diff --git a/Jenkinsfile b/Jenkinsfile
index cf5d8f3b63..50cd889087 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -3,6 +3,10 @@ pipeline {
label 'mm'
}
+ options {
+ ansiColor('xterm')
+ }
+
stages {
stage('Check formatting') {
steps {
diff --git a/Makefile b/Makefile
index 98aa5b1b47..c0569cbe13 100644
--- a/Makefile
+++ b/Makefile
@@ -133,6 +133,8 @@ ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*") $(shell fi
## Assets binaries (PNGs, JPGs, etc)
ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*")
+# Prevents building C files that will be #include'd
+ASSET_BIN_DIRS_C_FILES := $(shell find assets/* -type d -not -path "assets/xml*" -not -path "assets/code*" -not -path "assets/overlays*")
ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml))
ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin))
@@ -144,7 +146,7 @@ TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg))
TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \
$(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \
-C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS),$(wildcard $(dir)/*.c))
+C_FILES := $(foreach dir,$(SRC_DIRS) $(ASSET_BIN_DIRS_C_FILES),$(wildcard $(dir)/*.c))
S_FILES := $(shell grep -F "build/asm" spec | sed 's/.*build\/// ; s/\.o\".*/.s/') \
$(shell grep -F "build/data" spec | sed 's/.*build\/// ; s/\.o\".*/.s/')
BASEROM_FILES := $(shell grep -F "build/baserom" spec | sed 's/.*build\/// ; s/\.o\".*//')
@@ -174,7 +176,7 @@ build/src/libultra/flash/%.o: MIPS_VERSION := -mips1
build/src/code/audio/%.o: OPTFLAGS := -O2
-build/assets/%.o: OPTFLAGS :=
+build/assets/%.o: OPTFLAGS := -O1
# file flags
build/src/boot_O2_g3/fault.o: CFLAGS += -trapuv
@@ -205,6 +207,8 @@ build/src/overlays/fbdemos/%.o: CC := python3 tools/asm-processor/build.py $(CC)
build/src/overlays/gamestates/%.o: CC := python3 tools/asm-processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/overlays/kaleido_scope/%.o: CC := python3 tools/asm-processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
+build/assets/%.o: CC := python3 tools/asm-processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
+
#### Main Targets ###
uncompressed: $(ROM)
diff --git a/assets/xml/interface/nes_font_static.xml b/assets/xml/interface/nes_font_static.xml
new file mode 100644
index 0000000000..b021dbfdb3
--- /dev/null
+++ b/assets/xml/interface/nes_font_static.xml
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/interface/parameter_static.xml b/assets/xml/interface/parameter_static.xml
new file mode 100644
index 0000000000..33ab40de48
--- /dev/null
+++ b/assets/xml/interface/parameter_static.xml
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/interface/week_static.xml b/assets/xml/interface/week_static.xml
new file mode 100644
index 0000000000..6b21b80c0b
--- /dev/null
+++ b/assets/xml/interface/week_static.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_01.xml b/assets/xml/misc/scene_texture_01.xml
new file mode 100644
index 0000000000..edbb2d1c41
--- /dev/null
+++ b/assets/xml/misc/scene_texture_01.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_02.xml b/assets/xml/misc/scene_texture_02.xml
new file mode 100644
index 0000000000..a7219c31eb
--- /dev/null
+++ b/assets/xml/misc/scene_texture_02.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_03.xml b/assets/xml/misc/scene_texture_03.xml
new file mode 100644
index 0000000000..fcd10b9a97
--- /dev/null
+++ b/assets/xml/misc/scene_texture_03.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_04.xml b/assets/xml/misc/scene_texture_04.xml
new file mode 100644
index 0000000000..6faf681acb
--- /dev/null
+++ b/assets/xml/misc/scene_texture_04.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_05.xml b/assets/xml/misc/scene_texture_05.xml
new file mode 100644
index 0000000000..d9ae4f2c3c
--- /dev/null
+++ b/assets/xml/misc/scene_texture_05.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_06.xml b/assets/xml/misc/scene_texture_06.xml
new file mode 100644
index 0000000000..1a2dfc2a00
--- /dev/null
+++ b/assets/xml/misc/scene_texture_06.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_07.xml b/assets/xml/misc/scene_texture_07.xml
new file mode 100644
index 0000000000..22f445990f
--- /dev/null
+++ b/assets/xml/misc/scene_texture_07.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/assets/xml/misc/scene_texture_08.xml b/assets/xml/misc/scene_texture_08.xml
new file mode 100644
index 0000000000..31e5573479
--- /dev/null
+++ b/assets/xml/misc/scene_texture_08.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/misc/story_static.xml b/assets/xml/misc/story_static.xml
new file mode 100644
index 0000000000..d53f3f857f
--- /dev/null
+++ b/assets/xml/misc/story_static.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/gameplay_dangeon_keep.xml b/assets/xml/objects/gameplay_dangeon_keep.xml
index 8237f63804..70f9d606b1 100644
--- a/assets/xml/objects/gameplay_dangeon_keep.xml
+++ b/assets/xml/objects/gameplay_dangeon_keep.xml
@@ -50,8 +50,8 @@
-
-
+
+
diff --git a/assets/xml/objects/gameplay_field_keep.xml b/assets/xml/objects/gameplay_field_keep.xml
index 537d596a6b..a73a2f28db 100644
--- a/assets/xml/objects/gameplay_field_keep.xml
+++ b/assets/xml/objects/gameplay_field_keep.xml
@@ -26,12 +26,12 @@
-
-
-
+
+
+
-
+
diff --git a/assets/xml/objects/gameplay_keep.xml b/assets/xml/objects/gameplay_keep.xml
index 5e5b9b4f5c..265f1d5601 100644
--- a/assets/xml/objects/gameplay_keep.xml
+++ b/assets/xml/objects/gameplay_keep.xml
@@ -873,14 +873,17 @@
-
-
+
+
+
+
+
-
-
+
+
@@ -889,16 +892,16 @@
-
+
-
+
-
+
@@ -932,7 +935,7 @@
-
+
@@ -996,7 +999,7 @@
-
+
@@ -1038,15 +1041,15 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -1313,15 +1316,18 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -1399,14 +1405,14 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_am.xml b/assets/xml/objects/object_am.xml
index c135b7b0b6..b0737cb50a 100644
--- a/assets/xml/objects/object_am.xml
+++ b/assets/xml/objects/object_am.xml
@@ -1,8 +1,8 @@
-
-
+
+
@@ -21,21 +21,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_ani.xml b/assets/xml/objects/object_ani.xml
index 85fd13cecd..f039e01140 100644
--- a/assets/xml/objects/object_ani.xml
+++ b/assets/xml/objects/object_ani.xml
@@ -1,61 +1,67 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_bba.xml b/assets/xml/objects/object_bba.xml
index b172e9f770..144c685e43 100644
--- a/assets/xml/objects/object_bba.xml
+++ b/assets/xml/objects/object_bba.xml
@@ -1,56 +1,82 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_bdoor.xml b/assets/xml/objects/object_bdoor.xml
index d74f4aa575..a57339f3b3 100644
--- a/assets/xml/objects/object_bdoor.xml
+++ b/assets/xml/objects/object_bdoor.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/assets/xml/objects/object_bg.xml b/assets/xml/objects/object_bg.xml
index d623f9455a..554047b443 100644
--- a/assets/xml/objects/object_bg.xml
+++ b/assets/xml/objects/object_bg.xml
@@ -74,7 +74,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_bigokuta.xml b/assets/xml/objects/object_bigokuta.xml
index b6783c15d4..653853c928 100644
--- a/assets/xml/objects/object_bigokuta.xml
+++ b/assets/xml/objects/object_bigokuta.xml
@@ -1,58 +1,58 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_bigpo.xml b/assets/xml/objects/object_bigpo.xml
index c41d5ff793..531a151c6a 100644
--- a/assets/xml/objects/object_bigpo.xml
+++ b/assets/xml/objects/object_bigpo.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_bigslime.xml b/assets/xml/objects/object_bigslime.xml
index 18b7025061..5b7530addf 100644
--- a/assets/xml/objects/object_bigslime.xml
+++ b/assets/xml/objects/object_bigslime.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_bji.xml b/assets/xml/objects/object_bji.xml
index e8c7fe9496..cd953541c1 100644
--- a/assets/xml/objects/object_bji.xml
+++ b/assets/xml/objects/object_bji.xml
@@ -31,10 +31,11 @@
-
+
-
+
+
diff --git a/assets/xml/objects/object_boj.xml b/assets/xml/objects/object_boj.xml
index d948ff5464..e59c72027b 100644
--- a/assets/xml/objects/object_boj.xml
+++ b/assets/xml/objects/object_boj.xml
@@ -3,16 +3,16 @@
-
-
+
+
-
-
-
+
+
+
@@ -20,7 +20,9 @@
-
+
+
+
@@ -49,7 +51,7 @@
-
+
@@ -73,7 +75,7 @@
-
+
diff --git a/assets/xml/objects/object_boss02.xml b/assets/xml/objects/object_boss02.xml
index f944de2421..fee15d4a06 100644
--- a/assets/xml/objects/object_boss02.xml
+++ b/assets/xml/objects/object_boss02.xml
@@ -8,7 +8,7 @@
-
+
@@ -17,7 +17,7 @@
-
+
@@ -33,7 +33,7 @@
-
+
diff --git a/assets/xml/objects/object_boss03.xml b/assets/xml/objects/object_boss03.xml
index 14d7d3498e..5cf4ad2b8a 100644
--- a/assets/xml/objects/object_boss03.xml
+++ b/assets/xml/objects/object_boss03.xml
@@ -1,93 +1,138 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_boss_hakugin.xml b/assets/xml/objects/object_boss_hakugin.xml
index 05302db78d..52a124fec1 100644
--- a/assets/xml/objects/object_boss_hakugin.xml
+++ b/assets/xml/objects/object_boss_hakugin.xml
@@ -33,7 +33,7 @@
-
+
diff --git a/assets/xml/objects/object_cne.xml b/assets/xml/objects/object_cne.xml
index 72447ceec5..fccbf539f5 100644
--- a/assets/xml/objects/object_cne.xml
+++ b/assets/xml/objects/object_cne.xml
@@ -1,47 +1,54 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_cow.xml b/assets/xml/objects/object_cow.xml
index b440573447..535d5dd85b 100644
--- a/assets/xml/objects/object_cow.xml
+++ b/assets/xml/objects/object_cow.xml
@@ -1,38 +1,57 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_ctower_rot.xml b/assets/xml/objects/object_ctower_rot.xml
index 515b4fa65e..3a04c474e9 100644
--- a/assets/xml/objects/object_ctower_rot.xml
+++ b/assets/xml/objects/object_ctower_rot.xml
@@ -1,63 +1,100 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_dmask.xml b/assets/xml/objects/object_dmask.xml
index f2411c147c..a7b3874ec7 100644
--- a/assets/xml/objects/object_dmask.xml
+++ b/assets/xml/objects/object_dmask.xml
@@ -2,15 +2,18 @@
-
+
+
-
+
+
-
+
+
@@ -19,6 +22,7 @@
-
+
+
diff --git a/assets/xml/objects/object_dnk.xml b/assets/xml/objects/object_dnk.xml
index 209742fe18..0d290f19de 100644
--- a/assets/xml/objects/object_dnk.xml
+++ b/assets/xml/objects/object_dnk.xml
@@ -9,7 +9,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_dnp.xml b/assets/xml/objects/object_dnp.xml
index 0f5655e9b6..575ae3d698 100644
--- a/assets/xml/objects/object_dnp.xml
+++ b/assets/xml/objects/object_dnp.xml
@@ -52,7 +52,10 @@
-
+
+
+
+
diff --git a/assets/xml/objects/object_dns.xml b/assets/xml/objects/object_dns.xml
index 64939670e3..d42f68f54a 100644
--- a/assets/xml/objects/object_dns.xml
+++ b/assets/xml/objects/object_dns.xml
@@ -1,42 +1,45 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " Format="rgba16" Width="8" Height="8" Offset="0x28E8" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_dor02.xml b/assets/xml/objects/object_dor02.xml
index 0b64a9b1bd..c60fa9ba98 100644
--- a/assets/xml/objects/object_dor02.xml
+++ b/assets/xml/objects/object_dor02.xml
@@ -1,7 +1,7 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_dor03.xml b/assets/xml/objects/object_dor03.xml
index c374837eaf..941fa6fcc1 100644
--- a/assets/xml/objects/object_dor03.xml
+++ b/assets/xml/objects/object_dor03.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/assets/xml/objects/object_dor04.xml b/assets/xml/objects/object_dor04.xml
index 2d1ac5611d..394f5a6fe0 100644
--- a/assets/xml/objects/object_dor04.xml
+++ b/assets/xml/objects/object_dor04.xml
@@ -1,7 +1,7 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_dy_obj.xml b/assets/xml/objects/object_dy_obj.xml
index dc2ab5ed41..7de69f2ff3 100644
--- a/assets/xml/objects/object_dy_obj.xml
+++ b/assets/xml/objects/object_dy_obj.xml
@@ -15,6 +15,9 @@
+
+
+
diff --git a/assets/xml/objects/object_f52_obj.xml b/assets/xml/objects/object_f52_obj.xml
index 7f35d8b1bb..f80b676964 100644
--- a/assets/xml/objects/object_f52_obj.xml
+++ b/assets/xml/objects/object_f52_obj.xml
@@ -1,11 +1,11 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_fall.xml b/assets/xml/objects/object_fall.xml
index 5a90c5a243..47fa1da705 100644
--- a/assets/xml/objects/object_fall.xml
+++ b/assets/xml/objects/object_fall.xml
@@ -1,31 +1,56 @@
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ \
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_fall2.xml b/assets/xml/objects/object_fall2.xml
index e616de260d..4e58e9fd3e 100644
--- a/assets/xml/objects/object_fall2.xml
+++ b/assets/xml/objects/object_fall2.xml
@@ -1,12 +1,16 @@
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_fr.xml b/assets/xml/objects/object_fr.xml
index b1d284de9f..cf65cc0ac2 100644
--- a/assets/xml/objects/object_fr.xml
+++ b/assets/xml/objects/object_fr.xml
@@ -11,7 +11,8 @@
-
+
+
diff --git a/assets/xml/objects/object_fsn.xml b/assets/xml/objects/object_fsn.xml
index f2d4b36485..7c3d0beb2a 100644
--- a/assets/xml/objects/object_fsn.xml
+++ b/assets/xml/objects/object_fsn.xml
@@ -31,13 +31,15 @@
-
+
-
+
+
+
@@ -53,7 +55,8 @@
-
+
+
diff --git a/assets/xml/objects/object_fu.xml b/assets/xml/objects/object_fu.xml
index 83d2f9eff9..fe847642e7 100644
--- a/assets/xml/objects/object_fu.xml
+++ b/assets/xml/objects/object_fu.xml
@@ -27,7 +27,10 @@
-
+
+
+
+
diff --git a/assets/xml/objects/object_giant.xml b/assets/xml/objects/object_giant.xml
index edaeee0398..8698d176b0 100644
--- a/assets/xml/objects/object_giant.xml
+++ b/assets/xml/objects/object_giant.xml
@@ -51,24 +51,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/assets/xml/objects/object_gmo.xml b/assets/xml/objects/object_gmo.xml
index 4884d79190..7490a661e5 100644
--- a/assets/xml/objects/object_gmo.xml
+++ b/assets/xml/objects/object_gmo.xml
@@ -1,15 +1,16 @@
+
-
+
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_hanareyama_obj.xml b/assets/xml/objects/object_hanareyama_obj.xml
index ba213a5856..62cf675402 100644
--- a/assets/xml/objects/object_hanareyama_obj.xml
+++ b/assets/xml/objects/object_hanareyama_obj.xml
@@ -1,7 +1,6 @@
-
-
+
@@ -59,7 +58,12 @@
-
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_in.xml b/assets/xml/objects/object_in.xml
index 07969fe80f..42bace14f8 100644
--- a/assets/xml/objects/object_in.xml
+++ b/assets/xml/objects/object_in.xml
@@ -6,8 +6,8 @@
-
-
+
+
@@ -17,9 +17,10 @@
-
+
-
+
+
diff --git a/assets/xml/objects/object_in2.xml b/assets/xml/objects/object_in2.xml
index 34a942882a..a47c7613ea 100644
--- a/assets/xml/objects/object_in2.xml
+++ b/assets/xml/objects/object_in2.xml
@@ -21,15 +21,15 @@
-
+
-
+
-
+
@@ -37,9 +37,9 @@
-
+
-
+
diff --git a/assets/xml/objects/object_jg.xml b/assets/xml/objects/object_jg.xml
index 10253e155d..17889995fd 100644
--- a/assets/xml/objects/object_jg.xml
+++ b/assets/xml/objects/object_jg.xml
@@ -1,100 +1,118 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_kaizoku_obj.xml b/assets/xml/objects/object_kaizoku_obj.xml
index a38d16827b..8dd96770a0 100644
--- a/assets/xml/objects/object_kaizoku_obj.xml
+++ b/assets/xml/objects/object_kaizoku_obj.xml
@@ -28,8 +28,8 @@
-
-
+
+
diff --git a/assets/xml/objects/object_knight.xml b/assets/xml/objects/object_knight.xml
index bbd2d7b939..67d87a0ffd 100644
--- a/assets/xml/objects/object_knight.xml
+++ b/assets/xml/objects/object_knight.xml
@@ -98,6 +98,9 @@
+
+
+
diff --git a/assets/xml/objects/object_lightswitch.xml b/assets/xml/objects/object_lightswitch.xml
index 3d5c3aee2b..0a374033b6 100644
--- a/assets/xml/objects/object_lightswitch.xml
+++ b/assets/xml/objects/object_lightswitch.xml
@@ -3,7 +3,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_lodmoon.xml b/assets/xml/objects/object_lodmoon.xml
index 46d9f8e72b..0756c3300a 100644
--- a/assets/xml/objects/object_lodmoon.xml
+++ b/assets/xml/objects/object_lodmoon.xml
@@ -1,12 +1,13 @@
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_ma1.xml b/assets/xml/objects/object_ma1.xml
index 98444a884c..7001eb84ac 100644
--- a/assets/xml/objects/object_ma1.xml
+++ b/assets/xml/objects/object_ma1.xml
@@ -1,13 +1,13 @@
-
+
-
+
-
+
@@ -54,7 +54,15 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_ma2.xml b/assets/xml/objects/object_ma2.xml
index 523dfe212c..a6554d3875 100644
--- a/assets/xml/objects/object_ma2.xml
+++ b/assets/xml/objects/object_ma2.xml
@@ -6,7 +6,7 @@
-
+
@@ -48,7 +48,16 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_mag.xml b/assets/xml/objects/object_mag.xml
index 1feae8057c..29d30daad7 100644
--- a/assets/xml/objects/object_mag.xml
+++ b/assets/xml/objects/object_mag.xml
@@ -1,22 +1,25 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_mbar_obj.xml b/assets/xml/objects/object_mbar_obj.xml
index d69d7ce3b1..b1a816f47b 100644
--- a/assets/xml/objects/object_mbar_obj.xml
+++ b/assets/xml/objects/object_mbar_obj.xml
@@ -5,6 +5,6 @@
-
+
diff --git a/assets/xml/objects/object_mm.xml b/assets/xml/objects/object_mm.xml
index 3ce9c1925c..43c0e9b194 100644
--- a/assets/xml/objects/object_mm.xml
+++ b/assets/xml/objects/object_mm.xml
@@ -12,7 +12,8 @@
-
+
+
diff --git a/assets/xml/objects/object_moonston.xml b/assets/xml/objects/object_moonston.xml
index cc06a96323..58a9205225 100644
--- a/assets/xml/objects/object_moonston.xml
+++ b/assets/xml/objects/object_moonston.xml
@@ -1,9 +1,13 @@
+
-
-
-
-
-
+
+
+
+
+
diff --git a/assets/xml/objects/object_mtoride.xml b/assets/xml/objects/object_mtoride.xml
index ab07928391..a795477300 100644
--- a/assets/xml/objects/object_mtoride.xml
+++ b/assets/xml/objects/object_mtoride.xml
@@ -31,7 +31,7 @@
-
+
@@ -40,7 +40,7 @@
-
+
diff --git a/assets/xml/objects/object_niw.xml b/assets/xml/objects/object_niw.xml
index f97b5d7261..b055a27409 100644
--- a/assets/xml/objects/object_niw.xml
+++ b/assets/xml/objects/object_niw.xml
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/assets/xml/objects/object_numa_obj.xml b/assets/xml/objects/object_numa_obj.xml
index cc36fa1b80..a450cf11a2 100644
--- a/assets/xml/objects/object_numa_obj.xml
+++ b/assets/xml/objects/object_numa_obj.xml
@@ -1,4 +1,5 @@
+
@@ -11,27 +12,30 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_obj_milk_bin.xml b/assets/xml/objects/object_obj_milk_bin.xml
index 4a0ca700bb..70daa61722 100644
--- a/assets/xml/objects/object_obj_milk_bin.xml
+++ b/assets/xml/objects/object_obj_milk_bin.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/assets/xml/objects/object_obj_tokeidai.xml b/assets/xml/objects/object_obj_tokeidai.xml
index 9141b67ff3..09e0702540 100644
--- a/assets/xml/objects/object_obj_tokeidai.xml
+++ b/assets/xml/objects/object_obj_tokeidai.xml
@@ -1,59 +1,81 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_owl.xml b/assets/xml/objects/object_owl.xml
index b35f38b0f9..381c0bfd0e 100644
--- a/assets/xml/objects/object_owl.xml
+++ b/assets/xml/objects/object_owl.xml
@@ -29,7 +29,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_oyu.xml b/assets/xml/objects/object_oyu.xml
index aa762ce592..78cc8b34d9 100644
--- a/assets/xml/objects/object_oyu.xml
+++ b/assets/xml/objects/object_oyu.xml
@@ -4,6 +4,6 @@
-
+
diff --git a/assets/xml/objects/object_pamera.xml b/assets/xml/objects/object_pamera.xml
index 901a7523bc..6ce4c5219c 100644
--- a/assets/xml/objects/object_pamera.xml
+++ b/assets/xml/objects/object_pamera.xml
@@ -26,7 +26,13 @@
-
+
+
+
+
+
+
+
@@ -55,17 +61,17 @@
-
+
-
-
+
+
-
-
+
+
-
+
diff --git a/assets/xml/objects/object_rd.xml b/assets/xml/objects/object_rd.xml
index d9087282aa..854ded388c 100644
--- a/assets/xml/objects/object_rd.xml
+++ b/assets/xml/objects/object_rd.xml
@@ -1,114 +1,114 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_sdn.xml b/assets/xml/objects/object_sdn.xml
index 9cc607047c..691a272eef 100644
--- a/assets/xml/objects/object_sdn.xml
+++ b/assets/xml/objects/object_sdn.xml
@@ -1,66 +1,66 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_sek.xml b/assets/xml/objects/object_sek.xml
index e37af43802..3529620aa7 100644
--- a/assets/xml/objects/object_sek.xml
+++ b/assets/xml/objects/object_sek.xml
@@ -1,6 +1,6 @@
-
+
@@ -11,7 +11,7 @@
-
+
diff --git a/assets/xml/objects/object_shn.xml b/assets/xml/objects/object_shn.xml
index 78cc77ca71..b322641a9e 100644
--- a/assets/xml/objects/object_shn.xml
+++ b/assets/xml/objects/object_shn.xml
@@ -18,7 +18,9 @@
-
+
+
+
@@ -83,7 +85,8 @@
-
+
+
diff --git a/assets/xml/objects/object_st.xml b/assets/xml/objects/object_st.xml
index a7ce1418df..011d76449c 100644
--- a/assets/xml/objects/object_st.xml
+++ b/assets/xml/objects/object_st.xml
@@ -22,8 +22,8 @@
-
-
+
+
diff --git a/assets/xml/objects/object_syokudai.xml b/assets/xml/objects/object_syokudai.xml
index 83e4c34f33..01ab0ef908 100644
--- a/assets/xml/objects/object_syokudai.xml
+++ b/assets/xml/objects/object_syokudai.xml
@@ -1,8 +1,8 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_tite.xml b/assets/xml/objects/object_tite.xml
index 2d57d1b47d..eec5b05d0d 100644
--- a/assets/xml/objects/object_tite.xml
+++ b/assets/xml/objects/object_tite.xml
@@ -8,10 +8,14 @@
-
+
+
+
-
+
+
+
diff --git a/assets/xml/objects/object_tk.xml b/assets/xml/objects/object_tk.xml
index 506f9b00af..813b0fb24e 100644
--- a/assets/xml/objects/object_tk.xml
+++ b/assets/xml/objects/object_tk.xml
@@ -12,7 +12,9 @@
-
+
+
+
diff --git a/assets/xml/objects/object_tokei_step.xml b/assets/xml/objects/object_tokei_step.xml
index ecdf14ac38..aac4b5ea91 100644
--- a/assets/xml/objects/object_tokei_step.xml
+++ b/assets/xml/objects/object_tokei_step.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/objects/object_uch.xml b/assets/xml/objects/object_uch.xml
index de16b0d7b8..86f2a4646e 100644
--- a/assets/xml/objects/object_uch.xml
+++ b/assets/xml/objects/object_uch.xml
@@ -3,7 +3,7 @@
-
+
diff --git a/assets/xml/objects/object_wdor04.xml b/assets/xml/objects/object_wdor04.xml
index 040df15980..07ad601dd2 100644
--- a/assets/xml/objects/object_wdor04.xml
+++ b/assets/xml/objects/object_wdor04.xml
@@ -1,7 +1,7 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_wdor05.xml b/assets/xml/objects/object_wdor05.xml
index f8fda23221..6eb0f4ed08 100644
--- a/assets/xml/objects/object_wdor05.xml
+++ b/assets/xml/objects/object_wdor05.xml
@@ -1,7 +1,7 @@
-
-
-
+
+
+
diff --git a/assets/xml/objects/object_wf.xml b/assets/xml/objects/object_wf.xml
index 98dd21ed58..56c9e1621a 100644
--- a/assets/xml/objects/object_wf.xml
+++ b/assets/xml/objects/object_wf.xml
@@ -5,7 +5,7 @@
-
+
@@ -20,7 +20,8 @@
-
+
+
@@ -67,13 +68,14 @@
-
+
-
+
+
diff --git a/assets/xml/objects/object_yb.xml b/assets/xml/objects/object_yb.xml
index 8cf61e347c..1a8503a6e9 100644
--- a/assets/xml/objects/object_yb.xml
+++ b/assets/xml/objects/object_yb.xml
@@ -1,57 +1,61 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_zm.xml b/assets/xml/objects/object_zm.xml
index c5511f6b2e..022efcf279 100644
--- a/assets/xml/objects/object_zm.xml
+++ b/assets/xml/objects/object_zm.xml
@@ -28,7 +28,7 @@
-
+
@@ -36,7 +36,8 @@
-
+
+
diff --git a/assets/xml/objects/object_zo.xml b/assets/xml/objects/object_zo.xml
index 4462024438..f0926dd2b1 100644
--- a/assets/xml/objects/object_zo.xml
+++ b/assets/xml/objects/object_zo.xml
@@ -1,65 +1,67 @@
-
-
-
-
-
+
+
+
+
+
-
+
-
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/objects/object_zoraegg.xml b/assets/xml/objects/object_zoraegg.xml
index c527fe618a..0835e26989 100644
--- a/assets/xml/objects/object_zoraegg.xml
+++ b/assets/xml/objects/object_zoraegg.xml
@@ -11,10 +11,11 @@
-
+
-
+
+
diff --git a/assets/xml/objects/object_zos.xml b/assets/xml/objects/object_zos.xml
index 7a25eb338d..5af477773f 100644
--- a/assets/xml/objects/object_zos.xml
+++ b/assets/xml/objects/object_zos.xml
@@ -35,7 +35,10 @@
-
+
+
+
+
diff --git a/assets/xml/objects/object_zov.xml b/assets/xml/objects/object_zov.xml
index 17d6382a95..e485291b3b 100644
--- a/assets/xml/objects/object_zov.xml
+++ b/assets/xml/objects/object_zov.xml
@@ -37,15 +37,17 @@
-
+
-
+
-
+
+
-
+
+
diff --git a/assets/xml/overlays/ovl_Arrow_Ice.xml b/assets/xml/overlays/ovl_Arrow_Ice.xml
index 96c0f25220..9ac5d04e07 100644
--- a/assets/xml/overlays/ovl_Arrow_Ice.xml
+++ b/assets/xml/overlays/ovl_Arrow_Ice.xml
@@ -1,11 +1,12 @@
+
-
-
-
+
+
+
-
-
+
+
diff --git a/assets/xml/overlays/ovl_Dm_Char01.xml b/assets/xml/overlays/ovl_Dm_Char01.xml
new file mode 100644
index 0000000000..3f855c3764
--- /dev/null
+++ b/assets/xml/overlays/ovl_Dm_Char01.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/assets/xml/overlays/ovl_En_Bom.xml b/assets/xml/overlays/ovl_En_Bom.xml
new file mode 100644
index 0000000000..08902add6f
--- /dev/null
+++ b/assets/xml/overlays/ovl_En_Bom.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/overlays/ovl_En_Bom_Bowl_Man.xml b/assets/xml/overlays/ovl_En_Bom_Bowl_Man.xml
new file mode 100644
index 0000000000..7e0b6d08b1
--- /dev/null
+++ b/assets/xml/overlays/ovl_En_Bom_Bowl_Man.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/assets/xml/overlays/ovl_En_Sth.xml b/assets/xml/overlays/ovl_En_Sth.xml
new file mode 100644
index 0000000000..80393fc2d4
--- /dev/null
+++ b/assets/xml/overlays/ovl_En_Sth.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml b/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml
index 58d50ee839..3cf73a2559 100644
--- a/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml
+++ b/assets/xml/scenes/Z2_00KEIKOKU/Z2_00KEIKOKU.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml b/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml
index c48cb9646c..9676cbc39e 100644
--- a/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml
+++ b/assets/xml/scenes/Z2_10YUKIYAMANOMURA/Z2_10YUKIYAMANOMURA.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml b/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml
index 565dcc06c8..943e58e580 100644
--- a/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml
+++ b/assets/xml/scenes/Z2_10YUKIYAMANOMURA2/Z2_10YUKIYAMANOMURA2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml b/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml
index 2a948603b3..986823c906 100644
--- a/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml
+++ b/assets/xml/scenes/Z2_11GORONNOSATO/Z2_11GORONNOSATO.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml b/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml
index 40e82522fb..9e69251315 100644
--- a/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml
+++ b/assets/xml/scenes/Z2_11GORONNOSATO2/Z2_11GORONNOSATO2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml b/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml
index ca23dfa17f..740f6a15a1 100644
--- a/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml
+++ b/assets/xml/scenes/Z2_12HAKUGINMAE/Z2_12HAKUGINMAE.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml b/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml
index 2165e80f5c..6c368004f9 100644
--- a/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml
+++ b/assets/xml/scenes/Z2_14YUKIDAMANOMITI/Z2_14YUKIDAMANOMITI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml b/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml
index b5b9f6d773..ed6beb36e0 100644
--- a/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml
+++ b/assets/xml/scenes/Z2_17SETUGEN/Z2_17SETUGEN.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml b/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml
index 357c0b8979..1ac9488d77 100644
--- a/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml
+++ b/assets/xml/scenes/Z2_17SETUGEN2/Z2_17SETUGEN2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml b/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml
index 73c697f167..d144c9e8ef 100644
--- a/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml
+++ b/assets/xml/scenes/Z2_20SICHITAI/Z2_20SICHITAI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml b/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml
index fca3e68463..1449146210 100644
--- a/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml
+++ b/assets/xml/scenes/Z2_20SICHITAI2/Z2_20SICHITAI2.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml b/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml
index 1db584d584..77f382ecce 100644
--- a/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml
+++ b/assets/xml/scenes/Z2_22DEKUCITY/Z2_22DEKUCITY.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml b/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml
index eb4b353dbb..f6c852dc9b 100644
--- a/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml
+++ b/assets/xml/scenes/Z2_24KEMONOMITI/Z2_24KEMONOMITI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml b/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml
index 5055f4ff3d..83e3627422 100644
--- a/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml
+++ b/assets/xml/scenes/Z2_26SARUNOMORI/Z2_26SARUNOMORI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml b/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml
index eca5397421..f24a372540 100644
--- a/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml
+++ b/assets/xml/scenes/Z2_30GYOSON/Z2_30GYOSON.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml b/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml
index 918dc1cebc..afd35a8177 100644
--- a/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml
+++ b/assets/xml/scenes/Z2_31MISAKI/Z2_31MISAKI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml b/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml
index c757263f35..3b03e8e5e0 100644
--- a/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml
+++ b/assets/xml/scenes/Z2_AYASHIISHOP/Z2_AYASHIISHOP.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml b/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml
index 00e6702fae..a6b7a1a6ac 100644
--- a/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml
+++ b/assets/xml/scenes/Z2_DOUJOU/Z2_DOUJOU.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml b/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml
index 6e73abc32a..158669f8f7 100644
--- a/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml
+++ b/assets/xml/scenes/Z2_KAJIYA/Z2_KAJIYA.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_LOST_WOODS/Z2_LOST_WOODS.xml b/assets/xml/scenes/Z2_LOST_WOODS/Z2_LOST_WOODS.xml
index 066cbe10e4..0c41a1b29d 100644
--- a/assets/xml/scenes/Z2_LOST_WOODS/Z2_LOST_WOODS.xml
+++ b/assets/xml/scenes/Z2_LOST_WOODS/Z2_LOST_WOODS.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml b/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml
index e49402a101..3ef6123814 100644
--- a/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml
+++ b/assets/xml/scenes/Z2_ROMANYMAE/Z2_ROMANYMAE.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml b/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml
index d2f362453a..6a3df8b2e7 100644
--- a/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml
+++ b/assets/xml/scenes/Z2_SINKAI/Z2_SINKAI.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml b/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml
index 36168378be..72f4766314 100644
--- a/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml
+++ b/assets/xml/scenes/Z2_SONCHONOIE/Z2_SONCHONOIE.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml b/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml
index c8e4a16c26..4003e785da 100644
--- a/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml
+++ b/assets/xml/scenes/Z2_TORIDE/Z2_TORIDE.xml
@@ -1,4 +1,5 @@
+
diff --git a/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml b/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml
index 9a2ad70805..03801385cf 100644
--- a/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml
+++ b/assets/xml/scenes/Z2_YADOYA/Z2_YADOYA.xml
@@ -1,4 +1,5 @@
+
diff --git a/docs/tutorial/beginning_decomp.md b/docs/tutorial/beginning_decomp.md
index 01cc21cf3b..13e5941fce 100644
--- a/docs/tutorial/beginning_decomp.md
+++ b/docs/tutorial/beginning_decomp.md
@@ -1,6 +1,6 @@
# Beginning decompilation: the Init function and the Actor struct
-Up: [Contents](contents.md)
+- 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 EnRecepgirl (the rather forward Mayor's receptionist in the Mayor's residence in East Clock Town) as our example: it is a nice simple NPC with most of the common features of an NPC.
@@ -96,9 +96,9 @@ It is currently divided into six sections as follows:
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.
-5. `if`'d-out section containing the `InitVars` and a few other common pieces of data. This can be ignored until we import the data.
+4. `if`'d-out section containing the `InitVars` and a few other common pieces of data. This can be ignored until we import the data.
-4. A set of `extern`s. These refer to the data in the previous section, and, data that comes from other files, usually in the actor's corresponding object file. The latter 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). 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. A set of `extern`s. These refer to the data in the previous section, and, data that comes from other files, usually in the actor's corresponding object file. The latter point to addresses in the ROM where assets are stored (usually collision data, animations or display lists). These can simply be replaced by including the object file (see [Object Decompilation](object_decomp.md) for how this process works).
6. List of functions. Each `#pragma GLOBAL_ASM` 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.
@@ -397,7 +397,7 @@ An actor with SkelAnime has three structs in the Actor struct that handle it: on
There are two different sorts of SkelAnime, although for decompilation purposes there is not much difference between them. Looking at the prototype of `SkelAnime_InitFlex` from `functions.h` (or even the definition in `z_skelanime.c`),
```C
void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
- AnimationHeader* animationSeg, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount);
+ AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount);
```
we can read off the types of the various arguments:
- The `SkelAnime` struct is at `this + 0x144`
diff --git a/docs/tutorial/contents.md b/docs/tutorial/contents.md
index 227f4fc7d4..0435becb43 100644
--- a/docs/tutorial/contents.md
+++ b/docs/tutorial/contents.md
@@ -32,7 +32,9 @@
- Fake symbols
- Inlining
-## [Object Decompilation](object_decomp.md) (TODO)
+- [Documenting a decompiled file](documenting.md)
+
+## [Object Decompilation](object_decomp.md)
- Object files
- How we decompile objects
diff --git a/docs/tutorial/data.md b/docs/tutorial/data.md
index ae856123e9..972451b07b 100644
--- a/docs/tutorial/data.md
+++ b/docs/tutorial/data.md
@@ -1,13 +1,13 @@
# Data
-Up: [Contents](contents.md)
-Previous: [Draw functions](draw_functions.md)
+- Up: [Contents](contents.md)
+- Previous: [Draw functions](draw_functions.md)
## Table of Contents
- [Data first](#data-first)
- [Extern and data last](#extern-and-data-last)
-- [Segmented pointers](#segmented-pointers)
+- [Segmented pointers and object symbols](#segmented-pointers-and-object-symbols)
- [Fake symbols](#fake-symbols)
- [Inlining](#inlining)
@@ -114,7 +114,7 @@ static s32 D_80C106C8 = 0;
That should be everything, and we should now be able to `make` without the data file with no issues.
-## Segmented pointers
+## Segmented pointers and object symbols
The game has a convenient system that allows it to sometimes effectively use offsets into a file instead of raw memory addresses to reference things. This is done by setting a file address to a *segment*. A segmented address is of the form `0x0XYYYYYY`, where `X` is the segment number. There are 16 available segments, and actors always set segment 6 to their object file, which is a file containing assets (skeleton, animations, textures, etc.) that they use. This is what all those `D_06...` are, and it is also what the entries in `D_80C106B0` are: they are currently raw numbers instead of symbols, though, and we would like to replace them.
@@ -124,29 +124,23 @@ mips-linux-gnu-ld: build/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.o:(
````
As we'd expect, of course: we didn't fulfil our promise that they were defined elsewhere.)
-This is mitigated by use of the file `undefined_syms.txt`, which feeds the linker the raw addresses to use as the symbol definitions. If you find a segmented address that is not in already externed, `extern` it at the top of the file and add it to the actor's section in undefined_syms:
-```C
-extern void* D_0600F8F0;
-extern void* D_0600FCF0;
-extern void* D_060100F0;
-extern void* D_0600FCF0;
+For actors which have yet to be decompiled, this is mitigated by use of the file `undefined_syms.txt`, which feeds the linker the raw addresses to use as the symbol definitions. However, we want to replace these segmented addresses with proper object symbols whenever possible. In `En_Recepgirl_InitVars`, we can see that this actor uses the object `OBJECT_BG`:
+```c
+const ActorInit En_Recepgirl_InitVars = {
+ ACTOR_EN_RECEPGIRL,
+ ACTORCAT_NPC,
+ FLAGS,
+ OBJECT_BG,
+};
+```
-static void* D_80C106B0[4] = { &D_0600F8F0, &D_0600FCF0, &D_060100F0, &D_0600FCF0 };
-```
-and in undefined_syms.txt:
-```
-// ovl_En_Recepgirl
-D_06000968 = 0x06000968;
-D_06001384 = 0x06001384;
-D_06009890 = 0x06009890;
-D_0600A280 = 0x0600A280;
-D_0600AD98 = 0x0600AD98;
-D_0600F8F0 = 0x0600F8F0;
-D_0600FCF0 = 0x0600FCF0;
-D_060100F0 = 0x060100F0;
-D_06011B60 = 0x06011B60;
+If we open up `assets/objects/object_bg.h`, we can see a bunch of different names corresponding to every asset in the object. You may notice that some of these names look a bit familiar; `object_bg_Tex_00F8F0` seems very close to the segmented address `(void*)0x600F8F0`. This is the proper object symbol for this segmented address, so we should `#include` this header in our actor and use these object symbols like so:
+```c
+static void* D_80C106B0[4] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, object_bg_Tex_00FCF0 };
```
+After replacing every segmented pointer with an object symbol, you should go ahead and delete every segmented pointer associated with this actor from `undefined_syms`.
+
We will come back and name these later when we do the object.
diff --git a/docs/tutorial/documenting.md b/docs/tutorial/documenting.md
index de82b54f93..b064b3e3b2 100644
--- a/docs/tutorial/documenting.md
+++ b/docs/tutorial/documenting.md
@@ -1,7 +1,7 @@
# Documenting
-Up: [Contents](contents.md)
-Previous: [Data](data.md)
+- Up: [Contents](contents.md)
+- Previous: [Data](data.md)
Decompilation is only the first step: since the point of this project is to understand the game better than ever before, the code needs documentation. In this document, we will go through the basic stuff that it's good to do for any actor: we will not try to understand every single thing the actor does in full detail, but try to name the functions and variables usefully for a full documentation pass later to take advantage of.
@@ -62,11 +62,7 @@ const ActorInit En_Recepgirl_InitVars = {
(ActorFunc)EnRecepgirl_Draw,
};
-extern void* D_0600F8F0;
-extern void* D_0600FCF0;
-extern void* D_060100F0;
-
-static void* D_80C106B0[4] = { &D_0600F8F0, &D_0600FCF0, &D_060100F0, &D_0600FCF0 };
+static void* D_80C106B0[4] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, object_bg_Tex_00FCF0 };
// static InitChainEntry sInitChain[] = {
static InitChainEntry D_80C106C0[] = {
@@ -76,14 +72,6 @@ static InitChainEntry D_80C106C0[] = {
static s32 D_80C106C8 = 0;
-extern AnimationHeader D_06000968;
-extern AnimationHeader D_06001384;
-extern AnimationHeader D_06009890;
-extern AnimationHeader D_0600A280;
-extern AnimationHeader D_0600AD98;
-extern FlexSkeletonHeader D_06011B60;
-
-
// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Recepgirl/EnRecepgirl_Init.s")
void EnRecepgirl_Init(Actor* thisx, GlobalContext* globalCtx) {
EnRecepgirl* this = THIS;
@@ -91,7 +79,7 @@ void EnRecepgirl_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, D_80C106C0);
ActorShape_Init(&this->actor.shape, -60.0f, NULL, 0.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011B60, &D_06009890, this->jointTable, this->morphTable, 24);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable, this->morphTable, 24);
if (D_80C106C8 == 0) {
for (i = 0; i < 4; i++) {
@@ -132,8 +120,8 @@ void func_80C100DC(EnRecepgirl *this) {
// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C10148.s")
void func_80C10148(EnRecepgirl *this) {
- if (this->skelAnime.animation == &D_06001384) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_001384) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
}
this->actionFunc = func_80C1019C;
}
@@ -141,10 +129,10 @@ void func_80C10148(EnRecepgirl *this) {
// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C1019C.s")
void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
} else {
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, -4.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, -4.0f);
}
}
@@ -164,7 +152,7 @@ void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) {
// #pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C10290.s")
void func_80C10290(EnRecepgirl *this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
this->actionFunc = func_80C102D4;
}
@@ -173,18 +161,18 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) {
u8 temp_v0_2;
if (SkelAnime_Update(&this->skelAnime) != 0) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_ChangeDefaultRepeat(&this->skelAnime, &D_06001384);
- } else if (this->skelAnime.animation == &D_0600AD98) {
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_ChangeDefaultRepeat(&this->skelAnime, &object_bg_Anim_001384);
+ } else if (this->skelAnime.animation == &object_bg_Anim_00AD98) {
if (this->actor.textId == 0x2ADA) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
} else {
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
}
} else if (this->actor.textId == 0x2ADA) {
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
}
}
@@ -198,17 +186,17 @@ void func_80C102D4(EnRecepgirl *this, GlobalContext *globalCtx) {
if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) {
if (this->actor.textId == 0x2AD9) {
Flags_SetSwitch(globalCtx, this->actor.params);
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
if ((gSaveContext.weekEventReg[63] & 0x80)) {
this->actor.textId = 0x2ADF;
} else {
this->actor.textId = 0x2ADA;
}
} else if (this->actor.textId == 0x2ADC) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
this->actor.textId = 0x2ADD;
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
if (this->actor.textId == 0x2ADD) {
this->actor.textId = 0x2ADE;
} else if (this->actor.textId == 0x2ADA) {
@@ -262,7 +250,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -273,7 +261,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
(We can delete the `GLOBAL_ASM` lines now.)
-The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_UnkLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
+The worst part of documentation is finding somewhere to start. We have a decent place to start here, though, in that we already know the function (or rather, the use) of a couple of the functions, namely the LimbDraws. So we can rename `func_80C10558` to `EnRecepgirl_OverrideLimbDraw` and `func_80C10590` to `EnRecepgirl_TransformLimbDraw`. Remember to do a global rename so that the functions in the assembly are renamed, use `rename_global_asm`,
```
$ ./tools/rename_global_asm.py
asm/non_matchings/overlays/ovl_En_Recepgirl/func_80C10558.s --> asm/non_matchings/overlays/ovl_En_Recepgirl/EnRecepgirl_OverrideLimbDraw.s
@@ -349,11 +337,9 @@ Go to "Analysis -> Find Dlists" and press OK (the defaults are usually fine). Th
We will talk about what all these types of data are next time, but for now, all we want to know is what
```C
-extern void* D_0600F8F0;
-extern void* D_0600FCF0;
-extern void* D_060100F0;
+static void* D_80C106B0[4] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, object_bg_Tex_00FCF0 };
```
-actually are. We know they are set on segment 8, so we need to find where the skeleton uses them. We know from `extern FlexSkeletonHeader D_06011B60;` that this is at `0x06011B60`, so scroll down to it, right-click on it, and choose "Open in Skeleton Viewer". Pick an animation that we know it uses (sometimes Z64Utils misidentifies other things for animations), such as `extern AnimationHeader D_06000968;`, and you will get this error:
+actually are. We know they are set on segment 8, so we need to find where the skeleton uses them. We know from `object_bg_Skel_011B60` that this is at `0x06011B60`, so scroll down to it, right-click on it, and choose "Open in Skeleton Viewer". Pick an animation that we know it uses (sometimes Z64Utils misidentifies other things for animations), such as `object_bg_Anim_000968`, and you will get this error:

@@ -389,11 +375,7 @@ But what sort of textures? This is an NPC, so what textures on the model would i
**N.B.** static data should not be renamed in the assembly or `variables.txt`, since assembly has no notion of file locality and there can be symbol clashes. Therefore it should only be renamed in its respective file, not globally.
```C
-extern void* D_0600F8F0;
-extern void* D_0600FCF0;
-extern void* D_060100F0;
-
-static TexturePtr sEyeTextures[] = { &D_0600F8F0, &D_0600FCF0, &D_060100F0, &D_0600FCF0 };
+static TexturePtr sEyeTextures[] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0, object_bg_Tex_00FCF0 };
```
And now it's rather more obvious what
@@ -461,18 +443,18 @@ Finally, we have to name the rest of the functions. Setup functions are usually
```C
void func_80C10148(EnRecepgirl* this) {
- if (this->skelAnime.animation == &D_06001384) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_001384) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
}
this->actionFunc = func_80C1019C;
}
void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
} else {
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, -4.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, -4.0f);
}
}
@@ -491,7 +473,7 @@ void func_80C1019C(EnRecepgirl* this, GlobalContext* globalCtx) {
}
void func_80C10290(EnRecepgirl* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
this->actionFunc = func_80C102D4;
}
@@ -499,18 +481,18 @@ void func_80C102D4(EnRecepgirl* this, GlobalContext* globalCtx) {
u8 temp_v0_2;
if (SkelAnime_Update(&this->skelAnime)) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_ChangeDefaultRepeat(&this->skelAnime, &D_06001384);
- } else if (this->skelAnime.animation == &D_0600AD98) {
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_ChangeDefaultRepeat(&this->skelAnime, &object_bg_Anim_001384);
+ } else if (this->skelAnime.animation == &object_bg_Anim_00AD98) {
if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing)
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
} else {
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
}
} else if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing)
- Animation_ChangeTransitionRepeat(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_ChangeTransitionRepeat(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
}
}
@@ -521,17 +503,17 @@ void func_80C102D4(EnRecepgirl* this, GlobalContext* globalCtx) {
} else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) {
if (this->actor.textId == 0x2AD9) { // "Welcome..."
Flags_SetSwitch(globalCtx, this->actor.params);
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
if (gSaveContext.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting
this->actor.textId = 0x2ADF; // Mayor's office is on the left (meeting ended)
} else {
this->actor.textId = 0x2ADA; // Mayor's office is on the left (meeting ongoing)
}
} else if (this->actor.textId == 0x2ADC) { // hear directions again?
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
this->actor.textId = 0x2ADD; // "So..."
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
if (this->actor.textId == 0x2ADD) { // "So..."
this->actor.textId = 0x2ADE; // Mayor's office is on the left, drawing room on the right
@@ -568,7 +550,7 @@ We like to make macros for reading an actor's `params` (indeed, this is required
} else {
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
- CollisionHeader_GetVirtual(&D_06001B2C, &colHeader);
+ CollisionHeader_GetVirtual(&object_tree_Colheader_001B2C, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
```
@@ -588,7 +570,7 @@ Notice that we use `thisx`: this makes the form of every one of these macros the
} else {
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
- CollisionHeader_GetVirtual(&D_06001B2C, &colHeader);
+ CollisionHeader_GetVirtual(&object_tree_Colheader_001B2C, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
```
diff --git a/docs/tutorial/draw_functions.md b/docs/tutorial/draw_functions.md
index 319d5efbb0..eae1c121e3 100644
--- a/docs/tutorial/draw_functions.md
+++ b/docs/tutorial/draw_functions.md
@@ -1,7 +1,7 @@
# Draw functions
-Up: [Contents](contents.md)
-Previous: [The rest of the functions in the actor](other_functions.md)
+- 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.
@@ -34,7 +34,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
sp30->polyOpa.p = temp_v1 + 8;
temp_v1->words.w0 = 0xDB060020;
temp_v1->words.w1 = (u32) D_80C106B0[this->unk_2AC];
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, (s32) this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, (Actor *) this);
}
```
@@ -107,7 +107,7 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, D_80C106B0[this->unk_2AC]);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, func_80C10558, NULL, func_80C10590, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -115,28 +115,28 @@ void EnRecepgirl_Draw(Actor *thisx, GlobalContext *globalCtx) {
And this matches.
-The last two functions in the actor are used as arguments in `func_801343C0`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
+The last two functions in the actor are used as arguments in `SkelAnime_DrawTransformFlexOpa`. This is a `SkelAnime` function, except unlike the OoT ones, it has three function callback arguments instead of two: in `functions.h` or `z_skelanime.c`, we find
```C
-void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
- OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkDraw, Actor* actor)
+void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
+ OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor)
```
The typedefs of the callbacks it uses are in `z64animation.h`:
```C
-typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- struct Actor* actor);
+typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ struct Actor* thisx);
-typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
- struct Actor* actor);
+typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
+ struct Actor* thisx);
[...]
-typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
+typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
```
which is where mips2c got them from.
In this case, only two of them are used, and it is these that are the last functions standing between us and a decompiled actor.
-## OverrideLimbDraw, PostLimbDraw, UnkActorDraw
+## OverrideLimbDraw, PostLimbDraw, TransformLimbDraw
Well, we don't have a PostLimbDraw here, but as we see from the prototype, it's much the same as the OverrideLimbDraw but without the `pos` argument and no return value.
```C
@@ -159,7 +159,7 @@ s32 func_80C10558(GlobalContext *globalCtx, s32 limbIndex, Gfx **dList, Vec3f *p
}
```
-As for the UnkActorDraw, it has a much simpler prototype. mips2c gives
+As for the TransformLimbDraw, it has a much simpler prototype. mips2c gives
```C
void func_80C10590(GlobalContext *globalCtx, s32 limbIndex, Actor *actor) {
if (limbIndex == 5) {
diff --git a/docs/tutorial/images/broken_texture.png b/docs/tutorial/images/broken_texture.png
new file mode 100644
index 0000000000..6f79f18725
Binary files /dev/null and b/docs/tutorial/images/broken_texture.png differ
diff --git a/docs/tutorial/images/custom_texture_in_game.png b/docs/tutorial/images/custom_texture_in_game.png
new file mode 100644
index 0000000000..92fa538117
Binary files /dev/null and b/docs/tutorial/images/custom_texture_in_game.png differ
diff --git a/docs/tutorial/images/dns_custom_texture.png b/docs/tutorial/images/dns_custom_texture.png
new file mode 100644
index 0000000000..3b8cf4d57c
Binary files /dev/null and b/docs/tutorial/images/dns_custom_texture.png differ
diff --git a/docs/tutorial/images/z64utils_dns_deku_flower.png b/docs/tutorial/images/z64utils_dns_deku_flower.png
new file mode 100644
index 0000000000..66b40a3fd3
Binary files /dev/null and b/docs/tutorial/images/z64utils_dns_deku_flower.png differ
diff --git a/docs/tutorial/images/z64utils_dns_display_list.png b/docs/tutorial/images/z64utils_dns_display_list.png
new file mode 100644
index 0000000000..31cbd57946
Binary files /dev/null and b/docs/tutorial/images/z64utils_dns_display_list.png differ
diff --git a/docs/tutorial/images/z64utils_dns_head_limb.png b/docs/tutorial/images/z64utils_dns_head_limb.png
new file mode 100644
index 0000000000..dcb658fe80
Binary files /dev/null and b/docs/tutorial/images/z64utils_dns_head_limb.png differ
diff --git a/docs/tutorial/images/z64utils_dns_limb_dlist.png b/docs/tutorial/images/z64utils_dns_limb_dlist.png
new file mode 100644
index 0000000000..0f24d02250
Binary files /dev/null and b/docs/tutorial/images/z64utils_dns_limb_dlist.png differ
diff --git a/docs/tutorial/images/z64utils_dns_skeletonheader.png b/docs/tutorial/images/z64utils_dns_skeletonheader.png
new file mode 100644
index 0000000000..4f02226739
Binary files /dev/null and b/docs/tutorial/images/z64utils_dns_skeletonheader.png differ
diff --git a/docs/tutorial/images/z64utils_open_dns.png b/docs/tutorial/images/z64utils_open_dns.png
new file mode 100644
index 0000000000..84533270e6
Binary files /dev/null and b/docs/tutorial/images/z64utils_open_dns.png differ
diff --git a/docs/tutorial/images/z64utils_set_segment_8.png b/docs/tutorial/images/z64utils_set_segment_8.png
new file mode 100644
index 0000000000..46b2f1cff5
Binary files /dev/null and b/docs/tutorial/images/z64utils_set_segment_8.png differ
diff --git a/docs/tutorial/merging.md b/docs/tutorial/merging.md
index 1d8c6ad1c2..79e1386cc3 100644
--- a/docs/tutorial/merging.md
+++ b/docs/tutorial/merging.md
@@ -1,7 +1,7 @@
# The merging process
-Up: [Contents](contents.md)
-Previous: [Documenting](documenting.md)
+- Up: [Contents](contents.md)
+- Previous: [Documenting](documenting.md)
## Preparing to PR
diff --git a/docs/tutorial/object_decomp.md b/docs/tutorial/object_decomp.md
index 88fe89eca0..f210dd4463 100644
--- a/docs/tutorial/object_decomp.md
+++ b/docs/tutorial/object_decomp.md
@@ -1,14 +1,160 @@
-# Analysing object files
+# Object Decompilation
-Up: [Contents](contents.md)
-Previous: [Documenting](documenting.md)
+- Up: [Contents](contents.md)
+- Previous: [Documenting](documenting.md)
-TODO: To be written once automated objects are present.
+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.
-## Useful tools
+## 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
+- Texture Animations (instructions to scroll/cycle textures or change colors)
+
+## How we work with objects
+
+These objects are considered assets so they are not included in the repository directly. Instead we use the Zelda Asset Processor for Decompilation (ZAPD) to extract them from the ROM. As input, ZAPD takes an XML file that describes what and how to extract. Each object already has an autogenerated XML created in the `assets/xml/objects` directory, though they are incomplete with just autogenerated names. The goal of object decompilation is to complete these files by identifying any remaining blobs and giving everything proper names.
+
+## 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
+
+All objects have had their XML generated in an automated way, so most constituent parts of each object are already identified, but will still need to be named and documented properly. Further, 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 all files that have been updated since the last time it was run. You can also 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
+
+You'll want to name everything that exists in the XML, but it helps to break it down into separate steps. After each step, extract the single asset again.
+
+1. First, name every piece of data that is directly accessed by another part of the repo (generally, but not always, actors). For most objects, this includes several of a skeleton, animations, some textures, and collision information.
+
+2. Then, name the limbs associated with each skeleton. This is usually straightforward, providing Z64Utils can show the skeleton properly. Note that when naming limbs, you should name them *from the object's perspective*, so the "left arm" is the one that is to the *object's* left. As part of this step, you should also replace the autogenerated enum values associated with each limb with an appropriate name. Another thing to note is that some limbs are considered "Root" limbs that are simply parents to other limbs and don't actually render anything themselves. In these cases, you can simply add `Root` to the limb name, e.g., `gGibdoRightLegRootLimb`.
+
+3. Next, name the display lists that are associated to limbs in the skeleton. Z64Utils can show you which display list is associated with a given limb.
+
+4. If any non-limb display lists still lack a name, try naming them now.
+
+5. Lastly, try to name every texture in the object. This can be a bit tricky just by looking at the textures, so it helps to see how they're used in the display lists. You can also try manipulating the textures, recompiling the game, and loading up the resulting ROM to see what your changes look like in-game.
+
+You'll notice that we didn't mention vertices in this list. This is because, for the most part, vertices are not used outside the object itself, and so are not required to have names. However, some actors have code that manipulates or otherwise interacts with vertices; in these cases, the vertices should be added to the XML and named.
+
+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`, `TLUT`, `Vtx`, `TexAnim`, etc.), while output texture files are named in `snake_case`. TLUTs (texture look-up tables) should always have their output file end in `tlut`. For more info on which suffixes to use, check out the [ZAPD documentation on extraction XML](https://github.com/zeldaret/mm/blob/master/tools/ZAPD/docs/zapd_extraction_xml_reference.md).
+
+### Textures
+
+Since all objects have an autogenerated XML, most textures in the game already have an entry in an XML file. However, some did not get automatically detected, and textures can be 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, and if in doubt, just do height 1 and appropriate width.
+
+If in doubt, look at completed objects in the repo, and if still in doubt, ask.
+
+## Tools
We are very fortunate that several nice tools have been written recently that are excellent for documenting asset files:
- [Z64Utils](https://github.com/Random06457/Z64Utils/releases), for looking at displaylists, textures they reference, the skeleton, animations, etc.
- [Texture64](https://github.com/queueRAM/Texture64/releases), for looking at textures in all the common N64 formats (needed since Z64Utils cannot interpret textures not explicitly referenced in displaylists currently)
+## 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
+
+- Change and save the texture. You can simply open the texture's PNG file in most image editors (e.g., Photoshop, GIMP, Paint, etc.) and edit it to your liking, though you'll need to keep the original palette in mind for palettized textures.
+- Touch the object's main C file (in the same directory)
+- 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).
+
+## Tips and Tricks
+
+### Fixing improper-looking textures
+
+For CI4 and CI8 textures, you might see improper-looking textures like so:
+
+
+
+The reason this happens is because ZAPD couldn't determine the TLUT for the texture, so it couldn't use the proper palette. To fix this, you can supply a `TlutOffset` to the texture like so:
+```xml
+
+```
+
+### Understanding texture animations
+
+Texture animations are new to Majora's Mask, and they can be pretty tricky to understand. Luckily, there's some extensive documentation on how they're structured [here](https://github.com/zeldaret/mm/blob/master/tools/ZAPD/ZAPD/ZTextureAnimation.cpp). One useful thing to remember is that empty texture animations take the form of `00 00 00 06 00 00 00 00`. The process that automatically generated all the object XMLs sometimes failed to recognize this as an empty texture animation, so it puts it in various blobs or fails to account for it at all.
+
Next: [The merging process](merging.md)
\ No newline at end of file
diff --git a/docs/tutorial/object_decomp_example.md b/docs/tutorial/object_decomp_example.md
new file mode 100644
index 0000000000..798167e68a
--- /dev/null
+++ b/docs/tutorial/object_decomp_example.md
@@ -0,0 +1,258 @@
+# Object Decompilation Example
+
+- Previous: [Object Decompilation](object_decomp.md)
+
+Let's take a look at `object_dns`, which is a pretty typical NPC object. It's used by one actor: `ovl_En_Dns`.
+
+## Step 1: Naming the skeleton and limbs
+
+We already went through the steps of opening an object file in Z64Utils in the [documenting step](documenting.md#z64utils), but we'll do it in more detail here. First, search for the object file, then right-click and select "Open in Object Analyzer". It will ask you to choose a segment: this is the segment that the file is put on, and allows Z64Utils to resolve the segmented addresses it references into symbols. The json already knows it should be segment 6, so just click OK.
+
+
+
+In the resulting window, go to "Analysis -> Find Dlists" and press OK (the defaults are usually fine). This will only find display lists, so to find everything else in the obect, do "Analysis -> Analyze Dlists". We're looking for the skeleton, so scroll down to the SkeletonHeader, right-click it, and select "Open in Skeleton Viewer":
+
+
+
+When you open the Skeleton Viewer, you'll see a list of animations off to the side. Selecting one of them will display an error that says something like `RENDER ERROR AT 0x06001A98! (Could not read 0x80 bytes at address 08000000)`. This is because one of the display lists in the skeleton is expecting something to be set at segment 8. From the actor, we know that it's expecting the eye textures to be loaded into segment 8 like so:
+```c
+static TexturePtr D_8092DE1C[] = { &D_060028E8, &D_06002968, &D_060029E8, &D_06002968 };
+[...]
+gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex]));
+```
+
+Let's set segment 8 to be one of the eye textures listed here. Click on "Segments", then for segment 08, click "Edit" and select "Address" as the source. Input "060028E8" as the address, then hit OK. This should result in the window looking as follows:
+
+
+
+Now that we've gotten around the error, we can see what each limb in the skeleton corresponds to by clicking on it in the Hierarchy. Clicking on any given limb will highlight what part of the model it represents in red. In the below example, this limb is clearly the head:
+
+
+
+Note that some limbs don't actually render anything, so sometimes clicking on a limb will not turn anything red; this may indicate a "Root" limb that has no associated display list, or it may indicate something like an eye limb that doesn't have the right textures loaded to display anything in Z64Utils. It may be useful to skip ahead to [Step #5](#step-5-naming-limb-display-lists) to learn how to check if the limb has a display list. If it doesn't have a display list, then it's a "Root" limb that will never be highlighted.
+
+We can now start naming the skeleton and individual limbs. Since we know this particular skeleton is the King's Chamber Deku Guard, we can name the skeleton `gKingsChamberDekuGuardSkel`. For the LimbNone name, we can call it something like `KINGS_CHAMBER_DEKU_GUARD_LIMB_NONE`, and we can name the LimbMax similarly. For the EnumName, we can name it `KingsChamberDekuGuardLimbs`. For each individual limb, we can name them based on what we see in Z64Utils; just make sure to update both the Name and the EnumName. After naming everything, we have something that looks like this:
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Now we can run `./extract_assets.py -s objects/object_dns` to extract the object again, this time with our new names. What can we do with this? Quite a bit actually. In `z_en_dns.h`, we can add this to the top of the file to start using these new names in our code:
+```c
+#include "objects/object_dns/object_dns.h"
+```
+
+Now, we can redefine the `jointTable` and `morphTable` in terms of the limb enum we defined before, like so:
+```c
+/* 0x22A */ Vec3s jointTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX];
+/* 0x278 */ Vec3s morphTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX];
+```
+
+We can also use our new skeleton name and limb enum when initialization the skeleton like so:
+```c
+SkelAnime_Init(globalCtx, &this->skelAnime, &gKingsChamberDekuGuardSkel, NULL, this->jointTable, this->morphTable, KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX);
+```
+
+Lastly, we can use our limb enum in `EnDns_PostLimbDraw`. Where the code originally had:
+```c
+if (limbIndex == 2) {
+ [...]
+}
+```
+
+We can instead write:
+```c
+if (limbIndex == KINGS_CHAMBER_DEKU_GUARD_LIMB_HEAD) {
+ [...]
+}
+```
+
+## Step 2: Naming the animations
+
+Now that we have the skeleton figured out, it's time to name all the animations. In the Skeleton Viewer, you can hit the "play" button on any animation to see what it looks like. Note that some objects have multiple skeletons, and selecting an animation that is associated with a different skeleton than the one you're looking at can cause odd behavior. Try to give each animation a descriptive name based on what it looks like. If you're struggling;
+- Try viewing the animation in game. In what contexts does this animation play?
+- Try analyzing the code for the actor to see when the animation is used. Is this animation ever referenced?
+- If you're still really struggling, Majora's Mask 3D contains the original animation names for the majority of animations in the game. These original names can help you figure out what the developers were originally intending. Explaining how to find these animations in MM3D is outside of the scope of this document, so just ask in Discord if you want to try this.
+
+After naming the animations, the end result will look something like this:
+```xml
+
+
+
+
+
+
+[...]
+
+
+```
+
+Once again, we can run `./extract_assets.py -s objects/object_dns` to extract the object, and we can update the animation names in `z_en_dns.c` to use our new names like so:
+```c
+static AnimationInfoS sAnimations[] = {
+ { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gKingsChamberDekuGuardSurpriseStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardSurpriseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardRunStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardRunLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardDanceAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardFlipAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+};
+```
+
+## Step 3: Identifying the blob
+
+In the XML, you may notice undefined blobs like this:
+```xml
+
+```
+
+You might already have an idea as to what this is based on what you've seen before. Recall that the eye textures are referenced in the actor's code like this:
+```c
+static TexturePtr D_8092DE1C[] = { &D_060028E8, &D_06002968, &D_060029E8, &D_06002968 };
+```
+
+Do you notice how the "28E8" in `D_060028E8` also appears as the Offset in that blob? That's because the blob is just the eye textures; the process for automatically creating the XML wasn't able to figure it out on its own, so we'll need to do it ourselves. But how should we define these textures in the XML? Recall that the eye textures were loaded into segment 8; let's take a look in `object_dns.c` and see if we can find something that uses this segment. This display list has the answer:
+```c
+Gfx object_dns_DL_001A50[] = {
+ [...]
+ gsDPLoadTextureBlock(0x08000000, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR |
+ G_TX_CLAMP, 3, 3, G_TX_NOLOD, G_TX_NOLOD),
+ [...]
+};
+```
+
+Using `0x08000000` with `gsDPLoadTextureBlock` signals that this display list is expecting a texture in segment 8. What kind of texture is it expecting? We can look at the arguments after the `0x08000000`. It's looking for an RBGA16 texture with dimensions of 8x8, so we can define these textures in the XML like so:
+```xml
+
+
+
+```
+
+Now, we just have to name them. In [Step #1](#step-1-naming-the-skeleton-and-limbs), we set segment 8 to one of the eye textures; we can use that same technique with the other two eye textures to see what they are. Like most NPCs, these various eye textures are used for handling blinking, so we can name them based on how open the eye is:
+```xml
+
+
+
+```
+
+Like with previous steps, we can run `./extract_assets.py -s objects/object_dns` and then update `z_en_dns.c` with our new names:
+```c
+static TexturePtr sEyeTextures[] = {
+ gKingsChamberDekuGuardEyeOpenTex,
+ gKingsChamberDekuGuardEyeHalfTex,
+ gKingsChamberDekuGuardEyeClosedTex,
+ gKingsChamberDekuGuardEyeHalfTex,
+};
+```
+
+Note that this step might be tricky to do if multiple things in the actor use the same segment. It's okay to wait to do this until you've named all the display lists in the actor, since that will make it easier to find the display list associated with a given texture.
+
+## Step #4: Naming anything else in the actor
+
+For some actors, there may be a few other things left to name that are directly referenced in the actor's code. In our case, there is one display list that we still need to name:
+```c
+gSPDisplayList(POLY_OPA_DISP++, &D_06002C48);
+```
+
+In Z64Utils, scroll to find this display list, then right-click and select "Open in Dlist Viewer":
+
+
+
+We can see this is the guard's Deku Flower:
+
+
+
+We can name the display list as such in the XML:
+```xml
+
+```
+
+Then, like all steps before, we can run `./extract_assets.py -s objects/object_dns` and then update `z_en_dns.c` with our new name:
+```c
+gSPDisplayList(POLY_OPA_DISP++, gKingsChamberDekuGuardDekuFlower);
+```
+
+## Step #5: Naming limb display lists
+
+Now that we've named everything that's used externally by the actor, we just need to clean up the rest of the unnamed stuff in the XML. Let's start by naming the display lists for each limb. There are two ways you can determine which display list is associated with a given limb. One way is to click on the limb in Z64Utils; it will tell you what display list is used for that limb:
+
+
+
+Another way is to simply check `object_dns.c`. Each limb lists its own display list like this:
+```c
+StandardLimb gKingsChamberDekuGuardHeadLimb = {
+ { 0, 1300, 0 }, KINGS_CHAMBER_DEKU_GUARD_LIMB_STALK - 1, KINGS_CHAMBER_DEKU_GUARD_LIMB_LEFT_FOOT - 1,
+ object_dns_DL_0018B8
+};
+```
+
+Either way you go about it, you should be able to name all the limb display lists like so:
+```xml
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Run `./extract_assets.py -s objects/object_dns` once again, since it will help in the next step to have all of our display lists named.
+
+### Step #6: Naming remaining textures
+
+With every display list named, it's now a lot easier to name the remaining textures. In the `assets/objects/object_dns/` folder, you can see all the textures in the object as various PNG files. For some of the textures, just looking at them will give you a good idea as to what they should be named. For other textures, it may help to see how the texture is used in the object's display lists. Let's take a look at `object_dns_Tex_002868`, which is only used in one display list:
+```c
+Gfx gKingsChamberDekuGuardSnoutDL[] = {
+ [...]
+ gsDPLoadTextureBlock(object_dns_Tex_002868, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_MIRROR | G_TX_CLAMP,
+ G_TX_MIRROR | G_TX_CLAMP, 3, 3, G_TX_NOLOD, G_TX_NOLOD),
+ [...]
+};
+```
+
+Since `tex_002868.rgba16.png` looks like the inside of the Deku Guard's mouth, and it's *only* used in the snout display list, you can probably name this something like `gKingsChamberDekuGuardMouthTex`. But rather than guessing, we can confirm it by editing the texture ourselves and then viewing it in-game. Using an image editor, let's change `tex_002868.rgba16.png` to this:
+
+
+
+Now, rebuild the game using [the steps described here](object_decomp.md#building-and-investigative-modding) and look at the guard in-game. You should see something like this:
+
+
+
+This confirms our suspicion that this is indeed the mouth texture, so we can name it as such. We can use similar strategies to name all the other textures like so:
+```xml
+
+
+
+```
+
+### Step #7: Finishing up
+
+If you have any other unnamed assets, now's the time to identify them. Otherwise, finish up the file by putting a comment at the top above the `` node:
+```xml
+
+
+
+```
+
+And we're done! Hopefully, you found this example helpful when decompiling your own objects.
\ No newline at end of file
diff --git a/docs/tutorial/other_functions.md b/docs/tutorial/other_functions.md
index 870b490ea6..b0350a838e 100644
--- a/docs/tutorial/other_functions.md
+++ b/docs/tutorial/other_functions.md
@@ -1,7 +1,7 @@
# 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)
+- Up: [Contents](contents.md)
+- Previous: [Beginning decompilation: the Init function and the Actor struct](beginning_decomp.md)
## Now what?
diff --git a/include/PR/gbi.h b/include/PR/gbi.h
index 2c04e570f7..ace2cd2e89 100644
--- a/include/PR/gbi.h
+++ b/include/PR/gbi.h
@@ -2899,6 +2899,9 @@ _DW({ \
gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode)
#endif
+ #define gDPSetDither(pkt, mode) \
+ gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 4, mode)
+
/* 'blendmask' is not supported anymore.
* The bits are reserved for future use.
* Fri May 26 13:45:55 PDT 1995
diff --git a/include/command_macros_base.h b/include/command_macros_base.h
index bb5ce16485..4a866c29e7 100644
--- a/include/command_macros_base.h
+++ b/include/command_macros_base.h
@@ -17,9 +17,9 @@
#define CMD_W(a) (a)
#ifdef __GNUC__
-#define CMD_F(a) {.f = (a)}
+#define CMD_F(a) .f = (a)
#else
-#define CMD_F(a) {(a)}
+#define CMD_F(a) (a)
#endif
#define CMD_PTR(a) (uintptr_t)(a)
diff --git a/include/functions.h b/include/functions.h
index 0277ead11b..9cd3e6af26 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -559,7 +559,7 @@ void EffectSsBlast_SpawnWhiteCustomScale(GlobalContext* globalCtx, Vec3f* pos, V
void EffectSsBlast_SpawnWhiteShockwave(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3);
// void EffectSsGSpk_SpawnAccel(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, Vec3f* pzParm4, Vec3f* param_5, Color_RGBA8* param_6, Color_RGBA8* param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9);
// void EffectSsGSpk_SpawnNoAccel(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9);
-// void EffectSsGSpk_SpawnFuse(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
+void EffectSsGSpk_SpawnFuse(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel);
// void EffectSsGSpk_SpawnRandColor(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
// void EffectSsGSpk_SpawnSmall(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
void EffectSsDFire_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s16 alpha, s16 fadeDelay, s16 life, s32 arg9);
@@ -576,10 +576,10 @@ void EffectSsHahen_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos, f32 burstSca
// void EffectSsStick_Spawn(UNK_TYPE4 uParm1, UNK_PTR puParm2, UNK_TYPE2 uParm3);
// void EffectSsSibuki_Spawn(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
void EffectSsSibuki_SpawnBurst(GlobalContext* globalCtx, Vec3f* pos);
-// void EffectSsStone1_Spawn(UNK_TYPE4 uParm1, UNK_PTR puParm2, UNK_TYPE4 uParm3);
+void EffectSsStone1_Spawn(GlobalContext* globalCtx, Vec3f* arg1, s32 arg2);
// void EffectSsHitMark_Spawn(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, UNK_TYPE2 uParm3, Vec3f* pzParm4);
void EffectSsHitMark_SpawnFixedScale(GlobalContext* globalCtx, s32 type, Vec3f* pos);
-// void EffectSsHitMark_SpawnCustomScale(void);
+void EffectSsHitMark_SpawnCustomScale(GlobalContext* globalCtx, s32 type, s16 scale, Vec3f* pos);
// void EffectSsFhgFlash_SpawnShock(UNK_TYPE4 uParm1, UNK_TYPE4 uParm2, Vec3f* pzParm3, UNK_TYPE2 uParm4, UNK_TYPE1 param_5);
// void EffectSsKFire_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE1 param_6);
void EffectSsSolderSrchBall_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 unused, s16* linkDetected, s16 drawFlag);
@@ -595,7 +595,7 @@ void EffectSsEnIce_Spawn(GlobalContext* globalCtx, Vec3f* pos, f32 scale, Vec3f*
// void EffectSsFireTail_SpawnFlameOnPlayer(void);
void EffectSsEnFire_SpawnVec3f(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, s16 scale, s16 arg4, s16 flags, s16 bodyPart);
// void EffectSsEnFire_SpawnVec3s(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
-// void EffectSsExtra_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
+void EffectSsExtra_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scoreIdx);
void EffectSsDeadDb_Spawn(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, Color_RGBA8* prim, Color_RGBA8* env, s16 scale, s16 scaleStep, s32 unk);
void func_800B3030(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel, s16 scale, s16 scaleStep, s32 colorIndex);
// void EffectSsDeadDd_Spawn(UNK_TYPE4 uParm1, Vec3f* pzParm2, Vec3f* pzParm3, Vec3f* pzParm4, UNK_TYPE1* param_5, UNK_TYPE1* param_6, UNK_TYPE2 param_7, UNK_TYPE2 param_8, UNK_TYPE2 param_9, UNK_TYPE4 param_10);
@@ -782,7 +782,7 @@ s32 func_800BD2B4(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u
void func_800BD888(Actor* actor, struct_800BD888_arg1* arg1, s16 arg2, s16 arg3);
void func_800BD9E0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void func_800BDAA0(GlobalContext* globalCtx, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
-void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index);
+void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index);
void Actor_Noop(Actor* actor, GlobalContext* globalCtx);
void Gfx_DrawDListOpa(GlobalContext* globalCtx, Gfx* dlist);
@@ -944,7 +944,7 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId)
u32 SurfaceType_IsHookshotSurface(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_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
+s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
s32 func_800C9DDC(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorSpeed(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
u32 SurfaceType_GetConveyorDirection(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId);
@@ -1140,14 +1140,14 @@ s32 Camera_ChangeMode(Camera* camera, s16 mode);
// void func_800DF86C(void);
// void func_800DF8EC(void);
s32 func_800DFAC8(Camera* camera, s16 param_2);
-u32 func_800DFB14(Camera* camera, u32 param_2);
+u32 Camera_ChangeDataIdx(Camera* camera, u32 camDataIdx);
// void func_800DFC1C(void);
// void func_800DFC40(void);
-s32 func_800DFC68(Camera* camera);
+s32 Camera_GetInputDirYaw(Camera* camera);
// void func_800DFC90(void);
-s16 func_800DFCB4(Camera* camera);
-s16 func_800DFCDC(Camera* camera);
-// void func_800DFD04(void);
+s16 Camera_GetCamDirPitch(Camera* camera);
+s16 Camera_GetCamDirYaw(Camera* camera);
+void func_800DFD04(Camera* camera, s32 arg1, s32 arg2, s32 arg3);
// void func_800DFD78(void);
// UNK_TYPE4 func_800DFEF0(s32 param_1, u16 param_2);
// UNK_TYPE4 func_800DFF18(Camera* iParm1, UNK_TYPE2 uParm2);
@@ -1155,16 +1155,16 @@ s16 func_800DFCDC(Camera* camera);
// UNK_TYPE4 func_800DFF44(void);
s16 Camera_SetFlags(Camera* iParm1, s16 flags);
s16 Camera_ClearFlags(Camera* camera, s16 flags);
-// void func_800DFFAC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6, UNK_TYPE2 param_7);
+s32 func_800DFFAC(Camera* camera, Actor* doorActor, s16 bgCamDataId, f32 arg3, s16 timer1, s16 timer2, s16 timer3);
// UNK_TYPE4 func_800E007C(Camera* param_1, Camera* param_2);
// UNK_TYPE4 func_800E01AC(void);
// void func_800E01B8(void);
// void func_800E01DC(s32 param_1, u32 param_2, UNK_TYPE4 param_3, UNK_TYPE4 param_4, UNK_TYPE2 param_5, UNK_TYPE2 param_6);
// UNK_TYPE4 func_800E0228(void);
// void func_800E0238(void);
-void func_800E02AC(Camera* camera, Actor* actor);
-void func_800E0308(Camera* camera, Actor* actor);
-f32 func_800E031C(Camera* camera);
+void Camera_SetToTrackActor(Camera* camera, Actor* actor);
+void Camera_SetTargetActor(Camera* camera, Actor* actor);
+f32 Camera_GetWaterYPos(Camera* camera);
void func_800E0348(Camera* camera);
DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* damageTable);
@@ -1396,55 +1396,24 @@ DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX,
// void func_800E9DBC(void);
// void func_800E9E94(void);
void func_800E9F78(GraphicsContext* gfxCtx);
+
void Cutscene_Init(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EA0D4(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EA0EC(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void Cutscene_StepCutscene1(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void Cutscene_StepCutscene2(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void Cutscene_Nop800EA210(GlobalContext* globalCtx, CutsceneContext* csCtx);
-s32 func_800EA220(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target);
-void func_800EA258(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EA2B8(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EA324(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EABAC(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd);
-void func_800EAC08(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd);
-void func_800EAC44(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicChange* cmd);
-void func_800EAC94(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdMusicFade* cmd);
-void func_800EAD14(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EAD48(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EAD7C(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EADB0(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EAECC(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EAF20(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnk190* cmd);
-void func_800EAFE0(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdUnk9B* cmd);
-void func_800EB1DC(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd);
-void func_800EB364(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EB4B4(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EB6F8(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EBB68(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EBCD0(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-void func_800EBD60(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd);
-s32 func_800EC678(GlobalContext* globalCtx, CsCmdUnk5A* cmd);
-// u32 func_800EC6D4(void);
-void func_800EC924(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd);
-void func_800ECD7C(CutsceneContext* csCtx, u8** cutscenePtr, s16 index);
-void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr, u16* commandReadHead);
-void func_800ED980(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800ED9C4(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EDA04(GlobalContext* globalCtx, CutsceneContext* csCtx);
-void func_800EDA84(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void Cutscene_Start(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void Cutscene_End(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void Cutscene_Update1(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void Cutscene_Update2(GlobalContext* globalCtx, CutsceneContext* csCtx);
void func_800EDBE0(GlobalContext* globalCtx);
-void nop_800EDDB0(GlobalContext* globalCtx);
-// void func_800EDDBC(void);
-void func_800EDDCC(GlobalContext* globalCtx, u32 uParm2);
-void func_800EDE34(Actor* actor, GlobalContext* globalCtx, s32 param_3);
-void func_800EDF24(Actor* actor, GlobalContext* globalCtx, u32 arg2);
-void func_800EDF78(Actor* actor, GlobalContext* globalCtx, s32 iParm3);
-void func_800EE0CC(Actor* actor, GlobalContext* globalCtx, s32 iParm3);
-s32 func_800EE1D8(GlobalContext* globalCtx);
-u32 func_800EE200(GlobalContext* globalCtx, u16 uParm2);
-u32 func_800EE29C(GlobalContext* globalCtx, u16 uParm2);
-u32 func_800EE2F4(GlobalContext* globalCtx);
+void func_800EDDB0(GlobalContext* globalCtx);
+void Cutscene_LoadCutsceneData(GlobalContext* globalCtx, u8 csIndex);
+void Cutscene_ActorTranslate(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex);
+void Cutscene_ActorTranslateAndYaw(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex);
+void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex);
+void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex);
+s32 Cutscene_GetSceneSetupIndex(GlobalContext* globalCtx);
+s32 Cutscene_GetActorActionIndex(GlobalContext* globalCtx, u16 actorActionCmd);
+s32 Cutscene_CheckActorAction(GlobalContext* globalCtx, u16 actorActionCmd);
+u8 Cutscene_IsPlaying(GlobalContext* globalCtx);
+
void GetItem_Draw(GlobalContext* globalCtx, s16 index);
void func_800EE364(GlobalContext* globalCtx, s16 index);
void func_800EE400(GlobalContext* globalCtx, s16 index);
@@ -1478,21 +1447,7 @@ void SoundSource_UpdateAll(GlobalContext* globalCtx);
void SoundSource_PlaySfxAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPos, u32 duration, u16 sfxId);
void SoundSource_PlaySfxEachFrameAtFixedWorldPos(GlobalContext* globalCtx, Vec3f* worldPos, u32 duration, u16 sfxId);
u16 ElfMessage_GetFirstCycleHint(GlobalContext* globalCtx);
-s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex);
-Actor* EnHy_FindNearestDoor(Actor* actor, GlobalContext* globalCtx);
-void EnHy_ChangeObjectAndAnim(EnHy* enHy, GlobalContext* globalCtx, s16 animIndex);
-s32 EnHy_UpdateSkelAnime(EnHy* enHy, GlobalContext* globalCtx);
-void EnHy_Blink(EnHy* enHy, s32 arg1);
-s32 EnHy_Init(EnHy* enHy, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex);
-void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, Actor* arg2, s16 arg3, s16 arg4);
-s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5);
-s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3);
-s32 EnHy_SetPointFowards(EnHy* enHy, GlobalContext* globalCtx, f32 gravity, s16 animIndex);
-s32 EnHy_SetPointBackwards(EnHy* enHy, GlobalContext* globalCtx, s16 animIndex);
-s32 EnHy_MoveForwards(EnHy* enHy, f32 arg1);
-s32 EnHy_MoveBackwards(EnHy* enHy, f32 arg1);
-void EnHy_UpdateCollider(EnHy* enHy, GlobalContext* globalCtx);
-s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 arg2);
+
u16 Text_GetFaceReaction(GlobalContext* globalCtx, u32 reactionSet);
void EnvFlags_UnsetAll(GlobalContext* globalCtx);
void EnvFlags_Set(GlobalContext* globalCtx, s16 flag);
@@ -1517,10 +1472,10 @@ s16 ActorCutscene_GetCurrentIndex(void);
ActorCutscene* ActorCutscene_GetCutscene(s16 index);
s16 ActorCutscene_GetAdditionalCutscene(s16 index);
s16 ActorCutscene_GetLength(s16 index);
-// void func_800F2138(void);
+s32 func_800F2138(s8 arg0);
s32 func_800F2178(s16 arg0);
s16 ActorCutscene_GetCurrentCamera(s16 index);
-// void func_800F21CC(void);
+s16 func_800F21CC(void);
s32 func_800F22C4(s16 param_1, Actor* actor);
void ActorCutscene_SetReturnCamera(s16 index);
// void func_800F23E0(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
@@ -1560,7 +1515,7 @@ void Font_LoadOrderedFont(Font* font);
// void func_800F50D4(void);
void Kankyo_Init(GlobalContext* globalCtx, EnvironmentContext* envCtx);
u32 func_800F5954(u8* param_1, u32 param_2, u32 param_3, u8 param_4, u8 param_5);
-f32 func_800F5A8C(u16 arg0, u16 arg1, u16 arg2, GlobalContext* globalContext);
+f32 Environment_LerpWeight(u16 max, u16 min, u16 val);
// void func_800F5B10(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE2 param_5);
// void func_800F5CD0(void);
void func_800F6834(GlobalContext* globalCtx, s32 waterLightsIndex);
@@ -1588,7 +1543,7 @@ void func_800FAAB4(GlobalContext* globalCtx, u8 arg1);
// void func_800FAC20(void);
// void func_800FAF74(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5);
// void func_800FB010(void);
-void func_800FB320(GlobalContext* globalCtx, u8 param_2);
+void Environment_AddLightningBolts(GlobalContext* globalCtx, u8 num);
// void func_800FB388(void);
void func_800FB758(GlobalContext* globalCtx);
// void func_800FB9B4(void);
@@ -1632,7 +1587,7 @@ void func_800FE658(f32 arg0);
// void func_800FE788(void);
// void func_800FE798(void);
// void func_800FE7A8(void);
-// void func_800FE9B4(void);
+s32 func_800FE9B4(GlobalContext* globalCtx);
// void func_800FEA50(void);
void func_800FEAB0(void);
// void func_800FEAC0(void);
@@ -1968,8 +1923,8 @@ void func_801149A0(s32 arg0, s16 arg1);
// void func_80114A9C(void);
// void func_80114B84(void);
// void func_80114CA0(void);
-UNK_TYPE func_80114E90(void);
-UNK_TYPE func_80114F2C(u8 arg0);
+s32 Interface_HasEmptyBottle(void);
+s32 Interface_HasItemInBottle(u8 itemId);
// void func_80114FD0(void);
// void func_80115130(void);
// void func_801152B8(void);
@@ -2022,7 +1977,7 @@ f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
void Path_CopyLastPoint(Path* path, Vec3f* dest);
void FrameAdvance_Init(FrameAdvanceContext* frameAdvCtx);
s32 FrameAdvance_Update(FrameAdvanceContext* frameAdvCtx, Input* input);
-// void func_801226E0(void);
+void func_801226E0(GlobalContext* globalCtx, s8 arg1);
void func_80122744(GlobalContext* globalCtx, UNK_PTR arg1, u32 arg2, Vec3s* arg3);
s32 func_80122760(GlobalContext* globalCtx, UNK_PTR arg1, f32 arg2);
void func_80122868(GlobalContext* globalCtx, Player* player);
@@ -2034,12 +1989,12 @@ void func_801229A0(GlobalContext* globalCtx, Player* player);
// void func_80122D44(void);
// void func_80122ED8(void);
// void func_80122EEC(void);
-void func_80122F28(Player* player, GlobalContext* globalCtx, Actor* actor);
-// void func_80122F9C(void);
-// void func_80122FCC(void);
-// void func_8012300C(void);
+void func_80122F28(Player* player);
+s32 func_80122F9C(GlobalContext* globalCtx);
+s32 func_80122FCC(GlobalContext* globalCtx);
+void func_8012300C(GlobalContext* globalCtx, s32 arg1);
void func_8012301C(s32 iParm1, GlobalContext* globalCtx);
-void func_80123140(GlobalContext* globalCtx, Player* param_2);
+void func_80123140(GlobalContext* globalCtx, Player* player);
u32 func_80123358(GlobalContext* globalCtx, Player* player);
s32 Player_InCsMode(GameState* gameState);
// void func_80123420(void);
@@ -2055,24 +2010,24 @@ s32 func_80123810(GlobalContext* globalCtx);
void func_80123AA4(Player* player, s32 arg1);
// void func_80123BD4(void);
// void func_80123C58(void);
-// void func_80123C90(void);
+void Player_SetEquipmentData(GlobalContext* globalCtx, Player* this);
void func_80123D50(GlobalContext* globalCtx, Player* player, UNK_TYPE arg2, UNK_TYPE arg3);
void func_80123DA4(Player* player);
// void func_80123DC0(void);
void func_80123E90(GlobalContext* globalCtx, Actor* actor);
void func_80123F2C(GlobalContext* globalCtx, s32 arg1);
-// void func_80123F48(void);
-// void func_80124020(void);
+s32 func_80123F48(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, f32 arg3);
+s32 func_80124020(void);
u8 Player_GetMask(GlobalContext* globalCtx);
void Player_RemoveMask(GlobalContext* globalCtx);
s32 func_8012405C(GlobalContext* globalCtx);
-// void func_80124088(void);
+s32 func_80124088(GlobalContext* globalCtx);
s32 func_801240C8(Player* player);
// void func_801240DC(void);
// void func_80124110(void);
// void func_80124148(void);
// void func_80124168(void);
-// void func_80124190(void);
+s32 func_80124190(Player* player);
// void func_801241B4(void);
// void func_801241E0(void);
// void func_8012420C(void);
@@ -2099,7 +2054,7 @@ s32 func_801242B4(Player* player);
// void func_80125D4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801262C8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801263FC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
-void func_80126440(GlobalContext* globalCtx, Collider* param_2, s32* param_3, Vec3f* param_4, Vec3f* param_5);
+s32 func_80126440(GlobalContext* globalCtx, Collider* param_2, s32* param_3, Vec3f* param_4, Vec3f* param_5);
// void func_801265C8(void);
// void func_8012669C(void);
// void func_80126808(void);
@@ -2150,14 +2105,14 @@ void Quake_Init(void);
s16 Quake_Add(Camera* camera, u32 callbackIdx);
u32 Quake_RemoveFromIdx(s16 idx);
s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData);
-void Quake2_Init(GlobalContext* globalCtx);
-void Quake2_SetCountdown(s16 countdown);
-s16 Quake2_GetCountdown(void);
-s16 Quake2_GetType(void);
-void Quake2_SetType(s32 type);
-void Quake2_ClearType(s32 type);
-s32 Quake2_GetFloorQuake(Player* player);
-void Quake2_Update(void);
+void Distortion_Init(GlobalContext* globalCtx);
+void Distortion_SetCountdown(s16 countdown);
+s16 Distortion_GetCountdown(void);
+s16 Distortion_GetType(void);
+void Distortion_SetType(s32 type);
+void Distortion_ClearType(s32 type);
+s32 Distortion_GetUnderwaterCurrentSpeed(Player* player);
+void Distortion_Update(void);
s32 Quake_NumActiveQuakes(void);
Gfx* Gfx_SetFog(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
Gfx* Gfx_SetFogWithSync(Gfx* gfx, s32 r, s32 g, s32 b, s32 a, s32 n, s32 f);
@@ -2253,16 +2208,16 @@ s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtx, s32
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx);
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags);
void func_8012EBF8(GlobalContext* globalCtx, RoomContext* roomCtx);
-s32 func_8012EC80(GlobalContext* globalCtx);
-void func_8012ED34(s16 equipment);
-u8 func_8012ED78(GlobalContext* globalCtx, s16 equipment);
-void func_8012EDE8(s16 arg0, u32 arg1);
-s32 func_8012EE34(s16 arg0);
-void func_8012EF0C(s16 arg0);
-void func_8012F0EC(s16 arg0);
-void func_8012F1BC(s16 sceneIndex);
-s16 func_8012F22C(s16 sceneIndex);
-void func_8012F278(GlobalContext* globalCtx);
+s32 Inventory_GetBtnBItem(GlobalContext* globalCtx);
+void Inventory_ChangeEquipment(s16 value);
+u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment);
+void Inventory_ChangeUpgrade(s16 upgrade, u32 value);
+s32 Inventory_IsMapVisible(s16 sceneNum);
+void Inventory_SetMapVisibility(s16 tingleIndex);
+void Inventory_SaveDekuPlaygroundHighScore(s16 timerId);
+void Inventory_IncrementSkullTokenCount(s16 sceneIndex);
+s16 Inventory_GetSkullTokenCount(s16 sceneIndex);
+void Inventory_SaveLotteryCodeGuess(GlobalContext* globalCtx);
s32 Object_Spawn(ObjectContext* objectCtx, s16 id);
void Object_InitBank(GameState* gameState, ObjectContext* objectCtx);
void Object_UpdateBank(ObjectContext* objectCtx);
@@ -2375,9 +2330,9 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
void SkelAnime_DrawOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
void SkelAnime_DrawFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, Mtx** limbMatricies);
void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
-void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor, Mtx** mtx);
-void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw, Actor* actor);
-void SkelAnime_GetFrameData(AnimationHeader* animationSeg, s32 currentFrame, s32 limbCount, Vec3s* dst);
+void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx);
+void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor);
+void SkelAnime_GetFrameData(AnimationHeader* animation, s32 currentFrame, s32 limbCount, Vec3s* dst);
s16 Animation_GetLength(void* animation);
s16 Animation_GetLastFrame(void* animation);
Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx);
@@ -2395,7 +2350,7 @@ void AnimationContext_DisableQueue(GlobalContext* globalCtx);
AnimationEntry* AnimationContext_AddEntry(AnimationContext* animationCtx, AnimationType type);
void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable);
void AnimationContext_SetCopyAll(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src);
-void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 limbCount, Vec3s* arg2, Vec3s* arg3, f32 arg4);
+void AnimationContext_SetInterp(GlobalContext* globalCtx, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight);
void AnimationContext_SetCopyTrue(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* index);
void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s* dst, Vec3s* src, u8* index);
void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 arg3);
@@ -2413,25 +2368,25 @@ s32 LinkAnimation_Morph(GlobalContext* globalCtx, SkelAnime* skelAnime);
void LinkAnimation_AnimateFrame(GlobalContext* globalCtx, SkelAnime* skelAnime);
s32 LinkAnimation_Loop(GlobalContext* globalCtx, SkelAnime* skelAnime);
s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime);
-void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 transitionRate);
-void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationMode, f32 transitionRate);
-void LinkAnimation_PlayOnce(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg);
-void LinkAnimation_PlayOnceSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed);
-void LinkAnimation_PlayLoop(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg);
-void LinkAnimation_PlayLoopSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 playbackSpeed);
+void Animation_SetMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 morphFrames);
+void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
+void LinkAnimation_PlayOnce(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation);
+void LinkAnimation_PlayOnceSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed);
+void LinkAnimation_PlayLoop(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation);
+void LinkAnimation_PlayLoopSetSpeed(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed);
void LinkAnimation_CopyJointToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime);
void LinkAnimation_CopyMorphToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime);
-void LinkAnimation_LoadToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 frame);
-void LinkAnimation_LoadToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 frame);
+void LinkAnimation_LoadToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame);
+void LinkAnimation_LoadToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 frame);
void LinkAnimation_InterpJointMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, f32 frame);
-void LinkAnimation_BlendToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 transitionFrame, LinkAnimationHeader* linkAnimetionEntrySeg2, f32 frame, f32 transitionRate, Vec3s* jointTable);
-void LinkAnimation_BlendToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg, f32 transitionFrame, LinkAnimationHeader* linkAnimetionEntrySeg2, f32 frame, f32 transitionRate, Vec3s* jointTable);
+void LinkAnimation_BlendToJoint(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable);
+void LinkAnimation_BlendToMorph(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation1, f32 frame1, LinkAnimationHeader* animation2, f32 frame2, f32 blendWeight, Vec3s* blendTable);
void LinkAnimation_EndLoop(SkelAnime* skelAnime);
-s32 Animation_OnFrameImpl(SkelAnime* skelAnime, f32 arg1, f32 updateRate);
-s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 arg1);
-void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount);
+s32 Animation_OnFrameImpl(SkelAnime* skelAnime, f32 frame, f32 updateRate);
+s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame);
+void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount);
void SkelAnime_InitFlex(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount);
-void SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animationSeg);
+void SkelAnime_InitSkin(GlobalContext* globalCtx, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation);
void SkelAnime_SetUpdate(SkelAnime* skelAnime);
s32 SkelAnime_Update(SkelAnime* skelAnime);
s32 SkelAnime_Morph(SkelAnime* skelAnime);
@@ -2440,20 +2395,20 @@ void SkelAnime_AnimateFrame(SkelAnime* skelAnime);
s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
s32 SkelAnime_Once(SkelAnime* skelAnime);
-void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationType, f32 transitionRate, s8 unk2);
-void Animation_Change(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed, f32 frame, f32 frameCount, u8 mode, f32 transitionRate);
-void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg);
-void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 transitionRate);
-void Animation_PlayOnceSetSpeed(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed);
-void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg);
-void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 transitionRate);
-void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 playbackSpeed);
+void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames, s8 taper);
+void Animation_Change(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed, f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
+void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animation);
+void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames);
+void Animation_PlayOnceSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed);
+void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation);
+void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames);
+void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed);
void Animation_EndLoop(SkelAnime* skelAnime);
void Animation_Reverse(SkelAnime* skelAnime);
void SkelAnime_CopyFrameTableTrue(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* index);
-void SkelAnime_CopyFrameTableFalse(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* arg3);
+void SkelAnime_CopyFrameTableFalse(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src, u8* copyFlag);
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle);
-s32 Animation_OnFrame(SkelAnime* skelAnime, f32 arg1);
+s32 Animation_OnFrame(SkelAnime* skelAnime, f32 frame);
void SkelAnime_Free(SkelAnime* skelAnime, GlobalContext* globalCtx);
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
// void func_80137970(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
@@ -2504,11 +2459,11 @@ u32 func_8013A4C4(s32 flag);
s16 func_8013A504(s16 val);
s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, Vec3s* rot, f32 distanceMin, f32 distanceMax, s16 angleError);
struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5);
-Gfx* func_8013A860(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
-Gfx* func_8013AB00(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, UnkActorDraw unkActorDraw, Actor* actor, Gfx* gfx);
+Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
+Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx);
s32 func_8013AD6C(GlobalContext* globalCtx);
s32 func_8013AD9C(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5);
-void func_8013AED4(u16* arg0, u16 arg1, u16 arg2);
+void SubS_UpdateFlags(u16* flags, u16 setBits, u16 unsetBits);
void func_8013AF00(f32* arg0, s32 arg1, s32 arg2);
s32 func_8013B010(f32* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, f32* arg6);
void func_8013B0C8(s32 arg0, f32 arg1, s32 arg2, f32* arg3, f32* arg4);
@@ -2517,7 +2472,7 @@ s32 func_8013B6B0(Path* path, f32* arg1, s32* arg2, s32 arg3, s32 arg4, s32* arg
void func_8013B878(GlobalContext* globalCtx, Path* path, s32 arg2, Vec3f* arg3);
Path* func_8013BB34(GlobalContext* globalCtx, u8 arg1, s32 arg2);
Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCategory, s16 actorId);
-s32 func_8013BC6C(SkelAnime* skelAnime, ActorAnimationEntryS* arg1, s32 arg2);
+s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index);
s32 func_8013BD40(Actor* actor, Path* path, s32 arg2);
Path* func_8013BEDC(GlobalContext* globalCtx, u8 arg1, u8 arg2, s32* arg3);
s32 func_8013C068(Path* path, s32 arg1, Vec3f* arg2, f32 arg3, s32 arg4);
@@ -2529,16 +2484,16 @@ void func_8013CD64(Vec3f* arg0, Vec3f* arg1, u8* arg2, f32 arg3, u8 arg4, u8* ar
void func_8013CF04(Actor* actor, GraphicsContext** gfxCtxPtr, u8* arg2);
s16 func_8013D0E0(s16* arg0, s16 arg1, s16 arg2, f32 arg3, f32 arg4, f32 arg5);
s32 func_8013D2E0(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3, Vec3s* arg4, Vec3s* arg5, u16* arg6);
-s32 func_8013D5E8(s16 arg0, s16 arg1, s16 arg2);
+s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
Path* func_8013D648(GlobalContext* globalCtx, s16 arg1, s16 arg2);
s32 func_8013D68C(Path* path, s32 arg1, Vec3f* arg2);
s16 func_8013D720(Vec3f* arg0, Vec3f* arg1, f32* arg2);
s32 func_8013D768(Actor* actor, Vec3f* arg1, s16 arg2);
s16 func_8013D83C(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
-s8 func_8013D8DC(s8 arg0, GlobalContext* globalCtx);
-s8 func_8013D924(s16 arg0, GlobalContext* globalCtx);
+s8 SubS_IsObjectLoaded(s8 index, GlobalContext* globalCtx);
+s8 SubS_GetObjectIndex(s16 id, GlobalContext* globalCtx);
Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorCategory, s16 actorId);
-s32 func_8013D9C8(GlobalContext* globalCtx, s16* arg1, s16* arg2, s32 arg3);
+s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* limbRotTableZ, s32 numLimbs);
s32 func_8013DB90(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2);
s32 func_8013DC40(Path* arg0, s32 arg1, s32 arg2, Vec3f* arg3);
void func_8013DCE0(GlobalContext* globalCtx, Vec3f* arg1, Actor* arg2, struct_8013DF3C_arg1* arg3, Path* arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8, u8 arg9);
@@ -2547,9 +2502,9 @@ void func_8013DF3C(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1);
s32 func_8013E054(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1);
s32 func_8013E07C(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1);
s32 func_8013E0A4(GlobalContext* globalCtx, struct_8013DF3C_arg1* arg1);
-void func_8013E1C8(SkelAnime* skelAnime, struct_80B8E1A8 animations[], s32 animationIndex, s32* actorAnimationIndex);
-s32 func_8013E2D4(Actor* actor, s16 arg1, s16 arg2, s32 arg3);
-s32 func_8013E3B8(Actor* actor, s16 cutscenes[], s16 len);
+void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex, s32* curIndex);
+s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type);
+s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes);
void func_8013E4B0(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, Plane* plane);
s32 func_8013E5CC(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4, Vec3f* arg5);
Actor* SubS_FindActorCustom(GlobalContext* globalCtx, Actor* actor, Actor* actorListStart, u8 actorCategory, s16 actorId, void* verifyData, VerifyActor verifyActor);
@@ -2581,13 +2536,13 @@ void View_GetViewport(View* view, Viewport* viewport);
void View_WriteScissor(Gfx** gfx, s32 ulx, s32 uly, s32 lrx, s32 lry);
void View_SyncAndWriteScissor(View* view, Gfx** gfx);
void View_SetScissorForLetterbox(View* view);
-s32 View_SetQuakeRotation(View* view, f32 x, f32 y, f32 z);
-s32 View_SetQuakeScale(View* view, f32 x, f32 y, f32 z);
-s32 View_SetQuakeSpeed(View* view, f32 speed);
-s32 View_InitCameraQuake(View* view);
-s32 View_ClearQuake(View* view);
-s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed);
-s32 View_StepQuake(View* view, Mtx* matrix);
+s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ);
+s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ);
+s32 View_SetDistortionSpeed(View* view, f32 speed);
+s32 View_InitDistortion(View* view);
+s32 View_ClearDistortion(View* view);
+s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed);
+s32 View_StepDistortion(View* view, Mtx* projectionMtx);
void View_RenderView(View* view, s32 uParm2);
s32 View_RenderToPerspectiveMatrix(View* view);
s32 View_RenderToOrthographicMatrix(View* view);
@@ -2644,7 +2599,7 @@ u32 Sram_CalcChecksum(u8* data, u32 length);
// void Sram_GenerateRandomSaveFields(void);
void func_80144890(void);
void Sram_InitDebugSave(void);
-// void func_80144A94(void);
+void func_80144A94(SramContext* sramCtx);
// void func_80144E78(void);
// void func_8014546C(void);
// void func_80145698(void);
@@ -2656,8 +2611,8 @@ void func_80146580(s32 param_1, SramContext* param_2, s32 param_3);
void func_80146E40(GameState* gameState, SramContext* sramCtx);
void Sram_Alloc(GameState* gameState, SramContext* sramCtx);
// void func_80146EBC(SramContext* param_1, UNK_TYPE4 param_2, UNK_TYPE4 param_3);
-// void func_80146EE8(void);
-// void func_80146F5C(void);
+void func_80146EE8(GlobalContext* globalCtx);
+void func_80146F5C(GlobalContext* globalCtx);
// void func_80147008(void);
void func_80147020(SramContext* param_1);
void func_80147068(SramContext* param_1);
@@ -2669,8 +2624,8 @@ void func_80147198(SramContext* param_1);
// void Sram_nop8014750C(UNK_TYPE4 param_1);
// void func_80147520(void);
void func_80147564(GlobalContext* globalCtx);
-u32 func_80147624(GlobalContext* globalCtx);
-u32 func_80147734(GlobalContext* globalCtx);
+s32 func_80147624(GlobalContext* globalCtx);
+s32 func_80147734(GlobalContext* globalCtx);
void func_801477B4(GlobalContext* globalCtx);
// void func_80147818(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
// void func_80147F18(GlobalContext* globalCtx, UNK_PTR puParm2, UNK_TYPE4 uParm3, UNK_TYPE4 uParm4);
@@ -2699,7 +2654,7 @@ void func_8014ADBC(GlobalContext* globalCtx, UNK_PTR puParm2);
// void func_80150A84(void);
void func_80150D08(GlobalContext* globalCtx, u32 uParm2);
// void func_801514B0(void);
-void func_801518B0(GlobalContext* globalCtx, u16 textId, Actor* Actor);
+void Message_StartTextbox(GlobalContext* globalCtx, u16 textId, Actor* Actor);
void func_80151938(GlobalContext* globalCtx, u16 textId);
void func_80151A68(GlobalContext* globalCtx, u16 textId);
void func_80151BB4(GlobalContext* globalCtx, u32 uParm2);
@@ -2753,13 +2708,13 @@ void ShrinkWindow_Destroy(void);
void ShrinkWindow_Update(s32 framerateDivisor);
void ShrinkWindow_Draw(GraphicsContext* gfxCtx);
// void func_80161180(void);
-// void func_8016119C(void);
+void func_8016119C(Camera* camera, struct_801F4D48* arg1);
// void func_8016122C(void);
// void func_801612B8(void);
-// void func_80161998(void);
+s32 func_80161998(UNK_PTR arg0, struct_801F4D48* arg1);
// s32 func_80161BAC(void);
-// void func_80161BE0(void);
-// void func_80161C0C(void);
+void func_80161BE0(s16 arg0);
+void func_80161C0C(void);
// void func_80161C20(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_80161E4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801620CC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
@@ -2822,7 +2777,7 @@ void func_80165438(UNK_PTR param_1);
// void func_80165608(void);
// void func_80165630(void);
void func_80165658(u32 arg0);
-void func_8016566C(u32 arg0);
+void func_8016566C(s32 arg0);
void func_80165690(void);
// void func_801656A4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
// void func_80165DCC(void);
@@ -2852,22 +2807,21 @@ void func_8016927C(GlobalContext* globalCtx, s16 sParm2);
// void func_801692C4(GlobalContext* globalCtx, UNK_TYPE1 uParm2);
// void Play_SceneInit(GlobalContext* globalCtx, s32 sceneIndex, UNK_TYPE1 param_3);
UNK_RET func_80169474(GlobalContext* globalCtx, Vec3f* v1, Vec3f* v2);
-s32 func_801694DC(GlobalContext* globalCtx);
-s32 Play_GetActiveCameraIndex(GlobalContext* globalCtx);
-void func_80169590(GlobalContext* globalCtx, s16 param_2, s16 param_3);
-void func_80169600(GlobalContext* globalCtx, s16 param_2);
-// void func_80169668(void);
+s32 Play_CreateSubCamera(GlobalContext* globalCtx);
+s32 Play_GetActiveCamId(GlobalContext* globalCtx);
+void Play_CameraChangeStatus(GlobalContext* globalCtx, s16 camId, s16 status);
+void Play_ClearCamera(GlobalContext* globalCtx, s16 camId);
Camera* Play_GetCamera(GlobalContext* globalCtx, s16 index);
s32 Play_CameraSetAtEye(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye);
-void func_8016981C(GlobalContext* globalCtx, s16 arg1, Vec3f* arg2, Vec3f* arg3, Vec3f* arg4);
-void func_80169940(GlobalContext* globalCtx, s16 camId, f32 arg2);
-// void func_80169988(void);
-void func_801699D4(GlobalContext* globalCtx, s16 arg1, s16 arg2);
+void Play_CameraSetAtEyeUp(GlobalContext* globalCtx, s16 camId, Vec3f* at, Vec3f* eye, Vec3f* up);
+void Play_CameraSetFov(GlobalContext* globalCtx, s16 camId, f32 fov);
+void Play_CameraSetRoll(GlobalContext* globalCtx, s16 camId, s16 roll);
+void Play_CopyCamera(GlobalContext* globalCtx, s16 dstCamId, s16 srcCamId);
// void func_80169A50(void);
-// void func_80169AC0(void);
+void Play_CameraChangeSetting(GlobalContext* globalCtx, s16 camId, s16 setting);
void func_80169AFC(GlobalContext* globalCtx, s16 camId, s16 arg2);
-// void func_80169C64(void);
-// void func_80169C84(void);
+s16 Play_GetCsCamDataSetting(GlobalContext* globalCtx, s32 camId);
+Vec3s* Play_GetCsCamDataVec3s(GlobalContext* globalCtx, s32 camId);
s16 convert_scene_number_among_shared_scenes(s16 arg0);
void func_80169D40(GlobalContext* globalCtx);
void func_80169DCC(GlobalContext* globalCtx, s32 arg1, u16 arg2, s32 arg3, s32 arg4, Vec3f* arg5, s16 arg6);
@@ -3163,7 +3117,7 @@ s32 Math3D_TriChkPointParaZIntersect(Vec3f* a, Vec3f* b, Vec3f* c, f32 nx, f32 n
s32 Math3D_TriChkLineSegParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x, f32 y, f32* zIntersect, f32 z0, f32 z1);
// void func_8017D1AC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
// void func_8017D220(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
-// void func_8017D2FC(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8);
+s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersect, s32 fromFront);
// void func_8017D404(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9, UNK_TYPE4 param_10, UNK_TYPE4 param_11);
void Math3D_TriSetCoords(TriNorm* tri, Vec3f* pointA, Vec3f* pointB, Vec3f* pointC);
u32 Math3D_IsPointInSphere(Sphere16* sphere, Vec3f* point);
@@ -3375,7 +3329,7 @@ s32 osFlashReadArray(OSIoMesg* mb, s32 priority, u32 pageNum, void* dramAddr, u3
// void func_8018B4F8(void);
// void func_8018B520(void);
// void func_8018B578(void);
-// void func_8018B5D0(void);
+void* AudioHeap_AllocDmaMemory(AudioAllocPool* pool, u32 size);
// void func_8018B608(void);
// void func_8018B640(void);
// void func_8018B69C(void);
@@ -3421,7 +3375,7 @@ s32 osFlashReadArray(OSIoMesg* mb, s32 priority, u32 pageNum, void* dramAddr, u3
// void func_8018EB60(void);
// void func_8018EC4C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_8018EF88(void);
-// void func_8018F220(void);
+s32 AudioLoad_IsFontLoadComplete(s32 bankId);
// void func_8018F298(void);
// void func_8018F310(void);
// void func_8018F388(void);
@@ -3531,61 +3485,43 @@ void Audio_WritebackDCache(void* buf, size_t size);
// void func_80194790(void);
// void func_80194840(void);
// void func_801948B0(void);
-// void func_80194930(void);
-// void func_80194DB0(void);
-// void func_80194E60(void);
-// void func_80194F20(void);
-// void func_80194F84(void);
-// void func_801954CC(void);
-// void func_80195508(void);
-// void func_801955DC(void);
-// void func_801956C0(void);
-// void func_801957B4(void);
-// void func_801958F8(void);
-// void func_80195C40(void);
-// void func_80195C60(void);
-// void func_80195C80(void);
-// void func_80195D84(void);
-// void func_80195DDC(void);
-// void func_80195DEC(void);
-// void func_80195E3C(void);
-// void func_80195EE0(void);
-// void func_80196040(void);
-// void func_8019617C(void);
-// void func_801961BC(void);
-// void func_801961E8(void);
-// void func_80196268(void);
-// void func_801963E8(void);
-// void func_8019641C(void);
-// void func_80196448(void);
-// void func_80196494(void);
-// void func_801964F8(void);
-// void func_801965F0(void);
-// void func_801968C4(void);
-// void func_80196A00(void);
-// void func_80196BC8(void);
-// void func_80196D20(void);
-// void func_80196D7C(void);
-// void func_80196DB4(void);
-// void func_80196FEC(void);
-// void func_80197048(void);
-// void func_80197138(void);
-// void func_80197164(void);
-// void func_80197188(void);
+void AudioPlayback_NoteDisable(Note* note);
+void AudioPlayback_ProcessNotes(void);
+SoundFontSound* AudioPlayback_InstrumentGetSound(Instrument* instrument, s32 semitone);
+Instrument* AudioPlayback_GetInstrumentInner(s32 fontId, s32 instId);
+Drum* AudioPlayback_GetDrum(s32 fontId, s32 drumId);
+SoundFontSound* AudioPlayback_GetSfx(s32 fontId, s32 sfxId);
+s32 AudioPlayback_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value);
+void AudioPlayback_SeqLayerNoteDecay(SequenceLayer* layer);
+void AudioPlayback_SeqLayerNoteRelease(SequenceLayer* layer);
+void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer);
+void AudioPlayback_InitNoteLists(NotePool* pool);
+void AudioPlayback_InitNoteFreeList(void);
+void AudioPlayback_NotePoolClear(NotePool* pool);
+void AudioPlayback_NotePoolFill(NotePool* pool, s32 count);
+void AudioPlayback_AudioListRemove(AudioListItem* item);
+Note* AudioPlayback_AllocNote(SequenceLayer* layer);
+void AudioPlayback_NoteInitAll(void);
+void AudioEffects_SequencePlayerProcessSound(SequencePlayer* seqPlayer);
+void AudioEffects_NoteVibratoUpdate(Note* note);
+void AudioEffects_NoteVibratoInit(Note* note);
+void AudioEffects_NotePortamentoInit(Note* note);
+void AudioEffects_AdsrInit(AdsrState* adsr, AdsrEnvelope* envelope, s16* volOut);
+f32 AudioEffects_AdsrUpdate(AdsrState* adsr);
// void func_801974D0(void);
// void func_80197538(void);
// void func_80197714(void);
// void func_80197880(void);
// void func_801979D8(void);
// void func_80197A54(void);
-// void func_80197AA4(void);
+void AudioSeq_SequenceChannelDisable(SequenceChannel* channel);
// void func_80197B14(void);
// void func_80197C0C(void);
// void func_80197C8C(void);
// void func_80197D24(void);
-// void func_80197D4C(void);
-// void func_80197E08(void);
-// void func_80197E48(void);
+void AudioSeq_SequencePlayerDisable(SequencePlayer* seqPlayer);
+void AudioSeq_AudioListPushBack(AudioListItem* list, AudioListItem* item);
+void* AudioSeq_AudioListPopBack(AudioListItem* list);
// void func_80197E88(void);
// void func_80197F28(void);
// void func_80197F3C(void);
@@ -3649,7 +3585,7 @@ void func_8019C300(s32 arg0);
// void func_8019D488(void);
// void func_8019D4F8(void);
// void func_8019D600(void);
-// void func_8019D758(void);
+void func_8019D758(void);
// void func_8019D864(void);
// void func_8019D8B4(void);
// void func_8019D8E4(void);
@@ -3687,8 +3623,8 @@ void func_8019F88C(Vec3f* arg0, u16 sfxId, UNK_TYPE arg2);
// void func_8019F900(void);
// void func_8019FA18(void);
void func_8019FAD8(Vec3f* param_1, u16 sfxId, f32 param_3);
-// void func_8019FB0C(void);
-// void func_8019FC20(void);
+void func_8019FB0C(Vec3f* arg0, u16 sfxId, f32 arg2, s32 arg3);
+void func_8019FC20(Vec3f* pos, u16 sfxId);
// void func_8019FCB8(void);
// void func_8019FD90(void);
void func_8019FDC8(UNK_PTR arg0, u16 sfxId, UNK_TYPE arg2);
@@ -3710,7 +3646,7 @@ void func_801A0204(s8 seqId);
// void func_801A0554(void);
// void func_801A05F0(void);
void func_801A0654(Vec3f* arg0, u16 sfxId, s32 arg2);
-void func_801A0810(s32* arg0, u16 sfxId, u8 arg2);
+void func_801A0810(Vec3f* arg0, u16 sfxId, u8 arg2);
// void func_801A0868(void);
// void func_801A09D4(void);
// void func_801A0CB0(void);
@@ -3733,7 +3669,7 @@ void func_801A1FB4(u8 playerIdx, Vec3f* pos, u16 seqId, f32 maxDist);
void func_801A246C(u8 param_1, u8 param_2);
// void func_801A2544(void);
// void func_801A257C(void);
-// void func_801A25E4(void);
+void func_801A25E4(u16 seqId, u8 dayMinusOne);
// void func_801A2670(void);
// void func_801A2778(void);
// void func_801A27E8(void);
@@ -3742,8 +3678,8 @@ void func_801A29D4(UNK_TYPE arg0, f32 arg1, UNK_TYPE arg2);
void func_801A2BB8(s32 seqId);
void func_801A2C20(void);
// void func_801A2C44(void);
-// void func_801A2C88(void);
-// void func_801A2D54(void);
+void func_801A2C88(u16 seqId);
+void func_801A2D54(u16 seqId);
s32 Audio_IsSequencePlaying(u8 seqId);
void func_801A2E54(s32 param_1);
void func_801A2ED8(void);
@@ -3756,7 +3692,7 @@ void func_801A31EC(u16 seqId, s8 arg1, u8 arg2);
// void func_801A3238(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE1 param_5);
// void func_801A32CC(void);
// void func_801A3590(void);
-// void func_801A3950(void);
+u8 func_801A3950(s32 playerIndex, s32 isChannelIOSet);
u8 func_801A39F8(void);
// void func_801A3A7C(void);
// void func_801A3AC0(void);
@@ -3768,7 +3704,7 @@ void func_801A3CD8(s8 param_1);
// void func_801A3D98(void);
// void func_801A3E38(void);
// void func_801A3EC0(void);
-void func_801A3F54(s32 arg0);
+void Audio_SetCutsceneFlag(u8 flag);
// void func_801A3F6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_801A3FB4(void);
// void func_801A3FFC(UNK_TYPE1 param_1);
@@ -3781,16 +3717,16 @@ void audio_setBGM(u32 bgmID);
// void func_801A4324(void);
// void func_801A4348(void);
// void func_801A4380(void);
-// void func_801A4428(void);
+void func_801A4428(u8 reverbIndex);
void Audio_PreNMI(void);
// void func_801A44C4(void);
// void func_801A44D4(void);
s32 func_801A46F8(void);
-// void func_801A4748(void);
+void func_801A4748(Vec3f* pos, u16 sfxId);
void func_801A479C(Vec3f* arg0, u16 sfxId, s32 arg2);
-// void func_801A47DC(void);
+void func_801A47DC(u8 channelIndexRange, u8 port, u8 val);
// void func_801A48E0(void);
-void func_801A4A28(s32 arg0);
+void func_801A4A28(u8 natureSeqId);
// void func_801A4B80(void);
void func_801A4C30(void);
// void func_801A4C54(void);
diff --git a/include/macros.h b/include/macros.h
index c5fc2c4aeb..d986dd78ec 100644
--- a/include/macros.h
+++ b/include/macros.h
@@ -1,5 +1,5 @@
-#ifndef _MACROS_H_
-#define _MACROS_H_
+#ifndef MACROS_H
+#define MACROS_H
#include "libc/stdint.h"
#include "ultra64/convert.h"
@@ -21,8 +21,7 @@
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))
#define GET_ACTIVE_CAM(globalCtx) ((globalCtx)->cameraPtrs[(globalCtx)->activeCamera])
-#define MAIN_CAM 0
-#define SUBCAM_FREE 0
+#define CAM_ID_MAIN 0
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
(curState)->nextGameStateInit = (GameStateFunc)newInit; \
@@ -50,9 +49,16 @@
#define CURRENT_DAY (((void)0, gSaveContext.day) % 5)
-#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60)))
+#define TIME_TO_MINUTES(time) (s32)((time) * ((24 * 60) / 0x10000))
+#define CLOCK_TIME(hr, min) (s32)(((hr) * 60 + (min)) * 0x10000 / (24 * 60))
#define CLOCK_TIME_MINUTE (CLOCK_TIME(0, 1))
+#define TIME_TO_MINUTES_F(time) ((time) * ((24.0f * 60.0f) / 0x10000))
+#define CLOCK_TIME_F(hr, min) (((hr) * 60.0f + (min)) * (0x10000 / (24.0f * 60.0f)))
+
+#define TIME_TO_MINUTES_ALT_F(time) ((time) / (24.0f * 60.0f / 0x10000))
+#define CLOCK_TIME_ALT_F(hr, min) (((hr) * 60.0f + (min)) / (24.0f * 60.0f / 0x10000))
+
#define SLOT(item) gItemSlots[item]
#define AMMO(item) gSaveContext.inventory.ammo[SLOT(item)]
#define INV_CONTENT(item) gSaveContext.inventory.items[SLOT(item)]
@@ -70,10 +76,12 @@
#define ALL_EQUIP_VALUE(equip) ((gSaveContext.inventory.equipment & gEquipMasks[equip]) >> gEquipShifts[equip])
#define CUR_EQUIP_VALUE(equip) ((gSaveContext.equips.equipment & gEquipMasks[equip]) >> gEquipShifts[equip])
#define CUR_UPG_VALUE(upg) ((gSaveContext.inventory.upgrades & gUpgradeMasks[upg]) >> gUpgradeShifts[upg])
-#define TAKE_EQUIPPED_ITEM(equip) (gSaveContext.equips.equipment = ((((void)0, gSaveContext.equips.equipment) & (gEquipNegMasks[equip])) | (u16)(0 << gEquipShifts[equip])))
+#define SET_EQUIP_VALUE(equip, value) (gSaveContext.equips.equipment = ((((void)0, gSaveContext.equips.equipment) & (gEquipNegMasks[equip])) | (u16)((u16)(value) << gEquipShifts[equip])))
#define CUR_FORM_EQUIP(button) (gSaveContext.equips.buttonItems[CUR_FORM][button])
#define CHECK_QUEST_ITEM(item) (((void)0, gSaveContext.inventory.questItems) & gBitFlags[item])
#define REMOVE_QUEST_ITEM(item) (gSaveContext.inventory.questItems = (((void)0, gSaveContext.inventory.questItems) & (-1 - gBitFlags[item])))
+#define CHECK_DUNGEON_ITEM(item, dungeonIndex) (gSaveContext.inventory.dungeonItems[(void)0, dungeonIndex] & gBitFlags[item])
+#define DUNGEON_KEY_COUNT(dungeonIndex) (gSaveContext.inventory.dungeonKeys[(void)0, dungeonIndex])
#define CAPACITY(upg, value) gUpgradeCapacities[upg][value]
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg))
@@ -127,6 +135,21 @@ extern GraphicsContext* __gfxCtx;
#define GRAPH_ALLOC(gfxCtx, size) ((void*)((gfxCtx)->polyOpa.d = (Gfx*)((u8*)(gfxCtx)->polyOpa.d - (size))))
+// Custom gbi macro
+#define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \
+ { \
+ 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); \
+ } \
+ (void)0
+
#define ALIGN8(val) (((val) + 7) & ~7)
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
diff --git a/include/regs.h b/include/regs.h
index e39e53d69b..9942242a7d 100644
--- a/include/regs.h
+++ b/include/regs.h
@@ -1,8 +1,8 @@
/* Header taken as placeholder from OoT sister project */
/* Confirm as needed */
-#ifndef _REGS_H_
-#define _REGS_H_
+#ifndef REGS_H
+#define REGS_H
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
#define REG_PAGES 6
diff --git a/include/bgm.h b/include/sequence.h
similarity index 60%
rename from include/bgm.h
rename to include/sequence.h
index c3ac3b1d10..d46e96aea9 100644
--- a/include/bgm.h
+++ b/include/sequence.h
@@ -1,5 +1,5 @@
-#ifndef BGM_H
-#define BGM_H
+#ifndef SEQUENCE_H
+#define SEQUENCE_H
#define NA_BGM_STOP 0x100000FF
@@ -133,4 +133,146 @@
#define NA_BGM_END_CREDITS_2 0x82 // The End/Credits II "STAFFROLL2"
#define NA_BGM_DISABLED 0xFFFF
+typedef enum {
+ /* 0 */ SEQ_PLAYER_BGM_MAIN,
+ /* 1 */ SEQ_PLAYER_FANFARE,
+ /* 2 */ SEQ_PLAYER_SFX,
+ /* 3 */ SEQ_PLAYER_BGM_SUB,
+ /* 4 */ SEQ_PLAYER_NATURE
+} SequencePlayerId;
+
+typedef enum {
+ /* 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 {
+ /* 0x0 */ CHANNEL_IO_PORT_0,
+ /* 0x1 */ CHANNEL_IO_PORT_1,
+ /* 0x2 */ CHANNEL_IO_PORT_2,
+ /* 0x3 */ CHANNEL_IO_PORT_3,
+ /* 0x4 */ CHANNEL_IO_PORT_4,
+ /* 0x5 */ CHANNEL_IO_PORT_5,
+ /* 0x6 */ CHANNEL_IO_PORT_6,
+ /* 0x7 */ CHANNEL_IO_PORT_7
+} ChannelIOPort;
+
+typedef enum {
+ /* 0x0 */ NATURE_CHANNEL_STREAM_0,
+ /* 0x1 */ NATURE_CHANNEL_CRITTER_0,
+ /* 0x2 */ NATURE_CHANNEL_CRITTER_1,
+ /* 0x3 */ NATURE_CHANNEL_CRITTER_2,
+ /* 0x4 */ NATURE_CHANNEL_CRITTER_3,
+ /* 0x5 */ NATURE_CHANNEL_CRITTER_4,
+ /* 0x6 */ NATURE_CHANNEL_CRITTER_5,
+ /* 0x7 */ NATURE_CHANNEL_CRITTER_6,
+ /* 0x8 */ NATURE_CHANNEL_CRITTER_7,
+ /* 0xC */ NATURE_CHANNEL_STREAM_1 = 12,
+ /* 0xD */ NATURE_CHANNEL_UNK,
+ /* 0xE */ NATURE_CHANNEL_RAIN,
+ /* 0xF */ NATURE_CHANNEL_LIGHTNING
+} NatureChannelIdx; // playerIdx = 4
+
+typedef enum {
+ /* 0x00 */ NATURE_AMBIENCE_0,
+ /* 0x01 */ NATURE_AMBIENCE_1,
+ /* 0x02 */ NATURE_AMBIENCE_2,
+ /* 0x03 */ NATURE_AMBIENCE_3,
+ /* 0x04 */ NATURE_AMBIENCE_4,
+ /* 0x05 */ NATURE_AMBIENCE_5,
+ /* 0x06 */ NATURE_AMBIENCE_6,
+ /* 0x07 */ NATURE_AMBIENCE_7,
+ /* 0x08 */ NATURE_AMBIENCE_8,
+ /* 0x09 */ NATURE_AMBIENCE_9,
+ /* 0x0A */ NATURE_AMBIENCE_A,
+ /* 0x0B */ NATURE_AMBIENCE_B,
+ /* 0x0C */ NATURE_AMBIENCE_C,
+ /* 0x0D */ NATURE_AMBIENCE_D,
+ /* 0x0E */ NATURE_AMBIENCE_E,
+ /* 0x0F */ NATURE_AMBIENCE_F,
+ /* 0x10 */ NATURE_AMBIENCE_10,
+ /* 0x11 */ NATURE_AMBIENCE_11,
+ /* 0x12 */ NATURE_AMBIENCE_12,
+ /* 0x13 */ NATURE_AMBIENCE_13
+} NatureAmbienceId; // playerIdx = 4
+
+typedef enum {
+ /* 0x00 */ NATURE_STREAM_0,
+ /* 0x01 */ NATURE_STREAM_1,
+ /* 0x02 */ NATURE_STREAM_2,
+ /* 0x03 */ NATURE_STREAM_3
+} NatureStreamId;
+
+typedef enum {
+ /* 0x00 */ NATURE_CRITTER_00,
+ /* 0x01 */ NATURE_CRITTER_01,
+ /* 0x02 */ NATURE_CRITTER_02,
+ /* 0x03 */ NATURE_CRITTER_03,
+ /* 0x04 */ NATURE_CRITTER_04,
+ /* 0x05 */ NATURE_CRITTER_05,
+ /* 0x06 */ NATURE_CRITTER_06,
+ /* 0x07 */ NATURE_CRITTER_07,
+ /* 0x08 */ NATURE_CRITTER_08,
+ /* 0x09 */ NATURE_CRITTER_09,
+ /* 0x0A */ NATURE_CRITTER_10,
+ /* 0x0B */ NATURE_CRITTER_11,
+ /* 0x0C */ NATURE_CRITTER_12,
+ /* 0x0D */ NATURE_CRITTER_13,
+ /* 0x0E */ NATURE_CRITTER_14,
+ /* 0x0F */ NATURE_CRITTER_15,
+ /* 0x10 */ NATURE_CRITTER_16,
+ /* 0x11 */ NATURE_CRITTER_17,
+ /* 0x12 */ NATURE_CRITTER_18,
+ /* 0x13 */ NATURE_CRITTER_19
+} NatureAmimalId;
+
+#define NATURE_IO_CRITTER_0_TYPE(type) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_0_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_0_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_0_PORT5(reverb) NATURE_CHANNEL_CRITTER_0, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_1_TYPE(type) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_1_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_1_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_1_PORT5(reverb) NATURE_CHANNEL_CRITTER_1, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_2_TYPE(type) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_2_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_2_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_2_PORT5(reverb) NATURE_CHANNEL_CRITTER_2, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_3_TYPE(type) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_3_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_3_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_3_PORT5(reverb) NATURE_CHANNEL_CRITTER_3, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_4_TYPE(type) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_4_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_4_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_4_PORT5(reverb) NATURE_CHANNEL_CRITTER_4, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_5_TYPE(type) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_5_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_5_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_5_PORT5(reverb) NATURE_CHANNEL_CRITTER_5, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_CRITTER_6_TYPE(type) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_CRITTER_6_BEND_PITCH(bend) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_3, bend
+#define NATURE_IO_CRITTER_6_NUM_LAYERS(num) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_4, num
+#define NATURE_IO_CRITTER_6_PORT5(reverb) NATURE_CHANNEL_CRITTER_6, CHANNEL_IO_PORT_5, reverb
+
+#define NATURE_IO_STREAM_0_TYPE(type) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_STREAM_0_PORT3(data) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_3, data
+#define NATURE_IO_STREAM_0_PORT4(data) NATURE_CHANNEL_STREAM_0, CHANNEL_IO_PORT_4, data
+
+#define NATURE_IO_STREAM_1_TYPE(type) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_2, type
+#define NATURE_IO_STREAM_1_PORT3(data) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_3, data
+#define NATURE_IO_STREAM_1_PORT4(data) NATURE_CHANNEL_STREAM_1, CHANNEL_IO_PORT_4, data
+
+#define NATURE_IO_RAIN_PORT4(data) NATURE_CHANNEL_RAIN, CHANNEL_IO_PORT_4, data
+
+#define NATURE_IO_ENTRIES_END 0xFF
+
#endif
diff --git a/include/unk.h b/include/unk.h
index eb31a3874a..0510fcd6a8 100644
--- a/include/unk.h
+++ b/include/unk.h
@@ -1,5 +1,5 @@
-#ifndef _UNK_H_
-#define _UNK_H_
+#ifndef UNK_H
+#define UNK_H
#include "PR/ultratypes.h"
diff --git a/include/variables.h b/include/variables.h
index cabe5d09e4..9ddad27f90 100644
--- a/include/variables.h
+++ b/include/variables.h
@@ -79,7 +79,7 @@ extern float D_80097F90;
// extern UNK_TYPE1 D_80097FA0;
// extern UNK_TYPE1 D_80097FA4;
// extern UNK_TYPE1 D_80097FA5;
-// extern UNK_TYPE4 D_80097FB0;
+extern s32 __osPfsLastChannel;
extern OSViMode osViModeNtscLan1;
extern OSViMode osViModeMpalLan1;
// extern __OSViContext D_80098060[2];
@@ -358,8 +358,7 @@ extern OSMesgQueue viEventQueue;
extern u16 viRetrace;
extern DmaEntry dmadata[1568];
// extern UNK_TYPE1 D_80186028;
-// extern UNK_TYPE1 D_801AAAB0;
-extern u64 gJpegUCode[];
+extern u64 aspMainTextStart[];
extern ActorInit En_A_Obj_InitVars;
extern ColliderCylinderInit enAObjCylinderInit;
extern InitChainEntry enAObjInitVar;
@@ -870,21 +869,13 @@ extern EffectShieldParticleInit shieldParticleInitWood;
// extern UNK_TYPE1 D_801BB0DC;
// extern UNK_TYPE2 D_801BB0FC;
// extern UNK_TYPE1 D_801BB100;
-// extern UNK_TYPE2 D_801BB124;
-// extern UNK_TYPE2 D_801BB128;
+
extern u8 D_801BB12C;
-// extern UNK_TYPE1 D_801BB130;
-extern cutscene_update_func sCsStateHandlers1[5];
-extern cutscene_update_func sCsStateHandlers2[5];
-// extern UNK_TYPE2 D_801BB15C;
-// extern UNK_TYPE4 D_801BB160;
+
extern s801BB170 D_801BB170[118];
// extern UNK_TYPE1 D_801BC210;
extern Gfx D_801BC240[9];
extern Gfx D_801BC288[3];
-// extern UNK_TYPE1 D_801BC3F0;
-// extern UNK_TYPE1 D_801BC400;
-// extern UNK_TYPE1 D_801BC410;
// extern UNK_TYPE1 D_801BC41E;
extern ActorCutscene actorCutscenesGlobalCutscenes[8];
extern s16 actorCutsceneCurrent;
@@ -1630,39 +1621,37 @@ extern MtxF gIdentityMtxF;
// extern u64* initialgspUcodeText;
// extern u64* initialgspUcodeData;
// extern UNK_TYPE1 D_801D1E70;
-// extern UNK_TYPE1 D_801D2E80;
-// extern UNK_TYPE1 D_801D2F80;
-// extern UNK_TYPE1 D_801D3070;
-// extern UNK_TYPE1 D_801D3700;
-// extern UNK_TYPE1 D_801D3D90;
-// extern UNK_TYPE1 D_801D3F90;
-// extern UNK_TYPE1 D_801D4190;
-// extern UNK_TYPE1 D_801D4390;
-// extern UNK_TYPE1 D_801D4590;
+// extern UNK_TYPE1 gLowPassFilterData;
+// extern UNK_TYPE1 gHighPassFilterData;
+// extern UNK_TYPE1 gBandStopFilterData;
+// extern UNK_TYPE1 gBandPassFilterData;
+// extern UNK_TYPE1 gSawtoothWaveSample;
+// extern UNK_TYPE1 gTriangleWaveSample;
+// extern UNK_TYPE1 gSineWaveSample;
+// extern UNK_TYPE1 gSquareWaveSample;
+// extern UNK_TYPE1 gWhiteNoiseSample;
// extern UNK_TYPE1 D_801D4790;
-// extern UNK_TYPE1 D_801D4990;
-// extern UNK_TYPE1 D_801D4B90;
-extern UNK_PTR D_801D4D90;
+// extern UNK_TYPE1 gEighthPulseWaveSample;
+// extern UNK_TYPE1 gQuarterPulseWaveSample;
+extern s16* gWaveSamples[9];
extern UNK_PTR D_801D4D98;
extern UNK_PTR D_801D4DB0;
-// extern UNK_TYPE1 D_801D4DB4;
+extern f32 gBendPitchOneOctaveFrequencies[256];
// extern UNK_TYPE1 D_801D4FB4;
-// extern UNK_TYPE4 D_801D51B4;
+// extern UNK_TYPE4 gBendPitchTwoSemitonesFrequencies;
// extern UNK_TYPE4 D_801D53B4;
-// extern UNK_TYPE1 D_801D55B4;
-// extern UNK_TYPE1 D_801D57B4;
-// extern UNK_TYPE1 D_801D57C4;
-// extern UNK_TYPE1 D_801D57D4;
-// extern UNK_TYPE4 D_801D57E4;
-// extern UNK_TYPE4 D_801D5804;
-// extern UNK_TYPE2 D_801D5824;
-// extern UNK_TYPE2 D_801D58A2;
-// extern UNK_TYPE1 D_801D58AA;
-// extern UNK_TYPE1 D_801D5928;
-// extern UNK_TYPE1 D_801D5B24;
-// extern UNK_TYPE1 D_801D5B28;
-// extern UNK_TYPE1 D_801D5D24;
-// extern UNK_TYPE1 D_801D5D28;
+// extern UNK_TYPE1 gPitchFrequencies;
+// extern UNK_TYPE1 gDefaultShortNoteVelocityTable;
+// extern UNK_TYPE1 gDefaultShortNoteGateTimeTable;
+// extern UNK_TYPE1 gDefaultEnvelope;
+extern NoteSubEu gZeroNoteSub;
+extern NoteSubEu gDefaultNoteSub;
+extern u16 gHeadsetPanQuantization[];
+extern u16 gHeadsetPanQuantization[];
+extern s16 D_801D58A8[];
+extern f32 gHeadsetPanVolume[];
+extern f32 gStereoPanVolume[];
+extern f32 gDefaultPanVolume[];
// extern UNK_TYPE1 D_801D5F24;
// extern UNK_TYPE4 D_801D5FB4;
// extern UNK_TYPE4 D_801D5FB8;
@@ -1695,7 +1684,7 @@ extern UNK_PTR D_801D618C;
// extern UNK_TYPE1 D_801D6648;
// extern UNK_TYPE1 D_801D664C;
// extern UNK_TYPE1 D_801D6650;
-extern f32 D_801D6654;
+extern f32 gSfxVolume;
// extern UNK_TYPE1 D_801D6658;
// extern UNK_TYPE1 D_801D665C;
// extern UNK_TYPE1 D_801D6660;
@@ -1827,7 +1816,7 @@ extern UNK_PTR D_801DB478[7];
// extern UNK_TYPE1 D_801DB494;
// extern UNK_TYPE1 D_801DB49C;
// extern UNK_TYPE2 D_801DB4A0;
-extern UNK_TYPE D_801DB4A4;
+extern Vec3f D_801DB4A4;
extern f32 D_801DB4B0;
extern s8 D_801DB4B8;
// extern UNK_TYPE1 D_801DB4C0;
@@ -3085,15 +3074,11 @@ extern const s16 gAudioTatumInit[];
extern const AudioContextInitSizes gAudioContextInitSizes;
// extern UNK_TYPE4 D_801E1108;
// extern UNK_TYPE4 D_801E110C;
-// extern UNK_TYPE2 D_801E1180;
-// extern UNK_TYPE1 D_801E1420;
-// extern UNK_TYPE2 D_801E1630;
-// extern UNK_TYPE1 D_801E1E40;
-// extern UNK_TYPE1 D_801E1E80;
-extern u64 gspF3DEX2_NoN_fifoTextStart[];
-extern u64 gspF3DEX2_NoN_fifoDataStart[];
-extern u64 gJpegUCodeData[];
-// extern UNK_TYPE1 D_801E3FA0;
+// extern UNK_TYPE2 gSoundFontTable;
+// extern UNK_TYPE1 gSequenceFontTable;
+// extern UNK_TYPE2 gSequenceTable;
+// extern UNK_TYPE1 gSampleBankTable;
+extern u64 aspMainDataStart[];
// bss
// extern UNK_TYPE1 D_801ED890;
@@ -3203,15 +3188,11 @@ extern GameInfo* gGameInfo;
// extern UNK_TYPE1 D_801F3F80;
// extern UNK_TYPE1 D_801F3F83;
// extern UNK_TYPE1 D_801F48C8;
-// extern UNK_TYPE1 D_801F4D40;
-// extern UNK_TYPE2 D_801F4D42;
-// extern UNK_TYPE1 D_801F4D48;
-// extern UNK_TYPE1 D_801F4DC8;
-// extern UNK_TYPE1 D_801F4DCA;
-// extern UNK_TYPE2 D_801F4DCC[8];
-// extern UNK_TYPE1 D_801F4DDC;
-// extern UNK_TYPE1 D_801F4DE0;
+
+extern UNK_TYPE D_801F4DDC;
+extern u8 D_801F4DE0;
extern s16 D_801F4DE2;
+
extern ActorCutscene* actorCutscenes;
extern s16 actorCutsceneCount;
extern u8 actorCutsceneWaiting[16];
@@ -3220,21 +3201,17 @@ extern u8 actorCutsceneNextCutscenes[16];
// extern UNK_TYPE1 D_801F4E20;
extern u8 D_801F4E30;
// extern UNK_TYPE1 D_801F4E31;
-// extern UNK_TYPE1 D_801F4E32;
-// extern UNK_TYPE1 D_801F4E38;
-// extern UNK_TYPE1 D_801F4E3C;
-// extern UNK_TYPE1 D_801F4E40;
-// extern UNK_TYPE1 D_801F4E44;
-// extern UNK_TYPE1 D_801F4E48;
-// extern UNK_TYPE1 D_801F4E4C;
-// extern UNK_TYPE1 D_801F4E4E;
-// extern UNK_TYPE1 D_801F4E50;
-// extern UNK_TYPE1 D_801F4E54;
-// extern UNK_TYPE1 D_801F4E58;
-// extern UNK_TYPE1 D_801F4E5C;
-// extern UNK_TYPE1 D_801F4E60;
-// extern UNK_TYPE1 D_801F4E64;
-// extern UNK_TYPE1 D_801F4E68;
+extern s8 D_801F4E32;
+extern Vec3f D_801F4E38;
+extern f32 D_801F4E44;
+extern f32 D_801F4E48;
+extern s16 D_801F4E4C;
+extern s8 D_801F4E4E;
+extern Vec3f D_801F4E50;
+extern f32 D_801F4E5C;
+extern f32 D_801F4E60;
+extern s16 D_801F4E64;
+extern u8 D_801F4E68;
extern f32 D_801F4E70;
// extern UNK_TYPE1 D_801F4E74;
extern u16 D_801F4E78;
@@ -3354,6 +3331,7 @@ extern FaultAddrConvClient sGraphFaultAddrConvClient;
extern FaultClient sGraphFaultClient;
extern GfxMasterList* gGfxMasterDL;
extern CfbInfo sGraphCfbInfos[3];
+extern OSTime sGraphTaskStartTime;
extern OSMesgQueue sSiIntMsgQ;
extern OSMesg sSiIntMsgBuf[1];
extern u32 gSegments[NUM_SEGMENTS];
@@ -3623,131 +3601,7 @@ extern SoundRequest D_801FE7C0[1];
// extern UNK_TYPE1 D_80200BCC;
// extern UNK_TYPE1 D_80200BCE;
// extern UNK_TYPE1 D_80200BD0;
-// extern UNK_TYPE1 D_80200C70;
-// extern UNK_TYPE1 D_80200C71;
-// extern UNK_TYPE1 D_80200C76;
-// extern UNK_TYPE1 D_80200C78;
-// extern UNK_TYPE1 D_80200C7C;
-// extern UNK_TYPE1 D_80200C80;
-// extern UNK_TYPE1 D_80200C92;
-// extern UNK_TYPE1 D_80200C94;
-// extern UNK_TYPE1 D_80200C98;
-// extern UNK_TYPE1 D_80200C9A;
-// extern UNK_TYPE1 D_80200C9E;
-// extern UNK_TYPE1 D_80200CA0;
-// extern UNK_TYPE1 D_80200CF0;
-// extern UNK_TYPE1 D_80200D38;
-// extern UNK_TYPE1 D_80200D70;
-// extern UNK_TYPE1 D_802011F0;
-// extern UNK_TYPE1 D_8020178C;
-// extern UNK_TYPE1 D_802017B0;
-// extern UNK_TYPE1 D_80201D68;
-// extern UNK_TYPE1 D_80201D6C;
-// extern UNK_TYPE1 D_802023FC;
-// extern UNK_TYPE1 D_80202878;
-// extern UNK_TYPE1 D_80202880;
-// extern UNK_TYPE1 D_802028BC;
-extern OSMesgQueue D_80202980;
-// extern UNK_TYPE1 D_802029D8;
-extern OSMesgQueue D_80202AB0;
-extern OSMesg D_80202AC8[0x10];
-extern OSMesgQueue D_80202B08;
-extern OSMesg D_80202B20[0x10];
-extern OSMesgQueue D_80202B60;
-extern OSMesg D_80202B78[0x40];
-extern OSMesgQueue D_80203278;
-extern OSMesg D_80203290[1];
-// extern UNK_TYPE1 D_80203294;
-// extern UNK_TYPE1 D_802034C0;
-// extern UNK_TYPE1 D_802034C4;
-// extern UNK_TYPE1 D_802034C8;
-// extern UNK_TYPE4 D_802034D0;
-// extern UNK_TYPE1 D_802034D4;
-// extern UNK_TYPE1 D_802034D8;
-// extern UNK_TYPE1 D_802034DC;
-// extern UNK_TYPE1 D_802034E8;
-// extern UNK_TYPE2 D_802034F0;
-// extern UNK_TYPE1 D_802034F8;
-// extern UNK_TYPE1 D_802034FC;
-// extern UNK_TYPE1 D_80203500;
-// extern UNK_TYPE4 D_80203528;
-// extern UNK_TYPE1 D_8020352C;
-// extern UNK_TYPE1 D_8020352E;
-// extern UNK_TYPE1 D_80203530;
-// extern UNK_TYPE4 D_8020360C;
-// extern UNK_TYPE1 D_80203618;
-// extern UNK_TYPE1 D_8020361C;
-// extern UNK_TYPE1 D_80203620;
-// extern UNK_TYPE1 D_80203624;
-// extern UNK_TYPE1 D_80203628;
-// extern UNK_TYPE1 D_80203630;
-// extern UNK_TYPE1 D_80203640;
-// extern UNK_TYPE1 D_80203650;
-// extern UNK_TYPE1 D_80203660;
-// extern UNK_TYPE1 D_80203690;
-// extern UNK_TYPE1 D_802036A0;
-// extern UNK_TYPE1 D_802036B0;
-// extern UNK_TYPE1 D_802036C0;
-// extern UNK_TYPE1 D_802036C4;
-// extern UNK_TYPE1 D_80203794;
-// extern UNK_TYPE1 D_80203798;
-// extern UNK_TYPE1 D_802037D0;
-// extern UNK_TYPE1 D_802037D4;
-// extern UNK_TYPE1 D_802038A4;
-// extern UNK_TYPE1 D_802038A8;
-// extern UNK_TYPE1 D_802038C2;
-// extern UNK_TYPE1 D_802038CE;
-// extern UNK_TYPE1 D_802038E0;
-// extern UNK_TYPE1 D_802038E4;
-// extern UNK_TYPE1 D_80203970;
-// extern UNK_TYPE1 D_802039B4;
-// extern UNK_TYPE1 D_802039B8;
-// extern UNK_TYPE1 D_802039D2;
-// extern UNK_TYPE1 D_802039DE;
-// extern UNK_TYPE1 D_802039F0;
-// extern UNK_TYPE1 D_802039FC;
-// extern UNK_TYPE1 D_80203B80;
-// extern UNK_TYPE1 D_80203B88;
-// extern UNK_TYPE1 D_80203B90;
-// extern UNK_TYPE1 D_80204590;
-// extern UNK_TYPE1 D_80204594;
-// extern UNK_TYPE1 D_80204598;
-// extern UNK_TYPE1 D_802045A4;
-// extern UNK_TYPE1 D_80204FA4;
-// extern UNK_TYPE1 D_80204FA8;
-// extern UNK_TYPE1 D_80204FB4;
-// extern UNK_TYPE1 D_80204FB8;
-// extern UNK_TYPE1 D_80204FC0;
-// extern UNK_TYPE1 D_80204FCC;
-// extern UNK_TYPE1 D_80204FD8;
-// extern UNK_TYPE1 D_80205008;
-// extern UNK_TYPE1 D_80205038;
-// extern UNK_TYPE1 D_802050B9;
-// extern UNK_TYPE1 D_802050C0;
-// extern UNK_TYPE1 D_802050C4;
-// extern UNK_TYPE4 D_802050CC;
-// extern UNK_TYPE4 D_802050D0;
-// extern UNK_TYPE1 D_80205228;
-// extern UNK_TYPE1 D_8020522B;
-// extern UNK_TYPE1 D_80205390;
-// extern UNK_TYPE1 D_802053C8;
-// extern UNK_TYPE1 D_802057B0;
-// extern UNK_TYPE1 D_80205830;
-// extern UNK_TYPE1 D_802084B0;
-// extern UNK_TYPE1 D_80208530;
-// extern UNK_TYPE1 D_80208598;
-// extern UNK_TYPE1 D_802085A8;
-// extern UNK_TYPE1 D_802085B8;
-// extern UNK_TYPE1 D_802085C8;
-// extern UNK_TYPE1 D_802085D8;
-// extern UNK_TYPE1 D_802085F8;
-// extern UNK_TYPE1 D_802085FC;
-// extern UNK_TYPE1 D_80208604;
-// extern UNK_TYPE1 D_8020861C;
-// extern UNK_TYPE1 D_80208634;
-// extern UNK_TYPE1 D_8020864C;
-// extern UNK_TYPE1 D_80208650;
-// extern UNK_TYPE1 D_80208654;
+extern AudioContext gAudioContext; // at 0x80200C70
// extern UNK_TYPE4 D_80208E68;
// extern UNK_TYPE4 D_80208E6C;
// extern UNK_TYPE4 D_80208E70;
@@ -3764,244 +3618,6 @@ extern u8 D_80780000[0x4600];
extern u8 D_80784600[0x56200];
extern u16 gFramebuffer0[SCREEN_HEIGHT][SCREEN_WIDTH];
-// keep objects
-
-extern Gfx D_040008D0[];
-extern Gfx D_040032B0[];
-extern UNK_TYPE D_0400CF58;
-extern UNK_TYPE D_0400CF88;
-extern UNK_TYPE D_0400CF98;
-extern UNK_TYPE D_0400D0A8;
-extern UNK_TYPE D_0400D0B0;
-extern UNK_TYPE D_0400D0C8;
-extern UNK_TYPE D_0400D100;
-extern UNK_TYPE D_0400D218;
-extern UNK_TYPE D_0400D220;
-extern UNK_TYPE D_0400D228;
-extern UNK_TYPE D_0400D2D0;
-extern UNK_TYPE D_0400D3E8;
-extern UNK_TYPE D_0400D3F8;
-extern UNK_TYPE D_0400D488;
-extern UNK_TYPE D_0400D490;
-extern UNK_TYPE D_0400D500;
-extern UNK_TYPE D_0400D520;
-extern UNK_TYPE D_0400D568;
-extern UNK_TYPE D_0400D638;
-extern UNK_TYPE D_0400D660;
-extern UNK_TYPE D_0400D698;
-extern UNK_TYPE D_0400D728;
-extern UNK_TYPE D_0400D9C8;
-extern UNK_TYPE D_0400D9D0;
-extern UNK_TYPE D_0400DA70;
-extern UNK_TYPE D_0400DA88;
-extern UNK_TYPE D_0400DAA8;
-extern UNK_TYPE D_0400DAC0;
-extern UNK_TYPE D_0400DAC8;
-extern UNK_TYPE D_0400DAD8;
-extern UNK_TYPE D_0400DAE0;
-extern UNK_TYPE D_0400DAF0;
-extern UNK_TYPE D_0400DB10;
-extern UNK_TYPE D_0400DB18;
-extern UNK_TYPE D_0400DB30;
-extern UNK_TYPE D_0400DBB0;
-extern UNK_TYPE D_0400DBE8;
-extern UNK_TYPE D_0400DC48;
-extern UNK_TYPE D_0400DC50;
-extern UNK_TYPE D_0400DCA8;
-extern UNK_TYPE D_0400DCD0;
-extern UNK_TYPE D_0400DCD8;
-extern UNK_TYPE D_0400DCF8;
-extern UNK_TYPE D_0400DD30;
-extern UNK_TYPE D_0400DD38;
-extern UNK_TYPE D_0400DD40;
-extern UNK_TYPE D_0400DD50;
-extern UNK_TYPE D_0400DD58;
-extern UNK_TYPE D_0400DD80;
-extern UNK_TYPE D_0400DDB0;
-extern UNK_TYPE D_0400DDF8;
-extern UNK_TYPE D_0400DE00;
-extern UNK_TYPE D_0400DE08;
-extern UNK_TYPE D_0400DE10;
-extern UNK_TYPE D_0400DE28;
-extern UNK_TYPE D_0400DE30;
-extern UNK_TYPE D_0400DE58;
-extern UNK_TYPE D_0400DE60;
-extern UNK_TYPE D_0400DEA0;
-extern UNK_TYPE D_0400DEA8;
-extern UNK_TYPE D_0400DF78;
-extern UNK_TYPE D_0400DF90;
-extern UNK_TYPE D_0400DFA0;
-extern UNK_TYPE D_0400DFD0;
-extern UNK_TYPE D_0400DFE0;
-extern UNK_TYPE D_0400DFE8;
-extern UNK_TYPE D_0400DFF8;
-extern UNK_TYPE D_0400E000;
-extern UNK_TYPE D_0400E070;
-extern UNK_TYPE D_0400E088;
-extern UNK_TYPE D_0400E120;
-extern UNK_TYPE D_0400E150;
-extern UNK_TYPE D_0400E1F0;
-extern UNK_TYPE D_0400E200;
-extern UNK_TYPE D_0400E208;
-extern UNK_TYPE D_0400E270;
-extern UNK_TYPE D_0400E290;
-extern UNK_TYPE D_0400E2A8;
-extern UNK_TYPE D_0400E2B8;
-extern UNK_TYPE D_0400E2C0;
-extern UNK_TYPE D_0400E2D0;
-extern UNK_TYPE D_0400E2D8;
-extern UNK_TYPE D_0400E2E8;
-extern UNK_TYPE D_0400E318;
-extern UNK_TYPE D_0400E398;
-extern UNK_TYPE D_0400E3A0;
-extern UNK_TYPE D_0400E3A8;
-extern UNK_TYPE D_0400E3C0;
-extern UNK_TYPE D_0400E3D8;
-extern UNK_TYPE D_0400E408;
-extern UNK_TYPE D_0400E410;
-extern UNK_TYPE D_0400E418;
-extern UNK_TYPE D_04012860;
-extern UNK_TYPE D_040128BC;
-extern u64 D_04014570[];
-extern UNK_TYPE D_04015FA0;
-extern UNK_TYPE D_04016360;
-extern UNK_TYPE D_0401A4D0;
-extern UNK_TYPE D_0401A538;
-extern Gfx D_0401A620[];
-extern Gfx D_0401C430[];
-extern UNK_TYPE D_0401F740;
-extern UNK_TYPE D_0401F7C0;
-extern UNK_TYPE D_0401F8C0;
-extern UNK_TYPE D_0401FA40;
-extern UNK_TYPE D_04020BB8;
-extern UNK_TYPE D_040221B8;
-extern UNK_TYPE D_04023100;
-extern UNK_TYPE D_04023130;
-extern Gfx D_04023210[];
-extern UNK_TYPE D_04023288;
-extern Gfx D_04023348[];
-extern Gfx D_04023428[];
-extern UNK_TYPE D_04025DD0;
-extern UNK_TYPE D_040281DC;
-extern UNK_TYPE D_04028FEC;
-extern AnimationHeader D_04029140;
-extern Gfx D_04029CB0[];
-extern Gfx D_04029CF0[];
-extern UNK_TYPE D_04029D20;
-extern Gfx D_0402E510[];
-extern AnimationHeader D_0402E65C;
-extern AnimationHeader D_0402F0EC;
-extern Gfx D_04030100[]; // Floor shockwave ring
-extern Gfx D_040301B0[];
-extern UNK_TYPE D_04032270;
-extern UNK_TYPE D_04035710;
-extern UNK_TYPE D_040367B0;
-extern UNK_TYPE D_040377B0;
-extern UNK_TYPE D_04037850;
-extern Gfx D_040378F0[]; // gExplosionSplashTex1
-extern Gfx D_04037DF0[]; // gExplosionSplashTex2
-extern Gfx D_040382F0[]; // gExplosionSplashTex3
-extern Gfx D_040387F0[]; // gExplosionSplashTex4
-extern Gfx D_04038CF0[]; // gExplosionSplashTex5
-extern Gfx D_040391F0[]; // gExplosionSplashTex6
-extern Gfx D_040396F0[]; // gExplosionSplashTex7
-extern Gfx D_04039BF0[]; // gExplosionSplashTex8
-extern Gfx D_0403A0F0[]; // gExplosionSplashDL
-extern UNK_TYPE D_0403C190;
-extern UNK_TYPE D_0403F230;
-extern UNK_TYPE D_04044300;
-extern Gfx D_04048DF0[];
-extern UNK_TYPE D_04050D10;
-extern Gfx D_04051180[];
-extern Gfx D_04051238[];
-extern AnimationHeader D_0405140C;
-extern Gfx D_040527F0[];
-extern Gfx D_040528B0[];
-extern Gfx D_04054A90[];
-extern u64 D_04054F20[];
-extern UNK_TYPE D_04055628;
-extern Gfx D_04057B10[];
-extern Gfx D_04058BA0[];
-extern Gfx D_04089070[];
-extern TexturePtr D_0408DBE0[]; // gDust1Tex
-extern TexturePtr D_0408DFE0[]; // gDust2Tex
-extern TexturePtr D_0408E3E0[]; // gDust3Tex
-extern TexturePtr D_0408E7E0[]; // gDust4Tex
-extern TexturePtr D_0408EBE0[]; // gDust5Tex
-extern TexturePtr D_0408EFE0[]; // gDust6Tex
-extern TexturePtr D_0408F3E0[]; // gDust7Tex
-extern TexturePtr D_0408F7E0[]; // gDust8Tex
-extern UNK_TYPE D_04050550;
-extern Gfx D_04050648[];
-extern Gfx D_040506E0[];
-extern UNK_TYPE D_040510B0;
-extern UNK_TYPE D_04054940;
-extern Gfx D_0405AAB0[];
-extern UNK_TYPE D_0405B6F0;
-extern UNK_TYPE D_0405BEF0;
-extern UNK_TYPE D_0405C6F0;
-extern UNK_TYPE D_0405CEF0;
-extern UNK_TYPE D_0405E6F0;
-extern Gfx D_0405F6F0[];
-extern UNK_TYPE D_0405F7C0;
-extern UNK_TYPE D_0405FFC0;
-extern UNK_TYPE D_040607C0;
-extern UNK_TYPE D_04060FC0;
-extern UNK_TYPE D_040617C0;
-extern UNK_TYPE D_04061FC0;
-extern UNK_TYPE D_04061FE0;
-extern UNK_TYPE D_04062000;
-extern UNK_TYPE D_04062020;
-extern UNK_TYPE D_04062040;
-extern UNK_TYPE D_04062060;
-extern Gfx D_040622C0[];
-extern Gfx D_0406AB30[];
-extern UNK_TYPE D_0406B730;
-extern UNK_TYPE D_0406BB0C;
-extern UNK_TYPE D_0406F380;
-extern Gfx D_040706E0[];
-extern UNK_TYPE D_04073F00;
-extern UNK_TYPE D_04075400;
-extern Gfx D_04076BC0[];
-extern UNK_TYPE D_04079B10;
-extern Gfx D_0407AB10[]; // sun (sparkles when small) displaylist
-extern Gfx D_0407AB58[];
-extern UNK_TYPE D_0407AFB0;
-extern UNK_TYPE D_0407D650;
-extern UNK_TYPE D_0407F218;
-extern UNK_TYPE D_040815D0;
-extern UNK_TYPE D_04081628;
-extern UNK_TYPE D_04083534;
-extern UNK_TYPE D_04091BE0;
-extern UNK_TYPE D_04091CE0;
-extern TexturePtr D_04091DE0[];
-extern TexturePtr D_04091FE0[];
-extern TexturePtr D_040921E0[];
-extern TexturePtr D_040923E0[];
-
-extern Gfx D_05000C40[];
-extern UNK_TYPE D_05001D20;
-extern Gfx D_050061E8[];
-extern Gfx D_05006420[];
-extern Gfx D_050066B0[];
-extern UNK_TYPE D_05007498;
-extern Gfx D_05007890[];
-extern Gfx D_050078A0[];
-extern Gfx D_05007938[];
-extern Gfx D_05007980[];
-extern UNK_TYPE D_05007E00;
-extern UNK_TYPE D_05008018;
-extern UNK_TYPE D_050085F0;
-extern Gfx D_05017EA0[]; // pot displaylist
-extern Gfx D_05018090[]; // pot break shard displaylist
-extern UNK_TYPE D_050182A8;
-extern UNK_TYPE D_0501B508;
-extern UNK_TYPE D_0501C058;
-extern Gfx D_0501D980[];
-extern Gfx D_050219E0[];
-extern UNK_TYPE D_05023008;
-extern UNK_TYPE D_0502324C;
-
// other segments
extern GfxMasterList D_0E000000;
extern Mtx D_01000000;
diff --git a/include/z64.h b/include/z64.h
index 1aba77e7af..4c875ca7ec 100644
--- a/include/z64.h
+++ b/include/z64.h
@@ -1,5 +1,5 @@
-#ifndef _Z64_H_
-#define _Z64_H_
+#ifndef Z64_H
+#define Z64_H
#include "libc/math.h"
#include "libc/stdarg.h"
@@ -17,9 +17,9 @@
#include "scheduler.h"
#include "xstdio.h"
-#include "bgm.h"
#include "color.h"
#include "ichain.h"
+#include "sequence.h"
#include "sfx.h"
#include "z64actor.h"
@@ -34,6 +34,7 @@
#include "z64light.h"
#include "z64math.h"
#include "z64object.h"
+#include "z64ocarina.h"
#include "z64player.h"
#include "z64scene.h"
#include "z64save.h"
@@ -66,7 +67,7 @@
typedef struct {
/* 0x0 */ s16 priority; // Lower means higher priority. -1 means it ignores priority
/* 0x2 */ s16 length;
- /* 0x4 */ s16 unk4;
+ /* 0x4 */ s16 csCamSceneDataId; // Index of CsCameraEntry to use. Negative indices use sGlobalCamDataSettings. Indices 0 and above use CsCameraEntry from scene
/* 0x6 */ s16 unk6;
/* 0x8 */ s16 additionalCutscene;
/* 0xA */ u8 sound;
@@ -107,24 +108,6 @@ typedef struct {
/* 0x8 */ CameraModeParams* modes;
} CameraStateParams; // size = 0xC
-typedef struct {
- /* 0x00 */ u8 sceneCsCount;
- /* 0x04 */ void* segment;
- /* 0x08 */ u8 state;
- /* 0x0C */ f32 unk_0C;
- /* 0x10 */ u16 frames;
- /* 0x12 */ u16 unk_12;
- /* 0x14 */ s32 unk_14;
- /* 0x18 */ u16 unk_18;
- /* 0x1A */ u8 unk_1A;
- /* 0x1B */ u8 unk_1B;
- /* 0x1C */ CutsceneCameraPoint* cameraFocus;
- /* 0x20 */ CutsceneCameraPoint* cameraPosition;
- /* 0x24 */ CsCmdActorAction* linkAction;
- /* 0x28 */ CsCmdActorAction* npcActions[10]; // "npcdemopnt"
- /* 0x50 */ CutsceneEntry* sceneCsList;
-} CutsceneContext; // size = 0x54
-
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
@@ -167,8 +150,10 @@ typedef struct {
/* 0x5 */ Color_RGB8 envColor;
} FireObjLightParams; // size = 0x8
+#define FONT_CHAR_TEX_WIDTH 16
+#define FONT_CHAR_TEX_HEIGHT 16
//! @TODO: Make this use `sizeof(AnyFontTextureSymbol)`
-#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2)
+#define FONT_CHAR_TEX_SIZE ((16 * 16) / 2) // 16x16 I4 texture
// Font textures are loaded into here
typedef struct {
@@ -492,13 +477,12 @@ typedef struct {
/* 0x0E0 */ Mtx unkE0;
/* 0x120 */ Mtx* projectionPtr;
/* 0x124 */ Mtx* viewingPtr;
- /* 0x128 */ Vec3f quakeRot;
- /* 0x134 */ Vec3f quakeScale;
- /* 0x140 */ f32 quakeSpeed;
- /* 0x144 */ Vec3f currQuakeRot;
- /* 0x150 */ Vec3f currQuakeScale;
+ /* 0x128 */ Vec3f distortionDirRot;
+ /* 0x134 */ Vec3f distortionScale;
+ /* 0x140 */ f32 distortionSpeed;
+ /* 0x144 */ Vec3f curDistortionDirRot;
+ /* 0x150 */ Vec3f curDistortionScale;
/* 0x15C */ u16 normal;
- /* 0x15E */ UNK_TYPE1 pad15E[0x2];
/* 0x160 */ u32 flags; // bit 3: Render to an orthographic perspective
/* 0x164 */ UNK_TYPE4 unk164;
} View; // size = 0x168
@@ -707,7 +691,7 @@ typedef enum {
typedef struct {
/* 0x00 */ u16 unk_0;
- /* 0x02 */ u16 unk_2;
+ /* 0x02 */ u16 timeIncrement;
/* 0x04 */ f32 unk_4;
/* 0x08 */ f32 unk_8;
/* 0x0C */ f32 unk_C;
@@ -716,8 +700,8 @@ typedef struct {
/* 0x12 */ u8 unk_12;
/* 0x13 */ u8 unk_13;
/* 0x14 */ u8 unk_14;
- /* 0x15 */ u8 unk_15;
- /* 0x16 */ u8 unk_16;
+ /* 0x15 */ u8 skyboxDisabled;
+ /* 0x16 */ u8 sunMoonDisabled;
/* 0x17 */ u8 unk_17;
/* 0x18 */ u8 unk_18;
/* 0x19 */ u8 unk_19;
@@ -738,7 +722,7 @@ typedef struct {
/* 0x80 */ OSMesg unk_80;
/* 0x84 */ f32 unk_84;
/* 0x88 */ f32 unk_88;
- /* 0x8C */ LightSettings2 unk_8C;
+ /* 0x8C */ EnvLightSettings lightSettings;
/* 0xA8 */ f32 unk_A8;
/* 0xAC */ Vec3s windDir;
/* 0xB4 */ f32 windSpeed;
@@ -747,18 +731,18 @@ typedef struct {
/* 0xC0 */ u8 unk_C0;
/* 0xC1 */ u8 unk_C1;
/* 0xC2 */ u8 unk_C2;
- /* 0xC3 */ u8 unk_C3;
+ /* 0xC3 */ u8 lightSettingOverride;
/* 0xC4 */ LightSettings unk_C4;
/* 0xDA */ u16 unk_DA;
- /* 0xDC */ f32 unk_DC;
+ /* 0xDC */ f32 lightBlend;
/* 0xE0 */ u8 unk_E0;
/* 0xE1 */ u8 unk_E1;
/* 0xE2 */ s8 unk_E2;
/* 0xE3 */ u8 unk_E3; // modified by unused func in EnWeatherTag
/* 0xE4 */ u8 unk_E4;
- /* 0xE5 */ u8 unk_E5;
- /* 0xE6 */ u8 unk_E6[4];
- /* 0xEA */ u8 unk_EA;
+ /* 0xE5 */ u8 fillScreen;
+ /* 0xE6 */ u8 screenFillColor[4];
+ /* 0xEA */ u8 sandstormState;
/* 0xEB */ u8 unk_EB;
/* 0xEC */ u8 unk_EC;
/* 0xED */ u8 unk_ED;
@@ -854,15 +838,15 @@ typedef struct {
/* 0x11F0B */ UNK_TYPE1 pad11F0B[0x5];
/* 0x11F10 */ s32 unk11F10;
/* 0x11F14 */ UNK_TYPE1 pad11F14[0xE];
- /* 0x11F22 */ u8 unk11F22;
+ /* 0x11F22 */ u8 msgMode;
/* 0x11F23 */ UNK_TYPE1 pad11F23[0xFD];
/* 0x12020 */ u8 unk12020;
/* 0x12021 */ u8 choiceIndex;
/* 0x12022 */ u8 unk12022;
/* 0x12023 */ u8 unk12023;
/* 0x12024 */ UNK_TYPE1 unk12024[0x6];
- /* 0x1202A */ u16 unk1202A;
- /* 0x1202C */ UNK_TYPE1 pad1202C[0x2];
+ /* 0x1202A */ u16 ocarinaMode;
+ /* 0x1202C */ u16 ocarinaAction;
/* 0x1202E */ u16 unk1202E;
/* 0x12030 */ s16 unk_12030;
/* 0x12032 */ UNK_TYPE1 unk_12032[0x2];
@@ -870,10 +854,15 @@ typedef struct {
/* 0x12044 */ s16 unk12044;
/* 0x12046 */ UNK_TYPE1 pad12046[0x2];
/* 0x12048 */ u8 unk12048; // EnKakasi
- /* 0x12049 */ UNK_TYPE1 pad12049[0x21];
+ /* 0x12049 */ UNK_TYPE1 pad12049[0xB];
+ /* 0x12054 */ s16 unk12054; // First digit in lottery code guess
+ /* 0x12056 */ s16 unk12056; // Second digit lottery code guess
+ /* 0x12058 */ s16 unk12058; // Third digit lottery code guess
+ /* 0x1205A */ UNK_TYPE1 pad1205A[0x10];
/* 0x1206A */ s16 unk1206A;
/* 0x1206C */ s32 unk1206C;
- /* 0x12070 */ UNK_TYPE1 pad12070[0x8];
+ /* 0x12070 */ s32 unk12070;
+ /* 0x12074 */ UNK_TYPE1 pad12074[0x4];
/* 0x12078 */ s32 bankRupeesSelected;
/* 0x1207C */ s32 bankRupees;
/* 0x12080 */ UNK_TYPE1 pad12080[0x31];
@@ -988,8 +977,6 @@ typedef void (*ColChkApplyFunc)(GlobalContext*, CollisionCheckContext*, Collider
typedef void (*ColChkVsFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Collider*);
typedef s32 (*ColChkLineFunc)(GlobalContext*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*);
-typedef void(*cutscene_update_func)(GlobalContext* globalCtx, CutsceneContext* cCtxt);
-
typedef void(*draw_func)(GlobalContext* globalCtx, s16 index);
typedef void(*room_draw_func)(GlobalContext* globalCtx, Room* room, u32 flags);
@@ -1064,7 +1051,7 @@ typedef struct Camera {
/* 0x15E */ s16 animState;
/* 0x160 */ s16 unk160;
/* 0x162 */ s16 timer;
- /* 0x164 */ s16 thisIdx;
+ /* 0x164 */ s16 camId;
/* 0x166 */ s16 prevCamDataIdx;
/* 0x168 */ s16 unk168;
/* 0x16A */ s16 unk16A;
@@ -1093,7 +1080,7 @@ typedef struct {
/* 0x1A */ s16 speed;
/* 0x1C */ s16 isShakePerpendicular;
/* 0x1E */ s16 countdown;
- /* 0x20 */ s16 cameraPtrsIdx;
+ /* 0x20 */ s16 camId;
} QuakeRequest; // size = 0x24
typedef struct {
@@ -1122,13 +1109,13 @@ typedef struct {
/* 0x4 */ s32 type; // bitfield, highest set bit determines type
/* 0x8 */ s16 countdown;
/* 0xA */ s16 state;
-} Quake2Context; // size = 0xC
+} DistortionContext; // size = 0xC
typedef enum {
- QUAKE2_INACTIVE,
- QUAKE2_ACTIVE,
- QUAKE2_SETUP,
-} Quake2State;
+ /* 0 */ DISTORTION_INACTIVE,
+ /* 1 */ DISTORTION_ACTIVE,
+ /* 2 */ DISTORTION_SETUP,
+} DistortionState;
typedef struct {
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
@@ -1308,7 +1295,7 @@ struct GlobalContext {
/* 0x187B0 */ MtxF viewProjectionMtxF;
/* 0x187F0 */ Vec3f unk_187F0;
/* 0x187FC */ MtxF billboardMtxF;
- /* 0x1883C */ Mtx* unk_1883C;
+ /* 0x1883C */ Mtx* billboardMtx;
/* 0x18840 */ u32 gameplayFrames;
/* 0x18844 */ u8 unk_18844;
/* 0x18845 */ u8 unk_18845;
@@ -1317,7 +1304,7 @@ struct GlobalContext {
/* 0x1884C */ RomFile* roomList;
/* 0x18850 */ ActorEntry* linkActorEntry;
/* 0x18854 */ ActorEntry* setupActorList;
- /* 0x18858 */ void* unk_18858;
+ /* 0x18858 */ CsCamData* csCamData;
/* 0x1885C */ EntranceEntry* setupEntranceList;
/* 0x18860 */ u16* setupExitList;
/* 0x18864 */ Path* setupPathList;
@@ -1368,36 +1355,19 @@ typedef struct {
/* 0x24 */ s16 unk_24;
} struct_800BD888_arg1; // size = 0x28
-typedef struct EnHy {
- /* 0x000 */ Actor actor;
- /* 0x144 */ UNK_TYPE1 unk_144[0x8];
- /* 0x14C */ SkelAnime skelAnime;
- /* 0x190 */ s8 unk190;
- /* 0x191 */ s8 unk191;
- /* 0x192 */ s8 unk192;
- /* 0x193 */ s8 animObjIndex;
- /* 0x194 */ ColliderCylinder collider;
- /* 0x1E0 */ UNK_TYPE1 unk_1E0[0x4];
- /* 0x1E4 */ Path* path;
- /* 0x1E8 */ s16 curPoint;
- /* 0x1EA */ UNK_TYPE1 unk_1EA[0x2];
- /* 0x1EC */ Vec3f leftFootPos;
- /* 0x1F8 */ Vec3f rightFootPos;
- /* 0x204 */ u8 isLeftFootOnGround;
- /* 0x205 */ u8 isRightFootOnGround;
- /* 0x206 */ Vec3s jointTable[16];
- /* 0x266 */ Vec3s morphTable[16];
- /* 0x2C6 */ UNK_TYPE1 unk_2C6[0x120];
- /* 0x3E6 */ s16 eyeTexIndex;
- /* 0x3E8 */ s16 blinkTimer;
-} EnHy;
-
typedef struct {
/* 0x0 */ u8 unk0;
/* 0x4 */ s32 unk4;
- /* 0x8 */ s32 unk8;
+ /* 0x8 */ s32 unk8; // game script pointer?
} struct_80133038_arg2; // size = 0xC
+
+typedef enum {
+ /* 0 */ SUBS_CUTSCENE_SET_UNK_LINK_FIELDS,
+ /* 1 */ SUBS_CUTSCENE_NORMAL,
+ /* 2 */ SUBS_CUTSCENE_SET_FLAG
+} SubSCutsceneType;
+
typedef s32 (*func_8013E748_arg6)(struct GlobalContext*, Actor*, Vec3s*);
typedef s32 (*VerifyActor)(struct GlobalContext*, Actor*, Actor*, void*);
@@ -1522,4 +1492,27 @@ enum fram_mode {
FRAM_MODE_STATUS
};
+typedef struct {
+ /* 0x00 */ s16 unk_00;
+ /* 0x02 */ s16 unk_02;
+ /* 0x04 */ s16 unk_04;
+ /* 0x06 */ s16 unk_06;
+ /* 0x08 */ s16 unk_08;
+ /* 0x0A */ s16 unk_0A;
+ /* 0x0C */ s16 unk_0C;
+ /* 0x0E */ UNK_TYPE1 unk_0E[0x02];
+ /* 0x10 */ UNK_TYPE1 unk_10[0x2C];
+ /* 0x3C */ UNK_TYPE1 unk_3C[0x01];
+ /* 0x3D */ u8 unk_3D;
+ /* 0x3E */ UNK_TYPE1 unk_3E[0x02];
+ /* 0x40 */ UNK_TYPE1 unk_40[0x2C];
+ /* 0x6C */ UNK_TYPE1 unk_6C[0x01];
+ /* 0x6D */ u8 unk_6D;
+ /* 0x6E */ UNK_TYPE1 unk_6E[0x02];
+ /* 0x70 */ UNK_PTR unk_70;
+ /* 0x74 */ UNK_PTR unk_74;
+ /* 0x78 */ UNK_PTR unk_78;
+ /* 0x7C */ Camera* camera;
+} struct_801F4D48; // size = 0x80
+
#endif
diff --git a/include/z64actor.h b/include/z64actor.h
index 3ed9e2a335..7a7556ed00 100644
--- a/include/z64actor.h
+++ b/include/z64actor.h
@@ -18,7 +18,6 @@ struct Lights;
struct CollisionPoly;
struct EnBox;
-struct EnDoor;
typedef void(*ActorFunc)(struct Actor* this, struct GlobalContext* globalCtx);
@@ -298,24 +297,6 @@ typedef enum {
/* 0x0C */ ACTORCAT_MAX
} ActorType;
-typedef struct {
- /* 0x00 */ AnimationHeader* animation;
- /* 0x04 */ f32 playSpeed;
- /* 0x08 */ f32 startFrame;
- /* 0x0C */ f32 frameCount;
- /* 0x10 */ u8 mode;
- /* 0x14 */ f32 morphFrames;
-} ActorAnimationEntry; // size = 0x18
-
-typedef struct {
- /* 0x00 */ AnimationHeader* animationSeg;
- /* 0x04 */ f32 playbackSpeed;
- /* 0x08 */ s16 frame;
- /* 0x0A */ s16 frameCount;
- /* 0x0C */ u8 mode;
- /* 0x0E */ s16 transitionRate;
-} ActorAnimationEntryS; // size = 0x10
-
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ f32 unkC;
@@ -1169,6 +1150,8 @@ typedef enum {
#define ACTOR_FLAG_20000000 (1 << 29)
//
#define ACTOR_FLAG_40000000 (1 << 30)
+//
+#define ACTOR_FLAG_80000000 (1 << 31)
typedef enum {
/* 0x00 */ CLEAR_TAG_SMALL_EXPLOSION,
@@ -1177,7 +1160,7 @@ typedef enum {
/* 0x03 */ CLEAR_TAG_SMALL_LIGHT_RAYS,
/* 0x04 */ CLEAR_TAG_LARGE_LIGHT_RAYS,
/* 0x23 */ CLEAR_TAG_SPLASH = 35,
- /* 0xC8 */ CLEAR_TAG_SMOKE = 200,
+ /* 0xC8 */ CLEAR_TAG_SMOKE = 200
} ClearTagType;
#endif
diff --git a/include/z64animation.h b/include/z64animation.h
index 8d6df14c84..10b145d38a 100644
--- a/include/z64animation.h
+++ b/include/z64animation.h
@@ -204,26 +204,26 @@ typedef struct SkelAnime {
} SkelAnime; // size = 0x44
typedef s32 (*OverrideLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- struct Actor* actor);
+ struct Actor* thisx);
typedef void (*PostLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
- struct Actor* actor);
+ struct Actor* thisx);
typedef s32 (*OverrideLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- struct Actor* actor, Gfx** gfx);
+ struct Actor* thisx, Gfx** gfx);
typedef void (*PostLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
- struct Actor* actor, Gfx** gfx);
+ struct Actor* thisx, Gfx** gfx);
typedef s32 (*OverrideLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- struct Actor* actor);
+ struct Actor* thisx);
typedef void (*PostLimbDrawFlex)(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList1, Gfx** dList2, Vec3s* rot,
- struct Actor* actor);
+ struct Actor* thisx);
-typedef void (*UnkActorDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor);
+typedef void (*TransformLimbDrawOpa)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx);
-typedef void (*UnkActorDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* actor, Gfx** gfx);
+typedef void (*TransformLimbDraw)(struct GlobalContext* globalCtx, s32 limbIndex, struct Actor* thisx, Gfx** gfx);
typedef void (*AnimationEntryCallback)(struct GlobalContext*, AnimationEntryData*);
@@ -316,11 +316,29 @@ typedef struct {
/* 0x008 */ Gfx* unk_8;
} Struct_800A5E28; // size = 0xC
-typedef struct struct_80B8E1A8 {
- /* 0x00 */ AnimationHeader* animationSeg;
- /* 0x04 */ f32 playbackSpeed;
+typedef struct {
+ /* 0x00 */ AnimationHeader* animation;
+ /* 0x04 */ f32 playSpeed;
+ /* 0x08 */ f32 startFrame;
+ /* 0x0C */ f32 frameCount;
+ /* 0x10 */ u8 mode;
+ /* 0x14 */ f32 morphFrames;
+} AnimationInfo; // size = 0x18
+
+typedef struct {
+ /* 0x00 */ AnimationHeader* animation;
+ /* 0x04 */ f32 playSpeed;
+ /* 0x08 */ s16 startFrame;
+ /* 0x0A */ s16 frameCount;
+ /* 0x0C */ u8 mode;
+ /* 0x0E */ s16 morphFrames;
+} AnimationInfoS; // size = 0x10
+
+typedef struct AnimationSpeedInfo {
+ /* 0x00 */ AnimationHeader* animation;
+ /* 0x04 */ f32 playSpeed;
/* 0x08 */ u8 mode;
- /* 0x0C */ f32 transitionRate;
-} struct_80B8E1A8; // size = 0x10
+ /* 0x0C */ f32 morphFrames;
+} AnimationSpeedInfo; // size = 0x10
#endif
diff --git a/include/z64audio.h b/include/z64audio.h
index bc6d81a712..db43aad488 100644
--- a/include/z64audio.h
+++ b/include/z64audio.h
@@ -11,6 +11,8 @@
#define MAX_CHANNELS_PER_BANK 3
+#define AUDIO_LERPIMP(v0, v1, t) (v0 + ((v1 - v0) * t))
+
#define ADSR_DISABLE 0
#define ADSR_HANG -1
#define ADSR_GOTO -2
@@ -18,6 +20,21 @@
#define AIBUF_LEN 0x580
+typedef enum {
+ /* 0 */ AUDIO_FS_STEREO,
+ /* 1 */ AUDIO_FS_HEADSET,
+ /* 2 */ AUDIO_FS_SURROUND,
+ /* 3 */ AUDIO_FS_MONO
+} AudioFileSelectOption;
+
+typedef enum {
+ /* 0 */ AUDIO_MODE_STEREO,
+ /* 1 */ AUDIO_MODE_HEADSET,
+ /* 2 */ AUDIO_MODE_UNK,
+ /* 3 */ AUDIO_MODE_MONO,
+ /* 4 */ AUDIO_MODE_SURROUND,
+} AudioSoundMode;
+
typedef enum {
/* 0 */ ADSR_STATE_DISABLED,
/* 1 */ ADSR_STATE_INITIAL,
@@ -61,63 +78,6 @@ typedef enum {
/* 3 */ CACHE_PERMANENT
} AudioCacheType;
-typedef enum {
- /* 0 */ OCARINA_SONG_SONATA,
- /* 1 */ OCARINA_SONG_GORON_LULLABY,
- /* 2 */ OCARINA_SONG_NEW_WAVE,
- /* 3 */ OCARINA_SONG_ELEGY,
- /* 4 */ OCARINA_SONG_OATH,
- /* 5 */ OCARINA_SONG_SARIAS,
- /* 6 */ OCARINA_SONG_TIME,
- /* 7 */ OCARINA_SONG_HEALING,
- /* 8 */ OCARINA_SONG_EPONAS,
- /* 9 */ OCARINA_SONG_SOARING,
- /* 10 */ OCARINA_SONG_STORMS,
- /* 11 */ OCARINA_SONG_SUNS,
- /* 12 */ OCARINA_SONG_INVERTED_TIME,
- /* 13 */ OCARINA_SONG_DOUBLE_TIME,
- /* 14 */ OCARINA_SONG_GORON_LULLABY_INTRO,
- /* 15 */ OCARINA_SONG_WIND_FISH_HUMAN, // "Ballad of the Wind Fish"
- /* 16 */ OCARINA_SONG_WIND_FISH_GORON,
- /* 17 */ OCARINA_SONG_WIND_FISH_ZORA,
- /* 18 */ OCARINA_SONG_WIND_FISH_DEKU,
- /* 19 */ OCARINA_SONG_EVAN_PART1,
- /* 20 */ OCARINA_SONG_EVAN_PART2,
- /* 21 */ OCARINA_SONG_ZELDAS_LULLABY,
- /* 22 */ OCARINA_SONG_SCARECROW,
- /* 23 */ OCARINA_SONG_TERMINA_WALL,
- /* 24 */ OCARINA_SONG_MAX,
-} OcarinaSongId;
-
-typedef enum {
- /* 0 */ OCARINA_BTN_A,
- /* 1 */ OCARINA_BTN_C_DOWN,
- /* 2 */ OCARINA_BTN_C_RIGHT,
- /* 3 */ OCARINA_BTN_C_LEFT,
- /* 4 */ OCARINA_BTN_C_UP,
- /* -1 */ OCARINA_BTN_INVALID = 0xFF
-} OcarinaButtonIdx;
-
-typedef enum {
- /* 0x0 */ NOTE_C4,
- /* 0x1 */ NOTE_DFLAT4,
- /* 0x2 */ NOTE_D4,
- /* 0x3 */ NOTE_EFLAT4,
- /* 0x4 */ NOTE_E4,
- /* 0x5 */ NOTE_F4,
- /* 0x6 */ NOTE_GFLAT4,
- /* 0x7 */ NOTE_G4,
- /* 0x8 */ NOTE_AFLAT4,
- /* 0x9 */ NOTE_A4,
- /* 0xA */ NOTE_BFLAT4,
- /* 0xB */ NOTE_B4,
- /* 0xC */ NOTE_C5,
- /* 0xD */ NOTE_DFLAT5,
- /* 0xE */ NOTE_D5,
- /* 0xF */ NOTE_EFLAT5,
- /* -1 */ NOTE_NONE = 0xFF
-} OcarinaNoteIdx;
-
typedef s32 (*DmaHandler)(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
struct Note;
@@ -154,10 +114,10 @@ typedef struct NotePool {
// extrapolates exponentially in the wrong direction in that case, but that
// doesn't prevent seqplayer from doing it, AFAICT.
typedef struct {
- /* 0x00 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
- /* 0x02 */ u16 cur;
- /* 0x04 */ u16 speed;
- /* 0x08 */ f32 extent;
+ /* 0x0 */ u8 mode; // bit 0x80 denotes something; the rest are an index 0-5
+ /* 0x2 */ u16 cur;
+ /* 0x4 */ u16 speed;
+ /* 0x8 */ f32 extent;
} Portamento; // size = 0xC
typedef struct {
@@ -298,7 +258,7 @@ typedef struct {
/* 0x000 */ u8 fontDmaInProgress : 1;
/* 0x000 */ u8 recalculateVolume : 1;
/* 0x000 */ u8 stopScript : 1;
- /* 0x000 */ u8 unk_0b1 : 1;
+ /* 0x000 */ u8 applyBend : 1;
/* 0x001 */ u8 state;
/* 0x002 */ u8 noteAllocPolicy;
/* 0x003 */ u8 muteBehavior;
@@ -324,7 +284,7 @@ typedef struct {
/* 0x028 */ f32 muteVolumeScale;
/* 0x02C */ f32 fadeVolumeScale;
/* 0x030 */ f32 appliedFadeVolume;
- /* 0x034 */ f32 unk_34;
+ /* 0x034 */ f32 bend;
/* 0x038 */ struct SequenceChannel* channels[16];
/* 0x078 */ SeqScriptState scriptState;
/* 0x094 */ u8* shortNoteVelocityTable;
@@ -402,17 +362,6 @@ typedef struct VibratoSubStruct {
/* 0xC */ u16 vibratoDelay;
} VibratoSubStruct; // size = 0xE
-typedef struct SequenceChannelSubStruct {
- /* 0x0 */ u8 enabled : 1;
- /* 0x0 */ u8 finished : 1;
- /* 0x0 */ u8 stopScript : 1;
- /* 0x0 */ u8 stopSomething2 : 1; // sets SequenceLayer.stopSomething
- /* 0x0 */ u8 hasInstrument : 1;
- /* 0x0 */ u8 stereoHeadsetEffects : 1;
- /* 0x0 */ u8 largeNotes : 1; // notes specify duration and velocity
- /* 0x0 */ u8 unused : 1;
-} SequenceChannelSubStruct; // size = 0x1
-
// Also known as a SubTrack, according to sm64 debug strings.
typedef struct SequenceChannel {
/* 0x00 */ u8 enabled : 1;
@@ -530,7 +479,7 @@ typedef struct SequenceLayer {
/* 0x30 */ Portamento portamento;
/* 0x3C */ struct Note* note;
/* 0x40 */ f32 freqScale;
- /* 0x44 */ f32 unk_34;
+ /* 0x44 */ f32 bend;
/* 0x48 */ f32 velocitySquare2;
/* 0x4C */ f32 velocitySquare; // not sure which one of those corresponds to the sm64 original
/* 0x50 */ f32 noteVelocity;
@@ -1156,31 +1105,4 @@ typedef struct {
/* 0x10 */ f32* vol;
} SoundRequest; // size = 0x14
-/**
- * Note:
- * Flag for resolving C_RIGHT and C_LEFT only being two semitones apart
- * 0x40 - BTN_Z is pressed to lower note by a semitone
- * 0x80 - BTN_R is pressed to raise note by a semitone
- */
-
-typedef struct {
- /* 0x0 */ u8 noteIdx;
- /* 0x2 */ u16 length; // number of frames the note is sustained
- /* 0x4 */ u8 volume;
- /* 0x5 */ u8 vibrato;
- /* 0x6 */ s8 bend;
- /* 0x7 */ u8 BFlat4Flag; // BFlat4Flag See note above
-} OcarinaNote; // size = 0x8
-
-typedef struct {
- /* 0x0 */ u8 numButtons;
- /* 0x1 */ u8 buttonIdx[8];
-} OcarinaSongButtons; // size = 0x9
-
-typedef struct {
- /* 0x0 */ u8 buttonIdx;
- /* 0x1 */ u8 state;
- /* 0x2 */ u8 pos;
-} OcarinaStaff; // size = 0x3
-
#endif
diff --git a/include/z64bgcheck.h b/include/z64bgcheck.h
index 6ca0b66d54..0a5afb3d9a 100644
--- a/include/z64bgcheck.h
+++ b/include/z64bgcheck.h
@@ -56,6 +56,11 @@ struct DynaPolyActor;
// CollisionContext flags
#define BGCHECK_FLAG_REVERSE_CONVEYOR_FLOW 1
+typedef enum {
+ /* 0 */ CONVEYOR_WATER,
+ /* 1 */ CONVEYOR_FLOOR
+} ConveyorType;
+
typedef struct {
/* 0x0 */ Vec3s pos;
} BgVertex; // size = 0x6
@@ -84,10 +89,10 @@ typedef struct CollisionPoly {
} CollisionPoly; // size = 0x10
typedef struct {
- /* 0x00 */ u16 cameraSType;
- /* 0x02 */ s16 unk_02;
- /* 0x04 */ Vec3s* camPosData;
-} CamData;
+ /* 0x0 */ u16 setting;
+ /* 0x2 */ s16 numData;
+ /* 0x4 */ Vec3s* data;
+} CamData; // size = 0x8 (BgCamData)
typedef struct {
/* 0x0 */ Vec3s minPos;
diff --git a/include/z64cutscene.h b/include/z64cutscene.h
index 0f2a6e6784..84150a527c 100644
--- a/include/z64cutscene.h
+++ b/include/z64cutscene.h
@@ -1,5 +1,5 @@
-#ifndef _Z64CUTSCENE_H_
-#define _Z64CUTSCENE_H_
+#ifndef Z64CUTSCENE_H
+#define Z64CUTSCENE_H
#include "ultra64.h"
#include "unk.h"
@@ -26,21 +26,24 @@ typedef struct {
} CutsceneCameraMove; // size = 0xC
typedef struct {
- /* 0x00 */ u16 unk0; // action; // "dousa"
+ /* 0x00 */ u16 action; // "dousa"
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
- /* 0x06 */ u16 unk6;
- /* 0x08 */ u16 unk8;
- /* 0x0C */ Vec3i unk0C;
- /* 0x18 */ Vec3i unk18;
- /* 0x24 */ UNK_TYPE1 unk24[0xC];
+ union {
+ /* 0x06 */ Vec3s rot;
+ /* 0x06 */ Vec3us urot;
+ };
+ /* 0x0C */ Vec3i startPos;
+ /* 0x18 */ Vec3i endPos;
+ /* 0x24 */ Vec3f normal;
} CsCmdActorAction; // size = 0x30
typedef struct {
/* 0x0 */ u16 base;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
-} CsCmdBase; // size = 0x6
+ /* 0x6 */ u16 unk_06;
+} CsCmdBase; // size = 0x8
typedef struct {
/* 0x0 */ u16 unk0;
@@ -48,25 +51,30 @@ typedef struct {
/* 0x4 */ u16 endFrame;
/* 0x6 */ u8 hour;
/* 0x7 */ u8 minute;
-} CsCmdDayTime; // size = 0x8
+ /* 0x8 */ UNK_TYPE1 unk_08[0x04];
+} CsCmdDayTime; // size = 0xC
typedef struct {
/* 0x0 */ u16 setting;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
-} CsCmdEnvLighting; // size = 0x6
+ /* 0x6 */ u16 unk_06;
+} CsCmdEnvLighting; // size = 0x8
typedef struct {
/* 0x0 */ u16 sequence;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
-} CsCmdMusicChange; // size = 0x6
+ /* 0x6 */ u16 unk_06;
+} CsCmdSequenceChange; // size = 0x8
typedef struct {
/* 0x0 */ u16 type;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
-} CsCmdMusicFade; // size = 0x6
+ /* 0x6 */ u16 unk_06;
+ /* 0x8 */ u32 unk_08;
+} CsCmdSequenceFade; // size = 0xC
typedef struct {
/* 0x0 */ u16 base;
@@ -77,30 +85,77 @@ typedef struct {
/* 0xA */ u16 textId2;
} CsCmdTextbox; // size = 0xC
+typedef enum {
+ /* 0 */ CS_TEXTBOX_TYPE_DEFAULT,
+ /* 1 */ CS_TEXTBOX_TYPE_1,
+ /* 2 */ CS_TEXTBOX_TYPE_LEARN_SONG,
+ /* 3 */ CS_TEXTBOX_TYPE_3,
+ /* 4 */ CS_TEXTBOX_TYPE_BOSSES_REMAINS,
+ /* 5 */ CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS,
+ /* 0xFFFF */ CS_TEXTBOX_TYPE_NONE = 0xFFFF
+} CutsceneTextboxType;
+
typedef struct {
- /* 0x0 */ u16 unk0;
+ /* 0x0 */ u16 type;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
/* 0x6 */ u8 unk6;
/* 0x7 */ u8 unk7;
/* 0x8 */ u8 unk8;
/* 0x9 */ UNK_TYPE1 pad9[0x3];
-} CsCmdUnk190; // size = 0xC
-
-typedef struct {
- /* 0x0 */ UNK_TYPE4 unk0;
- /* 0x4 */ UNK_TYPE4 unk4;
-} CsCmdUnk5A; // size = 0x8
+} CsCmdRumble; // size = 0xC
typedef struct {
/* 0x0 */ u16 unk0;
/* 0x2 */ u16 startFrame;
/* 0x4 */ u16 endFrame;
- /* 0x6 */ u8 unk6;
- /* 0x7 */ u8 unk7;
- /* 0x8 */ u8 unk8;
+ /* 0x6 */ Color_RGB8 color;
/* 0x9 */ UNK_TYPE1 pad9[0x3];
-} CsCmdUnk9B; // size = 0xC
+} CsCmdFadeScreen; // size = 0xC
+
+typedef enum {
+ /* 0 */ CS_STATE_0,
+ /* 1 */ CS_STATE_1,
+ /* 2 */ CS_STATE_2,
+ /* 3 */ CS_STATE_3,
+ /* 4 */ CS_STATE_4
+} CutsceneState;
+
+typedef enum {
+ /* 0x00A */ CS_CMD_TEXTBOX = 0xA,
+ /* 0x05A */ CS_CMD_CAMERA = 0x5A,
+ /* 0x096 */ CS_CMD_MISC = 0x96,
+ /* 0x097 */ CS_CMD_SET_LIGHTING,
+ /* 0x098 */ CS_CMD_SCENE_TRANS_FX,
+ /* 0x099 */ CS_CMD_MOTIONBLUR,
+ /* 0x09A */ CS_CMD_GIVETATL,
+ /* 0x09B */ CS_CMD_FADESCREEN,
+ /* 0x09C */ CS_CMD_FADESEQ,
+ /* 0x09D */ CS_CMD_SETTIME,
+ /* 0x0C8 */ CS_CMD_SET_PLAYER_ACTION = 0xC8,
+ /* 0x0FA */ CS_CMD_UNK_FA = 0xFA,
+ /* 0x0FE */ CS_CMD_UNK_FE = 0xFE,
+ /* 0x0FF */ CS_CMD_UNK_FF,
+ /* 0x100 */ CS_CMD_UNK_100,
+ /* 0x101 */ CS_CMD_UNK_101,
+ /* 0x102 */ CS_CMD_UNK_102,
+ /* 0x103 */ CS_CMD_UNK_103,
+ /* 0x104 */ CS_CMD_UNK_104,
+ /* 0x105 */ CS_CMD_UNK_105,
+ /* 0x108 */ CS_CMD_UNK_108 = 0x108,
+ /* 0x109 */ CS_CMD_UNK_109,
+ /* 0x12C */ CS_CMD_PLAYSEQ = 0x12C,
+ /* 0x12D */ CS_CMD_UNK_12D,
+ /* 0x130 */ CS_CMD_130 = 0x130,
+ /* 0x131 */ CS_CMD_131,
+ /* 0x132 */ CS_CMD_132,
+ /* 0x133 */ CS_CMD_STOPSEQ,
+ /* 0x134 */ CS_CMD_PLAYAMBIENCE,
+ /* 0x135 */ CS_CMD_FADEAMBIENCE,
+ /* 0x15E */ CS_CMD_TERMINATOR = 0x15E,
+ /* 0x15F */ CS_CMD_CHOOSE_CREDITS_SCENES,
+ /* 0x190 */ CS_CMD_RUMBLE = 0x190
+} CutsceneCmd;
typedef union CutsceneData {
s32 i;
@@ -109,4 +164,29 @@ typedef union CutsceneData {
s8 b[4];
} CutsceneData;
+typedef struct {
+ /* 0x0 */ CutsceneData* segmentedData;
+ /* 0x4 */ s16 nextEntranceIndex;
+ /* 0x6 */ u8 unk6;
+ /* 0x7 */ u8 unk7; // a weekEventReg bitpack?
+} CutsceneEntry; // size = 0x8
+
+typedef struct {
+ /* 0x00 */ u8 sceneCsCount;
+ /* 0x04 */ CutsceneData* csData;
+ /* 0x08 */ u8 state;
+ /* 0x0C */ f32 unk_0C;
+ /* 0x10 */ u16 frames;
+ /* 0x12 */ u16 currentCsIndex;
+ /* 0x14 */ s32 csCamId;
+ /* 0x18 */ u16 unk_18;
+ /* 0x1A */ u8 unk_1A;
+ /* 0x1B */ u8 unk_1B;
+ /* 0x1C */ CutsceneCameraPoint* atPoints;
+ /* 0x20 */ CutsceneCameraPoint* eyePoints;
+ /* 0x24 */ CsCmdActorAction* playerAction;
+ /* 0x28 */ CsCmdActorAction* actorActions[10]; // "npcdemopnt"
+ /* 0x50 */ CutsceneEntry* sceneCsList;
+} CutsceneContext; // size = 0x54
+
#endif
diff --git a/include/z64cutscene_commands.h b/include/z64cutscene_commands.h
index 99000eec26..b487b49b18 100644
--- a/include/z64cutscene_commands.h
+++ b/include/z64cutscene_commands.h
@@ -1,5 +1,5 @@
-#ifndef _Z64CUTSCENE_COMMANDS_H_
-#define _Z64CUTSCENE_COMMANDS_H_
+#ifndef Z64CUTSCENE_COMMANDS_H
+#define Z64CUTSCENE_COMMANDS_H
#include "command_macros_base.h"
#include "z64cutscene.h"
@@ -11,11 +11,571 @@
* eeeeeeee nnnnnnnn
* size = 0x8
*/
-#define CS_BEGIN_CUTSCENE(totalEntries, endFrame) CMD_W(totalEntries), CMD_W(endFrame)
+#define CS_BEGIN_CUTSCENE(totalEntries, endFrame) { CMD_W(totalEntries) }, { CMD_W(endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000000A eeeeeeee
+ * size = 0x8
+ */
+#define CS_TEXT_LIST(entries) { CS_CMD_TEXTBOX }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 messageId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o),
+ * s16 topOptionBranch (y), s16 bottomOptionBranch (n)
+ * FORMAT
+ * iiiissss eeeeoooo yyyynnnn
+ * size = 0xC
+ */
+#define CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \
+ { CMD_HH(messageId, startFrame) }, { CMD_HH(endFrame, type) }, { CMD_HH(topOptionBranch, bottomOptionBranch) }
+
+/**
+ * ARGS
+ * s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
+ * s16 topOptionBranch (y), s16 bottomOptionBranch (n)
+ * FORMAT
+ * iiiissss eeee0000 yyyynnnn
+ * size = 0xC
+ */
+#define CS_TEXT_DEFAULT(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
+ CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_DEFAULT, topOptionBranch, bottomOptionBranch)
+
+/**
+ * ARGS
+ * s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
+ * s16 topOptionBranch (y), s16 bottomOptionBranch (n)
+ * FORMAT
+ * iiiissss eeee0001 yyyynnnn
+ * size = 0xC
+ */
+#define CS_TEXT_TYPE_1(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
+ CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_1, topOptionBranch, bottomOptionBranch)
+
+/**
+ * ARGS
+ * s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 messageId (i)
+ * FORMAT
+ * oooossss eeee0002 iiiiFFFF
+ * size = 0xC
+ */
+#define CS_TEXT_LEARN_SONG(ocarinaSongAction, startFrame, endFrame, messageId) \
+ CS_TEXT_DISPLAY_TEXTBOX(ocarinaSongAction, startFrame, endFrame, CS_TEXTBOX_TYPE_LEARN_SONG, messageId, 0xFFFF)
+
+/**
+ * ARGS
+ * s16 messageId (i), s16 startFrame (s), s16 endFrame (e),
+ * s16 topOptionBranch (y), s16 bottomOptionBranch (n)
+ * FORMAT
+ * iiiissss eeee0003 yyyynnnn
+ * size = 0xC
+ */
+#define CS_TEXT_TYPE_3(messageId, startFrame, endFrame, topOptionBranch, bottomOptionBranch) \
+ CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, CS_TEXTBOX_TYPE_3, topOptionBranch, bottomOptionBranch)
+
+/**
+ * If Player has all 4 bosses' remains then alternativeMessageId is used, otherwise defaultMessageId is used
+ * ARGS
+ * s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a)
+ * FORMAT
+ * ddddssss eeee0004 aaaaFFFF
+ * size = 0xC
+ */
+#define CS_TEXT_BOSSES_REMAINS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \
+ CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_BOSSES_REMAINS, alternativeMessageId, 0xFFFF)
+
+/**
+ * If Player has every non-transformation mask then alternativeMessageId is used, otherwise defaultMessageId is used
+ * ARGS
+ * s16 defaultMessageId (d), s16 startFrame (s), s16 endFrame (e), s16 alternativeMessageId (a)
+ * FORMAT
+ * ddddssss eeee0005 aaaaFFFF
+ * size = 0xC
+ */
+#define CS_TEXT_ALL_NORMAL_MASKS(defaultMessageId, startFrame, endFrame, alternativeMessageId) \
+ CS_TEXT_DISPLAY_TEXTBOX(defaultMessageId, startFrame, endFrame, CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS, alternativeMessageId, 0xFFFF)
+
+/**
+ * ARGS
+ * s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * FFFFssss eeeeFFFF FFFFFFFF
+ * size = 0xC
+ */
+#define CS_TEXT_NONE(startFrame, endFrame) \
+ CS_TEXT_DISPLAY_TEXTBOX(0xFFFF, startFrame, endFrame, CS_TEXTBOX_TYPE_NONE, 0xFFFF, 0xFFFF)
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000005A eeeeeeee
+ * size = 0x8
+ */
+#define CS_CAMERA_LIST(entries) { CS_CMD_CAMERA }, { CMD_W(entries) }
+
+// TODO: Camera command macros. Requieres func_80161998 being decomped
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000096 eeeeeeee
+ * size = 0x8
+ */
+#define CS_MISC_LIST(entries) { CS_CMD_MISC }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 unk (u), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * uuuussss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_MISC(unk, startFrame, endFrame, unk_06) \
+ { CMD_HH(unk, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000097 eeeeeeee
+ * size = 0x8
+ */
+#define CS_LIGHTING_LIST(entries) { CS_CMD_SET_LIGHTING }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 setting (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_LIGHTING(setting, startFrame, endFrame) \
+ { CMD_HH(setting, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000098 eeeeeeee
+ * size = 0x8
+ */
+#define CS_SCENE_TRANS_FX_LIST(entries) { CS_CMD_SCENE_TRANS_FX }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 transitionType (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_SCENE_TRANS_FX(transitionType, startFrame, endFrame) \
+ { CMD_HH(transitionType, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000099 eeeeeeee
+ * size = 0x08
+ */
+#define CS_MOTIONBLUR_LIST(entries) { CS_CMD_MOTIONBLUR }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_MOTIONBLUR(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000009A eeeeeeee
+ * size = 0x8
+ */
+#define CS_GIVETATL_LIST(entries) { CS_CMD_GIVETATL }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_GIVETATL(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000009B eeeeeeee
+ * size = 0x8
+ */
+#define CS_FADESCREEN_LIST(entries) { CS_CMD_FADESCREEN }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e),
+ * u8 red (r), u8 green (g), blue (b)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeerrgg bbUUUUUU
+ * size = 0x0C
+ */
+#define CS_FADESCREEN(base, startFrame, endFrame, red, green, blue) \
+ { CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, red, green) }, { CMD_BBBB(blue, 0, 0, 0) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000009C eeeeeeee
+ * size = 0x8
+ */
+#define CS_FADESEQ_LIST(entries) { CS_CMD_FADESEQ }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU UUUUUUUU
+ * size = 0x0C
+ */
+#define CS_FADESEQ(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, 0) }, { CMD_W(0) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000009D eeeeeeee
+ * size = 0x8
+ */
+#define CS_TIME_LIST(entries) { CS_CMD_SETTIME }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 unk (u), s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m)
+ * FORMAT
+ * Capital U is Unused
+ * uuuussss eeeehhmm UUUUUUUU
+ * size = 0xC
+ */
+#define CS_TIME(unk, startFrame, endFrame, hour, min, unused) \
+ { CMD_HH(unk, startFrame) }, { CMD_HBB(endFrame, hour, min) }, { CMD_W(unused) }
+
+
+/**
+ * ARGS
+ * s32 cmdType (c), s32 entries (e)
+ * FORMAT
+ * cccccccc eeeeeeee
+ * size = 0x8
+ */
+#define CS_ACTOR_ACTION_LIST(cmdType, entries) { CMD_W(cmdType) }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 npcAction (a), s16 startFrame (s), s16 endFrame (e),
+ * s16 rotX (u), s16 rotY (v), s16 rotZ (w),
+ * s32 startX (i), s32 startY (j), s32 startZ (k),
+ * s32 endX (l), s32 endY (m), s32 endZ (n),
+ * f32 normX (x), f32 normY (y), f32 normZ (z),
+ * FORMAT
+ * aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
+ * size = 0x30
+ */
+#define CS_ACTOR_ACTION(npcAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
+ { CMD_HH(npcAction, startFrame) }, { CMD_HH(endFrame, rotX) }, { CMD_HH(rotY, rotZ) }, \
+ { CMD_W(startX) }, { CMD_W(startY) }, { CMD_W(startZ) }, \
+ { CMD_W(endX) }, { CMD_W(endY) }, { CMD_W(endZ) }, \
+ { CMD_F(normX) }, { CMD_F(normY) }, { CMD_F(normZ) }
+
+
+/**
+ * ARGS
+ * s32 cmdType (c), s32 entries (e)
+ * FORMAT
+ * 000000C8 eeeeeeee
+ * size = 0x8
+ */
+#define CS_PLAYER_ACTION_LIST(entries) { CS_CMD_SET_PLAYER_ACTION }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 playerAction (a), s16 startFrame (s), s16 endFrame (e),
+ * s16 rotX (u), s16 rotY (v), s16 rotZ (w),
+ * s32 startX (i), s32 startY (j), s32 startZ (k),
+ * s32 endX (l), s32 endY (m), s32 endZ (n),
+ * f32 normX (x), f32 normY (y), f32 normZ (z),
+ * FORMAT
+ * aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
+ * size = 0x30
+ */
+#define CS_PLAYER_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
+ CS_ACTOR_ACTION(playerAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ)
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000012C eeeeeeee
+ * size = 0x8
+ */
+#define CS_PLAYSEQ_LIST(entries) { CS_CMD_PLAYSEQ }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_PLAYSEQ(sequence, startFrame, endFrame) \
+ { CMD_HH(sequence, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000130 eeeeeeee
+ * size = 0x8
+ */
+#define CS_SCENE_UNK_130_LIST(entries) { CS_CMD_130 }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x30
+ */
+#define CS_SCENE_UNK_130(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000131 eeeeeeee
+ * size = 0x8
+ */
+#define CS_SCENE_UNK_131_LIST(entries) { CS_CMD_131 }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_SCENE_UNK_131(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000132 eeeeeeee
+ * size = 0x8
+ */
+#define CS_SCENE_UNK_132_LIST(entries) { CS_CMD_132 }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_SCENE_UNK_132(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000133 eeeeeeee
+ * size = 0x8
+ */
+#define CS_STOPSEQ_LIST(entries) { CS_CMD_STOPSEQ }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_STOPSEQ(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000134 eeeeeeee
+ * size = 0x8
+ */
+#define CS_PLAYAMBIENCE_LIST(entries) { CS_CMD_PLAYAMBIENCE }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_PLAYAMBIENCE(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000135 eeeeeeee
+ * size = 0x8
+ */
+#define CS_FADEAMBIENCE_LIST(entries) { CS_CMD_FADEAMBIENCE }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_FADEAMBIENCE(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000015E eeeeeeee
+ * size = 0x8
+ */
+#define CS_TERMINATOR_LIST(entries) { CS_CMD_TERMINATOR }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_TERMINATOR(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 0000015F eeeeeeee
+ * size = 0x8
+ */
+#define CS_CHOOSE_CREDITS_SCENES_LIST(entries) { CS_CMD_CHOOSE_CREDITS_SCENES }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_CHOOSE_CREDITS_SCENES(base, startFrame, endFrame) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, endFrame) }
+
+
+/**
+ * ARGS
+ * s32 entries (e)
+ * FORMAT
+ * 00000004 eeeeeeee
+ * size = 0x8
+ */
+#define CS_RUMBLE_LIST(entries) { CS_CMD_RUMBLE }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_RUMBLE(base, startFrame, endFrame, unk6, unk7, unk8) \
+ { CMD_HH(base, startFrame) }, { CMD_HBB(endFrame, unk6, unk7) }, { CMD_BBBB(unk8, 0, 0, 0) }
+
+
+/**
+ * ARGS
+ * s32 cmd (c), s32 entries (e)
+ * FORMAT
+ * cccccccc eeeeeeee
+ * size = 0x8
+ */
+#define CS_UNK_DATA_LIST(cmd, entries) { CMD_W(cmd) }, { CMD_W(entries) }
+
+/**
+ * ARGS
+ * s16 base (m), s16 startFrame (s), s16 endFrame (e)
+ * FORMAT
+ * Capital U is Unused
+ * mmmmssss eeeeUUUU
+ * size = 0x08
+ */
+#define CS_UNK_DATA(base, startFrame, endFrame, unk_06) \
+ { CMD_HH(base, startFrame) }, { CMD_HH(endFrame, unk_06) }
+
/**
* Marks the end of a cutscene
*/
-#define CS_END() 0xFFFFFFFF
+#define CS_END() { CMD_W(0xFFFFFFFF) }
#endif
diff --git a/include/z64item.h b/include/z64item.h
index d7c802d70e..00683dd402 100644
--- a/include/z64item.h
+++ b/include/z64item.h
@@ -43,7 +43,7 @@ typedef enum {
/* 0x11 */ QUEST_SONG_SUN,
/* 0x12 */ QUEST_BOMBERS_NOTEBOOK,
/* 0x18 */ QUEST_SONG_LULLABY_INTRO = 0x18,
- /* 0x19 */ QUEST_UNK_19, // Related to PictoBox
+ /* 0x19 */ QUEST_UNK_19 // Related to PictoBox
} QuestItem;
typedef enum {
@@ -301,6 +301,7 @@ typedef enum {
/* 0x3D */ GI_KEY_BOSS,
/* 0x3E */ GI_MAP,
/* 0x3F */ GI_COMPASS,
+ /* 0x50 */ GI_50 = 0x50,
/* 0x52 */ GI_SCALE_GOLD = 0x52, // Assumed, used in En_Fishing
/* 0x59 */ GI_BOTTLE_POTION_RED = 0x59,
/* 0x5A */ GI_BOTTLE,
@@ -358,7 +359,11 @@ typedef enum {
typedef enum {
/* 0x00 */ GID_BOTTLE,
+ /* 0x02 */ GID_02 = 0x02,
+ /* 0x03 */ GID_03,
/* 0x0A */ GID_COMPASS = 0x0A,
+ /* 0x0E */ GID_0E = 0x0E,
+ /* 0x0F */ GID_0F,
/* 0x10 */ GID_MASK_ALL_NIGHT = 0x10,
/* 0x11 */ GID_NUTS,
/* 0x17 */ GID_BOMB_BAG_20 = 0x17,
@@ -376,11 +381,19 @@ typedef enum {
/* 0x31 */ GID_POTION_RED,
/* 0x32 */ GID_POTION_BLUE,
/* 0x33 */ GID_SHIELD_MIRROR,
- /* 0x3B */ GID_FAIRY = 0x3B,
+ /* 0x3A */ GID_3A = 0x3A,
+ /* 0x3B */ GID_FAIRY,
+ /* 0x3E */ GID_3E = 0x3E,
+ /* 0x44 */ GID_44 = 0x44,
+ /* 0x45 */ GID_45,
/* 0x55 */ GID_SWORD_KOKIRI = 0x55,
/* 0x66 */ GID_SWORD_RAZOR = 0x66,
/* 0x67 */ GID_SWORD_GILDED,
- /* 0x68 */ GID_SWORD_GREAT_FAIRY
+ /* 0x68 */ GID_SWORD_GREAT_FAIRY,
+ /* 0x6A */ GID_6A = 0x6A,
+ /* 0x6B */ GID_6B,
+ /* 0x70 */ GID_70 = 0x70,
+ /* 0x71 */ GID_71,
} GetItemDrawID;
// TODO: fill
@@ -388,7 +401,8 @@ typedef enum {
/* -1 */ EXCH_ITEM_MINUS1 = -1, // Unknown usage or function
/* 0x00 */ EXCH_ITEM_NONE,
/* 0x1E */ EXCH_ITEM_1E = 0x1E, // BOTTLE_MUSHROOM
- /* 0x2A */ EXCH_ITEM_2A = 0x2A // MOON_TEAR?
+ /* 0x2A */ EXCH_ITEM_2A = 0x2A, // MOON_TEAR?
+ /* 0x2E */ EXCH_ITEM_2E = 0x2E
} ExchangeItemID;
#endif
diff --git a/include/z64light.h b/include/z64light.h
index 90ee01fb00..8e8508579e 100644
--- a/include/z64light.h
+++ b/include/z64light.h
@@ -23,7 +23,7 @@ typedef struct {
/* 0x12 */ s16 fogColor[3];
/* 0x18 */ s16 fogNear;
/* 0x1A */ s16 fogFar;
-} LightSettings2; // size = 0x1C
+} EnvLightSettings; // size = 0x1C
typedef struct {
/* 0x0 */ s16 x;
diff --git a/include/z64object.h b/include/z64object.h
index 08423ab6c7..34035306b4 100644
--- a/include/z64object.h
+++ b/include/z64object.h
@@ -405,7 +405,7 @@ typedef enum {
/* 0x189 */ OBJECT_HANAREYAMA_OBJ,
/* 0x18A */ OBJECT_CRACE_OBJECT,
/* 0x18B */ OBJECT_DNQ,
- /* 0x18C */ OBJECT_OBJECT_UNSET_TOKEIDAI,
+ /* 0x18C */ OBJECT_OBJ_TOKEIDAI,
/* 0x18D */ OBJECT_EG,
/* 0x18E */ OBJECT_TRU,
/* 0x18F */ OBJECT_TRT,
@@ -545,13 +545,13 @@ typedef enum {
/* 0x215 */ OBJECT_GI_RESERVE_C_01,
/* 0x216 */ OBJECT_ZOD,
/* 0x217 */ OBJECT_KUMO30,
- /* 0x218 */ OBJECT_OBJECT_UNSET_YASI,
+ /* 0x218 */ OBJECT_OBJ_YASI,
/* 0x219 */ OBJECT_MASK_ROMERNY,
/* 0x21A */ OBJECT_TANRON1,
/* 0x21B */ OBJECT_TANRON2,
/* 0x21C */ OBJECT_TANRON3,
/* 0x21D */ OBJECT_GI_MAGICMUSHROOM,
- /* 0x21E */ OBJECT_OBJECT_UNSET_CHAN,
+ /* 0x21E */ OBJECT_OBJ_CHAN,
/* 0x21F */ OBJECT_GI_MASK10,
/* 0x220 */ OBJECT_ZOS,
/* 0x221 */ OBJECT_MASK_POSTHAT,
@@ -589,7 +589,7 @@ typedef enum {
/* 0x241 */ OBJECT_DT,
/* 0x242 */ OBJECT_GI_MASK03,
/* 0x243 */ OBJECT_CHA,
- /* 0x244 */ OBJECT_OBJECT_UNSET_DINNER,
+ /* 0x244 */ OBJECT_OBJ_DINNER,
/* 0x245 */ OBJECT_GI_RESERVE_B_01,
/* 0x246 */ OBJECT_LASTDAY,
/* 0x247 */ OBJECT_BAI,
@@ -608,7 +608,7 @@ typedef enum {
/* 0x254 */ OBJECT_GI_STONEMASK,
/* 0x255 */ OBJECT_ZORABAND,
/* 0x256 */ OBJECT_KEPN_KOYA,
- /* 0x257 */ OBJECT_OBJECT_UNSET_USIYANE,
+ /* 0x257 */ OBJECT_OBJ_USIYANE,
/* 0x258 */ OBJECT_GI_MASK05,
/* 0x259 */ OBJECT_GI_MASK11,
/* 0x25A */ OBJECT_GI_MASK20,
@@ -618,7 +618,7 @@ typedef enum {
/* 0x25E */ OBJECT_MASK_MEOTO,
/* 0x25F */ OBJECT_MASK_DANCER,
/* 0x260 */ OBJECT_KZSAKU,
- /* 0x261 */ OBJECT_OBJECT_UNSET_MILK_BIN,
+ /* 0x261 */ OBJECT_OBJ_MILK_BIN,
/* 0x262 */ OBJECT_RANDOM_OBJ,
/* 0x263 */ OBJECT_KUJIYA,
/* 0x264 */ OBJECT_KITAN,
@@ -636,7 +636,7 @@ typedef enum {
/* 0x270 */ OBJECT_MOONEND,
/* 0x271 */ OBJECT_OB,
/* 0x272 */ OBJECT_GI_BOTTLE_04,
- /* 0x273 */ OBJECT_OBJECT_UNSET_DANPEILIFT,
+ /* 0x273 */ OBJECT_OBJ_DANPEILIFT,
/* 0x274 */ OBJECT_WDOR01,
/* 0x275 */ OBJECT_WDOR02,
/* 0x276 */ OBJECT_WDOR03,
diff --git a/include/z64ocarina.h b/include/z64ocarina.h
new file mode 100644
index 0000000000..cc1662fbd7
--- /dev/null
+++ b/include/z64ocarina.h
@@ -0,0 +1,125 @@
+#ifndef Z64OCARINA_H
+#define Z64OCARINA_H
+
+#include "ultra64.h"
+
+typedef enum {
+ /* 0 */ OCARINA_SONG_SONATA,
+ /* 1 */ OCARINA_SONG_GORON_LULLABY,
+ /* 2 */ OCARINA_SONG_NEW_WAVE,
+ /* 3 */ OCARINA_SONG_ELEGY,
+ /* 4 */ OCARINA_SONG_OATH,
+ /* 5 */ OCARINA_SONG_SARIAS,
+ /* 6 */ OCARINA_SONG_TIME,
+ /* 7 */ OCARINA_SONG_HEALING,
+ /* 8 */ OCARINA_SONG_EPONAS,
+ /* 9 */ OCARINA_SONG_SOARING,
+ /* 10 */ OCARINA_SONG_STORMS,
+ /* 11 */ OCARINA_SONG_SUNS,
+ /* 12 */ OCARINA_SONG_INVERTED_TIME,
+ /* 13 */ OCARINA_SONG_DOUBLE_TIME,
+ /* 14 */ OCARINA_SONG_GORON_LULLABY_INTRO,
+ /* 15 */ OCARINA_SONG_WIND_FISH_HUMAN, // "Ballad of the Wind Fish"
+ /* 16 */ OCARINA_SONG_WIND_FISH_GORON,
+ /* 17 */ OCARINA_SONG_WIND_FISH_ZORA,
+ /* 18 */ OCARINA_SONG_WIND_FISH_DEKU,
+ /* 19 */ OCARINA_SONG_EVAN_PART1,
+ /* 20 */ OCARINA_SONG_EVAN_PART2,
+ /* 21 */ OCARINA_SONG_ZELDAS_LULLABY,
+ /* 22 */ OCARINA_SONG_SCARECROW,
+ /* 23 */ OCARINA_SONG_TERMINA_WALL,
+ /* 24 */ OCARINA_SONG_MAX,
+ /* 24 */ OCARINA_SONG_SCARECROW_LONG = OCARINA_SONG_MAX
+} OcarinaSongId;
+
+typedef enum {
+ /* 0 */ OCARINA_BTN_A,
+ /* 1 */ OCARINA_BTN_C_DOWN,
+ /* 2 */ OCARINA_BTN_C_RIGHT,
+ /* 3 */ OCARINA_BTN_C_LEFT,
+ /* 4 */ OCARINA_BTN_C_UP,
+ /* -1 */ OCARINA_BTN_INVALID = 0xFF
+} OcarinaButtonIdx;
+
+// Uses scientific pitch notation relative to middle C
+// https://en.wikipedia.org/wiki/Scientific_pitch_notation
+typedef enum {
+ /* 0x0 */ OCARINA_PITCH_C4,
+ /* 0x1 */ OCARINA_PITCH_DFLAT4,
+ /* 0x2 */ OCARINA_PITCH_D4,
+ /* 0x3 */ OCARINA_PITCH_EFLAT4,
+ /* 0x4 */ OCARINA_PITCH_E4,
+ /* 0x5 */ OCARINA_PITCH_F4,
+ /* 0x6 */ OCARINA_PITCH_GFLAT4,
+ /* 0x7 */ OCARINA_PITCH_G4,
+ /* 0x8 */ OCARINA_PITCH_AFLAT4,
+ /* 0x9 */ OCARINA_PITCH_A4,
+ /* 0xA */ OCARINA_PITCH_BFLAT4,
+ /* 0xB */ OCARINA_PITCH_B4,
+ /* 0xC */ OCARINA_PITCH_C5,
+ /* 0xD */ OCARINA_PITCH_DFLAT5,
+ /* 0xE */ OCARINA_PITCH_D5,
+ /* 0xF */ OCARINA_PITCH_EFLAT5,
+ /* -1 */ OCARINA_PITCH_NONE = 0xFF
+} OcarinaPitch;
+
+// Mainly set by func_80152CAC in z_message.c
+typedef enum {
+ /* 0 */ OCARINA_INSTRUMENT_OFF,
+ /* 1 */ OCARINA_INSTRUMENT_DEFAULT,
+ /* 2 */ OCARINA_INSTRUMENT_FEMALE_VOICE,
+ /* 3 */ OCARINA_INSTRUMENT_WHISTLING_FLUTE,
+ /* 4 */ OCARINA_INSTRUMENT_HARP,
+ /* 5 */ OCARINA_INSTRUMENT_IKANA_KING,
+ /* 6 */ OCARINA_INSTRUMENT_TATL,
+ /* 7 */ OCARINA_INSTRUMENT_GORON_DRUMS,
+ /* 8 */ OCARINA_INSTRUMENT_ZORA_GUITAR,
+ /* 9 */ OCARINA_INSTRUMENT_DEKU_PIPES,
+ /* 10 */ OCARINA_INSTRUMENT_MONKEY,
+ /* 11 */ OCARINA_INSTRUMENT_DEKU_TRUMPET, // Pull out ocarina for captured monkey
+ /* 12 */ OCARINA_INSTRUMENT_ELDER_GORON_DRUMS,
+ /* 13 */ OCARINA_INSTRUMENT_PIANO,
+ /* 14 */ OCARINA_INSTRUMENT_BASS_GUITAR,
+ /* 15 */ OCARINA_INSTRUMENT_BABY_SINGING,
+ /* 16 */ OCARINA_INSTRUMENT_AMPLIFIED_GUITAR, // Related to (gSaveContext.weekEventReg[41] & 0x20)
+} OcarinaInstrumentId;
+
+typedef enum {
+ /* 0 */ OCARINA_RECORD_OFF,
+ /* 1 */ OCARINA_RECORD_SCARECROW_LONG,
+ /* 2 */ OCARINA_RECORD_SCARECROW_SPAWN,
+ /* -1 */ OCARINA_RECORD_REJECTED = 0xFF
+} OcarinaRecordingState;
+
+/**
+ * BFlat4Flag Note:
+ * Flag for resolving whether (noteIdx = NOTE_BFLAT4)
+ * gets mapped to either C_RIGHT and C_LEFT
+ *
+ * This is required as C_RIGHT and C_LEFT are the only notes
+ * that map to two semitones apart (NOTE_A4 and NOTE_B4)
+ * 0x40 - BTN_Z is pressed to lower note by a semitone
+ * 0x80 - BTN_R is pressed to raise note by a semitone
+ */
+
+typedef struct {
+ /* 0x0 */ u8 noteIdx; // number of semitones above middle C
+ /* 0x2 */ u16 length; // number of frames the note is sustained
+ /* 0x4 */ u8 volume;
+ /* 0x5 */ u8 vibrato;
+ /* 0x6 */ s8 bend; // frequency multiplicative offset from the pitch defined by noteIdx
+ /* 0x7 */ u8 BFlat4Flag; // See note above
+} OcarinaNote; // size = 0x8
+
+typedef struct {
+ /* 0x0 */ u8 numButtons;
+ /* 0x1 */ u8 buttonIdx[8];
+} OcarinaSongButtons; // size = 0x9
+
+typedef struct {
+ /* 0x0 */ u8 buttonIdx;
+ /* 0x1 */ u8 state; // original name: "status"
+ /* 0x2 */ u8 pos; // original name: "locate"
+} OcarinaStaff; // size = 0x3
+
+#endif
diff --git a/include/z64save.h b/include/z64save.h
index 8e08a550a2..31232b56c4 100644
--- a/include/z64save.h
+++ b/include/z64save.h
@@ -20,7 +20,7 @@ typedef struct {
/* 0x50 */ u8 dungeonItems[10];
/* 0x5A */ s8 dungeonKeys[10];
/* 0x64 */ s8 strayFairies[10]; // "orange_fairy"
- /* 0x6E */ u8 unk_6E[8][3]; // "degnuts_memory_name"
+ /* 0x6E */ char dekuPlaygroundPlayerName[3][8]; // Stores playerName (8 char) over (3 days) when getting a new high score. original name: degnuts_memory_name
} Inventory; // size = 0x88
typedef struct {
@@ -41,6 +41,24 @@ typedef struct {
/* 0x1C */ u32 tempCollectFlags;
} RespawnData; // size = 0x20
+typedef struct {
+ /* 0x00 */ u32 chest;
+ /* 0x04 */ u32 swch0;
+ /* 0x08 */ u32 swch1;
+ /* 0x0C */ u32 clearedRoom;
+ /* 0x10 */ u32 collectible;
+ /* 0x14 */ u32 unk_14;
+ /* 0x18 */ u32 unk_18;
+} PermanentSceneFlags; // size = 0x1C
+
+typedef struct {
+ /* 0x00 */ u32 chest;
+ /* 0x04 */ u32 swch0;
+ /* 0x08 */ u32 swch1;
+ /* 0x0C */ u32 clearedRoom;
+ /* 0x10 */ u32 collectible;
+} CycleSceneFlags; // size = 0x14
+
typedef struct {
/* 0x0000 */ u32 entranceIndex; // "scene_no"
/* 0x0004 */ u8 equippedMask; // "player_mask"
@@ -78,16 +96,37 @@ typedef struct {
/* 0x004A */ s16 savedSceneNum; // "scene_data_ID"
/* 0x004C */ ItemEquips equips;
/* 0x0070 */ Inventory inventory;
- /* 0x00F8 */ u32 roomInf[128][7];
+ /* 0x00F8 */ PermanentSceneFlags permanentSceneFlags[120];
+ /* 0x0E18 */ u8 unk_E18[0x54];
+ /* 0x0E6C */ u32 dekuPlaygroundHighScores[3];
+ /* 0x0E78 */ u32 pictoFlags0;
+ /* 0x0E7C */ u32 pictoFlags1;
+ /* 0x0E80 */ u32 unk_E80;
+ /* 0x0E84 */ u32 unk_E84;
+ /* 0x0E88 */ u32 unk_E88[7]; // Invadepoh flags
+ /* 0x0EA4 */ u32 scenesVisible[7]; // tingle maps and clouded regions on pause map. Stores scenes bitwise for up to 224 scenes even though there are not that many scenes
+ /* 0x0EC0 */ u32 skullTokenCount; // upper 16 bits store Swamp skulls, lower 16 bits store Ocean skulls
+ /* 0x0EC4 */ u32 unk_EC4; // Gossic stone heart piece flags
+ /* 0x0EC8 */ u32 unk_EC8;
+ /* 0x0ECC */ u32 unk_ECC[2]; // Related to blue warps
+ /* 0x0ED4 */ u32 stolenItems; // Items stolen by Takkuri and given to Curiosity Shop Man
+ /* 0x0ED8 */ u32 unk_DD8;
+ /* 0x0EDC */ u32 bankRupees;
+ /* 0x0EE0 */ u32 unk_EE0;
+ /* 0x0EE4 */ u32 unk_EE4; // Fishing flags
+ /* 0x0EE8 */ u32 unk_EE8;
+ /* 0x0EEC */ u32 horseBackBalloonHighScore;
+ /* 0x0EF0 */ u32 lotteryCodeGuess; // Lottery code chosen by player (only uses lower three hex digits)
+ /* 0x0EF4 */ u32 unk_EF4; // Shooting Gallery Man Flags
/* 0x0EF8 */ u8 weekEventReg[100]; // "week_event_reg"
/* 0x0F5C */ u32 mapsVisited; // "area_arrival"
- /* 0x0F60 */ u32 unk_F60; // "cloud_clear"
+ /* 0x0F60 */ u32 mapsVisible; // "cloud_clear"
/* 0x0F64 */ u8 unk_F64; // "oca_rec_flag"
/* 0x0F65 */ u8 unk_F65; // "oca_rec_flag8"
/* 0x0F66 */ u8 unk_F66[128]; // "oca_rec_buff8"
/* 0x0FE6 */ s8 unk_FE6; // "aikotoba_index"
/* 0x0FE7 */ s8 unk_FE7[5]; // "aikotoba_table"
- /* 0x0FEC */ s8 lotteryCodes[3][3]; // "numbers_table"
+ /* 0x0FEC */ s8 lotteryCodes[3][3]; // Preset lottery codes "numbers_table"
/* 0x0FF5 */ s8 spiderHouseMaskOrder[6]; // "kinsta_color_table"
/* 0x0FFB */ s8 bomberCode[5]; // "bombers_aikotoba_table"
/* 0x1000 */ HorseData horseData;
@@ -169,12 +208,12 @@ typedef struct {
/* 0x3F54 */ u8 dogIsLost; // "dog_event_flag"
/* 0x3F55 */ u8 nextTransition; // "next_wipe"
/* 0x3F56 */ s16 worldMapArea; // "area_type"
- /* 0x3F58 */ s16 unk_3F58; // "sunmoon_flag"
+ /* 0x3F58 */ s16 sunsSongState; // "sunmoon_flag"
/* 0x3F5A */ s16 healthAccumulator; // "life_mode"
/* 0x3F5C */ s32 unk_3F5C; // "bet_rupees"
/* 0x3F60 */ u8 unk_3F60; // "framescale_flag"
/* 0x3F64 */ f32 unk_3F64; // "framescale_scale"
- /* 0x3F68 */ u32 cycleSceneFlags[120][5];
+ /* 0x3F68 */ CycleSceneFlags cycleSceneFlags[120]; // Scene flags that are temporarily stored over the duration of a single 3-day cycle
/* 0x48C8 */ u16 unk_48C8; // "scene_id_mix"
/* 0x48CA */ u8 maskMaskBit[3]; // masks given away on the Moon
/* 0x48CD */ char unk_48CD[24];
@@ -197,4 +236,11 @@ typedef enum {
/* 0xFF */ BTN_DISABLED = 0xFF
} ButtonStatus;
+typedef enum {
+ /* 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;
+
#endif
diff --git a/include/z64scene.h b/include/z64scene.h
index 8d301d1d17..b20313198d 100644
--- a/include/z64scene.h
+++ b/include/z64scene.h
@@ -1,15 +1,16 @@
-#ifndef _Z64SCENE_H_
-#define _Z64SCENE_H_
+#ifndef Z64SCENE_H
+#define Z64SCENE_H
#include "ultra64.h"
#include "z64dma.h"
+#include "z64cutscene.h"
#include "unk.h"
#define SPAWN_ROT_FLAGS(rotation, flags) (((rotation) << 7) | (flags))
typedef struct {
- /* 0x00 */ u32 vromStart;
- /* 0x04 */ u32 vromEnd;
+ /* 0x00 */ uintptr_t vromStart;
+ /* 0x04 */ uintptr_t vromEnd;
} RomFile; // size = 0x8
typedef struct {
@@ -290,7 +291,7 @@ typedef struct {
typedef struct {
struct {
s8 room; // Room to switch to
- s8 effects; // How the camera reacts during the transition
+ s8 bgCamDataId; // How the camera reacts during the transition. -2 for spiral staircase. -1 for generic door. 0+ will index scene CamData
} /* 0x00 */ sides[2]; // 0 = front, 1 = back
/* 0x04 */ s16 id;
/* 0x06 */ Vec3s pos;
@@ -310,13 +311,6 @@ typedef struct {
/* 0xE */ s16 params;
} ActorEntry; // size = 0x10
-typedef struct {
- /* 0x0 */ u32 data;
- /* 0x4 */ s16 unk4;
- /* 0x6 */ u8 unk6;
- /* 0x7 */ u8 unk7;
-} CutsceneEntry; // size = 0x8
-
typedef struct {
/* 0x0 */ u8 spawn;
/* 0x1 */ u8 room;
@@ -496,10 +490,12 @@ typedef struct {
} MinimapChest; // size = 0xA
typedef struct {
- /* 0x00 */ s16 type;
- /* 0x00 */ s16 numPoints;
- /* 0x00 */ Vec3s* points;
-} CsCameraEntry;
+ /* 0x0 */ s16 setting;
+ /* 0x2 */ s16 numData;
+ /* 0x4 */ Vec3s* data;
+} CsCamData; // size = 0x8
+
+typedef CsCamData CsCameraEntry; // TODO: Remove once ZAPD updates its structs
typedef union {
/* Command: N/A */ SCmdBase base;
diff --git a/include/z_en_hy_code.h b/include/z_en_hy_code.h
new file mode 100644
index 0000000000..997a41233c
--- /dev/null
+++ b/include/z_en_hy_code.h
@@ -0,0 +1,94 @@
+#ifndef Z_EN_HY_CODE_H
+#define Z_EN_HY_CODE_H
+
+#include "global.h"
+#include "overlays/actors/ovl_En_Door/z_en_door.h"
+
+struct EnHy;
+
+#define ENHY_LIMB_MAX 16
+
+//! TODO: Better animaion enum names when animations are documented
+typedef enum {
+ /* 0 */ ENHY_ANIMATION_AOB_0,
+ /* 1 */ ENHY_ANIMATION_BOJ_1,
+ /* 2 */ ENHY_ANIMATION_BOJ_2,
+ /* 3 */ ENHY_ANIMATION_BOJ_3,
+ /* 4 */ ENHY_ANIMATION_BOJ_4,
+ /* 5 */ ENHY_ANIMATION_BOJ_5,
+ /* 6 */ ENHY_ANIMATION_BBA_6,
+ /* 7 */ ENHY_ANIMATION_BJI_7,
+ /* 8 */ ENHY_ANIMATION_BJI_8,
+ /* 9 */ ENHY_ANIMATION_BJI_9,
+ /* 10 */ ENHY_ANIMATION_BOJ_10,
+ /* 11 */ ENHY_ANIMATION_OS_ANIME_11,
+ /* 12 */ ENHY_ANIMATION_BOJ_12,
+ /* 13 */ ENHY_ANIMATION_BOJ_13,
+ /* 14 */ ENHY_ANIMATION_BOJ_14,
+ /* 15 */ ENHY_ANIMATION_BOJ_15,
+ /* 16 */ ENHY_ANIMATION_BOJ_16,
+ /* 17 */ ENHY_ANIMATION_BOJ_17,
+ /* 18 */ ENHY_ANIMATION_BOJ_18,
+ /* 19 */ ENHY_ANIMATION_BOJ_19,
+ /* 20 */ ENHY_ANIMATION_BOJ_20,
+ /* 21 */ ENHY_ANIMATION_MAX
+} EnHyAnimation;
+
+typedef void (*EnHyActionFunc)(struct EnHy*, GlobalContext*);
+
+typedef struct EnHy {
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ EnHyActionFunc actionFunc;
+ /* 0x148 */ EnHyActionFunc tmpActionFunc;
+ /* 0x14C */ SkelAnime skelAnime;
+ /* 0x190 */ s8 headObjIndex; // Limb 15
+ /* 0x191 */ s8 skelUpperObjIndex; // Limbs 8-14
+ /* 0x192 */ s8 skelLowerObjIndex; // Limbs 1-7
+ /* 0x193 */ s8 animObjIndex;
+ /* 0x194 */ ColliderCylinder collider;
+ /* 0x1E0 */ u16 textId;
+ /* 0x1E2 */ u8 waitingOnInit;
+ /* 0x1E3 */ u8 inMsgState3;
+ /* 0x1E4 */ Path* path;
+ /* 0x1E8 */ s16 curPoint;
+ /* 0x1EC */ Vec3f leftFootPos;
+ /* 0x1F8 */ Vec3f rightFootPos;
+ /* 0x204 */ u8 isLeftFootOnGround;
+ /* 0x205 */ u8 isRightFootOnGround;
+ /* 0x206 */ Vec3s jointTable[ENHY_LIMB_MAX];
+ /* 0x266 */ Vec3s morphTable[ENHY_LIMB_MAX];
+ /* 0x2C6 */ Vec3s focusTarget;
+ /* 0x2CC */ Vec3s headRot;
+ /* 0x2D2 */ Vec3s torsoRot;
+ /* 0x2D8 */ Vec3s tmpFocusTarget;
+ /* 0x2DE */ Vec3s tmpHeadRot;
+ /* 0x2E4 */ Vec3s tmpTorsoRot;
+ /* 0x2EA */ s16 limbRotTableY[16];
+ /* 0x30A */ s16 limbRotTableZ[16];
+ /* 0x32C */ Vec3f bodyPartsPos[15];
+ /* 0x3E0 */ UNK_TYPE1 unk_3E0[0x6];
+ /* 0x3E6 */ s16 eyeTexIndex;
+ /* 0x3E8 */ s16 blinkTimer;
+} EnHy; // size = 0x3EC
+
+extern s8 gEnHyBodyParts[];
+extern s8 gEnHyBodyPartsIndex[];
+extern u8 gEnHyShadowSize[];
+
+s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex);
+EnDoor* EnHy_FindNearestDoor(Actor* actor, GlobalContext* globalCtx);
+void EnHy_ChangeObjectAndAnim(EnHy* enHy, GlobalContext* globalCtx, s16 animIndex);
+s32 EnHy_UpdateSkelAnime(EnHy* enHy, GlobalContext* globalCtx);
+void EnHy_Blink(EnHy* enHy, s32 arg1);
+s32 EnHy_Init(EnHy* enHy, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex);
+void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, EnDoor* door, s16 arg3, s16 arg4);
+s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5);
+s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3);
+s32 EnHy_SetPointFowards(EnHy* enHy, GlobalContext* globalCtx, f32 gravity, s16 animIndex);
+s32 EnHy_SetPointBackwards(EnHy* enHy, GlobalContext* globalCtx, s16 animIndex);
+s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget);
+s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget);
+void EnHy_UpdateCollider(EnHy* enHy, GlobalContext* globalCtx);
+s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 distAboveThreshold);
+
+#endif // Z_EN_HY_CODE_H
diff --git a/spec b/spec
index 8f4c435901..0cfd47f20b 100644
--- a/spec
+++ b/spec
@@ -14,7 +14,7 @@ beginseg
name "boot"
address 0x80080060
include "build/src/boot_O2_g3/boot_main.o"
- include "build/data/boot/rsp_boot.data.o"
+ include "build/data/boot/rspboot.data.o"
include "build/src/boot_O2_g3/idle.o"
include "build/src/boot_O2_g3/idle_extra_bss.o"
include "build/src/boot_O2_g3/viconfig.o"
@@ -162,7 +162,6 @@ beginseg
include "build/src/libultra/voice/voicesetadconverter.o"
include "build/src/libultra/io/aisetfreq.o"
include "build/src/libultra/io/contramread.o"
- include "build/data/boot/contramread.data.o"
include "build/src/libultra/voice/voicecontwrite20.o"
include "build/src/libultra/io/crc.o"
include "build/src/libultra/os/getactivequeue.o"
@@ -422,7 +421,9 @@ beginseg
compress
after "dmadata"
include "build/src/code/z_en_a_keep.o"
- include "build/data/code/rsp.data.o"
+ include "build/data/code/aspMain.data.o"
+ include "build/data/code/gspS2DEX2.fifo.data.o"
+ include "build/data/code/njpgdspMain.data.o"
include "build/data/code/code_801ADE60.data.o"
include "build/data/code/code_801E3FA0.bss.o"
include "build/src/code/z_en_item00.o"
@@ -459,14 +460,13 @@ beginseg
include "build/data/code/z_debug_mode.data.o"
include "build/data/code/z_debug_mode.bss.o"
include "build/src/code/z_demo.o"
- include "build/data/code/z_demo.bss.o"
include "build/src/code/z_draw.o"
include "build/data/code/z_draw.data.o"
include "build/src/code/z_eff_footmark.o"
include "build/data/code/z_eff_footmark.data.o"
include "build/src/code/z_sound_source.o"
include "build/src/code/z_elf_message.o"
- include "build/src/code/z_en_hy.o"
+ include "build/src/code/z_en_hy_code.o"
include "build/src/code/z_face_reaction.o"
include "build/src/code/z_env_flags.o"
include "build/src/code/z_eventmgr.o"
@@ -620,7 +620,7 @@ beginseg
pad_text
pad_text
pad_text
- include "build/data/code/audio_data.data.o"
+ include "build/src/code/audio/audio_data.o"
include "build/src/code/audio/audio_synthesis.o"
include "build/data/code/audio_synthesis.data.o"
include "build/src/code/audio/audio_heap.o"
@@ -635,7 +635,6 @@ beginseg
include "build/data/code/code_80194790.data.o"
include "build/src/code/audio/audio_playback.o"
include "build/src/code/audio/audio_effects.o"
- include "build/data/code/audio_effects.data.o"
include "build/src/code/audio/audio_seqplayer.o"
include "build/data/code/audio_seqplayer.data.o"
include "build/data/code/audio_dramStack.data.o"
@@ -643,8 +642,6 @@ beginseg
pad_text
include "build/asm/code/code_8019AEC0.text.o" // handwritten
include "build/src/code/audio/code_8019AF00.o"
- include "build/data/code/code_8019AF00.data.o"
- include "build/data/code/code_8019AF00.bss.o"
include "build/src/code/audio/code_801A4EB0.o"
include "build/data/code/code_801A4EB0.data.o"
include "build/src/code/audio/code_801A51F0.o"
@@ -663,7 +660,11 @@ beginseg
include "build/src/code/jpegdecoder.o"
include_readonly "build/src/code/z_game_over.o"
include "build/src/code/z_construct.o"
- include "build/data/code/rsp.rodata.o"
+ include "build/data/code/audio_tables.rodata.o"
+ include "build/data/code/aspMain.rodata.o"
+ include "build/data/code/gspF3DZEX2.NoN.PosLight.fifo.rodata.o"
+ include "build/data/code/gspS2DEX2.fifo.rodata.o"
+ include "build/data/code/njpgdspMain.rodata.o"
endseg
beginseg
@@ -773,8 +774,6 @@ beginseg
name "ovl_En_Door"
compress
include "build/src/overlays/actors/ovl_En_Door/z_en_door.o"
- include "build/data/ovl_En_Door/ovl_En_Door.data.o"
- include "build/data/ovl_En_Door/ovl_En_Door.bss.o"
include "build/data/ovl_En_Door/ovl_En_Door.reloc.o"
endseg
@@ -804,9 +803,7 @@ beginseg
name "ovl_En_Bom"
compress
include "build/src/overlays/actors/ovl_En_Bom/z_en_bom.o"
- include "build/data/ovl_En_Bom/ovl_En_Bom.data.o"
- include "build/data/ovl_En_Bom/ovl_En_Bom.bss.o"
- include "build/data/ovl_En_Bom/ovl_En_Bom.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Bom/ovl_En_Bom_reloc.o"
endseg
beginseg
@@ -843,8 +840,11 @@ beginseg
name "ovl_En_Arrow"
compress
include "build/src/overlays/actors/ovl_En_Arrow/z_en_arrow.o"
- include "build/data/ovl_En_Arrow/ovl_En_Arrow.data.o"
+#ifdef NON_MATCHING
+ include "build/src/overlays/actors/ovl_En_Arrow/ovl_En_Arrow_reloc.o"
+#else
include "build/data/ovl_En_Arrow/ovl_En_Arrow.reloc.o"
+#endif
endseg
beginseg
@@ -925,8 +925,7 @@ beginseg
name "ovl_Door_Shutter"
compress
include "build/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.o"
- include "build/data/ovl_Door_Shutter/ovl_Door_Shutter.data.o"
- include "build/data/ovl_Door_Shutter/ovl_Door_Shutter.reloc.o"
+ include "build/src/overlays/actors/ovl_Door_Shutter/ovl_Door_Shutter_reloc.o"
endseg
beginseg
@@ -1001,8 +1000,7 @@ beginseg
name "ovl_En_Am"
compress
include "build/src/overlays/actors/ovl_En_Am/z_en_am.o"
- include "build/data/ovl_En_Am/ovl_En_Am.data.o"
- include "build/data/ovl_En_Am/ovl_En_Am.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Am/ovl_En_Am_reloc.o"
endseg
beginseg
@@ -1253,8 +1251,11 @@ beginseg
name "ovl_Mir_Ray"
compress
include "build/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.o"
- include "build/data/ovl_Mir_Ray/ovl_Mir_Ray.data.o"
+#ifdef NON_MATCHING
+ include "build/src/overlays/actors/ovl_Mir_Ray/ovl_Mir_Ray_reloc.o"
+#else
include "build/data/ovl_Mir_Ray/ovl_Mir_Ray.reloc.o"
+#endif
endseg
beginseg
@@ -1275,8 +1276,7 @@ beginseg
name "ovl_En_Karebaba"
compress
include "build/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.o"
- include "build/data/ovl_En_Karebaba/ovl_En_Karebaba.data.o"
- include "build/data/ovl_En_Karebaba/ovl_En_Karebaba.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Karebaba/ovl_En_Karebaba_reloc.o"
endseg
beginseg
@@ -1331,8 +1331,7 @@ beginseg
name "ovl_Obj_Oshihiki"
compress
include "build/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.o"
- include "build/data/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki.data.o"
- include "build/data/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Oshihiki/ovl_Obj_Oshihiki_reloc.o"
endseg
beginseg
@@ -1354,8 +1353,7 @@ beginseg
name "ovl_En_Insect"
compress
include "build/src/overlays/actors/ovl_En_Insect/z_en_insect.o"
- include "build/data/ovl_En_Insect/ovl_En_Insect.data.o"
- include "build/data/ovl_En_Insect/ovl_En_Insect.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Insect/ovl_En_Insect_reloc.o"
endseg
beginseg
@@ -1470,8 +1468,7 @@ beginseg
name "ovl_Obj_Ice_Poly"
compress
include "build/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.o"
- include "build/data/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly.data.o"
- include "build/data/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Ice_Poly/ovl_Obj_Ice_Poly_reloc.o"
endseg
beginseg
@@ -1494,16 +1491,14 @@ beginseg
name "ovl_Obj_Bean"
compress
include "build/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.o"
- include "build/data/ovl_Obj_Bean/ovl_Obj_Bean.data.o"
- include "build/data/ovl_Obj_Bean/ovl_Obj_Bean.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Bean/ovl_Obj_Bean_reloc.o"
endseg
beginseg
name "ovl_Obj_Bombiwa"
compress
include "build/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.o"
- include "build/data/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa.data.o"
- include "build/data/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Bombiwa/ovl_Obj_Bombiwa_reloc.o"
endseg
beginseg
@@ -1729,8 +1724,7 @@ beginseg
name "ovl_En_Ani"
compress
include "build/src/overlays/actors/ovl_En_Ani/z_en_ani.o"
- include "build/data/ovl_En_Ani/ovl_En_Ani.data.o"
- include "build/data/ovl_En_Ani/ovl_En_Ani.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Ani/ovl_En_Ani_reloc.o"
endseg
beginseg
@@ -1752,8 +1746,7 @@ beginseg
name "ovl_En_Mag"
compress
include "build/src/overlays/actors/ovl_En_Mag/z_en_mag.o"
- include "build/data/ovl_En_Mag/ovl_En_Mag.data.o"
- include "build/data/ovl_En_Mag/ovl_En_Mag.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Mag/ovl_En_Mag_reloc.o"
endseg
beginseg
@@ -2130,8 +2123,7 @@ beginseg
name "ovl_Obj_Comb"
compress
include "build/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.o"
- include "build/data/ovl_Obj_Comb/ovl_Obj_Comb.data.o"
- include "build/data/ovl_Obj_Comb/ovl_Obj_Comb.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Comb/ovl_Obj_Comb_reloc.o"
endseg
beginseg
@@ -2221,8 +2213,7 @@ beginseg
name "ovl_En_Zo"
compress
include "build/src/overlays/actors/ovl_En_Zo/z_en_zo.o"
- include "build/data/ovl_En_Zo/ovl_En_Zo.data.o"
- include "build/data/ovl_En_Zo/ovl_En_Zo.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zo/ovl_En_Zo_reloc.o"
endseg
beginseg
@@ -2439,8 +2430,7 @@ beginseg
name "ovl_En_Bom_Bowl_Man"
compress
include "build/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.o"
- include "build/data/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man.data.o"
- include "build/data/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man_reloc.o"
endseg
beginseg
@@ -2476,16 +2466,14 @@ beginseg
name "ovl_En_Cne_01"
compress
include "build/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.o"
- include "build/data/ovl_En_Cne_01/ovl_En_Cne_01.data.o"
- include "build/data/ovl_En_Cne_01/ovl_En_Cne_01.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Cne_01/ovl_En_Cne_01_reloc.o"
endseg
beginseg
name "ovl_En_Bba_01"
compress
include "build/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.o"
- include "build/data/ovl_En_Bba_01/ovl_En_Bba_01.data.o"
- include "build/data/ovl_En_Bba_01/ovl_En_Bba_01.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Bba_01/ovl_En_Bba_01_reloc.o"
endseg
beginseg
@@ -2560,9 +2548,11 @@ beginseg
name "ovl_Boss_06"
compress
include "build/src/overlays/actors/ovl_Boss_06/z_boss_06.o"
- include "build/data/ovl_Boss_06/ovl_Boss_06.data.o"
- include "build/data/ovl_Boss_06/ovl_Boss_06.bss.o"
+#ifdef NON_MATCHING
+ include "build/src/overlays/actors/ovl_Boss_06/ovl_Boss_06_reloc.o"
+#else
include "build/data/ovl_Boss_06/ovl_Boss_06.reloc.o"
+#endif
endseg
beginseg
@@ -2633,8 +2623,7 @@ beginseg
name "ovl_Bg_Numa_Hana"
compress
include "build/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.o"
- include "build/data/ovl_Bg_Numa_Hana/ovl_Bg_Numa_Hana.data.o"
- include "build/data/ovl_Bg_Numa_Hana/ovl_Bg_Numa_Hana.reloc.o"
+ include "build/src/overlays/actors/ovl_Bg_Numa_Hana/ovl_Bg_Numa_Hana_reloc.o"
endseg
beginseg
@@ -2664,8 +2653,7 @@ beginseg
name "ovl_En_Syateki_Wf"
compress
include "build/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.o"
- include "build/data/ovl_En_Syateki_Wf/ovl_En_Syateki_Wf.data.o"
- include "build/data/ovl_En_Syateki_Wf/ovl_En_Syateki_Wf.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Syateki_Wf/ovl_En_Syateki_Wf_reloc.o"
endseg
beginseg
@@ -2688,11 +2676,7 @@ beginseg
name "ovl_Obj_Iceblock"
compress
include "build/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.o"
-#ifdef NON_MATCHING
include "build/src/overlays/actors/ovl_Obj_Iceblock/ovl_Obj_Iceblock_reloc.o"
-#else
- include "build/data/ovl_Obj_Iceblock/ovl_Obj_Iceblock.reloc.o"
-#endif
endseg
beginseg
@@ -2707,9 +2691,7 @@ beginseg
name "ovl_Bg_Dblue_Movebg"
compress
include "build/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.o"
- include "build/data/ovl_Bg_Dblue_Movebg/ovl_Bg_Dblue_Movebg.data.o"
- include "build/data/ovl_Bg_Dblue_Movebg/ovl_Bg_Dblue_Movebg.bss.o"
- include "build/data/ovl_Bg_Dblue_Movebg/ovl_Bg_Dblue_Movebg.reloc.o"
+ include "build/src/overlays/actors/ovl_Bg_Dblue_Movebg/ovl_Bg_Dblue_Movebg_reloc.o"
endseg
beginseg
@@ -2762,8 +2744,7 @@ beginseg
name "ovl_En_Pr"
compress
include "build/src/overlays/actors/ovl_En_Pr/z_en_pr.o"
- include "build/data/ovl_En_Pr/ovl_En_Pr.data.o"
- include "build/data/ovl_En_Pr/ovl_En_Pr.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Pr/ovl_En_Pr_reloc.o"
endseg
beginseg
@@ -3138,8 +3119,7 @@ beginseg
name "ovl_En_Pr2"
compress
include "build/src/overlays/actors/ovl_En_Pr2/z_en_pr2.o"
- include "build/data/ovl_En_Pr2/ovl_En_Pr2.data.o"
- include "build/data/ovl_En_Pr2/ovl_En_Pr2.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Pr2/ovl_En_Pr2_reloc.o"
endseg
beginseg
@@ -3267,17 +3247,14 @@ beginseg
name "ovl_Dm_Char00"
compress
include "build/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.o"
- include "build/data/ovl_Dm_Char00/ovl_Dm_Char00.data.o"
- include "build/data/ovl_Dm_Char00/ovl_Dm_Char00.reloc.o"
+ include "build/src/overlays/actors/ovl_Dm_Char00/ovl_Dm_Char00_reloc.o"
endseg
beginseg
name "ovl_Dm_Char01"
compress
include "build/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.o"
- include "build/data/ovl_Dm_Char01/ovl_Dm_Char01.data.o"
- include "build/data/ovl_Dm_Char01/ovl_Dm_Char01.bss.o"
- include "build/data/ovl_Dm_Char01/ovl_Dm_Char01.reloc.o"
+ include "build/src/overlays/actors/ovl_Dm_Char01/ovl_Dm_Char01_reloc.o"
endseg
beginseg
@@ -3308,8 +3285,7 @@ beginseg
name "ovl_Dm_Char05"
compress
include "build/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.o"
- include "build/data/ovl_Dm_Char05/ovl_Dm_Char05.data.o"
- include "build/data/ovl_Dm_Char05/ovl_Dm_Char05.reloc.o"
+ include "build/src/overlays/actors/ovl_Dm_Char05/ovl_Dm_Char05_reloc.o"
endseg
beginseg
@@ -3433,8 +3409,7 @@ beginseg
name "ovl_En_Bigokuta"
compress
include "build/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.o"
- include "build/data/ovl_En_Bigokuta/ovl_En_Bigokuta.data.o"
- include "build/data/ovl_En_Bigokuta/ovl_En_Bigokuta.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Bigokuta/ovl_En_Bigokuta_reloc.o"
endseg
beginseg
@@ -3574,8 +3549,7 @@ beginseg
name "ovl_En_Osn"
compress
include "build/src/overlays/actors/ovl_En_Osn/z_en_osn.o"
- include "build/data/ovl_En_Osn/ovl_En_Osn.data.o"
- include "build/data/ovl_En_Osn/ovl_En_Osn.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Osn/ovl_En_Osn_reloc.o"
endseg
beginseg
@@ -3589,8 +3563,7 @@ beginseg
name "ovl_En_Trt2"
compress
include "build/src/overlays/actors/ovl_En_Trt2/z_en_trt2.o"
- include "build/data/ovl_En_Trt2/ovl_En_Trt2.data.o"
- include "build/data/ovl_En_Trt2/ovl_En_Trt2.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Trt2/ovl_En_Trt2_reloc.o"
endseg
beginseg
@@ -3898,8 +3871,7 @@ beginseg
name "ovl_Obj_Dhouse"
compress
include "build/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.o"
- include "build/data/ovl_Obj_Dhouse/ovl_Obj_Dhouse.data.o"
- include "build/data/ovl_Obj_Dhouse/ovl_Obj_Dhouse.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Dhouse/ovl_Obj_Dhouse_reloc.o"
endseg
beginseg
@@ -3991,8 +3963,7 @@ beginseg
name "ovl_En_Kendo_Js"
compress
include "build/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.o"
- include "build/data/ovl_En_Kendo_Js/ovl_En_Kendo_Js.data.o"
- include "build/data/ovl_En_Kendo_Js/ovl_En_Kendo_Js.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Kendo_Js/ovl_En_Kendo_Js_reloc.o"
endseg
beginseg
@@ -4037,8 +4008,7 @@ beginseg
name "ovl_En_Zoraegg"
compress
include "build/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.o"
- include "build/data/ovl_En_Zoraegg/ovl_En_Zoraegg.data.o"
- include "build/data/ovl_En_Zoraegg/ovl_En_Zoraegg.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zoraegg/ovl_En_Zoraegg_reloc.o"
endseg
beginseg
@@ -4053,8 +4023,7 @@ beginseg
name "ovl_En_Gg"
compress
include "build/src/overlays/actors/ovl_En_Gg/z_en_gg.o"
- include "build/data/ovl_En_Gg/ovl_En_Gg.data.o"
- include "build/data/ovl_En_Gg/ovl_En_Gg.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Gg/ovl_En_Gg_reloc.o"
endseg
beginseg
@@ -4069,8 +4038,7 @@ beginseg
name "ovl_Obj_Snowball2"
compress
include "build/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.o"
- include "build/data/ovl_Obj_Snowball2/ovl_Obj_Snowball2.data.o"
- include "build/data/ovl_Obj_Snowball2/ovl_Obj_Snowball2.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Snowball2/ovl_Obj_Snowball2_reloc.o"
endseg
beginseg
@@ -4127,8 +4095,7 @@ beginseg
name "ovl_En_Gk"
compress
include "build/src/overlays/actors/ovl_En_Gk/z_en_gk.o"
- include "build/data/ovl_En_Gk/ovl_En_Gk.data.o"
- include "build/data/ovl_En_Gk/ovl_En_Gk.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Gk/ovl_En_Gk_reloc.o"
endseg
beginseg
@@ -4197,8 +4164,7 @@ beginseg
name "ovl_En_Sth"
compress
include "build/src/overlays/actors/ovl_En_Sth/z_en_sth.o"
- include "build/data/ovl_En_Sth/ovl_En_Sth.data.o"
- include "build/data/ovl_En_Sth/ovl_En_Sth.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Sth/ovl_En_Sth_reloc.o"
endseg
beginseg
@@ -4258,8 +4224,7 @@ beginseg
name "ovl_En_Jg"
compress
include "build/src/overlays/actors/ovl_En_Jg/z_en_jg.o"
- include "build/data/ovl_En_Jg/ovl_En_Jg.data.o"
- include "build/data/ovl_En_Jg/ovl_En_Jg.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Jg/ovl_En_Jg_reloc.o"
endseg
beginseg
@@ -4313,8 +4278,7 @@ beginseg
name "ovl_Bg_Ikana_Rotaryroom"
compress
include "build/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.o"
- include "build/data/ovl_Bg_Ikana_Rotaryroom/ovl_Bg_Ikana_Rotaryroom.data.o"
- include "build/data/ovl_Bg_Ikana_Rotaryroom/ovl_Bg_Ikana_Rotaryroom.reloc.o"
+ include "build/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/ovl_Bg_Ikana_Rotaryroom_reloc.o"
endseg
beginseg
@@ -4466,9 +4430,7 @@ beginseg
name "ovl_Obj_Hunsui"
compress
include "build/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.o"
- include "build/data/ovl_Obj_Hunsui/ovl_Obj_Hunsui.data.o"
- include "build/data/ovl_Obj_Hunsui/ovl_Obj_Hunsui.bss.o"
- include "build/data/ovl_Obj_Hunsui/ovl_Obj_Hunsui.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Hunsui/ovl_Obj_Hunsui_reloc.o"
endseg
beginseg
@@ -4490,8 +4452,7 @@ beginseg
name "ovl_En_Zob"
compress
include "build/src/overlays/actors/ovl_En_Zob/z_en_zob.o"
- include "build/data/ovl_En_Zob/ovl_En_Zob.data.o"
- include "build/data/ovl_En_Zob/ovl_En_Zob.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zob/ovl_En_Zob_reloc.o"
endseg
beginseg
@@ -4529,8 +4490,7 @@ beginseg
name "ovl_En_Baba"
compress
include "build/src/overlays/actors/ovl_En_Baba/z_en_baba.o"
- include "build/data/ovl_En_Baba/ovl_En_Baba.data.o"
- include "build/data/ovl_En_Baba/ovl_En_Baba.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Baba/ovl_En_Baba_reloc.o"
endseg
beginseg
@@ -4567,8 +4527,7 @@ beginseg
name "ovl_Obj_Kinoko"
compress
include "build/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.o"
- include "build/data/ovl_Obj_Kinoko/ovl_Obj_Kinoko.data.o"
- include "build/data/ovl_Obj_Kinoko/ovl_Obj_Kinoko.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Kinoko/ovl_Obj_Kinoko_reloc.o"
endseg
beginseg
@@ -4591,9 +4550,7 @@ beginseg
name "ovl_En_Tanron2"
compress
include "build/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.o"
- include "build/data/ovl_En_Tanron2/ovl_En_Tanron2.data.o"
- include "build/data/ovl_En_Tanron2/ovl_En_Tanron2.bss.o"
- include "build/data/ovl_En_Tanron2/ovl_En_Tanron2.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Tanron2/ovl_En_Tanron2_reloc.o"
endseg
beginseg
@@ -4616,8 +4573,7 @@ beginseg
name "ovl_En_Zos"
compress
include "build/src/overlays/actors/ovl_En_Zos/z_en_zos.o"
- include "build/data/ovl_En_Zos/ovl_En_Zos.data.o"
- include "build/data/ovl_En_Zos/ovl_En_Zos.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zos/ovl_En_Zos_reloc.o"
endseg
beginseg
@@ -4640,8 +4596,7 @@ beginseg
name "ovl_En_Ja"
compress
include "build/src/overlays/actors/ovl_En_Ja/z_en_ja.o"
- include "build/data/ovl_En_Ja/ovl_En_Ja.data.o"
- include "build/data/ovl_En_Ja/ovl_En_Ja.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Ja/ovl_En_Ja_reloc.o"
endseg
beginseg
@@ -4705,8 +4660,7 @@ beginseg
name "ovl_En_Scopenuts"
compress
include "build/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.o"
- include "build/data/ovl_En_Scopenuts/ovl_En_Scopenuts.data.o"
- include "build/data/ovl_En_Scopenuts/ovl_En_Scopenuts.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Scopenuts/ovl_En_Scopenuts_reloc.o"
endseg
beginseg
@@ -4746,16 +4700,14 @@ beginseg
name "ovl_En_Hgo"
compress
include "build/src/overlays/actors/ovl_En_Hgo/z_en_hgo.o"
- include "build/data/ovl_En_Hgo/ovl_En_Hgo.data.o"
- include "build/data/ovl_En_Hgo/ovl_En_Hgo.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Hgo/ovl_En_Hgo_reloc.o"
endseg
beginseg
name "ovl_En_Zov"
compress
include "build/src/overlays/actors/ovl_En_Zov/z_en_zov.o"
- include "build/data/ovl_En_Zov/ovl_En_Zov.data.o"
- include "build/data/ovl_En_Zov/ovl_En_Zov.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zov/ovl_En_Zov_reloc.o"
endseg
beginseg
@@ -4859,8 +4811,7 @@ beginseg
name "ovl_En_Zow"
compress
include "build/src/overlays/actors/ovl_En_Zow/z_en_zow.o"
- include "build/data/ovl_En_Zow/ovl_En_Zow.data.o"
- include "build/data/ovl_En_Zow/ovl_En_Zow.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Zow/ovl_En_Zow_reloc.o"
endseg
beginseg
@@ -4874,8 +4825,7 @@ beginseg
name "ovl_En_Al"
compress
include "build/src/overlays/actors/ovl_En_Al/z_en_al.o"
- include "build/data/ovl_En_Al/ovl_En_Al.data.o"
- include "build/data/ovl_En_Al/ovl_En_Al.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Al/ovl_En_Al_reloc.o"
endseg
beginseg
@@ -4964,8 +4914,7 @@ beginseg
name "ovl_En_Demo_heishi"
compress
include "build/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.o"
- include "build/data/ovl_En_Demo_heishi/ovl_En_Demo_heishi.data.o"
- include "build/data/ovl_En_Demo_heishi/ovl_En_Demo_heishi.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Demo_heishi/ovl_En_Demo_heishi_reloc.o"
endseg
beginseg
@@ -5026,17 +4975,18 @@ beginseg
name "ovl_En_Ig"
compress
include "build/src/overlays/actors/ovl_En_Ig/z_en_ig.o"
- include "build/data/ovl_En_Ig/ovl_En_Ig.data.o"
- include "build/data/ovl_En_Ig/ovl_En_Ig.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Ig/ovl_En_Ig_reloc.o"
endseg
beginseg
name "ovl_En_Rg"
compress
include "build/src/overlays/actors/ovl_En_Rg/z_en_rg.o"
- include "build/data/ovl_En_Rg/ovl_En_Rg.data.o"
- include "build/data/ovl_En_Rg/ovl_En_Rg.bss.o"
+#ifdef NON_MATCHING
+ include "build/src/overlays/actors/ovl_En_Rg/ovl_En_Rg_reloc.o"
+#else
include "build/data/ovl_En_Rg/ovl_En_Rg.reloc.o"
+#endif
endseg
beginseg
@@ -5059,8 +5009,7 @@ beginseg
name "ovl_En_Yb"
compress
include "build/src/overlays/actors/ovl_En_Yb/z_en_yb.o"
- include "build/data/ovl_En_Yb/ovl_En_Yb.data.o"
- include "build/data/ovl_En_Yb/ovl_En_Yb.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Yb/ovl_En_Yb_reloc.o"
endseg
beginseg
@@ -5180,8 +5129,7 @@ beginseg
name "ovl_Obj_Kzsaku"
compress
include "build/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.o"
- include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.data.o"
- include "build/data/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku.reloc.o"
+ include "build/src/overlays/actors/ovl_Obj_Kzsaku/ovl_Obj_Kzsaku_reloc.o"
endseg
beginseg
@@ -5389,8 +5337,7 @@ beginseg
name "ovl_En_Hint_Skb"
compress
include "build/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.o"
- include "build/data/ovl_En_Hint_Skb/ovl_En_Hint_Skb.data.o"
- include "build/data/ovl_En_Hint_Skb/ovl_En_Hint_Skb.reloc.o"
+ include "build/src/overlays/actors/ovl_En_Hint_Skb/ovl_En_Hint_Skb_reloc.o"
endseg
beginseg
@@ -9204,56 +9151,64 @@ beginseg
name "scene_texture_01"
compress
romalign 0x1000
- include "build/baserom/scene_texture_01.o"
+ number 6
+ include "build/assets/misc/scene_texture_01/scene_texture_01.o"
endseg
beginseg
name "scene_texture_02"
compress
romalign 0x1000
- include "build/baserom/scene_texture_02.o"
+ number 6
+ include "build/assets/misc/scene_texture_02/scene_texture_02.o"
endseg
beginseg
name "scene_texture_03"
compress
romalign 0x1000
- include "build/baserom/scene_texture_03.o"
+ number 6
+ include "build/assets/misc/scene_texture_03/scene_texture_03.o"
endseg
beginseg
name "scene_texture_04"
compress
romalign 0x1000
- include "build/baserom/scene_texture_04.o"
+ number 6
+ include "build/assets/misc/scene_texture_04/scene_texture_04.o"
endseg
beginseg
name "scene_texture_05"
compress
romalign 0x1000
- include "build/baserom/scene_texture_05.o"
+ number 6
+ include "build/assets/misc/scene_texture_05/scene_texture_05.o"
endseg
beginseg
name "scene_texture_06"
compress
romalign 0x1000
- include "build/baserom/scene_texture_06.o"
+ number 6
+ include "build/assets/misc/scene_texture_06/scene_texture_06.o"
endseg
beginseg
name "scene_texture_07"
compress
romalign 0x1000
- include "build/baserom/scene_texture_07.o"
+ number 6
+ include "build/assets/misc/scene_texture_07/scene_texture_07.o"
endseg
beginseg
name "scene_texture_08"
compress
romalign 0x1000
- include "build/baserom/scene_texture_08.o"
+ number 6
+ include "build/assets/misc/scene_texture_08/scene_texture_08.o"
endseg
beginseg
@@ -9291,7 +9246,8 @@ beginseg
name "parameter_static"
compress
romalign 0x1000
- include "build/baserom/parameter_static.o"
+ include "build/assets/interface/parameter_static/parameter_static.o"
+ number 2
endseg
beginseg
diff --git a/src/boot_O2_g3/CIC6105.c b/src/boot_O2_g3/CIC6105.c
index 4745ad5c89..78eed1a775 100644
--- a/src/boot_O2_g3/CIC6105.c
+++ b/src/boot_O2_g3/CIC6105.c
@@ -1,4 +1,3 @@
-#include "prevent_bss_reordering.h"
#include "global.h"
UNK_TYPE4 D_8009BE30;
diff --git a/src/boot_O2_g3/boot_main.c b/src/boot_O2_g3/boot_main.c
index be281d2489..04bb9a33ae 100644
--- a/src/boot_O2_g3/boot_main.c
+++ b/src/boot_O2_g3/boot_main.c
@@ -1,6 +1,4 @@
-#include "prevent_bss_reordering.h"
#include "global.h"
-#include "prevent_bss_reordering.h"
StackEntry sBootThreadInfo;
OSThread sIdleThread;
diff --git a/src/boot_O2_g3/idle.c b/src/boot_O2_g3/idle.c
index 2a52e7dcec..942435fa7b 100644
--- a/src/boot_O2_g3/idle.c
+++ b/src/boot_O2_g3/idle.c
@@ -1,6 +1,4 @@
-#include "prevent_bss_reordering.h"
#include "global.h"
-#include "prevent_bss_reordering.h"
u8 D_80096B20 = 1;
vu8 gViConfigUseDefault = 1;
diff --git a/src/boot_O2_g3/z_std_dma.c b/src/boot_O2_g3/z_std_dma.c
index 190536b21e..9edc65e52c 100644
--- a/src/boot_O2_g3/z_std_dma.c
+++ b/src/boot_O2_g3/z_std_dma.c
@@ -211,24 +211,20 @@ s32 DmaMgr_SendRequest0(void* vramStart, uintptr_t vromStart, size_t size) {
}
void DmaMgr_Start(void) {
- DmaEntry* iter;
- u32 idx;
-
DmaMgr_DMARomToRam(SEGMENT_ROM_START(dmadata), dmadata, SEGMENT_ROM_SIZE(dmadata));
-dummy_label:;
+ {
+ DmaEntry* iter = dmadata;
+ u32 idx = 0;
- iter = dmadata;
- idx = 0;
- while (iter->vromEnd != 0) {
- iter++;
- idx++;
+ while (iter->vromEnd != 0) {
+ iter++;
+ idx++;
+ }
+
+ numDmaEntries = idx;
}
- numDmaEntries = idx;
-
-dummy_label_2:;
-
osCreateMesgQueue(&sDmaMgrMsgQueue, sDmaMgrMsgs, ARRAY_COUNT(sDmaMgrMsgs));
StackCheck_Init(&sDmaMgrStackInfo, sDmaMgrStack, sDmaMgrStack + sizeof(sDmaMgrStack), 0, 0x100, "dmamgr");
osCreateThread(&sDmaMgrThread, Z_THREAD_ID_DMAMGR, DmaMgr_ThreadEntry, NULL, sDmaMgrStack + sizeof(sDmaMgrStack),
diff --git a/src/code/audio/audio_data.c b/src/code/audio/audio_data.c
new file mode 100644
index 0000000000..c430189223
--- /dev/null
+++ b/src/code/audio/audio_data.c
@@ -0,0 +1,949 @@
+#include "global.h"
+
+s16 gLowPassFilterData[16 * 8] = {
+ /* 0x0 */ 0, 0, 0, 32767, 0, 0, 0, 0, // Identity filter (delta function)
+ /* 0x1 */ 3854, 4188, 4398, 4469, 4398, 4188, 3854, 3416, // low-freq cutoff (more filtering)
+ /* 0x2 */ 3415, 4314, 4915, 5126, 4915, 4314, 3415, 2351,
+ /* 0x3 */ 2636, 4433, 5762, 6252, 5762, 4433, 2636, 849,
+ /* 0x4 */ 1334, 4196, 6646, 7609, 6646, 4196, 1334, -802,
+ /* 0x5 */ -265, 3421, 7292, 8944, 7292, 3421, -265, -1863,
+ /* 0x6 */ -1558, 2065, 7146, 9546, 7146, 2065, -1558, -1682,
+ /* 0x7 */ -2353, 726, 7441, 11028, 7441, 726, -2353, -697,
+ /* 0x8 */ -2252, -693, 7121, 11962, 7121, -693, -2252, 668,
+ /* 0x9 */ -1373, -1819, 6299, 12298, 6299, -1819, -1373, 1484,
+ /* 0xA */ -213, -2740, 5843, 13680, 5843, -2740, -213, 1494,
+ /* 0xB */ 980, -3081, 4883, 14286, 4883, -3081, 980, 590,
+ /* 0xC */ 1769, -2973, 3866, 14981, 3866, -2973, 1769, -568,
+ /* 0xD */ 2023, -2554, 2911, 16397, 2911, -2554, 2023, -1391,
+ /* 0xE */ 1766, -1918, 2016, 19800, 2016, -1918, 1766, -1564,
+ /* 0xF */ 841, -853, 863, 26829, 863, -853, 841, -820, // high-freq cutoff (less filtering)
+};
+
+s16 gHighPassFilterData[15 * 8] = {
+ /* 0x0 */ -289, -291, -289, 30736, -289, -291, -289, -290, // low-freq cutoff (less filtering)
+ /* 0x1 */ -464, -467, -467, 29506, -467, -467, -464, -463,
+ /* 0x2 */ -662, -670, -672, 28101, -672, -670, -662, -656,
+ /* 0x3 */ -839, -855, -861, 26830, -861, -855, -839, -822,
+ /* 0x4 */ -996, -1024, -1038, 25685, -1038, -1024, -996, -963,
+ /* 0x5 */ -1184, -1236, -1266, 24272, -1266, -1236, -1184, -1118,
+ /* 0x6 */ -1357, -1450, -1506, 22900, -1506, -1450, -1357, -1238,
+ /* 0x7 */ -1514, -1680, -1784, 21498, -1784, -1680, -1514, -1307,
+ /* 0x8 */ -1613, -1877, -2048, 20390, -2048, -1877, -1613, -1298,
+ /* 0x9 */ -1657, -2185, -2559, 18869, -2559, -2185, -1657, -1093,
+ /* 0xA */ -1524, -2395, -3078, 18030, -3078, -2395, -1524, -739,
+ /* 0xB */ -1253, -2504, -3621, 17642, -3621, -2504, -1253, -367,
+ /* 0xC */ -525, -2367, -4732, 17517, -4732, -2367, -525, 0,
+ /* 0xD */ -34, -1762, -5706, 17503, -5706, -1762, -34, -258,
+ /* 0xE */ -772, -3, -6985, 17240, -6985, -3, -772, -3, // high-freq cutoff (more filtering)
+};
+
+// clang-format off
+s16 gBandStopFilterData[105 * 8] = {
+ // Block 0
+ /* 0x00 */ -43, -716, -1205, 28210, -1205, -716, -43, 629,
+ /* 0x01 */ 249, -919, -1819, 25489, -1819, -919, 249, 1301,
+ /* 0x02 */ 1267, -802, -2650, 20722, -2650, -802, 1267, 2603,
+ /* 0x03 */ 2497, -210, -3196, 17617, -3196, -210, 2497, 3339,
+ /* 0x04 */ 3413, 690, -3385, 14754, -3385, 690, 3413, 3035,
+ /* 0x05 */ 3859, 1734, -3416, 12704, -3416, 1734, 3859, 2042,
+ /* 0x06 */ 3858, 2907, -3414, 11516, -3414, 2907, 3858, 890,
+ /* 0x07 */ 3374, 4194, -3345, 10859, -3345, 4194, 3374, 80,
+ /* 0x08 */ 2446, 5521, -3130, 10483, -3130, 5521, 2446, 86,
+ /* 0x09 */ 1275, 6760, -2665, 10225, -2665, 6760, 1275, 1140,
+ /* 0x0A */ 252, 7778, -1836, 10022, -1836, 7778, 252, 3010,
+ /* 0x0B */ -98, 8427, -461, 9805, -461, 8427, -98, 4988,
+ /* 0x0C */ 719, 7392, 1528, 8201, 1528, 7392, 719, 5286,
+ /* 0x0D */ 2499, 5359, 3651, 5985, 3651, 5359, 2499, 3761,
+
+ // Block 1
+ /* 0x0E */ 711, -205, -1026, 27608, -1026, -205, 711, 1271,
+ /* 0x0F */ 1335, -108, -1520, 24836, -1520, -108, 1335, 2003,
+ /* 0x10 */ 2540, 455, -2104, 19853, -2104, 455, 2540, 2712,
+ /* 0x11 */ 3406, 1298, -2347, 16266, -2347, 1298, 3406, 2397,
+ /* 0x12 */ 3860, 2321, -2440, 14094, -2440, 2321, 3860, 1428,
+ /* 0x13 */ 3858, 3511, -2439, 12888, -2439, 3511, 3858, 259,
+ /* 0x14 */ 3248, 4679, -2238, 11859, -2238, 4679, 3248, -575,
+ /* 0x15 */ 2329, 6021, -1929, 11579, -1929, 6021, 2329, -626,
+ /* 0x16 */ 1225, 7613, -1395, 11967, -1395, 7613, 1225, 332,
+ /* 0x17 */ 172, 8785, -352, 12028, -352, 8785, 172, 2119,
+ /* 0x18 */ -172, 8198, 1139, 10360, 1139, 8198, -172, 3385,
+ /* 0x19 */ 511, 7006, 2830, 8649, 2830, 7006, 511, 3421,
+ /* 0x1A */ 1995, 5313, 4595, 6801, 4595, 5313, 1995, 2158,
+
+ // Block 2
+ /* 0x1B */ 1196, 313, -815, 26961, -815, 313, 1196, 1154,
+ /* 0x1C */ 1896, 666, -1159, 23821, -1159, 666, 1896, 1500,
+ /* 0x1D */ 2934, 1569, -1548, 19353, -1548, 1569, 2934, 1308,
+ /* 0x1E */ 3463, 2673, -1703, 16770, -1703, 2673, 3463, 316,
+ /* 0x1F */ 3269, 3757, -1608, 14587, -1608, 3757, 3269, -910,
+ /* 0x20 */ 2585, 4889, -1364, 13325, -1364, 4889, 2585, -1763,
+ /* 0x21 */ 1588, 6277, -970, 13171, -970, 6277, 1588, -1922,
+ /* 0x22 */ 337, 8121, -265, 14134, -265, 8121, 337, -1186,
+ /* 0x23 */ -795, 8193, 882, 12631, 882, 8193, -795, 391,
+ /* 0x24 */ -1058, 7224, 2132, 10492, 2132, 7224, -1058, 1444,
+ /* 0x25 */ -503, 6540, 3803, 9532, 3803, 6540, -503, 1541,
+ /* 0x26 */ 906, 5326, 5759, 8358, 5759, 5326, 906, 423,
+
+ // Block 3
+ /* 0x27 */ 1298, 781, -597, 27018, -597, 781, 1298, 392,
+ /* 0x28 */ 1914, 1364, -834, 24334, -834, 1364, 1914, 205,
+ /* 0x29 */ 2474, 2527, -1015, 19916, -1015, 2527, 2474, -817,
+ /* 0x2A */ 2277, 3649, -934, 16994, -934, 3649, 2277, -2050,
+ /* 0x2B */ 1545, 4865, -673, 15635, -673, 4865, 1545, -2964,
+ /* 0x2C */ 366, 6363, -181, 15693, -181, 6363, 366, -3252,
+ /* 0x2D */ -1017, 6734, 611, 13854, 611, 6734, -1017, -2187,
+ /* 0x2E */ -1937, 6500, 1558, 12000, 1558, 6500, -1937, -774,
+ /* 0x2F */ -2216, 6018, 2714, 10698, 2714, 6018, -2216, 171,
+ /* 0x30 */ -1795, 5344, 4221, 9864, 4221, 5344, -1795, 182,
+ /* 0x31 */ -659, 4411, 6228, 9260, 6228, 4411, -659, -908,
+
+ // Block 4
+ /* 0x32 */ 968, 1138, -358, 27228, -358, 1138, 968, -607,
+ /* 0x33 */ 1251, 1846, -453, 24418, -453, 1846, 1251, -1246,
+ /* 0x34 */ 1138, 3176, -412, 20709, -412, 3176, 1138, -2601,
+ /* 0x35 */ 313, 4550, -119, 19167, -119, 4550, 313, -3633,
+ /* 0x36 */ -972, 5170, 419, 16290, 419, 5170, -972, -3351,
+ /* 0x37 */ -2123, 5230, 1090, 13680, 1090, 5230, -2123, -2199,
+ /* 0x38 */ -2916, 5066, 1926, 12019, 1926, 5066, -2916, -929,
+ /* 0x39 */ -3202, 4669, 2995, 10953, 2995, 4669, -3202, -80,
+ /* 0x3A */ -2874, 3990, 4369, 10214, 4369, 3990, -2874, -84,
+ /* 0x3B */ -1937, 3001, 6108, 9601, 6108, 3001, -1937, -1071,
+
+ // Block 5
+ /* 0x3C */ 310, 1351, -102, 27950, -102, 1351, 310, -1287,
+ /* 0x3D */ 169, 2166, -55, 25895, -55, 2166, 169, -2088,
+ /* 0x3E */ -697, 3332, 252, 21292, 252, 3332, -697, -2909,
+ /* 0x3F */ -1846, 3873, 739, 17298, 739, 3873, -1846, -2549,
+ /* 0x40 */ -2904, 4036, 1371, 14658, 1371, 4036, -2904, -1485,
+ /* 0x41 */ -3657, 3912, 2183, 12999, 2183, 3912, -3657, -261,
+ /* 0x42 */ -3814, 3385, 3124, 11558, 3124, 3385, -3814, 561,
+ /* 0x43 */ -3535, 2679, 4428, 10890, 4428, 2679, -3535, 589,
+ /* 0x44 */ -2812, 1718, 6312, 10782, 6312, 1718, -2812, -299,
+
+ // Block 6
+ /* 0x45 */ -472, 1315, 164, 27677, 164, 1315, -472, -1185,
+ /* 0x46 */ -993, 1945, 353, 24630, 353, 1945, -993, -1551,
+ /* 0x47 */ -2181, 2706, 860, 19924, 860, 2706, -2181, -1347,
+ /* 0x48 */ -3275, 2979, 1521, 16895, 1521, 2979, -3275, -319,
+ /* 0x49 */ -3842, 2725, 2248, 14245, 2248, 2725, -3842, 889,
+ /* 0x4A */ -3933, 2186, 3141, 12579, 3141, 2186, -3933, 1665,
+ /* 0x4B */ -3664, 1431, 4428, 11971, 4428, 1431, -3664, 1747,
+ /* 0x4C */ -3021, 346, 6399, 12209, 6399, 346, -3021, 1024,
+
+ // Block 7
+ /* 0x4D */ -1075, 1074, 417, 27236, 417, 1074, -1075, -395,
+ /* 0x4E */ -1798, 1521, 741, 24438, 741, 1521, -1798, -206,
+ /* 0x4F */ -2921, 1848, 1426, 19572, 1426, 1848, -2921, 803,
+ /* 0x50 */ -3491, 1649, 2169, 16192, 2169, 1649, -3491, 1954,
+ /* 0x51 */ -3600, 1124, 3106, 14379, 3106, 1124, -3600, 2726,
+ /* 0x52 */ -3300, 278, 4453, 13834, 4453, 278, -3300, 2867,
+ /* 0x53 */ -2282, -916, 5804, 12748, 5804, -916, -2282, 2012,
+
+ // Block 8
+ /* 0x54 */ -1306, 682, 649, 26892, 649, 682, -1306, 599,
+ /* 0x55 */ -1951, 858, 1073, 23787, 1073, 858, -1951, 1214,
+ /* 0x56 */ -2705, 755, 1945, 19505, 1945, 755, -2705, 2450,
+ /* 0x57 */ -2857, 207, 2996, 17354, 2996, 207, -2857, 3289,
+ /* 0x58 */ -2261, -722, 4101, 15425, 4101, -722, -2261, 3173,
+ /* 0x59 */ -1164, -1891, 5287, 13853, 5287, -1891, -1164, 2227,
+
+ // Block 9
+ /* 0x5A */ -1119, 202, 869, 27136, 869, 202, -1119, 1249,
+ /* 0x5B */ -1545, 108, 1432, 24611, 1432, 108, -1545, 1984,
+ /* 0x5C */ -1675, -472, 2529, 20597, 2529, -472, -1675, 2814,
+ /* 0x5D */ -1040, -1426, 3661, 17877, 3661, -1426, -1040, 2634,
+ /* 0x5E */ 105, -2626, 4871, 15944, 4871, -2626, 105, 1615,
+
+ // Block 10
+ /* 0x5F */ -554, -321, 1071, 27687, 1071, -321, -554, 1185,
+ /* 0x60 */ -562, -704, 1738, 25171, 1738, -704, -562, 1585,
+ /* 0x61 */ 73, -1749, 3045, 21572, 3045, -1749, 73, 1458,
+ /* 0x62 */ 1152, -2704, 3884, 16963, 3884, -2704, 1152, 320,
+
+ // Block 11
+ /* 0x63 */ 222, -806, 1221, 27862, 1221, -806, 222, 404,
+ /* 0x64 */ 632, -1385, 1908, 24706, 1908, -1385, 632, 208,
+ /* 0x65 */ 1605, -2339, 2840, 18439, 2840, -2339, 1605, -756,
+
+ // Block 12
+ /* 0x66 */ 861, -1081, 1224, 25856, 1224, -1081, 861, -576,
+ /* 0x67 */ 1422, -1655, 1804, 21885, 1804, -1655, 1422, -1117,
+
+ // Block 13
+ /* 0x68 */ 434, -453, 467, 29652, 467, -453, 434, -405,
+};
+
+s16 gBandPassFilterData[105 * 8] = {
+ // Block 0
+ /* 0x00 */ 687, 4058, 6599, 7544, 6599, 4058, 687, -2532,
+ /* 0x01 */ -1303, 2777, 6337, 7745, 6337, 2777, -1303, -4185,
+ /* 0x02 */ -2873, 1376, 5931, 7886, 5931, 1376, -2873, -4520,
+ /* 0x03 */ -4108, 0, 5913, 8723, 5913, 0, -4108, -3999,
+ /* 0x04 */ -4233, -1334, 5242, 8775, 5242, -1334, -4233, -2371,
+ /* 0x05 */ -3882, -2547, 4808, 9389, 4808, -2547, -3882, -900,
+ /* 0x06 */ -3072, -3668, 4423, 10438, 4423, -3668, -3072, 0,
+ /* 0x07 */ -1914, -4609, 3950, 11819, 3950, -4609, -1914, 0,
+ /* 0x08 */ -678, -5227, 3301, 13449, 3301, -5227, -678, -903,
+ /* 0x09 */ 246, -5250, 2363, 14858, 2363, -5250, 246, -2189,
+ /* 0x0A */ 509, -4812, 1262, 16454, 1262, -4812, 509, -3143,
+ /* 0x0B */ 0, -4404, 0, 20367, 0, -4404, 0, -3591,
+ /* 0x0C */ -1151, -2707, -1393, 19954, -1393, -2707, -1151, -2310,
+ /* 0x0D */ -1765, -1920, -2014, 19800, -2014, -1920, -1765, -1566,
+
+ // Block 1
+ /* 0x0E */ -3122, 1346, 5464, 7125, 5464, 1346, -3122, -5776,
+ /* 0x0F */ -4566, 0, 5211, 7489, 5211, 0, -4566, -5723,
+ /* 0x10 */ -4941, -1265, 4474, 7249, 4474, -1265, -4941, -4155,
+ /* 0x11 */ -4932, -2431, 4021, 7549, 4021, -2431, -4932, -2447,
+ /* 0x12 */ -4511, -3587, 3678, 8286, 3678, -3587, -4511, -927,
+ /* 0x13 */ -3660, -4711, 3314, 9396, 3314, -4711, -3660, 0,
+ /* 0x14 */ -2471, -5685, 2820, 10810, 2820, -5685, -2471, 0,
+ /* 0x15 */ -1213, -6349, 2123, 12463, 2123, -6349, -1213, -929,
+ /* 0x16 */ -272, -6581, 1189, 14354, 1189, -6581, -272, -2327,
+ /* 0x17 */ 0, -6351, 0, 16604, 0, -6351, 0, -3460,
+ /* 0x18 */ -509, -4812, -1262, 16454, -1262, -4812, -509, -3143,
+ /* 0x19 */ -1488, -3277, -2395, 16401, -2395, -3277, -1488, -2045,
+ /* 0x1A */ -2021, -2555, -2910, 16397, -2910, -2555, -2021, -1392,
+
+ // Block 2
+ /* 0x1B */ -5281, -1216, 4054, 6441, 4054, -1216, -5281, -5221,
+ /* 0x1C */ -5495, -2330, 3552, 6498, 3552, -2330, -5495, -3511,
+ /* 0x1D */ -5377, -3474, 3206, 6991, 3206, -3474, -5377, -1659,
+ /* 0x1E */ -4853, -4693, 2893, 7887, 2893, -4693, -4853, 0,
+ /* 0x1F */ -3646, -5586, 2357, 8623, 2357, -5586, -3646, 965,
+ /* 0x20 */ -2373, -6636, 1821, 10132, 1821, -6636, -2373, 971,
+ /* 0x21 */ -1086, -7852, 1115, 12658, 1115, -7852, -1086, 0,
+ /* 0x22 */ 0, -8182, 0, 14837, 0, -8182, 0, -1565,
+ /* 0x23 */ 272, -6581, -1189, 14354, -1189, -6581, 272, -2326,
+ /* 0x24 */ -246, -5250, -2363, 14858, -2363, -5250, -246, -2189,
+ /* 0x25 */ -1231, -3701, -3393, 14931, -3393, -3701, -1231, -1181,
+ /* 0x26 */ -1768, -2974, -3865, 14981, -3865, -2974, -1768, -569,
+
+ // Block 3
+ /* 0x27 */ -5832, -3391, 2948, 6305, 2948, -3391, -5832, -2116,
+ /* 0x28 */ -5587, -4647, 2641, 7014, 2641, -4647, -5587, 0,
+ /* 0x29 */ -4365, -5434, 2063, 7306, 2063, -5434, -4365, 1734,
+ /* 0x2A */ -3036, -6379, 1534, 8205, 1534, -6379, -3036, 2660,
+ /* 0x2B */ -1576, -7586, 916, 9927, 916, -7586, -1576, 2682,
+ /* 0x2C */ 0, -9097, 0, 12831, 0, -9097, 0, 1740,
+ /* 0x2D */ 1086, -7852, -1115, 12658, -1115, -7852, 1086, 0,
+ /* 0x2E */ 1213, -6349, -2123, 12463, -2123, -6349, 1213, -929,
+ /* 0x2F */ 678, -5227, -3301, 13449, -3301, -5227, 678, -903,
+ /* 0x30 */ -406, -3992, -4605, 14759, -4605, -3992, -406, 0,
+ /* 0x31 */ -979, -3083, -4882, 14287, -4882, -3083, -979, 589,
+
+ // Block 4
+ /* 0x32 */ -4748, -5319, 1902, 6607, 1902, -5319, -4748, 2218,
+ /* 0x33 */ -3402, -6148, 1363, 7101, 1363, -6148, -3402, 3837,
+ /* 0x34 */ -1853, -7246, 787, 8259, 787, -7246, -1853, 4733,
+ /* 0x35 */ 0, -8777, 0, 10430, 0, -8777, 0, 4782,
+ /* 0x36 */ 1576, -7586, -916, 9927, -916, -7586, 1576, 2682,
+ /* 0x37 */ 2373, -6636, -1821, 10132, -1821, -6636, 2373, 971,
+ /* 0x38 */ 2471, -5685, -2820, 10810, -2820, -5685, 2471, 0,
+ /* 0x39 */ 1914, -4609, -3950, 11819, -3950, -4609, 1914, 0,
+ /* 0x3A */ 846, -3385, -5195, 13035, -5195, -3385, 846, 875,
+ /* 0x3B */ 214, -2741, -5841, 13679, -5841, -2741, 214, 1492,
+
+ // Block 5
+ /* 0x3C */ -1989, -7002, 716, 7373, 716, -7002, -1989, 5976,
+ /* 0x3D */ 0, -8439, 0, 9006, 0, -8439, 0, 6882,
+ /* 0x3E */ 1853, -7246, -787, 8259, -787, -7246, 1853, 4733,
+ /* 0x3F */ 3036, -6379, -1534, 8205, -1534, -6379, 3036, 2660,
+ /* 0x40 */ 3646, -5586, -2357, 8623, -2357, -5586, 3646, 965,
+ /* 0x41 */ 3660, -4711, -3314, 9396, -3314, -4711, 3660, 0,
+ /* 0x42 */ 3072, -3668, -4423, 10438, -4423, -3668, 3072, 0,
+ /* 0x43 */ 2003, -2459, -5656, 11656, -5656, -2459, 2003, 869,
+ /* 0x44 */ 1374, -1820, -6298, 12297, -6298, -1820, 1374, 1483,
+
+ // Block 6
+ /* 0x45 */ 1989, -7002, -716, 7373, -716, -7002, 1989, 5976,
+ /* 0x46 */ 3402, -6148, -1363, 7101, -1363, -6148, 3402, 3837,
+ /* 0x47 */ 4365, -5434, -2063, 7306, -2063, -5434, 4365, 1734,
+ /* 0x48 */ 4853, -4693, -2893, 7887, -2893, -4693, 4853, 0,
+ /* 0x49 */ 4511, -3587, -3678, 8286, -3678, -3587, 4511, -927,
+ /* 0x4A */ 3882, -2547, -4808, 9389, -4808, -2547, 3882, -900,
+ /* 0x4B */ 2938, -1390, -6423, 11264, -6423, -1390, 2938, 0,
+ /* 0x4C */ 2253, -695, -7120, 11961, -7120, -695, 2253, 667,
+
+ // Block 7
+ /* 0x4D */ 4748, -5319, -1902, 6607, -1902, -5319, 4748, 2218,
+ /* 0x4E */ 5587, -4647, -2641, 7014, -2641, -4647, 5587, 0,
+ /* 0x4F */ 5377, -3474, -3206, 6991, -3206, -3474, 5377, -1659,
+ /* 0x50 */ 4932, -2431, -4021, 7549, -4021, -2431, 4932, -2447,
+ /* 0x51 */ 4233, -1334, -5242, 8775, -5242, -1334, 4233, -2371,
+ /* 0x52 */ 3218, 0, -7035, 10795, -7035, 0, 3218, -1464,
+ /* 0x53 */ 2355, 725, -7440, 11027, -7440, 725, 2355, -698,
+
+ // Block 8
+ /* 0x54 */ 5832, -3391, -2948, 6305, -2948, -3391, 5832, -2116,
+ /* 0x55 */ 5495, -2330, -3552, 6498, -3552, -2330, 5495, -3511,
+ /* 0x56 */ 4941, -1265, -4474, 7249, -4474, -1265, 4941, -4155,
+ /* 0x57 */ 4108, 0, -5913, 8723, -5913, 0, 4108, -3999,
+ /* 0x58 */ 2383, 1404, -6726, 9241, -6726, 1404, 2383, -2496,
+ /* 0x59 */ 1559, 2063, -7145, 9545, -7145, 2063, 1559, -1684,
+
+ // Block 9
+ /* 0x5A */ 5281, -1216, -4054, 6441, -4054, -1216, 5281, -5221,
+ /* 0x5B */ 4566, 0, -5211, 7489, -5211, 0, 4566, -5723,
+ /* 0x5C */ 2873, 1376, -5931, 7886, -5931, 1376, 2873, -4520,
+ /* 0x5D */ 1113, 2760, -6833, 8572, -6833, 2760, 1113, -2779,
+ /* 0x5E */ 267, 3420, -7291, 8943, -7291, 3420, 267, -1864,
+
+ // Block 10
+ /* 0x5F */ 3122, 1346, -5464, 7125, -5464, 1346, 3122, -5776,
+ /* 0x60 */ 1303, 2777, -6337, 7745, -6337, 2777, 1303, -4185,
+ /* 0x61 */ -605, 3972, -6859, 7994, -6859, 3972, -605, -1897,
+ /* 0x62 */ -1333, 4196, -6647, 7610, -6647, 4196, -1333, -803,
+
+ // Block 11
+ /* 0x63 */ -687, 4058, -6599, 7544, -6599, 4058, -687, -2532,
+ /* 0x64 */ -2251, 4520, -6201, 6821, -6201, 4520, -2251, 0,
+ /* 0x65 */ -2636, 4433, -5763, 6253, -5763, 4433, -2636, 847,
+
+ // Block 12
+ /* 0x66 */ -3207, 4379, -5163, 5439, -5163, 4379, -3207, 1826,
+ /* 0x67 */ -3414, 4314, -4915, 5127, -4915, 4314, -3414, 2350,
+
+ // Block 13
+ /* 0x68 */ -3854, 4188, -4398, 4469, -4398, 4188, -3854, 3415,
+};
+
+s16 gSawtoothWaveSample[] = {
+ // 1st Harmonic
+ 0, 1023, 2047, 3071, 4095, 5119, 6143, 7167,
+ 8191, 9215, 10239, 11263, 12287, 13311, 14335, 15359,
+ 16383, 17407, 18431, 19455, 20479, 21503, 22527, 23551,
+ 24575, 25599, 26623, 27647, 28671, 29695, 30719, 31743,
+ -32767, -31743, -30719, -29695, -28671, -27647, -26623, -25599,
+ -24575, -23551, -22527, -21503, -20479, -19455, -18431, -17407,
+ -16383, -15359, -14335, -13311, -12287, -11263, -10239, -9215,
+ -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023,
+
+ // 2nd Harmonic
+ 0, 2047, 4095, 6143, 8191, 10239, 12287, 14335,
+ 16383, 18431, 20479, 22527, 24575, 26623, 28671, 30719,
+ -32767, -30719, -28671, -26623, -24575, -22527, -20479, -18431,
+ -16383, -14335, -12287, -10239, -8191, -6143, -4095, -2047,
+ 0, 2047, 4095, 6143, 8191, 10239, 12287, 14335,
+ 16383, 18431, 20479, 22527, 24575, 26623, 28671, 30719,
+ -32767, -30719, -28671, -26623, -24575, -22527, -20479, -18431,
+ -16383, -14335, -12287, -10239, -8191, -6143, -4095, -2047,
+
+ // 4th Harmonic
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+
+ // 8th Harmonic
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, -32767, -24575, -16383, -8191,
+};
+
+s16 gTriangleWaveSample[] = {
+ // 1st Harmonic
+ 0, 2047, 4095, 6143, 8191, 10239, 12287, 14335,
+ 16383, 18431, 20479, 22527, 24575, 26623, 28671, 30719,
+ 32767, 30719, 28671, 26623, 24575, 22527, 20479, 18431,
+ 16383, 14335, 12287, 10239, 8191, 6143, 4095, 2047,
+ 0, -2047, -4095, -6143, -8191, -10239, -12287, -14335,
+ -16383, -18431, -20479, -22527, -24575, -26623, -28671, -30719,
+ -32767, -30719, -28671, -26623, -24575, -22527, -20479, -18431,
+ -16383, -14335, -12287, -10239, -8191, -6143, -4095, -2047,
+
+ // 2nd Harmonic
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ 32767, 28671, 24575, 20479, 16383, 12287, 8191, 4095,
+ 0, -4095, -8191, -12287, -16383, -20479, -24575, -28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+ 0, 4095, 8191, 12287, 16383, 20479, 24575, 28671,
+ 32767, 28671, 24575, 20479, 16383, 12287, 8191, 4095,
+ 0, -4095, -8191, -12287, -16383, -20479, -24575, -28671,
+ -32767, -28671, -24575, -20479, -16383, -12287, -8191, -4095,
+
+ // 4th Harmonic
+ 0, 8191, 16383, 24575, 32767, 24575, 16383, 8191,
+ 0, -8191, -16383, -24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, 32767, 24575, 16383, 8191,
+ 0, -8191, -16383, -24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, 32767, 24575, 16383, 8191,
+ 0, -8191, -16383, -24575, -32767, -24575, -16383, -8191,
+ 0, 8191, 16383, 24575, 32767, 24575, 16383, 8191,
+ 0, -8191, -16383, -24575, -32767, -24575, -16383, -8191,
+
+ // 8th Harmonic
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+ 0, 16383, 32767, 16383, 0, -16383, -32767, -16383,
+};
+
+s16 gSineWaveSample[] = {
+ // 1st Harmonic
+ 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787,
+ 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609,
+ 32767, 32609, 32137, 31356, 30272, 28897, 27244, 25329,
+ 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211,
+ 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787,
+ -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609,
+ -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329,
+ -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211,
+
+ // 2nd Harmonic
+ 0, 6392, 12539, 18204, 23169, 27244, 30272, 32137,
+ 32767, 32137, 30272, 27244, 23169, 18204, 12539, 6392,
+ 0, -6392, -12539, -18204, -23169, -27244, -30272, -32137,
+ -32767, -32137, -30272, -27244, -23169, -18204, -12539, -6392,
+ 0, 6392, 12539, 18204, 23169, 27244, 30272, 32137,
+ 32767, 32137, 30272, 27244, 23169, 18204, 12539, 6392,
+ 0, -6392, -12539, -18204, -23169, -27244, -30272, -32137,
+ -32767, -32137, -30272, -27244, -23169, -18204, -12539, -6392,
+
+ // 4th Harmonic
+ 0, 12539, 23169, 30272, 32767, 30272, 23169, 12539,
+ 0, -12539, -23169, -30272, -32767, -30272, -23169, -12539,
+ 0, 12539, 23169, 30272, 32767, 30272, 23169, 12539,
+ 0, -12539, -23169, -30272, -32767, -30272, -23169, -12539,
+ 0, 12539, 23169, 30272, 32767, 30272, 23169, 12539,
+ 0, -12539, -23169, -30272, -32767, -30272, -23169, -12539,
+ 0, 12539, 23169, 30272, 32767, 30272, 23169, 12539,
+ 0, -12539, -23169, -30272, -32767, -30272, -23169, -12539,
+
+ // 8th Harmonic
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+ 0, 23169, 32767, 23169, 0, -23169, -32767, -23169,
+};
+
+s16 gSquareWaveSample[] = {
+ // 1st Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
+ 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767,
+ -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767,
+
+ // 2nd Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+
+ // 4th Harmonic
+ -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, -32767, -32767, -32767, -32767,
+
+ // 8th Harmonic
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+ 0, 0, 32767, 32767, 0, 0, -32767, -32767,
+};
+
+s16 gWhiteNoiseSample[] = {
+ // 1st Harmonic
+ 0, -25689, -25791, 27803, -27568, -21030, 22174, 6298,
+ 27071, -18531, 28649, 2284, 3380, 6890, -12682, -21114,
+ 10000, -24520, 32296, 12248, 15096, 15354, -12021, -31545,
+ -12929, 6388, -11064, 30456, -30316, -21999, 29691, 27649,
+ 0, -27649, -29691, 21999, 30316, -30457, 11064, -6387,
+ 12929, 31544, 12021, -15353, -15096, -12249, -32296, 24521,
+ -10000, 21113, 12682, -6889, -3380, -2285, -28649, 18532,
+ -27071, -6299, -22174, 21031, 27568, -27804, 25791, 25690,
+
+ // 2nd Harmonic
+ 0, -25791, -27568, 22174, 27071, 28649, 3380, -12682,
+ 10000, 32296, 15096, -12021, -12929, -11064, -30316, 29691,
+ 0, -29691, 30316, 11064, 12929, 12021, -15096, -32296,
+ -10000, 12682, -3380, -28649, -27071, -22174, 27568, 25791,
+ 0, -25791, -27568, 22174, 27071, 28649, 3380, -12682,
+ 10000, 32296, 15096, -12021, -12929, -11064, -30316, 29691,
+ 0, -29691, 30316, 11064, 12929, 12021, -15096, -32296,
+ -10000, 12682, -3380, -28649, -27071, -22174, 27568, 25791,
+
+ // 4th Harmonic
+ 0, -27568, 27071, 3380, 10000, 15096, -12929, -30316,
+ 0, 30316, 12929, -15096, -10000, -3380, -27071, 27568,
+ 0, -27568, 27071, 3380, 10000, 15096, -12929, -30316,
+ 0, 30316, 12929, -15096, -10000, -3380, -27071, 27568,
+ 0, -27568, 27071, 3380, 10000, 15096, -12929, -30316,
+ 0, 30316, 12929, -15096, -10000, -3380, -27071, 27568,
+ 0, -27568, 27071, 3380, 10000, 15096, -12929, -30316,
+ 0, 30316, 12929, -15096, -10000, -3380, -27071, 27568,
+
+ // 8th Harmonic
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+ 0, 27071, 10000, -12929, 0, 12929, -10000, -27071,
+};
+
+// Sine White Noise?
+s16 D_801D4790[] = {
+ // 1st Harmonic
+ 0, 16316, 20148, 20257, 27209, -32657, 29264, 27259,
+ -29394, -21494, -26410, 30770, 30033, 29130, 20206, 14129,
+ 20000, 25677, 19024, 9146, 6921, 4506, -5868, -13122,
+ -7858, -1885, -7042, -14025, -11903, -8647, -12346, -12396,
+ 0, 12396, 12346, 8647, 11903, 14024, 7042, 1886,
+ 7858, 13121, 5868, -4505, -6921, -9147, -19024, -25676,
+ -20000, -14130, -20206, -29129, -30033, -30771, 26410, 21495,
+ 29394, -27260, -29264, 32658, -27209, -20258, -20148, -16315,
+
+ // 2nd Harmonic
+ 0, 20148, 27209, 29264, -29394, -26410, 30033, 20206,
+ 20000, 19024, 6921, -5868, -7858, -7042, -11903, -12346,
+ 0, 12346, 11903, 7042, 7858, 5868, -6921, -19024,
+ -20000, -20206, -30033, 26410, 29394, -29264, -27209, -20148,
+ 0, 20148, 27209, 29264, -29394, -26410, 30033, 20206,
+ 20000, 19024, 6921, -5868, -7858, -7042, -11903, -12346,
+ 0, 12346, 11903, 7042, 7858, 5868, -6921, -19024,
+ -20000, -20206, -30033, 26410, 29394, -29264, -27209, -20148,
+
+ // 4th Harmonic
+ 0, 27209, -29394, 30033, 20000, 6921, -7858, -11903,
+ 0, 11903, 7858, -6921, -20000, -30033, 29394, -27209,
+ 0, 27209, -29394, 30033, 20000, 6921, -7858, -11903,
+ 0, 11903, 7858, -6921, -20000, -30033, 29394, -27209,
+ 0, 27209, -29394, 30033, 20000, 6921, -7858, -11903,
+ 0, 11903, 7858, -6921, -20000, -30033, 29394, -27209,
+ 0, 27209, -29394, 30033, 20000, 6921, -7858, -11903,
+ 0, 11903, 7858, -6921, -20000, -30033, 29394, -27209,
+
+ // 8th Harmonic
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+ 0, -29394, 20000, -7858, 0, 7858, -20000, 29394,
+};
+
+// Pulse Wave (duty cycle = 12.5%)
+s16 gEighthPulseWaveSample[] = {
+ // 1st Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+
+ // 2nd Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, 0, 0, 0, 0, 0, 0,
+
+ // 4th Harmonic
+ 0, 0, 0, 0, 32767, 0, 0, 0,
+ 0, 0, 0, 0, -32767, 0, 0, 0,
+ 0, 0, 0, 0, 32767, 0, 0, 0,
+ 0, 0, 0, 0, -32767, 0, 0, 0,
+ 0, 0, 0, 0, 32767, 0, 0, 0,
+ 0, 0, 0, 0, -32767, 0, 0, 0,
+ 0, 0, 0, 0, 32767, 0, 0, 0,
+ 0, 0, 0, 0, -32767, 0, 0, 0,
+
+ // 8th Harmonic
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+};
+
+// Pulse Wave (duty cycle = 25%)
+s16 gQuarterPulseWaveSample[] = {
+ // 1st Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, -32767, -32767, -32767, -32767,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+
+ // 2nd Harmonic
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 32767, 32767, 32767, 32767, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ -32767, -32767, -32767, -32767, 0, 0, 0, 0,
+
+ // 4th Harmonic
+ 0, 0, 0, 0, 32767, 32767, 0, 0,
+ 0, 0, 0, 0, -32767, -32767, 0, 0,
+ 0, 0, 0, 0, 32767, 32767, 0, 0,
+ 0, 0, 0, 0, -32767, -32767, 0, 0,
+ 0, 0, 0, 0, 32767, 32767, 0, 0,
+ 0, 0, 0, 0, -32767, -32767, 0, 0,
+ 0, 0, 0, 0, 32767, 32767, 0, 0,
+ 0, 0, 0, 0, -32767, -32767, 0, 0,
+
+ // 8th Harmonic
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+ 0, 0, 32767, 0, 0, 0, -32767, 0,
+};
+// clang-format on
+
+s16* gWaveSamples[] = {
+ gSawtoothWaveSample, gTriangleWaveSample, gSineWaveSample, gSquareWaveSample, gWhiteNoiseSample,
+ D_801D4790, gEighthPulseWaveSample, gQuarterPulseWaveSample, gQuarterPulseWaveSample,
+};
+
+f32 gBendPitchOneOctaveFrequencies[] = {
+ 0.5f, 0.5f, 0.502736f, 0.505488f, 0.508254f, 0.511036f, 0.513833f, 0.516645f, 0.519472f, 0.522315f,
+ 0.525174f, 0.528048f, 0.530938f, 0.533843f, 0.536765f, 0.539702f, 0.542656f, 0.545626f, 0.548612f, 0.551614f,
+ 0.554633f, 0.557669f, 0.560721f, 0.563789f, 0.566875f, 0.569977f, 0.573097f, 0.576233f, 0.579387f, 0.582558f,
+ 0.585746f, 0.588951f, 0.592175f, 0.595415f, 0.598674f, 0.60195f, 0.605245f, 0.608557f, 0.611888f, 0.615236f,
+ 0.618603f, 0.621989f, 0.625393f, 0.628815f, 0.632257f, 0.635717f, 0.639196f, 0.642694f, 0.646212f, 0.649748f,
+ 0.653304f, 0.65688f, 0.660475f, 0.664089f, 0.667724f, 0.671378f, 0.675052f, 0.678747f, 0.682461f, 0.686196f,
+ 0.689952f, 0.693727f, 0.697524f, 0.701341f, 0.70518f, 0.709039f, 0.712919f, 0.716821f, 0.720744f, 0.724689f,
+ 0.728655f, 0.732642f, 0.736652f, 0.740684f, 0.744737f, 0.748813f, 0.752911f, 0.757031f, 0.761175f, 0.76534f,
+ 0.769529f, 0.77374f, 0.777975f, 0.782232f, 0.786513f, 0.790818f, 0.795146f, 0.799497f, 0.803873f, 0.808272f,
+ 0.812696f, 0.817144f, 0.821616f, 0.826112f, 0.830633f, 0.835179f, 0.83975f, 0.844346f, 0.848966f, 0.853613f,
+ 0.858284f, 0.862982f, 0.867704f, 0.872453f, 0.877228f, 0.882029f, 0.886856f, 0.891709f, 0.89659f, 0.901496f,
+ 0.90643f, 0.911391f, 0.916379f, 0.921394f, 0.926436f, 0.931507f, 0.936604f, 0.94173f, 0.946884f, 0.952066f,
+ 0.957277f, 0.962516f, 0.967783f, 0.97308f, 0.978405f, 0.98376f, 0.989144f, 0.994557f, 1.0f, 1.005473f,
+ 1.010975f, 1.016508f, 1.022071f, 1.027665f, 1.033289f, 1.038944f, 1.04463f, 1.050347f, 1.056095f, 1.061875f,
+ 1.067687f, 1.07353f, 1.079405f, 1.085312f, 1.091252f, 1.097224f, 1.103229f, 1.109267f, 1.115337f, 1.121441f,
+ 1.127579f, 1.13375f, 1.139955f, 1.146193f, 1.152466f, 1.158773f, 1.165115f, 1.171491f, 1.177903f, 1.184349f,
+ 1.190831f, 1.197348f, 1.203901f, 1.210489f, 1.217114f, 1.223775f, 1.230473f, 1.237207f, 1.243978f, 1.250786f,
+ 1.257631f, 1.264514f, 1.271434f, 1.278392f, 1.285389f, 1.292423f, 1.299497f, 1.306608f, 1.313759f, 1.320949f,
+ 1.328178f, 1.335447f, 1.342756f, 1.350104f, 1.357493f, 1.364922f, 1.372392f, 1.379903f, 1.387455f, 1.395048f,
+ 1.402683f, 1.41036f, 1.418078f, 1.425839f, 1.433642f, 1.441488f, 1.449377f, 1.457309f, 1.465285f, 1.473304f,
+ 1.481367f, 1.489474f, 1.497626f, 1.505822f, 1.514063f, 1.522349f, 1.530681f, 1.539058f, 1.547481f, 1.55595f,
+ 1.564465f, 1.573027f, 1.581636f, 1.590292f, 1.598995f, 1.607746f, 1.616545f, 1.625392f, 1.634287f, 1.643231f,
+ 1.652224f, 1.661266f, 1.670358f, 1.6795f, 1.688691f, 1.697933f, 1.707225f, 1.716569f, 1.725963f, 1.735409f,
+ 1.744906f, 1.754456f, 1.764058f, 1.773712f, 1.783419f, 1.793179f, 1.802993f, 1.81286f, 1.822782f, 1.832757f,
+ 1.842788f, 1.852873f, 1.863013f, 1.873209f, 1.883461f, 1.893768f, 1.904132f, 1.914553f, 1.925031f, 1.935567f,
+ 1.946159f, 1.95681f, 1.96752f, 1.978287f, 1.989114f, 2.0f,
+};
+
+f32 gBendPitchTwoSemitonesFrequencies[] = {
+ 0.890899f, 0.890899f, 0.89171f, 0.892521f, 0.893333f, 0.894146f, 0.89496f, 0.895774f, 0.89659f, 0.897406f,
+ 0.898222f, 0.89904f, 0.899858f, 0.900677f, 0.901496f, 0.902317f, 0.903138f, 0.90396f, 0.904783f, 0.905606f,
+ 0.90643f, 0.907255f, 0.908081f, 0.908907f, 0.909734f, 0.910562f, 0.911391f, 0.91222f, 0.91305f, 0.913881f,
+ 0.914713f, 0.915545f, 0.916379f, 0.917213f, 0.918047f, 0.918883f, 0.919719f, 0.920556f, 0.921394f, 0.922232f,
+ 0.923072f, 0.923912f, 0.924752f, 0.925594f, 0.926436f, 0.927279f, 0.928123f, 0.928968f, 0.929813f, 0.93066f,
+ 0.931507f, 0.932354f, 0.933203f, 0.934052f, 0.934902f, 0.935753f, 0.936604f, 0.937457f, 0.93831f, 0.939164f,
+ 0.940019f, 0.940874f, 0.94173f, 0.942587f, 0.943445f, 0.944304f, 0.945163f, 0.946023f, 0.946884f, 0.947746f,
+ 0.948608f, 0.949472f, 0.950336f, 0.951201f, 0.952066f, 0.952933f, 0.9538f, 0.954668f, 0.955537f, 0.956406f,
+ 0.957277f, 0.958148f, 0.95902f, 0.959893f, 0.960766f, 0.961641f, 0.962516f, 0.963392f, 0.964268f, 0.965146f,
+ 0.966024f, 0.966903f, 0.967783f, 0.968664f, 0.969546f, 0.970428f, 0.971311f, 0.972195f, 0.97308f, 0.973965f,
+ 0.974852f, 0.975739f, 0.976627f, 0.977516f, 0.978405f, 0.979296f, 0.980187f, 0.981079f, 0.981972f, 0.982865f,
+ 0.98376f, 0.984655f, 0.985551f, 0.986448f, 0.987346f, 0.988244f, 0.989144f, 0.990044f, 0.990945f, 0.991847f,
+ 0.992749f, 0.993653f, 0.994557f, 0.995462f, 0.996368f, 0.997275f, 0.998182f, 0.999091f, 1.0f, 1.00091f,
+ 1.001821f, 1.002733f, 1.003645f, 1.004559f, 1.005473f, 1.006388f, 1.007304f, 1.00822f, 1.009138f, 1.010056f,
+ 1.010975f, 1.011896f, 1.012816f, 1.013738f, 1.014661f, 1.015584f, 1.016508f, 1.017433f, 1.018359f, 1.019286f,
+ 1.020214f, 1.021142f, 1.022071f, 1.023002f, 1.023933f, 1.024864f, 1.025797f, 1.026731f, 1.027665f, 1.0286f,
+ 1.029536f, 1.030473f, 1.031411f, 1.03235f, 1.033289f, 1.03423f, 1.035171f, 1.036113f, 1.037056f, 1.038f,
+ 1.038944f, 1.03989f, 1.040836f, 1.041783f, 1.042731f, 1.04368f, 1.04463f, 1.045581f, 1.046532f, 1.047485f,
+ 1.048438f, 1.049392f, 1.050347f, 1.051303f, 1.05226f, 1.053217f, 1.054176f, 1.055135f, 1.056095f, 1.057056f,
+ 1.058018f, 1.058981f, 1.059945f, 1.06091f, 1.061875f, 1.062842f, 1.063809f, 1.064777f, 1.065746f, 1.066716f,
+ 1.067687f, 1.068658f, 1.069631f, 1.070604f, 1.071578f, 1.072554f, 1.07353f, 1.074507f, 1.075485f, 1.076463f,
+ 1.077443f, 1.078424f, 1.079405f, 1.080387f, 1.08137f, 1.082355f, 1.08334f, 1.084325f, 1.085312f, 1.0863f,
+ 1.087289f, 1.088278f, 1.089268f, 1.09026f, 1.091252f, 1.092245f, 1.093239f, 1.094234f, 1.09523f, 1.096226f,
+ 1.097224f, 1.098223f, 1.099222f, 1.100222f, 1.101224f, 1.102226f, 1.103229f, 1.104233f, 1.105238f, 1.106244f,
+ 1.10725f, 1.108258f, 1.109267f, 1.110276f, 1.111287f, 1.112298f, 1.11331f, 1.114323f, 1.115337f, 1.116352f,
+ 1.117368f, 1.118385f, 1.119403f, 1.120422f, 1.121441f, 1.122462f,
+};
+
+f32 gPitchFrequencies[] = {
+ /* 0x00 */ 0.105112f, // PITCH_A0
+ /* 0x01 */ 0.111362f, // PITCH_BFLAT0
+ /* 0x02 */ 0.117984f, // PITCH_B0
+ /* 0x03 */ 0.125f, // PITCH_C1
+ /* 0x04 */ 0.132433f, // PITCH_DFLAT1
+ /* 0x05 */ 0.140308f, // PITCH_D1
+ /* 0x06 */ 0.148651f, // PITCH_EFLAT1
+ /* 0x07 */ 0.15749f, // PITCH_E1
+ /* 0x08 */ 0.166855f, // PITCH_F1
+ /* 0x09 */ 0.176777f, // PITCH_GFLAT1
+ /* 0x0A */ 0.187288f, // PITCH_G1
+ /* 0x0B */ 0.198425f, // PITCH_AFLAT1
+ /* 0x0C */ 0.210224f, // PITCH_A1
+ /* 0x0D */ 0.222725f, // PITCH_BFLAT1
+ /* 0x0E */ 0.235969f, // PITCH_B1
+ /* 0x0F */ 0.25f, // PITCH_C2
+ /* 0x10 */ 0.264866f, // PITCH_DFLAT2
+ /* 0x11 */ 0.280616f, // PITCH_D2
+ /* 0x12 */ 0.297302f, // PITCH_EFLAT2
+ /* 0x13 */ 0.31498f, // PITCH_E2
+ /* 0x14 */ 0.33371f, // PITCH_F2
+ /* 0x15 */ 0.353553f, // PITCH_GFLAT2
+ /* 0x16 */ 0.374577f, // PITCH_G2
+ /* 0x17 */ 0.39685f, // PITCH_AFLAT2
+ /* 0x18 */ 0.420448f, // PITCH_A2
+ /* 0x19 */ 0.445449f, // PITCH_BFLAT2
+ /* 0x1A */ 0.471937f, // PITCH_B2
+ /* 0x1B */ 0.5f, // PITCH_C3
+ /* 0x1C */ 0.529732f, // PITCH_DFLAT3
+ /* 0x1D */ 0.561231f, // PITCH_D3
+ /* 0x1E */ 0.594604f, // PITCH_EFLAT3
+ /* 0x1F */ 0.629961f, // PITCH_E3
+ /* 0x20 */ 0.66742f, // PITCH_F3
+ /* 0x21 */ 0.707107f, // PITCH_GFLAT3
+ /* 0x22 */ 0.749154f, // PITCH_G3
+ /* 0x23 */ 0.793701f, // PITCH_AFLAT3
+ /* 0x24 */ 0.840897f, // PITCH_A3
+ /* 0x25 */ 0.890899f, // PITCH_BFLAT3
+ /* 0x26 */ 0.943875f, // PITCH_B3
+ /* 0x27 */ 1.0f, // PITCH_C4 (Middle C)
+ /* 0x28 */ 1.059463f, // PITCH_DFLAT4
+ /* 0x29 */ 1.122462f, // PITCH_D4
+ /* 0x2A */ 1.189207f, // PITCH_EFLAT4
+ /* 0x2B */ 1.259921f, // PITCH_E4
+ /* 0x2C */ 1.33484f, // PITCH_F4
+ /* 0x2D */ 1.414214f, // PITCH_GFLAT4
+ /* 0x2E */ 1.498307f, // PITCH_G4
+ /* 0x2F */ 1.587401f, // PITCH_AFLAT4
+ /* 0x30 */ 1.681793f, // PITCH_A4
+ /* 0x31 */ 1.781798f, // PITCH_BFLAT4
+ /* 0x32 */ 1.887749f, // PITCH_B4
+ /* 0x33 */ 2.0f, // PITCH_C5
+ /* 0x34 */ 2.118926f, // PITCH_DFLAT5
+ /* 0x35 */ 2.244924f, // PITCH_D5
+ /* 0x36 */ 2.378414f, // PITCH_EFLAT5
+ /* 0x37 */ 2.519842f, // PITCH_E5
+ /* 0x38 */ 2.66968f, // PITCH_F5
+ /* 0x39 */ 2.828428f, // PITCH_GFLAT5
+ /* 0x3A */ 2.996615f, // PITCH_G5
+ /* 0x3B */ 3.174803f, // PITCH_AFLAT5
+ /* 0x3C */ 3.363586f, // PITCH_A5
+ /* 0x3D */ 3.563596f, // PITCH_BFLAT5
+ /* 0x3E */ 3.775498f, // PITCH_B5
+ /* 0x3F */ 4.0f, // PITCH_C6
+ /* 0x40 */ 4.237853f, // PITCH_DFLAT6
+ /* 0x41 */ 4.489849f, // PITCH_D6
+ /* 0x42 */ 4.756829f, // PITCH_EFLAT6
+ /* 0x43 */ 5.039685f, // PITCH_E6
+ /* 0x44 */ 5.33936f, // PITCH_F6
+ /* 0x45 */ 5.656855f, // PITCH_GFLAT6
+ /* 0x46 */ 5.993229f, // PITCH_G6
+ /* 0x47 */ 6.349606f, // PITCH_AFLAT6
+ /* 0x48 */ 6.727173f, // PITCH_A6
+ /* 0x49 */ 7.127192f, // PITCH_BFLAT6
+ /* 0x4A */ 7.550996f, // PITCH_B6
+ /* 0x4B */ 8.0f, // PITCH_C7
+ /* 0x4C */ 8.475705f, // PITCH_DFLAT7
+ /* 0x4D */ 8.979697f, // PITCH_D7
+ /* 0x4E */ 9.513658f, // PITCH_EFLAT7
+ /* 0x4F */ 10.07937f, // PITCH_E7
+ /* 0x50 */ 10.6787205f, // PITCH_F7
+ /* 0x51 */ 11.31371f, // PITCH_GFLAT7
+ /* 0x52 */ 11.986459f, // PITCH_G7
+ /* 0x53 */ 12.699211f, // PITCH_AFLAT7
+ /* 0x54 */ 13.454346f, // PITCH_A7
+ /* 0x55 */ 14.254383f, // PITCH_BFLAT7
+ /* 0x56 */ 15.101993f, // PITCH_B7
+ /* 0x57 */ 16.0f, // PITCH_C8
+ /* 0x58 */ 16.95141f, // PITCH_DFLAT8
+ /* 0x59 */ 17.959395f, // PITCH_D8
+ /* 0x5A */ 19.027315f, // PITCH_EFLAT8
+ /* 0x5B */ 20.15874f, // PITCH_E8
+ /* 0x5C */ 21.35744f, // PITCH_F8
+ /* 0x5D */ 22.62742f, // PITCH_GFLAT8
+ /* 0x5E */ 23.972918f, // PITCH_G8
+ /* 0x5F */ 25.398422f, // PITCH_AFLAT8
+ /* 0x60 */ 26.908691f, // PITCH_A8
+ /* 0x61 */ 28.508766f, // PITCH_BFLAT8
+ /* 0x62 */ 30.203985f, // PITCH_B8
+ /* 0x63 */ 32.0f, // PITCH_C9
+ /* 0x64 */ 33.90282f, // PITCH_DFLAT9
+ /* 0x65 */ 35.91879f, // PITCH_D9
+ /* 0x66 */ 38.05463f, // PITCH_EFLAT9
+ /* 0x67 */ 40.31748f, // PITCH_E9
+ /* 0x68 */ 42.71488f, // PITCH_F9
+ /* 0x69 */ 45.25484f, // PITCH_GFLAT9
+ /* 0x6A */ 47.945835f, // PITCH_G9
+ /* 0x6B */ 50.796845f, // PITCH_AFLAT9
+ /* 0x6C */ 53.817383f, // PITCH_A9
+ /* 0x6D */ 57.017532f, // PITCH_BFLAT9
+ /* 0x6E */ 60.40797f, // PITCH_B9
+ /* 0x6F */ 64.0f, // PITCH_C10
+ /* 0x70 */ 67.80564f, // PITCH_DFLAT10
+ /* 0x71 */ 71.83758f, // PITCH_D10
+ /* 0x72 */ 76.10926f, // PITCH_EFLAT10
+ /* 0x73 */ 80.63496f, // PITCH_E10
+ /* 0x74 */ 85.42976f, // PITCH_F10
+ /* 0x75 */ 0.055681f, // PITCH_BFLATNEG1
+ /* 0x76 */ 0.058992f, // PITCH_BNEG1
+ /* 0x77 */ 0.0625f, // PITCH_C0
+ /* 0x78 */ 0.066216f, // PITCH_DFLAT0
+ /* 0x79 */ 0.070154f, // PITCH_D0
+ /* 0x7A */ 0.074325f, // PITCH_EFLAT0
+ /* 0x7B */ 0.078745f, // PITCH_E0
+ /* 0x7C */ 0.083427f, // PITCH_F0
+ /* 0x7D */ 0.088388f, // PITCH_GFLAT0
+ /* 0x7E */ 0.093644f, // PITCH_G0
+ /* 0x7F */ 0.099213f, // PITCH_AFLAT0
+};
+
+u8 gDefaultShortNoteVelocityTable[] = {
+ 12, 25, 38, 51, 57, 64, 71, 76, 83, 89, 96, 102, 109, 115, 121, 127,
+};
+
+u8 gDefaultShortNoteGateTimeTable[] = {
+ 229, 203, 177, 151, 139, 126, 113, 100, 87, 74, 61, 48, 36, 23, 10, 0,
+};
+
+AdsrEnvelope gDefaultEnvelope[] = {
+ { 1, 32000 },
+ { 1000, 32000 },
+ { -1, 0 },
+ { 0, 0 },
+};
+
+NoteSubEu gZeroNoteSub = { 0 };
+
+NoteSubEu gDefaultNoteSub = {
+ { 1, 1, 0, 0, 0, 0, 0, 0 }, { 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+u16 gHeadsetPanQuantization[64] = {
+ 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, 30, 28, 26, 24, 22, 20, 18,
+ 16, 14, 12, 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+s32 D_801D58A4 = 0;
+
+// clang-format off
+s16 D_801D58A8[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 500, 0, 0, 0, 0,
+ 0, 0, 0, 500, 0, 0, 0, 0,
+ 0, 0, 0, 500, 0, 0, 0, 0,
+ 0, 0, 0, 500, 0, 0, 0, 0,
+};
+// clang-format on
+
+f32 gHeadsetPanVolume[] = {
+ 1.0f, 0.995386f, 0.990772f, 0.986157f, 0.981543f, 0.976929f, 0.972315f, 0.967701f, 0.963087f, 0.958472f,
+ 0.953858f, 0.949244f, 0.94463f, 0.940016f, 0.935402f, 0.930787f, 0.926173f, 0.921559f, 0.916945f, 0.912331f,
+ 0.907717f, 0.903102f, 0.898488f, 0.893874f, 0.88926f, 0.884646f, 0.880031f, 0.875417f, 0.870803f, 0.866189f,
+ 0.861575f, 0.856961f, 0.852346f, 0.847732f, 0.843118f, 0.838504f, 0.83389f, 0.829276f, 0.824661f, 0.820047f,
+ 0.815433f, 0.810819f, 0.806205f, 0.801591f, 0.796976f, 0.792362f, 0.787748f, 0.783134f, 0.77852f, 0.773906f,
+ 0.769291f, 0.764677f, 0.760063f, 0.755449f, 0.750835f, 0.74622f, 0.741606f, 0.736992f, 0.732378f, 0.727764f,
+ 0.72315f, 0.718535f, 0.713921f, 0.709307f, 0.70537f, 0.70211f, 0.69885f, 0.695591f, 0.692331f, 0.689071f,
+ 0.685811f, 0.682551f, 0.679291f, 0.676031f, 0.672772f, 0.669512f, 0.666252f, 0.662992f, 0.659732f, 0.656472f,
+ 0.653213f, 0.649953f, 0.646693f, 0.643433f, 0.640173f, 0.636913f, 0.633654f, 0.630394f, 0.627134f, 0.623874f,
+ 0.620614f, 0.617354f, 0.614094f, 0.610835f, 0.607575f, 0.604315f, 0.601055f, 0.597795f, 0.594535f, 0.591276f,
+ 0.588016f, 0.584756f, 0.581496f, 0.578236f, 0.574976f, 0.571717f, 0.568457f, 0.565197f, 0.561937f, 0.558677f,
+ 0.555417f, 0.552157f, 0.548898f, 0.545638f, 0.542378f, 0.539118f, 0.535858f, 0.532598f, 0.529339f, 0.526079f,
+ 0.522819f, 0.519559f, 0.516299f, 0.513039f, 0.50978f, 0.50652f, 0.50326f, 0.5f,
+};
+
+f32 gStereoPanVolume[] = {
+ 0.707f, 0.716228f, 0.725457f, 0.734685f, 0.743913f, 0.753142f, 0.76237f, 0.771598f, 0.780827f, 0.790055f,
+ 0.799283f, 0.808512f, 0.81774f, 0.826968f, 0.836197f, 0.845425f, 0.854654f, 0.863882f, 0.87311f, 0.882339f,
+ 0.891567f, 0.900795f, 0.910024f, 0.919252f, 0.92848f, 0.937709f, 0.946937f, 0.956165f, 0.965394f, 0.974622f,
+ 0.98385f, 0.993079f, 0.997693f, 0.988465f, 0.979236f, 0.970008f, 0.960779f, 0.951551f, 0.942323f, 0.933095f,
+ 0.923866f, 0.914638f, 0.905409f, 0.896181f, 0.886953f, 0.877724f, 0.868496f, 0.859268f, 0.850039f, 0.840811f,
+ 0.831583f, 0.822354f, 0.813126f, 0.803898f, 0.794669f, 0.785441f, 0.776213f, 0.766984f, 0.757756f, 0.748528f,
+ 0.739299f, 0.730071f, 0.720843f, 0.711614f, 0.695866f, 0.673598f, 0.651331f, 0.629063f, 0.606795f, 0.584528f,
+ 0.56226f, 0.539992f, 0.517724f, 0.495457f, 0.473189f, 0.450921f, 0.428654f, 0.406386f, 0.384118f, 0.36185f,
+ 0.339583f, 0.317315f, 0.295047f, 0.27278f, 0.250512f, 0.228244f, 0.205976f, 0.183709f, 0.161441f, 0.139173f,
+ 0.116905f, 0.094638f, 0.07237f, 0.050102f, 0.027835f, 0.005567f, 0.00835f, 0.019484f, 0.030618f, 0.041752f,
+ 0.052886f, 0.06402f, 0.075154f, 0.086287f, 0.097421f, 0.108555f, 0.119689f, 0.130823f, 0.141957f, 0.153091f,
+ 0.164224f, 0.175358f, 0.186492f, 0.197626f, 0.20876f, 0.219894f, 0.231028f, 0.242161f, 0.253295f, 0.264429f,
+ 0.275563f, 0.286697f, 0.297831f, 0.308965f, 0.320098f, 0.331232f, 0.342366f, 0.3535f,
+};
+
+f32 gDefaultPanVolume[] = {
+ 1.0f, 0.999924f, 0.999694f, 0.999312f, 0.998776f, 0.998088f, 0.997248f, 0.996254f, 0.995109f, 0.993811f,
+ 0.992361f, 0.990759f, 0.989006f, 0.987101f, 0.985045f, 0.982839f, 0.980482f, 0.977976f, 0.97532f, 0.972514f,
+ 0.96956f, 0.966457f, 0.963207f, 0.959809f, 0.956265f, 0.952574f, 0.948737f, 0.944755f, 0.940629f, 0.936359f,
+ 0.931946f, 0.92739f, 0.922692f, 0.917853f, 0.912873f, 0.907754f, 0.902497f, 0.897101f, 0.891567f, 0.885898f,
+ 0.880093f, 0.874153f, 0.868079f, 0.861873f, 0.855535f, 0.849066f, 0.842467f, 0.835739f, 0.828884f, 0.821901f,
+ 0.814793f, 0.807561f, 0.800204f, 0.792725f, 0.785125f, 0.777405f, 0.769566f, 0.76161f, 0.753536f, 0.745348f,
+ 0.737045f, 0.72863f, 0.720103f, 0.711466f, 0.70272f, 0.693867f, 0.684908f, 0.675843f, 0.666676f, 0.657406f,
+ 0.648036f, 0.638567f, 0.629f, 0.619337f, 0.609579f, 0.599728f, 0.589785f, 0.579752f, 0.56963f, 0.559421f,
+ 0.549126f, 0.538748f, 0.528287f, 0.517745f, 0.507124f, 0.496425f, 0.485651f, 0.474802f, 0.46388f, 0.452888f,
+ 0.441826f, 0.430697f, 0.419502f, 0.408243f, 0.396921f, 0.385538f, 0.374097f, 0.362598f, 0.351044f, 0.339436f,
+ 0.327776f, 0.316066f, 0.304308f, 0.292503f, 0.280653f, 0.268761f, 0.256827f, 0.244854f, 0.232844f, 0.220798f,
+ 0.208718f, 0.196606f, 0.184465f, 0.172295f, 0.160098f, 0.147877f, 0.135634f, 0.12337f, 0.111087f, 0.098786f,
+ 0.086471f, 0.074143f, 0.061803f, 0.049454f, 0.037097f, 0.024734f, 0.012368f, 0.0f,
+};
+
+// clang-format off
+s16 D_801D5F24[8 * (2 + 3 + 3)] = {
+ // floor(sin(i * M_PI / 16) * (2^15 - 1))
+ 0, 6392, 12539, 18204, 23169, 27244, 30272, 32137,
+ 32767, 32137, 30272, 27244, 23169, 18204, 12539, 6392,
+ // -floor(sin(i * M_PI / 32) * (2^15 - 1))
+ 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787,
+ -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609,
+ -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329,
+ // -floor(sin(i * M_PI / 32) * (2^15 - 1))
+ -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609,
+ -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329,
+ -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211,
+};
+// clang-format on
diff --git a/src/code/audio/audio_effects.c b/src/code/audio/audio_effects.c
index e795d5e9f7..2dcef2237a 100644
--- a/src/code/audio/audio_effects.c
+++ b/src/code/audio/audio_effects.c
@@ -1,21 +1,341 @@
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196A00.s")
+void AudioEffects_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend) {
+ f32 channelVolume;
+ f32 chanFreqScale;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196BC8.s")
+ if (channel->changes.s.volume || recalculateVolume) {
+ channelVolume = channel->volume * channel->volumeScale * channel->seqPlayer->appliedFadeVolume;
+ if (channel->seqPlayer->muted && (channel->muteBehavior & 0x20)) {
+ channelVolume = channel->seqPlayer->muteVolumeScale * channelVolume;
+ }
+ channel->appliedVolume = channelVolume * channelVolume;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196D20.s")
+ if (channel->changes.s.pan) {
+ channel->pan = channel->newPan * channel->panChannelWeight;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196D7C.s")
+ chanFreqScale = channel->freqScale;
+ if (applyBend) {
+ chanFreqScale *= channel->seqPlayer->bend;
+ channel->changes.s.freqScale = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196DB4.s")
+ for (i = 0; i < ARRAY_COUNT(channel->layers); i++) {
+ SequenceLayer* layer = channel->layers[i];
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80196FEC.s")
+ if (layer != NULL && layer->enabled && layer->note != NULL) {
+ if (layer->notePropertiesNeedInit) {
+ layer->noteFreqScale = layer->freqScale * chanFreqScale;
+ layer->noteVelocity = layer->velocitySquare2 * channel->appliedVolume;
+ layer->notePan = (channel->pan + layer->pan * (0x80 - channel->panChannelWeight)) >> 7;
+ layer->notePropertiesNeedInit = false;
+ } else {
+ if (channel->changes.s.freqScale) {
+ layer->noteFreqScale = layer->freqScale * chanFreqScale;
+ }
+ if (channel->changes.s.volume || recalculateVolume) {
+ layer->noteVelocity = layer->velocitySquare2 * channel->appliedVolume;
+ }
+ if (channel->changes.s.pan) {
+ layer->notePan = (channel->pan + layer->pan * (0x80 - channel->panChannelWeight)) >> 7;
+ }
+ }
+ }
+ }
+ channel->changes.asByte = 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80197048.s")
+void AudioEffects_SequencePlayerProcessSound(SequencePlayer* seqPlayer) {
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80197138.s")
+ if ((seqPlayer->fadeTimer != 0) && (seqPlayer->skipTicks == 0)) {
+ seqPlayer->fadeVolume += seqPlayer->fadeVelocity;
+ seqPlayer->recalculateVolume = true;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80197164.s")
+ if (seqPlayer->fadeVolume > 1.0f) {
+ seqPlayer->fadeVolume = 1.0f;
+ }
+ if (seqPlayer->fadeVolume < 0.0f) {
+ seqPlayer->fadeVolume = 0.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_effects/func_80197188.s")
+ seqPlayer->fadeTimer--;
+ if (seqPlayer->fadeTimer == 0 && seqPlayer->state == 2) {
+ AudioSeq_SequencePlayerDisable(seqPlayer);
+ return;
+ }
+ }
+
+ if (seqPlayer->recalculateVolume) {
+ seqPlayer->appliedFadeVolume = seqPlayer->fadeVolume * seqPlayer->fadeVolumeScale;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(seqPlayer->channels); i++) {
+ if (seqPlayer->channels[i]->enabled == true) {
+ AudioEffects_SequenceChannelProcessSound(seqPlayer->channels[i], seqPlayer->recalculateVolume,
+ seqPlayer->applyBend);
+ }
+ }
+
+ seqPlayer->recalculateVolume = false;
+}
+
+f32 AudioEffects_GetPortamentoFreqScale(Portamento* portamento) {
+ u32 loResCur;
+ f32 portamentoFreq;
+
+ portamento->cur += portamento->speed;
+ loResCur = (portamento->cur >> 8) & 0xFF;
+
+ if (loResCur >= 127) {
+ loResCur = 127;
+ portamento->mode = 0;
+ }
+
+ portamentoFreq = AUDIO_LERPIMP(1.0f, gBendPitchOneOctaveFrequencies[loResCur + 128], portamento->extent);
+
+ return portamentoFreq;
+}
+
+s16 AudioEffects_GetVibratoPitchChange(VibratoState* vib) {
+ s32 index;
+
+ vib->time += (s32)vib->rate;
+ index = (vib->time >> 10) & 0x3F;
+ return vib->curve[index];
+}
+
+f32 AudioEffects_GetVibratoFreqScale(VibratoState* vib) {
+ static f32 activeVibratoFreqScaleSum = 0.0f;
+ static s32 activeVibratoCount = 0;
+ f32 pitchChange;
+ f32 extent;
+ f32 invExtent;
+ f32 result;
+ f32 scaledExtent;
+ VibratoSubStruct* subVib = vib->vibSubStruct;
+
+ if (vib->delay != 0) {
+ vib->delay--;
+ return 1.0f;
+ }
+
+ if (subVib != NULL) {
+ if (vib->extentChangeTimer) {
+ if (vib->extentChangeTimer == 1) {
+ vib->extent = (s32)subVib->vibratoExtentTarget;
+ } else {
+ vib->extent += ((s32)subVib->vibratoExtentTarget - vib->extent) / (s32)vib->extentChangeTimer;
+ }
+
+ vib->extentChangeTimer--;
+ } else if (subVib->vibratoExtentTarget != (s32)vib->extent) {
+ if ((vib->extentChangeTimer = subVib->vibratoExtentChangeDelay) == 0) {
+ vib->extent = (s32)subVib->vibratoExtentTarget;
+ }
+ }
+
+ if (vib->rateChangeTimer) {
+ if (vib->rateChangeTimer == 1) {
+ vib->rate = (s32)subVib->vibratoRateTarget;
+ } else {
+ vib->rate += ((s32)subVib->vibratoRateTarget - vib->rate) / (s32)vib->rateChangeTimer;
+ }
+
+ vib->rateChangeTimer--;
+ } else if (subVib->vibratoRateTarget != (s32)vib->rate) {
+ if ((vib->rateChangeTimer = subVib->vibratoRateChangeDelay) == 0) {
+ vib->rate = (s32)subVib->vibratoRateTarget;
+ }
+ }
+ }
+
+ if (vib->extent == 0.0f) {
+ return 1.0f;
+ }
+
+ pitchChange = AudioEffects_GetVibratoPitchChange(vib) + 32768.0f;
+ scaledExtent = vib->extent / 4096.0f;
+ extent = scaledExtent + 1.0f;
+ invExtent = 1.0f / extent;
+
+ // inverse linear interpolation
+ result = 1.0f / ((extent - invExtent) * pitchChange / 65536.0f + invExtent);
+
+ activeVibratoFreqScaleSum += result;
+ activeVibratoCount++;
+
+ return result;
+}
+
+void AudioEffects_NoteVibratoUpdate(Note* note) {
+ if (note->playbackState.portamento.mode != 0) {
+ note->playbackState.portamentoFreqScale = AudioEffects_GetPortamentoFreqScale(¬e->playbackState.portamento);
+ }
+ if (note->playbackState.vibratoState.active) {
+ note->playbackState.vibratoFreqScale = AudioEffects_GetVibratoFreqScale(¬e->playbackState.vibratoState);
+ }
+}
+
+void AudioEffects_NoteVibratoInit(Note* note) {
+ NotePlaybackState* playbackState = ¬e->playbackState;
+ VibratoState* vib = &playbackState->vibratoState;
+ VibratoSubStruct* subVib;
+
+ vib->active = true;
+ vib->curve = gWaveSamples[2];
+
+ if (playbackState->parentLayer->unk_0A.s.bit_3 == 1) {
+ vib->vibSubStruct = &playbackState->parentLayer->channel->vibrato;
+ } else {
+ vib->vibSubStruct = &playbackState->parentLayer->vibrato;
+ }
+
+ subVib = vib->vibSubStruct;
+
+ if ((vib->extentChangeTimer = subVib->vibratoExtentChangeDelay) == 0) {
+ vib->extent = (s32)subVib->vibratoExtentTarget;
+ } else {
+ vib->extent = (s32)subVib->vibratoExtentStart;
+ }
+
+ if ((vib->rateChangeTimer = subVib->vibratoRateChangeDelay) == 0) {
+ vib->rate = (s32)subVib->vibratoRateTarget;
+ } else {
+ vib->rate = (s32)subVib->vibratoRateStart;
+ }
+
+ playbackState->vibratoFreqScale = 1.0f;
+ vib->time = 0;
+ vib->delay = subVib->vibratoDelay;
+}
+
+void AudioEffects_NotePortamentoInit(Note* note) {
+ note->playbackState.portamentoFreqScale = 1.0f;
+ note->playbackState.portamento = note->playbackState.parentLayer->portamento;
+}
+
+void AudioEffects_AdsrInit(AdsrState* adsr, AdsrEnvelope* envelope, s16* volOut) {
+ adsr->action.asByte = 0;
+ adsr->delay = 0;
+ adsr->envelope = envelope;
+ adsr->sustain = 0.0f;
+ adsr->current = 0.0f;
+ adsr->velocity = 0.0f;
+ // (An older versions of the audio engine used in Super Mario 64 did
+ // adsr->volOut = volOut. That line and associated struct member were
+ // removed, but the function parameter was forgotten and remains.)
+}
+
+f32 AudioEffects_AdsrUpdate(AdsrState* adsr) {
+ u8 state = adsr->action.s.state;
+
+ switch (state) {
+ case ADSR_STATE_DISABLED:
+ return 0.0f;
+
+ case ADSR_STATE_INITIAL:
+ if (adsr->action.s.hang) {
+ adsr->action.s.state = ADSR_STATE_HANG;
+ break;
+ }
+ // fallthrough
+
+ case ADSR_STATE_START_LOOP:
+ adsr->envIndex = 0;
+ adsr->action.s.state = ADSR_STATE_LOOP;
+ // fallthrough
+
+ retry:
+ case ADSR_STATE_LOOP:
+ adsr->delay = adsr->envelope[adsr->envIndex].delay;
+ switch (adsr->delay) {
+ case ADSR_DISABLE:
+ adsr->action.s.state = ADSR_STATE_DISABLED;
+ break;
+ case ADSR_HANG:
+ adsr->action.s.state = ADSR_STATE_HANG;
+ break;
+ case ADSR_GOTO:
+ adsr->envIndex = adsr->envelope[adsr->envIndex].arg;
+ goto retry;
+ case ADSR_RESTART:
+ adsr->action.s.state = ADSR_STATE_INITIAL;
+ break;
+
+ default:
+ adsr->delay *= gAudioContext.audioBufferParameters.unk_24;
+ if (adsr->delay == 0) {
+ adsr->delay = 1;
+ }
+ adsr->target = adsr->envelope[adsr->envIndex].arg / 32767.0f;
+ adsr->target = adsr->target * adsr->target;
+ adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
+ adsr->action.s.state = ADSR_STATE_FADE;
+ adsr->envIndex++;
+ break;
+ }
+ if (adsr->action.s.state != ADSR_STATE_FADE) {
+ break;
+ }
+ // fallthrough
+
+ case ADSR_STATE_FADE:
+ adsr->current += adsr->velocity;
+ if (--adsr->delay <= 0) {
+ adsr->action.s.state = ADSR_STATE_LOOP;
+ }
+ // fallthrough
+
+ case ADSR_STATE_HANG:
+ break;
+
+ case ADSR_STATE_DECAY:
+ case ADSR_STATE_RELEASE:
+ adsr->current -= adsr->fadeOutVel;
+ if (adsr->sustain != 0.0f && state == ADSR_STATE_DECAY) {
+ if (adsr->current < adsr->sustain) {
+ adsr->current = adsr->sustain;
+ adsr->delay = 128;
+ adsr->action.s.state = ADSR_STATE_SUSTAIN;
+ }
+ break;
+ }
+
+ if (adsr->current < 0.00001f) {
+ adsr->current = 0.0f;
+ adsr->action.s.state = ADSR_STATE_DISABLED;
+ }
+ break;
+
+ case ADSR_STATE_SUSTAIN:
+ adsr->delay--;
+ if (adsr->delay == 0) {
+ adsr->action.s.state = ADSR_STATE_RELEASE;
+ }
+ break;
+ }
+
+ if (adsr->action.s.decay) {
+ adsr->action.s.state = ADSR_STATE_DECAY;
+ adsr->action.s.decay = false;
+ }
+
+ if (adsr->action.s.release) {
+ adsr->action.s.state = ADSR_STATE_RELEASE;
+ adsr->action.s.release = false;
+ }
+
+ if (adsr->current < 0.0f) {
+ return 0.0f;
+ }
+
+ if (adsr->current > 1.0f) {
+ return 1.0f;
+ }
+
+ return adsr->current;
+}
diff --git a/src/code/audio/audio_heap.c b/src/code/audio/audio_heap.c
index 7c43ef0f1c..b3d83c1f98 100644
--- a/src/code/audio/audio_heap.c
+++ b/src/code/audio/audio_heap.c
@@ -18,7 +18,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B578.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B5D0.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/AudioHeap_AllocDmaMemory.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_heap/func_8018B608.s")
diff --git a/src/code/audio/audio_load.c b/src/code/audio/audio_load.c
index 15e54b3c5d..497f9d47a9 100644
--- a/src/code/audio/audio_load.c
+++ b/src/code/audio/audio_load.c
@@ -8,7 +8,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018EF88.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018F220.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/AudioLoad_IsFontLoadComplete.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_load/func_8018F298.s")
diff --git a/src/code/audio/audio_playback.c b/src/code/audio/audio_playback.c
index ec8dd86b89..78161943c6 100644
--- a/src/code/audio/audio_playback.c
+++ b/src/code/audio/audio_playback.c
@@ -1,63 +1,988 @@
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194930.s")
+void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput);
+void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item);
+void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer);
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194DB0.s")
+void AudioPlayback_InitNoteSub(Note* note, NoteSubEu* sub, NoteSubAttributes* attrs) {
+ f32 volRight, volLeft;
+ s32 smallPanIndex;
+ u64 pad;
+ u8 strongLeft;
+ u8 strongRight;
+ f32 vel;
+ u8 pan;
+ u8 reverbVol;
+ StereoData stereoData;
+ s32 stereoHeadsetEffects = note->playbackState.stereoHeadsetEffects;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194E60.s")
+ vel = attrs->velocity;
+ pan = attrs->pan;
+ reverbVol = attrs->reverbVol;
+ stereoData = attrs->stereo.s;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194F20.s")
+ sub->bitField0 = note->noteSubEu.bitField0;
+ sub->bitField1 = note->noteSubEu.bitField1;
+ sub->sound.samples = note->noteSubEu.sound.samples;
+ sub->unk_06 = note->noteSubEu.unk_06;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80194F84.s")
+ AudioPlayback_NoteSetResamplingRate(sub, attrs->frequency);
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801954CC.s")
+ pan &= 0x7F;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195508.s")
+ sub->bitField0.stereoStrongRight = false;
+ sub->bitField0.stereoStrongLeft = false;
+ sub->bitField0.stereoHeadsetEffects = stereoData.stereoHeadsetEffects;
+ sub->bitField0.usesHeadsetPanEffects = stereoData.usesHeadsetPanEffects;
+ if (stereoHeadsetEffects && gAudioContext.soundMode == AUDIO_MODE_HEADSET) {
+ smallPanIndex = pan >> 1;
+ if (smallPanIndex > 0x3F) {
+ smallPanIndex = 0x3F;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801955DC.s")
+ sub->headsetPanLeft = gHeadsetPanQuantization[smallPanIndex];
+ sub->headsetPanRight = gHeadsetPanQuantization[0x3F - smallPanIndex];
+ sub->bitField1.usesHeadsetPanEffects2 = true;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801956C0.s")
+ volLeft = gHeadsetPanVolume[pan];
+ volRight = gHeadsetPanVolume[0x7F - pan];
+ } else if (stereoHeadsetEffects && gAudioContext.soundMode == AUDIO_MODE_STEREO) {
+ strongLeft = strongRight = false;
+ sub->headsetPanRight = 0;
+ sub->headsetPanLeft = 0;
+ sub->bitField1.usesHeadsetPanEffects2 = false;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801957B4.s")
+ volLeft = gStereoPanVolume[pan];
+ volRight = gStereoPanVolume[0x7F - pan];
+ if (pan < 0x20) {
+ strongLeft = true;
+ } else if (pan > 0x60) {
+ strongRight = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801958F8.s")
+ sub->bitField0.stereoStrongRight = strongRight;
+ sub->bitField0.stereoStrongLeft = strongLeft;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C40.s")
+ switch (stereoData.bit2) {
+ case 0:
+ break;
+ case 1:
+ sub->bitField0.stereoStrongRight = stereoData.strongRight;
+ sub->bitField0.stereoStrongLeft = stereoData.strongLeft;
+ break;
+ case 2:
+ sub->bitField0.stereoStrongRight = stereoData.strongRight | strongRight;
+ sub->bitField0.stereoStrongLeft = stereoData.strongLeft | strongLeft;
+ break;
+ case 3:
+ sub->bitField0.stereoStrongRight = stereoData.strongRight ^ strongRight;
+ sub->bitField0.stereoStrongLeft = stereoData.strongLeft ^ strongLeft;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C60.s")
+ } else if (gAudioContext.soundMode == AUDIO_MODE_MONO) {
+ sub->bitField0.stereoHeadsetEffects = false;
+ sub->bitField0.usesHeadsetPanEffects = false;
+ volLeft = 0.707f; // approx 1/sqrt(2)
+ volRight = 0.707f;
+ } else {
+ sub->bitField0.stereoStrongRight = stereoData.strongRight;
+ sub->bitField0.stereoStrongLeft = stereoData.strongLeft;
+ volLeft = gDefaultPanVolume[pan];
+ volRight = gDefaultPanVolume[0x7F - pan];
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195C80.s")
+ vel = 0.0f > vel ? 0.0f : vel;
+ vel = 1.0f < vel ? 1.0f : vel;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195D84.s")
+ sub->targetVolLeft = (s32)((vel * volLeft) * (0x1000 - 0.001f));
+ sub->targetVolRight = (s32)((vel * volRight) * (0x1000 - 0.001f));
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195DDC.s")
+ sub->unk_2 = attrs->unk_1;
+ sub->filter = attrs->filter;
+ sub->unk_07 = attrs->unk_14;
+ sub->unk_0E = attrs->unk_16;
+ sub->reverbVol = reverbVol;
+ sub->unk_19 = attrs->unk_3;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195DEC.s")
+void AudioPlayback_NoteSetResamplingRate(NoteSubEu* noteSubEu, f32 resamplingRateInput) {
+ f32 resamplingRate = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195E3C.s")
+ if (resamplingRateInput < 2.0f) {
+ noteSubEu->bitField1.hasTwoParts = false;
+ resamplingRate = CLAMP_MAX(resamplingRateInput, 1.99998f);
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80195EE0.s")
+ } else {
+ noteSubEu->bitField1.hasTwoParts = true;
+ if (resamplingRateInput > 3.99996f) {
+ resamplingRate = 1.99998f;
+ } else {
+ resamplingRate = resamplingRateInput * 0.5f;
+ }
+ }
+ noteSubEu->resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196040.s")
+void AudioPlayback_NoteInit(Note* note) {
+ if (note->playbackState.parentLayer->adsr.releaseRate == 0) {
+ AudioEffects_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->channel->adsr.envelope,
+ ¬e->playbackState.adsrVolScaleUnused);
+ } else {
+ AudioEffects_AdsrInit(¬e->playbackState.adsr, note->playbackState.parentLayer->adsr.envelope,
+ ¬e->playbackState.adsrVolScaleUnused);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_8019617C.s")
+ note->playbackState.unk_04 = 0;
+ note->playbackState.adsr.action.s.state = ADSR_STATE_INITIAL;
+ note->noteSubEu = gDefaultNoteSub;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801961BC.s")
+void AudioPlayback_NoteDisable(Note* note) {
+ if (note->noteSubEu.bitField0.needsInit == true) {
+ note->noteSubEu.bitField0.needsInit = false;
+ }
+ note->playbackState.priority = 0;
+ note->noteSubEu.bitField0.enabled = false;
+ note->playbackState.unk_04 = 0;
+ note->noteSubEu.bitField0.finished = false;
+ note->playbackState.parentLayer = NO_LAYER;
+ note->playbackState.prevParentLayer = NO_LAYER;
+ note->playbackState.adsr.action.s.state = ADSR_STATE_DISABLED;
+ note->playbackState.adsr.current = 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801961E8.s")
+void AudioPlayback_ProcessNotes(void) {
+ s32 pad;
+ s32 unk_04;
+ NoteAttributes* attrs;
+ NoteSubEu* noteSubEu2;
+ NoteSubEu* noteSubEu;
+ Note* note;
+ NotePlaybackState* playbackState;
+ NoteSubAttributes subAttrs;
+ u8 bookOffset;
+ f32 scale;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196268.s")
+ for (i = 0; i < gAudioContext.numNotes; i++) {
+ note = &gAudioContext.notes[i];
+ noteSubEu2 = &gAudioContext.noteSubsEu[gAudioContext.noteSubEuOffset + i];
+ playbackState = ¬e->playbackState;
+ if (playbackState->parentLayer != NO_LAYER) {
+ if ((u32)playbackState->parentLayer < 0x7FFFFFFF) {
+ continue;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801963E8.s")
+ if (note != playbackState->parentLayer->note && playbackState->unk_04 == 0) {
+ playbackState->adsr.action.s.release = true;
+ playbackState->adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
+ playbackState->priority = 1;
+ playbackState->unk_04 = 2;
+ goto out;
+ } else if (!playbackState->parentLayer->enabled && playbackState->unk_04 == 0 &&
+ playbackState->priority >= 1) {
+ // do nothing
+ } else if (playbackState->parentLayer->channel->seqPlayer == NULL) {
+ AudioSeq_SequenceChannelDisable(playbackState->parentLayer->channel);
+ playbackState->priority = 1;
+ playbackState->unk_04 = 1;
+ continue;
+ } else if (playbackState->parentLayer->channel->seqPlayer->muted &&
+ (playbackState->parentLayer->channel->muteBehavior & 0x40)) {
+ // do nothing
+ } else {
+ goto out;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_8019641C.s")
+ AudioPlayback_SeqLayerNoteRelease(playbackState->parentLayer);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioPlayback_AudioListPushFront(¬e->listItem.pool->decaying, ¬e->listItem);
+ playbackState->priority = 1;
+ playbackState->unk_04 = 2;
+ } else if (playbackState->unk_04 == 0 && playbackState->priority >= 1) {
+ continue;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196448.s")
+ out:
+ if (playbackState->priority != 0) {
+ if (1) {}
+ noteSubEu = ¬e->noteSubEu;
+ if (playbackState->unk_04 >= 1 || noteSubEu->bitField0.finished) {
+ if (playbackState->adsr.action.s.state == ADSR_STATE_DISABLED || noteSubEu->bitField0.finished) {
+ if (playbackState->wantedParentLayer != NO_LAYER) {
+ AudioPlayback_NoteDisable(note);
+ if (playbackState->wantedParentLayer->channel != NULL) {
+ AudioPlayback_NoteInitForLayer(note, playbackState->wantedParentLayer);
+ AudioEffects_NoteVibratoInit(note);
+ AudioEffects_NotePortamentoInit(note);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(¬e->listItem.pool->active, ¬e->listItem);
+ playbackState->wantedParentLayer = NO_LAYER;
+ // don't skip
+ } else {
+ AudioPlayback_NoteDisable(note);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem);
+ playbackState->wantedParentLayer = NO_LAYER;
+ goto skip;
+ }
+ } else {
+ if (playbackState->parentLayer != NO_LAYER) {
+ playbackState->parentLayer->bit1 = true;
+ }
+ AudioPlayback_NoteDisable(note);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem);
+ continue;
+ }
+ }
+ } else if (playbackState->adsr.action.s.state == ADSR_STATE_DISABLED) {
+ if (playbackState->parentLayer != NO_LAYER) {
+ playbackState->parentLayer->bit1 = true;
+ }
+ AudioPlayback_NoteDisable(note);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(¬e->listItem.pool->disabled, ¬e->listItem);
+ continue;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_80196494.s")
+ scale = AudioEffects_AdsrUpdate(&playbackState->adsr);
+ AudioEffects_NoteVibratoUpdate(note);
+ unk_04 = playbackState->unk_04;
+ attrs = &playbackState->attributes;
+ if (unk_04 == 1 || unk_04 == 2) {
+ subAttrs.frequency = attrs->freqScale;
+ subAttrs.velocity = attrs->velocity;
+ subAttrs.pan = attrs->pan;
+ subAttrs.reverbVol = attrs->reverb;
+ subAttrs.stereo = attrs->stereo;
+ subAttrs.unk_1 = attrs->unk_1;
+ subAttrs.filter = attrs->filter;
+ subAttrs.unk_14 = attrs->unk_4;
+ subAttrs.unk_16 = attrs->unk_6;
+ subAttrs.unk_3 = attrs->unk_3;
+ bookOffset = noteSubEu->bitField1.bookOffset;
+ } else {
+ SequenceLayer* layer = playbackState->parentLayer;
+ SequenceChannel* channel = playbackState->parentLayer->channel;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801964F8.s")
+ subAttrs.frequency = layer->noteFreqScale;
+ subAttrs.velocity = layer->noteVelocity;
+ subAttrs.pan = layer->notePan;
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801965F0.s")
+ if (layer->unk_08 == 0x80) {
+ subAttrs.unk_3 = channel->unk_10;
+ } else {
+ subAttrs.unk_3 = layer->unk_08;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_playback/func_801968C4.s")
+ if (layer->stereo.s.bit2 == 0) {
+ subAttrs.stereo = channel->stereo;
+ } else {
+ subAttrs.stereo = layer->stereo;
+ }
+
+ if (layer->unk_0A.s.bit_2 == 1) {
+ subAttrs.reverbVol = channel->reverb;
+ } else {
+ subAttrs.reverbVol = layer->unk_09;
+ }
+
+ if (layer->unk_0A.s.bit_9 == 1) {
+ subAttrs.unk_1 = channel->unk_0C;
+ } else {
+ subAttrs.unk_1 = 0;
+ if (1) {}
+ }
+
+ subAttrs.filter = channel->filter;
+ subAttrs.unk_14 = channel->unk_0F;
+ subAttrs.unk_16 = channel->unk_20;
+ bookOffset = channel->bookOffset & 0x7;
+
+ if (channel->seqPlayer->muted && (channel->muteBehavior & 8)) {
+ subAttrs.frequency = 0.0f;
+ subAttrs.velocity = 0.0f;
+ }
+ }
+
+ subAttrs.frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale;
+ subAttrs.frequency *= gAudioContext.audioBufferParameters.resampleRate;
+ subAttrs.velocity *= scale;
+ AudioPlayback_InitNoteSub(note, noteSubEu2, &subAttrs);
+ noteSubEu->bitField1.bookOffset = bookOffset;
+ skip:;
+ }
+ }
+}
+
+SoundFontSound* AudioPlayback_InstrumentGetSound(Instrument* instrument, s32 semitone) {
+ SoundFontSound* sound;
+
+ if (semitone < instrument->normalRangeLo) {
+ sound = &instrument->lowNotesSound;
+ } else if (semitone <= instrument->normalRangeHi) {
+ sound = &instrument->normalNotesSound;
+ } else {
+ sound = &instrument->highNotesSound;
+ }
+ return sound;
+}
+
+Instrument* AudioPlayback_GetInstrumentInner(s32 fontId, s32 instId) {
+ Instrument* inst;
+
+ if (fontId == 0xFF) {
+ return NULL;
+ }
+
+ if (!AudioLoad_IsFontLoadComplete(fontId)) {
+ gAudioContext.audioErrorFlags = fontId + 0x10000000;
+ return NULL;
+ }
+
+ if (instId >= gAudioContext.soundFonts[fontId].numInstruments) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x3000000;
+ return NULL;
+ }
+
+ inst = gAudioContext.soundFonts[fontId].instruments[instId];
+ if (inst == NULL) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + instId) + 0x1000000;
+ return inst;
+ }
+
+ return inst;
+}
+
+Drum* AudioPlayback_GetDrum(s32 fontId, s32 drumId) {
+ Drum* drum;
+
+ if (fontId == 0xFF) {
+ return NULL;
+ }
+
+ if (!AudioLoad_IsFontLoadComplete(fontId)) {
+ gAudioContext.audioErrorFlags = fontId + 0x10000000;
+ return NULL;
+ }
+
+ if (drumId >= gAudioContext.soundFonts[fontId].numDrums) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x4000000;
+ return NULL;
+ }
+ if ((u32)gAudioContext.soundFonts[fontId].drums < 0x80000000) {
+ return NULL;
+ }
+ drum = gAudioContext.soundFonts[fontId].drums[drumId];
+
+ if (drum == NULL) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + drumId) + 0x5000000;
+ }
+
+ return drum;
+}
+
+SoundFontSound* AudioPlayback_GetSfx(s32 fontId, s32 sfxId) {
+ SoundFontSound* sfx;
+
+ if (fontId == 0xFF) {
+ return NULL;
+ }
+
+ if (!AudioLoad_IsFontLoadComplete(fontId)) {
+ gAudioContext.audioErrorFlags = fontId + 0x10000000;
+ return NULL;
+ }
+
+ if (sfxId >= gAudioContext.soundFonts[fontId].numSfx) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x4000000;
+ return NULL;
+ }
+
+ if ((u32)gAudioContext.soundFonts[fontId].soundEffects < 0x80000000) {
+ return NULL;
+ }
+
+ sfx = &gAudioContext.soundFonts[fontId].soundEffects[sfxId];
+
+ if (sfx == NULL) {
+ gAudioContext.audioErrorFlags = ((fontId << 8) + sfxId) + 0x5000000;
+ }
+
+ if (sfx->sample == NULL) {
+ return NULL;
+ }
+
+ return sfx;
+}
+
+s32 AudioPlayback_SetFontInstrument(s32 instrumentType, s32 fontId, s32 index, void* value) {
+ if (fontId == 0xFF) {
+ return -1;
+ }
+
+ if (!AudioLoad_IsFontLoadComplete(fontId)) {
+ return -2;
+ }
+
+ switch (instrumentType) {
+ case 0:
+ if (index >= gAudioContext.soundFonts[fontId].numDrums) {
+ return -3;
+ }
+ gAudioContext.soundFonts[fontId].drums[index] = value;
+ break;
+
+ case 1:
+ if (index >= gAudioContext.soundFonts[fontId].numSfx) {
+ return -3;
+ }
+ gAudioContext.soundFonts[fontId].soundEffects[index] = *(SoundFontSound*)value;
+ break;
+
+ default:
+ if (index >= gAudioContext.soundFonts[fontId].numInstruments) {
+ return -3;
+ }
+ gAudioContext.soundFonts[fontId].instruments[index] = value;
+ break;
+ }
+
+ return 0;
+}
+
+void AudioPlayback_SeqLayerDecayRelease(SequenceLayer* layer, s32 target) {
+ Note* note;
+ NoteAttributes* attrs;
+ SequenceChannel* chan;
+ s32 i;
+
+ if (layer == NO_LAYER) {
+ return;
+ }
+
+ layer->bit3 = false;
+
+ if (layer->note == NULL) {
+ return;
+ }
+
+ note = layer->note;
+ attrs = ¬e->playbackState.attributes;
+
+ if (note->playbackState.wantedParentLayer == layer) {
+ note->playbackState.wantedParentLayer = NO_LAYER;
+ }
+
+ if (note->playbackState.parentLayer != layer) {
+ if (note->playbackState.parentLayer == NO_LAYER && note->playbackState.wantedParentLayer == NO_LAYER &&
+ note->playbackState.prevParentLayer == layer && target != ADSR_STATE_DECAY) {
+ note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
+ note->playbackState.adsr.action.s.release = true;
+ }
+ return;
+ }
+
+ if (note->playbackState.adsr.action.s.state != ADSR_STATE_DECAY) {
+ attrs->freqScale = layer->noteFreqScale;
+ attrs->velocity = layer->noteVelocity;
+ attrs->pan = layer->notePan;
+
+ if (layer->channel != NULL) {
+ chan = layer->channel;
+
+ if (layer->unk_0A.s.bit_2 == 1) {
+ attrs->reverb = chan->reverb;
+ } else {
+ attrs->reverb = layer->unk_09;
+ }
+
+ if (layer->unk_08 == 0x80) {
+ attrs->unk_3 = chan->unk_10;
+ } else {
+ attrs->unk_3 = layer->unk_08;
+ }
+
+ if (layer->unk_0A.s.bit_9 == 1) {
+ attrs->unk_1 = chan->unk_0C;
+ } else {
+ attrs->unk_1 = 0;
+ }
+
+ attrs->filter = chan->filter;
+
+ if (attrs->filter != NULL) {
+ for (i = 0; i < 8; i++) {
+ attrs->filterBuf[i] = attrs->filter[i];
+ }
+ attrs->filter = attrs->filterBuf;
+ }
+
+ attrs->unk_6 = chan->unk_20;
+ attrs->unk_4 = chan->unk_0F;
+ if (chan->seqPlayer->muted && (chan->muteBehavior & 8)) {
+ note->noteSubEu.bitField0.finished = true;
+ }
+
+ if (layer->stereo.asByte == 0) {
+ attrs->stereo = chan->stereo;
+ } else {
+ attrs->stereo = layer->stereo;
+ }
+ note->playbackState.priority = chan->someOtherPriority;
+ } else {
+ attrs->stereo = layer->stereo;
+ note->playbackState.priority = 1;
+ }
+
+ note->playbackState.prevParentLayer = note->playbackState.parentLayer;
+ note->playbackState.parentLayer = NO_LAYER;
+ if (target == ADSR_STATE_RELEASE) {
+ note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
+ note->playbackState.adsr.action.s.release = true;
+ note->playbackState.unk_04 = 2;
+ } else {
+ note->playbackState.unk_04 = 1;
+ note->playbackState.adsr.action.s.decay = true;
+ if (layer->adsr.releaseRate == 0) {
+ note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->channel->adsr.releaseRate];
+ } else {
+ note->playbackState.adsr.fadeOutVel = gAudioContext.unk_3520[layer->adsr.releaseRate];
+ }
+ note->playbackState.adsr.sustain =
+ ((f32)(s32)(layer->channel->adsr.sustain) * note->playbackState.adsr.current) / 256.0f;
+ }
+ }
+
+ if (target == ADSR_STATE_DECAY) {
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioPlayback_AudioListPushFront(¬e->listItem.pool->decaying, ¬e->listItem);
+ }
+}
+
+void AudioPlayback_SeqLayerNoteDecay(SequenceLayer* layer) {
+ AudioPlayback_SeqLayerDecayRelease(layer, ADSR_STATE_DECAY);
+}
+
+void AudioPlayback_SeqLayerNoteRelease(SequenceLayer* layer) {
+ AudioPlayback_SeqLayerDecayRelease(layer, ADSR_STATE_RELEASE);
+}
+
+s32 AudioPlayback_BuildSyntheticWave(Note* note, SequenceLayer* layer, s32 waveId) {
+ f32 freqScale;
+ f32 ratio;
+ u8 sampleCountIndex;
+
+ if (waveId < 128) {
+ waveId = 128;
+ }
+
+ freqScale = layer->freqScale;
+ if (layer->portamento.mode != 0 && 0.0f < layer->portamento.extent) {
+ freqScale *= (layer->portamento.extent + 1.0f);
+ }
+ if (freqScale < 0.99999f) {
+ sampleCountIndex = 0;
+ ratio = 1.0465f;
+ } else if (freqScale < 1.99999f) {
+ sampleCountIndex = 1;
+ ratio = 0.52325f;
+ } else if (freqScale < 3.99999f) {
+ sampleCountIndex = 2;
+ ratio = 0.26263f;
+ } else {
+ sampleCountIndex = 3;
+ ratio = 0.13081f;
+ }
+ layer->freqScale *= ratio;
+ note->playbackState.waveId = waveId;
+ note->playbackState.sampleCountIndex = sampleCountIndex;
+
+ note->noteSubEu.sound.samples = &gWaveSamples[waveId - 128][sampleCountIndex * 64];
+
+ return sampleCountIndex;
+}
+
+void AudioPlayback_InitSyntheticWave(Note* note, SequenceLayer* layer) {
+ s32 sampleCountIndex;
+ s32 waveSampleCountIndex;
+ s32 waveId = layer->instOrWave;
+
+ if (waveId == 0xFF) {
+ waveId = layer->channel->instOrWave;
+ }
+
+ sampleCountIndex = note->playbackState.sampleCountIndex;
+ waveSampleCountIndex = AudioPlayback_BuildSyntheticWave(note, layer, waveId);
+
+ if (waveSampleCountIndex != sampleCountIndex) {
+ note->noteSubEu.unk_06 = waveSampleCountIndex * 4 + sampleCountIndex;
+ }
+}
+
+void AudioPlayback_InitNoteList(AudioListItem* list) {
+ list->prev = list;
+ list->next = list;
+ list->u.count = 0;
+}
+
+void AudioPlayback_InitNoteLists(NotePool* pool) {
+ AudioPlayback_InitNoteList(&pool->disabled);
+ AudioPlayback_InitNoteList(&pool->decaying);
+ AudioPlayback_InitNoteList(&pool->releasing);
+ AudioPlayback_InitNoteList(&pool->active);
+ pool->disabled.pool = pool;
+ pool->decaying.pool = pool;
+ pool->releasing.pool = pool;
+ pool->active.pool = pool;
+}
+
+void AudioPlayback_InitNoteFreeList(void) {
+ s32 i;
+
+ AudioPlayback_InitNoteLists(&gAudioContext.noteFreeLists);
+ for (i = 0; i < gAudioContext.numNotes; i++) {
+ gAudioContext.notes[i].listItem.u.value = &gAudioContext.notes[i];
+ gAudioContext.notes[i].listItem.prev = NULL;
+ AudioSeq_AudioListPushBack(&gAudioContext.noteFreeLists.disabled, &gAudioContext.notes[i].listItem);
+ }
+}
+
+void AudioPlayback_NotePoolClear(NotePool* pool) {
+ s32 i;
+ AudioListItem* source;
+ AudioListItem* cur;
+ AudioListItem* dest;
+
+ for (i = 0; i < 4; i++) {
+ switch (i) {
+ case 0:
+ source = &pool->disabled;
+ dest = &gAudioContext.noteFreeLists.disabled;
+ break;
+
+ case 1:
+ source = &pool->decaying;
+ dest = &gAudioContext.noteFreeLists.decaying;
+ break;
+
+ case 2:
+ source = &pool->releasing;
+ dest = &gAudioContext.noteFreeLists.releasing;
+ break;
+
+ case 3:
+ source = &pool->active;
+ dest = &gAudioContext.noteFreeLists.active;
+ break;
+ }
+
+ for (;;) {
+ cur = source->next;
+ if (cur == source || cur == NULL) {
+ break;
+ }
+ AudioPlayback_AudioListRemove(cur);
+ AudioSeq_AudioListPushBack(dest, cur);
+ }
+ }
+}
+
+void AudioPlayback_NotePoolFill(NotePool* pool, s32 count) {
+ s32 i;
+ s32 j;
+ Note* note;
+ AudioListItem* source;
+ AudioListItem* dest;
+
+ AudioPlayback_NotePoolClear(pool);
+
+ for (i = 0, j = 0; j < count; i++) {
+ if (i == 4) {
+ return;
+ }
+
+ switch (i) {
+ case 0:
+ source = &gAudioContext.noteFreeLists.disabled;
+ dest = &pool->disabled;
+ break;
+
+ case 1:
+ source = &gAudioContext.noteFreeLists.decaying;
+ dest = &pool->decaying;
+ break;
+
+ case 2:
+ source = &gAudioContext.noteFreeLists.releasing;
+ dest = &pool->releasing;
+ break;
+
+ case 3:
+ source = &gAudioContext.noteFreeLists.active;
+ dest = &pool->active;
+ break;
+ }
+
+ while (j < count) {
+ note = AudioSeq_AudioListPopBack(source);
+ if (note == NULL) {
+ break;
+ }
+ AudioSeq_AudioListPushBack(dest, ¬e->listItem);
+ j++;
+ }
+ }
+}
+
+void AudioPlayback_AudioListPushFront(AudioListItem* list, AudioListItem* item) {
+ // add 'item' to the front of the list given by 'list', if it's not in any list
+ if (item->prev == NULL) {
+ item->prev = list;
+ item->next = list->next;
+ list->next->prev = item;
+ list->next = item;
+ list->u.count++;
+ item->pool = list->pool;
+ }
+}
+
+void AudioPlayback_AudioListRemove(AudioListItem* item) {
+ // remove 'item' from the list it's in, if any
+ if (item->prev != NULL) {
+ item->prev->next = item->next;
+ item->next->prev = item->prev;
+ item->prev = NULL;
+ }
+}
+
+Note* AudioPlayback_FindNodeWithPrioLessThan(AudioListItem* list, s32 limit) {
+ AudioListItem* cur = list->next;
+ AudioListItem* best;
+
+ if (cur == list) {
+ return NULL;
+ }
+
+ for (best = cur; cur != list; cur = cur->next) {
+ if (((Note*)best->u.value)->playbackState.priority >= ((Note*)cur->u.value)->playbackState.priority) {
+ best = cur;
+ }
+ }
+
+ if (best == NULL) {
+ return NULL;
+ }
+
+ if (limit <= ((Note*)best->u.value)->playbackState.priority) {
+ return NULL;
+ }
+
+ return best->u.value;
+}
+
+void AudioPlayback_NoteInitForLayer(Note* note, SequenceLayer* layer) {
+ s32 pad[3];
+ s16 instId;
+ SequenceChannel* channel = layer->channel;
+ NotePlaybackState* playbackState = ¬e->playbackState;
+ NoteSubEu* noteSubEu = ¬e->noteSubEu;
+
+ playbackState->prevParentLayer = NO_LAYER;
+ playbackState->parentLayer = layer;
+ playbackState->priority = channel->notePriority;
+ layer->notePropertiesNeedInit = true;
+ layer->bit3 = true;
+ layer->note = note;
+ channel->noteUnused = note;
+ channel->layerUnused = layer;
+ layer->noteVelocity = 0.0f;
+ AudioPlayback_NoteInit(note);
+ instId = layer->instOrWave;
+
+ if (instId == 0xFF) {
+ instId = channel->instOrWave;
+ }
+ noteSubEu->sound.soundFontSound = layer->sound;
+
+ if (instId >= 0x80 && instId < 0xC0) {
+ noteSubEu->bitField1.isSyntheticWave = true;
+ } else {
+ noteSubEu->bitField1.isSyntheticWave = false;
+ }
+
+ if (noteSubEu->bitField1.isSyntheticWave) {
+ AudioPlayback_BuildSyntheticWave(note, layer, instId);
+ } else if (channel->unk_DC == 1) {
+ playbackState->unk_84 = noteSubEu->sound.soundFontSound->sample->loop->start;
+ } else {
+ playbackState->unk_84 = channel->unk_DC;
+ if (playbackState->unk_84 >= noteSubEu->sound.soundFontSound->sample->loop->end) {
+ playbackState->unk_84 = 0;
+ }
+ }
+
+ playbackState->fontId = channel->fontId;
+ playbackState->stereoHeadsetEffects = channel->stereoHeadsetEffects;
+ noteSubEu->bitField1.reverbIndex = channel->reverbIndex & 3;
+}
+
+void func_801963E8(Note* note, SequenceLayer* layer) {
+ // similar to Audio_NoteReleaseAndTakeOwnership, hard to say what the difference is
+ AudioPlayback_SeqLayerNoteRelease(note->playbackState.parentLayer);
+ note->playbackState.wantedParentLayer = layer;
+}
+
+void AudioPlayback_NoteReleaseAndTakeOwnership(Note* note, SequenceLayer* layer) {
+ note->playbackState.wantedParentLayer = layer;
+ note->playbackState.priority = layer->channel->notePriority;
+
+ note->playbackState.adsr.fadeOutVel = gAudioContext.audioBufferParameters.updatesPerFrameInv;
+ note->playbackState.adsr.action.s.release = true;
+}
+
+Note* AudioPlayback_AllocNoteFromDisabled(NotePool* pool, SequenceLayer* layer) {
+ Note* note = AudioSeq_AudioListPopBack(&pool->disabled);
+ if (note != NULL) {
+ AudioPlayback_NoteInitForLayer(note, layer);
+ AudioPlayback_AudioListPushFront(&pool->active, ¬e->listItem);
+ }
+ return note;
+}
+
+Note* AudioPlayback_AllocNoteFromDecaying(NotePool* pool, SequenceLayer* layer) {
+ Note* note = AudioPlayback_FindNodeWithPrioLessThan(&pool->decaying, layer->channel->notePriority);
+
+ if (note != NULL) {
+ AudioPlayback_NoteReleaseAndTakeOwnership(note, layer);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(&pool->releasing, ¬e->listItem);
+ }
+ return note;
+}
+
+Note* AudioPlayback_AllocNoteFromActive(NotePool* pool, SequenceLayer* layer) {
+ Note* rNote;
+ Note* aNote;
+ s32 rPriority;
+ s32 aPriority;
+
+ rPriority = aPriority = 0x10;
+ rNote = AudioPlayback_FindNodeWithPrioLessThan(&pool->releasing, layer->channel->notePriority);
+
+ if (rNote != NULL) {
+ rPriority = rNote->playbackState.priority;
+ }
+
+ aNote = AudioPlayback_FindNodeWithPrioLessThan(&pool->active, layer->channel->notePriority);
+
+ if (aNote != NULL) {
+ aPriority = aNote->playbackState.priority;
+ }
+
+ if (rNote == NULL && aNote == NULL) {
+ return NULL;
+ }
+
+ if (aPriority < rPriority) {
+ AudioPlayback_AudioListRemove(&aNote->listItem);
+ func_801963E8(aNote, layer);
+ AudioSeq_AudioListPushBack(&pool->releasing, &aNote->listItem);
+ aNote->playbackState.priority = layer->channel->notePriority;
+ return aNote;
+ }
+ rNote->playbackState.wantedParentLayer = layer;
+ rNote->playbackState.priority = layer->channel->notePriority;
+ return rNote;
+}
+
+Note* AudioPlayback_AllocNote(SequenceLayer* layer) {
+ Note* note;
+ u32 policy = layer->channel->noteAllocPolicy;
+
+ if (policy & 1) {
+ note = layer->note;
+ if (note != NULL && note->playbackState.prevParentLayer == layer &&
+ note->playbackState.wantedParentLayer == NO_LAYER) {
+ AudioPlayback_NoteReleaseAndTakeOwnership(note, layer);
+ AudioPlayback_AudioListRemove(¬e->listItem);
+ AudioSeq_AudioListPushBack(¬e->listItem.pool->releasing, ¬e->listItem);
+ return note;
+ }
+ }
+
+ if (policy & 2) {
+ if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer))) {
+ goto null_return;
+ }
+ return note;
+ }
+
+ if (policy & 4) {
+ if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->seqPlayer->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->seqPlayer->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->seqPlayer->notePool, layer))) {
+ goto null_return;
+ }
+ return note;
+ }
+
+ if (policy & 8) {
+ if (!(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) {
+ goto null_return;
+ }
+ return note;
+ }
+
+ if (!(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDisabled(&layer->channel->seqPlayer->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDisabled(&gAudioContext.noteFreeLists, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&layer->channel->seqPlayer->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromDecaying(&gAudioContext.noteFreeLists, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&layer->channel->seqPlayer->notePool, layer)) &&
+ !(note = AudioPlayback_AllocNoteFromActive(&gAudioContext.noteFreeLists, layer))) {
+ goto null_return;
+ }
+ return note;
+
+null_return:
+ layer->bit3 = true;
+ return NULL;
+}
+
+void AudioPlayback_NoteInitAll(void) {
+ Note* note;
+ s32 i;
+
+ for (i = 0; i < gAudioContext.numNotes; i++) {
+ note = &gAudioContext.notes[i];
+ note->noteSubEu = gZeroNoteSub;
+ note->playbackState.priority = 0;
+ note->playbackState.unk_04 = 0;
+ note->playbackState.parentLayer = NO_LAYER;
+ note->playbackState.wantedParentLayer = NO_LAYER;
+ note->playbackState.prevParentLayer = NO_LAYER;
+ note->playbackState.waveId = 0;
+ note->playbackState.attributes.velocity = 0.0f;
+ note->playbackState.adsrVolScaleUnused = 0;
+ note->playbackState.adsr.action.asByte = 0;
+ note->playbackState.vibratoState.active = false;
+ note->playbackState.portamento.cur = 0;
+ note->playbackState.portamento.speed = 0;
+ note->playbackState.stereoHeadsetEffects = false;
+ note->playbackState.unk_84 = 0;
+ note->synthesisState.synthesisBuffers = AudioHeap_AllocDmaMemory(&gAudioContext.notesAndBuffersPool, 0x2E0);
+ note->playbackState.attributes.filterBuf = AudioHeap_AllocDmaMemory(&gAudioContext.notesAndBuffersPool, 0x10);
+ }
+}
diff --git a/src/code/audio/audio_seqplayer.c b/src/code/audio/audio_seqplayer.c
index e3841a50a6..56d8ac9516 100644
--- a/src/code/audio/audio_seqplayer.c
+++ b/src/code/audio/audio_seqplayer.c
@@ -12,7 +12,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197A54.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197AA4.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_SequenceChannelDisable.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197B14.s")
@@ -22,11 +22,11 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197D24.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197D4C.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_SequencePlayerDisable.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E08.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPushBack.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E48.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPopBack.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/audio_seqplayer/func_80197E88.s")
diff --git a/src/code/audio/code_8019AF00.c b/src/code/audio/code_8019AF00.c
index 5d0a166a28..17404280bc 100644
--- a/src/code/audio/code_8019AF00.c
+++ b/src/code/audio/code_8019AF00.c
@@ -1,6 +1,1882 @@
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/D_801E0BD0.s")
+typedef struct {
+ /* 0x0 */ s8 x;
+ /* 0x1 */ s8 y;
+} OcarinaControlStick; // size = 0x2
+
+typedef struct {
+ /* 0x0 */ u16 playerIO;
+ /* 0x2 */ u16 channelMask;
+ /* 0x4 */ u8 channelIO[3 * 33 + 1];
+} NatureAmbienceDataIO; // size = 0x68
+
+typedef struct {
+ /* 0x0 */ Vec3f* pos;
+ /* 0x4 */ f32 freqScale;
+ /* 0x8 */ s8 reverbAdd;
+} SfxSettings; // size = 0x9
+
+typedef struct {
+ /* 0x0 */ f32 vol;
+ /* 0x4 */ f32 freqScale;
+ /* 0x8 */ s8 reverb;
+ /* 0x9 */ s8 panSigned;
+ /* 0xA */ s8 stereoBits;
+ /* 0xB */ u8 filter;
+ /* 0xC */ u8 unk_0C;
+ /* 0xD */ u8 unk_0D;
+} SfxPlayerState; // size = 0xE
+
+typedef enum {
+ /* 0x0 */ SFX_CHANNEL_PLAYER0, // SfxPlayerBank
+ /* 0x1 */ SFX_CHANNEL_PLAYER1,
+ /* 0x2 */ SFX_CHANNEL_PLAYER2,
+ /* 0x3 */ SFX_CHANNEL_ITEM0, // SfxItemBank
+ /* 0x4 */ SFX_CHANNEL_ITEM1,
+ /* 0x5 */ SFX_CHANNEL_ENV0, // SfxEnvironmentBank
+ /* 0x6 */ SFX_CHANNEL_ENV1,
+ /* 0x7 */ SFX_CHANNEL_ENV2,
+ /* 0x8 */ SFX_CHANNEL_ENEMY0, // SfxEnemyBank
+ /* 0x9 */ SFX_CHANNEL_ENEMY1,
+ /* 0xA */ SFX_CHANNEL_ENEMY2,
+ /* 0xB */ SFX_CHANNEL_SYSTEM0, // SfxSystemBank
+ /* 0xC */ SFX_CHANNEL_SYSTEM1,
+ /* 0xD */ SFX_CHANNEL_OCARINA, // SfxOcarinaBank
+ /* 0xE */ SFX_CHANNEL_VOICE0, // SfxVoiceBank
+ /* 0xF */ SFX_CHANNEL_VOICE1
+} SfxChannelIdx; // playerIdx = 2
+
+// Global IO ports for sequences, 8 global ports per seqPlayer
+typedef enum {
+ /* 0x0 */ SEQ_PLAYER_IO_PORT_0,
+ /* 0x1 */ SEQ_PLAYER_IO_PORT_1,
+ /* 0x2 */ SEQ_PLAYER_IO_PORT_2,
+ /* 0x3 */ SEQ_PLAYER_IO_PORT_3,
+ /* 0x4 */ SEQ_PLAYER_IO_PORT_4,
+ /* 0x5 */ SEQ_PLAYER_IO_PORT_5,
+ /* 0x6 */ SEQ_PLAYER_IO_PORT_6,
+ /* 0x7 */ SEQ_PLAYER_IO_PORT_7,
+} SeqPlayerIOPort;
+
+typedef struct {
+ /* 0x0 */ f32 value;
+ /* 0x4 */ f32 target;
+ /* 0x8 */ f32 step;
+ /* 0xC */ s32 remainingFrames;
+} FreqLerp; // size = 0x10
+
+// Sfx bss
+SfxSettings sSfxSettings[8];
+u8 sSfxSettingsFlags;
+f32 sTwoSemitonesLoweredFreq;
+s8 sSfxIncreasedReverb;
+f32 sSfxSyncedVolume;
+f32 sSfxSyncedVolumeForMetalEffects;
+f32 sSfxSyncedFreq;
+FreqLerp sRiverFreqScaleLerp;
+FreqLerp sWaterfallFreqScaleLerp;
+f32 sSfxAdjustedFreq;
+s8 sSfxCustomReverb;
+u8 sRiverSoundMainBgmVol;
+u8 sRiverSoundMainBgmCurrentVol;
+u8 sRiverSoundMainBgmLower;
+u8 sRiverSoundMainBgmRestore;
+u8 sGanonsTowerVol;
+f32* sSfxVolumeCur;
+f32 sSfxVolumeTarget;
+f32 sSfxVolumeRate;
+u16 sSceneSeqId1;
+SfxPlayerState sSfxChannelState[16];
+
+// Sequence bss
+u8 D_801FD3A8;
+u8 D_801FD3A9;
+u8 sRiverSoundBgmTimer;
+u8 sFanfareState;
+u16 sFanfareSeqId;
+u8 sMuteOnlySfxAndNatureSeq;
+u8 sAllPlayersMutedExceptOcaAndSys;
+u8 sAudioPauseState;
+u8 sSpatialSeqIsActive[4];
+u8 sSequenceFilter[8 * 4];
+u8 sIsFinalHoursOrSoaring;
+u8 sObjSoundFanfareSeqId;
+u8 sObjSoundFanfareRequested;
+Vec3f sObjSoundFanfarePos;
+u8 sObjSoundPlayerIdx;
+Vec3f sObjSoundPos;
+s16 sObjSoundFlags;
+f32 sObjSoundMinDist;
+f32 sObjSoundMaxDist;
+f32 sObjSoundMaxVol;
+f32 sObjSoundMinVol;
+Vec3f sSpatialSeqNoFilterPos;
+Vec3f sSpatialSeqFilterPos;
+f32 sSpatialSeqMaxDist;
+u8 sSpatialSeqSeqId;
+u8 sSpatialSeqFlags;
+u8 D_801FD432;
+u8 sSpatialSubBgmFadeTimer;
+u8 D_801FD434;
+u8 sSpatialSeqPlayerIdx;
+u8 sSpatialSeqFadeTimer;
+u16 D_801FD438;
+
+// AudioOcarina bss
+OcarinaStaff sPlayingStaff;
+OcarinaStaff sPlaybackStaff;
+OcarinaStaff sRecordingStaff;
+u32 sOcarinaUpdateTaskCurrent;
+OcarinaControlStick sOcarinaInputStickRel;
+u32 sOcarinaInputButtonCur;
+u32 sOcarinaInputButtonStart;
+u32 sOcarinaInputButtonPrev;
+s32 sOcaInputBtnPress;
+u8 sOcarinaResetDelay;
+u8 sOcarinaResetUnused;
+u8 sOcarinaHasStartedSong;
+u8 sFirstOcarinaSongIdx;
+u8 sLastOcarinaSongIdx;
+u32 sOcarinaAvailSongs;
+u8 sOcarinaStaffPlayingPos;
+u16 sMusicStaffPos[OCARINA_SONG_MAX];
+u16 sMusicStaffCurHeldLength[OCARINA_SONG_MAX];
+u16 sMusicStaffExpectedLength[OCARINA_SONG_MAX];
+u8 sMusicStaffExpectedPitch[OCARINA_SONG_MAX]; // Next required pitch in song playback
+u8 D_801FD518[OCARINA_SONG_MAX];
+u32 D_801FD530[OCARINA_SONG_MAX];
+OcarinaNote sRecordingSongNote;
+u16 sCustomSequencePc;
+
+// Sfx Data
+u8 D_801D6600[] = {
+ true, false, true, true, false, false, true,
+};
+u8 D_801D6608[] = {
+ true, true, true, true, true, false, true,
+};
+u8 gChannelsPerBank[4][7] = {
+ { 3, 2, 3, 3, 2, 1, 2 },
+ { 3, 2, 2, 2, 2, 2, 2 },
+ { 3, 2, 2, 2, 2, 2, 2 },
+ { 4, 1, 0, 0, 2, 2, 2 },
+};
+u8 gUsedChannelsPerBank[4][7] = {
+ { 3, 2, 3, 2, 2, 1, 1 },
+ { 3, 1, 1, 1, 2, 1, 1 },
+ { 3, 1, 1, 1, 2, 1, 1 },
+ { 2, 1, 0, 0, 1, 1, 1 },
+};
+f32 sGiantsMaskFreq = 0.89167805f; // Around 2 semitones down in pitch
+s8 sGiantsMaskReverbAdd = 0x40;
+f32 sWaterWheelVolume = 0.65f;
+f32 gSfxVolume = 1.0f;
+s8 sSfxTimer = 20;
+s8 sSfxTimerLerpRange2 = 30;
+s8 sSfxTimerLerpRange1 = 20;
+f32 sBehindScreenZ[2] = { -15.0f, -65.0f }; // Unused Remnant of OoT
+u8 sAudioIncreasingTranspose = 0; // Remnant of OoT, only unsed in unused functions
+u8 gMorphaTransposeTable[16] = { 0, 0, 0, 1, 1, 2, 4, 6, 8, 8, 8, 8, 8, 8, 8, 8 }; // Unused Remnant of OoT
+u8 sPrevChargeLevel = 0;
+f32 sChargeLevelsSfxFreq[] = { 1.0f, 1.12246f, 1.33484f, 1.33484f };
+f32 sCurChargeLevelSfxFreq = 1.0f;
+u8 sGanonsTowerLevelsVol[] = {
+ 127, 80, 75, 73, 70, 68, 65, 60 // volumes
+};
+u8 sEnterGanonsTowerTimer = 0;
+u16 sSfxVolumeDuration = 0;
+
+// System Data
+s8 sAudioFileSelectSetting = AUDIO_FS_STEREO;
+s8 sAudioIsWindowOpen = false;
+s8 sAudioCutsceneFlag = false;
+s8 sSpecReverb = 0;
+s8 sAudioEnvReverb = 0;
+s8 sAudioCodeReverb = 0;
+
+// Sequence Data
+u8 sPrevSeqMode = 0;
+f32 sAudioEnemyDist = 0.0f;
+s8 sAudioEnemyVol = 127;
+u16 sPrevMainBgmSeqId = NA_BGM_DISABLED;
+u8 sBgmPlayerIOPort7 = 0;
+u8 sSceneSeqId2 = NA_BGM_GENERAL_SFX;
+u32 sNumFramesStill = 0;
+u32 sNumFramesMoving = 0;
+u8 sAudioBaseFilter = 0;
+u8 sAudioExtraFilter = 0;
+u8 sAudioBaseFilter2 = 0;
+u8 sAudioExtraFilter2 = 0;
+s8 gUnderwaterSfxReverbAdd = 0;
+Vec3f* sRiverSoundBgmPos = NULL;
+f32 sRiverSoundXZDistToPlayer = 2000.0f;
+u8 sObjSoundMainBgmSeqId = NA_BGM_GENERAL_SFX;
+u8 sSeqFlags[] = {
+ 0x3, // NA_BGM_GENERAL_SFX
+ 0x1, // NA_BGM_NATURE_AMBIENCE
+ 0x1, // NA_BGM_TERMINA_FIELD
+ 0x8, // NA_BGM_CHASE
+ 0, // NA_BGM_MAJORAS_THEME
+ 0, // NA_BGM_CLOCK_TOWER
+ 0x1, // NA_BGM_STONE_TOWER_TEMPLE
+ 0x1, // NA_BGM_INV_STONE_TOWER_TEMPLE
+ 0x2, // NA_BGM_FAILURE_0
+ 0x2, // NA_BGM_FAILURE_1
+ 0, // NA_BGM_HAPPY_MASK_SALESMAN
+ 0, // NA_BGM_SONG_OF_HEALING
+ 0x1, // NA_BGM_SWAMP_REGION
+ 0, // NA_BGM_ALIEN_INVASION
+ 0x2, // NA_BGM_SWAMP_CRUISE
+ 0, // NA_BGM_SHARPS_CURSE
+ 0x1, // NA_BGM_GREAT_BAY_REGION
+ 0x1, // NA_BGM_IKANA_REGION
+ 0, // NA_BGM_DEKU_KING
+ 0x1, // NA_BGM_MOUNTAIN_REGION
+ 0, // NA_BGM_PIRATES_FORTRESS
+ 0, // NA_BGM_CLOCK_TOWN_DAY_1
+ 0, // NA_BGM_CLOCK_TOWN_DAY_2
+ 0, // NA_BGM_CLOCK_TOWN_DAY_3
+ 0x40, // NA_BGM_FILE_SELECT
+ 0x10, // NA_BGM_CLEAR_EVENT
+ 0, // NA_BGM_ENEMY
+ 0x8, // NA_BGM_BOSS
+ 0x1, // NA_BGM_WOODFALL_TEMPLE
+ 0, // NA_BGM_MARKET
+ 0, // NA_BGM_OPENING
+ 0x20, // NA_BGM_INSIDE_A_HOUSE
+ 0x2, // NA_BGM_GAME_OVER
+ 0, // NA_BGM_CLEAR_BOSS
+ 0x2, // NA_BGM_GET_ITEM
+ 0x2, // NA_BGM_GATE_OPEN
+ 0x2, // NA_BGM_GET_HEART
+ 0x8, // NA_BGM_TIMED_MINI_GAME
+ 0, // NA_BGM_GORON_RACE
+ 0, // NA_BGM_MUSIC_BOX_HOUSE
+ 0, // NA_BGM_FAIRY_FOUNTAIN
+ 0, // NA_BGM_ZELDAS_LULLABY
+ 0, // NA_BGM_ROSA_SISTERS
+ 0x2, // NA_BGM_OPEN_CHEST
+ 0, // NA_BGM_MARINE_RESEARCH_LAB
+ 0x40, // NA_BGM_GIANTS_THEME
+ 0, // NA_BGM_SONG_OF_STORMS
+ 0, // NA_BGM_ROMANI_RANCH
+ 0, // NA_BGM_GORON_VILLAGE
+ 0, // NA_BGM_MAYORS_OFFICE
+ 0x2, // NA_BGM_OCA_EPONA
+ 0x2, // NA_BGM_OCA_SUNS
+ 0x2, // NA_BGM_OCA_TIME
+ 0x2, // NA_BGM_OCA_STORM
+ 0x10, // NA_BGM_ZORA_HALL
+ 0x2, // NA_BGM_GET_NEW_MASK
+ 0x8, // NA_BGM_MINI_BOSS
+ 0x2, // NA_BGM_GET_SMALL_ITEM
+ 0, // NA_BGM_ASTRAL_OBSERVATORY
+ 0x1, // NA_BGM_CAVERN
+ 0x11, // NA_BGM_MILK_BAR
+ 0x2, // NA_BGM_ZELDA_APPEAR
+ 0, // NA_BGM_SARIAS_SONG
+ 0, // NA_BGM_GORON_GOAL
+ 0, // NA_BGM_HORSE
+ 0, // NA_BGM_HORSE_GOAL
+ 0, // NA_BGM_INGO
+ 0, // NA_BGM_KOTAKE_POTION_SHOP
+ 0x20, // NA_BGM_SHOP
+ 0x2, // NA_BGM_OWL
+ 0x20, // NA_BGM_MINI_GAME
+ 0x2, // NA_BGM_OCA_SOARING
+ 0x2, // NA_BGM_OCA_HEALING
+ 0x2, // NA_BGM_INVERTED_SONG_OF_TIME
+ 0x2, // NA_BGM_SONG_OF_DOUBLE_TIME
+ 0x2, // NA_BGM_SONATA_OF_AWAKENING
+ 0x2, // NA_BGM_GORON_LULLABY
+ 0x2, // NA_BGM_NEW_WAVE_BOSSA_NOVA
+ 0x2, // NA_BGM_ELEGY_OF_EMPTINESS
+ 0x2, // NA_BGM_OATH_TO_ORDER
+ 0, // NA_BGM_SWORD_TRAINING_HALL
+ 0x2, // NA_BGM_GORON_LULLABY_INTRO
+ 0x2, // NA_BGM_OCA_FAIRY
+ 0x2, // NA_BGM_BREMEN_MARCH
+ 0x2, // NA_BGM_BALLAD_OF_THE_WIND_FISH
+ 0x8, // NA_BGM_SONG_OF_SOARING
+ 0, // NA_BGM_MILK_BAR_DUPLICATE
+ 0, // NA_BGM_FINAL_HOURS
+ 0x2, // NA_BGM_MIKAU_RIFF
+ 0x2, // NA_BGM_MIKAU_FINALE
+ 0, // NA_BGM_FROG_SONG
+ 0x2, // NA_BGM_OCA_SONATA
+ 0x2, // NA_BGM_OCA_LULLABY
+ 0x2, // NA_BGM_OCA_NEW_WAVE
+ 0x2, // NA_BGM_OCA_ELEGY
+ 0x2, // NA_BGM_OCA_OATH
+ 0, // NA_BGM_MAJORAS_LAIR
+ 0x2, // NA_BGM_OCA_LULLABY_INTRO
+ 0x2, // NA_BGM_OCA_GUITAR_BASS_SESSION
+ 0x2, // NA_BGM_PIANO_SESSION
+ 0x2, // NA_BGM_INDIGO_GO_SESSION
+ 0x1, // NA_BGM_SNOWHEAD_TEMPLE
+ 0x1, // NA_BGM_GREAT_BAY_TEMPLE
+ 0x2, // NA_BGM_NEW_WAVE_SAXOPHONE
+ 0x2, // NA_BGM_NEW_WAVE_VOCAL
+ 0, // NA_BGM_MAJORAS_WRATH
+ 0, // NA_BGM_MAJORAS_INCARNATION
+ 0, // NA_BGM_MAJORAS_MASK
+ 0x2, // NA_BGM_BASS_PLAY
+ 0x2, // NA_BGM_DRUMS_PLAY
+ 0x2, // NA_BGM_PIANO_PLAY
+ 0x1, // NA_BGM_IKANA_CASTLE
+ 0, // NA_BGM_GATHERING_GIANTS
+ 0x4, // NA_BGM_KAMARO_DANCE
+ 0, // NA_BGM_CREMIA_CARRIAGE
+ 0x2, // NA_BGM_KEATON_QUIZ
+ 0, // NA_BGM_END_CREDITS_1
+ 0, // NA_BGM_OPENING_LOOP
+ 0, // NA_BGM_TITLE_THEME
+ 0x2, // NA_BGM_DUNGEON_APPEAR
+ 0x2, // NA_BGM_WOODFALL_CLEAR
+ 0x2, // NA_BGM_SNOWHEAD_CLEAR
+ 0, //
+ 0, // NA_BGM_INTO_THE_MOON
+ 0, // NA_BGM_GOODBYE_GIANT
+ 0, // NA_BGM_TATL_AND_TAEL
+ 0, // NA_BGM_MOONS_DESTRUCTION
+ 0, // NA_BGM_END_CREDITS_2
+};
+
+s8 sSpecReverbs[20] = {
+ 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+NatureAmbienceDataIO sNatureAmbienceData[20] = {
+ // natureSeqId: 0
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_09),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(32),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_1_BEND_PITCH(0),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_10),
+ NATURE_IO_CRITTER_2_BEND_PITCH(112),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(48),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_03),
+ NATURE_IO_CRITTER_3_BEND_PITCH(127),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_00),
+ NATURE_IO_CRITTER_4_BEND_PITCH(127),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(16),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_5_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 1
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(32),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_16),
+ NATURE_IO_CRITTER_1_BEND_PITCH(0),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_12),
+ NATURE_IO_CRITTER_2_BEND_PITCH(112),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_2_PORT5(48),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_15),
+ NATURE_IO_CRITTER_3_BEND_PITCH(127),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_06),
+ NATURE_IO_CRITTER_4_BEND_PITCH(127),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(16),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_5_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 2
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(48),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_10),
+ NATURE_IO_CRITTER_1_BEND_PITCH(0),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_2_BEND_PITCH(48),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(32),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_03),
+ NATURE_IO_CRITTER_3_BEND_PITCH(127),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_4_BEND_PITCH(64),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(0),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_5_PORT5(63),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 3
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_09),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(32),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_1_BEND_PITCH(64),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_1_PORT5(48),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_10),
+ NATURE_IO_CRITTER_2_BEND_PITCH(32),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(32),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_14),
+ NATURE_IO_CRITTER_3_BEND_PITCH(64),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_00),
+ NATURE_IO_CRITTER_4_BEND_PITCH(127),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(16),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_5_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 4
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(32),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_02),
+ NATURE_IO_CRITTER_1_BEND_PITCH(64),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_12),
+ NATURE_IO_CRITTER_2_BEND_PITCH(112),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(48),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_13),
+ NATURE_IO_CRITTER_3_BEND_PITCH(64),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_4_BEND_PITCH(64),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(16),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_02),
+ NATURE_IO_CRITTER_5_BEND_PITCH(112),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_5_PORT5(48),
+
+ // Channel 14
+ NATURE_IO_RAIN_PORT4(63),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+
+ },
+ },
+
+ // natureSeqId: 5
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_09),
+ NATURE_IO_CRITTER_0_BEND_PITCH(64),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(32),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_1_BEND_PITCH(0),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_10),
+ NATURE_IO_CRITTER_2_BEND_PITCH(112),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(48),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_13),
+ NATURE_IO_CRITTER_3_BEND_PITCH(127),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_3_PORT5(63),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_00),
+ NATURE_IO_CRITTER_4_BEND_PITCH(127),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_4_PORT5(16),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_5_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 6
+ {
+ 0xC0FF, // PlayerIO Data
+ 0xC0FE, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_11),
+ NATURE_IO_CRITTER_0_BEND_PITCH(112),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_0_PORT5(48),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_15),
+ NATURE_IO_CRITTER_1_BEND_PITCH(112),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_1_PORT5(63),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_11),
+ NATURE_IO_CRITTER_2_BEND_PITCH(48),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(16),
+
+ // Channel 4
+ NATURE_IO_CRITTER_3_TYPE(NATURE_CRITTER_14),
+ NATURE_IO_CRITTER_3_BEND_PITCH(48),
+ NATURE_IO_CRITTER_3_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_3_PORT5(16),
+
+ // Channel 5
+ NATURE_IO_CRITTER_4_TYPE(NATURE_CRITTER_11),
+ NATURE_IO_CRITTER_4_BEND_PITCH(127),
+ NATURE_IO_CRITTER_4_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_4_PORT5(32),
+
+ // Channel 6
+ NATURE_IO_CRITTER_5_TYPE(NATURE_CRITTER_02),
+ NATURE_IO_CRITTER_5_BEND_PITCH(127),
+ NATURE_IO_CRITTER_5_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_5_PORT5(48),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 7
+ {
+ 0xC001, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 8
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_0_BEND_PITCH(127),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 9
+ {
+ 0xC00F, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_16),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(2),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_12),
+ NATURE_IO_CRITTER_1_BEND_PITCH(112),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(0),
+ NATURE_IO_CRITTER_1_PORT5(48),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_15),
+ NATURE_IO_CRITTER_2_BEND_PITCH(127),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 10
+ {
+ 0xC081, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_1),
+ NATURE_IO_STREAM_0_PORT3(8),
+
+ // Channel 7
+ NATURE_IO_CRITTER_6_TYPE(NATURE_CRITTER_11),
+ NATURE_IO_CRITTER_6_BEND_PITCH(112),
+ NATURE_IO_CRITTER_6_NUM_LAYERS(2),
+ NATURE_IO_CRITTER_6_PORT5(32),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 11
+ {
+ 0xC00F, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_3),
+ NATURE_IO_STREAM_0_PORT3(8),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_0_BEND_PITCH(127),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_00),
+ NATURE_IO_CRITTER_1_BEND_PITCH(127),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(2),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // Channel 3
+ NATURE_IO_CRITTER_2_TYPE(NATURE_CRITTER_06),
+ NATURE_IO_CRITTER_2_BEND_PITCH(127),
+ NATURE_IO_CRITTER_2_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_2_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 12
+ {
+ 0xC007, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_00),
+ NATURE_IO_CRITTER_0_BEND_PITCH(127),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // Channel 2
+ NATURE_IO_CRITTER_1_TYPE(NATURE_CRITTER_01),
+ NATURE_IO_CRITTER_1_BEND_PITCH(127),
+ NATURE_IO_CRITTER_1_NUM_LAYERS(3),
+ NATURE_IO_CRITTER_1_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 13
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 14
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 15
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 16
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 17
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 18
+ {
+ 0xC000, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ // Channel 0
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+ },
+ },
+
+ // natureSeqId: 19
+ {
+ 0xC003, // PlayerIO Data
+ 0xC000, // Channel Mask
+ {
+ NATURE_IO_STREAM_0_TYPE(NATURE_STREAM_0),
+ NATURE_IO_STREAM_0_PORT3(0),
+
+ // Channel 1
+ NATURE_IO_CRITTER_0_TYPE(NATURE_CRITTER_04),
+ NATURE_IO_CRITTER_0_BEND_PITCH(0),
+ NATURE_IO_CRITTER_0_NUM_LAYERS(1),
+ NATURE_IO_CRITTER_0_PORT5(16),
+
+ // End
+ NATURE_IO_ENTRIES_END,
+
+ },
+ },
+};
+
+// AudioOcarina Data
+u8 sIsOcarinaInputEnabled = false;
+s8 sOcarinaInstrumentId = OCARINA_INSTRUMENT_OFF;
+u8 sCurOcarinaPitch = OCARINA_PITCH_NONE;
+u8 sPrevOcarinaPitch = 0;
+u8 sCurOcarinaButtonIdx = 0;
+u8 sMusicStaffPrevPitch = 0;
+f32 sCurOcarinaBendFreq = 1.0f;
+f32 sDefaultOcarinaVolume = 0.68503935f;
+s8 sCurOcarinaBendIdx = 0;
+s8 sCurOcarinaVolume = 0x57;
+s8 sCurOcarinaVibrato = 0;
+u8 sPlaybackState = 0;
+u8 D_801D6FE4 = 0xFF;
+u8 D_801D6FE8 = 0xFF;
+u32 sOcarinaFlags = 0;
+s32 sPlaybackNoteTimer = 0;
+u16 sPlaybackNotePos = 0;
+u16 sPlaybackStaffPos = 0;
+u32 sPrevOcarinaSongFlags = 0; // Stores sOcarinaFlags but never used
+u8 sPlaybackNoteValue = OCARINA_PITCH_NONE;
+u8 sNotePlaybackVolume = 0;
+u8 sNotePlaybackVibrato = 0;
+s8 sNotePlaybackBend = 0;
+f32 sNormalizedNotePlaybackTone = 1.0f;
+f32 sNormalizedNotePlaybackVolume = 1.0f;
+u32 sOcarinaPlaybackTaskStart = 0;
+u32 sOcarinaWallCounter = 0;
+u8 sCurOcarinaSong[8] = {
+ OCARINA_PITCH_C4, OCARINA_PITCH_C4, OCARINA_PITCH_C4, OCARINA_PITCH_C4,
+ OCARINA_PITCH_C4, OCARINA_PITCH_C4, OCARINA_PITCH_C4, OCARINA_PITCH_C4,
+};
+u8 sOcarinaSongAppendPos = 0;
+u8 sOcarinaSongStartingPos = 0;
+
+u8 sButtonToNoteMap[5] = {
+ OCARINA_PITCH_D4, // OCARINA_BTN_A
+ OCARINA_PITCH_F4, // OCARINA_BTN_C_DOWN
+ OCARINA_PITCH_A4, // OCARINA_BTN_C_RIGHT
+ OCARINA_PITCH_B4, // OCARINA_BTN_C_LEFT
+ OCARINA_PITCH_D5, // OCARINA_BTN_C_UP
+};
+
+u8 sOcaMemoryGameAppendPos = 0;
+u8 sOcaMemoryGameEndPos = 0;
+u8 sOcaMemoryGameNumNotes[] = { 5, 6, 8 };
+OcarinaNote sOcarinaSongNotes[OCARINA_SONG_MAX][20] = {
+ // 0: Sonata of Awakening
+ {
+ { OCARINA_PITCH_D5, 19, 92, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 19, 90, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 19, 90, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 38, 90, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 39, 92, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 76, 89, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 77, 82, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 86, 0, 0, 0 },
+ },
+
+ // 1: Goron Lullaby
+ {
+ { OCARINA_PITCH_D4, 41, 80, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 40, 72, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 39, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 42, 76, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 40, 84, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 39, 76, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 41, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 80, 76, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 40, 76, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 2: New Wave Bossa Nova
+ {
+ { OCARINA_PITCH_B4, 64, 74, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 13, 88, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 12, 90, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 78, 88, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 12, 76, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 13, 76, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 114, 76, 6, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 3: Elegy of Emptyness
+ {
+ { OCARINA_PITCH_A4, 85, 93, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 43, 91, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 43, 93, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 21, 88, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 21, 88, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 43, 101, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 85, 95, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 94, 0, 0, 0 },
+ },
+
+ // 4: Oath to Order
+ {
+ { OCARINA_PITCH_A4, 97, 104, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 48, 88, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 49, 78, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 49, 78, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 48, 94, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 97, 100, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 96, 0, 0, 0 },
+
+ },
+
+ // 5: Sarias Song
+ {
+ { 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 6: Song of 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 7: Song of Healing
+ {
+ { OCARINA_PITCH_B4, 32, 88, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 33, 88, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 33, 69, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 32, 94, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 33, 88, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 121, 86, 2, 0, 0 },
+ { OCARINA_PITCH_NONE, 10, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 8: Eponas Song
+ {
+ { 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 9: Song of Soaring
+ {
+ { OCARINA_PITCH_F4, 18, 84, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 18, 80, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 36, 94, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 18, 73, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 18, 76, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 108, 96, 2, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 10: Song of 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 11: Suns Song
+ {
+ { 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 12: Inverted Song of Time
+ {
+ { OCARINA_PITCH_F4, 32, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 65, 88, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 33, 80, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 32, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 65, 88, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 99, 80, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 13: Song of Double Time
+ {
+ { OCARINA_PITCH_A4, 29, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 30, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 29, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 30, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 29, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 84, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 99, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 0, 0, 0, 0 },
+ },
+
+ // 14: Goron Lullaby Intro
+ {
+ { OCARINA_PITCH_D4, 32, 78, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 33, 90, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 33, 87, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 32, 92, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 33, 86, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 130, 80, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 15: Milk Bar Jam "Ballad of the Wind Fish" Human
+ {
+ { OCARINA_PITCH_D5, 89, 80, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 41, 72, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 22, 84, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 91, 76, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 30, 66, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 16: Milk Bar Jam "Ballad of the Wind Fish" Goron
+ {
+ { OCARINA_PITCH_D4, 52, 80, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 8, 72, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 30, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 34, 76, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 52, 80, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 8, 72, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 30, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 66, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 34, 76, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 17: Milk Bar Jam "Ballad of the Wind Fish" Zora
+ {
+ { OCARINA_PITCH_D5, 11, 80, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 11, 72, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 11, 84, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 100, 76, 0, 0, 0 },
+ { OCARINA_PITCH_D5, 11, 84, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 11, 76, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 11, 72, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 100, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 18: Milk Bar Jam "Ballad of the Wind Fish" Deku
+ {
+ { OCARINA_PITCH_A4, 54, 80, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 77, 72, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 19, 84, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 20, 76, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 78, 84, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 19: Evan HP (Zora Band Leader) Song Part 1
+ {
+ { OCARINA_PITCH_A4, 33, 100, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 92, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 37, 104, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 24, 100, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 70, 97, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 96, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 12, 93, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 12, 100, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 12, 62, 0, 0, 0 },
+ { OCARINA_PITCH_D4, 170, 91, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 20: Evan HP (Zora Band Leader) Song Part 2
+ {
+ { OCARINA_PITCH_B4, 33, 107, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 100, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 37, 104, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 24, 97, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 70, 104, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 3, 104, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 12, 90, 0, 0, 0 },
+ { OCARINA_PITCH_A4, 12, 96, 0, 0, 0 },
+ { OCARINA_PITCH_B4, 12, 81, 0, 0, 0 },
+ { OCARINA_PITCH_F4, 170, 66, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 21: Zeldas 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 22: Scarecrow
+ {
+ { OCARINA_PITCH_D4, 3, 0, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 255, 0, 0, 0 },
+ },
+
+ // 23: Termina Field 2D Song Buttons Appearing on Wall (In OoT, this is Ocarina Memory Game)
+ {
+ { OCARINA_PITCH_D4, 3, 0, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 255, 0, 0, 0 },
+ },
+};
+
+OcarinaNote sOoTOcarinaSongNotes[9][20] = {
+ // 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_NONE, 0, 86, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 66, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 94, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 96, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // Zeldas 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_NONE, 0, 90, 0, 0, 0 },
+ },
+
+ // Suns Song
+ {
+ { 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_NONE, 0, 90, 0, 0, 0 },
+ },
+};
+
+u8 sOoTOcarinaSongsNumNotes[] = {
+ 6, // Minuet
+ 8, // Bolero
+ 5, // Serenade
+ 6, // Requiem
+ 7, // Nocturne
+ 6, // Prelude
+ 6, // Sarias
+ 6, // Zeldas Lullaby
+ 6, // Suns Song
+};
+
+OcarinaNote* sPlaybackSong = sOcarinaSongNotes[OCARINA_SONG_SONATA];
+u8 sFrogsSongNotes[14] = {
+ OCARINA_BTN_A, OCARINA_BTN_C_LEFT, OCARINA_BTN_C_RIGHT, OCARINA_BTN_C_DOWN, OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT, OCARINA_BTN_C_DOWN, OCARINA_BTN_A, OCARINA_BTN_C_DOWN, OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN, OCARINA_BTN_C_RIGHT, OCARINA_BTN_C_LEFT, OCARINA_BTN_A,
+};
+u8* gFrogsSongPtr = sFrogsSongNotes;
+u8 sRecordingState = OCARINA_RECORD_OFF;
+u8 sRecordSongPos = 0;
+u32 sOcarinaRecordTaskStart = 0;
+u8 sRecordOcarinaPitch = 0;
+u8 sRecordOcarinaVolume = 0;
+u8 sRecordOcarinaVibrato = 0;
+s8 sRecordOcarinaBendIdx = 0;
+u8 sRecordOcarinaButtonIdx = 0;
+u8 sPlayedOcarinaSongIdxPlusOne = 0;
+u8 sMusicStaffNumNotesPerTest = 0;
+u8 D_801D8530 = false;
+u32 D_801D8534 = 0;
+u8 sIsOcarinaNoteChanged = false;
+
+OcarinaNote sScarecrowsLongSongNotes[108] = {
+ { OCARINA_PITCH_NONE, 0, 0, 0, 0, 0 },
+ { OCARINA_PITCH_NONE, 0, 0, 0, 0, 0 },
+};
+
+OcarinaNote* gScarecrowLongSongPtr = sScarecrowsLongSongNotes;
+u8* gScarecrowSpawnSongPtr = (u8*)&sOcarinaSongNotes[OCARINA_SONG_SCARECROW];
+OcarinaNote* sTerminaWallSongPtr = sOcarinaSongNotes[OCARINA_SONG_TERMINA_WALL];
+
+u8 sNoteToButtonMap[16] = {
+ OCARINA_BTN_A, // OCARINA_PITCH_C4
+ OCARINA_BTN_A, // OCARINA_PITCH_DFLAT4
+ OCARINA_BTN_A, // OCARINA_PITCH_D4
+ OCARINA_BTN_A, // OCARINA_PITCH_EFLAT4
+ OCARINA_BTN_C_DOWN, // OCARINA_PITCH_E4
+ OCARINA_BTN_C_DOWN, // OCARINA_PITCH_F4
+ OCARINA_BTN_C_DOWN, // OCARINA_PITCH_GFLAT4
+ OCARINA_BTN_C_RIGHT, // OCARINA_PITCH_G4
+ OCARINA_BTN_C_RIGHT, // OCARINA_PITCH_AFLAT4
+ OCARINA_BTN_C_RIGHT, // OCARINA_PITCH_A4
+ OCARINA_BTN_C_RIGHT + OCARINA_BTN_C_LEFT, // OCARINA_PITCH_BFLAT4: Interface/Overlap between C_RIGHT and C_LEFT
+ OCARINA_BTN_C_LEFT, // OCARINA_PITCH_B4
+ OCARINA_BTN_C_LEFT, // OCARINA_PITCH_C5
+ OCARINA_BTN_C_UP, // OCARINA_PITCH_DFLAT5
+ OCARINA_BTN_C_UP, // OCARINA_PITCH_D5
+ OCARINA_BTN_C_UP, // OCARINA_PITCH_EFLAT5
+};
+
+// seqData written in the music macro language
+// Only used in unused functions
+u8 sCustomSequenceScript[400] = {
+ 0xFE, 0xFE, 0xD3, 0x20, 0xD7, 0x00, 0x01, 0xCC, 0x00, 0x70, 0x90, 0x00, 0x16, 0xDB, 0x64, 0xDD, 0x78,
+ 0xFE, 0x00, 0xF3, 0xFC, 0xFF, 0xC3, 0x88, 0x00, 0x29, 0x89, 0x00, 0x2B, 0xDF, 0x7F, 0xE9, 0x0F, 0xDD,
+ 0x37, 0xD4, 0x40, 0xC1, 0x52, 0xFE, 0x80, 0xF3, 0xFC, 0xFF, 0xC2, 0xFB, 0xC0, 0x00, 0xC1, 0x57, 0xC9,
+};
+
+OcarinaSongButtons gOcarinaSongButtons[OCARINA_SONG_MAX] = {
+ // 0: Sonata of Awakening
+ {
+ 7,
+ {
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ },
+ },
+
+ // 1: Goron Lullaby
+ {
+ 8,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ },
+ },
+
+ // 2: New Wave Bossa Nova
+ {
+ 7,
+ {
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 3: Elegy of Emptyness
+ {
+ 7,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ },
+ },
+
+ // 4: Oath to Order
+ {
+ 6,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_UP,
+ },
+ },
+
+ // 5; Sarias Song
+ {
+ 6,
+ {
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ },
+ },
+
+ // 6: Song of Time
+ {
+ 6,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+
+ // 7: Song of Healing
+ {
+ 6,
+ {
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+
+ // 8: Eponas Song
+ {
+ 6,
+ {
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 9: Song of Soaring
+ {
+ 6,
+ {
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ },
+ },
+
+ // 10: Song of Storms
+ {
+ 6,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_UP,
+ },
+ },
+
+ // 11: Suns Song
+ {
+ 6,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_UP,
+ },
+ },
+
+ // 12: Inverted Song of Time
+ {
+ 6,
+ {
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 13; Song of Double Time
+ {
+ 6,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+
+ // 14: Goron Lullaby Intro
+ {
+ 6,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ },
+ },
+
+ // 15: Milk Bar Jam "Ballad of the Wind Fish" Human
+ {
+ 4,
+ {
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 16: Milk Bar Jam "Ballad of the Wind Fish" Goron
+ {
+ 8,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 17: Milk Bar Jam "Ballad of the Wind Fish" Zora
+ {
+ 8,
+ {
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+
+ // 18: Milk Bar Jam "Ballad of the Wind Fish" Deku
+ {
+ 5,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 19: Evan HP (Zora Band Leader) Song Part 1
+ {
+ 8,
+ {
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_A,
+ },
+ },
+
+ // 20: Evan HP (Zora Band Leader) Song Part 2
+ {
+ 8,
+ {
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+
+ // 21: Zeldas Lullaby
+ {
+ 6,
+ {
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_RIGHT,
+ },
+ },
+
+ // 22: Scarecrow
+ {
+ 8,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ OCARINA_BTN_A,
+ },
+ },
+
+ // 23: Termina Field 2D Song Buttons Appearing on Wall (In OoT, this is Ocarina Memory Game)
+ {
+ 8,
+ {
+ OCARINA_BTN_A,
+ OCARINA_BTN_C_DOWN,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_UP,
+ OCARINA_BTN_C_LEFT,
+ OCARINA_BTN_C_RIGHT,
+ OCARINA_BTN_C_DOWN,
+ },
+ },
+};
+
+// Static In-Function Data
+u8 sScarecrowAfterCreditsState = 0;
+u8 sScarecrowAfterCreditsIntrumentId = OCARINA_INSTRUMENT_DEFAULT;
+u16 sScarecrowAfterCreditsTimer = 1200;
+u8 sRequestCustomSequence = false;
+s8 D_801D8B30[] = {
+ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64,
+ 64, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127,
+};
+f32 sBigBellsVolume[8] = {
+ 1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f,
+};
+u8 sBgmPlayers[2] = { SEQ_PLAYER_BGM_MAIN, SEQ_PLAYER_BGM_SUB };
+f32 sSfxOriginalPos[] = { 0.0f, 0.0f, 0.0f };
+
+// OoT's soundEffects from EnRiverSound
+const u16 gAudioEnvironmentalSfx[] = {
+ NA_SE_EV_RIVER_STREAM - SFX_FLAG, NA_SE_EV_WAVE - SFX_FLAG,
+ NA_SE_EV_WATER_WALL_BIG - SFX_FLAG, NA_SE_EV_WATER_WALL - SFX_FLAG,
+ NA_SE_EV_MAGMA_LEVEL - SFX_FLAG, NA_SE_EV_MAGMA_LEVEL_M - SFX_FLAG,
+ NA_SE_EV_MAGMA_LEVEL_L - SFX_FLAG, NA_SE_EV_TORCH - SFX_FLAG,
+ NA_SE_EV_FOUNTAIN - SFX_FLAG, NA_SE_EV_DRAIN - SFX_FLAG,
+ NA_SE_EV_CROWD - SFX_FLAG, NA_SE_EV_WATER_CONVECTION - SFX_FLAG,
+ NA_SE_EV_GORON_CHEER - SFX_FLAG, NA_SE_EV_WATER_WALL_BIG_SILENT - SFX_FLAG,
+ NA_SE_EV_WATER_BUBBLE - SFX_FLAG, NA_SE_EV_COW_CRY_LV - SFX_FLAG,
+ NA_SE_EV_MAKE_TURRET - SFX_FLAG, NA_SE_EV_BOILED_WATER_S - SFX_FLAG,
+ NA_SE_EV_BOILED_WATER_L - SFX_FLAG, NA_SE_EV_WAVE_S - SFX_FLAG,
+ NA_SE_EV_WAVE_S - SFX_FLAG, NA_SE_EV_WAVE_S - SFX_FLAG,
+};
+
+/**
+const u8 sIsOcarinaSongReserved[OCARINA_SONG_MAX] = {
+ true, // OCARINA_SONG_SONATA
+ true, // OCARINA_SONG_GORON_LULLABY
+ true, // OCARINA_SONG_NEW_WAVE
+ true, // OCARINA_SONG_ELEGY
+ true, // OCARINA_SONG_OATH
+ false, // OCARINA_SONG_SARIAS
+ true, // OCARINA_SONG_TIME
+ true, // OCARINA_SONG_HEALING
+ true, // OCARINA_SONG_EPONAS
+ true, // OCARINA_SONG_SOARING
+ true, // OCARINA_SONG_STORMS
+ false, // OCARINA_SONG_SUNS
+ true, // OCARINA_SONG_INVERTED_TIME
+ true, // OCARINA_SONG_DOUBLE_TIME
+ true, // OCARINA_SONG_GORON_LULLABY_INTRO
+ false, // OCARINA_SONG_WIND_FISH_HUMAN
+ false, // OCARINA_SONG_WIND_FISH_GORON
+ false, // OCARINA_SONG_WIND_FISH_ZORA
+ false, // OCARINA_SONG_WIND_FISH_DEKU
+ true, // OCARINA_SONG_EVAN_PART1
+ true, // OCARINA_SONG_EVAN_PART2
+ false, // OCARINA_SONG_ZELDAS_LULLABY
+ true, // OCARINA_SONG_SCARECROW
+ false, // OCARINA_SONG_TERMINA_WALL
+};
+*/
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_8019AF00.s")
@@ -56,7 +1932,14 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_8019C8D8.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/D_801E0C14.s")
+const char sAudioOcarinaUnusedText0[] = "key step is too long !!! %d:%d>%d\n";
+const char sAudioOcarinaUnusedText1[] = "You played %d Melody !!! (last step:%d)\n";
+const char sAudioOcarinaUnusedText2[] = "pass 0\n";
+const char sAudioOcarinaUnusedText3[] = "pass 1\n";
+const char sAudioOcarinaUnusedText4[] = "pass 2\n";
+const char sAudioOcarinaUnusedText5[] = "last key is bad !!! %d %d %02X %02X\n";
+const char sAudioOcarinaUnusedText6[] = "last key step is too short !!! %d:%d %d<%d\n";
+const char sAudioOcarinaUnusedText7[] = "check is over!!! %d %d %d\n";
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_8019CD08.s")
@@ -350,7 +2233,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_801A3EC0.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_801A3F54.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/Audio_SetCutsceneFlag.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/code_8019AF00/func_801A3F6C.s")
diff --git a/src/code/code_8012EC80.c b/src/code/code_8012EC80.c
index 34ad973f6d..c65697483d 100644
--- a/src/code/code_8012EC80.c
+++ b/src/code/code_8012EC80.c
@@ -1,6 +1,7 @@
#include "global.h"
+#include "interface/parameter_static/parameter_static.h"
-// Bit Flag array in which gBitFlags[n] is literally (1 << n)
+// Bit Flag array in which gBitFlags[n] is (1 << n)
u32 gBitFlags[] = {
(1 << 0), (1 << 1), (1 << 2), (1 << 3), (1 << 4), (1 << 5), (1 << 6), (1 << 7),
(1 << 8), (1 << 9), (1 << 10), (1 << 11), (1 << 12), (1 << 13), (1 << 14), (1 << 15),
@@ -8,164 +9,225 @@ u32 gBitFlags[] = {
(1 << 24), (1 << 25), (1 << 26), (1 << 27), (1 << 28), (1 << 29), (1 << 30), (1 << 31),
};
-u16 gEquipMasks[] = { 0x000F, 0x00F0, 0x0F00, 0xF000 };
-u16 gEquipNegMasks[] = { 0xFFF0, 0xFF0F, 0xF0FF, 0x0FFF };
+// four-bit masks
+u16 gEquipMasks[] = {
+ 0xF << 0, // Sword
+ 0xF << 4, // Shield
+ 0xF << 8, // Unused (Tunic)
+ 0xF << 12, // Unused (Boots)
+};
+
+// four-bit masks
+u16 gEquipNegMasks[] = {
+ ~(0xF << 0), // Sword
+ ~(0xF << 4), // Shield
+ ~(0xF << 8), // Unused (Tunic)
+ (u16) ~(0xF << 12), // Unused (Boots)
+};
+
+// 3 = two bit masks
+// 7 = three bit masks
u32 gUpgradeMasks[] = {
- 0x00000007, 0x00000038, 0x000001C0, 0x00000E00, 0x00003000, 0x0001C000, 0x000E0000, 0x00700000,
+ 7 << 0, // Quivers
+ 7 << 3, // Bomb Bags
+ 7 << 6, // Unused (Strength)
+ 7 << 9, // Unused (Scale)
+ 3 << 12, // Wallets
+ 7 << 14, // Unused (Deku Seed Bullet Bags)
+ 7 << 17, // Unused (Deku Stick)
+ 7 << 20, // Unused (Deku Nut)
};
+
+// 3 = two-bit masks
+// 7 = three-bit masks
u32 gUpgradeNegMasks[] = {
- 0xFFFFFFF8, 0xFFFFFFC7, 0xFFFFFE3F, 0xFFFFF1FF, 0xFFFFCFFF, 0xFFFE3FFF, 0xFFF1FFFF, 0xFF8FFFFF,
+ ~(7 << 0), // Quivers
+ ~(7 << 3), // Bomb Bags
+ ~(7 << 6), // Unused (Strength)
+ ~(7 << 9), // Unused (Scale)
+ ~(3 << 12), // Wallets
+ ~(7 << 14), // Unused (Deku Seed Bullet Bags)
+ ~(7 << 17), // Unused (Deku Stick)
+ ~(7 << 20), // Unused (Deku Nut)
+};
+
+u8 gEquipShifts[] = {
+ 0, // Sword
+ 4, // Shield
+ 8, // Unused (Tunic)
+ 12, // Unused (Boots)
+};
+
+u8 gUpgradeShifts[] = {
+ 0, // Quivers
+ 3, // Bomb Bags
+ 6, // Unused (Strength)
+ 9, // Unused (Scale)
+ 12, // Wallets
+ 14, // Unused (Deku Seed Bullet Bags)
+ 17, // Unused (Deku Stick)
+ 20, // Unused (Deku Nut)
};
-u8 gEquipShifts[] = { 0, 4, 8, 12 };
-u8 gUpgradeShifts[] = { 0, 3, 6, 9, 12, 14, 17, 20 };
u16 gUpgradeCapacities[][4] = {
{ 0, 30, 40, 50 }, // Quivers
{ 0, 20, 30, 40 }, // Bomb Bags
- { 0, 0, 0, 0 }, // Unused (Scale)
{ 0, 0, 0, 0 }, // Unused (Strength)
+ { 0, 0, 0, 0 }, // Unused (Scale)
{ 99, 200, 500, 500 }, // Wallets
{ 0, 30, 40, 50 }, // Unused (Deku Seed Bullet Bags)
{ 0, 10, 20, 30 }, // Unused (Deku Stick)
{ 0, 20, 30, 40 }, // Unused (Deku Nut)
};
-u32 gGsFlagsMask[] = { 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000 };
-u32 gGsFlagsShift[] = { 0, 8, 16, 24 };
+// eight-bit masks
+u32 gGsFlagsMask[] = {
+ 0xFF << 0,
+ 0xFF << 8,
+ 0xFF << 16,
+ 0xFF << 24,
+};
+
+u32 gGsFlagsShift[] = {
+ 0,
+ 8,
+ 16,
+ 24,
+};
// TODO: use symbols for these icon textures once textures are properly in C
void* gItemIcons[] = {
- 0x08000000, // ITEM_OCARINA
- 0x08001000, // ITEM_BOW
- 0x08002000, // ITEM_ARROW_FIRE
- 0x08003000, // ITEM_ARROW_ICE
- 0x08004000, // ITEM_ARROW_LIGHT
- 0x08005000, // ITEM_OCARINA_FAIRY
- 0x08006000, // ITEM_BOMB
- 0x08007000, // ITEM_BOMBCHU
- 0x08008000, // ITEM_STICK
- 0x08009000, // ITEM_NUT
- 0x0800A000, // ITEM_MAGIC_BEANS
- 0x0800B000, // ITEM_SLINGSHOT
- 0x0800C000, // ITEM_POWDER_KEG
- 0x0800D000, // ITEM_PICTO_BOX
- 0x0800E000, // ITEM_LENS
- 0x0800F000, // ITEM_HOOKSHOT
- 0x08010000, // ITEM_SWORD_GREAT_FAIRY
- 0x08011000, // ITEM_LONGSHOT
- 0x08012000, // ITEM_BOTTLE
- 0x08013000, // ITEM_POTION_RED
- 0x08014000, // ITEM_POTION_GREEN
- 0x08015000, // ITEM_POTION_BLUE
- 0x08016000, // ITEM_FAIRY
- 0x08017000, // ITEM_DEKU_PRINCESS
- 0x08018000, // ITEM_MILK_BOTTLE
- 0x08019000, // ITEM_MILK_HALF
- 0x0801A000, // ITEM_FISH
- 0x0801B000, // ITEM_BUG
- 0x0801C000, // ITEM_BLUE_FIRE
- 0x0801D000, // ITEM_POE
- 0x0801E000, // ITEM_BIG_POE
- 0x0801F000, // ITEM_SPRING_WATER
- 0x08020000, // ITEM_HOT_SPRING_WATER
- 0x08021000, // ITEM_ZORA_EGG
- 0x08022000, // ITEM_GOLD_DUST
- 0x08023000, // ITEM_MUSHROOM
- 0x08024000, // ITEM_SEA_HORSE
- 0x08025000, // ITEM_CHATEAU
- 0x08026000, // ITEM_HYLIAN_LOACH
- 0x08027000, // ITEM_OBABA_DRINK
- 0x08028000, // ITEM_MOON_TEAR
- 0x08029000, // ITEM_DEED_LAND
- 0x0802A000, // ITEM_DEED_SWAMP
- 0x0802B000, // ITEM_DEED_MOUNTAIN
- 0x0802C000, // ITEM_DEED_OCEAN
- 0x0802D000, // ITEM_ROOM_KEY
- 0x0802E000, // ITEM_LETTER_MAMA
- 0x0802F000, // ITEM_LETTER_TO_KAFEI
- 0x08030000, // ITEM_PENDANT_MEMORIES
- 0x08031000, // ITEM_TINGLE_MAP
- 0x08032000, // ITEM_MASK_DEKU
- 0x08033000, // ITEM_MASK_GORON
- 0x08034000, // ITEM_MASK_ZORA
- 0x08035000, // ITEM_MASK_FIERCE_DEITY
- 0x08036000, // ITEM_MASK_TRUTH
- 0x08037000, // ITEM_MASK_KAFEIS_MASK
- 0x08038000, // ITEM_MASK_ALL_NIGHT
- 0x08039000, // ITEM_MASK_BUNNY
- 0x0803A000, // ITEM_MASK_KEATON
- 0x0803B000, // ITEM_MASK_GARO
- 0x0803C000, // ITEM_MASK_ROMANI
- 0x0803D000, // ITEM_MASK_CIRCUS_LEADER
- 0x0803E000, // ITEM_MASK_POSTMAN
- 0x0803F000, // ITEM_MASK_COUPLE
- 0x08040000, // ITEM_MASK_GREAT_FAIRY
- 0x08041000, // ITEM_MASK_GIBDO
- 0x08042000, // ITEM_MASK_DON_GERO
- 0x08043000, // ITEM_MASK_KAMARO
- 0x08044000, // ITEM_MASK_CAPTAIN
- 0x08045000, // ITEM_MASK_STONE
- 0x08046000, // ITEM_MASK_BREMEN
- 0x08047000, // ITEM_MASK_BLAST
- 0x08048000, // ITEM_MASK_SCENTS
- 0x08049000, // ITEM_MASK_GIANT
- 0x0804A000, // ITEM_BOW_ARROW_FIRE
- 0x0804B000, // ITEM_BOW_ARROW_ICE
- 0x0804C000, // ITEM_BOW_ARROW_LIGHT
- 0x0804D000, // ITEM_SWORD_KOKIRI
- 0x0804E000, // ITEM_SWORD_RAZOR
- 0x0804F000, // ITEM_SWORD_GILDED
- 0x08050000, // ITEM_SWORD_DEITY
- 0x08051000, // ITEM_SHIELD_HERO
- 0x08052000, // ITEM_SHIELD_MIRROR
- 0x08053000, // ITEM_QUIVER_30
- 0x08054000, // ITEM_QUIVER_40
- 0x08055000, // ITEM_QUIVER_50
- 0x08056000, // ITEM_BOMB_BAG_20
- 0x08057000, // ITEM_BOMB_BAG_30
- 0x08058000, // ITEM_BOMB_BAG_40
- 0x08059000, // ITEM_WALLET_DEFAULT
- 0x0805A000, // ITEM_WALLET_ADULT
- 0x0805B000, // ITEM_WALLET_GIANT
- 0x0805C000, // ITEM_FISHING_POLE
- 0x0805D000, // ITEM_REMAINS_ODOLWA
- 0x0805E000, // ITEM_REMAINS_GOHT
- 0x0805F000, // ITEM_REMAINS_GYORG
- 0x08060000, // ITEM_REMAINS_TWINMOLD
- 0x08062000, // ITEM_SONG_SONATA
- 0x08062000, // ITEM_SONG_LULLABY
- 0x08062000, // ITEM_SONG_NOVA
- 0x08062000, // ITEM_SONG_ELEGY
- 0x08062000, // ITEM_SONG_OATH
- 0x08062000, // ITEM_SONG_SARIA
- 0x08062000, // ITEM_SONG_TIME
- 0x08062000, // ITEM_SONG_HEALING
- 0x08062000, // ITEM_SONG_EPONA
- 0x08062000, // ITEM_SONG_SOARING
- 0x08062000, // ITEM_SONG_STORMS
- 0x08062000, // ITEM_SONG_SUN
- 0x08061000, // ITEM_BOMBERS_NOTEBOOK
- 0x09000000, // ITEM_SKULL_TOKEN
- 0x09000900, // ITEM_HEART_CONTAINER
- 0x09001200, // ITEM_HEART_PIECE
- 0x08062000, //
- 0x08062000, //
- 0x08062000, // ITEM_SONG_LULLABY_INTRO
- 0x09003600, // ITEM_KEY_BOSS
- 0x09004800, // ITEM_COMPASS
- 0x09003F00, // ITEM_DUNGEON_MAP
- 0x09005100, // ITEM_STRAY_FAIRIES
- 0x09005A00, // ITEM_KEY_SMALL
- 0x09006300, // ITEM_MAGIC_SMALL
- 0x09006C00, // ITEM_MAGIC_LARGE
- 0x08062180, // ITEM_HEART_PIECE_2
- 0x08062A80, // ITEM_INVALID_1
- 0x08063380, // ITEM_INVALID_2
- 0x020028A0, // ITEM_INVALID_3
- 0x020025A0, // ITEM_INVALID_4
- 0x020027A0, // ITEM_INVALID_5
- 0x020026A0, // ITEM_INVALID_6
- 0x020024A0, // ITEM_INVALID_7
+ 0x08000000, // ITEM_OCARINA
+ 0x08001000, // ITEM_BOW
+ 0x08002000, // ITEM_ARROW_FIRE
+ 0x08003000, // ITEM_ARROW_ICE
+ 0x08004000, // ITEM_ARROW_LIGHT
+ 0x08005000, // ITEM_OCARINA_FAIRY
+ 0x08006000, // ITEM_BOMB
+ 0x08007000, // ITEM_BOMBCHU
+ 0x08008000, // ITEM_STICK
+ 0x08009000, // ITEM_NUT
+ 0x0800A000, // ITEM_MAGIC_BEANS
+ 0x0800B000, // ITEM_SLINGSHOT
+ 0x0800C000, // ITEM_POWDER_KEG
+ 0x0800D000, // ITEM_PICTO_BOX
+ 0x0800E000, // ITEM_LENS
+ 0x0800F000, // ITEM_HOOKSHOT
+ 0x08010000, // ITEM_SWORD_GREAT_FAIRY
+ 0x08011000, // ITEM_LONGSHOT
+ 0x08012000, // ITEM_BOTTLE
+ 0x08013000, // ITEM_POTION_RED
+ 0x08014000, // ITEM_POTION_GREEN
+ 0x08015000, // ITEM_POTION_BLUE
+ 0x08016000, // ITEM_FAIRY
+ 0x08017000, // ITEM_DEKU_PRINCESS
+ 0x08018000, // ITEM_MILK_BOTTLE
+ 0x08019000, // ITEM_MILK_HALF
+ 0x0801A000, // ITEM_FISH
+ 0x0801B000, // ITEM_BUG
+ 0x0801C000, // ITEM_BLUE_FIRE
+ 0x0801D000, // ITEM_POE
+ 0x0801E000, // ITEM_BIG_POE
+ 0x0801F000, // ITEM_SPRING_WATER
+ 0x08020000, // ITEM_HOT_SPRING_WATER
+ 0x08021000, // ITEM_ZORA_EGG
+ 0x08022000, // ITEM_GOLD_DUST
+ 0x08023000, // ITEM_MUSHROOM
+ 0x08024000, // ITEM_SEA_HORSE
+ 0x08025000, // ITEM_CHATEAU
+ 0x08026000, // ITEM_HYLIAN_LOACH
+ 0x08027000, // ITEM_OBABA_DRINK
+ 0x08028000, // ITEM_MOON_TEAR
+ 0x08029000, // ITEM_DEED_LAND
+ 0x0802A000, // ITEM_DEED_SWAMP
+ 0x0802B000, // ITEM_DEED_MOUNTAIN
+ 0x0802C000, // ITEM_DEED_OCEAN
+ 0x0802D000, // ITEM_ROOM_KEY
+ 0x0802E000, // ITEM_LETTER_MAMA
+ 0x0802F000, // ITEM_LETTER_TO_KAFEI
+ 0x08030000, // ITEM_PENDANT_MEMORIES
+ 0x08031000, // ITEM_TINGLE_MAP
+ 0x08032000, // ITEM_MASK_DEKU
+ 0x08033000, // ITEM_MASK_GORON
+ 0x08034000, // ITEM_MASK_ZORA
+ 0x08035000, // ITEM_MASK_FIERCE_DEITY
+ 0x08036000, // ITEM_MASK_TRUTH
+ 0x08037000, // ITEM_MASK_KAFEIS_MASK
+ 0x08038000, // ITEM_MASK_ALL_NIGHT
+ 0x08039000, // ITEM_MASK_BUNNY
+ 0x0803A000, // ITEM_MASK_KEATON
+ 0x0803B000, // ITEM_MASK_GARO
+ 0x0803C000, // ITEM_MASK_ROMANI
+ 0x0803D000, // ITEM_MASK_CIRCUS_LEADER
+ 0x0803E000, // ITEM_MASK_POSTMAN
+ 0x0803F000, // ITEM_MASK_COUPLE
+ 0x08040000, // ITEM_MASK_GREAT_FAIRY
+ 0x08041000, // ITEM_MASK_GIBDO
+ 0x08042000, // ITEM_MASK_DON_GERO
+ 0x08043000, // ITEM_MASK_KAMARO
+ 0x08044000, // ITEM_MASK_CAPTAIN
+ 0x08045000, // ITEM_MASK_STONE
+ 0x08046000, // ITEM_MASK_BREMEN
+ 0x08047000, // ITEM_MASK_BLAST
+ 0x08048000, // ITEM_MASK_SCENTS
+ 0x08049000, // ITEM_MASK_GIANT
+ 0x0804A000, // ITEM_BOW_ARROW_FIRE
+ 0x0804B000, // ITEM_BOW_ARROW_ICE
+ 0x0804C000, // ITEM_BOW_ARROW_LIGHT
+ 0x0804D000, // ITEM_SWORD_KOKIRI
+ 0x0804E000, // ITEM_SWORD_RAZOR
+ 0x0804F000, // ITEM_SWORD_GILDED
+ 0x08050000, // ITEM_SWORD_DEITY
+ 0x08051000, // ITEM_SHIELD_HERO
+ 0x08052000, // ITEM_SHIELD_MIRROR
+ 0x08053000, // ITEM_QUIVER_30
+ 0x08054000, // ITEM_QUIVER_40
+ 0x08055000, // ITEM_QUIVER_50
+ 0x08056000, // ITEM_BOMB_BAG_20
+ 0x08057000, // ITEM_BOMB_BAG_30
+ 0x08058000, // ITEM_BOMB_BAG_40
+ 0x08059000, // ITEM_WALLET_DEFAULT
+ 0x0805A000, // ITEM_WALLET_ADULT
+ 0x0805B000, // ITEM_WALLET_GIANT
+ 0x0805C000, // ITEM_FISHING_POLE
+ 0x0805D000, // ITEM_REMAINS_ODOLWA
+ 0x0805E000, // ITEM_REMAINS_GOHT
+ 0x0805F000, // ITEM_REMAINS_GYORG
+ 0x08060000, // ITEM_REMAINS_TWINMOLD
+ 0x08062000, // ITEM_SONG_SONATA
+ 0x08062000, // ITEM_SONG_LULLABY
+ 0x08062000, // ITEM_SONG_NOVA
+ 0x08062000, // ITEM_SONG_ELEGY
+ 0x08062000, // ITEM_SONG_OATH
+ 0x08062000, // ITEM_SONG_SARIA
+ 0x08062000, // ITEM_SONG_TIME
+ 0x08062000, // ITEM_SONG_HEALING
+ 0x08062000, // ITEM_SONG_EPONA
+ 0x08062000, // ITEM_SONG_SOARING
+ 0x08062000, // ITEM_SONG_STORMS
+ 0x08062000, // ITEM_SONG_SUN
+ 0x08061000, // ITEM_BOMBERS_NOTEBOOK
+ 0x09000000, // ITEM_SKULL_TOKEN
+ 0x09000900, // ITEM_HEART_CONTAINER
+ 0x09001200, // ITEM_HEART_PIECE
+ 0x08062000, //
+ 0x08062000, //
+ 0x08062000, // ITEM_SONG_LULLABY_INTRO
+ 0x09003600, // ITEM_KEY_BOSS
+ 0x09004800, // ITEM_COMPASS
+ 0x09003F00, // ITEM_DUNGEON_MAP
+ 0x09005100, // ITEM_STRAY_FAIRIES
+ 0x09005A00, // ITEM_KEY_SMALL
+ 0x09006300, // ITEM_MAGIC_SMALL
+ 0x09006C00, // ITEM_MAGIC_LARGE
+ 0x08062180, // ITEM_HEART_PIECE_2
+ 0x08062A80, // ITEM_INVALID_1
+ 0x08063380, // ITEM_INVALID_2
+ gOcarinaCUpTex, // ITEM_INVALID_3
+ gOcarinaCDownTex, // ITEM_INVALID_4
+ gOcarinaCLeftTex, // ITEM_INVALID_5
+ gOcarinaCRightTex, // ITEM_INVALID_6
+ gOcarinaATex, // ITEM_INVALID_7
};
// Used to map item IDs to inventory slots
@@ -412,7 +474,7 @@ u16 gScenesPerRegion[11][27] = {
},
};
-s32 func_8012EC80(GlobalContext* globalCtx) {
+s32 Inventory_GetBtnBItem(GlobalContext* globalCtx) {
if (gSaveContext.buttonStatus[0] == BTN_DISABLED) {
return ITEM_NONE;
} else if (gSaveContext.unk_1015 == ITEM_NONE) {
@@ -429,129 +491,237 @@ s32 func_8012EC80(GlobalContext* globalCtx) {
}
}
-void func_8012ED34(s16 equipment);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012ED34.s")
+/**
+ * Only changes shield
+ */
+void Inventory_ChangeEquipment(s16 value) {
+ SET_EQUIP_VALUE(EQUIP_SHIELD, value);
+}
-u8 func_8012ED78(GlobalContext* globalCtx, s16 equipment);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012ED78.s")
+/**
+ * Only deletes shield, equipment argument unused and is a remnant of OoT
+ */
+u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
+ Player* player = GET_PLAYER(globalCtx);
-void func_8012EDE8(s16 arg0, u32 arg1);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012EDE8.s")
+ if (CUR_EQUIP_VALUE_VOID(EQUIP_SHIELD) != 0) {
+ SET_EQUIP_VALUE(EQUIP_SHIELD, 0);
+ Player_SetEquipmentData(globalCtx, player);
+ return true;
+ }
-s32 func_8012EE34(s16 arg0) {
- s16 num = 0;
+ return false;
+}
- if (arg0 >= 0x20) {
- if (arg0 < 0x40) {
- num = 1;
- } else if (arg0 < 0x60) {
- num = 2;
- } else if (arg0 < 0x80) {
- num = 3;
- } else if (arg0 < 0xA0) {
- num = 4;
- } else if (arg0 < 0xC0) {
- num = 5;
- } else if (arg0 < 0xE0) {
- num = 6;
+void Inventory_ChangeUpgrade(s16 upgrade, u32 value) {
+ u32 upgrades = gSaveContext.inventory.upgrades;
+
+ upgrades &= gUpgradeNegMasks[upgrade];
+ upgrades |= value << gUpgradeShifts[upgrade];
+
+ gSaveContext.inventory.upgrades = upgrades;
+}
+
+s32 Inventory_IsMapVisible(s16 sceneNum) {
+ s16 index = 0;
+
+ /**
+ * a single index of scenesVisible can only hold 32 bits. So for every 32 scenes in the scene enum,
+ * increment to the next index of scenesVisible so that every scene gets a unique flag in scenesVisible,
+ * 224 bits were allocated to this although there are only 112 scenes
+ */
+ if (sceneNum >= 0x20) {
+ if (sceneNum < 0x40) {
+ index = 1;
+ } else if (sceneNum < 0x60) {
+ index = 2;
+ } else if (sceneNum < 0x80) {
+ index = 3;
+ } else if (sceneNum < 0xA0) {
+ index = 4;
+ } else if (sceneNum < 0xC0) {
+ index = 5;
+ } else if (sceneNum < 0xE0) {
+ index = 6;
}
}
- if (gSaveContext.roomInf[125][num] & gBitFlags[arg0 - (num << 5)]) {
- return 1;
+ if (gSaveContext.scenesVisible[index] & gBitFlags[sceneNum - (index << 5)]) {
+ return true;
}
- return 0;
+ return false;
}
-static u16 D_801C2380[6][12] = {
- { SCENE_00KEIKOKU, SCENE_BOTI, SCENE_13HUBUKINOMITI, SCENE_24KEMONOMITI, SCENE_IKANAMAE, SCENE_TOWN, SCENE_ICHIBA,
- SCENE_BACKTOWN, SCENE_CLOCKTOWER, SCENE_ALLEY, -1 },
- { SCENE_20SICHITAI, SCENE_20SICHITAI2, SCENE_21MITURINMAE, SCENE_22DEKUCITY, SCENE_DEKU_KING, SCENE_KINSTA1, -1 },
- { SCENE_10YUKIYAMANOMURA, SCENE_10YUKIYAMANOMURA2, SCENE_11GORONNOSATO, SCENE_11GORONNOSATO2, SCENE_16GORON_HOUSE,
- SCENE_12HAKUGINMAE, SCENE_14YUKIDAMANOMITI, SCENE_GORONRACE, SCENE_17SETUGEN, SCENE_17SETUGEN2, -1 },
- { SCENE_F01, SCENE_ROMANYMAE, SCENE_OMOYA, SCENE_F01C, SCENE_F01_B, SCENE_KOEPONARACE, -1 },
- { SCENE_30GYOSON, SCENE_SINKAI, SCENE_31MISAKI, SCENE_TORIDE, SCENE_KAIZOKU, SCENE_33ZORACITY, SCENE_35TAKI, -1 },
- { SCENE_F40, SCENE_F41, SCENE_CASTLE, SCENE_IKANA, SCENE_REDEAD, -1 },
+static u16 sScenesPerTingleMap[6][12] = {
+ {
+ // Clock Town Tingle Map
+ SCENE_00KEIKOKU,
+ SCENE_BOTI,
+ SCENE_13HUBUKINOMITI,
+ SCENE_24KEMONOMITI,
+ SCENE_IKANAMAE,
+ SCENE_TOWN,
+ SCENE_ICHIBA,
+ SCENE_BACKTOWN,
+ SCENE_CLOCKTOWER,
+ SCENE_ALLEY,
+ -1,
+ },
+ {
+ // Woodfall Tingle Map
+ SCENE_20SICHITAI,
+ SCENE_20SICHITAI2,
+ SCENE_21MITURINMAE,
+ SCENE_22DEKUCITY,
+ SCENE_DEKU_KING,
+ SCENE_KINSTA1,
+ -1,
+ },
+ {
+ // Snowhead Tingle Map
+ SCENE_10YUKIYAMANOMURA,
+ SCENE_10YUKIYAMANOMURA2,
+ SCENE_11GORONNOSATO,
+ SCENE_11GORONNOSATO2,
+ SCENE_16GORON_HOUSE,
+ SCENE_12HAKUGINMAE,
+ SCENE_14YUKIDAMANOMITI,
+ SCENE_GORONRACE,
+ SCENE_17SETUGEN,
+ SCENE_17SETUGEN2,
+ -1,
+ },
+ {
+ // Romani Ranch Tingle Map
+ SCENE_F01,
+ SCENE_ROMANYMAE,
+ SCENE_OMOYA,
+ SCENE_F01C,
+ SCENE_F01_B,
+ SCENE_KOEPONARACE,
+ -1,
+ },
+ {
+ // Great Bay Tingle Map
+ SCENE_30GYOSON,
+ SCENE_SINKAI,
+ SCENE_31MISAKI,
+ SCENE_TORIDE,
+ SCENE_KAIZOKU,
+ SCENE_33ZORACITY,
+ SCENE_35TAKI,
+ -1,
+ },
+ {
+ // Stone Tower Tingle Map
+ SCENE_F40,
+ SCENE_F41,
+ SCENE_CASTLE,
+ SCENE_IKANA,
+ SCENE_REDEAD,
+ -1,
+ },
};
-void func_8012EF0C(s16 arg0) {
- s16 phi_v0 = 0;
- s16 phi_v1 = 0;
- u16(*new_var)[] = &D_801C2380[arg0];
+/**
+ * Map visibility is achieved by purchasing a tingle map
+ */
+void Inventory_SetMapVisibility(s16 tingleIndex) {
+ s16 i = 0;
+ s16 index = 0;
+ u16(*tingleMapSceneIndices)[] = &sScenesPerTingleMap[tingleIndex];
- if ((arg0 >= 0) && (arg0 < 6)) {
+ if ((tingleIndex >= 0) && (tingleIndex < 6)) {
while (true) {
- if ((*new_var)[phi_v0] == 0xFFFF) {
+ if ((*tingleMapSceneIndices)[i] == 0xFFFF) {
break;
}
- if (((s16)(*new_var)[phi_v0]) < 0x20) {
- phi_v1 = 0;
- } else if (((s16)(*new_var)[phi_v0]) < 0x40) {
- phi_v1 = 1;
- } else if (((s16)(*new_var)[phi_v0]) < 0x60) {
- phi_v1 = 2;
- } else if (((s16)(*new_var)[phi_v0]) < 0x80) {
- phi_v1 = 3;
- } else if (((s16)(*new_var)[phi_v0]) < 0xA0) {
- phi_v1 = 4;
- } else if (((s16)(*new_var)[phi_v0]) < 0xC0) {
- phi_v1 = 5;
- } else if (((s16)(*new_var)[phi_v0]) < 0xE0) {
- phi_v1 = 6;
+ /**
+ * a single index of scenesVisible can only hold 32 bits. So for every 32 scenes in the scene enum,
+ * increment to the next index of scenesVisible so that every scene gets a unique flag in scenesVisible,
+ * 224 bits were allocated to this although there are only 112 scenes
+ */
+ if (((s16)(*tingleMapSceneIndices)[i]) < 0x20) {
+ index = 0;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0x40) {
+ index = 1;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0x60) {
+ index = 2;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0x80) {
+ index = 3;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0xA0) {
+ index = 4;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0xC0) {
+ index = 5;
+ } else if (((s16)(*tingleMapSceneIndices)[i]) < 0xE0) {
+ index = 6;
}
- // Required to match
- gSaveContext.roomInf[125][phi_v1] =
- gSaveContext.roomInf[125][phi_v1] | gBitFlags[(s16)(*new_var)[phi_v0] - (phi_v1 << 5)];
- phi_v0++;
+ gSaveContext.scenesVisible[index] =
+ gSaveContext.scenesVisible[index] | gBitFlags[(s16)(*tingleMapSceneIndices)[i] - (index << 5)];
+ i++;
}
- if ((*new_var) == D_801C2380[0]) {
- gSaveContext.unk_F60 |= 3;
- } else if ((*new_var) == D_801C2380[1]) {
- gSaveContext.unk_F60 |= 0x1C;
- } else if ((*new_var) == D_801C2380[2]) {
- gSaveContext.unk_F60 |= 0xE0;
- } else if ((*new_var) == D_801C2380[3]) {
- gSaveContext.unk_F60 |= 0x100;
- } else if ((*new_var) == D_801C2380[4]) {
- gSaveContext.unk_F60 |= 0x1E00;
- } else if ((*new_var) == D_801C2380[5]) {
- gSaveContext.unk_F60 |= 0x6000;
+ if ((*tingleMapSceneIndices) == sScenesPerTingleMap[0]) {
+ gSaveContext.mapsVisible |= 3;
+ } else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[1]) {
+ gSaveContext.mapsVisible |= 0x1C;
+ } else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[2]) {
+ gSaveContext.mapsVisible |= 0xE0;
+ } else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[3]) {
+ gSaveContext.mapsVisible |= 0x100;
+ } else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[4]) {
+ gSaveContext.mapsVisible |= 0x1E00;
+ } else if ((*tingleMapSceneIndices) == sScenesPerTingleMap[5]) {
+ gSaveContext.mapsVisible |= 0x6000;
}
}
XREG(95) = 0;
}
-void func_8012F0EC(s16 arg0);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012F0EC.s")
+/**
+ * Also stores the players filename into dekuPlaygroundPlayerName
+ */
+void Inventory_SaveDekuPlaygroundHighScore(s16 timerId) {
+ s16 i;
-#ifdef NON_MATCHING
-// regalloc
-void func_8012F1BC(s16 sceneIndex) {
- if (sceneIndex == SCENE_KINSTA1) {
- gSaveContext.roomInf[126][0] = ((((gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
- (gSaveContext.roomInf[126][0] & 0xFFFF);
- } else {
- gSaveContext.roomInf[126][0] =
- ((gSaveContext.roomInf[126][0] + 1) & 0xFFFF) | (gSaveContext.roomInf[126][0] & 0xFFFF0000);
- }
-}
-#else
-void func_8012F1BC(s16 arg0);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012F1BC.s")
-#endif
+ gSaveContext.dekuPlaygroundHighScores[CURRENT_DAY - 1] = gSaveContext.unk_3DE0[timerId];
-s16 func_8012F22C(s16 sceneIndex) {
- if (sceneIndex == SCENE_KINSTA1) {
- return (gSaveContext.roomInf[126][0] & 0xFFFF0000) >> 0x10;
- } else {
- return gSaveContext.roomInf[126][0] & 0xFFFF;
+ for (i = 0; i < 8; i++) {
+ gSaveContext.inventory.dekuPlaygroundPlayerName[CURRENT_DAY - 1][i] = gSaveContext.playerName[i];
}
}
-void func_8012F278(GlobalContext* globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_8012EC80/func_8012F278.s")
+void Inventory_IncrementSkullTokenCount(s16 sceneIndex) {
+ if (sceneIndex == SCENE_KINSTA1) {
+ // Swamp Spider House (increment high bits of skullTokenCount)
+ gSaveContext.skullTokenCount = ((u16)(((gSaveContext.skullTokenCount & 0xFFFF0000) >> 0x10) + 1) << 0x10) |
+ (gSaveContext.skullTokenCount & 0xFFFF);
+ } else {
+ // Ocean Spider House (increment low bits of skullTokenCount)
+ gSaveContext.skullTokenCount =
+ (((u16)gSaveContext.skullTokenCount + 1) & 0xFFFF) | (gSaveContext.skullTokenCount & 0xFFFF0000);
+ }
+}
+
+s16 Inventory_GetSkullTokenCount(s16 sceneIndex) {
+ if (sceneIndex == SCENE_KINSTA1) {
+ // Swamp Spider House
+ return (gSaveContext.skullTokenCount & 0xFFFF0000) >> 0x10;
+ } else {
+ // Ocean Spider House
+ return gSaveContext.skullTokenCount & 0xFFFF;
+ }
+}
+
+void Inventory_SaveLotteryCodeGuess(GlobalContext* globalCtx) {
+ u16 lotteryCodeGuess;
+
+ lotteryCodeGuess = ((globalCtx->msgCtx.unk12054 & 0xF) << 8); // First Digit
+ lotteryCodeGuess |= ((globalCtx->msgCtx.unk12056 & 0xF) << 4); // Second Digit
+ lotteryCodeGuess |= (globalCtx->msgCtx.unk12058 & 0xF); // Third Digit
+ gSaveContext.lotteryCodeGuess = (gSaveContext.lotteryCodeGuess & 0xFFFF0000) | (lotteryCodeGuess & 0xFFFF);
+}
diff --git a/src/code/sys_math.c b/src/code/sys_math.c
index 9b274c7e24..da4ccc9d28 100644
--- a/src/code/sys_math.c
+++ b/src/code/sys_math.c
@@ -34,7 +34,7 @@ f32 func_80179400(s32 n) {
//! @bug No check for negative argument. Will read the array out-of-bounds if the argument is negative.
//! (The OoT version does an unsigned check instead, which will return sFactorialTbl[12] for a negative argument.)
- if (n > 12) {
+ if (n >= ARRAY_COUNT(sFactorialTbl)) {
ret = sFactorialTbl[12];
for (i = 13; i <= n; i++) {
ret *= i;
diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c
index d676a437cf..45b94d5690 100644
--- a/src/code/sys_math3d.c
+++ b/src/code/sys_math3d.c
@@ -130,7 +130,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D220.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D2FC.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/Math3D_LineSegVsPlane.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/sys_math3d/func_8017D404.s")
diff --git a/src/code/sys_ucode.c b/src/code/sys_ucode.c
index 9bde9e6df3..f9433eab22 100644
--- a/src/code/sys_ucode.c
+++ b/src/code/sys_ucode.c
@@ -7,8 +7,11 @@
extern u64 rspbootTextStart[];
extern u64 rspbootTextEnd[];
-u64* initialgspUcodeText = gspF3DEX2_NoN_fifoTextStart;
-u64* initialgspUcodeData = gspF3DEX2_NoN_fifoDataStart;
+extern u64 gspF3DZEX2_NoN_PosLight_fifoTextStart[];
+extern u64 gspF3DZEX2_NoN_PosLight_fifoDataStart[];
+
+u64* initialgspUcodeText = gspF3DZEX2_NoN_PosLight_fifoTextStart;
+u64* initialgspUcodeData = gspF3DZEX2_NoN_PosLight_fifoDataStart;
u64* SysUcode_GetUCodeBoot(void) {
return rspbootTextStart;
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 751562a82a..475c31827e 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -320,13 +320,12 @@ void func_800B4AEC(GlobalContext* globalCtx, Actor* actor, f32 y) {
void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) {
f32 spEC;
f32 temp_f12;
- f32 temp_f20;
f32 shadowScaleZ;
f32 temp_f22;
f32 temp_f24;
f32 temp_f8;
- MtxF sp94;
s32 lightNum;
+ MtxF sp94;
s32 numLights;
s8 phi_v1;
u8 temp_v0;
@@ -342,7 +341,8 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) {
spEC = actor->world.pos.y - actor->floorHeight;
if (spEC > 20.0f) {
- temp_f20 = actor->shape.shadowScale;
+ f32 temp_f20 = actor->shape.shadowScale;
+
temp_v0 = actor->shape.shadowAlpha;
actor->shape.shadowScale *= 0.3f;
temp_f12 = (spEC - 20.0f) * 0.02f;
@@ -350,7 +350,6 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) {
ActorShadow_DrawCircle(actor, mapper, globalCtx);
actor->shape.shadowScale = temp_f20;
actor->shape.shadowAlpha = temp_v0;
- dummy_label_111649:;
} else if (spEC >= -1.0f) {
numLights = mapper->numLights - 2;
@@ -377,8 +376,8 @@ void func_800B4B50(Actor* actor, Lights* mapper, GlobalContext* globalCtx) {
for (j = 0; j < 2; j++, phi_s0++) {
if (phi_s0->l.dir[1] > 0) {
- lightNum = (ABS_ALT(phi_s0->l.dir[1]) * (phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2])) -
- (lightNumMax * ((void)0, 8));
+ lightNum = ((phi_s0->l.col[0] + phi_s0->l.col[1] + phi_s0->l.col[2]) * ABS_ALT(phi_s0->l.dir[1])) -
+ (8 * lightNumMax);
if (lightNum > 0) {
ActorShadow_DrawFoot(globalCtx, phi_s0, &sp94, lightNum, temp_f22, temp_f24, shadowScaleZ);
}
@@ -1280,7 +1279,7 @@ f32 Actor_HeightDiff(Actor* actor1, Actor* actor2) {
* Sets the current and new inputs.
*/
void func_800B6F20(GlobalContext* globalCtx, Input* input, f32 magnitude, s16 baseYaw) {
- s16 relativeYaw = baseYaw - func_800DFC68(GET_ACTIVE_CAM(globalCtx));
+ s16 relativeYaw = baseYaw - Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx));
input->cur.stick_x = -Math_SinS(relativeYaw) * magnitude;
input->rel.stick_x = input->cur.stick_x;
@@ -1342,7 +1341,7 @@ void Actor_SetCameraHorseSetting(GlobalContext* globalCtx, Player* player) {
EnHorse* rideActor = (EnHorse*)player->rideActor;
if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) {
- func_800DFAC8(Play_GetCamera(globalCtx, MAIN_CAM), 4);
+ func_800DFAC8(Play_GetCamera(globalCtx, CAM_ID_MAIN), 4);
}
}
}
@@ -2234,11 +2233,11 @@ void func_800B9120(ActorContext* actorCtx) {
void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) {
ActorOverlay* overlayEntry;
- u32* cycleFlags;
+ CycleSceneFlags* cycleFlags;
s32 i;
gSaveContext.weekEventReg[92] |= 0x80;
- cycleFlags = gSaveContext.cycleSceneFlags[convert_scene_number_among_shared_scenes(globalCtx->sceneNum)];
+ cycleFlags = &gSaveContext.cycleSceneFlags[convert_scene_number_among_shared_scenes(globalCtx->sceneNum)];
bzero(actorCtx, sizeof(ActorContext));
ActorOverlayTable_Init();
@@ -2252,14 +2251,14 @@ void Actor_InitContext(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEn
overlayEntry++;
}
- actorCtx->flags.chest = cycleFlags[0];
- actorCtx->flags.switches[0] = cycleFlags[1];
- actorCtx->flags.switches[1] = cycleFlags[2];
+ actorCtx->flags.chest = cycleFlags->chest;
+ actorCtx->flags.switches[0] = cycleFlags->swch0;
+ actorCtx->flags.switches[1] = cycleFlags->swch1;
if (globalCtx->sceneNum == SCENE_INISIE_R) {
- cycleFlags = gSaveContext.cycleSceneFlags[globalCtx->sceneNum];
+ cycleFlags = &gSaveContext.cycleSceneFlags[globalCtx->sceneNum];
}
- actorCtx->flags.collectible[0] = cycleFlags[4];
- actorCtx->flags.clearedRoom = cycleFlags[3];
+ actorCtx->flags.collectible[0] = cycleFlags->collectible;
+ actorCtx->flags.clearedRoom = cycleFlags->clearedRoom;
TitleCard_ContextInit(&globalCtx->state, &actorCtx->titleCtxt);
func_800B6468(globalCtx);
@@ -3330,7 +3329,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
if ((player != NULL) && (actor == player->unk_730)) {
func_80123DA4(player);
- Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCameraIndex(globalCtx)), 0);
+ Camera_ChangeMode(Play_GetCamera(globalCtx, Play_GetActiveCamId(globalCtx)), 0);
}
if (actor == actorCtx->targetContext.arrowPointedActor) {
@@ -4253,7 +4252,7 @@ s16 func_800BDB6C(Actor* actor, GlobalContext* globalCtx, s16 arg2, f32 arg3) {
return arg2;
}
-void Actor_ChangeAnimation(SkelAnime* skelAnime, ActorAnimationEntry* animation, s32 index) {
+void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animation, s32 index) {
f32 frameCount;
animation += index;
@@ -4577,7 +4576,8 @@ void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16
}
Matrix_SetCurrentState(&globalCtx->billboardMtxF);
- Matrix_Scale((effectScale * 0.005f) * 1.35f, (effectScale * 0.005f), (effectScale * 0.005f) * 1.35f, 1);
+ Matrix_Scale((effectScale * 0.005f) * 1.35f, (effectScale * 0.005f), (effectScale * 0.005f) * 1.35f,
+ MTXMODE_APPLY);
sp74 = effectAlpha * 255.0f;
@@ -4676,7 +4676,7 @@ void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16
for (i = 0; i < arg3; i++) {
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
- Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), 1);
+ Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
temp_s3->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x;
temp_s3->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y;
temp_s3->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z;
@@ -4687,7 +4687,7 @@ void func_800BE680(GlobalContext* globalCtx, Actor* actor, Vec3f limbPos[], s16
gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0234F0);
Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(2 * M_PI));
- Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), 1);
+ Matrix_InsertZRotation_f(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
temp_s3->mf[3][0] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->x;
temp_s3->mf[3][1] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->y;
temp_s3->mf[3][2] = randPlusMinusPoint5Scaled((f32)sREG(24) + 30.0f) + limbPos->z;
diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c
index 850d5234b7..3f5583f798 100644
--- a/src/code/z_bgcheck.c
+++ b/src/code/z_bgcheck.c
@@ -4047,7 +4047,7 @@ u16 func_800C9728(CollisionContext* colCtx, u32 camId, s32 bgId) {
return 0;
}
camData = colHeader->cameraDataList;
- result = camData[camId].cameraSType;
+ result = camData[camId].setting;
return result;
}
@@ -4088,7 +4088,7 @@ u16 func_800C97F8(CollisionContext* colCtx, u32 camId, s32 bgId) {
if (camData == NULL) {
return 0;
}
- return camData[camId].unk_02;
+ return camData[camId].numData;
}
/**
@@ -4114,7 +4114,7 @@ u16 func_800C9844(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
}
/**
- * CamData get camPosData
+ * CamData get data
*/
Vec3s* func_800C98CC(CollisionContext* colCtx, s32 camId, s32 bgId) {
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(colCtx, bgId);
@@ -4127,11 +4127,11 @@ Vec3s* func_800C98CC(CollisionContext* colCtx, s32 camId, s32 bgId) {
if (cameraDataList == NULL) {
return NULL;
}
- return Lib_SegmentedToVirtual(cameraDataList[camId].camPosData);
+ return Lib_SegmentedToVirtual(cameraDataList[camId].data);
}
/**
- * SurfaceType Get camPosData
+ * SurfaceType Get data
*/
Vec3s* SurfaceType_GetCamPosData(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
CollisionHeader* colHeader = BgCheck_GetCollisionHeader(colCtx, bgId);
@@ -4321,17 +4321,18 @@ s32 SurfaceType_IsIgnoredByProjectiles(CollisionContext* colCtx, CollisionPoly*
}
/**
- * CollisionPoly is conveyor enabled
- * Returns true if `poly` is a conveyor surface, else false
+ * SurfaceType Get Conveyor Surface Type
+ * Return type 0 (CONVEYOR_WATER) if 'poly' is a surface that will only move player underwater
+ * Return type 1 (CONVEYOR_FLOOR) if `poly` is a surface that must be stood on to move player
*/
-s32 SurfaceType_IsConveyor(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
+s32 SurfaceType_GetConveyorType(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
u32 flags;
if (BgCheck_GetCollisionHeader(colCtx, bgId) == NULL) {
- return true;
+ return CONVEYOR_FLOOR;
}
if (poly == NULL) {
- return false;
+ return CONVEYOR_WATER;
}
flags = poly->flags_vIB & 0x2000;
return !!flags;
@@ -4572,7 +4573,7 @@ u16 WaterBox_GetCameraSetting(CollisionContext* colCtx, WaterBox* waterBox, s32
return result;
}
- result = camData[camId].cameraSType;
+ result = camData[camId].setting;
return result;
}
diff --git a/src/code/z_camera.c b/src/code/z_camera.c
index 1e983c9541..9aef846e0c 100644
--- a/src/code/z_camera.c
+++ b/src/code/z_camera.c
@@ -320,19 +320,19 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFAC8.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFB14.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeDataIdx.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC1C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC40.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC68.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetInputDirYaw.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFC90.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFCB4.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirPitch.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFCDC.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetCamDirYaw.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800DFD04.s")
@@ -364,10 +364,10 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0238.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E02AC.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetToTrackActor.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0308.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_SetTargetActor.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E031C.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_GetWaterYPos.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800E0348.s")
diff --git a/src/code/z_demo.c b/src/code/z_demo.c
index 72eeb742ef..fb6f8687ca 100644
--- a/src/code/z_demo.c
+++ b/src/code/z_demo.c
@@ -1,99 +1,1684 @@
#include "global.h"
+#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_Init.s")
+void Cutscene_DoNothing(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800EA258(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800ED9C4(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800EA2B8(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800ED980(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800EDA04(GlobalContext* globalCtx, CutsceneContext* csCtx);
+void func_800EDA84(GlobalContext* globalCtx, CutsceneContext* csCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA0D4.s")
+// Unused
+UNK_TYPE4 D_801BB120 = 0;
+u16 D_801BB124 = 0;
+u16 D_801BB128 = 0;
+u8 D_801BB12C = 0;
+u8 sCutsceneStoredPlayerForm = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA0EC.s")
+// bss
+#ifndef NON_MATCHING
+static u16 seqId;
+#endif
+s16 sCutsceneQuakeIndex;
+struct_801F4D48 sCutsceneCameraInfo;
+u16 D_801F4DC8[10];
+UNK_TYPE D_801F4DDC;
+u8 D_801F4DE0;
+s16 D_801F4DE2;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_StepCutscene1.s")
+void Cutscene_Init(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_StepCutscene2.s")
+ csCtx->state = CS_STATE_0;
+ csCtx->frames = 0;
+ csCtx->unk_0C = 0.0f;
+ globalCtx->csCtx.sceneCsCount = 0;
+ globalCtx->csCtx.currentCsIndex = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_Nop800EA210.s")
+ for (i = 0; i < ARRAY_COUNT(D_801F4DC8); i++) {
+ D_801F4DC8[i] = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA220.s")
+ D_801F4DE0 = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA258.s")
+ Audio_SetCutsceneFlag(false);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA2B8.s")
+void Cutscene_Start(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ csCtx->state = CS_STATE_1;
+ csCtx->playerAction = NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EA324.s")
+void Cutscene_End(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (csCtx->state != CS_STATE_4) {
+ csCtx->state = CS_STATE_3;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EABAC.s")
+typedef void (*CutsceneStateHandler)(GlobalContext* globalCtx, CutsceneContext* csCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAC08.s")
+CutsceneStateHandler sCsStateHandlers1[] = {
+ Cutscene_DoNothing, // CS_STATE_0
+ func_800EA258, // CS_STATE_1
+ Cutscene_DoNothing, // CS_STATE_2
+ func_800ED9C4, // CS_STATE_3
+ Cutscene_DoNothing, // CS_STATE_4
+};
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAC44.s")
+void Cutscene_Update1(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (gSaveContext.cutscene < 0xFFF0) {
+ sCsStateHandlers1[csCtx->state](globalCtx, csCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAC94.s")
+CutsceneStateHandler sCsStateHandlers2[] = {
+ Cutscene_DoNothing, // CS_STATE_0
+ func_800EA2B8, // CS_STATE_1
+ func_800ED980, // CS_STATE_2
+ func_800EDA04, // CS_STATE_3
+ func_800ED980, // CS_STATE_4
+};
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAD14.s")
+void Cutscene_Update2(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if ((gSaveContext.cutsceneTrigger != 0) && (globalCtx->sceneLoadFlag == 0x14)) {
+ gSaveContext.cutsceneTrigger = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAD48.s")
+ if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0)) {
+ gSaveContext.cutscene = 0xFFFD;
+ gSaveContext.cutsceneTrigger = 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAD7C.s")
+ if (gSaveContext.cutscene >= 0xFFF0) {
+ func_800EDA84(globalCtx, csCtx);
+ sCsStateHandlers2[csCtx->state](globalCtx, csCtx);
+ }
+}
+void Cutscene_DoNothing(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+}
+
+s32 func_800EA220(GlobalContext* globalCtx, CutsceneContext* csCtx, f32 target) {
+ return Math_StepToF(&csCtx->unk_0C, target, 0.1f);
+}
+
+void func_800EA258(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ Interface_ChangeAlpha(1);
+ ShrinkWindow_SetLetterboxTarget(32);
+ if (func_800EA220(globalCtx, csCtx, 1.0f)) {
+ Audio_SetCutsceneFlag(true);
+ csCtx->state++;
+ }
+}
+
+void func_800EA2B8(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ func_800ED980(globalCtx, csCtx);
+ Interface_ChangeAlpha(1);
+ ShrinkWindow_SetLetterboxTarget(32);
+ if (func_800EA220(globalCtx, csCtx, 1.0f)) {
+ Audio_SetCutsceneFlag(true);
+ csCtx->state++;
+ }
+}
+
+/* Start of command handling section */
+
+// Command 0x96: Miscellaneous commands.
+void Cutscene_Command_Misc(GlobalContext* globalCtx2, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ static u16 D_801BB15C = 0xFFFF;
+ Player* player = GET_PLAYER(globalCtx2);
+ GlobalContext* globalCtx = globalCtx2;
+ u8 isStartFrame = false;
+ f32 progress;
+ SceneTableEntry* loadedScene;
+ u16 time;
+
+ if ((csCtx->frames < cmd->startFrame) || ((csCtx->frames >= cmd->endFrame) && (cmd->endFrame != cmd->startFrame))) {
+ return;
+ }
+
+ progress = Environment_LerpWeight(cmd->endFrame - 1, cmd->startFrame, csCtx->frames);
+ if (csCtx->frames == cmd->startFrame) {
+ isStartFrame = true;
+ }
+
+ // TODO: consider creating an enum for this when we understand what each value does
+ switch (cmd->base) {
+ case 0x1:
+ if (isStartFrame) {
+ func_800FD78C(globalCtx);
+ globalCtx->envCtx.unk_F2[0] = 0x3C;
+ }
+ break;
+ case 0x2:
+ if (isStartFrame) {
+ func_801A47DC(NATURE_CHANNEL_LIGHTNING, CHANNEL_IO_PORT_0, 0);
+ Environment_AddLightningBolts(globalCtx, 3);
+ D_801F4E68 = 1;
+ }
+ break;
+ case 0x3:
+ if (globalCtx->envCtx.lightSettings.fogFar < 12800) {
+ globalCtx->envCtx.lightSettings.fogFar += 35;
+ }
+ break;
+ case 0x4:
+ if (isStartFrame) {
+ globalCtx->envCtx.unk_19 = 1;
+ globalCtx->envCtx.unk_17 = 1;
+ globalCtx->envCtx.unk_18 = 0;
+ globalCtx->envCtx.unk_1A = 0x3C;
+ globalCtx->envCtx.unk_21 = 1;
+ globalCtx->envCtx.unk_1F = 0;
+ globalCtx->envCtx.unk_20 = 1;
+ globalCtx->envCtx.unk_24 = 0x3C;
+ globalCtx->envCtx.unk_22 = globalCtx->envCtx.unk_24;
+ }
+ break;
+ case 0x5:
+ if (isStartFrame && (csCtx->state != CS_STATE_4)) {
+ csCtx->state = CS_STATE_3;
+ }
+ break;
+ case 0x7:
+ if (isStartFrame) {
+ loadedScene = globalCtx->loadedScene;
+ if (loadedScene->titleTextId != 0) {
+ func_80151A68(globalCtx, loadedScene->titleTextId);
+ }
+ }
+ break;
+ case 0x8:
+ func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
+ if (isStartFrame) {
+ sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(globalCtx), 6);
+ Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
+ Quake_SetQuakeValues(sCutsceneQuakeIndex, 6, 4, 0, 0);
+ Quake_SetCountdown(sCutsceneQuakeIndex, 800);
+ }
+ break;
+ case 0x9:
+ if (isStartFrame) {
+ Quake_Init();
+ }
+ break;
+ case 0xA:
+ D_801F6D30.r = 255;
+ D_801F6D30.g = 255;
+ D_801F6D30.b = 255;
+ D_801F6D30.a = 255 * progress;
+ break;
+ case 0xB:
+ D_801F6D30.r = 255;
+ D_801F6D30.g = 180;
+ D_801F6D30.b = 100;
+ D_801F6D30.a = 255 * progress;
+ break;
+ case 0xC:
+ globalCtx->roomCtx.currRoom.segment = NULL;
+ break;
+ case 0xD:
+ if (globalCtx->state.frames & 8) {
+ if (globalCtx->envCtx.lightSettings.ambientColor[0] < 40) {
+ globalCtx->envCtx.lightSettings.ambientColor[0] += 2;
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] -= 3;
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] -= 3;
+ }
+ } else {
+ if (globalCtx->envCtx.lightSettings.ambientColor[0] > 2) {
+ globalCtx->envCtx.lightSettings.ambientColor[0] -= 2;
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] += 3;
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] += 3;
+ }
+ }
+ break;
+ case 0xE:
+ globalCtx->unk_18845 = 1;
+ break;
+ case 0xF:
+ globalCtx->unk_18845 = 0;
+ break;
+ case 0x10:
+ if (isStartFrame) {
+ globalCtx->envCtx.sandstormState = 1;
+ }
+ func_8019F128(NA_SE_EV_SAND_STORM - SFX_FLAG);
+ break;
+ case 0x11:
+ gSaveContext.sunsSongState = SUNSSONG_START;
+ break;
+ case 0x12:
+ if (!gSaveContext.isNight) {
+ time = gSaveContext.time;
+ gSaveContext.time = time - (u16)REG(15);
+ } else {
+ time = gSaveContext.time;
+ gSaveContext.time = time - (u16)(2 * REG(15));
+ }
+ break;
+ case 0x13:
+ // AudioOcarina_PlayLongScarecrowAfterCredits
+ func_8019D758();
+ csCtx->frames = cmd->startFrame - 1;
+ break;
+ case 0x14:
+ EnvFlags_Set(globalCtx, 3);
+ break;
+ case 0x15:
+ EnvFlags_Set(globalCtx, 4);
+ break;
+ case 0x16:
+ gSaveContext.playerForm = PLAYER_FORM_DEKU;
+ break;
+ case 0x17:
+ player->stateFlags2 |= 0x4000000;
+ break;
+ case 0x18:
+ player->stateFlags2 &= ~0x4000000;
+ break;
+ case 0x19:
+ sCutsceneStoredPlayerForm = gSaveContext.playerForm;
+ gSaveContext.playerForm = PLAYER_FORM_HUMAN;
+ gSaveContext.equippedMask = PLAYER_MASK_NONE;
+ break;
+ case 0x1A:
+ func_8019F128(NA_SE_EV_EARTHQUAKE_LAST2 - SFX_FLAG);
+ if (isStartFrame) {
+ sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(globalCtx), 6);
+ Quake_SetSpeed(sCutsceneQuakeIndex, 30000);
+ Quake_SetQuakeValues(sCutsceneQuakeIndex, 20, 10, 0, 0);
+ Quake_SetCountdown(sCutsceneQuakeIndex, 800);
+ }
+ break;
+ case 0x1B:
+ if (isStartFrame) {
+ globalCtx->nextEntranceIndex = 0x1C00;
+ gSaveContext.nextCutsceneIndex = 0xFFF8;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ }
+ break;
+ case 0x1C:
+ if (isStartFrame) {
+ globalCtx->envCtx.unk_17 = 0xD;
+ }
+ break;
+ case 0x1D:
+ gSaveContext.playerForm = sCutsceneStoredPlayerForm;
+ break;
+ case 0x1E:
+ D_801F4DE0 = true;
+ break;
+ case 0x1F:
+ D_801F4DE0 = false;
+ break;
+ case 0x21:
+ if (isStartFrame) {
+ func_80146EE8(globalCtx);
+ }
+ break;
+ case 0x22:
+ if (isStartFrame) {
+ func_80144A94(&globalCtx->sramCtx);
+ }
+ break;
+ case 0x23:
+ if (csCtx->frames != D_801BB15C) {
+ D_801BB15C = csCtx->frames;
+
+ if (REG(15) != 0) {
+ time = gSaveContext.time;
+ gSaveContext.time = (u16)REG(15) + time;
+ time = gSaveContext.time;
+ gSaveContext.time = (u16)gSaveContext.unk_14 + time;
+ }
+ }
+ break;
+ case 0x24:
+ func_8019F128(NA_SE_EV_EARTHQUAKE_LAST - SFX_FLAG);
+ if (isStartFrame) {
+ sCutsceneQuakeIndex = Quake_Add(GET_ACTIVE_CAM(globalCtx), 6);
+ Quake_SetSpeed(sCutsceneQuakeIndex, 22000);
+ Quake_SetQuakeValues(sCutsceneQuakeIndex, 2, 1, 0, 0);
+ Quake_SetCountdown(sCutsceneQuakeIndex, 800);
+ }
+ break;
+
+ case 0x26:
+ // Seems to be used to trigger "Dawn of A New Day"
+
+ gSaveContext.day = 9;
+
+ {
+ GameState* gameState = &globalCtx->state;
+ gameState->running = false;
+ }
+ SET_NEXT_GAMESTATE(&globalCtx->state, Daytelop_Init, DaytelopContext);
+
+ func_80146F5C(globalCtx);
+ break;
+
+ case 0x27:
+ gSaveContext.playerForm = PLAYER_FORM_ZORA;
+ break;
+
+ case 0x28:
+ csCtx->frames = cmd->startFrame - 1;
+ break;
+ }
+}
+
+// Command 0x97: Set Environment Lighting
+void Cutscene_Command_SetLighting(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdEnvLighting* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
+ if (cmd->setting != 0x20) {
+ globalCtx->envCtx.lightSettingOverride = cmd->setting - 1;
+ globalCtx->envCtx.lightBlend = 1.0f;
+ } else {
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
+ }
+ }
+}
+
+// Command 0x12C: Plays a sequence (Background music or Fanfare)
+void Cutscene_Command_PlaySequence(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
+ func_801A2C88(cmd->sequence - 1);
+ }
+}
+
+// Command 0x12D: Stops a sequence (Background music or Fanfare)
+void Cutscene_Command_StopSequence(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdSequenceChange* cmd) {
+ if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
+ func_801A2D54(cmd->sequence - 1);
+ }
+}
+
+// Command 0x9C: Fade a sequence (Background music or Fanfare) over duration
+void Cutscene_Command_FadeSequence(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdSequenceFade* cmd) {
+ if ((csCtx->frames == cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
+ u8 fadeTimer = cmd->endFrame - cmd->startFrame;
+
+ if (cmd->type == 2) {
+ Audio_QueueSeqCmd((fadeTimer << 0x10) | 0x110000FF);
+ } else {
+ Audio_QueueSeqCmd((fadeTimer << 0x10) | NA_BGM_STOP);
+ }
+ }
+}
+
+// Command 0x12E: Play Ambience sequence
+void Cutscene_Command_PlayAmbienceSequence(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
+ // Audio_PlayNatureAmbienceSequence
+ // nightSeqIndex is natureAmbienceId
+ func_801A4A28(globalCtx->soundCtx.nightSeqIndex);
+ }
+}
+
+// Command 0x130:
+void func_800EAD48(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
+ // Audio_SetSfxReverbIndexExceptOcarinaBank
+ func_801A4428(2);
+ }
+}
+
+// Command 0x131:
+void func_800EAD7C(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if (csCtx->frames == cmd->startFrame) {
+ // Audio_SetSfxReverbIndexExceptOcarinaBank
+ func_801A4428(1);
+ }
+}
+
+#ifdef NON_MATCHING
+// needs in-function static bss
+// audio related
+void func_800EADB0(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ static u16 seqId;
+ u8 dayMinusOne;
+
+ if (csCtx->frames == cmd->startFrame) {
+ dayMinusOne = (gSaveContext.day - 1);
+ if (dayMinusOne >= 3) {
+ dayMinusOne = 0;
+ }
+
+ switch (cmd->base) {
+ case 1:
+ // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_1);
+ func_801A246C(SEQ_PLAYER_BGM_MAIN, 1);
+ break;
+
+ case 2:
+ // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_0);
+ func_801A246C(SEQ_PLAYER_BGM_MAIN, 0);
+ break;
+
+ case 3:
+ // func_801A246C(SEQ_PLAYER_BGM_MAIN, TYPE_2);
+ func_801A246C(SEQ_PLAYER_BGM_MAIN, 2);
+ break;
+
+ case 4:
+ // func_801A246C(SEQ_PLAYER_NATURE, TYPE_1);
+ func_801A246C(SEQ_PLAYER_NATURE, 1);
+ break;
+
+ case 5:
+ // func_801A246C(SEQ_PLAYER_NATURE, TYPE_0);
+ func_801A246C(SEQ_PLAYER_NATURE, 0);
+ break;
+
+ case 6:
+ // func_801A246C(SEQ_PLAYER_NATURE, TYPE_2);
+ func_801A246C(SEQ_PLAYER_NATURE, 2);
+ break;
+
+ case 7:
+ // Audio_GetActiveSequence
+ seqId = func_801A8A50(0);
+ break;
+
+ case 8:
+ if (seqId != NA_BGM_DISABLED) {
+ // Audio_PlayBgmForDayScene
+ func_801A25E4(seqId, dayMinusOne);
+ }
+ break;
+ }
+ }
+}
+#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EADB0.s")
+#endif
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAECC.s")
+// Command 0x12F: Fade Ambience sequence
+void Cutscene_Command_FadeAmbienceSequence(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if (csCtx->frames == cmd->startFrame && csCtx->frames < cmd->endFrame) {
+ u8 fadeTimer = cmd->endFrame - cmd->startFrame;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAF20.s")
+ Audio_QueueSeqCmd((fadeTimer << 0x10) | 0x140000FF);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EAFE0.s")
+// Command 0x190: Rumble
+void Cutscene_Command_Rumble(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdRumble* cmd) {
+ switch (cmd->type) {
+ case 1:
+ if (csCtx->frames == cmd->startFrame) {
+ func_8013ECE0(0.0f, cmd->unk6, cmd->unk7, cmd->unk8);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EB1DC.s")
+ case 2:
+ if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
+ if ((csCtx->frames == cmd->startFrame) || (globalCtx->state.frames % 64 == 0)) {
+ func_8013ECE0(0.0f, cmd->unk6, cmd->unk7, cmd->unk8);
+ }
+ }
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EB364.s")
+// Command 0x9B:
+void Cutscene_Command_FadeColorScreen(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdFadeScreen* cmd) {
+ if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
+ f32 alpha;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EB4B4.s")
+ globalCtx->envCtx.fillScreen = true;
+ alpha = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EB6F8.s")
+ if (((cmd->unk0 == 1)) || (cmd->unk0 == 2)) {
+ globalCtx->envCtx.screenFillColor[0] = cmd->color.r;
+ globalCtx->envCtx.screenFillColor[1] = cmd->color.g;
+ globalCtx->envCtx.screenFillColor[2] = cmd->color.b;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EBB68.s")
+ if (cmd->unk0 == 2) {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - alpha) * 255.0f;
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * alpha;
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EBCD0.s")
+// Command 0x9D: Set Time of Day & Environment Time
+void Cutscene_Command_SetTime(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdDayTime* cmd) {
+ u16 nextTime;
+ u16 hourAsMinutes;
+ u16 minutes;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EBD60.s")
+ if (csCtx->frames == cmd->startFrame) {
+ hourAsMinutes = CLOCK_TIME_ALT_F(cmd->hour, 0);
+ minutes = CLOCK_TIME_ALT_F(0, cmd->minute + 1);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EC678.s")
+ nextTime = hourAsMinutes + minutes;
+ gSaveContext.time = nextTime;
+ gSaveContext.environmentTime = nextTime;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EC6D4.s")
+void Cutscene_TerminatorImpl(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ csCtx->state = CS_STATE_4;
+ func_80165690();
+ Audio_SetCutsceneFlag(false);
+ gSaveContext.unk_3F48 = 1;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EC924.s")
+ if ((gSaveContext.gameMode != 0) && (csCtx->frames != cmd->startFrame)) {
+ gSaveContext.unk_3F1E = 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800ECD7C.s")
+ gSaveContext.cutscene = 0;
+ if (cmd->base == 1) {
+ globalCtx->nextEntranceIndex = globalCtx->csCtx.sceneCsList[globalCtx->csCtx.currentCsIndex].nextEntranceIndex;
+ gSaveContext.nextCutsceneIndex = 0;
+ globalCtx->sceneLoadFlag = 0x14;
+ if (gSaveContext.gameMode != 1) {
+ Scene_SetExitFade(globalCtx);
+ } else {
+ D_801BB12C++;
+ if (D_801BB12C >= 2) {
+ D_801BB12C = 0;
+ }
+ globalCtx->unk_1887F = 4;
+ }
+ if ((globalCtx->nextEntranceIndex & 0xF) > 0) {
+ gSaveContext.nextCutsceneIndex = (globalCtx->nextEntranceIndex & 0xF) + 0xFFEF;
+ }
+
+ globalCtx->nextEntranceIndex &= ~0xF;
+ }
+}
+
+// Command 0x15E
+void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if (cmd->base == 1) {
+ if (csCtx->frames == cmd->startFrame) {
+ Cutscene_TerminatorImpl(globalCtx, csCtx, cmd);
+ }
+ } else if (cmd->base == 2) {
+ if (csCtx->frames == cmd->startFrame) {
+ func_80165690();
+
+ switch (D_801F4DE2) {
+ case 0x1F:
+ if (gSaveContext.weekEventReg[0x14] & 2) {
+ globalCtx->nextEntranceIndex = 0x3010;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ } else {
+ globalCtx->nextEntranceIndex = 0x8600;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ }
+ break;
+
+ case 0x44:
+ if (gSaveContext.weekEventReg[0x21] & 0x80) {
+ globalCtx->nextEntranceIndex = 0xAE70;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ } else {
+ globalCtx->nextEntranceIndex = 0xAE00;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ }
+ break;
+
+ case 0x5F:
+ gSaveContext.weekEventReg[0x37] |= 0x80;
+ globalCtx->nextEntranceIndex = 0x6A80;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ break;
+
+ case 0x36:
+ gSaveContext.weekEventReg[0x34] |= 0x20;
+ globalCtx->nextEntranceIndex = 0x2000;
+ gSaveContext.nextCutsceneIndex = 0xFFF1;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ break;
+ }
+ }
+ }
+}
+
+// Command 0x15F: Chooses between a cutscene or a rotating mask depending on whether the player has the corresponding
+// mask
+void Cutscene_Command_ChooseCreditsScenes(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if ((csCtx->frames >= cmd->startFrame) && (func_801A3950(0, true) != 0xFF)) {
+ switch (cmd->base) {
+ case 1:
+ Cutscene_TerminatorImpl(globalCtx, csCtx, cmd);
+ break;
+
+ case 2:
+ if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) {
+ // Milk bar
+ globalCtx->nextEntranceIndex = 0x2400;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C00;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 3:
+ if (INV_CONTENT(ITEM_MASK_GREAT_FAIRY) == ITEM_MASK_GREAT_FAIRY) {
+ // Fairy's fountain
+ globalCtx->nextEntranceIndex = 0x4600;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C10;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 4:
+ if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) {
+ // Romani ranch
+ globalCtx->nextEntranceIndex = 0x6400;
+ gSaveContext.nextCutsceneIndex = 0xFFF1;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C20;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 5:
+ if (INV_CONTENT(ITEM_MASK_BLAST) == ITEM_MASK_BLAST) {
+ // West clock town
+ globalCtx->nextEntranceIndex = 0xD400;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C30;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 6:
+ if (INV_CONTENT(ITEM_MASK_CIRCUS_LEADER) == ITEM_MASK_CIRCUS_LEADER) {
+ // Milk bar
+ globalCtx->nextEntranceIndex = 0x2400;
+ gSaveContext.nextCutsceneIndex = 0xFFF1;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C50;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 7:
+ if (INV_CONTENT(ITEM_MASK_BREMEN) == ITEM_MASK_BREMEN) {
+ // Milk bar
+ globalCtx->nextEntranceIndex = 0x2400;
+ gSaveContext.nextCutsceneIndex = 0xFFF3;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C60;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 8:
+ // Ikana canyon
+ globalCtx->nextEntranceIndex = 0x2000;
+ gSaveContext.nextCutsceneIndex = 0xFFF3;
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 9:
+ if (INV_CONTENT(ITEM_MASK_COUPLE) == ITEM_MASK_COUPLE) {
+ // Termina field
+ globalCtx->nextEntranceIndex = 0x5400;
+ gSaveContext.nextCutsceneIndex = 0xFFF8;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C70;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 10:
+ if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) {
+ // Cucco shack
+ globalCtx->nextEntranceIndex = 0x7E00;
+ gSaveContext.nextCutsceneIndex = 0xFFF0;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C40;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+
+ case 11:
+ if (INV_CONTENT(ITEM_MASK_POSTMAN) == ITEM_MASK_POSTMAN) {
+ // Termina field
+ globalCtx->nextEntranceIndex = 0x5410;
+ gSaveContext.nextCutsceneIndex = 0xFFF8;
+ } else {
+ // SPOT00
+ globalCtx->nextEntranceIndex = 0x1C80;
+ gSaveContext.nextCutsceneIndex = 0xFFF9;
+ }
+ globalCtx->sceneLoadFlag = 0x14;
+ break;
+ }
+ }
+}
+
+// Command 0x99: Motion blur
+void Cutscene_Command_MotionBlur(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
+ if ((csCtx->frames == cmd->startFrame) && (cmd->base == 1)) {
+ func_8016566C(180);
+ }
+
+ if (cmd->base == 2) {
+ f32 progress = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
+
+ if (progress >= 0.9f) {
+ func_80165690();
+ } else {
+ func_80165658((1.0f - progress) * 180.0f);
+ }
+ }
+ }
+}
+
+// Command 0x9A: Gives Tatl to the player
+void Cutscene_Command_GiveTatlToPlayer(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (csCtx->frames == cmd->startFrame) {
+ if (cmd->base == 1) {
+ gSaveContext.hasTatl = true;
+ if (player->tatlActor != NULL) {
+ return;
+ }
+ player->tatlActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, player->actor.world.pos.x,
+ player->actor.world.pos.y, player->actor.world.pos.z, 0, 0, 0, 0);
+ }
+ }
+}
+
+// Command 0x98
+void Cutscene_Command_TransitionFX(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* cmd) {
+ if ((csCtx->frames >= cmd->startFrame) && (cmd->endFrame >= csCtx->frames)) {
+ f32 temp_f0;
+
+ globalCtx->envCtx.fillScreen = true;
+ temp_f0 = Environment_LerpWeight(cmd->endFrame, cmd->startFrame, csCtx->frames);
+
+ switch (cmd->base) {
+ case 1:
+ case 5:
+ globalCtx->envCtx.screenFillColor[0] = 160;
+ globalCtx->envCtx.screenFillColor[1] = 160;
+ globalCtx->envCtx.screenFillColor[2] = 160;
+ if (cmd->base == 1) {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
+ if (temp_f0 == 0.0f) {
+ func_8019F128(NA_SE_EV_S_STONE_FLASH);
+ }
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f;
+ }
+ break;
+
+ case 2:
+ case 6:
+ globalCtx->envCtx.screenFillColor[0] = 0;
+ globalCtx->envCtx.screenFillColor[1] = 0;
+ globalCtx->envCtx.screenFillColor[2] = 255;
+ if (cmd->base == 2) {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f;
+ }
+ break;
+
+ case 3:
+ case 7:
+ globalCtx->envCtx.screenFillColor[0] = 255;
+ globalCtx->envCtx.screenFillColor[1] = 0;
+ globalCtx->envCtx.screenFillColor[2] = 0;
+ if (cmd->base == 3) {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f;
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
+ }
+ break;
+
+ case 4:
+ case 8:
+ globalCtx->envCtx.screenFillColor[0] = 0;
+ globalCtx->envCtx.screenFillColor[1] = 255;
+ globalCtx->envCtx.screenFillColor[2] = 0;
+ if (cmd->base == 4) {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f;
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
+ }
+ break;
+
+ case 9:
+ gSaveContext.unk_3F48 = 1;
+ break;
+
+ case 10:
+ case 11:
+ globalCtx->envCtx.screenFillColor[0] = 0;
+ globalCtx->envCtx.screenFillColor[1] = 0;
+ globalCtx->envCtx.screenFillColor[2] = 0;
+ if (cmd->base == 10) {
+ globalCtx->envCtx.screenFillColor[3] = (1.0f - temp_f0) * 255.0f;
+ } else {
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
+ }
+ break;
+
+ case 12:
+ globalCtx->envCtx.screenFillColor[0] = (160.0f * (1.0f - temp_f0));
+ globalCtx->envCtx.screenFillColor[1] = globalCtx->envCtx.screenFillColor[0];
+ globalCtx->envCtx.screenFillColor[2] = globalCtx->envCtx.screenFillColor[0];
+ globalCtx->envCtx.screenFillColor[3] = 255;
+ break;
+
+ case 13:
+ globalCtx->envCtx.screenFillColor[0] = (160.0f * temp_f0);
+ globalCtx->envCtx.screenFillColor[1] = globalCtx->envCtx.screenFillColor[0];
+ globalCtx->envCtx.screenFillColor[2] = globalCtx->envCtx.screenFillColor[0];
+ globalCtx->envCtx.screenFillColor[3] = 255;
+ break;
+ }
+ }
+}
+
+// Command 0x5A: Camera
+s32 Cutscene_Command_Camera(GlobalContext* globalCtx, u8* cmd) {
+ s32 sp1C = 0;
+
+ bcopy(cmd, &sp1C, sizeof(s32));
+ cmd += sizeof(s32);
+ if (func_8016A168() == 0) {
+ func_80161998(cmd, &sCutsceneCameraInfo);
+ }
+ return sp1C + sizeof(s32);
+}
+
+/**
+ * Counts how many masks the player has
+ * The count doesn't include transformation masks
+ */
+s32 Cutscene_CountNormalMasks(void) {
+ s32 count = 0;
+
+ if (INV_CONTENT(ITEM_MASK_TRUTH) == ITEM_MASK_TRUTH) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_KAFEIS_MASK) == ITEM_MASK_KAFEIS_MASK) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_ALL_NIGHT) == ITEM_MASK_ALL_NIGHT) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_BUNNY) == ITEM_MASK_BUNNY) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_KEATON) == ITEM_MASK_KEATON) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_GARO) == ITEM_MASK_GARO) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_CIRCUS_LEADER) == ITEM_MASK_CIRCUS_LEADER) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_POSTMAN) == ITEM_MASK_POSTMAN) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_COUPLE) == ITEM_MASK_COUPLE) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_GREAT_FAIRY) == ITEM_MASK_GREAT_FAIRY) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_DON_GERO) == ITEM_MASK_DON_GERO) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_CAPTAIN) == ITEM_MASK_CAPTAIN) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_STONE) == ITEM_MASK_STONE) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_BREMEN) == ITEM_MASK_BREMEN) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_BLAST) == ITEM_MASK_BLAST) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_SCENTS) == ITEM_MASK_SCENTS) {
+ count++;
+ }
+ if (INV_CONTENT(ITEM_MASK_GIANT) == ITEM_MASK_GIANT) {
+ count++;
+ }
+
+ return count;
+}
+
+// Command 0xA: Textbox
+void Cutscene_Command_Textbox(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdTextbox* cmd) {
+ static s32 D_801BB160 = CS_TEXTBOX_TYPE_DEFAULT;
+ u8 dialogState;
+ s32 pad;
+ u16 originalCsFrames;
+ s32 pad2;
+
+ if ((cmd->startFrame >= csCtx->frames) || ((cmd->endFrame < csCtx->frames))) {
+ return;
+ }
+
+ if (cmd->type != CS_TEXTBOX_TYPE_LEARN_SONG) {
+ if (D_801BB124 != cmd->base) {
+ if (D_801BB160 == CS_TEXTBOX_TYPE_3) {
+ csCtx->frames--;
+ }
+ D_801BB160 = CS_TEXTBOX_TYPE_1;
+ D_801BB124 = cmd->base;
+ if (cmd->type == CS_TEXTBOX_TYPE_BOSSES_REMAINS) {
+ if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) &&
+ CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) {
+ if (cmd->textId1 != 0xFFFF) {
+ Message_StartTextbox(globalCtx, cmd->textId1, NULL);
+ }
+ } else {
+ Message_StartTextbox(globalCtx, cmd->base, NULL);
+ }
+ } else if (cmd->type == CS_TEXTBOX_TYPE_ALL_NORMAL_MASKS) {
+ if (Cutscene_CountNormalMasks() == 20) {
+ if (cmd->textId1 != 0xFFFF) {
+ Message_StartTextbox(globalCtx, cmd->textId1, NULL);
+ }
+ } else {
+ Message_StartTextbox(globalCtx, cmd->base, NULL);
+ }
+ } else {
+ Message_StartTextbox(globalCtx, cmd->base, NULL);
+ }
+ } else {
+ goto else_label;
+ }
+ } else if (D_801BB128 != cmd->base) {
+ D_801BB160 = CS_TEXTBOX_TYPE_LEARN_SONG;
+ D_801BB128 = cmd->base;
+ func_80152434(globalCtx, cmd->base);
+ } else {
+ else_label:
+ if (csCtx->frames >= cmd->endFrame) {
+ // The Textbox command can change the current cutscene frame, mainly to prevent advancing the cutscene when
+ // a textbox that is expected to be closed by the user is still open.
+
+ originalCsFrames = csCtx->frames;
+ dialogState = Message_GetState(&globalCtx->msgCtx);
+ if ((dialogState != 2) && (dialogState != 0) && (dialogState != 7) && (dialogState != 8)) {
+ csCtx->frames--;
+ if ((dialogState == 4) && func_80147624(globalCtx)) {
+ if (globalCtx->msgCtx.choiceIndex == 0) {
+ if (cmd->base == 0x33BD) {
+ func_8019F230();
+ }
+
+ if (cmd->textId1 != 0xFFFF) {
+ func_80151938(globalCtx, cmd->textId1);
+ if (cmd->type == CS_TEXTBOX_TYPE_3) {
+ D_801BB160 = CS_TEXTBOX_TYPE_3;
+ if (cmd->textId2 != 0xFFFF) {
+ csCtx->frames++;
+ }
+ }
+ } else {
+ func_801477B4(globalCtx);
+ csCtx->frames++;
+ }
+ } else {
+ if (cmd->base == 0x33BD) {
+ func_8019F208();
+ }
+
+ if (cmd->textId2 != 0xFFFF) {
+ func_80151938(globalCtx, cmd->textId2);
+ if (cmd->type == CS_TEXTBOX_TYPE_3) {
+ D_801BB160 = CS_TEXTBOX_TYPE_3;
+ if (cmd->textId1 != 0xFFFF) {
+ csCtx->frames++;
+ }
+ }
+ } else {
+ func_801477B4(globalCtx);
+ csCtx->frames++;
+ }
+ }
+ }
+
+ if (dialogState == 5 && func_80147624(globalCtx) != 0) {
+ func_80152434(globalCtx, cmd->base);
+ }
+ }
+
+ if ((dialogState == 2) && (D_801BB160 == CS_TEXTBOX_TYPE_3)) {
+ csCtx->frames--;
+ D_801BB124++;
+ }
+
+ if (originalCsFrames == csCtx->frames) {
+ Interface_ChangeAlpha(1);
+ D_801BB124 = 0;
+ D_801BB128 = 0;
+ func_80161C0C();
+ } else {
+ func_80161BE0(1);
+ }
+ }
+ }
+}
+
+// Related to actorActions. Maybe a generic actorAction setter?
+void func_800ECD7C(CutsceneContext* csCtx, u8** cutscenePtr, s16 index) {
+ s32 i;
+ s32 count;
+
+ bcopy(*cutscenePtr, &count, sizeof(s32));
+ *cutscenePtr += sizeof(s32);
+
+ for (i = 0; i < count; i++) {
+ CsCmdActorAction* actorAction = *(CsCmdActorAction**)cutscenePtr;
+
+ if ((csCtx->frames >= actorAction->startFrame) && (csCtx->frames < actorAction->endFrame)) {
+ csCtx->actorActions[index] = actorAction;
+ }
+
+ *cutscenePtr += sizeof(CsCmdActorAction);
+ }
+}
+
+#ifdef NON_MATCHING
+// Some stack issues, and a few instructions in the "wrong" places
+/**
+ * Loops over the cutscene data itself (`cutscenePtr`), applying the effects of each command instantaneously (for most
+ * commands).
+ *
+ * The cutscene data is an irregularly-structured array of words, which is made up of
+ * - A beginning, which contains the number of command lists of this cutscene and the ending frame (see
+ * `CS_BEGIN_CUTSCENE`).
+ * - Any number of cutscene command lists (which should be the number specified in the beginning), each one of which
+ * contains commands of the corresponding category.
+ * - A end marker (see `CS_END`).
+ *
+ * This function iterates over each command list until either it has processed the number of command lists stated on
+ * `CS_BEGIN_CUTSCENE` or until it finds a end marker.
+ *
+ * A command list starts with a pair of words containing the command category and a count of how many commands this list
+ * has (N). This is followed by N commands of the said category. (The exception is Camera, which has the length of the
+ * list in bytes instead of the number of commands).
+ *
+ * For most command lists categories (all but the actorActions and Camera commands):
+ * - For each command list found, read the number of commands and loop over them, passing each one to the corresponding
+ * function which handles the command, applying its effects and checking the frame range stored in the command.
+ *
+ * This function is invoked once per frame that a cutscene is active.
+ *
+ * TODO: consider changing the type of `cutscenePtr` to `uintptr_t` when this function matches.
+ */
+void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr) {
+ s32 i;
+ s16 phi_s0;
+ s32 totalEntries;
+ s32 j;
+ u32 cmdType; // sp5C
+ s32 pad;
+ s32 cmdEntries; // sp58
+ s32 cutsceneEndFrame; // sp50
+ s16 phi_s0_23;
+ CsCmdBase* cmd;
+
+ // Read the command list count and the ending frame for this cutscene
+ bcopy(cutscenePtr, &totalEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ bcopy(cutscenePtr, &cutsceneEndFrame, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+
+ if (((u16)cutsceneEndFrame < csCtx->frames) && (globalCtx->sceneLoadFlag != 0x14) && (csCtx->state != CS_STATE_4)) {
+ csCtx->state = CS_STATE_3;
+ return;
+ }
+
+ // Loop over every command list
+ for (i = 0; i < totalEntries; i++) {
+ // Read the command type of the current command list.
+ bcopy(cutscenePtr, &cmdType, sizeof(u32));
+ cutscenePtr += sizeof(u32);
+
+ // TODO: This should probably be added to the CutsceneCmd enum. Consider doing it when this function matches.
+ if (cmdType == 0xFFFFFFFF) {
+ break;
+ }
+
+ // Check special cases of command types. This are generic ActorActions
+ // Ranges: [0x64, 0x96), 0xC9, [0x1C2, 0x258)
+ if (((cmdType >= 100) && (cmdType < 150)) || (cmdType == 201) || ((cmdType >= 450) && (cmdType < 600))) {
+ for (phi_s0 = 0; phi_s0 < ARRAY_COUNT(D_801F4DC8); phi_s0++) {
+ if ((u16)cmdType == D_801F4DC8[phi_s0]) {
+ func_800ECD7C(csCtx, &cutscenePtr, phi_s0);
+ cmdType = -2;
+ break;
+ } else if (D_801F4DC8[phi_s0] == 0) {
+ D_801F4DC8[phi_s0] = cmdType;
+ func_800ECD7C(csCtx, &cutscenePtr, phi_s0);
+ cmdType = -2;
+ break;
+ }
+ }
+ }
+
+ switch (cmdType) {
+ case CS_CMD_MISC:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_Misc(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_SET_LIGHTING:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_SetLighting(globalCtx, csCtx, (CsCmdEnvLighting*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdEnvLighting);
+ }
+ break;
+
+ case CS_CMD_PLAYSEQ:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_PlaySequence(globalCtx, csCtx, (CsCmdSequenceChange*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdSequenceChange);
+ }
+ break;
+
+ case CS_CMD_STOPSEQ:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_StopSequence(globalCtx, csCtx, (CsCmdSequenceChange*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdSequenceChange);
+ }
+ break;
+
+ case CS_CMD_FADESEQ:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_FadeSequence(globalCtx, csCtx, (CsCmdSequenceFade*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdSequenceFade);
+ }
+ break;
+
+ case CS_CMD_PLAYAMBIENCE:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_PlayAmbienceSequence(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_FADEAMBIENCE:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_FadeAmbienceSequence(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_130:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ func_800EAD48(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_131:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ func_800EAD7C(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_132:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ func_800EADB0(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_RUMBLE:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_Rumble(globalCtx, csCtx, (CsCmdRumble*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdRumble);
+ }
+ break;
+
+ case CS_CMD_FADESCREEN:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_FadeColorScreen(globalCtx, csCtx, (CsCmdFadeScreen*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdFadeScreen);
+ }
+ break;
+
+ case CS_CMD_SETTIME:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_SetTime(globalCtx, csCtx, (CsCmdDayTime*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdDayTime);
+ }
+ break;
+
+ case CS_CMD_SET_PLAYER_ACTION:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ cmd = (CsCmdBase*)cutscenePtr;
+ if ((csCtx->frames >= cmd->startFrame) && (csCtx->frames < cmd->endFrame)) {
+ csCtx->playerAction = (CsCmdActorAction*)cutscenePtr;
+ }
+ cutscenePtr += sizeof(CsCmdActorAction);
+ }
+ break;
+
+ case CS_CMD_CAMERA:
+ cutscenePtr = &cutscenePtr[Cutscene_Command_Camera(globalCtx, cutscenePtr)];
+ break;
+
+ case CS_CMD_TERMINATOR:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_Terminator(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_CHOOSE_CREDITS_SCENES:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_ChooseCreditsScenes(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_TEXTBOX:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ cmd = (CsCmdBase*)cutscenePtr;
+ if (cmd->base != 0xFFFF) {
+ Cutscene_Command_Textbox(globalCtx, csCtx, (CsCmdTextbox*)cutscenePtr);
+ }
+ cutscenePtr += sizeof(CsCmdTextbox);
+ }
+ break;
+
+ case CS_CMD_SCENE_TRANS_FX:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_TransitionFX(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_MOTIONBLUR:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_MotionBlur(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case CS_CMD_GIVETATL:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ Cutscene_Command_GiveTatlToPlayer(globalCtx, csCtx, (CsCmdBase*)cutscenePtr);
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+
+ case -2:
+ break;
+
+ default:
+ bcopy(cutscenePtr, &cmdEntries, sizeof(s32));
+ cutscenePtr += sizeof(s32);
+ for (j = 0; j < cmdEntries; j++) {
+ cutscenePtr += sizeof(CsCmdBase);
+ }
+ break;
+ }
+ }
+}
+#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_ProcessCommands.s")
+#endif
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800ED980.s")
+/* End of command handling section */
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800ED9C4.s")
+void func_800ED980(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (gSaveContext.cutscene >= 0xFFF0) {
+ csCtx->frames++;
+ Cutscene_ProcessCommands(globalCtx, csCtx, (u8*)globalCtx->csCtx.csData);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDA04.s")
+void func_800ED9C4(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (func_800EA220(globalCtx, csCtx, 0.0f)) {
+ Audio_SetCutsceneFlag(false);
+ csCtx->state = CS_STATE_0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDA84.s")
+// unused
+void func_800EDA04(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if (func_800EA220(globalCtx, csCtx, 0.0f)) {
+ s16 i;
+ csCtx->playerAction = NULL;
+
+ for (i = 0; i < ARRAY_COUNT(csCtx->actorActions); i++) {
+ csCtx->actorActions[i] = NULL;
+ }
+
+ gSaveContext.cutscene = 0;
+ gSaveContext.gameMode = 0;
+ ActorCutscene_Stop(0x7F);
+ Audio_SetCutsceneFlag(false);
+ csCtx->state = CS_STATE_0;
+ }
+}
+
+void func_800EDA84(GlobalContext* globalCtx, CutsceneContext* csCtx) {
+ if ((gSaveContext.cutsceneTrigger != 0) && (csCtx->state == CS_STATE_0) && !Player_InCsMode(&globalCtx->state)) {
+ gSaveContext.cutscene = 0xFFFD;
+ }
+
+ if ((gSaveContext.cutscene >= 0xFFF0) && (csCtx->state == CS_STATE_0)) {
+ s16 i;
+
+ D_801BB124 = 0;
+ D_801BB128 = 0;
+ csCtx->playerAction = NULL;
+
+ for (i = 0; i < ARRAY_COUNT(csCtx->actorActions); i++) {
+ csCtx->actorActions[i] = NULL;
+ }
+
+ csCtx->state++;
+ if (csCtx->state == CS_STATE_1) {
+ Audio_SetCutsceneFlag(true);
+
+ csCtx->frames = 0xFFFF;
+ csCtx->csCamId = ActorCutscene_GetCurrentCamera(0x7F);
+ func_8016119C(Play_GetCamera(globalCtx, csCtx->csCamId), &sCutsceneCameraInfo);
+ csCtx->unk_18 = 0xFFFF;
+
+ if (gSaveContext.cutsceneTrigger == 0) {
+ Interface_ChangeAlpha(1);
+ ShrinkWindow_SetLetterboxTarget(32);
+ ShrinkWindow_SetLetterboxMagnitude(0x20);
+ csCtx->state++;
+ }
+
+ func_800ED980(globalCtx, csCtx);
+ }
+
+ gSaveContext.cutsceneTrigger = 0;
+ }
+}
+
+#ifdef NON_MATCHING
+// HandleFlags?
+// regalloc
+void func_800EDBE0(GlobalContext* globalCtx) {
+ CutsceneEntry* temp_a3;
+ s16 sp2A;
+ SceneTableEntry* sp24;
+ s32 temp_v0_3;
+
+ if (((gSaveContext.gameMode == 0) || (gSaveContext.gameMode == 1)) && (gSaveContext.respawnFlag <= 0)) {
+ sp2A = func_800F21CC();
+ if (sp2A != -1) {
+ temp_v0_3 = func_800F2138(sp2A);
+ if (temp_v0_3 != -1) {
+ temp_a3 = ((void)0, globalCtx->csCtx.sceneCsList);
+ if ((temp_a3[temp_v0_3].unk7 != 0xFF) && (gSaveContext.respawnFlag == 0)) {
+ if (temp_a3[temp_v0_3].unk7 == 0xFE) {
+ ActorCutscene_Start(sp2A, NULL);
+ gSaveContext.showTitleCard = false;
+ } else if (!((1 << (temp_a3[temp_v0_3].unk7 % 8)) &
+ gSaveContext.weekEventReg[temp_a3[temp_v0_3].unk7 / 8])) {
+ gSaveContext.weekEventReg[(temp_a3[temp_v0_3].unk7 / 8)] |= 1 << (temp_a3[temp_v0_3].unk7 % 8);
+ ActorCutscene_Start(sp2A, NULL);
+ gSaveContext.showTitleCard = false;
+ }
+ }
+ } else {
+ ActorCutscene_StartAndSetUnkLinkFields(sp2A, NULL);
+ }
+ }
+ }
+
+ if ((gSaveContext.respawnFlag == 0) || (gSaveContext.respawnFlag == -2)) {
+ sp24 = globalCtx->loadedScene;
+ if ((sp24->titleTextId != 0) && gSaveContext.showTitleCard) {
+ if ((Entrance_GetTransitionFlags(gSaveContext.sceneSetupIndex + gSaveContext.entranceIndex) & 0x4000) !=
+ 0) {
+ func_80151A68(globalCtx, sp24->titleTextId);
+ }
+ }
+
+ gSaveContext.showTitleCard = true;
+ }
+}
+#else
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDBE0.s")
+#endif
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/nop_800EDDB0.s")
+void func_800EDDB0(GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDDBC.s")
+void func_800EDDBC(UNK_TYPE arg0, UNK_TYPE arg1) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDDCC.s")
+void Cutscene_LoadCutsceneData(GlobalContext* globalCtx, u8 csIndex) {
+ if (dREG(95) == 0) {
+ globalCtx->csCtx.currentCsIndex = csIndex;
+ globalCtx->csCtx.csData = Lib_SegmentedToVirtual(globalCtx->csCtx.sceneCsList[csIndex].segmentedData);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDE34.s")
+ gSaveContext.cutsceneTrigger = 1;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDF24.s")
+/* Start of actor utilities section */
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EDF78.s")
+/**
+ * Interpolates the actor's position based on the corresponding actor action's position
+ * and the current cutscene frame
+ */
+void Cutscene_ActorTranslate(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex) {
+ Vec3f start;
+ Vec3f end;
+ CsCmdActorAction* entry = globalCtx->csCtx.actorActions[actorActionIndex];
+ f32 progress;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EE0CC.s")
+ start.x = entry->startPos.x;
+ start.y = entry->startPos.y;
+ start.z = entry->startPos.z;
+ end.x = entry->endPos.x;
+ end.y = entry->endPos.y;
+ end.z = entry->endPos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EE1D8.s")
+ progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, globalCtx->csCtx.frames);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EE200.s")
+ VEC3F_LERPIMPDST(&actor->world.pos, &start, &end, progress);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EE29C.s")
+/**
+ * Interpolates the actor's position based on the corresponding actor action's position
+ * and the current cutscene frame, and sets the actor's yaw using the actor action yaw
+ */
+void Cutscene_ActorTranslateAndYaw(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex) {
+ Cutscene_ActorTranslate(actor, globalCtx, actorActionIndex);
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/func_800EE2F4.s")
+ actor->world.rot.y = globalCtx->csCtx.actorActions[actorActionIndex]->urot.y;
+ actor->shape.rot.y = actor->world.rot.y;
+}
+
+/**
+ * Interpolates the actor's position and yaw based on the corresponding actor action's
+ * position and the current cutscene frame
+ */
+void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex) {
+ Vec3f start;
+ Vec3f end;
+ CsCmdActorAction* entry;
+ f32 progress;
+
+ start.x = globalCtx->csCtx.actorActions[actorActionIndex]->startPos.x;
+ start.y = globalCtx->csCtx.actorActions[actorActionIndex]->startPos.y;
+ start.z = globalCtx->csCtx.actorActions[actorActionIndex]->startPos.z;
+ end.x = globalCtx->csCtx.actorActions[actorActionIndex]->endPos.x;
+ end.y = globalCtx->csCtx.actorActions[actorActionIndex]->endPos.y;
+ end.z = globalCtx->csCtx.actorActions[actorActionIndex]->endPos.z;
+
+ entry = globalCtx->csCtx.actorActions[actorActionIndex];
+ progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, globalCtx->csCtx.frames);
+
+ VEC3F_LERPIMPDST(&actor->world.pos, &start, &end, progress);
+
+ Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&start, &end), 10, 1000, 1);
+ actor->shape.rot.y = actor->world.rot.y;
+}
+
+/**
+ * Interpolates the actor's XZ position and yaw based on the corresponding actor action's
+ * position and the current cutscene frame
+ */
+void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, GlobalContext* globalCtx, s32 actorActionIndex) {
+ Vec3f start;
+ Vec3f end;
+ CsCmdActorAction* entry;
+ f32 progress;
+
+ start.x = globalCtx->csCtx.actorActions[actorActionIndex]->startPos.x;
+ start.z = globalCtx->csCtx.actorActions[actorActionIndex]->startPos.z;
+ end.x = globalCtx->csCtx.actorActions[actorActionIndex]->endPos.x;
+ end.z = globalCtx->csCtx.actorActions[actorActionIndex]->endPos.z;
+
+ entry = globalCtx->csCtx.actorActions[actorActionIndex];
+ progress = Environment_LerpWeight(entry->endFrame, entry->startFrame, globalCtx->csCtx.frames);
+
+ actor->world.pos.x = start.x + (end.x - start.x) * progress;
+ actor->world.pos.z = start.z + (end.z - start.z) * progress;
+
+ Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&start, &end), 10, 1000, 1);
+ actor->shape.rot.y = actor->world.rot.y;
+}
+
+s32 Cutscene_GetSceneSetupIndex(GlobalContext* globalCtx) {
+ s32 sceneSetupIndex = 0;
+
+ if (gSaveContext.sceneSetupIndex > 0) {
+ sceneSetupIndex = gSaveContext.sceneSetupIndex;
+ }
+ return sceneSetupIndex;
+}
+
+s32 Cutscene_GetActorActionIndex(GlobalContext* globalCtx, u16 actorActionCmd) {
+ s32 i;
+ s32 index = -1;
+
+ for (i = 0; i < ARRAY_COUNT(D_801F4DC8); i++) {
+ if (actorActionCmd == D_801F4DC8[i]) {
+ index = i;
+ }
+ }
+
+ return index;
+}
+
+s32 Cutscene_CheckActorAction(GlobalContext* globalCtx, u16 actorActionCmd) {
+ if (globalCtx->csCtx.state != CS_STATE_0) {
+ s32 index = Cutscene_GetActorActionIndex(globalCtx, actorActionCmd);
+
+ if (index != -1) {
+ return globalCtx->csCtx.actorActions[index] != NULL;
+ }
+ }
+
+ return false;
+}
+
+u8 Cutscene_IsPlaying(GlobalContext* globalCtx) {
+ return (gSaveContext.cutsceneTrigger != 0) || (globalCtx->csCtx.state != CS_STATE_0);
+}
+
+/* End of actor utilities section */
diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c
index 8875343662..b17799aff5 100644
--- a/src/code/z_eff_blure.c
+++ b/src/code/z_eff_blure.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
EffectBlureElement* elem;
@@ -720,8 +721,8 @@ void EffectBlure_SetupSimpleAlt(GraphicsContext* gfxCtx, EffectBlure* this, Vtx*
gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE);
gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gDPLoadTextureBlock(POLY_XLU_DISP++, D_04014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0, G_TX_NOMIRROR | G_TX_CLAMP,
- G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0,
+ G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL0, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE,
ENVIRONMENT, COMBINED, ENVIRONMENT, 0, 0, 0, COMBINED);
diff --git a/src/code/z_eff_shield_particle.c b/src/code/z_eff_shield_particle.c
index 05669d63ad..e3a051fb4e 100644
--- a/src/code/z_eff_shield_particle.c
+++ b/src/code/z_eff_shield_particle.c
@@ -2,6 +2,7 @@
#include "vt.h"
#include "assets/code/eff_shield_particle/eff_shield_particle.c"
+#include "objects/gameplay_keep/gameplay_keep.h"
void EffectShieldParticle_Init(void* thisx, void* initParamsx) {
EffectShieldParticle* this = (EffectShieldParticle*)thisx;
@@ -154,8 +155,8 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) {
gDPPipeSync(POLY_XLU_DISP++);
gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gDPLoadTextureBlock(POLY_XLU_DISP++, D_04054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPSetCombineLERP(POLY_XLU_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, PRIMITIVE, 0, TEXEL0, 0, 0, 0,
0, COMBINED, 0, 0, 0, COMBINED);
@@ -183,7 +184,7 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) {
}
SkinMatrix_SetTranslate(&spC4, this->position.x, this->position.y, this->position.z);
- SkinMatrix_SetRotateRPY(&sp104, 0, elem->yaw, 0);
+ SkinMatrix_SetRotateRPY(&sp104, 0, elem->yaw, MTXMODE_NEW);
SkinMatrix_MtxFMtxFMult(&spC4, &sp104, &sp84);
SkinMatrix_SetRotateRPY(&sp104, 0, 0, elem->pitch);
SkinMatrix_MtxFMtxFMult(&sp84, &sp104, &spC4);
diff --git a/src/code/z_eff_spark.c b/src/code/z_eff_spark.c
index 27ed1443db..697c553987 100644
--- a/src/code/z_eff_spark.c
+++ b/src/code/z_eff_spark.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
void EffectSpark_Init(void* thisx, void* initParamsx) {
EffectSpark* this = (EffectSpark*)thisx;
@@ -152,8 +153,8 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) {
gDPPipeSync(POLY_XLU_DISP++);
gSPTexture(POLY_XLU_DISP++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
- gDPLoadTextureBlock(POLY_XLU_DISP++, D_04054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
- G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock(POLY_XLU_DISP++, gameplay_keep_Tex_054F20, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPSetCombineMode(POLY_XLU_DISP++, G_CC_SHADEDECALA, G_CC_PASS2);
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
diff --git a/src/code/z_eff_tire_mark.c b/src/code/z_eff_tire_mark.c
index 517ee52512..532e8e2fb0 100644
--- a/src/code/z_eff_tire_mark.c
+++ b/src/code/z_eff_tire_mark.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
void func_800AE930(CollisionContext* colCtx, EffectTireMark* this, Vec3f* pos, f32 arg3, s16 arg4,
CollisionPoly* colPoly, s32 arg6) {
@@ -233,7 +234,7 @@ void EffectTireMark_Draw(void* thisx, GraphicsContext* gfxCtx) {
POLY_OPA_DISP = Gfx_CallSetupDL(POLY_OPA_DISP++, 0x2C);
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
- gDPLoadTextureBlock(POLY_OPA_DISP++, D_04014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0,
+ gDPLoadTextureBlock(POLY_OPA_DISP++, gameplay_keep_Tex_014570, G_IM_FMT_I, G_IM_SIZ_8b, 64, 32, 0,
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_WRAP, 6, 5, G_TX_NOLOD, G_TX_NOLOD);
gDPSetCombineLERP(POLY_OPA_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED, 0, 0, 0,
@@ -255,11 +256,12 @@ void EffectTireMark_Draw(void* thisx, GraphicsContext* gfxCtx) {
if ((elem - 1)->flags & 1) {
if (!(elem->flags & 1)) {
+ s32 requiredScopeTemp;
+
vtx[i * 2 + 0].v.tc[0] = 0;
vtx[i * 2 + 0].v.tc[1] = 0;
vtx[i * 2 + 1].v.tc[0] = 0;
vtx[i * 2 + 1].v.tc[1] = 1024;
- dummy_label:;
} else if ((i >= 2) && !((elem - 2)->flags & 1)) {
vtx[i * 2 - 2].v.tc[0] = 0;
vtx[i * 2 - 2].v.tc[1] = 0;
diff --git a/src/code/z_effect_soft_sprite.c b/src/code/z_effect_soft_sprite.c
index 11545da016..43307bbc8a 100644
--- a/src/code/z_effect_soft_sprite.c
+++ b/src/code/z_effect_soft_sprite.c
@@ -255,9 +255,12 @@ void EffectSS_DrawAllParticles(GlobalContext* globalCtx) {
for (i = 0; i < sEffectSsInfo.size; i++) {
if (sEffectSsInfo.data_table[i].life > -1) {
- if ((sEffectSsInfo.data_table[i].pos.x > 32000.0f) || (sEffectSsInfo.data_table[i].pos.x < -32000.0f) ||
- (sEffectSsInfo.data_table[i].pos.y > 32000.0f) || (sEffectSsInfo.data_table[i].pos.y < -32000.0f) ||
- (sEffectSsInfo.data_table[i].pos.z > 32000.0f) || (sEffectSsInfo.data_table[i].pos.z < -32000.0f)) {
+ if ((sEffectSsInfo.data_table[i].pos.x > BGCHECK_Y_MAX) ||
+ (sEffectSsInfo.data_table[i].pos.x < BGCHECK_Y_MIN) ||
+ (sEffectSsInfo.data_table[i].pos.y > BGCHECK_Y_MAX) ||
+ (sEffectSsInfo.data_table[i].pos.y < BGCHECK_Y_MIN) ||
+ (sEffectSsInfo.data_table[i].pos.z > BGCHECK_Y_MAX) ||
+ (sEffectSsInfo.data_table[i].pos.z < BGCHECK_Y_MIN)) {
EffectSS_Delete(&sEffectSsInfo.data_table[i]);
} else {
EffectSS_DrawParticle(globalCtx, i);
diff --git a/src/code/z_en_hy.c b/src/code/z_en_hy_code.c
similarity index 65%
rename from src/code/z_en_hy.c
rename to src/code/z_en_hy_code.c
index e0c4872628..915687125c 100644
--- a/src/code/z_en_hy.c
+++ b/src/code/z_en_hy_code.c
@@ -3,78 +3,79 @@
* Description: Unused System for NPCs (includes animation, door interaction, blinking, pathing, and collider helpers)
*/
-#include "global.h"
+#include "z_en_hy_code.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_aob/object_aob.h"
+#include "objects/object_bba/object_bba.h"
+#include "objects/object_bji/object_bji.h"
+#include "objects/object_boj/object_boj.h"
+#include "objects/object_os_anime/object_os_anime.h"
-extern AnimationHeader D_0600007C;
-extern AnimationHeader D_0600066C;
-extern AnimationHeader D_0600071C;
-extern AnimationHeader D_060008C0;
-extern AnimationHeader D_06000AB0;
-extern AnimationHeader D_06000FDC;
-extern AnimationHeader D_06001494;
-extern AnimationHeader D_06001908;
-extern AnimationHeader D_06001EE0;
-extern AnimationHeader D_06005DC4;
-extern AnimationHeader D_06005D9C;
-extern AnimationHeader D_0600DED8;
-extern AnimationHeader D_0600F920;
-extern AnimationHeader D_0600FC1C;
-extern AnimationHeader D_0600FEE4;
-extern AnimationHeader D_06010330;
-
-static ActorAnimationEntryS animations[] = {
- { &D_0600007C, 1.0f, 0, -1, 0, 0 }, { &D_06001494, 1.0f, 0, -1, 0, 0 }, { &D_06001494, 1.0f, 0, -1, 0, -8 },
- { &D_06001908, 1.0f, 0, -1, 0, 0 }, { &D_06001908, 1.0f, 0, -1, 0, -8 }, { &D_060008C0, 1.0f, 0, -1, 0, 0 },
- { &D_06005DC4, 1.0f, 0, -1, 0, 0 }, { &D_06000FDC, 1.0f, 0, -1, 0, 0 }, { &D_06000AB0, 1.0f, 0, -1, 0, -8 },
- { &D_0600066C, 1.0f, 0, -1, 0, 0 }, { &D_0600071C, 1.0f, 0, -1, 0, 0 }, { &D_06001EE0, 1.0f, 0, -1, 0, 0 },
- { &D_0600DED8, 1.5f, 0, -1, 2, 0 }, { &D_0600F920, 1.5f, 0, -1, 2, 0 }, { &D_0600FC1C, 1.0f, 0, -1, 0, 0 },
- { &D_0600FEE4, 1.0f, 0, -1, 0, 0 }, { &D_06010330, 1.0f, 0, -1, 0, 0 }, { &D_0600FC1C, 1.0f, 0, -1, 0, -8 },
- { &D_0600FEE4, 1.0f, 0, -1, 0, -8 }, { &D_06010330, 1.0f, 0, -1, 0, -8 }, { &D_06005D9C, 1.0f, 0, -1, 0, -8 },
+static AnimationInfoS sAnimations[] = {
+ { &object_aob_Anim_00007C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_001494, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_boj_Anim_001908, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_001908, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_boj_Anim_0008C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gBbaIdleHoldingBagAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_bji_Anim_000FDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_bji_Anim_000AB0, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_bji_Anim_00066C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_00071C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_os_anime_Anim_001EE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_00DED8, 1.5f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_boj_Anim_00F920, 1.5f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_boj_Anim_00FC1C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_00FEE4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_010330, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_boj_Anim_00FC1C, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_boj_Anim_00FEE4, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_boj_Anim_010330, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
+ { &object_boj_Anim_005D9C, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
};
-s8 D_801BC3F0[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2 };
+s8 gEnHyBodyParts[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2 };
-s8 D_801BC400[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13, 0 };
+s8 gEnHyBodyPartsIndex[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13 };
-u8 D_801BC410[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+u8 gEnHyShadowSize[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
s32 isChanged = false;
- if (animIndex >= 0 && animIndex <= 20) {
+ if (animIndex >= ENHY_ANIMATION_AOB_0 && animIndex < ENHY_ANIMATION_MAX) {
isChanged = true;
- frameCount = animations[animIndex].frameCount;
+ frameCount = sAnimations[animIndex].frameCount;
if (frameCount < 0) {
- frameCount = Animation_GetLastFrame(&animations[animIndex].animationSeg->common);
+ frameCount = Animation_GetLastFrame(&sAnimations[animIndex].animation->common);
}
- Animation_Change(skelAnime, animations[animIndex].animationSeg, animations[animIndex].playbackSpeed,
- animations[animIndex].frame, frameCount, animations[animIndex].mode,
- animations[animIndex].transitionRate);
+ Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
+ sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
+ sAnimations[animIndex].morphFrames);
}
return isChanged;
}
-//! @TODO: Return Door instance when c and h files are split
-Actor* EnHy_FindNearestDoor(Actor* actor, GlobalContext* globalCtx) {
- Actor* nearestDoor = NULL;
+EnDoor* EnHy_FindNearestDoor(Actor* actor, GlobalContext* globalCtx) {
+ EnDoor* nearestDoor = NULL;
Actor* doorIter = NULL;
- Actor* door;
f32 dist;
+ EnDoor* door;
s32 isSetup = false;
f32 minDist = 0.0f;
do {
doorIter = SubS_FindActor(globalCtx, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
- door = doorIter;
- dist = Actor_DistanceBetweenActors(actor, door);
+ door = (EnDoor*)doorIter;
+ dist = Actor_DistanceBetweenActors(actor, &door->dyna.actor);
if (!isSetup || (dist < minDist)) {
nearestDoor = door;
minDist = dist;
isSetup = true;
}
- doorIter = door->next;
+ doorIter = door->dyna.actor.next;
} while (doorIter != NULL);
if (1) {}
@@ -111,42 +112,44 @@ void EnHy_Blink(EnHy* enHy, s32 eyeTexMaxIndex) {
s32 EnHy_Init(EnHy* enHy, GlobalContext* globalCtx, FlexSkeletonHeader* skeletonHeaderSeg, s16 animIndex) {
s32 isInitialized = false;
- if ((func_8013D8DC(enHy->animObjIndex, globalCtx) == 1) && (func_8013D8DC(enHy->unk190, globalCtx) == 1) &&
- (func_8013D8DC(enHy->unk191, globalCtx) == 1) && (func_8013D8DC(enHy->unk192, globalCtx) == 1)) {
- enHy->actor.objBankIndex = enHy->unk192;
+ if ((SubS_IsObjectLoaded(enHy->animObjIndex, globalCtx) == true) &&
+ (SubS_IsObjectLoaded(enHy->headObjIndex, globalCtx) == true) &&
+ (SubS_IsObjectLoaded(enHy->skelUpperObjIndex, globalCtx) == true) &&
+ (SubS_IsObjectLoaded(enHy->skelLowerObjIndex, globalCtx) == true)) {
+ enHy->actor.objBankIndex = enHy->skelLowerObjIndex;
isInitialized = true;
ActorShape_Init(&enHy->actor.shape, 0.0f, NULL, 0.0f);
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[enHy->actor.objBankIndex].segment);
SkelAnime_InitFlex(globalCtx, &enHy->skelAnime, skeletonHeaderSeg, NULL, enHy->jointTable, enHy->morphTable,
- 16);
+ ENHY_LIMB_MAX);
EnHy_ChangeObjectAndAnim(enHy, globalCtx, animIndex);
}
+
return isInitialized;
}
-//! @TODO: Should just take EnDoor instead of actor when c and h are split
-void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, Actor* door, s16 arg3, s16 arg4) {
+void func_800F0BB4(EnHy* enHy, GlobalContext* globalCtx, EnDoor* door, s16 arg3, s16 arg4) {
s32 pad;
- s8 sp3B;
+ s8 animIndex;
Vec3f offset;
f32 phi_f0;
- Actor_OffsetOfPointInActorCoords(door, &offset, &enHy->actor.world.pos);
+ Actor_OffsetOfPointInActorCoords(&door->dyna.actor, &offset, &enHy->actor.world.pos);
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
- sp3B = ((s8)phi_f0 < 0) ? 0 : 2;
- EnHy_ChangeObjectAndAnim(enHy, globalCtx, (sp3B == 0) ? arg3 : arg4);
+ animIndex = ((s8)phi_f0 < 0) ? 0 : 2;
+ EnHy_ChangeObjectAndAnim(enHy, globalCtx, (animIndex == 0) ? arg3 : arg4);
enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable;
enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable;
enHy->skelAnime.moveFlags |= 3;
AnimationContext_SetMoveActor(globalCtx, &enHy->actor, &enHy->skelAnime, 1.0f);
- ((EnDoor*)door)->unk_1A1 = 1;
- ((EnDoor*)door)->unk_1A0 = sp3B;
+ door->unk_1A1 = 1;
+ door->animIndex = animIndex;
}
s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3, s16 arg4, f32 arg5) {
s32 ret = false;
s16 yaw;
- Actor* door;
+ EnDoor* door;
s32 pad;
if (func_8013D68C(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
@@ -154,7 +157,7 @@ s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3
if (door != NULL) {
ret = true;
func_800F0BB4(enHy, globalCtx, door, arg3, arg4);
- yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->world.pos);
+ yaw = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
enHy->actor.world.pos.x += arg5 * Math_SinS(yaw);
enHy->actor.world.pos.z += arg5 * Math_CosS(yaw);
enHy->actor.world.rot.y = -yaw;
@@ -168,7 +171,7 @@ s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3
s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
s32 ret = false;
s32 pad;
- Actor* door;
+ EnDoor* door;
enHy->curPoint = 0;
if (func_8013D68C(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
@@ -176,10 +179,10 @@ s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
if (door != NULL) {
ret = true;
func_800F0BB4(enHy, globalCtx, door, arg2, arg3);
- enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->world.pos);
+ enHy->actor.shape.rot.y = Math_Vec3f_Yaw(&enHy->actor.world.pos, &door->dyna.actor.world.pos);
enHy->actor.world.rot.y = enHy->actor.shape.rot.y;
enHy->actor.gravity = 0.0f;
- enHy->actor.flags &= ~1;
+ enHy->actor.flags &= ~ACTOR_FLAG_1;
}
}
return ret;
@@ -187,16 +190,16 @@ s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
s32 EnHy_SetPointFowards(EnHy* enHy, GlobalContext* globalCtx, f32 gravity, s16 animIndex) {
enHy->actor.gravity = gravity;
- enHy->actor.flags |= 1;
+ enHy->actor.flags |= ACTOR_FLAG_1;
EnHy_ChangeObjectAndAnim(enHy, globalCtx, animIndex);
enHy->curPoint++;
- return 0;
+ return false;
}
s32 EnHy_SetPointBackwards(EnHy* enHy, GlobalContext* globalCtx, s16 animIndex) {
EnHy_ChangeObjectAndAnim(enHy, globalCtx, animIndex);
enHy->curPoint--;
- return 0;
+ return false;
}
s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) {
@@ -212,6 +215,7 @@ s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) {
reachedEnd = true;
}
}
+
return reachedEnd;
}
@@ -228,6 +232,7 @@ s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget) {
reachedEnd = true;
}
}
+
return reachedEnd;
}
@@ -267,5 +272,6 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 distAboveThr
if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) {
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
}
- return 0;
+
+ return false;
}
diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c
index 2f0668c668..5dc1f92a21 100644
--- a/src/code/z_en_item00.c
+++ b/src/code/z_en_item00.c
@@ -1,4 +1,6 @@
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_gi_hearts/object_gi_hearts.h"
#define FLAGS 0x00000000
@@ -693,12 +695,12 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
}
-UNK_PTR D_801ADF30[5] = {
- &D_04061FC0, // Green rupee
- &D_04061FE0, // Blue rupee
- &D_04062000, // Red rupee
- &D_04062040, // Orange rupee
- &D_04062020 // Purple rupee
+TexturePtr D_801ADF30[] = {
+ gameplay_keep_Tex_061FC0, // Green rupee
+ gameplay_keep_Tex_061FE0, // Blue rupee
+ gameplay_keep_Tex_062000, // Red rupee
+ gameplay_keep_Tex_062040, // Orange rupee
+ gameplay_keep_Tex_062020 // Purple rupee
};
void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
@@ -720,24 +722,24 @@ void EnItem00_DrawRupee(EnItem00* this, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_801ADF30[iconNb]));
- gSPDisplayList(POLY_OPA_DISP++, &D_040622C0); // TODO symbol
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0622C0); // TODO symbol
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-UNK_PTR D_801ADF44[12] = {
- &D_0405E6F0, // Heart (Not used)
- &D_0405CEF0, // Bombs (A), Bombs (0)
- &D_0405BEF0, // Arrows (10)
- &D_0405B6F0, // Arrows (30)
- &D_0405C6F0, // Arrows (40), Arrows (50)
- &D_0405CEF0, // Bombs (B)
- &D_040607C0, // Nuts (1), Nuts (10)
- &D_04060FC0, // Sticks (1)
- &D_040617C0, // Magic (Large)
- &D_0405FFC0, // Magic (Small)
+TexturePtr D_801ADF44[12] = {
+ gameplay_keep_Tex_05E6F0, // Heart (Not used)
+ gameplay_keep_Tex_05CEF0, // Bombs (A), Bombs (0)
+ gameplay_keep_Tex_05BEF0, // Arrows (10)
+ gameplay_keep_Tex_05B6F0, // Arrows (30)
+ gameplay_keep_Tex_05C6F0, // Arrows (40), Arrows (50)
+ gameplay_keep_Tex_05CEF0, // Bombs (B)
+ gameplay_keep_Tex_0607C0, // Nuts (1), Nuts (10)
+ gameplay_keep_Tex_060FC0, // Sticks (1)
+ gameplay_keep_Tex_0617C0, // Magic (Large)
+ gameplay_keep_Tex_05FFC0, // Magic (Small)
NULL,
- &D_0405F7C0 // Small Key
+ gameplay_keep_Tex_05F7C0 // Small Key
};
void EnItem00_DrawSprite(EnItem00* this, GlobalContext* globalCtx) {
@@ -764,14 +766,11 @@ void EnItem00_DrawSprite(EnItem00* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_OPA_DISP++, D_0405F6F0);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-extern Gfx D_06001290[];
-extern Gfx D_06001470[];
-
void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) {
s32 pad;
s32 pad2;
@@ -784,8 +783,8 @@ void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_XLU_DISP++, D_06001290);
- gSPDisplayList(POLY_XLU_DISP++, D_06001470);
+ gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001290);
+ gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001470);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -801,7 +800,7 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD);
- gSPDisplayList(POLY_XLU_DISP++, D_0405AAB0);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_05AAB0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1131,7 +1130,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
Actor_SetScale(&spawnedActor->actor, 0.0f);
spawnedActor->actionFunc = func_800A6780;
- spawnedActor->actor.flags = spawnedActor->actor.flags | 0x10;
+ spawnedActor->actor.flags = spawnedActor->actor.flags | ACTOR_FLAG_10;
if ((spawnedActor->actor.params != ITEM00_SMALL_KEY) &&
(spawnedActor->actor.params != ITEM00_HEART_PIECE) &&
(spawnedActor->actor.params != ITEM00_HEART_CONTAINER)) {
diff --git a/src/code/z_fireobj.c b/src/code/z_fireobj.c
index 2cf05e02a0..c6b6a3f9c1 100644
--- a/src/code/z_fireobj.c
+++ b/src/code/z_fireobj.c
@@ -157,7 +157,7 @@ void FireObj_Draw(GlobalContext* globalCtx, FireObj* fire) {
gDPSetEnvColor(POLY_XLU_DISP++, lightParams->envColor.r, lightParams->envColor.g, lightParams->envColor.b, 0);
vec.x = 0;
- vec.y = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x8000;
+ vec.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000;
vec.z = 0;
Matrix_SetStateRotationAndTranslation(fire->position.x, fire->position.y, fire->position.z, &vec);
Matrix_Scale(fire->xScale, fire->yScale, 1.0f, MTXMODE_APPLY);
@@ -236,13 +236,13 @@ void FireObj_Update(GlobalContext* globalCtx, FireObj* fire, Actor* actor) {
FireObj_UpdateStateTransitions(globalCtx, fire);
if (fire->state == 3) {
- if ((fire->collision.base.acFlags & 2) && (fire->collision.info.acHitInfo->toucher.dmgFlags & 0x800)) {
+ if ((fire->collision.base.acFlags & AC_HIT) && (fire->collision.info.acHitInfo->toucher.dmgFlags & 0x800)) {
FireObj_SetState(fire, fire->dynamicSizeStep, 0);
}
- } else if ((fire->collision.base.acFlags & 2) && (arrow->actor.update != NULL) &&
+ } else if ((fire->collision.base.acFlags & AC_HIT) && (arrow->actor.update != NULL) &&
(arrow->actor.id == ACTOR_EN_ARROW)) {
arrow->actor.params = 0;
- arrow->unk_1C0 = 0x800;
+ arrow->collider.info.toucher.dmgFlags = 0x800;
}
fire->collision.dim.pos.x = fire->position.x;
fire->collision.dim.pos.y = fire->position.y;
diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c
index c611ab1f87..7b9254ccd3 100644
--- a/src/code/z_jpeg.c
+++ b/src/code/z_jpeg.c
@@ -16,6 +16,9 @@
#define MARKER_COM 0xFE
#define MARKER_EOI 0xD9
+extern u64 njpgdspMainTextStart[];
+extern u64 njpgdspMainDataStart[];
+
/**
* Configures and schedules a JPEG decoder task and waits for it to finish.
*/
@@ -25,9 +28,9 @@ void Jpeg_ScheduleDecoderTask(JpegContext* jpegCtx) {
0, // flags
NULL, // ucode_boot
0, // ucode_boot_size
- gJpegUCode, // ucode
+ njpgdspMainTextStart, // ucode
0x1000, // ucode_size
- gJpegUCodeData, // ucode_data
+ njpgdspMainDataStart, // ucode_data
0x800, // ucode_data_size
NULL, // dram_stack
0, // dram_stack_size
diff --git a/src/code/z_kaleido_scope_call.c b/src/code/z_kaleido_scope_call.c
index b6d46eba16..c3c616669e 100644
--- a/src/code/z_kaleido_scope_call.c
+++ b/src/code/z_kaleido_scope_call.c
@@ -1,3 +1,4 @@
+#include "prevent_bss_reordering.h"
#include "global.h"
void (*sKaleidoScopeUpdateFunc)(GlobalContext* globalCtx);
diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c
index b678642b18..2a4849ccb0 100644
--- a/src/code/z_kanfont.c
+++ b/src/code/z_kanfont.c
@@ -19,11 +19,13 @@ void Font_LoadMessageBoxEndIcon(Font* font, u16 icon) {
FONT_CHAR_TEX_SIZE);
}
-static u8 sFontOrdering[] = "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19"
- "!\"#$%&\'()*+,-./0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "\x00\x0D\x0E\x1A"
- "afjmosvwxyz{|}~"
- "\x7F\x80\x81\x84\x86\x87\x88\x89\x8A\x8B\x8C";
+static u8 sFontOrdering[] = {
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
+ 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x41, 0x42,
+ 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55,
+ 0x56, 0x57, 0x58, 0x59, 0x5A, 0x00, 0x0D, 0x0E, 0x1A, 0x61, 0x66, 0x6A, 0x6D, 0x6F, 0x73, 0x76, 0x77, 0x78, 0x79,
+ 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F, 0x80, 0x81, 0x84, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C,
+};
void Font_LoadOrderedFont(Font* font) {
u32 loadOffset;
@@ -36,7 +38,7 @@ void Font_LoadOrderedFont(Font* font) {
if (sFontOrdering[codePointIndex] == 0) {
loadOffset = 0;
}
- // UB to convert pointer to u32
+
DmaMgr_SendRequest0(writeLocation, (uintptr_t)SEGMENT_ROM_START(nes_font_static) + loadOffset,
FONT_CHAR_TEX_SIZE);
if (sFontOrdering[codePointIndex] == 0x8C) {
diff --git a/src/code/z_kankyo.c b/src/code/z_kankyo.c
index 6221e09107..ad66fe4a18 100644
--- a/src/code/z_kankyo.c
+++ b/src/code/z_kankyo.c
@@ -8,7 +8,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F5954.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F5A8C.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_LerpWeight.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F5B10.s")
@@ -64,7 +64,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FB010.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FB320.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_AddLightningBolts.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800FB388.s")
diff --git a/src/code/z_lib.c b/src/code/z_lib.c
index 84eb8c051c..d9300deda3 100644
--- a/src/code/z_lib.c
+++ b/src/code/z_lib.c
@@ -371,7 +371,7 @@ void Math_Vec3f_DistXYZAndStoreNormDiff(Vec3f* a, Vec3f* b, f32 scale, Vec3f* de
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b) {
Vec3f diff;
Math_Vec3f_Diff(b, a, &diff);
- return sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z));
+ return sqrtf(SQXYZ(diff));
}
f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest) {
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index 738f9373e2..386adeb13b 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "interface/parameter_static/parameter_static.h"
static s16 sHeartsPrimColors[3][3] = { { 255, 70, 50 }, { 255, 190, 0 }, { 100, 100, 255 } };
static s16 sHeartsEnvColors[3][3] = { { 50, 40, 60 }, { 255, 0, 0 }, { 0, 0, 255 } };
@@ -14,24 +15,21 @@ s16 sBeatingHeartsDDEnv[3];
s16 sHeartsDDPrim[2][3];
s16 sHeartsDDEnv[2][3];
-extern TexturePtr D_02000000; // Empty heart texture
-extern TexturePtr D_02000100; // Quarter Heart Texture
-extern TexturePtr D_02000200; // Half Heart Texture
-extern TexturePtr D_02000300; // Three Quarter Heart Texture
-extern TexturePtr D_02000400; // Full heart texture
-extern TexturePtr D_02000500; // Empty Double Defense Heart texture
-extern TexturePtr D_02000600; // Quarter Double Defense Heart Texture
-extern TexturePtr D_02000700; // Half Double Defense Heart Texture
-extern TexturePtr D_02000800; // Three Quarter Double Defense Heart Texture
-extern TexturePtr D_02000900; // Full Double Defense Heart texture
+TexturePtr HeartTextures[] = {
+ gHeartFullTex, gHeartQuarterTex, gHeartQuarterTex, gHeartQuarterTex,
+ gHeartQuarterTex, gHeartQuarterTex, gHeartHalfTex, gHeartHalfTex,
+ gHeartHalfTex, gHeartHalfTex, gHeartHalfTex, gHeartThreeQuarterTex,
+ gHeartThreeQuarterTex, gHeartThreeQuarterTex, gHeartThreeQuarterTex, gHeartThreeQuarterTex,
+};
-TexturePtr HeartTextures[] = { &D_02000400, &D_02000100, &D_02000100, &D_02000100, &D_02000100, &D_02000100,
- &D_02000200, &D_02000200, &D_02000200, &D_02000200, &D_02000200, &D_02000300,
- &D_02000300, &D_02000300, &D_02000300, &D_02000300 };
-
-TexturePtr HeartDDTextures[] = { &D_02000900, &D_02000600, &D_02000600, &D_02000600, &D_02000600, &D_02000600,
- &D_02000700, &D_02000700, &D_02000700, &D_02000700, &D_02000700, &D_02000800,
- &D_02000800, &D_02000800, &D_02000800, &D_02000800 };
+TexturePtr HeartDDTextures[] = {
+ gDefenseHeartFullTex, gDefenseHeartQuarterTex, gDefenseHeartQuarterTex,
+ gDefenseHeartQuarterTex, gDefenseHeartQuarterTex, gDefenseHeartQuarterTex,
+ gDefenseHeartHalfTex, gDefenseHeartHalfTex, gDefenseHeartHalfTex,
+ gDefenseHeartHalfTex, gDefenseHeartHalfTex, gDefenseHeartThreeQuarterTex,
+ gDefenseHeartThreeQuarterTex, gDefenseHeartThreeQuarterTex, gDefenseHeartThreeQuarterTex,
+ gDefenseHeartThreeQuarterTex,
+};
void LifeMeter_Init(GlobalContext* globalCtx) {
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
@@ -276,11 +274,11 @@ void LifeMeter_Draw(GlobalContext* globalCtx) {
}
if (i < fullHeartCount) {
- heartTex = &D_02000400;
+ heartTex = gHeartFullTex;
} else if (i == fullHeartCount) {
heartTex = HeartTextures[fractionHeartCount];
} else {
- heartTex = &D_02000000;
+ heartTex = gHeartEmptyTex;
}
} else {
if (i < fullHeartCount) {
@@ -316,11 +314,11 @@ void LifeMeter_Draw(GlobalContext* globalCtx) {
gDPSetEnvColor(OVERLAY_DISP++, sHeartsDDEnv[1][0], sHeartsDDEnv[1][1], sHeartsDDEnv[1][2], 255);
}
if (i < fullHeartCount) {
- heartTex = &D_02000900;
+ heartTex = gDefenseHeartFullTex;
} else if (i == fullHeartCount) {
heartTex = HeartDDTextures[fractionHeartCount];
} else {
- heartTex = &D_02000500;
+ heartTex = gDefenseHeartEmptyTex;
}
}
diff --git a/src/code/z_lights.c b/src/code/z_lights.c
index fae6af51e1..615e11e690 100644
--- a/src/code/z_lights.c
+++ b/src/code/z_lights.c
@@ -1,4 +1,5 @@
#include "global.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type) {
info->type = type;
@@ -412,13 +413,12 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
dl = func_8012C7FC(POLY_XLU_DISP);
- gSPSetOtherMode(dl++, G_SETOTHERMODE_H, 4, 4,
- 0x00000080); //! This doesn't resolve to any of the macros in gdi.h
+ gDPSetDither(dl++, G_CD_NOISE);
gDPSetCombineLERP(dl++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
- gSPDisplayList(dl++, D_04029CB0);
+ gSPDisplayList(dl++, gameplay_keep_DL_029CB0);
do {
if (light->info->type == LIGHT_POINT_GLOW) {
@@ -434,7 +434,7 @@ void Lights_DrawGlow(GlobalContext* globalCtx) {
gSPMatrix(dl++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(dl++, D_04029CF0);
+ gSPDisplayList(dl++, gameplay_keep_DL_029CF0);
}
}
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 84f2ab951c..0eceeee309 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -64,7 +64,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_801514B0.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_801518B0.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/Message_StartTextbox.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_message/func_80151938.s")
diff --git a/src/code/z_olib.c b/src/code/z_olib.c
index c44fac2767..6f1cdbc552 100644
--- a/src/code/z_olib.c
+++ b/src/code/z_olib.c
@@ -66,7 +66,7 @@ Vec3f* OLib_Vec3fDistNormalize(Vec3f* dest, Vec3f* a, Vec3f* b) {
v1.y = b->y - a->y;
v1.z = b->z - a->z;
- dist = OLib_ClampMinDist(sqrtf(SQ(v1.x) + SQ(v1.y) + SQ(v1.z)), 0.01f);
+ dist = OLib_ClampMinDist(sqrtf(SQXYZ(v1)), 0.01f);
v2.x = v1.x / dist;
v2.y = v1.y / dist;
diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c
index ec227aaa9c..44b1de152d 100644
--- a/src/code/z_parameter.c
+++ b/src/code/z_parameter.c
@@ -72,9 +72,9 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114CA0.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114E90.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_HasEmptyBottle.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114F2C.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_HasItemInBottle.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80114FD0.s")
diff --git a/src/code/z_play.c b/src/code/z_play.c
index 7e0e018c74..a14359be70 100644
--- a/src/code/z_play.c
+++ b/src/code/z_play.c
@@ -74,41 +74,41 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169474.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801694DC.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CreateSubCamera.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetActiveCameraIndex.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetActiveCamId.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169590.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraChangeStatus.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169600.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_ClearCamera.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169668.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_ClearAllSubCameras.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCamera.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetAtEye.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_8016981C.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetAtEyeUp.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169940.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetFov.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169988.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraSetRoll.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_801699D4.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CopyCamera.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169A50.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169AC0.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraChangeSetting.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169AFC.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169BC4.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_CameraGetUID.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169BF8.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169C64.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCsCamDataSetting.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/func_80169C84.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s")
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c
index 99253188cb..cb3d14e8b2 100644
--- a/src/code/z_player_lib.c
+++ b/src/code/z_player_lib.c
@@ -68,7 +68,7 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123C58.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123C90.s")
+#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/Player_SetEquipmentData.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_80123D50.s")
diff --git a/src/code/z_quake.c b/src/code/z_quake.c
index e699ff0862..ee4fa3a6d6 100644
--- a/src/code/z_quake.c
+++ b/src/code/z_quake.c
@@ -1,7 +1,7 @@
#include "global.h"
QuakeRequest sQuakeRequest[4];
-Quake2Context sQuake2Context;
+DistortionContext sDistortionContext;
static s16 sIsQuakeInitialized = true;
static s16 sQuakeRequestCount = 0;
@@ -137,7 +137,7 @@ QuakeRequest* Quake_AddImpl(Camera* camera, u32 callbackIdx) {
__osMemset(req, 0, sizeof(QuakeRequest));
req->camera = camera;
- req->cameraPtrsIdx = camera->thisIdx;
+ req->camId = camera->camId;
req->callbackIdx = callbackIdx;
req->isShakePerpendicular = true;
req->randIdx = ((s16)(Rand_ZeroOne() * (f32)0x10000) & ~3) + idx;
@@ -326,10 +326,10 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) {
req = &sQuakeRequest[idx];
if (req->callbackIdx != 0) {
- if (globalCtx->cameraPtrs[req->cameraPtrsIdx] == NULL) {
+ if (globalCtx->cameraPtrs[req->camId] == NULL) {
Quake_Remove(req);
} else {
- eq = (camera->thisIdx != req->camera->thisIdx);
+ eq = (camera->camId != req->camera->camId);
absSpeedDiv = ABS(req->speed) / (f32)0x8000;
if (sQuakeCallbacks[req->callbackIdx](req, &shake) == 0) {
Quake_Remove(req);
@@ -382,58 +382,62 @@ s16 Quake_Calc(Camera* camera, QuakeCamCalc* camData) {
return ret;
}
-void Quake2_Init(GlobalContext* globalCtx) {
- sQuake2Context.globalCtx = globalCtx;
- View_ClearQuake(&globalCtx->view);
- sQuake2Context.type = 0;
- sQuake2Context.countdown = 0;
- sQuake2Context.state = QUAKE2_INACTIVE;
+void Distortion_Init(GlobalContext* globalCtx) {
+ sDistortionContext.globalCtx = globalCtx;
+ View_ClearDistortion(&globalCtx->view);
+ sDistortionContext.type = 0;
+ sDistortionContext.countdown = 0;
+ sDistortionContext.state = DISTORTION_INACTIVE;
}
-void Quake2_SetCountdown(s16 countdown) {
- sQuake2Context.countdown = countdown;
- sQuake2Context.state = QUAKE2_SETUP;
+void Distortion_SetCountdown(s16 countdown) {
+ sDistortionContext.countdown = countdown;
+ sDistortionContext.state = DISTORTION_SETUP;
}
-s16 Quake2_GetCountdown(void) {
- return sQuake2Context.countdown;
+s16 Distortion_GetCountdown(void) {
+ return sDistortionContext.countdown;
}
-s16 Quake2_GetType(void) {
- return sQuake2Context.type;
+s16 Distortion_GetType(void) {
+ return sDistortionContext.type;
}
-void Quake2_SetType(s32 type) {
- if (sQuake2Context.type < type) {
- sQuake2Context.type = type;
+void Distortion_SetType(s32 type) {
+ if (sDistortionContext.type < type) {
+ sDistortionContext.type = type;
}
}
-void Quake2_ClearType(s32 type) {
- if (sQuake2Context.type == type) {
- sQuake2Context.type = 0;
+void Distortion_ClearType(s32 type) {
+ if (sDistortionContext.type == type) {
+ sDistortionContext.type = 0;
}
}
-s32 Quake2_GetFloorQuake(Player* player) {
- if (!SurfaceType_IsConveyor(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId)) {
- return SurfaceType_GetConveyorSpeed(&sQuake2Context.globalCtx->colCtx, player->actor.floorPoly,
+/**
+ * Checks that the bg surface is an underwater conveyor type and if so, returns the conveyor speed
+ */
+s32 Distortion_GetUnderwaterCurrentSpeed(Player* player) {
+ if (SurfaceType_GetConveyorType(&sDistortionContext.globalCtx->colCtx, player->actor.floorPoly,
+ player->actor.floorBgId) == CONVEYOR_WATER) {
+ return SurfaceType_GetConveyorSpeed(&sDistortionContext.globalCtx->colCtx, player->actor.floorPoly,
player->actor.floorBgId);
}
return 0;
}
-void Quake2_Update(void) {
- static s16 angle1 = 0x3F0;
- static s16 angle2 = 0x156;
+void Distortion_Update(void) {
+ static s16 depthPhase = 0x3F0;
+ static s16 screenPlanePhase = 0x156;
static s16 countdownMax = 1;
f32 xyScaleFactor;
f32 zScaleFactor;
f32 speedScaleFactor;
f32 countdownRatio;
f32 waterYScaleFactor;
- f32 angle1Speed;
- f32 angle2Speed;
+ f32 depthPhaseStep;
+ f32 screenPlanePhaseStep;
f32 rotX;
f32 rotY;
f32 rotZ;
@@ -442,181 +446,210 @@ void Quake2_Update(void) {
f32 zScale;
f32 speed;
Player* player;
- GlobalContext* globalCtx = sQuake2Context.globalCtx;
+ GlobalContext* globalCtx = sDistortionContext.globalCtx;
PosRot playerPosRot;
Camera* camera = GET_ACTIVE_CAM(globalCtx);
f32 speedRatio = CLAMP_MAX(camera->speedRatio, 1.0f);
- if (sQuake2Context.type != 0) {
- if (sQuake2Context.type & 0x800) {
- sQuake2Context.countdown = 2;
- angle1 = 0x3F0;
- angle2 = 0x156;
- angle1Speed = 0.0f;
- angle2Speed = 170.0f;
+ if (sDistortionContext.type != 0) {
+ if (sDistortionContext.type & 0x800) {
+ sDistortionContext.countdown = 2;
+ depthPhase = 0x3F0;
+ screenPlanePhase = 0x156;
+
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 170.0f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.0f;
+
xScale = -0.01f;
yScale = 0.01f;
zScale = 0.0f;
+
speed = 0.6f;
- xyScaleFactor = zScaleFactor = sQuake2Context.countdown / 60.0f;
+ xyScaleFactor = zScaleFactor = sDistortionContext.countdown / 60.0f;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x400) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x3F0;
- angle2 = 0x156;
+ } else if (sDistortionContext.type & 0x400) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x3F0;
+ screenPlanePhase = 0x156;
}
- angle1Speed = 0.0f;
- angle2Speed = 50.0f / countdownMax;
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 50.0f / countdownMax;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.0f;
+
xScale = 0.01f;
yScale = 100.0f;
zScale = 0.0f;
+
speed = 0.4f;
- xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax;
+ xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
speedScaleFactor = 0.5f;
- } else if (sQuake2Context.type & 0x200) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x1FC;
- angle2 = 0x156;
+ } else if (sDistortionContext.type & 0x200) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x1FC;
+ screenPlanePhase = 0x156;
}
- angle1Speed = -5.0f;
- angle2Speed = 5.0f;
+ depthPhaseStep = -5.0f;
+ screenPlanePhaseStep = 5.0f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 2.0f;
+
xScale = 0.3f;
yScale = 0.3f;
zScale = 0.0f;
+
speed = 0.1f;
- xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax;
+ xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x100) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x2710;
- angle2 = 0x3E8;
+ } else if (sDistortionContext.type & 0x100) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x2710;
+ screenPlanePhase = 0x3E8;
}
- angle1Speed = 0.0f;
- angle2Speed = 150.0f;
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 150.0f;
+
rotX = 0;
rotY = 0;
rotZ = 0.2f;
+
xScale = 0.025f;
yScale = 0.02f;
zScale = 0.01f;
+
speed = 1.5f;
- if (sQuake2Context.countdown < 5) {
- xyScaleFactor = zScaleFactor = ((f32)countdownMax - sQuake2Context.countdown) / (f32)countdownMax;
+ if (sDistortionContext.countdown < 5) {
+ xyScaleFactor = zScaleFactor = ((f32)countdownMax - sDistortionContext.countdown) / (f32)countdownMax;
} else {
xyScaleFactor = zScaleFactor = 0.0f;
}
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x80) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x4B0;
- angle2 = 0x7D0;
+ } else if (sDistortionContext.type & 0x80) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x4B0;
+ screenPlanePhase = 0x7D0;
}
- angle1Speed = 0.0f;
- angle2Speed = 150.0f;
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 150.0f;
+
rotX = 0;
rotY = 0;
rotZ = 0;
+
xScale = 0.03f;
yScale = 0.02f;
zScale = 0.01f;
+
speed = 1.5f;
- xyScaleFactor = zScaleFactor = sQuake2Context.countdown / (f32)countdownMax;
+ xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x40) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x9C4;
- angle2 = 0xBB8;
+ } else if (sDistortionContext.type & 0x40) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x9C4;
+ screenPlanePhase = 0xBB8;
}
- angle1Speed = 0.0f;
- angle2Speed = 150.0f;
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 150.0f;
+
rotX = 0;
rotY = 0;
rotZ = 0;
+
xScale = 0.03f;
yScale = 0.03f;
zScale = 0.01f;
+
speed = 1.3f;
- if (sQuake2Context.countdown < 4) {
- xyScaleFactor = zScaleFactor = sQuake2Context.countdown / (f32)countdownMax;
+ if (sDistortionContext.countdown < 4) {
+ xyScaleFactor = zScaleFactor = sDistortionContext.countdown / (f32)countdownMax;
} else {
xyScaleFactor = zScaleFactor = 0.0f;
}
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x20) {
- sQuake2Context.countdown = 2;
- if (sQuake2Context.state == QUAKE2_SETUP) {
- angle1 = 0x9C4;
- angle2 = 0xBB8;
+ } else if (sDistortionContext.type & 0x20) {
+ sDistortionContext.countdown = 2;
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ depthPhase = 0x9C4;
+ screenPlanePhase = 0xBB8;
}
- angle1 += 0xB1;
- angle2 -= 0x2B;
- angle1Speed = -107.0f;
- angle2Speed = 158.0f;
+ depthPhase += 0xB1;
+ screenPlanePhase -= 0x2B;
+
+ depthPhaseStep = -107.0f;
+ screenPlanePhaseStep = 158.0f;
+
rotX = 0.2f;
rotY = 1.7f;
rotZ = -2.9f;
+
xScale = -0.6f;
yScale = -0.7f;
zScale = 0.6f;
+
speed = 0.2f;
zScaleFactor = 1.0f;
xyScaleFactor = 1.0f;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 0x10) {
- if (sQuake2Context.state == QUAKE2_SETUP) {
- countdownMax = sQuake2Context.countdown;
- angle1 = 0x760;
- angle2 = 0x1BC;
+ } else if (sDistortionContext.type & 0x10) {
+ if (sDistortionContext.state == DISTORTION_SETUP) {
+ countdownMax = sDistortionContext.countdown;
+ depthPhase = 0x760;
+ screenPlanePhase = 0x1BC;
}
- angle1Speed = 248.0f;
- angle2Speed = -90.0f;
+ depthPhaseStep = 248.0f;
+ screenPlanePhaseStep = -90.0f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.0f;
+
xScale = -0.4f;
yScale = 0.4f;
zScale = 0.2f;
+
speed = 0.25f;
- countdownRatio = sQuake2Context.countdown / (f32)countdownMax;
+ countdownRatio = sDistortionContext.countdown / (f32)countdownMax;
zScaleFactor = xyScaleFactor = countdownRatio;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 8) {
- angle1 = 0x3F0;
- angle2 = 0x156;
- sQuake2Context.countdown = 2;
+ } else if (sDistortionContext.type & 8) {
+ depthPhase = 0x3F0;
+ screenPlanePhase = 0x156;
+
+ sDistortionContext.countdown = 2;
player = GET_PLAYER(globalCtx);
if (&player->actor != NULL) {
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
}
- angle1Speed = 359.2f;
- angle2Speed = -18.5f;
+ depthPhaseStep = 359.2f;
+ screenPlanePhaseStep = -18.5f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.3f;
- switch (Quake2_GetFloorQuake(player)) {
+
+ switch (Distortion_GetUnderwaterCurrentSpeed(player)) {
case 3:
xScale = -0.06f;
yScale = 0.1f;
@@ -650,17 +683,20 @@ void Quake2_Update(void) {
}
zScaleFactor = -xyScaleFactor;
speedScaleFactor = 1.0f;
- } else if (sQuake2Context.type & 4) {
- angle1 = 0x3F0;
- angle2 = 0x156;
- sQuake2Context.countdown = 2;
+ } else if (sDistortionContext.type & 4) {
+ depthPhase = 0x3F0;
+ screenPlanePhase = 0x156;
+
+ sDistortionContext.countdown = 2;
player = GET_PLAYER(globalCtx);
- angle1Speed = 359.2f;
- angle2Speed = -18.5f;
+
+ depthPhaseStep = 359.2f;
+ screenPlanePhaseStep = -18.5f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.0f;
- switch (Quake2_GetFloorQuake(player)) {
+ switch (Distortion_GetUnderwaterCurrentSpeed(player)) {
case 3:
xScale = 0.12f;
yScale = 0.12f;
@@ -695,18 +731,23 @@ void Quake2_Update(void) {
xyScaleFactor = speedScaleFactor = (waterYScaleFactor * 0.15f) + 0.35f + (speedRatio * 0.4f);
zScaleFactor = 0.9f - xyScaleFactor;
- } else if (sQuake2Context.type & 1) {
- angle1 = 0x3F0;
- angle2 = 0x156;
- sQuake2Context.countdown = 2;
- angle1Speed = 0.0f;
- angle2Speed = 150.0f;
+ } else if (sDistortionContext.type & 1) {
+ // Gives a small mirage-like appearance
+ depthPhase = 0x3F0;
+ screenPlanePhase = 0x156;
+
+ sDistortionContext.countdown = 2;
+ depthPhaseStep = 0.0f;
+ screenPlanePhaseStep = 150.0f;
+
rotX = 0.0f;
rotY = 0.0f;
rotZ = 0.0f;
+
xScale = -0.01f;
yScale = 0.01f;
zScale = 0.01f;
+
speed = 0.6f;
speedScaleFactor = 1.0f;
zScaleFactor = 1.0f;
@@ -715,26 +756,32 @@ void Quake2_Update(void) {
return;
}
- angle1 += DEGF_TO_BINANG(angle1Speed);
- angle2 += DEGF_TO_BINANG(angle2Speed);
- View_SetQuakeRotation(&sQuake2Context.globalCtx->view, Math_CosS(angle1) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
- Math_SinS(angle1) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
- Math_SinS(angle2) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
- View_SetQuakeScale(&sQuake2Context.globalCtx->view, (Math_SinS(angle2) * (xScale * xyScaleFactor)) + 1.0f,
- (Math_CosS(angle2) * (yScale * xyScaleFactor)) + 1.0f,
- (Math_CosS(angle1) * (zScale * zScaleFactor)) + 1.0f);
- View_SetQuakeSpeed(&sQuake2Context.globalCtx->view, speed * speedScaleFactor);
- sQuake2Context.state = QUAKE2_ACTIVE;
- } else if (sQuake2Context.state != QUAKE2_INACTIVE) {
- View_ClearQuake(&globalCtx->view);
- sQuake2Context.state = QUAKE2_INACTIVE;
- sQuake2Context.countdown = 0;
+ depthPhase += DEGF_TO_BINANG(depthPhaseStep);
+ screenPlanePhase += DEGF_TO_BINANG(screenPlanePhaseStep);
+
+ View_SetDistortionDirRot(&sDistortionContext.globalCtx->view,
+ Math_CosS(depthPhase) * (DEGF_TO_RADF(rotX) * xyScaleFactor),
+ Math_SinS(depthPhase) * (DEGF_TO_RADF(rotY) * xyScaleFactor),
+ Math_SinS(screenPlanePhase) * (DEGF_TO_RADF(rotZ) * zScaleFactor));
+ View_SetDistortionScale(&sDistortionContext.globalCtx->view,
+ (Math_SinS(screenPlanePhase) * (xScale * xyScaleFactor)) + 1.0f,
+ (Math_CosS(screenPlanePhase) * (yScale * xyScaleFactor)) + 1.0f,
+ (Math_CosS(depthPhase) * (zScale * zScaleFactor)) + 1.0f);
+ View_SetDistortionSpeed(&sDistortionContext.globalCtx->view, speed * speedScaleFactor);
+
+ sDistortionContext.state = DISTORTION_ACTIVE;
+
+ } else if (sDistortionContext.state != DISTORTION_INACTIVE) {
+ View_ClearDistortion(&globalCtx->view);
+
+ sDistortionContext.state = DISTORTION_INACTIVE;
+ sDistortionContext.countdown = 0;
}
- if (sQuake2Context.countdown != 0) {
- sQuake2Context.countdown--;
- if (sQuake2Context.countdown == 0) {
- sQuake2Context.type = 0;
+ if (sDistortionContext.countdown != 0) {
+ sDistortionContext.countdown--;
+ if (sDistortionContext.countdown == 0) {
+ sDistortionContext.type = 0;
}
}
}
diff --git a/src/code/z_room.c b/src/code/z_room.c
index 1685acc80e..67c6c61586 100644
--- a/src/code/z_room.c
+++ b/src/code/z_room.c
@@ -75,12 +75,10 @@ void Room_Init(GlobalContext* globalCtx, RoomContext* roomCtx) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/Room_AllocateAndLoad.s")
-#ifdef NON_MATCHING
s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtx, s32 index) {
- size_t size;
-
- // XXX: this should use a branch-likely
if (roomCtx->unk31 == 0) {
+ s32 size;
+
roomCtx->prevRoom = roomCtx->currRoom;
roomCtx->currRoom.num = index;
roomCtx->currRoom.segment = NULL;
@@ -101,9 +99,6 @@ s32 Room_StartRoomTransition(GlobalContext* globalCtx, RoomContext* roomCtx, s32
return 0;
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_room/Room_StartRoomTransition.s")
-#endif
s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
if (roomCtx->unk31 == 1) {
@@ -119,7 +114,7 @@ s32 Room_HandleLoadCallbacks(GlobalContext* globalCtx, RoomContext* roomCtx) {
if (((globalCtx->sceneNum != SCENE_IKANA) || (roomCtx->currRoom.num != 1)) &&
(globalCtx->sceneNum != SCENE_IKNINSIDE)) {
- globalCtx->envCtx.unk_C3 = 0xff;
+ globalCtx->envCtx.lightSettingOverride = 0xff;
globalCtx->envCtx.unk_E0 = 0;
}
func_800FEAB0();
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index 6bebcf9386..6e47936612 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -179,7 +179,7 @@ void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x02: List of cameras for actor cutscenes
void Scene_HeaderCmdActorCutsceneCamList(GlobalContext* globalCtx, SceneCmd* cmd) {
- globalCtx->unk_18858 = (UNK_PTR)Lib_SegmentedToVirtual(cmd->csCameraList.segment);
+ globalCtx->csCamData = Lib_SegmentedToVirtual(cmd->csCameraList.segment);
}
// SceneTableEntry Header Command 0x03: Collision Header
@@ -374,8 +374,8 @@ void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
// SceneTableEntry Header Command 0x12: Skybox Disables
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
- globalCtx->envCtx.unk_15 = cmd->skyboxDisables.unk4;
- globalCtx->envCtx.unk_16 = cmd->skyboxDisables.unk5;
+ globalCtx->envCtx.skyboxDisabled = cmd->skyboxDisables.unk4;
+ globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk5;
}
// SceneTableEntry Header Command 0x10: Time Settings
@@ -388,17 +388,17 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
}
if (cmd->timeSettings.unk6 != 0xFF) {
- globalCtx->envCtx.unk_2 = cmd->timeSettings.unk6;
+ globalCtx->envCtx.timeIncrement = cmd->timeSettings.unk6;
} else {
- globalCtx->envCtx.unk_2 = 0;
+ globalCtx->envCtx.timeIncrement = 0;
}
- if ((gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (globalCtx->envCtx.unk_2 != 0)) {
- globalCtx->envCtx.unk_2 = 5;
+ if ((gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) && (globalCtx->envCtx.timeIncrement != 0)) {
+ globalCtx->envCtx.timeIncrement = 5;
}
- if (gSaveContext.unk_3F58 == 0) {
- REG(15) = globalCtx->envCtx.unk_2;
+ if (gSaveContext.sunsSongState == SUNSSONG_INACTIVE) {
+ REG(15) = globalCtx->envCtx.timeIncrement;
}
dayTime = gSaveContext.time;
@@ -408,17 +408,20 @@ void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
dayTime = gSaveContext.time;
globalCtx->envCtx.unk_C = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
- if (globalCtx->envCtx.unk_2 == 0 && gSaveContext.cutscene < 0xFFF0) {
+ if (globalCtx->envCtx.timeIncrement == 0 && gSaveContext.cutscene < 0xFFF0) {
gSaveContext.environmentTime = gSaveContext.time;
- if (gSaveContext.environmentTime >= 0x2AAA && gSaveContext.environmentTime < 0x4555) {
- gSaveContext.environmentTime = 0x3555;
- } else if (gSaveContext.environmentTime >= 0x4555 && gSaveContext.environmentTime < 0x5555) {
- gSaveContext.environmentTime = 0x5555;
- } else if (gSaveContext.environmentTime >= 0xAAAA && gSaveContext.environmentTime < 0xB555) {
- gSaveContext.environmentTime = 0xB555;
- } else if (gSaveContext.environmentTime >= 0xC000 && gSaveContext.environmentTime < 0xCAAA) {
- gSaveContext.environmentTime = 0xCAAA;
+ if (gSaveContext.environmentTime >= CLOCK_TIME(4, 0) && gSaveContext.environmentTime < CLOCK_TIME(6, 30)) {
+ gSaveContext.environmentTime = CLOCK_TIME(5, 0);
+ } else if (gSaveContext.environmentTime >= CLOCK_TIME(6, 30) &&
+ gSaveContext.environmentTime < CLOCK_TIME(8, 0)) {
+ gSaveContext.environmentTime = CLOCK_TIME(8, 0);
+ } else if (gSaveContext.environmentTime >= CLOCK_TIME(16, 0) &&
+ gSaveContext.environmentTime < CLOCK_TIME(17, 0)) {
+ gSaveContext.environmentTime = CLOCK_TIME(17, 0);
+ } else if (gSaveContext.environmentTime >= CLOCK_TIME(18, 0) &&
+ gSaveContext.environmentTime < CLOCK_TIME(19, 0)) {
+ gSaveContext.environmentTime = CLOCK_TIME(19, 0);
}
}
}
diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c
index 57e2930a26..b04b79bb47 100644
--- a/src/code/z_scene_proc.c
+++ b/src/code/z_scene_proc.c
@@ -1,4 +1,3 @@
-#include "prevent_bss_reordering.h"
#include "global.h"
s32 sMatAnimStep;
diff --git a/src/code/z_shrink_window.c b/src/code/z_shrink_window.c
index 194ee50839..5bfca86d92 100644
--- a/src/code/z_shrink_window.c
+++ b/src/code/z_shrink_window.c
@@ -2,6 +2,7 @@
* File: z_shrink_window.c
* Description: Draws black top/bottom/side borders on the viewing window (e.g. Z-targeting, talking to NPC)
*/
+#include "prevent_bss_reordering.h"
#include "global.h"
ShrinkWindowContext gShrinkWindowContext;
diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c
index 7f79bb51c3..9fc5467e07 100644
--- a/src/code/z_skelanime.c
+++ b/src/code/z_skelanime.c
@@ -8,10 +8,10 @@ s32 LinkAnimation_Once(GlobalContext* globalCtx, SkelAnime* skelAnime);
s32 SkelAnime_LoopFull(SkelAnime* skelAnime);
s32 SkelAnime_LoopPartial(SkelAnime* skelAnime);
s32 SkelAnime_Once(SkelAnime* skelAnime);
-void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animationSeg);
+void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation);
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* pos, s16 angle);
-void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* linkAnimetionEntrySeg,
- f32 playbackSpeed, f32 frame, f32 frameCount, u8 animationMode, f32 transitionRate);
+void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAnimationHeader* animation, f32 playSpeed,
+ f32 frame, f32 frameCount, u8 animationMode, f32 morphFrames);
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
static AnimationEntryCallback sAnimationLoadDone[] = {
@@ -35,7 +35,7 @@ void SkelAnime_DrawLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** skele
OPEN_DISPS(globalCtx->state.gfxCtx);
Matrix_StatePush();
- limb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -94,7 +94,7 @@ void SkelAnime_DrawLod(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTa
Matrix_StatePush();
- rootLimb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[0]);
+ rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
pos.z = jointTable[0].z;
@@ -146,7 +146,7 @@ void SkelAnime_DrawFlexLimbLod(GlobalContext* globalCtx, s32 limbIndex, void** s
Matrix_StatePush();
- limb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -203,7 +203,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
- Mtx* mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
+ Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
if (skeleton == NULL) {
return;
@@ -214,7 +214,7 @@ void SkelAnime_DrawFlexLod(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
Matrix_StatePush();
- rootLimb = (LodLimb*)Lib_SegmentedToVirtual(skeleton[0]);
+ rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
pos.z = jointTable[0].z;
@@ -266,7 +266,7 @@ void SkelAnime_DrawLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skele
Matrix_StatePush();
- limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
pos.x = limb->jointPos.x;
@@ -421,7 +421,7 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
Gfx* limbDList;
Vec3f pos;
Vec3s rot;
- Mtx* mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
+ Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
if (skeleton == NULL) {
return;
@@ -473,9 +473,9 @@ void SkelAnime_DrawFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* joi
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
- OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw,
- Actor* actor, Mtx** mtx) {
+void SkelAnime_DrawTransformFlexLimbOpa(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
+ OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
+ TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx) {
StandardLimb* limb;
Gfx* newDList;
Gfx* limbDList;
@@ -486,7 +486,7 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
Matrix_StatePush();
- limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -500,8 +500,8 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
- //! @bug Does not check unkDraw is not NULL before calling it.
- unkDraw(globalCtx, limbIndex, actor);
+ transformLimbDraw(globalCtx, limbIndex, actor);
+
if (newDList != NULL) {
Gfx* polyTemp = POLY_OPA_DISP;
@@ -523,23 +523,32 @@ void func_80134148(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec
}
if (limb->child != LIMB_DONE) {
- func_80134148(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
- mtx);
+ SkelAnime_DrawTransformFlexLimbOpa(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
+ transformLimbDraw, actor, mtx);
}
Matrix_StatePop();
if (limb->sibling != LIMB_DONE) {
- func_80134148(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
- mtx);
+ SkelAnime_DrawTransformFlexLimbOpa(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw,
+ postLimbDraw, transformLimbDraw, actor, mtx);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
- OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, UnkActorDrawOpa unkDraw,
- Actor* actor) {
+/**
+ * Draw all limbs of type `StandardLimb` in a given flexible skeleton to the polyOpa buffer
+ * Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
+ * An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
+ *
+ * Also makes use of a `TransformLimbDraw`, which transforms limbs based on world coordinates, as opposed to local limb
+ * coordinates.
+ * Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
+ */
+void SkelAnime_DrawTransformFlexOpa(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
+ OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
+ TransformLimbDrawOpa transformLimbDraw, Actor* actor) {
StandardLimb* rootLimb;
s32 pad;
Gfx* newDList;
@@ -554,13 +563,13 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
OPEN_DISPS(globalCtx->state.gfxCtx);
- mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
+ mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
gSPSegment(POLY_OPA_DISP++, 0x0D, mtx);
Matrix_StatePush();
- rootLimb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
+ rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
@@ -573,8 +582,7 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
Matrix_JointPosition(&pos, &rot);
Matrix_StatePush();
- //! @bug Does not check unkDraw is not NULL before calling it.
- unkDraw(globalCtx, 1, actor);
+ transformLimbDraw(globalCtx, 1, actor);
if (newDList != NULL) {
Gfx* polyTemp = POLY_OPA_DISP;
@@ -596,8 +604,8 @@ void func_801343C0(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
}
if (rootLimb->child != LIMB_DONE) {
- func_80134148(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw, unkDraw, actor,
- &mtx);
+ SkelAnime_DrawTransformFlexLimbOpa(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw,
+ postLimbDraw, transformLimbDraw, actor, &mtx);
}
Matrix_StatePop();
@@ -655,7 +663,7 @@ Gfx* SkelAnime_DrawLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton
Matrix_StatePush();
- limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -711,7 +719,7 @@ Gfx* SkelAnime_Draw(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable
Matrix_StatePush();
- rootLimb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[0]);
+ rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x;
pos.y = jointTable[0].y;
@@ -758,7 +766,7 @@ Gfx* SkelAnime_DrawFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skel
Matrix_StatePush();
- limb = (StandardLimb*)Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
limbIndex++;
rot = jointTable[limbIndex];
@@ -821,7 +829,7 @@ Gfx* SkelAnime_DrawFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointT
return NULL;
}
- mtx = (Mtx*)GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
+ mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(sizeof(Mtx) * dListCount));
gSPSegment(gfx++, 0x0D, mtx);
@@ -994,7 +1002,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMATION_LINKANIMETION);
if (entry != NULL) {
- LinkAnimationHeader* linkAnimHeader = (LinkAnimationHeader*)Lib_SegmentedToVirtual(animation);
+ LinkAnimationHeader* linkAnimHeader = Lib_SegmentedToVirtual(animation);
u32 ram = frameTable;
osCreateMesgQueue(&entry->data.load.msgQueue, &entry->data.load.msg, 1);
@@ -1066,13 +1074,13 @@ void AnimationContext_SetCopyFalse(GlobalContext* globalCtx, s32 vecCount, Vec3s
/**
* Requests moving an actor according to the translation of its root limb
*/
-void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 actor3) {
+void AnimationContext_SetMoveActor(GlobalContext* globalCtx, Actor* actor, SkelAnime* skelAnime, f32 arg3) {
AnimationEntry* entry = AnimationContext_AddEntry(&globalCtx->animationCtx, ANIMENTRY_MOVEACTOR);
if (entry != NULL) {
entry->data.move.actor = actor;
entry->data.move.skelAnime = skelAnime;
- entry->data.move.unk08 = actor3;
+ entry->data.move.unk08 = arg3;
}
}
@@ -1821,8 +1829,8 @@ void Animation_PlayOnce(SkelAnime* skelAnime, AnimationHeader* animation) {
* animation. Negative morph frames start the new animation immediately, modified by the pose immediately before the
* animation change.
*/
-void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animationSeg, f32 morphFrames) {
- Animation_Change(skelAnime, animationSeg, 1.0f, 0, Animation_GetLastFrame(&animationSeg->common), ANIMMODE_ONCE,
+void Animation_MorphToPlayOnce(SkelAnime* skelAnime, AnimationHeader* animation, f32 morphFrames) {
+ Animation_Change(skelAnime, animation, 1.0f, 0, Animation_GetLastFrame(&animation->common), ANIMMODE_ONCE,
morphFrames);
}
@@ -1854,9 +1862,9 @@ void Animation_MorphToLoop(SkelAnime* skelAnime, AnimationHeader* animation, f32
/**
* Immediately changes to an animation that loops at the specified speed.
*/
-void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playbackSpeed) {
- Animation_Change(skelAnime, animation, playbackSpeed, 0.0f, Animation_GetLastFrame(&animation->common),
- ANIMMODE_LOOP, 0.0f);
+void Animation_PlayLoopSetSpeed(SkelAnime* skelAnime, AnimationHeader* animation, f32 playSpeed) {
+ Animation_Change(skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(&animation->common), ANIMMODE_LOOP,
+ 0.0f);
}
/**
diff --git a/src/code/z_snap.c b/src/code/z_snap.c
index 6d206eea55..bce1f67d7b 100644
--- a/src/code/z_snap.c
+++ b/src/code/z_snap.c
@@ -12,8 +12,8 @@ s32 func_8013A240(GlobalContext* globalCtx) {
s32 seen;
s32 count = 0;
- gSaveContext.roomInf[123][3] = 0;
- gSaveContext.roomInf[123][4] = 0;
+ gSaveContext.pictoFlags0 = 0;
+ gSaveContext.pictoFlags1 = 0;
if (globalCtx->sceneNum == SCENE_20SICHITAI) {
func_8013A41C(1);
@@ -76,19 +76,19 @@ s32 func_8013A240(GlobalContext* globalCtx) {
void func_8013A41C(s32 flag) {
if (flag < 0x20) {
- gSaveContext.roomInf[123][3] |= (1 << flag);
+ gSaveContext.pictoFlags0 |= (1 << flag);
} else {
flag &= 0x1F;
- gSaveContext.roomInf[123][4] |= (1 << flag);
+ gSaveContext.pictoFlags1 |= (1 << flag);
}
}
void func_8013A46C(s32 flag) {
if (flag < 0x20) {
- gSaveContext.roomInf[123][3] &= ~(1 << flag);
+ gSaveContext.pictoFlags0 &= ~(1 << flag);
} else {
flag &= 0x1F;
- gSaveContext.roomInf[123][4] &= ~(1 << flag);
+ gSaveContext.pictoFlags1 &= ~(1 << flag);
}
}
@@ -96,10 +96,10 @@ u32 func_8013A4C4(s32 flag) {
SaveContext* saveCtx = &gSaveContext;
if (flag < 0x20) {
- return saveCtx->roomInf[123][3] & (1 << flag);
+ return saveCtx->pictoFlags0 & (1 << flag);
} else {
flag &= 0x1F;
- return saveCtx->roomInf[123][4] & (1 << flag);
+ return saveCtx->pictoFlags1 & (1 << flag);
}
}
@@ -114,45 +114,43 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
s16 y;
f32 distance;
CollisionPoly* poly;
- Camera* camera;
+ Camera* camera = GET_ACTIVE_CAM(globalCtx);
Actor* actors[2];
s32 ret = 0;
s32 bgId;
- camera = GET_ACTIVE_CAM(globalCtx);
-
distance = OLib_Vec3fDist(pos, &camera->eye);
if ((distance < distanceMin) || (distanceMax < distance)) {
- func_8013A41C(0x3f);
- ret = 0x3f;
+ func_8013A41C(0x3F);
+ ret = 0x3F;
}
- x = func_8013A504(func_800DFCB4(camera) + rot->x);
- y = func_8013A504(func_800DFCDC(camera) - (s16)(rot->y - 0x7FFF));
+ x = func_8013A504(Camera_GetCamDirPitch(camera) + rot->x);
+ y = func_8013A504(Camera_GetCamDirYaw(camera) - BINANG_SUB(rot->y, 0x7FFF));
if ((0 < angleError) && ((angleError < x) || (angleError < y))) {
- func_8013A41C(0x3e);
- ret |= 0x3e;
+ func_8013A41C(0x3E);
+ ret |= 0x3E;
}
Actor_GetProjectedPos(globalCtx, pos, &screenSpace, &distance);
x = (s16)(screenSpace.x * distance * 160.0f + 160.0f) - 85;
y = (s16)(screenSpace.y * distance * -120.0f + 120.0f) - 67;
if ((x < 0) || (0x96 < x) || (y < 0) || (0x69 < y)) {
- func_8013A41C(0x3d);
- ret |= 0x3d;
+ func_8013A41C(0x3D);
+ ret |= 0x3D;
}
if (BgCheck_ProjectileLineTest(&globalCtx->colCtx, pos, &camera->eye, &screenSpace, &poly, true, true, true, true,
&bgId)) {
- func_8013A41C(0x3c);
- ret |= 0x3c;
+ func_8013A41C(0x3C);
+ ret |= 0x3C;
}
actors[0] = actor;
actors[1] = &GET_PLAYER(globalCtx)->actor;
- if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colChkCtx, pos, &camera->eye, actors, 2) != 0) {
- func_8013A41C(0x3b);
- ret |= 0x3b;
+ if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colChkCtx, pos, &camera->eye, actors, 2)) {
+ func_8013A41C(0x3B);
+ ret |= 0x3B;
}
if (ret == 0) {
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 8f0599b553..52a5b07dac 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -21,7 +21,7 @@ EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
break;
}
- if ((door->unk_1A4 == 5) && (door->unk_1A5 == (u8)unk_1A5)) {
+ if ((door->unk_1A4 == 5) && (door->switchFlag == (u8)unk_1A5)) {
break;
}
@@ -36,15 +36,127 @@ EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
return door;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013A860.s")
+Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable,
+ OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
+ TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx) {
+ StandardLimb* limb;
+ Gfx* newDList;
+ Gfx* limbDList;
+ Vec3f pos;
+ Vec3s rot;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AB00.s")
+ Matrix_StatePush();
+ limb = Lib_SegmentedToVirtual(skeleton[limbIndex]);
+ limbIndex++;
+ rot = jointTable[limbIndex];
+ pos.x = limb->jointPos.x;
+ pos.y = limb->jointPos.y;
+ pos.z = limb->jointPos.z;
+ newDList = limbDList = limb->dList;
+
+ if ((overrideLimbDraw == NULL) || !overrideLimbDraw(globalCtx, limbIndex, &newDList, &pos, &rot, actor, &gfx)) {
+ Matrix_JointPosition(&pos, &rot);
+ Matrix_StatePush();
+
+ transformLimbDraw(globalCtx, limbIndex, actor, &gfx);
+
+ if (newDList != NULL) {
+ Matrix_ToMtx(*mtx);
+ gSPMatrix(gfx++, *mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, newDList);
+ (*mtx)++;
+ } else if (limbDList != NULL) {
+ Matrix_ToMtx(*mtx);
+ (*mtx)++;
+ }
+ Matrix_StatePop();
+ }
+ if (postLimbDraw != NULL) {
+ postLimbDraw(globalCtx, limbIndex, &limbDList, &rot, actor, &gfx);
+ }
+ if (limb->child != LIMB_DONE) {
+ gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->child, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
+ transformLimbDraw, actor, mtx, gfx);
+ }
+ Matrix_StatePop();
+ if (limb->sibling != LIMB_DONE) {
+ gfx = SubS_DrawTransformFlexLimb(globalCtx, limb->sibling, skeleton, jointTable, overrideLimbDraw, postLimbDraw,
+ transformLimbDraw, actor, mtx, gfx);
+ }
+ return gfx;
+}
+
+/**
+ * Draw all limbs of type `StandardLimb` in a given flexible skeleton
+ * Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
+ * An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
+ *
+ * Also makes use of a `TransformLimbDraw`, which transforms limbs based on world coordinates, as opposed to local limb
+ * coordinates.
+ * Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
+ */
+Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount,
+ OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw,
+ TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx) {
+ StandardLimb* rootLimb;
+ s32 pad;
+ Gfx* newDlist;
+ Gfx* limbDList;
+ Vec3f pos;
+ Vec3s rot;
+ Mtx* mtx = GRAPH_ALLOC(globalCtx->state.gfxCtx, ALIGN16(dListCount * sizeof(Mtx)));
+
+ if (skeleton == NULL) {
+ return NULL;
+ }
+
+ gSPSegment(gfx++, 0x0D, mtx);
+ Matrix_StatePush();
+ rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
+ pos.x = jointTable->x;
+ pos.y = jointTable->y;
+ pos.z = jointTable->z;
+ rot = jointTable[1];
+ newDlist = rootLimb->dList;
+ limbDList = rootLimb->dList;
+
+ if (overrideLimbDraw == NULL || !overrideLimbDraw(globalCtx, 1, &newDlist, &pos, &rot, actor, &gfx)) {
+ Matrix_JointPosition(&pos, &rot);
+ Matrix_StatePush();
+
+ transformLimbDraw(globalCtx, 1, actor, &gfx);
+
+ if (newDlist != NULL) {
+ Matrix_ToMtx(mtx);
+ gSPMatrix(gfx++, mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, newDlist);
+ mtx++;
+ } else if (limbDList != NULL) {
+ Matrix_ToMtx(mtx);
+ mtx++;
+ }
+ Matrix_StatePop();
+ }
+
+ if (postLimbDraw != NULL) {
+ postLimbDraw(globalCtx, 1, &limbDList, &rot, actor, &gfx);
+ }
+
+ if (rootLimb->child != LIMB_DONE) {
+ gfx = SubS_DrawTransformFlexLimb(globalCtx, rootLimb->child, skeleton, jointTable, overrideLimbDraw,
+ postLimbDraw, transformLimbDraw, actor, &mtx, gfx);
+ }
+ Matrix_StatePop();
+ return gfx;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AD6C.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AD9C.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AED4.s")
+void SubS_UpdateFlags(u16* flags, u16 setBits, u16 unsetBits) {
+ *flags = (*flags & ~unsetBits) | setBits;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013AF00.s")
@@ -95,7 +207,26 @@ Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCat
return closestActor;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BC6C.s")
+s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index) {
+ s32 endFrame;
+ s32 startFrame;
+
+ animations += index;
+ endFrame = animations->frameCount;
+ if (animations->frameCount < 0) {
+ endFrame = Animation_GetLastFrame(&animations->animation->common);
+ }
+ startFrame = animations->startFrame;
+ if (startFrame >= endFrame || startFrame < 0) {
+ return false;
+ }
+ if (animations->playSpeed < 0.0f) {
+ SWAP(s32, endFrame, startFrame);
+ }
+ Animation_Change(skelAnime, animations->animation, animations->playSpeed, startFrame, endFrame, animations->mode,
+ animations->morphFrames);
+ return true;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BD40.s")
@@ -119,7 +250,9 @@ Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCat
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D2E0.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D5E8.s")
+s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB) {
+ return (ABS_ALT(BINANG_SUB(angleB, angleA)) <= threshold) ? true : false;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D648.s")
@@ -131,9 +264,13 @@ Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCat
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D83C.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D8DC.s")
+s8 SubS_IsObjectLoaded(s8 index, GlobalContext* globalCtx) {
+ return !Object_IsLoaded(&globalCtx->objectCtx, index) ? false : true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D924.s")
+s8 SubS_GetObjectIndex(s16 id, GlobalContext* globalCtx) {
+ return Object_GetIndex(&globalCtx->objectCtx, id);
+}
/**
* Finds the first actor instance of a specified Id and category.
@@ -152,7 +289,17 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC
return actor;
}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D9C8.s")
+s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* limbRotTableZ, s32 numLimbs) {
+ s32 i;
+ u32 frames = globalCtx->gameplayFrames;
+
+ for (i = 0; i < numLimbs; i++) {
+ limbRotTableY[i] = (i * 50 + 0x814) * frames;
+ limbRotTableZ[i] = (i * 50 + 0x940) * frames;
+ }
+
+ return true;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013DB90.s")
@@ -172,11 +319,83 @@ Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorC
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E0A4.s")
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E1C8.s")
+void SubS_ChangeAnimationBySpeedInfo(SkelAnime* skelAnime, AnimationSpeedInfo* animations, s32 nextIndex,
+ s32* curIndex) {
+ AnimationSpeedInfo* animation = &animations[nextIndex];
+ f32 startFrame = skelAnime->curFrame;
+ f32 endFrame;
+ f32 morphFrames;
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E2D4.s")
+ if ((*curIndex < 0) || (nextIndex == *curIndex)) {
+ morphFrames = 0.0f;
+ if (*curIndex < 0) {
+ startFrame = 0.0f;
+ }
+ } else {
+ morphFrames = animation->morphFrames;
+ if (nextIndex != *curIndex) {
+ startFrame = 0.0f;
+ }
+ }
+ if (animation->playSpeed >= 0.0f) {
+ endFrame = Animation_GetLastFrame(&animation->animation->common);
+ } else {
+ startFrame = Animation_GetLastFrame(&animation->animation->common);
+ endFrame = 0.0f;
+ }
+ Animation_Change(skelAnime, animation->animation, animation->playSpeed, startFrame, endFrame, animation->mode,
+ morphFrames);
+ *curIndex = nextIndex;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E3B8.s")
+s32 SubS_StartActorCutscene(Actor* actor, s16 nextCutscene, s16 curCutscene, s32 type) {
+ s32 isStarted = false;
+
+ if ((curCutscene != -1) && (ActorCutscene_GetCurrentIndex() == curCutscene)) {
+ ActorCutscene_Stop(curCutscene);
+ ActorCutscene_SetIntentToPlay(nextCutscene);
+ } else if (ActorCutscene_GetCanPlayNext(nextCutscene)) {
+ switch (type) {
+ case SUBS_CUTSCENE_SET_UNK_LINK_FIELDS:
+ ActorCutscene_StartAndSetUnkLinkFields(nextCutscene, actor);
+ break;
+ case SUBS_CUTSCENE_NORMAL:
+ ActorCutscene_Start(nextCutscene, actor);
+ break;
+ case SUBS_CUTSCENE_SET_FLAG:
+ ActorCutscene_StartAndSetFlag(nextCutscene, actor);
+ break;
+ }
+ isStarted = true;
+ } else {
+ ActorCutscene_SetIntentToPlay(nextCutscene);
+ }
+
+ return isStarted;
+}
+
+s32 SubS_FillCutscenesList(Actor* actor, s16 cutscenes[], s16 numCutscenes) {
+ s16 cs;
+ s32 i;
+
+ for (i = 0; i < numCutscenes; i++) {
+ cutscenes[i] = -1;
+ }
+
+ cs = actor->cutscene;
+ i = 0;
+
+ while (cs != -1) {
+ // Note: Infinite loop if numCutscenes is less than possible additional cutscenes
+ if (i < numCutscenes) {
+ cutscenes[i] = cs;
+ cs = ActorCutscene_GetAdditionalCutscene(cs);
+ i++;
+ }
+ }
+
+ return i;
+}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E4B0.s")
diff --git a/src/code/z_view.c b/src/code/z_view.c
index da2e3593b3..d11a18201d 100644
--- a/src/code/z_view.c
+++ b/src/code/z_view.c
@@ -43,7 +43,7 @@ void View_Init(View* view, GraphicsContext* gfxCtx) {
view->zFar = 12800.0f;
view->eye.z = -1.0f;
- View_InitCameraQuake(view);
+ View_InitDistortion(view);
}
void View_SetViewOrientation(View* view, Vec3f* eye, Vec3f* at, Vec3f* up) {
@@ -187,87 +187,93 @@ void View_SetScissorForLetterbox(View* view) {
CLOSE_DISPS(view->gfxCtx);
}
-s32 View_SetQuakeRotation(View* view, f32 x, f32 y, f32 z) {
- view->quakeRot.x = x;
- view->quakeRot.y = y;
- view->quakeRot.z = z;
+s32 View_SetDistortionDirRot(View* view, f32 dirRotX, f32 dirRotY, f32 dirRotZ) {
+ view->distortionDirRot.x = dirRotX;
+ view->distortionDirRot.y = dirRotY;
+ view->distortionDirRot.z = dirRotZ;
return 1;
}
-s32 View_SetQuakeScale(View* view, f32 x, f32 y, f32 z) {
- view->quakeScale.x = x;
- view->quakeScale.y = y;
- view->quakeScale.z = z;
+s32 View_SetDistortionScale(View* view, f32 scaleX, f32 scaleY, f32 scaleZ) {
+ view->distortionScale.x = scaleX;
+ view->distortionScale.y = scaleY;
+ view->distortionScale.z = scaleZ;
return 1;
}
-s32 View_SetQuakeSpeed(View* view, f32 speed) {
- view->quakeSpeed = speed;
+s32 View_SetDistortionSpeed(View* view, f32 speed) {
+ view->distortionSpeed = speed;
return 1;
}
-s32 View_InitCameraQuake(View* view) {
- view->quakeRot.x = 0.0f;
- view->quakeRot.y = 0.0f;
- view->quakeRot.z = 0.0f;
- view->quakeScale.x = 1.0f;
- view->quakeScale.y = 1.0f;
- view->quakeScale.z = 1.0f;
- view->currQuakeRot = view->quakeRot;
- view->currQuakeScale = view->quakeScale;
- view->quakeSpeed = 0.0f;
+s32 View_InitDistortion(View* view) {
+ view->distortionDirRot.x = 0.0f;
+ view->distortionDirRot.y = 0.0f;
+ view->distortionDirRot.z = 0.0f;
+ view->distortionScale.x = 1.0f;
+ view->distortionScale.y = 1.0f;
+ view->distortionScale.z = 1.0f;
+ view->curDistortionDirRot = view->distortionDirRot;
+ view->curDistortionScale = view->distortionScale;
+ view->distortionSpeed = 0.0f;
return 1;
}
-s32 View_ClearQuake(View* view) {
- view->quakeRot.x = 0.0f;
- view->quakeRot.y = 0.0f;
- view->quakeRot.z = 0.0f;
- view->quakeScale.x = 1.0f;
- view->quakeScale.y = 1.0f;
- view->quakeScale.z = 1.0f;
- view->quakeSpeed = 1.0f;
+s32 View_ClearDistortion(View* view) {
+ view->distortionDirRot.x = 0.0f;
+ view->distortionDirRot.y = 0.0f;
+ view->distortionDirRot.z = 0.0f;
+ view->distortionScale.x = 1.0f;
+ view->distortionScale.y = 1.0f;
+ view->distortionScale.z = 1.0f;
+ view->distortionSpeed = 1.0f;
return 1;
}
-s32 View_SetQuake(View* view, Vec3f rot, Vec3f scale, f32 speed) {
- view->quakeRot = rot;
- view->quakeScale = scale;
- view->quakeSpeed = speed;
+s32 View_SetDistortion(View* view, Vec3f dirRot, Vec3f scale, f32 speed) {
+ view->distortionDirRot = dirRot;
+ view->distortionScale = scale;
+ view->distortionSpeed = speed;
return 1;
}
-s32 View_StepQuake(View* view, Mtx* matrix) {
- MtxF mf;
+s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
+ MtxF projectionMtxF;
- if (view->quakeSpeed == 0.0f) {
- return 0;
- } else if (view->quakeSpeed == 1.0f) {
- view->currQuakeRot = view->quakeRot;
- view->currQuakeScale = view->quakeScale;
- view->quakeSpeed = 0.0f;
+ if (view->distortionSpeed == 0.0f) {
+ return false;
+ } else if (view->distortionSpeed == 1.0f) {
+ view->curDistortionDirRot = view->distortionDirRot;
+ view->curDistortionScale = view->distortionScale;
+ view->distortionSpeed = 0.0f;
} else {
- view->currQuakeRot.x += ((view->quakeRot.x - view->currQuakeRot.x) * view->quakeSpeed);
- view->currQuakeRot.y += ((view->quakeRot.y - view->currQuakeRot.y) * view->quakeSpeed);
- view->currQuakeRot.z += ((view->quakeRot.z - view->currQuakeRot.z) * view->quakeSpeed);
+ view->curDistortionDirRot.x =
+ F32_LERPIMP(view->curDistortionDirRot.x, view->distortionDirRot.x, view->distortionSpeed);
+ view->curDistortionDirRot.y =
+ F32_LERPIMP(view->curDistortionDirRot.y, view->distortionDirRot.y, view->distortionSpeed);
+ view->curDistortionDirRot.z =
+ F32_LERPIMP(view->curDistortionDirRot.z, view->distortionDirRot.z, view->distortionSpeed);
- view->currQuakeScale.x += ((view->quakeScale.x - view->currQuakeScale.x) * view->quakeSpeed);
- view->currQuakeScale.y += ((view->quakeScale.y - view->currQuakeScale.y) * view->quakeSpeed);
- view->currQuakeScale.z += ((view->quakeScale.z - view->currQuakeScale.z) * view->quakeSpeed);
+ view->curDistortionScale.x =
+ F32_LERPIMP(view->curDistortionScale.x, view->distortionScale.x, view->distortionSpeed);
+ view->curDistortionScale.y =
+ F32_LERPIMP(view->curDistortionScale.y, view->distortionScale.y, view->distortionSpeed);
+ view->curDistortionScale.z =
+ F32_LERPIMP(view->curDistortionScale.z, view->distortionScale.z, view->distortionSpeed);
}
- Matrix_FromRSPMatrix(matrix, &mf);
- Matrix_SetCurrentState(&mf);
- Matrix_RotateStateAroundXAxis(view->currQuakeRot.x);
- Matrix_InsertYRotation_f(view->currQuakeRot.y, MTXMODE_APPLY);
- Matrix_InsertZRotation_f(view->currQuakeRot.z, MTXMODE_APPLY);
- Matrix_Scale(view->currQuakeScale.x, view->currQuakeScale.y, view->currQuakeScale.z, MTXMODE_APPLY);
- Matrix_InsertZRotation_f(-view->currQuakeRot.z, MTXMODE_APPLY);
- Matrix_InsertYRotation_f(-view->currQuakeRot.y, MTXMODE_APPLY);
- Matrix_RotateStateAroundXAxis(-view->currQuakeRot.x);
- Matrix_ToMtx(matrix);
+ Matrix_FromRSPMatrix(projectionMtx, &projectionMtxF);
+ Matrix_SetCurrentState(&projectionMtxF);
+ Matrix_RotateStateAroundXAxis(view->curDistortionDirRot.x);
+ Matrix_InsertYRotation_f(view->curDistortionDirRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_f(view->curDistortionDirRot.z, MTXMODE_APPLY);
+ Matrix_Scale(view->curDistortionScale.x, view->curDistortionScale.y, view->curDistortionScale.z, MTXMODE_APPLY);
+ Matrix_InsertZRotation_f(-view->curDistortionDirRot.z, MTXMODE_APPLY);
+ Matrix_InsertYRotation_f(-view->curDistortionDirRot.y, MTXMODE_APPLY);
+ Matrix_RotateStateAroundXAxis(-view->curDistortionDirRot.x);
+ Matrix_ToMtx(projectionMtx);
- return 1;
+ return true;
}
void View_RenderView(View* view, s32 uParm2) {
@@ -309,8 +315,8 @@ s32 View_RenderToPerspectiveMatrix(View* view) {
guPerspective(projection, &view->normal, view->fovy, aspect, view->zNear, view->zFar, view->scale);
view->projection = *projection;
- //! @bug: This cast of `projection` is invalid
- View_StepQuake(view, (Mtx*)projection);
+
+ View_StepDistortion(view, projection);
gSPPerspNormalize(POLY_OPA_DISP++, view->normal);
gSPMatrix(POLY_OPA_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
diff --git a/src/libultra/flash/osFlash.c b/src/libultra/flash/osFlash.c
index cf90bc75bc..edba06fc22 100644
--- a/src/libultra/flash/osFlash.c
+++ b/src/libultra/flash/osFlash.c
@@ -1,14 +1,13 @@
-#include "prevent_bss_reordering.h"
#include "ultra64.h"
#include "global.h"
-static s32 framDeviceInfo[4];
-static OSIoMesg framDeviceInfoQuery;
-static OSMesgQueue __osFlashMessageQ;
-static OSPiHandle __osFlashHandler;
-static OSMesg __osFlashMsgBuf;
-static s32 __osFlashVersion;
-static UNK_TYPE1 D_801FD0FC[0x14];
+s32 framDeviceInfo[4];
+OSIoMesg framDeviceInfoQuery;
+OSMesgQueue __osFlashMessageQ;
+OSPiHandle __osFlashHandler;
+OSMesg __osFlashMsgBuf;
+s32 __osFlashVersion;
+UNK_TYPE1 D_801FD0FC[0x14];
typedef enum {
FLASH_OLD,
diff --git a/src/libultra/io/contramread.c b/src/libultra/io/contramread.c
index 420be9d895..d993b47d76 100644
--- a/src/libultra/io/contramread.c
+++ b/src/libultra/io/contramread.c
@@ -1,3 +1,63 @@
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/boot/contramread/__osContRamRead.s")
+#define BLOCKSIZE 32
+
+s32 __osPfsLastChannel = -1;
+
+s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* buffer) {
+ s32 ret;
+ s32 i;
+ u8* bufptr;
+ s32 retryCount = 2;
+
+ __osSiGetAccess();
+ do {
+ bufptr = (u8*)&__osPfsPifRam;
+
+ if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) {
+ __osContLastPoll = 2;
+ __osPfsLastChannel = channel;
+ // clang-format off
+ for (i = 0; i < channel; i++) { *bufptr++ = 0; }
+ // clang-format on
+ __osPfsPifRam.status = 1;
+ ((__OSContRamReadFormat*)bufptr)->dummy = 0xFF;
+ ((__OSContRamReadFormat*)bufptr)->txsize = 3;
+ ((__OSContRamReadFormat*)bufptr)->rxsize = 0x21;
+ ((__OSContRamReadFormat*)bufptr)->cmd = CONT_CMD_READ_MEMPACK; // read mempak; send byte 0
+ ((__OSContRamReadFormat*)bufptr)->datacrc = 0xFF; // read mempak; send byte 0
+ // Received bytes are 6-26 inclusive
+ bufptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END; // End of commands
+ } else {
+ bufptr += channel;
+ }
+
+ ((__OSContRamReadFormat*)bufptr)->hi = addr >> 3; // send byte 1
+ ((__OSContRamReadFormat*)bufptr)->lo = (s8)(__osContAddressCrc(addr) | (addr << 5)); // send byte 2
+ __osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
+ osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK);
+ __osSiRawStartDma(OS_READ, &__osPfsPifRam);
+ osRecvMesg(ctrlrqueue, NULL, OS_MESG_BLOCK);
+
+ ret = (((__OSContRamReadFormat*)bufptr)->rxsize & 0xC0) >> 4;
+ if (!ret) {
+ if (((__OSContRamReadFormat*)bufptr)->datacrc != __osContDataCrc(bufptr + 6)) {
+ ret = __osPfsGetStatus(ctrlrqueue, channel);
+ if (ret) {
+ break;
+ }
+ ret = 4; // Retry
+ } else {
+ bcopy(bufptr + 6, buffer, BLOCKSIZE);
+ }
+ } else {
+ ret = 1; // Error
+ }
+ if (ret != 4) {
+ break;
+ }
+ } while (0 <= retryCount--);
+ __osSiRelAccess();
+
+ return ret;
+}
diff --git a/src/libultra/io/contramwrite.c b/src/libultra/io/contramwrite.c
index e6f96b1ef1..b2157a2a59 100644
--- a/src/libultra/io/contramwrite.c
+++ b/src/libultra/io/contramwrite.c
@@ -1,3 +1,68 @@
+#include "ultra64.h"
#include "global.h"
-#pragma GLOBAL_ASM("asm/non_matchings/boot/contramwrite/__osContRamWrite.s")
+s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32 force) {
+ s32 ret = 0;
+ s32 i;
+ u8* ptr;
+ s32 retry = 2;
+ u8 crc;
+
+ if ((force != PFS_FORCE) && (address < PFS_LABEL_AREA) && (address != 0)) {
+ return 0;
+ }
+
+ __osSiGetAccess();
+
+ do {
+ ptr = (u8*)(&__osPfsPifRam);
+
+ if (__osContLastPoll != CONT_CMD_WRITE_MEMPACK || __osPfsLastChannel != channel) {
+ __osContLastPoll = CONT_CMD_WRITE_MEMPACK;
+ __osPfsLastChannel = channel;
+
+ // clang-format off
+ for (i = 0; i < channel; i++) { *ptr++ = 0; }
+ // clang-format on
+
+ __osPfsPifRam.status = 1;
+
+ ((__OSContRamReadFormat*)ptr)->dummy = 0xFF;
+ ((__OSContRamReadFormat*)ptr)->txsize = 35;
+ ((__OSContRamReadFormat*)ptr)->rxsize = 1;
+ ((__OSContRamReadFormat*)ptr)->cmd = CONT_CMD_WRITE_MEMPACK;
+ ((__OSContRamReadFormat*)ptr)->datacrc = 0xFF;
+
+ ptr[sizeof(__OSContRamReadFormat)] = CONT_CMD_END;
+ } else {
+ ptr += channel;
+ }
+ ((__OSContRamReadFormat*)ptr)->hi = address >> 3;
+ ((__OSContRamReadFormat*)ptr)->lo = ((address << 5) | __osContAddressCrc(address));
+
+ bcopy(buffer, ((__OSContRamReadFormat*)ptr)->data, BLOCKSIZE);
+
+ ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam);
+ crc = __osContDataCrc(buffer);
+ osRecvMesg(mq, (OSMesg*)NULL, OS_MESG_BLOCK);
+
+ ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam);
+ osRecvMesg(mq, (OSMesg*)NULL, OS_MESG_BLOCK);
+
+ ret = ((((__OSContRamReadFormat*)ptr)->rxsize & 0xC0) >> 4);
+ if (!ret) {
+ if (crc != ((__OSContRamReadFormat*)ptr)->datacrc) {
+ if ((ret = __osPfsGetStatus(mq, channel))) {
+ break;
+ } else {
+ ret = PFS_ERR_CONTRFAIL;
+ }
+ }
+ } else {
+ ret = PFS_ERR_NOPACK;
+ }
+ } while ((ret == PFS_ERR_CONTRFAIL) && (retry-- >= 0));
+ __osSiRelAccess();
+
+ return ret;
+}
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 1045976983..0094052388 100644
--- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
+++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c
@@ -5,8 +5,10 @@
*/
#include "z_arms_hook.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_link_child/object_link_child.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ArmsHook*)thisx)
@@ -50,8 +52,6 @@ static ColliderQuadInit D_808C1BC0 = {
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
-extern Gfx D_0601D960[];
-
void ArmsHook_SetupAction(ArmsHook* this, ArmsHookActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@@ -108,7 +108,7 @@ void ArmsHook_DetachHookFromActor(ArmsHook* this) {
s32 ArmsHook_CheckForCancel(ArmsHook* this) {
Player* player = (Player*)this->actor.parent;
if (func_801240C8(player)) {
- if ((player->heldItemActionParam != player->itemActionParam) || ((player->actor.flags & 0x100)) ||
+ if ((player->heldItemActionParam != player->itemActionParam) || ((player->actor.flags & ACTOR_FLAG_100)) ||
((player->stateFlags1 & 0x4000080))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
@@ -170,7 +170,8 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
} else {
if (this->actor.child != NULL) {
f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
- f32 sp90 = sqrtf(SQ(this->unk1FC.x) + SQ(this->unk1FC.y) + SQ(this->unk1FC.z));
+ f32 sp90 = sqrtf(SQXYZ(this->unk1FC));
+
Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);
if (50.0f < (sp94 - sp90)) {
ArmsHook_DetachHookFromActor(this);
@@ -217,8 +218,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
}
} else {
Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity);
- player->actor.world.rot.x =
- Math_FAtan2F(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y);
+ player->actor.world.rot.x = Math_FAtan2F(sqrtf(SQXZ(bodyDistDiffVec)), -bodyDistDiffVec.y);
}
if (phi_f16 < 50.0f) {
ArmsHook_DetachHookFromActor(this);
@@ -323,7 +323,7 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_80122868(globalCtx, player);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_0601D960);
+ gSPDisplayList(POLY_OPA_DISP++, object_link_child_DL_01D960);
Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
MTXMODE_NEW);
Math_Vec3f_Diff(&player->rightHandWorld.pos, &this->actor.world.pos, &sp68);
@@ -334,7 +334,7 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
f0 = sqrtf(SQ(sp68.y) + sp48);
Matrix_Scale(0.015f, 0.015f, f0 * 0.01f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_040008D0);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0008D0);
func_801229A0(globalCtx, player);
CLOSE_DISPS(globalCtx->state.gfxCtx);
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 a0f11082c9..e85e3791ad 100644
--- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c
+++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c
@@ -6,7 +6,7 @@
#include "z_arrow_fire.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((ArrowFire*)thisx)
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 2bea2f0ff5..8f1d75ddee 100644
--- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c
+++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c
@@ -7,7 +7,7 @@
#include "z_arrow_ice.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((ArrowIce*)thisx)
@@ -178,7 +178,7 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
void ArrowIce_Update(Actor* thisx, GlobalContext* globalCtx) {
ArrowIce* this = THIS;
- if ((globalCtx->msgCtx.unk11F22 == 0xE) || (globalCtx->msgCtx.unk11F22 == 0x12)) {
+ if ((globalCtx->msgCtx.msgMode == 0xE) || (globalCtx->msgCtx.msgMode == 0x12)) {
Actor_MarkForDeath(&this->actor);
return;
} else {
@@ -228,11 +228,11 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_Scale(this->radius * 0.2f, this->height * 3.0f, this->radius * 0.2f, MTXMODE_APPLY);
Matrix_InsertTranslation(0.0f, -700.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, sIceArrowDL);
+ gSPDisplayList(POLY_XLU_DISP++, gIceArrowMaterialDL);
gSPDisplayList(POLY_XLU_DISP++,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1,
511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16));
- gSPDisplayList(POLY_XLU_DISP++, sIceArrowVtxDL);
+ gSPDisplayList(POLY_XLU_DISP++, gIceArrowModelDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 b31185726e..7d81b05a58 100644
--- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c
+++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c
@@ -6,7 +6,7 @@
#include "z_arrow_light.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((ArrowLight*)thisx)
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 c67eece3d6..63a9e69dc2 100644
--- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c
+++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c
@@ -6,7 +6,7 @@
#include "z_bg_breakwall.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgBreakwall*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c
index 82e9c8a150..c5613248a7 100644
--- a/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.c
@@ -6,7 +6,7 @@
#include "z_bg_crace_movebg.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgCraceMovebg*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c
index 5ce8f18e96..09876c3503 100644
--- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c
+++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c
@@ -5,20 +5,12 @@
*/
#include "z_bg_ctower_gear.h"
+#include "objects/object_ctower_rot/object_ctower_rot.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgCtowerGear*)thisx)
-#define BGCTOWERGEAR_GET_TYPE(this) (((BgCtowerGear*)this)->dyna.actor.params & 3)
-
-typedef enum {
- /* 0x00 */ CEILING_COG,
- /* 0x01 */ CENTER_COG,
- /* 0x02 */ WATER_WHEEL,
- /* 0x03 */ ORGAN
-} BgCtowerGearType;
-
void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx);
void BgCtowerGear_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgCtowerGear_Update(Actor* thisx, GlobalContext* globalCtx);
@@ -39,19 +31,14 @@ const ActorInit Bg_Ctower_Gear_InitVars = {
(ActorFunc)BgCtowerGear_Draw,
};
-extern Gfx D_06010828[];
-extern Gfx D_06015F30[];
-extern Gfx D_060160A0[];
-extern CollisionHeader D_06016E70;
-extern Gfx D_06017018[];
-extern Gfx D_06018118[];
-extern CollisionHeader D_06018588;
-
-static Vec3f D_80AD3270[] = {
- { -70.0f, -60.0f, 8.0f }, { -60.0f, -60.0f, -9.1f }, { -75.0f, -60.0f, -9.1f }, { -70.0f, -60.0f, -26.2f }
+static Vec3f sExitSplashOffsets[] = {
+ { -70.0f, -60.0f, 8.0f },
+ { -60.0f, -60.0f, -9.1f },
+ { -75.0f, -60.0f, -9.1f },
+ { -70.0f, -60.0f, -26.2f },
};
-static Vec3f D_80AD32A0[] = {
+static Vec3f sEnterSplashOffsets[] = {
{ 85.0f, -60.0f, 8.0f },
{ 80.0f, -60.0f, -9.1f },
{ 85.0f, -60.0f, -26.2f },
@@ -75,28 +62,26 @@ static InitChainEntry sInitChainOrgan[] = {
ICHAIN_F32(uncullZoneDownward, 570, ICHAIN_STOP),
};
-static Gfx* D_80AD32E8[] = { D_06010828, D_06017018, D_06018118 };
+static Gfx* sDLists[] = { gClockTowerCeilingCogDL, gClockTowerCenterCogDL, gClockTowerWaterWheelDL };
void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
- int i;
- s32 flags;
+ s32 i;
+ s32 flag40 = this->dyna.actor.flags & 0x40;
Vec3f splashSpawnPos;
Vec3f splashOffset;
s32 pad;
- int j;
- s16 rotZ;
+ s32 j;
+ s16 rotZ = this->dyna.actor.shape.rot.z & 0x1FFF;
- flags = this->dyna.actor.flags & 0x40;
- rotZ = this->dyna.actor.shape.rot.z & 0x1FFF;
- if ((flags != 0) && (rotZ < 0x1B58) && (rotZ >= 0x1388)) {
+ if (flag40 && (rotZ < 0x1B58) && (rotZ >= 0x1388)) {
Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW);
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
for (i = 0; i < 4; i++) {
if ((u32)Rand_Next() >= 0x40000000) {
- splashOffset.x = D_80AD3270[i].x - (Rand_ZeroOne() * 30.0f);
- splashOffset.y = D_80AD3270[i].y;
- splashOffset.z = D_80AD3270[i].z;
+ splashOffset.x = sExitSplashOffsets[i].x - (Rand_ZeroOne() * 30.0f);
+ splashOffset.y = sExitSplashOffsets[i].y;
+ splashOffset.z = sExitSplashOffsets[i].z;
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
splashSpawnPos.y += this->dyna.actor.world.pos.y;
@@ -106,15 +91,15 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
}
}
if ((rotZ < 0x1F4) && (rotZ >= 0)) {
- if (flags != 0) {
+ if (flag40) {
Matrix_RotateY(this->dyna.actor.home.rot.y, MTXMODE_NEW);
Matrix_InsertXRotation_s(this->dyna.actor.home.rot.x, MTXMODE_APPLY);
Matrix_InsertZRotation_s(this->dyna.actor.home.rot.z, MTXMODE_APPLY);
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
- splashOffset.x = D_80AD32A0[i].x + (Rand_ZeroOne() * 10.0f);
- splashOffset.y = D_80AD32A0[i].y;
- splashOffset.z = D_80AD32A0[i].z;
+ splashOffset.x = sEnterSplashOffsets[i].x + (Rand_ZeroOne() * 10.0f);
+ splashOffset.y = sEnterSplashOffsets[i].y;
+ splashOffset.z = sEnterSplashOffsets[i].z;
Matrix_MultiplyVector3fByState(&splashOffset, &splashSpawnPos);
splashSpawnPos.x += this->dyna.actor.world.pos.x + ((Rand_ZeroOne() * 20.0f) - 10.0f);
splashSpawnPos.y += this->dyna.actor.world.pos.y;
@@ -129,50 +114,47 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) {
void BgCtowerGear_Init(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerGear* this = THIS;
- s32 type;
+ s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor);
- type = BGCTOWERGEAR_GET_TYPE(this);
Actor_SetScale(&this->dyna.actor, 0.1f);
- if (type == CENTER_COG) {
+ if (type == BGCTOWERGEAR_CENTER_COG) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChainCenterCog);
- } else if (type == ORGAN) {
+ } else if (type == BGCTOWERGEAR_ORGAN) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChainOrgan);
this->dyna.actor.draw = NULL;
this->dyna.actor.update = BgCtowerGear_UpdateOrgan;
} else {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
}
- if (type == WATER_WHEEL) {
+ if (type == BGCTOWERGEAR_WATER_WHEEL) {
DynaPolyActor_Init(&this->dyna, 3);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06018588);
- } else if (type == ORGAN) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerWaterWheelCol);
+ } else if (type == BGCTOWERGEAR_ORGAN) {
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06016E70);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerOrganCol);
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
}
void BgCtowerGear_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerGear* this = THIS;
- s32 type;
+ s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor);
- type = BGCTOWERGEAR_GET_TYPE(this);
- if ((type == WATER_WHEEL) || (type == ORGAN)) {
+ if ((type == BGCTOWERGEAR_WATER_WHEEL) || (type == BGCTOWERGEAR_ORGAN)) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
}
void BgCtowerGear_Update(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerGear* this = THIS;
- s32 type;
+ s32 type = BGCTOWERGEAR_GET_TYPE(&this->dyna.actor);
- type = BGCTOWERGEAR_GET_TYPE(this);
- if (type == CEILING_COG) {
+ if (type == BGCTOWERGEAR_CEILING_COG) {
this->dyna.actor.shape.rot.x -= 0x1F4;
- } else if (type == CENTER_COG) {
+ } else if (type == BGCTOWERGEAR_CENTER_COG) {
this->dyna.actor.shape.rot.y += 0x1F4;
func_800B9010(&this->dyna.actor, NA_SE_EV_WINDMILL_LEVEL - SFX_FLAG);
- } else if (type == WATER_WHEEL) {
+ } else if (type == BGCTOWERGEAR_WATER_WHEEL) {
this->dyna.actor.shape.rot.z -= 0x1F4;
BgCtowerGear_Splash(this, globalCtx);
}
@@ -181,8 +163,8 @@ void BgCtowerGear_Update(Actor* thisx, GlobalContext* globalCtx) {
void BgCtowerGear_UpdateOrgan(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerGear* this = THIS;
- if (func_800EE29C(globalCtx, 0x68)) {
- switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x68)]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 104)) {
+ switch (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 104)]->action) {
case 1:
this->dyna.actor.draw = NULL;
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
@@ -198,18 +180,17 @@ void BgCtowerGear_UpdateOrgan(Actor* thisx, GlobalContext* globalCtx) {
}
}
-// Using BgCtowerGear *this = THIS causes regalloc issues
void BgCtowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_80AD32E8[BGCTOWERGEAR_GET_TYPE(thisx)]);
+ Gfx_DrawDListOpa(globalCtx, sDLists[BGCTOWERGEAR_GET_TYPE(thisx)]);
}
void BgCtowerGear_DrawOrgan(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060160A0);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerOrganDL);
func_8012C2DC(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06015F30);
+ gSPDisplayList(POLY_XLU_DISP++, gClockTowerOrganPipesDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h
index caf8d3508c..5da321679a 100644
--- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h
+++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.h
@@ -5,6 +5,16 @@
struct BgCtowerGear;
+
+#define BGCTOWERGEAR_GET_TYPE(thisx) ((thisx)->params & 3)
+
+typedef enum {
+ /* 0x00 */ BGCTOWERGEAR_CEILING_COG,
+ /* 0x01 */ BGCTOWERGEAR_CENTER_COG,
+ /* 0x02 */ BGCTOWERGEAR_WATER_WHEEL,
+ /* 0x03 */ BGCTOWERGEAR_ORGAN
+} BgCtowerGearType;
+
typedef struct BgCtowerGear {
/* 0x000 */ DynaPolyActor dyna;
} BgCtowerGear; // size = 0x15C
diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c
index 1686906238..53ddd7b81d 100644
--- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c
+++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.c
@@ -1,12 +1,13 @@
/*
* File: z_bg_ctower_rot.c
* Overlay: ovl_Bg_CtowerRot
- * Description: Twisting path along with the Doors to Clock Tower
+ * Description: Twisting path along with the Stone Doors to Clock Tower
*/
#include "z_bg_ctower_rot.h"
+#include "objects/object_ctower_rot/object_ctower_rot.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgCtowerRot*)thisx)
@@ -32,39 +33,32 @@ const ActorInit Bg_Ctower_Rot_InitVars = {
(ActorFunc)BgCtowerRot_Draw,
};
-extern Gfx D_060129D0[];
-extern Gfx D_06012DA0[];
-extern CollisionHeader D_060142E8;
-extern Gfx D_06017220[];
-extern CollisionHeader D_06017410;
-extern Gfx D_060174E0[];
-extern CollisionHeader D_06017650;
-
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-static Gfx* bgCtowerRotDlists[] = { D_06012DA0, D_06017220, D_060174E0 };
+static Gfx* sDLists[] = { gClockTowerCorridorDL, gClockTowerStoneDoorMainDL, gClockTowerStoneDoorDL };
void BgCtowerRot_Init(Actor* thisx, GlobalContext* globalCtx) {
- BgCtowerRot* this = THIS;
s32 pad;
+ BgCtowerRot* this = THIS;
Player* player;
Vec3f offset;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
- if (this->dyna.actor.params == CORRIDOR) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060142E8);
+ if (this->dyna.actor.params == BGCTOWERROT_CORRIDOR) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerCorridorCol);
this->actionFunc = BgCtowerRot_CorridorRotate;
return;
}
+
player = GET_PLAYER(globalCtx);
- if (this->dyna.actor.params == MAIN_DOOR) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017410);
+ if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerStoneDoorMainCol);
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y + 0x4000;
} else {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06017650);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClockTowerStoneDoorCol);
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y - 0x4000;
}
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
@@ -88,22 +82,18 @@ void BgCtowerRot_CorridorRotate(BgCtowerRot* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
Vec3f offset;
f32 rotZ;
- f32 offsetDiffZ;
f32 rotZtmp;
Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &offset, &player->actor.world.pos);
if (offset.z > 1100.0f) {
rotZ = 0.0f;
} else {
- offsetDiffZ = 1100.0f - offset.z;
- rotZtmp = (offsetDiffZ > 1000.0f)
- ? 1000.0f
- : offsetDiffZ; // Removing rotZtmp just causes regalloc issues and a missing instruction
+ rotZtmp = CLAMP_MAX(1100.0f - offset.z, 1000.0f);
rotZ = rotZtmp;
}
- func_800DFAC8(globalCtx->cameraPtrs[0], 0x11);
+ func_800DFAC8(globalCtx->cameraPtrs[CAM_ID_MAIN], 17);
this->dyna.actor.shape.rot.z = rotZ * 16.384f;
- if (globalCtx->csCtx.frames == 0x84) {
+ if (globalCtx->csCtx.frames == 132) {
play_sound(NA_SE_SY_SPIRAL_DASH);
}
}
@@ -113,12 +103,12 @@ void BgCtowerRot_DoorDoNothing(BgCtowerRot* this, GlobalContext* globalCtx) {
void BgCtowerRot_DoorClose(BgCtowerRot* this, GlobalContext* globalCtx) {
if (!Math_SmoothStepToF(&this->timer, 0.0f, 0.1f, 15.0f, 0.1f)) {
- if (this->dyna.actor.params == MAIN_DOOR) {
+ if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
ActorCutscene_Stop(this->dyna.actor.cutscene);
}
this->actionFunc = BgCtowerRot_DoorDoNothing;
- } else if (this->dyna.actor.params == 1) {
+ } else if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
func_800B9010(&this->dyna.actor, NA_SE_EV_STONE_STATUE_OPEN - SFX_FLAG);
}
this->dyna.actor.world.pos.x =
@@ -141,7 +131,7 @@ void BgCtowerRot_DoorIdle(BgCtowerRot* this, GlobalContext* globalCtx) {
void BgCtowerRot_SetupDoorClose(BgCtowerRot* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
- if (this->dyna.actor.params == MAIN_DOOR) {
+ if (this->dyna.actor.params == BGCTOWERROT_STONE_DOOR_MAIN) {
ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
}
this->actionFunc = BgCtowerRot_DoorClose;
@@ -159,8 +149,8 @@ void BgCtowerRot_Update(Actor* thisx, GlobalContext* globalCtx) {
void BgCtowerRot_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgCtowerRot* this = THIS;
- Gfx_DrawDListOpa(globalCtx, bgCtowerRotDlists[this->dyna.actor.params]);
- if (this->dyna.actor.params == CORRIDOR) {
- Gfx_DrawDListXlu(globalCtx, D_060129D0);
+ Gfx_DrawDListOpa(globalCtx, sDLists[this->dyna.actor.params]);
+ if (this->dyna.actor.params == BGCTOWERROT_CORRIDOR) {
+ Gfx_DrawDListXlu(globalCtx, gClockTowerCorridorFoliageDL);
}
}
diff --git a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h
index 78ff6744b3..b8b0dbfb0b 100644
--- a/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h
+++ b/src/overlays/actors/ovl_Bg_Ctower_Rot/z_bg_ctower_rot.h
@@ -8,10 +8,10 @@ struct BgCtowerRot;
typedef void (*BgCtowerRotActionFunc)(struct BgCtowerRot*, GlobalContext*);
typedef enum {
- /* 0 */ CORRIDOR,
- /* 1 */ MAIN_DOOR, // Main door controls cutscene flow (updating Link fields and playing sounds). It is the one on
- // the left when entering from the Lost Woods
- /* 2 */ DOOR,
+ /* 0 */ BGCTOWERROT_CORRIDOR,
+ /* 1 */ BGCTOWERROT_STONE_DOOR_MAIN, // Main door controls cutscene flow (updating Link fields and playing sounds).
+ // It is the one on the left when entering from the Lost Woods
+ /* 2 */ BGCTOWERROT_STONE_DOOR,
} BgCtowerRotType;
typedef struct BgCtowerRot {
diff --git a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c
index 00219105b5..1aada92723 100644
--- a/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.c
@@ -6,7 +6,7 @@
#include "z_bg_danpei_movebg.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgDanpeiMovebg*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c
index 977c3ed8ba..af6ed5fa2e 100644
--- a/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c
+++ b/src/overlays/actors/ovl_Bg_Dblue_Elevator/z_bg_dblue_elevator.c
@@ -6,7 +6,7 @@
#include "z_bg_dblue_elevator.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgDblueElevator*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
index aa4a325818..3a12f286d1 100644
--- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.c
@@ -5,8 +5,10 @@
*/
#include "z_bg_dblue_movebg.h"
+#include "objects/object_dblue_object/object_dblue_object.h"
+#include "overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgDblueMovebg*)thisx)
@@ -15,7 +17,33 @@ void BgDblueMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgDblueMovebg_Update(Actor* thisx, GlobalContext* globalCtx);
void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80A2A1E0(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A32C(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A444(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A670(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A688(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A714(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2A7F8(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2AAB8(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2AED0(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2B1A0(BgDblueMovebg* this, GlobalContext* globalCtx);
+void func_80A2B274(Actor* thisx, GlobalContext* globalCtx);
+void func_80A2B308(Actor* thisx, GlobalContext* globalCtx);
+
+BgDblueMovebg* D_80A2BBF0;
+
+typedef struct {
+ u8 unk_00;
+ u8 unk_01;
+} BgDblueMovebgUnkStruct;
+
+BgDblueMovebgUnkStruct D_80A2BBF4;
+
+u8 D_80A2B870[][2] = {
+ { 0x01, 0x01 }, { 0x01, 0x00 }, { 0x02, 0x03 }, { 0x02, 0x01 }, { 0x02, 0x02 }, { 0x02, 0x00 }, { 0x03, 0x07 },
+ { 0x03, 0x03 }, { 0x03, 0x05 }, { 0x03, 0x01 }, { 0x03, 0x06 }, { 0x03, 0x02 }, { 0x03, 0x04 }, { 0x03, 0x00 },
+};
+
const ActorInit Bg_Dblue_Movebg_InitVars = {
ACTOR_BG_DBLUE_MOVEBG,
ACTORCAT_BG,
@@ -28,46 +56,813 @@ const ActorInit Bg_Dblue_Movebg_InitVars = {
(ActorFunc)BgDblueMovebg_Draw,
};
-#endif
+Gfx* D_80A2B8AC[] = {
+ NULL,
+ object_dblue_object_DL_0069D8,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ object_dblue_object_DL_004848,
+ object_dblue_object_DL_0061B8,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+};
-extern UNK_TYPE D_06004848;
-extern UNK_TYPE D_060052B8;
-extern UNK_TYPE D_06008778;
+Gfx* D_80A2B8DC[] = {
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, object_dblue_object_DL_00CAA0, NULL,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A29A80.s")
+CollisionHeader* D_80A2B90C[] = {
+ NULL,
+ &object_dblue_object_Colheader_006EA8,
+ NULL,
+ NULL,
+ NULL,
+ &object_dblue_object_Colheader_00D3DC,
+ &object_dblue_object_Colheader_005D28,
+ &object_dblue_object_Colheader_00714C,
+ &object_dblue_object_Colheader_00AED0,
+ &object_dblue_object_Colheader_00AED0,
+ NULL,
+ NULL,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/BgDblueMovebg_Init.s")
+AnimatedMaterial* D_80A2B93C[] = {
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, object_dblue_object_Matanimheader_00CC18, NULL,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/BgDblueMovebg_Destroy.s")
+s16 D_80A2B96C[] = { 0, 0x16C, -0x16C, 0 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A128.s")
+s16 D_80A2B974[] = { -1, -1 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A1E0.s")
+static InitChainEntry sInitChain[] = {
+ ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneDownward, 1100, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_CONTINUE),
+ ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A32C.s")
+Vec3f D_80A2B988 = { 1785.0f, 0.0f, 220.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A444.s")
+s32 func_80A29A80(GlobalContext* globalCtx, s32 arg1, s32 arg2) {
+ s32 sp2C = 1;
+ s32 val;
+ s32 val2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A670.s")
+ if (arg2 < 14) {
+ val = D_80A2B870[arg2][0];
+ val2 = D_80A2B870[arg2][1];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A688.s")
+ while (val--) {
+ if ((1 << val) & val2) {
+ if (!Flags_GetSwitch(globalCtx, arg1 + val)) {
+ sp2C = 0;
+ break;
+ }
+ } else if (Flags_GetSwitch(globalCtx, arg1 + val)) {
+ sp2C = 0;
+ break;
+ }
+ }
+ } else {
+ sp2C = 0;
+ switch (arg2) {
+ case 14:
+ if (!Flags_GetSwitch(globalCtx, arg1)) {
+ sp2C = 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A714.s")
+ if (Flags_GetSwitch(globalCtx, arg1 + 1) && Flags_GetSwitch(globalCtx, arg1 + 2) &&
+ Flags_GetSwitch(globalCtx, arg1 + 3)) {
+ sp2C += 2;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2A7F8.s")
+ case 15:
+ if (!Flags_GetSwitch(globalCtx, arg1) ||
+ (Flags_GetSwitch(globalCtx, arg1 + 1) && Flags_GetSwitch(globalCtx, arg1 + 2) &&
+ Flags_GetSwitch(globalCtx, arg1 + 3))) {
+ sp2C = 1;
+ }
+ break;
+ }
+ }
+ return sp2C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2AAB8.s")
+void BgDblueMovebg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ BgDblueMovebg* this = THIS;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2ABD0.s")
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ this->unk_160 = BGDBLUEMOVEBG_GET_F(thisx);
+ this->unk_1BC = BGDBLUEMOVEBG_GET_F000(thisx);
+ this->unk_1C0 = BGDBLUEMOVEBG_GET_FF0(thisx);
+ DynaPolyActor_Init(&this->dyna, 1);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2AED0.s")
+ if ((this->unk_160 == 9) || (this->unk_160 == 8)) {
+ if (D_80A2BBF4.unk_00 != 0) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ this->unk_170 = this->dyna.actor.room;
+ this->dyna.actor.room = -1;
+ D_80A2BBF4.unk_00 = 1;
+ this->unk_171 = this->dyna.actor.world.rot.z;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ } else if (this->unk_160 == 6) {
+ if (D_80A2BBF4.unk_01 != 0) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ this->unk_171 = this->dyna.actor.world.rot.z;
+ this->unk_170 = this->dyna.actor.room;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ this->dyna.actor.room = -1;
+ D_80A2BBF4.unk_01 = 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2B1A0.s")
+ if (D_80A2B90C[this->unk_160] != NULL) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_80A2B90C[this->unk_160]);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/BgDblueMovebg_Update.s")
+ this->unk_164 = D_80A2B8AC[this->unk_160];
+ this->unk_168 = D_80A2B8DC[this->unk_160];
+ this->unk_16C = D_80A2B93C[this->unk_160];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2B274.s")
+ SubS_FillCutscenesList(&this->dyna.actor, this->unk_1B6, ARRAY_COUNT(this->unk_1B6));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/func_80A2B308.s")
+ switch (this->unk_160) {
+ case 1:
+ this->unk_1C4 = this->dyna.actor.world.rot.x;
+ this->unk_1C8 = this->dyna.actor.world.rot.z;
+ this->dyna.actor.world.rot.x = 0;
+ this->dyna.actor.shape.rot.x = 0;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ if (func_80A29A80(globalCtx, this->unk_1C8, this->unk_1C4)) {
+ this->unk_172 |= 1;
+ } else {
+ this->unk_172 &= ~1;
+ }
+ this->unk_17E = 0;
+ this->unk_184 = 0.0f;
+ if (Flags_GetSwitch(globalCtx, this->unk_1C0)) {
+ this->unk_18C = 0x384;
+ } else {
+ this->unk_18C = 0;
+ }
+ this->dyna.actor.shape.rot.y += (s16)((this->unk_18C / 10.0f) * (0x10000 / 360.0f));
+ this->actionFunc = func_80A2A714;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Dblue_Movebg/BgDblueMovebg_Draw.s")
+ case 6:
+ this->unk_178 = func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC);
+ this->unk_1CC = D_80A2B96C[this->unk_178];
+ this->unk_1CE = this->unk_1CC;
+ this->actionFunc = func_80A2A1E0;
+ break;
+
+ case 7:
+ this->unk_1C4 = this->dyna.actor.world.rot.x;
+ this->unk_1C8 = this->dyna.actor.world.rot.z;
+ this->dyna.actor.world.rot.x = 0;
+ this->dyna.actor.shape.rot.x = 0;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ if (Flags_GetSwitch(globalCtx, this->unk_1C0)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ break;
+ }
+ this->unk_18C = 0;
+ this->dyna.actor.draw = func_80A2B308;
+ this->unk_17E = 0;
+ this->unk_184 = 0.0f;
+ this->dyna.actor.shape.rot.y += (s16)((this->unk_18C / 10.0f) * (0x10000 / 360.0f));
+ this->actionFunc = func_80A2A32C;
+ break;
+
+ case 8:
+ case 9:
+ this->unk_2F8[1] = NULL;
+ this->unk_2F8[0] = NULL;
+ label:
+ for (i = 0; i < ARRAY_COUNT(D_80A2B974); i++) {
+ D_80A2B974[i] = this->unk_1B6[i];
+ }
+ this->unk_178 = func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC);
+ this->unk_1CC = D_80A2B96C[this->unk_178];
+ this->unk_1CE = this->unk_1CC;
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_GetStateTranslationAndScaledX(2240.0f, &this->unk_190);
+ Matrix_GetStateTranslationAndScaledX(-10.0f, &this->unk_19C);
+ Math_Vec3f_Sum(&this->unk_190, &this->dyna.actor.world.pos, &this->unk_190);
+ Math_Vec3f_Sum(&this->unk_19C, &this->dyna.actor.world.pos, &this->unk_19C);
+ D_80A2BBF0 = this;
+ this->dyna.actor.flags |= ACTOR_FLAG_20;
+ this->actionFunc = func_80A2AED0;
+ break;
+
+ case 10:
+ this->actionFunc = func_80A2B1A0;
+ break;
+
+ case 11:
+ this->unk_1CC = D_80A2B96C[func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC)];
+ D_80A2BBF0 = this;
+ this->dyna.actor.flags |= ACTOR_FLAG_20;
+ this->dyna.actor.update = Actor_Noop;
+ this->dyna.actor.draw = func_80A2B274;
+ break;
+ }
+}
+
+void BgDblueMovebg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ BgDblueMovebg* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ if ((this->unk_160 == 9) || (this->unk_160 == 8)) {
+ Audio_StopSfxByPos(&this->unk_1A8);
+ }
+}
+
+void func_80A2A128(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Actor* phi_s0 = NULL;
+
+ while (true) {
+ phi_s0 = SubS_FindActor(globalCtx, phi_s0, ACTORCAT_BG, ACTOR_OBJ_HUNSUI);
+ if (phi_s0 != NULL) {
+ if ((OBJHUNSUI_GET_F000(phi_s0) == 5) && (phi_s0->update != NULL)) {
+ this->unk_2F8[1] = phi_s0;
+ } else if ((OBJHUNSUI_GET_F000(phi_s0) == 6) && (phi_s0->update != NULL)) {
+ this->unk_2F8[0] = phi_s0;
+ }
+ phi_s0 = phi_s0->next;
+ }
+
+ if (phi_s0 == NULL) {
+ break;
+ }
+ }
+}
+
+void func_80A2A1E0(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ s32 temp_v0 = func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC);
+
+ if (temp_v0 != this->unk_178) {
+ switch (temp_v0) {
+ case 1:
+ case 2:
+ this->unk_17E = 40;
+ break;
+
+ case 0:
+ case 3:
+ this->unk_17E = 15;
+ break;
+ }
+ }
+ this->unk_178 = temp_v0;
+
+ if (this->unk_17E <= 0) {
+ this->unk_1CE = D_80A2B96C[temp_v0];
+ } else {
+ this->unk_17E--;
+ }
+
+ Math_StepToS(&this->unk_1CC, this->unk_1CE, 12);
+ this->dyna.actor.shape.rot.y += this->unk_1CC;
+
+ if (globalCtx->roomCtx.currRoom.num == 0) {
+ this->unk_164 = object_dblue_object_DL_004848;
+ } else if (globalCtx->roomCtx.currRoom.num == 8) {
+ this->unk_164 = NULL;
+ }
+
+ if (globalCtx->roomCtx.currRoom.num != this->unk_170) {
+ if (globalCtx->roomCtx.currRoom.num != this->unk_171) {
+ if ((globalCtx->roomCtx.prevRoom.num != this->unk_170) &&
+ (globalCtx->roomCtx.prevRoom.num != this->unk_171)) {
+ D_80A2BBF4.unk_01 = 0;
+ Actor_MarkForDeath(&this->dyna.actor);
+ }
+ }
+ }
+}
+
+void func_80A2A32C(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 phi_v0;
+ f32 phi_f0;
+ s32 phi_v1;
+
+ if (this->dyna.pushForce != 0.0f) {
+ this->unk_18E = BINANG_SUB(this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer);
+ this->unk_184 = this->dyna.actor.xzDistToPlayer;
+
+ if (this->dyna.pushForce >= 0.0f) {
+ phi_f0 = 1.0f;
+ } else {
+ phi_f0 = -1.0f;
+ }
+
+ if (BINANG_SUB(this->dyna.actor.yawTowardsPlayer, player->actor.shape.rot.y) > 0) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ this->unk_17E = phi_v0 * phi_f0;
+
+ phi_v1 = false;
+ if (this->unk_17E > 0) {
+ phi_v1 = true;
+ }
+
+ if (phi_v1) {
+ this->unk_180 = func_800F2178(this->unk_1B6[0]);
+ this->unk_1D2 = this->unk_1B6[0];
+ this->unk_172 |= 8;
+ this->actionFunc = func_80A2A444;
+ } else {
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ }
+ }
+}
+
+void func_80A2A444(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 sp20;
+ Player* temp_a3;
+ s16 temp_v0;
+
+ this->unk_188++;
+ this->unk_188 = CLAMP_MAX(this->unk_188, 5);
+
+ sp20 = Math_StepToS(&this->unk_18A, 900, this->unk_188);
+ temp_v0 = this->unk_18A * this->unk_17E;
+ this->dyna.actor.shape.rot.y =
+ (s32)((this->unk_18C + temp_v0) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y;
+
+ if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) {
+ player->actor.world.pos.x =
+ (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x;
+ player->actor.world.pos.z =
+ (Math_CosS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.z;
+ } else {
+ this->unk_184 = 0.0f;
+ }
+
+ if (sp20) {
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ Flags_SetSwitch(globalCtx, this->unk_1C0);
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
+
+ if (func_80A29A80(globalCtx, this->unk_1C8, this->unk_1C4)) {
+ this->unk_172 |= 1;
+ } else {
+ this->unk_172 &= ~1;
+ }
+
+ if (!(this->unk_174 & 1) && (this->unk_172 & 1)) {
+ func_801000CC(NA_SE_EV_PIPE_STREAM_START);
+ }
+ func_80A2A670(this, globalCtx);
+ } else {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_COCK_SWITCH_ROLL - SFX_FLAG);
+ }
+}
+
+void func_80A2A670(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ this->actionFunc = func_80A2A688;
+}
+
+void func_80A2A688(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ this->unk_180--;
+ if (this->unk_180 <= 0) {
+ ActorCutscene_Stop(this->unk_1B6[0]);
+ }
+
+ if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 60.0f, 2.0f) &&
+ (this->unk_180 <= 0)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ }
+}
+
+void func_80A2A714(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 phi_v0;
+ f32 phi_f0;
+
+ if (this->dyna.pushForce != 0.0f) {
+ this->unk_18E = BINANG_SUB(this->dyna.actor.shape.rot.y, this->dyna.actor.yawTowardsPlayer);
+ this->unk_184 = this->dyna.actor.xzDistToPlayer;
+ if (this->dyna.pushForce >= 0.0f) {
+ phi_f0 = 1.0f;
+ } else {
+ phi_f0 = -1.0f;
+ }
+
+ if (BINANG_SUB(this->dyna.actor.yawTowardsPlayer, player->actor.shape.rot.y) > 0) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ this->unk_17E = phi_v0 * phi_f0;
+
+ this->unk_180 = func_800F2178(this->unk_1B6[0]);
+ this->unk_1D2 = this->unk_1B6[0];
+ this->unk_172 |= 8;
+ this->actionFunc = func_80A2A7F8;
+ }
+}
+
+void func_80A2A7F8(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 sp28;
+ s16 sp26;
+ s32 temp;
+
+ this->unk_188++;
+ this->unk_188 = CLAMP_MAX(this->unk_188, 5);
+
+ sp28 = Math_StepToS(&this->unk_18A, 900, this->unk_188);
+ sp26 = this->unk_18A * this->unk_17E;
+ this->dyna.actor.shape.rot.y =
+ (s32)((this->unk_18C + sp26) * 0.1f * (0x10000 / 360.0f)) + this->dyna.actor.home.rot.y;
+
+ if ((player->stateFlags2 & 0x10) && (this->unk_184 > 0.0f)) {
+ player->actor.world.pos.x =
+ (Math_SinS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.x;
+ player->actor.world.pos.z =
+ (Math_CosS(this->dyna.actor.shape.rot.y - this->unk_18E) * this->unk_184) + this->dyna.actor.home.pos.z;
+ } else {
+ this->unk_184 = 0.0f;
+ }
+
+ if (sp28) {
+ temp = (this->unk_18C + sp26 + 3600) % 3600;
+
+ if ((temp == 900) || (temp == 2700)) {
+ Flags_SetSwitch(globalCtx, this->unk_1C0);
+ } else {
+ Flags_UnsetSwitch(globalCtx, this->unk_1C0);
+ }
+
+ player->stateFlags1 |= 0x20;
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+
+ this->unk_18C = (this->unk_18C + sp26 + 3600) % 3600;
+ this->unk_188 = 0;
+ this->unk_18A = 0;
+ this->unk_17E = 0;
+
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_STONEDOOR_STOP);
+
+ if (func_80A29A80(globalCtx, this->unk_1C8, this->unk_1C4)) {
+ this->unk_172 |= 1;
+ } else {
+ this->unk_172 &= ~1;
+ }
+
+ if (!(this->unk_174 & 1) && (this->unk_172 & 1)) {
+ func_801000CC(NA_SE_EV_PIPE_STREAM_START);
+ }
+
+ this->unk_174 = this->unk_172;
+ this->unk_1D0 = 17;
+ this->actionFunc = func_80A2AAB8;
+ } else {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_COCK_SWITCH_ROLL - SFX_FLAG);
+ }
+}
+
+void func_80A2AAB8(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 sp18;
+
+ if (this->unk_180-- <= 0) {
+ ActorCutscene_Stop(this->unk_1B6[0]);
+ }
+
+ sp18 = false;
+ if ((this->unk_1D0 > 0) && ((D_80A2B974[0] >= 0) || (D_80A2B974[1] >= 0))) {
+ if (ActorCutscene_GetCurrentIndex() != -1) {
+ sp18 = true;
+ }
+ }
+
+ if (!sp18 && (this->unk_180 <= 0)) {
+ this->unk_1D0--;
+
+ if (this->unk_1D0 == 1) {
+ this->dyna.pushForce = 0.0f;
+ player->stateFlags1 |= 0x20;
+ player->stateFlags2 &= ~0x10;
+ }
+
+ if (this->unk_1D0 <= 0) {
+ player->stateFlags1 &= ~0x20;
+ this->actionFunc = func_80A2A714;
+ }
+ }
+}
+
+void func_80A2ABD0(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ Vec3f spAC;
+ f32 temp_f0;
+ f32 temp_f20;
+ s32 phi_v0;
+ s32 i;
+ s32 j;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_2F8); i++) {
+ if (this->unk_2F8[i] == NULL) {
+ func_80A2A128(this, globalCtx);
+ continue;
+ }
+
+ for (j = 0; j < ARRAY_COUNT(this->unk_1D8[0]); j++) {
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x + (j * 0x2000), MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
+ Matrix_MultiplyVector3fByState(&D_80A2B988, &spAC);
+ Math_Vec3f_Sum(&this->dyna.actor.world.pos, &spAC, &spAC);
+ Math_Vec3f_Copy(&this->unk_238[i][j], &spAC);
+ temp_f20 = spAC.y - this->unk_2F8[i]->world.pos.y;
+ temp_f0 = Math_Vec3f_DistXZ(&this->unk_2F8[i]->world.pos, &spAC);
+
+ if ((this->unk_300[i][j] != 0) && (temp_f20 <= 12.0f) && (temp_f20 >= 0.0f) && (temp_f0 <= 60.0f)) {
+ phi_v0 = 1;
+ } else {
+ phi_v0 = 1;
+ phi_v0 = (s64)phi_v0;
+ if (((temp_f20 >= 0.0f) && ((temp_f20 > 0.0f) || (temp_f0 > 60.f))) ||
+ ((temp_f20 < 0.0f) && ((temp_f20 < -150.0f) || (temp_f0 > 40.0f)))) {
+ phi_v0 = 0;
+ }
+ }
+
+ if (phi_v0) {
+ this->unk_300[i][j] = i + 1;
+ Math_StepToF(&this->unk_1F8[i][j], 1.0f, 0.2f);
+ Math_StepToS(&this->unk_1D8[i][j], 255, 20);
+ } else {
+ this->unk_300[i][j] = 0;
+ Math_StepToF(&this->unk_1F8[i][j], 0.0f, 0.01f);
+ Math_StepToS(&this->unk_1D8[i][j], 0, 20);
+ }
+ }
+ }
+}
+
+void func_80A2AED0(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 temp_v0_3;
+
+ if (globalCtx->roomCtx.currRoom.num != this->unk_170) {
+ if (globalCtx->roomCtx.currRoom.num != this->unk_171) {
+ if ((globalCtx->roomCtx.prevRoom.num != this->unk_170) &&
+ (globalCtx->roomCtx.prevRoom.num != this->unk_171)) {
+ D_80A2BBF4.unk_00 = 0;
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ }
+ }
+
+ temp_v0_3 = func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC);
+ if (temp_v0_3 != this->unk_178) {
+ switch (temp_v0_3) {
+ case 1:
+ case 2:
+ this->unk_1D2 = this->unk_1B6[0];
+ this->unk_17E = 40;
+ break;
+
+ case 0:
+ case 3:
+ this->unk_1D2 = this->unk_1B6[1];
+ this->unk_17E = 15;
+ break;
+ }
+ this->unk_172 |= 8;
+ }
+ this->unk_178 = temp_v0_3;
+
+ if (!(this->unk_172 & 8)) {
+ if (this->unk_17E <= 0) {
+ this->unk_1CE = D_80A2B96C[temp_v0_3];
+ } else {
+ this->unk_17E--;
+ }
+ }
+
+ Math_StepToS(&this->unk_1CC, this->unk_1CE, 12);
+ this->dyna.actor.shape.rot.x += this->unk_1CC;
+
+ if (this->unk_160 == 8) {
+ if (globalCtx->roomCtx.currRoom.num == 8) {
+ func_80A2ABD0(this, globalCtx);
+ this->unk_172 |= 0x20;
+ } else {
+ this->unk_172 &= ~0x20;
+ }
+ }
+
+ if (globalCtx->roomCtx.currRoom.num == 0) {
+ this->unk_164 = object_dblue_object_DL_008778;
+ } else if (globalCtx->roomCtx.currRoom.num == 8) {
+ this->unk_164 = object_dblue_object_DL_00A528;
+ }
+
+ if (this == D_80A2BBF0) {
+ Vec3f sp54;
+ f32 sp50;
+
+ if (Math3D_PointDistToLine2D(globalCtx->view.eye.x, globalCtx->view.eye.z, this->unk_190.x, this->unk_190.z,
+ this->unk_19C.x, this->unk_19C.z, &sp54.x, &sp54.z, &sp50)) {
+ sp54.y = this->dyna.actor.world.pos.y;
+ } else {
+ if (Math_Vec3f_DistXYZ(&globalCtx->view.eye, &this->unk_190) <=
+ Math_Vec3f_DistXYZ(&globalCtx->view.eye, &this->unk_19C)) {
+ Math_Vec3f_Copy(&sp54, &this->unk_190);
+ } else {
+ Math_Vec3f_Copy(&sp54, &this->unk_19C);
+ }
+ }
+
+ SkinMatrix_Vec3fMtxFMultXYZ(&globalCtx->viewProjectionMtxF, &sp54, &this->unk_1A8);
+ this->unk_1D4 = ABS(this->unk_1CC) / 364.0f;
+ }
+}
+
+void func_80A2B1A0(BgDblueMovebg* this, GlobalContext* globalCtx) {
+ switch (func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC)) {
+ case 1:
+ this->dyna.actor.shape.rot.z = this->dyna.actor.home.rot.z;
+ break;
+
+ case 2:
+ this->dyna.actor.shape.rot.z = BINANG_ROT180(this->dyna.actor.home.rot.z);
+ break;
+ }
+}
+
+void BgDblueMovebg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ BgDblueMovebg* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_172 & 8) {
+ if (SubS_StartActorCutscene(&this->dyna.actor, this->unk_1D2, -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
+ this->unk_172 &= ~8;
+ }
+ }
+}
+
+void func_80A2B274(Actor* thisx, GlobalContext* globalCtx) {
+ BgDblueMovebg* this = THIS;
+ s16 temp_v1;
+
+ if (this != D_80A2BBF0) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+
+ temp_v1 = D_80A2B96C[func_80A29A80(globalCtx, this->unk_1C0, this->unk_1BC)];
+ if (temp_v1 != 0) {
+ if (temp_v1 > 0) {
+ func_8019FC20(&this->dyna.actor.projectedPos, NA_SE_EV_DUMMY_WATER_WHEEL_RR - SFX_FLAG);
+ } else {
+ func_8019FC20(&this->dyna.actor.projectedPos, NA_SE_EV_DUMMY_WATER_WHEEL_LR - SFX_FLAG);
+ }
+ }
+}
+
+void func_80A2B308(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ BgDblueMovebg* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, this->unk_164);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void BgDblueMovebg_Draw(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ BgDblueMovebg* this = THIS;
+ s32 i;
+ s32 j;
+ Gfx* gfx;
+ Gfx* gfx2;
+
+ Matrix_StatePush();
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if ((this->unk_160 == 9) || (this->unk_160 == 8) || (this->dyna.actor.flags & ACTOR_FLAG_40)) {
+ if (this->unk_16C != NULL) {
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(this->unk_16C));
+ }
+
+ if ((this->unk_164 != 0) || (this->unk_160 == 6)) {
+ gfx2 = Gfx_CallSetupDL(POLY_OPA_DISP, 0x19);
+
+ gSPMatrix(&gfx2[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ if (this->unk_160 == 6) {
+ gSPDisplayList(&gfx2[1], object_dblue_object_DL_0052B8);
+ if (this->unk_164 != 0) {
+ gSPDisplayList(&gfx2[2], this->unk_164);
+ POLY_OPA_DISP = &gfx2[3];
+ } else {
+ POLY_OPA_DISP = &gfx2[2];
+ }
+ } else {
+ gSPDisplayList(&gfx2[1], this->unk_164);
+ POLY_OPA_DISP = &gfx2[2];
+ }
+ }
+
+ if (this->unk_168 != NULL) {
+ gfx = func_8012C2B4(POLY_XLU_DISP);
+
+ gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(&gfx[1], this->unk_168);
+
+ POLY_XLU_DISP = &gfx[2];
+ }
+ }
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+
+ if ((this->unk_160 == 8) && (this->unk_172 & 0x20)) {
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_dblue_object_Matanimheader_00CE00));
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, MTXMODE_NEW);
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
+ gfx = func_8012C2B4(POLY_XLU_DISP);
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_1D8[0]); i++) {
+ for (j = 0; j < ARRAY_COUNT(this->unk_1D8); j++) {
+ if (this->unk_1D8[j][i] > 0) {
+ if (this->unk_1F8[j][i] > 0.1f) {
+ gSPSegment(
+ gfx++, 0x09,
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0,
+ (s32)(((globalCtx->gameplayFrames % 128) * -9.0f) / this->unk_1F8[j][i]),
+ 0x20, 0x20, 1, 0, 0, 0x20, 0x20));
+ }
+ Matrix_StatePush();
+ Matrix_InsertXRotation_s(i * 0x2000, MTXMODE_APPLY);
+ Matrix_InsertTranslation(1785.0f, 0.0f, 270.0f, MTXMODE_APPLY);
+ if (j != 0) {
+ Matrix_InsertZRotation_s(-0x8000, MTXMODE_APPLY);
+ }
+ Matrix_Scale(this->unk_1F8[j][i] * this->dyna.actor.scale.x,
+ this->unk_1F8[j][i] * this->dyna.actor.scale.y,
+ this->unk_1F8[j][i] * this->dyna.actor.scale.z, MTXMODE_APPLY);
+
+ gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetEnvColor(gfx++, 255, 255, 255, this->unk_1D8[j][i]);
+ gSPDisplayList(gfx++, object_dblue_object_DL_00CD10);
+
+ Matrix_StatePop();
+ }
+ }
+ }
+ POLY_XLU_DISP = gfx;
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if ((this->unk_160 == 9) || (this->unk_160 == 8)) {
+ if (this->unk_1CC >= 0) {
+ func_8019FB0C(&this->unk_1A8, NA_SE_EV_BIG_WATER_WHEEL_RR - SFX_FLAG, this->unk_1D4, 32);
+ } else {
+ func_8019FB0C(&this->unk_1A8, NA_SE_EV_BIG_WATER_WHEEL_LR - SFX_FLAG, this->unk_1D4, 32);
+ }
+ }
+}
diff --git a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h
index aeef09c879..b487762387 100644
--- a/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h
+++ b/src/overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h
@@ -7,11 +7,52 @@ struct BgDblueMovebg;
typedef void (*BgDblueMovebgActionFunc)(struct BgDblueMovebg*, GlobalContext*);
+#define BGDBLUEMOVEBG_GET_F(thisx) ((thisx)->params & 0xF)
+#define BGDBLUEMOVEBG_GET_FF0(thisx) (((thisx)->params >> 4) & 0xFF)
+#define BGDBLUEMOVEBG_GET_F000(thisx) (((thisx)->params >> 0xC) & 0xF)
+
+#define BGDBLUEMOVEBG_F_8 8
+
typedef struct BgDblueMovebg {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
- /* 0x015C */ BgDblueMovebgActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0x210];
+ /* 0x000 */ DynaPolyActor dyna;
+ /* 0x15C */ BgDblueMovebgActionFunc actionFunc;
+ /* 0x160 */ s32 unk_160;
+ /* 0x164 */ Gfx* unk_164;
+ /* 0x168 */ Gfx* unk_168;
+ /* 0x16C */ TexturePtr unk_16C;
+ /* 0x170 */ s8 unk_170;
+ /* 0x171 */ s8 unk_171;
+ /* 0x172 */ u16 unk_172;
+ /* 0x174 */ u16 unk_174;
+ /* 0x178 */ s32 unk_178;
+ /* 0x17C */ UNK_TYPE1 unk17C[2];
+ /* 0x17E */ s16 unk_17E;
+ /* 0x180 */ s16 unk_180;
+ /* 0x184 */ f32 unk_184;
+ /* 0x188 */ s16 unk_188;
+ /* 0x18A */ s16 unk_18A;
+ /* 0x18C */ s16 unk_18C;
+ /* 0x18E */ s16 unk_18E;
+ /* 0x190 */ Vec3f unk_190;
+ /* 0x19C */ Vec3f unk_19C;
+ /* 0x1A8 */ Vec3f unk_1A8;
+ /* 0x1B4 */ UNK_TYPE1 unk1B4[2];
+ /* 0x1B6 */ s16 unk_1B6[2];
+ /* 0x1BC */ s32 unk_1BC;
+ /* 0x1C0 */ s32 unk_1C0;
+ /* 0x1C4 */ s32 unk_1C4;
+ /* 0x1C8 */ s32 unk_1C8;
+ /* 0x1CC */ s16 unk_1CC;
+ /* 0x1CE */ s16 unk_1CE;
+ /* 0x1D0 */ s16 unk_1D0;
+ /* 0x1D2 */ s16 unk_1D2;
+ /* 0x1D4 */ f32 unk_1D4;
+ /* 0x1D8 */ s16 unk_1D8[2][8];
+ /* 0x1F8 */ f32 unk_1F8[2][8];
+ /* 0x238 */ Vec3f unk_238[2][8];
+ /* 0x2F8 */ Actor* unk_2F8[2];
+ /* 0x300 */ u8 unk_300[2][8];
+ /* 0x310 */ UNK_TYPE1 unk310[0x60];
} BgDblueMovebg; // size = 0x370
extern const ActorInit Bg_Dblue_Movebg_InitVars;
diff --git a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c
index fac369ac68..0c124dc07d 100644
--- a/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c
+++ b/src/overlays/actors/ovl_Bg_Dblue_Waterfall/z_bg_dblue_waterfall.c
@@ -6,7 +6,7 @@
#include "z_bg_dblue_waterfall.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgDblueWaterfall*)thisx)
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 1423328a16..4e9bf5c633 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
@@ -6,7 +6,7 @@
#include "z_bg_dy_yoseizo.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((BgDyYoseizo*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c
index e916d005c1..769118e697 100644
--- a/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c
+++ b/src/overlays/actors/ovl_Bg_F40_Block/z_bg_f40_block.c
@@ -6,7 +6,7 @@
#include "z_bg_f40_block.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgF40Block*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
index fb87361813..7805a6e546 100644
--- a/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
+++ b/src/overlays/actors/ovl_Bg_F40_Flift/z_bg_f40_flift.c
@@ -6,7 +6,7 @@
#include "z_bg_f40_flift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgF40Flift*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c
index 45cfbf74cb..8bb351a97e 100644
--- a/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c
+++ b/src/overlays/actors/ovl_Bg_F40_Switch/z_bg_f40_switch.c
@@ -6,7 +6,7 @@
#include "z_bg_f40_switch.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgF40Switch*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
index 672ba1f464..9d84f191c4 100644
--- a/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
+++ b/src/overlays/actors/ovl_Bg_F40_Swlift/z_bg_f40_swlift.c
@@ -6,7 +6,7 @@
#include "z_bg_f40_swlift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgF40Swlift*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c
index 0d215f5c2e..307d0fd0a3 100644
--- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c
+++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_fu_kaiten.h"
+#include "objects/object_fu_kaiten/object_fu_kaiten.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgFuKaiten*)thisx)
@@ -27,56 +28,58 @@ const ActorInit Bg_Fu_Kaiten_InitVars = {
(ActorFunc)BgFuKaiten_Draw,
};
-extern Gfx D_060005D0[];
-extern CollisionHeader D_06002D30;
-
void BgFuKaiten_Init(Actor* thisx, GlobalContext* globalCtx) {
- UNK_TYPE pad0;
- UNK_TYPE pad1;
- CollisionHeader* header = 0;
+ s32 pad;
+ BgFuKaiten* this = THIS;
+ CollisionHeader* header = NULL;
Actor_SetScale(thisx, 1.0);
- DynaPolyActor_Init(&THIS->dyna, 3);
- CollisionHeader_GetVirtual(&D_06002D30, &header);
- THIS->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &THIS->dyna.actor, header);
+ DynaPolyActor_Init(&this->dyna, 3);
+ CollisionHeader_GetVirtual(&object_fu_kaiten_Colheader_002D30, &header);
+ this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, header);
- THIS->bouceHeight = 0.0;
- THIS->rotationSpeed = 0;
- THIS->bounceSpeed = 0;
- THIS->bounce = 0;
+ this->bounceHeight = 0.0;
+ this->rotationSpeed = 0;
+ this->bounceSpeed = 0;
+ this->bounce = 0;
}
void BgFuKaiten_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, THIS->dyna.bgId);
+ BgFuKaiten* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void BgFuKaiten_UpdateRotation(BgFuKaiten* this) {
f32 f0;
+
this->dyna.actor.shape.rot.y += this->rotationSpeed;
if (this->rotationSpeed > 0) {
- f0 = this->rotationSpeed * .002f;
- func_8019FAD8(&this->dyna.actor.projectedPos, 8310, f0);
+ f0 = this->rotationSpeed * 0.002f;
+ func_8019FAD8(&this->dyna.actor.projectedPos, NA_SE_EV_WOOD_GEAR - SFX_FLAG, f0);
}
}
void BgFuKaiten_UpdateHeight(BgFuKaiten* this) {
this->bounce += this->bounceSpeed;
- this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->elevation + this->bouceHeight;
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->elevation + this->bounceHeight;
- this->dyna.actor.world.pos.y -= this->bouceHeight * Math_CosS(this->bounce);
+ this->dyna.actor.world.pos.y -= this->bounceHeight * Math_CosS(this->bounce);
}
void BgFuKaiten_Update(Actor* thisx, GlobalContext* globalCtx) {
- BgFuKaiten_UpdateRotation(THIS);
- BgFuKaiten_UpdateHeight(THIS);
+ BgFuKaiten* this = THIS;
+
+ BgFuKaiten_UpdateRotation(this);
+ BgFuKaiten_UpdateHeight(this);
}
void BgFuKaiten_Draw(Actor* thisx, GlobalContext* globalCtx) {
- GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
- UNK_TYPE pad;
+ OPEN_DISPS(globalCtx->state.gfxCtx);
- func_8012C28C(gfxCtx);
+ func_8012C28C(globalCtx->state.gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(gfxCtx->polyOpa.p++, D_060005D0);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_fu_kaiten_DL_0005D0);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h
index a7a589717b..6937fbf534 100644
--- a/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h
+++ b/src/overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h
@@ -9,11 +9,10 @@ typedef struct BgFuKaiten {
/* 0x000 */ DynaPolyActor dyna;
/* 0x15C */ UNK_TYPE1 pad15C[0x4];
/* 0x160 */ f32 elevation;
- /* 0x164 */ f32 bouceHeight;
+ /* 0x164 */ f32 bounceHeight;
/* 0x168 */ s16 rotationSpeed;
/* 0x16A */ s16 bounceSpeed;
/* 0x16C */ s16 bounce;
- /* 0x16E */ UNK_TYPE1 pad16E[0x2];
} BgFuKaiten; // size = 0x170
extern const ActorInit Bg_Fu_Kaiten_InitVars;
diff --git a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c
index 15ac358ca6..a8d54222d8 100644
--- a/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c
+++ b/src/overlays/actors/ovl_Bg_Fu_Mizu/z_bg_fu_mizu.c
@@ -6,7 +6,7 @@
#include "z_bg_fu_mizu.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgFuMizu*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c
index e75367f602..d064a3cb42 100644
--- a/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c
+++ b/src/overlays/actors/ovl_Bg_Goron_Oyu/z_bg_goron_oyu.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_goron_oyu.h"
+#include "objects/object_oyu/object_oyu.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgGoronOyu*)thisx)
@@ -34,11 +35,6 @@ const ActorInit Bg_Goron_Oyu_InitVars = {
(ActorFunc)BgGoronOyu_Draw,
};
-extern Gfx D_06000080;
-extern Gfx D_06000158;
-extern AnimatedMaterial D_06000968;
-extern CollisionHeader D_06000988;
-
void func_80B40080(BgGoronOyu* this) {
this->unk_17E = 1;
this->actionFunc = func_80B400C8;
@@ -95,7 +91,7 @@ void func_80B401F8(BgGoronOyu* this, GlobalContext* globalCtx) {
if (dist.x >= 0.0f && dist.x <= this->waterBoxXLength && dist.z >= 0.0f && dist.z <= this->waterBoxZLength &&
fabsf(dist.y) < 100.0f && player->actor.depthInWater > 12.0f) {
- Actor_PickUp(&this->dyna.actor, globalCtx, 0xBA, this->dyna.actor.xzDistToPlayer,
+ Actor_PickUp(&this->dyna.actor, globalCtx, GI_MAX, this->dyna.actor.xzDistToPlayer,
fabsf(this->dyna.actor.playerHeightRel));
}
}
@@ -157,7 +153,7 @@ void BgGoronOyu_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
- CollisionHeader_GetVirtual(&D_06000988, &colHeader);
+ CollisionHeader_GetVirtual(&object_oyu_Colheader_000988, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
@@ -188,9 +184,9 @@ void BgGoronOyu_Update(Actor* thisx, GlobalContext* globalCtx) {
void BgGoronOyu_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06000968));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_oyu_Matanimheader_000968));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, &D_06000158);
- gSPDisplayList(POLY_XLU_DISP++, &D_06000080);
+ gSPDisplayList(POLY_XLU_DISP++, &object_oyu_DL_000158);
+ gSPDisplayList(POLY_XLU_DISP++, &object_oyu_DL_000080);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c
index 87686f4c8e..576388d5c8 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Curtain/z_bg_haka_curtain.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_haka_curtain.h"
+#include "objects/object_haka_obj/object_haka_obj.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgHakaCurtain*)thisx)
@@ -44,15 +45,12 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_06001588;
-extern Gfx D_06001410[];
-
void BgHakaCurtain_Init(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001588);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_haka_obj_Colheader_001588);
if (Flags_GetClear(globalCtx, this->dyna.actor.room)) {
func_80B6DE80(this);
return;
@@ -127,9 +125,9 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) {
BgHakaCurtain* this = THIS;
CsCmdActorAction* actorAction;
- if (func_800EE29C(globalCtx, 0x1D5)) {
- actorAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1D5)];
- if (actorAction->startFrame == globalCtx->csCtx.frames && actorAction->unk0 == 2) {
+ if (Cutscene_CheckActorAction(globalCtx, 469)) {
+ actorAction = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 469)];
+ if (actorAction->startFrame == globalCtx->csCtx.frames && actorAction->action == 2) {
func_80B6DD80(this);
}
}
@@ -137,5 +135,5 @@ void BgHakaCurtain_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgHakaCurtain_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06001410);
+ Gfx_DrawDListOpa(globalCtx, object_haka_obj_DL_001410);
}
diff --git a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c
index a36055a3dc..7cb4aab5e2 100644
--- a/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c
+++ b/src/overlays/actors/ovl_Bg_Haka_Tomb/z_bg_haka_tomb.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_haka_tomb.h"
+#include "objects/object_haka_obj/object_haka_obj.h"
#define FLAGS 0x00000000
@@ -22,9 +23,6 @@ void func_80BD6768(BgHakaTomb* this, GlobalContext* globalCtx);
void BgHakaTomb_SetupDoNothing(BgHakaTomb* this);
void BgHakaTomb_DoNothing(BgHakaTomb* this, GlobalContext* globalCtx);
-extern CollisionHeader D_06000EE8[];
-extern Gfx D_060007B0[];
-
const ActorInit Bg_Haka_Tomb_InitVars = {
ACTOR_BG_HAKA_TOMB,
ACTORCAT_BG,
@@ -48,8 +46,8 @@ void BgHakaTomb_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_06000EE8);
- func_8013E3B8(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_haka_obj_Colheader_000EE8);
+ SubS_FillCutscenesList(&this->dyna.actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
func_80BD6624(this);
}
@@ -85,15 +83,15 @@ void func_80BD66AC(BgHakaTomb* this, GlobalContext* globalCtx) {
s16 temp;
if (Flags_GetClear(globalCtx, this->dyna.actor.room)) {
- this->dyna.actor.flags |= 9;
+ this->dyna.actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
if (!func_80BD6638(&temp, this->cutscenes, 1) && (temp < 0) && Flags_GetClear(globalCtx, this->dyna.actor.room)) {
- this->dyna.actor.flags |= 1;
+ this->dyna.actor.flags |= ACTOR_FLAG_1;
if (this->dyna.actor.isTargeted) {
func_80BD6754(this);
}
} else {
- this->dyna.actor.flags &= ~1;
+ this->dyna.actor.flags &= ~ACTOR_FLAG_1;
}
}
@@ -102,7 +100,7 @@ void func_80BD6754(BgHakaTomb* this) {
}
void func_80BD6768(BgHakaTomb* this, GlobalContext* globalCtx) {
- if (func_8013E2D4(&this->dyna.actor, this->cutscenes[0], -1, 0)) {
+ if (SubS_StartActorCutscene(&this->dyna.actor, this->cutscenes[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
BgHakaTomb_SetupDoNothing(this);
}
}
@@ -128,5 +126,5 @@ void BgHakaTomb_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgHakaTomb_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_060007B0);
+ Gfx_DrawDListOpa(globalCtx, object_haka_obj_DL_0007B0);
}
diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c
index 52e1e56145..b61f66bb62 100644
--- a/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c
+++ b/src/overlays/actors/ovl_Bg_Hakugin_Elvpole/z_bg_hakugin_elvpole.c
@@ -6,7 +6,7 @@
#include "z_bg_hakugin_elvpole.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgHakuginElvpole*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c
index 0a3ef22ebc..6abaaf72c1 100644
--- a/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c
+++ b/src/overlays/actors/ovl_Bg_Hakugin_Post/z_bg_hakugin_post.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_hakugin_post.h"
+#include "objects/object_hakugin_obj/object_hakugin_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgHakuginPost*)thisx)
@@ -32,13 +33,6 @@ void func_80A9D3E4(BgHakuginPost* this);
void func_80A9D434(BgHakuginPost* this, GlobalContext* globalCtx);
void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx);
-extern Gfx D_0600C1A8[];
-extern Gfx D_0600C568[];
-extern Gfx D_0600CA38[];
-extern Gfx D_0600CEC8[];
-extern Gfx D_0600D098[];
-extern CollisionHeader D_0600D3B0;
-
BgHakuginPostColliders D_80A9DDC0;
BgHakuginPostUnkStruct D_80A9E028;
@@ -705,7 +699,7 @@ void BgHakuginPost_Init(Actor* thisx, GlobalContext* globalCtx) {
this->dyna.actor.shape.rot.x = 0;
this->dyna.actor.shape.rot.z = 0;
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600D3B0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hakugin_obj_Colheader_00D3B0);
func_80A9B3BC(this, globalCtx);
func_80A9CA94(this);
} else {
@@ -996,13 +990,14 @@ void BgHakuginPost_Update(Actor* thisx, GlobalContext* globalCtx) {
void func_80A9D61C(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* D_80A9D900[] = {
- D_0600C1A8, D_0600C568, NULL, NULL, D_0600CA38, D_0600CEC8, NULL,
+ object_hakugin_obj_DL_00C1A8, object_hakugin_obj_DL_00C568, NULL, NULL,
+ object_hakugin_obj_DL_00CA38, object_hakugin_obj_DL_00CEC8, NULL,
};
static Gfx* D_80A9D91C[] = {
- D_0600D098,
- D_0600D098,
- D_0600D098,
- D_0600D098,
+ object_hakugin_obj_DL_00D098,
+ object_hakugin_obj_DL_00D098,
+ object_hakugin_obj_DL_00D098,
+ object_hakugin_obj_DL_00D098,
};
BgHakuginPost* this = THIS;
BgHakuginPostUnkStruct1* unkStruct1;
diff --git a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c
index f4ca155bd8..d16c6c0db5 100644
--- a/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c
+++ b/src/overlays/actors/ovl_Bg_Hakugin_Switch/z_bg_hakugin_switch.c
@@ -6,7 +6,7 @@
#include "z_bg_hakugin_switch.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgHakuginSwitch*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
index 8ad7b2905d..e3270fb6e2 100644
--- a/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
+++ b/src/overlays/actors/ovl_Bg_Icefloe/z_bg_icefloe.c
@@ -6,7 +6,7 @@
#include "z_bg_icefloe.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIcefloe*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
index d497492f33..bf0851a5b7 100644
--- a/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
+++ b/src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_icicle.h"
+#include "objects/object_icicle/object_icicle.h"
#define FLAGS 0x00000000
@@ -60,9 +61,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern Gfx D_060000D0[];
-extern CollisionHeader D_06000294;
-
void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
BgIcicle* this = THIS;
@@ -71,7 +69,7 @@ void BgIcicle_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000294);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_icicle_Colheader_000294);
Collider_InitAndSetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
Collider_UpdateCylinder(thisx, &this->collider);
@@ -245,5 +243,5 @@ void BgIcicle_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgIcicle_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_060000D0);
+ Gfx_DrawDListOpa(globalCtx, object_icicle_DL_0000D0);
}
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
index 360e8b897e..9d2fd67d90 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.c
@@ -6,7 +6,7 @@
#include "z_bg_ikana_block.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkanaBlock*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h
index 48e65613f3..112e4ad008 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h
+++ b/src/overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h
@@ -11,7 +11,12 @@ typedef struct BgIkanaBlock {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x1C];
/* 0x0160 */ BgIkanaBlockActionFunc actionFunc;
- /* 0x0164 */ char unk_164[0x1C];
+ /* 0x0164 */ char unk_164[0xC];
+ /* 0x0170 */ f32 unk_170;
+ /* 0x0174 */ char unk_174[0x8];
+ /* 0x017C */ u8 unk_17C;
+ /* 0x017D */ char unk_17D[0x1];
+ /* 0x017E */ u8 unk_17E;
} BgIkanaBlock; // size = 0x180
extern const ActorInit Bg_Ikana_Block_InitVars;
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c
index b1a0a19c1e..f183a71642 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Bombwall/z_bg_ikana_bombwall.c
@@ -6,7 +6,7 @@
#include "z_bg_ikana_bombwall.h"
-#define FLAGS 0x10000000
+#define FLAGS (ACTOR_FLAG_10000000)
#define THIS ((BgIkanaBombwall*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c
index 1b222a2f8d..2fb508c79a 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Dharma/z_bg_ikana_dharma.c
@@ -6,7 +6,7 @@
#include "z_bg_ikana_dharma.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkanaDharma*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c b/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c
index 6b72aba384..de45de35bc 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Mirror/z_bg_ikana_mirror.c
@@ -6,7 +6,7 @@
#include "z_bg_ikana_mirror.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkanaMirror*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c
index e96c20accb..95e33a2eff 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Ray/z_bg_ikana_ray.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_ikana_ray.h"
+#include "objects/object_ikana_obj/object_ikana_obj.h"
#define FLAGS 0x00000000
@@ -59,9 +60,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern Gfx D_06001100[];
-extern AnimatedMaterial D_06001228[];
-
void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
BgIkanaRay* this = THIS;
ColliderCylinder* collision = &this->collision;
@@ -71,7 +69,7 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, collision, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collision);
- this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(D_06001228);
+ this->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_Matanimheader_001228);
if (Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) {
BgIkanaRay_SetActivated(this);
@@ -89,7 +87,7 @@ void BgIkanaRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void BgIkanaRay_SetDeactivated(BgIkanaRay* this) {
this->actor.draw = NULL;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->update = BgIkanaRay_UpdateCheckForActivation;
}
@@ -101,7 +99,7 @@ void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, GlobalContext* global
void BgIkanaRay_SetActivated(BgIkanaRay* this) {
this->actor.draw = BgIkanaRay_Draw;
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->update = BgIkanaRay_UpdateActivated;
}
@@ -119,5 +117,5 @@ void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgIkanaRay* this = THIS;
AnimatedMat_Draw(globalCtx, this->animatedTextures);
- Gfx_DrawDListXlu(globalCtx, D_06001100);
+ Gfx_DrawDListXlu(globalCtx, object_ikana_obj_DL_001100);
}
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c
index f4263f783c..13d8161e2b 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c
@@ -5,8 +5,11 @@
*/
#include "z_bg_ikana_rotaryroom.h"
+#include "overlays/actors/ovl_Bg_Ikana_Block/z_bg_ikana_block.h"
+#include "overlays/actors/ovl_En_Torch2/z_en_torch2.h"
+#include "objects/object_ikana_obj/object_ikana_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgIkanaRotaryroom*)thisx)
@@ -16,8 +19,19 @@ void BgIkanaRotaryroom_Update(Actor* thisx, GlobalContext* globalCtx);
void BgIkanaRotaryroom_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80B814B8(BgIkanaRotaryroom* this, GlobalContext* globalCtx);
+void func_80B818B4(BgIkanaRotaryroom* this);
+void func_80B818C8(Actor* thisx, GlobalContext* globalCtx);
+void func_80B81978(BgIkanaRotaryroom* this);
+void func_80B8198C(Actor* thisx, GlobalContext* globalCtx);
+void func_80B819DC(BgIkanaRotaryroom* this);
+void func_80B819F0(Actor* thisx, GlobalContext* globalCtx);
+void func_80B81A64(BgIkanaRotaryroom* this);
+void func_80B81A80(Actor* thisx, GlobalContext* globalCtx);
+void func_80B81B84(BgIkanaRotaryroom* this);
+void func_80B81BA0(Actor* thisx, GlobalContext* globalCtx);
+void func_80B81DAC(BgIkanaRotaryroom* this);
+void func_80B81DC8(Actor* thisx, GlobalContext* globalCtx);
-#if 0
const ActorInit Bg_Ikana_Rotaryroom_InitVars = {
ACTOR_BG_IKANA_ROTARYROOM,
ACTORCAT_BG,
@@ -30,108 +44,959 @@ const ActorInit Bg_Ikana_Rotaryroom_InitVars = {
(ActorFunc)BgIkanaRotaryroom_Draw,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[2] = {
-static ColliderJntSphElementInit D_80B820E0[2] = {
+static ColliderJntSphElementInit sJntSphElementsInit1[2] = {
{
- { ELEMTYPE_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x00002000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK4,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00002000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 0, { { -3450, 450, 0 }, 60 }, 100 },
},
{
- { ELEMTYPE_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x00002000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK4,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00002000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 0, { { 3450, 450, 0 }, 60 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80B82128 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, },
- 2, D_80B820E0, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit1 = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_JNTSPH,
+ },
+ 2,
+ sJntSphElementsInit1,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_80B82138[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit2[1] = {
{
- { ELEMTYPE_UNK4, { 0x00000000, 0x00, 0x00 }, { 0x00002000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK4,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00002000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 0, { { -3750, 1200, 0 }, 60 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80B8215C = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, },
- 1, D_80B82138, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit2 = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit2,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80B82214[] = {
+Vec3f D_80B8216C = { 225.0f, -280.0f, -210.0f };
+
+Vec3f D_80B82178 = { -255.0f, -280.0f, 210.0f };
+
+typedef struct {
+ /* 0x00 */ s8 unk_00;
+ /* 0x01 */ s8 unk_01;
+ /* 0x04 */ Vec3f unk_04;
+} BgIkanaRotaryroomStruct4; // size = 0x10
+
+BgIkanaRotaryroomStruct4 D_80B82184[2][2] = {
+ { { 0, 0, { -375.0f, -170.0f, 0.0f } }, { 0, 0, { 375.0f, -170.0f, 0.0f } } },
+ { { 0, 0, { -435.0f, -180.0f, 0.0f } }, { 0, 1, { 435.0f, -180.0f, 0.0f } } },
+};
+
+Vec3s D_80B821C4[] = {
+ { -150, 194, -120 }, { -120, 194, -30 }, { -150, 194, 120 }, { 120, 194, 120 }, { 180, 194, 30 },
+ { 150, 194, -90 }, { 60, 194, -120 }, { -60, 194, 90 }, { 30, 194, 120 }, { 49, 194, -105 },
+};
+
+f32 D_80B82200[] = { 64.0f, 66.0f, 66.0f, 30.0f, 41.0f };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-#endif
+CollisionHeader* D_80B82218[] = { &object_ikana_obj_Colheader_006368, &object_ikana_obj_Colheader_0084F8 };
-extern ColliderJntSphElementInit D_80B820E0[2];
-extern ColliderJntSphInit D_80B82128;
-extern ColliderJntSphElementInit D_80B82138[1];
-extern ColliderJntSphInit D_80B8215C;
-extern InitChainEntry D_80B82214[];
+void func_80B802E0(BgIkanaRotaryroom* this) {
+ s32 pad;
-extern UNK_TYPE D_060048A0;
-extern UNK_TYPE D_06007B68;
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+ Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, MTXMODE_APPLY);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B802E0.s")
+ Collider_UpdateSpheres(0, &this->collider);
+ if (!BGIKANAROTARYROOM_GET_1(&this->dyna.actor)) {
+ Collider_UpdateSpheres(1, &this->collider);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80358.s")
+void func_80B80358(Vec3f* arg0) {
+ arg0->x += (arg0->x >= 0.0f) ? 0.5f : -0.5f;
+ arg0->y += (arg0->y >= 0.0f) ? 0.5f : -0.5f;
+ arg0->z += (arg0->z >= 0.0f) ? 0.5f : -0.5f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80440.s")
+ arg0->x = (s32)arg0->x;
+ arg0->y = (s32)arg0->y;
+ arg0->z = (s32)arg0->z;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80550.s")
+void func_80B80440(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp50;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80778.s")
+ Matrix_StatePush();
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+ if (Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_7F00(&this->dyna.actor))) {
+ Matrix_InsertTranslation(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
+ } else {
+ Matrix_InsertTranslation(D_80B8216C.x, D_80B8216C.y, D_80B8216C.z, MTXMODE_APPLY);
+ }
+ Matrix_GetStateTranslation(&sp50);
+ func_80B80358(&sp50);
+ this->unk_204.unk_00 = Actor_SpawnAsChildAndCutscene(
+ &globalCtx->actorCtx, globalCtx, ACTOR_BG_IKANA_BLOCK, sp50.x, sp50.y, sp50.z, this->dyna.actor.shape.rot.x,
+ this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z, -1,
+ ActorCutscene_GetAdditionalCutscene(this->dyna.actor.cutscene), this->dyna.actor.unk20, NULL);
+ Matrix_StatePop();
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80894.s")
+void func_80B80550(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 spC8 = BGIKANAROTARYROOM_GET_1(&this->dyna.actor);
+ s32 spC4;
+ s32 pad2;
+ Vec3f spB4;
+ Actor* actor;
+ s32 i;
+ BgIkanaRotaryroomStruct4* ptr;
+ MtxF sp68;
+ Vec3s sp60;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80C88.s")
+ if (Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
+ spC4 = 1;
+ } else {
+ spC4 = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B80F08.s")
+ actor = globalCtx->actorCtx.actorLists[ACTORCAT_DOOR].first;
+ Matrix_StatePush();
+ sp60.x = BINANG_ROT180(this->dyna.actor.home.rot.x);
+ sp60.y = this->dyna.actor.home.rot.y;
+ sp60.z = this->dyna.actor.home.rot.z;
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &sp60);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81010.s")
+ while (actor != NULL) {
+ if (actor->id == ACTOR_DOOR_SHUTTER) {
+ Math_Vec3f_Diff(&actor->world.pos, &this->dyna.actor.world.pos, &spB4);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81234.s")
+ for (i = 0; i < ARRAY_COUNT(D_80B82184); i++) {
+ ptr = &D_80B82184[spC8][i];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B814B8.s")
+ if ((Math3D_Vec3fDistSq(&spB4, &D_80B82184[spC8][i].unk_04) < SQ(250.0f)) &&
+ ((ptr->unk_00 ^ spC4) && (ptr->unk_01 == 0U))) {
+ Matrix_StatePush();
+ Matrix_InsertTranslation(spB4.x, spB4.y, spB4.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y - this->dyna.actor.home.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x - this->dyna.actor.home.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z - this->dyna.actor.home.rot.z, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&actor->world.pos);
+ func_80B80358(&actor->world.pos);
+ Matrix_CopyCurrentState(&sp68);
+ func_8018219C(&sp68, &actor->shape.rot, 0);
+ Matrix_StatePop();
+ }
+ }
+ }
+ actor = actor->next;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81570.s")
+ Matrix_StatePop();
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B816A4.s")
+BgIkanaRotaryroomStruct4* func_80B80778(BgIkanaRotaryroom* this, GlobalContext* globalCtx, Actor* arg2) {
+ s32 i;
+ Vec3f sp68;
+ s32 pad[2];
+ s32 temp_s3 = BGIKANAROTARYROOM_GET_1(&this->dyna.actor);
+ BgIkanaRotaryroomStruct4* sp58 = NULL;
+ BgIkanaRotaryroomStruct4* ptr;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/BgIkanaRotaryroom_Init.s")
+ if (1) {}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/BgIkanaRotaryroom_Destroy.s")
+ if (arg2->id == ACTOR_DOOR_SHUTTER) {
+ Matrix_StatePush();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B818B4.s")
+ for (i = 0; i < ARRAY_COUNT(D_80B82184); i++) {
+ ptr = &D_80B82184[temp_s3][i];
+ if ((ptr->unk_01 == 0) &&
+ (Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot),
+ Matrix_MultiplyVector3fByState(&ptr->unk_04, &sp68),
+ (Math3D_Vec3fDistSq(&arg2->world.pos, &sp68) < SQ(250.0f)))) {
+ sp58 = ptr;
+ break;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B818C8.s")
+ Matrix_StatePop();
+ }
+ return sp58;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81978.s")
+void func_80B80894(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad[7];
+ Actor* actor = this->unk_204.unk_00;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B8198C.s")
+ Matrix_StatePush();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B819DC.s")
+ Matrix_InsertZRotation_s(-this->dyna.actor.shape.rot.z, MTXMODE_NEW);
+ Matrix_InsertXRotation_s(-this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_RotateY(-this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertTranslation(-this->dyna.actor.world.pos.x, -this->dyna.actor.world.pos.y,
+ -this->dyna.actor.world.pos.z, MTXMODE_APPLY);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B819F0.s")
+ if (actor != NULL) {
+ Matrix_StatePush();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81A64.s")
+ Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&this->unk_204.unk_04);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81A80.s")
+ Matrix_StatePop();
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81B84.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_248); i++) {
+ this->unk_248[i].unk_00 = NULL;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81BA0.s")
+ actor = globalCtx->actorCtx.actorLists[ACTORCAT_DOOR].first;
+ i = 0;
+ while (actor != NULL) {
+ if (func_80B80778(this, globalCtx, actor) && (i < 2)) {
+ this->unk_248[i].unk_00 = actor;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81DAC.s")
+ Matrix_StatePush();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/func_80B81DC8.s")
+ Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&this->unk_248[i].unk_04);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/BgIkanaRotaryroom_Update.s")
+ Matrix_StatePop();
+ i++;
+ }
+ actor = actor->next;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Ikana_Rotaryroom/BgIkanaRotaryroom_Draw.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
+ this->unk_2D0[i].unk_00 = NULL;
+ }
+
+ actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first;
+ i = 0;
+ while (actor != NULL) {
+ if ((actor->id == ACTOR_EN_TORCH2) && (actor->update != NULL) && (i < ARRAY_COUNT(this->unk_2D0))) {
+ this->unk_2D0[i].unk_00 = actor;
+
+ Matrix_StatePush();
+
+ Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&this->unk_2D0[i].unk_04);
+
+ Matrix_StatePop();
+ i++;
+ }
+ actor = actor->next;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ this->unk_3E0[i].unk_00 = NULL;
+ }
+
+ actor = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first;
+ i = 0;
+ while (actor != NULL) {
+ if ((actor->update != NULL) && (actor->id != ACTOR_EN_WATER_EFFECT) && (i < ARRAY_COUNT(this->unk_3E0))) {
+ this->unk_3E0[i].unk_00 = actor;
+ this->unk_3E0[i].unk_44 = actor->shape.rot;
+ this->unk_3E0[i].unk_4C = 0.0f;
+
+ Matrix_StatePush();
+
+ Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&this->unk_3E0[i].unk_04);
+
+ Matrix_StatePop();
+ i++;
+ }
+ actor = actor->next;
+ }
+
+ actor = &GET_PLAYER(globalCtx)->actor;
+ if (actor->update != NULL) {
+ this->unk_520.unk_40 = actor->shape.rot;
+
+ Matrix_StatePush();
+
+ Matrix_InsertTranslation(actor->world.pos.x, actor->world.pos.y, actor->world.pos.z, MTXMODE_APPLY);
+ Matrix_RotateY(actor->shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(actor->shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(actor->shape.rot.z, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&this->unk_520.unk_00);
+
+ Matrix_StatePop();
+ }
+
+ Matrix_StatePop();
+}
+
+void func_80B80C88(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad[5];
+ BgIkanaBlock* ikanaBlock = (BgIkanaBlock*)this->unk_204.unk_00;
+ Player* player;
+ Actor* ptr;
+ Actor* ptr2;
+ Actor* ptr3;
+ s32 i;
+ MtxF sp3C;
+
+ Matrix_StatePush();
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+
+ if (ikanaBlock != NULL) {
+ Matrix_StatePush();
+
+ Matrix_InsertMatrix(&this->unk_204.unk_04, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&ikanaBlock->actor.world.pos);
+ func_80B80358(&ikanaBlock->actor.world.pos);
+ Matrix_CopyCurrentState(&sp3C);
+ func_8018219C(&sp3C, &ikanaBlock->actor.shape.rot, 0);
+
+ Matrix_StatePop();
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_248); i++) {
+ ptr = this->unk_248[i].unk_00;
+ if (ptr != NULL) {
+ Matrix_StatePush();
+
+ Matrix_InsertMatrix(&this->unk_248[i].unk_04, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&ptr->world.pos);
+ func_80B80358(&ptr->world.pos);
+ Matrix_CopyCurrentState(&sp3C);
+ func_8018219C(&sp3C, &ptr->shape.rot, 0);
+
+ Matrix_StatePop();
+ }
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
+ ptr2 = this->unk_2D0[i].unk_00;
+ if (ptr2 != NULL) {
+ Matrix_StatePush();
+
+ Matrix_InsertMatrix(&this->unk_2D0[i].unk_04, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&ptr2->world.pos);
+ func_80B80358(&ptr2->world.pos);
+ Matrix_CopyCurrentState(&sp3C);
+ func_8018219C(&sp3C, &ptr2->shape.rot, 0);
+
+ Matrix_StatePop();
+ }
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ ptr3 = this->unk_3E0[i].unk_00;
+ if (ptr3 != NULL) {
+ Matrix_StatePush();
+
+ Matrix_InsertMatrix(&this->unk_3E0[i].unk_04, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&ptr3->world.pos);
+ func_80B80358(&ptr3->world.pos);
+ Matrix_CopyCurrentState(&sp3C);
+ func_8018219C(&sp3C, &ptr3->shape.rot, 0);
+
+ Matrix_StatePop();
+ }
+ }
+
+ player = GET_PLAYER(globalCtx);
+ if (player != NULL) {
+ Matrix_StatePush();
+
+ Matrix_InsertMatrix(&this->unk_520.unk_00, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&player->actor.world.pos);
+ Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
+ func_80B80358(&player->actor.world.pos);
+ Matrix_CopyCurrentState(&sp3C);
+ func_8018219C(&sp3C, &player->actor.shape.rot, 0);
+
+ Matrix_StatePop();
+ player->actor.freezeTimer = 2;
+ }
+
+ Matrix_StatePop();
+}
+
+s32 func_80B80F08(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad;
+ BgIkanaBlock* sp40 = (BgIkanaBlock*)this->unk_204.unk_00;
+ Vec3f sp34;
+ Vec3f sp28;
+ s32 sp24 = false;
+
+ if (sp40 != NULL) {
+ Matrix_StatePush();
+
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+ Matrix_InsertTranslation(D_80B82178.x, D_80B82178.y, D_80B82178.z, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&sp34);
+ Matrix_SetStateRotationAndTranslation(sp40->actor.world.pos.x, sp40->actor.world.pos.y + sp40->unk_170,
+ sp40->actor.world.pos.z, &sp40->actor.shape.rot);
+ Matrix_GetStateTranslation(&sp28);
+
+ Matrix_StatePop();
+
+ if (Math3D_Vec3fDistSq(&sp34, &sp28) < 3.0f) {
+ if (!Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_7F00(&this->dyna.actor))) {
+ sp24 = true;
+ }
+ Flags_SetSwitch(globalCtx, BGIKANAROTARYROOM_GET_7F00(&this->dyna.actor));
+ }
+ }
+ return sp24;
+}
+
+void func_80B81010(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad;
+ f32 temp_f0;
+ s32 temp_s2;
+ s32 phi_s7;
+ s32 i;
+ Actor* ptr;
+ Vec3f sp84;
+ BgIkanaRotaryroomStruct2* ptr2;
+ CollisionPoly* sp7C;
+ s32 sp78;
+
+ if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
+ phi_s7 = true;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ ptr = this->unk_3E0[i].unk_00;
+ ptr2 = &this->unk_3E0[i];
+
+ if (ptr != NULL) {
+ temp_s2 = Math_ScaledStepToS(&ptr->shape.rot.x, ptr2->unk_44.x, 0xBB8) & 1;
+ temp_s2 &= Math_ScaledStepToS(&ptr->shape.rot.y, ptr2->unk_44.y, 0xBB8);
+ temp_s2 &= Math_ScaledStepToS(&ptr->shape.rot.z, ptr2->unk_44.z, 0xBB8);
+
+ ptr2->unk_4C -= 2.0f;
+ if (ptr2->unk_4C < -30.0f) {
+ ptr2->unk_4C = -30.0f;
+ }
+
+ Math_Vec3f_Copy(&ptr->prevPos, &ptr->world.pos);
+
+ ptr->world.pos.y += ptr2->unk_4C;
+
+ sp84.x = ptr->prevPos.x;
+ sp84.y = ptr->prevPos.y + 50.0f;
+ sp84.z = ptr->prevPos.z;
+
+ temp_f0 = BgCheck_EntityRaycastFloor5_2(globalCtx, &globalCtx->colCtx, &sp7C, &sp78, NULL, &sp84);
+ if (ptr->world.pos.y <= temp_f0) {
+ ptr->world.pos.y = temp_f0;
+ } else {
+ temp_s2 = false;
+ }
+
+ if (temp_s2) {
+ ptr2->unk_00 = NULL;
+ } else {
+ phi_s7 = false;
+ }
+ }
+ }
+
+ if (phi_s7) {
+ this->unk_578 = NULL;
+ }
+ } else {
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ ptr = this->unk_3E0[i].unk_00;
+ if (ptr != NULL) {
+ ptr->shape.rot = this->unk_3E0[i].unk_44;
+ Math_Vec3f_Copy(&ptr->prevPos, &ptr->world.pos);
+ }
+ }
+ this->unk_578 = NULL;
+ }
+}
+
+void func_80B81234(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 pad[2];
+ Player* player = GET_PLAYER(globalCtx);
+ BgIkanaRotaryroomStruct3* ptr;
+ s32 sp64;
+ Vec3f sp58;
+ Vec3f sp4C;
+ f32 temp_f0;
+ f32 sp44 = D_80B82200[player->transformation] * 0.5f;
+ CollisionPoly* sp40;
+ s32 sp3C;
+
+ if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
+ if (player == NULL) {
+ return;
+ }
+
+ ptr = &this->unk_520;
+
+ if (player->actor.freezeTimer > 0) {
+ sp58.x = ptr->unk_4C.x;
+ sp58.y = ptr->unk_4C.y + 50.0f;
+ sp58.z = ptr->unk_4C.z;
+
+ sp64 = Math_ScaledStepToS(&player->actor.shape.rot.x, ptr->unk_40.x, 2000) & 1;
+ sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.y, ptr->unk_40.y, 2000);
+ sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.z, ptr->unk_40.z, 2000);
+
+ ptr->unk_48 = ptr->unk_48 - 2.1f;
+ ptr->unk_48 = ptr->unk_48 * 0.98f;
+ if (ptr->unk_48 < -30.0f) {
+ ptr->unk_48 = -30.0f;
+ }
+ ptr->unk_4C.y += ptr->unk_48;
+
+ Matrix_StatePush();
+
+ Matrix_RotateY(player->actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_InsertXRotation_s(player->actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(player->actor.shape.rot.z, MTXMODE_APPLY);
+ Matrix_GetStateTranslationAndScaledY(sp44, &sp4C);
+
+ Matrix_StatePop();
+
+ temp_f0 = BgCheck_EntityRaycastFloor5_2(globalCtx, &globalCtx->colCtx, &sp40, &sp3C, NULL, &sp58);
+ if (ptr->unk_4C.y <= temp_f0) {
+ ptr->unk_4C.y = temp_f0;
+ } else {
+ sp64 = 0;
+ }
+
+ Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
+
+ player->actor.world.pos.x = ptr->unk_4C.x - sp4C.x;
+ player->actor.world.pos.y = (ptr->unk_4C.y - sp4C.y) + sp44;
+ player->actor.world.pos.z = ptr->unk_4C.z - sp4C.z;
+
+ if (sp64 != 0) {
+ Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
+ this->unk_57C = NULL;
+ } else {
+ player->actor.freezeTimer = 2;
+ }
+ }
+ } else {
+ if (player != NULL) {
+ player->actor.shape.rot = this->unk_520.unk_40;
+ Math_Vec3f_Copy(&player->actor.home.pos, &player->actor.world.pos);
+ }
+ this->unk_57C = NULL;
+ }
+}
+
+void func_80B814B8(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
+ if (player->actor.bgCheckFlags & 0x100) {
+ func_800B8E58(player, NA_SE_VO_LI_DAMAGE_S + player->ageProperties->unk_92);
+ func_80169EFC(globalCtx);
+ func_800B8E58(player, NA_SE_VO_LI_TAKEN_AWAY + player->ageProperties->unk_92);
+ globalCtx->unk_18845 = 1;
+ play_sound(NA_SE_OC_ABYSS);
+ this->actionFunc = NULL;
+ }
+ } else {
+ this->actionFunc = NULL;
+ }
+}
+
+void func_80B81570(BgIkanaRotaryroom* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f sp70;
+ Vec3f sp64;
+ s32 pad;
+ s32 pad2;
+
+ Matrix_StatePush();
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
+
+ for (i = 0; i < ARRAY_COUNT(D_80B821C4); i++) {
+ sp64.x = D_80B821C4[i].x;
+ sp64.y = D_80B821C4[i].y;
+ sp64.z = D_80B821C4[i].z;
+
+ Matrix_MultiplyVector3fByState(&sp64, &sp70);
+
+ sp70.x += this->dyna.actor.world.pos.x;
+ sp70.y += this->dyna.actor.world.pos.y;
+ sp70.z += this->dyna.actor.world.pos.z;
+
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_WATER_EFFECT, sp70.x, sp70.y, sp70.z, 0, 0, 0, 1);
+ }
+
+ Matrix_StatePop();
+}
+
+s32 func_80B816A4(BgIkanaRotaryroom* this) {
+ s32 i;
+ s32 count = 0;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ if (this->unk_3E0[i].unk_00 != NULL) {
+ count++;
+ }
+ }
+
+ return count;
+}
+
+void BgIkanaRotaryroom_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ BgIkanaRotaryroom* this = THIS;
+ s32 sp34 = BGIKANAROTARYROOM_GET_1(&this->dyna.actor);
+
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+
+ if (Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
+ this->dyna.actor.shape.rot.x = -0x8000;
+ } else {
+ this->dyna.actor.shape.rot.x = 0;
+ }
+
+ DynaPolyActor_Init(&this->dyna, 1);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, D_80B82218[sp34]);
+
+ Collider_InitJntSph(globalCtx, &this->collider);
+ if (!sp34) {
+ Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit1, this->colliderElements);
+ } else {
+ Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit2, this->colliderElements);
+ }
+
+ func_80B802E0(this);
+
+ if (sp34 == true) {
+ this->unk_1FC = Lib_SegmentedToVirtual(&object_ikana_obj_Matanimheader_007B68);
+ }
+
+ if (!sp34) {
+ func_80B80440(this, globalCtx);
+ } else {
+ func_80B81570(this, globalCtx);
+ }
+
+ func_80B80550(this, globalCtx);
+ func_80B818B4(this);
+}
+
+void BgIkanaRotaryroom_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ Collider_DestroyJntSph(globalCtx, &this->collider);
+}
+
+void func_80B818B4(BgIkanaRotaryroom* this) {
+ this->unk_200 = func_80B818C8;
+}
+
+void func_80B818C8(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+ s32 sp20;
+
+ if (this->collider.base.acFlags & AC_HIT) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ sp20 = BGIKANAROTARYROOM_GET_FE(&this->dyna.actor);
+ if (Flags_GetSwitch(globalCtx, sp20)) {
+ Flags_UnsetSwitch(globalCtx, sp20);
+ } else {
+ Flags_SetSwitch(globalCtx, sp20);
+ }
+ func_80B81978(this);
+ } else {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+}
+
+void func_80B81978(BgIkanaRotaryroom* this) {
+ this->unk_200 = func_80B8198C;
+}
+
+void func_80B8198C(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+
+ if (this->unk_204.unk_00 == NULL) {
+ func_80B819DC(this);
+ } else if (((BgIkanaBlock*)this->unk_204.unk_00)->unk_17C & 1) {
+ ((BgIkanaBlock*)this->unk_204.unk_00)->unk_17C |= 8;
+ func_80B819DC(this);
+ }
+}
+
+void func_80B819DC(BgIkanaRotaryroom* this) {
+ this->unk_200 = func_80B819F0;
+}
+
+void func_80B819F0(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+
+ if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
+ if (this->dyna.actor.cutscene >= 0) {
+ func_800B7298(globalCtx, &this->dyna.actor, 7);
+ }
+ func_80B81A64(this);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ }
+}
+
+void func_80B81A64(BgIkanaRotaryroom* this) {
+ this->unk_584 = 25;
+ this->unk_200 = func_80B81A80;
+}
+
+void func_80B81A80(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+ s32 pad;
+ s32 i;
+ BgIkanaRotaryroomStruct1* ptr;
+
+ func_800B9010(thisx, NA_SE_EV_EARTHQUAKE - SFX_FLAG);
+ this->unk_584--;
+
+ if (this->unk_584 <= 0) {
+ if (1) {}
+ if (1) {}
+ if (1) {}
+ if (1) {}
+ func_80B80894(this, globalCtx);
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
+ ptr = &this->unk_2D0[i];
+ if (ptr->unk_00 != NULL) {
+ ((EnTorch2*)ptr->unk_00)->state = 3;
+ }
+ }
+
+ func_80B81B84(this);
+ } else if (this->unk_584 == 15) {
+ s16 sp26 = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
+
+ Quake_SetSpeed(sp26, 0x7B30);
+ Quake_SetQuakeValues(sp26, 6, 0, 100, 0);
+ Quake_SetCountdown(sp26, 22);
+ }
+}
+
+void func_80B81B84(BgIkanaRotaryroom* this) {
+ this->unk_584 = 0x2001;
+ this->unk_200 = func_80B81BA0;
+}
+
+void func_80B81BA0(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+ s32 sp30 = 0;
+ s32 i;
+
+ func_800B9010(&this->dyna.actor, NA_SE_EV_EARTHQUAKE - SFX_FLAG);
+
+ if (this->unk_584 > 0) {
+ this->unk_584--;
+ }
+
+ thisx->shape.rot.x += 0x1F4;
+
+ if (!(this->unk_584 & 7)) {
+ s16 quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
+
+ Quake_SetSpeed(quake, 0x7B30);
+ Quake_SetQuakeValues(quake, (s32)(Rand_ZeroOne() * 2.5f) + 3, 0, 10, 0);
+ Quake_SetCountdown(quake, 15);
+ }
+
+ if (Flags_GetSwitch(globalCtx, BGIKANAROTARYROOM_GET_FE(&this->dyna.actor))) {
+ if (this->dyna.actor.shape.rot.x < 0) {
+ this->dyna.actor.shape.rot.x = -0x8000;
+ sp30 = 1;
+ }
+ } else if (this->dyna.actor.shape.rot.x >= 0) {
+ this->dyna.actor.shape.rot.x = 0;
+ sp30 = 1;
+ }
+
+ func_80B80C88(this, globalCtx);
+
+ if (sp30 != 0) {
+ Player* player = GET_PLAYER(globalCtx);
+ BgIkanaRotaryroomStruct1* ptr;
+ BgIkanaBlock* block = (BgIkanaBlock*)this->unk_204.unk_00;
+
+ if (block != NULL) {
+ block->unk_17C &= ~8;
+ block->unk_17C |= 4;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
+ ptr = &this->unk_2D0[i];
+ if (ptr->unk_00 != NULL) {
+ ((EnTorch2*)ptr->unk_00)->state = 4;
+ }
+ }
+
+ this->unk_520.unk_48 = 0.0f;
+ this->unk_520.unk_4C.x = player->actor.world.pos.x;
+ this->unk_520.unk_4C.y = player->actor.world.pos.y - D_80B82200[player->transformation];
+ this->unk_520.unk_4C.z = player->actor.world.pos.z;
+
+ if (func_80B816A4(this) > 0) {
+ this->unk_578 = func_80B81010;
+ }
+
+ this->unk_57C = func_80B81234;
+ this->actionFunc = func_80B814B8;
+ func_80B802E0(this);
+ func_80B81DAC(this);
+ }
+}
+
+void func_80B81DAC(BgIkanaRotaryroom* this) {
+ this->unk_584 = 20;
+ this->unk_200 = func_80B81DC8;
+}
+
+void func_80B81DC8(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ BgIkanaRotaryroom* this = THIS;
+
+ if (this->unk_584 > 10) {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_EARTHQUAKE - SFX_FLAG);
+ }
+ this->unk_584--;
+
+ if (this->unk_584 <= 0) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ func_80B818B4(this);
+ } else if (this->unk_584 == 19) {
+ s16 quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 3);
+
+ Quake_SetSpeed(quake, 0x4E20);
+ Quake_SetQuakeValues(quake, 5, 0, 40, 60);
+ Quake_SetCountdown(quake, 17);
+ }
+}
+
+void BgIkanaRotaryroom_Update(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+ BgIkanaRotaryroomStruct1* ptr;
+ BgIkanaRotaryroomStruct1* ptr2;
+ BgIkanaRotaryroomStruct2* ptr3;
+ s32 i;
+
+ if ((this->unk_204.unk_00 != NULL) && (this->unk_204.unk_00->update == NULL)) {
+ this->unk_204.unk_00 = NULL;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_248); i++) {
+ ptr = &this->unk_248[i];
+ if ((ptr->unk_00 != NULL) && (ptr->unk_00->update == NULL)) {
+ ptr->unk_00 = NULL;
+ }
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++) {
+ ptr2 = &this->unk_2D0[i];
+ if ((ptr2->unk_00 != NULL) && (ptr2->unk_00->update == NULL)) {
+ ptr2->unk_00 = NULL;
+ }
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_3E0); i++) {
+ ptr3 = &this->unk_3E0[i];
+ if ((ptr3->unk_00 != NULL) && (ptr3->unk_00->update == NULL)) {
+ ptr3->unk_00 = NULL;
+ }
+ }
+
+ if (func_80B80F08(this, globalCtx)) {
+ if (this->unk_204.unk_00 != NULL) {
+ ((BgIkanaBlock*)this->unk_204.unk_00)->unk_17E = 1;
+ }
+ }
+
+ this->unk_200(&this->dyna.actor, globalCtx);
+
+ if (this->unk_578 != NULL) {
+ this->unk_578(this, globalCtx);
+ }
+
+ if (this->unk_57C != NULL) {
+ this->unk_57C(this, globalCtx);
+ }
+
+ if (this->actionFunc != NULL) {
+ this->actionFunc(this, globalCtx);
+ }
+}
+
+void BgIkanaRotaryroom_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ BgIkanaRotaryroom* this = THIS;
+ s32 param = BGIKANAROTARYROOM_GET_1(&this->dyna.actor);
+
+ if (!param) {
+ Gfx_DrawDListOpa(globalCtx, object_ikana_obj_DL_0048A0);
+ Gfx_DrawDListXlu(globalCtx, object_ikana_obj_DL_004710);
+ } else {
+ AnimatedMat_Draw(globalCtx, this->unk_1FC);
+ Gfx_DrawDListOpa(globalCtx, object_ikana_obj_DL_007448);
+ Gfx_DrawDListXlu(globalCtx, object_ikana_obj_DL_007360);
+ }
+}
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h
index d446d5e923..1e27fb485c 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h
+++ b/src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.h
@@ -6,12 +6,47 @@
struct BgIkanaRotaryroom;
typedef void (*BgIkanaRotaryroomActionFunc)(struct BgIkanaRotaryroom*, GlobalContext*);
+typedef void (*BgIkanaRotaryroomUnkFunc)(Actor*, GlobalContext*);
+typedef void (*BgIkanaRotaryroomUnkFunc2)(struct BgIkanaRotaryroom*, GlobalContext*);
+
+#define BGIKANAROTARYROOM_GET_1(thisx) ((thisx)->params & 1)
+#define BGIKANAROTARYROOM_GET_FE(thisx) (((thisx)->params >> 1) & 0x7F)
+#define BGIKANAROTARYROOM_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F)
+
+typedef struct {
+ /* 0x00 */ Actor* unk_00;
+ /* 0x04 */ MtxF unk_04;
+} BgIkanaRotaryroomStruct1; // size = 0x44
+
+typedef struct {
+ /* 0x00 */ Actor* unk_00;
+ /* 0x04 */ MtxF unk_04;
+ /* 0x44 */ Vec3s unk_44;
+ /* 0x4C */ f32 unk_4C;
+} BgIkanaRotaryroomStruct2; // size = 0x50
+
+typedef struct {
+ /* 0x00 */ MtxF unk_00;
+ /* 0x40 */ Vec3s unk_40;
+ /* 0x48 */ f32 unk_48;
+ /* 0x4C */ Vec3f unk_4C;
+} BgIkanaRotaryroomStruct3; // size = 0x58
typedef struct BgIkanaRotaryroom {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x43C];
+ /* 0x0000 */ DynaPolyActor dyna;
+ /* 0x015C */ ColliderJntSph collider;
+ /* 0x017C */ ColliderJntSphElement colliderElements[2];
+ /* 0x01FC */ AnimatedMaterial* unk_1FC;
+ /* 0x0200 */ BgIkanaRotaryroomUnkFunc unk_200;
+ /* 0x0204 */ BgIkanaRotaryroomStruct1 unk_204;
+ /* 0x0248 */ BgIkanaRotaryroomStruct1 unk_248[2];
+ /* 0x02D0 */ BgIkanaRotaryroomStruct1 unk_2D0[4];
+ /* 0x03E0 */ BgIkanaRotaryroomStruct2 unk_3E0[4];
+ /* 0x0520 */ BgIkanaRotaryroomStruct3 unk_520;
+ /* 0x0578 */ BgIkanaRotaryroomUnkFunc2 unk_578;
+ /* 0x057C */ BgIkanaRotaryroomUnkFunc2 unk_57C;
/* 0x0580 */ BgIkanaRotaryroomActionFunc actionFunc;
- /* 0x0584 */ char unk_584[0x4];
+ /* 0x0584 */ s16 unk_584;
} BgIkanaRotaryroom; // size = 0x588
extern const ActorInit Bg_Ikana_Rotaryroom_InitVars;
diff --git a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c
index 70b58b4828..16060bbd21 100644
--- a/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Ikana_Shutter/z_bg_ikana_shutter.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_ikana_shutter.h"
+#include "objects/object_ikana_obj/object_ikana_obj.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkanaShutter*)thisx)
@@ -53,9 +54,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_06000F28;
-extern Gfx D_06000CE8[];
-
s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globalCtx) {
return Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x7F) &&
Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x7F) + 1) &&
@@ -68,7 +66,7 @@ void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000F28);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ikana_obj_Colheader_000F28);
if (!((this->dyna.actor.params >> 8) & 1)) {
if (BgIkanaShutter_AllSwitchesPressed(this, globalCtx)) {
func_80BD599C(this);
@@ -213,5 +211,5 @@ void BgIkanaShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgIkanaShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000CE8);
+ Gfx_DrawDListOpa(globalCtx, object_ikana_obj_DL_000CE8);
}
diff --git a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
index f4dca549b3..4a49be53c1 100644
--- a/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
+++ b/src/overlays/actors/ovl_Bg_Iknin_Susceil/z_bg_iknin_susceil.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_iknin_susceil.h"
+#include "objects/object_ikninside_obj/object_ikninside_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgIkninSusceil*)thisx)
@@ -26,10 +27,6 @@ void func_80C0AD44(BgIkninSusceil* this);
void func_80C0AD64(BgIkninSusceil* this, GlobalContext* globalCtx);
void func_80C0AE5C(BgIkninSusceil* this, GlobalContext* globalCtx);
-extern CollisionHeader D_0600CBAC;
-extern AnimatedMaterial D_0600C670;
-extern Gfx D_0600C308[];
-
const ActorInit Bg_Iknin_Susceil_InitVars = {
ACTOR_BG_IKNIN_SUSCEIL,
ACTORCAT_BG,
@@ -116,8 +113,8 @@ void BgIkninSusceil_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600CBAC);
- this->animatedTexture = Lib_SegmentedToVirtual(&D_0600C670);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ikninside_obj_Colheader_00CBAC);
+ this->animatedTexture = Lib_SegmentedToVirtual(object_ikninside_obj_Matanimheader_00C670);
func_80C0AC74(this);
}
@@ -260,5 +257,5 @@ void BgIkninSusceil_Draw(Actor* thisx, GlobalContext* globalCtx) {
BgIkninSusceil* this = THIS;
AnimatedMat_Draw(globalCtx, this->animatedTexture);
- Gfx_DrawDListOpa(globalCtx, D_0600C308);
+ Gfx_DrawDListOpa(globalCtx, object_ikninside_obj_DL_00C308);
}
diff --git a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c
index 3b3b211723..a09bcba873 100644
--- a/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c
+++ b/src/overlays/actors/ovl_Bg_Ikninside/z_bg_ikninside.c
@@ -6,7 +6,7 @@
#include "z_bg_ikninside.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIkninside*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
index 67d95a2e49..92a109925b 100644
--- a/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
+++ b/src/overlays/actors/ovl_Bg_Iknv_Doukutu/z_bg_iknv_doukutu.c
@@ -6,7 +6,7 @@
#include "z_bg_iknv_doukutu.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgIknvDoukutu*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
index 53a0b5ea29..a9bf942564 100644
--- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
+++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_iknv_obj.h"
+#include "objects/object_iknv_obj/object_iknv_obj.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgIknvObj*)thisx)
@@ -20,12 +21,6 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx);
void BgIknvObj_UpdateRaisedDoor(BgIknvObj* this, GlobalContext* globalCtx);
void BgIknvObj_UpdateSakonDoor(BgIknvObj* this, GlobalContext* globalCtx);
-extern CollisionHeader D_060119D4;
-extern CollisionHeader D_06012CA4;
-extern Gfx D_06011880[];
-extern Gfx D_060129C8[];
-extern Gfx D_06013058[];
-
const ActorInit Bg_Iknv_Obj_InitVars = {
ACTOR_BG_IKNV_OBJ,
ACTORCAT_BG,
@@ -67,24 +62,24 @@ void BgIknvObj_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = BgIknvObj_DoNothing;
switch (IKNV_OBJ_TYPE(this)) {
case IKNV_OBJ_WATERWHEEL:
- this->displayListPtr = D_06013058;
+ this->displayListPtr = object_iknv_obj_DL_013058;
this->actionFunc = BgIknvObj_UpdateWaterwheel;
- this->dyna.actor.flags |= 0x100000;
- this->dyna.actor.flags |= 0x10;
+ this->dyna.actor.flags |= ACTOR_FLAG_100000;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
break;
case IKNV_OBJ_RAISED_DOOR:
- this->displayListPtr = D_06011880;
+ this->displayListPtr = object_iknv_obj_DL_011880;
DynaPolyActor_Init(&this->dyna, 0);
- CollisionHeader_GetVirtual(&D_060119D4, &colHeader);
+ CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_0119D4, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
this->actionFunc = BgIknvObj_UpdateRaisedDoor;
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f;
break;
case IKNV_OBJ_SAKON_DOOR:
- this->displayListPtr = D_060129C8;
+ this->displayListPtr = object_iknv_obj_DL_0129C8;
this->actionFunc = BgIknvObj_UpdateSakonDoor;
DynaPolyActor_Init(&this->dyna, 0);
- CollisionHeader_GetVirtual(&D_06012CA4, &colHeader);
+ CollisionHeader_GetVirtual(&object_iknv_obj_Colheader_012CA4, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
@@ -136,8 +131,8 @@ void BgIknvObj_UpdateWaterwheel(BgIknvObj* this, GlobalContext* globalCtx) {
func_800B9010(&this->dyna.actor, NA_SE_EV_WOOD_WATER_WHEEL - SFX_FLAG);
}
- if ((globalCtx->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) && (globalCtx->csCtx.unk_12 == 4) &&
- (globalCtx->csCtx.frames == 0x5D7)) {
+ if ((globalCtx->csCtx.state != 0) && (gSaveContext.sceneSetupIndex == 1) &&
+ (globalCtx->csCtx.currentCsIndex == 4) && (globalCtx->csCtx.frames == 1495)) {
func_8019F128(NA_SE_EV_DOOR_UNLOCK);
}
}
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 1522405283..d120c451e5 100644
--- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
+++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c
@@ -6,7 +6,7 @@
#include "z_bg_ingate.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgIngate*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c
index 61e6845631..9ae16fb1ce 100644
--- a/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c
+++ b/src/overlays/actors/ovl_Bg_Inibs_Movebg/z_bg_inibs_movebg.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_inibs_movebg.h"
+#include "objects/object_inibs_object/object_inibs_object.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgInibsMovebg*)thisx)
@@ -26,15 +27,9 @@ const ActorInit Bg_Inibs_Movebg_InitVars = {
(ActorFunc)BgInibsMovebg_Draw,
};
-extern Gfx D_06001C10[];
-extern Gfx D_06001DC0[];
-extern AnimatedMaterial D_06002598;
-extern Gfx D_06006140[];
-extern Gfx D_060062D8[];
-extern AnimatedMaterial D_06006858;
-Gfx* D_80B96560[] = { D_060062D8, D_06001DC0 };
-Gfx* D_80B96568[] = { D_06006140, D_06001C10 };
-AnimatedMaterial* D_80B96570[] = { &D_06006858, &D_06002598 };
+Gfx* D_80B96560[] = { object_inibs_object_DL_0062D8, object_inibs_object_DL_001DC0 };
+Gfx* D_80B96568[] = { object_inibs_object_DL_006140, object_inibs_object_DL_001C10 };
+AnimatedMaterial* D_80B96570[] = { object_inibs_object_Matanimheader_006858, object_inibs_object_Matanimheader_002598 };
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
diff --git a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c
index 3d47988b99..28cea492c6 100644
--- a/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c
+++ b/src/overlays/actors/ovl_Bg_Keikoku_Spr/z_bg_keikoku_spr.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_keikoku_spr.h"
+#include "objects/object_keikoku_obj/object_keikoku_obj.h"
#define FLAGS 0x00000000
@@ -34,13 +35,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 20, ICHAIN_STOP),
};
-extern Gfx D_06000100[];
-extern AnimatedMaterial D_060001F8;
-extern Gfx D_06000300[];
-extern AnimatedMaterial D_060003F8;
-extern Gfx D_06000500[];
-extern AnimatedMaterial D_060005F8;
-
void BgKeikokuSpr_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
}
@@ -56,13 +50,13 @@ void BgKeikokuSpr_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060001F8));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0001F8));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06000100);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060003F8));
- gSPDisplayList(POLY_XLU_DISP++, D_06000300);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060005F8));
- gSPDisplayList(POLY_XLU_DISP++, D_06000500);
+ gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000100);
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0003F8));
+ gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000300);
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_keikoku_obj_Matanimheader_0005F8));
+ gSPDisplayList(POLY_XLU_DISP++, object_keikoku_obj_DL_000500);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c
index 5abeab5f0c..5630bdd8f1 100644
--- a/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c
+++ b/src/overlays/actors/ovl_Bg_Kin2_Bombwall/z_bg_kin2_bombwall.c
@@ -6,7 +6,7 @@
#include "z_bg_kin2_bombwall.h"
-#define FLAGS 0x10000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_10000000)
#define THIS ((BgKin2Bombwall*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c
index d526c458ba..d169be6de0 100644
--- a/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c
+++ b/src/overlays/actors/ovl_Bg_Kin2_Fence/z_bg_kin2_fence.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_kin2_fence.h"
+#include "objects/object_kin2_obj/object_kin2_obj.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgKin2Fence*)thisx)
@@ -118,22 +119,19 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern Gfx D_06000828[];
-extern CollisionHeader D_06000908;
-
s32 BgKin2Fence_CheckHitMask(BgKin2Fence* this) {
ColliderJntSphElement* elements = this->collider.elements;
- if (elements[0].info.bumperFlags & 2) {
+ if (elements[0].info.bumperFlags & BUMP_HIT) {
return 0;
}
- if (elements[1].info.bumperFlags & 2) {
+ if (elements[1].info.bumperFlags & BUMP_HIT) {
return 1;
}
- if (elements[2].info.bumperFlags & 2) {
+ if (elements[2].info.bumperFlags & BUMP_HIT) {
return 2;
}
- if (elements[3].info.bumperFlags & 2) {
+ if (elements[3].info.bumperFlags & BUMP_HIT) {
return 3;
}
return -1;
@@ -159,7 +157,7 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000908);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_kin2_obj_Colheader_000908);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
@@ -272,5 +270,5 @@ void BgKin2Fence_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgKin2Fence_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000828);
+ Gfx_DrawDListOpa(globalCtx, object_kin2_obj_DL_000828);
}
diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c
index 070d8776b2..de9b891aca 100644
--- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c
+++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_ladder.h"
+#include "objects/object_ladder/object_ladder.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgLadder*)thisx)
@@ -19,16 +20,6 @@ void BgLadder_ActionStartCutscene(BgLadder* this, GlobalContext* globalCtx);
void BgLadder_ActionFadeIn(BgLadder* this, GlobalContext* globalCtx);
void BgLadder_ActionIdle(BgLadder* this, GlobalContext* globalCtx);
-extern Gfx D_060000A0[];
-extern Gfx D_060002D0[];
-extern Gfx D_06000500[];
-extern Gfx D_06000730[];
-
-extern CollisionHeader D_060001D8;
-extern CollisionHeader D_06000408;
-extern CollisionHeader D_06000638;
-extern CollisionHeader D_06000868;
-
const ActorInit Bg_Ladder_InitVars = {
ACTOR_BG_LADDER,
ACTORCAT_PROP,
@@ -46,10 +37,10 @@ static InitChainEntry sInitChain[] = {
};
static Gfx* sLadderDLists[] = {
- D_060000A0, // 12 Rung
- D_060002D0, // 16 Rung
- D_06000500, // 20 Rung
- D_06000730, // 24 Rung
+ object_ladder_DL_0000A0, // 12 Rung
+ object_ladder_DL_0002D0, // 16 Rung
+ object_ladder_DL_000500, // 20 Rung
+ object_ladder_DL_000730, // 24 Rung
};
void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -65,13 +56,13 @@ void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) {
size = thisx->params;
if (size == LADDER_SIZE_12RUNG) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060001D8);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_0001D8);
} else if (size == LADDER_SIZE_16RUNG) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000408);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000408);
} else if (size == LADDER_SIZE_20RUNG) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000638);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000638);
} else if (size == LADDER_SIZE_24RUNG) {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000868);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_ladder_Colheader_000868);
} else {
Actor_MarkForDeath(&this->dyna.actor);
return;
@@ -80,7 +71,7 @@ void BgLadder_Init(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
// If the flag is set, then the ladder draws immediately
this->alpha = 255;
- this->dyna.actor.flags &= ~0x10; // always update = off
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off
this->action = BgLadder_ActionIdle;
} else {
// Otherwise, the ladder doesn't draw; wait for the flag to be set
@@ -124,7 +115,7 @@ void BgLadder_ActionFadeIn(BgLadder* this, GlobalContext* globalCtx) {
this->alpha = 255;
ActorCutscene_Stop(this->dyna.actor.cutscene);
func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
- this->dyna.actor.flags &= ~0x10; // always update = off
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10; // always update = off
this->action = BgLadder_ActionIdle;
}
}
diff --git a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c
index 11132cf64e..b0ad9d32eb 100644
--- a/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c
+++ b/src/overlays/actors/ovl_Bg_Lbfshot/z_bg_lbfshot.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_lbfshot.h"
+#include "objects/object_lbfshot/object_lbfshot.h"
#define FLAGS 0x00000000
@@ -30,16 +31,13 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_060014D8;
-extern Gfx D_06000228[];
-
void BgLbfshot_Init(Actor* thisx, GlobalContext* globalCtx) {
BgLbfshot* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
this->dyna.actor.uncullZoneForward = 4000.0f;
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060014D8);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lbfshot_Colheader_0014D8);
}
void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
BgLbfshot* this = THIS;
@@ -47,5 +45,5 @@ void BgLbfshot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
}
void BgLbfshot_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000228);
+ Gfx_DrawDListOpa(globalCtx, object_lbfshot_DL_000228);
}
diff --git a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c
index e8a2d0b4cc..5c2a972b59 100644
--- a/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c
+++ b/src/overlays/actors/ovl_Bg_Lotus/z_bg_lotus.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_lotus.h"
+#include "objects/object_lotus/object_lotus.h"
#define FLAGS 0x00000000
@@ -35,9 +36,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_06000A20; // Lilypad collision
-extern Gfx D_06000040[]; // Lilypad model
-
void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) {
BgLotus* this = THIS;
s32 pad;
@@ -45,7 +43,7 @@ void BgLotus_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000A20);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lotus_Colheader_000A20);
this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &thisx->floorPoly, &bgId,
&this->dyna.actor, &this->dyna.actor.world.pos);
this->timer2 = 96;
@@ -101,7 +99,7 @@ void BgLotus_Wait(BgLotus* this, GlobalContext* globalCtx) {
}
if (gSaveContext.playerForm != PLAYER_FORM_DEKU) {
this->timer = 40;
- this->dyna.actor.flags |= 0x10;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
this->actionFunc = BgLotus_Sink;
return;
}
@@ -154,7 +152,7 @@ void BgLotus_WaitToAppear(BgLotus* this, GlobalContext* globalCtx) {
func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
Actor_SetScale(&this->dyna.actor, 0.1f);
this->dyna.actor.world.pos.y = CLAMP_MIN(this->height, this->dyna.actor.floorHeight);
- this->dyna.actor.flags &= ~0x10;
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10;
this->timer2 = 96;
this->actionFunc = BgLotus_Wait;
this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x;
@@ -173,5 +171,5 @@ void BgLotus_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgLotus_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000040);
+ Gfx_DrawDListOpa(globalCtx, object_lotus_DL_000040);
}
diff --git a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c
index e9a365c91d..e25aeaf67a 100644
--- a/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c
+++ b/src/overlays/actors/ovl_Bg_Market_Step/z_bg_market_step.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_market_step.h"
+#include "objects/object_market_obj/object_market_obj.h"
-#define FLAGS 0x10000020
+#define FLAGS (ACTOR_FLAG_20 | ACTOR_FLAG_10000000)
#define THIS ((BgMarketStep*)thisx)
@@ -26,12 +27,8 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 1000, ICHAIN_STOP),
};
-extern Gfx D_0601F050[];
-extern Gfx D_06018DA0[];
-extern Gfx D_0601EF10[];
-extern Gfx D_06018C60[];
-Gfx* D_80AF0120[] = { D_0601F050, D_06018DA0 };
-Gfx* D_80AF0128[] = { D_0601EF10, D_06018C60 };
+Gfx* D_80AF0120[] = { object_market_obj_DL_01F050, object_market_obj_DL_018DA0 };
+Gfx* D_80AF0128[] = { object_market_obj_DL_01EF10, object_market_obj_DL_018C60 };
void BgMarketStep_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMarketStep* this = THIS;
diff --git a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c
index 8a31c536bc..e5e300757e 100644
--- a/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c
+++ b/src/overlays/actors/ovl_Bg_Mbar_Chair/z_bg_mbar_chair.c
@@ -5,6 +5,7 @@
*/
#include "z_bg_mbar_chair.h"
+#include "objects/object_mbar_obj/object_mbar_obj.h"
#define FLAGS 0x00000000
@@ -34,15 +35,12 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_060019B4;
-extern Gfx D_06000288[];
-
void BgMbarChair_Init(Actor* thisx, GlobalContext* globalCtx) {
BgMbarChair* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060019B4);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mbar_obj_Colheader_0019B4);
}
void BgMbarChair_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -55,5 +53,5 @@ void BgMbarChair_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgMbarChair_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000288);
+ Gfx_DrawDListOpa(globalCtx, object_mbar_obj_DL_000288);
}
diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c
index 62ae7ab8ac..bf556345f1 100644
--- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c
+++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c
@@ -5,8 +5,10 @@
*/
#include "z_bg_numa_hana.h"
+#include "objects/object_numa_obj/object_numa_obj.h"
+#include "objects/object_syokudai/object_syokudai.h"
-#define FLAGS 0x00000410
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((BgNumaHana*)thisx)
@@ -15,14 +17,19 @@ void BgNumaHana_Destroy(Actor* thisx, GlobalContext* globalCtx);
void BgNumaHana_Update(Actor* thisx, GlobalContext* globalCtx);
void BgNumaHana_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_80A1AA28(BgNumaHana* this, GlobalContext* globalCtx);
-void func_80A1AA4C(BgNumaHana* this, GlobalContext* globalCtx);
-void func_80A1AB00(BgNumaHana* this, GlobalContext* globalCtx);
-void func_80A1ABF0(BgNumaHana* this, GlobalContext* globalCtx);
-void func_80A1ACE0(BgNumaHana* this, GlobalContext* globalCtx);
-void func_80A1AE1C(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupDoNothing(BgNumaHana* this);
+void BgNumaHana_DoNothing(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupClosedIdle(BgNumaHana* this);
+void BgNumaHana_ClosedIdle(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupUnfoldInnerPetals(BgNumaHana* this);
+void BgNumaHana_UnfoldInnerPetals(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupUnfoldOuterPetals(BgNumaHana* this);
+void BgNumaHana_UnfoldOuterPetals(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupRaiseFlower(BgNumaHana* this);
+void BgNumaHana_RaiseFlower(BgNumaHana* this, GlobalContext* globalCtx);
+void BgNumaHana_SetupOpenedIdle(BgNumaHana* this);
+void BgNumaHana_OpenedIdle(BgNumaHana* this, GlobalContext* globalCtx);
-#if 0
const ActorInit Bg_Numa_Hana_InitVars = {
ACTOR_BG_NUMA_HANA,
ACTORCAT_BG,
@@ -35,63 +42,379 @@ const ActorInit Bg_Numa_Hana_InitVars = {
(ActorFunc)BgNumaHana_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80A1B260 = {
- { COLTYPE_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x01CBFBB6, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_METAL,
+ AT_NONE,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK2,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x01CBFBB6, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 18, 16, 0, { 0, 0, 0 } },
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80A1B2A8[] = {
+static FireObjInitParams sFireObjInit = {
+ 0.00405000010505f, 0.0500000007451f, 3, 1, 0, 0, 0,
+};
+
+static s16 sInitialAnglePerPetal[] = { 0x0000, 0x2AAA, 0x5555, 0x8000, 0xAAAA, 0xD555 };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 600, ICHAIN_STOP),
};
-#endif
+/**
+ * Spawns another wooden flower instance that handles the opened flower's collision.
+ * Returns true if this wooden flower instance was succesfully spawned.
+ */
+s32 BgNumaHana_SpawnOpenFlowerCollisionChild(BgNumaHana* this, GlobalContext* globalCtx) {
+ Actor* child;
-extern ColliderCylinderInit D_80A1B260;
-extern InitChainEntry D_80A1B2A8[];
+ child = Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_NUMA_HANA,
+ this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
+ this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y, this->dyna.actor.shape.rot.z,
+ BG_NUMA_HANA_TYPE_OPEN_FLOWER_COLLISION);
-extern UNK_TYPE D_06009FE0;
-extern UNK_TYPE D_0600B928;
+ return child != NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1A500.s")
+void BgNumaHana_UpdatePetalPosRots(BgNumaHana* this) {
+ f32 outerPetalPosScale;
+ f32 innerPetalYPos;
+ f32 outerPetalYPos;
+ s16 angle;
+ WoodenFlowerPetalPosRot* innerPetalPosRot;
+ WoodenFlowerPetalPosRot* outerPetalPosRot;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1A56C.s")
+ innerPetalYPos = this->dyna.actor.world.pos.y + -10.0f;
+ angle = this->petalZRotation - 0x2000;
+ outerPetalPosScale = (Math_CosS(angle) * 77.42784f) + 74.95192f;
+ outerPetalYPos = (Math_SinS(this->petalZRotation) * 77.42784f) + this->dyna.actor.world.pos.y + -64.74976f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1A750.s")
+ for (i = 0; i < ARRAY_COUNT(this->innerPetalPosRot); i++) {
+ innerPetalPosRot = &this->innerPetalPosRot[i];
+ outerPetalPosRot = &this->outerPetalPosRot[i];
+ angle = sInitialAnglePerPetal[i] + this->dyna.actor.shape.rot.y + 0x1555;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/BgNumaHana_Init.s")
+ innerPetalPosRot->pos.x = (Math_SinS(angle) * 74.95192f) + this->dyna.actor.world.pos.x;
+ innerPetalPosRot->pos.y = innerPetalYPos;
+ innerPetalPosRot->pos.z = (Math_CosS(angle) * 74.95192f) + this->dyna.actor.world.pos.z;
+ innerPetalPosRot->rot.x = this->dyna.actor.shape.rot.x;
+ innerPetalPosRot->rot.y = angle - 0x4000;
+ innerPetalPosRot->rot.z = this->dyna.actor.shape.rot.z + this->petalZRotation;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/BgNumaHana_Destroy.s")
+ outerPetalPosRot->pos.x = (Math_SinS(angle) * outerPetalPosScale) + this->dyna.actor.world.pos.x;
+ outerPetalPosRot->pos.y = outerPetalYPos;
+ outerPetalPosRot->pos.z = (Math_CosS(angle) * outerPetalPosScale) + this->dyna.actor.world.pos.z;
+ outerPetalPosRot->rot.x = innerPetalPosRot->rot.x;
+ outerPetalPosRot->rot.y = innerPetalPosRot->rot.y;
+ outerPetalPosRot->rot.z = innerPetalPosRot->rot.z + this->outerPetalZRotation;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AA14.s")
+/**
+ * As the pieces of the petals finish unfolding, they shake to appear
+ * as if they are "settling" into place. This function is responsible
+ * for computing the extra rotation for this "settling".
+ */
+void BgNumaHana_UpdateSettleRotation(s16* settleZRotation, s16* settleAngle, f32* settleScale, f32 scaleStep) {
+ *settleAngle += 0x32C8;
+ Math_StepToF(settleScale, 0.0f, scaleStep);
+ *settleZRotation += (s16)(Math_SinS(*settleAngle) * *settleScale);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AA28.s")
+void BgNumaHana_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ DynaPolyActor* child;
+ s32 type;
+ BgNumaHana* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AA38.s")
+ type = BG_NUMA_HANA_GET_TYPE(&this->dyna.actor);
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ DynaPolyActor_Init(&this->dyna, 3);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AA4C.s")
+ if (type == BG_NUMA_HANA_TYPE_OPEN_FLOWER_COLLISION) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gWoodenFlowerOpenedFlowerCol);
+ BgNumaHana_SetupDoNothing(this);
+ this->dyna.actor.draw = NULL;
+ } else {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gWoodenFlowerClosedFlowerCol);
+ FireObj_Init(globalCtx, &this->fire, &sFireObjInit, &this->dyna.actor);
+ Collider_InitCylinder(globalCtx, &this->torchCollider);
+ Collider_SetCylinder(globalCtx, &this->torchCollider, &this->dyna.actor, &sCylinderInit);
+ this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
+ if (!BgNumaHana_SpawnOpenFlowerCollisionChild(this, globalCtx)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AAE8.s")
+ if (gSaveContext.weekEventReg[12] & 1) {
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AB00.s")
+ this->petalZRotation = 0x2000;
+ this->innerPetalZRotation = 0x2000;
+ this->innerPetalZRotationalVelocity = 0;
+ this->settleZRotation = 0;
+ this->settleAngle = 0;
+ this->settleScale = 0.0f;
+ this->outerPetalZRotation = -0x4000;
+ this->outerPetalZRotationalVelocity = 0;
+ this->flowerRotationalVelocity = 0x147;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1ABD8.s")
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 210.0f;
+ FireObj_SetState2(&this->fire, 0.05f, 2);
+ Flags_SetSwitch(globalCtx, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor));
+ BgNumaHana_SetupOpenedIdle(this);
+ } else {
+ child = (DynaPolyActor*)this->dyna.actor.child;
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, child->bgId);
+ Flags_UnsetSwitch(globalCtx, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor));
+ BgNumaHana_SetupClosedIdle(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1ABF0.s")
+ BgNumaHana_UpdatePetalPosRots(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1ACCC.s")
+void BgNumaHana_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ BgNumaHana* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1ACE0.s")
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ if (BG_NUMA_HANA_GET_TYPE(&this->dyna.actor) == BG_NUMA_HANA_TYPE_NORMAL) {
+ FireObj_Destroy(globalCtx, &this->fire);
+ Collider_DestroyCylinder(globalCtx, &this->torchCollider);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AE08.s")
+void BgNumaHana_SetupDoNothing(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_DoNothing;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/func_80A1AE1C.s")
+void BgNumaHana_DoNothing(BgNumaHana* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/BgNumaHana_Update.s")
+void BgNumaHana_SetupClosedIdle(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_ClosedIdle;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Bg_Numa_Hana/BgNumaHana_Draw.s")
+/**
+ * This function waits for the torch to be lit. Once it is, it starts
+ * the cutscene where the petals unfold.
+ */
+void BgNumaHana_ClosedIdle(BgNumaHana* this, GlobalContext* globalCtx) {
+ if (this->fire.state != 3) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLAME_IGNITION);
+ if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
+ gSaveContext.weekEventReg[12] |= 1;
+ Flags_SetSwitch(globalCtx, BG_NUMA_HANA_SWITCH_FLAG(&this->dyna.actor));
+ BgNumaHana_SetupUnfoldInnerPetals(this);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ }
+ }
+}
+
+void BgNumaHana_SetupUnfoldInnerPetals(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_UnfoldInnerPetals;
+ this->transitionTimer = 0;
+}
+
+/**
+ * Partially moves the flower to the "open" position by raising the "inner"
+ * parts of the petals that are closest to the stalk.
+ */
+void BgNumaHana_UnfoldInnerPetals(BgNumaHana* this, GlobalContext* globalCtx) {
+ Math_StepToS(&this->innerPetalZRotationalVelocity, 240, 14);
+ if (Math_ScaledStepToS(&this->innerPetalZRotation, 0x2000, this->innerPetalZRotationalVelocity)) {
+ if (this->transitionTimer >= 11) {
+ BgNumaHana_SetupUnfoldOuterPetals(this);
+ } else {
+ if (this->transitionTimer <= 0) {
+ this->settleZRotation = 0;
+ this->settleAngle = 0;
+ this->settleScale = 420.0f;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP);
+ }
+ this->transitionTimer++;
+ }
+ } else {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_MOVE - SFX_FLAG);
+ }
+
+ BgNumaHana_UpdateSettleRotation(&this->settleZRotation, &this->settleAngle, &this->settleScale, 20.0f);
+ this->petalZRotation = this->innerPetalZRotation + this->settleZRotation;
+ BgNumaHana_UpdatePetalPosRots(this);
+}
+
+void BgNumaHana_SetupUnfoldOuterPetals(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_UnfoldOuterPetals;
+ this->transitionTimer = 0;
+}
+
+/**
+ * Partially moves the flower to the "open" position by lowering the "outer"
+ * parts of the petals that are furthest to the stalk.
+ */
+void BgNumaHana_UnfoldOuterPetals(BgNumaHana* this, GlobalContext* globalCtx) {
+ Math_StepToS(&this->outerPetalZRotationalVelocity, 240, 14);
+ if (Math_ScaledStepToS(&this->outerPetalZRotation, -0x4000, this->outerPetalZRotationalVelocity)) {
+ if (this->transitionTimer >= 11) {
+ BgNumaHana_SetupRaiseFlower(this);
+ } else {
+ if (this->transitionTimer <= 0) {
+ this->settleZRotation = 0;
+ this->settleAngle = 0x5120;
+ this->settleScale = 130.0f;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_STOP);
+ }
+ this->transitionTimer++;
+ }
+ } else {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_FLOWERPETAL_MOVE - SFX_FLAG);
+ }
+
+ BgNumaHana_UpdateSettleRotation(&this->settleZRotation, &this->settleAngle, &this->settleScale, 7.0f);
+ this->petalZRotation = this->innerPetalZRotation + this->settleZRotation;
+ BgNumaHana_UpdatePetalPosRots(this);
+}
+
+void BgNumaHana_SetupRaiseFlower(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_RaiseFlower;
+}
+
+/**
+ * This function slowly raises the flower to its final height and makes it start spinning.
+ */
+void BgNumaHana_RaiseFlower(BgNumaHana* this, GlobalContext* globalCtx) {
+ s32 pad;
+ DynaPolyActor* child;
+
+ BgNumaHana_UpdateSettleRotation(&this->settleZRotation, &this->settleAngle, &this->settleScale, 10.0f);
+ this->petalZRotation = this->innerPetalZRotation + this->settleZRotation;
+ Math_StepToS(&this->flowerRotationalVelocity, 0x111, 0xA);
+ this->dyna.actor.shape.rot.y += this->flowerRotationalVelocity;
+ Math_StepToF(&this->dyna.actor.velocity.y, 3.0f, 0.3f);
+
+ if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 210.0f,
+ this->dyna.actor.velocity.y)) {
+ child = (DynaPolyActor*)this->dyna.actor.child;
+
+ // Swaps out the "closed" flower collision for the "opened" collision.
+ func_800C6314(globalCtx, &globalCtx->colCtx.dyna, child->bgId);
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+
+ this->petalZRotation = 0x2000;
+ this->innerPetalZRotation = 0x2000;
+ this->innerPetalZRotationalVelocity = 0;
+ this->settleZRotation = 0;
+ this->settleAngle = 0;
+ this->outerPetalZRotation = -0x4000;
+ this->outerPetalZRotationalVelocity = 0;
+ this->flowerRotationalVelocity = 0x147;
+ this->settleScale = 0.0f;
+
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ BgNumaHana_SetupOpenedIdle(this);
+ }
+
+ BgNumaHana_UpdatePetalPosRots(this);
+ func_800B9010(&this->dyna.actor, NA_SE_EV_FLOWER_ROLLING - SFX_FLAG);
+}
+
+void BgNumaHana_SetupOpenedIdle(BgNumaHana* this) {
+ this->actionFunc = BgNumaHana_OpenedIdle;
+}
+
+/**
+ * Spins the "opened" flower around the y-axis.
+ */
+void BgNumaHana_OpenedIdle(BgNumaHana* this, GlobalContext* globalCtx) {
+ this->dyna.actor.shape.rot.y += this->flowerRotationalVelocity;
+ this->petalZRotation = this->innerPetalZRotation + this->settleZRotation;
+ BgNumaHana_UpdatePetalPosRots(this);
+ func_800B9010(&this->dyna.actor, NA_SE_EV_FLOWER_ROLLING - SFX_FLAG);
+}
+
+void BgNumaHana_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ BgNumaHana* this = THIS;
+ s32 type = BG_NUMA_HANA_GET_TYPE(&this->dyna.actor);
+ Vec3f firePos;
+
+ if (type == BG_NUMA_HANA_TYPE_NORMAL) {
+ firePos.x = this->dyna.actor.world.pos.x;
+ firePos.y = this->dyna.actor.world.pos.y + 10.5f;
+ firePos.z = this->dyna.actor.world.pos.z;
+ FireObj_SetPosition(&this->fire, &firePos);
+ FireObj_Update(globalCtx, &this->fire, &this->dyna.actor);
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (type == BG_NUMA_HANA_TYPE_NORMAL) {
+ this->dyna.actor.child->shape.rot = this->dyna.actor.shape.rot;
+ Collider_UpdateCylinder(&this->dyna.actor, &this->torchCollider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->torchCollider.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->torchCollider.base);
+ }
+}
+
+void BgNumaHana_Draw(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ BgNumaHana* this = THIS;
+ WoodenFlowerPetalPosRot* innerPetalPosRot;
+ WoodenFlowerPetalPosRot* outerPetalPosRot;
+ s32 objectIndex;
+ s32 i;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerStalkDL);
+
+ for (i = 0; i < ARRAY_COUNT(this->innerPetalPosRot); i++) {
+ innerPetalPosRot = &this->innerPetalPosRot[i];
+ outerPetalPosRot = &this->outerPetalPosRot[i];
+
+ Matrix_SetStateRotationAndTranslation(innerPetalPosRot->pos.x, innerPetalPosRot->pos.y, innerPetalPosRot->pos.z,
+ &innerPetalPosRot->rot);
+ Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerInnerPetalDL);
+
+ Matrix_SetStateRotationAndTranslation(outerPetalPosRot->pos.x, outerPetalPosRot->pos.y, outerPetalPosRot->pos.z,
+ &outerPetalPosRot->rot);
+ Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerOuterPetalDL);
+ }
+
+ objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_SYOKUDAI);
+ if ((objectIndex >= 0) && (Object_IsLoaded(&globalCtx->objectCtx, objectIndex))) {
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 64.5f,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+ Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[objectIndex].segment);
+ gSPDisplayList(POLY_OPA_DISP++, gObjectSyokudaiTypeNoSwitchDL);
+ }
+
+ FireObj_Draw(globalCtx, &this->fire);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h
index f4974860ae..19d30a34f1 100644
--- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h
+++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.h
@@ -3,15 +3,41 @@
#include "global.h"
+#define BG_NUMA_HANA_GET_TYPE(thisx) ((thisx)->params & 1)
+#define BG_NUMA_HANA_SWITCH_FLAG(thisx) (((thisx)->params >> 8) & 0x7F)
+
+typedef enum {
+ /* 0 */ BG_NUMA_HANA_TYPE_NORMAL,
+ /* 1 */ BG_NUMA_HANA_TYPE_OPEN_FLOWER_COLLISION,
+} BgNumaHanaType;
+
struct BgNumaHana;
typedef void (*BgNumaHanaActionFunc)(struct BgNumaHana*, GlobalContext*);
+typedef struct {
+ /* 0x00 */ Vec3f pos;
+ /* 0x0C */ Vec3s rot;
+ /* 0x12 */ UNK_TYPE1 unk_12[0x2];
+} WoodenFlowerPetalPosRot; // size = 0x14
+
typedef struct BgNumaHana {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xF0];
- /* 0x0234 */ BgNumaHanaActionFunc actionFunc;
- /* 0x0238 */ char unk_238[0x108];
+ /* 0x000 */ DynaPolyActor dyna;
+ /* 0x15C */ FireObj fire;
+ /* 0x1E8 */ ColliderCylinder torchCollider;
+ /* 0x234 */ BgNumaHanaActionFunc actionFunc;
+ /* 0x238 */ WoodenFlowerPetalPosRot innerPetalPosRot[6];
+ /* 0x2B0 */ WoodenFlowerPetalPosRot outerPetalPosRot[6];
+ /* 0x328 */ s16 petalZRotation;
+ /* 0x32A */ s16 innerPetalZRotation;
+ /* 0x32C */ s16 innerPetalZRotationalVelocity;
+ /* 0x32E */ s16 settleZRotation;
+ /* 0x330 */ s16 settleAngle;
+ /* 0x334 */ f32 settleScale;
+ /* 0x338 */ s16 outerPetalZRotation;
+ /* 0x33A */ s16 outerPetalZRotationalVelocity;
+ /* 0x33C */ s16 flowerRotationalVelocity;
+ /* 0x33E */ s16 transitionTimer;
} BgNumaHana; // size = 0x340
extern const ActorInit Bg_Numa_Hana_InitVars;
diff --git a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c
index ecfc8ad021..f1fa69810f 100644
--- a/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c
+++ b/src/overlays/actors/ovl_Bg_Open_Shutter/z_bg_open_shutter.c
@@ -6,7 +6,7 @@
#include "z_bg_open_shutter.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgOpenShutter*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c
index 8657a40db7..b776253e60 100644
--- a/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c
+++ b/src/overlays/actors/ovl_Bg_Open_Spot/z_bg_open_spot.c
@@ -6,7 +6,7 @@
#include "z_bg_open_spot.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgOpenSpot*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c
index 8e443f5295..15bac4d131 100644
--- a/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c
+++ b/src/overlays/actors/ovl_Bg_Sinkai_Kabe/z_bg_sinkai_kabe.c
@@ -6,7 +6,7 @@
#include "z_bg_sinkai_kabe.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((BgSinkaiKabe*)thisx)
diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
index 38ce543ccf..3adec0ce4e 100644
--- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
+++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c
@@ -5,8 +5,9 @@
*/
#include "z_bg_tobira01.h"
+#include "objects/object_spot11_obj/object_spot11_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BgTobira01*)thisx)
@@ -27,9 +28,6 @@ const ActorInit Bg_Tobira01_InitVars = {
(ActorFunc)BgTobira01_Draw,
};
-extern Gfx D_06000088[];
-extern CollisionHeader D_060011C0;
-
void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 cutsceneId = this->dyna.actor.cutscene;
@@ -80,7 +78,7 @@ void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011C0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_spot11_obj_Colheader_0011C0);
gSaveContext.weekEventReg[88] &= (u8)~0x40;
Actor_SetScale(&this->dyna.actor, 1.0f);
this->timer2 = gSaveContext.isNight;
@@ -107,7 +105,7 @@ void BgTobira01_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000088);
+ gSPDisplayList(POLY_OPA_DISP++, object_spot11_obj_DL_000088);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c
index 467911ca96..4a6ef6e662 100644
--- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c
+++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c
@@ -6,7 +6,7 @@
#include "z_boss_01.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss01*)thisx)
diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
index f60141c5d8..e2c8c079e6 100644
--- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c
+++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c
@@ -7,8 +7,10 @@
#include "z_boss_02.h"
#include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h"
#include "overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h"
+#include "objects/object_boss02/object_boss02.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss02*)thisx)
@@ -29,36 +31,6 @@ void func_809DD2F8(GlobalContext* globalCtx);
void func_809DD934(Boss02* this, GlobalContext* globalCtx);
void func_809DEAC4(Boss02* this, GlobalContext* globalCtx);
-extern Gfx D_06000230[];
-extern Gfx D_060002E0[];
-extern UNK_TYPE D_060003A0;
-extern UNK_TYPE D_060041A0;
-extern UNK_TYPE D_06008650;
-extern SkeletonHeader D_06009B10;
-extern AnimationHeader D_06009C78;
-extern Gfx D_0600ECF0[];
-extern Gfx D_0600EF90[];
-extern Gfx D_0600F310[];
-extern Gfx D_0600F690[];
-extern Gfx D_0600FA10[];
-extern Gfx D_0600FD90[];
-extern Gfx D_06010110[];
-extern Gfx D_06010490[];
-extern Gfx D_06010810[];
-extern Gfx D_06010B90[];
-extern Gfx D_06010F10[];
-extern Gfx D_06011290[];
-extern Gfx D_06011610[];
-extern Gfx D_06011990[];
-extern Gfx D_06011D10[];
-extern Gfx D_06012090[];
-extern Gfx D_06012410[];
-extern Gfx D_06012790[];
-extern Gfx D_06012B10[];
-extern Gfx D_06012E90[];
-extern Gfx D_06013210[];
-extern Gfx D_06013590[];
-
static u8 D_809E0420;
static u8 D_809E0421;
static u8 D_809E0422;
@@ -591,7 +563,7 @@ void Boss02_Init(Actor* thisx, GlobalContext* globalCtx) {
globalCtx->specialEffects = (void*)D_809E0438;
this->actor.update = func_809DC78C;
this->actor.draw = func_809DD0A8;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_1D70 = 0.00999999977648f;
if ((KREG(64) != 0) || (gSaveContext.eventInf[5] & 0x20) || (D_809E0434 != NULL)) {
this->unk_1D20 = 0;
@@ -624,7 +596,8 @@ void Boss02_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_HEAVY;
this->actor.colChkInfo.health = 20;
Actor_SetScale(&this->actor, 0.01f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06009B10, &D_06009C78, this->jointTable, this->morphTable, 13);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_boss02_Skel_009B10, &object_boss02_Anim_009C78,
+ this->jointTable, this->morphTable, 13);
Collider_InitAndSetJntSph(globalCtx, &this->colliderSphere1, &this->actor, &sJntSphInit1,
this->colliderSphere1Elements);
Collider_InitAndSetJntSph(globalCtx, &this->colliderSphere2, &this->actor, &sJntSphInit2,
@@ -663,7 +636,7 @@ void func_809DAA98(Boss02* this, GlobalContext* globalCtx) {
void func_809DAAA8(Boss02* this, GlobalContext* globalCtx) {
this->actionFunc = func_809DAB78;
- Animation_MorphToLoop(&this->skelAnime, &D_06009C78, 0.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_boss02_Anim_009C78, 0.0f);
if (D_809E042C->unk_1D20 != 0) {
this->unk_0144 = 10;
} else {
@@ -759,7 +732,7 @@ void func_809DAB78(Boss02* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_INBOSS_ROAR_OLD);
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (this->unk_0195 != 0) {
this->actor.world.rot.z = Math_SinS(this->unk_014C * 0x1200) * 0xE00;
} else {
@@ -1179,9 +1152,9 @@ void func_809DC218(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actor.focus.pos.y < BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp20, &sp24)) ||
(D_809E0422 != 0)) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
}
}
@@ -1308,22 +1281,22 @@ void func_809DC78C(Actor* thisx, GlobalContext* globalCtx) {
Boss02* this = THIS;
this->unk_01AC = D_809DF5B0;
- globalCtx->envCtx.unk_EA = 0xD;
+ globalCtx->envCtx.sandstormState = 0xD;
if (D_809E0434 != NULL) {
this->unk_1D74 = KREG(23) + -15.0f;
D_801F4E30 = 0;
- globalCtx->envCtx.unk_C3 = 1;
+ globalCtx->envCtx.lightSettingOverride = 1;
globalCtx->skyboxId = 1;
} else if (D_809E0422 == 0) {
this->unk_1D74 = 0.0f;
D_801F4E30 = this->unk_1D7C;
- globalCtx->envCtx.unk_C3 = 0;
+ globalCtx->envCtx.lightSettingOverride = 0;
globalCtx->skyboxId = 2;
} else {
this->unk_1D74 = KREG(23) + -15.0f;
D_801F4E30 = ((KREG(24) * 0.1f) + 1.0f) * this->unk_1D7C;
- globalCtx->envCtx.unk_C3 = 1;
+ globalCtx->envCtx.lightSettingOverride = 1;
globalCtx->skyboxId = 1;
}
@@ -1351,9 +1324,12 @@ void func_809DC78C(Actor* thisx, GlobalContext* globalCtx) {
// matrix stuff at the start?
void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
static Gfx* D_809DFA9C[] = {
- D_0600ECF0, D_0600EF90, D_0600F310, D_0600F690, D_0600FA10, D_0600FD90, D_06010110, D_06010490,
- D_06010810, D_06010B90, D_06010F10, D_06011290, D_06011610, D_06011990, D_06011D10, D_06012090,
- D_06012410, D_06012790, D_06012B10, D_06012E90, D_06013210, D_06013590,
+ object_boss02_DL_00ECF0, object_boss02_DL_00EF90, object_boss02_DL_00F310, object_boss02_DL_00F690,
+ object_boss02_DL_00FA10, object_boss02_DL_00FD90, object_boss02_DL_010110, object_boss02_DL_010490,
+ object_boss02_DL_010810, object_boss02_DL_010B90, object_boss02_DL_010F10, object_boss02_DL_011290,
+ object_boss02_DL_011610, object_boss02_DL_011990, object_boss02_DL_011D10, object_boss02_DL_012090,
+ object_boss02_DL_012410, object_boss02_DL_012790, object_boss02_DL_012B10, object_boss02_DL_012E90,
+ object_boss02_DL_013210, object_boss02_DL_013590,
};
static Vec3f D_809DFAF4 = { -10000.0f, -100000.0f, -100000.0f };
Boss02* this = THIS;
@@ -1378,9 +1354,9 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
func_8012C28C(globalCtx->state.gfxCtx);
if (this->actor.params == 0) {
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060003A0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_boss02_Tex_0003A0));
} else {
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060041A0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_boss02_Tex_0041A0));
}
gSPSegment(POLY_OPA_DISP++, 0x0D, matrix);
@@ -1490,9 +1466,12 @@ void Boss02_Draw(Actor* thisx, GlobalContext* globalCtx2) {
}
#else
static Gfx* D_809DFA9C[] = {
- D_0600ECF0, D_0600EF90, D_0600F310, D_0600F690, D_0600FA10, D_0600FD90, D_06010110, D_06010490,
- D_06010810, D_06010B90, D_06010F10, D_06011290, D_06011610, D_06011990, D_06011D10, D_06012090,
- D_06012410, D_06012790, D_06012B10, D_06012E90, D_06013210, D_06013590,
+ object_boss02_DL_00ECF0, object_boss02_DL_00EF90, object_boss02_DL_00F310, object_boss02_DL_00F690,
+ object_boss02_DL_00FA10, object_boss02_DL_00FD90, object_boss02_DL_010110, object_boss02_DL_010490,
+ object_boss02_DL_010810, object_boss02_DL_010B90, object_boss02_DL_010F10, object_boss02_DL_011290,
+ object_boss02_DL_011610, object_boss02_DL_011990, object_boss02_DL_011D10, object_boss02_DL_012090,
+ object_boss02_DL_012410, object_boss02_DL_012790, object_boss02_DL_012B10, object_boss02_DL_012E90,
+ object_boss02_DL_013210, object_boss02_DL_013590,
};
static Vec3f D_809DFAF4 = { -10000.0f, -100000.0f, -100000.0f };
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_02/Boss02_Draw.s")
@@ -1562,7 +1541,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
for (i = 0; i < ARRAY_COUNT(D_809E0438); i++, effect++) {
if (effect->unk_24 == 1) {
if (!flag) {
- gSPDisplayList(POLY_XLU_DISP++, D_06000230);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_000230);
gDPSetEnvColor(POLY_XLU_DISP++, 185, 140, 70, 128);
flag++;
}
@@ -1583,7 +1562,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_060002E0);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_0002E0);
}
}
@@ -1604,7 +1583,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_0401A620);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_01A620);
}
}
@@ -1612,7 +1591,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
for (i = 0, flag = false; i < ARRAY_COUNT(D_809E0438); i++, effect++) {
if (effect->unk_24 == 4) {
if (!flag) { //! @bug - dev forgot to set flag to 1, should only apply to first entry?
- gSPDisplayList(POLY_XLU_DISP++, D_04023348);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023348);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 128);
}
@@ -1624,7 +1603,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_04023428);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428);
}
}
@@ -1632,7 +1611,7 @@ void func_809DD2F8(GlobalContext* globalCtx) {
for (i = 0, flag = false; i < ARRAY_COUNT(D_809E0438); i++, effect++) {
if (effect->unk_24 == 2) {
if (!flag) {
- gSPDisplayList(POLY_XLU_DISP++, D_06000230);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_000230);
gDPSetEnvColor(POLY_XLU_DISP++, 30, 30, 30, 128);
flag++;
}
@@ -1642,13 +1621,13 @@ void func_809DD2F8(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, effect->unk_26 + (i * 3),
(effect->unk_26 + (i * 3)) * 5, 32, 64, 1, 0, 0, 32, 32));
- Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, 0);
+ Matrix_InsertTranslation(effect->unk_00.x, effect->unk_00.y, effect->unk_00.z, MTXMODE_NEW);
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
Matrix_Scale(effect->unk_34 * D_809DF5B0, effect->unk_34 * D_809DF5B0, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_060002E0);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss02_DL_0002E0);
}
}
@@ -1671,10 +1650,10 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
switch (this->unk_1D18) {
case 0:
if (player->stateFlags1 & 0x100) {
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- this->unk_1D22 = func_801694DC(globalCtx);
- func_80169590(globalCtx, 0, 1);
- func_80169590(globalCtx, this->unk_1D22, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ this->unk_1D22 = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->unk_1D22, 7);
func_8016566C(150);
this->unk_1D14 = 0;
this->unk_1D5C = 0.0f;
@@ -1791,8 +1770,8 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
this->unk_1D18 = 0;
func_80169AFC(globalCtx, this->unk_1D22, 0);
this->unk_1D22 = 0;
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
- this->actor.flags |= 1;
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
+ this->actor.flags |= ACTOR_FLAG_1;
player->stateFlags1 &= ~0x100;
this->unk_1D70 = 0.01f;
func_80165690();
@@ -1805,7 +1784,7 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
Actor_SetScale(&player->actor, this->unk_1D70);
}
- globalCtx->envCtx.unk_8C.fogNear = this->unk_1D74;
+ globalCtx->envCtx.lightSettings.fogNear = this->unk_1D74;
if (sp57) {
D_809E0422 = 1 - D_809E0422;
@@ -2069,8 +2048,8 @@ void func_809DD934(Boss02* this, GlobalContext* globalCtx) {
this->unk_1D54 = Math_SinS(this->unk_1D14 * 1512) * this->unk_1D58;
Matrix_InsertZRotation_f(this->unk_1D54, MTXMODE_APPLY);
Matrix_GetStateTranslationAndScaledY(1.0f, &this->unk_1D3C);
- func_8016981C(globalCtx, this->unk_1D22, &this->unk_1D30, &this->unk_1D24, &this->unk_1D3C);
- ShrinkWindow_SetLetterboxTarget(0x1B);
+ Play_CameraSetAtEyeUp(globalCtx, this->unk_1D22, &this->unk_1D30, &this->unk_1D24, &this->unk_1D3C);
+ ShrinkWindow_SetLetterboxTarget(27);
}
}
#else
@@ -2098,10 +2077,10 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
if ((gSaveContext.weekEventReg[52] & 0x20) || ((u32)(KREG(13) + 15) >= this->unk_1D1C)) {
break;
}
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- this->unk_1D22 = func_801694DC(globalCtx);
- func_80169590(globalCtx, 0, 1);
- func_80169590(globalCtx, this->unk_1D22, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ this->unk_1D22 = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->unk_1D22, 7);
this->unk_1D20 = 2;
this->unk_1D1C = 0;
@@ -2178,15 +2157,15 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
if (this->unk_1D1C == (u32)(KREG(92) + 125)) {
TitleCard_InitBossName(&globalCtx->state, &globalCtx->actorCtx.titleCtxt,
- Lib_SegmentedToVirtual(&D_06008650), 160, 180, 128, 40);
+ Lib_SegmentedToVirtual(object_boss02_Tex_008650), 160, 180, 128, 40);
}
if (this->unk_1D1C == (u32)(BREG(27) + 335)) {
func_80169AFC(globalCtx, this->unk_1D22, 0);
this->unk_1D22 = 0;
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_1D20 = 0;
D_809E0424->unk_0144 = D_809E0428->unk_0144 = 3;
D_809E0424->unk_0146[0] = D_809E0428->unk_0146[0] = 60;
@@ -2196,10 +2175,10 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
case 100:
if (ActorCutscene_GetCurrentIndex() == -1) {
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- this->unk_1D22 = func_801694DC(globalCtx);
- func_80169590(globalCtx, 0, 1);
- func_80169590(globalCtx, this->unk_1D22, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ this->unk_1D22 = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->unk_1D22, 7);
this->unk_1D20 = 101;
this->unk_1D1C = 0;
this->unk_1D5C = 1.0f;
@@ -2245,10 +2224,10 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
if (this->unk_1D1C == 30) {
func_80169AFC(globalCtx, this->unk_1D22, 0);
this->unk_1D22 = 0;
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6);
this->unk_1D20 = 0;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
sp68->unk_0144 = 10;
if ((D_809E0424->unk_0144 >= 10) && (D_809E0428->unk_0144 >= 10)) {
f32 phi_f0;
@@ -2281,9 +2260,9 @@ void func_809DEAC4(Boss02* this, GlobalContext* globalCtx) {
if ((this->unk_1D20 != 0) && (this->unk_1D22 != 0)) {
sp5C = this->unk_1D24;
sp5C.y += sp58 * D_809DF5B0;
- func_8016981C(globalCtx, this->unk_1D22, &this->unk_1D30, &sp5C, &this->unk_1D3C);
+ Play_CameraSetAtEyeUp(globalCtx, this->unk_1D22, &this->unk_1D30, &sp5C, &this->unk_1D3C);
this->unk_1D3C.z = this->unk_1D3C.x = 0.0f;
this->unk_1D3C.y = 1.0f;
- ShrinkWindow_SetLetterboxTarget(0x1B);
+ ShrinkWindow_SetLetterboxTarget(27);
}
}
diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c
index ce8551aa7f..70a6405bcb 100644
--- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c
+++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c
@@ -6,7 +6,7 @@
#include "z_boss_03.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss03*)thisx)
diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
index 67ea1702e6..b4106527b6 100644
--- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c
+++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c
@@ -7,7 +7,7 @@
#include "z_boss_04.h"
#include "objects/object_boss04/object_boss04.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss04*)thisx)
@@ -231,7 +231,7 @@ void Boss04_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_809EC544(Boss04* this) {
this->actionFunc = func_809EC568;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
@@ -259,10 +259,10 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
this->unk_708 = 10;
this->unk_704 = 0;
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- this->unk_70A = func_801694DC(globalCtx);
- func_80169590(globalCtx, 0, 1);
- func_80169590(globalCtx, this->unk_70A, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ this->unk_70A = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->unk_70A, 7);
func_800B7298(globalCtx, &this->actor, 7);
player->actor.world.pos.x = this->unk_6E8;
player->actor.world.pos.z = this->unk_6F0 + 410.0f;
@@ -380,7 +380,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
}
if (this->unk_704 > 140) {
- Camera* sp5C = Play_GetCamera(globalCtx, MAIN_CAM);
+ Camera* sp5C = Play_GetCamera(globalCtx, CAM_ID_MAIN);
this->unk_708 = 0;
func_809ECD00(this, globalCtx);
@@ -389,7 +389,7 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
sp5C->at = this->unk_718;
func_80169AFC(globalCtx, this->unk_70A, 0);
this->unk_70A = 0;
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6);
func_80165690();
gSaveContext.eventInf[6] |= 1;
@@ -400,14 +400,14 @@ void func_809EC568(Boss04* this, GlobalContext* globalCtx) {
if (this->unk_70A != 0) {
Vec3f sp50;
- ShrinkWindow_SetLetterboxTarget(0x1B);
+ ShrinkWindow_SetLetterboxTarget(27);
if (this->unk_748 != 0) {
this->unk_748--;
}
Math_Vec3f_Copy(&sp50, &this->unk_718);
sp50.y += Math_SinS(this->unk_748 * 0x4000) * this->unk_748 * 1.5f;
Play_CameraSetAtEye(globalCtx, this->unk_70A, &sp50, &this->unk_70C);
- func_80169940(globalCtx, this->unk_70A, this->unk_744);
+ Play_CameraSetFov(globalCtx, this->unk_70A, this->unk_744);
Math_ApproachF(&this->unk_744, 60.0f, 0.1f, 1.0f);
}
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
@@ -521,7 +521,7 @@ void func_809ED224(Boss04* this) {
this->unk_2D0 = 10000.0f;
this->unk_2C8 = 200;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ME_DEAD);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
func_801A2ED8();
this->unk_1F6 = 10;
}
@@ -542,7 +542,7 @@ void func_809ED2A0(Boss04* this, GlobalContext* globalCtx) {
}
if (this->unk_1F8 == 3) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_700 = 0.0f;
this->unk_6FC = 0.0f;
this->unk_6F8 = 0.0f;
@@ -747,9 +747,9 @@ void Boss04_Update(Actor* thisx, GlobalContext* globalCtx2) {
func_809ED45C(this, globalCtx);
if (this->unk_2CC > 3000.0f) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
} else {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.h b/src/overlays/actors/ovl_Boss_04/z_boss_04.h
index f4542cf3a0..267688ab0e 100644
--- a/src/overlays/actors/ovl_Boss_04/z_boss_04.h
+++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.h
@@ -13,7 +13,7 @@ typedef struct Boss04 {
/* 0x0188 */ Vec3s jointTable[9];
/* 0x01BE */ Vec3s morphtable[9];
/* 0x01F4 */ s16 unk_1F4;
- /* 0x01F6 */ s8 unk_1F6;
+ /* 0x01F6 */ u8 unk_1F6;
/* 0x01F7 */ u8 unk_1F7;
/* 0x01F8 */ s16 unk_1F8;
/* 0x01FA */ s16 unk_1FA;
diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c
index a8122fdaa4..a88ad80089 100644
--- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c
+++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c
@@ -6,7 +6,7 @@
#include "z_boss_05.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((Boss05*)thisx)
diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c
index 9e38aaccb5..262bc1979d 100644
--- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c
+++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c
@@ -5,8 +5,11 @@
*/
#include "z_boss_06.h"
+#include "overlays/actors/ovl_En_Knight/z_en_knight.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_knight/object_knight.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss06*)thisx)
@@ -15,15 +18,22 @@ void Boss06_Destroy(Actor* thisx, GlobalContext* globalCtx);
void Boss06_Update(Actor* thisx, GlobalContext* globalCtx);
void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_809F24A8(Boss06* this);
void func_809F24C8(Boss06* this, GlobalContext* globalCtx);
void func_809F2B64(Boss06* this, GlobalContext* globalCtx);
void func_809F2C44(Boss06* this, GlobalContext* globalCtx);
+void func_809F2E14(Boss06* this, GlobalContext* globalCtx);
void func_809F2E34(Boss06* this, GlobalContext* globalCtx);
+void func_809F2ED0(Boss06* this, GlobalContext* globalCtx);
void func_809F2EE8(Boss06* this, GlobalContext* globalCtx);
-#if 0
-// static DamageTable sDamageTable = {
-static DamageTable D_809F4080 = {
+static Vec3f D_809F4370[128];
+static EnKnight* D_809F4970;
+static s32 D_809F4974;
+static s32 D_809F4978;
+static s32 D_809F497C;
+
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0xF),
/* Deku Stick */ DMG_ENTRY(0, 0xF),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -70,47 +80,581 @@ const ActorInit Boss_06_InitVars = {
(ActorFunc)Boss06_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_809F40C0 = {
- { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x04 }, { 0xF7FFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT3,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK3,
+ { 0xF7CFFFFF, 0x00, 0x04 },
+ { 0xF7FFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 90, 140, 10, { 0, 0, 0 } },
};
+static Vec3f D_809F40EC[] = {
+ { 1081.0f, 235.0f, 3224.0f },
+ { 676.0f, 235.0f, 3224.0f },
+};
+
+void func_809F2120(s32 arg0, s32 arg1, s32 arg2) {
+ D_809F4974 = arg0;
+ D_809F4978 = arg1;
+ D_809F497C = arg2;
+}
+
+f32 func_809F2140(void) {
+ f32 temp_f2;
+
+ D_809F4974 = (D_809F4974 * 171) % 30269;
+ D_809F4978 = (D_809F4978 * 172) % 30307;
+ D_809F497C = (D_809F497C * 170) % 30323;
+ temp_f2 = (D_809F4974 / 30269.0f) + (D_809F4978 / 30307.0f) + (D_809F497C / 30323.0f);
+
+ while (temp_f2 >= 1.0f) {
+ temp_f2 -= 1.0f;
+ }
+
+ return fabsf(temp_f2);
+}
+
+void Boss06_Init(Actor* thisx, GlobalContext* globalCtx) {
+ Boss06* this = THIS;
+ u8* temp_v0;
+ s32 i;
+
+ D_809F4970 = (EnKnight*)this->actor.parent;
+ this->actor.colChkInfo.damageTable = &sDamageTable;
+
+ if ((KREG(64) != 0) || (gSaveContext.eventInf[5] & 0x80)) {
+ this->actionFunc = func_809F2E14;
+ } else {
+ this->actionFunc = func_809F2B64;
+ }
+
+ Actor_SetScale(&this->actor, 0.1f);
+ Math_Vec3f_Copy(&this->actor.world.pos, &D_809F40EC[ENBOSS06_GET_PARAMS(&this->actor)]);
+ this->actor.shape.rot.y = -0x8000;
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+
+ temp_v0 = SEGMENTED_TO_VIRTUAL(&object_knight_Tex_019490);
+ for (i = 0; i < ARRAY_COUNT(this->unk_200); i++) {
+ this->unk_200[i] = temp_v0[i];
+ }
+
+ this->actor.flags &= ~ACTOR_FLAG_1;
+}
+
+void Boss06_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
+
+void func_809F23CC(Boss06* this) {
+ if (this->collider.base.acFlags & AC_HIT) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ if ((this->unk_1C9 == 0) && (D_809F4970->unk_68A == 0)) {
+ if (this->actor.colChkInfo.damageEffect == 2) {
+ func_809F24A8(this);
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+
+ this->unk_1B0 = -(this->actor.world.pos.x - this->collider.info.bumper.hitPos.x);
+ this->unk_1BC = this->unk_1B0 * 0.35f;
+
+ this->unk_1B4 = -((this->actor.world.pos.y + 80.0f) - this->collider.info.bumper.hitPos.y);
+ this->unk_1C0 = this->unk_1B4 * -0.35f;
+ }
+ }
+ }
+}
+
+void func_809F24A8(Boss06* this) {
+ this->actionFunc = func_809F24C8;
+ this->unk_A28 = 0.0f;
+ this->unk_1AC = 0.0f;
+}
+
+#ifdef NON_MATCHING
+// Weird loading of 1
+void func_809F24C8(Boss06* this, GlobalContext* globalCtx) {
+ s16 sp4E = 0;
+ Player* player = GET_PLAYER(globalCtx);
+ Actor* temp_s0;
+ Actor* temp_v0_2;
+ Actor* child;
+
+ this->unk_1CA++;
+
+ switch (this->unk_1C9) {
+ case 0:
+ if (ActorCutscene_GetCurrentIndex() != -1) {
+ break;
+ }
+
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ func_800B7298(globalCtx, &this->actor, 7);
+ this->unk_A00 = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->unk_A00, 7);
+ D_809F4970->unk_151 = 1;
+ this->unk_1C9 = 1;
+ this->unk_1C8 = 1;
+ this->unk_1E0 = 255.0f;
+ this->unk_1DC = 0.0f;
+
+ temp_s0 = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first;
+ while (temp_s0 != NULL) {
+ if (temp_s0->id == ACTOR_EN_ARROW) {
+ Actor_MarkForDeath(temp_s0);
+ }
+ temp_s0 = temp_s0->next;
+ }
+
+ case 1:
+ if (this->unk_1CA >= 10) {
+ Math_ApproachF(&this->unk_1E4, 30.0f, 0.2f, 1.0f);
+ globalCtx->envCtx.fillScreen = 1;
+ globalCtx->envCtx.screenFillColor[2] = 0;
+ globalCtx->envCtx.screenFillColor[1] = 0;
+ globalCtx->envCtx.screenFillColor[0] = 0;
+ globalCtx->envCtx.screenFillColor[3] = this->unk_A2C;
+ Math_ApproachF(&this->unk_A2C, 75.0f, 1.0f, 3.0f);
+ }
+
+ if (this->unk_1CA >= 30) {
+ play_sound(NA_SE_EV_S_STONE_FLASH);
+ }
+
+ if (this->unk_1CA >= 60) {
+ globalCtx->envCtx.fillScreen = 0;
+ this->unk_1C8 = 0;
+ this->unk_1DC = 0.0f;
+ this->unk_1D8 = 0.0f;
+ if (this->unk_1CA == 60) {
+ D_809F4970->unk_154++;
+ func_800B7298(globalCtx, &this->actor, 0x84);
+ player->actor.shape.rot.y = 0;
+ player->actor.world.rot.y = player->actor.shape.rot.y;
+ }
+
+ this->unk_A04.x = player->actor.world.pos.x + 20.0f;
+ this->unk_A04.y = player->actor.world.pos.y + 20.0f;
+ this->unk_A04.z = player->actor.world.pos.z + 30.0f;
+
+ this->unk_A10.x = player->actor.world.pos.x;
+ this->unk_A10.y = player->actor.world.pos.y + 26.0f;
+ this->unk_A10.z = player->actor.world.pos.z;
+
+ if (this->unk_1CA >= 75) {
+ temp_v0_2 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first;
+ while (temp_v0_2 != NULL) {
+ if ((temp_v0_2->id == ACTOR_EN_KNIGHT) && (&D_809F4970->actor == temp_v0_2) &&
+ (D_809F4970->unk_680 != 0)) {
+ this->unk_A04.x = 1307.0f;
+ this->unk_A04.y = 142.0f;
+ this->unk_A04.z = 2897.0f;
+
+ this->unk_A10.x = 1376.0f;
+ this->unk_A10.y = 132.0f;
+ this->unk_A10.z = 2860.0f;
+
+ if (this->unk_1CA == 75) {
+ D_809F4970->unk_148 = 1;
+ }
+ sp4E = 17;
+ break;
+ }
+ temp_v0_2 = temp_v0_2->next;
+ }
+ }
+
+ if ((s16)(sp4E + 80) < this->unk_1CA) {
+ this->unk_1C9 = 2;
+ this->unk_1CA = 0;
+ this->unk_1B4 = 0.0f;
+ this->unk_1B0 = 0.0f;
+ this->unk_144 = 2;
+ this->unk_1A4 = 0.0f;
+ this->unk_1A0 = 0.0f;
+ this->unk_1DC = 18.0f;
+ this->unk_1E0 = 255.0f;
+ this->unk_19C = 1.0f;
+
+ Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_MIR_RAY2,
+ this->actor.world.pos.x, this->actor.world.pos.y - 200.0f,
+ this->actor.world.pos.z - 170.0f, 15, 0, 0, 1);
+
+ if (ENBOSS06_GET_PARAMS(&this->actor) == 0) {
+ this->unk_A04.x = this->actor.world.pos.x - 200.0f;
+ } else {
+ this->unk_A04.x = this->actor.world.pos.x + 200.0f;
+ }
+ this->unk_A04.y = (this->actor.world.pos.y - 200.0f) + 100.0f;
+ this->unk_A04.z = this->actor.world.pos.z - 200.0f;
+
+ this->unk_A10.x = this->actor.world.pos.x;
+ this->unk_A10.y = this->actor.world.pos.y + 80.0f;
+ this->unk_A10.z = this->actor.world.pos.z;
+ }
+ } else {
+ this->unk_A10.z = this->actor.world.pos.z;
+ this->unk_A04.y = this->actor.world.pos.y + 60.0f;
+ this->unk_A04.x = this->actor.world.pos.x;
+
+ this->unk_A04.z = this->actor.world.pos.z - 210.0f;
+ this->unk_A10.y = this->actor.world.pos.y + 80.0f;
+ this->unk_A10.x = this->actor.world.pos.x;
+ }
+ break;
+
+ case 2:
+ child = this->actor.child;
+
+ if (this->unk_1CA == 1) {
+ this->unk_A1C.x = fabsf(this->unk_A10.x - child->world.pos.x);
+ this->unk_A1C.y = fabsf(this->unk_A10.y - child->world.pos.y);
+ this->unk_A1C.z = fabsf(this->unk_A10.z - child->world.pos.z);
+ }
+
+ Math_ApproachF(&this->unk_A10.x, child->world.pos.x, 0.15f, this->unk_A1C.x * this->unk_A28);
+ Math_ApproachF(&this->unk_A10.y, child->world.pos.y, 0.15f, this->unk_A1C.y * this->unk_A28);
+ Math_ApproachF(&this->unk_A10.z, child->world.pos.z, 0.15f, this->unk_A1C.z * this->unk_A28);
+ Math_ApproachF(&this->unk_A28, 1.0f, 1.0f, 0.001f);
+
+ if (this->unk_1CA > 80) {
+ func_809F2ED0(this, globalCtx);
+ func_80169AFC(globalCtx, this->unk_A00, 0);
+ this->unk_A00 = 0;
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
+ func_800B7298(globalCtx, &this->actor, 6);
+ D_809F4970->unk_151 = 0;
+ }
+ break;
+ }
+
+ if (this->unk_A00 != 0) {
+ ShrinkWindow_SetLetterboxTarget(27);
+ Play_CameraSetAtEye(globalCtx, this->unk_A00, &this->unk_A10, &this->unk_A04);
+ }
+}
+#else
+#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24C8.s")
#endif
-extern DamageTable D_809F4080;
-extern ColliderCylinderInit D_809F40C0;
+void func_809F2B64(Boss06* this, GlobalContext* globalCtx) {
+ this->actionFunc = func_809F2C44;
+ this->unk_144 = 3;
+ this->unk_1A8 = 110.0f;
+ this->unk_1E0 = 200;
+ this->unk_1DC = 15.0f;
+ this->unk_1E4 = 30.0f;
+ this->unk_1AC = 0.0f;
+ this->unk_19C = 1.0f;
+ Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_MIR_RAY2, this->actor.world.pos.x,
+ this->actor.world.pos.y - 200.0f, this->actor.world.pos.z - 170.0f, 15, 0, 0, 1);
+ D_809F4970->unk_154++;
+}
-extern UNK_TYPE D_06018BD0;
-extern UNK_TYPE D_06019490;
+void func_809F2C44(Boss06* this, GlobalContext* globalCtx) {
+ if (D_809F4970->unk_153 != 0) {
+ this->unk_A28 = 0.008f;
+ Math_ApproachF(&this->unk_1E4, 0.0f, 0.2f, this->unk_A28 * 30.0f);
+ Math_ApproachF(&this->unk_1AC, -70.0f, 0.2f, this->unk_A28 * 70.0f);
+ Math_ApproachF(&this->unk_1A8, 0.0f, 0.2f, this->unk_A28 * 110.0f);
+ Math_ApproachF(&this->unk_1A0, -900.0f, 0.2f, this->unk_A28 * 900.0f);
+ Math_ApproachF(&this->unk_1A4, 1350.0f, 0.2f, this->unk_A28 * 1350.0f);
+ Math_ApproachF(&this->unk_1E0, 100.0f, 0.2f, this->unk_A28 * 100.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2120.s")
+ if (this->unk_1E4 < 5.0f) {
+ Math_ApproachF(&this->unk_19C, 0.0f, 1.0f, 0.03f);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2140.s")
+ if ((this->unk_1E4 > 0.1f) && ENBOSS06_GET_PARAMS(&this->actor) == 0) {
+ play_sound(NA_SE_EV_CURTAIN_DOWN - SFX_FLAG);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Init.s")
+ if (D_809F4970->unk_153 == 2) {
+ Actor_MarkForDeath(this->actor.child);
+ this->actor.child = NULL;
+ func_809F2E14(this, globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Destroy.s")
+void func_809F2E14(Boss06* this, GlobalContext* globalCtx) {
+ this->actionFunc = func_809F2E34;
+ this->unk_144 = 1;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F23CC.s")
+void func_809F2E34(Boss06* this, GlobalContext* globalCtx) {
+ this->unk_1E0 = 200.0f;
+ this->unk_1DC = 15.0f;
+ func_809F23CC(this);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ this->collider.dim.pos.z = (this->actor.world.pos.z - 50.0f) + 100.0f;
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24A8.s")
+void func_809F2ED0(Boss06* this, GlobalContext* globalCtx) {
+ this->actionFunc = func_809F2EE8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F24C8.s")
+void func_809F2EE8(Boss06* this, GlobalContext* globalCtx) {
+ this->unk_1E0 = 100.0f;
+ this->unk_1DC = 13.0f;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2B64.s")
+void Boss06_Update(Actor* thisx, GlobalContext* globalCtx) {
+ Boss06* this = THIS;
+ s32 i;
+ Vec3f sp7C;
+ f32 temp_f22;
+ f32 phi_f26;
+ f32 phi_f24;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2C44.s")
+ this->actionFunc(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2E14.s")
+ if (this->unk_146 != 0) {
+ this->unk_146--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2E34.s")
+ if (this->unk_148 != 0) {
+ this->unk_148--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2ED0.s")
+ if (this->unk_1E4 > 0.0f) {
+ if (ENBOSS06_GET_PARAMS(&this->actor) == 0) {
+ D_801F4E32 = 1;
+ D_801F4E38.x = this->actor.world.pos.x + this->unk_1B0;
+ D_801F4E38.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
+ D_801F4E38.z = this->actor.world.pos.z;
+ D_801F4E44 = this->unk_1E4;
+ D_801F4E48 = 10.0f;
+ D_801F4E4C = 0;
+ } else {
+ D_801F4E4E = 1;
+ D_801F4E50.x = this->actor.world.pos.x + this->unk_1B0;
+ D_801F4E50.y = this->actor.world.pos.y + 80.0f + this->unk_1B4 + this->unk_1AC;
+ D_801F4E50.z = this->actor.world.pos.z;
+ D_801F4E5C = this->unk_1E4;
+ D_801F4E60 = 10.0f;
+ D_801F4E64 = 0;
+ }
+ } else if (ENBOSS06_GET_PARAMS(&this->actor) == 0) {
+ D_801F4E32 = 0;
+ } else {
+ D_801F4E4E = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/func_809F2EE8.s")
+ if ((this->unk_1C8 != 0) && (this->unk_1C8 != 0)) {
+ play_sound(NA_SE_EV_FIRE_PLATE - SFX_FLAG);
+ this->unk_1CC += 0.6f;
+ this->unk_1D0 += 0.1f;
+ this->unk_1D4 += 0.0200000014156f;
+ this->unk_1D8 += 0.00016f;
+ this->unk_1DC += 0.4f;
+ Math_ApproachZeroF(&this->unk_1B0, 1.0f, 0.7f);
+ Math_ApproachZeroF(&this->unk_1B4, 1.0f, 0.7f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Update.s")
+ phi_f26 = 0.0f;
+ phi_f24 = 0.0f;
+ for (i = 0; i < 1024; i++) {
+ temp_f22 =
+ (((__sinf(phi_f24) * this->unk_1D4) + 1.0f) * ((__sinf(phi_f26) * this->unk_1D0) + this->unk_1D0)) +
+ this->unk_1CC;
+
+ phi_f26 += (M_PI / 64);
+ phi_f24 += 0.030679617f;
+
+ Matrix_InsertZRotation_f(i * (M_PI / 512), MTXMODE_NEW);
+ Matrix_GetStateTranslationAndScaledY(temp_f22, &sp7C);
+
+ sp7C.x += 32.0f + this->unk_1BC;
+ sp7C.y += 32.0f + this->unk_1C0;
+
+ if ((i % 8) == 0) {
+ Math_Vec3f_Copy(&D_809F4370[i / 8], &sp7C);
+ }
+
+ if ((sp7C.x >= 0.0f) && (sp7C.y >= 0.0f) && (sp7C.x < 64.0f) && (sp7C.y < 64.0f)) {
+ s32 x = sp7C.x;
+ s32 idx = ((s32)sp7C.y << 5);
+
+ idx += (x / 2);
+
+ if ((x % 2) != 0) {
+ this->unk_200[idx] &= 0xF0;
+ } else {
+ this->unk_200[idx] &= 0xF;
+ }
+ }
+ }
+ }
+}
+
+#ifdef NON_MATCHING
+// v/a flips
+void Boss06_Draw(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ Boss06* this = THIS;
+ s32 i;
+ f32 spE0 = 0.0f;
+ s16 temp_s0;
+ s16 temp_f10;
+ Vtx* temp_v0_2;
+ u32 temp_v0;
+ u8 spD3;
+ u8 spD2;
+ s32 pad;
+ f32 sp68;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ temp_v0 = gSaveContext.time;
+ if (gSaveContext.time > 0x8000) {
+ temp_v0 = (0xFFFF - gSaveContext.time) & 0xFFFF;
+ }
+ sp68 = (f32)temp_v0 / 0x8000;
+ spD3 = ((10.0f * sp68) + 105.0f) * this->unk_19C;
+ spD2 = ((40.0f * sp68) + 55.0f) * this->unk_19C;
+
+ if (this->unk_144 & 2) {
+ temp_s0 = Math_SinS(D_809F4970->unk_144) * 1000.0f;
+ temp_f10 = (Math_CosS(D_809F4970->unk_144) * -2000.0f) - 2000.0f;
+ temp_v0_2 = SEGMENTED_TO_VIRTUAL(&object_knight_Vtx_018BD0);
+
+ temp_v0_2[0].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
+ temp_v0_2[3].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
+ temp_v0_2[4].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
+ temp_v0_2[7].v.ob[1] = (s16)this->unk_1A0 + 0xE92;
+
+ temp_v0_2[5].v.ob[0] = temp_s0 + 0x2A3;
+ temp_v0_2[5].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708;
+
+ temp_v0_2[6].v.ob[0] = temp_s0 - 0x2A3;
+ temp_v0_2[6].v.ob[2] = (temp_f10 + (s16)this->unk_1A4) - 0x708;
+
+ temp_v0_2[9].v.ob[0] = temp_s0 + 0x2A3;
+ temp_v0_2[9].v.ob[2] = temp_f10 - 0x1C2;
+
+ temp_v0_2[11].v.ob[0] = temp_s0 - 0x2A3;
+ temp_v0_2[11].v.ob[2] = temp_f10 - 0x1C2;
+
+ temp_v0_2[12].v.ob[0] = temp_s0 + 0x2A3;
+ temp_v0_2[12].v.ob[2] = temp_f10 - 0x1C2;
+
+ temp_v0_2[14].v.ob[0] = temp_s0 - 0x339;
+ temp_v0_2[14].v.ob[2] = temp_f10 - 0x79E;
+
+ temp_v0_2[15].v.ob[0] = temp_s0 - 0x339;
+ temp_v0_2[15].v.ob[2] = temp_f10;
+
+ temp_v0_2[16].v.ob[0] = temp_s0 + 0x339;
+ temp_v0_2[16].v.ob[2] = temp_f10;
+
+ temp_v0_2[17].v.ob[0] = temp_s0 + 0x339;
+ temp_v0_2[17].v.ob[2] = temp_f10 - 0x79E;
+
+ if (this->actor.child != NULL) {
+ Actor* child = this->actor.child;
+
+ child->world.pos.x = this->actor.world.pos.x + (temp_s0 * 0.1f);
+ child->world.pos.z = (this->actor.world.pos.z - 170.0f) + (temp_f10 * 0.1f);
+ }
+
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_knight_Matanimheader_019360));
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y - 234.0f,
+ this->actor.world.pos.z + 30.0f, 0);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, 0.0f, -1112.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x9B, 255, 255, (u8)((140.0f * sp68) + 115.0f), spD3);
+ gSPDisplayList(POLY_XLU_DISP++, object_knight_DL_018CF0);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0xFF, 255, 255, (u8)((100.0f * sp68) + 65.0f), spD2);
+ gSPDisplayList(POLY_XLU_DISP++, object_knight_DL_018DE0);
+ }
+
+ if (this->unk_144 & 1) {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&this->unk_200));
+
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + this->unk_1A8,
+ this->actor.world.pos.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, 0.0f, MTXMODE_APPLY);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_knight_DL_0193B0);
+
+ if (this->unk_1D8 > 0.0f) {
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + 84.0f,
+ this->actor.world.pos.z - 2.0f, MTXMODE_NEW);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
+ func_809F2120(1, 0x71A5, 0x263A);
+
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 10, 0, 0);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 230);
+
+ for (i = 0; i < ARRAY_COUNT(D_809F4370); i++) {
+ if ((fabsf(D_809F4370[i].x - 32.0f) < 30.0f) && (fabsf(D_809F4370[i].y - 32.0f) < 30.0f)) {
+ Matrix_StatePush();
+
+ gSPSegment(POLY_XLU_DISP++, 0x08,
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0,
+ ((globalCtx->gameplayFrames + (i * 10)) * -20) % 512, 0x20, 0x80));
+
+ Matrix_InsertTranslation((D_809F4370[i].x - 32.0f) * -2.4f, (D_809F4370[i].y - 32.0f) * -2.4f, 0.0f,
+ MTXMODE_APPLY);
+ Matrix_InsertZRotation_f(i * (M_PI / 64), MTXMODE_APPLY);
+
+ if (func_809F2140() < 0.5f) {
+ Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
+ }
+
+ Matrix_Scale(-0.002f, -this->unk_1D8, 1.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
+
+ Matrix_StatePop();
+ }
+ }
+ } else {
+ spE0 = 7.0f;
+ }
+ }
+
+ if (this->unk_1DC > 0.0f) {
+ u8 temp_s2 = (this->unk_1E0 - 50.0f) + (50.0f * sp68);
+
+ Matrix_InsertTranslation(this->actor.world.pos.x + this->unk_1B0,
+ this->actor.world.pos.y + 84.0f + this->unk_1B4,
+ (this->actor.world.pos.z - 2.0f) + spE0, MTXMODE_NEW);
+
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023348);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, (u8)((140.0f * sp68) + 115.0f), temp_s2);
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 205, (u8)((100.0f * sp68) + 65.0f), 128);
+
+ Matrix_Scale(this->unk_1DC, this->unk_1DC, 1.0f, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(globalCtx->gameplayFrames * 64, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+#else
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Boss_06/Boss06_Draw.s")
+#endif
diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.h b/src/overlays/actors/ovl_Boss_06/z_boss_06.h
index b793b284b2..d7e6875a20 100644
--- a/src/overlays/actors/ovl_Boss_06/z_boss_06.h
+++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.h
@@ -7,11 +7,47 @@ struct Boss06;
typedef void (*Boss06ActionFunc)(struct Boss06*, GlobalContext*);
+#define ENBOSS06_GET_PARAMS(thisx) ((thisx)->params)
+
typedef struct Boss06 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x54];
+ /* 0x0144 */ u8 unk_144;
+ /* 0x0146 */ s16 unk_146;
+ /* 0x0148 */ s16 unk_148;
+ /* 0x014C */ ColliderCylinder collider;
/* 0x0198 */ Boss06ActionFunc actionFunc;
- /* 0x019C */ char unk_19C[0x894];
+ /* 0x019C */ f32 unk_19C;
+ /* 0x01A0 */ f32 unk_1A0;
+ /* 0x01A4 */ f32 unk_1A4;
+ /* 0x01A8 */ f32 unk_1A8;
+ /* 0x01AC */ f32 unk_1AC;
+ /* 0x01B0 */ f32 unk_1B0;
+ /* 0x01B4 */ f32 unk_1B4;
+ /* 0x01B8 */ UNK_TYPE1 unk1B8[4];
+ /* 0x01BC */ f32 unk_1BC;
+ /* 0x01C0 */ f32 unk_1C0;
+ /* 0x01C4 */ UNK_TYPE1 unk1C4[4];
+ /* 0x01C8 */ u8 unk_1C8;
+ /* 0x01C9 */ u8 unk_1C9;
+ /* 0x01CA */ s16 unk_1CA;
+ /* 0x01CC */ f32 unk_1CC;
+ /* 0x01D0 */ f32 unk_1D0;
+ /* 0x01D4 */ f32 unk_1D4;
+ /* 0x01D8 */ f32 unk_1D8;
+ /* 0x01DC */ f32 unk_1DC;
+ /* 0x01E0 */ f32 unk_1E0;
+ /* 0x01E4 */ f32 unk_1E4;
+ /* 0x01E8 */ UNK_TYPE1 unk1E8[0x15];
+ /* 0x01FD */ u8 unk_1FD;
+ /* 0x01FE */ u8 unk_1FE;
+ /* 0x01FF */ u8 unk_1FF;
+ /* 0x0200 */ u8 unk_200[0x800];
+ /* 0x0A00 */ s16 unk_A00;
+ /* 0x0A04 */ Vec3f unk_A04;
+ /* 0x0A10 */ Vec3f unk_A10;
+ /* 0x0A1C */ Vec3f unk_A1C;
+ /* 0x0A28 */ f32 unk_A28;
+ /* 0x0A2C */ f32 unk_A2C;
} Boss06; // size = 0xA30
extern const ActorInit Boss_06_InitVars;
diff --git a/src/overlays/actors/ovl_Boss_07/z_boss_07.c b/src/overlays/actors/ovl_Boss_07/z_boss_07.c
index d5e0e22ede..9e88410345 100644
--- a/src/overlays/actors/ovl_Boss_07/z_boss_07.c
+++ b/src/overlays/actors/ovl_Boss_07/z_boss_07.c
@@ -6,7 +6,7 @@
#include "z_boss_07.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((Boss07*)thisx)
diff --git a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c
index 333d2a89f4..d8ebaf7eb1 100644
--- a/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c
+++ b/src/overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.c
@@ -6,7 +6,7 @@
#include "z_boss_hakugin.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((BossHakugin*)thisx)
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 94bbef096f..18be6991c1 100644
--- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c
+++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c
@@ -6,7 +6,7 @@
#include "z_demo_effect.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoEffect*)thisx)
diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c
index 71f0d92048..9e6661fd0a 100644
--- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c
+++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c
@@ -6,7 +6,7 @@
#include "z_demo_getitem.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoGetitem*)thisx)
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 9cc359c9e6..629ec5668e 100644
--- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
+++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c
@@ -5,8 +5,10 @@
*/
#include "z_demo_kankyo.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_bubble/object_bubble.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoKankyo*)thisx)
@@ -17,10 +19,6 @@ void DemoKankyo_Draw(Actor* thisx, GlobalContext* globalCtx);
void DemoKakyo_MoonSparklesActionFunc(DemoKankyo* this, GlobalContext* globalCtx);
-extern Gfx D_0407AB58[];
-extern Gfx D_06001000[]; // the bubble display list used by shabom in giants type
-extern Gfx D_04023428[];
-
static u8 sLostWoodsSparklesMutex = false; // make sure only one can exist at once
static s16 sLostWoodsSkyFishParticleNum = 0;
@@ -512,21 +510,21 @@ void DemoKankyo_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) {
- DemoKankyo* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ DemoKankyo* this = THIS;
s16 i;
f32 scaleAlpha;
Vec3f worldPos;
Vec3f screenPos;
// if not underwater
- if (!(globalCtx->cameraPtrs[MAIN_CAM]->flags2 & 0x100)) {
+ if (!(globalCtx->cameraPtrs[CAM_ID_MAIN]->flags2 & 0x100)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(&D_04079B10));
- gSPDisplayList(POLY_XLU_DISP++, D_0407AB10);
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gSun1Tex));
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB10);
for (i = 0; i < globalCtx->envCtx.unk_F2[3]; i++) {
worldPos.x = this->particles[i].posBase.x + this->particles[i].posOffset.x;
@@ -593,7 +591,7 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_0407AB58);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58);
}
}
@@ -603,8 +601,8 @@ void DemoKakyo_DrawLostWoodsSparkle(Actor* thisx, GlobalContext* globalCtx2) {
// draw, giants and moon
void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) {
- DemoKankyo* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ DemoKankyo* this = THIS;
s16 i;
f32 alphaScale;
@@ -657,7 +655,7 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) {
break;
}
- gSPDisplayList(POLY_XLU_DISP++, &D_04023348);
+ gSPDisplayList(POLY_XLU_DISP++, &gameplay_keep_DL_023348);
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
@@ -667,9 +665,9 @@ void DemoKankyo_DrawMoonAndGiant(Actor* thisx, GlobalContext* globalCtx2) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (this->actor.params == DEMO_KANKYO_TYPE_GIANTS) {
- gSPDisplayList(POLY_XLU_DISP++, D_06001000);
+ gSPDisplayList(POLY_XLU_DISP++, object_bubble_DL_001000);
} else {
- gSPDisplayList(POLY_XLU_DISP++, D_04023428);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023428);
}
}
}
diff --git a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c
index ab3cf474fa..9ed7a0c274 100644
--- a/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c
+++ b/src/overlays/actors/ovl_Demo_Moonend/z_demo_moonend.c
@@ -6,7 +6,7 @@
#include "z_demo_moonend.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoMoonend*)thisx)
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 f7001b4891..faedc1b748 100644
--- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c
+++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd.c
@@ -6,7 +6,7 @@
#include "z_demo_shd.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoShd*)thisx)
diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c
index a22d0f8c68..a4c9b9dc38 100644
--- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c
+++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c
@@ -6,7 +6,7 @@
#include "z_demo_syoten.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DemoSyoten*)thisx)
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 751447860a..ff738dc70a 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
@@ -8,7 +8,7 @@
#include "../ovl_En_Box/z_en_box.h"
#include "objects/object_box/object_box.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((DemoTreLgt*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c
index 3a84e6b391..ede7baa1da 100644
--- a/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c
+++ b/src/overlays/actors/ovl_Dm_Ah/z_dm_ah.c
@@ -6,7 +6,7 @@
#include "z_dm_ah.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((DmAh*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c
index f61a8f74ee..d289b99ec3 100644
--- a/src/overlays/actors/ovl_Dm_Al/z_dm_al.c
+++ b/src/overlays/actors/ovl_Dm_Al/z_dm_al.c
@@ -6,7 +6,7 @@
#include "z_dm_al.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((DmAl*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c
index 865cbeef03..e6175bfd95 100644
--- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c
+++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c
@@ -6,7 +6,7 @@
#include "z_dm_an.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((DmAn*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c
index 4394c6109c..aa4abb91da 100644
--- a/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c
+++ b/src/overlays/actors/ovl_Dm_Bal/z_dm_bal.c
@@ -6,7 +6,7 @@
#include "z_dm_bal.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((DmBal*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
index 596945272c..c72634216a 100644
--- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
+++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.c
@@ -5,8 +5,10 @@
*/
#include "z_dm_char00.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_delf/object_delf.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar00*)thisx)
@@ -15,7 +17,9 @@ void DmChar00_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DmChar00_Update(Actor* thisx, GlobalContext* globalCtx);
void DmChar00_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80AA67F8(DmChar00* this, GlobalContext* globalCtx);
+void func_80AA695C(DmChar00* this, GlobalContext* globalCtx);
+
const ActorInit Dm_Char00_InitVars = {
ACTOR_DM_CHAR00,
ACTORCAT_ITEMACTION,
@@ -28,56 +32,921 @@ const ActorInit Dm_Char00_InitVars = {
(ActorFunc)DmChar00_Draw,
};
-#endif
+static AnimationInfo sAnimations[] = {
+ { &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_004FF4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0053A4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_005B68, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_006328, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00FB30, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_010590, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_005B68, 1.0f, 37.0f, 56.0f, 4, 0.0f },
+ { &object_delf_Anim_006328, 1.0f, 37.0f, 56.0f, 4, 0.0f },
+ { &object_delf_Anim_00E024, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00F0D0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_011C70, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_011FE0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_011088, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0118FC, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_012388, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_012738, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_013BE0, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_013E80, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_007B04, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0080A4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00859C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_008A44, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00EB18, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00EBB0, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00EE30, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_012BBC, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_012EF8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00C248, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00C588, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00BDFC, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00C0BC, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_013040, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_013378, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_0091BC, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0094B0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_009C4C, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_009F40, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_009010, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0097C4, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00A7B4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00C588, 1.0f, 0.0f, -1.0f, 0, -10.0f },
+ { &object_delf_Anim_004FF4, 1.0f, 0.0f, -1.0f, 2, -10.0f },
+ { &object_delf_Anim_011C70, 1.0f, 0.0f, -1.0f, 0, -10.0f },
+ { &object_delf_Anim_006B28, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_014190, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_01447C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_003FAC, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_004798, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_0042E8, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_004C44, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_01088C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_01498C, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_014E9C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00CEE0, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00D260, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00C690, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00C790, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00AF78, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00B2B8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00BCD8, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_006D74, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00706C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_0072B0, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_007570, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00A2A4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00A4B4, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_006614, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_015114, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00CCD4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00046C, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_00065C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00377C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_003148, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_001410, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_0010F8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_00199C, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_003BB4, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_001754, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_0008E0, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_000A94, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_001ED4, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+ { &object_delf_Anim_001B28, 1.0f, 0.0f, -1.0f, 2, 0.0f },
+ { &object_delf_Anim_000E44, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5580.s")
+DmChar00Struct D_80AA77A8[] = {
+ { 250.0f, 255.0f, 230.0f, 255.0f },
+ { 63.0f, 18.0f, 93.0f, 255.0f },
+ { 255.0f, 235.0f, 220.0f, 255.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA561C.s")
+DmChar00Struct D_80AA77D8[] = {
+ { 220.0f, 160.0f, 80.0f, 255.0f },
+ { 250.0f, 40.0f, 10.0f, 255.0f },
+ { 255.0f, 235.0f, 220.0f, 255.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5720.s")
+Vec3f D_80AA7808 = { 0.0f, 0.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA575C.s")
+void func_80AA5580(SkelAnime* skelAnime, AnimationInfo* animation, u16 idx) {
+ f32 phi_f2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5890.s")
+ animation += idx;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA58CC.s")
+ if (animation->frameCount < 0.0f) {
+ phi_f2 = Animation_GetLastFrame(animation->animation);
+ } else {
+ phi_f2 = animation->frameCount;
+ }
+ Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, phi_f2,
+ animation->mode, animation->morphFrames);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5950.s")
+void func_80AA561C(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames + 20) {
+ case 503:
+ case 926:
+ case 979:
+ case 1222:
+ case 1682:
+ case 2194:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5960.s")
+ case 1858:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA59E4.s")
+ case 2043:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ break;
+ }
+ } else {
+ switch (globalCtx->csCtx.frames + 20) {
+ case 503:
+ case 926:
+ case 979:
+ case 1234:
+ case 1687:
+ case 2194:
+ case 2210:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5A6C.s")
+ case 2043:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONDO_SURPRISE);
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5AF4.s")
+void func_80AA5720(DmChar00* this, GlobalContext* globalCtx) {
+ if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (globalCtx->csCtx.frames == 505)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SPOT_LIGHT_OPEN);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5BF8.s")
+void func_80AA575C(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 474:
+ case 489:
+ case 495:
+ case 505:
+ case 854:
+ case 860:
+ case 866:
+ case 872:
+ case 877:
+ case 882:
+ case 887:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5CD4.s")
+ case 520:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_SPIT);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5D10.s")
+ case 774:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5D6C.s")
+ case 904:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_SIGH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5DC8.s")
+ case 813:
+ case 972:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE);
+ break;
+ }
+ } else if (globalCtx->csCtx.frames == 660) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MONDO_SURPRISE);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5E2C.s")
+void func_80AA5890(DmChar00* this, GlobalContext* globalCtx) {
+ if ((DMCHAR00_GET(&this->actor) == DMCHAR00_0) && (globalCtx->csCtx.frames == 20)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA5EBC.s")
+void func_80AA58CC(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ if (globalCtx->csCtx.frames == 568) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ }
+ } else {
+ switch (globalCtx->csCtx.frames) {
+ case 375:
+ case 479:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/DmChar00_Init.s")
+ case 534:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK);
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/DmChar00_Destroy.s")
+void func_80AA5950(DmChar00* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA62FC.s")
+void func_80AA5960(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ if (globalCtx->csCtx.frames == 280) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ }
+ } else {
+ switch (globalCtx->csCtx.frames) {
+ case 87:
+ case 190:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA67F8.s")
+ case 244:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_ATTACK);
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA695C.s")
+void func_80AA59E4(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 125:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/DmChar00_Update.s")
+ case 1832:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON);
+ break;
+ }
+ } else if (globalCtx->csCtx.frames == 125) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/func_80AA6A6C.s")
+void func_80AA5A6C(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 44:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char00/DmChar00_Draw.s")
+ case 891:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_WHITE_OUT_INTO_MOON);
+ break;
+ }
+ } else if (globalCtx->csCtx.frames == 44) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ }
+}
+
+void func_80AA5AF4(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 352:
+ case 401:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+
+ case 440:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+
+ case 550:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE);
+ break;
+ }
+ } else {
+ switch (globalCtx->csCtx.frames) {
+ case 362:
+ case 401:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
+
+ case 454:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
+ }
+
+ if ((globalCtx->csCtx.frames >= 500) && (globalCtx->csCtx.frames < 602)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SHIVER - SFX_FLAG);
+ }
+ }
+}
+
+void func_80AA5BF8(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 762:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_SHOT_DASH);
+ break;
+ case 797:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+ }
+ } else {
+ switch (globalCtx->csCtx.frames) {
+ case 762:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_SHOT_DASH);
+ break;
+
+ case 797:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
+ }
+ }
+
+ if ((this->unk_261 == 53) && Animation_OnFrame(&this->skelAnime, 16.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ }
+}
+
+void func_80AA5CD4(DmChar00* this, GlobalContext* globalCtx) {
+ if ((DMCHAR00_GET(&this->actor) != DMCHAR00_0) && (globalCtx->csCtx.frames == 467)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ }
+}
+
+void func_80AA5D10(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 8:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ break;
+
+ case 130:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH);
+ break;
+ }
+ }
+}
+
+void func_80AA5D6C(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 2:
+ case 166:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+
+ case 31:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIRY_SURPRISE);
+ break;
+ }
+ }
+}
+
+void func_80AA5DC8(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_0) {
+ switch (globalCtx->csCtx.frames) {
+ case 233:
+ case 415:
+ case 593:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+
+ case 130:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_NAVY_VANISH);
+ break;
+ }
+ }
+}
+
+void func_80AA5E2C(DmChar00* this, GlobalContext* globalCtx) {
+ if (DMCHAR00_GET(&this->actor) == DMCHAR00_1) {
+ switch (globalCtx->csCtx.frames) {
+ case 32:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
+ break;
+
+ case 42:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BLACK_FAIRY_DASH);
+ break;
+
+ case 192:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BELL_BRAKE);
+ break;
+
+ case 215:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WEED);
+ break;
+ }
+ }
+}
+
+void func_80AA5EBC(DmChar00* this, GlobalContext* globalCtx) {
+ if (globalCtx->csCtx.state != 0) {
+ switch (globalCtx->sceneNum) {
+ case SCENE_LOST_WOODS:
+ if (gSaveContext.sceneSetupIndex == 1) {
+ func_80AA561C(this, globalCtx);
+ }
+ break;
+
+ case SCENE_OPENINGDAN:
+ if (gSaveContext.sceneSetupIndex == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AA5720(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
+ func_80AA575C(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 2) {
+ func_80AA5890(this, globalCtx);
+ }
+ }
+ break;
+
+ case SCENE_OKUJOU:
+ if (gSaveContext.sceneSetupIndex == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AA58CC(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
+ func_80AA5950(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 2) {
+ func_80AA5960(this, globalCtx);
+ }
+ } else if (gSaveContext.sceneSetupIndex == 2) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AA59E4(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
+ func_80AA5A6C(this, globalCtx);
+ }
+ }
+ break;
+
+ case SCENE_00KEIKOKU:
+ if (gSaveContext.sceneSetupIndex == 3) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AA5AF4(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 2) {
+ func_80AA5E2C(this, globalCtx);
+ }
+ } else if (gSaveContext.sceneSetupIndex == 7) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AA5BF8(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
+ func_80AA5CD4(this, globalCtx);
+ }
+ }
+ break;
+
+ case SCENE_MITURIN:
+ if ((gSaveContext.sceneSetupIndex == 0) && (globalCtx->csCtx.currentCsIndex == 1)) {
+ func_80AA5DC8(this, globalCtx);
+ }
+ break;
+
+ case SCENE_INSIDETOWER:
+ if ((gSaveContext.sceneSetupIndex == 0) && (globalCtx->csCtx.currentCsIndex == 0)) {
+ func_80AA5D10(this, globalCtx);
+ }
+ break;
+
+ case SCENE_PIRATE:
+ if ((gSaveContext.sceneSetupIndex == 0) && (globalCtx->csCtx.currentCsIndex == 0)) {
+ func_80AA5D6C(this, globalCtx);
+ }
+ break;
+ }
+ }
+}
+
+void DmChar00_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ DmChar00* this = THIS;
+
+ if ((globalCtx->sceneNum == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(globalCtx)) {
+ Actor_MarkForDeath(thisx);
+ }
+
+ this->unk_240 = D_80AA77A8[DMCHAR00_GET(thisx)];
+ this->unk_250 = D_80AA77D8[DMCHAR00_GET(thisx)];
+
+ thisx->targetArrowOffset = 3000.0f;
+ this->unk_260 = 99;
+ this->unk_262 = DMCHAR00_GET_F800(thisx);
+
+ ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140,
+ this->jointTable, this->morphTable, 7);
+ ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f);
+ func_80AA5580(&this->skelAnime, sAnimations, 0);
+ Actor_SetScale(thisx, 0.01f);
+ this->actionFunc = func_80AA67F8;
+}
+
+void DmChar00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
+
+void func_80AA62FC(DmChar00* this, GlobalContext* globalCtx) {
+ u16 sp26 = DMCHAR00_GET(&this->actor) + 113;
+ s32 temp_v0;
+ s32 pad;
+
+ if (Cutscene_CheckActorAction(globalCtx, sp26)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, sp26);
+
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[temp_v0]->startFrame) {
+ if (this->unk_260 != globalCtx->csCtx.actorActions[temp_v0]->action) {
+ this->unk_260 = globalCtx->csCtx.actorActions[temp_v0]->action;
+
+ switch (globalCtx->csCtx.actorActions[temp_v0]->action) {
+ case 0x1:
+ this->unk_261 = 0;
+ break;
+
+ case 0x2:
+ this->unk_261 = 2;
+ break;
+
+ case 0x3:
+ this->unk_261 = 3;
+ break;
+
+ case 0x4:
+ this->unk_261 = 4;
+ break;
+
+ case 0x5:
+ this->unk_261 = 5;
+ break;
+
+ case 0x6:
+ this->unk_261 = 6;
+ break;
+
+ case 0x7:
+ this->unk_261 = 7;
+ break;
+
+ case 0x8:
+ this->unk_261 = 20;
+ break;
+
+ case 0x9:
+ this->unk_261 = 21;
+ break;
+
+ case 0xA:
+ this->unk_261 = 14;
+ break;
+
+ case 0xB:
+ this->unk_261 = 15;
+ break;
+
+ case 0xC:
+ this->unk_261 = 18;
+ break;
+
+ case 0xD:
+ this->unk_261 = 25;
+ break;
+
+ case 0xE:
+ this->unk_261 = 27;
+ break;
+
+ case 0xF:
+ this->unk_261 = 24;
+ break;
+
+ case 0x10:
+ this->unk_261 = 10;
+ break;
+
+ case 0x11:
+ this->unk_261 = 12;
+ break;
+
+ case 0x12:
+ this->unk_261 = 13;
+ break;
+
+ case 0x13:
+ this->unk_261 = 29;
+ break;
+
+ case 0x14:
+ this->unk_261 = 31;
+ break;
+
+ case 0x15:
+ this->unk_261 = 33;
+ break;
+
+ case 0x16:
+ Actor_MarkForDeath(&this->actor);
+ break;
+
+ case 0x17:
+ this->unk_261 = 35;
+ break;
+
+ case 0x18:
+ this->unk_261 = 37;
+ break;
+
+ case 0x19:
+ this->unk_261 = 39;
+ break;
+
+ case 0x1A:
+ this->unk_261 = 41;
+ break;
+
+ case 0x1B:
+ this->unk_261 = 45;
+ break;
+
+ case 0x1C:
+ this->unk_261 = 46;
+ break;
+
+ case 0x1E:
+ this->unk_261 = 48;
+ break;
+
+ case 0x1F:
+ this->unk_261 = 50;
+ break;
+
+ case 0x20:
+ this->unk_261 = 52;
+ break;
+
+ case 0x21:
+ this->unk_261 = 53;
+ break;
+
+ case 0x23:
+ this->unk_261 = 55;
+ break;
+
+ case 0x24:
+ this->unk_261 = 57;
+ break;
+
+ case 0x25:
+ this->unk_261 = 58;
+ break;
+
+ case 0x26:
+ this->unk_261 = 59;
+ break;
+
+ case 0x27:
+ this->unk_261 = 61;
+ break;
+
+ case 0x28:
+ this->unk_261 = 62;
+ break;
+
+ case 0x29:
+ this->unk_261 = 64;
+ break;
+
+ case 0x2A:
+ this->unk_261 = 66;
+ break;
+
+ case 0x2B:
+ this->unk_261 = 68;
+ break;
+
+ case 0x2C:
+ this->unk_261 = 69;
+ break;
+
+ case 0x2D:
+ this->unk_261 = 70;
+ break;
+
+ case 0x2E:
+ this->unk_261 = 67;
+ break;
+
+ case 0x2F:
+ this->unk_261 = 71;
+ break;
+
+ case 0x30:
+ this->unk_261 = 73;
+ break;
+
+ case 0x31:
+ this->unk_261 = 74;
+ break;
+
+ case 0x32:
+ this->unk_261 = 75;
+ break;
+
+ case 0x33:
+ this->unk_261 = 77;
+ break;
+
+ case 0x34:
+ this->unk_261 = 78;
+ break;
+
+ case 0x35:
+ this->unk_261 = 79;
+ break;
+
+ case 0x36:
+ this->unk_261 = 80;
+ break;
+
+ case 0x37:
+ this->unk_261 = 82;
+ break;
+
+ case 0x38:
+ this->unk_261 = 83;
+ break;
+
+ default:
+ this->unk_261 = 0;
+ break;
+ }
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ }
+ }
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
+ } else {
+ this->unk_260 = 99;
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ switch (this->unk_261) {
+ case 0x4:
+ case 0x5:
+ this->unk_261 += 4;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ this->skelAnime.curFrame = 37.0f;
+ break;
+
+ case 0xE:
+ case 0xF:
+ case 0x14:
+ case 0x15:
+ this->unk_261 += 2;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ break;
+
+ case 0xA:
+ case 0x12:
+ case 0x19:
+ case 0x1B:
+ case 0x1D:
+ case 0x1F:
+ case 0x21:
+ case 0x23:
+ case 0x25:
+ case 0x27:
+ case 0x2B:
+ case 0x2E:
+ case 0x30:
+ case 0x32:
+ case 0x35:
+ case 0x37:
+ case 0x3B:
+ case 0x3E:
+ case 0x40:
+ case 0x42:
+ case 0x47:
+ case 0x4B:
+ case 0x50:
+ case 0x53:
+ this->unk_261 += 1;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ break;
+
+ case 0x2D:
+ this->unk_261 = 19;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ break;
+
+ case 0x46:
+ case 0x4D:
+ this->unk_261 = 0;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ break;
+ }
+ }
+}
+
+void func_80AA67F8(DmChar00* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((globalCtx->csCtx.state == 0) && (gSaveContext.sceneSetupIndex == 0) &&
+ (globalCtx->csCtx.currentCsIndex == 1)) {
+ if (this->unk_261 != 42) {
+ this->unk_261 = 42;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ }
+
+ Math_SmoothStepToF(&this->actor.world.pos.x, 0.0f, 0.5f, 0.5f, 0.001f);
+ Math_SmoothStepToF(&this->actor.world.pos.y, 30.0f, 0.5f, 0.5f, 0.001f);
+ Math_SmoothStepToF(&this->actor.world.pos.z, -560.0f, 0.5f, 20.0f, 0.001f);
+
+ if (player->actor.world.pos.z < -625.0f) {
+ this->unk_261 = 43;
+ func_80AA5580(&this->skelAnime, &sAnimations[this->unk_261], 0);
+ this->actionFunc = func_80AA695C;
+ this->skelAnime.playSpeed = 1.5f;
+ }
+ }
+}
+
+void func_80AA695C(DmChar00* this, GlobalContext* globalCtx) {
+ if (this->unk_261 == 44) {
+ Math_SmoothStepToF(&this->actor.world.pos.x, 0.0f, 0.5f, 0.5f, 0.001f);
+ Math_SmoothStepToF(&this->actor.world.pos.y, 30.0f, 0.5f, 0.5f, 0.001f);
+ Math_SmoothStepToF(&this->actor.world.pos.z, -680.0f, 0.5f, 10.0f, 0.001f);
+ }
+}
+
+void DmChar00_Update(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar00* this = THIS;
+
+ SkelAnime_Update(&this->skelAnime);
+
+ this->actionFunc(this, globalCtx);
+
+ this->unk_262++;
+ func_80AA5EBC(this, globalCtx);
+ func_80AA62FC(this, globalCtx);
+}
+
+s32 DmChar00_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx, Gfx** gfx) {
+ DmChar00* this = THIS;
+ f32 sp28;
+ Vec3f sp1C;
+
+ if (limbIndex == 6) {
+ sp28 = ((Math_SinS(this->unk_262 * 0x1000) * 0.1f) + 1.0f) * 0.012f * (this->actor.scale.x * 124.99999f);
+ Matrix_MultiplyVector3fByState(&D_80AA7808, &sp1C);
+ Matrix_InsertTranslation(sp1C.x, sp1C.y, sp1C.z, MTXMODE_NEW);
+ Matrix_Scale(sp28, sp28, sp28, MTXMODE_APPLY);
+ }
+ return false;
+}
+
+void DmChar00_Draw(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ DmChar00* this = THIS;
+ s32 phi_a0;
+ s32 pad;
+ Gfx* gfx = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 4);
+
+ if ((globalCtx->csCtx.state == 0) &&
+ ((globalCtx->sceneNum != SCENE_OPENINGDAN) || (gSaveContext.sceneSetupIndex != 0) ||
+ (globalCtx->roomCtx.currRoom.num != 0) || (globalCtx->csCtx.currentCsIndex != 1) ||
+ (DMCHAR00_GET(&this->actor) != DMCHAR00_0))) {
+ return;
+ }
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C94C(globalCtx->state.gfxCtx);
+
+ do {
+ phi_a0 = (this->unk_262 * 50) & 511;
+ if (phi_a0 >= 256) {
+ phi_a0 = 511 - phi_a0;
+ }
+ } while (0);
+
+ gSPSegment(POLY_XLU_DISP++, 0x08, &gfx[0]);
+
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0x01, (u8)this->unk_240.unk_00, (u8)this->unk_240.unk_04, (u8)this->unk_240.unk_08,
+ (u8)(this->unk_240.unk_0C * 1));
+ gDPSetRenderMode(gfx++, G_RM_PASS, G_RM_ZB_CLD_SURF2);
+ gSPEndDisplayList(gfx);
+
+ gDPSetEnvColor(POLY_XLU_DISP++, (u8)(s8)this->unk_250.unk_00, (u8)(s8)this->unk_250.unk_04,
+ (u8)(s8)this->unk_250.unk_08, (u8)(s8)((f32)phi_a0 * 1));
+ gDPSetDither(POLY_XLU_DISP++, G_CD_BAYER);
+
+ POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ DmChar00_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h
index 0bc9b9d0a7..52adfe794b 100644
--- a/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h
+++ b/src/overlays/actors/ovl_Dm_Char00/z_dm_char00.h
@@ -7,11 +7,32 @@ struct DmChar00;
typedef void (*DmChar00ActionFunc)(struct DmChar00*, GlobalContext*);
+#define DMCHAR00_GET(thisx) ((thisx)->params)
+#define DMCHAR00_GET_F800(thisx) ((thisx)->params << 0xB)
+
+#define DMCHAR00_0 0
+#define DMCHAR00_1 1
+
+typedef struct {
+ /* 0x00 */ f32 unk_00;
+ /* 0x04 */ f32 unk_04;
+ /* 0x08 */ f32 unk_08;
+ /* 0x0C */ f32 unk_0C;
+} DmChar00Struct; // size = 0x10
+
typedef struct DmChar00 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xF8];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[7];
+ /* 0x01B2 */ UNK_TYPE1 unk_1B2[0x30];
+ /* 0x01E2 */ Vec3s morphTable[7];
+ /* 0x020C */ UNK_TYPE1 unk_20C[0x30];
/* 0x023C */ DmChar00ActionFunc actionFunc;
- /* 0x0240 */ char unk_240[0x24];
+ /* 0x0240 */ DmChar00Struct unk_240;
+ /* 0x0250 */ DmChar00Struct unk_250;
+ /* 0x0260 */ u8 unk_260;
+ /* 0x0261 */ u8 unk_261;
+ /* 0x0262 */ u16 unk_262;
} DmChar00; // size = 0x264
extern const ActorInit Dm_Char00_InitVars;
diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
index cf2d8b03b6..959207b8d5 100644
--- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
+++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_char01.h"
+#include "objects/object_mtoride/object_mtoride.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((DmChar01*)thisx)
@@ -15,7 +16,24 @@ void DmChar01_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DmChar01_Update(Actor* thisx, GlobalContext* globalCtx);
void DmChar01_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80AA8698(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA884C(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA88A8(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA892C(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA8C28(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA8F1C(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA8F2C(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA9020(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA90AC(DmChar01* this, GlobalContext* globalCtx);
+void func_80AA90F4(DmChar01* this, GlobalContext* globalCtx);
+
+s16 D_80AAAE20;
+s16 D_80AAAE22;
+s16 D_80AAAE24;
+s16 D_80AAAE26;
+
+#include "overlays/ovl_Dm_Char01/ovl_Dm_Char01.c"
+
const ActorInit Dm_Char01_InitVars = {
ACTOR_DM_CHAR01,
ACTORCAT_ITEMACTION,
@@ -28,44 +46,501 @@ const ActorInit Dm_Char01_InitVars = {
(ActorFunc)DmChar01_Draw,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80AAAAB0[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneScale, 300, ICHAIN_STOP),
};
-#endif
+s16 D_80AAAAB4 = false;
-extern InitChainEntry D_80AAAAB0[];
+void DmChar01_Init(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar01* this = THIS;
+ s32 i;
-extern UNK_TYPE D_06009E4C;
-extern UNK_TYPE D_0600AA50;
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ Actor_SetScale(&this->dyna.actor, 1.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/DmChar01_Init.s")
+ this->unk_346 = 0;
+ this->unk_34D = false;
+ D_80AAAE24 = 0;
+ D_80AAAE26 = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/DmChar01_Destroy.s")
+ switch (DMCHAR01_GET(&this->dyna.actor)) {
+ case DMCHAR01_0:
+ if (gSaveContext.weekEventReg[20] & 2) {
+ this->unk_34C = 2;
+ this->actionFunc = func_80AA8F1C;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA8698.s")
+ if (gSaveContext.sceneSetupIndex == 0) {
+ globalCtx->envCtx.unk_1F = 5;
+ globalCtx->envCtx.unk_20 = 5;
+ }
+ this->unk_348 = 255.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA884C.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_1AC); i++) {
+ this->unk_1AC[i] = ovl_dm_char01_Vtx_1BE0[i].v.ob[1] * 409.6f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA88A8.s")
+ DynaPolyActor_Init(&this->dyna, 0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mtoride_Colheader_009E4C);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA892C.s")
+ this->unk_34D = true;
+ if (gSaveContext.sceneSetupIndex == 1) {
+ this->unk_34C = 1;
+ this->actionFunc = func_80AA8C28;
+ } else {
+ this->unk_34C = 0;
+ this->actionFunc = func_80AA892C;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA8C28.s")
+ case DMCHAR01_1:
+ if ((gSaveContext.weekEventReg[20] & 2) || (gSaveContext.sceneSetupIndex == 1)) {
+ this->unk_34C = 1;
+ this->actionFunc = func_80AA8F1C;
+ } else {
+ this->actionFunc = func_80AA8698;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA8F0C.s")
+ case DMCHAR01_2:
+ this->unk_34C = 0;
+ if (!(gSaveContext.weekEventReg[20] & 1)) {
+ this->unk_34C = 1;
+ this->dyna.actor.world.pos.y -= 400.0f;
+ }
+ this->dyna.actor.world.rot.y += 0x8000;
+ this->dyna.actor.shape.rot.y += 0x8000;
+ DynaPolyActor_Init(&this->dyna, 0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mtoride_Colheader_010C3C);
+ this->unk_34D = true;
+ this->unk_348 = 200.0f;
+ this->actionFunc = func_80AA8F2C;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA8F1C.s")
+ case DMCHAR01_3:
+ this->dyna.actor.world.rot.y += 0x8000;
+ this->dyna.actor.shape.rot.y += 0x8000;
+ if (!(gSaveContext.weekEventReg[20] & 1)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA8F2C.s")
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ETCETERA, 5.0f, 202.0f, 294.0f, 0, 0, 0, 0x80);
+ DynaPolyActor_Init(&this->dyna, 0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mtoride_Colheader_00FE5C);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA9020.s")
+ this->unk_34D = true;
+ if (!(gSaveContext.weekEventReg[20] & 2)) {
+ this->actionFunc = func_80AA9020;
+ this->dyna.actor.world.pos.y -= 120.0f;
+ } else {
+ this->actionFunc = func_80AA8F1C;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA90AC.s")
+ default:
+ this->actionFunc = func_80AA88A8;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/func_80AA90F4.s")
+void DmChar01_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar01* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/DmChar01_Update.s")
+ if (this->unk_34D) {
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char01/DmChar01_Draw.s")
+void func_80AA8698(DmChar01* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Player* player2 = GET_PLAYER(globalCtx);
+
+ if (gSaveContext.weekEventReg[20] & 1) {
+ return;
+ }
+
+ if ((player->stateFlags2 & 0x8000000) && (player2->actor.world.pos.x > -40.0f) &&
+ (player2->actor.world.pos.x < 40.0f) && (player2->actor.world.pos.z > 1000.0f) &&
+ (player2->actor.world.pos.z < 1078.0f)) {
+ if (!D_80AAAAB4) {
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ D_80AAAAB4 = true;
+ }
+ } else {
+ D_80AAAAB4 = false;
+ }
+
+ if ((player->transformation == PLAYER_FORM_DEKU) && (globalCtx->msgCtx.ocarinaMode == 3) &&
+ (globalCtx->msgCtx.unk1202E == 0)) {
+
+ if ((player2->actor.world.pos.x > -40.0f) && (player2->actor.world.pos.x < 40.0f) &&
+ (player2->actor.world.pos.z > 1000.0f) && (player2->actor.world.pos.z < 1078.0f)) {
+ gSaveContext.weekEventReg[20] |= 1;
+ this->actionFunc = func_80AA884C;
+ }
+ }
+}
+
+void func_80AA884C(DmChar01* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->dyna.actor.cutscene;
+
+ if (ActorCutscene_GetCanPlayNext(sp1E)) {
+ ActorCutscene_Start(sp1E, &this->dyna.actor);
+ this->actionFunc = func_80AA88A8;
+ } else {
+ ActorCutscene_SetIntentToPlay(sp1E);
+ }
+}
+
+void func_80AA88A8(DmChar01* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 135)) {
+ if (globalCtx->csCtx.frames ==
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 135)]->startFrame) {
+ D_80AAAE24 = 1;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_FORT_RISING);
+ }
+ } else {
+ D_80AAAE24 = 0;
+ }
+}
+
+void func_80AA892C(DmChar01* this, GlobalContext* globalCtx) {
+ f32 temp_f18;
+ s32 temp_v0_4;
+ s32 i;
+
+ switch (this->unk_346) {
+ case 0:
+ D_80AAAE22 = -2200;
+ D_80AAAE20 = 380;
+ this->unk_346++;
+ break;
+
+ case 1:
+ if (D_80AAAE24 != 0) {
+ this->unk_34C = 1;
+ if (D_80AAAE22 > -2000) {
+ D_80AAAE26 = 1;
+ }
+
+ D_80AAAE22 += 40;
+ if (D_80AAAE22 > 3400) {
+ if (D_80AAAE20 > 100) {
+ D_80AAAE20 -= 230;
+ }
+ this->unk_346++;
+ }
+ }
+ break;
+
+ case 2:
+ D_80AAAE22 -= 40;
+ if (D_80AAAE22 <= -2200) {
+ if (D_80AAAE20 > 100) {
+ D_80AAAE20 -= 70;
+ }
+ this->unk_346--;
+ }
+ break;
+ }
+
+ if (D_80AAAE24 == 0) {
+ this->unk_34C = 0;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(ovl_dm_char01_Vtx_1BE0); i++) {
+ s32 temp_s2 = sqrtf(SQ((f32)ovl_dm_char01_Vtx_1BE0[i].v.ob[2]) + SQ((f32)ovl_dm_char01_Vtx_1BE0[i].v.ob[0]));
+ f32 cos = Math_CosS((temp_s2 / 1892.0f) * 0x4000);
+ f32 temp_f20 = (1.0f - (ABS_ALT(temp_s2 - D_80AAAE22) / 1892.0f)) * D_80AAAE20 * cos;
+
+ if (temp_f20 < 0.0f) {
+ temp_f20 = 0.0f;
+ }
+
+ temp_f18 = Math_SinS(this->unk_1AC[i]) * 15.0f;
+ temp_f20 += temp_f18;
+
+ this->unk_1AC[i] += 1600;
+ ovl_dm_char01_Vtx_1BE0[i].v.ob[1] = temp_f20;
+ }
+}
+
+void func_80AA8C28(DmChar01* this, GlobalContext* globalCtx) {
+ f32 temp_f18;
+ s32 temp_v0_4;
+ s32 i;
+
+ switch (this->unk_346) {
+ case 0:
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WATER_PURIFICATION);
+ D_80AAAE22 = -2200;
+ D_80AAAE20 = 100;
+ this->unk_346++;
+ break;
+
+ case 1:
+ D_80AAAE22 += 40;
+ if (D_80AAAE22 > 3400) {
+ this->unk_346++;
+ }
+ break;
+
+ case 2:
+ D_80AAAE22 -= 40;
+ if (D_80AAAE22 <= -2200) {
+ this->unk_346--;
+ }
+ break;
+ }
+
+ for (i = 0; i < ARRAY_COUNT(ovl_dm_char01_Vtx_1BE0); i++) {
+ s32 temp_s2 = sqrtf(SQ((f32)ovl_dm_char01_Vtx_1BE0[i].v.ob[2]) + SQ((f32)ovl_dm_char01_Vtx_1BE0[i].v.ob[0]));
+ f32 cos = Math_CosS((temp_s2 / 1892.0f) * 0x4000);
+ f32 temp_f20 = (1.0f - (ABS_ALT(temp_s2 - D_80AAAE22) / 1892.0f)) * D_80AAAE20 * cos;
+
+ if (temp_f20 < 0.0f) {
+ temp_f20 = 0.0f;
+ }
+
+ temp_f18 = Math_SinS(this->unk_1AC[i]) * 15.0f;
+ temp_f20 += temp_f18;
+
+ this->unk_1AC[i] += 1600;
+ ovl_dm_char01_Vtx_1BE0[i].v.ob[1] = temp_f20;
+ }
+
+ Math_SmoothStepToF(&this->unk_348, 0.0f, 0.02f, 0.6f, 0.4f);
+
+ if (this->unk_348 < 0.01f) {
+ this->unk_34C = 2;
+ this->actionFunc = func_80AA8F1C;
+ }
+}
+
+void func_80AA8F0C(DmChar01* this, GlobalContext* globalCtx) {
+}
+
+void func_80AA8F1C(DmChar01* this, GlobalContext* globalCtx) {
+}
+
+void func_80AA8F2C(DmChar01* this, GlobalContext* globalCtx) {
+ if (D_80AAAE26 != 0) {
+ Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 0.0f, 0.05f, 6.0f, 0.001f);
+ Math_SmoothStepToF(&this->unk_348, 0.0f, 0.01f, 0.5f, 0.4f);
+ if ((s32)this->dyna.actor.world.pos.y >= 0) {
+ D_80AAAE26 = 2;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ETCETERA, 5.0f, 202.0f, 294.0f, 0, 0, 0, 0x80);
+ this->actionFunc = func_80AA90F4;
+ }
+ }
+ func_80AA8F0C(this, globalCtx);
+}
+
+void func_80AA9020(DmChar01* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 135)) {
+ CsCmdActorAction* temp_v1 = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 135)];
+
+ if ((temp_v1->startFrame == globalCtx->csCtx.frames) && (temp_v1->action == 2)) {
+ gSaveContext.weekEventReg[20] |= 2;
+ this->actionFunc = func_80AA90AC;
+ }
+ }
+}
+
+void func_80AA90AC(DmChar01* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToF(&this->dyna.actor.world.pos.y, 0.0f, 0.05f, 2.0f, 0.001f);
+}
+
+void func_80AA90F4(DmChar01* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToF(&this->unk_348, 0.0f, 0.02f, 0.8f, 0.4f);
+}
+
+void DmChar01_Update(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ DmChar01* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_34D) {
+ if (DMCHAR01_GET(&this->dyna.actor) == DMCHAR01_0) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (player->actor.world.pos.y > 5.0f) {
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ } else {
+ func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ }
+ }
+
+ if (DMCHAR01_GET(&this->dyna.actor) == DMCHAR01_2) {
+ if (this->dyna.actor.xzDistToPlayer > 600.0f) {
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ } else {
+ func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ }
+ }
+ }
+}
+
+void DmChar01_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static f32 D_80AAAAB8 = 0.0f;
+ static f32 D_80AAAABC = 0.0f;
+ static s16 D_80AAAAC0 = 0;
+ static s16 D_80AAAAC4 = 0;
+ static s16 D_80AAAAC8 = 0;
+ static s16 D_80AAAACC = 0;
+ DmChar01* this = THIS;
+ f32 temp_f12;
+ f32 spBC;
+ s32 i;
+ u8 spB7 = false;
+
+ switch (DMCHAR01_GET(thisx)) {
+ case DMCHAR01_0:
+ switch (this->unk_34C) {
+ case 0:
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_00AA50));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_00A8F8);
+ break;
+
+ case 1:
+ if (gSaveContext.sceneSetupIndex == 1) {
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_0110B8));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_010FD8);
+ Gfx_DrawDListXlu(globalCtx, object_mtoride_DL_010EF0);
+ Matrix_InsertTranslation(0.0f, 10.0f, 0.0f, MTXMODE_APPLY);
+ }
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_009D70));
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if ((u8)this->unk_348 == 255) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x96, 255, 255, 255, 255);
+ gSPSegment(POLY_OPA_DISP++, 0x0B, Lib_SegmentedToVirtual(ovl_dm_char01_Vtx_1BE0));
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_mtoride_DL_009928);
+ } else {
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2);
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, (u8)this->unk_348);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x96, 255, 255, 255, (u8)this->unk_348);
+ gSPSegment(POLY_XLU_DISP++, 0x0B, Lib_SegmentedToVirtual(ovl_dm_char01_Vtx_1BE0));
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_mtoride_DL_009928);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ break;
+
+ case 2:
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_0110B8));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_010FD8);
+ Gfx_DrawDListXlu(globalCtx, object_mtoride_DL_010EF0);
+ break;
+ }
+ break;
+
+ case DMCHAR01_1:
+ switch (this->unk_34C) {
+ case 0:
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_00A5C0));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_00A398);
+ break;
+
+ case 1:
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_00B1A0));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_00AF98);
+ break;
+ }
+ break;
+
+ case DMCHAR01_2:
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_00FE90));
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_00DF18);
+
+ if ((this->unk_34C != 0) && ((u8)this->unk_348 != 0)) {
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_mtoride_Matanimheader_00F768));
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, (u8)this->unk_348);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, (u8)this->unk_348);
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_mtoride_DL_00F3C0);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if (D_80AAAE24 != 0) {
+ if ((D_80AAAE22 > -1800) && (D_80AAAE22 < 3000)) {
+ temp_f12 = D_80AAAE22 - 640.0f;
+ if ((D_80AAAE20 == 380) && (D_80AAAE22 > 640)) {
+ D_80AAAAC0 = 2;
+ D_80AAAAC4 = 0;
+ D_80AAAAC8 = 900;
+ D_80AAAACC = 700;
+ spB7 = true;
+ if (D_80AAAE22 < 1350) {
+ f32 temp_f0 = temp_f12 / 2000.0f;
+
+ D_80AAAAB8 = 420.0f - (420.0f * temp_f0);
+ D_80AAAABC = (200.0f * temp_f0) + 200.0f;
+ } else {
+ f32 temp_f0 = temp_f12 / 2000.0f;
+
+ D_80AAAAB8 = 420.0f - (420.0f * temp_f0);
+ D_80AAAABC = 400.0f;
+ }
+ }
+ }
+
+ if (spB7) {
+ for (i = 0; i < D_80AAAAC0 * 2; i++) {
+ Vec3f sp44;
+ f32 phi_f2 = D_80AAAABC;
+ s16 temp;
+
+ spBC = Rand_ZeroOne() * D_80AAAAC8;
+ if ((globalCtx->state.frames % 2) != 0) {
+ sp44.x = (Rand_ZeroOne() - 0.5f) * (2.0f * phi_f2);
+ sp44.y = D_80AAAAB8;
+ sp44.z = (Rand_ZeroOne() * D_80AAAAC4) + phi_f2;
+ temp = (s16)spBC + D_80AAAACC;
+ EffectSsGSplash_Spawn(globalCtx, &sp44, NULL, NULL, 0, temp);
+ } else {
+ sp44.x = -phi_f2 - (Rand_ZeroOne() * D_80AAAAC4);
+ sp44.y = D_80AAAAB8;
+ sp44.z = (Rand_ZeroOne() - 0.5f) * (2.0f * phi_f2);
+ temp = (s16)spBC + D_80AAAACC;
+ EffectSsGSplash_Spawn(globalCtx, &sp44, NULL, NULL, 0, temp);
+ }
+ }
+ }
+ }
+
+ Gfx_DrawDListXlu(globalCtx, object_mtoride_DL_00DE50);
+ break;
+
+ case DMCHAR01_3:
+ if (thisx->world.pos.y > -120.0f) {
+ Gfx_DrawDListOpa(globalCtx, object_mtoride_DL_00FAE8);
+ }
+ break;
+ }
+}
diff --git a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h
index a0d4fb3363..b2c235f561 100644
--- a/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h
+++ b/src/overlays/actors/ovl_Dm_Char01/z_dm_char01.h
@@ -7,11 +7,25 @@ struct DmChar01;
typedef void (*DmChar01ActionFunc)(struct DmChar01*, GlobalContext*);
+#define DMCHAR01_GET(thisx) ((thisx)->params)
+
+enum {
+ /* 0 */ DMCHAR01_0,
+ /* 1 */ DMCHAR01_1,
+ /* 2 */ DMCHAR01_2,
+ /* 3 */ DMCHAR01_3,
+};
+
typedef struct DmChar01 {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x5C];
+ /* 0x0000 */ DynaPolyActor dyna;
+ /* 0x015C */ UNK_TYPE1 unk15C[0x44];
/* 0x01A0 */ DmChar01ActionFunc actionFunc;
- /* 0x01A4 */ char unk_1A4[0x1AC];
+ /* 0x01A4 */ UNK_TYPE1 unk1A4[0x8];
+ /* 0x01AC */ s16 unk_1AC[205];
+ /* 0x0346 */ s16 unk_346;
+ /* 0x0348 */ f32 unk_348;
+ /* 0x034C */ u8 unk_34C;
+ /* 0x034D */ u8 unk_34D;
} DmChar01; // size = 0x350
extern const ActorInit Dm_Char01_InitVars;
diff --git a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c
index 116b2732d0..72258b70bf 100644
--- a/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c
+++ b/src/overlays/actors/ovl_Dm_Char02/z_dm_char02.c
@@ -6,7 +6,7 @@
#include "z_dm_char02.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar02*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c
index b5e6c87429..1508f95a21 100644
--- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c
+++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c
@@ -6,7 +6,7 @@
#include "z_dm_char03.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar03*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
index e2c72238e3..eff96b7e50 100644
--- a/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
+++ b/src/overlays/actors/ovl_Dm_Char04/z_dm_char04.c
@@ -6,7 +6,7 @@
#include "z_dm_char04.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar04*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c
index 1f61d302fe..956f7317c1 100644
--- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c
+++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_char05.h"
+#include "objects/object_dmask/object_dmask.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar05*)thisx)
@@ -28,8 +29,12 @@ void func_80AACD1C(DmChar05* this, GlobalContext* globalCtx);
void func_80AACD68(DmChar05* this, GlobalContext* globalCtx);
void func_80AACE10(DmChar05* this, GlobalContext* globalCtx);
void func_80AACE5C(DmChar05* this, GlobalContext* globalCtx);
+void func_80AADD9C(GlobalContext* globalCtx, DmChar05* this);
+void func_80AADE78(GlobalContext* globalCtx, DmChar05* this);
+void func_80AADF54(GlobalContext* globalCtx, DmChar05* this);
+void func_80AAE030(GlobalContext* globalCtx, DmChar05* this);
+void func_80AAE114(GlobalContext* globalCtx, DmChar05* this);
-#if 0
const ActorInit Dm_Char05_InitVars = {
ACTOR_DM_CHAR05,
ACTORCAT_ITEMACTION,
@@ -42,86 +47,743 @@ const ActorInit Dm_Char05_InitVars = {
(ActorFunc)DmChar05_Draw,
};
-#endif
+static AnimationInfo sAnimations[] = {
+ { &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dmask_Anim_00017C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dmask_Anim_0011A0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dmask_Anim_0013A4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+};
-extern UNK_TYPE D_060001D0;
-extern UNK_TYPE D_060010B0;
-extern UNK_TYPE D_060013D0;
-extern UNK_TYPE D_06001E70;
-extern UNK_TYPE D_060042B0;
+void func_80AAC5A0(SkelAnime* skelAnime, AnimationInfo* animation, u16 arg2) {
+ f32 phi_f2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC5A0.s")
+ animation += arg2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC63C.s")
+ if (animation->frameCount < 0.0f) {
+ phi_f2 = Animation_GetLastFrame(animation->animation);
+ } else {
+ phi_f2 = animation->frameCount;
+ }
+ Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, phi_f2,
+ animation->mode, animation->morphFrames);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC6E4.s")
+void func_80AAC63C(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC770.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dmask_Skel_010B0, NULL, NULL, NULL, 0);
+ if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[0], 0);
+ } else {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0);
+ }
+ this->actionFunc = func_80AACC48;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC7FC.s")
+void func_80AAC6E4(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC888.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dmask_Skel_042B0, NULL, NULL, NULL, 0);
+ func_80AAC5A0(&this->skelAnime, &sAnimations[1], 0);
+ this->actionFunc = func_80AACC48;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/DmChar05_Init.s")
+void func_80AAC770(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/DmChar05_Destroy.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dmask_Skel_001D0, NULL, NULL, NULL, 0);
+ func_80AAC5A0(&this->skelAnime, &sAnimations[3], 0);
+ this->actionFunc = func_80AACC48;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC990.s")
+void func_80AAC7FC(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAC9DC.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dmask_Skel_013D0, NULL, NULL, NULL, 0);
+ func_80AAC5A0(&this->skelAnime, &sAnimations[4], 0);
+ this->actionFunc = func_80AACC48;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACA98.s")
+void func_80AAC888(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACAE4.s")
+ this->actionFunc = func_80AACA98;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACBE4.s")
+void DmChar05_Init(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACC48.s")
+ this->unk_18C = 0;
+ this->unk_18E = 0;
+ this->unk_19C = 0;
+ this->unk_1A0 = 0;
+ this->unk_1A4 = 0;
+ this->unk_1A8 = 0;
+ this->unk_1AC = 100;
+ this->unk_1B0 = 1000;
+ this->unk_1B4 = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACC6C.s")
+ switch (DMCHAR05_GET(&this->actor)) {
+ case DMCHAR05_0:
+ func_80AAC63C(thisx, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACCD4.s")
+ case DMCHAR05_1:
+ func_80AAC6E4(thisx, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACD0C.s")
+ case DMCHAR05_2:
+ func_80AAC770(thisx, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACD1C.s")
+ case DMCHAR05_3:
+ func_80AAC7FC(thisx, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACD68.s")
+ case DMCHAR05_4:
+ func_80AAC888(thisx, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACE10.s")
+ case DMCHAR05_5:
+ case DMCHAR05_6:
+ case DMCHAR05_7:
+ case DMCHAR05_8:
+ case DMCHAR05_9:
+ case DMCHAR05_10:
+ case DMCHAR05_11:
+ case DMCHAR05_12:
+ this->actionFunc = func_80AACBE4;
+ break;
+ }
+ Actor_SetScale(&this->actor, 0.01f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACE5C.s")
+void DmChar05_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AACF04.s")
+void func_80AAC990(DmChar05* this, GlobalContext* globalCtx) {
+ s32 objectIdx = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_GOLONMASK);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD3F8.s")
+ if (objectIdx >= 0) {
+ this->unk_18F = objectIdx;
+ this->actionFunc = func_80AAC9DC;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD450.s")
+void func_80AAC9DC(DmChar05* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 109) != 0) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 109);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD4A8.s")
+ if (globalCtx->csCtx.actorActions[actionIndex]->action == 4) {
+ this->unk_18E = 1;
+ this->unk_190.x = globalCtx->csCtx.actorActions[actionIndex]->startPos.x;
+ this->unk_190.y = globalCtx->csCtx.actorActions[actionIndex]->startPos.y;
+ this->unk_190.z = globalCtx->csCtx.actorActions[actionIndex]->startPos.z;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/DmChar05_Update.s")
+void func_80AACA98(DmChar05* this, GlobalContext* globalCtx) {
+ s32 objectIdx = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_MASK13);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD964.s")
+ if (objectIdx >= 0) {
+ this->unk_18F = objectIdx;
+ this->actionFunc = func_80AACAE4;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD980.s")
+void func_80AACAE4(DmChar05* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 564)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 564);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAD998.s")
+ if (globalCtx->csCtx.actorActions[actionIndex]->action == 2) {
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ Item_Give(globalCtx, ITEM_MASK_COUPLE);
+ }
+ this->unk_18E = 1;
+ this->unk_190.x = globalCtx->csCtx.actorActions[actionIndex]->startPos.x;
+ this->unk_190.y = globalCtx->csCtx.actorActions[actionIndex]->startPos.y;
+ this->unk_190.z = globalCtx->csCtx.actorActions[actionIndex]->startPos.z;
+ } else {
+ this->unk_18E = 0;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADA90.s")
+void func_80AACBE4(DmChar05* this, GlobalContext* globalCtx) {
+ static s16 D_80AAE2F0[] = {
+ OBJECT_GI_MASK17, OBJECT_GI_MASK14, OBJECT_GI_MASK10, OBJECT_GI_MASK21,
+ OBJECT_GI_MASK11, OBJECT_GI_MASK20, OBJECT_GI_RABIT_MASK, OBJECT_GI_MASK12,
+ };
+ s32 params = DMCHAR05_GET(&this->actor) - DMCHAR05_5;
+ s32 objectIdx = Object_GetIndex(&globalCtx->objectCtx, D_80AAE2F0[params]);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADB4C.s")
+ if (objectIdx >= 0) {
+ this->unk_18F = objectIdx;
+ this->actionFunc = func_80AACD0C;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADC00.s")
+void func_80AACC48(DmChar05* this, GlobalContext* globalCtx) {
+ if (this->unk_1B4 != 0) {
+ this->actionFunc = func_80AACC6C;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/DmChar05_Draw.s")
+void func_80AACC6C(DmChar05* this, GlobalContext* globalCtx) {
+ if (this->unk_19C < 247) {
+ this->unk_19C += 8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADD9C.s")
+ if (this->unk_1A0 < 247) {
+ this->unk_1A0 += 8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADE78.s")
+ if (this->unk_1A4 < 247) {
+ this->unk_1A4 += 8;
+ } else {
+ this->unk_19C = 255;
+ this->unk_1A0 = 255;
+ this->unk_1A4 = 255;
+ this->actionFunc = func_80AACCD4;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AADF54.s")
+void func_80AACCD4(DmChar05* this, GlobalContext* globalCtx) {
+ if (this->unk_1AC < 975) {
+ this->unk_1AC += 25;
+ } else {
+ this->unk_1AC = 996;
+ this->actionFunc = func_80AACD0C;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAE030.s")
+void func_80AACD0C(DmChar05* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Dm_Char05/func_80AAE114.s")
+void func_80AACD1C(DmChar05* this, GlobalContext* globalCtx) {
+ s32 objectIdx = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_ZORAMASK);
+
+ if (objectIdx >= 0) {
+ this->unk_18F = objectIdx;
+ this->actionFunc = func_80AACD68;
+ }
+}
+
+void func_80AACD68(DmChar05* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 473)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 473);
+
+ this->unk_18E = 1;
+ this->unk_190.x = globalCtx->csCtx.actorActions[actionIndex]->startPos.x;
+ this->unk_190.y = globalCtx->csCtx.actorActions[actionIndex]->startPos.y;
+ this->unk_190.z = globalCtx->csCtx.actorActions[actionIndex]->startPos.z;
+ }
+}
+
+void func_80AACE10(DmChar05* this, GlobalContext* globalCtx) {
+ s32 objectIdx = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_MASK15);
+
+ if (objectIdx >= 0) {
+ this->unk_18F = objectIdx;
+ this->actionFunc = func_80AACE5C;
+ }
+}
+
+void func_80AACE5C(DmChar05* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 518)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 518);
+
+ this->unk_18E = 1;
+ this->unk_190.x = globalCtx->csCtx.actorActions[actionIndex]->startPos.x;
+ this->unk_190.y = globalCtx->csCtx.actorActions[actionIndex]->startPos.y;
+ this->unk_190.z = globalCtx->csCtx.actorActions[actionIndex]->startPos.z;
+ }
+}
+
+void func_80AACF04(DmChar05* this, GlobalContext* globalCtx) {
+ u8 sp2F = true;
+ s32 actionIndex;
+
+ switch (DMCHAR05_GET(&this->actor)) {
+ case DMCHAR05_0:
+ if (Cutscene_CheckActorAction(globalCtx, 109)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 109);
+
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ sp2F = false;
+ break;
+
+ case 2:
+ this->unk_1B4 = 1;
+ break;
+
+ case 3:
+ this->unk_18C = 0;
+ break;
+
+ case 4:
+ Item_Give(globalCtx, ITEM_MASK_GORON);
+ sp2F = false;
+ this->actionFunc = func_80AAC990;
+ break;
+
+ case 5:
+ sp2F = false;
+ Actor_MarkForDeath(&this->actor);
+ break;
+
+ default:
+ sp2F = false;
+ break;
+ }
+
+ if (sp2F) {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
+ }
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ }
+ break;
+
+ case DMCHAR05_1:
+ if (Cutscene_CheckActorAction(globalCtx, 473)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 473);
+
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ sp2F = false;
+ break;
+
+ case 2:
+ this->unk_18C = 1;
+ this->unk_1B4 = 1;
+ break;
+
+ case 3:
+ this->unk_18C = 1;
+ break;
+
+ case 4:
+ Item_Give(globalCtx, ITEM_MASK_ZORA);
+ sp2F = false;
+ this->actionFunc = func_80AACD1C;
+ break;
+
+ case 5:
+ sp2F = false;
+ Actor_MarkForDeath(&this->actor);
+ break;
+
+ default:
+ sp2F = false;
+ break;
+ }
+
+ if (sp2F) {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
+ }
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ }
+ break;
+
+ case DMCHAR05_2:
+ if (Cutscene_CheckActorAction(globalCtx, 518)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 518);
+
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ sp2F = false;
+ break;
+
+ case 2:
+ this->unk_18C = 3;
+ break;
+
+ case 3:
+ this->unk_18C = 2;
+ break;
+
+ case 4:
+ Item_Give(globalCtx, ITEM_MASK_GIBDO);
+ sp2F = false;
+ this->actionFunc = func_80AACE10;
+ break;
+
+ case 5:
+ sp2F = false;
+ Actor_MarkForDeath(&this->actor);
+ break;
+
+ default:
+ sp2F = false;
+ break;
+ }
+
+ if (sp2F) {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
+ }
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ }
+ break;
+
+ case DMCHAR05_3:
+ if (Cutscene_CheckActorAction(globalCtx, 559)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 559);
+
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ default:
+ sp2F = false;
+ break;
+
+ case 1:
+ sp2F = false;
+ break;
+
+ case 2:
+ this->unk_18C = 4;
+ break;
+
+ case 3:
+ this->unk_18C = 5;
+ break;
+
+ case 4:
+ this->unk_18C = 5;
+ break;
+ }
+
+ if (sp2F) {
+ func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
+ }
+ }
+
+ if (globalCtx->csCtx.actorActions[actionIndex]->action != 4) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ } else {
+ Cutscene_ActorTranslate(&this->actor, globalCtx, actionIndex);
+ }
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if (this->unk_18C == 4) {
+ this->unk_18C++;
+ func_80AAC5A0(&this->skelAnime, &sAnimations[this->unk_18C], 0);
+ }
+ }
+ break;
+ }
+}
+
+void func_80AAD3F8(DmChar05* this, GlobalContext* globalCtx) {
+ if (globalCtx->csCtx.frames == 490) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER);
+ }
+
+ if (globalCtx->csCtx.frames > 550) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG);
+ }
+}
+
+void func_80AAD450(DmChar05* this, GlobalContext* globalCtx) {
+ if (globalCtx->csCtx.frames == 262) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER);
+ }
+
+ if (globalCtx->csCtx.frames > 318) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MASK_FLOAT - SFX_FLAG);
+ }
+}
+
+void func_80AAD4A8(DmChar05* this, GlobalContext* globalCtx) {
+ if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) {
+ if (Cutscene_CheckActorAction(globalCtx, 109) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 109)]->action == 3)) {
+ if (Animation_OnFrame(&this->skelAnime, 14.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_0);
+ } else if (Animation_OnFrame(&this->skelAnime, 19.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1);
+ }
+ }
+ } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_1) {
+ if (Cutscene_CheckActorAction(globalCtx, 473)) {
+ if ((globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 473)]->action == 3) &&
+ Animation_OnFrame(&this->skelAnime, 5.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_SAND);
+ }
+ }
+ } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_2) {
+ if (Cutscene_CheckActorAction(globalCtx, 518) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 518)]->action == 2)) {
+ if (Animation_OnFrame(&this->skelAnime, 7.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_0);
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, 14.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1);
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, 18.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_MASK_BOUND_1);
+ }
+ }
+ } else if (DMCHAR05_GET(&this->actor) == DMCHAR05_3) {
+ if (globalCtx->sceneNum == SCENE_OKUJOU) {
+ if (gSaveContext.sceneSetupIndex == 2) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
+ func_80AAD3F8(this, globalCtx);
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
+ func_80AAD450(this, globalCtx);
+ }
+ }
+ } else if (globalCtx->sceneNum == SCENE_SPOT00) {
+ if (gSaveContext.sceneSetupIndex == 9) {
+ if ((globalCtx->csCtx.currentCsIndex == 0) && (globalCtx->csCtx.frames == 255)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER);
+ }
+ } else if ((gSaveContext.sceneSetupIndex == 0xB) && (globalCtx->csCtx.frames == 115)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EVIL_POWER_PREDEMO);
+ }
+ }
+ }
+}
+
+void DmChar05_Update(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
+
+ func_80AACF04(this, globalCtx);
+ if (Cutscene_CheckActorAction(globalCtx, 109)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 109)]->action == 3) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+ } else if (Cutscene_CheckActorAction(globalCtx, 473)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 473)]->action == 3) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+ } else if (Cutscene_CheckActorAction(globalCtx, 518)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 518)]->action == 2) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+ } else if (Cutscene_CheckActorAction(globalCtx, 559)) {
+ if ((globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 559)]->action == 2) ||
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 559)]->action == 3)) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 559)]->action == 4) {
+ this->actor.world.rot.y += 0x258;
+ this->actor.shape.rot.y += 0x258;
+ }
+ }
+ this->actionFunc(this, globalCtx);
+ func_80AAD4A8(this, globalCtx);
+}
+
+s32 DmChar05_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ return false;
+}
+
+void DmChar05_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+}
+
+void func_80AAD998(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
+ s32 pad[2];
+
+ if (this->unk_18E == 0) {
+ if (Cutscene_CheckActorAction(globalCtx, 109) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 109)]->action != 1)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, this->unk_19C, this->unk_1A0, this->unk_1A4, this->unk_1A8,
+ this->unk_1AC, this->unk_1B0);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ DmChar05_OverrideLimbDraw, DmChar05_PostLimbDraw, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ } else if (this->unk_18E == 1) {
+ func_80AADD9C(globalCtx, this);
+ }
+}
+
+void func_80AADA90(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
+
+ if (this->unk_18E == 0) {
+ if (Cutscene_CheckActorAction(globalCtx, 473) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 473)]->action != 1)) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ DmChar05_OverrideLimbDraw, DmChar05_PostLimbDraw, &this->actor);
+ }
+ } else if (this->unk_18E == 1) {
+ func_80AADE78(globalCtx, this);
+ }
+}
+
+void func_80AADB4C(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
+
+ if (this->unk_18E == 0) {
+ if (Cutscene_CheckActorAction(globalCtx, 518) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 518)]->action != 1)) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, NULL, &this->actor);
+ }
+ } else if (this->unk_18E == 1) {
+ func_80AADF54(globalCtx, this);
+ }
+}
+
+void func_80AADC00(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ DmChar05* this = THIS;
+ s32 actionIndex;
+
+ if (Cutscene_CheckActorAction(globalCtx, 559)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 559);
+
+ if ((globalCtx->csCtx.actorActions[actionIndex]->action != 1) &&
+ (globalCtx->csCtx.actorActions[actionIndex]->action != 4)) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ DmChar05_OverrideLimbDraw, DmChar05_PostLimbDraw, &this->actor);
+ }
+
+ if (globalCtx->csCtx.actorActions[actionIndex]->action == 4) {
+ Matrix_InsertTranslation(-600.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Gfx_DrawDListOpa(globalCtx, object_dmask_DL_001E70);
+ }
+ }
+}
+
+void DmChar05_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ DmChar05* this = THIS;
+
+ switch (DMCHAR05_GET(&this->actor)) {
+ case DMCHAR05_0:
+ func_80AAD998(thisx, globalCtx);
+ break;
+
+ case DMCHAR05_1:
+ func_80AADA90(thisx, globalCtx);
+ break;
+
+ case DMCHAR05_2:
+ func_80AADB4C(thisx, globalCtx);
+ break;
+
+ case DMCHAR05_3:
+ func_80AADC00(thisx, globalCtx);
+ break;
+
+ case DMCHAR05_4:
+ func_80AAE030(globalCtx, this);
+ break;
+
+ case DMCHAR05_5:
+ case DMCHAR05_6:
+ case DMCHAR05_7:
+ case DMCHAR05_8:
+ case DMCHAR05_9:
+ case DMCHAR05_10:
+ case DMCHAR05_11:
+ case DMCHAR05_12:
+ func_80AAE114(globalCtx, this);
+ break;
+ }
+}
+
+void func_80AADD9C(GlobalContext* globalCtx, DmChar05* this) {
+ if (this->actor.objBankIndex == this->unk_18F) {
+ Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
+ Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ GetItem_Draw(globalCtx, GID_44);
+ }
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_18F)) {
+ this->actor.objBankIndex = this->unk_18F;
+ }
+}
+
+void func_80AADE78(GlobalContext* globalCtx, DmChar05* this) {
+ if (this->actor.objBankIndex == this->unk_18F) {
+ Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
+ Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ GetItem_Draw(globalCtx, GID_45);
+ }
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_18F)) {
+ this->actor.objBankIndex = this->unk_18F;
+ }
+}
+
+void func_80AADF54(GlobalContext* globalCtx, DmChar05* this) {
+ if (this->actor.objBankIndex == this->unk_18F) {
+ Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
+ Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ GetItem_Draw(globalCtx, GID_6B);
+ }
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_18F)) {
+ this->actor.objBankIndex = this->unk_18F;
+ }
+}
+
+void func_80AAE030(GlobalContext* globalCtx, DmChar05* this) {
+ if (this->unk_18E != 0) {
+ if (this->actor.objBankIndex == this->unk_18F) {
+ Matrix_InsertTranslation(this->unk_190.x, this->unk_190.y, this->unk_190.z, MTXMODE_NEW);
+ Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ GetItem_Draw(globalCtx, GID_03);
+ }
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_18F)) {
+ this->actor.objBankIndex = this->unk_18F;
+ }
+ }
+}
+
+void func_80AAE114(GlobalContext* globalCtx, DmChar05* this) {
+ s32 sp34;
+ s16 sp24[] = {
+ GID_02, GID_6A, GID_70, GID_3A, GID_0E, GID_0F, GID_3E, GID_71,
+ };
+
+ sp34 = DMCHAR05_GET(&this->actor) - DMCHAR05_5;
+ if (this->actor.objBankIndex == this->unk_18F) {
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
+ MTXMODE_NEW);
+ Matrix_InsertRotation(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
+ GetItem_Draw(globalCtx, sp24[sp34]);
+ }
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_18F)) {
+ this->actor.objBankIndex = this->unk_18F;
+ }
+}
diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h
index a2e1a6208d..83bb679486 100644
--- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h
+++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.h
@@ -7,11 +7,39 @@ struct DmChar05;
typedef void (*DmChar05ActionFunc)(struct DmChar05*, GlobalContext*);
+#define DMCHAR05_GET(thisx) ((thisx)->params)
+
+enum {
+ /* 0 */ DMCHAR05_0,
+ /* 1 */ DMCHAR05_1,
+ /* 2 */ DMCHAR05_2,
+ /* 3 */ DMCHAR05_3,
+ /* 4 */ DMCHAR05_4,
+ /* 5 */ DMCHAR05_5,
+ /* 6 */ DMCHAR05_6,
+ /* 7 */ DMCHAR05_7,
+ /* 8 */ DMCHAR05_8,
+ /* 9 */ DMCHAR05_9,
+ /* 10 */ DMCHAR05_10,
+ /* 11 */ DMCHAR05_11,
+ /* 12 */ DMCHAR05_12,
+};
+
typedef struct DmChar05 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ DmChar05ActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x2C];
+ /* 0x018C */ s16 unk_18C;
+ /* 0x018E */ u8 unk_18E;
+ /* 0x018F */ u8 unk_18F;
+ /* 0x0190 */ Vec3f unk_190;
+ /* 0x019C */ u32 unk_19C;
+ /* 0x01A0 */ u32 unk_1A0;
+ /* 0x01A4 */ u32 unk_1A4;
+ /* 0x01A8 */ s32 unk_1A8;
+ /* 0x01AC */ s32 unk_1AC;
+ /* 0x01B0 */ s32 unk_1B0;
+ /* 0x01B4 */ u8 unk_1B4;
} DmChar05; // size = 0x1B8
extern const ActorInit Dm_Char05_InitVars;
diff --git a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c
index 1518cd4b41..e35328af04 100644
--- a/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c
+++ b/src/overlays/actors/ovl_Dm_Char06/z_dm_char06.c
@@ -6,7 +6,7 @@
#include "z_dm_char06.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar06*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c
index efb716667e..d2aac5a7cd 100644
--- a/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c
+++ b/src/overlays/actors/ovl_Dm_Char07/z_dm_char07.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_char07.h"
+#include "objects/object_milkbar/object_milkbar.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar07*)thisx)
@@ -29,24 +30,6 @@ const ActorInit Dm_Char07_InitVars = {
(ActorFunc)DmChar07_Draw,
};
-extern Gfx D_06000100[];
-extern Gfx D_06000240[];
-extern Gfx D_06000650[];
-extern Gfx D_06000790[];
-extern Gfx D_06000B80[];
-extern Gfx D_06000CC0[];
-extern Gfx D_060010D0[];
-extern Gfx D_06001210[];
-extern Gfx D_060015E0[];
-extern Gfx D_060016B8[];
-extern Gfx D_06002BA0[];
-extern Gfx D_06002CD0[];
-extern CollisionHeader D_06006688;
-extern Gfx D_060076A0[];
-extern Gfx D_06007918[];
-extern AnimatedMaterial D_060105F8;
-extern Gfx D_06010D68[];
-
void DmChar07_SetupAction(DmChar07* this, DmChar07ActionFunc actionFunc) {
this->actionFunc = actionFunc;
}
@@ -62,7 +45,7 @@ void DmChar07_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->dyna.actor, 0.1f);
this->isStage = 1;
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06006688);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_milkbar_Colheader_006688);
} else {
Actor_SetScale(&this->dyna.actor, 1.0f);
}
@@ -96,36 +79,36 @@ void DmChar07_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
switch (this->dyna.actor.params) {
case DMCHAR07_STAGE:
- gSPDisplayList(POLY_OPA_DISP++, D_06002CD0);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_002CD0);
break;
case DMCHAR07_CREDITS_STAGE:
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060105F8));
- gSPDisplayList(POLY_OPA_DISP++, D_06007918);
- gSPDisplayList(POLY_OPA_DISP++, D_06000240);
- gSPDisplayList(POLY_OPA_DISP++, D_06000790);
- gSPDisplayList(POLY_OPA_DISP++, D_06000CC0);
- gSPDisplayList(POLY_OPA_DISP++, D_06001210);
- gSPDisplayList(POLY_OPA_DISP++, D_060016B8);
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_milkbar_Matanimheader_0105F8));
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_007918);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000240);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000790);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000CC0);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_001210);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8);
break;
case DMCHAR07_SPOTLIGHTS:
if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000240);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000240);
}
if (this->spotlightFlags & DMCHAR07_UPSTAGE_RIGHT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000790);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000790);
}
if (this->spotlightFlags & DMCHAR07_STAGE_CENTER_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000CC0);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000CC0);
}
if (this->spotlightFlags & DMCHAR07_UPSTAGE_LEFT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06001210);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_001210);
}
if (this->spotlightFlags & DMCHAR07_DOWNSTAGE_CENTER_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_060016B8);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8);
}
break;
case DMCHAR07_DISHES:
- gSPDisplayList(POLY_OPA_DISP++, D_06010D68);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_010D68);
break;
}
@@ -133,31 +116,31 @@ void DmChar07_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
switch (this->dyna.actor.params) {
case DMCHAR07_STAGE:
- gSPDisplayList(POLY_XLU_DISP++, D_06002BA0);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_002BA0);
break;
case DMCHAR07_CREDITS_STAGE:
- gSPDisplayList(POLY_XLU_DISP++, D_060076A0);
- gSPDisplayList(POLY_XLU_DISP++, D_06000100);
- gSPDisplayList(POLY_XLU_DISP++, D_06000650);
- gSPDisplayList(POLY_XLU_DISP++, D_06000B80);
- gSPDisplayList(POLY_XLU_DISP++, D_060010D0);
- gSPDisplayList(POLY_XLU_DISP++, D_060015E0);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0076A0);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000100);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000650);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000B80);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0010D0);
+ gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0015E0);
break;
case DMCHAR07_SPOTLIGHTS:
if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000100);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000100);
}
if (this->spotlightFlags & DMCHAR07_UPSTAGE_RIGHT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000650);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000650);
}
if (this->spotlightFlags & DMCHAR07_STAGE_CENTER_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000B80);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000B80);
}
if (this->spotlightFlags & DMCHAR07_UPSTAGE_LEFT_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_060010D0);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0010D0);
}
if (this->spotlightFlags & DMCHAR07_DOWNSTAGE_CENTER_SPOTLIGHT) {
- gSPDisplayList(POLY_OPA_DISP++, D_060015E0);
+ gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0015E0);
}
break;
case DMCHAR07_DISHES:
diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c
index aa0357ef2d..f944c9c630 100644
--- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c
+++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c
@@ -6,7 +6,7 @@
#include "z_dm_char08.h"
-#define FLAGS 0x02000000
+#define FLAGS (ACTOR_FLAG_2000000)
#define THIS ((DmChar08*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c
index 490800ea99..7fb20d1a0b 100644
--- a/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c
+++ b/src/overlays/actors/ovl_Dm_Char09/z_dm_char09.c
@@ -6,7 +6,7 @@
#include "z_dm_char09.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmChar09*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c
index c6499f0ee6..c2edb33a0e 100644
--- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c
+++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c
@@ -6,7 +6,7 @@
#include "z_dm_gm.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((DmGm*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c
index 187e935144..a30e836209 100644
--- a/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c
+++ b/src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c
@@ -6,7 +6,7 @@
#include "z_dm_hina.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmHina*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c
index 1e36f9e29b..4dd75d8435 100644
--- a/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c
+++ b/src/overlays/actors/ovl_Dm_Nb/z_dm_nb.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_nb.h"
+#include "objects/object_nb/object_nb.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((DmNb*)thisx)
@@ -27,17 +28,14 @@ const ActorInit Dm_Nb_InitVars = {
(ActorFunc)DmNb_Draw,
};
-extern AnimationHeader D_06000990;
-extern FlexSkeletonHeader D_06008C40;
-
-static ActorAnimationEntryS D_80C1E200[] = { &D_06000990, 1.0f, 0, -1, 0, 0 };
+static AnimationInfoS D_80C1E200[] = { &object_nb_Anim_000990, 1.0f, 0, -1, ANIMMODE_LOOP, 0 };
s32 func_80C1DED0(DmNb* this, s32 arg1) {
- s32 ret = 0;
+ s32 ret = false;
if (arg1 != this->unk1F0) {
this->unk1F0 = arg1;
- ret = func_8013BC6C(&this->skelAnime, D_80C1E200, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80C1E200, arg1);
}
return ret;
}
@@ -45,7 +43,7 @@ s32 func_80C1DED0(DmNb* this, s32 arg1) {
void func_80C1DF18(DmNb* this, GlobalContext* globalCtx) {
s32 sp2C[] = { 0, 0, 0, 0, 0 };
u16 actionUnk0;
- u32 actionIndex;
+ s32 actionIndex;
if (globalCtx->csCtx.state != 0) {
if (this->unk1F8 == 0) {
@@ -53,14 +51,14 @@ void func_80C1DF18(DmNb* this, GlobalContext* globalCtx) {
this->unk1F8 = 1;
this->unk1F4 = this->unk1F0;
}
- if (func_800EE29C(globalCtx, 0x232)) {
- actionIndex = func_800EE200(globalCtx, 0x232);
- actionUnk0 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 562)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 562);
+ actionUnk0 = globalCtx->csCtx.actorActions[actionIndex]->action;
if (this->unk1EC != (actionUnk0 & 0xFF)) {
this->unk1EC = actionUnk0;
func_80C1DED0(this, sp2C[actionUnk0]);
}
- func_800EDF24(&this->actor, globalCtx, actionIndex);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
}
} else if (this->unk1F8 != 0) {
this->unk1F8 = 0;
@@ -72,10 +70,11 @@ void DmNb_Init(Actor* thisx, GlobalContext* globalCtx) {
DmNb* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008C40, NULL, this->jointTable, this->morphTable, 8);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_nb_Skel_008C40, NULL, this->jointTable, this->morphTable,
+ 8);
this->unk1F0 = -1;
func_80C1DED0(this, 0);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80C1DF18;
}
@@ -91,13 +90,13 @@ void DmNb_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
}
-void DmNb_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void DmNb_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void DmNb_Draw(Actor* thisx, GlobalContext* globalCtx) {
DmNb* this = THIS;
func_8012C5B0(globalCtx->state.gfxCtx);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
- NULL, DmNb_UnkActorDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, NULL, DmNb_TransformLimbDraw, &this->actor);
}
diff --git a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c
index 6f22be2ffc..ef81bc467a 100644
--- a/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c
+++ b/src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c
@@ -6,7 +6,7 @@
#include "z_dm_opstage.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmOpstage*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c
index fca8d14528..4c39ddd544 100644
--- a/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c
+++ b/src/overlays/actors/ovl_Dm_Ravine/z_dm_ravine.c
@@ -6,7 +6,7 @@
#include "z_dm_ravine.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmRavine*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c
index 586b231ae4..4d5a20114d 100644
--- a/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c
+++ b/src/overlays/actors/ovl_Dm_Sa/z_dm_sa.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_sa.h"
+#include "objects/object_stk/object_stk.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmSa*)thisx)
@@ -29,15 +30,12 @@ const ActorInit Dm_Sa_InitVars = {
(ActorFunc)DmSa_Draw,
};
-extern FlexSkeletonHeader D_06013328;
-extern AnimationHeader D_0600CC94;
+static AnimationInfo D_80A2ED00[] = { { &object_stk_Anim_00CC94, 1.0f, 0, -1.0f, ANIMMODE_LOOP, 0 } };
-static ActorAnimationEntry D_80A2ED00[] = { { &D_0600CC94, 1.0f, 0, -1.0f, 0, 0 } };
-
-void func_80A2E960(SkelAnime* arg0, ActorAnimationEntry* animations, u16 index) {
+void func_80A2E960(SkelAnime* arg0, AnimationInfo* animations, u16 index) {
f32 frameCount;
- animations += index;
+ animations += index;
if (animations->frameCount < 0.0f) {
frameCount = Animation_GetLastFrame(animations->animation);
} else {
@@ -54,7 +52,7 @@ void DmSa_Init(Actor* thisx, GlobalContext* globalCtx) {
this->alpha = 0xFF;
this->actor.targetArrowOffset = 3000.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_stk_Skel_013328, NULL, NULL, NULL, 0);
func_80A2E960(&this->skelAnime, D_80A2ED00, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmSa_DoNothing;
@@ -74,14 +72,14 @@ void DmSa_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
-s32 func_80A2EB10(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
- return 0;
+s32 DmSa_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ return false;
}
-void func_80A2EB2C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
+void DmSa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
-void func_80A2EB44(GlobalContext* globalCtx, s32 limbIndex, Actor* actor) {
+void DmSa_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
Gfx* func_80A2EB58(GraphicsContext* gfxCtx, u32 alpha) {
@@ -120,8 +118,9 @@ void DmSa_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x0C, func_80A2EBB0(globalCtx->state.gfxCtx, this->alpha));
}
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80A2EB10, func_80A2EB2C, func_80A2EB44, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, DmSa_OverrideLimbDraw, DmSa_PostLimbDraw,
+ DmSa_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c
index edfa0567da..6c9d11170c 100644
--- a/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c
+++ b/src/overlays/actors/ovl_Dm_Statue/z_dm_statue.c
@@ -5,8 +5,9 @@
*/
#include "z_dm_statue.h"
+#include "objects/object_smtower/object_smtower.h"
-#define FLAGS 0x04000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000000)
#define THIS ((DmStatue*)thisx)
@@ -27,9 +28,6 @@ const ActorInit Dm_Statue_InitVars = {
(ActorFunc)DmStatue_Draw,
};
-extern AnimatedMaterial D_06001788;
-extern Gfx D_06000520[];
-
void DmStatue_Init(Actor* thisx, GlobalContext* globalCtx) {
DmStatue* this = THIS;
@@ -43,6 +41,6 @@ void DmStatue_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void DmStatue_Draw(Actor* thisx, GlobalContext* globalCtx) {
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001788));
- Gfx_DrawDListXlu(globalCtx, D_06000520);
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_smtower_Matanimheader_001788));
+ Gfx_DrawDListXlu(globalCtx, object_smtower_DL_000520);
}
diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
index 99a46c1e25..2017e960b5 100644
--- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
+++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c
@@ -5,8 +5,11 @@
*/
#include "z_dm_stk.h"
+#include "objects/object_stk/object_stk.h"
+#include "objects/object_stk2/object_stk2.h"
+#include "objects/object_stk3/object_stk3.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((DmStk*)thisx)
@@ -30,96 +33,6 @@ void func_80AA1C64(DmStk* this, GlobalContext* globalCtx);
void func_80AA2720(DmStk* this, GlobalContext* globalCtx);
void func_80AA27EC(DmStk* this, GlobalContext* globalCtx);
-extern AnimationHeader D_0600055C;
-extern AnimationHeader D_06001030;
-extern AnimationHeader D_0600130C;
-extern AnimationHeader D_06001374;
-extern AnimationHeader D_06001EDC;
-extern AnimationHeader D_06002774;
-extern AnimationHeader D_06002CD8;
-extern AnimationHeader D_06003068;
-extern AnimationHeader D_060035C8;
-extern AnimationHeader D_060039F0;
-extern AnimationHeader D_06004554;
-extern AnimationHeader D_06004580;
-extern Gfx D_060046B0[];
-extern AnimationHeader D_060049C8;
-extern AnimationHeader D_060051C0;
-extern Gfx D_060053C0[];
-extern Gfx D_06005870[];
-extern AnimationHeader D_06005F44;
-extern Gfx D_06006BB0[];
-extern AnimationHeader D_060070DC;
-extern Gfx D_06007840[];
-extern Gfx D_060079F0[];
-extern Gfx D_060084C0[];
-extern UNK_TYPE D_06008658;
-extern Gfx D_060087B0[];
-extern Gfx D_06008A80[];
-extern Gfx D_060090C0[];
-extern Gfx D_06009710[];
-extern Gfx D_06009AC0[];
-extern Gfx D_06009DA0[];
-extern Gfx D_0600A530[];
-extern Gfx D_0600A5C0[];
-extern Gfx D_0600AE30[];
-extern Gfx D_0600AEC0[];
-extern AnimationHeader D_0600BB2C;
-extern AnimationHeader D_0600C270;
-extern AnimationHeader D_0600C964;
-extern Gfx D_0600CAD0[];
-extern AnimationHeader D_0600CBB8;
-extern AnimationHeader D_0600D830;
-extern AnimationHeader D_0600E6EC;
-extern AnimationHeader D_0600EEC0;
-extern AnimationHeader D_060101A4;
-extern AnimationHeader D_06010B60;
-extern AnimationHeader D_060110B4;
-extern AnimationHeader D_06011FB0;
-extern AnimationHeader D_06012A58;
-extern FlexSkeletonHeader D_06013328;
-extern AnimationHeader D_060141E4;
-extern AnimationHeader D_06014920;
-extern AnimationHeader D_06015028;
-extern AnimationHeader D_06015C14;
-extern AnimationHeader D_06016508;
-extern Gfx D_06016620[];
-extern AnimationHeader D_06016910;
-extern AnimationHeader D_06018ED0;
-extern AnimationHeader D_0601AA80;
-extern AnimationHeader D_0601C114;
-extern AnimationHeader D_0601C21C;
-extern AnimationHeader D_0601D008;
-extern AnimationHeader D_0601D07C;
-extern AnimationHeader D_0601D3D0;
-extern AnimationHeader D_0601DDE0;
-extern AnimationHeader D_0601EF50;
-extern AnimationHeader D_0601F9E4;
-extern AnimationHeader D_06020CAC;
-extern AnimationHeader D_0602200C;
-extern AnimationHeader D_0602336C;
-extern AnimationHeader D_060259F4;
-extern AnimationHeader D_060266C8;
-extern AnimationHeader D_06026CF4;
-extern AnimationHeader D_06027CF4;
-extern AnimationHeader D_06028F28;
-extern AnimationHeader D_06029A04;
-extern AnimationHeader D_0602A2D8;
-extern AnimationHeader D_0602AD54;
-extern AnimationHeader D_0602DC64;
-extern AnimationHeader D_0602E9A0;
-extern AnimationHeader D_0602FA70;
-extern AnimationHeader D_0603021C;
-extern AnimationHeader D_06031210;
-extern AnimationHeader D_060322FC;
-extern AnimationHeader D_06032AE0;
-extern AnimationHeader D_0603323C;
-extern AnimationHeader D_06034FD8;
-extern AnimationHeader D_06036964;
-extern AnimationHeader D_06037B94;
-extern AnimationHeader D_0603967C;
-extern AnimationHeader D_0603A8F8;
-
const ActorInit Dm_Stk_InitVars = {
ACTOR_DM_STK,
ACTORCAT_ITEMACTION,
@@ -189,43 +102,79 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_0601C21C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0601D3D0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06001030, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601D008, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0601D008, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06015C14, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060070DC, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0600D830, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0600055C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600130C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0600C270, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600CBB8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0601AA80, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601D07C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06016910, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06018ED0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0601DDE0, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601EF50, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0602DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0602DC64, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602E9A0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060035C8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060049C8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060259F4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060266C8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06026CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601C114, 1.0f, 0.0f, -1.0f, 2, 0.0f },
- { &D_06004580, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06020CAC, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0602200C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602336C, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06002774, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06003068, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060101A4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06010B60, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0602A2D8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0601F9E4, 1.0f, 0.0f, -1.0f, 2, 0.0f },
- { &D_06029A04, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_0602AD54, 1.0f, 0.0f, -1.0f, 2, 0.0f },
- { &D_0600BB2C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600C964, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060110B4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06011FB0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06012A58, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060141E4, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0600E6EC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0600EEC0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06027CF4, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06028F28, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0603323C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06031210, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_060322FC, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06032AE0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_0603021C, 1.0f, 0.0f, -1.0f, 0, 0.0f }, { &D_06036964, 1.0f, 0.0f, -1.0f, 2, 0.0f },
- { &D_06016508, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06015028, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06014920, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0602FA70, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06037B94, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0603967C, 1.0f, 0.0f, -1.0f, 2, 0.0f },
- { &D_0603967C, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_0603A8F8, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06034FD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06005F44, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06002CD8, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060039F0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06004554, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_060051C0, 1.0f, 0.0f, -1.0f, 0, 0.0f },
- { &D_06001374, 1.0f, 0.0f, -1.0f, 2, 0.0f }, { &D_06001EDC, 1.0f, 0.0f, -1.0f, 0, 0.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_stk_Anim_01C21C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_01D3D0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_001030, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_01D008, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_015C14, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0070DC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_00D830, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_00055C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_00130C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_00C270, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_00CBB8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_01AA80, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_01D07C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_016910, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_018ED0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_01DDE0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_01EF50, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_02DC64, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_02E9A0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0035C8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_0049C8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0259F4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_0266C8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_026CF4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_01C114, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_004580, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_020CAC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_02200C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_02336C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_002774, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_003068, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0101A4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_010B60, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_02A2D8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_01F9E4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_029A04, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_02AD54, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_00BB2C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_00C964, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0110B4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_011FB0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_012A58, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_0141E4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_00E6EC, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_00EEC0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_027CF4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_028F28, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_03323C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_031210, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_0322FC, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_032AE0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_03021C, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_036964, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_016508, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk_Anim_015028, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk_Anim_014920, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_02FA70, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_037B94, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_03967C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk2_Anim_03A8F8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk2_Anim_034FD8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk3_Anim_005F44, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk3_Anim_002CD8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk3_Anim_0039F0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk3_Anim_004554, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk3_Anim_0051C0, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_stk3_Anim_001374, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_stk3_Anim_001EDC, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
};
void func_80A9FDB0(DmStk* this, GlobalContext* globalCtx) {
@@ -245,8 +194,7 @@ void func_80A9FDB0(DmStk* this, GlobalContext* globalCtx) {
}
}
-void func_80A9FE3C(DmStk* this, GlobalContext* globalCtx, SkelAnime* skelAnime, ActorAnimationEntry* animation,
- u16 index) {
+void func_80A9FE3C(DmStk* this, GlobalContext* globalCtx, SkelAnime* skelAnime, AnimationInfo* animation, u16 index) {
func_80A9FDB0(this, globalCtx);
animation += index;
@@ -401,7 +349,7 @@ void func_80AA01C0(DmStk* this, GlobalContext* globalCtx) {
case 785:
func_8019F128(NA_SE_SY_STALKIDS_PSYCHO);
- func_8019FE74(&D_801D6654, 0.0f, 150);
+ func_8019FE74(&gSfxVolume, 0.0f, 150);
break;
case 560:
@@ -431,7 +379,7 @@ void func_80AA0264(DmStk* this, GlobalContext* globalCtx) {
break;
case 650:
- func_8019FE74(&D_801D6654, 0.0f, 80);
+ func_8019FE74(&gSfxVolume, 0.0f, 80);
break;
case 265:
@@ -773,7 +721,7 @@ void func_80AA0E90(DmStk* this, GlobalContext* globalCtx) {
func_80A9FED8(this, globalCtx);
} else if (gSaveContext.sceneSetupIndex == 0) {
func_80AA0100(this, globalCtx);
- } else if ((gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.unk_12 == 0)) {
+ } else if ((gSaveContext.sceneSetupIndex == 2) && (globalCtx->csCtx.currentCsIndex == 0)) {
func_80AA0158(this, globalCtx);
}
break;
@@ -786,9 +734,9 @@ void func_80AA0E90(DmStk* this, GlobalContext* globalCtx) {
case SCENE_OPENINGDAN:
if (gSaveContext.sceneSetupIndex == 0) {
- if (globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
func_80AA01C0(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 1) {
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
func_80AA0264(this, globalCtx);
}
}
@@ -796,19 +744,19 @@ void func_80AA0E90(DmStk* this, GlobalContext* globalCtx) {
case SCENE_OKUJOU:
if (gSaveContext.sceneSetupIndex == 0) {
- if (globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
func_80AA0420(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 1) {
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
func_80AA05F0(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 2) {
+ } else if (globalCtx->csCtx.currentCsIndex == 2) {
func_80AA09DC(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 3) {
+ } else if (globalCtx->csCtx.currentCsIndex == 3) {
func_80AA0B08(this, globalCtx);
}
} else if (gSaveContext.sceneSetupIndex == 2) {
- if (globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
func_80AA0DA8(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 1) {
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
func_80AA0E1C(this, globalCtx);
}
}
@@ -816,15 +764,15 @@ void func_80AA0E90(DmStk* this, GlobalContext* globalCtx) {
case SCENE_00KEIKOKU:
if (gSaveContext.sceneSetupIndex == 3) {
- if (globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
func_80AA0634(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 2) {
+ } else if (globalCtx->csCtx.currentCsIndex == 2) {
func_80AA066C(this, globalCtx);
}
} else if (gSaveContext.sceneSetupIndex == 7) {
- if (globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->csCtx.currentCsIndex == 0) {
func_80AA071C(this, globalCtx);
- } else if (globalCtx->csCtx.unk_12 == 1) {
+ } else if (globalCtx->csCtx.currentCsIndex == 1) {
func_80AA076C(this, globalCtx);
}
}
@@ -946,7 +894,7 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_2E0 = 5;
this->actionFunc = func_80AA1714;
} else {
- if ((globalCtx->sceneNum == SCENE_LOST_WOODS) && !func_800EE2F4(globalCtx)) {
+ if ((globalCtx->sceneNum == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(globalCtx)) {
Actor_MarkForDeath(&this->actor);
}
this->unk_32C = 2;
@@ -965,14 +913,14 @@ void DmStk_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetArrowOffset = 1100.0f;
this->unk_334 = 99;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013328, NULL, NULL, NULL, 0);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_stk_Skel_013328, NULL, NULL, NULL, 0);
func_80A9FE3C(this, globalCtx, &this->skelAnime, &sAnimations[this->unk_2E0], 0);
}
Actor_SetScale(&this->actor, 0.01f);
if ((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 3) &&
- (globalCtx->csCtx.unk_12 > 0)) {
+ (globalCtx->csCtx.currentCsIndex > 0)) {
globalCtx->envCtx.unk_17 = 15;
globalCtx->envCtx.unk_18 = 15;
}
@@ -1103,7 +1051,7 @@ void func_80AA1B9C(DmStk* this, GlobalContext* globalCtx) {
if (this->unk_339 >= 3) {
this->unk_339 = 0;
if (!(player->stateFlags2 & 0x8000000)) {
- func_801518B0(globalCtx, 0x2013, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2013, &this->actor);
}
}
@@ -1128,21 +1076,21 @@ void func_80AA1C64(DmStk* this, GlobalContext* globalCtx) {
void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
s32 pad;
- u32 temp_v0;
+ s32 temp_v0;
- if (func_800EE29C(globalCtx, 0x6B)) {
- temp_v0 = func_800EE200(globalCtx, 0x6B);
+ if (Cutscene_CheckActorAction(globalCtx, 107)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, 107);
- if (globalCtx->csCtx.frames == globalCtx->csCtx.npcActions[temp_v0]->startFrame) {
- if (this->unk_334 != globalCtx->csCtx.npcActions[temp_v0]->unk0) {
- this->unk_334 = globalCtx->csCtx.npcActions[temp_v0]->unk0;
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[temp_v0]->startFrame) {
+ if (this->unk_334 != globalCtx->csCtx.actorActions[temp_v0]->action) {
+ this->unk_334 = globalCtx->csCtx.actorActions[temp_v0]->action;
if (globalCtx->sceneNum == SCENE_CLOCKTOWER) {
this->unk_32D = 6;
} else {
this->unk_32D = 9;
}
- switch (globalCtx->csCtx.npcActions[temp_v0]->unk0) {
+ switch (globalCtx->csCtx.actorActions[temp_v0]->action) {
case 0:
case 1:
this->unk_2E0 = 3;
@@ -1402,7 +1350,7 @@ void func_80AA1D1C(DmStk* this, GlobalContext* globalCtx) {
}
}
- func_800EDF24(&this->actor, globalCtx, temp_v0);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
} else {
this->unk_334 = 99;
}
@@ -1529,12 +1477,12 @@ void func_80AA2720(DmStk* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state == 0) {
func_80AA1AF8(this, globalCtx);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_328++;
if (this->unk_328 > 800) {
this->unk_328 = 0;
if (!(player->stateFlags2 & 0x8000000)) {
- func_801518B0(globalCtx, 0x2014, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2014, &this->actor);
}
}
if ((this->collider.base.acFlags & AC_HIT) && (this->actor.colChkInfo.damageEffect == 0xF)) {
@@ -1547,7 +1495,7 @@ void func_80AA2720(DmStk* this, GlobalContext* globalCtx) {
void func_80AA27EC(DmStk* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state == 0) {
func_80AA1AF8(this, globalCtx);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (this->unk_2E0 == 33) {
this->actor.targetArrowOffset = 3100.0f;
@@ -1617,7 +1565,7 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
break;
}
- if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.unk11F22 != 0) &&
+ if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) &&
(globalCtx->msgCtx.unk11F04 == 0x5E6) && !FrameAdvance_IsEnabled(globalCtx) &&
(globalCtx->sceneLoadFlag == 0) && (ActorCutscene_GetCurrentIndex() == -1) &&
(globalCtx->csCtx.state == 0)) {
@@ -1631,7 +1579,7 @@ void DmStk_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if ((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 3) &&
- (globalCtx->csCtx.unk_12 > 0)) {
+ (globalCtx->csCtx.currentCsIndex > 0)) {
globalCtx->envCtx.unk_17 = 15;
globalCtx->envCtx.unk_18 = 15;
}
@@ -1680,11 +1628,11 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if ((this->unk_2E0 == 69) || (this->unk_2E0 == 11) || (this->unk_2E0 == 71)) {
- gSPDisplayList(POLY_OPA_DISP++, D_0600AEC0);
- gSPDisplayList(POLY_OPA_DISP++, D_0600AE30);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00AEC0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00AE30);
} else {
- gSPDisplayList(POLY_OPA_DISP++, D_0600A5C0);
- gSPDisplayList(POLY_OPA_DISP++, D_0600A530);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00A5C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00A530);
}
switch (this->unk_32C) {
@@ -1699,27 +1647,28 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
}
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, this->unk_2E8, this->unk_2EC, this->unk_2F0,
this->unk_2F4, this->unk_2F8, this->unk_2FC);
- gSPDisplayList(POLY_OPA_DISP++, D_06006BB0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0);
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
} else {
- gSPDisplayList(POLY_OPA_DISP++, D_06006BB0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0);
}
break;
case 2:
- gSPDisplayList(POLY_OPA_DISP++, D_06006BB0);
- gSPDisplayList(POLY_OPA_DISP++, D_06005870);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_005870);
- if (func_800EE29C(globalCtx, 0x201) &&
- (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x201)]->unk0 == 2) && (this->unk_337 >= 0)) {
+ if (Cutscene_CheckActorAction(globalCtx, 513) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 513)]->action == 2) &&
+ (this->unk_337 >= 0)) {
Matrix_StatePush();
Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY);
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_337].segment);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_337].segment);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06008658));
- Gfx_DrawDListOpa(globalCtx, D_06007840);
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_stk2_Matanimheader_008658));
+ Gfx_DrawDListOpa(globalCtx, object_stk2_DL_007840);
gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_336].segment);
gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->unk_336].segment);
@@ -1742,20 +1691,20 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
switch (this->unk_32D) {
case 0:
- gSPDisplayList(POLY_OPA_DISP++, D_06009AC0);
- gSPDisplayList(POLY_OPA_DISP++, D_060046B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009AC0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0046B0);
break;
case 1:
- gSPDisplayList(POLY_OPA_DISP++, D_06009710);
- gSPDisplayList(POLY_OPA_DISP++, D_060053C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009710);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0053C0);
break;
case 3:
- gSPDisplayList(POLY_OPA_DISP++, D_06009DA0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_009DA0);
if ((globalCtx->sceneNum == SCENE_LOST_WOODS) && (gSaveContext.sceneSetupIndex == 1)) {
- gSPDisplayList(POLY_OPA_DISP++, D_0600CAD0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00CAD0);
}
break;
@@ -1766,7 +1715,7 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06006BB0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_006BB0);
break;
}
@@ -1783,33 +1732,33 @@ void DmStk_PostLimbDraw2(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, V
break;
case 1:
- gSPDisplayList(POLY_OPA_DISP++, D_060084C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0084C0);
break;
case 2:
- gSPDisplayList(POLY_OPA_DISP++, D_060090C0);
- gSPDisplayList(POLY_OPA_DISP++, D_060079F0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0079F0);
break;
case 3:
if ((globalCtx->sceneNum != SCENE_LOST_WOODS) || (gSaveContext.sceneSetupIndex != 1)) {
- gSPDisplayList(POLY_OPA_DISP++, D_0600CAD0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_00CAD0);
}
- gSPDisplayList(POLY_OPA_DISP++, D_060090C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0);
break;
case 4:
- gSPDisplayList(POLY_OPA_DISP++, D_060090C0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0090C0);
break;
case 6:
- gSPDisplayList(POLY_OPA_DISP++, D_06008A80);
- gSPDisplayList(POLY_OPA_DISP++, D_06016620);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_008A80);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_016620);
break;
case 9:
if (this->unk_2E4 == 255) {
- gSPDisplayList(POLY_OPA_DISP++, D_060087B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_stk_DL_0087B0);
}
break;
}
@@ -1829,7 +1778,7 @@ void DmStk_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_33B != 0) {
if (this->actor.params == 1) {
- Gfx_DrawDListOpa(globalCtx, D_06006BB0);
+ Gfx_DrawDListOpa(globalCtx, object_stk_DL_006BB0);
return;
}
diff --git a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c
index 80eb930fdf..6290b41e00 100644
--- a/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c
+++ b/src/overlays/actors/ovl_Dm_Tag/z_dm_tag.c
@@ -6,7 +6,7 @@
#include "z_dm_tag.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((DmTag*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c
index b3c11b83ed..9ed86ba2c9 100644
--- a/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c
+++ b/src/overlays/actors/ovl_Dm_Tsg/z_dm_tsg.c
@@ -6,7 +6,7 @@
#include "z_dm_tsg.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((DmTsg*)thisx)
diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c
index 993dbc3207..fc9d21b3d0 100644
--- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c
+++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c
@@ -6,7 +6,7 @@
#include "z_dm_zl.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((DmZl*)thisx)
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 167dbfe69d..85a7a9bc86 100644
--- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
+++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c
@@ -5,8 +5,9 @@
*/
#include "z_door_ana.h"
+#include "objects/gameplay_field_keep/gameplay_field_keep.h"
-#define FLAGS 0x02000000
+#define FLAGS (ACTOR_FLAG_2000000)
#define THIS ((DoorAna*)thisx)
@@ -70,7 +71,7 @@ void DoorAna_Init(Actor* thisx, GlobalContext* globalCtx) {
if (grottoType == DOORANA_TYPE_HIDDEN) {
Collider_InitAndSetCylinder(globalCtx, &this->bombCollider, &this->actor, &sCylinderInit);
} else {
- this->actor.flags |= 0x10; // always update
+ this->actor.flags |= ACTOR_FLAG_10; // always update
}
Actor_SetScale(&this->actor, 0);
@@ -98,9 +99,9 @@ void DoorAna_WaitClosed(DoorAna* this, GlobalContext* globalCtx) {
if (grottoType == DOORANA_TYPE_UNK) {
// in OOT decomp its marked as open with storms, but does not seem to open with storms in MM
- if ((this->actor.xyzDistToPlayerSq < 40000.0f) && (EnvFlags_Get(globalCtx, 5))) {
+ if ((this->actor.xyzDistToPlayerSq < SQ(200.0f)) && (EnvFlags_Get(globalCtx, 5))) {
grottoIsOpen = 1;
- this->actor.flags &= ~0x10; // always update OFF
+ this->actor.flags &= ~ACTOR_FLAG_10; // always update OFF
}
} else {
@@ -204,9 +205,9 @@ void DoorAna_Update(Actor* thisx, GlobalContext* globalCtx) {
DoorAna* this = THIS;
this->actionFunc(this, globalCtx);
- this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
+ this->actor.shape.rot.y = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)));
}
void DoorAna_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListXlu(globalCtx, D_05000C40);
+ Gfx_DrawDListXlu(globalCtx, gameplay_field_keep_DL_000C40);
}
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 44f6992987..e28e05a16b 100644
--- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
+++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c
@@ -5,8 +5,20 @@
*/
#include "z_door_shutter.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_bdoor/object_bdoor.h"
+#include "objects/object_numa_obj/object_numa_obj.h"
+#include "objects/object_hakugin_obj/object_hakugin_obj.h"
+#include "objects/object_dblue_object/object_dblue_object.h"
+#include "objects/object_ikana_obj/object_ikana_obj.h"
+#include "objects/object_redead_obj/object_redead_obj.h"
+#include "objects/object_ikninside_obj/object_ikninside_obj.h"
+#include "objects/object_random_obj/object_random_obj.h"
+#include "objects/object_kinsta1_obj/object_kinsta1_obj.h"
+#include "objects/object_kaizoku_obj/object_kaizoku_obj.h"
+#include "objects/object_last_obj/object_last_obj.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((DoorShutter*)thisx)
@@ -14,7 +26,18 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx);
void DoorShutter_Destroy(Actor* thisx, GlobalContext* globalCtx);
void DoorShutter_Update(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void DoorShutter_SetupType(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A0F88(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1080(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1090(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1548(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1618(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1684(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1784(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1B48(DoorShutter* this, GlobalContext* globalCtx);
+void func_808A1C50(DoorShutter* this, GlobalContext* globalCtx);
+void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx);
+
const ActorInit Door_Shutter_InitVars = {
ACTOR_DOOR_SHUTTER,
ACTORCAT_DOOR,
@@ -27,64 +50,670 @@ const ActorInit Door_Shutter_InitVars = {
(ActorFunc)NULL,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_808A2248[] = {
+typedef struct {
+ /* 0x0 */ s16 objectId;
+ /* 0x2 */ u8 index1;
+ /* 0x3 */ u8 index2;
+} ShutterObjectInfo; // size = 0x4
+
+ShutterObjectInfo D_808A2180[] = {
+ { OBJECT_BDOOR, 0, 0 }, { GAMEPLAY_KEEP, 1, 1 }, { OBJECT_NUMA_OBJ, 2, 2 },
+ { OBJECT_HAKUGIN_OBJ, 3, 3 }, { OBJECT_DBLUE_OBJECT, 4, 4 }, { OBJECT_IKANA_OBJ, 5, 5 },
+ { OBJECT_REDEAD_OBJ, 6, 6 }, { OBJECT_IKNINSIDE_OBJ, 7, 7 }, { OBJECT_LAST_OBJ, 11, 11 },
+ { OBJECT_RANDOM_OBJ, 8, 8 }, { OBJECT_KINSTA1_OBJ, 9, 9 }, { OBJECT_KAIZOKU_OBJ, 10, 10 },
+};
+
+typedef struct {
+ /* 0x0 */ Gfx* unk_00;
+ /* 0x4 */ Gfx* unk_04;
+ /* 0x8 */ u8 unk_08;
+ /* 0x9 */ u8 translateZ;
+ /* 0xA */ u8 unk_0A;
+ /* 0xB */ u8 unk_0B;
+} ShutterInfo; // size = 0xC
+
+ShutterInfo D_808A21B0[] = {
+ { object_bdoor_DL_0000C0, NULL, 130, 12, 50, 15 },
+ { gameplay_keep_DL_077990, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_numa_obj_DL_007150, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_hakugin_obj_DL_000128, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_dblue_object_DL_017D00, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_ikana_obj_DL_014A40, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_redead_obj_DL_0001A0, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_ikninside_obj_DL_004440, object_ikninside_obj_DL_005260, 130, 0, 20, 15 },
+ { object_random_obj_DL_000190, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_kinsta1_obj_DL_000198, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_kaizoku_obj_DL_0001A0, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+ { object_last_obj_DL_0039C0, gameplay_keep_DL_078A80, 130, 12, 20, 15 },
+};
+
+s8 D_808A2240[] = {
+ -1, -1, -1, -1, -1, 0, -1, -1,
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 1, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP),
};
-#endif
+typedef struct {
+ /* 0x00 */ s16 sceneNum;
+ /* 0x02 */ u8 index;
+} ShutterSceneInfo; // size = 0x4
-extern InitChainEntry D_808A2248[];
+ShutterSceneInfo D_808A2258[] = {
+ { SCENE_MITURIN, 2 }, { SCENE_HAKUGIN, 3 }, { SCENE_SEA, 4 },
+ { SCENE_INISIE_N, 5 }, { SCENE_INISIE_R, 5 }, { SCENE_REDEAD, 6 },
+ { SCENE_IKNINSIDE, 7 }, { SCENE_CASTLE, 7 }, { SCENE_RANDOM, 9 },
+ { SCENE_KINSTA1, 10 }, { SCENE_KAIZOKU, 11 }, { SCENE_PIRATE, 11 },
+ { SCENE_TORIDE, 11 }, { SCENE_LAST_DEKU, 8 }, { SCENE_LAST_GORON, 8 },
+ { SCENE_LAST_ZORA, 8 }, { SCENE_LAST_LINK, 8 }, { -1, 1 },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A08F0.s")
+typedef struct {
+ /* 0x00 */ s16 dungeonScene;
+ /* 0x02 */ s16 bossScene;
+ /* 0x04 */ u8 index;
+} BossDoorInfo; // size = 0x6
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0900.s")
+BossDoorInfo D_808A22A0[] = {
+ { SCENE_MITURIN, SCENE_MITURIN_BS, 1 }, { SCENE_HAKUGIN, SCENE_HAKUGIN_BS, 2 }, { SCENE_SEA, SCENE_SEA_BS, 3 },
+ { SCENE_INISIE_N, SCENE_INISIE_BS, 4 }, { SCENE_INISIE_R, SCENE_INISIE_BS, 4 }, { -1, -1, 0 },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0974.s")
+Vec3f D_808A22C4 = { 120.0f, 0.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/DoorShutter_Init.s")
+Vec3f D_808A22D0 = { -90.0f, 0.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/DoorShutter_Destroy.s")
+TexturePtr D_808A22DC[] = {
+ object_bdoor_Tex_006BA0, object_bdoor_Tex_005BA0, object_bdoor_Tex_0005C0,
+ object_bdoor_Tex_004BA0, object_bdoor_Tex_003BA0,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0D0C.s")
+void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc) {
+ this->actionFunc = actionFunc;
+ this->unk_167 = 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0D90.s")
+s32 func_808A0900(DoorShutter* this, GlobalContext* globalCtx) {
+ TransitionActorEntry* transitionEntry = &globalCtx->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)];
+ s8 frontRoom = transitionEntry->sides[0].room;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0E28.s")
+ if (frontRoom == transitionEntry->sides[1].room) {
+ if (ABS_ALT(BINANG_SUB(this->actor.shape.rot.y, this->actor.yawTowardsPlayer)) < 0x4000) {
+ frontRoom = -1;
+ }
+ }
+ return frontRoom == this->actor.room;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A0F88.s")
+s32 DoorShutter_SetupDoor(DoorShutter* this, GlobalContext* globalCtx) {
+ ShutterObjectInfo* sp24 = &D_808A2180[this->unk_163];
+ s32 doorType = this->doorType;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1080.s")
+ if (doorType != 4) {
+ if (func_808A0900(this, globalCtx)) {
+ if ((doorType == 7) || (doorType == 6)) {
+ doorType = 1;
+ } else if (doorType == 5) {
+ doorType = 3;
+ } else {
+ doorType = 0;
+ }
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1090.s")
+ if (doorType == 0) {
+ this->unk_164 = sp24->index1;
+ } else {
+ this->unk_164 = sp24->index2;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1288.s")
+ if (doorType == 1) {
+ if (!Flags_GetClear(globalCtx, this->actor.room)) {
+ DoorShutter_SetupAction(this, func_808A0F88);
+ this->unk_168 = 1.0f;
+ return true;
+ }
+ } else if ((doorType == 2) || (doorType == 7)) {
+ if (!Flags_GetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor))) {
+ DoorShutter_SetupAction(this, func_808A1548);
+ this->unk_168 = 1.0f;
+ return true;
+ }
+ DoorShutter_SetupAction(this, func_808A1618);
+ return false;
+ } else if (doorType == 3) {
+ DoorShutter_SetupAction(this, func_808A1080);
+ this->unk_168 = 1.0f;
+ return false;
+ }
+ DoorShutter_SetupAction(this, func_808A1090);
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1340.s")
+void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ DoorShutter* this = THIS;
+ s32 sp24;
+ s32 i;
+ s8 objId;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1478.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ this->doorType = DOORSHUTTER_GET_380(&this->actor);
+ sp24 = D_808A2240[this->doorType];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1548.s")
+ if (sp24 < 0) {
+ ShutterSceneInfo* shutterSceneInfo = &D_808A2258[0];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1618.s")
+ for (i = 0; i < ARRAY_COUNT(D_808A2258) - 1; i++, shutterSceneInfo++) {
+ if (globalCtx->sceneNum == shutterSceneInfo->sceneNum) {
+ break;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1684.s")
+ sp24 = shutterSceneInfo->index;
+ if (sp24 == 6) {
+ this->actor.flags |= ACTOR_FLAG_10000000;
+ }
+ } else if (sp24 == 0) {
+ BossDoorInfo* bossDoorInfo = &D_808A22A0[0];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1784.s")
+ for (i = 0; i < ARRAY_COUNT(D_808A22A0) - 1; i++, bossDoorInfo++) {
+ if ((globalCtx->sceneNum == bossDoorInfo->dungeonScene) ||
+ (globalCtx->sceneNum == bossDoorInfo->bossScene)) {
+ break;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1884.s")
+ this->unk_15E = bossDoorInfo->index;
+ } else {
+ this->actor.room = -1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1A70.s")
+ // clang-format off
+ objId = Object_GetIndex(&globalCtx->objectCtx, D_808A2180[sp24].objectId); this->requiredObjBankIndex = objId; if (objId < 0) { Actor_MarkForDeath(&this->actor); return; }
+ // clang-format on
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1B48.s")
+ DoorShutter_SetupAction(this, DoorShutter_SetupType);
+ this->unk_163 = sp24;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1C50.s")
+ if ((this->doorType == 4) || (this->doorType == 5)) {
+ if (!Flags_GetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor))) {
+ this->unk_166 = 10;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/DoorShutter_Update.s")
+ Actor_SetFocus(&this->actor, 60.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1D68.s")
+void DoorShutter_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ DoorShutter* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Shutter/func_808A1E14.s")
+ if (this->actor.room >= 0) {
+ s32 transitionActorId = DOORSHUTTER_GET_FC00(&this->actor);
+
+ globalCtx->doorCtx.transitionActorList[transitionActorId].id =
+ -globalCtx->doorCtx.transitionActorList[transitionActorId].id;
+ }
+}
+
+void DoorShutter_SetupType(DoorShutter* this, GlobalContext* globalCtx) {
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->requiredObjBankIndex) && ((MREG(64) == 0) || (MREG(68) == 0))) {
+ this->actor.objBankIndex = this->requiredObjBankIndex;
+ this->actor.draw = DoorShutter_Draw;
+ DoorShutter_SetupDoor(this, globalCtx);
+ }
+}
+
+f32 func_808A0D90(GlobalContext* globalCtx, DoorShutter* this, f32 arg2, f32 arg3, f32 arg4) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp28;
+ Vec3f sp1C;
+
+ sp28.x = player->actor.world.pos.x;
+ sp28.y = player->actor.world.pos.y + arg2;
+ sp28.z = player->actor.world.pos.z;
+
+ Actor_OffsetOfPointInActorCoords(&this->actor, &sp1C, &sp28);
+
+ if ((arg3 < fabsf(sp1C.x)) || (arg4 < fabsf(sp1C.y))) {
+ return FLT_MAX;
+ }
+ return sp1C.z;
+}
+
+s32 func_808A0E28(DoorShutter* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (!Player_InCsMode(&globalCtx->state)) {
+ ShutterInfo* shutterInfo = &D_808A21B0[this->unk_164];
+ f32 temp_f0 = func_808A0D90(globalCtx, this, 0.0f, shutterInfo->unk_0A, shutterInfo->unk_0B);
+
+ if (fabsf(temp_f0) < 50.0f) {
+ s16 temp_v0_2 = BINANG_SUB(player->actor.shape.rot.y, this->actor.shape.rot.y);
+
+ if (temp_f0 > 0.0f) {
+ temp_v0_2 = 0x8000 - temp_v0_2;
+ }
+
+ if (ABS_ALT(temp_v0_2) < 0x3000) {
+ return (temp_f0 >= 0.0f) ? 1.0f : -1.0f;
+ }
+ }
+ }
+ return false;
+}
+
+void func_808A0F88(DoorShutter* this, GlobalContext* globalCtx) {
+ if (Flags_GetClear(globalCtx, this->actor.room) || Flags_GetClearTemp(globalCtx, this->actor.room)) {
+ this->unk_160 = this->actor.cutscene;
+ if (this->doorType == 7) {
+ if (this->unk_160 != -1) {
+ this->unk_160 = ActorCutscene_GetAdditionalCutscene(this->unk_160);
+ }
+ }
+
+ if (ActorCutscene_GetCanPlayNext(this->unk_160)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_160, &this->actor);
+ Flags_SetClear(globalCtx, this->actor.room);
+ DoorShutter_SetupAction(this, func_808A1784);
+ this->unk_167 = -1;
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_160);
+ }
+ } else if (func_808A0E28(this, globalCtx)) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->doorType = -1;
+ player->doorActor = &this->actor;
+ this->actor.textId = 0x1801;
+ func_80122F28(player);
+ }
+}
+
+void func_808A1080(DoorShutter* this, GlobalContext* globalCtx) {
+}
+
+void func_808A1090(DoorShutter* this, GlobalContext* globalCtx) {
+ if (this->unk_15C != 0) {
+ DoorShutter_SetupAction(this, func_808A1684);
+ this->actor.velocity.y = 0.0f;
+ if (this->unk_166 != 0) {
+ Flags_SetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor));
+ if (this->doorType != 5) {
+ gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
+ } else {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
+ }
+ }
+ } else {
+ s32 doorDirection = func_808A0E28(this, globalCtx);
+
+ if (doorDirection != 0) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->doorType = 2;
+ player->doorDirection = doorDirection;
+ player->doorActor = &this->actor;
+
+ if (this->unk_163 == 7) {
+ player->doorTimer = 12;
+ } else {
+ player->doorTimer = 0;
+ }
+
+ if (this->doorType == 6) {
+ if (gSaveContext.healthCapacity < (DOORSHUTTER_GET_1F(&this->actor) * 0x10)) {
+ player->doorType = -1;
+ this->actor.textId = 0x14FC;
+ }
+ } else if (this->unk_166 != 0) {
+ if (this->doorType == 5) {
+ if (!CHECK_DUNGEON_ITEM(0, gSaveContext.mapIndex)) {
+ player->doorType = -1;
+ this->actor.textId = 0x1803;
+ }
+ player->doorTimer += 10;
+ } else if (DUNGEON_KEY_COUNT(gSaveContext.mapIndex) <= 0) {
+ player->doorType = -1;
+ this->actor.textId = 0x1802;
+ } else {
+ player->doorTimer += 10;
+ }
+ }
+ func_80122F28(player);
+ }
+ }
+}
+
+void func_808A1288(DoorShutter* this, GlobalContext* globalCtx) {
+ if (this->actor.category == ACTORCAT_DOOR) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 sp38 = this->unk_164;
+ s32 sp34 = 0xF;
+
+ if (DoorShutter_SetupDoor(this, globalCtx)) {
+ sp34 = 0x20;
+ }
+
+ DoorShutter_SetupAction(this, func_808A1684);
+
+ this->unk_164 = sp38;
+ this->unk_168 = 0.0f;
+
+ func_800DFFAC(globalCtx->cameraPtrs[CAM_ID_MAIN], &this->actor, player->unk_3BA, this->unk_168, 12, sp34, 10);
+ }
+}
+
+s32 func_808A1340(DoorShutter* this, GlobalContext* globalCtx) {
+ Vec3f sp2C;
+
+ if (this->actor.velocity.y == 0.0f) {
+ func_808A1288(this, globalCtx);
+ if (this->unk_163 != 7) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIDE_DOOR_OPEN);
+ }
+ }
+
+ if (this->unk_163 == 7) {
+ s32 pad;
+
+ if (this->unk_163 == 7) {
+ func_800B9010(&this->actor, NA_SE_EV_IKANA_DOOR_OPEN - SFX_FLAG);
+ }
+
+ Lib_Vec3f_TranslateAndRotateY(&this->actor.home.pos, this->actor.shape.rot.y,
+ (this->unk_163 == 7) ? &D_808A22C4 : &D_808A22D0, &sp2C);
+ Math_StepToF(&this->actor.velocity.y, 5.0f, 0.5f);
+
+ if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &sp2C, this->actor.velocity.y) == 0.0f) {
+ return true;
+ }
+ } else {
+ Math_StepToF(&this->actor.velocity.y, 15.0f, 3.0f);
+
+ if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 200.0f, this->actor.velocity.y)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+s32 func_808A1478(DoorShutter* this, GlobalContext* globalCtx, f32 arg2) {
+ f32 temp = 1.0f - arg2;
+
+ if (temp == this->unk_168) {
+ if (arg2 == 1.0f) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METALDOOR_CLOSE);
+ } else {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_METALDOOR_OPEN);
+ }
+
+ if ((this->unk_160 != -1) && (ActorCutscene_GetCurrentIndex() == this->unk_160)) {
+ func_800B724C(globalCtx, &this->actor, 1);
+ }
+ }
+
+ if (Math_StepToF(&this->unk_168, arg2, 0.2f)) {
+ return true;
+ }
+ return false;
+}
+
+void func_808A1548(DoorShutter* this, GlobalContext* globalCtx) {
+ if (func_808A1478(this, globalCtx, 1.0f)) {
+ if (Flags_GetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor))) {
+ this->unk_160 = this->actor.cutscene;
+ if (ActorCutscene_GetCanPlayNext(this->unk_160)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_160, &this->actor);
+ DoorShutter_SetupAction(this, func_808A1784);
+ this->unk_167 = -1;
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_160);
+ }
+ } else if (func_808A0E28(this, globalCtx)) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->doorType = -1;
+ player->doorActor = &this->actor;
+ this->actor.textId = 0x1800;
+ func_80122F28(player);
+ }
+ }
+}
+
+void func_808A1618(DoorShutter* this, GlobalContext* globalCtx) {
+ if ((this->unk_15C == 0) && !Flags_GetSwitch(globalCtx, DOORSHUTTER_GET_7F(&this->actor))) {
+ DoorShutter_SetupAction(this, func_808A1548);
+ } else {
+ func_808A1090(this, globalCtx);
+ }
+}
+
+void func_808A1684(DoorShutter* this, GlobalContext* globalCtx) {
+ f32 phi_f0;
+
+ if ((DECR(this->unk_166) == 0) && (globalCtx->roomCtx.unk31 == 0) && func_808A1340(this, globalCtx)) {
+ if (this->doorType == 5) {
+ phi_f0 = 20.0f;
+ } else {
+ phi_f0 = 50.0f;
+ }
+
+ if (phi_f0 < this->actor.xzDistToPlayer) {
+ if (this->unk_163 == 7) {
+ this->actor.velocity.y = 0.0f;
+ } else {
+ if (DoorShutter_SetupDoor(this, globalCtx)) {
+ this->actor.velocity.y = 30.0f;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIDE_DOOR_CLOSE);
+ }
+ DoorShutter_SetupAction(this, func_808A1B48);
+ }
+ }
+}
+
+void func_808A1784(DoorShutter* this, GlobalContext* globalCtx) {
+ if (this->unk_167 != 0) {
+ if (func_800F22C4(this->unk_160, &this->actor)) {
+ if (this->unk_167 < 0) {
+ if ((globalCtx->state.frames % 2) != 0) {
+ this->unk_167++;
+ }
+ } else {
+ this->unk_167--;
+ }
+ }
+ } else if (func_808A1478(this, globalCtx, 0.0f)) {
+ u8 doorType = this->doorType;
+
+ if ((doorType != 0) && (doorType != 1) &&
+ (((doorType != 7) && (doorType != 6)) || !func_808A0900(this, globalCtx))) {
+ DoorShutter_SetupAction(this, func_808A1618);
+ } else {
+ DoorShutter_SetupAction(this, func_808A1090);
+ }
+ func_801A2ED8();
+ }
+}
+
+void func_808A1884(DoorShutter* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s8 room = this->actor.room;
+ Vec3f sp44;
+
+ if (this->actor.room >= 0) {
+ Actor_OffsetOfPointInActorCoords(&this->actor, &sp44, &player->actor.world.pos);
+
+ this->actor.room = globalCtx->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)]
+ .sides[(sp44.z < 0.0f) ? 0 : 1]
+ .room;
+
+ if (room != this->actor.room) {
+ Room temp = globalCtx->roomCtx.currRoom;
+
+ globalCtx->roomCtx.currRoom = globalCtx->roomCtx.prevRoom;
+ globalCtx->roomCtx.prevRoom = temp;
+ globalCtx->roomCtx.activeMemPage ^= 1;
+ }
+ func_8012EBF8(globalCtx, &globalCtx->roomCtx);
+ }
+
+ this->unk_15C = 0;
+ this->actor.velocity.y = 0.0f;
+
+ if (DoorShutter_SetupDoor(this, globalCtx) && !(player->stateFlags1 & 0x800)) {
+ DoorShutter_SetupAction(this, func_808A1C50);
+ if (ActorCutscene_GetCurrentIndex() == 0x7D) {
+ s8 data = gSaveContext.respawn[0].data;
+
+ func_801226E0(globalCtx, data);
+ player->unk_A86 = -1;
+ func_800B7298(globalCtx, NULL, 0x73);
+ }
+ }
+}
+
+s32 func_808A1A70(DoorShutter* this) {
+ if (this->unk_163 == 7) {
+ if (this->unk_163 == 7) {
+ func_800B9010(&this->actor, NA_SE_EV_IKANA_DOOR_CLOSE - SFX_FLAG);
+ }
+
+ Math_StepToF(&this->actor.velocity.y, 5.0f, 0.5f);
+
+ if (Math_Vec3f_StepToXZ(&this->actor.world.pos, &this->actor.home.pos, this->actor.velocity.y) == 0.0f) {
+ return true;
+ }
+ } else {
+ if (this->actor.velocity.y < 20.0f) {
+ Math_StepToF(&this->actor.velocity.y, 20.0f, 8.0f);
+ }
+
+ if (Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, this->actor.velocity.y)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+void func_808A1B48(DoorShutter* this, GlobalContext* globalCtx) {
+ s16 quake;
+
+ if (func_808A1A70(this)) {
+ if (this->actor.velocity.y > 20.0f) {
+ this->actor.floorHeight = this->actor.home.pos.y;
+ Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 45.0f, 10, 8.0f, 500, 10, 0);
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BIGWALL_BOUND);
+ quake = Quake_Add(Play_GetCamera(globalCtx, 0), 3);
+ Quake_SetSpeed(quake, -32536);
+ Quake_SetQuakeValues(quake, 2, 0, 0, 0);
+ Quake_SetCountdown(quake, 10);
+ func_8013ECE0(this->actor.xyzDistToPlayerSq, 180, 20, 100);
+ func_808A1884(this, globalCtx);
+ }
+}
+
+void func_808A1C50(DoorShutter* this, GlobalContext* globalCtx) {
+ if (this->unk_167++ > 30) {
+ if (GET_PLAYER(globalCtx)->csMode == 0x73) {
+ func_800B7298(globalCtx, NULL, 6);
+ }
+ DoorShutter_SetupDoor(this, globalCtx);
+ }
+}
+
+void DoorShutter_Update(Actor* thisx, GlobalContext* globalCtx) {
+ DoorShutter* this = THIS;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (!(player->stateFlags1 & 0x100004C0) || (this->actionFunc == DoorShutter_SetupType)) {
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_163 == 7) {
+ this->actor.home.rot.z = Math_Vec3f_DistXZ(&this->actor.home.pos, &this->actor.world.pos) * -100.0f;
+ }
+ }
+}
+
+s32 func_808A1D68(DoorShutter* this, GlobalContext* globalCtx) {
+ s32 temp_a0;
+ s32 temp_a1;
+
+ if (Player_InCsMode(&globalCtx->state)) {
+ return true;
+ }
+
+ temp_a0 = BINANG_SUB(Actor_YawToPoint(&this->actor, &globalCtx->view.eye), this->actor.shape.rot.y);
+ temp_a1 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y);
+
+ temp_a0 = ABS_ALT(temp_a0);
+ temp_a1 = ABS_ALT(temp_a1);
+
+ if (((temp_a1 < 0x4000) && (temp_a0 > 0x4000)) || ((temp_a1 > 0x4000) && (temp_a0 < 0x4000))) {
+ return false;
+ }
+ return true;
+}
+
+void DoorShutter_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ DoorShutter* this = THIS;
+ ShutterInfo* sp44;
+
+ if (func_808A1D68(this, globalCtx)) {
+ sp44 = &D_808A21B0[this->unk_164];
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ if (this->unk_164 == 7) {
+ Matrix_InsertTranslation(0.0f, 64.96f, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->actor.home.rot.z, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, -64.96f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if (sp44->unk_04 != 0) {
+ TransitionActorEntry* transitionEntry =
+ &globalCtx->doorCtx.transitionActorList[DOORSHUTTER_GET_FC00(&this->actor)];
+
+ if ((globalCtx->roomCtx.prevRoom.num >= 0) ||
+ (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) {
+ s16 yaw = this->actor.shape.rot.y - Math_Vec3f_Yaw(&globalCtx->view.eye, &this->actor.world.pos);
+
+ if (ABS_ALT(yaw) < 0x4000) {
+ Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
+ }
+ } else if (this->actor.room == transitionEntry->sides[0].room) {
+ Matrix_InsertYRotation_f(M_PI, MTXMODE_APPLY);
+ }
+ } else if (this->doorType == 5) {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_808A22DC[this->unk_15E]));
+ }
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, sp44->unk_00);
+
+ if ((this->unk_168 != 0.0f) && (sp44->unk_04 != 0)) {
+ Matrix_InsertTranslation(0.0f, sp44->unk_08 * (1.0f - this->unk_168), sp44->translateZ, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, sp44->unk_04);
+ }
+
+ if (this->unk_166 != 0) {
+ Matrix_Scale(0.01f, 0.01f, 0.025f, MTXMODE_APPLY);
+ Actor_DrawDoorLock(globalCtx, this->unk_166, (this->doorType == 5) ? DOORLOCK_BOSS : DOORLOCK_NORMAL);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
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 e9da6684bf..0b796d442f 100644
--- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h
+++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h
@@ -7,9 +7,24 @@ struct DoorShutter;
typedef void (*DoorShutterActionFunc)(struct DoorShutter*, GlobalContext*);
+#define DOORSHUTTER_GET_1F(thisx) ((thisx)->params & 0x1F)
+#define DOORSHUTTER_GET_7F(thisx) ((thisx)->params & 0x7F)
+#define DOORSHUTTER_GET_380(thisx) (((thisx)->params >> 7) & 7)
+#define DOORSHUTTER_GET_FC00(thisx) (((u16)(thisx)->params >> 0xA))
+
typedef struct DoorShutter {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x28];
+ /* 0x0144 */ UNK_TYPE1 unk144[0x18];
+ /* 0x015C */ s16 unk_15C;
+ /* 0x015E */ s16 unk_15E;
+ /* 0x0160 */ s16 unk_160;
+ /* 0x0162 */ u8 doorType;
+ /* 0x0163 */ u8 unk_163;
+ /* 0x0164 */ u8 unk_164;
+ /* 0x0165 */ s8 requiredObjBankIndex;
+ /* 0x0166 */ s8 unk_166;
+ /* 0x0167 */ s8 unk_167;
+ /* 0x0168 */ f32 unk_168;
/* 0x016C */ DoorShutterActionFunc actionFunc;
} DoorShutter; // size = 0x170
diff --git a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
index 3e9754ccfc..a2bc8a0be8 100644
--- a/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
+++ b/src/overlays/actors/ovl_Door_Spiral/z_door_spiral.c
@@ -5,8 +5,16 @@
*/
#include "z_door_spiral.h"
+#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
+#include "objects/object_numa_obj/object_numa_obj.h"
+#include "objects/object_hakugin_obj/object_hakugin_obj.h"
+#include "objects/object_ikana_obj/object_ikana_obj.h"
+#include "objects/object_ikninside_obj/object_ikninside_obj.h"
+#include "objects/object_danpei_object/object_danpei_object.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
+
+#define THIS ((DoorSpiral*)thisx)
#define GET_ORIENTATION_PARAM(this) ((((Actor*)(this))->params >> 7) & 0x1)
#define GET_UNK145_PARAM(this) ((((Actor*)(this))->params >> 8) & 0x3)
@@ -75,29 +83,16 @@ const ActorInit Door_Spiral_InitVars = {
(ActorFunc)DoorSpiral_Draw,
};
-extern Gfx D_06000590[];
-extern Gfx D_060007A8[];
-extern Gfx D_06000EA0[];
-extern Gfx D_060012C0[];
-extern Gfx D_060014C8[];
-extern Gfx D_06002110[];
-extern Gfx D_06004448[];
-extern Gfx D_060051B8[];
-extern Gfx D_06006128[];
-extern Gfx D_06009278[];
-extern Gfx D_06012B70[];
-extern Gfx D_06013EA8[];
-
// Parameters for each staircase, indexed with SpiralType
static SpiralInfo sSpiralInfo[] = {
- { { NULL, NULL }, 0, 130, 12, 50, 15 }, // SPIRAL_OVERWORLD
- { { D_050219E0, D_0501D980 }, 0, 130, 12, 50, 15 }, // SPIRAL_DUNGEON
- { { D_06004448, D_060007A8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE
- { { D_060051B8, D_060014C8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE_ALT
- { { D_06009278, D_06006128 }, 0, 130, 12, 50, 15 }, // SPIRAL_SNOWHEAD_TEMPLE
- { { D_06013EA8, D_06012B70 }, 0, 130, 12, 50, 15 }, // SPIRAL_STONE_TOWER
- { { D_06000EA0, D_06000590 }, 0, 130, 12, 50, 15 }, // SPIRAL_IKANA_CASTLE
- { { D_06002110, D_060012C0 }, 0, 130, 12, 50, 15 }, // SPIRAL_DAMPES_HOUSE
+ { { NULL, NULL }, 0, 130, 12, 50, 15 }, // SPIRAL_OVERWORLD
+ { { gameplay_dangeon_keep_DL_0219E0, gameplay_dangeon_keep_DL_01D980 }, 0, 130, 12, 50, 15 }, // SPIRAL_DUNGEON
+ { { object_numa_obj_DL_004448, object_numa_obj_DL_0007A8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE
+ { { object_numa_obj_DL_0051B8, object_numa_obj_DL_0014C8 }, 0, 130, 12, 50, 15 }, // SPIRAL_WOODFALL_TEMPLE_ALT
+ { { object_hakugin_obj_DL_009278, object_hakugin_obj_DL_006128 }, 0, 130, 12, 50, 15 }, // SPIRAL_SNOWHEAD_TEMPLE
+ { { object_ikana_obj_DL_013EA8, object_ikana_obj_DL_012B70 }, 0, 130, 12, 50, 15 }, // SPIRAL_STONE_TOWER
+ { { object_ikninside_obj_DL_000EA0, object_ikninside_obj_DL_000590 }, 0, 130, 12, 50, 15 }, // SPIRAL_IKANA_CASTLE
+ { { object_danpei_object_DL_002110, object_danpei_object_DL_0012C0 }, 0, 130, 12, 50, 15 }, // SPIRAL_DAMPES_HOUSE
};
// Defines which object bank a staircase should use, and its index to `sSpiralInfo`
@@ -130,7 +125,7 @@ s32 DoorSpiral_SetSpiralType(DoorSpiral* this, GlobalContext* globalCtx) {
this->spiralType = SPIRAL_WOODFALL_TEMPLE_ALT;
}
- this->actor.flags |= 0x10000000;
+ this->actor.flags |= ACTOR_FLAG_10000000;
}
DoorSpiral_SetupAction(this, DoorSpiral_Wait);
@@ -182,7 +177,7 @@ static InitChainEntry sInitChain[] = {
};
void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
- DoorSpiral* this = (DoorSpiral*)thisx;
+ DoorSpiral* this = THIS;
s32 pad;
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
s8 objBankId;
@@ -291,7 +286,7 @@ void DoorSpiral_Wait(DoorSpiral* this, GlobalContext* globalCtx) {
transition = GET_TRANSITION_ID_PARAM(this);
player->doorNext = ((u16)globalCtx->doorCtx.transitionActorList[transition].params) >> 10;
- func_80122F28(player, globalCtx, &this->actor);
+ func_80122F28(player);
}
}
@@ -308,7 +303,7 @@ void DoorSpiral_PlayerClimb(DoorSpiral* this, GlobalContext* globalCtx) {
}
void DoorSpiral_Update(Actor* thisx, GlobalContext* globalCtx) {
- DoorSpiral* this = (DoorSpiral*)thisx;
+ DoorSpiral* this = THIS;
s32 pad;
Player* player = GET_PLAYER(globalCtx);
@@ -319,7 +314,7 @@ void DoorSpiral_Update(Actor* thisx, GlobalContext* globalCtx) {
void DoorSpiral_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
- DoorSpiral* this = (DoorSpiral*)thisx;
+ DoorSpiral* this = THIS;
if (this->actor.objBankIndex == this->bankIndex) {
SpiralInfo* spiralInfo = &sSpiralInfo[this->spiralType];
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 6d933ecd95..a1a738fee8 100644
--- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
+++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c
@@ -177,10 +177,10 @@ void DoorWarp1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->unk_1DC);
LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->unk_1F0);
- for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.unk_8C.diffuseColor1); i++) {
- globalCtx->envCtx.unk_8C.diffuseColor1[i] = 0;
- globalCtx->envCtx.unk_8C.fogColor[i] = globalCtx->envCtx.unk_8C.diffuseColor1[i];
- globalCtx->envCtx.unk_8C.ambientColor[i] = globalCtx->envCtx.unk_8C.diffuseColor1[i];
+ for (i = 0; i < ARRAY_COUNT(globalCtx->envCtx.lightSettings.diffuseColor1); i++) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[i] = 0;
+ globalCtx->envCtx.lightSettings.fogColor[i] = globalCtx->envCtx.lightSettings.diffuseColor1[i];
+ globalCtx->envCtx.lightSettings.ambientColor[i] = globalCtx->envCtx.lightSettings.diffuseColor1[i];
}
if (this->unk_1D3 != 0) {
@@ -279,14 +279,15 @@ void func_808B8E78(DoorWarp1* this, GlobalContext* globalCtx) {
}
s32 func_808B900C(DoorWarp1* this, GlobalContext* globalCtx) {
- u32 index;
+ s32 index;
u8 ret = false;
- if (func_800EE29C(globalCtx, 0x239)) {
- index = func_800EE200(globalCtx, 0x239);
- if (this->unk_208 != globalCtx->csCtx.npcActions[index]->unk0) {
- this->unk_208 = globalCtx->csCtx.npcActions[index]->unk0;
- if (globalCtx->csCtx.npcActions[index]->unk0 == 2) {
+ if (Cutscene_CheckActorAction(globalCtx, 569)) {
+ index = Cutscene_GetActorActionIndex(globalCtx, 569);
+
+ if (this->unk_208 != globalCtx->csCtx.actorActions[index]->action) {
+ this->unk_208 = globalCtx->csCtx.actorActions[index]->action;
+ if (globalCtx->csCtx.actorActions[index]->action == 2) {
ret = true;
}
}
@@ -344,7 +345,7 @@ void func_808B921C(DoorWarp1* this, GlobalContext* globalCtx) {
if (func_808B866C(this, globalCtx) && !func_801690CC(globalCtx)) {
func_800B7298(globalCtx, &this->dyna.actor, 7);
- func_801518B0(globalCtx, 0xF2, &this->dyna.actor);
+ Message_StartTextbox(globalCtx, 0xF2, &this->dyna.actor);
DoorWarp1_SetupAction(this, func_808B93A0);
}
@@ -552,28 +553,27 @@ void func_808B9CE8(DoorWarp1* this, GlobalContext* globalCtx) {
switch (globalCtx->sceneNum) {
case SCENE_MITURIN_BS:
- gSaveContext.roomInf[126][3] =
- (((void)0, gSaveContext.roomInf[126][3]) & 0xFFFFFF00) | (((u8)gSaveContext.roomInf[126][4]) & 0xFF);
+ gSaveContext.unk_ECC[0] =
+ (((void)0, gSaveContext.unk_ECC[0]) & 0xFFFFFF00) | (((u8)gSaveContext.unk_ECC[1]) & 0xFF);
break;
case SCENE_HAKUGIN_BS:
- gSaveContext.roomInf[126][3] = (((void)0, gSaveContext.roomInf[126][3]) & 0xFFFF00FF) |
- ((((u8)gSaveContext.roomInf[126][4]) & 0xFF) << 8);
+ gSaveContext.unk_ECC[0] =
+ (((void)0, gSaveContext.unk_ECC[0]) & 0xFFFF00FF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 8);
break;
case SCENE_INISIE_BS:
- gSaveContext.roomInf[126][3] = (((void)0, gSaveContext.roomInf[126][3]) & 0xFF00FFFF) |
- ((((u8)gSaveContext.roomInf[126][4]) & 0xFF) << 0x10);
+ gSaveContext.unk_ECC[0] =
+ (((void)0, gSaveContext.unk_ECC[0]) & 0xFF00FFFF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 0x10);
break;
case SCENE_SEA_BS:
- gSaveContext.roomInf[126][3] = (((void)0, gSaveContext.roomInf[126][3]) & 0x00FFFFFF) |
- ((((u8)gSaveContext.roomInf[126][4]) & 0xFF) << 0x18);
+ gSaveContext.unk_ECC[0] =
+ (((void)0, gSaveContext.unk_ECC[0]) & 0x00FFFFFF) | ((((u8)gSaveContext.unk_ECC[1]) & 0xFF) << 0x18);
break;
}
- gSaveContext.roomInf[126][4] =
- (gSaveContext.roomInf[126][4] & 0xFFFFFF00) | ((((u8)gSaveContext.roomInf[126][4]) + 1) & 0xFF);
+ gSaveContext.unk_ECC[1] = (gSaveContext.unk_ECC[1] & 0xFFFFFF00) | ((((u8)gSaveContext.unk_ECC[1]) + 1) & 0xFF);
Item_Give(globalCtx, func_808B849C(this, globalCtx) + (ITEM_REMAINS_ODOLWA - 1));
DoorWarp1_SetupAction(this, func_808B9E94);
}
@@ -656,19 +656,19 @@ void func_808BA10C(DoorWarp1* this, GlobalContext* globalCtx) {
switch (phi_v0_2) {
case 0:
- phi_a0 = gSaveContext.roomInf[126][3] & 0xFF;
+ phi_a0 = gSaveContext.unk_ECC[0] & 0xFF;
break;
case 1:
- phi_a0 = (gSaveContext.roomInf[126][3] & 0xFF00) >> 8;
+ phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF00) >> 8;
break;
case 2:
- phi_a0 = (gSaveContext.roomInf[126][3] & 0xFF0000) >> 0x10;
+ phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF0000) >> 0x10;
break;
case 3:
- phi_a0 = (gSaveContext.roomInf[126][3] & 0xFF000000) >> 0x18;
+ phi_a0 = (gSaveContext.unk_ECC[0] & 0xFF000000) >> 0x18;
break;
default:
@@ -832,15 +832,15 @@ void func_808BA550(DoorWarp1* this, GlobalContext* globalCtx) {
}
if (this->unk_1D0 > 140) {
- globalCtx->envCtx.unk_E5 = 1;
+ globalCtx->envCtx.fillScreen = 1;
temp_f0 = (this->unk_1D0 - 140) / 20.0f;
if (temp_f0 > 1.0f) {
temp_f0 = 1.0f;
}
- globalCtx->envCtx.unk_E6[0] = 160;
- globalCtx->envCtx.unk_E6[1] = 160;
- globalCtx->envCtx.unk_E6[2] = 160;
- globalCtx->envCtx.unk_E6[3] = 255.0f * temp_f0;
+ globalCtx->envCtx.screenFillColor[0] = 160;
+ globalCtx->envCtx.screenFillColor[1] = 160;
+ globalCtx->envCtx.screenFillColor[2] = 160;
+ globalCtx->envCtx.screenFillColor[3] = 255.0f * temp_f0;
}
Lights_PointNoGlowSetInfo(&this->unk_1E0, player->actor.world.pos.x + 10.0f, player->actor.world.pos.y + 10.0f,
@@ -863,13 +863,13 @@ void func_808BA550(DoorWarp1* this, GlobalContext* globalCtx) {
temp_f16 = -255.0f * temp_f0;
for (i = 0; i < 3; i++) {
- globalCtx->envCtx.unk_8C.diffuseColor1[i] = temp_f16;
- globalCtx->envCtx.unk_8C.fogColor[i] = temp_f16;
- globalCtx->envCtx.unk_8C.ambientColor[i] = temp_f16;
+ globalCtx->envCtx.lightSettings.diffuseColor1[i] = temp_f16;
+ globalCtx->envCtx.lightSettings.fogColor[i] = temp_f16;
+ globalCtx->envCtx.lightSettings.ambientColor[i] = temp_f16;
}
- globalCtx->envCtx.unk_8C.fogNear = -500.0f * temp_f0;
- if (globalCtx->envCtx.unk_8C.fogNear < -300) {
+ globalCtx->envCtx.lightSettings.fogNear = -500.0f * temp_f0;
+ if (globalCtx->envCtx.lightSettings.fogNear < -300) {
globalCtx->roomCtx.currRoom.segment = NULL;
}
}
@@ -1035,7 +1035,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + this->unk_1A4,
this->dyna.actor.world.pos.z, MTXMODE_NEW);
Matrix_Scale(4.0f, this->unk_1AC, 4.0f, MTXMODE_APPLY);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_0044D8));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0044D8));
Gfx_DrawDListXlu(globalCtx, object_warp1_DL_003230);
return;
}
@@ -1054,7 +1054,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
MTXMODE_NEW);
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
Matrix_Scale(1.0f, this->unk_1A8, 1.0f, MTXMODE_APPLY);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_0057D8));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_0057D8));
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -1066,7 +1066,7 @@ void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2) {
gSPDisplayList(POLY_XLU_DISP++, object_warp1_DL_004690);
gfxCtx = globalCtx->state.gfxCtx;
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_warp1_Matanimheader_007238));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_warp1_Matanimheader_007238));
Matrix_InsertTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z,
MTXMODE_NEW);
Matrix_RotateY(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
diff --git a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c
index 45a62ed729..d7bd601f08 100644
--- a/src/overlays/actors/ovl_Eff_Change/z_eff_change.c
+++ b/src/overlays/actors/ovl_Eff_Change/z_eff_change.c
@@ -6,7 +6,7 @@
#include "z_eff_change.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EffChange*)thisx)
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 697ea58e8f..e536356037 100644
--- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
+++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c
@@ -5,9 +5,10 @@
*/
#include "z_eff_dust.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
#include "system_malloc.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EffDust*)thisx)
@@ -295,7 +296,7 @@ void func_80919768(Actor* thisx, GlobalContext* globalCtx2) {
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
- gSPDisplayList(POLY_XLU_DISP++, D_04054A90);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054A90);
gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
}
@@ -351,7 +352,7 @@ void func_809199FC(Actor* thisx, GlobalContext* globalCtx2) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
- gSPDisplayList(POLY_XLU_DISP++, D_04054A90);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054A90);
gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
}
diff --git a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
index faea4c4e42..687ae1b96f 100644
--- a/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
+++ b/src/overlays/actors/ovl_Eff_Kamejima_Wave/z_eff_kamejima_wave.c
@@ -6,7 +6,7 @@
#include "z_eff_kamejima_wave.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EffKamejimaWave*)thisx)
diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c
index 4f9138aa7f..3901c01796 100644
--- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c
+++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c
@@ -6,7 +6,7 @@
#include "z_eff_lastday.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EffLastday*)thisx)
diff --git a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c
index b02e52e571..b54bba5770 100644
--- a/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c
+++ b/src/overlays/actors/ovl_Eff_Stk/z_eff_stk.c
@@ -6,7 +6,7 @@
#include "z_eff_stk.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EffStk*)thisx)
diff --git a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c
index 6da3885bea..8ed8c6db44 100644
--- a/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c
+++ b/src/overlays/actors/ovl_Eff_Zoraband/z_eff_zoraband.c
@@ -6,7 +6,7 @@
#include "z_eff_zoraband.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EffZoraband*)thisx)
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 d3d0317ae3..372a21d11c 100644
--- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c
+++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c
@@ -6,7 +6,7 @@
#include "z_elf_msg.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg*)thisx)
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 ece5b9a5c6..5397ca5d6f 100644
--- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c
+++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c
@@ -6,7 +6,7 @@
#include "z_elf_msg2.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg2*)thisx)
diff --git a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c
index 95942b815a..dc0e5eb72f 100644
--- a/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c
+++ b/src/overlays/actors/ovl_Elf_Msg3/z_elf_msg3.c
@@ -6,7 +6,7 @@
#include "z_elf_msg3.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg3*)thisx)
diff --git a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c
index c55591fbaf..ca79813623 100644
--- a/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c
+++ b/src/overlays/actors/ovl_Elf_Msg4/z_elf_msg4.c
@@ -6,7 +6,7 @@
#include "z_elf_msg4.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg4*)thisx)
diff --git a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c
index 3fc56c89b6..aceb36807d 100644
--- a/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c
+++ b/src/overlays/actors/ovl_Elf_Msg5/z_elf_msg5.c
@@ -6,7 +6,7 @@
#include "z_elf_msg5.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg5*)thisx)
diff --git a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c
index ecd927765f..e7daab2940 100644
--- a/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c
+++ b/src/overlays/actors/ovl_Elf_Msg6/z_elf_msg6.c
@@ -6,7 +6,7 @@
#include "z_elf_msg6.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ElfMsg6*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ah/z_en_ah.c b/src/overlays/actors/ovl_En_Ah/z_en_ah.c
index 19a2aaf2d3..b7bec3f698 100644
--- a/src/overlays/actors/ovl_En_Ah/z_en_ah.c
+++ b/src/overlays/actors/ovl_En_Ah/z_en_ah.c
@@ -6,7 +6,7 @@
#include "z_en_ah.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnAh*)thisx)
diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
index a638422bff..7f540f3b64 100644
--- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
+++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c
@@ -7,7 +7,7 @@
#include "z_en_akindonuts.h"
#include "objects/object_dnt/object_dnt.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnAkindonuts*)thisx)
@@ -62,19 +62,30 @@ static ColliderCylinderInitType1 sCylinderInit = {
{ 27, 32, 0, { 0, 0, 0 } },
};
-static ActorAnimationEntryS sAnimations[] = {
- { &object_dnt_Anim_005488, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, 0, 0 },
- { &object_dnt_Anim_004AA0, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004E38, 1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_005CA8, 1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_0038CC, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003CC0, 1.0f, 0, -1, 0, 0 },
- { &object_dnt_Anim_0012F4, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_004700, 1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_003438, 1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_001E2C, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_000994, 1.0f, 0, -1, 0, 0 },
- { &object_dnt_Anim_002268, 1.0f, 0, -1, 2, 0 }, { &object_dnt_Anim_002F08, 1.0f, 0, -1, 0, 0 },
- { &object_dnt_Anim_00577C, 1.0f, 0, -1, 0, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 8, -1, 2, 0 },
- { &object_dnt_Anim_0029E8, 1.0f, 4, -1, 2, -4 }, { &object_dnt_Anim_0029E8, 1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_001BC8, 1.0f, 0, -1, 0, 0 }, { &object_dnt_Anim_0012F4, -1.0f, 0, -1, 2, 0 },
- { &object_dnt_Anim_002670, 1.0f, 0, -1, 2, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
static u16 D_80BF048C[] = {
@@ -246,16 +257,16 @@ void func_80BED090(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (player->transformation == PLAYER_FORM_DEKU) {
- gSaveContext.weekEventReg[63] |= 0x8;
+ gSaveContext.weekEventReg[63] |= 8;
gSaveContext.weekEventReg[63] &= (u8)~0x10;
} else if (player->transformation == PLAYER_FORM_ZORA) {
- gSaveContext.weekEventReg[63] &= (u8)~0x8;
+ gSaveContext.weekEventReg[63] &= (u8)~8;
gSaveContext.weekEventReg[63] |= 0x10;
} else if (player->transformation == PLAYER_FORM_GORON) {
- gSaveContext.weekEventReg[63] |= 0x8;
+ gSaveContext.weekEventReg[63] |= 8;
gSaveContext.weekEventReg[63] |= 0x10;
} else if (player->transformation == PLAYER_FORM_HUMAN) {
- gSaveContext.weekEventReg[63] &= (u8)~0x8;
+ gSaveContext.weekEventReg[63] &= (u8)~8;
gSaveContext.weekEventReg[63] &= (u8)~0x10;
}
}
@@ -264,19 +275,19 @@ s32 func_80BED140(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (player->transformation == PLAYER_FORM_DEKU) {
- if ((gSaveContext.weekEventReg[63] & 0x8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
+ if ((gSaveContext.weekEventReg[63] & 8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_ZORA) {
- if (!(gSaveContext.weekEventReg[63] & 0x8) && (gSaveContext.weekEventReg[63] & 0x10)) {
+ if (!(gSaveContext.weekEventReg[63] & 8) && (gSaveContext.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_GORON) {
- if ((gSaveContext.weekEventReg[63] & 0x8) && (gSaveContext.weekEventReg[63] & 0x10)) {
+ if ((gSaveContext.weekEventReg[63] & 8) && (gSaveContext.weekEventReg[63] & 0x10)) {
return true;
}
} else if (player->transformation == PLAYER_FORM_HUMAN) {
- if (!(gSaveContext.weekEventReg[63] & 0x8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
+ if (!(gSaveContext.weekEventReg[63] & 8) && !(gSaveContext.weekEventReg[63] & 0x10)) {
return true;
}
}
@@ -321,7 +332,7 @@ s32 func_80BED27C(EnAkindonuts* this) {
}
s32 func_80BED2FC(EnAkindonuts* this) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return 2;
}
@@ -335,7 +346,7 @@ s32 func_80BED2FC(EnAkindonuts* this) {
}
s32 func_80BED35C(EnAkindonuts* this) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return 2;
}
@@ -414,7 +425,7 @@ void func_80BED3BC(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C &= ~0x1;
this->unk_32C |= 0x40;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -444,7 +455,7 @@ void func_80BED3BC(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BED680(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -497,7 +508,7 @@ void func_80BED680(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -515,7 +526,7 @@ void func_80BED680(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BED8A4(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -592,7 +603,7 @@ void func_80BED8A4(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -621,7 +632,7 @@ void func_80BED8A4(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEDB88(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -630,7 +641,7 @@ void func_80BEDB88(EnAkindonuts* this, GlobalContext* globalCtx) {
switch (this->unk_33C) {
case 0:
if ((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.weekEventReg[62] & 2)) {
- gSaveContext.weekEventReg[62] |= 0x2;
+ gSaveContext.weekEventReg[62] |= 2;
this->unk_33C = 0x15F0;
break;
}
@@ -675,7 +686,7 @@ void func_80BEDB88(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -693,7 +704,7 @@ void func_80BEDB88(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -765,7 +776,7 @@ void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -785,7 +796,7 @@ void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
case 0x15FA:
this->unk_33C = 0x160D;
- gSaveContext.weekEventReg[62] |= 0x4;
+ gSaveContext.weekEventReg[62] |= 4;
this->unk_32C |= 0x20;
break;
@@ -794,7 +805,7 @@ void func_80BEDDAC(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEE070(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -843,7 +854,7 @@ void func_80BEE070(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x161A;
this->actionFunc = func_80BEF360;
@@ -861,7 +872,7 @@ void func_80BEE070(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEE274(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -926,7 +937,7 @@ void func_80BEE274(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x1629;
this->actionFunc = func_80BEF360;
@@ -955,7 +966,7 @@ void func_80BEE274(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEE530(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -1004,7 +1015,7 @@ void func_80BEE530(EnAkindonuts* this, GlobalContext* globalCtx) {
func_8019F208();
this->unk_32C |= 0x40;
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0x15EF;
this->actionFunc = func_80BEF360;
@@ -1022,7 +1033,7 @@ void func_80BEE530(EnAkindonuts* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_33C, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
}
void func_80BEE73C(EnAkindonuts* this, GlobalContext* globalCtx) {
@@ -1143,7 +1154,7 @@ void func_80BEE938(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) {
s16 sp26 = this->skelAnime.curFrame;
- s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common);
+ s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
s16 phi_v0;
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
@@ -1166,7 +1177,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) {
this->actionFunc = func_80BEEDC0;
this->unk_338 = 3;
this->collider.dim.height = 64;
- func_8013BC6C(&this->skelAnime, sAnimations, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
return;
}
}
@@ -1176,19 +1187,19 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) {
this->unk_338 = 17;
this->collider.dim.height = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
- func_8013BC6C(&this->skelAnime, sAnimations, 17);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 17);
} else if (this->unk_338 == 2) {
this->unk_338 = 16;
this->collider.dim.height = 32;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
- func_8013BC6C(&this->skelAnime, sAnimations, 16);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 16);
} else if (this->unk_338 == 17) {
phi_v0 = DECR(this->unk_33A);
if (phi_v0 == 0) {
this->unk_33A = Rand_ZeroOne() * 10.0f;
this->unk_338 = 2;
this->collider.dim.height = 32;
- func_8013BC6C(&this->skelAnime, sAnimations, 2);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2);
}
} else if (this->unk_338 == 16) {
phi_v0 = DECR(this->unk_33A);
@@ -1196,7 +1207,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) {
this->unk_33A = Rand_S16Offset(40, 40);
this->unk_338 = 18;
this->collider.dim.height = 32;
- func_8013BC6C(&this->skelAnime, sAnimations, 18);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18);
}
}
}
@@ -1205,7 +1216,7 @@ void func_80BEEB20(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEEDC0(EnAkindonuts* this, GlobalContext* globalCtx) {
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
this->actionFunc = func_80BEEE10;
- func_8013BC6C(&this->skelAnime, sAnimations, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0);
}
}
@@ -1223,7 +1234,7 @@ void func_80BEEE10(EnAkindonuts* this, GlobalContext* globalCtx) {
} else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) ||
!((this->actor.xzDistToPlayer < 200.0f) ? true : false)) {
this->unk_338 = 4;
- func_8013BC6C(&this->skelAnime, sAnimations, 4);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
this->actionFunc = func_80BEEB20;
}
}
@@ -1235,19 +1246,19 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) {
if (func_80147624(globalCtx)) {
if (this->unk_32C & 1) {
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0;
this->actionFunc = func_80BEEE10;
} else if (this->unk_32C & 0x20) {
this->unk_32C &= ~0x20;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_32C &= ~0x4;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_338 = 8;
this->unk_33C = 0;
- func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
this->actionFunc = func_80BEF518;
} else {
this->unk_2DC(this, globalCtx);
@@ -1275,7 +1286,7 @@ void func_80BEEFA8(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_33C = 0;
this->actionFunc = func_80BEEE10;
@@ -1285,24 +1296,24 @@ void func_80BEF18C(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEF20C(EnAkindonuts* this, GlobalContext* globalCtx) {
u8 sp27 = Message_GetState(&globalCtx->msgCtx);
s16 sp24 = this->skelAnime.curFrame;
- s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common);
+ s16 sp22 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
if (this->unk_356 == 40) {
this->unk_338 = 5;
- func_8013BC6C(&this->skelAnime, sAnimations, 5);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 5);
}
this->unk_356++;
if ((sp24 == sp22) && (this->unk_338 == 5)) {
this->unk_338 = 6;
- func_8013BC6C(&this->skelAnime, sAnimations, 6);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 6);
}
if ((sp27 == 5) && func_80147624(globalCtx)) {
if (this->unk_32C & 1) {
this->unk_32C &= ~0x1;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80BEF360;
} else {
@@ -1347,7 +1358,7 @@ void func_80BEF4B8(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEF518(EnAkindonuts* this, GlobalContext* globalCtx) {
s16 sp26 = this->skelAnime.curFrame;
- s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common);
+ s16 sp24 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
switch (sp26) {
case 10:
@@ -1421,7 +1432,7 @@ void func_80BEF518(EnAkindonuts* this, GlobalContext* globalCtx) {
if (sp26 == sp24) {
this->unk_33E = 3;
this->unk_338 = 19;
- func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
this->unk_32C &= ~2;
this->unk_32C |= 0x80;
@@ -1454,7 +1465,7 @@ void func_80BEF770(EnAkindonuts* this, GlobalContext* globalCtx) {
void func_80BEF83C(EnAkindonuts* this, GlobalContext* globalCtx) {
Vec3f sp34;
s16 sp32 = this->skelAnime.curFrame;
- s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animationSeg->common);
+ s16 sp30 = Animation_GetLastFrame(&sAnimations[this->unk_338].animation->common);
if (sp32 == sp30) {
Math_SmoothStepToS(&this->unk_362, 0x1C71, 3, 0x100, 0);
@@ -1480,7 +1491,7 @@ void func_80BEF83C(EnAkindonuts* this, GlobalContext* globalCtx) {
if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) {
this->unk_34C = 0.3f;
this->unk_338 = 9;
- func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actionFunc = func_80BEF9F0;
}
@@ -1499,7 +1510,7 @@ void func_80BEF9F0(EnAkindonuts* this, GlobalContext* globalCtx) {
if ((this->actor.home.pos.y + 200.0f) < this->actor.world.pos.y) {
Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f);
this->unk_338 = 10;
- func_8013BC6C(&this->skelAnime, sAnimations, this->unk_338);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_338);
if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_2) {
this->unk_32C |= 0x2;
}
@@ -1602,7 +1613,7 @@ void EnAkindonuts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
- func_8013BC6C(&this->skelAnime, sAnimations, 4);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
this->unk_32C |= 0x2;
this->unk_32C |= 0x4;
this->unk_338 = 4;
@@ -1670,13 +1681,13 @@ s32 EnAkindonuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
*dList = object_dnt_DL_008290;
}
}
- return 0;
+ return false;
}
void EnAkindonuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
-void EnAkindonuts_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnAkindonuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnAkindonuts* this = THIS;
if (((this->unk_33E == 1) || (this->unk_33E == 2)) && ((limbIndex == 23) || (limbIndex == 24))) {
@@ -1696,6 +1707,7 @@ void EnAkindonuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnAkindonuts* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnAkindonuts_OverrideLimbDraw, EnAkindonuts_PostLimbDraw, EnAkindonuts_UnkActorDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnAkindonuts_OverrideLimbDraw, EnAkindonuts_PostLimbDraw,
+ EnAkindonuts_TransformLimbDraw, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c
index 26961e4c78..98ba1c91fc 100644
--- a/src/overlays/actors/ovl_En_Al/z_en_al.c
+++ b/src/overlays/actors/ovl_En_Al/z_en_al.c
@@ -5,8 +5,9 @@
*/
#include "z_en_al.h"
+#include "objects/object_al/object_al.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnAl*)thisx)
@@ -18,7 +19,60 @@ void EnAl_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BDF5E8(EnAl* this, GlobalContext* globalCtx);
void func_80BDF6C4(EnAl* this, GlobalContext* globalCtx);
-#if 0
+s32 D_80BDFC70[] = {
+ 0x0C00030D, 0x02120006, 0x0001050E, 0x12000600, 0x02020800, 0x0A002F02, 0x0A000A37,
+ 0x23020A37, 0x0B2D0D02, 0x0B2D1400, 0x01050E0B, 0x2D140001, 0x0C000206, 0x0E0A370B,
+ 0x2D010E0A, 0x370B2D03, 0x0E0A000A, 0x37010400, 0x01000000,
+};
+
+s32 D_80BDFCBC[] = {
+ 0x09000017, 0x0E27A50C, 0x09000018, 0x0E27A60C, 0x09000017, 0x0E27A70C, 0x09000018, 0x0E27A80C,
+ 0x09000017, 0x0E27A90C, 0x09000018, 0x0E27AA0C, 0x09000017, 0x0E27AB0C, 0x09000018, 0x0E27AC0C,
+ 0x09000017, 0x0E27AD2D, 0x000B2D00, 0x080C1159, 0x08090000, 0x10000000,
+};
+
+s32 D_80BDFD14[] = {
+ 0x00562000, 0xA2090000, 0x170E2AA6, 0x0C090000, 0x180E2AA7, 0x0C090000, 0x170E2AA8, 0x0C090000,
+ 0x180E2AA9, 0x0C090000, 0x170E2AAA, 0x0C090000, 0x180E2AAB, 0x0C090000, 0x170E2AAC, 0x0C090000,
+ 0x170E2AAD, 0x0C0F2AAE, 0x0C090000, 0x180E2AAF, 0x0C090000, 0x170E2AB0, 0x0C090000, 0x170E2AB1,
+ 0x0C090000, 0x180E2AB2, 0x0C090000, 0x170E2AB3, 0x0C090000, 0x180E2AB4, 0x0C090000, 0x170E2AB5,
+ 0x0C090000, 0x180E2AB6, 0x0C090000, 0x170E2AB7, 0x0C090000, 0x180E2AB8, 0x2D00082D, 0x00092D00,
+ 0x0A0C1156, 0x20121009, 0x0000170E, 0x2AEA0C09, 0x0000180E, 0x2AEB0C09, 0x00001210,
+};
+
+s32 D_80BDFDD0[] = { 0x005C0800, 0x0B0E2AE5, 0x2D000811, 0x5C080C10, 0x0E2AE62D, 0x00080C10 };
+
+s32 D_80BDFDE8[] = { 0x0900000E, 0x2B192D00, 0x080C1509, 0x00001210 };
+
+s32 D_80BDFDF8[] = {
+ 0x09000000, 0x39040071, 0x0E2B1A0C, 0x0F00FF1E, 0x00330018, 0x000D0000, 0x0E2B1B2D, 0x00080C15, 0x09000012,
+ 0x102C2B1C, 0x0C2F0000, 0x0C19FFDC, 0x2C2B1D0C, 0x2F00000C, 0x0F2B1E0C, 0x0F2B1F0C, 0x122A002E, 0x00390800,
+ 0x1306006F, 0x00001300, 0x6F2F0000, 0x2E2D0023, 0x0C07000C, 0x06000500, 0x00130005, 0x0C070000, 0x0E2B202D,
+ 0x00080C16, 0x11390411, 0x390819FF, 0xA60E2B3C, 0x2D00080C, 0x19FF9C00,
+};
+
+s32 D_80BDFE7C[] = { 0x0E2A9C2D, 0x00080C10 };
+
+s32 D_80BDFE84[] = { 0x0E2A9D2D, 0x00080C10 };
+
+s32 D_80BDFE8C[] = {
+ 0x00390200, 0x0F0E2A9E, 0x0C0F2A9F, 0x0C0F2AA0, 0x0C190004, 0x0E2AA00C, 0x05000000, 0x1A001A30, 0x0E2AA20C,
+ 0x1206008F, 0x00001300, 0x8F2F0000, 0x2E2D002C, 0x2D00080C, 0x10310E2A, 0xA12D0008, 0x0C113902, 0x10000000,
+};
+
+s32 D_80BDFED4[] = {
+ 0x0900002C, 0x2B1D0C2F, 0x00000C0F, 0x2B1E0C0F, 0x2B1F0C12, 0x2A002E00, 0x39080013,
+ 0x06006F00, 0x0013006F, 0x2F00002E, 0x2D00230C, 0x07000C06, 0x00050000, 0x1300050C,
+ 0x0700000E, 0x2B202D00, 0x080C1611, 0x39041139, 0x08150900, 0x00121000,
+};
+
+s32 D_80BDFF24[] = {
+ 0x0900002C, 0x2B1C0C0F, 0x00FF1E00, 0x33000DFF, 0xF000000E, 0x2B1B2D00, 0x080C1509, 0x00001210,
+ 0x2C2B1D0C, 0x2F00000C, 0x0F2B1E0C, 0x0F2B1F0C, 0x122A002E, 0x00390800, 0x1306006F, 0x00001300,
+ 0x6F2F0000, 0x2E2D0023, 0x0C07000C, 0x06000500, 0x00130005, 0x0C070000, 0x0E2B202D, 0x00080C16,
+ 0x11390411, 0x390819FF, 0xB10E2B3C, 0x2D00080C, 0x19FFA700,
+};
+
const ActorInit En_Al_InitVars = {
ACTOR_EN_AL,
ACTORCAT_NPC,
@@ -31,87 +85,830 @@ const ActorInit En_Al_InitVars = {
(ActorFunc)EnAl_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BDFFB8 = {
- { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT1,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 14, 62, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BDFFE4 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-#endif
+static AnimationInfoS sAnimations[] = {
+ { &object_al_Anim_000C54, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, 0 },
+ { &object_al_Anim_00DBE0, 1.0f, 0, -1, 0, -4 }, { &object_al_Anim_00ACA0, 1.0f, 0, -1, 2, 0 },
+ { &object_al_Anim_00ACA0, -1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00CA28, 1.0f, 0, -1, 0, -4 },
+ { &object_al_Anim_00BCA4, 1.0f, 0, -1, 2, 0 }, { &object_al_Anim_00A764, 1.0f, 0, -1, 0, -4 },
+};
-extern ColliderCylinderInit D_80BDFFB8;
-extern CollisionCheckInfoInit2 D_80BDFFE4;
+Vec3f D_80BE0070 = { 1000.0f, 0.0f, 0.0f };
-extern UNK_TYPE D_0600A0D8;
+Gfx* D_80BE007C[] = {
+ object_al_DL_006598, object_al_DL_005920, object_al_DL_005878,
+ object_al_DL_0057D0, object_al_DL_005728, object_al_DL_005680,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE1A0.s")
+Actor* func_80BDE1A0(EnAl* this, GlobalContext* globalCtx, u8 arg0, s16 arg1) {
+ Actor* foundActor = NULL;
+ Actor* temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE250.s")
+ while (true) {
+ foundActor = SubS_FindActor(globalCtx, foundActor, arg0, arg1);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE27C.s")
+ if (foundActor == NULL) {
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE318.s")
+ if ((this != (EnAl*)foundActor) && (foundActor->update != NULL)) {
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE384.s")
+ temp = foundActor->next;
+ if (temp == NULL) {
+ foundActor = NULL;
+ break;
+ }
+ foundActor = temp;
+ }
+ return foundActor;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE408.s")
+void func_80BDE250(EnAl* this) {
+ this->skelAnime.playSpeed = this->unk_4C8;
+ SkelAnime_Update(&this->skelAnime);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE484.s")
+s32 func_80BDE27C(EnAl* this, s32 arg1) {
+ s32 phi_v1 = false;
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE4E0.s")
+ if ((arg1 == 1) || (arg1 == 2)) {
+ if ((this->unk_4F8 != 1) && (this->unk_4F8 != 2)) {
+ phi_v1 = true;
+ }
+ } else if (arg1 != this->unk_4F8) {
+ phi_v1 = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE678.s")
+ if (phi_v1) {
+ this->unk_4F8 = arg1;
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
+ this->unk_4C8 = this->skelAnime.playSpeed;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE7FC.s")
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDE92C.s")
+void func_80BDE318(EnAl* this, GlobalContext* globalCtx) {
+ s32 pad;
+ f32 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEA14.s")
+ Collider_UpdateCylinder(&this->actor, &this->unk_310);
+ temp = this->actor.focus.pos.y - this->actor.world.pos.y;
+ this->unk_310.dim.height = temp;
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->unk_310.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEABC.s")
+Actor* func_80BDE384(EnAl* this, GlobalContext* globalCtx) {
+ Actor* actor;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEC2C.s")
+ switch (this->unk_35C) {
+ case 2:
+ if (!(gSaveContext.weekEventReg[89] & 8) && (gSaveContext.weekEventReg[85] & 0x80)) {
+ actor = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_PM);
+ } else {
+ actor = &GET_PLAYER(globalCtx)->actor;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDED20.s")
+ case 3:
+ actor = this->unk_368;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEE5C.s")
+ default:
+ actor = &GET_PLAYER(globalCtx)->actor;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEF3C.s")
+ return actor;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDEFE4.s")
+s32 func_80BDE408(EnAl* this, s16 arg1) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF064.s")
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(arg1);
+ } else if (ActorCutscene_GetCanPlayNext(arg1)) {
+ ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor);
+ ret = true;
+ } else {
+ ActorCutscene_SetIntentToPlay(arg1);
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF244.s")
+s16 func_80BDE484(EnAl* this, s32 arg1) {
+ s16 cs = this->actor.cutscene;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF308.s")
+ for (i = 0; i < arg1; i++) {
+ cs = ActorCutscene_GetAdditionalCutscene(cs);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF390.s")
+ return cs;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF414.s")
+s32 func_80BDE4E0(EnAl* this, s16* arg1, s16 arg2) {
+ s32 ret = false;
+ s16 sp42;
+ Vec3f sp34;
+ Vec3f sp28;
+ s32 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF568.s")
+ if ((this->unk_368 == NULL) || (this->unk_368->update == NULL)) {
+ return true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF578.s")
+ if (arg2 == *arg1) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL);
+ func_80BDE27C(this, 3);
+ this->unk_4E8 = 0;
+ (*arg1)++;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF5E8.s")
+ if ((arg2 + 1) == *arg1) {
+ Math_Vec3f_Copy(&sp28, &this->unk_368->world.pos);
+ Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
+ sp42 = Math_Vec3f_Yaw(&sp34, &sp28);
+ temp = sp42 / 364;
+ this->unk_4E8++;
+ if ((temp != (this->actor.world.rot.y / 364)) && (this->unk_4E8 < 20)) {
+ Math_ApproachS(&this->actor.world.rot.y, sp42, 3, 0x2AA8);
+ } else {
+ func_80BDE27C(this, 5);
+ this->actor.world.rot.y = sp42;
+ this->unk_4E8 = 0;
+ (*arg1)++;
+ ret = true;
+ }
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF6C4.s")
+s32 func_80BDE678(EnAl* this, s16* arg1, s16 arg2) {
+ s32 ret = false;
+ s16 sp22;
+ s32 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/EnAl_Init.s")
+ if ((this->unk_368 == NULL) || (this->unk_368->update == NULL)) {
+ return true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/EnAl_Destroy.s")
+ if (arg2 == *arg1) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL);
+ func_80BDE27C(this, 4);
+ this->unk_4E8 = 0;
+ (*arg1)++;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/EnAl_Update.s")
+ if ((arg2 + 1) == *arg1) {
+ sp22 = this->actor.home.rot.y;
+ temp = sp22 / 364;
+ this->unk_4E8++;
+ if ((temp != (this->actor.world.rot.y / 364)) && (this->unk_4E8 < 20)) {
+ Math_ApproachS(&this->actor.world.rot.y, sp22, 3, 0x2AA8);
+ } else {
+ func_80BDE27C(this, 2);
+ this->actor.world.rot.y = sp22;
+ this->unk_4E8 = 0;
+ (*arg1)++;
+ ret = true;
+ }
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF914.s")
+s32 func_80BDE7FC(EnAl* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s16 sp2A = func_80BDE484(this, 0);
+ s32 pad2;
+ s32 sp20 = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDF950.s")
+ switch (this->unk_4E6) {
+ case 0:
+ if (!func_80BDE408(this, sp2A)) {
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/func_80BDFA34.s")
+ case 2:
+ case 4:
+ case 6:
+ case 8:
+ if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)),
+ this->actor.child);
+ }
+ this->unk_4E6++;
+ sp20 = true;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Al/EnAl_Draw.s")
+ case 1:
+ case 3:
+ case 5:
+ case 7:
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
+ this->unk_4E6++;
+ sp20 = true;
+ break;
+
+ case 9:
+ ActorCutscene_Stop(sp2A);
+ this->unk_4E6++;
+ sp20 = true;
+ break;
+ }
+ return sp20;
+}
+
+s32 func_80BDE92C(EnAl* this, GlobalContext* globalCtx) {
+ s32 pad[2];
+ Actor* sp1C = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_GM);
+ Actor* temp_v0 = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_TOTO);
+
+ if ((sp1C == NULL) || (sp1C->update == NULL) || (temp_v0 == NULL) || (temp_v0->update == NULL)) {
+ this->unk_4E6++;
+ return true;
+ }
+
+ switch (this->unk_4E6) {
+ case 0:
+ case 1:
+ case 3:
+ case 5:
+ case 8:
+ case 10:
+ case 11:
+ case 13:
+ case 15:
+ case 17:
+ this->actor.child = sp1C;
+ this->unk_4E6++;
+ break;
+
+ case 7:
+ case 9:
+ case 12:
+ this->actor.child = temp_v0;
+ this->unk_4E6++;
+ break;
+
+ case 2:
+ case 4:
+ case 6:
+ case 14:
+ case 16:
+ this->unk_4E6++;
+ break;
+
+ default:
+ this->unk_4E6++;
+ break;
+ }
+ return true;
+}
+
+s32 func_80BDEA14(EnAl* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp18 = false;
+
+ switch (this->unk_4E6) {
+ case 0:
+ case 1:
+ if ((gSaveContext.weekEventReg[75] & 2)) {
+ sp18 = true;
+ } else if (func_80BDE4E0(this, &this->unk_4E6, 0)) {
+ sp18 = true;
+ }
+ break;
+
+ case 2:
+ case 3:
+ if (func_80BDE678(this, &this->unk_4E6, 2)) {
+ sp18 = true;
+ }
+ break;
+ }
+ return sp18;
+}
+
+s32* func_80BDEABC(EnAl* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->unk_35C == 3) {
+ this->unk_4EC = func_80BDE92C;
+ return D_80BDFD14;
+ }
+
+ switch (this->unk_35C) {
+ case 1:
+ if (player->transformation == PLAYER_FORM_DEKU) {
+ return D_80BDFDD0;
+ }
+
+ if (INV_CONTENT(ITEM_MASK_KAFEIS_MASK) != ITEM_MASK_KAFEIS_MASK) {
+ return D_80BDFE8C;
+ }
+
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_KAFEIS_MASK) {
+ return D_80BDFE7C;
+ }
+ return D_80BDFE84;
+
+ case 2:
+ if (!(gSaveContext.weekEventReg[89] & 8) && (gSaveContext.weekEventReg[85] & 0x80)) {
+ this->unk_4EC = func_80BDE7FC;
+ return D_80BDFCBC;
+ }
+
+ this->unk_4EC = func_80BDEA14;
+ if (Player_GetMask(globalCtx) != PLAYER_MASK_KAFEIS_MASK) {
+ return D_80BDFDE8;
+ }
+
+ if (this->unk_4C2 & 0x800) {
+ return D_80BDFED4;
+ }
+
+ if (this->unk_4C2 & 0x1000) {
+ return D_80BDFF24;
+ }
+ return D_80BDFDF8;
+ }
+ return NULL;
+}
+
+s32 func_80BDEC2C(EnAl* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 ret = false;
+
+ if ((this->unk_4C2 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_4C2 &= ~0x1800;
+ if (player->exchangeItemId == 0x33) {
+ this->unk_4C2 |= 0x800;
+ this->unk_4F4 = player->exchangeItemId;
+ } else if (player->exchangeItemId != 0) {
+ this->unk_4C2 |= 0x1000;
+ this->unk_4F4 = player->exchangeItemId;
+ }
+ SubS_UpdateFlags(&this->unk_4C2, 0, 7);
+ this->unk_4E6 = 0;
+ this->unk_4EC = 0;
+ this->actor.child = this->unk_368;
+ this->unk_360 = func_80BDEABC(this, globalCtx);
+ this->unk_4C2 |= 0x20;
+ this->actionFunc = func_80BDF6C4;
+ ret = true;
+ }
+
+ return ret;
+}
+
+void func_80BDED20(EnAl* this) {
+ s32 pad;
+ Vec3f sp40;
+ Vec3f sp34;
+ s32 pad2;
+
+ Math_Vec3f_Copy(&sp40, &this->unk_368->world.pos);
+ Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
+
+ Math_ApproachS(&this->unk_4DE, Math_Vec3f_Yaw(&sp34, &sp40) - this->actor.shape.rot.y, 4, 0x2AA8);
+ this->unk_4DE = CLAMP(this->unk_4DE, -0x1FFE, 0x1FFE);
+
+ Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
+
+ if (this->unk_368->id == ACTOR_PLAYER) {
+ sp40.y = ((Player*)this->unk_368)->bodyPartsPos[7].y + 3.0f;
+ } else {
+ Math_Vec3f_Copy(&sp40, &this->unk_368->focus.pos);
+ }
+
+ Math_ApproachS(&this->unk_4DC, Math_Vec3f_Pitch(&sp34, &sp40), 4, 0x2AA8);
+ this->unk_4DC = CLAMP(this->unk_4DC, -0x1554, 0x1554);
+}
+
+void func_80BDEE5C(EnAl* this) {
+ if (this->unk_4C2 & 0x20) {
+ if ((this->unk_368 != NULL) && (this->unk_368->update != NULL)) {
+ if (DECR(this->unk_4E2) == 0) {
+ func_80BDED20(this);
+ this->unk_4C2 &= ~0x200;
+ this->unk_4C2 |= 0x80;
+ return;
+ }
+ }
+ }
+
+ if (this->unk_4C2 & 0x80) {
+ this->unk_4C2 &= ~0x80;
+ this->unk_4DC = 0;
+ this->unk_4DE = 0;
+ this->unk_4E2 = 0x14;
+ } else if (DECR(this->unk_4E2) == 0) {
+ this->unk_4C2 |= 0x200;
+ }
+}
+
+void func_80BDEF3C(EnAl* this, GlobalContext* globalCtx) {
+ if (this->unk_4E4 == 0) {
+ func_80BDE27C(this, 7);
+ this->unk_4C2 &= ~0x20;
+ this->unk_4C2 |= 0x200;
+ this->unk_4E4++;
+ } else if ((this->unk_4E4 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ func_80BDE27C(this, 0);
+ this->unk_4C2 &= ~0x200;
+ this->unk_4C2 |= 0x20;
+ this->unk_4E4++;
+ }
+}
+
+void func_80BDEFE4(EnAl* this, GlobalContext* globalCtx) {
+ if (this->unk_4E4 == 0) {
+ func_80BDE27C(this, 6);
+ this->unk_4E4 += 1;
+ } else if ((this->unk_4E4 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ func_80BDE27C(this, 5);
+ this->unk_4E4 += 1;
+ }
+}
+
+s32 func_80BDF064(EnAl* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ u16 sp22 = globalCtx->msgCtx.unk11F04;
+ Actor* sp1C = func_80BDE1A0(this, globalCtx, 4, 0xA4);
+ Actor* temp_v0 = func_80BDE1A0(this, globalCtx, 4, 0x234);
+
+ if (player->stateFlags1 & 0x40) {
+ this->unk_4C2 |= 0x400;
+ if (this->unk_4C4 != sp22) {
+ switch (sp22) {
+ case 0x2AA6:
+ case 0x2AAF:
+ case 0x2AB4:
+ if ((sp1C != NULL) && (sp1C->update != NULL)) {
+ this->unk_368 = sp1C;
+ }
+ break;
+
+ case 0x2AAD:
+ case 0x2AB0:
+ if ((temp_v0 != NULL) && (temp_v0->update != NULL)) {
+ this->unk_368 = temp_v0;
+ }
+ break;
+ }
+
+ switch (sp22) {
+ case 0x2AA1:
+ case 0x2AA2:
+ case 0x2AA7:
+ case 0x2AE6:
+ case 0x2AE8:
+ case 0x2AE9:
+ case 0x2AB4:
+ this->unk_18C = func_80BDEF3C;
+ this->unk_4E4 = 0;
+ break;
+
+ case 0x27A6:
+ case 0x27A8:
+ case 0x27AA:
+ case 0x2B1E:
+ this->unk_18C = func_80BDEFE4;
+ this->unk_4E4 = 0;
+ break;
+
+ case 0x2B19:
+ case 0x2B20:
+ case 0x2B3C:
+ func_80BDE27C(this, 5);
+ break;
+ }
+ }
+ this->unk_4C4 = sp22;
+ } else if (this->unk_4C2 & 0x400) {
+ this->unk_4C4 = 0;
+ this->unk_4C2 &= ~0x400;
+ }
+
+ if (this->unk_18C != NULL) {
+ this->unk_18C(this, globalCtx);
+ }
+
+ return false;
+}
+
+s32 func_80BDF244(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret = false;
+ Actor* sp20 = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_GM);
+ Actor* temp_v0 = func_80BDE1A0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_TOTO);
+
+ if ((sp20 != NULL) && (sp20->update != NULL) && (temp_v0 != NULL) && (temp_v0->update != NULL)) {
+ func_80BDE27C(this, 0);
+ SubS_UpdateFlags(&this->unk_4C2, 3, 7);
+ this->unk_368 = sp20;
+ this->unk_4C2 |= 0x20;
+ ret = true;
+ }
+ return ret;
+}
+
+s32 func_80BDF308(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ SubS_UpdateFlags(&this->unk_4C2, 3, 7);
+
+ switch (arg2->unk0) {
+ case 1:
+ func_80BDE27C(this, 0);
+ break;
+
+ case 2:
+ this->unk_4F0 = 0;
+ this->unk_4EA = 0;
+ func_80BDE27C(this, 2);
+ break;
+ }
+ return true;
+}
+
+s32 func_80BDF390(EnAl* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret;
+
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actor.targetMode = 0;
+ this->unk_4F0 = 0;
+ this->unk_4C2 = 0;
+ this->unk_4D4 = 40.0f;
+
+ switch (arg2->unk0) {
+ case 3:
+ ret = func_80BDF244(this, globalCtx, arg2);
+ break;
+
+ case 1:
+ case 2:
+ ret = func_80BDF308(this, globalCtx, arg2);
+ break;
+
+ default:
+ ret = false;
+ break;
+ }
+ return ret;
+}
+
+void func_80BDF414(EnAl* this, GlobalContext* globalCtx) {
+ s16 temp_v0;
+
+ switch (this->unk_4EA) {
+ case 0:
+ case 1:
+ if (!(gSaveContext.weekEventReg[89] & 8)) {
+ if (gSaveContext.weekEventReg[85] & 0x80) {
+ func_80BDE4E0(this, &this->unk_4EA, 0);
+ }
+ }
+ break;
+
+ case 2:
+ if (gSaveContext.weekEventReg[89] & 8) {
+ this->unk_4EA++;
+ }
+ break;
+
+ case 3:
+ case 4:
+ func_80BDE678(this, &this->unk_4EA, 3);
+ break;
+ }
+
+ temp_v0 = this->actor.world.rot.y - this->actor.yawTowardsPlayer;
+ if (((this->unk_4EA == 0) && (ABS_ALT(temp_v0) >= 0x5800)) ||
+ ((this->unk_4EA == 5) && (ABS_ALT(temp_v0) >= 0x5800)) || (this->unk_4EA == 2)) {
+ SubS_UpdateFlags(&this->unk_4C2, 3, 7);
+ } else {
+ SubS_UpdateFlags(&this->unk_4C2, 0, 7);
+ }
+}
+
+void func_80BDF568(EnAl* this, GlobalContext* globalCtx) {
+}
+
+void func_80BDF578(EnAl* this, GlobalContext* globalCtx) {
+ switch (this->unk_35C) {
+ case 1:
+ case 3:
+ func_80BDF568(this, globalCtx);
+ break;
+
+ case 2:
+ func_80BDF414(this, globalCtx);
+ break;
+ }
+
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8);
+}
+
+void func_80BDF5E8(EnAl* this, GlobalContext* globalCtx) {
+ u32* unk14 = &gSaveContext.unk_14;
+ struct_80133038_arg2 sp20;
+
+ this->unk_4E0 = REG(15) + *unk14;
+ if (!func_80133038(globalCtx, D_80BDFC70, &sp20) ||
+ ((this->unk_35C != sp20.unk0) && !func_80BDF390(this, globalCtx, &sp20))) {
+ this->actor.shape.shadowDraw = NULL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ sp20.unk0 = 0;
+ } else {
+ this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+ this->unk_35C = sp20.unk0;
+ this->unk_368 = func_80BDE384(this, globalCtx);
+ func_80BDF578(this, globalCtx);
+}
+
+void func_80BDF6C4(EnAl* this, GlobalContext* globalCtx) {
+ if (func_8010BF58(&this->actor, globalCtx, this->unk_360, this->unk_4EC, &this->unk_364)) {
+ SubS_UpdateFlags(&this->unk_4C2, 3, 7);
+ this->unk_4C2 &= ~0x20;
+ this->unk_4C2 |= 0x200;
+ this->actor.child = NULL;
+ this->unk_4E2 = 20;
+ this->unk_364 = 0;
+ this->actionFunc = func_80BDF5E8;
+ } else {
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8);
+ }
+}
+
+void EnAl_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnAl* this = THIS;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_al_Skel_00A0D8, NULL, this->jointTable, this->morphTable,
+ 27);
+ this->unk_4F8 = -1;
+ func_80BDE27C(this, 1);
+ Collider_InitAndSetCylinder(globalCtx, &this->unk_310, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->unk_35C = 0;
+ this->actionFunc = func_80BDF5E8;
+
+ this->actionFunc(this, globalCtx);
+}
+
+void EnAl_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnAl* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->unk_310);
+}
+
+void EnAl_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnAl* this = THIS;
+
+ func_80BDEC2C(this, globalCtx);
+
+ this->actionFunc(this, globalCtx);
+
+ func_80BDF064(this, globalCtx);
+
+ if (this->unk_35C != 0) {
+ func_80BDE250(this);
+ func_80BDEE5C(this);
+ func_8013C964(&this->actor, globalCtx, this->unk_4D4, 30.0f, this->unk_4F0, this->unk_4C2 & 7);
+ func_80BDE318(this, globalCtx);
+ }
+}
+
+s32 EnAl_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ switch (limbIndex) {
+ case 3:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ *dList = NULL;
+ break;
+
+ case 16:
+ break;
+ }
+ return false;
+}
+
+void EnAl_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnAl* this = THIS;
+
+ switch (limbIndex) {
+ case 3:
+ Matrix_CopyCurrentState(&this->unk_190[0]);
+ break;
+
+ case 11:
+ Matrix_CopyCurrentState(&this->unk_190[1]);
+ break;
+
+ case 12:
+ Matrix_CopyCurrentState(&this->unk_190[2]);
+ break;
+
+ case 13:
+ Matrix_CopyCurrentState(&this->unk_190[3]);
+ break;
+
+ case 14:
+ Matrix_CopyCurrentState(&this->unk_190[4]);
+ break;
+
+ case 15:
+ Matrix_CopyCurrentState(&this->unk_190[5]);
+ break;
+
+ case 16:
+ Matrix_MultiplyVector3fByState(&D_80BE0070, &this->actor.focus.pos);
+ Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
+ break;
+ }
+}
+
+void EnAl_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+ EnAl* this = THIS;
+ s32 phi_v0;
+ s32 phi_v1;
+
+ if (!(this->unk_4C2 & 0x200)) {
+ if (this->unk_4C2 & 0x80) {
+ phi_v1 = 1;
+ } else {
+ phi_v1 = 0;
+ }
+ phi_v0 = 1;
+ } else {
+ phi_v1 = 0;
+ phi_v0 = 0;
+ }
+
+ if (limbIndex == 16) {
+ func_8013AD9C(this->unk_4DC + 0x4000, this->unk_4DE + this->actor.shape.rot.y + 0x4000, &this->unk_36C,
+ &this->unk_378, phi_v0, phi_v1);
+ Matrix_StatePop();
+ Matrix_InsertTranslation(this->unk_36C.x, this->unk_36C.y, this->unk_36C.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_378.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_378.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_378.z, MTXMODE_APPLY);
+ Matrix_StatePush();
+ }
+}
+
+void EnAl_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnAl* this = THIS;
+ s32 i;
+
+ if (this->unk_35C != 0) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Matrix_InsertTranslation(0.0f, 0.0f, 850.0f, MTXMODE_APPLY);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnAl_OverrideLimbDraw, EnAl_PostLimbDraw,
+ EnAl_TransformLimbDraw, &this->actor);
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_190); i++) {
+ Matrix_SetCurrentState(&this->unk_190[i]);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, D_80BE007C[i]);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.h b/src/overlays/actors/ovl_En_Al/z_en_al.h
index a4a8cf9992..9e5ee8872e 100644
--- a/src/overlays/actors/ovl_En_Al/z_en_al.h
+++ b/src/overlays/actors/ovl_En_Al/z_en_al.h
@@ -6,12 +6,43 @@
struct EnAl;
typedef void (*EnAlActionFunc)(struct EnAl*, GlobalContext*);
+typedef s32 (*EnAlUnkFunc)(struct EnAl*, GlobalContext*);
+typedef void (*EnAlUnkFunc2)(struct EnAl*, GlobalContext*);
typedef struct EnAl {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnAlActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x374];
+ /* 0x018C */ EnAlUnkFunc2 unk_18C;
+ /* 0x0190 */ MtxF unk_190[6];
+ /* 0x0310 */ ColliderCylinder unk_310;
+ /* 0x035C */ u8 unk_35C;
+ /* 0x0360 */ s32* unk_360;
+ /* 0x0364 */ s32 unk_364;
+ /* 0x0368 */ Actor* unk_368;
+ /* 0x036C */ Vec3f unk_36C;
+ /* 0x0378 */ Vec3s unk_378;
+ /* 0x037E */ Vec3s jointTable[27];
+ /* 0x0420 */ Vec3s morphTable[27];
+ /* 0x04C2 */ u16 unk_4C2;
+ /* 0x04C4 */ u16 unk_4C4;
+ /* 0x04C8 */ f32 unk_4C8;
+ /* 0x04CC */ UNK_TYPE1 unk4CC[8];
+ /* 0x04D4 */ f32 unk_4D4;
+ /* 0x04D8 */ UNK_TYPE1 unk4D8[4];
+ /* 0x04DC */ s16 unk_4DC;
+ /* 0x04DE */ s16 unk_4DE;
+ /* 0x04E0 */ s16 unk_4E0;
+ /* 0x04E2 */ s16 unk_4E2;
+ /* 0x04E4 */ s16 unk_4E4;
+ /* 0x04E6 */ s16 unk_4E6;
+ /* 0x04E8 */ s16 unk_4E8;
+ /* 0x04EA */ s16 unk_4EA;
+ /* 0x04EC */ EnAlUnkFunc unk_4EC;
+ /* 0x04F0 */ s32 unk_4F0;
+ /* 0x04F4 */ s32 unk_4F4;
+ /* 0x04F8 */ s32 unk_4F8;
+ /* 0x04FC */ UNK_TYPE1 unk4FC[4];
} EnAl; // size = 0x500
extern const ActorInit En_Al_InitVars;
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 355d37e59d..083bcfa417 100644
--- a/src/overlays/actors/ovl_En_Am/z_en_am.c
+++ b/src/overlays/actors/ovl_En_Am/z_en_am.c
@@ -5,8 +5,10 @@
*/
#include "z_en_am.h"
+#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_400 | ACTOR_FLAG_4 | ACTOR_FLAG_1)
#define THIS ((EnAm*)thisx)
@@ -15,18 +17,26 @@ void EnAm_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnAm_Update(Actor* thisx, GlobalContext* globalCtx);
void EnAm_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_808B0040(EnAm* this, GlobalContext* globalCtx);
-void func_808B0124(EnAm* this, GlobalContext* globalCtx);
+void func_808AFF9C(EnAm* this);
+void EnAm_RemoveEnemyTexture(EnAm* this, GlobalContext* globalCtx);
+void EnAm_WakeUp(EnAm* this);
+void EnAm_ApplyEnemyTexture(EnAm* this, GlobalContext* globalCtx);
+void func_808B0358(EnAm* this);
void func_808B03C0(EnAm* this, GlobalContext* globalCtx);
+void func_808B0460(EnAm* this);
void func_808B04A8(EnAm* this, GlobalContext* globalCtx);
void func_808B0508(EnAm* this, GlobalContext* globalCtx);
+void func_808B057C(EnAm* this);
void func_808B05C8(EnAm* this, GlobalContext* globalCtx);
+void func_808B0640(EnAm* this);
void func_808B066C(EnAm* this, GlobalContext* globalCtx);
+void EnAm_TakeDamage(EnAm* this, GlobalContext* globalCtx);
void func_808B07A8(EnAm* this, GlobalContext* globalCtx);
+void func_808B0820(EnAm* this);
void func_808B0894(EnAm* this, GlobalContext* globalCtx);
void func_808B0B4C(EnAm* this, GlobalContext* globalCtx);
+void EnAm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor);
-#if 0
const ActorInit En_Am_InitVars = {
ACTOR_EN_AM,
ACTORCAT_ENEMY,
@@ -39,22 +49,47 @@ const ActorInit En_Am_InitVars = {
(ActorFunc)EnAm_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_808B1070 = {
- { COLTYPE_HIT5, AT_NONE | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x08 }, { 0x81C2C788, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+static ColliderCylinderInit sEnemyCylinderInit = {
+ {
+ COLTYPE_HIT5,
+ AT_NONE | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x00, 0x08 },
+ { 0x81C2C788, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 23, 98, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_808B109C = {
- { COLTYPE_METAL, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x760D3877, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_METAL,
+ AT_NONE,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x760D3877, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 23, 98, 0, { 0, 0, 0 } },
};
-// static DamageTable sDamageTable = {
-static DamageTable D_808B10C8 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0xF),
/* Deku Stick */ DMG_ENTRY(0, 0xF),
/* Horse trample */ DMG_ENTRY(0, 0xF),
@@ -89,81 +124,448 @@ static DamageTable D_808B10C8 = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
-// sColChkInfoInit
-static CollisionCheckInfoInit D_808B10E8 = { 1, 23, 98, MASS_HEAVY };
+static CollisionCheckInfoInit sColChkInfoInit = { 1, 23, 98, MASS_HEAVY };
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_808B10F0[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 14, ICHAIN_CONTINUE),
ICHAIN_S8(hintId, 19, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP),
};
-#endif
+static Vec3f sVelocity = { 0.0f, -1.5f, 0.0f };
-extern ColliderCylinderInit D_808B1070;
-extern ColliderCylinderInit D_808B109C;
-extern DamageTable D_808B10C8;
-extern CollisionCheckInfoInit D_808B10E8;
-extern InitChainEntry D_808B10F0[];
+static Vec3f sAccel = { 0.0f, -(1.0f / 5.0f), 0.0f };
-extern UNK_TYPE D_06000238;
-extern UNK_TYPE D_0600033C;
-extern UNK_TYPE D_06005B3C;
+static Color_RGBA8 D_808B1118 = { 100, 100, 100, 0 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/EnAm_Init.s")
+static Color_RGBA8 D_808B111C = { 40, 40, 40, 0 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/EnAm_Destroy.s")
+static Color_RGBA8 D_808B1120 = { 150, 150, 150, 255 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808AFE38.s")
+static Color_RGBA8 D_808B1124 = { 100, 100, 100, 150 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808AFF9C.s")
+static Vec3f D_808B1128[] = {
+ { 4700.0f, -500.0f, 1800.0f }, { 4700.0f, -500.0f, -1800.0f }, { 2000.0f, -1500.0f, 0.0f },
+ { 2000.0f, 0.0f, -1500.0f }, { 2000.0f, 0.0f, 1500.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0040.s")
+static Vec3f D_808B1164[] = {
+ { 0.0f, -3000.0f, 0.0f },
+ { 700.0f, -800.0f, 0.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B00D8.s")
+static Vec3f D_808B117C[] = {
+ { 800.0f, 1000.0f, -1000.0f },
+ { 800.0f, 1000.0f, 1000.0f },
+ { 800.0f, -1000.0f, 1000.0f },
+ { 800.0f, -1000.0f, -1000.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0124.s")
+void EnAm_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnAm* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0208.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 300.0f / 7.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_am_Skel_005948, &gArmosPushedBackAnim, this->jointTable,
+ this->morphTable, OBJECT_AM_LIMB_MAX);
+ Collider_InitAndSetCylinder(globalCtx, &this->enemyCollider, &this->actor, &sEnemyCylinderInit);
+ Collider_InitAndSetCylinder(globalCtx, &this->interactCollider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ this->actor.home.pos.x -= 9.0f * Math_SinS(this->actor.shape.rot.y);
+ this->actor.home.pos.z -= 9.0f * Math_CosS(this->actor.shape.rot.y);
+ this->actor.world.pos.x = this->actor.home.pos.x;
+ this->actor.world.pos.z = this->actor.home.pos.z;
+ func_808AFF9C(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0358.s")
+void EnAm_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnAm* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B03C0.s")
+ Collider_DestroyCylinder(globalCtx, &this->enemyCollider);
+ Collider_DestroyCylinder(globalCtx, &this->interactCollider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0460.s")
+void EnAm_SpawnEffects(EnAm* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f effectPos;
+ s32 pad;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B04A8.s")
+ // Dust Clouds that spawn from the hop
+ for (i = 4; i > 0; i--) {
+ effectPos.x = randPlusMinusPoint5Scaled(65.0f) + this->actor.world.pos.x;
+ effectPos.y = randPlusMinusPoint5Scaled(10.0f) + (this->actor.world.pos.y + 40.0f);
+ effectPos.z = randPlusMinusPoint5Scaled(65.0f) + this->actor.world.pos.z;
+ EffectSsKiraKira_SpawnSmall(globalCtx, &effectPos, &sVelocity, &sAccel, &D_808B1118, &D_808B111C);
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_WALK);
+ Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 4.0f, 3, 8.0f, 300, 15, 0);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B04E4.s")
+void func_808AFF9C(EnAm* this) {
+ f32 lastFrame = Animation_GetLastFrame(&gArmosPushedBackAnim);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0508.s")
+ Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 0.0f, lastFrame, lastFrame, 0, 0.0f);
+ this->enemyCollider.info.bumper.dmgFlags = 0x80000088;
+ this->interactCollider.info.bumper.dmgFlags = 0x77CFFF77;
+ if (this->actor.colChkInfo.health != 0) {
+ this->enemyCollider.base.atFlags &= ~AT_ON;
+ }
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
+ this->actionFunc = EnAm_RemoveEnemyTexture;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B057C.s")
+void EnAm_RemoveEnemyTexture(EnAm* this, GlobalContext* globalCtx) {
+ if (((this->enemyCollider.base.ocFlags1 & OC1_HIT) && (this->enemyCollider.base.ocFlags2 & OC2_HIT_PLAYER)) ||
+ (this->interactCollider.base.acFlags & AC_HIT)) {
+ if (this->textureBlend == 0) {
+ EnAm_WakeUp(this);
+ }
+ } else if (this->textureBlend > 10) {
+ this->textureBlend -= 10;
+ } else {
+ this->textureBlend = 0;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->unkFlag = 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B05C8.s")
+void EnAm_WakeUp(EnAm* this) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_WAVE);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_VOICE);
+ this->returnHomeTimer = 300;
+ this->actionFunc = EnAm_ApplyEnemyTexture;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0640.s")
+void EnAm_ApplyEnemyTexture(EnAm* this, GlobalContext* globalCtx) {
+ s32 tempTextureBlend;
+ f32 cos;
+ u8 pad;
+ f32 rand;
+ f32 sin;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B066C.s")
+ if (this->textureBlend + 20 >= 255) {
+ this->textureBlend = 255;
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->enemyCollider.info.bumper.dmgFlags = 0x81C2C788;
+ this->interactCollider.info.bumper.dmgFlags = 0x760D3877;
+ this->enemyCollider.base.atFlags |= AT_ON;
+ this->actor.shape.yOffset = 0.0f;
+ func_808B0358(this);
+ } else {
+ tempTextureBlend = this->textureBlend + 20;
+ rand = randPlusMinusPoint5Scaled(10.0f);
+ cos = Math_CosS(this->actor.shape.rot.y) * rand;
+ sin = Math_SinS(this->actor.shape.rot.y) * rand;
+ this->actor.world.pos.x = this->actor.home.pos.x + cos;
+ this->actor.world.pos.z = this->actor.home.pos.z + sin;
+ this->textureBlend = tempTextureBlend;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B06D0.s")
+void func_808B0208(EnAm* this, GlobalContext* globalCtx) {
+ // If the armos is against a wall, rotate and turn away from it
+ if ((this->actor.speedXZ > 0.0f) && (this->actor.bgCheckFlags & 8)) {
+ this->actor.world.rot.y = (this->actor.wallYaw * 2) - this->actor.world.rot.y;
+ this->actor.world.pos.x += this->actor.speedXZ * Math_SinS(this->actor.world.rot.y);
+ this->actor.world.pos.z += this->actor.speedXZ * Math_CosS(this->actor.world.rot.y);
+ }
+ SkelAnime_Update(&this->skelAnime);
+ if (Animation_OnFrame(&this->skelAnime, 8.0f) != 0) {
+ this->actor.speedXZ = this->speed;
+ this->actor.velocity.y = 12.0f;
+ } else if (this->skelAnime.curFrame > 11.0f) {
+ if (!(this->actor.bgCheckFlags & 1)) {
+ this->skelAnime.curFrame = 11.0f;
+ } else {
+ Math_ScaledStepToS(&this->actor.world.rot.y, this->armosYaw, 0x1F40);
+ this->actor.speedXZ = 0.0f;
+ if (this->actor.bgCheckFlags & 2) {
+ EnAm_SpawnEffects(this, globalCtx);
+ }
+ }
+ }
+ if (this->actionFunc != func_808B0894) {
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B07A8.s")
+void func_808B0358(EnAm* this) {
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
+ this->explodeTimer = 3;
+ this->actor.speedXZ = 0.0f;
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ this->speed = 6.0f;
+ this->actionFunc = func_808B03C0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0820.s")
+void func_808B03C0(EnAm* this, GlobalContext* globalCtx) {
+ this->armosYaw = this->actor.yawTowardsPlayer;
+ func_808B0208(this, globalCtx);
+ if (this->actor.bgCheckFlags & 2) {
+ this->explodeTimer--;
+ }
+ if (this->explodeTimer == 0) {
+ func_808B0640(this);
+ } else if ((this->returnHomeTimer == 0) || Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) > 240.0f) {
+ func_808B0460(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0894.s")
+void func_808B0460(EnAm* this) {
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ this->speed = 0.0f;
+ this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
+ this->actionFunc = func_808B04A8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0AD0.s")
+void func_808B04A8(EnAm* this, GlobalContext* globalCtx) {
+ func_808B0208(this, globalCtx);
+ if (this->armosYaw == this->actor.world.rot.y) {
+ func_808B057C(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0B4C.s")
+void func_808B04E4(EnAm* this) {
+ this->speed = 0.0f;
+ this->armosYaw = this->actor.home.rot.y;
+ this->actionFunc = func_808B0508;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0B9C.s")
+void func_808B0508(EnAm* this, GlobalContext* globalCtx) {
+ func_808B0208(this, globalCtx);
+ if (!(this->actor.bgCheckFlags & 1)) {
+ Math_StepToF(&this->actor.world.pos.x, this->actor.home.pos.x, 2.0f);
+ Math_StepToF(&this->actor.world.pos.z, this->actor.home.pos.z, 2.0f);
+ }
+ if (this->actor.home.rot.y == this->actor.world.rot.y) {
+ func_808AFF9C(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/EnAm_Update.s")
+void func_808B057C(EnAm* this) {
+ this->speed = 6.0f;
+ this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
+ this->explodeTimer = 1;
+ this->actionFunc = func_808B05C8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/func_808B0EA4.s")
+void func_808B05C8(EnAm* this, GlobalContext* globalCtx) {
+ this->armosYaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
+ func_808B0208(this, globalCtx);
+ if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 8.0f) {
+ func_808B04E4(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Am/EnAm_Draw.s")
+void func_808B0640(EnAm* this) {
+ this->explodeTimer = 40;
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ this->speed = 0.0f;
+ this->actionFunc = func_808B066C;
+}
+
+void func_808B066C(EnAm* this, GlobalContext* globalCtx) {
+ if (this->explodeTimer != 0) {
+ this->explodeTimer--;
+ } else {
+ this->armosYaw = this->actor.yawTowardsPlayer;
+ func_808B0208(this, globalCtx);
+ if (this->armosYaw == this->actor.shape.rot.y) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AMOS_VOICE);
+ func_808B0358(this);
+ }
+ }
+}
+
+void EnAm_TakeDamage(EnAm* this, GlobalContext* globalCtx) {
+ Animation_Change(&this->skelAnime, &gArmosTakeDamageAnim, 1.0f, 4.0f,
+ Animation_GetLastFrame(&gArmosTakeDamageAnim) - 6, 2, 0.0f);
+ func_800BE504(&this->actor, &this->enemyCollider);
+ this->actor.speedXZ = 6.0f;
+ Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, Animation_GetLastFrame(&gArmosTakeDamageAnim) - 10);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DAMAGE);
+ this->enemyCollider.base.acFlags &= ~AC_ON;
+ this->textureBlend = 255;
+ this->actionFunc = func_808B07A8;
+}
+
+void func_808B07A8(EnAm* this, GlobalContext* globalCtx) {
+ Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
+ if (SkelAnime_Update(&this->skelAnime)) {
+ if (this->actor.colChkInfo.health == 0) {
+ func_808B0820(this);
+ } else {
+ this->enemyCollider.base.acFlags |= AC_ON;
+ func_808B0358(this);
+ }
+ }
+}
+
+void func_808B0820(EnAm* this) {
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &gArmosHopAnim, 4.0f);
+ this->explodeTimer = 64;
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.speedXZ = 0.0f;
+ this->speed = 6.0f;
+ this->actionFunc = func_808B0894;
+}
+
+void func_808B0894(EnAm* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f dustPos;
+ s32 pad;
+
+ this->explodeTimer--;
+ this->armosYaw = this->actor.yawTowardsPlayer;
+ func_808B0208(this, globalCtx);
+ if (this->explodeTimer == 1) {
+ EnBom* bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.world.pos.x,
+ this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 2, 0);
+ if (bomb != NULL) {
+ bomb->timer = 0;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_DEAD);
+ Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xB0);
+
+ for (i = 0; i < 8; i++) {
+ dustPos.x = (Math_SinS(0) * 7.0f) + this->actor.world.pos.x;
+ dustPos.y = (randPlusMinusPoint5Scaled(10.0f) * 6.0f) + (this->actor.world.pos.y + 40.0f);
+ dustPos.z = (Math_CosS(0) * 7.0f) + this->actor.world.pos.z;
+
+ func_800B0EB0(globalCtx, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_808B1120, &D_808B1124, 200, 45, 12);
+ }
+ } else if (this->explodeTimer == 0) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ } else if (!(this->explodeTimer & 3)) {
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 4);
+ }
+ if (this->actor.world.rot.z < 0x1F40) {
+ this->actor.world.rot.z += 0x320;
+ }
+ this->actor.shape.rot.y += this->actor.world.rot.z;
+}
+
+void func_808B0AD0(EnAm* this, GlobalContext* globalCtx) {
+ Animation_Change(&this->skelAnime, &gArmosPushedBackAnim, 1.0f, 0.0f, 8.0f, 2, 0.0f);
+ this->actor.world.rot.y = this->actor.yawTowardsPlayer;
+ this->actor.speedXZ = -6.0f;
+ this->actionFunc = func_808B0B4C;
+}
+
+void func_808B0B4C(EnAm* this, GlobalContext* globalCtx) {
+ Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
+ if (SkelAnime_Update(&this->skelAnime)) {
+ func_808B0358(this);
+ }
+}
+
+s32 EnAm_UpdateDamage(EnAm* this, GlobalContext* globalCtx) {
+ if (this->enemyCollider.base.acFlags & AC_HIT) {
+ this->enemyCollider.base.acFlags &= ~AC_HIT;
+ Actor_SetDropFlag(&this->actor, &this->enemyCollider.info);
+ if (!Actor_ApplyDamage(&this->actor)) {
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ }
+ if (this->actor.colChkInfo.damageEffect == 0xD) {
+ return true;
+ }
+ if (this->actor.colChkInfo.health != 0) {
+ this->enemyCollider.base.atFlags &= ~AT_ON;
+ }
+ this->enemyCollider.base.atFlags &= ~AT_HIT;
+ if (this->actor.colChkInfo.damageEffect == 0x4) {
+ this->effectScale = 0.7f;
+ this->effectAlpha = 4.0f;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->enemyCollider.info.bumper.hitPos.x,
+ this->enemyCollider.info.bumper.hitPos.y, this->enemyCollider.info.bumper.hitPos.z, 0, 0, 0,
+ CLEAR_TAG_LARGE_LIGHT_RAYS);
+ }
+ EnAm_TakeDamage(this, globalCtx);
+ return true;
+ }
+ return false;
+}
+
+void EnAm_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnAm* this = THIS;
+ s32 pad;
+
+ if (EnAm_UpdateDamage(this, globalCtx) == false) {
+ if (this->enemyCollider.base.atFlags & AT_BOUNCED) {
+ this->enemyCollider.base.atFlags &= ~(AT_BOUNCED | AT_HIT);
+ if (this->actor.colChkInfo.health == 0) {
+ this->actor.world.rot.y = this->actor.yawTowardsPlayer + 0x8000;
+ } else {
+ func_808B0AD0(this, globalCtx);
+ }
+ }
+ }
+ if (this->returnHomeTimer != 0) {
+ this->returnHomeTimer--;
+ }
+ this->actionFunc(this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 30.0f, 100.0f, 0x1D);
+ Actor_SetFocus(&this->actor, 64.0f);
+ Collider_UpdateCylinder(&this->actor, &this->enemyCollider);
+ Collider_UpdateCylinder(&this->actor, &this->interactCollider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->enemyCollider.base);
+ if (this->enemyCollider.base.acFlags & AC_ON) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->enemyCollider.base);
+ }
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->interactCollider.base);
+ if (this->enemyCollider.base.atFlags & AC_ON) {
+ this->actor.flags |= ACTOR_FLAG_1000000;
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->enemyCollider.base);
+ }
+ Math_StepToF(&this->effectAlpha, 0.0f, 0.05f);
+ this->effectScale = (this->effectAlpha + 1.0f) * 0.35f;
+ this->effectScale = (this->effectScale > 0.7f) ? 0.7f : this->effectScale;
+}
+
+void EnAm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ s32 i;
+ s32 phi_s3;
+ Vec3f* phi_s1;
+ Vec3f* phi_s2;
+ EnAm* this = THIS;
+
+ phi_s2 = 0;
+ phi_s1 = 0;
+ if (limbIndex == 4) {
+ phi_s2 = &this->limbPos[0];
+ phi_s1 = D_808B1128;
+ phi_s3 = 5;
+ } else if (limbIndex == 13) {
+ phi_s2 = &this->limbPos[9];
+ phi_s1 = D_808B117C;
+ phi_s3 = 4;
+ } else if ((limbIndex == 7) || (limbIndex == 10)) {
+ phi_s2 = (limbIndex == 7) ? &this->limbPos[5] : &this->limbPos[7];
+ phi_s1 = D_808B1164;
+ phi_s3 = 2;
+ } else {
+ phi_s3 = 0;
+ }
+ for (i = 0; i < phi_s3; i++, phi_s2++, phi_s1++) {
+ Matrix_MultiplyVector3fByState(phi_s1, phi_s2);
+ }
+}
+
+void EnAm_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ Gfx* gfx;
+ EnAm* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gfx = POLY_OPA_DISP;
+ gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]);
+ gDPSetEnvColor(&gfx[1], 0, 0, 0, this->textureBlend);
+ POLY_OPA_DISP = &gfx[2];
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnAm_PostLimbDraw,
+ &this->actor);
+ func_800BE680(globalCtx, &this->actor, this->limbPos, 13, this->effectScale, 0.0f, this->effectAlpha, 20);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
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 59d8abbad6..02ba4dd4a5 100644
--- a/src/overlays/actors/ovl_En_Am/z_en_am.h
+++ b/src/overlays/actors/ovl_En_Am/z_en_am.h
@@ -2,6 +2,7 @@
#define Z_EN_AM_H
#include "global.h"
+#include "objects/object_am/object_am.h"
struct EnAm;
@@ -9,9 +10,21 @@ typedef void (*EnAmActionFunc)(struct EnAm*, GlobalContext*);
typedef struct EnAm {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xEC];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[OBJECT_AM_LIMB_MAX];
+ /* 0x01DC */ Vec3s morphTable[OBJECT_AM_LIMB_MAX];
/* 0x0230 */ EnAmActionFunc actionFunc;
- /* 0x0234 */ char unk_234[0x14C];
+ /* 0x0234 */ u8 textureBlend; // 0 = statue textures; 255 = enemy textures
+ /* 0x0236 */ s16 explodeTimer; // timer counting down till armos explodes
+ /* 0x0238 */ s16 returnHomeTimer; // Timer that counts down till an armos will return to its spawn position
+ /* 0x023A */ s16 unkFlag;
+ /* 0x023C */ s16 armosYaw; // Yaw of Armos
+ /* 0x0240 */ f32 speed; // Hopping speed of Armos
+ /* 0x0244 */ f32 effectAlpha;
+ /* 0x0248 */ f32 effectScale;
+ /* 0x024C */ Vec3f limbPos[13];
+ /* 0x02E8 */ ColliderCylinder enemyCollider; // Collider for when Armos is Hostile
+ /* 0x0334 */ ColliderCylinder interactCollider; // Collider for when an interactable Armos is docile
} EnAm; // size = 0x380
extern const ActorInit En_Am_InitVars;
diff --git a/src/overlays/actors/ovl_En_An/z_en_an.c b/src/overlays/actors/ovl_En_An/z_en_an.c
index 43ea5744ab..9144d34fa0 100644
--- a/src/overlays/actors/ovl_En_An/z_en_an.c
+++ b/src/overlays/actors/ovl_En_An/z_en_an.c
@@ -6,7 +6,7 @@
#include "z_en_an.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnAn*)thisx)
diff --git a/src/overlays/actors/ovl_En_And/z_en_and.c b/src/overlays/actors/ovl_En_And/z_en_and.c
index ad0291e7d4..437bd17500 100644
--- a/src/overlays/actors/ovl_En_And/z_en_and.c
+++ b/src/overlays/actors/ovl_En_And/z_en_and.c
@@ -6,7 +6,7 @@
#include "z_en_and.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnAnd*)thisx)
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 c125784207..00bf054619 100644
--- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c
+++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c
@@ -1,21 +1,44 @@
/*
* File: z_en_ani.c
* Overlay: ovl_En_Ani
- * Description: Part-time worker
+ * Description: Man in Tree in South Termina Field
+ * version in shop at night is EnOssan actor using object_ani
*/
#include "z_en_ani.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnAni*)thisx)
+// clang-format off
+#define ANI_STATE_STANDING (0)
+#define ANI_STATE_UNK (1 << 0)
+#define ANI_STATE_WRITHING (1 << 1)
+#define ANI_STATE_CLIMBING (1 << 2)
+#define ANI_STATE_FALLING (1 << 3)
+// clang-format on
+
void EnAni_Init(Actor* thisx, GlobalContext* globalCtx);
void EnAni_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnAni_Update(Actor* thisx, GlobalContext* globalCtx);
void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void EnAni_DefaultBlink(EnAni* this);
+void EnAni_WaitForEyeClose(EnAni* this);
+void EnAni_WaitForEyeOpen(EnAni* this);
+
+void EnAni_SetText(EnAni* this, GlobalContext* globalCtx, u16 textId);
+
+void EnAni_HangInTree(EnAni* this, GlobalContext* globalCtx);
+void EnAni_LoseBalance(EnAni* this, GlobalContext* globalCtx);
+void EnAni_FallToGround(EnAni* this, GlobalContext* globalCtx);
+void EnAni_LandOnFoot(EnAni* this, GlobalContext* globalCtx);
+void EnAni_FallOverInPain(EnAni* this, GlobalContext* globalCtx);
+void EnAni_IdleInPain(EnAni* this, GlobalContext* globalCtx);
+void EnAni_Talk(EnAni* this, GlobalContext* globalCtx);
+void EnAni_IdleStanding(EnAni* this, GlobalContext* globalCtx);
+
const ActorInit En_Ani_InitVars = {
ACTOR_EN_ANI,
ACTORCAT_NPC,
@@ -28,62 +51,304 @@ const ActorInit En_Ani_InitVars = {
(ActorFunc)EnAni_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80968670 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+// two different colliders, but only one init for both
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 30, 40, 0, { 0, 0, 0 } },
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8096869C[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 850, ICHAIN_STOP),
};
-#endif
+void EnAni_DefaultBlink(EnAni* this) {
+ if (DECR(this->blinkTimer) == 0) {
+ this->blinkTimer = Rand_S16Offset(60, 60);
+ }
-extern ColliderCylinderInit D_80968670;
-extern InitChainEntry D_8096869C[];
+ this->eyeState = this->blinkTimer;
+ if (this->eyeState >= 3) {
+ this->eyeState = 0;
+ }
+}
-extern UNK_TYPE D_06000C14;
-extern UNK_TYPE D_060011CC;
-extern UNK_TYPE D_060027A0;
-extern UNK_TYPE D_06009220;
-extern UNK_TYPE D_06009D34;
+void EnAni_WaitForEyeClose(EnAni* this) {
+ if (this->blinkTimer > 0) {
+ this->blinkTimer--;
+ } else if (this->eyeState < 2) {
+ this->eyeState++;
+ } else {
+ this->blinkFunc = EnAni_WaitForEyeOpen;
+ this->blinkTimer = Rand_S16Offset(20, 20);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_809679D0.s")
+void EnAni_WaitForEyeOpen(EnAni* this) {
+ if (this->blinkTimer > 0) {
+ this->blinkTimer--;
+ } else if (this->eyeState > 0) {
+ this->eyeState--;
+ } else {
+ this->blinkFunc = EnAni_WaitForEyeClose;
+ this->blinkTimer = Rand_S16Offset(10, 10);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967A48.s")
+void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnAni* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967AB4.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gAniSkeleton, &gAniStandingNormalAnim, this->jointTable,
+ this->morphTable, ANI_LIMB_MAX);
+ Animation_PlayOnce(&this->skelAnime, &gAniStandingNormalAnim);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit);
+ Collider_UpdateCylinder(&this->actor, &this->collider2);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->stateFlags = ANI_STATE_STANDING;
+ this->unk2EE = 0;
+ this->treeReachTimer = 0;
+ this->blinkFunc = EnAni_DefaultBlink;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/EnAni_Init.s")
+ if (GET_ANI_TYPE(thisx) == ANI_TYPE_TREE_HANGING) {
+ Animation_Change(&this->skelAnime, &gAniTreeHangingAnim, 1.0f, 0.0f,
+ Animation_GetLastFrame(&gAniTreeHangingAnim), ANIMMODE_ONCE, 0.0f);
+ this->actionFunc = EnAni_HangInTree;
+ this->actor.velocity.y = 0.0f;
+ this->actor.terminalVelocity = 0.0f;
+ this->actor.gravity = 0.0f;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->stateFlags |= ANI_STATE_CLIMBING;
+ gSaveContext.eventInf[1] &= (u8)~0x10;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/EnAni_Destroy.s")
+ } else { // ANI_TYPE_STANDING
+ // ( unused code )
+ // for some reason standing he has a large collider
+ // possibly he was meant to be a blocking npc like bomber
+ this->collider2.dim.radius = 60;
+ this->actionFunc = EnAni_IdleStanding;
+ this->actor.velocity.y = -25.0f;
+ this->actor.terminalVelocity = -25.0f;
+ this->actor.gravity = -5.0f;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967D20.s")
+void EnAni_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnAni* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967DA0.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider1);
+ Collider_DestroyCylinder(globalCtx, &this->collider2);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967DCC.s")
+void EnAni_SetText(EnAni* this, GlobalContext* globalCtx, u16 textId) {
+ s16 diffAngle = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967E34.s")
+ this->actor.textId = textId;
+ if ((this->stateFlags & ANI_STATE_WRITHING) || ABS_ALT(diffAngle) <= 0x4300) {
+ if (this->actor.xzDistToPlayer < 100.0f) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967E90.s")
+void EnAni_IdleStanding(EnAni* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967F20.s")
+void EnAni_Talk(EnAni* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+ if (Message_GetState(&globalCtx->msgCtx) == 2 && globalCtx->msgCtx.unk11F04 == 0x6DE) {
+ this->actionFunc = EnAni_IdleInPain;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80967FA4.s")
+void EnAni_IdleInPain(EnAni* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = EnAni_Talk;
+ } else {
+ // telling you not to take his rupees you knocked from the tree
+ EnAni_SetText(this, globalCtx, 0x6DE);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_809680B0.s")
+void EnAni_FallOverInPain(EnAni* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ this->blinkFunc = EnAni_WaitForEyeOpen;
+ this->actionFunc = EnAni_IdleInPain;
+ Animation_Change(&this->skelAnime, &gAniHoldingFootWrithingInPainAnim, 1.0f, 0.0f,
+ Animation_GetLastFrame(&gAniHoldingFootWrithingInPainAnim), ANIMMODE_LOOP, 0.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80968164.s")
+void EnAni_LandOnFoot(EnAni* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ this->actionFunc = EnAni_FallOverInPain;
+ Animation_Change(&this->skelAnime, &gAniFallOverHoldingFootAnim, 1.0f, 0.0f,
+ Animation_GetLastFrame(&gAniFallOverHoldingFootAnim), ANIMMODE_ONCE, 0.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/EnAni_Update.s")
+void EnAni_FallToGround(EnAni* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s16 quakeValue;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_80968504.s")
+ if (this->actor.bgCheckFlags & 1) { // hit the ground
+ this->actor.flags &= ~ACTOR_FLAG_10;
+ this->actionFunc = EnAni_LandOnFoot;
+ this->actor.velocity.x = 0.0f;
+ this->actor.velocity.z = 0.0f;
+ // the animation gets cut short, (first 16 frames only) only the landing part is seen
+ Animation_Change(&this->skelAnime, &gAniLandingThenStandingUpAnim, 1.0f, 0.0f, 16.0f, ANIMMODE_ONCE, 0.0f);
+ this->stateFlags |= ANI_STATE_WRITHING;
+ quakeValue = Quake_Add(globalCtx->cameraPtrs[0], 3);
+ Quake_SetSpeed(quakeValue, 0x6978);
+ Quake_SetQuakeValues(quakeValue, 7, 0, 0, 0);
+ Quake_SetCountdown(quakeValue, 0x14);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_HAMMER_HIT);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/func_8096854C.s")
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2, 0x7D0, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ani/EnAni_Draw.s")
+void EnAni_LoseBalance(EnAni* this, GlobalContext* globalCtx) {
+ s32 pad;
+
+ if (SkelAnime_Update(&this->skelAnime)) {
+ this->actor.terminalVelocity = -20.0f;
+ this->actor.gravity = -5.0f;
+ this->actor.velocity.y = 0.0f;
+ this->actor.velocity.z = -4.0f;
+ // frame count : 0.0f, only first frame, rest is handled in next action func
+ Animation_Change(&this->skelAnime, &gAniLandingThenStandingUpAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 5.0f);
+ this->actionFunc = EnAni_FallToGround;
+ gSaveContext.eventInf[1] |= 0x10;
+ }
+}
+
+void EnAni_HangInTree(EnAni* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ if (this->treeReachTimer > 0) {
+ this->treeReachTimer--;
+ if (this->treeReachTimer > 0) {
+ Animation_PlayOnce(&this->skelAnime, &gAniTreeHangingReachAnim);
+ } else {
+ Animation_PlayOnce(&this->skelAnime, &gAniTreeHangingAnim);
+ }
+ } else if (Rand_ZeroFloat(1.0f) < 0.4f) {
+ Animation_PlayOnce(&this->skelAnime, &gAniTreeHangingReachAnim);
+ this->treeReachTimer = 2;
+ } else {
+ Animation_PlayOnce(&this->skelAnime, &gAniTreeHangingAnim);
+ }
+ }
+
+ // his bonk detection is based on his tilt, neat
+ if (this->actor.home.rot.x != 0) {
+ this->stateFlags |= ANI_STATE_FALLING;
+ this->actionFunc = EnAni_LoseBalance;
+ Animation_Change(&this->skelAnime, &gAniTreeHangLosingBalanceAnim, 1.0f, 0.0f,
+ Animation_GetLastFrame(&gAniTreeHangLosingBalanceAnim), ANIMMODE_ONCE, -5.0f);
+ }
+}
+
+void EnAni_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnAni* this = THIS;
+ f32 minVelocity;
+
+ Collider_UpdateCylinder(&this->actor, &this->collider1);
+ Collider_UpdateCylinder(&this->actor, &this->collider2);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ if (!(this->stateFlags & ANI_STATE_UNK)) {
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ }
+
+ this->actor.velocity.y += this->actor.gravity;
+ minVelocity = this->actor.terminalVelocity;
+ if (this->actor.velocity.y < minVelocity) {
+ this->actor.velocity.y = minVelocity;
+ }
+
+ Actor_UpdatePos(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+ this->actionFunc(this, globalCtx);
+ if (this->actor.xzDistToPlayer < 100.0f && !(this->stateFlags & ANI_STATE_CLIMBING)) {
+ func_800E9250(globalCtx, &this->actor, &this->headRot, &this->chestRot, this->actor.focus.pos);
+ this->chestRot.x = this->chestRot.y = this->chestRot.z = 0;
+ } else {
+ Math_SmoothStepToS(&this->headRot.x, 0, 0x6, 0x1838, 0x64);
+ Math_SmoothStepToS(&this->headRot.y, 0, 0x6, 0x1838, 0x64);
+ Math_SmoothStepToS(&this->chestRot.x, 0, 0x6, 0x1838, 0x64);
+ Math_SmoothStepToS(&this->chestRot.y, 0, 0x6, 0x1838, 0x64);
+ }
+
+ this->blinkFunc(this);
+ if (this->stateFlags & ANI_STATE_FALLING) {
+ if (this->actor.cutscene == -1) {
+ this->stateFlags &= ~ANI_STATE_FALLING;
+ } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
+ this->actor.cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
+ Camera_SetToTrackActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->actor.cutscene)),
+ &this->actor);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+ }
+}
+
+s32 EnAni_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnAni* this = THIS;
+
+ if (limbIndex == ANI_LIMB_HEAD) {
+ rot->x += this->headRot.y;
+ rot->z += this->headRot.x;
+ }
+
+ return false;
+}
+
+void EnAni_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ static Vec3f D_809686A4 = { 800.0f, 500.0f, 0.0f };
+
+ if (limbIndex == ANI_LIMB_HEAD) {
+ Matrix_MultiplyVector3fByState(&D_809686A4, &thisx->focus.pos);
+ }
+}
+
+void EnAni_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static TexturePtr sEyeTextures[] = { gAniOpenEyeTex, gAniClosingEyeTex, gAniClosedEyeTex };
+ s32 pad;
+ EnAni* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_InsertTranslation(0.0f, 0.0f, -1000.0f, MTXMODE_APPLY);
+ func_8012C5B0(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeState]));
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnAni_OverrideLimbDraw, EnAni_PostLimbDraw, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.h b/src/overlays/actors/ovl_En_Ani/z_en_ani.h
index 554c1bc8af..21dced2c18 100644
--- a/src/overlays/actors/ovl_En_Ani/z_en_ani.h
+++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.h
@@ -2,18 +2,37 @@
#define Z_EN_ANI_H
#include "global.h"
+#include "objects/object_ani/object_ani.h"
struct EnAni;
typedef void (*EnAniActionFunc)(struct EnAni*, GlobalContext*);
+typedef void (*EnAniBlinkFunc)(struct EnAni*);
+
typedef struct EnAni {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x1B0];
- /* 0x02F4 */ EnAniActionFunc actionFunc;
- /* 0x02F8 */ char unk_2F8[0x8];
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ ColliderCylinder collider1;
+ /* 0x190 */ ColliderCylinder collider2;
+ /* 0x1DC */ SkelAnime skelAnime;
+ /* 0x220 */ Vec3s jointTable[ANI_LIMB_MAX];
+ /* 0x280 */ Vec3s morphTable[ANI_LIMB_MAX];
+ /* 0x2E0 */ Vec3s headRot;
+ /* 0x2E6 */ Vec3s chestRot; // unused
+ /* 0x2EC */ u16 stateFlags;
+ /* 0x2EE */ s16 unk2EE; // assigned to zero in init, never used after
+ /* 0x2F0 */ s16 treeReachTimer;
+ /* 0x2F4 */ EnAniBlinkFunc blinkFunc;
+ /* 0x2F8 */ s16 eyeState;
+ /* 0x2FA */ s16 blinkTimer;
+ /* 0x2FC */ EnAniActionFunc actionFunc;
} EnAni; // size = 0x300
-extern const ActorInit En_Ani_InitVars;
+enum EnAniType {
+ /* else */ ANI_TYPE_STANDING, // unfinshed and unused
+ /* 1 */ ANI_TYPE_TREE_HANGING = 1,
+};
+
+#define GET_ANI_TYPE(thisx) (thisx->params & 0xFF)
#endif // Z_EN_ANI_H
diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
index 4c7b1d6cb2..26cde7e4c8 100644
--- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
+++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c
@@ -9,7 +9,7 @@
#include "overlays/actors/ovl_En_Dg/z_en_dg.h"
#include "objects/object_aob/object_aob.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnAob01*)thisx)
@@ -45,10 +45,13 @@ const ActorInit En_Aob_01_InitVars = {
(ActorFunc)EnAob01_Draw,
};
-static ActorAnimationEntry D_809C3790[6] = {
- { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_0068B4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
- { &object_aob_Anim_00700C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_0058EC, 1.0f, 0.0f, 0.0f, 2, 0.0f },
- { &object_aob_Anim_006040, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, 0, -6.0f },
+static AnimationInfo D_809C3790[6] = {
+ { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_aob_Anim_0068B4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_aob_Anim_00700C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_aob_Anim_0058EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_aob_Anim_006040, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_aob_Anim_007758, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
};
static ColliderCylinderInit sCylinderInit = {
@@ -150,7 +153,7 @@ s32 func_809C1424(EnAob01* this) {
if (this->unk_43C == 1) {
if (curFrame == lastFrame) {
this->unk_43C = 2;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 2);
return true;
}
} else if (this->unk_43C == 2) {
@@ -166,13 +169,13 @@ s32 func_809C14D0(EnAob01* this) {
if ((this->unk_43C == 0) || (this->unk_43C == 5)) {
if (curFrame == lastFrame) {
this->unk_43C = 3;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 3);
return true;
}
} else if (this->unk_43C == 3) {
if (curFrame == lastFrame) {
this->unk_43C = 4;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 4);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 4);
return true;
}
} else if (this->unk_43C == 4) {
@@ -188,7 +191,7 @@ s32 func_809C15BC(EnAob01* this) {
if ((this->unk_43C != 0) && (this->unk_43C != 5)) {
if (curFrame == lastFrame) {
this->unk_43C = 5;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 5);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 5);
return true;
}
} else {
@@ -330,7 +333,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 |= 0x40;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
case 0x3525:
@@ -345,7 +348,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 |= 0x40;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
}
@@ -360,7 +363,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 |= 4;
this->unk_2D2 |= 0x10;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
case 0x3527:
@@ -372,7 +375,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_210 = 0x3536;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
}
@@ -380,7 +383,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_210 = 0x3537;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
}
@@ -394,7 +397,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 &= ~2;
func_801159EC(-this->unk_434);
func_800B7298(globalCtx, NULL, 7);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_809C1C9C;
return;
@@ -408,7 +411,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
break;
}
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
}
void func_809C1C9C(EnAob01* this, GlobalContext* globalCtx) {
@@ -436,13 +439,13 @@ void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) {
if (gSaveContext.rupees < 10) {
play_sound(NA_SE_SY_ERROR);
this->unk_210 = 0x3524;
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
} else {
func_8019F208();
this->unk_2D2 |= 4;
this->unk_2D2 |= 0x10;
this->unk_210 = 0x3522;
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
this->actionFunc = func_809C21E0;
}
break;
@@ -450,12 +453,12 @@ void func_809C1D64(EnAob01* this, GlobalContext* globalCtx) {
case 1:
func_8019F230();
this->unk_210 = 0x3535;
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
break;
}
}
} else if ((temp_v0 == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_210 = 0;
this->actionFunc = func_809C2060;
@@ -468,7 +471,7 @@ void func_809C1EC8(EnAob01* this, GlobalContext* globalCtx) {
Vec3f sp30;
SkelAnime_Update(&this->skelAnime);
- if (func_8013D5E8(this->actor.shape.rot.y, 14000, this->actor.yawTowardsPlayer)) {
+ if (SubS_AngleDiffLessEqual(this->actor.shape.rot.y, 0x36B0, this->actor.yawTowardsPlayer)) {
sp30.x = player->actor.world.pos.x;
sp30.y = player->bodyPartsPos[7].y + 3.0f;
sp30.z = player->actor.world.pos.z;
@@ -483,7 +486,7 @@ void func_809C1EC8(EnAob01* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->unk_2E0.y, 0, 4, 1000, 1);
}
func_809C10B0(this, 3);
- func_8013D9C8(globalCtx, this->unk_2F8, this->unk_318, 0x10);
+ SubS_FillLimbRotTables(globalCtx, this->unk_2F8, this->unk_318, ARRAY_COUNT(this->unk_2F8));
func_809C165C(this, globalCtx);
if (player->stateFlags1 & 0x20) {
func_809C1124();
@@ -494,7 +497,7 @@ void func_809C2060(EnAob01* this, GlobalContext* globalCtx) {
if (func_809C15BC(this)) {
if (func_809C2EC4(this, globalCtx) && !(this->unk_2D2 & 0x100)) {
if (this->collider.base.ocFlags2 & OC2_HIT_PLAYER) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 100.0f);
this->unk_2D2 |= 8;
this->actionFunc = func_809C21E0;
@@ -528,7 +531,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
}
this->actor.textId = 0;
this->unk_2D2 &= ~8;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = func_809C2060;
return;
}
@@ -543,7 +546,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
if (this->unk_2D2 & 8) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80123E90(globalCtx, &this->actor);
if (this->unk_2D2 & 4) {
func_809C16DC(this, globalCtx);
@@ -552,8 +555,8 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 |= 0x10;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
- func_801518B0(globalCtx, 0x354B, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
+ Message_StartTextbox(globalCtx, 0x354B, &this->actor);
}
this->unk_2D2 &= ~8;
}
@@ -578,7 +581,7 @@ void func_809C21E0(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 &= ~0x40;
if (this->unk_2D2 & 0x10) {
this->unk_2D2 &= ~0x10;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_809C2060;
} else {
@@ -700,7 +703,7 @@ void func_809C2824(EnAob01* this, GlobalContext* globalCtx) {
void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80123E90(globalCtx, &this->actor);
this->unk_434 = gSaveContext.unk_3F5C;
switch ((gSaveContext.eventInf[0] & 0xF8) >> 3) {
@@ -731,11 +734,11 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) {
this->unk_210 = 0x352D;
this->unk_2D2 |= 0x40;
this->unk_43C = 1;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 1);
break;
}
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
this->actionFunc = func_809C2D0C;
} else if (this->actor.xzDistToPlayer < 100.0f) {
func_800B8614(&this->actor, globalCtx, 100.0f);
@@ -748,7 +751,7 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) {
if (func_809C15BC(this)) {
if ((sp2F == 5) && func_80147624(globalCtx)) {
this->unk_434 = 0;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
}
@@ -765,9 +768,9 @@ void func_809C2A64(EnAob01* this, GlobalContext* globalCtx) {
this->actionFunc = func_809C2BE4;
}
} else if (gSaveContext.weekEventReg[8] & 0x20) {
- Actor_PickUp(&this->actor, globalCtx, 4, 300.0f, 300.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 300.0f, 300.0f);
} else {
- Actor_PickUp(&this->actor, globalCtx, 12, 300.0f, 300.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 300.0f, 300.0f);
}
}
}
@@ -821,7 +824,7 @@ void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) {
this->unk_2D2 &= ~0x80;
if (this->unk_434 >= 150) {
this->unk_210 = 0x352E;
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
this->actionFunc = func_809C2A64;
} else {
this->unk_2D4 = this->unk_2E6;
@@ -839,7 +842,7 @@ void func_809C2D0C(EnAob01* this, GlobalContext* globalCtx) {
}
this->unk_210 = 0x354C;
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
this->actionFunc = func_809C1D64;
gSaveContext.eventInf[0] &= (u8)~7;
}
@@ -927,14 +930,14 @@ void EnAob01_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->unk_43C = 0;
- Actor_ChangeAnimation(&this->skelAnime, D_809C3790, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, D_809C3790, 0);
Actor_SetScale(&this->actor, 0.01f);
switch (gSaveContext.eventInf[0] & 7) {
case 0:
func_809C2FA0();
func_809C11EC(this, globalCtx);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = func_809C2060;
break;
@@ -945,7 +948,7 @@ void EnAob01_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_430 = this->actor.cutscene;
func_809C2594(this, globalCtx);
ActorCutscene_SetIntentToPlay(this->unk_430);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
func_809C2F34(this, globalCtx);
this->actionFunc = func_809C2824;
break;
@@ -953,8 +956,8 @@ void EnAob01_Init(Actor* thisx, GlobalContext* globalCtx) {
case 3:
func_809C2FA0();
func_809C11EC(this, globalCtx);
- this->actor.flags |= 1;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_809C28B8;
break;
}
@@ -979,10 +982,10 @@ void EnAob01_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 EnAob01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx) {
EnAob01* this = THIS;
- UNK_TYPE sp38[] = {
- &object_aob_Tex_000658,
- &object_aob_Tex_000E58,
- &object_aob_Tex_001658,
+ TexturePtr sp38[] = {
+ object_aob_Tex_000658,
+ object_aob_Tex_000E58,
+ object_aob_Tex_001658,
};
if (limbIndex == 15) {
@@ -1023,7 +1026,7 @@ void EnAob01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
}
-void EnAob01_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnAob01_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnAob01_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -1040,8 +1043,9 @@ void EnAob01_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 50, 80, 0, 0));
gDPPipeSync(POLY_OPA_DISP++);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnAob01_OverrideLimbDraw, EnAob01_PostLimbDraw, EnAob01_UnkDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnAob01_OverrideLimbDraw, EnAob01_PostLimbDraw,
+ EnAob01_TransformLimbDraw, &this->actor);
if (this->actor.draw != NULL) {
func_8012C2DC(globalCtx->state.gfxCtx);
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 097c90fe08..adfce2f19b 100644
--- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
+++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c
@@ -5,8 +5,10 @@
*/
#include "z_en_arrow.h"
+#include "overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnArrow*)thisx)
@@ -20,7 +22,6 @@ void func_8088ACE0(EnArrow* this, GlobalContext* globalCtx);
void func_8088B630(EnArrow* this, GlobalContext* globalCtx);
void func_8088B6B0(EnArrow* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Arrow_InitVars = {
ACTOR_EN_ARROW,
ACTORCAT_ITEMACTION,
@@ -33,45 +34,718 @@ const ActorInit En_Arrow_InitVars = {
(ActorFunc)EnArrow_Draw,
};
-// static ColliderQuadInit sQuadInit = {
-static ColliderQuadInit D_8088C1E0 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, OC2_TYPE_PLAYER, COLSHAPE_QUAD, },
- { ELEMTYPE_UNK2, { 0x00000020, 0x00, 0x02 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_NONE, },
+static ColliderQuadInit sQuadInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_PLAYER,
+ AC_NONE,
+ OC1_NONE,
+ OC2_TYPE_PLAYER,
+ COLSHAPE_QUAD,
+ },
+ {
+ ELEMTYPE_UNK2,
+ { 0x00000020, 0x00, 0x02 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_NONE,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8088C230[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(terminalVelocity, -150, ICHAIN_STOP),
};
+void EnArrow_Init(Actor* thisx, GlobalContext* globalCtx) {
+ static EffectBlureInit2 D_8088C234 = {
+ 0, 4, 0, { 0, 255, 200, 255 }, { 0, 255, 255, 255 }, { 0, 255, 200, 0 }, { 0, 255, 255, 0 }, 16,
+ 0, 1, 0, { 255, 255, 170, 255 }, { 0, 150, 0, 0 },
+ };
+ static EffectBlureInit2 D_8088C258 = {
+ 0, 4, 0, { 0, 255, 200, 255 }, { 0, 255, 255, 255 }, { 0, 255, 200, 0 }, { 0, 255, 255, 0 }, 16,
+ 0, 1, 0, { 255, 200, 0, 255 }, { 255, 0, 0, 0 },
+ };
+ static EffectBlureInit2 D_8088C27C = {
+ 0, 4, 0, { 0, 255, 200, 255 }, { 0, 255, 255, 255 }, { 0, 255, 200, 0 }, { 0, 255, 255, 0 }, 16,
+ 0, 1, 0, { 170, 255, 255, 255 }, { 0, 0x64, 255, 0 },
+ };
+ static EffectBlureInit2 D_8088C2A0 = {
+ 0, 4, 0, { 0, 255, 200, 255 }, { 0, 255, 255, 255 }, { 0, 255, 200, 0 }, { 0, 255, 255, 0 }, 16,
+ 0, 1, 0, { 255, 255, 170, 255 }, { 255, 255, 0, 0 },
+ };
+ EnArrow* this = THIS;
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ if (this->actor.params == ENARROW_MINUS8) {
+ this->unk_263 = 1;
+ this->actor.params = 8;
+ }
+
+ if (this->actor.params < ENARROW_6) {
+ SkelAnime_Init(globalCtx, &this->arrow.skelAnime, &gameplay_keep_Skel_014560, &gameplay_keep_Anim_0128BC,
+ this->arrow.jointTable, this->arrow.jointTable, 5);
+ if (this->actor.params < ENARROW_3) {
+ if (this->actor.params == ENARROW_1) {
+ D_8088C234.elemDuration = 4;
+ } else {
+ D_8088C234.elemDuration = 16;
+ }
+ Effect_Add(globalCtx, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C234);
+ } else if (this->actor.params == ENARROW_3) {
+ Effect_Add(globalCtx, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C258);
+ } else if (this->actor.params == ENARROW_4) {
+ Effect_Add(globalCtx, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C27C);
+ } else if (this->actor.params == ENARROW_5) {
+ Effect_Add(globalCtx, &this->unk_240, EFFECT_BLURE2, 0, 0, &D_8088C2A0);
+ }
+ }
+
+ Collider_InitQuad(globalCtx, &this->collider);
+ Collider_SetQuad(globalCtx, &this->collider, &this->actor, &sQuadInit);
+
+ if (this->actor.params < ENARROW_6) {
+ this->collider.info.toucherFlags &= ~(TOUCH_SFX_WOOD | TOUCH_SFX_HARD);
+ this->collider.info.toucherFlags |= 0;
+ }
+
+ if (this->actor.params < ENARROW_0) {
+ this->collider.base.atFlags = (AT_TYPE_ENEMY | AT_ON);
+ } else {
+ this->collider.info.toucher.dmgFlags = func_800BC188(this->actor.params);
+ if (this->actor.params == ENARROW_8) {
+ this->collider.info.toucher.damage = 1;
+ }
+
+ if (this->actor.params == ENARROW_7) {
+ Actor_SetScale(&this->actor, 1.0f);
+ }
+ }
+ this->actionFunc = func_8088A594;
+}
+
+void EnArrow_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnArrow* this = THIS;
+
+ if (this->actor.params < ENARROW_6) {
+ Effect_Destroy(globalCtx, this->unk_240);
+ }
+
+ Collider_DestroyQuad(globalCtx, &this->collider);
+
+ if ((this->unk_264 != NULL) && (this->unk_264->update != NULL)) {
+ this->unk_264->flags &= ~0x8000;
+ }
+
+ if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6) && (this->actor.child == NULL)) {
+ func_80115D5C(&globalCtx->state);
+ }
+}
+
+void func_8088A514(EnArrow* this) {
+ f32 temp_f0 = 16.0f - this->bubble.unk_144;
+
+ Actor_SetSpeeds(&this->actor, CLAMP(temp_f0, 1.0f, 80.0f));
+}
+
+void func_8088A594(EnArrow* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->actor.parent != NULL) {
+ if (this->actor.params == ENARROW_7) {
+ if (Math_SmoothStepToF(&this->bubble.unk_144, 16.0f, 0.07f, 1.8f, 0.0f) > 0.5f) {
+ func_800B9010(&this->actor, NA_SE_PL_DEKUNUTS_BUBLE_BREATH - SFX_FLAG);
+ return;
+ }
+
+ this->bubble.unk_148++;
+ if (this->bubble.unk_148 > 20) {
+ this->actionFunc = func_8088ACE0;
+ func_80115D5C(&globalCtx->state);
+ }
+ }
+ } else {
+ if ((this->actor.params != ENARROW_8) && (player->unk_D57 == 0)) {
+ if (this->actor.params == ENARROW_7) {
+ func_80115D5C(&globalCtx->state);
+ }
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ switch (this->actor.params) {
+ case ENARROW_6:
+ func_800B8E58(player, NA_SE_IT_SLING_SHOT);
+ break;
+
+ case ENARROW_0:
+ case ENARROW_1:
+ case ENARROW_2:
+ func_800B8E58(player, NA_SE_IT_ARROW_SHOT);
+ break;
+
+ case ENARROW_3:
+ case ENARROW_4:
+ case ENARROW_5:
+ func_800B8E58(player, NA_SE_IT_MAGIC_ARROW_SHOT);
+
+ case ENARROW_7:
+ func_800B8E58(player, NA_SE_PL_DEKUNUTS_FIRE);
+ break;
+ }
+
+ this->actionFunc = func_8088ACE0;
+ Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
+
+ if (this->actor.params == ENARROW_7) {
+ this->bubble.unk_144 = CLAMP_MIN(this->bubble.unk_144, 3.5f);
+ func_8088A514(this);
+ this->unk_260 = 99;
+ func_80115D5C(&globalCtx->state);
+ } else if (this->actor.params >= ENARROW_6) {
+ if ((this->actor.params == ENARROW_8) && (this->actor.world.rot.x < 0)) {
+ Actor_SetScale(&this->actor, 0.009f);
+ this->unk_260 = 40;
+ } else {
+ Actor_SetSpeeds(&this->actor, 80.0f);
+ this->unk_260 = 15;
+ }
+ this->actor.shape.rot.x = 0;
+ this->actor.shape.rot.y = 0;
+ this->actor.shape.rot.z = 0;
+ } else {
+ Actor_SetSpeeds(&this->actor, 150.0f);
+ this->unk_260 = 16;
+ }
+ }
+}
+
+void func_8088A7D8(GlobalContext* globalCtx, EnArrow* this) {
+ this->actionFunc = func_8088B6B0;
+ Animation_PlayOnce(&this->arrow.skelAnime, &gameplay_keep_Anim_012860);
+ this->actor.world.rot.y += (s32)(0x6000 * (Rand_ZeroOne() - 0.5f)) + 0x8000;
+ this->actor.speedXZ *= 0.02f + (0.02f * Rand_ZeroOne());
+ this->actor.gravity = -1.5f;
+ this->unk_260 = 50;
+ this->unk_263 = 1;
+}
+
+void func_8088A894(EnArrow* this, GlobalContext* globalCtx) {
+ CollisionPoly* sp74;
+ Vec3f sp68;
+ Vec3f sp5C;
+ Vec3f sp50;
+ f32 sp4C;
+ f32 temp_f0;
+ s32 sp44;
+
+ Math_Vec3f_Diff(&this->actor.world.pos, &this->unk_228, &sp68);
+ sp4C = ((this->actor.world.pos.x - this->unk_264->world.pos.x) * sp68.x) +
+ ((this->actor.world.pos.y - this->unk_264->world.pos.y) * sp68.y) +
+ ((this->actor.world.pos.z - this->unk_264->world.pos.z) * sp68.z);
+ if (sp4C < 0.0f) {
+ return;
+ }
+
+ temp_f0 = Math3D_LengthSquared(&sp68);
+ if (temp_f0 < 1.0f) {
+ return;
+ }
+
+ temp_f0 = sp4C / temp_f0;
+ Math_Vec3f_Scale(&sp68, temp_f0);
+ Math_Vec3f_Sum(&this->unk_264->world.pos, &sp68, &sp5C);
+ if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->unk_264->world.pos, &sp5C, &sp50, &sp74, true, true, true,
+ true, &sp44)) {
+ this->unk_264->world.pos.x = ((sp5C.x <= sp50.x) ? 1.0f : -1.0f) + sp50.x;
+ this->unk_264->world.pos.y = ((sp5C.y <= sp50.y) ? 1.0f : -1.0f) + sp50.y;
+ this->unk_264->world.pos.z = ((sp5C.z <= sp50.z) ? 1.0f : -1.0f) + sp50.z;
+ } else {
+ Math_Vec3f_Copy(&this->unk_264->world.pos, &sp5C);
+ }
+}
+
+void func_8088AA98(EnArrow* this, GlobalContext* globalCtx) {
+ WaterBox* sp54;
+ f32 sp50 = this->actor.world.pos.y;
+ Vec3f sp44;
+ f32 temp_f0;
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp50,
+ &sp54) &&
+ (this->actor.world.pos.y < sp50) && !(this->actor.bgCheckFlags & 0x20)) {
+ this->actor.bgCheckFlags |= 0x20;
+
+ Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.home.pos, &sp44);
+
+ if (sp44.y != 0.0f) {
+ temp_f0 = sqrtf(SQ(sp44.x) + SQ(sp44.z));
+ if (temp_f0 != 0.0f) {
+ temp_f0 = (((sp50 - this->actor.home.pos.y) / sp44.y) * temp_f0) / temp_f0;
+ }
+ sp44.x = this->actor.home.pos.x + (sp44.x * temp_f0);
+ sp44.y = sp50;
+ sp44.z = this->actor.home.pos.z + (sp44.z * temp_f0);
+ EffectSsGSplash_Spawn(globalCtx, &sp44, NULL, NULL, 0, 300);
+ }
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L);
+
+ EffectSsGRipple_Spawn(globalCtx, &sp44, 100, 500, 0);
+ EffectSsGRipple_Spawn(globalCtx, &sp44, 100, 500, 4);
+ EffectSsGRipple_Spawn(globalCtx, &sp44, 100, 500, 8);
+
+ if ((this->actor.params == ENARROW_4) || (this->actor.params == ENARROW_3)) {
+ if ((this->actor.params == ENARROW_4) && (func_8088B6B0 != this->actionFunc)) {
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_BG_ICEFLOE, sp44.x, sp44.y, sp44.z, 0, 0, 0, 300);
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ this->actor.params = ENARROW_2;
+ this->collider.info.toucher.dmgFlags = 0x20;
+
+ if (this->actor.child != NULL) {
+ Actor_MarkForDeath(this->actor.child);
+ return;
+ }
+
+ func_80115D5C(&globalCtx->state);
+ }
+ }
+}
+
+#ifdef NON_MATCHING
+// Stack. Scoped variable required to fix code gen at the bottom, likely sp60/54 there,
+// but sp50 must be declared below those so maybe not?
+void func_8088ACE0(EnArrow* this, GlobalContext* globalCtx) {
+ CollisionPoly* spAC;
+ s32 spA8;
+ Vec3f sp9C;
+ s32 phi_a2 = 0;
+ EffectSsSbnInitParams sp84;
+ u16 sp82;
+ Actor* sp7C;
+ f32 sp78;
+ f32 sp74;
+ f32 temp_f12_2;
+ Vec3f sp60;
+ Vec3f sp54;
+ s32 sp50;
+
+ if ((DECR(this->unk_260) == 0) ||
+ ((this->actor.params == ENARROW_7) &&
+ ((this->unk_262 != 0) || (phi_a2 = (this->collider.base.atFlags & AT_HIT) != 0)))) {
+ if (this->actor.params == ENARROW_7) {
+ if (phi_a2 && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4) &&
+ (this->collider.base.atFlags & AT_BOUNCED)) {
+ if ((this->collider.base.at != NULL) && (this->collider.base.at->id != ACTOR_OBJ_SYOKUDAI)) {
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
+ this->actor.world.rot.y += BINANG_ROT180((s16)randPlusMinusPoint5Scaled(8000.0f));
+ this->actor.velocity.y = -this->actor.velocity.y;
+ this->bubble.unk_149 = -1;
+ return;
+ }
+ }
+
+ if ((this->unk_262 != 0) || phi_a2) {
+ EffectSsStone1_Spawn(globalCtx, &this->actor.world.pos, 0);
+ }
+
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_IT_DEKUNUTS_BUBLE_VANISH);
+
+ if ((this->unk_262 != 0) && (this->actor.wallBgId == BG_ACTOR_MAX)) {
+
+ Math_Vec3f_Copy(&sp84.unk_00, &this->actor.world.pos);
+ sp84.unk_0C = this->actor.wallPoly;
+ sp84.unk_10 = this->bubble.unk_144;
+ EffectSs_Spawn(globalCtx, EFFECT_SS_SBN, 128, &sp84.unk_00);
+ }
+ }
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ sp50 =
+ (this->actor.params != ENARROW_0) && (this->actor.params < ENARROW_8) && (this->collider.base.atFlags & AT_HIT);
+
+ if (sp50 || (this->unk_262 != 0)) {
+ if (this->actor.params >= ENARROW_6) {
+ if (sp50) {
+ this->actor.world.pos.x = (this->actor.world.pos.x + this->actor.prevPos.x) * 0.5f;
+ this->actor.world.pos.y = (this->actor.world.pos.y + this->actor.prevPos.y) * 0.5f;
+ this->actor.world.pos.z = (this->actor.world.pos.z + this->actor.prevPos.z) * 0.5f;
+ }
+
+ if (this->actor.params == ENARROW_8) {
+ iREG(50) = -1;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_FIRE1, this->actor.world.pos.x,
+ this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, this->actor.speedXZ == 0.0f);
+ sp82 = NA_SE_IT_DEKU;
+ } else {
+ sp82 = NA_SE_IT_SLING_REFLECT;
+ }
+ EffectSsStone1_Spawn(globalCtx, &this->actor.world.pos, 0);
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, sp82);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ EffectSsHitMark_SpawnCustomScale(globalCtx, 0, 150, &this->actor.world.pos);
+
+ if (sp50 && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
+ sp7C = this->collider.base.at;
+
+ if ((sp7C->update != NULL) && !(this->collider.base.atFlags & AT_BOUNCED) && (sp7C->flags & 0x4000)) {
+ this->unk_264 = sp7C;
+ func_8088A894(this, globalCtx);
+ Math_Vec3f_Diff(&sp7C->world.pos, &this->actor.world.pos, &this->unk_268);
+ sp7C->flags |= 0x8000;
+ this->collider.base.atFlags &= ~AT_HIT;
+ this->actor.speedXZ *= 0.5f;
+ this->actor.velocity.y *= 0.5f;
+ } else {
+ this->unk_261 |= 1;
+ this->unk_261 |= 2;
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
+ func_8088A7D8(globalCtx, this);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_HOOKSHOT_STICK_CRE);
+ }
+ } else if (this->unk_262 != 0) {
+ this->actionFunc = func_8088B630;
+ Animation_PlayOnce(&this->arrow.skelAnime, &gameplay_keep_Anim_0128BC);
+ if (this->actor.params >= ENARROW_0) {
+ this->unk_260 = 60;
+ } else {
+ this->unk_260 = 20;
+ }
+ if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6)) {
+ this->actor.draw = NULL;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_ARROW_STICK_OBJ);
+ this->unk_261 |= 1;
+ }
+ }
+ } else {
+ func_8088AA98(this, globalCtx);
+ if (this->actor.params == ENARROW_7) {
+ if (this->bubble.unk_149 == 0) {
+ sp78 = sqrtf(SQ(this->actor.speedXZ) + SQ(this->actor.velocity.y));
+ sp74 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
+ temp_f12_2 = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
+
+ this->actor.prevPos.x = this->actor.world.pos.x - (sp74 * (10.0f / sp78));
+ this->actor.prevPos.y = this->actor.world.pos.y - (this->actor.velocity.y * (10.0f / sp78));
+ this->actor.prevPos.z = this->actor.world.pos.z - (temp_f12_2 * (10.0f / sp78));
+
+ this->bubble.unk_149 = 1;
+ }
+
+ if (Math_StepToF(&this->bubble.unk_144, 1.0f, 0.4f)) {
+ this->unk_260 = 0;
+ } else {
+ this->bubble.unk_14A += (s16)(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
+ this->actor.world.rot.x += (s16)(500.0f * Math_SinS(this->bubble.unk_14A));
+ this->actor.shape.rot.x = this->actor.world.rot.x;
+
+ this->bubble.unk_14C += (s16)(this->bubble.unk_144 * (500.0f + Rand_ZeroFloat(1400.0f)));
+ this->actor.world.rot.y += (s16)(500.0f * Math_SinS(this->bubble.unk_14C));
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ func_8088A514(this);
+ }
+ func_800B9010(&this->actor, NA_SE_IT_DEKUNUTS_BUBLE_SHOT_LEVEL - SFX_FLAG);
+ } else if (this->unk_260 < 7) {
+ this->actor.gravity = -0.4f;
+ }
+
+ Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
+
+ if (this->actor.speedXZ == 0.0f) {
+ this->actor.velocity.y -= 1.0f;
+ if (this->actor.velocity.y < this->actor.terminalVelocity) {
+ this->actor.velocity.y = this->actor.terminalVelocity;
+ }
+ Actor_UpdatePos(&this->actor);
+ } else {
+ Actor_MoveWithGravity(&this->actor);
+ }
+
+ this->unk_262 = BgCheck_ProjectileLineTest(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos,
+ &sp9C, &this->actor.wallPoly, 1, 1, 1, 1, &spA8);
+ if (this->unk_262 != 0) {
+ func_800B90AC(globalCtx, &this->actor, this->actor.wallPoly, spA8, &sp9C);
+ Math_Vec3f_Copy(&this->actor.world.pos, &sp9C);
+ this->actor.wallBgId = spA8;
+ }
+
+ if (this->actor.params < ENARROW_6) {
+ this->actor.shape.rot.x = Math_FAtan2F(this->actor.speedXZ, -this->actor.velocity.y);
+ }
+ }
+
+ if (this->unk_264 != NULL) {
+ if (this->unk_264->update != NULL) {
+ s32 pad;
+
+ Math_Vec3f_Sum(&this->unk_228, &this->unk_268, &sp60);
+ Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_268, &sp54);
+
+ if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &sp54, &sp9C, &spAC, true, true, true, true,
+ &spA8)) {
+ this->unk_264->world.pos.x = ((sp54.x <= sp9C.x) ? 1.0f : -1.0f) + sp9C.x;
+ this->unk_264->world.pos.y = ((sp54.y <= sp9C.y) ? 1.0f : -1.0f) + sp9C.y;
+ this->unk_264->world.pos.z = ((sp54.z <= sp9C.z) ? 1.0f : -1.0f) + sp9C.z;
+
+ Math_Vec3f_Diff(&this->unk_264->world.pos, &this->actor.world.pos, &this->unk_268);
+ this->unk_264->flags &= ~0x8000;
+ this->unk_264 = NULL;
+ } else {
+ Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_268, &this->unk_264->world.pos);
+ }
+
+ if ((this->unk_262 != 0) && (this->unk_264 != NULL)) {
+ this->unk_264->flags &= ~0x8000;
+ this->unk_264 = NULL;
+ }
+ } else {
+ this->unk_264 = NULL;
+ }
+ }
+}
+#else
+#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088ACE0.s")
#endif
-extern ColliderQuadInit D_8088C1E0;
-extern InitChainEntry D_8088C230[];
+void func_8088B630(EnArrow* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->arrow.skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/EnArrow_Init.s")
+ if (this->actor.wallBgId != BG_ACTOR_MAX) {
+ BgCheck2_UpdateActorAttachedToMesh(&globalCtx->colCtx, this->actor.wallBgId, &this->actor);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/EnArrow_Destroy.s")
+ if (DECR(this->unk_260) == 0) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088A514.s")
+void func_8088B6B0(EnArrow* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->arrow.skelAnime);
+ Actor_MoveWithGravity(&this->actor);
+ func_8088AA98(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088A594.s")
+ if (DECR(this->unk_260) == 0) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088A7D8.s")
+void EnArrow_Update(Actor* thisx, GlobalContext* globalCtx) {
+ static Vec3f D_8088C2CC = { 0.0f, 0.5f, 0.0f };
+ static Vec3f D_8088C2D8 = { 0.0f, 0.5f, 0.0f };
+ static Color_RGBA8 D_8088C2E4 = { 255, 255, 100, 255 };
+ static Color_RGBA8 D_8088C2E8 = { 255, 50, 0, 0 };
+ s32 pad;
+ EnArrow* this = THIS;
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088A894.s")
+ if ((this->unk_263 != 0) ||
+ ((this->actor.params >= ENARROW_0) && ((this->actor.params == ENARROW_7) || (player->unk_D57 != 0))) ||
+ !func_80123358(globalCtx, player)) {
+ this->actionFunc(this, globalCtx);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088AA98.s")
+ if ((this->actor.params >= ENARROW_3) && (this->actor.params < ENARROW_6)) {
+ s16 sp44[] = { ACTOR_ARROW_FIRE, ACTOR_ARROW_ICE, ACTOR_ARROW_LIGHT };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088ACE0.s")
+ if (this->actor.child == NULL) {
+ Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, sp44[this->actor.params - ENARROW_3],
+ this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
+ }
+ } else if (this->actor.params == ENARROW_0) {
+ func_800B0EB0(globalCtx, &this->unk_234, &D_8088C2CC, &D_8088C2D8, &D_8088C2E4, &D_8088C2E8, 100, 0, 8);
+ }
+ Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.prevPos);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088B630.s")
+typedef struct {
+ /* 0x00 */ Vec3f unk_00[2];
+ /* 0x18 */ Vec3f unk_18[2][2];
+ /* 0x48 */ Vec3f unk_48;
+} EnArrowUnkStruct; // size = 0x54
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088B6B0.s")
+void func_8088B88C(GlobalContext* globalCtx, EnArrow* this, EnArrowUnkStruct* arg2) {
+ Vec3f* sp4C;
+ Vec3f sp40;
+ Vec3f sp34;
+ s32 sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/EnArrow_Update.s")
+ Matrix_MultiplyVector3fByState(&arg2->unk_48, &this->unk_234);
+ if (func_8088ACE0 == this->actionFunc) {
+ if (this->unk_244 == 0) {
+ sp4C = arg2->unk_00;
+ } else {
+ sp4C = arg2->unk_18[globalCtx->gameplayFrames % 2];
+ }
+ Matrix_MultiplyVector3fByState(&sp4C[0], &sp40);
+ Matrix_MultiplyVector3fByState(&sp4C[1], &sp34);
+ if (this->actor.params < ENARROW_8) {
+ sp30 = this->actor.params < ENARROW_6;
+ if (this->unk_264 == 0) {
+ sp30 &= func_80126440(globalCtx, &this->collider.base, &this->unk_244, &sp40, &sp34);
+ } else if (sp30 && (sp40.x == this->unk_248) && (sp40.y == this->unk_24C) && (sp40.z == this->unk_250) &&
+ (sp34.x == this->unk_254) && (sp34.y == this->unk_258) && (sp34.z == this->unk_25C)) {
+ sp30 = false;
+ }
+ if (sp30) {
+ EffectBlure_AddVertex(Effect_GetByIndex(this->unk_240), &sp40, &sp34);
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/func_8088B88C.s")
+void EnArrow_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static EnArrowUnkStruct D_8088C2EC[] = {
+ {
+ {
+ { 400.0f, 400.0f, 0.0f },
+ { -400.0f, 400.0f, 0.0f },
+ },
+ {
+ {
+ { 400.0f, 400.0f, 1500.0f },
+ { -400.0f, 400.0f, 1500.0f },
+ },
+ {
+ { 400.0f, 400.0f, 1500.0f },
+ { -400.0f, 400.0f, 1500.0f },
+ },
+ },
+ { 0.0f, 0.0f, -300.0f },
+ },
+ {
+ {
+ { 20.0f, -20.0f, 20.0f },
+ { 20.0f, -20.0f, 20.0f },
+ },
+ {
+ {
+ { 20.0f, -20.0f, 20.0f },
+ { -20.0f, 20.0f, 20.0f },
+ },
+ {
+ { -20.0f, -20.0f, 20.0f },
+ { 20.0f, 20.0f, 20.0f },
+ },
+ },
+ { 0.0f, 0.0f, 20.0f },
+ },
+ };
+ EnArrow* this = THIS;
+ s32 phi_v0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Arrow/EnArrow_Draw.s")
+ if (this->actor.params < ENARROW_6) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawLod(globalCtx, this->arrow.skelAnime.skeleton, this->arrow.skelAnime.jointTable, NULL, NULL,
+ &this->actor, this->actor.projectedPos.z < 160.0f ? 0 : 1);
+ } else if (this->actor.params == ENARROW_7) {
+ s32 spA4 = 255 - (s32)(this->bubble.unk_144 * 4.0f);
+ f32 spA0 = (this->actor.speedXZ * 0.1f) + 1.0f;
+ f32 sp9C = (1.0f / spA0);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->bubble.unk_149 >= 0) {
+ func_8088B88C(globalCtx, this, &D_8088C2EC[1]);
+ } else {
+ Collider_ResetQuadAT(globalCtx, &this->collider.base);
+ }
+
+ sp9C *= 0.002f;
+ spA0 *= 0.002f;
+
+ Matrix_Scale(this->bubble.unk_144 * sp9C, this->bubble.unk_144 * sp9C, this->bubble.unk_144 * spA0,
+ MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, 0.0f, 460.0f, MTXMODE_APPLY);
+
+ if (this->actor.speedXZ == 0.0f) {
+ func_800B8118(&this->actor, globalCtx, MTXMODE_NEW);
+
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_06F380);
+ gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2);
+ gDPSetCombineLERP(POLY_XLU_DISP++, TEXEL1, 0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0,
+ COMBINED, 0, ENVIRONMENT, 0, COMBINED, 0, ENVIRONMENT, 0);
+ gDPSetEnvColor(POLY_XLU_DISP++, 230, 225, 150, spA4);
+
+ Matrix_NormalizeXYZ(&gIdentityMtxF);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPMatrix(POLY_XLU_DISP++, &D_01000000, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_06F9F0);
+ } else {
+ func_800B8050(&this->actor, globalCtx, MTXMODE_NEW);
+
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06F380);
+ gDPSetCombineLERP(POLY_OPA_DISP++, TEXEL1, 0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0,
+ COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, COMBINED);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x7F, 230, 225, 150, 255);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06FAE0);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+
+ return;
+ } else if (this->actor.speedXZ != 0.0f) {
+ u8 sp63 = (Math_CosS(this->unk_260 * 5000) * 127.5f) + 127.5f;
+ f32 sp5C;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C240(globalCtx->state.gfxCtx);
+
+ gSPClearGeometryMode(POLY_XLU_DISP++, G_FOG | G_LIGHTING);
+
+ if (this->actor.params == ENARROW_6) {
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 255, 255, sp63);
+ sp5C = 50.0f;
+ } else {
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 12, 0, 0, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 0, sp63);
+ sp5C = 150.0f;
+ }
+
+ Matrix_StatePush();
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+
+ if (this->actor.speedXZ == 0.0f) {
+ phi_v0 = 0;
+ } else {
+ phi_v0 = (globalCtx->gameplayFrames % 256) * 4000;
+ }
+
+ Matrix_InsertZRotation_s(phi_v0, MTXMODE_APPLY);
+ Matrix_Scale(sp5C, sp5C, sp5C, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_054A90);
+
+ Matrix_StatePop();
+ Matrix_RotateY(this->actor.world.rot.y, MTXMODE_APPLY);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else if (this->actor.velocity.y != 0.0f) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_058BA0);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ func_8088B88C(globalCtx, this, &D_8088C2EC[0]);
+}
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 119507d4d0..f318cf1528 100644
--- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h
+++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.h
@@ -7,15 +7,56 @@ struct EnArrow;
typedef void (*EnArrowActionFunc)(struct EnArrow*, GlobalContext*);
+enum {
+ /* -8 */ ENARROW_MINUS8 = -8,
+ /* 0 */ ENARROW_0 = 0,
+ /* 1 */ ENARROW_1,
+ /* 2 */ ENARROW_2,
+ /* 3 */ ENARROW_3,
+ /* 4 */ ENARROW_4,
+ /* 5 */ ENARROW_5,
+ /* 6 */ ENARROW_6,
+ /* 7 */ ENARROW_7,
+ /* 8 */ ENARROW_8,
+};
+
+typedef struct {
+ /* 0x144 */ SkelAnime skelAnime;
+ /* 0x188 */ Vec3s jointTable[5];
+} EnArrowArrow; // size = 0x1A8
+
+typedef struct {
+ /* 0x144 */ f32 unk_144;
+ /* 0x148 */ u8 unk_148;
+ /* 0x149 */ s8 unk_149;
+ /* 0x14A */ s16 unk_14A;
+ /* 0x14C */ s16 unk_14C;
+} EnArrowBubble; // size = 0x150
+
typedef struct EnArrow {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x7C];
- /* 0x01C0 */ s32 unk_1C0;
- /* 0x01C4 */ char unk_1C4[0x9C];
- /* 0x0260 */ u8 unk_260; // timer in OoT
- /* 0x0261 */ u8 unk_261; // hitFlags in OoT
- /* 0x0262 */ char unk_262[0x12];
- /* 0x0274 */ EnArrowActionFunc actionFunc;
+ /* 0x000 */ Actor actor;
+ union {
+ EnArrowArrow arrow;
+ EnArrowBubble bubble;
+ };
+ /* 0x1A8 */ ColliderQuad collider;
+ /* 0x228 */ Vec3f unk_228;
+ /* 0x234 */ Vec3f unk_234;
+ /* 0x240 */ s32 unk_240;
+ /* 0x244 */ s32 unk_244;
+ /* 0x248 */ f32 unk_248;
+ /* 0x24C */ f32 unk_24C;
+ /* 0x250 */ f32 unk_250;
+ /* 0x254 */ f32 unk_254;
+ /* 0x258 */ f32 unk_258;
+ /* 0x25C */ f32 unk_25C;
+ /* 0x260 */ u8 unk_260; // timer in OoT
+ /* 0x261 */ u8 unk_261; // hitFlags in OoT
+ /* 0x262 */ u8 unk_262;
+ /* 0x263 */ u8 unk_263;
+ /* 0x264 */ Actor* unk_264;
+ /* 0x268 */ Vec3f unk_268;
+ /* 0x274 */ EnArrowActionFunc actionFunc;
} EnArrow; // size = 0x278
extern const ActorInit En_Arrow_InitVars;
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 5eca6c796d..90e99b5ea6 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
@@ -6,7 +6,7 @@
#include "z_en_attack_niw.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnAttackNiw*)thisx)
diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c
index c5f687498c..f815991c19 100644
--- a/src/overlays/actors/ovl_En_Az/z_en_az.c
+++ b/src/overlays/actors/ovl_En_Az/z_en_az.c
@@ -6,7 +6,7 @@
#include "z_en_az.h"
-#define FLAGS 0x80000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
#define THIS ((EnAz*)thisx)
diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.c b/src/overlays/actors/ovl_En_Baba/z_en_baba.c
index 4593ec4b04..25cf5e6e48 100644
--- a/src/overlays/actors/ovl_En_Baba/z_en_baba.c
+++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.c
@@ -5,8 +5,10 @@
*/
#include "z_en_baba.h"
+#include "overlays/actors/ovl_En_Ossan/z_en_ossan.h"
+#include "objects/object_bba/object_bba.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBaba*)thisx)
@@ -27,7 +29,6 @@ void func_80BA9E00(EnBaba* this, GlobalContext* globalCtx);
void func_80BA9E10(EnBaba* this, GlobalContext* globalCtx);
void func_80BA9E48(EnBaba* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Baba_InitVars = {
ACTOR_EN_BABA,
ACTORCAT_NPC,
@@ -40,18 +41,38 @@ const ActorInit En_Baba_InitVars = {
(ActorFunc)EnBaba_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BAA430 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static AnimationInfo sAnimations[] = {
+ { &gBbaIdleHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &gBbaIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &gBbaWalkingHoldingBagAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &gBbaKnockedOverAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &gBbaLyingDownAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &gBbaWalkingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+};
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 18, 64, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BAA45C = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80BAA468 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(1, 0x0),
/* Deku Stick */ DMG_ENTRY(1, 0x0),
/* Horse trample */ DMG_ENTRY(1, 0x0),
@@ -86,67 +107,661 @@ static DamageTable D_80BAA468 = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-#endif
+s32 D_80BAA488[] = {
+ 0x0C000119, 0x0A006E14, 0x02000000, 0x1E080F00, 0x1E030400, 0x01050E00, 0x00001E02, 0x05050000,
+};
-extern ColliderCylinderInit D_80BAA430;
-extern CollisionCheckInfoInit2 D_80BAA45C;
-extern DamageTable D_80BAA468;
+s32 D_80BAA4A8[] = { -1, -1, 0 };
-extern UNK_TYPE D_06006B10;
-extern UNK_TYPE D_060092A0;
+u16 D_80BAA4B4[] = { 4000, 4, 1, 3, 6000, 4, 1, 6, 4000, 4, 1, 3, 6000, 4, 1, 6 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8820.s")
+s32 func_80BA8820(EnBaba* this, GlobalContext* globalCtx) {
+ this->unk_144 = (EnOssan*)SubS_FindActor(globalCtx, &this->unk_144->actor, ACTORCAT_NPC, ACTOR_EN_OSSAN);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA886C.s")
+ if (this->unk_144 != NULL) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8C4C.s")
+void func_80BA886C(EnBaba* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8C90.s")
+ switch (this->unk_1E0) {
+ case 0:
+ if (this->unk_40A & 8) {
+ if (gSaveContext.weekEventReg[33] & 8) {
+ this->unk_1E0 = 0x2A34;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8D2C.s")
+ if (gSaveContext.weekEventReg[79] & 0x40) {
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A33;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8DF4.s")
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A32;
+ break;
+ } else if (player->transformation == PLAYER_FORM_DEKU) {
+ if (!(gSaveContext.weekEventReg[79] & 0x20)) {
+ gSaveContext.weekEventReg[79] |= 0x20;
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A37;
+ break;
+ } else {
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A38;
+ }
+ break;
+ } else if (!(gSaveContext.weekEventReg[33] & 8)) {
+ if (!(gSaveContext.weekEventReg[73] & 1)) {
+ this->unk_1E0 = 0x660;
+ break;
+ }
+ this->unk_1E0 = 0x662;
+ break;
+ } else {
+ if (!(gSaveContext.weekEventReg[73] & 2)) {
+ this->unk_1E0 = 0x65A;
+ break;
+ }
+ this->unk_1E0 = 0x65E;
+ break;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA8F88.s")
+ case 0x660:
+ Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
+ this->unk_1E0 = 0x661;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9110.s")
+ case 0x661:
+ Actor_ChangeFocus(&this->unk_144->actor, globalCtx, &this->actor);
+ this->unk_1E0 = 0x662;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9160.s")
+ case 0x662:
+ Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
+ this->unk_1E0 = 0x663;
+ gSaveContext.weekEventReg[73] |= 1;
+ this->unk_40A |= 1;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA93AC.s")
+ case 0x65A:
+ Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
+ this->unk_1E0 = 0x65B;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9480.s")
+ case 0x65B:
+ Actor_ChangeFocus(&this->unk_144->actor, globalCtx, &this->actor);
+ this->unk_1E0 = 0x65C;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9758.s")
+ case 0x65C:
+ Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
+ this->unk_1E0 = 0x65D;
+ gSaveContext.weekEventReg[73] |= 2;
+ this->unk_40A |= 1;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9848.s")
+ case 0x65E:
+ Actor_ChangeFocus(&this->actor, globalCtx, &this->unk_144->actor);
+ this->unk_1E0 = 0x65F;
+ this->unk_40A |= 1;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA98EC.s")
+ case 0x2A34:
+ if (INV_CONTENT(ITEM_MASK_BLAST) == ITEM_MASK_BLAST) {
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A36;
+ break;
+ }
+ this->unk_40A |= 0x20;
+ this->unk_1E0 = 0x2A35;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9AB8.s")
+ case 0x2A35:
+ this->unk_40A |= 1;
+ this->unk_1E0 = 0x2A36;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9B24.s")
+ case 0x2A30:
+ case 0x2A31:
+ this->unk_40A |= 1;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9B80.s")
+ Message_StartTextbox(globalCtx, this->unk_1E0, &this->actor);
+ if (this->unk_40A & 1) {
+ if (this->unk_40A & 0x40) {
+ this->unk_40A &= ~0x40;
+ func_80151BB4(globalCtx, 0x33);
+ }
+ func_80151BB4(globalCtx, 4);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9CD4.s")
+void func_80BA8C4C(GlobalContext* globalCtx, u16 nextEntrance) {
+ globalCtx->nextEntranceIndex = nextEntrance;
+ globalCtx->unk_1887F = 0x40;
+ gSaveContext.nextTransition = 0x40;
+ globalCtx->sceneLoadFlag = 0x14;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9E00.s")
+void func_80BA8C90(EnBaba* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x + 5.0f;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z + 22.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9E10.s")
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9E48.s")
+s32 func_80BA8D2C(EnBaba* this, f32 arg1) {
+ s16 sp3E;
+ s32 ret = false;
+ Vec3f sp2C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/EnBaba_Init.s")
+ Math_SmoothStepToF(&this->actor.speedXZ, arg1, 0.4f, 1000.0f, 0.0f);
+ sp3E = this->actor.speedXZ * 400.0f;
+ if (func_8013D68C(this->path, this->unk_1E8, &sp2C) && func_8013D768(&this->actor, &sp2C, sp3E)) {
+ this->unk_1E8++;
+ if (this->unk_1E8 >= this->path->count) {
+ ret = true;
+ }
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/EnBaba_Destroy.s")
+void func_80BA8DF4(EnBaba* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/EnBaba_Update.s")
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BA9FB0.s")
+ if (SubS_AngleDiffLessEqual(this->actor.shape.rot.y, 0x36B0, this->actor.yawTowardsPlayer) &&
+ !(this->unk_40A & 4)) {
+ sp30.x = player->actor.world.pos.x;
+ sp30.y = player->bodyPartsPos[7].y + 3.0f;
+ sp30.z = player->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BAA198.s")
+ func_8013D2E0(&sp30, &this->actor.focus.pos, &this->actor.shape.rot, &this->unk_2DE, &this->unk_2E4,
+ &this->unk_2EA, D_80BAA4B4);
+ } else {
+ Math_SmoothStepToS(&this->unk_2DE.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->unk_2DE.y, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->unk_2E4.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->unk_2E4.y, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->unk_2EA.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->unk_2EA.y, 0, 4, 1000, 1);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/func_80BAA20C.s")
+ SubS_FillLimbRotTables(globalCtx, this->unk_302, this->unk_326, ARRAY_COUNT(this->unk_302));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Baba/EnBaba_Draw.s")
+ if (this->unk_40A & 2) {
+ func_80BA8C90(this, globalCtx);
+ }
+}
+
+s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ u16 sp26 = (u16)(gSaveContext.time - 0x3FFC);
+ u16 temp;
+ u8 sp23 = ENBABA_GET_3F00(&this->actor);
+
+ if (D_80BAA4A8[arg2->unk0] >= 0) {
+ this->unk_410 = func_8013BB34(globalCtx, sp23, D_80BAA4A8[arg2->unk0]);
+ }
+
+ if (this->unk_410 == NULL) {
+ return false;
+ }
+
+ if ((this->unk_434 != 0) && (this->unk_436 >= 0)) {
+ temp = sp26;
+ } else {
+ temp = arg2->unk4;
+ }
+
+ if (arg2->unk8 < temp) {
+ this->unk_424 = (temp - arg2->unk8) + 0xFFFF;
+ } else {
+ this->unk_424 = arg2->unk8 - temp;
+ }
+
+ this->unk_430 = sp26 - temp;
+ temp = this->unk_410->count - 2;
+ this->unk_428 = this->unk_424 / temp;
+ this->unk_438 = 0;
+ this->unk_42C = (this->unk_430 / this->unk_428) + 2;
+ this->unk_43C = 0;
+ return true;
+}
+
+s32 func_80BA9110(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret;
+
+ switch (arg2->unk0) {
+ default:
+ ret = false;
+ break;
+
+ case 2:
+ ret = func_80BA8F88(this, globalCtx, arg2);
+ break;
+
+ case 1:
+ ret = true;
+ break;
+ }
+ return ret;
+}
+
+s32 func_80BA9160(EnBaba* this, GlobalContext* globalCtx) {
+ f32 sp7C[265];
+ Vec3f sp70;
+ Vec3f sp64;
+ Vec3f sp58;
+ s32 sp54 = 0;
+ s32 sp50 = 0;
+ s32 pad;
+
+ func_8013AF00(sp7C, 3, this->unk_410->count + 3);
+
+ if (this->unk_438 == 0) {
+ sp58 = gZeroVec3f;
+
+ func_8013B6B0(this->unk_410, &this->unk_420, &this->unk_430, this->unk_428, this->unk_424, &this->unk_42C, sp7C,
+ &sp58, this->unk_436);
+ func_8013B878(globalCtx, this->unk_410, this->unk_42C, &sp58);
+ this->actor.world.pos.y = sp58.y;
+ this->unk_438 = 1;
+ } else {
+ sp58 = this->unk_414;
+ }
+
+ this->actor.world.pos.x = sp58.x;
+ this->actor.world.pos.z = sp58.z;
+
+ if (func_8013AD6C(globalCtx)) {
+ sp54 = this->unk_430;
+ sp50 = this->unk_42C;
+ sp58 = this->actor.world.pos;
+ }
+
+ this->unk_414 = gZeroVec3f;
+
+ if (func_8013B6B0(this->unk_410, &this->unk_420, &this->unk_430, this->unk_428, this->unk_424, &this->unk_42C, sp7C,
+ &this->unk_414, this->unk_436)) {
+ this->unk_43C = 1;
+ } else {
+ sp70 = this->actor.world.pos;
+ sp64 = this->unk_414;
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp70, &sp64);
+ }
+
+ if (func_8013AD6C(globalCtx)) {
+ this->unk_430 = sp54;
+ this->unk_42C = sp50;
+ this->unk_414 = sp58;
+ }
+
+ return false;
+}
+
+void func_80BA93AC(EnBaba* this, GlobalContext* globalCtx) {
+ if (this->unk_434 != 1) {
+ if (this->unk_434 == 2) {
+ gSaveContext.weekEventReg[58] |= 0x40;
+ this->unk_40A |= 2;
+ func_80BA9160(this, globalCtx);
+ }
+ } else {
+ this->unk_40C = 3;
+ this->unk_1E0 = 10800;
+ this->actor.speedXZ = 0.0f;
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ this->unk_40A |= 4;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_40C);
+ this->actionFunc = func_80BA9CD4;
+ }
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 4, 0x1554);
+}
+
+void func_80BA9480(EnBaba* this, GlobalContext* globalCtx) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gBbaSkel, &gBbaWalkingHoldingBagAnim, this->jointTable,
+ this->morphTable, 0x12);
+
+ this->actor.draw = EnBaba_Draw;
+ this->unk_40A |= 0x80;
+ this->actor.flags |= ACTOR_FLAG_1;
+
+ if (globalCtx->sceneNum == SCENE_BOMYA) {
+ this->unk_40A |= 2;
+ this->unk_40C = 1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ this->actionFunc = func_80BA9758;
+ } else if (globalCtx->sceneNum == SCENE_BACKTOWN) {
+ if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_0) && (gSaveContext.entranceIndex != 0xD670) &&
+ ((ENBABA_GET_3F00(&this->actor)) != ENBABA_3F00_3F)) {
+ if ((gSaveContext.weekEventReg[58] & 0x40) ||
+ (!(gSaveContext.time < CLOCK_TIME(0, 20)) && (gSaveContext.time < CLOCK_TIME(6, 0)))) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ this->unk_404 = 50;
+ this->unk_40C = 2;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ this->actionFunc = func_80BA9B80;
+ } else if ((ENBABA_GET_C000(&this->actor) == ENBABA_C000_1) && (gSaveContext.entranceIndex == 0xD670)) {
+ if (gSaveContext.weekEventReg[81] & 2) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ this->unk_40A |= 2;
+ if (gSaveContext.weekEventReg[33] & 8) {
+ this->unk_40C = 0;
+ } else {
+ this->unk_40C = 1;
+ }
+
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_40C);
+ this->unk_40A |= 8;
+ this->actionFunc = func_80BA9758;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else {
+ this->unk_40A |= 2;
+ if (ENBABA_GET_C000(&this->actor) == ENBABA_C000_2) {
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->unk_40C = 5;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
+ this->actionFunc = func_80BA9E00;
+ } else if ((ENBABA_GET_3F00(&this->actor)) != ENBABA_3F00_3F) {
+ this->unk_40C = 2;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ this->actionFunc = func_80BA9E10;
+ } else {
+ this->unk_40C = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actionFunc = func_80BA9E48;
+ }
+ }
+}
+
+void func_80BA9758(EnBaba* this, GlobalContext* globalCtx) {
+ if ((this->unk_40A & 8) || (this->unk_144 != NULL) || func_80BA8820(this, globalCtx)) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80BA886C(this, globalCtx);
+ if (this->unk_40A & 8) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ }
+ this->actionFunc = func_80BA98EC;
+ } else if (this->actor.xzDistToPlayer < 100.0f) {
+ if (this->unk_40A & 8) {
+ this->actor.flags |= ACTOR_FLAG_10000;
+ }
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ }
+ }
+}
+
+void func_80BA9848(EnBaba* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if (((temp_v0 == 5) || (temp_v0 == 6)) && func_80147624(globalCtx)) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actionFunc = func_80BA9B80;
+ }
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+}
+
+void func_80BA98EC(EnBaba* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if (temp_v0 == 5) {
+ if (func_80147624(globalCtx)) {
+ if (this->unk_40A & 1) {
+ this->unk_40A &= ~1;
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ if (this->unk_40A & 8) {
+ if (CHECK_QUEST_ITEM(QUEST_BOMBERS_NOTEBOOK)) {
+ if (globalCtx->msgCtx.unk120B1 == 0) {
+ gSaveContext.weekEventReg[81] |= 2;
+ func_80BA8C4C(globalCtx, 0xD670);
+ return;
+ }
+ } else {
+ gSaveContext.weekEventReg[81] |= 2;
+ func_80BA8C4C(globalCtx, 0xD670);
+ }
+ } else {
+ this->unk_1E0 = 0;
+ this->actionFunc = func_80BA9758;
+ }
+ } else if (this->unk_40A & 0x20) {
+ this->unk_40A &= ~0x20;
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actionFunc = func_80BA9AB8;
+ } else {
+ func_80BA886C(this, globalCtx);
+ }
+ }
+ } else if (temp_v0 == 6) {
+ if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk120B1 == 0)) {
+ gSaveContext.weekEventReg[81] |= 2;
+ func_80BA8C4C(globalCtx, 0xD670);
+ }
+ }
+}
+
+void func_80BA9AB8(EnBaba* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ this->unk_40A |= 0x40;
+ this->actionFunc = func_80BA9B24;
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_MASK_BLAST, 300.0f, 300.0f);
+ }
+}
+
+void func_80BA9B24(EnBaba* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80BA886C(this, globalCtx);
+ this->actionFunc = func_80BA98EC;
+ } else {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ }
+}
+
+void func_80BA9B80(EnBaba* this, GlobalContext* globalCtx) {
+ u32* unk14 = &gSaveContext.unk_14;
+ struct_80133038_arg2 sp20;
+
+ this->unk_436 = REG(15) + *unk14;
+
+ if (!func_80133038(globalCtx, D_80BAA488, &sp20) ||
+ ((this->unk_434 != sp20.unk0) && !func_80BA9110(this, globalCtx, &sp20))) {
+ this->unk_40A &= ~0x80;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ sp20.unk0 = false;
+ } else {
+ this->unk_40A |= 0x80;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+ this->unk_434 = sp20.unk0;
+
+ func_80BA93AC(this, globalCtx);
+
+ if (this->unk_40A & 2) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ Message_StartTextbox(globalCtx, 0x2A39, &this->actor); // "I'm sorry"
+ this->actionFunc = func_80BA9848;
+ } else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) {
+ func_800B863C(&this->actor, globalCtx);
+ }
+ }
+ Actor_MoveWithGravity(&this->actor);
+}
+
+void func_80BA9CD4(EnBaba* this, GlobalContext* globalCtx) {
+ s16 sp2E = this->skelAnime.curFrame;
+ s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_40C].animation);
+
+ this->collider.dim.height = 37;
+ this->collider.dim.radius = 23;
+
+ if (this->unk_40C == 3) {
+ if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_BBVO00);
+ }
+
+ if (sp2E == sp2C) {
+ this->unk_40C = 4;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ }
+ } else {
+ if ((gSaveContext.weekEventReg[79] & 0x40) && (DECR(this->unk_404) == 0)) {
+ Audio_QueueSeqCmd(0x101400FF);
+ func_80BA8C4C(globalCtx, 0xD670);
+ } else {
+ Actor_MoveWithGravity(&this->actor);
+ }
+ }
+}
+
+void func_80BA9E00(EnBaba* this, GlobalContext* globalCtx) {
+}
+
+void func_80BA9E10(EnBaba* this, GlobalContext* globalCtx) {
+ if (func_80BA8D2C(this, 1.0f)) {
+ this->unk_1E8 = 0;
+ }
+}
+
+void func_80BA9E48(EnBaba* this, GlobalContext* globalCtx) {
+ this->actor.shape.rot = this->actor.world.rot;
+}
+
+void EnBaba_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBaba* this = THIS;
+
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ this->path = func_8013D648(globalCtx, ENBABA_GET_3F00(&this->actor), ENBABA_3F00_3F);
+
+ Actor_SetScale(&this->actor, 0.01f);
+
+ this->actor.targetMode = 0;
+ this->actor.gravity = -4.0f;
+ this->actionFunc = func_80BA9480;
+}
+
+void EnBaba_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnBaba* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnBaba_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnBaba* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+ func_80BA8DF4(this, globalCtx);
+}
+
+s32 EnBaba_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnBaba* this = THIS;
+
+ if (limbIndex == 6) {
+ Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_2E4.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->unk_2E4.x, MTXMODE_APPLY);
+ Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if (limbIndex == 5) {
+ Matrix_InsertXRotation_s(-this->unk_2EA.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->unk_2EA.x, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == 6) && (this->unk_1E2 != 0) && ((globalCtx->state.frames % 2) == 0)) {
+ Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == 5) || (limbIndex == 10) || (limbIndex == 14)) {
+ rot->y += (s16)(Math_SinS(this->unk_302[limbIndex]) * 200.0f);
+ rot->z += (s16)(Math_CosS(this->unk_326[limbIndex]) * 200.0f);
+ }
+
+ if (((this->unk_40C == 1) || (this->unk_40C == 3) || (this->unk_40C == 4) ||
+ (ENBABA_GET_C000(&this->actor) == ENBABA_C000_2)) &&
+ (limbIndex == 8)) {
+ *dList = NULL;
+ }
+ return 0;
+}
+
+void EnBaba_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnBaba* this = THIS;
+ Vec3f sp18 = { 0.0f, 0.0f, 0.0f };
+
+ if (limbIndex == 7) {
+ this->actor.focus.pos.x = this->actor.world.pos.x;
+ this->actor.focus.pos.y = this->actor.world.pos.y;
+ this->actor.focus.pos.z = this->actor.world.pos.z;
+ Matrix_MultiplyVector3fByState(&sp18, &this->actor.focus.pos);
+ }
+}
+
+void EnBaba_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+}
+
+void EnBaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBaba* this = THIS;
+ Vec3f sp4C;
+ Vec3f sp40;
+
+ if (this->unk_40A & 2) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C5B0(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gBbaEyeTex));
+
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnBaba_OverrideLimbDraw, EnBaba_PostLimbDraw,
+ EnBaba_TransformLimbDraw, &this->actor);
+
+ if (this->unk_40A & 0x80) {
+ if ((this->unk_40C == 3) || (this->unk_40C == 4)) {
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ sp4C.x = this->actor.world.pos.x + 20.0f;
+ sp4C.y = this->actor.world.pos.y;
+ sp4C.z = this->actor.world.pos.z + 20.0f;
+ } else {
+ sp4C = this->actor.world.pos;
+ }
+
+ sp40.x = sp40.y = sp40.z = 0.3f;
+ func_800BC620(&sp4C, &sp40, 255, globalCtx);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Baba/z_en_baba.h b/src/overlays/actors/ovl_En_Baba/z_en_baba.h
index fdc0648b9b..d26e686255 100644
--- a/src/overlays/actors/ovl_En_Baba/z_en_baba.h
+++ b/src/overlays/actors/ovl_En_Baba/z_en_baba.h
@@ -7,11 +7,53 @@ struct EnBaba;
typedef void (*EnBabaActionFunc)(struct EnBaba*, GlobalContext*);
+#define ENBABA_GET_3F00(thisx) (((thisx)->params & 0x3F00) >> 8)
+#define ENBABA_GET_C000(thisx) (((thisx)->params & 0xC000) >> 0xE)
+
+#define ENBABA_3F00_3F 0x3F
+
+enum {
+ /* 0 */ ENBABA_C000_0,
+ /* 1 */ ENBABA_C000_1,
+ /* 2 */ ENBABA_C000_2,
+};
+
typedef struct EnBaba {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x4];
+ /* 0x0144 */ struct EnOssan* unk_144;
/* 0x0148 */ EnBabaActionFunc actionFunc;
- /* 0x014C */ char unk_14C[0x2F4];
+ /* 0x014C */ UNK_TYPE1 unk14C[4];
+ /* 0x0150 */ SkelAnime skelAnime;
+ /* 0x0194 */ ColliderCylinder collider;
+ /* 0x01E0 */ u16 unk_1E0;
+ /* 0x01E2 */ u8 unk_1E2;
+ /* 0x01E4 */ Path* path;
+ /* 0x01E8 */ s16 unk_1E8;
+ /* 0x01EA */ UNK_TYPE1 unk1EA[0x1C];
+ /* 0x0206 */ Vec3s jointTable[18];
+ /* 0x0272 */ Vec3s morphTable[18];
+ /* 0x02DE */ Vec3s unk_2DE;
+ /* 0x02E4 */ Vec3s unk_2E4;
+ /* 0x02EA */ Vec3s unk_2EA;
+ /* 0x02F0 */ UNK_TYPE1 unk2F0[0x12];
+ /* 0x0302 */ s16 unk_302[18];
+ /* 0x0326 */ s16 unk_326[18];
+ /* 0x034A */ UNK_TYPE1 unk34A[0xBA];
+ /* 0x0404 */ s16 unk_404;
+ /* 0x0406 */ UNK_TYPE1 unk406[4];
+ /* 0x040A */ u16 unk_40A;
+ /* 0x040C */ s32 unk_40C;
+ /* 0x0410 */ Path* unk_410;
+ /* 0x0414 */ Vec3f unk_414;
+ /* 0x0420 */ f32 unk_420;
+ /* 0x0424 */ s32 unk_424;
+ /* 0x0428 */ s32 unk_428;
+ /* 0x042C */ s32 unk_42C;
+ /* 0x0430 */ s32 unk_430;
+ /* 0x0434 */ u8 unk_434;
+ /* 0x0436 */ s16 unk_436;
+ /* 0x0438 */ s32 unk_438;
+ /* 0x043C */ s32 unk_43C;
} EnBaba; // size = 0x440
extern const ActorInit En_Baba_InitVars;
diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
index 2668c1d680..8e70d5d6ba 100644
--- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
+++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
@@ -5,10 +5,9 @@
*/
#include "z_en_baguo.h"
-#include "objects/object_gmo/object_gmo.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnBaguo*)thisx)
@@ -28,6 +27,21 @@ void EnBaguo_InitializeParticle(EnBaguo* this, Vec3f* position, Vec3f* velocity,
void EnBaguo_UpdateParticles(EnBaguo* this, GlobalContext* globalCtx);
void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx);
+typedef enum {
+ /* 0x0 */ NEJIRON_ACTION_INACTIVE, // The Nejiron is either underground or emerging from underground
+ /* 0x1 */ NEJIRON_ACTION_ACTIVE, // The Nejiron is above ground and actively chasing the player
+ /* 0x2 */ NEJIRON_ACTION_RETREATING, // The Nejiron is burrowing back underground
+ /* 0x3 */ NEJIRON_ACTION_EXPLODING // The Nejiron has detonated
+} NejironAction;
+
+/**
+ * These directions are relative to the Nejiron.
+ */
+typedef enum {
+ /* 0x0 */ NEJIRON_DIRECTION_RIGHT,
+ /* 0x1 */ NEJIRON_DIRECTION_LEFT
+} NejironRollDirection;
+
const ActorInit En_Baguo_InitVars = {
ACTOR_EN_BAGUO,
ACTORCAT_ENEMY,
@@ -112,7 +126,8 @@ void EnBaguo_Init(Actor* thisx, GlobalContext* globalCtx) {
EnBaguo* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable, 3);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gNejironSkel, NULL, this->jointTable, this->morphTable,
+ NEJIRON_LIMB_MAX);
this->actor.hintId = 0xB;
this->maxDistanceFromHome = 240.0f;
this->maxDistanceFromHome += this->actor.world.rot.z * 40.0f;
@@ -120,17 +135,19 @@ void EnBaguo_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.targetMode = 2;
+
Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements[0].dim.modelSphere.radius = 30;
this->collider.elements[0].dim.scale = 1.0f;
this->collider.elements[0].dim.modelSphere.center.x = 80;
this->collider.elements[0].dim.modelSphere.center.y = 80;
this->collider.elements[0].dim.modelSphere.center.z = 0;
+
this->actor.shape.yOffset = -3000.0f;
this->actor.gravity = -3.0f;
this->actor.colChkInfo.damageTable = &sDamageTable;
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~1;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->collider.base.acFlags |= AC_HARD;
this->actionFunc = EnBaguo_UndergroundIdle;
}
@@ -148,8 +165,8 @@ void EnBaguo_UndergroundIdle(EnBaguo* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR);
this->actor.world.rot.z = 0;
this->actor.world.rot.x = this->actor.world.rot.z;
- this->actor.flags &= ~0x8000000;
- this->actor.flags |= 1;
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = EnBaguo_EmergeFromUnderground;
}
this->actor.shape.rot.y = this->actor.world.rot.y;
@@ -195,26 +212,27 @@ void EnBaguo_Idle(EnBaguo* this, GlobalContext* globalCtx) {
}
}
this->actor.shape.rot.y = this->actor.world.rot.y;
- return;
- }
-
- yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
- absoluteYaw = ABS_ALT(yaw);
- Math_Vec3f_Copy(&this->targetRotation, &gZeroVec3f);
- Math_Vec3f_Copy(&this->currentRotation, &gZeroVec3f);
- if (absoluteYaw < 0x2000) {
- this->targetRotation.x = 2000.0f;
} else {
- this->zRollDirection = NEJIRON_DIRECTION_RIGHT;
- this->targetRotation.z = 2000.0f;
- if ((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0) {
- this->zRollDirection = NEJIRON_DIRECTION_LEFT;
+ yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
+ absoluteYaw = ABS_ALT(yaw);
+ Math_Vec3f_Copy(&this->targetRotation, &gZeroVec3f);
+ Math_Vec3f_Copy(&this->currentRotation, &gZeroVec3f);
+
+ if (absoluteYaw < 0x2000) {
+ this->targetRotation.x = 2000.0f;
+ } else {
+ this->zRollDirection = NEJIRON_DIRECTION_RIGHT;
+ this->targetRotation.z = 2000.0f;
+ if ((s16)(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0) {
+ this->zRollDirection = NEJIRON_DIRECTION_LEFT;
+ }
}
+
+ this->timer = 38;
+ this->actor.world.rot.y = this->actor.yawTowardsPlayer;
+ this->bouncedFlag = 0;
+ this->actionFunc = EnBaguo_Roll;
}
- this->timer = 38;
- this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- this->hardHitFlag = 0;
- this->actionFunc = EnBaguo_Roll;
}
void EnBaguo_Roll(EnBaguo* this, GlobalContext* globalCtx) {
@@ -224,35 +242,33 @@ void EnBaguo_Roll(EnBaguo* this, GlobalContext* globalCtx) {
if ((sqrtf(SQ(xDistanceFromHome) + SQ(zDistanceFromHome)) > this->maxDistanceFromHome) ||
(Player_GetMask(globalCtx) == PLAYER_MASK_STONE)) {
EnBaguo_SetupRetreatUnderground(this);
- return;
- }
-
- if (this->timer == 0) {
+ } else if (this->timer == 0) {
this->timer = 100;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = EnBaguo_Idle;
this->actor.speedXZ = 0.0f;
- return;
- }
-
- if (!this->hardHitFlag && this->collider.base.atFlags & AC_HARD) {
- this->zRollDirection ^= 1;
- this->hardHitFlag = 1;
- this->actor.speedXZ = -7.0f;
- }
-
- Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f);
- Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f);
- Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f);
- this->actor.world.rot.x += (s16)this->currentRotation.x;
- if (this->currentRotation.z != 0.0f) {
- if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) {
- this->actor.world.rot.z += (s16)this->currentRotation.z;
- } else {
- this->actor.world.rot.z -= (s16)this->currentRotation.z;
+ } else {
+ if (!this->bouncedFlag && this->collider.base.atFlags & AT_BOUNCED) {
+ this->zRollDirection ^= 1;
+ this->bouncedFlag = 1;
+ this->actor.speedXZ = -7.0f;
}
+
+ Math_ApproachF(&this->currentRotation.x, this->targetRotation.x, 0.2f, 1000.0f);
+ Math_ApproachF(&this->currentRotation.z, this->targetRotation.z, 0.2f, 1000.0f);
+ Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 0.5f);
+ this->actor.world.rot.x += (s16)this->currentRotation.x;
+
+ if (this->currentRotation.z != 0.0f) {
+ if (this->zRollDirection == NEJIRON_DIRECTION_RIGHT) {
+ this->actor.world.rot.z += (s16)this->currentRotation.z;
+ } else {
+ this->actor.world.rot.z -= (s16)this->currentRotation.z;
+ }
+ }
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG);
}
- Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_ROLL - SFX_FLAG);
}
void EnBaguo_SetupRetreatUnderground(EnBaguo* this) {
@@ -268,15 +284,17 @@ void EnBaguo_RetreatUnderground(EnBaguo* this, GlobalContext* globalCtx) {
Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, this->actor.shape.shadowScale - 20.0f,
10, 8.0f, 500, 10, 1);
}
+
Math_ApproachF(&this->actor.shape.yOffset, -3000.0f, 100.0f, 500.0f);
Math_ApproachZeroF(&this->actor.shape.shadowScale, 0.3f, 5.0f);
+
if (this->actor.shape.yOffset < -2970.0f) {
this->actor.shape.yOffset = -3000.0f;
this->actor.draw = EnBaguo_DrawBody;
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_APPEAR);
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~1;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = EnBaguo_UndergroundIdle;
}
}
@@ -285,6 +303,7 @@ void EnBaguo_PostDetonation(EnBaguo* this, GlobalContext* globalCtx) {
if (this->timer == 0) {
Actor_MarkForDeath(&this->actor);
}
+
if (this->timer >= 26) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
@@ -331,9 +350,10 @@ void EnBaguo_CheckForDetonation(EnBaguo* this, GlobalContext* globalCtx) {
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_POP);
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_BOMB_EXPLOSION);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BAKUO_DEAD);
+
this->timer = 30;
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~1;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.0f);
this->collider.elements->dim.scale = 3.0f;
this->collider.elements->info.toucher.damage = 8;
@@ -362,6 +382,7 @@ void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->action != NEJIRON_ACTION_EXPLODING) {
this->actor.shape.rot.x = this->actor.world.rot.x;
this->actor.shape.rot.z = this->actor.world.rot.z;
+
if (this->blinkTimer == 0) {
this->eyeIndex++;
if (this->eyeIndex >= 3) {
@@ -369,6 +390,7 @@ void EnBaguo_Update(Actor* thisx, GlobalContext* globalCtx) {
this->blinkTimer = Rand_ZeroFloat(60.0f) + 20.0f;
}
}
+
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1D);
if (this->action != NEJIRON_ACTION_INACTIVE) {
@@ -449,12 +471,14 @@ void EnBaguo_UpdateParticles(EnBaguo* this, GlobalContext* globalCtx) {
particle->velocity.x += particle->acceleration.x;
particle->velocity.y += particle->acceleration.y;
particle->velocity.z += particle->acceleration.z;
+
if (particle->position.y < (this->actor.world.pos.y - 10.0f)) {
Math_ApproachZeroF(&particle->scale, 0.2f, 0.001f);
if (particle->scale <= 0.0001f) {
particle->timer = 0;
}
}
+
if (particle->timer != 0) {
particle->timer--;
} else {
@@ -470,6 +494,7 @@ void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx) {
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
OPEN_DISPS(gfxCtx);
+
func_8012C28C(globalCtx->state.gfxCtx);
for (i = 0; i < ARRAY_COUNT(this->particles); i++, particle++) {
if (particle->isVisible) {
@@ -478,10 +503,12 @@ void EnBaguo_DrawRockParticles(EnBaguo* this, GlobalContext* globalCtx) {
Matrix_RotateY(particle->rotation.y, MTXMODE_APPLY);
Matrix_InsertZRotation_s(particle->rotation.z, MTXMODE_APPLY);
Matrix_Scale(particle->scale, particle->scale, particle->scale, MTXMODE_APPLY);
+
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 1, 255, 255, 255, 255);
- gSPDisplayList(POLY_OPA_DISP++, &gameplay_keep_DL_01FA40);
+ gSPDisplayList(POLY_OPA_DISP++, gBoulderFragmentsDL);
}
}
+
CLOSE_DISPS(gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h
index 2dc1d7b2c2..133e68b3df 100644
--- a/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h
+++ b/src/overlays/actors/ovl_En_Baguo/z_en_baguo.h
@@ -2,26 +2,12 @@
#define Z_EN_BAGUO_H
#include "global.h"
+#include "objects/object_gmo/object_gmo.h"
struct EnBaguo;
typedef void (*EnBaguoActionFunc)(struct EnBaguo*, GlobalContext*);
-typedef enum {
- /* 0x0 */ NEJIRON_ACTION_INACTIVE, // The Nejiron is either underground or emerging from underground
- /* 0x1 */ NEJIRON_ACTION_ACTIVE, // The Nejiron is above ground and actively chasing the player
- /* 0x2 */ NEJIRON_ACTION_RETREATING, // The Nejiron is burrowing back underground
- /* 0x3 */ NEJIRON_ACTION_EXPLODING // The Nejiron has detonated
-} NejironAction;
-
-/**
- * These directions are relative to the Nejiron.
- */
-typedef enum {
- /* 0x0 */ NEJIRON_DIRECTION_RIGHT,
- /* 0x1 */ NEJIRON_DIRECTION_LEFT
-} NejironRollDirection;
-
/**
* When a Nejiron explodes, rock particles fly out from where it exploded.
* This struct governs how these rock particles behave.
@@ -39,8 +25,8 @@ typedef struct NejironParticle {
typedef struct EnBaguo {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
- /* 0x188 */ Vec3s jointTable[3];
- /* 0x19A */ Vec3s morphTable[3];
+ /* 0x188 */ Vec3s jointTable[NEJIRON_LIMB_MAX];
+ /* 0x19A */ Vec3s morphTable[NEJIRON_LIMB_MAX];
/* 0x1AC */ EnBaguoActionFunc actionFunc;
/* 0x1B0 */ s16 eyeIndex;
/* 0x1B2 */ s16 blinkTimer;
@@ -48,7 +34,7 @@ typedef struct EnBaguo {
/* 0x1B6 */ s16 action;
/* 0x1B8 */ s16 zRollDirection;
/* 0x1BC */ f32 maxDistanceFromHome;
- /* 0x1C0 */ u8 hardHitFlag;
+ /* 0x1C0 */ u8 bouncedFlag;
/* 0x1C4 */ Vec3f currentRotation;
/* 0x1D0 */ Vec3f targetRotation;
/* 0x1DC */ ColliderJntSph collider;
diff --git a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c
index fcbd60ed0a..dc7bca14ce 100644
--- a/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c
+++ b/src/overlays/actors/ovl_En_Baisen/z_en_baisen.c
@@ -5,8 +5,9 @@
*/
#include "z_en_baisen.h"
+#include "objects/object_bai/object_bai.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBaisen*)thisx)
@@ -22,11 +23,6 @@ void func_80BE895C(EnBaisen* this, GlobalContext* globalCtx);
void func_80BE8AAC(EnBaisen* this, GlobalContext* globalCtx);
void func_80BE89D8(EnBaisen* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_06007908;
-extern AnimationHeader D_060011C0;
-extern AnimationHeader D_060008B4;
-extern AnimationHeader D_06008198;
-
const ActorInit En_Baisen_InitVars = {
ACTOR_EN_BAISEN,
ACTORCAT_NPC,
@@ -61,15 +57,16 @@ static ColliderCylinderInit sCylinderInit = {
static u16 sTextIds[] = { 0x2ABD, 0x2ABB, 0x2AD5, 0x2AD6, 0x2AD7, 0x2AD8, 0x2AC6 };
-static AnimationHeader* D_80BE8E4C[] = { &D_060011C0, &D_060008B4, &D_06008198 };
+static AnimationHeader* D_80BE8E4C[] = { &object_bai_Anim_0011C0, &object_bai_Anim_0008B4, &object_bai_Anim_008198 };
-static u8 animModes[] = { 0, 0 };
+static u8 animModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP };
void EnBaisen_Init(Actor* thisx, GlobalContext* globalCtx) {
EnBaisen* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bai_Skel_007908, &object_bai_Anim_0011C0, this->jointTable,
+ this->morphTable, 20);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->paramCopy = this->actor.params;
if (this->actor.params == 0) {
diff --git a/src/overlays/actors/ovl_En_Bal/z_en_bal.c b/src/overlays/actors/ovl_En_Bal/z_en_bal.c
index dbfa561c61..2f57c28042 100644
--- a/src/overlays/actors/ovl_En_Bal/z_en_bal.c
+++ b/src/overlays/actors/ovl_En_Bal/z_en_bal.c
@@ -6,7 +6,7 @@
#include "z_en_bal.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBal*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bat/z_en_bat.c b/src/overlays/actors/ovl_En_Bat/z_en_bat.c
index a419d2901a..ab76d88c84 100644
--- a/src/overlays/actors/ovl_En_Bat/z_en_bat.c
+++ b/src/overlays/actors/ovl_En_Bat/z_en_bat.c
@@ -6,7 +6,7 @@
#include "z_en_bat.h"
-#define FLAGS 0x00005005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000)
#define THIS ((EnBat*)thisx)
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 cd8c7cac87..1ce821f66e 100644
--- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c
+++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c
@@ -6,7 +6,7 @@
#include "z_en_bb.h"
-#define FLAGS 0x00000205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200)
#define THIS ((EnBb*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c
index 0ee8d32e37..00f4be6e8e 100644
--- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c
+++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c
@@ -2,11 +2,20 @@
* File: z_en_bba_01.c
* Overlay: ovl_En_Bba_01
* Description: Unused Bomb Shop Lady NPC
+ *
+ * Note: This actor was probably written with OOT's object_bba's skeleton in mind, and so this actor is very bugged.
+ *
+ * The main offender is that gBbaSkel has 18 limbs, while the system used (EnHy) expects 16 (see @bug in FinishInit
+ * below).
+ *
+ * The draw functions also use different limbs than expected, which results in, for example, EnBba01's right arm and bag
+ * following the player instead of her head and torso.
*/
#include "z_en_bba_01.h"
+#include "objects/object_bba/object_bba.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBba01*)thisx)
@@ -15,12 +24,10 @@ void EnBba01_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnBba01_Update(Actor* thisx, GlobalContext* globalCtx);
void EnBba01_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_809CC2F0(EnBba01* this, GlobalContext* globalCtx);
-void func_809CC370(EnBba01* this, GlobalContext* globalCtx);
-void func_809CC3A8(EnBba01* this, GlobalContext* globalCtx);
-void func_809CC3CC(EnBba01* this, GlobalContext* globalCtx);
+void EnBba01_Walk(EnHy* this, GlobalContext* globalCtx);
+void EnBba01_FaceFoward(EnHy* this, GlobalContext* globalCtx);
+void EnBba01_Talk(EnHy* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Bba_01_InitVars = {
ACTOR_EN_BBA_01,
ACTORCAT_NPC,
@@ -33,84 +40,296 @@ const ActorInit En_Bba_01_InitVars = {
(ActorFunc)EnBba01_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_809CCC80 = {
- { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT0,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 18, 64, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_809CCCAC = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_809CCCB8 = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(0, 0x0),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(0, 0x0),
- /* Zora boomerang */ DMG_ENTRY(0, 0x0),
- /* Normal arrow */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0),
- /* Hookshot */ DMG_ENTRY(0, 0x0),
- /* Goron punch */ DMG_ENTRY(0, 0x0),
- /* Sword */ DMG_ENTRY(0, 0x0),
- /* Goron pound */ DMG_ENTRY(0, 0x0),
- /* Fire arrow */ DMG_ENTRY(0, 0x0),
- /* Ice arrow */ DMG_ENTRY(0, 0x0),
- /* Light arrow */ DMG_ENTRY(0, 0x0),
- /* Goron spikes */ DMG_ENTRY(0, 0x0),
- /* Deku spin */ DMG_ENTRY(0, 0x0),
- /* Deku bubble */ DMG_ENTRY(0, 0x0),
- /* Deku launch */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0x0),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0x0),
- /* Thrown object */ DMG_ENTRY(0, 0x0),
- /* Zora punch */ DMG_ENTRY(0, 0x0),
- /* Spin attack */ DMG_ENTRY(0, 0x0),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(0, 0x0),
+static DamageTable sDamageTable = {
+ /* Deku Nut */ DMG_ENTRY(0, 0),
+ /* Deku Stick */ DMG_ENTRY(0, 0),
+ /* Horse trample */ DMG_ENTRY(0, 0),
+ /* Explosives */ DMG_ENTRY(0, 0),
+ /* Zora boomerang */ DMG_ENTRY(0, 0),
+ /* Normal arrow */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0),
+ /* Hookshot */ DMG_ENTRY(0, 0),
+ /* Goron punch */ DMG_ENTRY(0, 0),
+ /* Sword */ DMG_ENTRY(0, 0),
+ /* Goron pound */ DMG_ENTRY(0, 0),
+ /* Fire arrow */ DMG_ENTRY(0, 0),
+ /* Ice arrow */ DMG_ENTRY(0, 0),
+ /* Light arrow */ DMG_ENTRY(0, 0),
+ /* Goron spikes */ DMG_ENTRY(0, 0),
+ /* Deku spin */ DMG_ENTRY(0, 0),
+ /* Deku bubble */ DMG_ENTRY(0, 0),
+ /* Deku launch */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0),
+ /* Zora barrier */ DMG_ENTRY(0, 0),
+ /* Normal shield */ DMG_ENTRY(0, 0),
+ /* Light ray */ DMG_ENTRY(0, 0),
+ /* Thrown object */ DMG_ENTRY(0, 0),
+ /* Zora punch */ DMG_ENTRY(0, 0),
+ /* Spin attack */ DMG_ENTRY(0, 0),
+ /* Sword beam */ DMG_ENTRY(0, 0),
+ /* Normal Roll */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0),
+ /* Unblockable */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0),
+ /* Powder Keg */ DMG_ENTRY(0, 0),
};
-#endif
+u16 D_809CCCD8[] = { 4000, 4, 1, 3, 6000, 4, 1, 6, 4000, 4, 1, 3, 6000, 4, 1, 6 };
-extern ColliderCylinderInit D_809CCC80;
-extern CollisionCheckInfoInit2 D_809CCCAC;
-extern DamageTable D_809CCCB8;
+void EnBba01_UpdateModel(EnBba01* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f focus;
-extern UNK_TYPE D_06005EF0;
+ EnHy_UpdateSkelAnime(&this->enHy, globalCtx);
+ if (SubS_AngleDiffLessEqual(this->enHy.actor.shape.rot.y, 0x36B0, this->enHy.actor.yawTowardsPlayer)) {
+ focus.x = player->actor.world.pos.x;
+ focus.y = player->bodyPartsPos[7].y + 3.0f;
+ focus.z = player->actor.world.pos.z;
+ func_8013D2E0(&focus, &this->enHy.actor.focus.pos, &this->enHy.actor.shape.rot, &this->enHy.focusTarget,
+ &this->enHy.headRot, &this->enHy.torsoRot, D_809CCCD8);
+ } else {
+ Math_SmoothStepToS(&this->enHy.focusTarget.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.focusTarget.y, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.headRot.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.headRot.y, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.torsoRot.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.torsoRot.y, 0, 4, 0x3E8, 1);
+ }
+ SubS_FillLimbRotTables(globalCtx, this->enHy.limbRotTableY, this->enHy.limbRotTableZ,
+ ARRAY_COUNT(this->enHy.limbRotTableY));
+ EnHy_UpdateCollider(&this->enHy, globalCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC060.s")
+s32 EnBba01_TestIsTalking(EnBba01* this, GlobalContext* globalCtx) {
+ s32 isTalking = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC1D4.s")
+ if (Actor_ProcessTalkRequest(&this->enHy.actor, &globalCtx->state)) {
+ isTalking = true;
+ this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox
+ this->enHy.tmpFocusTarget = this->enHy.focusTarget;
+ this->enHy.tmpHeadRot = this->enHy.headRot;
+ this->enHy.tmpTorsoRot = this->enHy.torsoRot;
+ this->enHy.tmpActionFunc = this->enHy.actionFunc;
+ this->enHy.actionFunc = EnBba01_Talk;
+ }
+ return isTalking;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC270.s")
+s32 func_809CC270(EnBba01* this, GlobalContext* globalCtx) {
+ s16 x;
+ s16 y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC2F0.s")
+ Actor_GetScreenPos(globalCtx, &this->enHy.actor, &x, &y);
+ //! @bug: Both x and y conditionals are always true, || should be an &&
+ if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
+ func_800B85E0(&this->enHy.actor, globalCtx, 30.0f, EXCH_ITEM_2E);
+ }
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC370.s")
+void EnBba01_FinishInit(EnHy* this, GlobalContext* globalCtx) {
+ //! @bug: gBbaSkel does not match EnHy's skeleton assumptions.
+ //! Since gBbaSkel has more limbs than expected, joint and morph tables will overflow
+ if (EnHy_Init(this, globalCtx, &gBbaSkel, ENHY_ANIMATION_BBA_6)) {
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actor.draw = EnBba01_Draw;
+ this->waitingOnInit = false;
+ if (ENBBA01_GET_PATH(&this->actor) == ENBBA01_NO_PATH) {
+ this->actionFunc = EnBba01_FaceFoward;
+ } else {
+ this->actionFunc = EnBba01_Walk;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC3A8.s")
+void EnBba01_Walk(EnHy* this, GlobalContext* globalCtx) {
+ if (EnHy_MoveForwards(this, 1.0f)) {
+ this->curPoint = 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC3CC.s")
+void EnBba01_FaceFoward(EnHy* this, GlobalContext* globalCtx) {
+ this->actor.shape.rot = this->actor.world.rot;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/EnBba01_Init.s")
+void EnBba01_Talk(EnHy* this, GlobalContext* globalCtx) {
+ s16 yaw;
+ u8 talkState;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/EnBba01_Destroy.s")
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1);
+ talkState = Message_GetState(&globalCtx->msgCtx);
+ this->inMsgState3 = (talkState == 3) ? true : false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/EnBba01_Update.s")
+ switch (talkState) {
+ case 0:
+ yaw = ABS_ALT(this->actor.shape.rot.y - this->actor.yawTowardsPlayer);
+ if (yaw < 0x64) {
+ Message_StartTextbox(globalCtx, this->textId, NULL);
+ }
+ break;
+ case 2:
+ this->actor.textId = 0;
+ this->focusTarget = this->tmpFocusTarget;
+ this->headRot = this->tmpHeadRot;
+ this->torsoRot = this->tmpTorsoRot;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actionFunc = this->tmpActionFunc;
+ this->tmpActionFunc = NULL;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC6F0.s")
+void EnBba01_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBba01* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CC984.s")
+ this->enHy.animObjIndex = SubS_GetObjectIndex(OBJECT_BBA, globalCtx);
+ this->enHy.headObjIndex = SubS_GetObjectIndex(OBJECT_BBA, globalCtx);
+ this->enHy.skelUpperObjIndex = SubS_GetObjectIndex(OBJECT_BBA, globalCtx);
+ this->enHy.skelLowerObjIndex = SubS_GetObjectIndex(OBJECT_BBA, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/func_809CCA5C.s")
+ if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) ||
+ (this->enHy.skelLowerObjIndex < 0)) {
+ Actor_MarkForDeath(&this->enHy.actor);
+ }
+ this->enHy.actor.draw = NULL;
+ Collider_InitCylinder(globalCtx, &this->enHy.collider);
+ Collider_SetCylinder(globalCtx, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ this->enHy.actor.flags &= ~ACTOR_FLAG_1;
+ this->enHy.path = func_8013D648(globalCtx, ENBBA01_GET_PATH(&this->enHy.actor), ENBBA01_NO_PATH);
+ this->enHy.waitingOnInit = true;
+ Actor_SetScale(&this->enHy.actor, 0.01f);
+ this->enHy.actionFunc = EnBba01_FinishInit;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bba_01/EnBba01_Draw.s")
+void EnBba01_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnBba01* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->enHy.collider);
+}
+
+void EnBba01_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnBba01* this = THIS;
+
+ EnBba01_TestIsTalking(this, globalCtx);
+ this->enHy.actionFunc(&this->enHy, globalCtx);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->enHy.actor, 0.0f, 0.0f, 0.0f, 4);
+ EnBba01_UpdateModel(this, globalCtx);
+ func_809CC270(this, globalCtx);
+}
+
+s32 EnBba01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnBba01* this = THIS;
+ s8 bodyPart;
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
+
+ bodyPart = gEnHyBodyParts[limbIndex];
+ if (bodyPart >= 0) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
+ }
+
+ if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->enHy.headObjIndex].segment);
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.headObjIndex].segment);
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.skelLowerObjIndex].segment);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
+ Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->enHy.headRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->enHy.headRot.x, MTXMODE_APPLY);
+ Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if (limbIndex == BBA_LIMB_BAG) {
+ Matrix_InsertXRotation_s(-this->enHy.torsoRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->enHy.torsoRot.x, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) && this->enHy.inMsgState3 &&
+ ((globalCtx->state.frames % 2) == 0)) {
+ Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == BBA_LIMB_BAG) || (limbIndex == BBA_LIMB_TORSO) || (limbIndex == BBA_LIMB_LEFT_FOREARM)) {
+ rot->y += (s16)(Math_SinS(this->enHy.limbRotTableY[limbIndex]) * 200.0f);
+ rot->z += (s16)(Math_CosS(this->enHy.limbRotTableZ[limbIndex]) * 200.0f);
+ }
+
+ return false;
+}
+
+void EnBba01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnBba01* this = THIS;
+ GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
+
+ if (limbIndex == BBA_LIMB_HEAD) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->enHy.skelUpperObjIndex].segment);
+ gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.skelUpperObjIndex].segment);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.actor.focus.pos);
+ }
+}
+
+void EnBba01_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+}
+
+void EnBba01_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnBba01* this = THIS;
+ s32 i;
+ u8* shadowTex = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[64][64]));
+ u8* shadowTexIter;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_EnvColor(globalCtx->state.gfxCtx, 255, 255, 255, 0));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 55, 55, 255, 0));
+ gDPPipeSync(POLY_OPA_DISP++);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->enHy.skelAnime.skeleton, this->enHy.skelAnime.jointTable,
+ this->enHy.skelAnime.dListCount, EnBba01_OverrideLimbDraw, EnBba01_PostLimbDraw,
+ EnBba01_TransformLimbDraw, &this->enHy.actor);
+ Matrix_InsertXRotation_s(0, MTXMODE_NEW);
+
+ for (i = 0, shadowTexIter = shadowTex; i < (s32)sizeof(u8[64][64]); i++) {
+ *shadowTexIter++ = 0;
+ }
+ for (i = 0; i < 5; i++) {
+ func_8013CD64(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f,
+ ARRAY_COUNT(this->enHy.bodyPartsPos), gEnHyShadowSize, gEnHyBodyPartsIndex);
+ }
+ func_8013CF04(&this->enHy.actor, &globalCtx->state.gfxCtx, shadowTex);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h
index 20416b4f9f..b670dea012 100644
--- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h
+++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.h
@@ -1,16 +1,18 @@
#ifndef Z_EN_BBA_01_H
#define Z_EN_BBA_01_H
-#include "global.h"
+#include "z_en_hy_code.h"
struct EnBba01;
typedef void (*EnBba01ActionFunc)(struct EnBba01*, GlobalContext*);
+#define ENBBA01_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
+#define ENBBA01_NO_PATH 0x3F
+
typedef struct EnBba01 {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ EnBba01ActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x4D4];
+ /* 0x000 */ EnHy enHy;
+ /* 0x3EC */ UNK_TYPE1 unk_3EC[0x230];
} EnBba01; // size = 0x61C
extern const ActorInit En_Bba_01_InitVars;
diff --git a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
index 080579156d..8af8e650a5 100644
--- a/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
+++ b/src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
@@ -6,7 +6,7 @@
#include "z_en_bbfall.h"
-#define FLAGS 0x00000215
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_200)
#define THIS ((EnBbfall*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bee/z_en_bee.c b/src/overlays/actors/ovl_En_Bee/z_en_bee.c
index 1bf4d8d8c5..ecb64cb910 100644
--- a/src/overlays/actors/ovl_En_Bee/z_en_bee.c
+++ b/src/overlays/actors/ovl_En_Bee/z_en_bee.c
@@ -6,7 +6,7 @@
#include "z_en_bee.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnBee*)thisx)
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 65ef97e26c..019332000a 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.c
@@ -5,8 +5,9 @@
*/
#include "z_en_bigokuta.h"
+#include "assets/objects/object_bigokuta/object_bigokuta.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnBigokuta*)thisx)
@@ -15,7 +16,21 @@ void EnBigokuta_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnBigokuta_Update(Actor* thisx, GlobalContext* globalCtx);
void EnBigokuta_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80AC2B4C(GlobalContext* globalCtx, EnBigokuta* this);
+void EnBigokuta_SetupIdle(EnBigokuta* this);
+void EnBigokuta_Idle(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SetupRise(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_RiseOutOfWater(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SetupIdleAboveWater(EnBigokuta* this);
+void EnBigokuta_IdleAboveWater(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SetupHoldPlayer(EnBigokuta* this);
+void EnBigokuta_HoldPlayer(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, GlobalContext* globalCtx);
+void EnBigokuta_SetupDeathEffects(EnBigokuta* this);
+void EnBigokuta_PlayDeathEffects(EnBigokuta* this, GlobalContext* globalCtx);
+
const ActorInit En_Bigokuta_InitVars = {
ACTOR_EN_BIGOKUTA,
ACTORCAT_BOSS,
@@ -28,25 +43,54 @@ const ActorInit En_Bigokuta_InitVars = {
(ActorFunc)EnBigokuta_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80AC4530 = {
- { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFC74F, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+typedef enum {
+ BIGOCTO_DRAWEFFECT_ICE = 10,
+ BIGOCTO_DRAWEFFECT_LIGHT_ORBS = 20,
+} EnBigokutaDrawEffect;
+
+static ColliderCylinderInit sShellCylinderInit = {
+ {
+ COLTYPE_HARD,
+ AT_NONE,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFC74F, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 75, 125, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80AC455C = {
- { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x000038B0, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sBodyCylinderInit = {
+ {
+ COLTYPE_HIT0,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x000038B0, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 70, 125, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit D_80AC4588 = { 4, 130, 120, MASS_HEAVY };
+static CollisionCheckInfoInit sColChkInfoInit = { 4, 130, 120, MASS_HEAVY };
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80AC4590[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 2500, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE),
ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE),
@@ -54,73 +98,585 @@ static InitChainEntry D_80AC4590[] = {
ICHAIN_VEC3F_DIV1000(scale, 33, ICHAIN_STOP),
};
-#endif
+void EnBigokuta_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnBigokuta* this = THIS;
-extern ColliderCylinderInit D_80AC4530;
-extern ColliderCylinderInit D_80AC455C;
-extern CollisionCheckInfoInit D_80AC4588;
-extern InitChainEntry D_80AC4590[];
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gBigOctoSkel, &gBigOctoIdleAnim, this->jointTable,
+ this->morphTable, BIGOKUTA_LIMB_MAX);
-extern UNK_TYPE D_06000444;
-extern UNK_TYPE D_06000A74;
-extern UNK_TYPE D_060014B8;
+ Collider_InitAndSetCylinder(globalCtx, &this->shellCollider, &this->actor, &sShellCylinderInit);
+ Collider_InitAndSetCylinder(globalCtx, &this->bodyCollider, &this->actor, &sBodyCylinderInit);
+ CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
+ this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Init.s")
+ if (gSaveContext.weekEventReg[20] & 2 ||
+ ((this->actor.params != 0xFF) && Flags_GetSwitch(globalCtx, this->actor.params))) {
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ this->actor.world.pos.y -= 99.0f;
+ EnBigokuta_SetupIdle(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Destroy.s")
+ this->camAt.x = (Math_SinS(this->actor.home.rot.y) * 66.0f) + this->actor.world.pos.x;
+ this->camAt.y = (this->actor.home.pos.y - 49.5f) + 42.899998f;
+ this->camAt.z = (Math_CosS(this->actor.home.rot.y) * 66.0f) + this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC28B4.s")
+ this->unkFunc = func_80AC2B4C; // set but never called
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC299C.s")
+void EnBigokuta_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnBigokuta* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2A1C.s")
+ Collider_DestroyCylinder(globalCtx, &this->shellCollider);
+ Collider_DestroyCylinder(globalCtx, &this->bodyCollider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2A7C.s")
+void EnBigokuta_SetupCutsceneCamera(EnBigokuta* this, GlobalContext* globalCtx, Vec3f* at, Vec3f* eye) {
+ s16 angle;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2B4C.s")
+ ActorCutscene_Start(this->actor.cutscene, &this->actor);
+ this->camId = ActorCutscene_GetCurrentCamera(this->actor.cutscene);
+ Play_CameraSetAtEye(globalCtx, this->camId, at, eye);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2B98.s")
+ angle = BINANG_SUB(Actor_YawToPoint(&this->actor, eye), this->actor.home.rot.y);
+ if (angle > 0) {
+ angle = BINANG_ADD(this->actor.home.rot.y, 0x1800);
+ } else {
+ angle = BINANG_SUB(this->actor.home.rot.y, 0x1800);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2C30.s")
+ this->camEye.x = (Math_SinS(angle) * 250.0f) + this->camAt.x;
+ this->camEye.y = this->camAt.y + 100.0f;
+ this->camEye.z = (Math_CosS(angle) * 250.0f) + this->camAt.z;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2C84.s")
+void EnBigokuta_MoveCamera(EnBigokuta* this, GlobalContext* globalCtx) {
+ Camera* camera = Play_GetCamera(globalCtx, this->camId);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2CE8.s")
+ Math_Vec3f_StepTo(&camera->eye, &this->camEye, 20.0f);
+ Math_Vec3f_StepTo(&camera->at, &this->camAt, 20.0f);
+ Play_CameraSetAtEye(globalCtx, this->camId, &camera->at, &camera->eye);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2DAC.s")
+void EnBigokuta_ResetCamera(EnBigokuta* this, GlobalContext* globalCtx) {
+ Camera* camera;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2EBC.s")
+ if (this->camId != 0) {
+ camera = Play_GetCamera(globalCtx, this->camId);
+ Play_CameraSetAtEye(globalCtx, 0, &camera->at, &camera->eye);
+ this->camId = 0;
+ ActorCutscene_Stop(this->actor.cutscene);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2F20.s")
+void EnBigokuta_ShootPlayer(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC2F64.s")
+ if (&this->actor == player->actor.parent) {
+ player->actor.parent = NULL;
+ player->unk_AE8 = 100;
+ player->actor.velocity.y = 0.0f;
+ player->actor.world.pos.x += 20.0f * Math_SinS(this->actor.home.rot.y);
+ player->actor.world.pos.z += 20.0f * Math_CosS(this->actor.home.rot.y);
+ func_800B8D50(globalCtx, &this->actor, 10.0f, this->actor.home.rot.y, 10.0f, 4);
+ }
+ EnBigokuta_ResetCamera(this, globalCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3054.s")
+void func_80AC2B4C(GlobalContext* globalCtx, EnBigokuta* this) {
+ func_8013A530(globalCtx, &this->actor, 3, &this->actor.focus.pos, &this->actor.shape.rot, 280.0f, 1800.0f, -1);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC30EC.s")
+s32 EnBigokuta_IsInWater(EnBigokuta* this, GlobalContext* globalCtx) {
+ WaterBox* box;
+ s32 bgId;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC31EC.s")
+ this->actor.floorHeight = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->actor.floorPoly, &bgId,
+ &this->actor, &this->actor.world.pos);
+ if (!WaterBox_GetSurface1_2(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->actor.home.pos.y, &box) ||
+ (this->actor.home.pos.y <= this->actor.floorHeight)) {
+ return false;
+ } else {
+ return true;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC33A4.s")
+void EnBigokuta_SpawnRipple(EnBigokuta* this, GlobalContext* globalCtx) {
+ Vec3f ripplePos;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC33C0.s")
+ ripplePos.x = this->actor.world.pos.x;
+ ripplePos.y = this->actor.home.pos.y;
+ ripplePos.z = this->actor.world.pos.z;
+ EffectSsGRipple_Spawn(globalCtx, &ripplePos, 1000, 1400, 0);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3460.s")
+void EnBigokuta_SetupIdle(EnBigokuta* this) {
+ Animation_Change(&this->skelAnime, &gBigOctoIdleAnim, 0.5f, 0.0f, 0.0f, 1, -3.0f);
+ this->actionFunc = EnBigokuta_Idle;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC34A8.s")
+void EnBigokuta_Idle(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC35E8.s")
+ SkelAnime_Update(&this->skelAnime);
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 99.0f, 2.5f);
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000);
+ if ((this->actor.xzDistToPlayer < 300.0f) && ((player->actor.world.pos.y - this->actor.home.pos.y) < 100.0f)) {
+ EnBigokuta_SetupRise(this, globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3650.s")
+void EnBigokuta_SetupRise(EnBigokuta* this, GlobalContext* globalCtx) {
+ Vec3f splashPos;
+ s32 i;
+ s16 angle = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3930.s")
+ Animation_PlayOnce(&this->skelAnime, &gBigOctoRiseOutOfWaterAnim);
+ splashPos.y = this->actor.home.pos.y;
+ for (i = 0; i < 8; i++) {
+ splashPos.x = Math_SinS(angle) * 70.0f + this->actor.world.pos.x;
+ splashPos.z = Math_CosS(angle) * 70.0f + this->actor.world.pos.z;
+ EffectSsGSplash_Spawn(globalCtx, &splashPos, NULL, NULL, 0, Rand_S16Offset(1000, 200));
+ angle = BINANG_ADD(angle, 0x2000);
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_LAND);
+ this->actionFunc = EnBigokuta_RiseOutOfWater;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC39A0.s")
+void EnBigokuta_RiseOutOfWater(EnBigokuta* this, GlobalContext* globalCtx) {
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 15.0f);
+ if (SkelAnime_Update(&this->skelAnime)) {
+ EnBigokuta_SetupIdleAboveWater(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Update.s")
+void EnBigokuta_SetupIdleAboveWater(EnBigokuta* this) {
+ Animation_MorphToLoop(&this->skelAnime, &gBigOctoIdleAnim, -5.0f);
+ this->actionFunc = EnBigokuta_IdleAboveWater;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC3D48.s")
+void EnBigokuta_IdleAboveWater(EnBigokuta* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 2.5f);
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/func_80AC4204.s")
+ if ((this->actor.xzDistToPlayer > 400.0f) || (this->actor.playerHeightRel > 200.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_SINK);
+ EnBigokuta_SetupIdle(this);
+ } else if ((this->actor.xzDistToPlayer < 200.0f) && globalCtx->grabPlayer(globalCtx, GET_PLAYER(globalCtx))) {
+ EnBigokuta_SetupSuckInPlayer(this, globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bigokuta/EnBigokuta_Draw.s")
+void EnBigokuta_UpdateOrSetupCam(EnBigokuta* this, GlobalContext* globalCtx) {
+ if (this->actor.cutscene != -1) {
+ if (this->camId != 0) {
+ EnBigokuta_MoveCamera(this, globalCtx);
+ } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ Camera* camera = Play_GetCamera(globalCtx, 0);
+
+ EnBigokuta_SetupCutsceneCamera(this, globalCtx, &camera->at, &camera->eye);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+ }
+}
+
+void EnBigokuta_SetupSuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->actor.parent = &this->actor;
+ this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
+ Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos);
+ this->timer = 0;
+
+ Animation_Change(&this->skelAnime, &gBigOctoIdleAnim, 1.0f, 12.0f, 12.0f, 2, -3.0f);
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+
+ this->playerHoldPos.x = (Math_SinS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.x;
+ this->playerHoldPos.y = (this->actor.home.pos.y - 49.5f) + 42.899998f;
+ this->playerHoldPos.z = (Math_CosS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.z;
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_SLIME_DEAD);
+ this->actionFunc = EnBigokuta_SuckInPlayer;
+}
+
+void EnBigokuta_SuckInPlayer(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ EnBigokuta_UpdateOrSetupCam(this, globalCtx);
+ SkelAnime_Update(&this->skelAnime);
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 49.5f, 10.0f);
+
+ if (this->timer < 9) {
+ this->timer++;
+ }
+
+ player->unk_AE8 = 0;
+ Math_Vec3f_Copy(&player->actor.world.pos, &this->playerPos);
+ if (Math_Vec3f_StepTo(&player->actor.world.pos, &this->playerHoldPos, sqrtf(this->timer) * 5.0f) < 0.1f) {
+ s16 rotY = this->actor.shape.rot.y;
+
+ if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x800)) {
+ EnBigokuta_SetupHoldPlayer(this);
+ }
+
+ this->playerHoldPos.x = (Math_SinS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.x;
+ this->playerHoldPos.y = (this->actor.home.pos.y - 49.5f) + 42.899998f;
+ this->playerHoldPos.z = (Math_CosS(this->actor.shape.rot.y) * 66.0f) + this->actor.world.pos.z;
+
+ Math_Vec3f_Copy(&player->actor.world.pos, &this->playerHoldPos);
+ Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos);
+ player->actor.shape.rot.y += BINANG_SUB(this->actor.shape.rot.y, rotY);
+ } else {
+ Math_Vec3f_Copy(&this->playerPos, &player->actor.world.pos);
+ player->actor.velocity.y = 0.0f;
+ }
+}
+
+void EnBigokuta_SetupHoldPlayer(EnBigokuta* this) {
+ this->timer = 12;
+ this->actionFunc = EnBigokuta_HoldPlayer;
+}
+
+void EnBigokuta_HoldPlayer(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ this->timer--;
+ if (this->timer >= 0) {
+ EnBigokuta_UpdateOrSetupCam(this, globalCtx);
+ Math_Vec3f_Copy(&player->actor.world.pos, &this->playerHoldPos);
+
+ if (this->timer == 0) {
+ EnBigokuta_ShootPlayer(this, globalCtx);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_REVERSE);
+ }
+ } else if (this->timer == -24) {
+ EnBigokuta_SetupIdleAboveWater(this);
+ }
+}
+
+void EnBigokuta_SetupDeathCutscene(EnBigokuta* this) {
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ this->timer = 0;
+ this->bodyCollider.base.acFlags &= ~AC_ON;
+ this->actionFunc = EnBigokuta_PlayDeathCutscene;
+}
+
+void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, GlobalContext* globalCtx) {
+ Player* player;
+
+ this->actor.colorFilterTimer = Animation_GetLastFrame(&gBigOctoDeathAnim);
+
+ if (this->timer != 0) {
+ this->timer--;
+ if (this->timer == 0) {
+ this->drawEffect = 0;
+ this->drawEffectAlpha = 0.0f;
+ Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.5f, 0.35f);
+ EnBigokuta_SetupDeathEffects(this);
+ }
+ } else if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
+ ActorCutscene_Start(this->cutscene, &this->actor);
+
+ if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) {
+ func_800B724C(globalCtx, &this->actor, 7);
+ } else {
+ player = GET_PLAYER(globalCtx);
+ player->stateFlags1 |= 0x20;
+ }
+
+ if (this->drawEffect == BIGOCTO_DRAWEFFECT_ICE) {
+ this->timer = 3;
+ } else {
+ EnBigokuta_SetupDeathEffects(this);
+ }
+ } else {
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ }
+}
+
+void EnBigokuta_SetupDeathEffects(EnBigokuta* this) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &gBigOctoDeathAnim, -5.0f);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DAIOCTA_DEAD2);
+ this->actor.flags &= ~1;
+ this->timer = 10;
+ this->actionFunc = EnBigokuta_PlayDeathEffects;
+}
+
+void EnBigokuta_PlayDeathEffects(EnBigokuta* this, GlobalContext* globalCtx) {
+ static Vec3f D_80AC45A4 = { 0.0f, -0.5f, 0.0f };
+ static Color_RGBA8 D_80AC45B0 = { 255, 255, 255, 255 };
+ static Color_RGBA8 D_80AC45B4 = { 100, 255, 255, 255 };
+ static Color_RGBA8 D_80AC45B8 = { 150, 150, 150, 0 };
+
+ if (SkelAnime_Update(&this->skelAnime)) {
+ this->actor.world.pos.y -= 0.2f;
+
+ if (this->timer > 0) {
+ this->timer--;
+
+ if (this->timer == 6) {
+ Vec3f dustPos;
+
+ dustPos.x = this->actor.world.pos.x;
+ dustPos.y = this->actor.world.pos.y + 150.0f;
+ dustPos.z = this->actor.world.pos.z;
+
+ func_800B0DE0(globalCtx, &dustPos, &gZeroVec3f, &gZeroVec3f, &D_80AC45B0, &D_80AC45B4, 1200, 20);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OCTAROCK_DEAD2);
+ }
+ } else {
+ this->actor.world.pos.y -= 0.2f;
+
+ if (Math_StepToF(&this->actor.scale.y, 0.001f, 0.001f)) {
+ s32 i;
+ Vec3f bubbleVel;
+ Vec3f bubblePos;
+
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 50, NA_SE_EN_COMMON_WATER_MID);
+ bubblePos.y = this->actor.world.pos.y;
+
+ for (i = 0; i < 20; i++) {
+ bubbleVel.x = randPlusMinusPoint5Scaled(10.0f);
+ bubbleVel.y = Rand_ZeroFloat(5.5f) + 5.5f;
+ bubbleVel.z = randPlusMinusPoint5Scaled(10.0f);
+ bubblePos.x = this->actor.world.pos.x + (2.0f * bubbleVel.x);
+ bubblePos.z = this->actor.world.pos.z + (2.0f * bubbleVel.z);
+
+ EffectSsDtBubble_SpawnCustomColor(globalCtx, &bubblePos, &bubbleVel, &D_80AC45A4, &D_80AC45B0,
+ &D_80AC45B8, Rand_S16Offset(150, 50), 25, 0);
+ }
+
+ if (this->actor.params != 0xFF) {
+ Flags_SetSwitch(globalCtx, this->actor.params);
+ }
+
+ ActorCutscene_Stop(this->cutscene);
+ Actor_MarkForDeath(&this->actor);
+
+ if (!(gSaveContext.eventInf[4] & 2) && !(gSaveContext.eventInf[3] & 0x20)) {
+ func_800B724C(globalCtx, &this->actor, 6);
+ } else {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->stateFlags1 &= ~0x20;
+ }
+ }
+
+ if (this->drawEffectAlpha > 0.0f) {
+ this->drawEffectAlpha = this->actor.scale.y * 30.30303f;
+ }
+ }
+ } else {
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y - 16.5f, 15.0f);
+ }
+}
+
+s32 EnBigokuta_IsNearSwampBoat(EnBigokuta* this, GlobalContext* globalCtx) {
+ this->actor.child = SubS_FindActor(globalCtx, NULL, ACTORCAT_BG, ACTOR_BG_INGATE);
+
+ if ((this->actor.child != NULL) && (Actor_XZDistanceBetweenActors(&this->actor, this->actor.child) < 250.0f)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void EnBigokuta_CheckOneHitKill(EnBigokuta* this, GlobalContext* globalCtx) {
+ if ((this->bodyCollider.base.acFlags & AC_ON) &&
+ ((this->bodyCollider.base.acFlags & AC_HIT) ||
+ ((globalCtx->sceneNum == SCENE_20SICHITAI || globalCtx->sceneNum == SCENE_20SICHITAI2) &&
+ EnBigokuta_IsNearSwampBoat(this, globalCtx)))) {
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+
+ if (this->bodyCollider.base.acFlags & AC_HIT) {
+ if (this->bodyCollider.info.acHitInfo->toucher.dmgFlags & 0x1000) { // Ice Arrow
+ this->drawEffect = BIGOCTO_DRAWEFFECT_ICE;
+ this->drawEffectScale = 1.2f;
+ this->drawEffectSteamScale = 1.8000001f;
+ this->drawEffectAlpha = 1.0f;
+ } else if (this->bodyCollider.info.acHitInfo->toucher.dmgFlags & 0x2000) { // Light Arrow
+ this->drawEffect = BIGOCTO_DRAWEFFECT_LIGHT_ORBS;
+ this->drawEffectScale = 1.2f;
+ this->drawEffectAlpha = 4.0f;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG,
+ this->bodyCollider.info.bumper.hitPos.x, this->bodyCollider.info.bumper.hitPos.y,
+ this->bodyCollider.info.bumper.hitPos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS);
+ }
+ }
+
+ this->bodyCollider.base.acFlags &= ~AC_HIT;
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&gBigOctoDeathAnim));
+ EnBigokuta_ShootPlayer(this, globalCtx);
+ EnBigokuta_SetupDeathCutscene(this);
+ }
+}
+
+void EnBigokuta_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBigokuta* this = THIS;
+
+ if (!EnBigokuta_IsInWater(this, globalCtx)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ if (globalCtx->gameplayFrames % 7 == 0) {
+ EnBigokuta_SpawnRipple(this, globalCtx);
+ }
+
+ EnBigokuta_CheckOneHitKill(this, globalCtx);
+ this->actionFunc(this, globalCtx);
+
+ if ((this->bodyCollider.base.acFlags & AC_ON)) {
+ this->shellCollider.dim.pos.x = Math_SinS(this->actor.shape.rot.y) * -20.0f + this->actor.world.pos.x;
+ this->shellCollider.dim.pos.y = this->actor.world.pos.y;
+ this->shellCollider.dim.pos.z = Math_CosS(this->actor.shape.rot.y) * -20.0f + this->actor.world.pos.z;
+
+ this->bodyCollider.dim.pos.x = this->shellCollider.dim.pos.x;
+ this->bodyCollider.dim.pos.y = this->shellCollider.dim.pos.y;
+ this->bodyCollider.dim.pos.z = this->shellCollider.dim.pos.z;
+
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->bodyCollider.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->shellCollider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->shellCollider.base);
+ Actor_SetFocus(&this->actor, 82.5f);
+ }
+
+ if (this->drawEffectAlpha > 0.0f) {
+ if (this->drawEffect != BIGOCTO_DRAWEFFECT_ICE) {
+ Math_StepToF(&this->drawEffectAlpha, 0.0f, 0.05f);
+ this->drawEffectScale = (this->drawEffectAlpha + 1.0f) * 0.6f;
+ this->drawEffectScale = CLAMP_MAX(this->drawEffectScale, 1.2f);
+ } else if (!Math_StepToF(&this->drawEffectSteamScale, 1.2f, 0.030000001f)) {
+ func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
+ }
+ }
+}
+
+s32 EnBigokuta_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx, Gfx** gfx) {
+ if (limbIndex == BIGOKUTA_LIMB_HEAD) {
+ EnBigokuta* this = THIS;
+ s32 envColor;
+ s16 rotX;
+ f32 lastFrame;
+
+ if (this->actionFunc == EnBigokuta_PlayDeathEffects) {
+ lastFrame = Animation_GetLastFrame(&gBigOctoDeathAnim);
+ envColor = ((255.0f / lastFrame) * (lastFrame - this->skelAnime.curFrame));
+ } else {
+ envColor = 255;
+ }
+ gDPPipeSync((*gfx)++);
+ gDPSetEnvColor((*gfx)++, envColor, envColor, envColor, envColor);
+
+ if (this->actionFunc == EnBigokuta_SuckInPlayer) {
+ rotX = (s16)(this->timer * 6144.0f * (1 / 9.0f));
+ rot->x -= rotX;
+ } else if (this->actionFunc == EnBigokuta_HoldPlayer) {
+ if (this->timer == 1) {
+ rotX = 0;
+ } else if (this->timer == 0) {
+ rotX = -0xC00;
+ } else if (this->timer > 0) {
+ rotX = 0x1800;
+ } else {
+ rotX = ((this->timer + 0x18) * 0.041666668f * -6144.0f);
+ }
+ rot->x -= rotX;
+ }
+ } else if (limbIndex == BIGOKUTA_LIMB_SNOUT_CENTER) {
+ EnBigokuta* this = THIS;
+
+ if (this->actionFunc == EnBigokuta_PlayDeathEffects) {
+ if (this->timer < 5) {
+ Matrix_Scale(1.0f, 1.0f, (this->timer * 0.2f * 0.25f) + 1.0f, MTXMODE_APPLY);
+ } else if (this->timer < 8) {
+ f32 time = (this->timer - 5) * (1 / 12.0f);
+
+ Matrix_Scale(1.0f + time, 1.0f + time, 1.25f - time, MTXMODE_APPLY);
+ } else {
+ Matrix_Scale(1.25f - ((this->timer - 8) * 0.125f), 1.25f - ((this->timer - 8) * 0.125f), 1.0f,
+ MTXMODE_APPLY);
+ }
+ } else if (this->actionFunc == EnBigokuta_SuckInPlayer) {
+ f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f;
+
+ Matrix_Scale(((this->timer * (2 / 90.0f)) * (0.5f + sin)) + 1.0f,
+ ((this->timer * (2 / 90.0f)) * (0.5f - sin)) + 1.0f, 1.0f - ((this->timer * 0.3f) / 9.0f),
+ MTXMODE_APPLY);
+ } else if (this->actionFunc == EnBigokuta_HoldPlayer && this->timer != 1) {
+ if (this->timer == 0) {
+ Matrix_Scale(0.9f, 0.9f, 1.15f, MTXMODE_APPLY);
+ } else if (this->timer > 0) {
+ f32 sin = sin_rad(this->timer * (M_PI / 3.0f)) * 0.5f;
+
+ Matrix_Scale(((0.5f + sin) * 0.2f) + 1.0f, ((0.5f - sin) * 0.2f) + 1.0f, 0.7f, MTXMODE_APPLY);
+ } else {
+ Matrix_Scale(1.0f - ((this->timer + 0x18) * 0.2f * 0.041666668f),
+ 1.0f - ((this->timer + 0x18) * 0.2f * 0.041666668f),
+ ((this->timer + 0x18) * 0.3f * 0.041666668f) + 1.0f, MTXMODE_APPLY);
+ }
+ }
+ }
+ return false;
+}
+
+void EnBigokuta_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ static s8 D_80AC45BC[] = {
+ -1, -1, -1, 0, -1, 1, -1, 2, -1, 3, 8, 4, -1, 5, -1, -1, -1, -1, 6, 7,
+ };
+ static Vec3f D_80AC45D0[] = {
+ { 0.0f, 2000.0f, 1000.0f }, { 0.0f, 2000.0f, -2000.0f }, { 1700.0f, 700.0f, -600.0f },
+ { -1700.0f, 700.0f, -600.0f }, { 0.0f, 500.0f, -2500.0f },
+ };
+ EnBigokuta* this = THIS;
+ s32 i;
+ s8 limbPosIndex = D_80AC45BC[limbIndex];
+
+ if (limbPosIndex != -1) {
+ if (limbPosIndex < 6) {
+ Matrix_GetStateTranslationAndScaledX(800.0f, &this->limbPos[limbPosIndex]);
+ } else if (limbPosIndex < 8) {
+ Matrix_GetStateTranslation(&this->limbPos[limbPosIndex]);
+ } else {
+ for (i = 0; i < ARRAY_COUNT(D_80AC45D0); i++) {
+ Matrix_MultiplyVector3fByState(&D_80AC45D0[i], &this->limbPos[limbPosIndex + i]);
+ }
+ }
+ }
+}
+
+void EnBigokuta_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBigokuta* this = THIS;
+ Gfx* gfx;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ if ((this->actionFunc != EnBigokuta_PlayDeathEffects) || (this->timer != 0)) {
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ gfx = POLY_OPA_DISP;
+ gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]);
+ gDPSetEnvColor(&gfx[1], 255, 255, 255, 255);
+ POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnBigokuta_OverrideLimbDraw,
+ EnBigokuta_PostLimbDraw, &this->actor, &gfx[2]);
+ } else {
+ Scene_SetRenderModeXlu(globalCtx, 1, 2);
+ gfx = POLY_XLU_DISP;
+ gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]);
+ gDPSetEnvColor(&gfx[1], 0, 0, 0, (this->actor.scale.y * 7727.273f));
+ POLY_XLU_DISP =
+ SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, EnBigokuta_PostLimbDraw, &this->actor, &gfx[2]);
+ }
+
+ func_800BE680(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawEffectScale,
+ this->drawEffectSteamScale, this->drawEffectAlpha, this->drawEffect);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
index 40b23d63cc..ac0cb01581 100644
--- a/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
+++ b/src/overlays/actors/ovl_En_Bigokuta/z_en_bigokuta.h
@@ -6,12 +6,53 @@
struct EnBigokuta;
typedef void (*EnBigokutaActionFunc)(struct EnBigokuta*, GlobalContext*);
+typedef void (*EnBigokutaUnkFunc)(GlobalContext*, struct EnBigokuta*);
+
+typedef enum {
+ /* 00 */ BIGOKUTA_LIMB_NONE,
+ /* 01 */ BIGOKUTA_LIMB_BODY,
+ /* 02 */ BIGOKUTA_LIMB_ARM_BASE_RIGHT_FRONT,
+ /* 03 */ BIGOKUTA_LIMB_ARM_END_RIGHT_FRONT,
+ /* 04 */ BIGOKUTA_LIMB_ARM_BASE_LEFT_FRONT,
+ /* 05 */ BIGOKUTA_LIMB_ARM_END_LEFT_FRONT,
+ /* 06 */ BIGOKUTA_LIMB_ARM_BASE_RIGHT_BACK,
+ /* 07 */ BIGOKUTA_LIMB_ARM_END_RIGHT_BACK,
+ /* 08 */ BIGOKUTA_LIMB_ARM_BASE_LEFT_BACK,
+ /* 09 */ BIGOKUTA_LIMB_ARM_END_LEFT_BACK,
+ /* 10 */ BIGOKUTA_LIMB_HEAD,
+ /* 11 */ BIGOKUTA_LIMB_TENTACLE_BASE_LEFT,
+ /* 12 */ BIGOKUTA_LIMB_TENTACLE_TIP_LEFT,
+ /* 13 */ BIGOKUTA_LIMB_TENTACLE_BASE_RIGHT,
+ /* 14 */ BIGOKUTA_LIMB_TENTACLE_TIP_RIGHT,
+ /* 15 */ BIGOKUTA_LIMB_WEAK_POINT_LEFT,
+ /* 16 */ BIGOKUTA_LIMB_WEAK_POINT_RIGHT,
+ /* 17 */ BIGOKUTA_LIMB_SNOUT_CENTER,
+ /* 18 */ BIGOKUTA_LIMB_SNOUT_RIGHT,
+ /* 19 */ BIGOKUTA_LIMB_SNOUT_LEFT,
+ /* 20 */ BIGOKUTA_LIMB_MAX
+} ObjectBigokutaLimbs;
typedef struct EnBigokuta {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x48];
+ /* 0x0144 */ EnBigokutaUnkFunc unkFunc; // possibly something to do with photographing
+ /* 0x0148 */ SkelAnime skelAnime;
/* 0x018C */ EnBigokutaActionFunc actionFunc;
- /* 0x0190 */ char unk_190[0x268];
+ /* 0x0190 */ u8 drawEffect;
+ /* 0x0192 */ s16 timer;
+ /* 0x0194 */ s16 camId;
+ /* 0x0196 */ s16 cutscene;
+ /* 0x0198 */ Vec3s jointTable[BIGOKUTA_LIMB_MAX];
+ /* 0x0210 */ Vec3s morphTable[BIGOKUTA_LIMB_MAX];
+ /* 0x0288 */ f32 drawEffectAlpha;
+ /* 0x028C */ f32 drawEffectScale;
+ /* 0x0290 */ f32 drawEffectSteamScale; // only affects DRAWEFFECT_ICE
+ /* 0x0294 */ Vec3f playerPos;
+ /* 0x02A0 */ Vec3f playerHoldPos;
+ /* 0x02AC */ Vec3f camAt;
+ /* 0x02B8 */ Vec3f camEye;
+ /* 0x02C4 */ Vec3f limbPos[13];
+ /* 0x0360 */ ColliderCylinder shellCollider;
+ /* 0x03AC */ ColliderCylinder bodyCollider;
} EnBigokuta; // size = 0x3F8
extern const ActorInit En_Bigokuta_InitVars;
diff --git a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
index 7608bed536..2fbd609276 100644
--- a/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
+++ b/src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
@@ -6,7 +6,7 @@
#include "z_en_bigpamet.h"
-#define FLAGS 0x00000435
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_400)
#define THIS ((EnBigpamet*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
index 5b31f76013..4eeeb3894f 100644
--- a/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
+++ b/src/overlays/actors/ovl_En_Bigpo/z_en_bigpo.c
@@ -8,7 +8,7 @@
#include "objects/object_bigpo/object_bigpo.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00001215
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_200 | ACTOR_FLAG_1000)
#define THIS ((EnBigpo*)thisx)
@@ -175,7 +175,7 @@ static Vec3f D_80B65084[] = {
void EnBigpo_Init(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
EnBigpoFireEffect* firesPtr;
s32 i;
@@ -228,20 +228,19 @@ void EnBigpo_Init(Actor* thisx, GlobalContext* globalCtx2) {
}
}
-void EnBigpo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
- GlobalContext* globalCtx2;
+void EnBigpo_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ EnBigpo* this = THIS;
s32 fireCount;
if ((this->actor.params != ENBIGPO_POSSIBLEFIRE) && (this->actor.params != ENBIGPO_CHOSENFIRE) &&
(this->actor.params != ENBIGPO_REVEALEDFIRE) && (this->actor.params != ENBIGPO_UNK5)) {
// if NOT a fire type, *ENBIGPO_REGULAR and ENBIGPO_SUMMONED (combat types only)
if (1) {}
- globalCtx2 = globalCtx;
for (fireCount = 0; fireCount < ARRAY_COUNT(this->fires); fireCount++) {
- LightContext_RemoveLight(globalCtx2, &globalCtx2->lightCtx, this->fires[fireCount].light);
+ LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->fires[fireCount].light);
}
- Collider_DestroyCylinder(globalCtx2, &this->collider);
+ Collider_DestroyCylinder(globalCtx, &this->collider);
}
}
@@ -272,7 +271,7 @@ void EnBigpo_UpdateSpin(EnBigpo* this) {
void EnBigpo_LowerCutsceneSubCamera(EnBigpo* this, GlobalContext* globalContext) {
Camera* subCam;
- if (this->cutsceneSubCamId != SUBCAM_FREE) {
+ if (this->cutsceneSubCamId != CAM_ID_MAIN) {
subCam = Play_GetCamera(globalContext, this->cutsceneSubCamId);
subCam->eye.y -= this->actor.velocity.y;
if (this->actor.velocity.y > 0.0f) {
@@ -284,7 +283,7 @@ void EnBigpo_LowerCutsceneSubCamera(EnBigpo* this, GlobalContext* globalContext)
}
void EnBigpo_InitWellBigpo(EnBigpo* this) {
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->actionFunc = EnBigpo_WellWaitForProximity;
this->fireRadius = 200.0f;
}
@@ -333,7 +332,7 @@ void EnBigpo_SpawnCutsceneStage1(EnBigpo* this, GlobalContext* globalCtx) {
this->actor.scale.y = 0.015f;
this->actor.scale.z = 0.0f;
- if (this->cutsceneSubCamId != SUBCAM_FREE) {
+ if (this->cutsceneSubCamId != CAM_ID_MAIN) {
Vec3f subCamEye;
subCamEye.x = ((this->actor.world.pos.x - this->fires[0].pos.x) * 1.8f) + this->actor.world.pos.x;
@@ -461,8 +460,8 @@ void EnBigpo_SpawnCutsceneStage8(EnBigpo* this, GlobalContext* globalCtx) {
this->idleTimer--;
if (this->idleTimer == 0) {
subCam = Play_GetCamera(globalCtx, this->cutsceneSubCamId);
- Play_CameraSetAtEye(globalCtx, MAIN_CAM, &subCam->at, &subCam->eye);
- this->cutsceneSubCamId = SUBCAM_FREE;
+ Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &subCam->at, &subCam->eye);
+ this->cutsceneSubCamId = CAM_ID_MAIN;
if (this->actor.params == ENBIGPO_SUMMONED) {
dampe = SubS_FindActor(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_TK);
if (dampe != NULL) {
@@ -484,7 +483,7 @@ void EnBigpo_SetupWarpOut(EnBigpo* this) {
this->collider.base.ocFlags1 &= ~OC1_ON;
this->rotVelocity = 0x2000;
this->idleTimer = 32;
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->actor.speedXZ = 0.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DISAPPEAR);
this->actionFunc = EnBigpo_WarpingOut;
@@ -545,7 +544,7 @@ void EnBigpo_SetupIdleFlying(EnBigpo* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->collider.base.acFlags |= AC_ON;
this->collider.base.ocFlags1 |= OC1_ON;
- this->actor.flags |= 0x1; // targetable ON
+ this->actor.flags |= ACTOR_FLAG_1; // targetable ON
this->actionFunc = EnBigpo_IdleFlying;
}
@@ -684,25 +683,25 @@ void EnBigpo_SetupDeath(EnBigpo* this) {
void EnBigpo_BurnAwayDeath(EnBigpo* this, GlobalContext* globalCtx) {
Vec3f tempVec;
f32 unkTemp2; // dont really know what these unktemps are doing
- s16 cam;
+ s16 camYaw;
s16 unkTemp;
s16 modifiedTimer;
this->idleTimer++;
if (this->idleTimer < 8) {
- cam = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x4800;
+ camYaw = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800;
if (this->idleTimer < 5) {
unkTemp = (this->idleTimer << 0xC) - 0x4000;
// 1.4.0...1 is NOT 1.4, the rodata demands it
tempVec.y = (((Math_SinS(unkTemp) * 23.0f) + 40.0f) * 1.4000001f) + this->actor.world.pos.y;
unkTemp2 = Math_CosS(unkTemp) * 32.2f;
- tempVec.x = (Math_SinS(cam) * unkTemp2) + this->actor.world.pos.x;
- tempVec.z = (Math_CosS(cam) * unkTemp2) + this->actor.world.pos.z;
+ tempVec.x = (Math_SinS(camYaw) * unkTemp2) + this->actor.world.pos.x;
+ tempVec.z = (Math_CosS(camYaw) * unkTemp2) + this->actor.world.pos.z;
} else {
tempVec.y = this->actor.world.pos.y + ((40.0f + (15.0f * (this->idleTimer - 5))) * 1.4000001f);
- tempVec.x = (Math_SinS(cam) * 32.2f) + this->actor.world.pos.x;
- tempVec.z = (Math_CosS(cam) * 32.2f) + this->actor.world.pos.z;
+ tempVec.x = (Math_SinS(camYaw) * 32.2f) + this->actor.world.pos.x;
+ tempVec.z = (Math_CosS(camYaw) * 32.2f) + this->actor.world.pos.z;
}
// not sure what we're turning this into, but its based on the timer
@@ -746,7 +745,7 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, GlobalContext* globalCtx) {
this->actor.velocity.y = 0.0f;
this->actor.world.pos.y -= 15.0f;
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_MISC);
- this->actor.flags &= ~(0x1 | 0x4); // targetable OFF, enemy music OFF
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4); // targetable OFF, enemy music OFF
this->actor.bgCheckFlags &= ~0x400;
this->actionFunc = EnBigpo_LanternFalling;
}
@@ -814,8 +813,8 @@ void EnBigpo_ScoopSoulAppearing(EnBigpo* this, GlobalContext* globalCtx) {
void EnBigpo_SetupScoopSoulIdle(EnBigpo* this) {
this->savedHeight = this->actor.world.pos.y;
Actor_SetFocus(&this->actor, -10.0f);
- this->idleTimer = 400; // 20 seconds
- this->actor.flags |= 0x1; // targetable ON
+ this->idleTimer = 400; // 20 seconds
+ this->actor.flags |= ACTOR_FLAG_1; // targetable ON
this->actionFunc = EnBigpo_ScoopSoulIdle;
}
@@ -834,7 +833,7 @@ void EnBigpo_ScoopSoulIdle(EnBigpo* this, GlobalContext* globalCtx) {
}
void EnBigpo_SetupScoopSoulLeaving(EnBigpo* this) {
- this->actor.flags &= ~(0x1 | 0x10000); // targetable OFF and unknown OFF
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10000); // targetable OFF and unknown OFF
this->actionFunc = EnBigpo_ScoopSoulFadingAway;
}
@@ -846,7 +845,7 @@ void EnBigpo_ScoopSoulFadingAway(EnBigpo* this, GlobalContext* globalCtx) {
}
void EnBigpo_InitDampeMainPo(EnBigpo* this) {
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->actionFunc = EnBigpo_SelectRandomFireLocations;
}
@@ -892,7 +891,7 @@ void EnBigpo_SelectRandomFireLocations(EnBigpo* this, GlobalContext* globalCtx)
randomFirePo->actor.update = EnBigpo_UpdateFire;
func_800BC154(globalCtx, &globalCtx->actorCtx, &randomFirePo->actor, ACTORCAT_PROP);
randomFirePo->unk20C = fireIndex;
- randomFirePo->actor.flags &= ~0x1; // targetable OFF
+ randomFirePo->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
// make invisible by size: 0
Actor_SetScale(&randomFirePo->actor, 0);
@@ -956,7 +955,7 @@ void EnBigpo_SetupFlameCirclePositions(EnBigpo* this, GlobalContext* globalCtx)
}
// Setup sub camera
- if (this->cutsceneSubCamId != SUBCAM_FREE) {
+ if (this->cutsceneSubCamId != CAM_ID_MAIN) {
subCamEye.x = (Math_SinS(this->actor.yawTowardsPlayer) * 360.0f) + this->actor.world.pos.x;
subCamEye.y = this->actor.world.pos.y + 150.0f;
subCamEye.z = (Math_CosS(this->actor.yawTowardsPlayer) * 360.0f) + this->actor.world.pos.z;
@@ -1125,7 +1124,7 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, GlobalContext* globalCtx) {
}
if (Actor_ApplyDamage(&this->actor) == 0) {
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_DEAD);
Enemy_StartFinishingBlow(globalCtx, &this->actor);
if (this->actor.params == ENBIGPO_SUMMONED) { // dampe type
@@ -1150,11 +1149,11 @@ s32 EnBigpo_ApplyDamage(EnBigpo* this, GlobalContext* globalCtx) {
}
void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
s32 pad;
ColliderCylinder* thisCollider;
- if ((this->actor.flags & 0x2000) == 0x2000) {
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
this->hoverHeightCycleTimer = 0;
this->savedHeight = this->actor.world.pos.y;
}
@@ -1218,24 +1217,25 @@ void EnBigpo_Update(Actor* thisx, GlobalContext* globalCtx) {
* alt update func: the revealed fires under dampe's house
*/
void EnBigpo_UpdateFire(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
- this->actor.shape.rot.y = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
+ EnBigpo* this = THIS;
+
+ this->actor.shape.rot.y = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)));
this->actionFunc(this, globalCtx);
}
-s32 EnBigpo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor,
+s32 EnBigpo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
Gfx** gfx) {
- EnBigpo* this = (EnBigpo*)actor;
+ EnBigpo* this = THIS;
// not fully invisible
if (!(this->mainColor.a != 0 && limbIndex != 7) ||
(this->actionFunc == EnBigpo_BurnAwayDeath && this->idleTimer >= 2)) {
*dList = NULL;
}
- return 0;
+ return false;
}
-void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor, Gfx** gfx) {
- EnBigpo* this = (EnBigpo*)actor;
+void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ EnBigpo* this = THIS;
s8 limbByte;
Vec3f* v1ptr; // todo: figure out better names
Vec3f* v2ptr;
@@ -1290,7 +1290,7 @@ void EnBigpo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
Gfx* dispHead;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -1331,7 +1331,7 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, GlobalContext* globalCtx) {
}
void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
s32 pad;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -1350,7 +1350,7 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.pos.z, this->mainColor.r, this->mainColor.g, this->mainColor.b,
this->mainColor.a * 2);
- Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
+ Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -1364,7 +1364,7 @@ void EnBigpo_DrawScoopSoul(Actor* thisx, GlobalContext* globalCtx) {
* might be able to find an alternative match with the macros, so far no success
*/
void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
f32 magnitude;
f32 magnitude2;
Gfx* dispHead;
@@ -1420,7 +1420,7 @@ void EnBigpo_DrawLantern(Actor* thisx, GlobalContext* globalCtx) {
}
void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
s32 pad[3];
s16 fireRadius;
MtxF* mtfxPtr;
@@ -1430,7 +1430,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
- Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_NEW);
+ Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_NEW);
if (this->actionFunc == EnBigpo_SpawnCutsceneStage6) {
Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
fireRadius = 500;
@@ -1462,7 +1462,7 @@ void EnBigpo_DrawCircleFlames(Actor* thisx, GlobalContext* globalCtx) {
}
void EnBigpo_RevealedFire(Actor* thisx, GlobalContext* globalCtx) {
- EnBigpo* this = (EnBigpo*)thisx;
+ EnBigpo* this = THIS;
EnBigpo* parent = (EnBigpo*)thisx->parent;
s32 pad;
diff --git a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
index d32947951c..f305684ed2 100644
--- a/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
+++ b/src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
@@ -7,8 +7,9 @@
#include "z_en_bigslime.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_bigslime/object_bigslime.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000235
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200)
#define THIS ((EnBigslime*)thisx)
@@ -307,7 +308,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 5, ICHAIN_STOP),
};
-void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) {
+void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx2) {
// gSaveContext.weekEventReg[KEY] = VALUE
// KEY | VALUE
static s32 isFrogReturnedFlags[] = {
@@ -316,8 +317,8 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) {
(33 << 8) | 0x01, // Southern Swamp Frog Returned
(33 << 8) | 0x02, // Laundry Pool Frog Returned
};
+ GlobalContext* globalCtx = globalCtx2;
EnBigslime* this = THIS;
- GlobalContext* globalCtx2 = globalCtx;
s32 i;
Actor_ProcessInitChain(&this->actor, sInitChain);
@@ -341,7 +342,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
if (!(gSaveContext.weekEventReg[isFrogReturnedFlags[this->actor.params - 1] >> 8] &
(u8)isFrogReturnedFlags[this->actor.params - 1])) {
- Actor_Spawn(&globalCtx2->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x,
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_MINIFROG, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.shape.rot.y, 0,
this->actor.params);
}
@@ -354,7 +355,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.home.pos.y = GBT_ROOM_5_MAX_Y - 75.0f;
this->actor.home.pos.z = GBT_ROOM_5_CENTER_Z;
for (i = 0; i < MINISLIME_NUM_SPAWN; i++) {
- this->minislime[i] = (EnMinislime*)Actor_SpawnAsChild(&globalCtx2->actorCtx, &this->actor, globalCtx,
+ this->minislime[i] = (EnMinislime*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx,
ACTOR_EN_MINISLIME, 0.0f, 0.0f, 0.0f, 0, 0, 0, i);
if (this->minislime[i] == NULL) {
for (i = i - 1; i >= 0; i--) {
@@ -370,7 +371,7 @@ void EnBigslime_Init(Actor* thisx, GlobalContext* globalCtx) {
this->bigslimeFrozenTexAnim = Lib_SegmentedToVirtual(&gBigslimeFrozenTexAnim);
this->iceShardTexAnim = Lib_SegmentedToVirtual(&gBigslimeIceShardTexAnim);
this->actor.world.pos.y = GBT_ROOM_5_MIN_Y;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.shape.shadowAlpha = 255;
this->gekkoScale = 0.007f;
this->actor.shape.rot.y = 0;
@@ -762,8 +763,8 @@ void EnBigslime_BreakIntoMinislime(EnBigslime* this, GlobalContext* globalCtx) {
EnBigslime_SetPlayerParams(this, globalCtx);
EnBigslime_EndCutscene(this, globalCtx);
this->actor.colChkInfo.mass = 50;
- this->actor.flags &= ~(0x1 | 0x400);
- this->actor.flags |= 0x200;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_400);
+ this->actor.flags |= ACTOR_FLAG_200;
this->actor.hintId = 95;
this->gekkoRot.x = 0;
this->gekkoRot.y = 0;
@@ -842,10 +843,10 @@ void EnBigslime_UpdateCameraFormingBigslime(EnBigslime* this, GlobalContext* glo
void EnBigslime_EndCutscene(EnBigslime* this, GlobalContext* globalCtx) {
Camera* subCam;
- if (this->subCamId != MAIN_CAM) {
+ if (this->subCamId != CAM_ID_MAIN) {
subCam = Play_GetCamera(globalCtx, this->subCamId);
- Play_CameraSetAtEye(globalCtx, MAIN_CAM, &subCam->at, &subCam->eye);
- this->subCamId = MAIN_CAM;
+ Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &subCam->at, &subCam->eye);
+ this->subCamId = CAM_ID_MAIN;
ActorCutscene_Stop(this->cutscene);
this->cutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
func_800B724C(globalCtx, &this->actor, 6);
@@ -862,7 +863,7 @@ void EnBigslime_Scale(EnBigslime* this, s16 pitch, f32 xzScale, f32 yScale) {
* Set the params used by the floor shockwave when bigslime shatters into minislime
*/
void EnBigslime_InitShockwave(EnBigslime* this, GlobalContext* globalCtx) {
- globalCtx->envCtx.unk_C3 = 3;
+ globalCtx->envCtx.lightSettingOverride = 3;
Math_Vec3f_Copy(&this->frozenPos, &this->actor.world.pos);
this->frozenPos.y = GBT_ROOM_5_MIN_Y;
this->shockwaveAlpha = 235;
@@ -912,7 +913,7 @@ void EnBigslime_GekkoFreeze(EnBigslime* this) {
this->unk_38C = 0.75f;
this->unk_390 = 1.125f;
this->unk_388 = 1.0f;
- this->actor.flags &= ~0x200;
+ this->actor.flags &= ~ACTOR_FLAG_200;
}
void EnBigslime_GekkoThaw(EnBigslime* this, GlobalContext* globalCtx) {
@@ -922,7 +923,7 @@ void EnBigslime_GekkoThaw(EnBigslime* this, GlobalContext* globalCtx) {
this->gekkoCollider.info.elemType = ELEMTYPE_UNK1;
this->unk_388 = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f);
- this->actor.flags |= 0x200;
+ this->actor.flags |= ACTOR_FLAG_200;
}
}
@@ -930,7 +931,7 @@ void EnBigslime_SetupCutsceneStartBattle(EnBigslime* this, GlobalContext* global
Player* player = GET_PLAYER(globalCtx);
Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
- globalCtx->envCtx.unk_C3 = 4;
+ globalCtx->envCtx.lightSettingOverride = 4;
Animation_PlayLoop(&this->skelAnime, &gGekkoLookAroundAnim);
this->bigslimeCollider[0].base.atFlags &= ~AT_ON;
@@ -999,7 +1000,7 @@ void EnBigslime_CallMinislime(EnBigslime* this, GlobalContext* globalCtx) {
if (this->callTimer == 0) {
EnBigslime_EndCutscene(this, globalCtx);
this->formBigslimeTimer = 2;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
EnBigslime_SetupIdleNoticePlayer(this);
}
} else if (this->isAnimUpdate) {
@@ -1007,7 +1008,7 @@ void EnBigslime_CallMinislime(EnBigslime* this, GlobalContext* globalCtx) {
EnBigslime_UpdateCameraIntroCs(this, globalCtx, 25);
func_801A2E54(0x38);
EnBigslime_InitFallMinislime(this);
- globalCtx->envCtx.unk_C3 = 0xFF;
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
this->callTimer = 35;
func_800B7298(globalCtx, &this->actor, 4);
}
@@ -1018,7 +1019,7 @@ void EnBigslime_SetupMoveOnCeiling(EnBigslime* this) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 20.0f;
- if (this->subCamId != MAIN_CAM) {
+ if (this->subCamId != CAM_ID_MAIN) {
this->actor.speedXZ = 0.0f;
this->ceilingMoveTimer = 20;
} else {
@@ -1029,7 +1030,7 @@ void EnBigslime_SetupMoveOnCeiling(EnBigslime* this) {
this->wavySurfaceTimer = 0;
this->bigslimeCollider[0].base.acFlags |= AC_ON;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
- this->actor.flags &= ~0x200;
+ this->actor.flags &= ~ACTOR_FLAG_200;
this->actionFunc = EnBigslime_MoveOnCeiling;
}
@@ -1042,7 +1043,7 @@ void EnBigslime_MoveOnCeiling(EnBigslime* this, GlobalContext* globalCtx) {
EnBigslime_Scale(this, pitch, 0.04f, 0.04f);
EnBigslime_UpdateWavySurface(this);
- if (this->subCamId != MAIN_CAM) {
+ if (this->subCamId != CAM_ID_MAIN) {
if (this->ceilingMoveTimer == 0) {
EnBigslime_EndCutscene(this, globalCtx);
this->ceilingMoveTimer = 320;
@@ -1492,7 +1493,7 @@ void EnBigslime_Rise(EnBigslime* this, GlobalContext* globalCtx) {
}
void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, GlobalContext* globalCtx) {
- Camera* mainCam = Play_GetCamera(globalCtx, MAIN_CAM);
+ Camera* mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN);
s16 yaw;
Play_CameraSetAtEye(globalCtx, this->subCamId, &mainCam->at, &mainCam->eye);
@@ -1500,7 +1501,7 @@ void EnBigslime_SetupCutsceneGrabPlayer(EnBigslime* this, GlobalContext* globalC
this->wavySurfaceTimer = 0;
this->bigslimeCollider[0].base.atFlags &= ~AT_ON;
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
- yaw = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) - this->actor.world.rot.y;
+ yaw = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - this->actor.world.rot.y;
if (yaw > 0x4000) {
this->subCamYawGrabPlayer = -0x2000;
@@ -1987,7 +1988,7 @@ void EnBigslime_Melt(EnBigslime* this, GlobalContext* globalCtx) {
if (this->meltCounter == 100) {
EnBigslime_SetTargetVtxFromPreFrozen(this);
} else if (this->meltCounter == 50) {
- globalCtx->envCtx.unk_C3 = 0xFF;
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
}
}
@@ -2038,7 +2039,7 @@ void EnBigslime_JumpGekko(EnBigslime* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
this->gekkoCollider.base.acFlags |= AC_ON;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->jumpTimer--;
@@ -2175,8 +2176,8 @@ void EnBigslime_SetupDamageGekko(EnBigslime* this, s32 isNotFrozen) {
}
EnBigslime_GekkoSfxOutsideBigslime(this, NA_SE_EN_FROG_DAMAGE);
- if ((this->actor.flags & 0x2000) == 0x2000) {
- this->actor.flags &= ~0x2000;
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
+ this->actor.flags &= ~ACTOR_FLAG_2000;
}
this->actionFunc = EnBigslime_DamageGekko;
@@ -2349,7 +2350,7 @@ void EnBigslime_SetupCutsceneDefeat(EnBigslime* this, GlobalContext* globalCtx)
this->minislime[i]->actor.params = MINISLIME_DEFEAT_IDLE;
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
EnBigslime_GekkoThaw(this, globalCtx);
this->actionFunc = EnBigslime_CutsceneDefeat;
}
@@ -2422,7 +2423,7 @@ void EnBigslime_SetupFrogSpawn(EnBigslime* this, GlobalContext* globalCtx) {
Vec3f* worldPos;
Vec3f dustPos;
Vec3f hahenVel;
- s16 yaw = func_800DFCDC(GET_ACTIVE_CAM(globalCtx));
+ s16 yaw = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
s16 yawReverse = yaw + 0x8000;
s32 i;
@@ -2581,7 +2582,7 @@ void EnBigslime_ApplyDamageEffectBigslime(EnBigslime* this, GlobalContext* globa
if (this->actor.colChkInfo.damageEffect == BIGSLIME_DMGEFF_ICE) {
EnMinislime* minislime;
- globalCtx->envCtx.unk_C3 = 2;
+ globalCtx->envCtx.lightSettingOverride = 2;
EnBigslime_SetPlayerParams(this, globalCtx);
this->rotation = 0;
EnBigslime_SetupFreeze(this);
@@ -2771,8 +2772,8 @@ void EnBigslime_UpdateBigslime(Actor* thisx, GlobalContext* globalCtx) {
Vec3f vtxMax;
Vec3f vtxMin;
- if (globalCtx->envCtx.unk_C3 == 3) {
- globalCtx->envCtx.unk_C3 = 0xFF;
+ if (globalCtx->envCtx.lightSettingOverride == 3) {
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
}
func_8019F540(1);
@@ -2816,8 +2817,8 @@ void EnBigslime_UpdateGekko(Actor* thisx, GlobalContext* globalCtx) {
Player* player;
s32 pad;
- if (globalCtx->envCtx.unk_C3 == 3) {
- globalCtx->envCtx.unk_C3 = 0xFF;
+ if (globalCtx->envCtx.lightSettingOverride == 3) {
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
}
func_8019F540(0);
@@ -2905,9 +2906,9 @@ void EnBigslime_SetSysMatrix(Vec3f* pos, GlobalContext* globalCtx, Gfx* shadowDL
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx) {
+void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx2) {
EnMinislime* minislime;
- GlobalContext* globalCtx2 = globalCtx;
+ GlobalContext* globalCtx = globalCtx2;
s32 pad;
s32 currIndex;
s32 i;
@@ -2933,8 +2934,8 @@ void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
for (i = 0; i < MINISLIME_NUM_SPAWN; i++) {
minislime = this->minislime[indices[i]];
- lights = LightContext_NewLights(&globalCtx2->lightCtx, globalCtx->state.gfxCtx);
- Lights_BindAll(lights, globalCtx2->lightCtx.listHead, &minislime->actor.world.pos, globalCtx);
+ lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx);
+ Lights_BindAll(lights, globalCtx->lightCtx.listHead, &minislime->actor.world.pos, globalCtx);
Lights_Draw(lights, globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
func_800B8118(&minislime->actor, globalCtx, 0);
@@ -2945,7 +2946,7 @@ void EnBigslime_DrawMinislime(EnBigslime* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, &gMinislimeNormalDL);
if (minislime->frozenAlpha > 0) {
- Matrix_InsertTranslation(0.0f, (0.1f - minislime->frozenScale) * -4000.0f, 0.0f, 1);
+ Matrix_InsertTranslation(0.0f, (0.1f - minislime->frozenScale) * -4000.0f, 0.0f, MTXMODE_APPLY);
Matrix_Scale(0.1f, minislime->frozenScale, 0.1f, MTXMODE_APPLY);
AnimatedMat_Draw(globalCtx, this->minislimeFrozenTexAnim);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, minislime->frozenAlpha);
@@ -3099,7 +3100,7 @@ void EnBigslime_DrawGekko(Actor* thisx, GlobalContext* globalCtx) {
func_800AE5A0(globalCtx);
}
- EnBigslime_SetSysMatrix(&gekkoPos, globalCtx, D_04076BC0, this->gekkoScale * (550.0f / 7.0f),
+ EnBigslime_SetSysMatrix(&gekkoPos, globalCtx, gCircleShadowDL, this->gekkoScale * (550.0f / 7.0f),
this->gekkoScale * (550.0f / 7.0f), 0.0f, 0, 255.0f);
if (this->minislimeState != MINISLIME_INACTIVE_STATE) {
diff --git a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c
index d1c876b6cc..53bdc09953 100644
--- a/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c
+++ b/src/overlays/actors/ovl_En_Bji_01/z_en_bji_01.c
@@ -5,8 +5,9 @@
*/
#include "z_en_bji_01.h"
+#include "objects/object_bji/object_bji.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBji01*)thisx)
@@ -26,17 +27,9 @@ void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx);
void func_809CD70C(EnBji01* this, GlobalContext* globalCtx);
void func_809CD77C(EnBji01* this, GlobalContext* globalCtx);
-s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg);
-void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg);
-
-extern AnimationHeader D_06000FDC;
-extern AnimationHeader D_06005B58;
-extern AnimationHeader D_06000AB0;
-extern AnimationHeader D_0600066C;
-extern void* D_060049F0[];
-extern void* D_06004E70[];
-extern void* D_06005270[];
-extern FlexSkeletonHeader D_0600578C;
+s32 EnBji01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx);
+void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
const ActorInit En_Bji_01_InitVars = {
ACTOR_EN_BJI_01,
@@ -71,11 +64,11 @@ static ColliderCylinderInit sCylinderInit = {
};
/* Animations struct */
-static struct_80B8E1A8 D_809CDC7C[] = {
- { &D_06000FDC, 1.0f, 0, 0.0f }, /* Looking through telescope */
- { &D_06005B58, 1.0f, 0, 10.0f }, /* Breathing? Unused? */
- { &D_06000AB0, 1.0f, 0, 0.0f }, /* Talking */
- { &D_0600066C, 1.0f, 2, -5.0f }, /* Scratching chin? */
+static AnimationSpeedInfo D_809CDC7C[] = {
+ { &object_bji_Anim_000FDC, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Looking through telescope */
+ { &object_bji_Anim_005B58, 1.0f, ANIMMODE_LOOP, 10.0f }, /* Breathing? Unused? */
+ { &object_bji_Anim_000AB0, 1.0f, ANIMMODE_LOOP, 0.0f }, /* Talking */
+ { &object_bji_Anim_00066C, 1.0f, ANIMMODE_ONCE, -5.0f }, /* Scratching chin? */
};
void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) {
@@ -91,7 +84,7 @@ void func_809CCDE0(EnBji01* this, GlobalContext* globalCtx) {
}
void func_809CCE98(EnBji01* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 0, &this->animationIndex);
this->actor.textId = 0;
this->actionFunc = func_809CCEE8;
}
@@ -100,13 +93,13 @@ void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x444);
if (this->actor.params == ENBJI01_PARAMS_DEFAULT) {
if ((this->actor.xzDistToPlayer <= 60.0f) && (this->actor.playerHeightRel <= 10.0f)) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
} else {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk11F22 = 0;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
func_809CD028(this, globalCtx);
} else {
@@ -190,7 +183,7 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
tempDay = gSaveContext.day;
tempTimeBeforeMoonCrash =
((-(tempDay % 5 << 0x10) - ((u16)(gSaveContext.time - 0x4000))) + 0x40000);
- if (tempTimeBeforeMoonCrash < 2730.6667f) { /* 1 hr */
+ if (tempTimeBeforeMoonCrash < CLOCK_TIME_F(1, 0)) { /* 1 hr */
this->textId = 0x5E8;
} else {
this->textId = 0x5EB;
@@ -200,7 +193,7 @@ void func_809CD028(EnBji01* this, GlobalContext* globalCtx) {
}
break;
}
- func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
this->actionFunc = EnBji01_DialogueHandler;
}
@@ -210,12 +203,12 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x444);
func_809CCDE0(this, globalCtx);
if (this->actor.shape.rot.y == this->actor.yawTowardsPlayer) {
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
}
break;
case 4:
if (func_80147624(globalCtx) != 0) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
@@ -243,10 +236,10 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
break;
case 5:
if (func_80147624(globalCtx) != 0) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
switch (globalCtx->msgCtx.unk11F04) {
case 0x5DE:
- func_8013E1C8(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 3, &this->animationIndex);
func_80151938(globalCtx, 0x5DF);
break;
case 0x5E4:
@@ -283,7 +276,7 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
case 0x5F7:
case 0x5F8:
func_801477B4(globalCtx);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
func_809CCE98(this, globalCtx);
break;
@@ -292,12 +285,12 @@ void EnBji01_DialogueHandler(EnBji01* this, GlobalContext* globalCtx) {
break;
case 6:
this->actor.params = ENBJI01_PARAMS_FINISHED_CONVERSATION;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_809CCE98(this, globalCtx);
break;
}
if ((this->animationIndex == 3) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
}
}
@@ -315,7 +308,7 @@ void EnBji01_DoNothing(EnBji01* this, GlobalContext* globalCtx) {
}
void func_809CD6C0(EnBji01* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_809CDC7C, 2, &this->animationIndex);
this->actionFunc = func_809CD70C;
}
@@ -338,8 +331,8 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
EnBji01* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600578C, &D_06000FDC, this->jointTable, this->morphTable,
- BJI_LIMB_MAX);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bji_Skel_00578C, &object_bji_Anim_000FDC, this->jointTable,
+ this->morphTable, BJI_LIMB_MAX);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
@@ -348,8 +341,7 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
this->animationIndex = -1;
Actor_SetScale(&this->actor, 0.01f);
- func_8013E3B8(&this->actor, this->cutscenes,
- ARRAY_COUNT(this->cutscenes)); /* initializes all elements of cutscenes to -1 */
+ SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
this->moonsTear = (ObjMoonStone*)SubS_FindActor(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
switch (gSaveContext.entranceIndex) {
@@ -359,7 +351,7 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
func_809CCE98(this, globalCtx);
break;
case 0x4C20: /* Observatory from Termina Field telescope */
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_801A5BD0(0);
Audio_QueueSeqCmd(0xE0000100);
this->actor.params = ENBJI01_PARAMS_LOOKED_THROUGH_TELESCOPE;
@@ -441,7 +433,7 @@ void EnBji01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
void EnBji01_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static void* sEyeTextures[] = { D_060049F0, D_06004E70, D_06005270 };
+ static TexturePtr sEyeTextures[] = { object_bji_Tex_0049F0, object_bji_Tex_004E70, object_bji_Tex_005270 };
EnBji01* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c
index f4814fac24..dedb09d4ce 100644
--- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c
+++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c
@@ -6,7 +6,7 @@
#include "z_en_bjt.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBjt*)thisx)
diff --git a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c
index e070bea5e9..5d827f4dad 100644
--- a/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c
+++ b/src/overlays/actors/ovl_En_Boj_01/z_en_boj_01.c
@@ -6,7 +6,7 @@
#include "z_en_boj_01.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBoj01*)thisx)
diff --git a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c
index 9899a15e0d..8e26fa09c2 100644
--- a/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c
+++ b/src/overlays/actors/ovl_En_Boj_02/z_en_boj_02.c
@@ -6,7 +6,7 @@
#include "z_en_boj_02.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBoj02*)thisx)
diff --git a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c
index 019f805389..4f9325e9d4 100644
--- a/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c
+++ b/src/overlays/actors/ovl_En_Boj_03/z_en_boj_03.c
@@ -6,7 +6,7 @@
#include "z_en_boj_03.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBoj03*)thisx)
diff --git a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c
index 9952f706d2..09eed96c75 100644
--- a/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c
+++ b/src/overlays/actors/ovl_En_Boj_04/z_en_boj_04.c
@@ -6,7 +6,7 @@
#include "z_en_boj_04.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBoj04*)thisx)
diff --git a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c
index a3a9dcff8e..d6ccba7349 100644
--- a/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c
+++ b/src/overlays/actors/ovl_En_Boj_05/z_en_boj_05.c
@@ -6,7 +6,7 @@
#include "z_en_boj_05.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBoj05*)thisx)
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 d135e2b359..57a88bcef5 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
@@ -5,8 +5,9 @@
*/
#include "z_en_bom.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnBom*)thisx)
@@ -17,8 +18,19 @@ void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80871058(EnBom* this, GlobalContext* globalCtx);
void func_808714D4(EnBom* this, GlobalContext* globalCtx);
+void func_80872648(GlobalContext* globalCtx, Vec3f* arg1);
+void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 arg4);
+void func_80872BC0(GlobalContext* globalCtx, s32 arg1);
+
+typedef struct {
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ Vec3f unk_0C;
+ /* 0x18 */ s16 unk_18;
+ /* 0x1A */ s16 unk_1A;
+} EnBomStruct; // size = 0x1C
+
+static EnBomStruct D_80874650[16];
-#if 0
const ActorInit En_Bom_InitVars = {
ACTOR_EN_BOM,
ACTORCAT_EXPLOSIVES,
@@ -31,73 +43,762 @@ const ActorInit En_Bom_InitVars = {
(ActorFunc)EnBom_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80872DC8 = {
- { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK2, { 0x00000000, 0x00, 0x00 }, { 0x00013828, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static f32 enBomScales[] = { 0.01f, 0.03f };
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT0,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK2,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00013828, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 6, 11, 14, { 0, 0, 0 } },
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_80872DF4[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit1[1] = {
{
- { ELEMTYPE_UNK0, { 0x00000008, 0x00, 0x02 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000008, 0x00, 0x02 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NONE,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ 0, { { 0, 0, 0 }, 0 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80872E18 = {
- { COLTYPE_HIT0, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, },
- 1, D_80872DF4, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit1 = {
+ {
+ COLTYPE_HIT0,
+ AT_ON | AT_TYPE_ALL,
+ AC_NONE,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit1,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_80872E28[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit2[1] = {
{
- { ELEMTYPE_UNK0, { 0x80000008, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x80000008, 0x00, 0x04 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NONE,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ 0, { { 0, 0, 0 }, 0 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80872E4C = {
- { COLTYPE_HIT0, AT_ON | AT_TYPE_ALL, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, },
- 1, D_80872E28, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit2 = {
+ {
+ COLTYPE_HIT0,
+ AT_ON | AT_TYPE_ALL,
+ AC_NONE,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit2,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80872E5C[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F(scale, 0, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_STOP),
};
-#endif
+void EnBom_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnBom* this = THIS;
+ s32 params;
-extern ColliderCylinderInit D_80872DC8;
-extern ColliderJntSphElementInit D_80872DF4[1];
-extern ColliderJntSphInit D_80872E18;
-extern ColliderJntSphElementInit D_80872E28[1];
-extern ColliderJntSphInit D_80872E4C;
-extern InitChainEntry D_80872E5C[];
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 700.0f, ActorShadow_DrawCircle, 16.0f);
+ this->actor.colChkInfo.mass = 200;
+ this->actor.colChkInfo.cylRadius = 5;
+ this->actor.colChkInfo.cylHeight = 10;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Init.s")
+ this->flashSpeedScale = 7;
+ this->isPowderKeg = ENBOM_GETX_1(&this->actor);
+ if (this->isPowderKeg) {
+ globalCtx->actorCtx.unk5 |= 1;
+ this->timer = gSaveContext.powderKegTimer;
+ } else {
+ this->timer = 70;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Destroy.s")
+ Collider_InitCylinder(globalCtx, &this->collider1);
+ Collider_InitJntSph(globalCtx, &this->collider2);
+ Collider_SetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80871058.s")
+ if (!this->isPowderKeg) {
+ Collider_SetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit1, &this->collider3);
+ this->collider1.dim.radius = 6;
+ this->collider1.dim.height = 11;
+ } else {
+ Collider_SetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit2, &this->collider3);
+ this->collider1.dim.radius = 20;
+ this->collider1.dim.height = 36;
+ func_80872648(globalCtx, &this->actor.world.pos);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808714D4.s")
+ this->collider3.info.toucher.damage += ENBOM_GETZ_FF00(thisx);
+ this->actor.shape.rot.z &= 0xFF;
+ if (ENBOM_GETZ_80(&this->actor)) {
+ this->actor.shape.rot.z |= 0xFF00;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808715B8.s")
+ this->collider2.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
+ this->collider2.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
+ this->collider2.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Update.s")
+ this->actor.flags |= ACTOR_FLAG_100000;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/EnBom_Draw.s")
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actionFunc = func_808714D4;
+ this->actor.room = -1;
+ Actor_SetScale(&this->actor, enBomScales[this->isPowderKeg]);
+ } else {
+ this->actionFunc = func_80871058;
+ gSaveContext.powderKegTimer = 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80872648.s")
+void EnBom_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnBom* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_808726DC.s")
+ Collider_DestroyJntSph(globalCtx, &this->collider2);
+ Collider_DestroyCylinder(globalCtx, &this->collider1);
+ if (this->isPowderKeg) {
+ globalCtx->actorCtx.unk5 &= ~1;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom/func_80872BC0.s")
+void func_80871058(EnBom* this, GlobalContext* globalCtx) {
+ static Vec3f D_80872E68[] = {
+ { 2.0f, -6.0f, -0.3f },
+ { 1.5f, -5.0f, -0.6f },
+ { 0.2f, -6.0f, -0.1f },
+ };
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actionFunc = func_808714D4;
+ this->actor.room = -1;
+ return;
+ }
+
+ if ((this->actor.velocity.y > 0.0f) && (this->actor.bgCheckFlags & 0x10)) {
+ this->actor.velocity.y = -this->actor.velocity.y;
+ }
+
+ if ((this->actor.speedXZ != 0.0f) && (this->actor.bgCheckFlags & 8)) {
+ s16 yDiff = BINANG_SUB(this->actor.wallYaw, this->actor.world.rot.y);
+
+ if (ABS_ALT(yDiff) > 0x4000) {
+ this->actor.world.rot.y =
+ BINANG_SUB(this->actor.wallYaw - this->actor.world.rot.y + this->actor.wallYaw, 0x8000);
+ }
+
+ Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_PUT_DOWN_WOODBOX : NA_SE_EV_BOMB_BOUND);
+ Actor_MoveWithGravity(&this->actor);
+ this->actor.speedXZ *= 0.7f;
+ this->actor.bgCheckFlags &= ~8;
+ }
+
+ if (!(this->actor.bgCheckFlags & 1)) {
+ Math_StepToF(&this->actor.speedXZ, 0.0f, 0.08f);
+ } else {
+ Vec3f* sp58;
+ u32 sp54 = func_800C99D4(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
+ Vec3f sp48;
+ s16 sp46;
+ f32 sp40;
+ f32 sp3C;
+ f32 sp38;
+
+ sp58 = &D_80872E68[this->isPowderKeg];
+
+ if (sp54 == 5) {
+ sp58 = &D_80872E68[2];
+ }
+
+ if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) {
+ s16 sp36;
+
+ Math_ApproachF(&this->actor.shape.yOffset, 0.0f, 0.1f, 50.0f);
+ sp36 = this->actor.shape.shadowAlpha;
+ Math_ApproachS(&sp36, 0, 1, 20);
+ this->actor.shape.shadowAlpha = sp36;
+ } else {
+ Math_ApproachF(&this->actor.shape.yOffset, 700.0f, 1.0f, 700.0f);
+ }
+
+ sp40 = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
+ sp3C = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
+ func_800B75A0(this->actor.floorPoly, &sp48, &sp46);
+
+ sp40 += 3.0f * sp48.x;
+ sp3C += 3.0f * sp48.z;
+ sp38 = sqrtf(SQ(sp40) + SQ(sp3C));
+
+ if ((sp38 < this->actor.speedXZ) ||
+ (SurfaceType_GetSlope(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) == 1)) {
+ if (sp38 > 16.0f) {
+ this->actor.speedXZ = 16.0f;
+ } else {
+ this->actor.speedXZ = sp38;
+ }
+ this->actor.world.rot.y = Math_FAtan2F(sp3C, sp40);
+ }
+
+ if (!Math_StepToF(&this->actor.speedXZ, 0.0f, sp58->x)) {
+ s16 temp = this->actor.world.rot.y;
+ s32 pad;
+
+ if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->actor.shape.rot.y)) > 0x4000) {
+ temp = BINANG_ROT180(temp);
+ }
+ Math_ScaledStepToS(&this->actor.shape.rot.y, temp, this->actor.speedXZ * 100.0f);
+ this->unk_1FA += (s16)(this->actor.speedXZ * 800.0f);
+ }
+
+ if (this->actor.bgCheckFlags & 2) {
+ Actor_PlaySfxAtPos(&this->actor, this->isPowderKeg ? NA_SE_EV_TRE_BOX_BOUND : NA_SE_EV_BOMB_BOUND);
+ if (this->actor.velocity.y < sp58->y) {
+ if ((sp54 == 4) || (sp54 == 14) || (sp54 == 15)) {
+ this->actor.velocity.y = 0.0f;
+ } else {
+ this->actor.velocity.y = this->actor.velocity.y * sp58->z;
+ }
+ this->actor.bgCheckFlags &= ~1;
+ }
+ } else if (this->timer >= 4) {
+ Actor_LiftActor(&this->actor, globalCtx);
+ }
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+}
+
+void func_808714D4(EnBom* this, GlobalContext* globalCtx) {
+ if (Actor_HasNoParent(&this->actor, globalCtx)) {
+ this->actionFunc = func_80871058;
+ this->actor.room = globalCtx->roomCtx.currRoom.num;
+ this->actor.flags &= ~ACTOR_FLAG_100000;
+ this->actor.bgCheckFlags &= ~1;
+ Math_Vec3s_ToVec3f(&this->actor.prevPos, &this->actor.home.rot);
+ if (this->isPowderKeg) {
+ gSaveContext.powderKegTimer = 0;
+ }
+ func_80871058(this, globalCtx);
+ } else {
+ Math_Vec3f_ToVec3s(&this->actor.home.rot, &this->actor.parent->world.pos);
+ if (this->isPowderKeg) {
+ gSaveContext.powderKegTimer = this->timer;
+ }
+ }
+ Math_ScaledStepToS(&this->unk_1FA, 0, 2000);
+}
+
+void func_808715B8(EnBom* this, GlobalContext* globalCtx) {
+ static s16 D_80872E8C[] = { 100, 200 };
+ static Color_RGBA8 D_80872E90 = { 185, 140, 70, 255 };
+ static Color_RGBA8 D_80872E94 = { 255, 255, 255, 255 };
+ s32 i;
+ s32 temp_s0;
+ f32 temp_f20;
+ s32 pad;
+ f32 spCC;
+ Vec3f spC0;
+ Vec3f spB4;
+ CollisionPoly* spB0;
+ s32 spAC;
+ Vec3f spA0;
+ Vec3f sp94;
+ Vec3f sp88;
+ Color_RGBA8 sp84;
+ Color_RGBA8 sp80;
+
+ if (this->collider2.elements->dim.modelSphere.radius == 0) {
+ this->actor.flags |= ACTOR_FLAG_20;
+ func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150);
+ }
+
+ this->collider2.elements->dim.worldSphere.radius = D_80872E8C[this->isPowderKeg];
+ if (this->timer == 7) {
+ this->collider2.base.atFlags &= ~OC1_TYPE_1;
+ }
+
+ if (this->actor.params == ENBOM_1) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ }
+
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[0] != 0) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] -= 25;
+ }
+
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[1] != 0) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] -= 25;
+ }
+
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[2] != 0) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] -= 25;
+ }
+
+ if (globalCtx->envCtx.lightSettings.ambientColor[0] != 0) {
+ globalCtx->envCtx.lightSettings.ambientColor[0] -= 25;
+ }
+
+ if (globalCtx->envCtx.lightSettings.ambientColor[1] != 0) {
+ globalCtx->envCtx.lightSettings.ambientColor[1] -= 25;
+ }
+
+ if (globalCtx->envCtx.lightSettings.ambientColor[2] != 0) {
+ globalCtx->envCtx.lightSettings.ambientColor[2] -= 25;
+ }
+
+ if (this->timer == 0) {
+ func_80123590(globalCtx, &this->actor);
+ Actor_MarkForDeath(&this->actor);
+ }
+
+ if ((this->timer & 1) == 0) {
+ spCC = Rand_ZeroFloat(M_PI);
+
+ for (i = 0; i < 15; i++) {
+ Matrix_InsertYRotation_f(((2.0f * (i * M_PI)) / 15.0f) + spCC, MTXMODE_NEW);
+ Matrix_GetStateTranslationAndScaledZ((10 - this->timer) * 300.0f * 0.1f, &spC0);
+ spB4.x = this->actor.world.pos.x + spC0.x;
+ spB4.y = this->actor.world.pos.y + 500.0f;
+ spB4.z = this->actor.world.pos.z + spC0.z;
+ if (BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &spB0, &spAC, &spB4) != BGCHECK_Y_MIN) {
+ temp_s0 = func_800C99D4(&globalCtx->colCtx, spB0, spAC);
+ temp_f20 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &spB0, &spB4);
+
+ if ((temp_s0 == 4) || (temp_s0 == 15) || (temp_s0 == 14)) {
+ if (temp_s0 == 4) {
+ sp84 = D_80872E90;
+ sp80 = D_80872E90;
+ } else {
+ sp84 = D_80872E94;
+ sp80 = D_80872E94;
+ }
+ Matrix_GetStateTranslationAndScaledZ(5.0f, &sp94);
+ sp88.x = sp88.z = 0.0f;
+ sp94.y = 2.0f;
+ sp88.y = 0.2f;
+
+ spA0.x = spB4.x;
+ spA0.y = temp_f20;
+ spA0.z = spB4.z;
+
+ temp_f20 = Rand_ZeroFloat(250.0f);
+ func_800B0F18(globalCtx, &spA0, &sp94, &sp88, &sp84, &sp80, temp_f20 + 950.0f, 10,
+ Rand_ZeroFloat(5.0f) + 14.0f);
+ }
+ }
+ }
+ }
+}
+
+static s16 D_80872E98[] = { 3, 5 };
+static s16 D_80872E9C[] = { 10, 15 };
+
+void EnBom_Update(Actor* thisx, GlobalContext* globalCtx) {
+ Vec3f spA4 = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp98 = { 0.0f, 0.1f, 0.0f };
+ Vec3f sp8C = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp80;
+ Vec3f sp74 = { 0.0f, 0.6f, 0.0f };
+ Color_RGBA8 sp70 = { 255, 255, 255, 255 };
+ EnBom* this = THIS;
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (player->stateFlags1 & 2) {
+ return;
+ }
+
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_GIANT) {
+ Actor_MarkForDeath(thisx);
+ return;
+ }
+
+ if (this->unk_1FC != 0) {
+ this->unk_1FC--;
+ Math_ApproachZeroF(&thisx->speedXZ, 1.0f, 1.0f);
+ Actor_MoveWithGravity(thisx);
+ Actor_UpdateBgCheckInfo(globalCtx, thisx, 35.0f, 10.0f, 36.0f, 4);
+ if (this->unk_1FC == 0) {
+ if (this->isPowderKeg) {
+ gSaveContext.powderKegTimer = 0;
+ }
+ Actor_MarkForDeath(thisx);
+ }
+ } else {
+ thisx->gravity = -1.2f;
+ if (this->timer != 0) {
+ if (!this->isPowderKeg || (func_808715B8 == this->actionFunc) || !func_801690CC(globalCtx)) {
+ this->timer--;
+ }
+ }
+
+ if ((!this->isPowderKeg && (this->timer == 67)) || (this->isPowderKeg && (this->timer <= 2400))) {
+ Actor_PlaySfxAtPos(thisx, NA_SE_PL_TAKE_OUT_SHIELD);
+ Actor_SetScale(thisx, enBomScales[this->isPowderKeg]);
+ }
+
+ if ((thisx->xzDistToPlayer >= 20.0f) || (fabsf(thisx->playerHeightRel) >= 80.0f)) {
+ this->unk_1F8 = 1;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ Actor_UpdateBgCheckInfo(globalCtx, thisx, 35.0f, 10.0f, 36.0f, 0x1F);
+ if (thisx->params == ENBOM_0) {
+ static Vec3us D_80872ED4[] = {
+ { 40, 20, 100 },
+ { 300, 60, 600 },
+ };
+ Vec3us* sp60 = &D_80872ED4[this->isPowderKeg];
+
+ sp74.y = 0.2f;
+ Math_Vec3f_Copy(&sp80, &thisx->home.pos);
+ if ((globalCtx->gameplayFrames % 2) == 0) {
+ EffectSsGSpk_SpawnFuse(globalCtx, thisx, &sp80, &spA4, &sp8C);
+ }
+ if (this->isPowderKeg) {
+ func_801A0810(&thisx->projectedPos, NA_SE_IT_BIG_BOMB_IGNIT - SFX_FLAG,
+ (this->flashSpeedScale == 7) ? 0
+ : (this->flashSpeedScale == 3) ? 1
+ : 2);
+ } else {
+ Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_IGNIT - SFX_FLAG);
+ }
+
+ sp80.y += 3.0f;
+ func_800B0DE0(globalCtx, &sp80, &spA4, &sp74, &sp70, &sp70, 50, 5);
+
+ if ((this->collider1.base.acFlags & AC_HIT) ||
+ ((this->collider1.base.ocFlags1 & OC1_HIT) && ((this->collider1.base.oc->category == ACTORCAT_ENEMY) ||
+ (this->collider1.base.oc->category == ACTORCAT_BOSS)))) {
+ this->timer = 0;
+ thisx->shape.rot.z = 0;
+ } else if ((this->timer > 100) && (func_80123F48(globalCtx, &thisx->world.pos, 30.0f, 50.0f))) {
+ this->timer = 100;
+ }
+
+ sp74.y = 0.2f;
+ sp80 = thisx->world.pos;
+ sp80.y += 10.0f;
+
+ if ((this->timer == sp60->x) || (this->timer == sp60->y) || (this->timer == 3)) {
+ thisx->shape.rot.z = 0;
+ this->flashSpeedScale >>= 1;
+ }
+
+ if ((this->timer < sp60->z) && (this->timer & (this->flashSpeedScale + 1))) {
+ Math_ApproachF(&this->unk_1F4, 140.0f, 1.0f, 140.0f / this->flashSpeedScale);
+ } else {
+ Math_ApproachZeroF(&this->unk_1F4, 1.0f, 140.0f / this->flashSpeedScale);
+ }
+
+ if (this->timer < 3) {
+ Actor_SetScale(thisx, thisx->scale.x + 0.002f);
+ }
+
+ if (this->timer == 0) {
+ sp80 = thisx->world.pos;
+ sp80.y += 10.0f;
+ if (Actor_HasParent(thisx, globalCtx)) {
+ sp80.y += 30.0f;
+ }
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, sp80.x, sp80.y - 10.0f, sp80.z, 0, 0,
+ 0, this->isPowderKeg);
+ func_800BC848(thisx, globalCtx, D_80872E98[this->isPowderKeg], D_80872E9C[this->isPowderKeg]);
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] = globalCtx->envCtx.lightSettings.diffuseColor1[1] =
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] = 250;
+ globalCtx->envCtx.lightSettings.ambientColor[0] = globalCtx->envCtx.lightSettings.ambientColor[1] =
+ globalCtx->envCtx.lightSettings.ambientColor[2] = 250;
+ func_800DFD04(&globalCtx->mainCamera, 2, 11, 8);
+ thisx->params = ENBOM_1;
+ this->timer = 10;
+ thisx->flags |= (0x100000 | 0x20);
+ this->actionFunc = func_808715B8;
+ if (this->isPowderKeg) {
+ gSaveContext.powderKegTimer = 0;
+ Actor_PlaySfxAtPos(thisx, NA_SE_IT_BIG_BOMB_EXPLOSION);
+ } else {
+ Actor_PlaySfxAtPos(thisx, NA_SE_IT_BOMB_EXPLOSION);
+ }
+ }
+ }
+
+ Actor_SetFocus(thisx, 20.0f);
+
+ if (thisx->params <= ENBOM_0) {
+ Collider_UpdateCylinder(thisx, &this->collider1);
+ if (!Actor_HasParent(thisx, globalCtx) && (this->unk_1F8 != 0)) {
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ }
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ }
+
+ if ((enBomScales[this->isPowderKeg] <= thisx->scale.x) && (thisx->params != ENBOM_1)) {
+ if (thisx->depthInWater >= 20.0f) {
+ Vec3f sp54;
+
+ sp54.x = thisx->world.pos.x;
+ sp54.y = thisx->world.pos.y + thisx->depthInWater;
+ sp54.z = thisx->world.pos.z;
+ EffectSsGRipple_Spawn(globalCtx, &sp54, 70, 500, 0);
+ EffectSsGRipple_Spawn(globalCtx, &sp54, 70, 500, 10);
+ sp54.y += 10.0f;
+ EffectSsGSplash_Spawn(globalCtx, &sp54, NULL, NULL, 1, 500);
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, sp54.x, sp54.y, sp54.z, 0, 0, 1, 200);
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &thisx->world.pos, 30, NA_SE_IT_BOMB_UNEXPLOSION);
+ this->unk_1F4 = 0.0f;
+ thisx->velocity.y = (KREG(83) * 0.1f) + -2.0f;
+ thisx->gravity = (KREG(84) * 0.1f) + -0.5f;
+ this->unk_1FC = KREG(81) + 10;
+ } else if (thisx->bgCheckFlags & 0x40) {
+ thisx->bgCheckFlags &= ~0x40;
+ Actor_PlaySfxAtPos(thisx, NA_SE_EV_BOMB_DROP_WATER);
+ }
+ }
+ }
+}
+
+static Vec3f D_80872EE0 = { 0.0f, 800.0f, 0.0f };
+static Vec3f D_80872EEC = { -750.0f, 0.0f, 0.0f };
+static Vec3f D_80872EF8 = { -800.0f, 0.0f, 0.0f };
+static Vec3f D_80872F04 = { 0.0f, 0.0f, 0.0f };
+
+#include "overlays/ovl_En_Bom/ovl_En_Bom.c"
+
+void EnBom_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnBom* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->actor.params == ENBOM_0) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ Collider_UpdateSpheres(0, &this->collider2);
+
+ if (!this->isPowderKeg) {
+ func_800B8050(&this->actor, globalCtx, 0);
+ Matrix_MultiplyVector3fByState(&D_80872EE0, &this->actor.home.pos);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_015FA0);
+
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+ Matrix_InsertXRotation_s(0x4000, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetEnvColor(POLY_OPA_DISP++, (s8)this->unk_1F4, 0, 40, 255);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, (s8)this->unk_1F4, 0, 40, 255);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_015DB0);
+ } else {
+ Vec3f sp58;
+ Vec3f sp4C;
+
+ if (this->unk_1FA != 0) {
+ s16 sp4A = this->actor.world.rot.y - this->actor.shape.rot.y;
+ f32 sp44 = (1000.0f / Math_CosS(ABS_ALT((s16)(this->unk_1FA % 10922)) - 0x1555)) + -1000.0f;
+
+ Matrix_RotateY(sp4A, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, sp44, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_1FA, MTXMODE_APPLY);
+ Matrix_RotateY(-sp4A, MTXMODE_APPLY);
+ }
+
+ Matrix_MultiplyVector3fByState(&D_80872EEC, &this->actor.home.pos);
+ Matrix_MultiplyVector3fByState(&D_80872EF8, &sp58);
+ Matrix_MultiplyVector3fByState(&D_80872F04, &sp4C);
+
+ gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873CA0);
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_808742F8);
+
+ func_808726DC(globalCtx, &this->actor.home.pos, &sp58, &sp4C, this->timer);
+ func_80872BC0(globalCtx, this->timer);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80872648(GlobalContext* globalCtx, Vec3f* arg1) {
+ EnBomStruct* ptr = &D_80874650[0];
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(D_80874650); i++, ptr++) {
+ Math_Vec3f_Copy(&ptr->unk_00, arg1);
+ Math_Vec3f_Copy(&ptr->unk_0C, &gZeroVec3f);
+ ptr->unk_18 = 0;
+ ptr->unk_1A = 0x4000;
+ }
+}
+
+void func_808726DC(GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, s32 arg4) {
+ s32 i;
+ f32 temp_f20;
+ Vec3f spCC;
+ Vec3f spC0;
+ EnBomStruct* ptr = &D_80874650[0];
+ EnBomStruct* ptr2 = &D_80874650[1];
+ f32 temp_f26 = Math_Vec3f_DistXYZ(arg3, arg1);
+ s32 spB0;
+ f32 temp_f2;
+ f32 sqrt;
+
+ Math_Vec3f_Copy(&ptr->unk_00, arg1);
+ Math_Vec3f_Diff(arg2, arg1, &spCC);
+
+ ptr->unk_18 = Math_FAtan2F(spCC.z, spCC.x);
+ sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z));
+ ptr->unk_1A = Math_FAtan2F(sqrt, spCC.y);
+
+ spB0 = (arg4 / 240) + 1;
+
+ for (i = 0; i < spB0; i++, ptr++, ptr2++, arg4 -= 240) {
+ f32 phi_f22;
+ CollisionPoly* spA0;
+ s32 sp9C;
+ Vec3f sp90;
+
+ if (arg4 >= 240) {
+ phi_f22 = 8.0f;
+ } else {
+ phi_f22 = (arg4 % 240) * (1.0f / 240) * 8.0f;
+ }
+
+ Math_Vec3f_Sum(&ptr2->unk_00, &ptr2->unk_0C, &ptr2->unk_00);
+ temp_f20 = Math_Vec3f_DistXYZAndStoreDiff(arg3, &ptr2->unk_00, &spCC);
+ if (temp_f20 < temp_f26) {
+ if (temp_f20 == 0.0f) {
+ spCC.x = 0.0f;
+ spCC.y = temp_f26;
+ spCC.z = 0.0f;
+ } else {
+ temp_f20 = temp_f26 / temp_f20;
+ spCC.x *= temp_f20;
+ spCC.y *= temp_f20;
+ spCC.z *= temp_f20;
+ }
+ Math_Vec3f_Sum(arg3, &spCC, &ptr2->unk_00);
+ }
+
+ if (Math_Vec3f_DistXYZAndStoreDiff(&ptr->unk_00, &ptr2->unk_00, &spCC) == 0.0f) {
+ spCC.x = 0.0f;
+ spCC.y = phi_f22;
+ spCC.z = 0.0f;
+ }
+
+ ptr2->unk_18 = Math_FAtan2F(spCC.z, spCC.x);
+ sqrt = sqrtf(SQ(spCC.x) + SQ(spCC.z));
+ ptr2->unk_1A = Math_FAtan2F(sqrt, spCC.y);
+
+ ptr2->unk_18 = (s16)CLAMP(BINANG_SUB(ptr2->unk_18, ptr->unk_18), -8000, 8000) + ptr->unk_18;
+ ptr2->unk_1A = (s16)CLAMP(BINANG_SUB(ptr2->unk_1A, ptr->unk_1A), -8000, 8000) + ptr->unk_1A;
+
+ temp_f20 = Math_CosS(ptr2->unk_1A) * phi_f22;
+ spC0.x = Math_SinS(ptr2->unk_18) * temp_f20;
+ spC0.z = Math_CosS(ptr2->unk_18) * temp_f20;
+ spC0.y = Math_SinS(ptr2->unk_1A) * phi_f22;
+
+ Math_Vec3f_Sum(&ptr->unk_00, &spC0, &ptr2->unk_00);
+ Math_Vec3f_Copy(&sp90, &ptr2->unk_00);
+
+ sp90.y += 50.0f;
+
+ temp_f2 = BgCheck_EntityRaycastFloor3(&globalCtx->colCtx, &spA0, &sp9C, &sp90) - ptr2->unk_00.y;
+ if (temp_f2 >= 0.0f) {
+ spC0.y += temp_f2;
+ if (phi_f22 < spC0.y) {
+ spC0.y = phi_f22;
+ temp_f2 = 0.0f;
+ } else {
+ temp_f2 = sqrtf(SQ(phi_f22) - SQ(spC0.y));
+ }
+
+ if (temp_f20 == 0.0f) {
+ spC0.x = temp_f2;
+ } else {
+ temp_f2 /= temp_f20;
+ spC0.x *= temp_f2;
+ spC0.z *= temp_f2;
+ }
+
+ Math_Vec3f_Sum(&ptr->unk_00, &spC0, &ptr2->unk_00);
+ Math_Vec3f_Copy(&ptr2->unk_0C, &gZeroVec3f);
+ }
+
+ ptr2->unk_0C.y += -1.0f;
+ if (ptr2->unk_0C.y < -10.0f) {
+ ptr2->unk_0C.y = -10.0f;
+ }
+ }
+
+ Math_Vec3f_Copy(arg1, &ptr->unk_00);
+}
+
+void func_80872BC0(GlobalContext* globalCtx, s32 arg1) {
+ s32 temp_s5;
+ s32 i;
+ EnBomStruct* ptr = &D_80874650[0];
+ EnBomStruct* ptr2;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_InsertTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
+ Matrix_InsertRotation(ptr->unk_1A, ptr->unk_18, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80872F98);
+
+ temp_s5 = (arg1 / 240) + 1;
+ ptr2 = &D_80874650[1];
+
+ for (i = 1; i < temp_s5; i++, ptr2++) {
+ Matrix_InsertTranslation(ptr2->unk_00.x, ptr2->unk_00.y, ptr2->unk_00.z, MTXMODE_NEW);
+ Matrix_InsertRotation(ptr2->unk_1A, ptr2->unk_18, 0, MTXMODE_APPLY);
+ Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ if ((i % 2) == 0) {
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873020);
+ } else {
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Bom_DL_80873040);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
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 60cf065b35..a0555ab248 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h
@@ -7,13 +7,27 @@ struct EnBom;
typedef void (*EnBomActionFunc)(struct EnBom*, GlobalContext*);
+#define ENBOM_GETX_1(thisx) ((thisx)->shape.rot.x & 1)
+#define ENBOM_GETZ_80(thisx) ((thisx)->shape.rot.z & 0x80)
+#define ENBOM_GETZ_FF00(thisx) (((thisx)->shape.rot.z & 0xFF00) >> 8)
+
+enum {
+ /* 0 */ ENBOM_0,
+ /* 1 */ ENBOM_1,
+};
+
typedef struct EnBom {
/* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0xAC];
+ /* 0x144 */ ColliderCylinder collider1;
+ /* 0x190 */ ColliderJntSph collider2;
+ /* 0x1B0 */ ColliderJntSphElement collider3;
/* 0x1F0 */ s16 timer;
- /* 0x1F2 */ char unk_1F2[0x7];
- /* 0x1F9 */ u8 unk_1F9;
- /* 0x1FA */ char unk_1FA[0x6];
+ /* 0x1F2 */ s16 flashSpeedScale;
+ /* 0x1F4 */ f32 unk_1F4;
+ /* 0x1F8 */ u8 unk_1F8;
+ /* 0x1F9 */ u8 isPowderKeg;
+ /* 0x1FA */ s16 unk_1FA;
+ /* 0x1FC */ u8 unk_1FC;
/* 0x200 */ EnBomActionFunc actionFunc;
} EnBom; // size = 0x204
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 4ec8ae2b60..397f230688 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
@@ -5,8 +5,9 @@
*/
#include "z_en_bom_bowl_man.h"
+#include "objects/object_cs/object_cs.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBomBowlMan*)thisx)
@@ -15,18 +16,27 @@ void EnBomBowlMan_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx);
void EnBomBowlMan_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_809C4BC4(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C4DA4(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C51B4(EnBomBowlMan* this, GlobalContext* globalCtx);
+void func_809C52B4(EnBomBowlMan* this);
void func_809C5310(EnBomBowlMan* this, GlobalContext* globalCtx);
+void func_809C53A4(EnBomBowlMan* this);
void func_809C5408(EnBomBowlMan* this, GlobalContext* globalCtx);
+void func_809C5524(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C5598(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C5738(EnBomBowlMan* this, GlobalContext* globalCtx);
+void func_809C59A4(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C59F0(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C5AA4(EnBomBowlMan* this, GlobalContext* globalCtx);
void func_809C5B1C(EnBomBowlMan* this, GlobalContext* globalCtx);
+void func_809C5BA0(EnBomBowlMan* this);
void func_809C5BF4(EnBomBowlMan* this, GlobalContext* globalCtx);
-#if 0
+s32 D_809C6100 = 0;
+
+s32 D_809C6104 = 0;
+
const ActorInit En_Bom_Bowl_Man_InitVars = {
ACTOR_EN_BOM_BOWL_MAN,
ACTORCAT_NPC,
@@ -39,56 +49,644 @@ const ActorInit En_Bom_Bowl_Man_InitVars = {
(ActorFunc)EnBomBowlMan_Draw,
};
-#endif
+static AnimationHeader* sAnimations[] = {
+ &object_cs_Anim_0064B8, &object_cs_Anim_00FAF4, &object_cs_Anim_0057C8, &object_cs_Anim_0053F4,
+ &object_cs_Anim_002044, &object_cs_Anim_01007C, &object_cs_Anim_00349C, &object_cs_Anim_004960,
+ &object_cs_Anim_005128, &object_cs_Anim_004C1C, &object_cs_Anim_001A1C, &object_cs_Anim_003EE4,
+ &object_cs_Anim_00478C, &object_cs_Anim_00433C, &object_cs_Anim_0060E8, &object_cs_Anim_001708,
+ &object_cs_Anim_005DC4, &object_cs_Anim_0026B0, &object_cs_Anim_0036B0, &object_cs_Anim_0031C4,
+};
-extern UNK_TYPE D_060064B8;
+u8 D_809C6178[] = {
+ 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/EnBomBowlMan_Init.s")
+u16 D_809C618C[] = { 0x710, 0x711, 0x715, 0x716, 0x717, 0x718 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/EnBomBowlMan_Destroy.s")
+u16 D_809C6198[] = { 0x74F, 0x750, 0x751, 0x752 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C493C.s")
+Vec3f D_809C61A0[] = {
+ { -730.0f, 200.0f, -2350.0f }, { -690.0f, 200.0f, -2350.0f }, { -650.0f, 200.0f, -2350.0f },
+ { -610.0f, 200.0f, -2350.0f }, { -570.0f, 200.0f, -2350.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C49CC.s")
+void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnBomBowlMan* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C4B50.s")
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
+ this->actor.gravity = -3.0f;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
+ this->morphTable, 21);
+ this->unk_2F6 = ENBOMBOWLMAN_GET_F0(&this->actor);
+ this->unk_2F4 = ENBOMBOWLMAN_GET_F(&this->actor);
+ this->actor.targetMode = 6;
+ Actor_SetScale(&this->actor, 0.01f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C4B6C.s")
+ if (this->unk_2F6 == ENBOMBOWLMAN_F0_0) {
+ if (this->unk_2F4 == 0) {
+ func_809C4BC4(this, globalCtx);
+ } else {
+ this->unk_2F4--;
+ func_809C5BA0(this);
+ }
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C4BC4.s")
+ this->unk_29A = ENBOMBOWLMAN_GET_FF00(&this->actor);
+ this->path = func_8013D648(globalCtx, this->unk_29A, 0x3F);
+ this->unk_2C8 = 80.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C4DA4.s")
+ if ((gSaveContext.entranceIndex == 0xD220) && (gSaveContext.weekEventReg[73] & 0x80) &&
+ !CHECK_QUEST_ITEM(ITEM_BOTTLE)) {
+ this->unk_2D6 = this->actor.cutscene;
+ if (this->unk_2D6 == 0) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ func_809C52B4(this);
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C51B4.s")
+void EnBomBowlMan_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C52B4.s")
+void func_809C493C(EnBomBowlMan* this, s32 arg1, f32 arg2) {
+ this->unk_2F8 = arg1;
+ this->unk_2C4 = Animation_GetLastFrame(sAnimations[arg1]);
+ Animation_Change(&this->skelAnime, sAnimations[this->unk_2F8], arg2, 0.0f, this->unk_2C4, D_809C6178[this->unk_2F8],
+ -4.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5310.s")
+void func_809C49CC(EnBomBowlMan* this) {
+ if ((this->unk_2F8 == 5) &&
+ (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 10.0f) ||
+ Animation_OnFrame(&this->skelAnime, 17.0f) || Animation_OnFrame(&this->skelAnime, 18.0f))) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C53A4.s")
+ if ((this->unk_2F8 == 0xB) &&
+ (Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 8.0f) ||
+ Animation_OnFrame(&this->skelAnime, 12.0f))) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5408.s")
+ if ((this->unk_2F8 == 0x12) &&
+ (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 2.0f) ||
+ Animation_OnFrame(&this->skelAnime, 4.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_WALK);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5524.s")
+ if ((this->unk_2F8 == 0xF) && Animation_OnFrame(&this->skelAnime, 15.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5598.s")
+ if ((this->unk_2F8 == 6) && Animation_OnFrame(&this->skelAnime, 8.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMBERS_LAND);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5738.s")
+void func_809C4B50(EnBomBowlMan* this) {
+ this->unk_2B8 = 0;
+ this->unk_2BC = 0;
+ this->unk_2BA = 0;
+ this->unk_29E = 0;
+ this->unk_290 = 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C59A4.s")
+void func_809C4B6C(EnBomBowlMan* this) {
+ if ((this->unk_29A != ENBOMBOWLMAN_FF00_MINUS1) && (this->path != NULL)) {
+ if (!func_8013D68C(this->path, this->unk_298, &this->unk_2A0)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C59F0.s")
+void func_809C4BC4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 i;
+ Vec3f sp7C;
+ EnBomBowlMan* bomBowlMan;
+ s8 code;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5AA4.s")
+ func_809C4B50(this);
+ func_809C493C(this, 0, 1.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5B1C.s")
+ for (i = 0; i < ARRAY_COUNT(gSaveContext.bomberCode); i++) {
+ Math_Vec3f_Copy(&sp7C, &this->actor.home.pos);
+ code = gSaveContext.bomberCode[i];
+ if (code == 1) {
+ Math_Vec3f_Copy(&this->actor.world.pos, &D_809C61A0[i]);
+ this->unk_2D8[code] = this;
+ } else {
+ Math_Vec3f_Copy(&sp7C, &D_809C61A0[i]);
+ bomBowlMan =
+ (EnBomBowlMan*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_BOM_BOWL_MAN,
+ sp7C.x, sp7C.y, sp7C.z, 0, this->actor.world.rot.y, 0, code);
+ if (bomBowlMan != NULL) {
+ if (i == 2) {
+ this->unk_2D8[0] = bomBowlMan;
+ }
+ this->unk_2D8[code] = bomBowlMan;
+ }
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5BA0.s")
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D0);
+ } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D0)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D0);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5BF4.s")
+ func_809C493C(this, 3, 1.0f);
+ this->unk_2D4 = this->actor.yawTowardsPlayer;
+ this->unk_290 = this->actor.yawTowardsPlayer;
+ gSaveContext.weekEventReg[73] &= (u8)~0x10;
+ gSaveContext.weekEventReg[85] &= (u8)~2;
+ this->unk_29C = 0;
+ this->actionFunc = func_809C4DA4;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/EnBomBowlMan_Update.s")
+void func_809C4DA4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 5000, 0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/func_809C5F44.s")
+ if (this->unk_2B8 == 0) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Bom_Bowl_Man/EnBomBowlMan_Draw.s")
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D0);
+ return;
+ }
+
+ if (!ActorCutscene_GetCanPlayNext(this->unk_2D0)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D0);
+ return;
+ }
+
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D0, &this->actor);
+ this->unk_2B8 = 1;
+ this->unk_2C0 = 0;
+ this->unk_2D4 = this->actor.yawTowardsPlayer;
+ this->unk_290 = this->actor.yawTowardsPlayer;
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ Message_StartTextbox(globalCtx, D_809C618C[0], &this->actor);
+ } else {
+ Message_StartTextbox(globalCtx, D_809C6198[0], &this->actor);
+ }
+ }
+
+ if ((this->unk_2BC == 0) && (Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 pad;
+ s32 sp28 = false;
+
+ func_801477B4(globalCtx);
+
+ switch (this->unk_2C0) {
+ case 0:
+ this->unk_2C0 = 1;
+ D_809C6104 = 1;
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->unk_2D0)),
+ &this->unk_2D8[0]->actor);
+ this->unk_2D4 = 0;
+ this->unk_2BC = 10;
+ func_809C493C(this, 17, 1.0f);
+ break;
+
+ case 1:
+ D_809C6104 = 0;
+ func_809C493C(this, 3, 1.0f);
+ this->unk_2D4 = this->actor.yawTowardsPlayer;
+ this->unk_2C0 = 2;
+ if ((player->transformation == PLAYER_FORM_HUMAN) && CHECK_QUEST_ITEM(ITEM_BOTTLE)) {
+ this->unk_2C0 = 4;
+ }
+ break;
+
+ case 2:
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ this->unk_2B8 = 2;
+ ActorCutscene_Stop(this->unk_2D0);
+ func_809C59A4(this, globalCtx);
+ sp28 = true;
+ } else {
+ this->unk_2C0 = 3;
+ globalCtx->msgCtx.unk11F10 = 0;
+ func_809C493C(this, 1, 1.0f);
+ D_809C6100 = 1;
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D2);
+ } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D2)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D2);
+ }
+ ActorCutscene_Stop(this->unk_2D0);
+ this->actionFunc = func_809C5B1C;
+ sp28 = true;
+ }
+ break;
+
+ case 3:
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ this->unk_2C0 = 4;
+ } else {
+ this->actionFunc = func_809C51B4;
+ return;
+ }
+ break;
+
+ case 4:
+ if (this->unk_2B8 != 2) {
+ ActorCutscene_Stop(this->unk_2D0);
+ }
+ globalCtx->msgCtx.unk11F10 = 0;
+ func_809C493C(this, 1, 1.0f);
+ D_809C6100 = 1;
+ this->actionFunc = func_809C5B1C;
+ sp28 = true;
+ break;
+
+ case 5:
+ func_80151BB4(globalCtx, 0x24);
+ func_80151BB4(globalCtx, 0x25);
+ func_80151BB4(globalCtx, 0);
+ this->actionFunc = func_809C51B4;
+ sp28 = true;
+ break;
+ }
+
+ if (!sp28) {
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ func_80151938(globalCtx, D_809C618C[this->unk_2C0]);
+ } else {
+ func_80151938(globalCtx, D_809C6198[this->unk_2C0]);
+ }
+ }
+ }
+}
+
+void func_809C51B4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((globalCtx->msgCtx.unk120B1 == 0) &&
+ ((globalCtx->msgCtx.msgMode == 0) || (Message_GetState(&globalCtx->msgCtx) == 6))) {
+ globalCtx->nextEntranceIndex = Entrance_CreateIndexFromSpawn(6);
+ gSaveContext.nextCutsceneIndex = 0;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 0x56;
+ gSaveContext.nextTransition = 3;
+ gSaveContext.weekEventReg[75] &= (u8)~0x40;
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ gSaveContext.weekEventReg[84] |= 0x80;
+ gSaveContext.weekEventReg[77] &= (u8)~2;
+ } else {
+ gSaveContext.weekEventReg[73] |= 0x20;
+ gSaveContext.weekEventReg[85] &= (u8)~1;
+ }
+ }
+}
+
+void func_809C52B4(EnBomBowlMan* this) {
+ this->actor.draw = NULL;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.world.pos.x = 1340.0f;
+ this->actor.world.pos.z = -1795.0f;
+ this->unk_29C = 3;
+ this->actionFunc = func_809C5310;
+}
+
+void func_809C5310(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (player->actor.world.pos.x < 1510.0f) {
+ if (player->transformation != PLAYER_FORM_DEKU) {
+ if (this->actor.xzDistToPlayer < this->unk_2C8) {
+ func_800B7298(globalCtx, &this->actor, 7);
+ func_809C53A4(this);
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ }
+}
+
+void func_809C53A4(EnBomBowlMan* this) {
+ this->actor.draw = EnBomBowlMan_Draw;
+ this->actor.world.pos.x = 1360.0f;
+ this->actor.world.pos.z = -1870.0f;
+ func_809C493C(this, 18, 1.0f);
+ this->unk_29C = 3;
+ this->actionFunc = func_809C5408;
+}
+
+void func_809C5408(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ s32 pad[2];
+ Player* player = GET_PLAYER(globalCtx);
+
+ Math_SmoothStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &player->actor.world.pos), 1,
+ 0x1388, 0);
+ Math_SmoothStepToS(&player->actor.shape.rot.y, Math_Vec3f_Yaw(&player->actor.world.pos, &this->actor.world.pos), 1,
+ 0x1388, 0);
+ player->actor.world.rot.y = player->actor.shape.rot.y;
+ Math_ApproachF(&this->actor.world.pos.x, 1350.0f, 0.3f, 2.0f);
+ Math_ApproachF(&this->actor.world.pos.z, -1800.0f, 0.3f, 2.0f);
+ if (sqrtf(SQ(this->actor.world.pos.x - 1350.0f) + SQ(this->actor.world.pos.z + 1800.0f)) < 4.0f) {
+ func_809C5524(this, globalCtx);
+ }
+}
+
+void func_809C5524(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ this->actor.textId = 0x730;
+ if (!(gSaveContext.weekEventReg[85] & 2)) {
+ this->actor.textId = 0x72F;
+ }
+ func_809C493C(this, 3, 1.0f);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
+ this->actionFunc = func_809C5598;
+}
+
+void func_809C5598(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ func_801477B4(globalCtx);
+ if ((this->actor.textId == 0x72F) || (this->actor.textId == 0x730)) {
+ this->actor.textId = 0x731;
+ } else if (this->actor.textId == 0x731) {
+ this->actor.textId = 0x732;
+ } else if (this->actor.textId == 0x732) {
+ this->actor.textId = 0x733;
+ } else if (this->actor.textId == 0x733) {
+ this->actor.textId = 0x734;
+ } else if (this->actor.textId == 0x734) {
+ this->actor.textId = 0x715;
+ } else if (this->actor.textId == 0x715) {
+ func_800B7298(globalCtx, &this->actor, 6);
+ func_809C493C(this, 17, 1.0f);
+ func_809C59A4(this, globalCtx);
+ return;
+ } else if (this->actor.textId == 0x716) {
+ this->actor.textId = 0x735;
+ } else if (this->actor.textId == 0x735) {
+ this->unk_2C2 = 0;
+ func_809C493C(this, 17, 1.0f);
+ func_80151BB4(globalCtx, 0x24);
+ func_80151BB4(globalCtx, 0x25);
+ func_80151BB4(globalCtx, 0);
+ func_800B7298(globalCtx, &this->actor, 7);
+ this->actionFunc = func_809C5738;
+ return;
+ }
+ func_80151938(globalCtx, this->actor.textId);
+ }
+}
+
+void func_809C5738(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ s32 pad[3];
+ s16 yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_2A0);
+
+ if (this->unk_2C2 == 0) {
+ if ((globalCtx->msgCtx.unk120B1 == 0) &&
+ ((globalCtx->msgCtx.msgMode == 0) || (Message_GetState(&globalCtx->msgCtx) == 6))) {
+ this->unk_2C2 = 1;
+ func_809C4B6C(this);
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D6);
+ } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D6);
+ } else {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->actor);
+ this->unk_2C2 = 2;
+ func_809C493C(this, 18, 1.0f);
+ }
+ }
+ } else if (this->unk_2C2 == 1) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D6);
+ } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D6)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D6);
+ } else {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D6, &this->actor);
+ this->unk_2C2 = 2;
+ func_809C493C(this, 18, 1.0f);
+ }
+ } else {
+ Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 2000, 10);
+ Math_ApproachF(&this->actor.world.pos.x, this->unk_2A0.x, 0.5f, 6.0f);
+ Math_ApproachF(&this->actor.world.pos.z, this->unk_2A0.z, 0.5f, 6.0f);
+ if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_2A0.x) + SQ(this->actor.world.pos.z - this->unk_2A0.z)) <
+ 4.0f) &&
+ (this->path != NULL)) {
+ this->unk_298++;
+ if (this->unk_298 >= this->path->count) {
+ gSaveContext.weekEventReg[84] |= 0x80;
+ gSaveContext.weekEventReg[83] &= (u8)~4;
+ ActorCutscene_Stop(this->unk_2D6);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ func_809C4B6C(this);
+ }
+ }
+ }
+}
+
+void func_809C59A4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ Actor_PickUp(&this->actor, globalCtx, GI_50, 300.0f, 300.0f);
+ this->unk_29C = 1;
+ this->actionFunc = func_809C59F0;
+}
+
+void func_809C59F0(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ if (this->unk_2F6 == ENBOMBOWLMAN_F0_0) {
+ this->unk_2C0 = 3;
+ this->actor.textId = D_809C618C[this->unk_2C0];
+ } else {
+ this->actor.textId = 0x716;
+ }
+ func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, -1);
+ this->actionFunc = func_809C5AA4;
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_50, 300.0f, 300.0f);
+ }
+}
+
+void func_809C5AA4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ if (this->unk_2F6 == ENBOMBOWLMAN_F0_0) {
+ this->actionFunc = func_809C4DA4;
+ } else {
+ this->actionFunc = func_809C5598;
+ }
+ } else {
+ func_800B8500(&this->actor, globalCtx, 400.0f, 400.0f, -1);
+ }
+}
+
+void func_809C5B1C(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_2D2);
+ } else if (!ActorCutscene_GetCanPlayNext(this->unk_2D2)) {
+ ActorCutscene_SetIntentToPlay(this->unk_2D2);
+ } else {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D2, &this->actor);
+ func_809C5BA0(this);
+ }
+}
+
+void func_809C5BA0(EnBomBowlMan* this) {
+ if (this->unk_2F4 != 0) {
+ func_809C493C(this, 0, 1.0f);
+ } else {
+ this->unk_2F8 = 0;
+ }
+ this->unk_29C = 2;
+ this->actionFunc = func_809C5BF4;
+}
+
+void func_809C5BF4(EnBomBowlMan* this, GlobalContext* globalCtx) {
+ f32 sp2C = this->skelAnime.curFrame;
+ s32 sp28;
+
+ if ((D_809C6104 != 0) && (this->unk_2F8 != 15)) {
+ func_809C493C(this, 15, 1.0f);
+ }
+
+ if ((this->unk_2F8 == 15) && (this->unk_2C4 <= sp2C)) {
+ func_809C493C(this, 0, 1.0f);
+ }
+
+ if (D_809C6100 != 0) {
+ if ((this->unk_2F8 == 0) && (D_809C6100 == (this->unk_2F4 + 1))) {
+ func_809C493C(this, 11, 1.0f);
+ }
+
+ if ((this->unk_2F8 == 11) && (this->unk_2C4 <= sp2C)) {
+ func_809C493C(this, 12, 1.0f);
+ D_809C6100++;
+ }
+
+ if (this->unk_2F4 == 0) {
+ sp28 = Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->unk_2D2));
+
+ if (D_809C6100 > 5) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ func_801477B4(globalCtx);
+ Camera_SetTargetActor(sp28, &this->unk_2D8[0]->actor);
+ func_809C493C(this, 13, 1.0f);
+ D_809C6100 = 0;
+ if (player->transformation == PLAYER_FORM_HUMAN) {
+ this->unk_2C0 = 5;
+ Message_StartTextbox(globalCtx, D_809C618C[this->unk_2C0], &this->actor);
+ } else {
+ this->unk_2C0 = 3;
+ Message_StartTextbox(globalCtx, D_809C6198[this->unk_2C0], &this->actor);
+ }
+ this->unk_29C = 0;
+ this->actionFunc = func_809C4DA4;
+ } else {
+ s32 idx = D_809C6100 - 1;
+
+ Camera_SetTargetActor(sp28, &this->unk_2D8[1 + idx]->actor);
+ }
+ }
+ }
+}
+
+void EnBomBowlMan_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnBomBowlMan* this = THIS;
+
+ if (this->unk_2BA != 0) {
+ this->unk_2BA--;
+ }
+
+ if (this->unk_2BC != 0) {
+ this->unk_2BC--;
+ }
+
+ SkelAnime_Update(&this->skelAnime);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ func_809C49CC(this);
+ Actor_SetFocus(&this->actor, 20.0f);
+
+ this->actionFunc(this, globalCtx);
+
+ Actor_MoveWithGravity(&this->actor);
+ Math_SmoothStepToS(&this->unk_28A, this->unk_290, 1, 0x1388, 0);
+ Math_SmoothStepToS(&this->unk_288, this->unk_28E, 1, 0x3E8, 0);
+
+ if (this->unk_2F2 == 0) {
+ this->unk_2F0++;
+ if (this->unk_2F0 >= 3) {
+ this->unk_2F0 = 0;
+ this->unk_2F2 = (s32)Rand_ZeroFloat(60.0f) + 20;
+ }
+ }
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
+}
+
+s32 EnBomBowlMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnBomBowlMan* this = THIS;
+
+ if (limbIndex == 15) {
+ *dList = NULL;
+ }
+
+ if (limbIndex == 17) {
+ rot->x += this->unk_28A;
+ }
+
+ if ((limbIndex == 19) && (this->unk_2F6 == ENBOMBOWLMAN_F0_2)) {
+ *dList = NULL;
+ }
+
+ if ((limbIndex == 20) && (this->unk_2F6 == ENBOMBOWLMAN_F0_0)) {
+ *dList = NULL;
+ }
+ return false;
+}
+
+#include "overlays/ovl_En_Bom_Bowl_Man/ovl_En_Bom_Bowl_Man.c"
+
+TexturePtr D_809C6200[] = {
+ gEnBomBowlMan_D_809C61E0, gEnBomBowlMan_D_809C61F0, gEnBomBowlMan_D_809C61F0,
+ gEnBomBowlMan_D_809C61F0, gEnBomBowlMan_D_809C61F0,
+};
+
+TexturePtr D_809C6214[] = {
+ object_cs_Tex_00C520,
+ object_cs_Tex_00CD20,
+ object_cs_Tex_00D520,
+};
+
+TexturePtr D_809C6220[] = {
+ object_cs_Tex_00E620, object_cs_Tex_00EA20, object_cs_Tex_00EE20, object_cs_Tex_00DD20, object_cs_Tex_00F220,
+};
+
+void EnBomBowlMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnBomBowlMan* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_809C6214[this->unk_2F0]));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_809C6220[this->unk_2F4]));
+ gSPSegment(POLY_OPA_DISP++, 0x0A, Lib_SegmentedToVirtual(D_809C6200[this->unk_2F4]));
+
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnBomBowlMan_OverrideLimbDraw, NULL, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h
index ba90b19c9c..21e25b19de 100644
--- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h
+++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h
@@ -7,11 +7,54 @@ struct EnBomBowlMan;
typedef void (*EnBomBowlManActionFunc)(struct EnBomBowlMan*, GlobalContext*);
+#define ENBOMBOWLMAN_GET_F(thisx) ((thisx)->params & 0xF)
+#define ENBOMBOWLMAN_GET_F0(thisx) (((thisx)->params >> 4) & 0xF)
+#define ENBOMBOWLMAN_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
+
+#define ENBOMBOWLMAN_F0_0 0
+#define ENBOMBOWLMAN_F0_2 2
+
+#define ENBOMBOWLMAN_FF00_MINUS1 -1
+
typedef struct EnBomBowlMan {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x140];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[21];
+ /* 0x0206 */ Vec3s morphTable[21];
/* 0x0284 */ EnBomBowlManActionFunc actionFunc;
- /* 0x0288 */ char unk_288[0x74];
+ /* 0x0288 */ s16 unk_288;
+ /* 0x028A */ s16 unk_28A;
+ /* 0x028C */ UNK_TYPE1 unk28C[2];
+ /* 0x028E */ s16 unk_28E;
+ /* 0x0290 */ s16 unk_290;
+ /* 0x0292 */ UNK_TYPE1 unk292[2];
+ /* 0x0294 */ Path* path;
+ /* 0x0298 */ s16 unk_298;
+ /* 0x029A */ s16 unk_29A;
+ /* 0x029C */ s16 unk_29C;
+ /* 0x029E */ s16 unk_29E;
+ /* 0x02A0 */ Vec3f unk_2A0;
+ /* 0x02AC */ UNK_TYPE1 unk2AC[0xC];
+ /* 0x02B8 */ s16 unk_2B8;
+ /* 0x02BA */ s16 unk_2BA;
+ /* 0x02BC */ s16 unk_2BC;
+ /* 0x02BE */ UNK_TYPE1 unk2BE[2];
+ /* 0x02C0 */ s16 unk_2C0;
+ /* 0x02C2 */ s16 unk_2C2;
+ /* 0x02C4 */ f32 unk_2C4;
+ /* 0x02C8 */ f32 unk_2C8;
+ /* 0x02CC */ UNK_TYPE1 unk2CC[4];
+ /* 0x02D0 */ s16 unk_2D0;
+ /* 0x02D2 */ s16 unk_2D2;
+ /* 0x02D4 */ s16 unk_2D4;
+ /* 0x02D6 */ s16 unk_2D6;
+ /* 0x02D8 */ struct EnBomBowlMan* unk_2D8[5];
+ /* 0x02EC */ UNK_TYPE1 unk2EC[0x4];
+ /* 0x02F0 */ s16 unk_2F0;
+ /* 0x02F2 */ s16 unk_2F2;
+ /* 0x02F4 */ s16 unk_2F4;
+ /* 0x02F6 */ s16 unk_2F6;
+ /* 0x02F8 */ s32 unk_2F8;
} EnBomBowlMan; // size = 0x2FC
extern const ActorInit En_Bom_Bowl_Man_InitVars;
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 f02ab4ec69..47c25941d2 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
@@ -6,7 +6,7 @@
#include "z_en_bom_chu.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnBomChu*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c
index 09d0880c66..479df5cd7d 100644
--- a/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c
+++ b/src/overlays/actors/ovl_En_Bombal/z_en_bombal.c
@@ -6,7 +6,7 @@
#include "z_en_bombal.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnBombal*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
index 2ef45e65d4..c20759cb6c 100644
--- a/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
+++ b/src/overlays/actors/ovl_En_Bombers/z_en_bombers.c
@@ -6,7 +6,7 @@
#include "z_en_bombers.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBombers*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c
index 18aa562e7b..bcd76ab9d3 100644
--- a/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c
+++ b/src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c
@@ -6,7 +6,7 @@
#include "z_en_bombers2.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBombers2*)thisx)
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 292469236e..4362997e66 100644
--- a/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c
+++ b/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c
@@ -6,7 +6,7 @@
#include "z_en_bombf.h"
-#define FLAGS 0x00000011
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_10)
#define THIS ((EnBombf*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
index 4664f2b9f8..6bb4827ae2 100644
--- a/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
+++ b/src/overlays/actors/ovl_En_Bomjima/z_en_bomjima.c
@@ -8,7 +8,7 @@
#include "z_en_bomjima.h"
#include "objects/object_cs/object_cs.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnBomjima*)thisx)
@@ -125,7 +125,7 @@ void EnBomjima_Init(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_cs_Skel_00F82C, &object_cs_Anim_0064B8, this->jointTable,
this->morphTable, 21);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
- gSaveContext.weekEventReg[83] &= (u8)~0x4;
+ gSaveContext.weekEventReg[83] &= (u8)~4;
this->actor.targetMode = 0;
this->unk_2E6 = ENBOMJIMA_GET_F0(&this->actor);
this->unk_2E4 = ENBOMJIMA_GET_F(&this->actor);
@@ -469,8 +469,8 @@ void func_80BFF03C(EnBomjima* this, GlobalContext* globalCtx) {
} else {
player->stateFlags1 &= ~0x20;
gSaveContext.weekEventReg[83] &= (u8)~4;
- this->actor.world.rot.y = func_800DFCDC(GET_ACTIVE_CAM(globalCtx));
- this->unk_2DC = func_800DFCDC(GET_ACTIVE_CAM(globalCtx));
+ this->actor.world.rot.y = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
+ this->unk_2DC = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx));
ActorCutscene_StartAndSetUnkLinkFields(this->unk_2D4[0], &this->actor);
func_80BFF120(this);
}
@@ -1101,13 +1101,12 @@ void EnBomjima_Draw(Actor* thisx, GlobalContext* globalCtx) {
gEnBomjima_D_80C00B18, gEnBomjima_D_80C00B18,
};
static TexturePtr D_80C00B3C[] = {
- &object_cs_Tex_00C520,
- &object_cs_Tex_00CD20,
- &object_cs_Tex_00D520,
+ object_cs_Tex_00C520,
+ object_cs_Tex_00CD20,
+ object_cs_Tex_00D520,
};
static TexturePtr D_80C00B48[] = {
- &object_cs_Tex_00E620, &object_cs_Tex_00EA20, &object_cs_Tex_00EE20,
- &object_cs_Tex_00DD20, &object_cs_Tex_00F220,
+ object_cs_Tex_00E620, object_cs_Tex_00EA20, object_cs_Tex_00EE20, object_cs_Tex_00DD20, object_cs_Tex_00F220,
};
EnBomjima* this = THIS;
diff --git a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
index dc776fa59a..26e9291d1d 100644
--- a/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
+++ b/src/overlays/actors/ovl_En_Bomjimb/z_en_bomjimb.c
@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Niw/z_en_niw.h"
#include "objects/object_cs/object_cs.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnBomjimb*)thisx)
@@ -661,7 +661,7 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
func_80C0113C(this, 21, 1.0f);
if ((player->transformation != PLAYER_FORM_DEKU) && (player->transformation != PLAYER_FORM_HUMAN)) {
func_80C0113C(this, 17, 1.0f);
- func_801518B0(globalCtx, 0x72E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x72E, &this->actor);
player->stateFlags1 |= 0x10000000;
player->actor.freezeTimer = 3;
func_80C012E0(this);
@@ -673,7 +673,7 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
if (((player->transformation == PLAYER_FORM_DEKU) && !(gSaveContext.weekEventReg[73] & 0x10)) ||
((player->transformation == PLAYER_FORM_HUMAN) && !(gSaveContext.weekEventReg[85] & 2))) {
func_80C0113C(this, 17, 1.0f);
- func_801518B0(globalCtx, 0x72E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x72E, &this->actor);
player->stateFlags1 |= 0x10000000;
player->actor.freezeTimer = 3;
func_80C012E0(this);
@@ -683,7 +683,7 @@ void func_80C02740(EnBomjimb* this, GlobalContext* globalCtx) {
}
idx = gSaveContext.unk_FE6;
- func_801518B0(globalCtx, D_80C03230[idx], &this->actor);
+ Message_StartTextbox(globalCtx, D_80C03230[idx], &this->actor);
idx = gSaveContext.unk_FE6;
gSaveContext.unk_FE7[idx] = this->unk_2C8 + 1;
gSaveContext.unk_FE6++;
@@ -897,13 +897,12 @@ void EnBomjimb_Draw(Actor* thisx, GlobalContext* globalCtx) {
gEnBomjimb_D_80C03250, gEnBomjimb_D_80C03250,
};
static TexturePtr D_80C03274[] = {
- &object_cs_Tex_00C520,
- &object_cs_Tex_00CD20,
- &object_cs_Tex_00D520,
+ object_cs_Tex_00C520,
+ object_cs_Tex_00CD20,
+ object_cs_Tex_00D520,
};
static TexturePtr D_80C03280[] = {
- &object_cs_Tex_00E620, &object_cs_Tex_00EA20, &object_cs_Tex_00EE20,
- &object_cs_Tex_00DD20, &object_cs_Tex_00F220,
+ object_cs_Tex_00E620, object_cs_Tex_00EA20, object_cs_Tex_00EE20, object_cs_Tex_00DD20, object_cs_Tex_00F220,
};
EnBomjimb* this = THIS;
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 b6115a897d..930b1b597c 100644
--- a/src/overlays/actors/ovl_En_Boom/z_en_boom.c
+++ b/src/overlays/actors/ovl_En_Boom/z_en_boom.c
@@ -6,7 +6,7 @@
#include "z_en_boom.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnBoom*)thisx)
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 0eb142cfe5..311ad9aaa3 100644
--- a/src/overlays/actors/ovl_En_Box/z_en_box.c
+++ b/src/overlays/actors/ovl_En_Box/z_en_box.c
@@ -76,9 +76,9 @@ typedef struct {
f32 data[5];
} EnBox_PlaybackSpeed; // 0x14
-EnBox_PlaybackSpeed sPlaybackSpeed = { { 1.5f, 1.0f, 1.5f, 1.0f, 1.5f } };
+static EnBox_PlaybackSpeed sPlaybackSpeed = { { 1.5f, 1.0f, 1.5f, 1.0f, 1.5f } };
-AnimationHeader* sAnimations[5] = {
+static AnimationHeader* sAnimations[5] = {
&gBoxChestOpenAdultAnim, &gBoxChestOpenGoronAnim, &gBoxChestOpenAdultAnim,
&gBoxChestOpenDekuAnim, &gBoxChestOpenChildAnim,
};
@@ -147,7 +147,7 @@ void func_80867C8C(func_80867BDC_a0* arg0, GlobalContext* globalCtx) {
Matrix_InsertMatrix(&globalCtx->billboardMtxF, 1);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_023210);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
}
Matrix_StatePop();
gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c
index 2e6b31a351..e80004a92a 100644
--- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c
+++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c
@@ -6,7 +6,7 @@
#include "z_en_bsb.h"
-#define FLAGS 0x02000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((EnBsb*)thisx)
diff --git a/src/overlays/actors/ovl_En_Bu/z_en_bu.c b/src/overlays/actors/ovl_En_Bu/z_en_bu.c
index 6dab7f307d..937759ff67 100644
--- a/src/overlays/actors/ovl_En_Bu/z_en_bu.c
+++ b/src/overlays/actors/ovl_En_Bu/z_en_bu.c
@@ -6,7 +6,7 @@
#include "z_en_bu.h"
-#define FLAGS 0x00000001
+#define FLAGS (ACTOR_FLAG_1)
#define THIS ((EnBu*)thisx)
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 e6ff6864ad..0f54995be1 100644
--- a/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
+++ b/src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
@@ -6,7 +6,7 @@
#include "z_en_bubble.h"
-#define FLAGS 0x00000001
+#define FLAGS (ACTOR_FLAG_1)
#define THIS ((EnBubble*)thisx)
diff --git a/src/overlays/actors/ovl_En_Cha/z_en_cha.c b/src/overlays/actors/ovl_En_Cha/z_en_cha.c
index d5a2f0be06..129045a6c7 100644
--- a/src/overlays/actors/ovl_En_Cha/z_en_cha.c
+++ b/src/overlays/actors/ovl_En_Cha/z_en_cha.c
@@ -5,6 +5,7 @@
*/
#include "z_en_cha.h"
+#include "objects/object_cha/object_cha.h"
#define FLAGS 0x00000000
@@ -49,21 +50,18 @@ static ColliderCylinderInit sCylinderInit = {
{ 10, 40, 0, { 0, 0, 0 } },
};
-extern Gfx D_06000710[];
-extern Gfx D_06000958[];
-
void EnCha_Init(Actor* thisx, GlobalContext* globalCtx) {
EnCha* this = THIS;
s32 pad;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Collider_UpdateCylinder(&this->actor, &this->collider);
Actor_SetScale(&this->actor, 0.01f);
this->actor.home.rot.z = 0;
this->actionFunc = EnCha_Idle;
this->actor.home.rot.x = this->actor.home.rot.z;
- gSaveContext.weekEventReg[60] &= 0xFB;
+ gSaveContext.weekEventReg[60] &= (u8)~4;
}
void EnCha_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -87,7 +85,7 @@ void EnCha_Ring(EnCha* this, GlobalContext* globalCtx) {
void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[60] & 4) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DOOR_BELL);
- gSaveContext.weekEventReg[60] &= 0xFB;
+ gSaveContext.weekEventReg[60] &= (u8)~4;
this->actor.home.rot.z = 0x7D0;
}
if (this->collider.base.acFlags & AC_HIT) {
@@ -103,22 +101,22 @@ void EnCha_Idle(EnCha* this, GlobalContext* globalCtx) {
this->actor.home.rot.z *= 0.96f;
}
-void EnCha_Update(Actor* thisx, GlobalContext* globalCtx) {
+void EnCha_Update(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
EnCha* this = THIS;
- GlobalContext* globalCtx2 = globalCtx;
- CollisionCheck_SetOC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
this->actionFunc(this, globalCtx);
- if ((this->actor.shape.rot.z >= -0x1F3F) && (this->actor.shape.rot.z < 0x1F40)) {
- CollisionCheck_SetAC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base);
+ if ((this->actor.shape.rot.z > -0x1F40) && (this->actor.shape.rot.z < 0x1F40)) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
void EnCha_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnCha* this = THIS;
- Gfx_DrawDListOpa(globalCtx, D_06000710);
+ Gfx_DrawDListOpa(globalCtx, object_cha_DL_000710);
Matrix_InsertTranslation(-1094.0f, 4950.0f, 9.0f, MTXMODE_APPLY);
Matrix_InsertXRotation_s(this->actor.home.rot.x, MTXMODE_APPLY);
- Gfx_DrawDListOpa(globalCtx, D_06000958);
+ Gfx_DrawDListOpa(globalCtx, object_cha_DL_000958);
}
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 d323c98d27..cddff71cc7 100644
--- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
+++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c
@@ -5,8 +5,9 @@
*/
#include "z_en_clear_tag.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnClearTag*)thisx)
@@ -81,8 +82,18 @@ static f32 sLightRayMaxScale[] = {
25.0f, 100.0f, 48.0f, 20.0f, 32.0f,
};
-static Gfx* sSplashTex[] = {
- D_040378F0, D_04037DF0, D_040382F0, D_040387F0, D_04038CF0, D_040391F0, D_040396F0, D_04039BF0, NULL, NULL, NULL,
+static TexturePtr sSplashTex[] = {
+ gExplosionSplashTex1,
+ gExplosionSplashTex2,
+ gExplosionSplashTex3,
+ gExplosionSplashTex4,
+ gExplosionSplashTex5,
+ gExplosionSplashTex6,
+ gExplosionSplashTex7,
+ gExplosionSplashTex8,
+ NULL,
+ NULL,
+ NULL,
};
#include "overlays/ovl_En_Clear_Tag/ovl_En_Clear_Tag.c"
@@ -399,7 +410,7 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
Vec3f vel;
Vec3f accel;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (thisx->params >= 0) {
this->activeTimer = 70;
Math_Vec3f_Copy(&pos, &this->actor.world.pos);
@@ -510,7 +521,7 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnClearTag_UpdateCamera(EnClearTag* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- Camera* camera;
+ Camera* mainCam;
s32 pad;
switch (this->cameraState) {
@@ -533,19 +544,19 @@ void EnClearTag_UpdateCamera(EnClearTag* this, GlobalContext* globalCtx) {
}
break;
case 1:
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- this->camId = func_801694DC(globalCtx);
- func_80169590(globalCtx, 0, 1);
- func_80169590(globalCtx, this->camId, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ this->subCamId = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, this->subCamId, 7);
func_800B7298(globalCtx, &this->actor, 4);
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
- this->eye.x = camera->eye.x;
- this->eye.y = camera->eye.y;
- this->eye.z = camera->eye.z;
- this->at.x = camera->at.x;
- this->at.y = camera->at.y;
- this->at.z = camera->at.z;
- func_801518B0(globalCtx, 0xF, NULL);
+ mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN);
+ this->subCamEye.x = mainCam->eye.x;
+ this->subCamEye.y = mainCam->eye.y;
+ this->subCamEye.z = mainCam->eye.z;
+ this->subCamAt.x = mainCam->at.x;
+ this->subCamAt.y = mainCam->at.y;
+ this->subCamAt.z = mainCam->at.z;
+ Message_StartTextbox(globalCtx, 0xF, NULL);
this->cameraState = 2;
func_8019FDC8(&D_801DB4A4, NA_SE_VO_NA_LISTEN, 0x20);
case 2:
@@ -557,22 +568,22 @@ void EnClearTag_UpdateCamera(EnClearTag* this, GlobalContext* globalCtx) {
player->actor.speedXZ = 0.0f;
if (Message_GetState(&globalCtx->msgCtx) == 0) {
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
- camera->eye = this->eye;
- camera->eyeNext = this->eye;
- camera->at = this->at;
- func_80169AFC(globalCtx, this->camId, 0);
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ mainCam = Play_GetCamera(globalCtx, CAM_ID_MAIN);
+ mainCam->eye = this->subCamEye;
+ mainCam->eyeNext = this->subCamEye;
+ mainCam->at = this->subCamAt;
+ func_80169AFC(globalCtx, this->subCamId, 0);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6);
this->cameraState = 0;
- this->camId = 0;
+ this->subCamId = CAM_ID_MAIN;
this->activeTimer = 20;
}
break;
}
- if (this->camId != 0) {
- Play_CameraSetAtEye(globalCtx, this->camId, &this->at, &this->eye);
+ if (this->subCamId != CAM_ID_MAIN) {
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->subCamAt, &this->subCamEye);
}
}
@@ -820,7 +831,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
Matrix_SetCurrentState(&mtxF);
Matrix_Scale(effect->scale, 1.0f, effect->scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_04030100);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_030100);
}
}
}
@@ -986,7 +997,7 @@ void EnClearTag_DrawEffects(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateStateAroundXAxis(effect->rotationX);
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_0403A0F0);
+ gSPDisplayList(POLY_XLU_DISP++, gExplosionSplashDL);
}
}
}
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 453e6c0ac2..61c4a638bd 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
@@ -45,10 +45,10 @@ typedef struct EnClearTag {
/* 0x2E54 */ u8 cameraState;
/* 0x2E56 */ s16 activeTimer; // Actor Marked for Death when timer runs out
/* 0x2E58 */ UNK_TYPE1 unk2E58[0xC];
- /* 0x2E64 */ s16 camId;
+ /* 0x2E64 */ s16 subCamId;
/* 0x2E66 */ Color_RGBA8 flashEnvColor;
- /* 0x2E6C */ Vec3f eye; // Camera eye
- /* 0x2E78 */ Vec3f at; // Camera lookAt
+ /* 0x2E6C */ Vec3f subCamEye;
+ /* 0x2E78 */ Vec3f subCamAt;
} EnClearTag; // size = 0x2E84
extern const ActorInit En_Clear_Tag_InitVars;
diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c
index 698878d718..3d8623e7a0 100644
--- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c
+++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c
@@ -5,8 +5,9 @@
*/
#include "z_en_cne_01.h"
+#include "objects/object_cne/object_cne.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnCne01*)thisx)
@@ -15,12 +16,10 @@ void EnCne01_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnCne01_Update(Actor* thisx, GlobalContext* globalCtx);
void EnCne01_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_809CB520(EnCne01* this, GlobalContext* globalCtx);
-void func_809CB5A0(EnCne01* this, GlobalContext* globalCtx);
-void func_809CB5D8(EnCne01* this, GlobalContext* globalCtx);
-void func_809CB5FC(EnCne01* this, GlobalContext* globalCtx);
+void EnCne01_Walk(EnHy* this, GlobalContext* globalCtx);
+void EnCne01_FaceForward(EnHy* this, GlobalContext* globalCtx);
+void EnCne01_Talk(EnHy* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Cne_01_InitVars = {
ACTOR_EN_CNE_01,
ACTORCAT_NPC,
@@ -33,85 +32,296 @@ const ActorInit En_Cne_01_InitVars = {
(ActorFunc)EnCne01_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_809CBF00 = {
- { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT0,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 18, 64, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_809CBF2C = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_809CBF38 = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(0, 0x0),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(0, 0x0),
- /* Zora boomerang */ DMG_ENTRY(0, 0x0),
- /* Normal arrow */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0),
- /* Hookshot */ DMG_ENTRY(0, 0x0),
- /* Goron punch */ DMG_ENTRY(0, 0x0),
- /* Sword */ DMG_ENTRY(0, 0x0),
- /* Goron pound */ DMG_ENTRY(0, 0x0),
- /* Fire arrow */ DMG_ENTRY(0, 0x0),
- /* Ice arrow */ DMG_ENTRY(0, 0x0),
- /* Light arrow */ DMG_ENTRY(0, 0x0),
- /* Goron spikes */ DMG_ENTRY(0, 0x0),
- /* Deku spin */ DMG_ENTRY(0, 0x0),
- /* Deku bubble */ DMG_ENTRY(0, 0x0),
- /* Deku launch */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0x0),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0x0),
- /* Thrown object */ DMG_ENTRY(0, 0x0),
- /* Zora punch */ DMG_ENTRY(0, 0x0),
- /* Spin attack */ DMG_ENTRY(0, 0x0),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(0, 0x0),
+static DamageTable sDamageTable = {
+ /* Deku Nut */ DMG_ENTRY(0, 0),
+ /* Deku Stick */ DMG_ENTRY(0, 0),
+ /* Horse trample */ DMG_ENTRY(0, 0),
+ /* Explosives */ DMG_ENTRY(0, 0),
+ /* Zora boomerang */ DMG_ENTRY(0, 0),
+ /* Normal arrow */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0),
+ /* Hookshot */ DMG_ENTRY(0, 0),
+ /* Goron punch */ DMG_ENTRY(0, 0),
+ /* Sword */ DMG_ENTRY(0, 0),
+ /* Goron pound */ DMG_ENTRY(0, 0),
+ /* Fire arrow */ DMG_ENTRY(0, 0),
+ /* Ice arrow */ DMG_ENTRY(0, 0),
+ /* Light arrow */ DMG_ENTRY(0, 0),
+ /* Goron spikes */ DMG_ENTRY(0, 0),
+ /* Deku spin */ DMG_ENTRY(0, 0),
+ /* Deku bubble */ DMG_ENTRY(0, 0),
+ /* Deku launch */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0),
+ /* Zora barrier */ DMG_ENTRY(0, 0),
+ /* Normal shield */ DMG_ENTRY(0, 0),
+ /* Light ray */ DMG_ENTRY(0, 0),
+ /* Thrown object */ DMG_ENTRY(0, 0),
+ /* Zora punch */ DMG_ENTRY(0, 0),
+ /* Spin attack */ DMG_ENTRY(0, 0),
+ /* Sword beam */ DMG_ENTRY(0, 0),
+ /* Normal Roll */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0),
+ /* Unblockable */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0),
+ /* Powder Keg */ DMG_ENTRY(0, 0),
};
-#endif
+u16 D_809CBF58[] = { 4000, 4, 1, 3, 6000, 4, 1, 6, 4000, 4, 1, 3, 6000, 4, 1, 6 };
-extern ColliderCylinderInit D_809CBF00;
-extern CollisionCheckInfoInit2 D_809CBF2C;
-extern DamageTable D_809CBF38;
+void EnCne01_UpdateModel(EnCne01* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f focus;
-extern UNK_TYPE D_060000F0;
-extern UNK_TYPE D_06001300;
+ EnHy_UpdateSkelAnime(&this->enHy, globalCtx);
+ if (SubS_AngleDiffLessEqual(this->enHy.actor.shape.rot.y, 0x36B0, this->enHy.actor.yawTowardsPlayer)) {
+ focus.x = player->actor.world.pos.x;
+ focus.y = player->bodyPartsPos[7].y + 3.0f;
+ focus.z = player->actor.world.pos.z;
+ func_8013D2E0(&focus, &this->enHy.actor.focus.pos, &this->enHy.actor.shape.rot, &this->enHy.focusTarget,
+ &this->enHy.headRot, &this->enHy.torsoRot, D_809CBF58);
+ } else {
+ Math_SmoothStepToS(&this->enHy.focusTarget.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.focusTarget.y, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.headRot.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.headRot.y, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.torsoRot.x, 0, 4, 0x3E8, 1);
+ Math_SmoothStepToS(&this->enHy.torsoRot.y, 0, 4, 0x3E8, 1);
+ }
+ SubS_FillLimbRotTables(globalCtx, this->enHy.limbRotTableY, this->enHy.limbRotTableZ,
+ ARRAY_COUNT(this->enHy.limbRotTableY));
+ EnHy_UpdateCollider(&this->enHy, globalCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB290.s")
+s32 EnCne01_TestIsTalking(EnCne01* this, GlobalContext* globalCtx) {
+ s32 isTalking = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB404.s")
+ if (Actor_ProcessTalkRequest(&this->enHy.actor, &globalCtx->state)) {
+ isTalking = true;
+ this->enHy.textId = 0x10B9; // Invalid textId, produces empty textbox
+ this->enHy.tmpFocusTarget = this->enHy.focusTarget;
+ this->enHy.tmpHeadRot = this->enHy.headRot;
+ this->enHy.tmpTorsoRot = this->enHy.torsoRot;
+ this->enHy.tmpActionFunc = this->enHy.actionFunc;
+ this->enHy.actionFunc = EnCne01_Talk;
+ }
+ return isTalking;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB4A0.s")
+s32 func_809CB4A0(EnCne01* this, GlobalContext* globalCtx) {
+ s16 x;
+ s16 y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB520.s")
+ Actor_GetScreenPos(globalCtx, &this->enHy.actor, &x, &y);
+ //! @bug: Both x and y conditionals are always true, || should be an &&
+ if (!this->enHy.waitingOnInit && ((x >= 0) || (x < SCREEN_WIDTH)) && ((y >= 0) || (y < SCREEN_HEIGHT))) {
+ func_800B85E0(&this->enHy.actor, globalCtx, 30.0f, EXCH_ITEM_2E);
+ }
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB5A0.s")
+void EnCne01_FinishInit(EnHy* this, GlobalContext* globalCtx) {
+ if (EnHy_Init(this, globalCtx, &gCneSkel, ENHY_ANIMATION_OS_ANIME_11)) {
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actor.draw = EnCne01_Draw;
+ this->waitingOnInit = false;
+ if (ENCNE01_GET_PATH(&this->actor) == ENCNE01_NO_PATH) {
+ this->actionFunc = EnCne01_FaceForward;
+ } else {
+ this->actionFunc = EnCne01_Walk;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB5D8.s")
+void EnCne01_Walk(EnHy* this, GlobalContext* globalCtx) {
+ if (EnHy_MoveForwards(this, 1.0f)) {
+ this->curPoint = 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB5FC.s")
+void EnCne01_FaceForward(EnHy* this, GlobalContext* globalCtx) {
+ this->actor.shape.rot = this->actor.world.rot;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/EnCne01_Init.s")
+void EnCne01_Talk(EnHy* this, GlobalContext* globalCtx) {
+ s16 yaw;
+ u8 talkState;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/EnCne01_Destroy.s")
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1);
+ talkState = Message_GetState(&globalCtx->msgCtx);
+ this->inMsgState3 = (talkState == 3) ? true : false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/EnCne01_Update.s")
+ switch (talkState) {
+ case 0:
+ yaw = ABS_ALT(this->actor.shape.rot.y - this->actor.yawTowardsPlayer);
+ if (yaw < 0x64) {
+ Message_StartTextbox(globalCtx, this->textId, NULL);
+ }
+ break;
+ case 2:
+ this->actor.textId = 0;
+ this->focusTarget = this->tmpFocusTarget;
+ this->headRot = this->tmpHeadRot;
+ this->torsoRot = this->tmpTorsoRot;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actionFunc = this->tmpActionFunc;
+ this->tmpActionFunc = NULL;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CB920.s")
+void EnCne01_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnCne01* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CBBC8.s")
+ this->enHy.animObjIndex = SubS_GetObjectIndex(OBJECT_OS_ANIME, globalCtx);
+ this->enHy.headObjIndex = SubS_GetObjectIndex(OBJECT_CNE, globalCtx);
+ this->enHy.skelUpperObjIndex = SubS_GetObjectIndex(OBJECT_CNE, globalCtx);
+ this->enHy.skelLowerObjIndex = SubS_GetObjectIndex(OBJECT_CNE, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/func_809CBCA0.s")
+ if ((this->enHy.animObjIndex < 0) || (this->enHy.headObjIndex < 0) || (this->enHy.skelUpperObjIndex < 0) ||
+ (this->enHy.skelLowerObjIndex < 0)) {
+ Actor_MarkForDeath(&this->enHy.actor);
+ }
+ this->enHy.actor.draw = NULL;
+ Collider_InitCylinder(globalCtx, &this->enHy.collider);
+ Collider_SetCylinder(globalCtx, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ this->enHy.actor.flags &= ~ACTOR_FLAG_1;
+ this->enHy.path = func_8013D648(globalCtx, ENCNE01_GET_PATH(&this->enHy.actor), ENCNE01_NO_PATH);
+ this->enHy.waitingOnInit = true;
+ Actor_SetScale(&this->enHy.actor, 0.01f);
+ this->enHy.actionFunc = EnCne01_FinishInit;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Cne_01/EnCne01_Draw.s")
+void EnCne01_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnCne01* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->enHy.collider);
+}
+
+void EnCne01_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnCne01* this = THIS;
+
+ EnCne01_TestIsTalking(this, globalCtx);
+ this->enHy.actionFunc(&this->enHy, globalCtx);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->enHy.actor, 0.0f, 0.0f, 0.0f, 4);
+ EnCne01_UpdateModel(this, globalCtx);
+ func_809CB4A0(this, globalCtx);
+}
+
+s32 EnCne01_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnCne01* this = THIS;
+ s8 bodyPart;
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
+
+ bodyPart = gEnHyBodyParts[limbIndex];
+ if (bodyPart >= 0) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
+ }
+
+ if (limbIndex == CNE_LIMB_HEAD) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->enHy.headObjIndex].segment);
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.headObjIndex].segment);
+ *dList = gCneHeadBrownHairDL;
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.skelLowerObjIndex].segment);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ if (limbIndex == CNE_LIMB_HEAD) {
+ Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->enHy.headRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->enHy.headRot.x, MTXMODE_APPLY);
+ Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if (limbIndex == CNE_LIMB_TORSO) {
+ Matrix_InsertXRotation_s(-this->enHy.torsoRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->enHy.torsoRot.x, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == CNE_LIMB_HEAD) && this->enHy.inMsgState3 && ((globalCtx->state.frames % 2) == 0)) {
+ Matrix_InsertTranslation(40.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == CNE_LIMB_TORSO) || (limbIndex == CNE_LIMB_LEFT_UPPER_ARM) ||
+ (limbIndex == CNE_LIMB_RIGHT_UPPER_ARM)) {
+ rot->y += (s16)(Math_SinS(this->enHy.limbRotTableY[limbIndex]) * 200.0f);
+ rot->z += (s16)(Math_CosS(this->enHy.limbRotTableZ[limbIndex]) * 200.0f);
+ }
+
+ return false;
+}
+
+void EnCne01_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnCne01* this = THIS;
+ GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
+
+ if (limbIndex == CNE_LIMB_RIGHT_FOOT) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x06, globalCtx->objectCtx.status[this->enHy.skelUpperObjIndex].segment);
+ gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->enHy.skelUpperObjIndex].segment);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if (limbIndex == CNE_LIMB_HEAD) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->enHy.actor.focus.pos);
+ }
+}
+
+void EnCne01_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+}
+
+void EnCne01_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnCne01* this = THIS;
+ s32 i;
+ u8* shadowTex = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8[64][64]));
+ u8* shadowTexIter;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 180, 255, 0));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 180, 255, 0));
+ gSPSegment(POLY_OPA_DISP++, 0x0A, Gfx_EnvColor(globalCtx->state.gfxCtx, 160, 180, 255, 0));
+ gDPPipeSync(POLY_OPA_DISP++);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->enHy.skelAnime.skeleton, this->enHy.skelAnime.jointTable,
+ this->enHy.skelAnime.dListCount, EnCne01_OverrideLimbDraw, EnCne01_PostLimbDraw,
+ EnCne01_TransformLimbDraw, &this->enHy.actor);
+ Matrix_InsertXRotation_s(0, MTXMODE_NEW);
+
+ for (i = 0, shadowTexIter = shadowTex; i < (s32)sizeof(u8[64][64]); i++) {
+ *shadowTexIter++ = 0;
+ }
+ for (i = 0; i < 5; i++) {
+ func_8013CD64(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f,
+ ARRAY_COUNT(this->enHy.bodyPartsPos), gEnHyShadowSize, gEnHyBodyPartsIndex);
+ }
+ func_8013CF04(&this->enHy.actor, &globalCtx->state.gfxCtx, shadowTex);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h
index db0e797e96..840d1cf60e 100644
--- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h
+++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.h
@@ -1,16 +1,18 @@
#ifndef Z_EN_CNE_01_H
#define Z_EN_CNE_01_H
-#include "global.h"
+#include "z_en_hy_code.h"
struct EnCne01;
typedef void (*EnCne01ActionFunc)(struct EnCne01*, GlobalContext*);
+#define ENCNE01_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
+#define ENCNE01_NO_PATH 0x3F
+
typedef struct EnCne01 {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ EnCne01ActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x4D4];
+ /* 0x000 */ EnHy enHy;
+ /* 0x3EC */ UNK_TYPE1 unk_3EC[0x230];
} EnCne01; // size = 0x61C
extern const ActorInit En_Cne_01_InitVars;
diff --git a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
index 531e0b1229..5b5cf51333 100644
--- a/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
+++ b/src/overlays/actors/ovl_En_Col_Man/z_en_col_man.c
@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00100000
+#define FLAGS (ACTOR_FLAG_100000)
#define THIS ((EnColMan*)thisx)
@@ -146,8 +146,8 @@ void EnColMan_SetHeartPieceCollectedAndKill(EnColMan* this, GlobalContext* globa
void func_80AFDF60(EnColMan* this) {
this->actor.draw = func_80AFE584;
- this->actor.flags |= 0x10;
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.flags |= ACTOR_FLAG_20;
this->type = EN_COL_MAN_FALLING_ROCK;
this->actionFunc = func_80AFDFB4;
this->actor.shape.shadowScale = 5.0f;
@@ -246,7 +246,7 @@ void func_80AFE4AC(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&gameplay_keep_Tex_05E6F0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -268,7 +268,7 @@ void func_80AFE650(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
POLY_OPA_DISP = func_8012C724(POLY_OPA_DISP);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&gameplay_keep_Tex_05CEF0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05CEF0));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_05F6F0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
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 9f997cc1eb..fd42fd3f35 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 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnCow*)thisx)
@@ -61,13 +61,6 @@ static ColliderCylinderInit sCylinderInit = {
Vec3f D_8099D63C = { 0.0f, -1300.0f, 1100.0f };
-extern AnimationHeader D_060001CC; // gCowBodyChewAnim
-extern FlexSkeletonHeader D_06004010; // gCowBodySkel
-extern AnimationHeader D_06004264; // gCowBodyMoveHeadAnim
-extern AnimationHeader D_06004348; // gCowTailIdleAnim
-extern FlexSkeletonHeader D_06004C30; // gCowTailSkel
-extern AnimationHeader D_06004E98; // gCowTailSwishAnim
-
void EnCow_RotatePoint(Vec3f* vec, s16 angle) {
f32 x = (Math_CosS(angle) * vec->x) + (Math_SinS(angle) * vec->z);
@@ -113,9 +106,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
switch (EN_COW_TYPE(thisx)) {
case EN_COW_TYPE_DEFAULT:
case EN_COW_TYPE_ABDUCTED:
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable,
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowSkel, NULL, this->jointTable, this->morphTable,
COW_LIMB_MAX);
- Animation_PlayLoop(&this->skelAnime, &D_060001CC);
+ Animation_PlayLoop(&this->skelAnime, &gCowChewAnim);
Collider_InitAndSetCylinder(globalCtx, &this->colliders[0], &this->actor, &sCylinderInit);
Collider_InitAndSetCylinder(globalCtx, &this->colliders[1], &this->actor, &sCylinderInit);
@@ -141,9 +134,9 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
func_801A5080(4);
break;
case EN_COW_TYPE_TAIL:
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->jointTable, this->morphTable,
- COW_LIMB_MAX);
- Animation_PlayLoop(&this->skelAnime, &D_06004348);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable,
+ COW_TAIL_LIMB_MAX);
+ Animation_PlayLoop(&this->skelAnime, &gCowTailIdleAnim);
this->actor.update = EnCow_UpdateTail;
this->actor.draw = EnCow_DrawTail;
@@ -151,7 +144,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) {
EnCow_SetTailPos(this);
- this->actor.flags &= ~EN_COW_FLAG_IS_TAIL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->animationTimer = Rand_ZeroFloat(1000.0f) + 40.0f;
break;
}
@@ -177,13 +170,13 @@ void EnCow_UpdateAnimation(EnCow* this, GlobalContext* globalCtx) {
this->animationTimer--;
} else {
this->animationTimer = Rand_ZeroFloat(500.0f) + 40.0f;
- Animation_Change(&this->skelAnime, &D_060001CC, 1.0f, this->skelAnime.curFrame,
- Animation_GetLastFrame(&D_060001CC), ANIMMODE_ONCE, 1.0f);
+ Animation_Change(&this->skelAnime, &gCowChewAnim, 1.0f, this->skelAnime.curFrame,
+ Animation_GetLastFrame(&gCowChewAnim), ANIMMODE_ONCE, 1.0f);
}
if (this->actor.xzDistToPlayer < 150.0f) {
if (!(this->flags & EN_COW_FLAG_PLAYER_HAS_APPROACHED)) {
this->flags |= EN_COW_FLAG_PLAYER_HAS_APPROACHED;
- if (this->skelAnime.animation == &D_060001CC) {
+ if (this->skelAnime.animation == &gCowChewAnim) {
this->animationTimer = 0;
}
}
@@ -208,7 +201,7 @@ void EnCow_UpdateAnimation(EnCow* this, GlobalContext* globalCtx) {
void EnCow_TalkEnd(EnCow* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_801477B4(globalCtx);
this->actionFunc = EnCow_Idle;
}
@@ -216,7 +209,7 @@ void EnCow_TalkEnd(EnCow* this, GlobalContext* globalCtx) {
void EnCow_GiveMilkEnd(EnCow* this, GlobalContext* globalCtx) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = EnCow_Idle;
}
}
@@ -232,7 +225,7 @@ void EnCow_GiveMilkWait(EnCow* this, GlobalContext* globalCtx) {
void EnCow_GiveMilk(EnCow* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_801477B4(globalCtx);
this->actionFunc = EnCow_GiveMilkWait;
Actor_PickUp(&this->actor, globalCtx, GI_MILK, 10000.0f, 100.0f);
@@ -241,7 +234,7 @@ void EnCow_GiveMilk(EnCow* this, GlobalContext* globalCtx) {
void EnCow_CheckForEmptyBottle(EnCow* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
func_80151938(globalCtx, 0x32C9); // Text to give milk.
this->actionFunc = EnCow_GiveMilk;
} else {
@@ -261,7 +254,7 @@ void EnCow_Talk(EnCow* this, GlobalContext* globalCtx) {
this->actionFunc = EnCow_TalkEnd;
}
} else {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 170.0f);
this->actor.textId = 0x32C8; //! @bug textId is reset to this no matter the intial value
}
@@ -270,7 +263,7 @@ void EnCow_Talk(EnCow* this, GlobalContext* globalCtx) {
}
void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
- if ((globalCtx->msgCtx.unk1202A == 0) || (globalCtx->msgCtx.unk1202A == 4)) {
+ if ((globalCtx->msgCtx.ocarinaMode == 0) || (globalCtx->msgCtx.ocarinaMode == 4)) {
if (D_801BDAA4 != 0) {
if (this->flags & EN_COW_FLAG_WONT_GIVE_MILK) {
this->flags &= ~EN_COW_FLAG_WONT_GIVE_MILK;
@@ -279,7 +272,7 @@ void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000) {
D_801BDAA4 = 0;
this->actionFunc = EnCow_Talk;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 170.0f);
this->actor.textId = 0x32C8; // Text to give milk after playing Epona's Song.
@@ -298,12 +291,12 @@ void EnCow_Idle(EnCow* this, GlobalContext* globalCtx) {
if (func_801A5100() == 4) {
if (!(gSaveContext.weekEventReg[87] & 1)) {
gSaveContext.weekEventReg[87] |= 1;
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
this->actor.textId = 0x32C9; // Text to give milk.
} else {
this->actor.textId = 0x32CA; // Text if you don't have an empty bottle.
}
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 170.0f);
this->actionFunc = EnCow_Talk;
}
@@ -320,15 +313,15 @@ void EnCow_DoTail(EnCow* this, GlobalContext* globalCtx) {
this->animationTimer--;
} else {
this->animationTimer = Rand_ZeroFloat(200.0f) + 40.0f;
- Animation_Change(&this->skelAnime, &D_06004348, 1.0f, this->skelAnime.curFrame,
- Animation_GetLastFrame(&D_06004348), ANIMMODE_ONCE, 1.0f);
+ Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, this->skelAnime.curFrame,
+ Animation_GetLastFrame(&gCowTailIdleAnim), ANIMMODE_ONCE, 1.0f);
}
if (this->actor.xzDistToPlayer < 150.0f &&
ABS_ALT((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) > 25000) {
if (!(this->flags & EN_COW_FLAG_PLAYER_HAS_APPROACHED)) {
this->flags |= EN_COW_FLAG_PLAYER_HAS_APPROACHED;
- if (this->skelAnime.animation == &D_06004348) {
+ if (this->skelAnime.animation == &gCowTailIdleAnim) {
this->animationTimer = 0;
}
}
@@ -350,12 +343,12 @@ void EnCow_Update(Actor* thisx, GlobalContext* globalCtx2) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
if (SkelAnime_Update(&this->skelAnime)) {
- if (this->skelAnime.animation == &D_060001CC) {
+ if (this->skelAnime.animation == &gCowChewAnim) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_COW_CRY);
- Animation_Change(&this->skelAnime, &D_06004264, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004264),
+ Animation_Change(&this->skelAnime, &gCowMooAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowMooAnim),
ANIMMODE_ONCE, 1.0f);
} else {
- Animation_Change(&this->skelAnime, &D_060001CC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060001CC),
+ Animation_Change(&this->skelAnime, &gCowChewAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowChewAnim),
ANIMMODE_LOOP, 1.0f);
}
}
@@ -391,11 +384,11 @@ void EnCow_UpdateTail(Actor* thisx, GlobalContext* globalCtx) {
EnCow* this = THIS;
if (SkelAnime_Update(&this->skelAnime)) {
- if (this->skelAnime.animation == &D_06004348) {
- Animation_Change(&this->skelAnime, &D_06004E98, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004E98),
- ANIMMODE_ONCE, 1.0f);
+ if (this->skelAnime.animation == &gCowTailIdleAnim) {
+ Animation_Change(&this->skelAnime, &gCowTailSwishAnim, 1.0f, 0.0f,
+ Animation_GetLastFrame(&gCowTailSwishAnim), ANIMMODE_ONCE, 1.0f);
} else {
- Animation_Change(&this->skelAnime, &D_06004348, 1.0f, 0.0f, Animation_GetLastFrame(&D_06004348),
+ Animation_Change(&this->skelAnime, &gCowTailIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gCowTailIdleAnim),
ANIMMODE_LOOP, 1.0f);
}
}
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 fd865cecbe..bb9319ad97 100644
--- a/src/overlays/actors/ovl_En_Cow/z_en_cow.h
+++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.h
@@ -2,10 +2,10 @@
#define Z_EN_COW_H
#include "global.h"
+#include "objects/object_cow/object_cow.h"
#define EN_COW_TYPE(thisx) ((thisx)->params & 0xF)
-#define EN_COW_FLAG_IS_TAIL (1 << 0) // This is never set but it is cleared for tail types
#define EN_COW_FLAG_PLAYER_HAS_APPROACHED (1 << 1)
#define EN_COW_FLAG_WONT_GIVE_MILK (1 << 2)
@@ -19,16 +19,6 @@ struct EnCow;
typedef void (*EnCowActionFunc)(struct EnCow*, GlobalContext*);
-typedef enum {
- /* 0 */ COW_LIMB_NONE,
- /* 1 */ COW_LIMB_ROOT,
- /* 2 */ COW_LIMB_HEAD,
- /* 3 */ COW_LIMB_JAW,
- /* 4 */ COW_LIMB_NOSE,
- /* 5 */ COW_LIMB_NOSE_RING,
- /* 6 */ COW_LIMB_MAX,
-} ObjectCowLimbs;
-
typedef struct EnCow {
/* 0x0000 */ Actor actor;
/* 0x0144 */ ColliderCylinder colliders[2];
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 be24037bfd..8293ddd941 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
@@ -6,7 +6,7 @@
#include "z_en_crow.h"
-#define FLAGS 0x00005005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000)
#define THIS ((EnCrow*)thisx)
diff --git a/src/overlays/actors/ovl_En_Dai/z_en_dai.c b/src/overlays/actors/ovl_En_Dai/z_en_dai.c
index 0e83d1091f..3b96d1b4d6 100644
--- a/src/overlays/actors/ovl_En_Dai/z_en_dai.c
+++ b/src/overlays/actors/ovl_En_Dai/z_en_dai.c
@@ -5,8 +5,9 @@
*/
#include "z_en_dai.h"
+#include "objects/object_dai/object_dai.h"
-#define FLAGS 0x02000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((EnDai*)thisx)
@@ -18,24 +19,6 @@ void EnDai_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80B3F00C(EnDai* this, GlobalContext* globalCtx);
void func_80B3EF90(EnDai* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060107B0;
-extern AnimationHeader D_06010FB0;
-extern AnimationHeader D_060117B0;
-extern AnimationHeader D_06010FB0;
-extern AnimationHeader D_06011FB0;
-extern AnimationHeader D_060127B0;
-extern AnimationHeader D_060079E4;
-extern AnimationHeader D_06007354;
-extern AnimationHeader D_06000CEC;
-extern AnimationHeader D_060069DC;
-extern AnimationHeader D_0600563C;
-extern AnimationHeader D_06002E58;
-extern AnimationHeader D_06006590;
-extern FlexSkeletonHeader D_060130D0;
-extern Gfx D_06000230[];
-extern Gfx D_060002E8[];
-extern Gfx D_0600C538[];
-
const ActorInit En_Dai_InitVars = {
ACTOR_EN_DAI,
ACTORCAT_NPC,
@@ -87,7 +70,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
gDPPipeSync(POLY_XLU_DISP++);
if (!isDisplayListSet) {
- gSPDisplayList(POLY_XLU_DISP++, D_06000230);
+ gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_000230);
isDisplayListSet = true;
}
@@ -108,7 +91,7 @@ void func_80B3E168(EnDaiParticle* particle, GlobalContext* globalCtx2) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_060002E8);
+ gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_0002E8);
Matrix_StatePop();
}
@@ -147,14 +130,20 @@ s32 func_80B3E5B4(EnDai* this, GlobalContext* globalCtx) {
}
s32 func_80B3E5DC(EnDai* this, s32 arg1) {
- static ActorAnimationEntryS D_80B3FBFC[] = {
- { &D_060079E4, 1.0f, 0, -1, 0, 0 }, { &D_060079E4, 1.0f, 0, -1, 0, -4 }, { &D_06007354, 1.0f, 0, -1, 2, -4 },
- { &D_06000CEC, 1.0f, 0, -1, 2, -4 }, { &D_060069DC, 1.0f, 0, -1, 2, -4 }, { &D_0600563C, 1.0f, 0, -1, 2, 0 },
- { &D_0600563C, 1.0f, 0, -1, 2, -4 }, { &D_06002E58, 1.0f, 0, -1, 0, -4 }, { &D_06006590, 1.0f, 0, -1, 2, -4 },
+ static AnimationInfoS D_80B3FBFC[] = {
+ { &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dai_Anim_0079E4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dai_Anim_007354, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dai_Anim_000CEC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dai_Anim_0069DC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dai_Anim_00563C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dai_Anim_00563C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dai_Anim_002E58, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dai_Anim_006590, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
};
s32 phi_v1 = false;
- s32 ret = 0;
+ s32 ret = false;
switch (arg1) {
case 0:
@@ -180,7 +169,7 @@ s32 func_80B3E5DC(EnDai* this, s32 arg1) {
if (phi_v1) {
this->unk_A70 = arg1;
- ret = func_8013BC6C(&this->skelAnime, D_80B3FBFC, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80B3FBFC, arg1);
}
return ret;
@@ -190,7 +179,7 @@ s32 func_80B3E69C(EnDai* this, GlobalContext* globalCtx) {
s32 ret = false;
if ((globalCtx->csCtx.state != 0) && (globalCtx->sceneNum == SCENE_12HAKUGINMAE) &&
- (globalCtx->csCtx.unk_12 == 0) && !(gSaveContext.weekEventReg[30] & 1)) {
+ (globalCtx->csCtx.currentCsIndex == 0) && !(gSaveContext.weekEventReg[30] & 1)) {
if (!(this->unk_1CE & 0x10)) {
Flags_SetSwitch(globalCtx, 20);
this->unk_1CE |= (0x80 | 0x10);
@@ -217,7 +206,7 @@ s32 func_80B3E7C8(EnDai* this, GlobalContext* globalCtx) {
if (this->unk_1CE & 7) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_1CE, 0, 7);
+ SubS_UpdateFlags(&this->unk_1CE, 0, 7);
this->actionFunc = func_80B3EF90;
ret = true;
}
@@ -424,7 +413,7 @@ void func_80B3EE8C(EnDai* this, GlobalContext* globalCtx) {
void func_80B3EEDC(EnDai* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.unk1202A == 3) &&
+ if ((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.ocarinaMode == 3) &&
(globalCtx->msgCtx.unk1202E == 1)) {
func_80B3E5DC(this, 1);
this->actionFunc = func_80B3EE8C;
@@ -439,7 +428,7 @@ void func_80B3EEDC(EnDai* this, GlobalContext* globalCtx) {
void func_80B3EF90(EnDai* this, GlobalContext* globalCtx) {
if (func_8010BF58(&this->actor, globalCtx, D_80B3FC8C, NULL, &this->unk_1D0)) {
- func_8013AED4(&this->unk_1CE, 3, 7);
+ SubS_UpdateFlags(&this->unk_1CE, 3, 7);
this->unk_1D0 = 0;
this->actionFunc = func_80B3F00C;
} else {
@@ -455,13 +444,12 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) {
static s32 D_80B3FE38[] = {
0, 0, 6, 7, 8,
};
-
s32 sp2C = 0;
s32 sp28;
- if (func_800EE29C(globalCtx, 0x1D8)) {
- sp2C = func_800EE200(globalCtx, 0x1D8);
- sp28 = globalCtx->csCtx.npcActions[sp2C]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 472)) {
+ sp2C = Cutscene_GetActorActionIndex(globalCtx, 472);
+ sp28 = globalCtx->csCtx.actorActions[sp2C]->action;
if (this->unk_1CC != (u8)sp28) {
func_80B3E5DC(this, D_80B3FE38[sp28]);
switch (sp28) {
@@ -519,14 +507,15 @@ void func_80B3F044(EnDai* this, GlobalContext* globalCtx) {
break;
}
- func_800EDF24(&this->actor, globalCtx, sp2C);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, sp2C);
}
void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDai* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060130D0, NULL, this->jointTable, this->morphTable, 19);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dai_Skel_0130D0, NULL, this->jointTable, this->morphTable,
+ 19);
this->unk_A70 = -1;
func_80B3E5DC(this, 0);
Actor_SetScale(&this->actor, 0.2f);
@@ -537,7 +526,7 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_1D6 = 0;
if (gSaveContext.weekEventReg[33] & 0x80) {
- func_8013AED4(&this->unk_1CE, 3, 7);
+ SubS_UpdateFlags(&this->unk_1CE, 3, 7);
this->unk_1CE |= 0x80;
this->unk_1CD = 0xFF;
this->actionFunc = func_80B3F00C;
@@ -550,7 +539,7 @@ void EnDai_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->unk_1CD = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_1CE |= (0x100 | 0x20);
this->unk_1CE |= 0x80;
this->actionFunc = func_80B3EEDC;
@@ -582,8 +571,8 @@ void EnDai_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_80B3F598(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
- Gfx** gfx) {
+s32 EnDai_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
EnDai* this = THIS;
if (!(this->unk_1CE & 0x40)) {
@@ -598,10 +587,10 @@ s32 func_80B3F598(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
*dList = NULL;
}
- return 0;
+ return false;
}
-void func_80B3F614(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+void EnDai_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static Vec3f D_80B3FE4C = { 0.0f, 0.0f, 0.0f };
EnDai* this = THIS;
@@ -626,10 +615,10 @@ void func_80B3F614(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
}
-void func_80B3F6EC(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx) {
+void EnDai_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx, Gfx** gfx) {
EnDai* this = THIS;
- switch (arg1) {
+ switch (limbIndex) {
case 9:
if (this->unk_1CE & 0x100) {
func_80B3EC84(this);
@@ -647,10 +636,10 @@ void func_80B3F6EC(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx)
}
void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
- static AnimationHeader* D_80B3FE58[] = {
- &D_060107B0, &D_06010FB0, &D_060117B0, &D_06010FB0, &D_06011FB0, &D_060127B0,
+ static TexturePtr D_80B3FE58[] = {
+ object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0,
+ object_dai_Tex_010FB0, object_dai_Tex_011FB0, object_dai_Tex_0127B0,
};
-
s32 pad;
if (globalCtx->actorCtx.unkB != 0) {
@@ -669,14 +658,14 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE58[this->unk_1D6]));
- POLY_XLU_DISP =
- func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
+ POLY_XLU_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
+ EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
if (this->unk_1CE & 0x40) {
Matrix_SetCurrentState(&this->unk_18C);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_0600C538);
+ gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538);
}
func_80B3E5B4(this, globalCtx);
@@ -685,8 +674,9 @@ void func_80B3F78C(EnDai* this, GlobalContext* globalCtx) {
}
void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
- static AnimationHeader* D_80B3FE70[] = {
- &D_060107B0, &D_06010FB0, &D_060117B0, &D_06010FB0, &D_06011FB0, &D_060127B0,
+ static TexturePtr D_80B3FE70[] = {
+ object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0,
+ object_dai_Tex_010FB0, object_dai_Tex_011FB0, object_dai_Tex_0127B0,
};
s32 pad;
@@ -701,13 +691,13 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
- POLY_OPA_DISP =
- func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_OPA_DISP);
+ POLY_OPA_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
+ EnDai_TransformLimbDraw, &this->actor, POLY_OPA_DISP);
Matrix_SetCurrentState(&this->unk_18C);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_0600C538);
+ gSPDisplayList(POLY_OPA_DISP++, object_dai_DL_00C538);
CLOSE_DISPS(globalCtx->state.gfxCtx);
} else {
@@ -720,13 +710,13 @@ void func_80B3F920(EnDai* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1CD);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3FE70[this->unk_1D6]));
- POLY_XLU_DISP =
- func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80B3F598, func_80B3F614, func_80B3F6EC, &this->actor, POLY_XLU_DISP);
+ POLY_XLU_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnDai_OverrideLimbDraw, EnDai_PostLimbDraw,
+ EnDai_TransformLimbDraw, &this->actor, POLY_XLU_DISP);
Matrix_SetCurrentState(&this->unk_18C);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_0600C538);
+ gSPDisplayList(POLY_XLU_DISP++, object_dai_DL_00C538);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 4971193a32..011c0ebbd3 100644
--- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
+++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
@@ -5,8 +5,9 @@
*/
#include "z_en_daiku.h"
+#include "objects/object_daiku/object_daiku.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDaiku*)thisx)
@@ -20,22 +21,6 @@ void func_80943BC0(EnDaiku* this);
void func_80943BDC(EnDaiku* this, GlobalContext* globalCtx);
void func_809438F8(EnDaiku* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000600;
-extern AnimationHeader D_06000C44;
-extern AnimationHeader D_06001114;
-extern AnimationHeader D_06002FA0;
-extern FlexSkeletonHeader D_0600A850;
-extern AnimationHeader D_0600ACD0;
-extern AnimationHeader D_0600B690;
-extern AnimationHeader D_0600BEAC;
-extern AnimationHeader D_0600C234;
-extern AnimationHeader D_0600C92C;
-extern Gfx D_06006D70[];
-extern Gfx D_06006E80[];
-extern Gfx D_06006FB0[];
-extern Gfx D_060070C0[];
-extern Gfx D_06008EC8[];
-
const ActorInit En_Daiku_InitVars = {
ACTOR_EN_DAIKU,
ACTORCAT_NPC,
@@ -91,7 +76,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.dim.radius = 30;
this->collider.dim.height = 60;
this->collider.dim.yShift = 0;
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
if ((gSaveContext.weekEventReg[63] & 0x80) || ((gSaveContext.day == 3) && gSaveContext.isNight)) {
Actor_MarkForDeath(&this->actor);
}
@@ -108,18 +93,18 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_27E = this->unk_278 * 4 + 4;
case ENDAIKU_PARAMS_FF_1:
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable,
- this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0,
+ this->jointTable, this->morphTable, 17);
break;
case ENDAIKU_PARAMS_FF_2:
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_0600B690, this->jointTable,
- this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_00B690,
+ this->jointTable, this->morphTable, 17);
break;
case ENDAIKU_PARAMS_FF_3:
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06001114, this->jointTable,
- this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_001114,
+ this->jointTable, this->morphTable, 17);
break;
}
@@ -134,8 +119,9 @@ void EnDaiku_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_8094373C(EnDaiku* this, s32 arg1) {
static AnimationHeader* D_809440A4[] = {
- &D_06002FA0, &D_0600ACD0, &D_0600C92C, &D_06000C44, &D_0600C234,
- &D_06000600, &D_06001114, &D_0600B690, &D_0600BEAC,
+ &object_daiku_Anim_002FA0, &object_daiku_Anim_00ACD0, &object_daiku_Anim_00C92C,
+ &object_daiku_Anim_000C44, &object_daiku_Anim_00C234, &object_daiku_Anim_000600,
+ &object_daiku_Anim_001114, &object_daiku_Anim_00B690, &object_daiku_Anim_00BEAC,
};
static u8 D_809440C8[] = {
0, 0, 0, 0, 2, 0, 0, 2, 2,
@@ -296,7 +282,8 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
-s32 func_80943E18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnDaiku_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
EnDaiku* this = THIS;
if (limbIndex == 15) {
@@ -304,11 +291,16 @@ s32 func_80943E18(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
rot->z += this->unk_25E;
}
- return 0;
+ return false;
}
-void func_80943E60(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
- static Gfx* D_809440D4[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70 };
+void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ static Gfx* D_809440D4[] = {
+ object_daiku_DL_0070C0,
+ object_daiku_DL_006FB0,
+ object_daiku_DL_006E80,
+ object_daiku_DL_006D70,
+ };
EnDaiku* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -318,7 +310,7 @@ void func_80943E60(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
if ((this->unk_278 == ENDAIKU_PARAMS_FF_3) && (limbIndex == 8)) {
- gSPDisplayList(POLY_OPA_DISP++, D_06008EC8);
+ gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_008EC8);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -354,7 +346,7 @@ void EnDaiku_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80943E18, func_80943E60, &this->actor);
+ EnDaiku_OverrideLimbDraw, EnDaiku_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
index 6776086cc6..434e1c79fd 100644
--- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
+++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c
@@ -6,8 +6,10 @@
#include "z_en_daiku2.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "objects/object_daiku/object_daiku.h"
+#include "objects/object_bombiwa/object_bombiwa.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDaiku2*)thisx)
@@ -30,22 +32,6 @@ void func_80BE71D8(EnDaiku2* this, GlobalContext* globalCtx);
void func_80BE7504(EnDaiku2* this, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3, f32 arg4, s16 arg5);
void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06002134;
-extern AnimationHeader D_06002FA0;
-extern AnimationHeader D_0600ACD0;
-extern AnimationHeader D_0600C92C;
-extern AnimationHeader D_06000C44;
-extern AnimationHeader D_0600C234;
-extern AnimationHeader D_06000600;
-extern AnimationHeader D_06001114;
-extern AnimationHeader D_0600B690;
-extern AnimationHeader D_06001A24;
-extern AnimationHeader D_0600D328;
-extern FlexSkeletonHeader D_0600A850;
-extern Gfx D_06009638[];
-extern Gfx D_0600A390[];
-extern Gfx D_060009E0[];
-
const ActorInit En_Daiku2_InitVars = {
ACTOR_EN_DAIKU2,
ACTORCAT_NPC,
@@ -96,7 +82,8 @@ void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0,
+ this->jointTable, this->morphTable, 17);
this->actor.targetMode = 0;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->unk_278 = ENDAIKU2_GET_7F(&this->actor);
@@ -135,8 +122,9 @@ void EnDaiku2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80BE6408(EnDaiku2* this, s32 arg1) {
static AnimationHeader* sAnimations[] = {
- &D_06002FA0, &D_0600ACD0, &D_0600C92C, &D_06000C44, &D_0600C234, &D_06000600,
- &D_06001114, &D_0600B690, &D_06001A24, &D_06002134, &D_0600D328,
+ &object_daiku_Anim_002FA0, &object_daiku_Anim_00ACD0, &object_daiku_Anim_00C92C, &object_daiku_Anim_000C44,
+ &object_daiku_Anim_00C234, &object_daiku_Anim_000600, &object_daiku_Anim_001114, &object_daiku_Anim_00B690,
+ &object_daiku_Anim_001A24, &object_daiku_Anim_002134, &object_daiku_Anim_00D328,
};
static u8 D_80BE7958[] = {
0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0,
@@ -162,7 +150,7 @@ s32 func_80BE64C0(EnDaiku2* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&this->actor.world.pos, &sp30);
if ((this->unk_278 >= ENDAIKU2_GET_7F_0) && !Flags_GetSwitch(globalCtx, this->unk_278) && (bomb != NULL) &&
(bomb->actor.id == ACTOR_EN_BOM)) {
- if (bomb->unk_1F9 == 0) {
+ if (!bomb->isPowderKeg) {
this->actor.textId = 0x32D3;
} else {
this->actor.textId = 0x32D4;
@@ -274,8 +262,8 @@ void func_80BE66E4(EnDaiku2* this, GlobalContext* globalCtx) {
if ((this->unk_276 == 5) || (this->unk_276 == 9)) {
func_80BE6408(this, 10);
} else if ((this->unk_276 == 10) && (this->unk_284 <= sp9C)) {
- this->unk_284 = Animation_GetLastFrame(&D_06002134);
- Animation_Change(&this->skelAnime, &D_06002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f);
+ this->unk_284 = Animation_GetLastFrame(&object_daiku_Anim_002134);
+ Animation_Change(&this->skelAnime, &object_daiku_Anim_002134, -1.0f, this->unk_284, 0.0f, 2, -4.0f);
this->unk_276 = 11;
} else if ((this->unk_276 == 11) && (sp9C <= 0.0f)) {
func_80BE6408(this, 8);
@@ -479,11 +467,11 @@ void EnDaiku2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
if (limbIndex == 14) {
Matrix_Scale(this->unk_260, this->unk_260, this->unk_260, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06009638);
+ gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_009638);
}
if (limbIndex == 15) {
- gSPDisplayList(POLY_OPA_DISP++, D_0600A390);
+ gSPDisplayList(POLY_OPA_DISP++, object_daiku_DL_00A390);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -569,7 +557,7 @@ void func_80BE7718(EnDaiku2* this, GlobalContext* globalCtx) {
Matrix_Scale(particle->unk_30, particle->unk_30, particle->unk_30, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060009E0);
+ gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_0009E0);
Matrix_StatePop();
}
diff --git a/src/overlays/actors/ovl_En_Death/z_en_death.c b/src/overlays/actors/ovl_En_Death/z_en_death.c
index ec6d57bbfa..6292103eee 100644
--- a/src/overlays/actors/ovl_En_Death/z_en_death.c
+++ b/src/overlays/actors/ovl_En_Death/z_en_death.c
@@ -6,7 +6,7 @@
#include "z_en_death.h"
-#define FLAGS 0x00001035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_1000)
#define THIS ((EnDeath*)thisx)
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 288ce89a3b..1939a5bcca 100644
--- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
+++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
@@ -6,7 +6,7 @@
#include "z_en_dekubaba.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnDekubaba*)thisx)
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 e75bbade9a..9a6b678fc3 100644
--- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
+++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
@@ -6,8 +6,9 @@
#include "z_en_dekunuts.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "objects/object_dekunuts/object_dekunuts.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnDekunuts*)thisx)
@@ -38,20 +39,6 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx);
void func_808BE680(EnDekunuts* this);
void func_808BE6C4(EnDekunuts* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000168;
-extern Gfx D_06001E50[];
-extern Gfx D_06001F50[];
-extern SkeletonHeader D_06002468;
-extern AnimationHeader D_0600259C;
-extern AnimationHeader D_06002A5C;
-extern AnimationHeader D_06002BD4;
-extern AnimationHeader D_06002DD4;
-extern AnimationHeader D_06002FA4;
-extern AnimationHeader D_06003180;
-extern AnimationHeader D_0600326C;
-extern AnimationHeader D_060033E4;
-extern AnimationHeader D_06003780;
-
const ActorInit En_Dekunuts_InitVars = {
ACTOR_EN_DEKUNUTS,
ACTORCAT_ENEMY,
@@ -132,7 +119,8 @@ void EnDekunuts_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002468, &D_0600326C, this->jointTable, this->morphTable, 10);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekunuts_Skel_002468, &object_dekunuts_Anim_00326C,
+ this->jointTable, this->morphTable, 10);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->unk_194 = ENDEKUNUTS_GET_FF00(&this->actor);
@@ -142,7 +130,7 @@ void EnDekunuts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->actor.params == ENDEKUNUTS_GET_FF00_1) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->collider.base.colType = COLTYPE_NONE;
this->collider.info.bumperFlags |= (BUMP_NO_HITMARK | BUMP_NO_SWORD_SFX | BUMP_NO_DAMAGE | BUMP_NO_AT_INFO);
} else if (this->actor.params == ENDEKUNUTS_GET_FF00_2) {
@@ -178,7 +166,7 @@ void func_808BD3B4(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BD428(EnDekunuts* this) {
- Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06003180, 0.0f);
+ Animation_PlayOnceSetSpeed(&this->skelAnime, &object_dekunuts_Anim_003180, 0.0f);
this->unk_190 = Rand_S16Offset(100, 50);
this->collider.dim.height = 5;
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
@@ -233,7 +221,7 @@ void func_808BD49C(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BD78C(EnDekunuts* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06002FA4);
+ Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_002FA4);
this->unk_190 = 2;
this->actionFunc = func_808BD7D4;
}
@@ -253,7 +241,7 @@ void func_808BD7D4(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BD870(EnDekunuts* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dekunuts_Anim_00326C, -3.0f);
if (this->actionFunc == func_808BDA4C) {
this->unk_190 = 4098;
} else {
@@ -292,7 +280,7 @@ void func_808BD8D8(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BDA08(EnDekunuts* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06000168);
+ Animation_PlayOnce(&this->skelAnime, &object_dekunuts_Anim_000168);
this->unk_190 = this->unk_194;
this->actionFunc = func_808BDA4C;
}
@@ -336,7 +324,7 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_THROW);
}
} else if ((this->unk_190 >= 2) && Animation_OnFrame(&this->skelAnime, 12.0f)) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000168, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_000168, -3.0f);
if (this->unk_190 != 0) {
this->unk_190--;
}
@@ -344,14 +332,14 @@ void func_808BDA4C(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BDC9C(EnDekunuts* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002A5C, -5.0f);
this->unk_190 = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
this->actionFunc = func_808BDD54;
}
void func_808BDCF0(EnDekunuts* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A5C, -5.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002A5C, -5.0f);
this->collider.base.acFlags &= ~AC_ON;
this->unk_190 = 80;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
@@ -379,12 +367,12 @@ void func_808BDD54(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BDE7C(EnDekunuts* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06002DD4, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_002DD4, -3.0f);
this->collider.dim.height = 37;
this->actor.colChkInfo.mass = 50;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE);
this->actor.world.rot.x = 0;
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_20;
this->collider.base.acFlags &= ~AC_ON;
this->actionFunc = func_808BDEF8;
}
@@ -399,7 +387,7 @@ void func_808BDEF8(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BDF60(EnDekunuts* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06003780);
+ Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_003780);
this->unk_190 = 2;
this->unk_18C = 0;
this->collider.base.acFlags |= AC_ON;
@@ -447,7 +435,7 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) {
if ((this->unk_18D == 0) && (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 20.0f) &&
(fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f)) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
- this->actor.flags &= ~0x20;
+ this->actor.flags &= ~ACTOR_FLAG_20;
this->actor.speedXZ = 0.0f;
func_808BDC9C(this);
} else if (this->unk_190 == 0) {
@@ -456,7 +444,7 @@ void func_808BDFB8(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BE1CC(EnDekunuts* this) {
- Animation_PlayLoop(&this->skelAnime, &D_060033E4);
+ Animation_PlayLoop(&this->skelAnime, &object_dekunuts_Anim_0033E4);
this->unk_190 = 3;
this->actor.speedXZ = 0.0f;
if (this->unk_18D != 0) {
@@ -479,7 +467,7 @@ void func_808BE22C(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BE294(EnDekunuts* this, s32 arg1) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600259C, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dekunuts_Anim_00259C, -3.0f);
if (this->actor.params == ENDEKUNUTS_GET_FF00_0) {
this->actor.speedXZ = 10.0f;
if (arg1 != 0) {
@@ -492,7 +480,7 @@ void func_808BE294(EnDekunuts* this, s32 arg1) {
this->actionFunc = func_808BE358;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DAMAGE);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_CUTBODY);
- Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&D_0600259C));
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, Animation_GetLastFrame(&object_dekunuts_Anim_00259C));
}
void func_808BE358(EnDekunuts* this, GlobalContext* globalCtx) {
@@ -531,7 +519,7 @@ void func_808BE3FC(EnDekunuts* this, GlobalContext* globalCtx) {
}
void func_808BE484(EnDekunuts* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06002BD4);
+ Animation_PlayOnce(&this->skelAnime, &object_dekunuts_Anim_002BD4);
this->actionFunc = func_808BE4D4;
this->actor.speedXZ = 0.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DEAD);
@@ -554,13 +542,14 @@ void func_808BE4D4(EnDekunuts* this, GlobalContext* globalCtx) {
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0xE0);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ETCETERA, this->actor.home.pos.x, this->actor.home.pos.y,
this->actor.home.pos.z, 0, this->actor.home.rot.y, 0, 0x80);
- EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, 64, 10, D_06001F50);
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 6.0f, 0, 6, 2, 15, 64, 10,
+ object_dekunuts_DL_001F50);
Actor_MarkForDeath(&this->actor);
}
}
void func_808BE680(EnDekunuts* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_0600326C, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dekunuts_Anim_00326C, -3.0f);
this->actionFunc = func_808BE6C4;
}
@@ -671,7 +660,8 @@ void EnDekunuts_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_808BEBD0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnDekunuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
EnDekunuts* this = THIS;
f32 arg1, arg2, arg3;
f32 currentFrame;
@@ -700,10 +690,10 @@ s32 func_808BEBD0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
rot->z = this->actor.world.rot.x;
}
}
- return 0;
+ return false;
}
-void func_808BED30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnDekunuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static s8 D_808BEF98[] = {
-1, -1, -1, 3, -1, 0, -1, 1, -1, 2, 0, 0,
};
@@ -739,15 +729,15 @@ void func_808BED30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
void EnDekunuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnDekunuts* this = THIS;
- SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, func_808BEBD0, func_808BED30,
- &this->actor);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDekunuts_OverrideLimbDraw,
+ EnDekunuts_PostLimbDraw, &this->actor);
Matrix_SetStateRotationAndTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
&this->actor.home.rot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
if (this->actor.colorFilterTimer != 0) {
func_800AE5A0(globalCtx);
}
- Gfx_DrawDListOpa(globalCtx, D_06001E50);
+ Gfx_DrawDListOpa(globalCtx, object_dekunuts_DL_001E50);
func_800BE680(globalCtx, &this->actor, this->unk_21C, 8, this->unk_214, this->unk_218, this->unk_210,
this->unk_18E);
}
diff --git a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c
index b7e1609906..65aad6461c 100644
--- a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c
+++ b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.c
@@ -5,8 +5,9 @@
*/
#include "z_en_demo_heishi.h"
+#include "objects/object_sdn/object_sdn.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDemoheishi*)thisx)
@@ -15,10 +16,22 @@ void EnDemoheishi_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnDemoheishi_Update(Actor* thisx, GlobalContext* globalCtx);
void EnDemoheishi_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_80BE975C(EnDemoheishi* this, GlobalContext* globalCtx);
-void func_80BE980C(EnDemoheishi* this, GlobalContext* globalCtx);
+void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex);
+void EnDemoheishi_SetupIdle(EnDemoheishi* this);
+void EnDemoheishi_Idle(EnDemoheishi* this, GlobalContext* globalCtx);
+void EnDemoheishi_SetupTalk(EnDemoheishi* this);
+void EnDemoheishi_Talk(EnDemoheishi* this, GlobalContext* globalCtx);
+s32 EnDemoheishi_OverrideLimbDraw(GlobalContext* globalctx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx);
+
+typedef enum {
+ /* 0 */ DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP,
+ /* 1 */ DEMOHEISHI_ANIMATION_CHEER_WITH_SPEAR,
+ /* 2 */ DEMOHEISHI_ANIMATION_WAVE,
+ /* 3 */ DEMOHEISHI_ANIMATION_SIT_AND_REACH,
+ /* 4 */ DEMOHEISHI_ANIMATION_STAND_UP
+} EnDemoheishiAnimationIndex;
-#if 0
const ActorInit En_Demo_heishi_InitVars = {
ACTOR_EN_DEMO_HEISHI,
ACTORCAT_NPC,
@@ -31,37 +44,152 @@ const ActorInit En_Demo_heishi_InitVars = {
(ActorFunc)EnDemoheishi_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BE9A50 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 40, 40, 0, { 0, 0, 0 } },
};
-#endif
+static u16 sTextIds[] = { 0x1473 }; // Shiro initial intro text
-extern ColliderCylinderInit D_80BE9A50;
+void EnDemoheishi_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnDemoheishi* this = THIS;
-extern UNK_TYPE D_06003BFC;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gSoldierSkeleton, &gSoldierWave, this->jointTable,
+ this->morphTable, 17);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->actor.targetMode = 6;
+ this->actor.gravity = -3.0f;
+ Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
+ EnDemoheishi_SetupIdle(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Init.s")
+void EnDemoheishi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnDemoheishi* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Destroy.s")
+ Collider_DestroyCylinder(globalCtx, &this->colliderCylinder);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE95EC.s")
+void EnDemoheishi_ChangeAnimation(EnDemoheishi* this, s32 animIndex) {
+ static AnimationHeader* sAnimations[] = {
+ &gSoldierStandHandOnHip, &gSoldierCheerWithSpear, &gSoldierWave, &gSoldierSitAndReach, &gSoldierStandUp,
+ };
+ static u8 sAnimModes[] = {
+ ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_LOOP,
+ ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP
+ };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE9678.s")
+ this->animIndex = animIndex;
+ this->frameCount = Animation_GetLastFrame(sAnimations[animIndex]);
+ Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->frameCount,
+ sAnimModes[this->animIndex], -10.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE970C.s")
+void EnDemoheishi_SetHeadRotation(EnDemoheishi* this) {
+ s16 yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
+ s32 absYawDiff = ABS_ALT(yawDiff);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE975C.s")
+ this->headRotXTarget = 0;
+ if ((this->actor.xzDistToPlayer < 200.0f) && (absYawDiff < 0x4E20)) {
+ this->headRotXTarget = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
+ if (this->headRotXTarget > 0x2710) {
+ this->headRotXTarget = 0x2710;
+ } else if (this->headRotXTarget < -0x2710) {
+ this->headRotXTarget = -0x2710;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE97F0.s")
+void EnDemoheishi_SetupIdle(EnDemoheishi* this) {
+ EnDemoheishi_ChangeAnimation(this, DEMOHEISHI_ANIMATION_STAND_HAND_ON_HIP);
+ this->textIdIndex = 0;
+ this->actor.textId = sTextIds[this->textIdIndex];
+ this->isTalking = false;
+ this->actionFunc = EnDemoheishi_Idle;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE980C.s")
+void EnDemoheishi_Idle(EnDemoheishi* this, GlobalContext* globalCtx) {
+ s32 absYawDiff;
+ s16 yawDiff;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Update.s")
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
+ yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
+ absYawDiff = ABS_ALT(yawDiff);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/func_80BE9974.s")
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ EnDemoheishi_SetupTalk(this);
+ } else if (absYawDiff <= 0x4BB8) {
+ func_800B8614(&this->actor, globalCtx, 70.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Demo_heishi/EnDemoheishi_Draw.s")
+void EnDemoheishi_SetupTalk(EnDemoheishi* this) {
+ this->isTalking = true;
+ this->actionFunc = EnDemoheishi_Talk;
+}
+
+void EnDemoheishi_Talk(EnDemoheishi* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ func_801477B4(globalCtx);
+ EnDemoheishi_SetupIdle(this);
+ }
+}
+
+void EnDemoheishi_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnDemoheishi* this = THIS;
+
+ SkelAnime_Update(&this->skelAnime);
+ if (this->timer != 0) {
+ this->timer--;
+ }
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actionFunc(this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
+ Actor_SetScale(&this->actor, 0.01f);
+ EnDemoheishi_SetHeadRotation(this);
+
+ Actor_SetFocus(&this->actor, 60.0f);
+ Math_SmoothStepToS(&this->headRotX, this->headRotXTarget, 1, 0xBB8, 0);
+ Math_SmoothStepToS(&this->headRotY, this->headRotYTarget, 1, 0x3E8, 0);
+ Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliderCylinder.base);
+}
+
+s32 EnDemoheishi_OverrideLimbDraw(GlobalContext* globalctx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnDemoheishi* this = THIS;
+
+ if (limbIndex == DEMOHEISHI_LIMB_HEAD) {
+ rot->x += this->headRotX;
+ rot->y += this->headRotY;
+ rot->z += this->headRotZ;
+ }
+
+ return false;
+}
+
+void EnDemoheishi_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnDemoheishi* this = THIS;
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnDemoheishi_OverrideLimbDraw, NULL, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h
index 8dcdc899d7..e6a2f9a914 100644
--- a/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h
+++ b/src/overlays/actors/ovl_En_Demo_heishi/z_en_demo_heishi.h
@@ -7,12 +7,46 @@ struct EnDemoheishi;
typedef void (*EnDemoheishiActionFunc)(struct EnDemoheishi*, GlobalContext*);
+typedef enum {
+ /* 0 */ DEMOHEISHI_LIMB_NONE,
+ /* 1 */ DEMOHEISHI_LIMB_ROOT,
+ /* 2 */ DEMOHEISHI_LIMB_PELVIS,
+ /* 3 */ DEMOHEISHI_LIMB_LEFT_THIGH,
+ /* 4 */ DEMOHEISHI_LIMB_LEFT_SHIN,
+ /* 5 */ DEMOHEISHI_LIMB_LEFT_FOOT,
+ /* 6 */ DEMOHEISHI_LIMB_RIGHT_THIGH,
+ /* 7 */ DEMOHEISHI_LIMB_RIGHT_SHIN,
+ /* 8 */ DEMOHEISHI_LIMB_RIGHT_FOOT,
+ /* 9 */ DEMOHEISHI_LIMB_TORSO,
+ /* 10 */ DEMOHEISHI_LIMB_LEFT_SHOULDER,
+ /* 11 */ DEMOHEISHI_LIMB_LEFT_FOREARM,
+ /* 12 */ DEMOHEISHI_LIMB_LEFT_HAND,
+ /* 13 */ DEMOHEISHI_LIMB_RIGHT_SHOULDER,
+ /* 14 */ DEMOHEISHI_LIMB_RIGHT_FOREARM,
+ /* 15 */ DEMOHEISHI_LIMB_RIGHT_HAND_WITH_SPEAR,
+ /* 16 */ DEMOHEISHI_LIMB_HEAD,
+ /* 17 */ DEMOHEISHI_LIMB_MAX
+} EnDemoheishiLimbs;
+
typedef struct EnDemoheishi {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x110];
- /* 0x0254 */ EnDemoheishiActionFunc actionFunc;
- /* 0x0258 */ char unk_258[0x68];
-} EnDemoheishi; // size = 0x2C0
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ SkelAnime skelAnime;
+ /* 0x188 */ Vec3s jointTable[DEMOHEISHI_LIMB_MAX];
+ /* 0x1EE */ Vec3s morphTable[DEMOHEISHI_LIMB_MAX];
+ /* 0x254 */ EnDemoheishiActionFunc actionFunc;
+ /* 0x258 */ s16 headRotY;
+ /* 0x25A */ s16 headRotX;
+ /* 0x25C */ s16 headRotZ;
+ /* 0x25E */ s16 headRotYTarget;
+ /* 0x260 */ s16 headRotXTarget;
+ /* 0x262 */ s16 headRotZTarget;
+ /* 0x264 */ s32 animIndex;
+ /* 0x268 */ s16 timer;
+ /* 0x26C */ f32 frameCount;
+ /* 0x270 */ s16 isTalking;
+ /* 0x272 */ s16 textIdIndex;
+ /* 0x274 */ ColliderCylinder colliderCylinder;
+} EnDemoheishi; //size = 0x2C0
extern const ActorInit En_Demo_heishi_InitVars;
diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
index 907344cf5a..263469dac7 100644
--- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c
+++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c
@@ -5,8 +5,9 @@
*/
#include "z_en_dg.h"
+#include "objects/object_dog/object_dog.h"
-#define FLAGS 0x00800019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_800000)
#define THIS ((EnDg*)thisx)
@@ -36,17 +37,6 @@ void func_8098BB10(EnDg* this, GlobalContext* globalCtx);
void func_8098BBEC(EnDg* this, GlobalContext* globalCtx);
void func_8098BC54(EnDg* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000998;
-extern AnimationHeader D_06001048;
-extern AnimationHeader D_06001348;
-extern AnimationHeader D_06001560;
-extern AnimationHeader D_060017C0;
-extern AnimationHeader D_06001A84;
-extern AnimationHeader D_06001BD8;
-extern AnimationHeader D_06001FB0;
-extern AnimationHeader D_060021C8;
-extern FlexSkeletonHeader D_060080F0;
-
const ActorInit En_Dg_InitVars = {
ACTOR_EN_DG,
ACTORCAT_ENEMY,
@@ -139,31 +129,41 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_060021C8, 1.0f, 0, -1, 0, 0 }, { &D_060021C8, 1.0f, 0, -1, 0, -6 }, { &D_06001BD8, 1.0f, 0, -1, 0, 0 },
- { &D_06000998, 1.0f, 0, -1, 0, -6 }, { &D_06001FB0, 1.0f, 0, -1, 2, -6 }, { &D_06001FB0, 1.0f, 0, -1, 4, -6 },
- { &D_06001048, 1.0f, 0, -1, 2, -6 }, { &D_06001348, 1.0f, 0, -1, 0, -6 }, { &D_06001048, 1.0f, 0, 27, 2, -6 },
- { &D_06001048, 1.0f, 28, -1, 2, -6 }, { &D_06001048, 1.0f, 54, 54, 2, -6 }, { &D_060021C8, -1.5f, -1, 0, 0, -6 },
- { &D_06001560, 1.0f, 0, -1, 2, 0 }, { &D_06001A84, 1.2f, 0, -1, 2, 0 }, { &D_060017C0, 1.2f, 0, -1, 2, 0 },
- { &D_060021C8, 0.5f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_dog_Anim_0021C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dog_Anim_0021C8, 1.0f, 0, -1, ANIMMODE_LOOP, -6 },
+ { &object_dog_Anim_001BD8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dog_Anim_000998, 1.0f, 0, -1, ANIMMODE_LOOP, -6 },
+ { &object_dog_Anim_001FB0, 1.0f, 0, -1, ANIMMODE_ONCE, -6 },
+ { &object_dog_Anim_001FB0, 1.0f, 0, -1, ANIMMODE_LOOP_PARTIAL, -6 },
+ { &object_dog_Anim_001048, 1.0f, 0, -1, ANIMMODE_ONCE, -6 },
+ { &object_dog_Anim_001348, 1.0f, 0, -1, ANIMMODE_LOOP, -6 },
+ { &object_dog_Anim_001048, 1.0f, 0, 27, ANIMMODE_ONCE, -6 },
+ { &object_dog_Anim_001048, 1.0f, 28, -1, ANIMMODE_ONCE, -6 },
+ { &object_dog_Anim_001048, 1.0f, 54, 54, ANIMMODE_ONCE, -6 },
+ { &object_dog_Anim_0021C8, -1.5f, -1, 0, ANIMMODE_LOOP, -6 },
+ { &object_dog_Anim_001560, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dog_Anim_001A84, 1.2f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dog_Anim_0017C0, 1.2f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dog_Anim_0021C8, 0.5f, 0, -1, ANIMMODE_LOOP, 0 },
};
static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 1000, ICHAIN_STOP),
};
-void func_80989140(SkelAnime* skelAnime, ActorAnimationEntryS arg1[], s32 arg2) {
+void func_80989140(SkelAnime* skelAnime, AnimationInfoS arg1[], s32 arg2) {
f32 frameCount;
arg1 += arg2;
if (arg1->frameCount < 0) {
- frameCount = Animation_GetLastFrame(arg1->animationSeg);
+ frameCount = Animation_GetLastFrame(arg1->animation);
} else {
frameCount = arg1->frameCount;
}
- Animation_Change(skelAnime, arg1->animationSeg, arg1->playbackSpeed + (BREG(88) * 0.1f), arg1->frame, frameCount,
- arg1->mode, arg1->transitionRate);
+ Animation_Change(skelAnime, arg1->animation, arg1->playSpeed + (BREG(88) * 0.1f), arg1->startFrame, frameCount,
+ arg1->mode, arg1->morphFrames);
}
void func_80989204(EnDg* this, GlobalContext* globalCtx) {
@@ -357,9 +357,10 @@ void func_80989BF8(EnDg* this) {
if (this->unk_286 < 14) {
if (this->unk_286 % 2) {
D_8098C2A8[this->unk_286].unk_04 =
- 0x3538 + ((gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & 0xF0) >> 4);
+ 0x3538 + ((gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & (0x10 | 0x20 | 0x40 | 0x80)) >> 4);
} else {
- D_8098C2A8[this->unk_286].unk_04 = 0x3538 + (gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & 0xF);
+ D_8098C2A8[this->unk_286].unk_04 =
+ 0x3538 + (gSaveContext.weekEventReg[42 + (this->unk_286 / 2)] & (1 | 2 | 4 | 8));
}
} else {
Actor_MarkForDeath(&this->actor);
@@ -377,16 +378,16 @@ void func_80989BF8(EnDg* this) {
void func_80989D38(EnDg* this, GlobalContext* globalCtx) {
if (this->unk_286 == 21) {
if (CURRENT_DAY == 1) {
- func_801518B0(globalCtx, 0x91C, NULL);
+ Message_StartTextbox(globalCtx, 0x91C, NULL);
} else {
- func_801518B0(globalCtx, 0x91E, NULL);
+ Message_StartTextbox(globalCtx, 0x91E, NULL);
}
} else if ((this->unk_286 >= 0) && (this->unk_286 < 14)) {
- func_801518B0(globalCtx, D_8098C2A8[this->unk_286].unk_04, NULL);
+ Message_StartTextbox(globalCtx, D_8098C2A8[this->unk_286].unk_04, NULL);
} else if (this->unk_286 == 20) {
- func_801518B0(globalCtx, 0x353D, NULL);
+ Message_StartTextbox(globalCtx, 0x353D, NULL);
} else {
- func_801518B0(globalCtx, 0x627, NULL);
+ Message_StartTextbox(globalCtx, 0x627, NULL);
}
}
@@ -394,10 +395,10 @@ void func_80989E18(EnDg* this, GlobalContext* globalCtx) {
D_8098C2A8_s* temp;
if ((D_8098C2A0 != 0) && !(this->unk_280 & 1)) {
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
this->unk_280 |= 1;
} else if ((D_8098C2A0 == 0) && (this->unk_280 & 1)) {
- this->actor.flags &= ~0x8000000;
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
this->unk_280 &= ~1;
}
@@ -406,16 +407,16 @@ void func_80989E18(EnDg* this, GlobalContext* globalCtx) {
this->unk_290 = 1;
D_8098C2FC = D_8098C2A8[this->unk_286];
if (D_8098C2A0 == 0) {
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
D_8098C2A0 = 1;
this->unk_280 |= 1;
}
func_80989140(&this->skelAnime, sAnimations, 5);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
if (Player_GetMask(globalCtx) == PLAYER_MASK_TRUTH) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 100.0f);
this->actionFunc = func_8098BBEC;
} else {
@@ -698,7 +699,7 @@ void func_8098A938(EnDg* this, GlobalContext* globalCtx) {
this->actionFunc = func_8098AC34;
} else {
func_80989140(&this->skelAnime, sAnimations, 11);
- sAnimations[11].playbackSpeed = -1.0f;
+ sAnimations[11].playSpeed = -1.0f;
this->actionFunc = func_8098B198;
}
}
@@ -773,7 +774,7 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) {
if (sp26 < 9) {
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
- sAnimations[14].playbackSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
+ sAnimations[14].playSpeed = randPlusMinusPoint5Scaled(1.0f) + 3.0f;
}
func_80989864(this, globalCtx);
} else {
@@ -781,7 +782,7 @@ void func_8098AC34(EnDg* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, 9.0f)) {
f32 rand = randPlusMinusPoint5Scaled(1.5f);
- sAnimations[14].playbackSpeed = 1.2f;
+ sAnimations[14].playSpeed = 1.2f;
this->actor.velocity.y = 2.0f * rand + 3.0f;
this->actor.speedXZ = 8.0f + rand;
} else if (sp26 >= 0x15) {
@@ -838,7 +839,7 @@ void func_8098B004(EnDg* this, GlobalContext* globalCtx) {
this->actor.velocity.y = 0.0f;
this->actor.gravity = -3.0f;
- if ((this->actor.xzDistToPlayer < 60.0f) && (this->collider.base.ocFlags1 & 2)) {
+ if ((this->actor.xzDistToPlayer < 60.0f) && (this->collider.base.ocFlags1 & OC1_HIT)) {
this->actor.shape.rot.y += 0x71C;
} else {
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xC00);
@@ -1054,9 +1055,9 @@ void func_8098B88C(EnDg* this, GlobalContext* globalCtx) {
void func_8098BA64(EnDg* this, GlobalContext* globalCtx) {
if (Actor_HasNoParent(&this->actor, globalCtx)) {
this->unk_290 = 2;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (D_8098C2A0 != 0) {
- this->actor.flags &= ~0x8000000;
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
D_8098C2A0 = 0;
this->unk_280 &= ~1;
}
@@ -1096,7 +1097,7 @@ void func_8098BB10(EnDg* this, GlobalContext* globalCtx) {
void func_8098BBEC(EnDg* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80989D38(this, globalCtx);
this->actionFunc = func_8098BC54;
} else {
@@ -1116,7 +1117,8 @@ void EnDg_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, NULL, this->jointTable, this->morphTable, 13);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dog_Skel_0080F0, NULL, this->jointTable, this->morphTable,
+ 13);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@@ -1174,11 +1176,11 @@ void EnDg_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_8098BFB8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
- return 0;
+s32 EnDg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ return false;
}
-void func_8098BFD4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnDg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnDg* this = THIS;
Vec3f sp20 = { 0.0f, 20.0f, 0.0f };
@@ -1231,7 +1233,7 @@ void EnDg_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_8098BFB8, func_8098BFD4, &this->actor);
+ EnDg_OverrideLimbDraw, EnDg_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
index 7c7b2811cb..079abb641e 100644
--- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
+++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.c
@@ -5,8 +5,9 @@
*/
#include "z_en_dinofos.h"
+#include "objects/object_dinofos/object_dinofos.h"
-#define FLAGS 0x00000435
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_400)
#define THIS ((EnDinofos*)thisx)
@@ -56,25 +57,6 @@ void func_8089C398(EnDinofos* this);
void func_8089C164(EnDinofos* this);
void func_8089C244(EnDinofos* this);
-extern FlexSkeletonHeader D_06009570;
-extern AnimationHeader D_06002E40;
-extern AnimationHeader D_060025B4;
-extern AnimationHeader D_06000580;
-extern AnimationHeader D_06001CCC;
-extern AnimationHeader D_0600ABD0;
-extern AnimationHeader D_0600D62C;
-extern AnimationHeader D_06001040;
-extern AnimationHeader D_060013C0;
-extern AnimationHeader D_060017B8;
-extern AnimationHeader D_0600C974;
-extern AnimationHeader D_06009B70;
-extern AnimationHeader D_06000AF0;
-extern AnimationHeader D_0600D21C;
-extern Gfx D_06008E30[];
-extern Gfx D_06009030[];
-extern Gfx D_06009230[];
-extern Gfx D_06009030[];
-
const ActorInit En_Dinofos_InitVars = {
ACTOR_EN_DINOFOS,
ACTORCAT_ENEMY,
@@ -259,11 +241,11 @@ static DamageTable sDamageTable = {
static CollisionCheckInfoInit sColChkInfoInit = { 4, 40, 100, 80 };
-static Gfx* D_8089E33C[] = {
- D_06008E30,
- D_06009030,
- D_06009230,
- D_06009030,
+static TexturePtr D_8089E33C[] = {
+ object_dinofos_Tex_008E30,
+ object_dinofos_Tex_009030,
+ object_dinofos_Tex_009230,
+ object_dinofos_Tex_009030,
};
static s16 D_8089E34C = -1;
@@ -293,7 +275,8 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) {
this->colliderJntSphElement);
Collider_InitAndSetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009570, &D_06002E40, this->jointTable, this->morphTable, 21);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dinofos_Skel_009570, &object_dinofos_Anim_002E40,
+ this->jointTable, this->morphTable, 21);
if (D_8089E364 == 0) {
for (i = 0; i < ARRAY_COUNT(D_8089E33C); i++) {
@@ -312,7 +295,7 @@ void EnDinofos_Init(Actor* thisx, GlobalContext* globalCtx) {
if (thisx->cutscene == -1) {
func_8089B7B0(this);
} else {
- this->actor.flags |= 0x100000;
+ this->actor.flags |= ACTOR_FLAG_100000;
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
D_8089E34C = thisx->cutscene;
@@ -380,11 +363,11 @@ void func_8089A9B0(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089ABF4(EnDinofos* this, GlobalContext* globalCtx) {
- if (this->camId != 0) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
+ if (this->subCamId != CAM_ID_MAIN) {
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
- Play_CameraSetAtEye(globalCtx, 0, &camera->at, &camera->eye);
- this->camId = 0;
+ Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &subCam->at, &subCam->eye);
+ this->subCamId = CAM_ID_MAIN;
ActorCutscene_Stop(this->actor.cutscene);
if (this->actor.colChkInfo.health == 0) {
func_800B724C(globalCtx, &this->actor, 6);
@@ -399,7 +382,7 @@ void func_8089AC70(EnDinofos* this) {
this->unk_2B8 = 0.82500005f;
this->unk_2B0 = 1.0f;
this->unk_290 = 80;
- this->actor.flags &= ~0x400;
+ this->actor.flags &= ~ACTOR_FLAG_400;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
}
@@ -409,7 +392,7 @@ void func_8089ACEC(EnDinofos* this, GlobalContext* globalCtx) {
this->colliderJntSph.base.colType = COLTYPE_HIT0;
this->unk_2B0 = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D4, 12, 2, 0.3f, 0.2f);
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -479,13 +462,14 @@ s32 func_8089AE00(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089B100(EnDinofos* this, GlobalContext* globalCtx) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
Player* player = GET_PLAYER(globalCtx);
Vec3f sp3C;
- Animation_Change(&this->skelAnime, &D_06001CCC, 1.0f, Animation_GetLastFrame(&D_06001CCC),
- Animation_GetLastFrame(&D_06001CCC), 2, 0.0f);
- func_800BE33C(&camera->eye, &camera->at, &this->unk_29A, true);
+ Animation_Change(&this->skelAnime, &object_dinofos_Anim_001CCC, 1.0f,
+ Animation_GetLastFrame(&object_dinofos_Anim_001CCC),
+ Animation_GetLastFrame(&object_dinofos_Anim_001CCC), 2, 0.0f);
+ func_800BE33C(&subCam->eye, &subCam->at, &this->unk_29A, true);
Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &sp3C);
this->unk_2BC.x = player->actor.world.pos.x + (0.4f * sp3C.x);
this->unk_2BC.y = player->actor.world.pos.y + 5.0f;
@@ -493,19 +477,19 @@ void func_8089B100(EnDinofos* this, GlobalContext* globalCtx) {
this->unk_2C8.x = this->actor.world.pos.x;
this->unk_2C8.y = this->actor.focus.pos.y - 400.0f;
this->unk_2C8.z = this->actor.world.pos.z;
- this->unk_2AC = Math_Vec3f_DistXYZ(&camera->eye, &this->unk_2BC) * 0.05f;
- this->unk_2A8 = Math_Vec3f_DistXYZ(&camera->at, &this->unk_2C8) * 0.05f;
+ this->unk_2AC = Math_Vec3f_DistXYZ(&subCam->eye, &this->unk_2BC) * 0.05f;
+ this->unk_2A8 = Math_Vec3f_DistXYZ(&subCam->at, &this->unk_2C8) * 0.05f;
this->unk_290 = 20;
this->actionFunc = func_8089B288;
}
void func_8089B288(EnDinofos* this, GlobalContext* globalCtx) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
this->unk_290--;
- Math_Vec3f_StepTo(&camera->eye, &this->unk_2BC, this->unk_2AC);
- Math_Vec3f_StepTo(&camera->at, &this->unk_2C8, this->unk_2A8);
- Play_CameraSetAtEye(globalCtx, this->camId, &camera->at, &camera->eye);
+ Math_Vec3f_StepTo(&subCam->eye, &this->unk_2BC, this->unk_2AC);
+ Math_Vec3f_StepTo(&subCam->at, &this->unk_2C8, this->unk_2A8);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &subCam->at, &subCam->eye);
if (this->unk_290 == 0) {
func_8089B320(this);
}
@@ -522,24 +506,24 @@ void func_8089B320(EnDinofos* this) {
}
void func_8089B3D4(EnDinofos* this, GlobalContext* globalCtx) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
- Vec3f sp28;
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
+ Vec3f subCamAt;
- Math_Vec3f_StepTo(&camera->eye, &this->unk_2BC, 10.0f);
+ Math_Vec3f_StepTo(&subCam->eye, &this->unk_2BC, 10.0f);
this->unk_290++;
if (this->unk_290 == 10) {
func_801A2E54(NA_BGM_MINI_BOSS);
}
- sp28.x = this->actor.world.pos.x;
- sp28.z = this->actor.world.pos.z;
- if (this->actor.focus.pos.y <= camera->at.y) {
- sp28.y = this->actor.focus.pos.y;
+ subCamAt.x = this->actor.world.pos.x;
+ subCamAt.z = this->actor.world.pos.z;
+ if (this->actor.focus.pos.y <= subCam->at.y) {
+ subCamAt.y = this->actor.focus.pos.y;
} else {
- sp28.y = camera->at.y;
+ subCamAt.y = subCam->at.y;
}
- Play_CameraSetAtEye(globalCtx, this->camId, &sp28, &camera->eye);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCam->eye);
if (this->actor.bgCheckFlags & 1) {
func_8089B4A4(this);
}
@@ -549,7 +533,7 @@ void func_8089B4A4(EnDinofos* this) {
if (this->unk_290 < 10) {
func_801A2E54(NA_BGM_MINI_BOSS);
}
- Animation_PlayOnce(&this->skelAnime, &D_0600C974);
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00C974);
this->unk_2BC.x = (Math_SinS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.x;
this->unk_2BC.y = this->actor.floorHeight + 11.0f;
this->unk_2BC.z = (Math_CosS(this->actor.shape.rot.y + 0x200) * 123.0f) + this->actor.world.pos.z;
@@ -560,27 +544,27 @@ void func_8089B4A4(EnDinofos* this) {
}
void func_8089B580(EnDinofos* this, GlobalContext* globalCtx) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
this->unk_290++;
if (this->unk_290 < 8) {
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &camera->eye);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.focus.pos, &subCam->eye);
}
if (this->skelAnime.curFrame > 35.0f) {
if ((globalCtx->sceneNum == SCENE_MITURIN) && Animation_OnFrame(&this->skelAnime, 38.0f)) {
- globalCtx->envCtx.unk_C3 = 11;
+ globalCtx->envCtx.lightSettingOverride = 11;
}
- Math_Vec3f_StepTo(&camera->eye, &this->unk_2BC, 10.0f);
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &camera->eye);
+ Math_Vec3f_StepTo(&subCam->eye, &this->unk_2BC, 10.0f);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.focus.pos, &subCam->eye);
if (this->skelAnime.curFrame <= 55.0f) {
func_800B9010(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
}
}
if ((globalCtx->sceneNum == SCENE_MITURIN) && Animation_OnFrame(&this->skelAnime, 55.0f)) {
- globalCtx->envCtx.unk_C3 = 0xFF;
+ globalCtx->envCtx.lightSettingOverride = 0xFF;
}
if (SkelAnime_Update(&this->skelAnime)) {
@@ -589,7 +573,7 @@ void func_8089B580(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089B6E8(EnDinofos* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009B70, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_009B70, -3.0f);
this->actionFunc = func_8089B72C;
}
@@ -600,14 +584,14 @@ void func_8089B72C(EnDinofos* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
func_8089ABF4(this, globalCtx);
- this->actor.flags &= ~0x00100000;
+ this->actor.flags &= ~ACTOR_FLAG_100000;
this->actor.cutscene = -1;
func_8089B7B0(this);
}
}
void func_8089B7B0(EnDinofos* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06002E40, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_002E40, -4.0f);
this->unk_290 = (s32)Rand_ZeroFloat(20.0f) + 40;
this->unk_292 = 30;
this->actor.speedXZ = 0.0f;
@@ -635,7 +619,7 @@ void func_8089B8B0(EnDinofos* this, GlobalContext* globalCtx) {
f32 phi_f0;
if (this->actionFunc != func_8089B98C) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f);
if (Actor_OtherIsTargeted(globalCtx, &this->actor)) {
phi_f0 = 170.0f;
} else {
@@ -690,7 +674,7 @@ void func_8089B98C(EnDinofos* this, GlobalContext* globalCtx) {
void func_8089BAC0(EnDinofos* this) {
if (this->actionFunc != func_8089BB60) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000580, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dinofos_Anim_000580, -4.0f);
this->actor.speedXZ = 0.0f;
}
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) > 0) {
@@ -731,8 +715,8 @@ void func_8089BBB4(EnDinofos* this, GlobalContext* globalCtx) {
if (this->actionFunc == func_8089D1E0) {
this->skelAnime.playSpeed = this->actor.speedXZ * 0.166666671634f;
} else {
- Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * 0.166666671634f, 0.0f, 0.0f, 0,
- -4.0f);
+ Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * 0.166666671634f, 0.0f,
+ 0.0f, 0, -4.0f);
}
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
@@ -811,10 +795,10 @@ void func_8089BD28(EnDinofos* this, GlobalContext* globalCtx) {
void func_8089C024(EnDinofos* this, s32 arg1) {
if (arg1 == 0) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, 2.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001CCC, 2.0f);
func_8089AD70(this);
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001CCC, -1.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001CCC, -1.0f);
if ((arg1 == 2) || (arg1 == 3)) {
this->colliderJntSph.base.acFlags &= ~AC_ON;
func_8089AD70(this);
@@ -878,10 +862,10 @@ void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
this->unk_290++;
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x1800);
- if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animation == &D_06001CCC)) {
+ if ((this->actor.velocity.y < 0.0f) && (this->skelAnime.animation == &object_dinofos_Anim_001CCC)) {
this->colliderQuad.base.atFlags |= AT_ON;
this->colliderJntSph.base.acFlags |= AC_ON;
- Animation_Change(&this->skelAnime, &D_060025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f);
+ Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, 1.0f, 7.0f, 13.0f, 2, -2.0f);
}
if (this->actor.bgCheckFlags & 1) {
@@ -892,9 +876,9 @@ void func_8089C2A8(EnDinofos* this, GlobalContext* globalCtx) {
void func_8089C398(EnDinofos* this) {
if (this->actionFunc != func_8089C2A8) {
- Animation_PlayOnce(&this->skelAnime, &D_06000AF0);
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_000AF0);
} else {
- this->skelAnime.endFrame = Animation_GetLastFrame(&D_060025B4);
+ this->skelAnime.endFrame = Animation_GetLastFrame(&object_dinofos_Anim_0025B4);
}
if (this->actor.speedXZ < 0.0f) {
@@ -921,7 +905,7 @@ void func_8089C44C(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089C4F8(EnDinofos* this) {
- Animation_PlayOnce(&this->skelAnime, &D_060025B4);
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_0025B4);
this->colliderQuad.base.atFlags &= ~AT_BOUNCED;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_CRY);
this->unk_290 = 0;
@@ -952,7 +936,7 @@ void func_8089C56C(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089C690(EnDinofos* this) {
- Animation_Change(&this->skelAnime, &D_060025B4, -1.0f, this->skelAnime.curFrame, 0.0f, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_dinofos_Anim_0025B4, -1.0f, this->skelAnime.curFrame, 0.0f, 2, 0.0f);
this->colliderQuad.base.atFlags &= ~(AT_ON | AT_BOUNCED);
if (this->actionFunc != func_8089C2A8) {
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -1002,7 +986,7 @@ void func_8089C7B8(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089C87C(EnDinofos* this, s32 arg1) {
- Animation_PlayOnce(&this->skelAnime, &D_0600D21C);
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00D21C);
func_800BE5CC(&this->actor, &this->colliderJntSph, arg1);
this->actor.shape.rot.y = BINANG_ROT180(this->actor.world.rot.y);
this->actor.speedXZ = 10.0f;
@@ -1035,7 +1019,7 @@ void func_8089C938(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089CA14(EnDinofos* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001040, -5.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dinofos_Anim_001040, -5.0f);
this->colliderJntSph.base.acFlags |= AC_ON;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -1056,7 +1040,7 @@ void func_8089CB10(EnDinofos* this, GlobalContext* globalCtx) {
s32 i;
Sphere16* worldSphere;
- Animation_PlayLoop(&this->skelAnime, &D_060013C0);
+ Animation_PlayLoop(&this->skelAnime, &object_dinofos_Anim_0013C0);
this->unk_290 = 20;
this->actor.speedXZ = 0.0f;
this->colliderJntSph.base.atFlags |= AT_ON;
@@ -1070,7 +1054,7 @@ void func_8089CB10(EnDinofos* this, GlobalContext* globalCtx) {
}
if (globalCtx->sceneNum == SCENE_MITURIN) {
- globalCtx->envCtx.unk_C3 = 11;
+ globalCtx->envCtx.lightSettingOverride = 11;
}
this->actionFunc = func_8089CBEC;
@@ -1128,10 +1112,10 @@ void func_8089CBEC(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089CF00(EnDinofos* this, GlobalContext* globalCtx) {
- Animation_PlayOnce(&this->skelAnime, &D_060017B8);
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_0017B8);
this->colliderJntSph.base.atFlags &= ~AT_ON;
if (globalCtx->sceneNum == SCENE_MITURIN) {
- globalCtx->envCtx.unk_C3 = 255;
+ globalCtx->envCtx.lightSettingOverride = 255;
}
this->actionFunc = func_8089CF70;
}
@@ -1143,8 +1127,8 @@ void func_8089CF70(EnDinofos* this, GlobalContext* globalCtx) {
}
void func_8089CFAC(EnDinofos* this) {
- Animation_PlayOnce(&this->skelAnime, &D_0600ABD0);
- this->actor.flags &= ~1;
+ Animation_PlayOnce(&this->skelAnime, &object_dinofos_Anim_00ABD0);
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_DEAD);
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -1183,7 +1167,8 @@ void func_8089D11C(EnDinofos* this, s16 arg1) {
} else {
this->actor.speedXZ = 15.0f;
}
- Animation_Change(&this->skelAnime, &D_0600D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0, -4.0f);
+ Animation_Change(&this->skelAnime, &object_dinofos_Anim_00D62C, this->actor.speedXZ * (1.0f / 7.5f), 0.0f, 0.0f, 0,
+ -4.0f);
this->actor.world.rot.y = BINANG_ADD(this->actor.shape.rot.y, 0x4000);
this->unk_292 = 10;
this->unk_2A4 = 0.0f;
@@ -1216,7 +1201,7 @@ void func_8089D2E0(EnDinofos* this) {
}
void func_8089D318(EnDinofos* this, GlobalContext* globalCtx) {
- Vec3f sp24;
+ Vec3f subCamEye;
if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
if (this->actor.colChkInfo.health == 0) {
@@ -1225,12 +1210,12 @@ void func_8089D318(EnDinofos* this, GlobalContext* globalCtx) {
} else {
ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
}
- this->camId = ActorCutscene_GetCurrentCamera(this->actor.cutscene);
+ this->subCamId = ActorCutscene_GetCurrentCamera(this->actor.cutscene);
if (this->actor.colChkInfo.health == 0) {
- sp24.x = (Math_SinS(this->actor.shape.rot.y) * 150.0f) + this->actor.focus.pos.x;
- sp24.y = this->actor.focus.pos.y;
- sp24.z = (Math_CosS(this->actor.shape.rot.y) * 150.0f) + this->actor.focus.pos.z;
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &sp24);
+ subCamEye.x = (Math_SinS(this->actor.shape.rot.y) * 150.0f) + this->actor.focus.pos.x;
+ subCamEye.y = this->actor.focus.pos.y;
+ subCamEye.z = (Math_CosS(this->actor.shape.rot.y) * 150.0f) + this->actor.focus.pos.z;
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.focus.pos, &subCamEye);
func_8089CFAC(this);
} else {
func_8089B100(this, globalCtx);
@@ -1300,7 +1285,7 @@ s32 func_8089D60C(EnDinofos* this, GlobalContext* globalCtx) {
func_8089ACEC(this, globalCtx);
func_8089AD70(this);
if (globalCtx->sceneNum == SCENE_MITURIN) {
- globalCtx->envCtx.unk_C3 = 255;
+ globalCtx->envCtx.lightSettingOverride = 255;
}
this->colliderQuad.base.atFlags &= ~(AT_ON | AT_BOUNCED);
@@ -1355,8 +1340,8 @@ s32 func_8089D60C(EnDinofos* this, GlobalContext* globalCtx) {
}
void EnDinofos_Update(Actor* thisx, GlobalContext* globalCtx2) {
- EnDinofos* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnDinofos* this = THIS;
s32 pad;
Vec3f sp30;
diff --git a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h
index e6a00853e1..961780b942 100644
--- a/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h
+++ b/src/overlays/actors/ovl_En_Dinofos/z_en_dinofos.h
@@ -22,7 +22,7 @@ typedef struct EnDinofos {
/* 0x290 */ s16 unk_290;
/* 0x292 */ s16 unk_292;
/* 0x294 */ UNK_TYPE1 unk_294[4];
- /* 0x298 */ s16 camId;
+ /* 0x298 */ s16 subCamId;
/* 0x29A */ Vec3s unk_29A;
/* 0x2A0 */ s32 unk_2A0;
/* 0x2A4 */ f32 unk_2A4;
diff --git a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c
index 7e4b67b7c3..a637174bfb 100644
--- a/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c
+++ b/src/overlays/actors/ovl_En_Dnb/z_en_dnb.c
@@ -5,8 +5,10 @@
*/
#include "z_en_dnb.h"
+#include "objects/object_hanareyama_obj/object_hanareyama_obj.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x000000B0
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_80)
#define THIS ((EnDnb*)thisx)
@@ -19,12 +21,6 @@ s32 func_80A507C0(EnDnbUnkStruct* arg0, Vec3f arg1, Vec3f arg2, u8 arg3, f32 arg
s32 func_80A5086C(EnDnbUnkStruct* arg0);
s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx);
-extern Gfx D_06000000[];
-extern Gfx D_06000020[];
-extern Gfx D_06004638[];
-extern Vec3s D_06004710[];
-extern CollisionHeader D_06004D8C;
-
const ActorInit En_Dnb_InitVars = {
ACTOR_EN_DNB,
ACTORCAT_BG,
@@ -109,9 +105,9 @@ void EnDnb_Init(Actor* thisx, GlobalContext* globalCtx) {
s16* alloc;
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06004D8C);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hanareyama_obj_Colheader_004D8C);
- alloc = (s16*)Lib_SegmentedToVirtual(D_06004710);
+ alloc = (s16*)Lib_SegmentedToVirtual(object_hanareyama_obj_Vec_004710);
for (i = 0; i < ARRAY_COUNT(this->particles); i++) {
func_80A4FDD0(&this->particles[i], this, alloc, i);
}
@@ -156,7 +152,7 @@ void EnDnb_Update(Actor* thisx, GlobalContext* globalCtx) {
void func_80A50510(EnDnb* this, GlobalContext* globalCtx) {
s32 i;
- Gfx** gfx = Lib_SegmentedToVirtual(D_06004638);
+ Gfx** gfx = Lib_SegmentedToVirtual(object_hanareyama_obj_DLArray_004638);
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -181,7 +177,7 @@ void func_80A50510(EnDnb* this, GlobalContext* globalCtx) {
void func_80A5063C(EnDnb* this, GlobalContext* globalCtx) {
s32 i;
- Gfx** gfx = Lib_SegmentedToVirtual(D_06004638);
+ Gfx** gfx = Lib_SegmentedToVirtual(object_hanareyama_obj_DLArray_004638);
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -259,7 +255,7 @@ s32 func_80A5086C(EnDnbUnkStruct* arg0) {
s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
static TexturePtr D_80A50CBC[] = {
- D_0408F7E0, D_0408F3E0, D_0408EFE0, D_0408EBE0, D_0408E7E0, D_0408E3E0, D_0408DFE0, D_0408DBE0,
+ gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
};
GlobalContext* globalCtx = globalCtx2;
s32 isGfxSetup = false;
@@ -275,7 +271,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
if (arg0->isEnabled == 1) {
if (!isGfxSetup) {
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0);
- gSPDisplayList(POLY_XLU_DISP++, D_06000000);
+ gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000000);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 0);
isGfxSetup = true;
}
@@ -294,7 +290,7 @@ s32 func_80A50950(EnDnbUnkStruct* arg0, GlobalContext* globalCtx2) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
idx = (arg0->unk_01 / (f32)arg0->unk_02) * 8.0f;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A50CBC[idx]));
- gSPDisplayList(POLY_XLU_DISP++, D_06000020);
+ gSPDisplayList(POLY_XLU_DISP++, object_hanareyama_obj_DL_000020);
Matrix_StatePop();
sp5C += 1;
diff --git a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c
index ecd6e8ffc8..25fbaefaca 100644
--- a/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c
+++ b/src/overlays/actors/ovl_En_Dnh/z_en_dnh.c
@@ -6,7 +6,7 @@
#include "z_en_dnh.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDnh*)thisx)
diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c
index 2dcf85e3d0..d04ed3ee1f 100644
--- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c
+++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c
@@ -5,8 +5,11 @@
*/
#include "z_en_dnk.h"
+#include "objects/object_dnk/object_dnk.h"
+#include "objects/object_hintnuts/object_hintnuts.h"
+#include "objects/object_dekunuts/object_dekunuts.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDnk*)thisx)
@@ -19,39 +22,6 @@ void EnDnk_DoNothing(EnDnk* this, GlobalContext* globalCtx);
void func_80A52018(Actor* thisx, GlobalContext* globalCtx);
void func_80A52134(EnDnk* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000168;
-extern AnimationHeader D_0600031C;
-extern AnimationHeader D_06000430;
-extern AnimationHeader D_060006CC;
-extern AnimationHeader D_06000894;
-extern AnimationHeader D_06000B70;
-extern UNK_PTR D_06001680[];
-extern UNK_PTR D_06001700[];
-extern UNK_PTR D_06001780[];
-extern SkeletonHeader D_060023B8;
-extern SkeletonHeader D_06002468;
-extern AnimationHeader D_060024CC;
-extern AnimationHeader D_0600259C;
-extern AnimationHeader D_060026C4;
-extern SkeletonHeader D_06002848;
-extern AnimationHeader D_06002894;
-extern AnimationHeader D_06002950;
-extern AnimationHeader D_060029BC;
-extern AnimationHeader D_06002A08;
-extern AnimationHeader D_06002A5C;
-extern AnimationHeader D_06002B6C;
-extern AnimationHeader D_06002B90;
-extern AnimationHeader D_06002BD4;
-extern AnimationHeader D_06002DD4;
-extern AnimationHeader D_06002E84;
-extern AnimationHeader D_06002F7C;
-extern AnimationHeader D_06002FA4;
-extern AnimationHeader D_06003128;
-extern AnimationHeader D_06003180;
-extern AnimationHeader D_0600326C;
-extern AnimationHeader D_060033E4;
-extern AnimationHeader D_06003780;
-
static s16 D_80A521A0 = 0;
const ActorInit En_Dnk_InitVars = {
@@ -123,19 +93,43 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06000B70, 1.0f, 0, -1, 2, 0 }, { &D_06000B70, 1.0f, 0, -1, 2, -4 }, { &D_06002A08, 1.0f, 0, -1, 0, -4 },
- { &D_0600031C, 1.0f, 0, -1, 0, -4 }, { &D_06000430, 1.0f, -1, -1, 2, 0 }, { &D_06000430, 1.0f, 0, -1, 2, -4 },
- { &D_06000894, 1.0f, 0, -1, 2, -4 }, { &D_06002B6C, 1.0f, 0, -1, 0, 0 }, { &D_06002B6C, 1.0f, 0, -1, 0, -4 },
- { &D_060006CC, 1.0f, 0, -1, 0, -4 }, { &D_06000168, 1.0f, 0, -1, 2, -4 }, { &D_060024CC, 1.0f, -1, -1, 2, 0 },
- { &D_060024CC, 1.0f, 0, -1, 2, -4 }, { &D_060026C4, 1.0f, 0, -1, 2, -4 }, { &D_06002894, 1.0f, 0, -1, 2, -4 },
- { &D_06002B90, 1.0f, 0, -1, 2, -4 }, { &D_06002F7C, 1.0f, 0, -1, 0, 0 }, { &D_06002F7C, 1.0f, 0, -1, 0, -4 },
- { &D_06003128, 1.0f, 0, -1, 0, 0 }, { &D_06003128, 1.0f, 0, -1, 0, -4 }, { &D_060029BC, 1.0f, 0, -1, 0, -4 },
- { &D_06002E84, 1.0f, 0, -1, 0, -4 }, { &D_06000168, 1.0f, 0, -1, 0, -4 }, { &D_0600259C, 1.0f, 0, -1, 2, -4 },
- { &D_06002A5C, 1.0f, 0, -1, 2, 0 }, { &D_06002A5C, 1.0f, 0, -1, 2, -4 }, { &D_06002BD4, 1.0f, 0, -1, 2, -4 },
- { &D_06002DD4, 1.0f, 0, -1, 2, -4 }, { &D_06002FA4, 1.0f, 0, -1, 0, -4 }, { &D_06003180, 1.0f, 0, -1, 2, -4 },
- { &D_0600326C, 1.0f, 0, -1, 0, 0 }, { &D_0600326C, 1.0f, 0, -1, 0, -4 }, { &D_060033E4, 1.0f, 0, -1, 0, -4 },
- { &D_06003780, 1.0f, 0, -1, 0, 0 }, { &D_06003780, 1.0f, 0, -1, 0, -4 }, { &D_06002950, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_dnk_Anim_000B70, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnk_Anim_000B70, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnk_Anim_002A08, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnk_Anim_00031C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnk_Anim_000430, 1.0f, -1, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnk_Anim_000430, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnk_Anim_000894, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnk_Anim_002B6C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnk_Anim_002B6C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnk_Anim_0006CC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_hintnuts_Anim_000168, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_hintnuts_Anim_0024CC, 1.0f, -1, -1, ANIMMODE_ONCE, 0 },
+ { &object_hintnuts_Anim_0024CC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_hintnuts_Anim_0026C4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_hintnuts_Anim_002894, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_hintnuts_Anim_002B90, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_hintnuts_Anim_002F7C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_hintnuts_Anim_003128, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_hintnuts_Anim_003128, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_hintnuts_Anim_0029BC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_hintnuts_Anim_002E84, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_000168, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_00259C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dekunuts_Anim_002A5C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dekunuts_Anim_002BD4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dekunuts_Anim_002DD4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dekunuts_Anim_002FA4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_003180, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dekunuts_Anim_00326C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_0033E4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_003780, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dekunuts_Anim_003780, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dekunuts_Anim_002950, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) {
@@ -144,18 +138,18 @@ s32 func_80A514F0(SkelAnime* skelAnime, s16 animIndex) {
s32 sp30 = false;
if (animIndex >= 0) {
- if (animIndex < 36) {
+ if (animIndex < ARRAY_COUNT(sAnimations)) {
sp30 = true;
frameCount = sAnimations[animIndex].frameCount;
if (frameCount < 0) {
- frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg);
+ frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
}
- frame = sAnimations[animIndex].frame;
+ frame = sAnimations[animIndex].startFrame;
if (frame < 0) {
frame = frameCount;
}
- Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
- frame, frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].transitionRate);
+ Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed, frame,
+ frameCount, sAnimations[animIndex].mode, sAnimations[animIndex].morphFrames);
}
}
return sp30;
@@ -176,7 +170,7 @@ s32 func_80A515C4(EnDnk* this) {
}
void func_80A51648(EnDnk* this, GlobalContext* globalCtx) {
- if (func_8013D8DC(this->unk_28E, globalCtx) == 1) {
+ if (SubS_IsObjectLoaded(this->unk_28E, globalCtx) == true) {
gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->unk_28E].segment);
this->actor.draw = func_80A52018;
this->actor.objBankIndex = this->unk_28E;
@@ -184,17 +178,20 @@ void func_80A51648(EnDnk* this, GlobalContext* globalCtx) {
switch (ENDNK_GET_3(&this->actor)) {
case ENDNK_GET_3_0:
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002848, NULL, this->jointTable, this->morphTable, 11);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dnk_Skel_002848, NULL, this->jointTable,
+ this->morphTable, 11);
func_80A514F0(&this->skelAnime, 7);
break;
case ENDNK_GET_3_1:
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_060023B8, NULL, this->jointTable, this->morphTable, 10);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_hintnuts_Skel_0023B8.sh, NULL, this->jointTable,
+ this->morphTable, 10);
func_80A514F0(&this->skelAnime, 18);
break;
case ENDNK_GET_3_2:
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002468, NULL, this->jointTable, this->morphTable, 10);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekunuts_Skel_002468, NULL, this->jointTable,
+ this->morphTable, 10);
func_80A514F0(&this->skelAnime, 35);
break;
}
@@ -203,12 +200,12 @@ void func_80A51648(EnDnk* this, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (ENDNK_GET_3C(&this->actor) == 4) {
- this->actor.flags &= ~1;
- this->actor.flags |= (0x10 | 0x20);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
this->actionFunc = func_80A51890;
Actor_SetScale(&this->actor, 0.1f);
} else {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = EnDnk_DoNothing;
Actor_SetScale(&this->actor, 0.01f);
}
@@ -216,8 +213,8 @@ void func_80A51648(EnDnk* this, GlobalContext* globalCtx) {
}
void func_80A51890(EnDnk* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x7E)) {
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x7E));
+ if (Cutscene_CheckActorAction(globalCtx, 126)) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 126));
}
}
@@ -230,15 +227,15 @@ void EnDnk_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_28E = -1;
switch (ENDNK_GET_3(&this->actor)) {
case ENDNK_GET_3_1:
- this->unk_28E = func_8013D924(0x12B, globalCtx);
+ this->unk_28E = SubS_GetObjectIndex(OBJECT_HINTNUTS, globalCtx);
break;
case ENDNK_GET_3_0:
- this->unk_28E = func_8013D924(0x135, globalCtx);
+ this->unk_28E = SubS_GetObjectIndex(OBJECT_DNK, globalCtx);
break;
case ENDNK_GET_3_2:
- this->unk_28E = func_8013D924(0x40, globalCtx);
+ this->unk_28E = SubS_GetObjectIndex(OBJECT_DEKUNUTS, globalCtx);
break;
}
@@ -328,10 +325,10 @@ void func_80A51AA4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
void func_80A51CB8(EnDnk* this, GlobalContext* globalCtx) {
- static UNK_PTR D_80A5245C[] = {
- D_06001680,
- D_06001700,
- D_06001780,
+ static TexturePtr D_80A5245C[] = {
+ object_dnk_Tex_001680,
+ object_dnk_Tex_001700,
+ object_dnk_Tex_001780,
};
s32 pad;
diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c
index 2a352380cf..f05817282f 100644
--- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c
+++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c
@@ -7,8 +7,9 @@
#include "z_en_dno.h"
#include "overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h"
#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_dno/object_dno.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnDno*)thisx)
@@ -39,37 +40,19 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx);
s32 EnDno_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
void EnDno_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
-extern AnimationHeader D_06000470;
-extern AnimationHeader D_060008F0;
-extern AnimationHeader D_06000F6C;
-extern AnimationHeader D_06001A50;
-extern AnimationHeader D_06002530;
-extern AnimationHeader D_06003320;
-extern AnimationHeader D_060036D0;
-extern AnimationHeader D_060041CC;
-extern AnimationHeader D_06004DD8;
-extern AnimationHeader D_060051E4;
-extern AnimationHeader D_06005E20;
-extern AnimationHeader D_06005F98;
-extern AnimationHeader D_06006488;
-extern AnimationHeader D_06006F84;
-extern AnimationHeader D_060073E4;
-extern AnimationHeader D_060077A8;
-extern AnimationHeader D_06007CA4;
-extern AnimationHeader D_06008324;
-extern AnimationHeader D_06008AE4;
-extern AnimationHeader D_06009100;
-extern FlexSkeletonHeader D_0600E1F8;
extern u8 D_801C20C0;
-static struct_80B8E1A8 sAnimations[] = {
- { &D_06000470, 1.0f, 2, 0.0f }, { &D_060008F0, 1.0f, 2, 0.0f }, { &D_06000F6C, 1.0f, 0, 0.0f },
- { &D_06001A50, 1.0f, 2, 0.0f }, { &D_06002530, 1.0f, 2, 0.0f }, { &D_06003320, 1.0f, 2, 0.0f },
- { &D_060036D0, 1.0f, 0, 0.0f }, { &D_060041CC, 1.0f, 2, 0.0f }, { &D_06004DD8, 1.0f, 2, 0.0f },
- { &D_06005F98, 1.0f, 0, 0.0f }, { &D_06006488, 1.0f, 2, 0.0f }, { &D_060073E4, 1.0f, 0, 0.0f },
- { &D_060077A8, 1.0f, 0, 0.0f }, { &D_06007CA4, 1.0f, 0, 0.0f }, { &D_06008324, 1.0f, 0, 0.0f },
- { &D_06008AE4, 1.0f, 2, 0.0f }, { &D_06009100, 1.0f, 2, 0.0f }, { &D_060051E4, 1.0f, 2, 0.0f },
- { &D_06005E20, 1.0f, 0, 0.0f }, { &D_06006F84, 1.0f, 0, 0.0f },
+static AnimationSpeedInfo sAnimations[] = {
+ { &object_dno_Anim_000470, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0008F0, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_000F6C, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_001A50, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_002530, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_003320, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_0036D0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_0041CC, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_004DD8, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_005F98, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_dno_Anim_006488, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0073E4, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_dno_Anim_0077A8, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_007CA4, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_dno_Anim_008324, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_008AE4, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_009100, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_dno_Anim_0051E4, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_dno_Anim_005E20, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_dno_Anim_006F84, 1.0f, ANIMMODE_LOOP, 0.0f },
};
const ActorInit En_Dno_InitVars = {
@@ -213,14 +196,14 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
if (actor == NULL) {
Actor_ProcessInitChain(thisx, sInitChain);
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 21.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E1F8, &D_06007CA4, this->jointTable,
- this->morphTable, 28);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dno_Skel_00E1F8, &object_dno_Anim_007CA4,
+ this->jointTable, this->morphTable, 28);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
Actor_UpdateBgCheckInfo(globalCtx, thisx, 0.0f, 0.0f, 0.0f, 4);
- Animation_Change(&this->skelAnime, sAnimations[14].animationSeg, 1.0f, 0.0f,
- Animation_GetLastFrame(sAnimations[14].animationSeg), sAnimations[14].mode,
- sAnimations[14].transitionRate);
+ Animation_Change(&this->skelAnime, sAnimations[14].animation, 1.0f, 0.0f,
+ Animation_GetLastFrame(sAnimations[14].animation), sAnimations[14].mode,
+ sAnimations[14].morphFrames);
this->unk_3BE = 0x3E93;
this->unk_3C0 = 60.0f;
this->unk_3B0 = 0;
@@ -233,7 +216,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[23] & 0x20) || (gSaveContext.weekEventReg[93] & 2)) {
Actor_MarkForDeath(thisx);
} else {
- func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
thisx->room = -1;
gSaveContext.unk_3DD0[1] = 5;
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
@@ -247,7 +230,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[23] & 0x20) {
Actor_MarkForDeath(thisx);
} else {
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
this->unk_460 = SubS_FindActor(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ);
if (this->unk_460 == NULL) {
Actor_MarkForDeath(thisx);
@@ -275,7 +258,7 @@ void EnDno_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80A71B04(EnDno* this, GlobalContext* globalCtx) {
this->unk_452 = 0;
- func_8013E1C8(&this->skelAnime, sAnimations, 19, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 19, &this->unk_32C);
this->actionFunc = EnDno_DoNothing;
}
@@ -288,14 +271,14 @@ void func_80A71B68(EnDno* this, GlobalContext* globalCtx) {
if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA)) {
if (gSaveContext.weekEventReg[27] & 1) {
if (!(this->unk_3B0 & 0x20)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C);
this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->unk_460);
}
} else {
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
}
} else {
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
}
this->actionFunc = func_80A71C3C;
}
@@ -304,23 +287,23 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
switch (this->unk_32C) {
case 9:
case 16:
- func_8013E1C8(&this->skelAnime, sAnimations, 10, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 10, &this->unk_32C);
break;
case 3:
case 10:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
}
break;
case 11:
- func_8013E1C8(&this->skelAnime, sAnimations, 15, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 15, &this->unk_32C);
break;
case 15:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C);
}
case 6:
@@ -340,7 +323,7 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk11F22 = 0;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
func_80A71E54(this, globalCtx);
} else if (this->actor.xzDistToPlayer < 60.0f) {
@@ -351,19 +334,19 @@ void func_80A71C3C(EnDno* this, GlobalContext* globalCtx) {
void func_80A71E54(EnDno* this, GlobalContext* globalCtx) {
if (CHECK_QUEST_ITEM(QUEST_SONG_SONATA)) {
if (gSaveContext.weekEventReg[27] & 1) {
- this->unk_464 = 0x811;
+ this->textId = 0x811;
} else {
- this->unk_464 = 0x80F;
+ this->textId = 0x80F;
gSaveContext.weekEventReg[27] |= 1;
}
} else if (gSaveContext.weekEventReg[26] & 0x80) {
- this->unk_464 = 0x80B;
+ this->textId = 0x80B;
} else {
- this->unk_464 = 0x80C;
+ this->textId = 0x80C;
gSaveContext.weekEventReg[26] |= 0x80;
}
- if (this->unk_464 != 0x811) {
+ if (this->textId != 0x811) {
this->unk_3B0 |= 0x10;
} else {
this->unk_3B0 &= ~0x10;
@@ -378,21 +361,21 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
case 0:
if (!(this->unk_3B0 & 0x10) ||
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xE38)) {
- switch (this->unk_464) {
+ switch (this->textId) {
case 0x80B:
- func_8013E1C8(&this->skelAnime, sAnimations, 16, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 16, &this->unk_32C);
case 0x811:
- func_801518B0(globalCtx, this->unk_464, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
break;
case 0x80C:
case 0x80F:
if (this->unk_32C == 13) {
- func_8013E1C8(&this->skelAnime, sAnimations, 4, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 4, &this->unk_32C);
} else if ((this->unk_32C == 4) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 11, &this->unk_32C);
- func_801518B0(globalCtx, this->unk_464, &this->actor);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 11, &this->unk_32C);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
}
break;
}
@@ -404,7 +387,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
switch (this->unk_32C) {
case 16:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 9, &this->unk_32C);
}
Math_ScaledStepToS(&this->actor.shape.rot.y,
Actor_YawBetweenActors(&this->actor, this->unk_460), 0x71C);
@@ -413,7 +396,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
case 10:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
func_801477B4(globalCtx);
- func_8013E1C8(&this->skelAnime, sAnimations, 0xD, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
func_80A71B68(this, globalCtx);
}
break;
@@ -429,21 +412,21 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
switch (this->unk_32C) {
case 16:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 9, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 9, &this->unk_32C);
}
break;
case 9:
if (func_80147624(globalCtx)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 10, &this->unk_32C);
- globalCtx->msgCtx.unk11F22 = 0x44;
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 10, &this->unk_32C);
+ globalCtx->msgCtx.msgMode = 0x44;
}
break;
case 10:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
func_801477B4(globalCtx);
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
func_80A71B68(this, globalCtx);
}
break;
@@ -464,10 +447,10 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
case 0x80E:
if (this->unk_32C == 11) {
- func_8013E1C8(&this->skelAnime, sAnimations, 3, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 3, &this->unk_32C);
} else if (this->unk_32C == 3) {
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 13, &this->unk_32C);
}
} else if ((this->unk_32C == 13) && func_80147624(globalCtx)) {
func_801477B4(globalCtx);
@@ -491,12 +474,12 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
switch (this->unk_32C) {
case 11:
- func_8013E1C8(&this->skelAnime, sAnimations, 15, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 15, &this->unk_32C);
break;
case 15:
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
- func_8013E1C8(&this->skelAnime, sAnimations, 6, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 6, &this->unk_32C);
}
break;
}
@@ -515,7 +498,7 @@ void func_80A71F18(EnDno* this, GlobalContext* globalCtx) {
void func_80A72438(EnDno* this, GlobalContext* globalCtx) {
this->unk_452 = 1;
- func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
this->actor.textId = 0;
if (Flags_GetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor))) {
this->unk_454 = 1.0f;
@@ -561,29 +544,29 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
case 0:
if (this->unk_32C == 14) {
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2D8)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 5, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 5, &this->unk_32C);
}
} else if ((this->unk_32C == 5) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (Flags_GetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor))) {
- func_801518B0(globalCtx, 0x801, &this->actor);
+ Message_StartTextbox(globalCtx, 0x801, &this->actor);
} else if (Player_GetMask(globalCtx) == PLAYER_MASK_SCENTS) {
- func_801518B0(globalCtx, 0x806, &this->actor);
+ Message_StartTextbox(globalCtx, 0x806, &this->actor);
} else {
- func_801518B0(globalCtx, 0x800, &this->actor);
+ Message_StartTextbox(globalCtx, 0x800, &this->actor);
}
- func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
}
break;
case 2:
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x2D8)) {
gSaveContext.weekEventReg[93] |= 2;
- func_801518B0(globalCtx, 0x802, &this->actor);
+ Message_StartTextbox(globalCtx, 0x802, &this->actor);
}
break;
case 3:
- func_801518B0(globalCtx, 0x804, &this->actor);
+ Message_StartTextbox(globalCtx, 0x804, &this->actor);
break;
}
break;
@@ -606,8 +589,8 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 12, &this->unk_32C);
- func_801518B0(globalCtx, 0x803, &this->actor);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 12, &this->unk_32C);
+ Message_StartTextbox(globalCtx, 0x803, &this->actor);
}
}
break;
@@ -619,10 +602,10 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
case 0x800:
case 0x801:
if (func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x44;
+ globalCtx->msgCtx.msgMode = 0x44;
this->unk_452 = 1;
this->unk_454 = 0.0f;
- func_8013E1C8(&this->skelAnime, sAnimations, 8, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 8, &this->unk_32C);
}
break;
@@ -648,7 +631,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
case 0x804:
if (this->unk_32C == 14) {
if (func_80147624(globalCtx)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 5, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 5, &this->unk_32C);
if (!(this->unk_3B0 & 0x40)) {
func_80A72CF8(this, globalCtx);
this->unk_3B0 |= 0x40;
@@ -675,7 +658,7 @@ void func_80A725F8(EnDno* this, GlobalContext* globalCtx) {
}
void func_80A72AE4(EnDno* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->unk_32C);
func_80A714B4(this, globalCtx);
this->actionFunc = func_80A72B3C;
}
@@ -702,9 +685,9 @@ void func_80A72BA4(EnDno* this, GlobalContext* globalCtx) {
}
void func_80A72C04(EnDno* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->unk_32C);
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~(8 | 1);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->unk_32C);
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
Math_Vec3f_Copy(&this->unk_334, &this->actor.world.pos);
func_8013DCE0(globalCtx, &this->unk_334, &this->actor, &this->unk_340, globalCtx->setupPathList,
ENDNO_GET_7F(&this->actor), 1, 0, 1, 0);
@@ -801,7 +784,7 @@ void func_80A730A0(EnDno* this, GlobalContext* globalCtx) {
}
if (phi_a2 >= 0) {
- func_8013E1C8(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C);
}
}
@@ -817,7 +800,7 @@ void func_80A730A0(EnDno* this, GlobalContext* globalCtx) {
this->unk_3AE += 1000;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
func_80A715DC(this, globalCtx);
- func_800B9010(&this->actor, 0x2153);
+ func_800B9010(&this->actor, NA_SE_EV_BUTLER_FRY - SFX_FLAG);
if (this->unk_340.unk_1C & 0x20) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_340.unk_20);
this->actor.speedXZ = 0.0f;
@@ -829,8 +812,8 @@ void func_80A730A0(EnDno* this, GlobalContext* globalCtx) {
}
void func_80A73244(EnDno* this, GlobalContext* globalCtx) {
- this->actor.flags &= ~0x8000000;
- this->actor.flags |= (8 | 1);
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->unk_328 = 2;
this->actor.speedXZ = 0.0f;
Flags_UnsetSwitch(globalCtx, ENDNO_GET_3F80(&this->actor));
@@ -846,11 +829,11 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx) {
if (Math_ScaledStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0x71C)) {
this->unk_3B0 |= 4;
this->unk_44E = 3;
- func_8013E1C8(&this->skelAnime, sAnimations, 7, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 7, &this->unk_32C);
}
} else if (this->unk_44E == 3) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, sAnimations, 14, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 14, &this->unk_32C);
func_80A72438(this, globalCtx);
} else {
if (this->skelAnime.curFrame >= 20.0f) {
@@ -871,12 +854,12 @@ void func_80A732C8(EnDno* this, GlobalContext* globalCtx) {
void func_80A73408(EnDno* this, GlobalContext* globalCtx) {
s32 phi_a2;
u8 sp33 = true;
- u32 temp_v0;
+ s32 temp_v0;
- if (func_800EE29C(globalCtx, 0x1DB)) {
- temp_v0 = func_800EE200(globalCtx, 0x1DB);
- if (this->unk_468 != globalCtx->csCtx.npcActions[temp_v0]->unk0) {
- switch (globalCtx->csCtx.npcActions[temp_v0]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 475)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, 475);
+ if (this->unk_468 != globalCtx->csCtx.actorActions[temp_v0]->action) {
+ switch (globalCtx->csCtx.actorActions[temp_v0]->action) {
case 1:
phi_a2 = 13;
break;
@@ -892,15 +875,15 @@ void func_80A73408(EnDno* this, GlobalContext* globalCtx) {
}
if (sp33) {
- func_8013E1C8(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, phi_a2, &this->unk_32C);
}
}
- func_800EDF24(&this->actor, globalCtx, temp_v0);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
}
if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_32C == 17)) {
if (0) {};
- func_8013E1C8(&this->skelAnime, sAnimations, 18, &this->unk_32C);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 18, &this->unk_32C);
}
}
diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.h b/src/overlays/actors/ovl_En_Dno/z_en_dno.h
index ed9ee52c64..350e0c0049 100644
--- a/src/overlays/actors/ovl_En_Dno/z_en_dno.h
+++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.h
@@ -51,7 +51,7 @@ typedef struct EnDno {
/* 0x458 */ s32 unk_458;
/* 0x45C */ s16 unk_45C;
/* 0x460 */ Actor* unk_460;
- /* 0x464 */ u16 unk_464;
+ /* 0x464 */ u16 textId;
/* 0x466 */ s16 unk_466;
/* 0x468 */ u8 unk_468;
} EnDno; // size = 0x46C
diff --git a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c
index 98884c1149..d7274837cb 100644
--- a/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c
+++ b/src/overlays/actors/ovl_En_Dnp/z_en_dnp.c
@@ -5,8 +5,9 @@
*/
#include "z_en_dnp.h"
+#include "objects/object_dnp/object_dnp.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnDnp*)thisx)
@@ -21,35 +22,6 @@ void func_80B3D338(EnDnp* this, GlobalContext* globalCtx);
void func_80B3D3F8(EnDnp* this, GlobalContext* globalCtx);
void func_80B3D558(EnDnp* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060007D8;
-extern AnimationHeader D_0600125C;
-extern AnimationHeader D_060017F8;
-extern AnimationHeader D_06001C1C;
-extern AnimationHeader D_060021DC;
-extern AnimationHeader D_060026B8;
-extern AnimationHeader D_06004D08;
-extern AnimationHeader D_060057AC;
-extern AnimationHeader D_0600625C;
-extern AnimationHeader D_0600674C;
-extern AnimationHeader D_06006B74;
-extern AnimationHeader D_060071F4;
-extern AnimationHeader D_06007960;
-extern AnimationHeader D_06008588;
-extern AnimationHeader D_0600923C;
-extern AnimationHeader D_06009AA0;
-extern AnimationHeader D_0600A900;
-extern AnimationHeader D_0600AEB8;
-extern AnimationHeader D_0600B324;
-extern AnimationHeader D_0600B754;
-extern AnimationHeader D_0600BAD8;
-extern Gfx D_060103D0[];
-extern Gfx D_060105D0[];
-extern Gfx D_060107D0[];
-extern Gfx D_060109D0[];
-extern FlexSkeletonHeader D_06010D60;
-extern AnimationHeader D_060115B8;
-extern AnimationHeader D_06012428;
-
const ActorInit En_Dnp_InitVars = {
ACTOR_EN_DNP,
ACTORCAT_NPC,
@@ -84,16 +56,33 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS sAnimations[] = {
- { &D_060007D8, 1.0f, 0, -1, 2, -4 }, { &D_060021DC, 1.0f, 0, -1, 0, 0 }, { &D_060021DC, 1.0f, 0, -1, 0, -4 },
- { &D_060026B8, 1.0f, 0, -1, 2, -4 }, { &D_06004D08, 1.0f, 0, -1, 2, -4 }, { &D_060071F4, 1.0f, 0, -1, 2, -4 },
- { &D_06007960, 1.0f, 0, -1, 0, -4 }, { &D_06008588, 1.0f, 0, -1, 2, 0 }, { &D_0600A900, 1.0f, 0, -1, 0, -4 },
- { &D_0600AEB8, 1.0f, 0, -1, 0, -4 }, { &D_0600B754, 1.0f, 0, -1, 2, -4 }, { &D_0600674C, 1.0f, 0, -1, 0, -4 },
- { &D_0600BAD8, 1.0f, 0, -1, 2, -4 }, { &D_06006B74, 1.0f, 0, -1, 0, -4 }, { &D_06012428, 1.0f, 0, -1, 0, -4 },
- { &D_0600B324, 1.0f, 0, -1, 0, 0 }, { &D_0600B324, 1.0f, 0, -1, 0, -4 }, { &D_060115B8, 1.0f, 0, -1, 0, -4 },
- { &D_060115B8, 1.0f, 0, -1, 0, 0 }, { &D_0600923C, 1.0f, 0, -1, 2, -4 }, { &D_06009AA0, 1.0f, 0, -1, 0, -4 },
- { &D_0600125C, 1.0f, 0, -1, 2, -4 }, { &D_060017F8, 1.0f, 0, -1, 2, 0 }, { &D_06001C1C, 1.0f, 0, -1, 0, -4 },
- { &D_060057AC, 1.0f, 0, -1, 2, 0 }, { &D_0600625C, 1.0f, 0, -1, 0, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_dnp_Anim_0007D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnp_Anim_0021DC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_0026B8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_004D08, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_0071F4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_007960, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_008588, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnp_Anim_00A900, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_00AEB8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_00B754, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_00674C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_00BAD8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_006B74, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_012428, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnp_Anim_00B324, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_0115B8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnp_Anim_00923C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_009AA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_00125C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnp_Anim_0017F8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnp_Anim_001C1C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnp_Anim_0057AC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnp_Anim_00625C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
static s32 D_80B3DE58[] = {
@@ -146,7 +135,7 @@ s32 func_80B3CC38(EnDnp* this, s32 arg1) {
if (arg1 != this->unk_340) {
this->unk_340 = arg1;
- ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
}
return ret;
@@ -213,12 +202,12 @@ s32 func_80B3CF60(EnDnp* this, GlobalContext* globalCtx) {
s32 ret = false;
if ((this->unk_322 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_322, 0, 7);
+ SubS_UpdateFlags(&this->unk_322, 0, 7);
this->unk_322 |= 8;
this->actionFunc = func_80B3D3F8;
ret = true;
} else if (!(gSaveContext.weekEventReg[23] & 0x20) && Actor_HasParent(&this->actor, globalCtx)) {
- func_8013AED4(&this->unk_322, 0, 7);
+ SubS_UpdateFlags(&this->unk_322, 0, 7);
this->unk_322 &= ~0x500;
this->actor.parent = NULL;
this->unk_32E = 0;
@@ -235,15 +224,15 @@ s32 func_80B3D044(EnDnp* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != 0) {
if (!(this->unk_322 & 0x200)) {
this->unk_322 |= (0x200 | 0x10);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_324 = 0xFF;
}
- func_8013AED4(&this->unk_322, 0, 7);
+ SubS_UpdateFlags(&this->unk_322, 0, 7);
this->actionFunc = func_80B3D11C;
ret = true;
} else if (this->unk_322 & 0x200) {
- this->actor.flags |= 1;
- func_8013AED4(&this->unk_322, 3, 7);
+ this->actor.flags |= ACTOR_FLAG_1;
+ SubS_UpdateFlags(&this->unk_322, 3, 7);
this->unk_322 &= ~(0x200 | 0x10);
this->actionFunc = func_80B3D2D4;
}
@@ -255,18 +244,18 @@ void func_80B3D11C(EnDnp* this, GlobalContext* globalCtx) {
static s32 D_80B3DE74[] = {
0, 16, 14, 10, 18, 12, 5, 7, 2, 19, 21, 22, 24, 8,
};
- u32 temp_v0;
+ s32 temp_v0;
s32 val;
if (!(gSaveContext.weekEventReg[29] & 0x40) && (globalCtx->sceneNum == SCENE_MITURIN) &&
- (globalCtx->csCtx.unk_12 == 0)) {
+ (globalCtx->csCtx.currentCsIndex == 0)) {
this->unk_322 |= 0x20;
gSaveContext.weekEventReg[29] |= 0x40;
}
- if (func_800EE29C(globalCtx, 0x65)) {
- temp_v0 = func_800EE200(globalCtx, 0x65);
- val = globalCtx->csCtx.npcActions[temp_v0]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 101)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, 101);
+ val = globalCtx->csCtx.actorActions[temp_v0]->action;
if (this->unk_324 != (u8)val) {
func_80B3CC38(this, D_80B3DE74[val]);
if (this->unk_340 == 16) {
@@ -292,7 +281,7 @@ void func_80B3D11C(EnDnp* this, GlobalContext* globalCtx) {
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80B3CC38(this, this->unk_340 + 1);
}
- func_800EDF24(&this->actor, globalCtx, temp_v0);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
}
}
@@ -322,7 +311,7 @@ void func_80B3D338(EnDnp* this, GlobalContext* globalCtx) {
void func_80B3D3F8(EnDnp* this, GlobalContext* globalCtx) {
if (func_8010BF58(&this->actor, globalCtx, D_80B3DE58, NULL, &this->unk_328)) {
- func_8013AED4(&this->unk_322, 3, 7);
+ SubS_UpdateFlags(&this->unk_322, 3, 7);
this->unk_322 &= ~8;
this->actionFunc = func_80B3D2D4;
} else {
@@ -334,8 +323,8 @@ void func_80B3D47C(EnDnp* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
Math_SmoothStepToF(&this->actor.scale.x, 0.0085f, 0.1f, 0.01f, 0.001f);
if ((s32)(this->actor.scale.x * 10000.0f) >= 85) {
- this->actor.flags |= 1;
- func_8013AED4(&this->unk_322, 3, 7);
+ this->actor.flags |= ACTOR_FLAG_1;
+ SubS_UpdateFlags(&this->unk_322, 3, 7);
this->unk_322 &= ~0x10;
this->unk_322 |= 0x400;
this->actor.scale.x = 0.0085f;
@@ -358,7 +347,8 @@ void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDnp* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 16.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010D60, NULL, this->jointTable, this->morphTable, 26);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnp_Skel_010D60, NULL, this->jointTable, this->morphTable,
+ 26);
this->unk_340 = -1;
func_80B3CC38(this, 15);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -368,18 +358,18 @@ void EnDnp_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_322 |= (0x100 | 0x80 | 0x10);
this->actor.gravity = -1.0f;
if (ENDNP_GET_7(&this->actor) == ENDNP_GET_7_1) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.00085000007f);
- func_8013AED4(&this->unk_322, 0, 7);
+ SubS_UpdateFlags(&this->unk_322, 0, 7);
this->actor.shape.rot.x = 0;
this->actor.world.rot.x = this->actor.shape.rot.x;
this->actor.cutscene = 0x10;
this->actionFunc = func_80B3D47C;
- } else if (((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_0) && !func_80114F2C(0x17) &&
+ } else if (((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_0) && !Interface_HasItemInBottle(ITEM_DEKU_PRINCESS) &&
!(gSaveContext.weekEventReg[23] & 0x20)) ||
((ENDNP_GET_7(&this->actor) == ENDNP_GET_7_2) && (gSaveContext.weekEventReg[23] & 0x20))) {
Actor_SetScale(&this->actor, 0.0085f);
- func_8013AED4(&this->unk_322, 3, 7);
+ SubS_UpdateFlags(&this->unk_322, 3, 7);
this->unk_322 |= 0x400;
if ((globalCtx->sceneNum == SCENE_MITURIN) && (gSaveContext.weekEventReg[29] & 0x40)) {
this->unk_322 |= 0x20;
@@ -456,10 +446,10 @@ s32 func_80B3D974(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 ar
return 1;
}
-void func_80B3DA88(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnDnp_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
-void func_80B3DAA0(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnDnp_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnDnp* this = THIS;
s32 phi_v1 = 1;
s32 phi_v0;
@@ -489,11 +479,11 @@ void func_80B3DAA0(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnDnp_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static Gfx* D_80B3DEAC[] = {
- D_060103D0,
- D_060105D0,
- D_060107D0,
- D_060109D0,
+ static TexturePtr D_80B3DEAC[] = {
+ object_dnp_Tex_0103D0,
+ object_dnp_Tex_0105D0,
+ object_dnp_Tex_0107D0,
+ object_dnp_Tex_0109D0,
};
EnDnp* this = THIS;
@@ -504,8 +494,9 @@ void EnDnp_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B3DEAC[this->unk_336]));
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
- func_80B3DA88, func_80B3DAA0, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, EnDnp_PostLimbDraw, EnDnp_TransformLimbDraw,
+ &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
index f1e500e0fb..f25abc6a4f 100644
--- a/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
+++ b/src/overlays/actors/ovl_En_Dnq/z_en_dnq.c
@@ -5,8 +5,9 @@
*/
#include "z_en_dnq.h"
+#include "objects/object_dnq/object_dnq.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDnq*)thisx)
@@ -17,24 +18,6 @@ void EnDnq_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80A52FB8(EnDnq* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060006F0;
-extern AnimationHeader D_06000BF8;
-extern AnimationHeader D_06001100;
-extern AnimationHeader D_06001AEC;
-extern AnimationHeader D_06002690;
-extern AnimationHeader D_06003408;
-extern AnimationHeader D_06003DBC;
-extern AnimationHeader D_060047B8;
-extern AnimationHeader D_06004EA0;
-extern AnimationHeader D_06005284;
-extern AnimationHeader D_06005A14;
-extern AnimationHeader D_06005E18;
-extern AnimationHeader D_06006984;
-extern AnimationHeader D_06007528;
-extern AnimationHeader D_06008328;
-extern FlexSkeletonHeader D_0600EB48;
-extern AnimationHeader D_0600F504;
-
static s32 D_80A53400[] = {
0x00120100, 0x150E0899, 0x0C120F08, 0x9A0C0F08, 0x9B0C0F08, 0x9C0C1112, 0x01100E08, 0x980C1000, 0x00120200,
0x0C0E089D, 0x0C0F089E, 0x0C111202, 0x100E089F, 0x0C100000, 0x0E08A10C, 0x0F08A20C, 0x10000000,
@@ -74,14 +57,27 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS D_80A5349C[] = {
- { &D_06008328, 1.0f, 0, -1, 0, 0 }, { &D_06008328, 1.0f, 0, -1, 0, -4 }, { &D_06007528, 1.0f, 0, -1, 2, -4 },
- { &D_060006F0, 1.0f, 0, -1, 2, 0 }, { &D_06000BF8, 1.0f, 0, -1, 0, -4 }, { &D_06002690, 0.0f, 0, -1, 2, 0 },
- { &D_06002690, 1.0f, 0, -1, 2, -4 }, { &D_06003408, 1.0f, 0, -1, 0, -4 }, { &D_06006984, 1.0f, 0, -1, 2, -4 },
- { &D_06005E18, 1.0f, 0, -1, 2, -4 }, { &D_06005A14, 1.0f, 0, -1, 2, -4 }, { &D_06005284, 1.0f, 0, -1, 2, -4 },
- { &D_06001AEC, 1.0f, 0, -1, 2, 0 }, { &D_06001100, 1.0f, 0, -1, 2, 0 }, { &D_06004EA0, 1.0f, 0, -1, 0, -4 },
- { &D_0600F504, 1.0f, 0, -1, 0, -4 }, { &D_060047B8, 1.0f, 0, -1, 0, -4 }, { &D_06003DBC, 1.0f, 0, -1, 2, -4 },
- { &D_06005A14, 1.0f, 0, -1, 0, -4 }, { &D_06003DBC, 1.0f, 0, -1, 0, -4 },
+static AnimationInfoS D_80A5349C[] = {
+ { &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnq_Anim_008328, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_007528, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_0006F0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnq_Anim_000BF8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_002690, 0.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnq_Anim_002690, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_003408, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_006984, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_005E18, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_005A14, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_005284, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_001AEC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnq_Anim_001100, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnq_Anim_004EA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_00F504, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_0047B8, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnq_Anim_005A14, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnq_Anim_003DBC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
void func_80A52530(GlobalContext* globalCtx, EnDnq* this) {
@@ -108,7 +104,7 @@ s32 func_80A5257C(EnDnq* this, s32 arg1) {
if (phi_v1) {
this->unk_398 = arg1;
- ret = func_8013BC6C(&this->skelAnime, D_80A5349C, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A5349C, arg1);
}
return ret;
@@ -124,18 +120,18 @@ s32 func_80A52648(EnDnq* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != 0) {
if (!(this->unk_37C & 0x20)) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_1DC = 0xFF;
this->unk_37C |= 0x20;
}
- func_8013AED4(&this->unk_37C, 0, 7);
+ SubS_UpdateFlags(&this->unk_37C, 0, 7);
ret = true;
} else {
if (this->unk_37C & 0x20) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_1DC = 0xFF;
this->unk_37C &= ~0x20;
- func_8013AED4(&this->unk_37C, 3, 7);
+ SubS_UpdateFlags(&this->unk_37C, 3, 7);
}
}
@@ -325,7 +321,7 @@ s32 func_80A52D44(EnDnq* this, GlobalContext* globalCtx) {
s32 ret = false;
if ((this->unk_37C & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_37C, 0, 7);
+ SubS_UpdateFlags(&this->unk_37C, 0, 7);
this->unk_380 = func_80A52CF8(this, globalCtx);
this->actionFunc = func_80A52FB8;
ret = true;
@@ -339,17 +335,17 @@ void func_80A52DC8(EnDnq* this, GlobalContext* globalCtx) {
s16 yaw = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
if (yaw <= 0x3800) {
- func_8013AED4(&this->unk_37C, 3, 7);
+ SubS_UpdateFlags(&this->unk_37C, 3, 7);
} else {
- func_8013AED4(&this->unk_37C, 0, 7);
+ SubS_UpdateFlags(&this->unk_37C, 0, 7);
}
if (!(gSaveContext.weekEventReg[23] & 0x20)) {
this->unk_390 = 70.0f;
- if (func_80114F2C(ITEM_DEKU_PRINCESS) && !func_801690CC(globalCtx) &&
+ if (Interface_HasItemInBottle(ITEM_DEKU_PRINCESS) && !func_801690CC(globalCtx) &&
(Message_GetState(&globalCtx->msgCtx) == 0) && (ActorCutscene_GetCurrentIndex() == -1)) {
if ((DECR(this->unk_384) == 0) && (gSaveContext.weekEventReg[29] & 0x40)) {
- func_801518B0(globalCtx, 0x969, NULL);
+ Message_StartTextbox(globalCtx, 0x969, NULL);
this->unk_384 = 200;
}
}
@@ -380,7 +376,7 @@ void func_80A52FB8(EnDnq* this, GlobalContext* globalCtx) {
s16 sp2E = this->actor.yawTowardsPlayer;
if (func_8010BF58(&this->actor, globalCtx, this->unk_380, NULL, &this->unk_1E0)) {
- func_8013AED4(&this->unk_37C, 3, 7);
+ SubS_UpdateFlags(&this->unk_37C, 3, 7);
this->unk_386 = 0;
this->actionFunc = func_80A52DC8;
} else {
@@ -392,12 +388,12 @@ void func_80A53038(EnDnq* this, GlobalContext* globalCtx) {
static s32 D_80A535FC[] = {
0, 1, 2, 3, 5, 6,
};
- u32 temp_v0;
+ s32 temp_v0;
u32 temp_v1;
- if (func_800EE29C(globalCtx, 0x69)) {
- temp_v0 = func_800EE200(globalCtx, 0x69);
- temp_v1 = globalCtx->csCtx.npcActions[temp_v0]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 105)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, 105);
+ temp_v1 = globalCtx->csCtx.actorActions[temp_v0]->action;
if (this->unk_1DC != (u8)temp_v1) {
func_80A5257C(this, D_80A535FC[temp_v1]);
this->unk_1DC = temp_v1;
@@ -412,7 +408,7 @@ void func_80A53038(EnDnq* this, GlobalContext* globalCtx) {
func_80A5257C(this, this->unk_398 + 1);
}
- func_800EDF24(&this->actor, globalCtx, temp_v0);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
}
}
@@ -420,7 +416,8 @@ void EnDnq_Init(Actor* thisx, GlobalContext* globalCtx) {
EnDnq* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 14.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600EB48, NULL, this->jointTable, this->morphTable, 33);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnq_Skel_00EB48, NULL, this->jointTable, this->morphTable,
+ 33);
this->unk_398 = -1;
func_80A5257C(this, 0);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -429,7 +426,7 @@ void EnDnq_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 1;
this->unk_386 = 0;
this->unk_37C = 0;
- func_8013AED4(&this->unk_37C, 3, 7);
+ SubS_UpdateFlags(&this->unk_37C, 3, 7);
if (gSaveContext.weekEventReg[9] & 0x80) {
this->unk_3A4 = 1;
} else {
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 b6e75ef3ce..b9f1605f9d 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c
@@ -6,7 +6,7 @@
#include "z_en_dns.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnDns*)thisx)
@@ -19,19 +19,19 @@ void func_8092D330(EnDns* this, GlobalContext* globalCtx);
void EnDns_DoNothing(EnDns* this, GlobalContext* globalCtx);
void func_8092D4D8(EnDns* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060002A8;
-extern AnimationHeader D_06000734;
-extern AnimationHeader D_060008F4;
-extern AnimationHeader D_06000BD8;
-extern AnimationHeader D_06000D58;
-extern AnimationHeader D_06000FEC;
-extern TexturePtr D_060028E8;
-extern TexturePtr D_06002968;
-extern TexturePtr D_060029E8;
-extern Gfx D_06002C48[];
-extern SkeletonHeader D_06002DD8;
-extern AnimationHeader D_06003310;
-extern AnimationHeader D_060034EC;
+typedef enum {
+ /* 0 */ EN_DNS_ANIMATION_IDLE_1,
+ /* 1 */ EN_DNS_ANIMATION_IDLE_2,
+ /* 2 */ EN_DNS_ANIMATION_WALK_1,
+ /* 3 */ EN_DNS_ANIMATION_WALK_2,
+ /* 4 */ EN_DNS_ANIMATION_SURPRISE_START,
+ /* 5 */ EN_DNS_ANIMATION_SURPRISE_LOOP,
+ /* 6 */ EN_DNS_ANIMATION_RUN_START,
+ /* 7 */ EN_DNS_ANIMATION_RUN_LOOP,
+ /* 8 */ EN_DNS_ANIMATION_DANCE,
+ /* 9 */ EN_DNS_ANIMATION_FLIP,
+ /* 10 */ EN_DNS_ANIMATION_MAX,
+} EnDnsAnimationIndex;
static s32 D_8092DCB0[] = {
0x00172000, 0x050E082F, 0x0C100E08, 0x200C1000, 0x00172000, 0x050E0830, 0x0C100E08, 0x210C1000,
@@ -73,17 +73,24 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06003310, 1.0f, 0, -1, 0, 0 }, { &D_06003310, 1.0f, 0, -1, 0, -4 }, { &D_060034EC, 1.0f, 0, -1, 0, 0 },
- { &D_060034EC, 1.0f, 0, -1, 0, -4 }, { &D_060008F4, 1.0f, 0, -1, 2, 0 }, { &D_06000BD8, 1.0f, 0, -1, 0, 0 },
- { &D_06000D58, 1.0f, 0, -1, 2, 0 }, { &D_06000FEC, 1.0f, 0, -1, 0, 0 }, { &D_060002A8, 1.0f, 0, -1, 2, 0 },
- { &D_06000734, 1.0f, 0, -1, 2, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gKingsChamberDekuGuardSurpriseStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardSurpriseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardRunStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardRunLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gKingsChamberDekuGuardDanceAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gKingsChamberDekuGuardFlipAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
void func_8092C5C0(EnDns* this) {
s32 pad;
- if (((this->unk_2F8 == 2) || (this->unk_2F8 == 3) || (this->unk_2F8 == 6) || (this->unk_2F8 == 7)) &&
+ if (((this->animationIndex == EN_DNS_ANIMATION_WALK_1) || (this->animationIndex == EN_DNS_ANIMATION_WALK_2) ||
+ (this->animationIndex == EN_DNS_ANIMATION_RUN_START) || (this->animationIndex == EN_DNS_ANIMATION_RUN_LOOP)) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 3.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_WALK);
}
@@ -91,32 +98,34 @@ void func_8092C5C0(EnDns* this) {
s32 func_8092C63C(EnDns* this, s32 arg1) {
s32 phi_v1 = false;
- s32 ret = 0;
+ s32 ret = false;
switch (arg1) {
- case 0:
- case 1:
- if ((this->unk_2F8 != 0) && (this->unk_2F8 != 1)) {
+ case EN_DNS_ANIMATION_IDLE_1:
+ case EN_DNS_ANIMATION_IDLE_2:
+ if ((this->animationIndex != EN_DNS_ANIMATION_IDLE_1) &&
+ (this->animationIndex != EN_DNS_ANIMATION_IDLE_2)) {
phi_v1 = true;
}
break;
- case 2:
- case 3:
- if ((this->unk_2F8 != 2) && (this->unk_2F8 != 3)) {
+ case EN_DNS_ANIMATION_WALK_1:
+ case EN_DNS_ANIMATION_WALK_2:
+ if ((this->animationIndex != EN_DNS_ANIMATION_WALK_1) &&
+ (this->animationIndex != EN_DNS_ANIMATION_WALK_2)) {
phi_v1 = true;
}
break;
default:
- if (this->unk_2F8 != arg1) {
+ if (this->animationIndex != arg1) {
phi_v1 = true;
}
}
if (phi_v1) {
- this->unk_2F8 = arg1;
- ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1);
+ this->animationIndex = arg1;
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
}
return ret;
@@ -161,11 +170,11 @@ void func_8092C86C(EnDns* this, GlobalContext* globalCtx) {
}
void func_8092C934(EnDns* this) {
- if ((this->unk_2C6 & 0x40) && (DECR(this->unk_2DE) == 0)) {
- this->unk_2E0++;
- if (this->unk_2E0 >= 4) {
- this->unk_2DE = Rand_S16Offset(30, 30);
- this->unk_2E0 = 0;
+ if ((this->unk_2C6 & 0x40) && (DECR(this->blinkTimer) == 0)) {
+ this->eyeIndex++;
+ if (this->eyeIndex >= 4) {
+ this->blinkTimer = Rand_S16Offset(30, 30);
+ this->eyeIndex = 0;
}
}
}
@@ -201,16 +210,16 @@ s32* func_8092C9BC(EnDns* this, GlobalContext* globalCtx) {
s32 func_8092CA74(EnDns* this) {
switch (ENDNS_GET_7(&this->actor)) {
case ENDNS_GET_7_0:
- return 0x1D1;
+ return 465;
case ENDNS_GET_7_1:
- return 0x1D2;
+ return 466;
case ENDNS_GET_7_2:
- return 0x1D3;
+ return 467;
case ENDNS_GET_7_3:
- return 0x1D4;
+ return 468;
}
return 0;
@@ -221,13 +230,13 @@ s32 func_8092CAD0(EnDns* this, GlobalContext* globalCtx) {
if (this->unk_2C6 & 7) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_2C6, 0, 7);
+ SubS_UpdateFlags(&this->unk_2C6, 0, 7);
this->unk_2C6 &= ~0x10;
if (ENDNS_GET_4000(&this->actor)) {
this->unk_2F0 = 0.0f;
if (this->unk_2D2 != 0) {
this->unk_2F0 = this->skelAnime.curFrame;
- func_8092C63C(this, 2);
+ func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
}
this->unk_2DA = this->actor.world.rot.y;
}
@@ -245,15 +254,15 @@ s32 func_8092CB98(EnDns* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != 0) {
if (!(this->unk_2C6 & 0x80)) {
this->unk_2C8 = func_8092CA74(this);
- this->actor.flags &= ~0x1;
- func_8013AED4(&this->unk_2C6, 0, 7);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ SubS_UpdateFlags(&this->unk_2C6, 0, 7);
this->unk_2C6 |= 0x80;
this->unk_1D8 = 0xFF;
}
phi_v1 = 1;
} else if (this->unk_2C6 & 0x80) {
- this->actor.flags |= 1;
- func_8013AED4(&this->unk_2C6, 3, 7);
+ this->actor.flags |= ACTOR_FLAG_1;
+ SubS_UpdateFlags(&this->unk_2C6, 3, 7);
this->unk_2C6 &= ~0x80;
}
return phi_v1;
@@ -297,7 +306,7 @@ s32 func_8092CCEC(EnDns* this, GlobalContext* globalCtx) {
}
s32 func_8092CE38(EnDns* this) {
- static s32 D_8092DE00[] = { 8, 8, 9 };
+ static s32 D_8092DE00[] = { EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_DANCE, EN_DNS_ANIMATION_FLIP };
s16 frame;
s32 pad;
Vec3f sp2C;
@@ -376,7 +385,7 @@ void func_8092D108(EnDns* this, GlobalContext* globalCtx) {
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06002C48);
+ gSPDisplayList(POLY_OPA_DISP++, gKingsChamberDekuGuardDekuFlower);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -393,15 +402,15 @@ void func_8092D1B8(EnDns* this, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[23] & 0x20) && !(gSaveContext.eventInf[1] & 0x20) && func_8092CC68(globalCtx)) {
player->stateFlags1 |= 0x20;
this->unk_2C6 |= 0x100;
- func_8013AED4(&this->unk_2C6, 4, 7);
+ SubS_UpdateFlags(&this->unk_2C6, 4, 7);
play_sound(NA_SE_SY_FOUND);
gSaveContext.eventInf[1] |= 0x20;
this->unk_2F4 = func_8092CCEC;
- func_8092C63C(this, 2);
+ func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
this->actionFunc = EnDns_DoNothing;
} else if (gSaveContext.eventInf[1] & 0x40) {
func_8092CCEC(this, globalCtx);
- func_8092C63C(this, 2);
+ func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
this->actionFunc = func_8092D330;
}
Math_ApproachS(&this->actor.shape.rot.y, sp22, 3, 0x2AA8);
@@ -443,16 +452,16 @@ void func_8092D4D8(EnDns* this, GlobalContext* globalCtx) {
if (ENDNS_GET_4000(&this->actor) && (this->unk_2D2 == 0)) {
if (func_8092CE38(this)) {
- func_8092C63C(this, 2);
+ func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
}
} else if (func_8010BF58(&this->actor, globalCtx, this->unk_1E0, this->unk_2F4, &this->unk_1DC)) {
- func_8013AED4(&this->unk_2C6, 3, 7);
+ SubS_UpdateFlags(&this->unk_2C6, 3, 7);
this->unk_2F4 = NULL;
if (ENDNS_GET_4000(&this->actor)) {
if (!(gSaveContext.eventInf[1] & 0x20)) {
this->skelAnime.curFrame = this->unk_2F0;
this->actor.world.rot.y = this->unk_2DA;
- func_8092C63C(this, 8);
+ func_8092C63C(this, EN_DNS_ANIMATION_DANCE);
}
this->unk_2CC = 0;
this->unk_2CE = 0;
@@ -465,24 +474,30 @@ void func_8092D4D8(EnDns* this, GlobalContext* globalCtx) {
}
void func_8092D5E8(EnDns* this, GlobalContext* globalCtx) {
- static s32 D_8092DE0C[] = { 0, 0, 4, 6 };
- u32 temp_v0;
+ static s32 D_8092DE0C[] = {
+ EN_DNS_ANIMATION_IDLE_1,
+ EN_DNS_ANIMATION_IDLE_1,
+ EN_DNS_ANIMATION_SURPRISE_START,
+ EN_DNS_ANIMATION_RUN_START,
+ };
+ s32 temp_v0;
u32 temp_v1;
- if (func_800EE29C(globalCtx, this->unk_2C8)) {
- temp_v0 = func_800EE200(globalCtx, this->unk_2C8);
- temp_v1 = globalCtx->csCtx.npcActions[temp_v0]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, this->unk_2C8)) {
+ temp_v0 = Cutscene_GetActorActionIndex(globalCtx, this->unk_2C8);
+ temp_v1 = globalCtx->csCtx.actorActions[temp_v0]->action;
if (this->unk_1D8 != (u8)temp_v1) {
func_8092C63C(this, D_8092DE0C[temp_v1]);
this->unk_1D8 = temp_v1;
}
- if (((this->unk_2F8 == 4) || (this->unk_2F8 == 6)) &&
+ if (((this->animationIndex == EN_DNS_ANIMATION_SURPRISE_START) ||
+ (this->animationIndex == EN_DNS_ANIMATION_RUN_START)) &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8092C63C(this, this->unk_2F8 + 1);
+ func_8092C63C(this, this->animationIndex + 1);
}
- func_800EDF24(&this->actor, globalCtx, temp_v0);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, temp_v0);
}
}
@@ -495,9 +510,10 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06002DD8, NULL, this->jointTable, this->morphTable, 13);
- this->unk_2F8 = -1;
- func_8092C63C(this, 2);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gKingsChamberDekuGuardSkel, NULL, this->jointTable, this->morphTable,
+ KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX);
+ this->animationIndex = -1;
+ func_8092C63C(this, EN_DNS_ANIMATION_WALK_1);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
@@ -505,7 +521,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -0.8f;
this->unk_2D2 = 0;
this->unk_2C6 = 0;
- func_8013AED4(&this->unk_2C6, 3, 7);
+ SubS_UpdateFlags(&this->unk_2C6, 3, 7);
this->unk_2C6 |= (0x40 | 0x10);
this->unk_2C6 |= 0x200;
if (gSaveContext.weekEventReg[9] & 0x80) {
@@ -597,7 +613,7 @@ void EnDns_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
}
- if (limbIndex == 2) {
+ if (limbIndex == KINGS_CHAMBER_DEKU_GUARD_LIMB_HEAD) {
func_8092D954(this->unk_2CC, this->unk_2CE + this->actor.shape.rot.y, &this->unk_218, &this->unk_224, phi_v1,
phi_v0);
Matrix_InsertTranslation(this->unk_218.x, this->unk_218.y, this->unk_218.z, MTXMODE_NEW);
@@ -616,14 +632,19 @@ void EnDns_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
void EnDns_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr D_8092DE1C[] = { &D_060028E8, &D_06002968, &D_060029E8, &D_06002968 };
+ static TexturePtr sEyeTextures[] = {
+ gKingsChamberDekuGuardEyeOpenTex,
+ gKingsChamberDekuGuardEyeHalfTex,
+ gKingsChamberDekuGuardEyeClosedTex,
+ gKingsChamberDekuGuardEyeHalfTex,
+ };
EnDns* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_8092DE1C[this->unk_2E0]));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex]));
gDPPipeSync(POLY_OPA_DISP++);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDns_OverrideLimbDraw,
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 598dfff3b7..2577175026 100644
--- a/src/overlays/actors/ovl_En_Dns/z_en_dns.h
+++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.h
@@ -2,6 +2,7 @@
#define Z_EN_DNS_H
#include "global.h"
+#include "objects/object_dns/object_dns.h"
struct EnDns;
@@ -31,8 +32,8 @@ typedef struct EnDns {
/* 0x1E4 */ Gfx* unk_1E4[13];
/* 0x218 */ Vec3f unk_218;
/* 0x224 */ Vec3s unk_224;
- /* 0x22A */ Vec3s jointTable[13];
- /* 0x278 */ Vec3s morphTable[13];
+ /* 0x22A */ Vec3s jointTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX];
+ /* 0x278 */ Vec3s morphTable[KINGS_CHAMBER_DEKU_GUARD_LIMB_MAX];
/* 0x2C6 */ u16 unk_2C6;
/* 0x2C8 */ u16 unk_2C8;
/* 0x2CA */ UNK_TYPE1 unk_2CA[0x2];
@@ -45,14 +46,14 @@ typedef struct EnDns {
/* 0x2D8 */ s16 unk_2D8;
/* 0x2DA */ s16 unk_2DA;
/* 0x2DC */ s16 unk_2DC;
- /* 0x2DE */ s16 unk_2DE;
- /* 0x2E0 */ s16 unk_2E0;
+ /* 0x2DE */ s16 blinkTimer;
+ /* 0x2E0 */ s16 eyeIndex;
/* 0x2E4 */ f32 unk_2E4;
/* 0x2E8 */ UNK_TYPE1 unk_2E8[0x4];
/* 0x2EC */ f32 unk_2EC;
/* 0x2F0 */ f32 unk_2F0;
/* 0x2F4 */ EnDnsFunc unk_2F4;
- /* 0x2F8 */ s32 unk_2F8;
+ /* 0x2F8 */ s32 animationIndex;
/* 0x2FC */ s32 unk_2FC;
} EnDns; // size = 0x300
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 bf7955ec7b..8432b632ab 100644
--- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
+++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c
@@ -7,8 +7,9 @@
#include "z_en_dodongo.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
+#include "objects/object_dodongo/object_dodongo.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnDodongo*)thisx)
@@ -34,16 +35,6 @@ void func_808786C8(EnDodongo* this, GlobalContext* globalCtx);
void func_80878724(EnDodongo* this);
void func_808787B0(EnDodongo* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060013C4;
-extern AnimationHeader D_06001A44;
-extern AnimationHeader D_060028F0;
-extern AnimationHeader D_06003088;
-extern AnimationHeader D_06003B14;
-extern AnimationHeader D_060042C4;
-extern AnimationHeader D_06004C20;
-extern SkeletonHeader D_06008318;
-extern AnimationHeader D_06008B1C;
-
const ActorInit En_Dodongo_InitVars = {
ACTOR_EN_DODONGO,
ACTORCAT_ENEMY,
@@ -304,7 +295,8 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_330.a = 200;
Math_Vec3f_Copy(&this->unk_314, &D_801C5DB0);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 48.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dodongo_Skel_008318, &object_dodongo_Anim_004C20,
+ this->jointTable, this->morphTable, 31);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Collider_InitAndSetJntSph(globalCtx, &this->collider2, &this->actor, &sJntSphInit2, this->collider2Elements);
Collider_InitAndSetJntSph(globalCtx, &this->collider1, &this->actor, &sJntSphInit1, this->collider1Elements);
@@ -428,7 +420,7 @@ void func_80876CAC(EnDodongo* this) {
this->unk_344 = 1.125f;
this->unk_33C = 1.0f;
this->timer = 80;
- this->actor.flags &= ~0x400;
+ this->actor.flags &= ~ACTOR_FLAG_400;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 80);
}
@@ -441,7 +433,7 @@ void func_80876D28(EnDodongo* this, GlobalContext* globalCtx) {
this->unk_33C = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, &this->unk_348[0], 9, 2, this->unk_334 * 0.3f,
this->unk_334 * 0.2f);
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -545,7 +537,7 @@ s32 func_80877278(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_808773C4(EnDodongo* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06004C20, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_004C20, -4.0f);
this->actor.speedXZ = 0.0f;
this->timer = Rand_S16Offset(30, 50);
this->actionFunc = func_80877424;
@@ -565,7 +557,7 @@ void func_80877424(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_80877494(EnDodongo* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06008B1C, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dodongo_Anim_008B1C, -4.0f);
this->actor.speedXZ = this->unk_334 * 1.5f;
this->timer = Rand_S16Offset(50, 70);
this->actionFunc = func_80877500;
@@ -624,7 +616,7 @@ void func_808777A8(EnDodongo* this) {
s32 i;
Sphere16* sph;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060028F0, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0028F0, -4.0f);
this->actor.speedXZ = 0.0f;
for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) {
@@ -689,7 +681,7 @@ void func_8087784C(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_80877D50(EnDodongo* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06003088);
+ Animation_PlayOnce(&this->skelAnime, &object_dodongo_Anim_003088);
this->actionFunc = func_80877D90;
}
@@ -701,8 +693,8 @@ void func_80877D90(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_80877DE0(EnDodongo* this) {
- Animation_Change(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
- this->actor.flags |= 0x10;
+ Animation_Change(&this->skelAnime, &object_dodongo_Anim_0028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
+ this->actor.flags |= ACTOR_FLAG_10;
this->timer = 25;
this->actionFunc = func_80877E60;
this->actor.speedXZ = 0.0f;
@@ -742,7 +734,7 @@ void func_80877E60(EnDodongo* this, GlobalContext* globalCtx) {
Actor_MarkForDeath(this->actor.child);
this->actor.child = NULL;
}
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
} else if (this->skelAnime.playSpeed > -0.5f) {
this->timer--;
if (this->timer == 10) {
@@ -813,10 +805,10 @@ void func_80878354(EnDodongo* this) {
this->unk_306 = (0xFFFF - ABS_ALT(yDiff)) / 15;
if (yDiff >= 0) {
- sp18 = &D_060042C4;
+ sp18 = &object_dodongo_Anim_0042C4;
this->unk_306 = -this->unk_306;
} else {
- sp18 = &D_06003B14;
+ sp18 = &object_dodongo_Anim_003B14;
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_TAIL);
@@ -853,7 +845,7 @@ void func_80878424(EnDodongo* this, GlobalContext* globalCtx) {
sp20.z = this->collider1Elements[2].dim.worldSphere.center.z;
func_80876930(this, globalCtx, &sp20);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
}
void func_80878594(EnDodongo* this) {
@@ -879,7 +871,7 @@ void func_808785B0(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_8087864C(EnDodongo* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_001A44, -4.0f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
this->timer = 0;
this->unk_304 = 0;
@@ -899,11 +891,11 @@ void func_808786C8(EnDodongo* this, GlobalContext* globalCtx) {
}
void func_80878724(EnDodongo* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dodongo_Anim_0013C4, -8.0f);
this->timer = 0;
this->unk_304 = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DODO_J_DEAD);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
this->actionFunc = func_808787B0;
@@ -1025,8 +1017,8 @@ void EnDodongo_UpdateDamage(EnDodongo* this, GlobalContext* globalCtx) {
}
void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx2) {
- EnDodongo* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnDodongo* this = THIS;
EnDodongo_UpdateDamage(this, globalCtx);
this->actionFunc(this, globalCtx);
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 a410aabdd7..e5733c2b16 100644
--- a/src/overlays/actors/ovl_En_Door/z_en_door.c
+++ b/src/overlays/actors/ovl_En_Door/z_en_door.c
@@ -5,8 +5,22 @@
*/
#include "z_en_door.h"
+#include "objects/object_mkk/object_mkk.h"
+#include "objects/object_dor01/object_dor01.h"
+#include "objects/object_dor02/object_dor02.h"
+#include "objects/object_dor03/object_dor03.h"
+#include "objects/object_dor04/object_dor04.h"
+#include "objects/object_wdor01/object_wdor01.h"
+#include "objects/object_wdor02/object_wdor02.h"
+#include "objects/object_wdor03/object_wdor03.h"
+#include "objects/object_wdor04/object_wdor04.h"
+#include "objects/object_wdor05/object_wdor05.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_numa_obj/object_numa_obj.h"
+#include "objects/object_kaizoku_obj/object_kaizoku_obj.h"
+#include "objects/gameplay_field_keep/gameplay_field_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnDoor*)thisx)
@@ -15,7 +29,115 @@ void EnDoor_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx);
void EnDoor_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80866B20(EnDoor*, GlobalContext*);
+void func_8086704C(EnDoor*, GlobalContext*);
+void func_80866F94(EnDoor*, GlobalContext*);
+void func_80867080(EnDoor*, GlobalContext*);
+void func_80867144(EnDoor*, GlobalContext*);
+void func_808670F0(EnDoor*, GlobalContext*);
+void func_80866A5C(EnDoor*, GlobalContext*);
+
+u8 D_808675D0[] = {
+ 0x0C, 0x00, 0x03, 0x0E, 0x02, 0x06, 0x00, 0x17, 0x00, 0x08,
+ 0x02, 0x00, 0x00, 0x06, 0x00, 0x02, 0x09, 0x07, 0x05, 0x00,
+};
+
+u8 D_808675E4[] = {
+ 0x0F, 0x09, 0x00, 0x47, 0x0F, 0x0C, 0x00, 0x15, 0x0C, 0x00, 0x01, 0x13, 0x11, 0x00, 0x0F, 0x0D,
+ 0x00, 0x0A, 0x0F, 0x0F, 0x00, 0x07, 0x0F, 0x00, 0x00, 0x02, 0x09, 0x09, 0x05, 0x09, 0x08, 0x0C,
+ 0x00, 0x02, 0x19, 0x00, 0x1C, 0x08, 0x07, 0x0F, 0x0D, 0x00, 0x02, 0x09, 0x09, 0x05, 0x0F, 0x0D,
+ 0x00, 0xEA, 0x0F, 0x11, 0x00, 0xE7, 0x0F, 0x00, 0x00, 0xE2, 0x09, 0x09, 0x0F, 0x0D, 0x00, 0xDC,
+ 0x0F, 0x0D, 0x00, 0xD9, 0x0F, 0x12, 0x00, 0x01, 0x05, 0x09, 0x09, 0x09, 0x09, 0x00, 0x00, 0x00,
+};
+
+u8 D_80867634[] = {
+ 0x02, 0x06, 0x00, 0x17, 0x00, 0x02, 0x09, 0x1C, 0x05, 0x00, 0x00, 0x00,
+};
+
+u8 D_80867640[] = {
+ 0x02, 0x15, 0x00, 0x16, 0x00, 0x01, 0x05, 0x09, 0x0B, 0x00, 0x00, 0x00,
+};
+u8 D_8086764C[] = {
+ 0x02, 0x16, 0x00, 0x05, 0x00, 0x02, 0x09, 0x0A, 0x05, 0x00, 0x00, 0x00,
+};
+u8 D_80867658[] = {
+ 0x0C, 0x00, 0x02, 0x0F, 0x00, 0x1C, 0x08, 0x02, 0x09, 0x0C, 0x02, 0x0F, 0x0A, 0x16, 0x00,
+ 0x02, 0x09, 0x0C, 0x05, 0x0C, 0x00, 0x03, 0x11, 0x0F, 0x0D, 0x00, 0x0D, 0x00, 0x33, 0x08,
+ 0x02, 0x09, 0x0C, 0x0F, 0x16, 0x00, 0x02, 0x09, 0x0C, 0x05, 0x09, 0x0C, 0x00, 0x00,
+};
+
+u8 D_80867684[] = { 0x05, 0x00, 0x00, 0x00 };
+
+u8 D_80867688[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x0F, 0x05, 0x00 };
+
+u8 D_80867690[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x10, 0x05, 0x00 };
+
+u8 D_80867698[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x11, 0x05, 0x00 };
+
+u8 D_808676A0[] = {
+ 0x02, 0x0A, 0x00, 0x15, 0x00, 0x0F, 0x02, 0x16, 0x00, 0x05, 0x00, 0x02,
+ 0x09, 0x12, 0x08, 0x02, 0x02, 0x09, 0x22, 0x09, 0x21, 0x05, 0x00, 0x00,
+};
+
+u8 D_808676B8[] = {
+ 0x08, 0x00, 0x14, 0x0C, 0x00, 0x03, 0x07, 0x0F, 0x08, 0x00, 0x01, 0x05,
+ 0x09, 0x13, 0x02, 0x08, 0x00, 0x14, 0x1E, 0x02, 0x09, 0x13, 0x05, 0x05,
+};
+
+u8 D_808676D0[] = { 0x05, 0x00, 0x00, 0x00 };
+
+u8 D_808676D4[] = { 0x05, 0x00, 0x00, 0x00 };
+
+u8 D_808676D8[] = { 0x0C, 0x00, 0x03, 0x05, 0x0F, 0x12, 0x00, 0x01, 0x05, 0x09, 0x14, 0x00 };
+
+u8 D_808676E4[] = { 0x08, 0x00, 0x02, 0x09, 0x16, 0x05, 0x00, 0x00 };
+
+u8 D_808676EC[] = { 0x05, 0x00, 0x00, 0x00 };
+
+u8 D_808676F0[] = {
+ 0x0C, 0x00, 0x03, 0x05, 0x0F, 0x0A, 0x00, 0x07, 0x05, 0x02,
+ 0x0A, 0x00, 0x14, 0x00, 0xF9, 0x09, 0x15, 0x00, 0x00, 0x00,
+};
+
+u8 D_80867704[] = { 0x05, 0x00, 0x00, 0x00 };
+u8 D_80867708[] = { 0x05, 0x00, 0x00, 0x00 };
+u8 D_8086770C[] = { 0x05, 0x00, 0x00, 0x00 };
+u8 D_80867710[] = { 0x05, 0x00, 0x00, 0x00 };
+
+u8 D_80867714[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x17, 0x05, 0x00 };
+
+u8 D_8086771C[] = {
+ 0x0C, 0x00, 0x01, 0x07, 0x0F, 0x02, 0x1E, 0x02, 0x09, 0x18, 0x05, 0x0C,
+ 0x00, 0x03, 0xFB, 0x0F, 0x14, 0x00, 0xF7, 0x09, 0x0C, 0x00, 0x00, 0x00,
+};
+
+u8 D_80867734[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x19, 0x05, 0x00 };
+
+u8 D_8086773C[] = { 0x0F, 0x14, 0x00, 0x02, 0x09, 0x1A, 0x05, 0x00 };
+
+u8 D_80867744[] = {
+ 0x0C, 0x00, 0x02, 0x04, 0x00, 0x63, 0x80, 0x06, 0x0F, 0x14, 0x00, 0x08,
+ 0x09, 0x1B, 0x0F, 0x12, 0x00, 0x02, 0x09, 0x1B, 0x05, 0x00, 0x00, 0x00,
+};
+
+u8 D_8086775C[] = {
+ 0x00, 0x34, 0x20, 0x17, 0x00, 0x4B, 0x20, 0x13, 0x00, 0x0E, 0x04, 0x02, 0x09, 0x1D,
+ 0x00, 0x3B, 0x01, 0x08, 0x00, 0x3D, 0x02, 0x02, 0x09, 0x1E, 0x09, 0x1F, 0x05, 0x05,
+};
+
+u8 D_80867778[] = { 0x09, 0x20, 0x00, 0x00 };
+u8 D_8086777C[] = { 0x05, 0x00, 0x00, 0x00 };
+u8 D_80867780[] = { 0x05, 0x00, 0x00, 0x00 };
+u8 D_80867784[] = { 0x0F, 0x16, 0x00, 0x02, 0x09, 0x23, 0x05, 0x00 };
+
+// void* seems to keep the compiler happy.
+void* D_8086778C[] = {
+ &D_808675D0, &D_808675E4, &D_80867634, &D_80867640, &D_8086764C, &D_80867658, &D_80867684, &D_80867688,
+ &D_80867690, &D_80867698, &D_808676A0, &D_808676B8, &D_808676D0, &D_808676D4, &D_808676D8, &D_808676E4,
+ &D_808676EC, &D_808676F0, &D_80867704, &D_80867708, &D_8086770C, &D_80867710, &D_80867714, &D_8086771C,
+ &D_80867734, &D_8086773C, &D_80867744, &D_8086775C, &D_80867778, &D_8086777C, &D_80867780, &D_80867784,
+};
+
const ActorInit En_Door_InitVars = {
ACTOR_EN_DOOR,
ACTORCAT_DOOR,
@@ -28,38 +150,395 @@ const ActorInit En_Door_InitVars = {
(ActorFunc)EnDoor_Draw,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80867954[] = {
+typedef struct {
+ /* 0x00 */ s16 sceneNum;
+ /* 0x02 */ u8 dListIndex;
+ /* 0x04 */ s16 objectId;
+} EnDoorInfo;
+
+static EnDoorInfo sObjInfo[] = {
+ { SCENE_MITURIN, 0x01, OBJECT_NUMA_OBJ },
+ { SCENE_TENMON_DAI, 0x02, OBJECT_DOR01 },
+ { SCENE_00KEIKOKU, 0x02, OBJECT_DOR01 },
+ { SCENE_30GYOSON, 0x02, OBJECT_DOR01 },
+ { SCENE_LABO, 0x02, OBJECT_DOR01 },
+ { SCENE_33ZORACITY, 0x03, OBJECT_DOR02 },
+ { SCENE_UNSET_31, 0x03, OBJECT_DOR02 },
+ { SCENE_BANDROOM, 0x03, OBJECT_DOR02 },
+ { SCENE_20SICHITAI, 0x04, OBJECT_DOR03 },
+ { SCENE_20SICHITAI2, 0x04, OBJECT_DOR03 },
+ { SCENE_MAP_SHOP, 0x04, OBJECT_DOR03 },
+ { SCENE_KAIZOKU, 0x0B, OBJECT_KAIZOKU_OBJ },
+ { SCENE_PIRATE, 0x0B, OBJECT_KAIZOKU_OBJ },
+ { SCENE_TORIDE, 0x0B, OBJECT_KAIZOKU_OBJ },
+ { SCENE_KINDAN2, 0x0C, OBJECT_KINSTA2_OBJ },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x08, OBJECT_WDOR03 },
+ { -1, 0x07, OBJECT_WDOR02 },
+ { -1, 0x06, OBJECT_WDOR01 },
+ { -1, 0x07, OBJECT_WDOR02 },
+ { -1, 0x06, OBJECT_WDOR01 },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x09, OBJECT_WDOR04 },
+ { -1, 0x08, OBJECT_WDOR03 },
+ { -1, 0x08, OBJECT_WDOR03 },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x06, OBJECT_WDOR01 },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x00, GAMEPLAY_KEEP },
+ { -1, 0x0A, OBJECT_WDOR05 },
+ { -1, 0x0D, GAMEPLAY_FIELD_KEEP },
+ { -1, 0x05, OBJECT_DOR04 },
+ { -1, 0x09, OBJECT_WDOR04 },
+ { -1, 0x04, OBJECT_DOR03 },
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_U16(shape.rot.x, 0, ICHAIN_CONTINUE),
ICHAIN_U16(shape.rot.z, 0, ICHAIN_STOP),
};
-#endif
+static AnimationHeader* sAnimations[] = {
+ &gameplay_keep_Anim_020658, &gameplay_keep_Anim_022CA8, &gameplay_keep_Anim_020658, &gameplay_keep_Anim_022E68,
+ &gameplay_keep_Anim_0204B4, &gameplay_keep_Anim_022BE8, &gameplay_keep_Anim_022D90, &gameplay_keep_Anim_022BE8,
+ &gameplay_keep_Anim_022FF0, &gameplay_keep_Anim_0205A0,
+};
+static u8 sAnimOpenFrames[10] = {
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
+};
-extern InitChainEntry D_80867954[];
+static u8 sAnimCloseFrames[10] = {
+ 60, 60, 60, 70, 70, 60, 60, 60, 60, 70,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/EnDoor_Init.s")
+static Gfx* D_808679A4[14][2] = {
+ { gDoorLeftDL, gDoorRightDL },
+ { gWoodfallDoorDL, gWoodfallDoorDL },
+ { object_dor01_DL_000448, object_dor01_DL_000448 },
+ { gZoraHallDoorDL, gZoraHallDoorDL },
+ { gSwampDoorDL, gSwampDoorDL },
+ { gMagicHagPotionShopDoorDL, gMagicHagPotionShopDoorDL },
+ { object_wdor01_DL_000548, object_wdor01_DL_000548 }, // Lottery Shop / Curiosity Shop / Mayor's House Door
+ { object_wdor02_DL_000548, object_wdor02_DL_000548 }, // Trading Post / Post Office Door
+ { object_wdor03_DL_000548, object_wdor03_DL_000548 }, // Stockpot Inn & Swordsman's School Door
+ { gMilkBarDoorDL, gMilkBarDoorDL },
+ { gMusicBoxHouseDoorDL, gMusicBoxHouseDoorDL },
+ { gPiratesFortressDoorDL, gPiratesFortressDoorDL },
+ { object_mkk_DL_000310, object_mkk_DL_000310 },
+ { gFieldWoodDoorLeftDL, gFieldWoodDoorRightDL },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/EnDoor_Destroy.s")
+void EnDoor_Init(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ s32 objectBankIndex;
+ EnDoorInfo* objectInfo = sObjInfo;
+ EnDoor* this = THIS;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80866A5C.s")
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80866B20.s")
+ this->unk_1A4 = ENDOOR_GET_PARAMS_7(thisx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80866F94.s")
+ this->switchFlag = ENDOOR_GET_PARAMS_7F(thisx);
+ if ((this->unk_1A4 == 7) && (this->switchFlag == 0)) {
+ DynaPolyActor_Init(&this->dyna, 0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gDoorCol);
+ }
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gDoorSkel, &gameplay_keep_Anim_020658, this->limbTable,
+ this->limbTable, 5);
+ if (this->unk_1A4 == 5) {
+ objectInfo = &sObjInfo[17 + this->switchFlag];
+ } else {
+ for (i = 0; i < ARRAY_COUNT(sObjInfo) - 34; i++, objectInfo++) {
+ if (globalCtx->sceneNum == objectInfo->sceneNum) {
+ break;
+ }
+ }
+ if ((i >= ARRAY_COUNT(sObjInfo) - 34) && (Object_GetIndex(&globalCtx->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) {
+ objectInfo++;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_8086704C.s")
+ this->dlIndex = objectInfo->dListIndex;
+ objectBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectInfo->objectId);
+ if (objectBankIndex < 0) {
+ objectInfo = &sObjInfo[15];
+ objectBankIndex = Object_GetIndex(&globalCtx->objectCtx, objectInfo->objectId);
+ if (objectBankIndex != 0) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ }
+ this->requiredObjBankIndex = objectBankIndex;
+ this->dlIndex = objectInfo->dListIndex; // Set twice?
+ if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex) {
+ func_80866A5C(this, globalCtx);
+ } else {
+ this->actionFunc = func_80866A5C;
+ }
+ Actor_SetFocus(&this->dyna.actor, 35.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80867080.s")
+void EnDoor_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnDoor* this = (EnDoor*)thisx;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_808670F0.s")
+ if (this->unk_1A4 != 7) {
+ TransitionActorEntry* transitionEntry =
+ &globalCtx->doorCtx.transitionActorList[(u16)this->dyna.actor.params >> 0xA];
+ if (transitionEntry->id < 0) {
+ transitionEntry->id = -transitionEntry->id;
+ }
+ } else if (this->switchFlag == 0) {
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80867144.s")
+void func_80866A5C(EnDoor* this, GlobalContext* globalCtx) {
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->requiredObjBankIndex)) {
+ this->dyna.actor.objBankIndex = this->requiredObjBankIndex;
+ this->actionFunc = func_80866B20;
+ this->dyna.actor.world.rot.y = 0;
+ if (this->unk_1A4 == 1) {
+ if (!Flags_GetSwitch(globalCtx, this->switchFlag)) {
+ this->unk_1A6 = 10;
+ }
+ } else if ((this->unk_1A4 == 4) &&
+ (Actor_XZDistanceBetweenActors(&this->dyna.actor, &GET_PLAYER(globalCtx)->actor) > 120.0f)) {
+ this->actionFunc = func_8086704C;
+ this->dyna.actor.world.rot.y = -0x1800;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/EnDoor_Update.s")
+void func_80866B20(EnDoor* this, GlobalContext* globalCtx) {
+ static s32 D_80867BC0[4];
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f playerPosRelToDoor;
+ s16 temp_a2;
+ s16 yawDiff;
+ s32 temp_a1_2;
+ s32 temp_t0;
+ u8 temp_a1;
+ s32 pad;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/func_80867350.s")
+ if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state) && (this->dyna.actor.textId == 0x1821)) {
+ D_80867BC0[0] = 1;
+ }
+ if (this->unk_1A1 != 0) {
+ this->actionFunc = func_80867144;
+ Animation_PlayOnceSetSpeed(&this->skelAnime, sAnimations[this->animIndex],
+ (player->stateFlags1 & 0x8000000) ? 0.75f : 1.5f);
+ if (this->unk_1A6 != 0) {
+ gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
+ Flags_SetSwitch(globalCtx, this->switchFlag);
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
+ }
+ } else if (this->unk_1A7 != 0) {
+ this->actionFunc = func_80866F94;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_OPEN);
+ } else if (!Player_InCsMode(&globalCtx->state)) {
+ Actor_OffsetOfPointInActorCoords(&this->dyna.actor, &playerPosRelToDoor, &player->actor.world.pos);
+ if ((D_80867BC0[0] != 0) || ((fabsf(playerPosRelToDoor.y) < 20.0f) && (fabsf(playerPosRelToDoor.x) < 20.0f) &&
+ (fabsf(playerPosRelToDoor.z) < 50.0f))) {
+ yawDiff = player->actor.shape.rot.y - this->dyna.actor.shape.rot.y;
+ if (playerPosRelToDoor.z > 0.0f) {
+ yawDiff = (0x8000 - yawDiff);
+ }
+ if (ABS_ALT(yawDiff) < 0x3000) {
+ player->doorType = 1;
+ player->doorDirection = playerPosRelToDoor.z >= 0.0f ? 1.0f : -1.0f;
+ player->doorActor = &this->dyna.actor;
+ if (this->unk_1A6 != 0) {
+ if (gSaveContext.inventory.dungeonKeys[((void)0, gSaveContext.mapIndex)] <= 0) {
+ player->doorType = -1;
+ this->dyna.actor.textId = 0x1802;
+ } else {
+ player->doorTimer = 10;
+ }
+ } else if (this->unk_1A4 == 4) {
+ player->doorType = -1;
+ this->dyna.actor.textId = 0x1800;
+ } else if ((this->unk_1A4 == 0) || (this->unk_1A4 == 2) || (this->unk_1A4 == 3)) {
+ s32 textIdOffset;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Door/EnDoor_Draw.s")
+ temp_t0 = (globalCtx->actorCtx.unkC & 0x2AA) >> 1;
+ temp_a2 = D_801AED48[this->switchFlag & 7];
+ temp_a1_2 = globalCtx->actorCtx.unkC & 0x155;
+ textIdOffset = (this->switchFlag >> 3) & 0xF;
+ if (((this->unk_1A4 == 0) && (((temp_t0 | temp_a1_2) & temp_a2) == 0)) ||
+ ((this->unk_1A4 == 2) && ((temp_a2 & temp_a1_2) == 0)) ||
+ ((this->unk_1A4 == 3) && ((temp_a2 & temp_t0) == 0))) {
+ s16 baseTextId = 0x182D;
+
+ if (this->unk_1A4 == 3) {
+ baseTextId = 0x180D;
+ } else if (this->unk_1A4 == 2) {
+ baseTextId = 0x181D;
+ }
+ player->doorType = -1;
+ this->dyna.actor.textId = baseTextId + textIdOffset;
+ }
+ } else if ((this->unk_1A4 == 5) && (playerPosRelToDoor.z > 0.0f)) {
+ struct_80133038_arg2 sp30;
+
+ if (func_80133038(globalCtx, D_8086778C[this->switchFlag], &sp30) != 0) {
+ this->dyna.actor.textId = sp30.unk0 + 0x1800;
+
+ player->doorType = ((this->dyna.actor.textId == 0x1821) && (D_80867BC0[0] != 0)) ? 5 : -1;
+ }
+ }
+ func_80122F28(player);
+ }
+ } else if ((this->unk_1A4 == 4) && (this->dyna.actor.xzDistToPlayer > 240.0f)) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_OPEN);
+ this->actionFunc = func_80867080;
+ }
+ }
+}
+
+void func_80866F94(EnDoor* this, GlobalContext* globalCtx) {
+ s32 direction;
+
+ if (this->unk_1A7 != 0) {
+ if (this->unk_1A7 >= 0) {
+ direction = 1;
+ } else {
+ direction = -1;
+ }
+ if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, direction * 0x3E80, 0x7D0)) {
+ Math_StepToC(&this->unk_1A7, 0, 1);
+ }
+ } else {
+ if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x7D0)) {
+ this->actionFunc = func_80866B20;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_AUTO_DOOR_CLOSE);
+ }
+ }
+}
+
+void func_8086704C(EnDoor* this, GlobalContext* globalCtx) {
+ if (this->dyna.actor.xzDistToPlayer < 120.0f) {
+ this->actionFunc = func_808670F0;
+ }
+}
+
+void func_80867080(EnDoor* this, GlobalContext* globalCtx) {
+ if (this->dyna.actor.xzDistToPlayer < 120.0f) {
+ this->actionFunc = func_808670F0;
+ } else if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, -0x1800, 0x100)) {
+ this->actionFunc = func_8086704C;
+ }
+}
+
+void func_808670F0(EnDoor* this, GlobalContext* globalCtx) {
+ if (Math_ScaledStepToS(&this->dyna.actor.world.rot.y, 0, 0x700)) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE);
+ this->actionFunc = func_80866B20;
+ }
+}
+
+void func_80867144(EnDoor* this, GlobalContext* globalCtx) {
+ s32 numEffects;
+ s32 i;
+
+ if (DECR(this->unk_1A6) == 0) {
+ if (SkelAnime_Update(&this->skelAnime) != 0) {
+ this->actionFunc = func_80866B20;
+ this->unk_1A1 = 0;
+ } else if (Animation_OnFrame(&this->skelAnime, sAnimOpenFrames[this->animIndex])) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_OC_DOOR_OPEN);
+ if (this->skelAnime.playSpeed < 1.5f) {
+ numEffects = (s32)(Rand_ZeroOne() * 30.0f) + 50;
+ for (i = 0; i < numEffects; i++) {
+ EffectSsBubble_Spawn(globalCtx, &this->dyna.actor.world.pos, 60.0, 100.0f, 50.0f, 0.15f);
+ }
+ }
+ } else if (Animation_OnFrame(&this->skelAnime, sAnimCloseFrames[this->animIndex])) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_DOOR_CLOSE);
+ }
+ }
+}
+
+void EnDoor_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnDoor* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+}
+
+s32 EnDoor_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ TransitionActorEntry* transitionEntry;
+ EnDoor* this = THIS;
+
+ if (limbIndex == 4) {
+ Gfx** dl = D_808679A4[this->dlIndex];
+ s16 temp;
+ s32 dlIndex;
+
+ transitionEntry = NULL;
+
+ if (this->unk_1A4 != 7) {
+ transitionEntry = &globalCtx->doorCtx.transitionActorList[(u16)this->dyna.actor.params >> 0xA];
+ }
+ rot->z += this->dyna.actor.world.rot.y;
+ if ((this->unk_1A4 == 7) || (globalCtx->roomCtx.prevRoom.num >= 0) ||
+ (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) {
+ s32 pad;
+
+ temp = (this->dyna.actor.shape.rot.y + this->skelAnime.jointTable[3].z + rot->z) -
+ Math_Vec3f_Yaw(&globalCtx->view.eye, &this->dyna.actor.world.pos);
+ *dList = (ABS_ALT(temp) < 0x4000) ? dl[0] : dl[1];
+
+ } else {
+ dlIndex = 0;
+ if (transitionEntry->sides[0].room != this->dyna.actor.room) {
+ dlIndex = 1;
+ }
+ *dList = dl[dlIndex];
+ }
+ }
+ return 0;
+}
+
+void EnDoor_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnDoor* this = THIS;
+
+ if (this->dyna.actor.objBankIndex == this->requiredObjBankIndex) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ if ((this->unk_1A4 == 7) && (this->switchFlag == 0)) {
+ Gfx_DrawDListOpa(globalCtx, gameplay_keep_DL_0221B8);
+ } else {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ }
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDoor_OverrideLimbDraw,
+ NULL, &this->dyna.actor);
+ if (this->dyna.actor.world.rot.y != 0) {
+ if (this->dyna.actor.world.rot.y > 0) {
+ gSPDisplayList(POLY_OPA_DISP++, gDoorRightDL);
+ } else {
+ gSPDisplayList(POLY_OPA_DISP++, gDoorLeftDL);
+ }
+ }
+ if (this->unk_1A6) {
+ Actor_DrawDoorLock(globalCtx, this->unk_1A6, 0);
+ }
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
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 6ed5aac156..bc94e150ee 100644
--- a/src/overlays/actors/ovl_En_Door/z_en_door.h
+++ b/src/overlays/actors/ovl_En_Door/z_en_door.h
@@ -7,19 +7,24 @@ struct EnDoor;
typedef void (*EnDoorActionFunc)(struct EnDoor*, GlobalContext*);
+#define ENDOOR_GET_PARAMS_7(thisx) (((thisx)->params >> 7) & 7)
+#define ENDOOR_GET_PARAMS_7F(thisx) (((thisx)->params) & 0x7F)
+
+
typedef struct EnDoor {
- /* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x5C];
- /* 0x1A0 */ s8 unk_1A0;
- /* 0x1A1 */ s8 unk_1A1;
- /* 0x1A2 */ char unk_1A2[0x2];
+ /* 0x000 */ DynaPolyActor dyna;
+ /* 0x15C */ SkelAnime skelAnime;
+ /* 0x1A0 */ u8 animIndex;
+ /* 0x1A1 */ u8 unk_1A1;
+ /* 0x1A2 */ s8 requiredObjBankIndex;
+ /* 0x1A3 */ s8 dlIndex;
/* 0x1A4 */ u8 unk_1A4;
- /* 0x1A5 */ u8 unk_1A5;
- /* 0x1A6 */ s8 unk_1A6;
+ /* 0x1A5 */ u8 switchFlag;
+ /* 0x1A6 */ u8 unk_1A6;
/* 0x1A7 */ s8 unk_1A7;
- /* 0x1A8 */ char unk_1A8[0x20];
+ /* 0x1A8 */ Vec3s limbTable[5];
/* 0x1C8 */ EnDoorActionFunc actionFunc;
-} EnDoor; // size = 0x1CC
+} EnDoor;
extern const ActorInit En_Door_InitVars;
diff --git a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c
index 688aa7a420..9b53c36d2a 100644
--- a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c
+++ b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c
@@ -6,7 +6,7 @@
#include "z_en_door_etc.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnDoorEtc*)thisx)
diff --git a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
index 2068ca8ffb..604be5441f 100644
--- a/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
+++ b/src/overlays/actors/ovl_En_Dragon/z_en_dragon.c
@@ -6,7 +6,7 @@
#include "z_en_dragon.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnDragon*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c
index 1ca8d69fcc..c47961a6d2 100644
--- a/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c
+++ b/src/overlays/actors/ovl_En_Ds2n/z_en_ds2n.c
@@ -6,7 +6,7 @@
#include "z_en_ds2n.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnDs2n*)thisx)
diff --git a/src/overlays/actors/ovl_En_Dt/z_en_dt.c b/src/overlays/actors/ovl_En_Dt/z_en_dt.c
index d76c0c919f..0501b728c6 100644
--- a/src/overlays/actors/ovl_En_Dt/z_en_dt.c
+++ b/src/overlays/actors/ovl_En_Dt/z_en_dt.c
@@ -6,7 +6,7 @@
#include "z_en_dt.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnDt*)thisx)
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 564b52fcb1..40e06787ce 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
@@ -5,8 +5,9 @@
*/
#include "z_en_dy_extra.h"
+#include "objects/object_dy_obj/object_dy_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnDyExtra*)thisx)
@@ -30,9 +31,6 @@ const ActorInit En_Dy_Extra_InitVars = {
(ActorFunc)EnDyExtra_Draw,
};
-extern Vtx D_0600DD40[];
-extern Gfx D_0600DEF0[];
-
void EnDyExtra_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
@@ -88,11 +86,10 @@ void EnDyExtra_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static Color_RGBA8 D_80A61740[] = { { 255, 255, 170, 255 },
- { 255, 170, 255, 255 },
- { 255, 255, 170, 255 },
- { 170, 255, 255, 255 },
- { 255, 255, 170, 255 } };
+ static Color_RGBA8 D_80A61740[] = {
+ { 255, 255, 170, 255 }, { 255, 170, 255, 255 }, { 255, 255, 170, 255 },
+ { 170, 255, 255, 255 }, { 255, 255, 170, 255 },
+ };
static Color_RGBA8 D_80A61754[] = {
{ 255, 100, 0, 255 }, { 255, 0, 100, 255 }, { 100, 255, 0, 255 }, { 0, 100, 255, 255 }, { 255, 230, 0, 255 }
};
@@ -101,7 +98,7 @@ void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnDyExtra* this = THIS;
s32 pad;
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
- Vtx* vertices = Lib_SegmentedToVirtual(D_0600DD40);
+ Vtx* vertices = Lib_SegmentedToVirtual(object_dy_obj_Vtx_00DD40);
s32 i;
u8 unk[3];
@@ -126,7 +123,7 @@ void EnDyExtra_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, D_80A61740[this->type].r, D_80A61740[this->type].g,
D_80A61740[this->type].b, 255);
gDPSetEnvColor(POLY_XLU_DISP++, D_80A61754[this->type].r, D_80A61754[this->type].g, D_80A61754[this->type].b, 128);
- gSPDisplayList(POLY_XLU_DISP++, D_0600DEF0);
+ gSPDisplayList(POLY_XLU_DISP++, object_dy_obj_DL_00DEF0);
CLOSE_DISPS(gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
index 8d72af042f..bea655d9a1 100644
--- a/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
+++ b/src/overlays/actors/ovl_En_Egblock/z_en_egblock.c
@@ -6,7 +6,7 @@
#include "z_en_egblock.h"
-#define FLAGS 0x08000000
+#define FLAGS (ACTOR_FLAG_8000000)
#define THIS ((EnEgblock*)thisx)
diff --git a/src/overlays/actors/ovl_En_Egol/z_en_egol.c b/src/overlays/actors/ovl_En_Egol/z_en_egol.c
index fe3e0e09ed..0111c6cd7b 100644
--- a/src/overlays/actors/ovl_En_Egol/z_en_egol.c
+++ b/src/overlays/actors/ovl_En_Egol/z_en_egol.c
@@ -6,7 +6,7 @@
#include "z_en_egol.h"
-#define FLAGS 0x80000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_80000000)
#define THIS ((EnEgol*)thisx)
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 d614223e76..134a7080ef 100644
--- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c
+++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c
@@ -5,8 +5,9 @@
*/
#include "z_en_elf.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((EnElf*)thisx)
@@ -32,8 +33,6 @@ void func_8088F5F4(EnElf* this, GlobalContext* globalCtx, s32 arg2);
void func_8089010C(Actor* thisx, GlobalContext* globalCtx);
void func_808908D0(Vec3f* arg0, GlobalContext* globalCtx, u32 arg2);
-extern SkeletonHeader D_0402AF58;
-
const ActorInit En_Elf_InitVars = {
ACTOR_EN_ELF,
ACTORCAT_ITEMACTION,
@@ -322,7 +321,8 @@ void EnElf_Init(Actor* thisx, GlobalContext* globalCtx2) {
s32 params;
Actor_ProcessInitChain(thisx, sInitChain);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_0402AF58, &D_04029140, this->jointTable, this->morphTable, 7);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140,
+ this->jointTable, this->morphTable, 7);
ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f);
thisx->shape.shadowAlpha = 255;
@@ -700,7 +700,7 @@ void func_8088DD34(EnElf* this, GlobalContext* globalCtx) {
}
if (this->fairyFlags & 0x2000) {
- Actor_PickUp(&this->actor, globalCtx, 0xBA, 80.0f, 60.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MAX, 80.0f, 60.0f);
}
}
@@ -854,8 +854,8 @@ void func_8088E60C(EnElf* this, GlobalContext* globalCtx) {
glowLightRadius = 0;
}
- if (func_800EE29C(globalCtx, 0xC9)) {
- if (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0xC9)]->unk0 == 6) {
+ if (Cutscene_CheckActorAction(globalCtx, 201)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 201)]->action == 6) {
glowLightRadius = 0;
}
}
@@ -888,12 +888,12 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) {
func_8088E5A8(this, globalCtx);
xScale = 0.0f;
- if (func_800EE29C(globalCtx, 0xC9)) {
- sp38 = func_800EE200(globalCtx, 0xC9);
+ if (Cutscene_CheckActorAction(globalCtx, 201)) {
+ sp38 = Cutscene_GetActorActionIndex(globalCtx, 201);
func_808908D0(&nextPos, globalCtx, sp38);
- this->actor.shape.rot.y = globalCtx->csCtx.npcActions[sp38]->unk8;
- this->actor.shape.rot.x = globalCtx->csCtx.npcActions[sp38]->unk6;
- if (globalCtx->csCtx.npcActions[sp38]->unk0 == 5) {
+ this->actor.shape.rot.y = globalCtx->csCtx.actorActions[sp38]->urot.y;
+ this->actor.shape.rot.x = globalCtx->csCtx.actorActions[sp38]->urot.x;
+ if (globalCtx->csCtx.actorActions[sp38]->action == 5) {
func_8088F5F4(this, globalCtx, 16);
}
@@ -904,14 +904,14 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) {
}
if ((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 0) &&
- (globalCtx->csCtx.unk_12 == 0) &&
- ((globalCtx->csCtx.frames == 0x95) || (globalCtx->csCtx.frames == 0x17D) ||
- (globalCtx->csCtx.frames == 0x24F))) {
+ (globalCtx->csCtx.currentCsIndex == 0) &&
+ ((globalCtx->csCtx.frames == 149) || (globalCtx->csCtx.frames == 381) ||
+ (globalCtx->csCtx.frames == 591))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
}
if ((globalCtx->sceneNum == SCENE_SECOM) && (gSaveContext.sceneSetupIndex == 0) &&
- (globalCtx->csCtx.unk_12 == 4) && (globalCtx->csCtx.frames == 0x5F)) {
+ (globalCtx->csCtx.currentCsIndex == 4) && (globalCtx->csCtx.frames == 95)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_WHITE_FAIRY_DASH);
}
} else {
@@ -1016,7 +1016,7 @@ void func_8088E850(EnElf* this, GlobalContext* globalCtx) {
func_8088E60C(this, globalCtx);
- if (!func_800EE29C(globalCtx, 0xC9)) {
+ if (!Cutscene_CheckActorAction(globalCtx, 0xC9)) {
this->actor.shape.rot.y = this->unk_258;
}
}
@@ -1107,8 +1107,8 @@ void func_8088F214(EnElf* this, GlobalContext* globalCtx) {
s32 pad;
if (globalCtx->csCtx.state != 0) {
- if (func_800EE29C(globalCtx, 0xC9)) {
- switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0xC9)]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 201)) {
+ switch (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 201)]->action) {
case 4:
sp34 = 7;
break;
@@ -1577,8 +1577,8 @@ void EnElf_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (player->currentMask != PLAYER_MASK_GIANT) {
if (!(this->fairyFlags & 8) &&
- (!func_800EE29C(globalCtx, 0xC9) ||
- (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0xC9)]->unk0 != 6)) &&
+ (!Cutscene_CheckActorAction(globalCtx, 201) ||
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 201)]->action != 6)) &&
(!(player->stateFlags1 & 0x100000) || (kREG(90) < this->actor.projectedPos.z))) {
Gfx* dListHead = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(Gfx) * 4);
f32 alphaScale;
@@ -1621,17 +1621,17 @@ void EnElf_Draw(Actor* thisx, GlobalContext* globalCtx) {
void func_808908D0(Vec3f* vec, GlobalContext* globalCtx, u32 action) {
Vec3f startPos;
Vec3f endPos;
- CsCmdActorAction* npcAction = globalCtx->csCtx.npcActions[action];
+ CsCmdActorAction* npcAction = globalCtx->csCtx.actorActions[action];
f32 lerp;
- startPos.x = npcAction->unk0C.x;
- startPos.y = npcAction->unk0C.y;
- startPos.z = npcAction->unk0C.z;
+ startPos.x = npcAction->startPos.x;
+ startPos.y = npcAction->startPos.y;
+ startPos.z = npcAction->startPos.z;
- endPos.x = npcAction->unk18.x;
- endPos.y = npcAction->unk18.y;
- endPos.z = npcAction->unk18.z;
+ endPos.x = npcAction->endPos.x;
+ endPos.y = npcAction->endPos.y;
+ endPos.z = npcAction->endPos.z;
- lerp = func_800F5A8C(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames, globalCtx);
+ lerp = Environment_LerpWeight(npcAction->endFrame, npcAction->startFrame, globalCtx->csCtx.frames);
VEC3F_LERPIMPDST(vec, &startPos, &endPos, lerp);
}
diff --git a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
index e0eed3f3c0..3693b258b0 100644
--- a/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
+++ b/src/overlays/actors/ovl_En_Elfbub/z_en_elfbub.c
@@ -6,8 +6,9 @@
#include "z_en_elfbub.h"
#include "overlays/actors/ovl_En_Elforg/z_en_elforg.h"
+#include "objects/object_bubble/object_bubble.h"
-#define FLAGS 0x00000001
+#define FLAGS (ACTOR_FLAG_1)
#define THIS ((EnElfbub*)thisx)
@@ -51,8 +52,6 @@ static ColliderCylinderInit sCylinderInit = {
{ 16, 32, 0, { 0, 0, 0 } },
};
-extern Gfx D_06001000[];
-
void EnElfbub_Init(Actor* thisx, GlobalContext* globalCtx) {
EnElfbub* this = THIS;
Actor* childActor;
@@ -83,7 +82,7 @@ void EnElfbub_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->oscillationAngle = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
void EnElfbub_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -162,7 +161,7 @@ void EnElfbub_Draw(Actor* thisx, GlobalContext* globalCtx2) {
Matrix_InsertZRotation_s(this->zRot * -1, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06001000);
+ gSPDisplayList(POLY_XLU_DISP++, object_bubble_DL_001000);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
index bb19fa61a7..9ff716318b 100644
--- a/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
+++ b/src/overlays/actors/ovl_En_Elfgrp/z_en_elfgrp.c
@@ -6,7 +6,7 @@
#include "z_en_elfgrp.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnElfgrp*)thisx)
diff --git a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
index 65863f546d..3c263c0182 100644
--- a/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
+++ b/src/overlays/actors/ovl_En_Elforg/z_en_elforg.c
@@ -7,7 +7,7 @@
#include "z_en_elforg.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnElforg*)thisx)
@@ -456,7 +456,7 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) {
if (STRAY_FAIRY_TYPE(&this->actor) == STRAY_FAIRY_TYPE_CLOCK_TOWN) {
player->actor.freezeTimer = 100;
player->stateFlags1 |= 0x20000000;
- func_801518B0(globalCtx, 0x579, NULL);
+ Message_StartTextbox(globalCtx, 0x579, NULL);
this->actionFunc = EnElforg_ClockTownFairyCollected;
ActorCutscene_SetIntentToPlay(0x7C);
return;
@@ -464,7 +464,7 @@ void EnElforg_FreeFloating(EnElforg* this, GlobalContext* globalCtx) {
if (func_8010A074(globalCtx)) {
gSaveContext.inventory.strayFairies[gSaveContext.unk_48C8]++;
- func_801518B0(globalCtx, 0x11, NULL);
+ Message_StartTextbox(globalCtx, 0x11, NULL);
if (gSaveContext.inventory.strayFairies[(void)0, gSaveContext.unk_48C8] >= 15) {
func_801A3098(NA_BGM_GET_ITEM | 0x900);
}
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 2672c209f2..b9a1860571 100644
--- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
+++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c
@@ -6,7 +6,7 @@
#include "z_en_encount1.h"
-#define FLAGS 0x08100010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_100000 | ACTOR_FLAG_8000000)
#define THIS ((EnEncount1*)thisx)
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 72638d9a6a..3cf01bd8a8 100644
--- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h
+++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.h
@@ -10,7 +10,11 @@ typedef void (*EnEncount1ActionFunc)(struct EnEncount1*, GlobalContext*);
typedef struct EnEncount1 {
/* 0x0000 */ Actor actor;
/* 0x0144 */ EnEncount1ActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x1C];
+ /* 0x0148 */ char unk_148[0x6];
+ /* 0x014E */ s16 unk_14E;
+ /* 0x0150 */ char unk_150[0xA];
+ /* 0x015A */ s16 unk_15A;
+ /* 0x015C */ char unk_15C[0x8];
} EnEncount1; // size = 0x164
extern const ActorInit En_Encount1_InitVars;
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 58bf7e1fe7..83f04b0134 100644
--- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c
+++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c
@@ -5,8 +5,10 @@
*/
#include "z_en_encount2.h"
+#include "objects/object_fusen/object_fusen.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnEncount2*)thisx)
@@ -97,17 +99,13 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0xF),
};
-extern Gfx D_06000A00[];
-extern Gfx D_06000D78[];
-extern CollisionHeader D_06002420;
-
void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEncount2* this = THIS;
s32 pad;
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, 0);
- CollisionHeader_GetVirtual(&D_06002420, &colHeader);
+ CollisionHeader_GetVirtual(&object_fusen_Colheader_002420, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
@@ -209,8 +207,8 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnEncount2_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnEncount2* this = THIS;
if (this->isPopped != true) {
- Gfx_DrawDListOpa(globalCtx, D_06000A00);
- Gfx_DrawDListOpa(globalCtx, D_06000D78);
+ Gfx_DrawDListOpa(globalCtx, object_fusen_DL_000A00);
+ Gfx_DrawDListOpa(globalCtx, object_fusen_DL_000D78);
}
EnEncount2_DrawParticles(this, globalCtx);
}
@@ -279,8 +277,8 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
Matrix_InsertTranslation(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY);
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 20);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(&D_04079B10));
- gSPDisplayList(POLY_XLU_DISP++, D_0407AB10);
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gSun1Tex));
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB10);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
@@ -288,7 +286,7 @@ void EnEncount2_DrawParticles(EnEncount2* this, GlobalContext* globalCtx) {
Matrix_InsertZRotation_f(DEGTORAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_0407AB58);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_07AB58);
}
}
CLOSE_DISPS(gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c
index 184eb8728b..b9681b5e18 100644
--- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c
+++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c
@@ -6,7 +6,7 @@
#include "z_en_encount3.h"
-#define FLAGS 0x08000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
#define THIS ((EnEncount3*)thisx)
diff --git a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
index d4f6c44870..eaadd81333 100644
--- a/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
+++ b/src/overlays/actors/ovl_En_Encount4/z_en_encount4.c
@@ -6,7 +6,7 @@
#include "z_en_encount4.h"
-#define FLAGS 0x08000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_8000000)
#define THIS ((EnEncount4*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c
index f483b3289d..b366a4dec4 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero/z_en_ending_hero.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ending_hero.h"
+#include "objects/object_dt/object_dt.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero*)thisx)
@@ -30,25 +31,15 @@ const ActorInit En_Ending_Hero_InitVars = {
(ActorFunc)EnEndingHero_Draw,
};
-extern FlexSkeletonHeader D_0600B0CC;
-extern AnimationHeader D_06000BE0;
-extern UNK_PTR D_06007350[];
-extern UNK_PTR D_06009590[];
-extern UNK_PTR D_06009F90[];
-extern UNK_PTR D_0600A790[];
-extern UNK_PTR D_0600AB90[];
-extern UNK_PTR D_06007750[];
-extern UNK_PTR D_0600A390[];
-extern UNK_PTR D_0600A490[];
-
void EnEndingHero_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero* this = THIS;
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B0CC, &D_06000BE0, this->jointTable, this->morphTable, 15);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dt_Skel_00B0CC, &object_dt_Anim_000BE0, this->jointTable,
+ this->morphTable, 15);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C1E748(this);
}
@@ -80,8 +71,14 @@ void EnEndingHero_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
}
-static UNK_PTR D_80C1E970[] = { D_06007350, D_06009590, D_06009F90, D_0600A790, D_0600AB90 };
-static UNK_PTR D_80C1E984[] = { D_06007750, D_0600A390, D_0600A490 };
+static TexturePtr D_80C1E970[] = {
+ object_dt_Tex_007350, object_dt_Tex_009590, object_dt_Tex_009F90, object_dt_Tex_00A790, object_dt_Tex_00AB90,
+};
+static TexturePtr D_80C1E984[] = {
+ object_dt_Tex_007750,
+ object_dt_Tex_00A390,
+ object_dt_Tex_00A490,
+};
void EnEndingHero_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero* this = THIS;
@@ -99,7 +96,7 @@ void EnEndingHero_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80C1E984[index]));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- 0, 0, &this->actor);
+ NULL, NULL, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c
index 8df6a328dd..f3515787c9 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero2/z_en_ending_hero2.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ending_hero2.h"
+#include "objects/object_bai/object_bai.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero2*)thisx)
@@ -30,17 +31,15 @@ const ActorInit En_Ending_Hero2_InitVars = {
(ActorFunc)EnEndingHero2_Draw,
};
-extern FlexSkeletonHeader D_06007908;
-extern AnimationHeader D_060011C0;
-
void EnEndingHero2_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero2* this = THIS;
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007908, &D_060011C0, this->jointTable, this->morphTable, 20);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bai_Skel_007908, &object_bai_Anim_0011C0, this->jointTable,
+ this->morphTable, 20);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C232E8(this);
}
@@ -71,5 +70,5 @@ void EnEndingHero2_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- 0, 0, &this->actor);
+ NULL, NULL, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c
index b89196d58d..91c44e7415 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero3/z_en_ending_hero3.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ending_hero3.h"
+#include "objects/object_toryo/object_toryo.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero3*)thisx)
@@ -30,17 +31,15 @@ const ActorInit En_Ending_Hero3_InitVars = {
(ActorFunc)EnEndingHero3_Draw,
};
-extern FlexSkeletonHeader D_06007150;
-extern AnimationHeader D_06000E50;
-
void EnEndingHero3_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero3* this = THIS;
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_toryo_Skel_007150, &object_toryo_Anim_000E50,
+ this->jointTable, this->morphTable, 17);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C23518(this);
}
@@ -71,5 +70,5 @@ void EnEndingHero3_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- 0, 0, &this->actor);
+ NULL, NULL, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c
index 5f2ad62224..1e54ee8b92 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero4/z_en_ending_hero4.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ending_hero4.h"
+#include "objects/object_sdn/object_sdn.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero4*)thisx)
@@ -30,17 +31,15 @@ const ActorInit En_Ending_Hero4_InitVars = {
(ActorFunc)EnEndingHero4_Draw,
};
-extern FlexSkeletonHeader D_0600D640;
-extern AnimationHeader D_06002A84;
-
void EnEndingHero4_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero4* this = THIS;
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D640, &D_06002A84, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gSoldierSkeleton, &gSoldierCheerWithSpear, this->jointTable,
+ this->morphTable, 17);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C23748(this);
}
@@ -71,5 +70,5 @@ void EnEndingHero4_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- 0, 0, &this->actor);
+ NULL, NULL, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c
index 3a8f317f55..23ac531f3f 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero5/z_en_ending_hero5.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ending_hero5.h"
+#include "objects/object_daiku/object_daiku.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero5*)thisx)
@@ -30,23 +31,15 @@ const ActorInit En_Ending_Hero5_InitVars = {
(ActorFunc)EnEndingHero5_Draw,
};
-extern FlexSkeletonHeader D_0600A850;
-extern AnimationHeader D_06002FA0;
-
-extern Gfx D_060070C0[];
-extern Gfx D_06006FB0[];
-extern Gfx D_06006E80[];
-extern Gfx D_06006D70[];
-extern Gfx D_0600A390[];
-
void EnEndingHero5_Init(Actor* thisx, GlobalContext* globalCtx) {
EnEndingHero5* this = THIS;
- this->actor.colChkInfo.mass = 0xFF;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A850, &D_06002FA0, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0,
+ this->jointTable, this->morphTable, 17);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
this->unk25C = this->actor.params;
func_80C23980(this);
@@ -72,9 +65,10 @@ void EnEndingHero5_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 50.0f, 0x1D);
}
-Gfx* D_80C23BF0[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70, D_0600A390 };
+Gfx* D_80C23BF0[] = { object_daiku_DL_0070C0, object_daiku_DL_006FB0, object_daiku_DL_006E80, object_daiku_DL_006D70,
+ object_daiku_DL_00A390 };
-void func_80C23A30(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnEndingHero5_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnEndingHero5* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -112,7 +106,7 @@ void EnEndingHero5_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- NULL, func_80C23A30, &this->actor);
+ NULL, EnEndingHero5_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c
index 7af0874336..82df507c2a 100644
--- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c
+++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c
@@ -5,8 +5,13 @@
*/
#include "z_en_ending_hero6.h"
+#include "objects/object_dt/object_dt.h"
+#include "objects/object_daiku/object_daiku.h"
+#include "objects/object_bai/object_bai.h"
+#include "objects/object_toryo/object_toryo.h"
+#include "objects/object_sdn/object_sdn.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnEndingHero6*)thisx)
@@ -19,36 +24,6 @@ void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex);
void EnEndingHero6_SetupIdle(EnEndingHero6* this);
void EnEndingHero6_Idle(EnEndingHero6* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_0600B0CC; // object_dt
-extern FlexSkeletonHeader D_06007908; // object_bai
-extern FlexSkeletonHeader D_06007150; // object_toryo
-extern FlexSkeletonHeader D_0600D640; // object_sdn
-extern FlexSkeletonHeader D_0600A850; // object_daiku
-
-extern AnimationHeader D_06000BE0; // object_dt
-extern AnimationHeader D_060011C0; // object_bai
-extern AnimationHeader D_06000E50; // object_toryo
-extern AnimationHeader D_06002A84; // object_sdn
-extern AnimationHeader D_06002FA0; // object_daiku
-
-// object_daiku
-extern Gfx D_060070C0[];
-extern Gfx D_06006FB0[];
-extern Gfx D_06006E80[];
-extern Gfx D_06006D70[];
-extern Gfx D_0600A390_dl[];
-
-// object_dt
-extern TexturePtr D_06007350;
-extern TexturePtr D_06009590;
-extern TexturePtr D_06009F90;
-extern TexturePtr D_0600A790;
-extern TexturePtr D_0600AB90;
-
-extern TexturePtr D_06007750;
-extern TexturePtr D_0600A390_tex;
-extern TexturePtr D_0600A490;
-
const ActorInit En_Ending_Hero6_InitVars = {
ACTOR_EN_ENDING_HERO6,
ACTORCAT_NPC,
@@ -61,11 +36,17 @@ const ActorInit En_Ending_Hero6_InitVars = {
(ActorFunc)EnEndingHero6_Draw,
};
-static FlexSkeletonHeader* sSkeletons[] = { &D_0600B0CC, &D_06007908, &D_06007150, &D_0600D640, &D_0600A850,
- &D_0600A850, &D_0600A850, &D_0600A850, &D_0600A850 };
+static FlexSkeletonHeader* sSkeletons[] = {
+ &object_dt_Skel_00B0CC, &object_bai_Skel_007908, &object_toryo_Skel_007150,
+ &gSoldierSkeleton, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
+ &object_daiku_Skel_00A850, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
+};
-static AnimationHeader* sAnimations[] = { &D_06000BE0, &D_060011C0, &D_06000E50, &D_06002A84, &D_06002FA0,
- &D_06002FA0, &D_06002FA0, &D_06002FA0, &D_06002FA0 };
+static AnimationHeader* sAnimations[] = {
+ &object_dt_Anim_000BE0, &object_bai_Anim_0011C0, &object_toryo_Anim_000E50,
+ &gSoldierCheerWithSpear, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
+ &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
+};
static s32 sLimbCounts[] = { 15, 20, 17, 17, 17, 17, 17, 17, 17 };
@@ -124,7 +105,8 @@ void EnEndingHero6_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnEndingHero6_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
- static Gfx* D_80C2426C[] = { D_060070C0, D_06006FB0, D_06006E80, D_06006D70, D_0600A390_dl };
+ static Gfx* D_80C2426C[] = { object_daiku_DL_0070C0, object_daiku_DL_006FB0, object_daiku_DL_006E80,
+ object_daiku_DL_006D70, object_daiku_DL_00A390 };
EnEndingHero6* this = THIS;
s32 index;
@@ -139,8 +121,9 @@ void EnEndingHero6_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
}
void EnEndingHero6_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr D_80C24280[] = { &D_06007350, &D_06009590, &D_06009F90, &D_0600A790, &D_0600AB90 };
- static TexturePtr D_80C24294[] = { &D_06007750, &D_0600A390_tex, &D_0600A490 };
+ static TexturePtr D_80C24280[] = { object_dt_Tex_007350, object_dt_Tex_009590, object_dt_Tex_009F90,
+ object_dt_Tex_00A790, object_dt_Tex_00AB90 };
+ static TexturePtr D_80C24294[] = { object_dt_Tex_007750, object_dt_Tex_00A390, object_dt_Tex_00A490 };
s32 pad;
EnEndingHero6* this = THIS;
s32 index = 0;
diff --git a/src/overlays/actors/ovl_En_Estone/z_en_estone.c b/src/overlays/actors/ovl_En_Estone/z_en_estone.c
index 7cc45bb5af..b1ac6673aa 100644
--- a/src/overlays/actors/ovl_En_Estone/z_en_estone.c
+++ b/src/overlays/actors/ovl_En_Estone/z_en_estone.c
@@ -6,7 +6,7 @@
#include "z_en_estone.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnEstone*)thisx)
diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c
index 0474bc1323..8c7f291ce5 100644
--- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c
+++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c
@@ -4,14 +4,15 @@
* Description: The moon and related effects, along with the Moon's Tear that falls from its eye.
*
* This actor handles mutliple types of moon as well as a variety of effects. Specifically, it handles:
- * - A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes
- * - A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon's interior.
- * - An enlarged high-detail moon, used for when the moon is crashing.
- * - A low-detail moon, used everywhere else. Its object file is named "Lodmoon".
- * - The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail.
- * - The ball of fire that surrounds the moon when it is crashing.
- * - The debris that rises from the ground as the moon is crashing.
- * - The ring of fire that expands outward when the moon is almost done crashing.
+ * - Moon: A high-detail moon, used in Termina Field, the Clock Tower, and a few cutscenes.
+ * - StoppedClosedMouthMoon: A high-detail moon, used in the Clock Tower after the Giants stop the moon from crashing.
+ * - StoppedOpenMouthMoon: A high-detail open-mouthed moon, used in the cutscene prior to warping to the moon.
+ * - CrashingMoon: An enlarged high-detail moon, used for when the moon is crashing.
+ * - LodMoon: A low-detail moon, used everywhere else.
+ * - MoonsTear: The Moon's Tear that can be seen falling from the telescope, along with its associated fire trail.
+ * - Fireball: The ball of fire that surrounds the moon when it is crashing.
+ * - RisingDebris: The debris that rises from the ground as the moon is crashing.
+ * - FireRing: The ring of fire that expands outward when the moon is almost done crashing.
*/
#include "z_en_fall.h"
@@ -20,10 +21,13 @@
#include "objects/object_lodmoon/object_lodmoon.h"
#include "objects/object_moonston/object_moonston.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnFall*)thisx)
+#define FLAG_FIRE_BALL_INTENSIFIES (1 << 0)
+#define FLAG_FIRE_RING_APPEARS (1 << 1)
+
void EnFall_Init(Actor* thisx, GlobalContext* globalCtx);
void EnFall_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnFall_Update(Actor* thisx, GlobalContext* globalCtx);
@@ -35,20 +39,20 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx);
void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx);
void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx);
-void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx);
+void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx);
void EnFall_RisingDebris_Update(Actor* thisx, GlobalContext* globalCtx);
void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx);
void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnFall_LodMoon_DrawWithoutLerp(Actor* thisx, GlobalContext* globalCtx);
void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx);
-void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx);
+void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx);
typedef struct {
- u8 dListIndex;
+ u8 modelIndex;
Vec3f pos;
Vec3f velocity;
Vec3s rot;
@@ -87,14 +91,17 @@ void EnFall_Moon_AdjustScaleAndPosition(EnFall* this, GlobalContext* globalCtx)
Actor_SetScale(&this->actor, this->scale * 1.2f);
this->actor.world.pos.y = this->actor.home.pos.y;
break;
+
case 1:
Actor_SetScale(&this->actor, this->scale * 2.4f);
this->actor.world.pos.y = this->actor.home.pos.y;
break;
+
case 2:
Actor_SetScale(&this->actor, this->scale * 3.6f);
this->actor.world.pos.y = this->actor.home.pos.y;
break;
+
case 3:
Actor_SetScale(&this->actor, this->scale * 3.6f);
if (EN_FALL_TYPE(&this->actor) == EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER) {
@@ -112,7 +119,7 @@ void EnFall_RisingDebris_ResetParticles(EnFall* this) {
s32 i;
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
- debrisParticles[i].dListIndex = 3;
+ debrisParticles[i].modelIndex = 3;
}
this->activeDebrisParticleCount = 0;
}
@@ -130,15 +137,19 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) {
case 1:
this->scale = 0.08f;
break;
+
case 2:
this->scale = 0.04f;
break;
+
case 3:
this->scale = 0.02f;
break;
+
case 4:
this->scale = 0.01f;
break;
+
default:
this->scale = 0.16f;
break;
@@ -150,12 +161,15 @@ void EnFall_Init(Actor* thisx, GlobalContext* globalCtx) {
case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER:
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_LODMOON);
break;
+
case EN_FALL_TYPE_MOONS_TEAR:
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MOONSTON);
break;
+
case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH:
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL2);
break;
+
default:
objectIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_FALL);
break;
@@ -199,36 +213,41 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale);
break;
+
case EN_FALL_TYPE_STOPPED_MOON_CLOSED_MOUTH:
this->actor.draw = EnFall_Moon_Draw;
this->actionFunc = EnFall_StoppedClosedMouthMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale * 3.0f);
- if (!(gSaveContext.weekEventReg[0x19] & 2)) {
+ if (!(gSaveContext.weekEventReg[25] & 2)) {
Actor_MarkForDeath(&this->actor);
}
break;
+
case EN_FALL_TYPE_CLOCK_TOWER_MOON:
this->actionFunc = EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale * 3.0f);
this->actor.draw = EnFall_Moon_Draw;
- if (gSaveContext.weekEventReg[0x19] & 2) {
+ if (gSaveContext.weekEventReg[25] & 2) {
Actor_MarkForDeath(&this->actor);
}
break;
+
case EN_FALL_TYPE_CRASHING_MOON:
this->actor.draw = EnFall_Moon_Draw;
Actor_SetScale(&this->actor, this->scale * 5.3999996f);
this->actionFunc = EnFall_CrashingMoon_PerformCutsceneActions;
break;
+
case EN_FALL_TYPE_CRASH_FIRE_BALL:
- this->actor.update = EnFall_FireBall_Update;
- this->actor.draw = EnFall_FireBall_Draw;
+ this->actor.update = EnFall_Fireball_Update;
+ this->actor.draw = EnFall_Fireball_Draw;
this->scale = 1.0f;
this->actor.shape.rot.z = 0;
- this->fireBallIntensity = 0.0f;
- this->fireBallAlpha = 100;
+ this->fireballIntensity = 0.0f;
+ this->fireballAlpha = 100;
this->actor.shape.rot.x = this->actor.shape.rot.z;
break;
+
case EN_FALL_TYPE_CRASH_RISING_DEBRIS:
this->actor.update = EnFall_RisingDebris_Update;
this->actor.draw = EnFall_RisingDebris_Draw;
@@ -237,12 +256,14 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 1.0f);
this->actor.shape.rot.x = 0;
break;
+
case EN_FALL_TYPE_LODMOON_NO_LERP:
this->actor.draw = EnFall_LodMoon_DrawWithoutLerp;
this->dayStartTime = CLOCK_TIME(6, 0);
this->currentDay = CURRENT_DAY;
EnFall_Moon_AdjustScaleAndPosition(this, globalCtx);
break;
+
case EN_FALL_TYPE_LODMOON:
case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER:
this->actor.draw = EnFall_LodMoon_DrawWithLerp;
@@ -250,6 +271,7 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
this->currentDay = CURRENT_DAY;
EnFall_Moon_AdjustScaleAndPosition(this, globalCtx);
break;
+
case EN_FALL_TYPE_MOONS_TEAR:
this->actor.update = EnFall_Update;
this->actor.draw = NULL;
@@ -264,17 +286,21 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
}
break;
+
case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH:
this->actor.draw = NULL;
this->actionFunc = EnFall_StoppedOpenMouthMoon_PerformCutsceneActions;
Actor_SetScale(&this->actor, this->scale * 3.0f);
break;
+
case EN_FALL_TYPE_CRASH_FIRE_RING:
this->actor.update = EnFall_FireRing_Update;
this->actor.draw = EnFall_FireRing_Draw;
Actor_SetScale(&this->actor, 0.2f);
break;
+
default:
+ // used for EN_FALL_TYPE_TERMINA_FIELD_MOON and anything else that isn't in the enum
this->actor.draw = EnFall_Moon_Draw;
this->dayStartTime = CLOCK_TIME(6, 0);
this->currentDay = CURRENT_DAY;
@@ -287,17 +313,19 @@ void EnFall_Setup(EnFall* this, GlobalContext* globalCtx) {
void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globalCtx) {
static s32 sGiantsCutsceneState = 0;
- if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 1 && globalCtx->csCtx.unk_12 == 0) {
+ if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 1 &&
+ globalCtx->csCtx.currentCsIndex == 0) {
switch (sGiantsCutsceneState) {
case 0:
if (globalCtx->csCtx.state != 0) {
sGiantsCutsceneState += 2;
}
break;
+
case 2:
if (CHECK_QUEST_ITEM(QUEST_REMAINS_ODOWLA) && CHECK_QUEST_ITEM(QUEST_REMAINS_GOHT) &&
CHECK_QUEST_ITEM(QUEST_REMAINS_GYORG) && CHECK_QUEST_ITEM(QUEST_REMAINS_TWINMOLD)) {
- if (gSaveContext.weekEventReg[0x5D] & 4) {
+ if (gSaveContext.weekEventReg[93] & 4) {
if (ActorCutscene_GetCanPlayNext(0xC)) {
ActorCutscene_Start(0xC, &this->actor);
sGiantsCutsceneState++;
@@ -306,7 +334,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
}
} else if (ActorCutscene_GetCanPlayNext(0xB)) {
ActorCutscene_Start(0xB, &this->actor);
- gSaveContext.weekEventReg[0x5D] |= 4;
+ gSaveContext.weekEventReg[93] |= 4;
sGiantsCutsceneState++;
} else {
ActorCutscene_SetIntentToPlay(0xB);
@@ -320,6 +348,7 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
sGiantsCutsceneState = 9;
}
break;
+
case 9:
globalCtx->csCtx.frames--;
break;
@@ -329,14 +358,15 @@ void EnFall_CrashingMoon_HandleGiantsCutscene(EnFall* this, GlobalContext* globa
void EnFall_CrashingMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx) {
EnFall_CrashingMoon_HandleGiantsCutscene(this, globalCtx);
- if (func_800EE29C(globalCtx, 0x85)) {
- if (func_800EE29C(globalCtx, 0x85) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0 == 1) {
+ if (Cutscene_CheckActorAction(globalCtx, 0x85)) {
+ if (Cutscene_CheckActorAction(globalCtx, 133) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action == 1) {
this->actor.draw = NULL;
} else {
this->actor.draw = EnFall_Moon_Draw;
- if (func_800EE29C(globalCtx, 0x85) &&
- globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0 == 2) {
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x85));
+ if (Cutscene_CheckActorAction(globalCtx, 133) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action == 2) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 133));
}
}
} else {
@@ -345,17 +375,18 @@ void EnFall_CrashingMoon_PerformCutsceneActions(EnFall* this, GlobalContext* glo
}
void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x85)) {
- switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 133)) {
+ switch (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action) {
case 3:
if (this->eyeGlowIntensity == 0.0f) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_EYE_FLASH);
}
- this->eyeGlowIntensity += 0.033333335f;
+ this->eyeGlowIntensity += 1 / 30.0f;
if (this->eyeGlowIntensity > 1.0f) {
this->eyeGlowIntensity = 1.0f;
}
break;
+
case 4:
this->actor.draw = EnFall_OpenMouthMoon_Draw;
break;
@@ -364,11 +395,12 @@ void EnFall_StoppedOpenMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCont
}
void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x85)) {
- switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 133)) {
+ switch (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action) {
case 2:
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x85));
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 133));
break;
+
case 4:
this->actor.draw = NULL;
break;
@@ -376,15 +408,17 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
}
if (globalCtx->sceneNum == SCENE_OKUJOU && gSaveContext.sceneSetupIndex == 2) {
- switch (globalCtx->csCtx.unk_12) {
+ switch (globalCtx->csCtx.currentCsIndex) {
case 0:
switch (globalCtx->csCtx.frames) {
case 1060:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1);
break;
+
case 1089:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY);
break;
+
case 1303:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON);
break;
@@ -393,14 +427,17 @@ void EnFall_StoppedClosedMouthMoon_PerformCutsceneActions(EnFall* this, GlobalCo
func_800B9010(&this->actor, NA_SE_EV_FALL_POWER - SFX_FLAG);
}
break;
+
case 1:
switch (globalCtx->csCtx.frames) {
case 561:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MOON_SCREAM1);
break;
+
case 590:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_MOON_CRY);
break;
+
case 737:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SLIP_MOON);
break;
@@ -420,22 +457,21 @@ void EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions(EnFall* this, Glo
}
/**
- * This is rarely used in the final game. One example of where it *is* used
- * is when the moon is crashing; there is a second, smaller moon hidden within
- * the larger moon that uses this action function.
+ * Used by the Moon in Termina Field, as well as all LodMoons.
*/
void EnFall_Moon_PerformDefaultActions(EnFall* this, GlobalContext* globalCtx) {
u16 currentDay;
- if (func_800EE29C(globalCtx, 0x85)) {
- if (func_800EE29C(globalCtx, 0x85) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0 == 1) {
+ if (Cutscene_CheckActorAction(globalCtx, 133)) {
+ if (Cutscene_CheckActorAction(globalCtx, 133) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action == 1) {
this->actor.draw = NULL;
} else {
Actor_SetScale(&this->actor, this->scale * 3.6f);
this->actor.draw = EnFall_Moon_Draw;
- if (func_800EE29C(globalCtx, 0x85) &&
- globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x85)]->unk0 == 2) {
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x85));
+ if (Cutscene_CheckActorAction(globalCtx, 133) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 133)]->action == 2) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 133));
}
}
} else {
@@ -467,13 +503,14 @@ void EnFall_MoonsTear_Initialize(EnFall* this) {
this->actor.shape.rot.y = this->actor.world.rot.y;
}
-void EnFall_DoNothing(EnFall* this, GlobalContext* globalCtx) {
+void EnFall_MoonsTear_DoNothing(EnFall* this, GlobalContext* globalCtx) {
}
void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) {
s32 pad;
- if (func_800EE29C(globalCtx, 0x205) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x205)]->unk0 == 2 &&
+ if (Cutscene_CheckActorAction(globalCtx, 517) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 517)]->action == 2 &&
this->actor.draw == NULL) {
EnFall_MoonsTear_Initialize(this);
}
@@ -481,14 +518,14 @@ void EnFall_MoonsTear_Fall(EnFall* this, GlobalContext* globalCtx) {
if (this->actor.draw != NULL) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &this->actor.home.pos, this->actor.speedXZ) <= 0.0f) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_BOUND_1);
- gSaveContext.weekEventReg[0x4A] |= 0x80;
- gSaveContext.weekEventReg[0x4A] |= 0x20;
+ gSaveContext.weekEventReg[74] |= 0x80;
+ gSaveContext.weekEventReg[74] |= 0x20;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_TEST, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, -2);
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_EXPLOSION);
this->actor.draw = NULL;
- this->actionFunc = EnFall_DoNothing;
+ this->actionFunc = EnFall_MoonsTear_DoNothing;
} else {
func_800B9010(&this->actor, NA_SE_EV_MOONSTONE_FALL - SFX_FLAG);
}
@@ -504,7 +541,7 @@ void EnFall_Update(Actor* thisx, GlobalContext* globalCtx) {
* Updates the alpha for every vertex in the fire ball so that some parts of
* the sphere are more transparent or opaque than others.
*/
-void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) {
+void EnFall_Fireball_SetPerVertexAlpha(f32 fireballAlpha) {
static u8 sAlphaTableIndex[] = {
4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 0, 1, 1, 1, 4, 0, 4, 0, 1, 1, 1, 3, 0, 3, 0, 1, 1, 1, 4, 4, 1,
1, 0, 4, 4, 0, 1, 1, 1, 1, 1, 1, 3, 3, 0, 0, 3, 3, 0, 0, 1, 1, 1, 1, 1, 4, 0, 4, 4, 0, 4, 4, 1, 1, 1, 1,
@@ -516,66 +553,71 @@ void EnFall_FireBall_SetPerVertexAlpha(f32 fireBallAlpha) {
s32 pad;
u8 perVertexAlphaTable[5];
- Vtx* vertices = Lib_SegmentedToVirtual(&object_fall_Vtx_0004C0);
+ Vtx* vertices = Lib_SegmentedToVirtual(gMoonFireballVtx);
s32 i;
- if (fireBallAlpha > 1.0f) {
- fireBallAlpha = 1.0f;
+ if (fireballAlpha > 1.0f) {
+ fireballAlpha = 1.0f;
}
perVertexAlphaTable[0] = 0;
- perVertexAlphaTable[1] = (s8)(255.0f * fireBallAlpha);
- perVertexAlphaTable[2] = (s8)(155.0f * fireBallAlpha);
- perVertexAlphaTable[3] = (s8)(104.0f * fireBallAlpha);
- perVertexAlphaTable[4] = (s8)(54.0f * fireBallAlpha);
+ perVertexAlphaTable[1] = (s8)(255.0f * fireballAlpha);
+ perVertexAlphaTable[2] = (s8)(155.0f * fireballAlpha);
+ perVertexAlphaTable[3] = (s8)(104.0f * fireballAlpha);
+ perVertexAlphaTable[4] = (s8)(54.0f * fireballAlpha);
for (i = 0; i < ARRAY_COUNT(sAlphaTableIndex); i++, vertices++) {
vertices->v.cn[3] = perVertexAlphaTable[sAlphaTableIndex[i]];
}
}
-void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
+void EnFall_Fireball_Update(Actor* thisx, GlobalContext* globalCtx) {
EnFall* this = THIS;
- if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 2) {
+ if (globalCtx->sceneNum == SCENE_00KEIKOKU && gSaveContext.sceneSetupIndex == 0 &&
+ globalCtx->csCtx.currentCsIndex == 2) {
globalCtx->skyboxCtx.rotY -= 0.05f;
}
- if (func_800EE29C(globalCtx, 0x1C2)) {
- this->actor.draw = EnFall_FireBall_Draw;
- if (this->flags & EN_FALL_FLAG_FIRE_BALL_INTENSIFIES) {
- this->fireBallIntensity += 0.01f;
- if (this->fireBallIntensity > 1.0f) {
- this->fireBallIntensity = 1.0f;
+ if (Cutscene_CheckActorAction(globalCtx, 450)) {
+ this->actor.draw = EnFall_Fireball_Draw;
+ if (this->flags & FLAG_FIRE_BALL_INTENSIFIES) {
+ this->fireballIntensity += 0.01f;
+ if (this->fireballIntensity > 1.0f) {
+ this->fireballIntensity = 1.0f;
}
}
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x1C2));
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 450));
- switch (globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0) {
+ switch (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 450)]->action) {
default:
this->actor.draw = NULL;
- this->fireBallAlpha = 0;
+ this->fireballAlpha = 0;
break;
+
case 2:
- if (this->fireBallAlpha < 100) {
- this->fireBallAlpha += 4;
+ if (this->fireballAlpha < 100) {
+ this->fireballAlpha += 4;
}
- if (this->fireBallAlpha > 100) {
- this->fireBallAlpha = 100;
+ if (this->fireballAlpha > 100) {
+ this->fireballAlpha = 100;
}
- EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f);
+ EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f);
break;
+
case 3:
- if (this->fireBallAlpha > 0) {
- this->fireBallAlpha -= 2;
+ if (this->fireballAlpha > 0) {
+ this->fireballAlpha -= 2;
}
- if (this->fireBallAlpha < 0) {
- this->fireBallAlpha = 0;
+ if (this->fireballAlpha < 0) {
+ this->fireballAlpha = 0;
}
- EnFall_FireBall_SetPerVertexAlpha(this->fireBallAlpha * 0.01f);
+ EnFall_Fireball_SetPerVertexAlpha(this->fireballAlpha * 0.01f);
break;
+
case 4:
- this->flags |= EN_FALL_FLAG_FIRE_BALL_INTENSIFIES;
+ this->flags |= FLAG_FIRE_BALL_INTENSIFIES;
break;
+
case 5:
break;
}
@@ -583,7 +625,7 @@ void EnFall_FireBall_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actor.draw = NULL;
}
- if (func_800EE29C(globalCtx, 0x1C2) && this->fireBallAlpha > 0) {
+ if (Cutscene_CheckActorAction(globalCtx, 0x1C2) && this->fireballAlpha > 0) {
func_8019F128(NA_SE_EV_MOON_FALL_LAST - SFX_FLAG);
}
Actor_SetScale(&this->actor, this->scale * 1.74f);
@@ -593,7 +635,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) {
s32 i;
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
- if (debrisParticles[i].dListIndex < 3) {
+ if (debrisParticles[i].modelIndex < 3) {
debrisParticles[i].pos.x += debrisParticles[i].velocity.x;
debrisParticles[i].pos.y += debrisParticles[i].velocity.y;
debrisParticles[i].pos.z += debrisParticles[i].velocity.z;
@@ -601,7 +643,7 @@ void EnFall_RisingDebris_UpdateParticles(EnFall* this) {
debrisParticles[i].rot.y += 0xC8;
debrisParticles[i].rot.z += 0x12C;
if ((this->actor.world.pos.y + 3000.0f) < debrisParticles[i].pos.y) {
- debrisParticles[i].dListIndex = 3;
+ debrisParticles[i].modelIndex = 3;
this->activeDebrisParticleCount--;
}
}
@@ -614,8 +656,8 @@ s32 EnFall_RisingDebris_InitializeParticles(EnFall* this) {
f32 scale;
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
- if (debrisParticles[i].dListIndex >= 3) {
- debrisParticles[i].dListIndex = (s32)Rand_ZeroFloat(3.0f);
+ if (debrisParticles[i].modelIndex >= 3) {
+ debrisParticles[i].modelIndex = (s32)Rand_ZeroFloat(3.0f);
debrisParticles[i].pos.x = this->actor.world.pos.x;
debrisParticles[i].pos.y = this->actor.world.pos.y;
debrisParticles[i].pos.z = this->actor.world.pos.z;
@@ -640,9 +682,9 @@ s32 EnFall_RisingDebris_InitializeParticles(EnFall* this) {
void EnFall_RisingDebris_Update(Actor* thisx, GlobalContext* globalCtx) {
EnFall* this = THIS;
- if (func_800EE29C(globalCtx, 0x1C3)) {
- if (func_800EE29C(globalCtx, 0x1C3) &&
- globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C3)]->unk0 == 2) {
+ if (Cutscene_CheckActorAction(globalCtx, 451)) {
+ if (Cutscene_CheckActorAction(globalCtx, 451) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 451)]->action == 2) {
EnFall_RisingDebris_UpdateParticles(this);
EnFall_RisingDebris_InitializeParticles(this);
} else if (this->activeDebrisParticleCount != 0) {
@@ -657,14 +699,15 @@ void EnFall_RisingDebris_Update(Actor* thisx, GlobalContext* globalCtx) {
void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) {
EnFall* this = THIS;
- if (func_800EE29C(globalCtx, 0x1C2) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1C2)]->unk0 == 5) {
- if (!(this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS)) {
+ if (Cutscene_CheckActorAction(globalCtx, 450) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 450)]->action == 5) {
+ if (!(this->flags & FLAG_FIRE_RING_APPEARS)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_DM_RING_EXPLOSION);
}
- this->flags |= EN_FALL_FLAG_FIRE_RING_APPEARS;
+ this->flags |= FLAG_FIRE_RING_APPEARS;
}
- if (this->flags & EN_FALL_FLAG_FIRE_RING_APPEARS) {
- this->fireRingAlpha += 0.033333335f;
+ if (this->flags & FLAG_FIRE_RING_APPEARS) {
+ this->fireRingAlpha += 1 / 30.0f;
if (this->fireRingAlpha > 1.0f) {
this->fireRingAlpha = 1.0f;
}
@@ -679,6 +722,10 @@ void EnFall_FireRing_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
+/**
+ * Used for all closed-mouth high-detail moons, including
+ * StoppedClosedMouthMoon and CrashingMoon.
+ */
void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) {
// This offsets the moon's focus so that the Moon's Tear actually falls
// out of its eye when looking at it through the telescope.
@@ -691,9 +738,11 @@ void EnFall_Moon_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_MultiplyVector3fByState(sFocusOffset, &this->actor.focus.pos);
+
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
- gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_0077F0);
+
+ gSPDisplayList(POLY_OPA_DISP++, gMoonDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -706,9 +755,11 @@ void EnFall_OpenMouthMoon_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
- gSPDisplayList(POLY_OPA_DISP++, object_fall2_DL_002970);
+
+ gSPDisplayList(POLY_OPA_DISP++, gOpenMouthMoonDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -722,14 +773,17 @@ void EnFall_LodMoon_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 20, 25, 30, 0, 0x3E7, 0x3200);
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_PASS, G_RM_AA_ZB_OPA_SURF2);
gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH);
+
primColor = (this->eyeGlowIntensity * 200.0f) + 40.0f;
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, primColor, primColor, primColor, 255);
- gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_0010E0);
+
+ gSPDisplayList(POLY_OPA_DISP++, gLodmoonEyesDL);
gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH);
- gSPDisplayList(POLY_OPA_DISP++, object_lodmoon_DL_001158);
+ gSPDisplayList(POLY_OPA_DISP++, gLodmoonMoonDL);
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -759,57 +813,63 @@ void EnFall_LodMoon_DrawWithLerp(Actor* thisx, GlobalContext* globalCtx) {
Matrix_InsertXRotation_s(thisx->shape.rot.x, MTXMODE_APPLY);
Matrix_InsertZRotation_s(thisx->shape.rot.z, MTXMODE_APPLY);
}
+
EnFall_LodMoon_Draw(thisx, globalCtx);
}
-void EnFall_FireBall_Draw(Actor* thisx, GlobalContext* globalCtx) {
+void EnFall_Fireball_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnFall* this = THIS;
u32 gameplayFrames = globalCtx->gameplayFrames;
OPEN_DISPS(globalCtx->state.gfxCtx);
+
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(globalCtx->state.gfxCtx);
- this->fireBallYTexScroll1 += (s32)(4.0f + (this->fireBallIntensity * 12.0f));
- this->fireBallYTexScroll2 += (s32)(2.0f + (this->fireBallIntensity * 6.0f));
+
+ this->fireballYTexScroll1 += (s32)(4.0f + (this->fireballIntensity * 12.0f));
+ this->fireballYTexScroll2 += (s32)(2.0f + (this->fireballIntensity * 6.0f));
+
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80,
- (s32)(((1.0f - this->fireBallIntensity) * 160.0f) + (255.0f * this->fireBallIntensity)),
- (s32)((70.0f * (1.0f - this->fireBallIntensity)) + (255.0f * this->fireBallIntensity)),
- (s32)(70.0f * (1.0f - this->fireBallIntensity)), 255);
+ (s32)(((1.0f - this->fireballIntensity) * 160.0f) + (255.0f * this->fireballIntensity)),
+ (s32)((70.0f * (1.0f - this->fireballIntensity)) + (255.0f * this->fireballIntensity)),
+ (s32)(70.0f * (1.0f - this->fireballIntensity)), 255);
gDPSetEnvColor(
- POLY_XLU_DISP++, (s32)(((1.0f - this->fireBallIntensity) * 50.0f) + (200.0f * this->fireBallIntensity)),
- (s32)(20.0f * (1.0f - this->fireBallIntensity)), (s32)(20.0f * (1.0f - this->fireBallIntensity)), 255);
+ POLY_XLU_DISP++, (s32)(((1.0f - this->fireballIntensity) * 50.0f) + (200.0f * this->fireballIntensity)),
+ (s32)(20.0f * (1.0f - this->fireballIntensity)), (s32)(20.0f * (1.0f - this->fireballIntensity)), 255);
- // Glowing sphere of fire
+ // For the glowing sphere of fire
gSPSegment(POLY_XLU_DISP++, 0x09,
- Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireBallYTexScroll2, 64, 64, 1,
- -gameplayFrames, -this->fireBallYTexScroll1, 64, 64));
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames, -this->fireballYTexScroll2, 64, 64, 1,
+ -gameplayFrames, -this->fireballYTexScroll1, 64, 64));
- // "Flecks" of fire
+ // For the "flecks" of fire around the fireball
gSPSegment(POLY_XLU_DISP++, 0x0A,
- Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64, 1,
- -gameplayFrames * 2, -this->fireBallYTexScroll1, 64, 64));
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64, 1,
+ -gameplayFrames * 2, -this->fireballYTexScroll1, 64, 64));
gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
- gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_0011D0);
+ gSPDisplayList(POLY_XLU_DISP++, gMoonFireballDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static Gfx* sDebrisDLists[] = { object_fall_DL_000220, object_fall_DL_000428, object_fall_DL_000498 };
+ static Gfx* sDebrisModelDLists[] = { gMoonDebrisModel1DL, gMoonDebrisModel2DL, gMoonDebrisModel3DL };
EnFall* this = THIS;
f32 scale = this->scale * 0.06f;
s32 i;
OPEN_DISPS(globalCtx->state.gfxCtx);
+
func_8012C28C(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, object_fall_DL_000198);
+ gSPDisplayList(POLY_OPA_DISP++, gMoonDebrisMaterialDL);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
+
for (i = 0; i < ARRAY_COUNT(debrisParticles); i++) {
- if (debrisParticles[i].dListIndex < 3) {
+ if (debrisParticles[i].modelIndex < 3) {
Matrix_InsertTranslation(debrisParticles[i].pos.x, debrisParticles[i].pos.y, debrisParticles[i].pos.z,
MTXMODE_NEW);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
@@ -817,9 +877,10 @@ void EnFall_RisingDebris_Draw(Actor* thisx, GlobalContext* globalCtx) {
MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, sDebrisDLists[debrisParticles[i].dListIndex]);
+ gSPDisplayList(POLY_OPA_DISP++, sDebrisModelDLists[debrisParticles[i].modelIndex]);
}
}
+
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -832,13 +893,18 @@ void EnFall_FireRing_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->fireRingAlpha = 1.0f;
}
OPEN_DISPS(globalCtx->state.gfxCtx);
- AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(&object_fall_Matanimheader_004E38));
+
+ AnimatedMat_DrawXlu(globalCtx, Lib_SegmentedToVirtual(gMoonFireRingTexAnim));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(globalCtx->state.gfxCtx);
+
gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE);
gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
+
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, (s32)(this->fireRingAlpha * 255.0f));
- gSPDisplayList(POLY_XLU_DISP++, object_fall_DL_003C30);
+
+ gSPDisplayList(POLY_XLU_DISP++, gMoonFireRingDL);
+
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
@@ -847,13 +913,18 @@ void EnFall_MoonsTear_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
OPEN_DISPS(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_moonston_Matanimheader_001220));
+
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(gFallingMoonsTearTexAnim));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C28C(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, object_moonston_DL_000400);
+
+ gSPDisplayList(POLY_OPA_DISP++, gFallingMoonsTearDL);
+
Matrix_Scale(3.0f, 3.0f, 6.0f, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_XLU_DISP++, object_moonston_DL_0004C8);
+
+ gSPDisplayList(POLY_XLU_DISP++, gFallingMoonsTearFireDL);
+
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.h b/src/overlays/actors/ovl_En_Fall/z_en_fall.h
index 0124087d95..620c0590a0 100644
--- a/src/overlays/actors/ovl_En_Fall/z_en_fall.h
+++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.h
@@ -6,9 +6,6 @@
#define EN_FALL_SCALE(thisx) ((thisx)->params & 0x7F)
#define EN_FALL_TYPE(thisx) (((thisx)->params & 0xF80) >> 7)
-#define EN_FALL_FLAG_FIRE_BALL_INTENSIFIES (1 << 0)
-#define EN_FALL_FLAG_FIRE_RING_APPEARS (1 << 1)
-
typedef enum {
/* 0 */ EN_FALL_TYPE_TERMINA_FIELD_MOON,
/* 1 */ EN_FALL_TYPE_TITLE_SCREEN_MOON,
@@ -37,19 +34,19 @@ typedef struct EnFall {
/* 0x14C */ f32 scale;
/* 0x150 */ union {
f32 eyeGlowIntensity;
- f32 fireBallIntensity;
+ f32 fireballIntensity;
f32 fireRingAlpha;
};
/* 0x154 */ u16 flags;
/* 0x158 */ union {
- s32 fireBallAlpha;
+ s32 fireballAlpha;
s32 activeDebrisParticleCount;
};
/* 0x15C */ union {
- s16 fireBallYTexScroll1;
+ s16 fireballYTexScroll1;
s16 fireWallYScale;
};
- /* 0x15E */ s16 fireBallYTexScroll2;
+ /* 0x15E */ s16 fireballYTexScroll2;
/* 0x160 */ EnFallActionFunc actionFunc;
} EnFall; // size = 0x164
diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c
index a9e27fec74..46c365cd30 100644
--- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c
+++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c
@@ -6,7 +6,7 @@
#include "z_en_fall2.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnFall2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Famos/z_en_famos.c b/src/overlays/actors/ovl_En_Famos/z_en_famos.c
index de24735c72..23da2fb305 100644
--- a/src/overlays/actors/ovl_En_Famos/z_en_famos.c
+++ b/src/overlays/actors/ovl_En_Famos/z_en_famos.c
@@ -6,7 +6,7 @@
#include "z_en_famos.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnFamos*)thisx)
diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c
index 6123310541..060678506d 100644
--- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c
+++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c
@@ -5,8 +5,10 @@
*/
#include "z_en_fg.h"
+#include "objects/object_fr/object_fr.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00004209
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_200 | ACTOR_FLAG_4000)
#define THIS ((EnFg*)thisx)
@@ -22,14 +24,6 @@ void EnFg_AddDust(EnFgEffectDust* dustEffect, Vec3f* worldPos);
void EnFg_UpdateDust(EnFgEffectDust* dustEffect);
void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect);
-extern AnimationHeader D_06001534;
-extern AnimationHeader D_060011C0;
-extern AnimationHeader D_060007BC;
-extern Gfx* D_060059A0[];
-extern Gfx* D_0600B328[];
-extern Gfx* D_0600B338[];
-extern FlexSkeletonHeader D_0600B538;
-
const ActorInit En_Fg_InitVars = {
ACTOR_EN_FG,
ACTORCAT_NPC,
@@ -101,11 +95,11 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06001534, 1.0f, 0, -1, 0, 0 },
- { &D_06001534, 1.0f, 0, -1, 0, -4 },
- { &D_060011C0, 1.0f, 0, -1, 0, -4 },
- { &D_060007BC, 1.0f, 0, -1, 2, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fr_Anim_001534, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_fr_Anim_0011C0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_fr_Anim_0007BC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
};
s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) {
@@ -117,11 +111,11 @@ s32 EnFg_UpdateAnimation(SkelAnime* skelAnime, s16 animIndex) {
ret = true;
frameCount = sAnimations[animIndex].frameCount;
if (frameCount < 0) {
- frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg);
+ frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
}
- Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
- sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode,
- sAnimations[animIndex].transitionRate);
+ Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
+ sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
+ sAnimations[animIndex].morphFrames);
}
return ret;
}
@@ -183,7 +177,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
switch (EnFg_GetDamageEffect(this)) {
case FG_DMGEFFECT_DEKUSTICK:
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_1);
this->skelAnime.playSpeed = 0.0f;
this->actor.shape.shadowDraw = NULL;
@@ -196,7 +190,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
case FG_DMGEFFECT_HOOKSHOT:
break;
case FG_DMGEFFECT_ARROW:
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->skelAnime.playSpeed = 0.0f;
rotY = this->collider.base.ac->world.rot.y;
rotX = this->collider.base.ac->world.rot.x;
@@ -209,7 +203,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) {
this->actionFunc = EnFg_DoNothing;
break;
case FG_DMGEFFECT_EXPLOSION:
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0);
if (1) {}
this->actor.params = FG_BLACK;
@@ -244,7 +238,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) {
switch (EnFg_GetDamageEffect(this)) {
case FG_DMGEFFECT_ARROW:
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->skelAnime.playSpeed = 0.0f;
ac = this->collider.base.ac;
rotY = ac->world.rot.y;
@@ -260,7 +254,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) {
case FG_DMGEFFECT_HOOKSHOT:
break;
case FG_DMGEFFECT_EXPLOSION:
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FROG_CRY_0);
EnFg_UpdateAnimation(&this->skelAnime, 0);
this->actor.params = FG_BLACK;
@@ -321,12 +315,13 @@ void EnFg_Init(Actor* thisx, GlobalContext* globalCtx) {
EnFg* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 10.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, NULL, this->jointTable, this->morphTable, 24);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fr_Skel_00B538, NULL, this->jointTable, this->morphTable,
+ 24);
EnFg_UpdateAnimation(&this->skelAnime, 0);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
- this->actor.flags |= 0x4000;
+ this->actor.flags |= ACTOR_FLAG_4000;
Actor_SetScale(&this->actor, 0.01f);
this->actor.gravity = -1.6f;
this->actionFunc = EnFg_Idle;
@@ -360,8 +355,8 @@ void EnFg_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80A2D348(this, globalCtx);
}
-s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg) {
- EnFg* this = (EnFg*)arg;
+s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnFg* this = THIS;
if ((limbIndex == 7) || (limbIndex == 8)) {
*dList = NULL;
@@ -372,11 +367,11 @@ s32 EnFg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
*dList = NULL;
}
}
- return 0;
+ return false;
}
-void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnFg* this = (EnFg*)arg;
+void EnFg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnFg* this = THIS;
s16 pad;
Vec3f vec1 = { 0.0f, 0.0f, 0.0f };
@@ -412,8 +407,8 @@ void EnFg_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetEnvColor(POLY_OPA_DISP++, envColor[this->actor.params].r, envColor[this->actor.params].g,
envColor[this->actor.params].b, envColor[this->actor.params].a);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_060059A0));
- gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(&D_060059A0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_fr_Tex_0059A0));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(object_fr_Tex_0059A0));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnFg_OverrideLimbDraw, EnFg_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -451,7 +446,7 @@ void EnFg_UpdateDust(EnFgEffectDust* dustEffect) {
}
TexturePtr sDustTex[] = {
- D_0408F7E0, D_0408F3E0, D_0408EFE0, D_0408EBE0, D_0408E7E0, D_0408E3E0, D_0408DFE0, D_0408DBE0,
+ gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
};
void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) {
@@ -467,7 +462,7 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) {
if (dustEffect->type) {
if (!firstDone) {
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0);
- gSPDisplayList(POLY_XLU_DISP++, D_0600B328);
+ gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B328);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 0);
firstDone = true;
}
@@ -483,7 +478,7 @@ void EnFg_DrawDust(GlobalContext* globalCtx, EnFgEffectDust* dustEffect) {
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
index = 0.5f * dustEffect->timer;
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sDustTex[index]));
- gSPDisplayList(POLY_XLU_DISP++, D_0600B338);
+ gSPDisplayList(POLY_XLU_DISP++, object_fr_DL_00B338);
}
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
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 765e694886..77909d2eeb 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
@@ -6,7 +6,7 @@
#include "z_en_fire_rock.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnFireRock*)thisx)
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 5c5952cc6b..664c7ce37e 100644
--- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
+++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c
@@ -6,8 +6,9 @@
#include "z_en_firefly.h"
#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h"
+#include "objects/object_firefly/object_firefly.h"
-#define FLAGS 0x00005005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000)
#define THIS ((EnFirefly*)thisx)
@@ -119,21 +120,18 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 4000, ICHAIN_STOP),
};
-extern AnimationHeader D_0600017C;
-extern SkeletonHeader D_060018B8;
-extern Gfx D_06001678[];
-
void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) {
EnFirefly* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_firefly_Skel_0018B8, &object_firefly_Anim_00017C,
+ this->jointTable, this->morphTable, 28);
Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (this->actor.params & KEESE_INVISIBLE) {
- this->actor.flags |= 0x80;
+ this->actor.flags |= ACTOR_FLAG_80;
this->actor.params = KEESE_GET_MAIN_TYPE(thisx);
this->isInvisible = true;
}
@@ -331,9 +329,9 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) {
this->timer = 40;
this->actor.velocity.y = 0.0f;
- Animation_Change(&this->skelAnime, &D_0600017C, 0.0f, 6.0f, 6.0f, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_firefly_Anim_00017C, 0.0f, 6.0f, 6.0f, 2, 0.0f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FFLY_DEAD);
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
if (this->isInvisible) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0x2000, 40);
@@ -363,7 +361,7 @@ void EnFirefly_SetupFall(EnFirefly* this, GlobalContext* globalCtx) {
this->auraType = KEESE_AURA_NONE;
}
- if (this->actor.flags & 0x8000) {
+ if (this->actor.flags & ACTOR_FLAG_8000) {
this->actor.speedXZ = 0.0f;
}
@@ -375,7 +373,7 @@ void EnFirefly_Fall(EnFirefly* this, GlobalContext* globalCtx) {
this->actor.colorFilterTimer = 40;
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
- if (!(this->actor.flags & 0x8000)) {
+ if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (this->unk_18F != 0xA) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x6800, 0x200);
this->actor.shape.rot.y -= 0x300;
@@ -647,7 +645,7 @@ void EnFirefly_UpdateDamage(EnFirefly* this, GlobalContext* globalCtx) {
} else {
Enemy_StartFinishingBlow(globalCtx, &this->actor);
this->actor.colChkInfo.health = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
// Negate effects of fire on Fire Keese and Ice on Ice Keese
if (((this->currentType == KEESE_FIRE) && (this->actor.colChkInfo.damageEffect == 2)) ||
@@ -680,7 +678,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
EnFirefly_UpdateDamage(this, globalCtx);
this->actionFunc(this, globalCtx);
- if (!(this->actor.flags & 0x8000)) {
+ if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if ((this->actor.colChkInfo.health == 0) || (this->actionFunc == EnFirefly_Stunned)) {
Actor_MoveWithGravity(&this->actor);
} else {
@@ -757,7 +755,7 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
EnFirefly* this = THIS;
if ((this->currentType != KEESE_FIRE) && (limbIndex == 27)) {
- gSPDisplayList((*gfx)++, D_06001678);
+ gSPDisplayList((*gfx)++, object_firefly_DL_001678);
} else if ((this->unk_2F4 != globalCtx->gameplayFrames) &&
((this->auraType == KEESE_AURA_FIRE) || (this->auraType == KEESE_AURA_ICE)) &&
((limbIndex == 15) || (limbIndex == 21))) {
@@ -816,7 +814,7 @@ void EnFirefly_Draw(Actor* thisx, GlobalContext* globalCtx) {
gfx = POLY_OPA_DISP;
}
- gSPDisplayList(gfx, &sSetupDL[150]);
+ gSPDisplayList(gfx, &sSetupDL[6 * 25]);
if (this->currentType == KEESE_FIRE) {
gDPSetEnvColor(&gfx[1], 0, 0, 0, 0);
diff --git a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c
index 62417b95e5..b076e2885b 100644
--- a/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c
+++ b/src/overlays/actors/ovl_En_Firefly2/z_en_firefly2.c
@@ -6,7 +6,7 @@
#include "z_en_firefly2.h"
-#define FLAGS 0x00005015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000)
#define THIS ((EnFirefly2*)thisx)
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 24d8efb58a..6c9f813fd5 100644
--- a/src/overlays/actors/ovl_En_Fish/z_en_fish.c
+++ b/src/overlays/actors/ovl_En_Fish/z_en_fish.c
@@ -214,7 +214,7 @@ void EnFish_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_246 = (u32)Rand_Next() >> 0x10;
if (sp36 == ENFISH_0) {
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f);
func_8091E810(this);
} else if (sp36 == ENFISH_1) {
@@ -605,7 +605,7 @@ void func_8091ECF4(EnFish* this) {
this->actor.gravity = 0.0f;
this->actor.terminalVelocity = 0.0f;
this->actor.shape.yOffset = 0.0f;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->unk_240 = 200;
func_8091D660(this);
this->unkFunc = func_8091ED70;
@@ -666,7 +666,7 @@ void func_8091EF30(EnFish* this) {
if (this->actor.velocity.y < -1.0f) {
this->actor.velocity.y = -1.0f;
}
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->actor.home.pos.x = this->actor.world.pos.x;
this->actor.home.pos.y = this->actor.world.pos.y - 20.0f;
this->actor.home.pos.z = this->actor.world.pos.z;
@@ -882,7 +882,7 @@ void func_8091F5A4(Actor* thisx, GlobalContext* globalCtx) {
func_8091D904(this);
}
} else if (func_8091DDF4(this, globalCtx)) {
- Actor_PickUp(&this->actor, globalCtx, 0xBA, 80.0f, 25.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MAX, 80.0f, 25.0f);
}
}
}
diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
index ee36b9107a..21b42c4a4a 100644
--- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
+++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c
@@ -7,8 +7,10 @@
#include "overlays/actors/ovl_En_Fish/z_en_fish.h"
#include "overlays/actors/ovl_En_Mushi2/z_en_mushi2.h"
#include "z_en_fish2.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_fb/object_fb.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnFish2*)thisx)
@@ -40,13 +42,6 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2);
void func_80B2AF80(EnFish2* this, GlobalContext* globalCtx);
void func_80B2B180(EnFish2* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060006D8;
-extern AnimationHeader D_060007D4;
-extern AnimationHeader D_06000ACC;
-extern AnimationHeader D_06001174;
-extern AnimationHeader D_060013AC;
-extern FlexSkeletonHeader D_06006190;
-
static s32 D_80B2B2E0 = 0;
static s32 D_80B2B2E4 = 0;
static s32 D_80B2B2E8 = 0;
@@ -109,7 +104,8 @@ static f32 D_80B2B380[] = { 0.019f, 0.033f };
void func_80B28370(EnFish2* this, s32 arg0) {
static AnimationHeader* D_80B2B388[] = {
- &D_060013AC, &D_060007D4, &D_060006D8, &D_060006D8, &D_06001174, &D_06000ACC,
+ &object_fb_Anim_0013AC, &object_fb_Anim_0007D4, &object_fb_Anim_0006D8,
+ &object_fb_Anim_0006D8, &object_fb_Anim_001174, &object_fb_Anim_000ACC,
};
static u8 D_80B2B3A0[] = { 0, 0, 2, 2, 2, 2 };
f32 sp34;
@@ -161,8 +157,8 @@ void EnFish2_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.params == 0) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006190, &D_060013AC, this->jointTable, this->morphTable,
- 24);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fb_Skel_006190, &object_fb_Anim_0013AC,
+ this->jointTable, this->morphTable, 24);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
if (this->unk_344 == 0) {
if (gSaveContext.weekEventReg[81] & 0x10) {
@@ -213,7 +209,7 @@ void EnFish2_Init(Actor* thisx, GlobalContext* globalCtx) {
} else if (this->actor.params != 0) {
this->unk_2B4 = 10;
this->actor.draw = NULL;
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
this->actionFunc = func_80B2A01C;
}
}
@@ -898,8 +894,8 @@ void func_80B2A498(EnFish2* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[81] &= (u8)~0x20;
gSaveContext.weekEventReg[81] &= (u8)~0x40;
gSaveContext.weekEventReg[81] &= (u8)~0x80;
- gSaveContext.weekEventReg[82] &= (u8)~0x1;
- gSaveContext.weekEventReg[82] &= (u8)~0x2;
+ gSaveContext.weekEventReg[82] &= (u8)~1;
+ gSaveContext.weekEventReg[82] &= (u8)~2;
}
}
@@ -937,8 +933,8 @@ void EnFish2_Update(Actor* thisx, GlobalContext* globalCtx2) {
static f32 D_80B2B3A8[] = {
0.0f, 40.0f, -40.0f, 0.0f, 0.0f, 0.0f,
};
- EnFish2* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnFish2* this = THIS;
if ((this->actionFunc != func_80B295A4) && (this->actor.params != 1)) {
SkelAnime_Update(&this->skelAnime);
@@ -1095,12 +1091,12 @@ void func_80B2ADB0(EnFish2* this, Vec3f* vec, s16 arg2) {
for (i = 0; i < ARRAY_COUNT(this->unk_3F8); i++, ptr++) {
if (!ptr->unk_00) {
- u32 phi_v0;
+ TexturePtr phi_v0;
if (Rand_ZeroOne() < 0.5f) {
- phi_v0 = &D_04091CE0;
+ phi_v0 = gameplay_keep_Tex_091CE0;
} else {
- phi_v0 = &D_04091BE0;
+ phi_v0 = gameplay_keep_Tex_091BE0;
}
ptr->unk_20 = VIRTUAL_TO_PHYSICAL(SEGMENTED_TO_VIRTUAL(phi_v0));
@@ -1172,7 +1168,7 @@ void func_80B2B180(EnFish2* this, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_OPA_DISP++, 150, 150, 150, 0);
gSPSegment(POLY_OPA_DISP++, 0x08, ptr->unk_20);
- gSPDisplayList(POLY_OPA_DISP++, D_040301B0);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0301B0);
}
}
diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
index 4de4d0955e..14e364d56f 100644
--- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
+++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c
@@ -8,7 +8,7 @@
#include "objects/object_fish/object_fish.h"
#include "overlays/actors/ovl_En_Kanban/z_en_kanban.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnFishing*)thisx)
@@ -833,7 +833,7 @@ void EnFishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
if (sLinkAge != 1) {
// HIGH_SCORE(HS_FISHING) from OoT
- if (gSaveContext.roomInf[127][2] & 0x1000) {
+ if (gSaveContext.unk_EE4 & 0x1000) {
D_8090CD08 = 0;
} else {
D_8090CD08 = 1;
@@ -851,18 +851,18 @@ void EnFishing_Init(Actor* thisx, GlobalContext* globalCtx2) {
Audio_QueueSeqCmd(0x100100FF);
if (sLinkAge == 1) {
- if (gSaveContext.roomInf[127][2] & 0x7F) {
- D_809171CC = gSaveContext.roomInf[127][2] & 0x7F;
+ if (gSaveContext.unk_EE4 & 0x7F) {
+ D_809171CC = gSaveContext.unk_EE4 & 0x7F;
} else {
D_809171CC = 40.0f;
}
- } else if (gSaveContext.roomInf[127][2] & 0x7F000000) {
- D_809171CC = (gSaveContext.roomInf[127][2] & 0x7F000000) >> 0x18;
+ } else if (gSaveContext.unk_EE4 & 0x7F000000) {
+ D_809171CC = (gSaveContext.unk_EE4 & 0x7F000000) >> 0x18;
} else {
D_809171CC = 45.0f;
}
- D_809171D1 = (gSaveContext.roomInf[127][2] & 0xFF0000) >> 0x10;
+ D_809171D1 = (gSaveContext.unk_EE4 & 0xFF0000) >> 0x10;
if ((D_809171D1 & 7) == 7) {
globalCtx->roomCtx.unk7A[0] = 90;
D_809171CA = 1;
@@ -1123,11 +1123,11 @@ void EnFishing_UpdateEffects(FishingEffect* effect, GlobalContext* globalCtx) {
}
if (effect->unk_2C == 30) {
- func_801518B0(globalCtx, 0x40B3, NULL);
+ Message_StartTextbox(globalCtx, 0x40B3, NULL);
}
if ((effect->unk_2C >= 100) && (Message_GetState(&globalCtx->msgCtx) == 5)) {
- if (func_80147624(globalCtx) || !Message_GetState(&globalCtx->msgCtx)) {
+ if (func_80147624(globalCtx) || Message_GetState(&globalCtx->msgCtx) == 0) {
func_801477B4(globalCtx);
func_801159EC(-50);
effect->unk_2C = -1;
@@ -2812,8 +2812,8 @@ void func_80903C60(EnFishing* this, u8 arg1) {
void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
if (sLinkAge == 1) {
- if (gSaveContext.roomInf[127][2] & 0x7F) {
- if (gSaveContext.roomInf[127][2] & 0x80) {
+ if (gSaveContext.unk_EE4 & 0x7F) {
+ if (gSaveContext.unk_EE4 & 0x80) {
this->actor.textId = 0x40B1;
} else {
this->actor.textId = 0x4089;
@@ -2821,8 +2821,8 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
} else {
this->actor.textId = 0x40AE;
}
- } else if (gSaveContext.roomInf[127][2] & 0x7F000000) {
- if (gSaveContext.roomInf[127][2] & 0x80000000) {
+ } else if (gSaveContext.unk_EE4 & 0x7F000000) {
+ if (gSaveContext.unk_EE4 & 0x80000000) {
this->actor.textId = 0x40B1;
} else {
this->actor.textId = 0x4089;
@@ -2833,7 +2833,7 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
if (this->unk_1CB == 0) {
if (this->unk_1CC == 0) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
D_8090CCF8 = D_809171CC;
@@ -2843,7 +2843,7 @@ void EnFishing_HandleAquariumDialog(EnFishing* this, GlobalContext* globalCtx) {
}
} else {
this->unk_1CC--;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
} else if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
this->unk_1CB = 0;
@@ -2898,11 +2898,11 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
sp118 = (player->actor.speedXZ * 0.3f) + 0.25f;
}
- if ((D_80917200 != 0) || (sCameraId != MAIN_CAM) ||
+ if ((D_80917200 != 0) || (sCameraId != CAM_ID_MAIN) ||
((player->actor.world.pos.z > 1150.0f) && (this->unk_150 != 100))) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (D_8090CD14 != 0) {
if (D_80917202 == 0) {
this->actor.focus.pos = sLurePos;
@@ -3079,7 +3079,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
this->unk_172[1] = 50;
}
- if (!Message_GetState(&globalCtx->msgCtx)) {
+ if (Message_GetState(&globalCtx->msgCtx) == 0) {
if ((gSaveContext.time >= 0xC000) && (gSaveContext.time <= 0xC01B)) {
this->unk_150 = 7;
this->unk_172[3] = Rand_ZeroFloat(150.0f) + 200.0f;
@@ -3112,7 +3112,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
if (D_80917206 == 2) {
func_809038A4(this, input);
} else {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
break;
@@ -3149,7 +3149,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
if (D_80917206 == 2) {
func_809038A4(this, input);
} else {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
}
break;
@@ -3192,7 +3192,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
this->unk_1AC.z = Rand_ZeroFloat(50.0f);
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
break;
case -2:
@@ -3231,7 +3231,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
}
Math_ApproachF(&this->unk_1A8, 2048.0f, 1.0f, 128.0f);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
break;
@@ -3762,8 +3762,8 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
if ((D_80917272 == 0) && (D_80917274 == 0)) {
// Assignment of OoT's D_80B7E086 here removed in MM
- if (((sLinkAge == 1) && (gSaveContext.roomInf[127][2] & 0x400)) ||
- ((sLinkAge != 1) && (gSaveContext.roomInf[127][2] & 0x800))) {
+ if (((sLinkAge == 1) && (gSaveContext.unk_EE4 & 0x400)) ||
+ ((sLinkAge != 1) && (gSaveContext.unk_EE4 & 0x800))) {
// Assignment of OoT's D_80B7A67C here removed in MM, this is now an empty branch
}
} else {
@@ -3793,7 +3793,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
player->unk_B28 = 3;
func_8013EC44(0.0f, 1, 3, 1);
D_809171D8++;
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
D_8090CD4C = 100;
D_80911F48 = 45.0f;
D_8090CD14 = 5;
@@ -3875,7 +3875,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
if (this->unk_172[0] <= 50) {
switch (this->unk_1CD) {
case 0:
- if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 4) || Message_GetState(&globalCtx->msgCtx) == 0) {
if (func_80147624(globalCtx)) {
func_801477B4(globalCtx);
if (globalCtx->msgCtx.choiceIndex == 0) {
@@ -3888,7 +3888,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
((s16)this->unk_1A4 < (s16)D_8090CCF0)) {
this->unk_1CD = 1;
this->unk_172[0] = 0x3C;
- func_801518B0(globalCtx, 0x4098, NULL);
+ Message_StartTextbox(globalCtx, 0x4098, NULL);
} else {
f32 temp1 = D_8090CCF0;
s16 temp2 = D_809171D0;
@@ -3906,7 +3906,7 @@ void EnFishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
}
break;
case 1:
- if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 4) || Message_GetState(&globalCtx->msgCtx) == 0) {
if (func_80147624(globalCtx)) {
func_801477B4(globalCtx);
if (globalCtx->msgCtx.choiceIndex != 0) {
@@ -4228,7 +4228,7 @@ s32 EnFishing_LoachOverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx
rot->y += this->unk_1C4[2];
}
- return 0;
+ return false;
}
void EnFishing_LoachPostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@@ -4359,7 +4359,7 @@ void EnFishing_UpdatePondProps(GlobalContext* globalCtx) {
prop++;
}
- if (sCameraId == MAIN_CAM) {
+ if (sCameraId == CAM_ID_MAIN) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &sFishingMain->collider.base);
}
}
@@ -4705,7 +4705,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
case 0:
if (D_809171FC == 0) {
if (sLinkAge != 1) {
- if ((gSaveContext.roomInf[127][2] & 0x100) && !(gSaveContext.roomInf[127][2] & 0x200)) {
+ if ((gSaveContext.unk_EE4 & 0x100) && !(gSaveContext.unk_EE4 & 0x200)) {
this->actor.textId = 0x4093;
} else {
this->actor.textId = 0x407B;
@@ -4723,9 +4723,9 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
if (D_809171FC == 0) {
this->unk_154 = 1;
if (sLinkAge != 1) {
- gSaveContext.roomInf[127][2] |= 0x200;
+ gSaveContext.unk_EE4 |= 0x200;
} else {
- gSaveContext.roomInf[127][2] |= 0x100;
+ gSaveContext.unk_EE4 |= 0x100;
}
} else {
this->unk_154 = 10;
@@ -4808,8 +4808,8 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
D_8090CD04 = 20;
this->unk_154 = 0;
- if ((gSaveContext.roomInf[127][2] & 0xFF0000) < 0xFF0000) {
- gSaveContext.roomInf[127][2] += 0x10000;
+ if ((gSaveContext.unk_EE4 & 0xFF0000) < 0xFF0000) {
+ gSaveContext.unk_EE4 += 0x10000;
}
}
break;
@@ -4904,7 +4904,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
break;
case 11:
- if (((Message_GetState(&globalCtx->msgCtx) == 5) || !Message_GetState(&globalCtx->msgCtx)) &&
+ if (((Message_GetState(&globalCtx->msgCtx) == 5) || Message_GetState(&globalCtx->msgCtx) == 0) &&
func_80147624(globalCtx)) {
s32 getItemId;
@@ -4917,30 +4917,30 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
if (sLinkAge == 1) {
f32 temp;
- gSaveContext.roomInf[127][2] &= 0xFFFFFF00;
- gSaveContext.roomInf[127][2] |= ((s16)D_809171CC & 0x7F);
+ gSaveContext.unk_EE4 &= 0xFFFFFF00;
+ gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F);
- temp = (gSaveContext.roomInf[127][2] & 0x7F000000) >> 0x18;
+ temp = (gSaveContext.unk_EE4 & 0x7F000000) >> 0x18;
if (temp < D_809171CC) {
- gSaveContext.roomInf[127][2] &= 0xFFFFFF;
- gSaveContext.roomInf[127][2] |= ((s16)D_809171CC & 0x7F) << 0x18;
+ gSaveContext.unk_EE4 &= 0xFFFFFF;
+ gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
if (D_809171D2 == 2) {
- gSaveContext.roomInf[127][2] |= 0x80000000;
+ gSaveContext.unk_EE4 |= 0x80000000;
}
}
if (D_809171D2 == 2) {
- gSaveContext.roomInf[127][2] |= 0x80;
+ gSaveContext.unk_EE4 |= 0x80;
this->unk_154 = 0;
break;
}
} else {
- gSaveContext.roomInf[127][2] &= 0xFFFFFF;
- gSaveContext.roomInf[127][2] |= ((s16)D_809171CC & 0x7F) << 0x18;
+ gSaveContext.unk_EE4 &= 0xFFFFFF;
+ gSaveContext.unk_EE4 |= ((s16)D_809171CC & 0x7F) << 0x18;
if (D_809171D2 == 2) {
- gSaveContext.roomInf[127][2] |= 0x80000000;
+ gSaveContext.unk_EE4 |= 0x80000000;
this->unk_154 = 0;
break;
}
@@ -4957,14 +4957,14 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
}
if (sLinkAge == 1) {
- if ((D_809171CC >= 50.0f) && !(gSaveContext.roomInf[127][2] & 0x400)) {
- gSaveContext.roomInf[127][2] |= 0x400;
+ if ((D_809171CC >= 50.0f) && !(gSaveContext.unk_EE4 & 0x400)) {
+ gSaveContext.unk_EE4 |= 0x400;
getItemId = GI_HEART_PIECE;
sSinkingLureLocation = Rand_ZeroFloat(3.999f) + 1.0f;
}
} else {
- if ((D_809171CC >= 60.0f) && !(gSaveContext.roomInf[127][2] & 0x800)) {
- gSaveContext.roomInf[127][2] |= 0x800;
+ if ((D_809171CC >= 60.0f) && !(gSaveContext.unk_EE4 & 0x800)) {
+ gSaveContext.unk_EE4 |= 0x800;
getItemId = GI_SCALE_GOLD;
sSinkingLureLocation = Rand_ZeroFloat(3.999f) + 1.0f;
}
@@ -5008,7 +5008,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
break;
case 22:
- if (!Message_GetState(&globalCtx->msgCtx)) {
+ if (Message_GetState(&globalCtx->msgCtx) == 0) {
this->unk_154 = 0;
if (D_8090CD0C != 0) {
D_8090CD08 = 1;
@@ -5034,7 +5034,7 @@ void EnFishing_HandleOwnerDialog(EnFishing* this, GlobalContext* globalCtx) {
if (D_809171D0 == 0) {
this->unk_154 = 0;
} else {
- func_801518B0(globalCtx, 0x409C, NULL);
+ Message_StartTextbox(globalCtx, 0x409C, NULL);
this->unk_154 = 20;
}
}
@@ -5084,9 +5084,9 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
SkelAnime_Update(&this->skelAnime);
if ((D_8090CD04 != 0) || Message_GetState(&globalCtx->msgCtx)) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
} else {
- this->actor.flags |= 0x21;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_20);
}
if ((this->actor.xzDistToPlayer < 120.0f) || Message_GetState(&globalCtx->msgCtx)) {
@@ -5125,20 +5125,20 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
if ((sqrtf(SQ(dx) + SQ(dy) + SQ(dz)) < 25.0f)) {
D_8090CD08 = 0;
D_8090CD0C = 1;
- func_801518B0(globalCtx, 0x4087, NULL);
+ Message_StartTextbox(globalCtx, 0x4087, NULL);
}
}
if (D_8090CD08 == 0) {
- gSaveContext.roomInf[127][2] |= 0x1000;
+ gSaveContext.unk_EE4 |= 0x1000;
} else if (D_8090CD08 == 1) {
- gSaveContext.roomInf[127][2] &= ~0x1000;
+ gSaveContext.unk_EE4 &= ~0x1000;
}
if (D_8090CCFC != 0) {
D_8090CCFC--;
if (D_8090CCFC == 0) {
- func_801518B0(globalCtx, D_809171DA, NULL);
+ Message_StartTextbox(globalCtx, D_809171DA, NULL);
}
}
@@ -5185,10 +5185,10 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
break;
case 1:
- sCameraId = func_801694DC(globalCtx);
- func_80169590(globalCtx, MAIN_CAM, 1);
- func_80169590(globalCtx, sCameraId, 7);
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ sCameraId = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, sCameraId, 7);
+ camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
sCameraEye.x = camera->eye.x;
sCameraEye.y = camera->eye.y;
sCameraEye.z = camera->eye.z;
@@ -5201,7 +5201,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
// fallthrough
case 2:
- ShrinkWindow_SetLetterboxTarget(0x1B);
+ ShrinkWindow_SetLetterboxTarget(27);
spFC.x = sLurePos.x - player->actor.world.pos.x;
spFC.z = sLurePos.z - player->actor.world.pos.z;
@@ -5295,36 +5295,36 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
break;
case 3: {
- Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
camera->eye = sCameraEye;
camera->eyeNext = sCameraEye;
camera->at = sCameraAt;
}
func_80169AFC(globalCtx, sCameraId, 0);
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
D_8090CD4C = 0;
- sCameraId = MAIN_CAM;
+ sCameraId = CAM_ID_MAIN;
func_800F6834(globalCtx, 0);
- globalCtx->envCtx.unk_8C.fogNear = 0;
+ globalCtx->envCtx.lightSettings.fogNear = 0;
player->unk_B28 = -5;
D_80917200 = 5;
break;
case 10:
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- sCameraId = func_801694DC(globalCtx);
- func_80169590(globalCtx, MAIN_CAM, 1);
- func_80169590(globalCtx, sCameraId, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ sCameraId = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, sCameraId, 7);
func_800B7298(globalCtx, &this->actor, 4);
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
sCameraEye.x = camera->eye.x;
sCameraEye.y = camera->eye.y;
sCameraEye.z = camera->eye.z;
sCameraAt.x = camera->at.x;
sCameraAt.y = camera->at.y;
sCameraAt.z = camera->at.z;
- func_801518B0(globalCtx, 0x409E, NULL);
+ Message_StartTextbox(globalCtx, 0x409E, NULL);
D_8090CD4C = 11;
func_8013EC44(0.0f, 150, 10, 10);
// fallthrough
@@ -5333,37 +5333,37 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
player->actor.world.pos.z = 1360.0f;
player->actor.speedXZ = 0.0f;
- if (!Message_GetState(&globalCtx->msgCtx)) {
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ if (Message_GetState(&globalCtx->msgCtx) == 0) {
+ camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
camera->eye = sCameraEye;
camera->eyeNext = sCameraEye;
camera->at = sCameraAt;
func_80169AFC(globalCtx, sCameraId, 0);
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6);
D_8090CD4C = 0;
- sCameraId = MAIN_CAM;
+ sCameraId = CAM_ID_MAIN;
D_8090CD50 = 30;
func_800F6834(globalCtx, 0);
- globalCtx->envCtx.unk_8C.fogNear = 0;
+ globalCtx->envCtx.lightSettings.fogNear = 0;
}
break;
case 20:
- func_800EA0D4(globalCtx, &globalCtx->csCtx);
- sCameraId = func_801694DC(globalCtx);
- func_80169590(globalCtx, MAIN_CAM, 1);
- func_80169590(globalCtx, sCameraId, 7);
+ Cutscene_Start(globalCtx, &globalCtx->csCtx);
+ sCameraId = Play_CreateSubCamera(globalCtx);
+ Play_CameraChangeStatus(globalCtx, CAM_ID_MAIN, 1);
+ Play_CameraChangeStatus(globalCtx, sCameraId, 7);
func_800B7298(globalCtx, &this->actor, 4);
- camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
sCameraEye.x = camera->eye.x;
sCameraEye.y = camera->eye.y;
sCameraEye.z = camera->eye.z;
sCameraAt.x = camera->at.x;
sCameraAt.y = camera->at.y;
sCameraAt.z = camera->at.z;
- func_801518B0(globalCtx, 0x409A, NULL);
+ Message_StartTextbox(globalCtx, 0x409A, NULL);
D_8090CD4C = 21;
D_80911F48 = 45.0f;
D_8090CD50 = 10;
@@ -5426,9 +5426,9 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
}
if (D_8090CD50 == 0) {
- if ((Message_GetState(&globalCtx->msgCtx) == 4) || !Message_GetState(&globalCtx->msgCtx)) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 4) || Message_GetState(&globalCtx->msgCtx) == 0) {
if (func_80147624(globalCtx)) {
- Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
func_801477B4(globalCtx);
if (globalCtx->msgCtx.choiceIndex == 0) {
@@ -5440,16 +5440,16 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
camera->eyeNext = sCameraEye;
camera->at = sCameraAt;
func_80169AFC(globalCtx, sCameraId, 0);
- func_800EA0EC(globalCtx, &globalCtx->csCtx);
+ Cutscene_End(globalCtx, &globalCtx->csCtx);
func_800B7298(globalCtx, &this->actor, 6); // arg2 changed from 7 to 6 in MM
D_8090CD4C = 0;
- sCameraId = MAIN_CAM;
+ sCameraId = CAM_ID_MAIN;
player->unk_B28 = -5;
D_80917200 = 5;
D_8090CD54 = 0;
D_809171F6 = 20;
func_800F6834(globalCtx, 0);
- globalCtx->envCtx.unk_8C.fogNear = 0;
+ globalCtx->envCtx.lightSettings.fogNear = 0;
}
}
}
@@ -5459,20 +5459,20 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
break;
}
- if (sCameraId != MAIN_CAM) {
+ if (sCameraId != CAM_ID_MAIN) {
Play_CameraSetAtEye(globalCtx, sCameraId, &sCameraAt, &sCameraEye);
Math_ApproachF(&D_80911F4C, 1.0f, 1.0f, 0.02f);
if (sCameraEye.y <= (WATER_SURFACE_Y(globalCtx) + 1.0f)) {
func_800F6834(globalCtx, 1);
if (D_809171CA != 0) {
- globalCtx->envCtx.unk_8C.fogNear = -0xB2;
+ globalCtx->envCtx.lightSettings.fogNear = -0xB2;
} else {
- globalCtx->envCtx.unk_8C.fogNear = -0x2E;
+ globalCtx->envCtx.lightSettings.fogNear = -0x2E;
}
} else {
func_800F6834(globalCtx, 0);
- globalCtx->envCtx.unk_8C.fogNear = 0;
+ globalCtx->envCtx.lightSettings.fogNear = 0;
}
}
@@ -5518,7 +5518,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
D_809171CB--;
}
- if ((D_809171CB == 1) && !Message_GetState(&globalCtx->msgCtx) && ((D_8090CD00 & 0xFFF) == 0xFFF)) {
+ if ((D_809171CB == 1) && Message_GetState(&globalCtx->msgCtx) == 0 && ((D_8090CD00 & 0xFFF) == 0xFFF)) {
D_809171CB = 200;
if (Rand_ZeroOne() < 0.5f) {
@@ -5556,12 +5556,12 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
Math_ApproachZeroF(&D_8090CCD8, 1.0f, 2.0f);
}
- globalCtx->envCtx.unk_8C.diffuseColor1[0] = globalCtx->envCtx.unk_8C.diffuseColor1[1] =
- globalCtx->envCtx.unk_8C.diffuseColor1[2] = D_8090CCD8;
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] = globalCtx->envCtx.lightSettings.diffuseColor1[1] =
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] = D_8090CCD8;
if ((u8)D_8090CCD0 > 0) {
s32 pad;
- Camera* camera = Play_GetCamera(globalCtx, MAIN_CAM);
+ Camera* camera = Play_GetCamera(globalCtx, CAM_ID_MAIN);
s16 i;
s32 pad1;
Vec3f pos;
@@ -5571,7 +5571,7 @@ void EnFishing_UpdateOwner(Actor* thisx, GlobalContext* globalCtx2) {
rot.x = 1.6707964f;
rot.y = 1.0f;
- rot.z = (func_800DFC68(camera) * -(M_PI / 32768)) + rot.y;
+ rot.z = (Camera_GetInputDirYaw(camera) * -(M_PI / 32768)) + rot.y;
for (i = 0; i < (u8)D_8090CCD0; i++) {
pos.x = randPlusMinusPoint5Scaled(700.0f) + globalCtx->view.eye.x;
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 fe74226102..3ce216f7fc 100644
--- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
+++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c
@@ -5,8 +5,9 @@
*/
#include "z_en_floormas.h"
+#include "objects/object_wallmaster/object_wallmaster.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnFloormas*)thisx)
@@ -59,19 +60,6 @@ void func_808D2D30(EnFloormas* this, GlobalContext* globalCtx);
void func_808D2DC0(EnFloormas* this, GlobalContext* globalCtx);
void func_808D3754(Actor* thisx, GlobalContext* globalCtx);
-extern AnimationHeader D_06000590;
-extern AnimationHeader D_06000EA4;
-extern AnimationHeader D_060019CC;
-extern AnimationHeader D_06002158;
-extern AnimationHeader D_060039B0;
-extern AnimationHeader D_060041F4;
-extern Gfx D_06008688[];
-extern FlexSkeletonHeader D_06008FB0;
-extern AnimationHeader D_06009244;
-extern AnimationHeader D_06009520;
-extern AnimationHeader D_06009DB0;
-extern AnimationHeader D_0600A054;
-
const ActorInit En_Floormas_InitVars = {
ACTOR_EN_FLOORMAS,
ACTORCAT_ENEMY,
@@ -159,14 +147,15 @@ static s8 D_808D393C[] = {
static Color_RGBA8 D_808D3958 = { 0, 255, 0, 0 };
void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx2) {
- EnFloormas* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnFloormas* this = THIS;
s32 pad;
s32 params;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wallmaster_Skel_008FB0, &object_wallmaster_Anim_009DB0,
+ this->jointTable, this->morphTable, 25);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@@ -175,13 +164,13 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->actor.params = ENFLOORMAS_GET_7FFF(&this->actor);
if (params != 0) {
- this->actor.flags |= 0x80;
+ this->actor.flags |= ACTOR_FLAG_80;
this->actor.draw = func_808D3754;
}
if (this->actor.params == ENFLOORMAS_GET_7FFF_10) {
this->actor.draw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_808D2AA8;
return;
}
@@ -250,7 +239,7 @@ void func_808D09CC(EnFloormas* this) {
this->unk_2C4 = 1.0f;
this->collider.base.colType = COLTYPE_HIT3;
this->unk_18E = 80;
- this->actor.flags &= ~(0x400 | 0x200);
+ this->actor.flags &= ~(ACTOR_FLAG_200 | ACTOR_FLAG_400);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
}
@@ -262,15 +251,15 @@ void func_808D0A48(EnFloormas* this, GlobalContext* globalCtx) {
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D0, ARRAY_COUNT(this->unk_2D0), 2,
this->actor.scale.x * 30.000002f, this->actor.scale.x * 20.0f);
if (this->actor.scale.x > 0.009f) {
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
} else {
- this->actor.flags |= 0x200;
+ this->actor.flags |= ACTOR_FLAG_200;
}
}
}
void func_808D0B08(EnFloormas* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06009DB0);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_808D0B50;
}
@@ -289,7 +278,7 @@ void func_808D0B50(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D0C14(EnFloormas* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A054, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_00A054, -3.0f);
this->actionFunc = func_808D0C58;
}
@@ -307,7 +296,7 @@ void func_808D0C58(EnFloormas* this, GlobalContext* globalCtx) {
void func_808D0CE4(EnFloormas* this) {
if (this->actionFunc != func_808D0F80) {
- Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 1.5f);
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 1.5f);
} else {
this->skelAnime.playSpeed = 1.5f;
}
@@ -345,7 +334,7 @@ void func_808D0D70(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D0ECC(EnFloormas* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06009244);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009244);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_808D0F14;
}
@@ -384,10 +373,10 @@ void func_808D108C(EnFloormas* this) {
this->actor.speedXZ = 0.0f;
if (sp36 > 0) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06002158, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_002158, -3.0f);
} else {
- Animation_Change(&this->skelAnime, &D_06002158, -1.0f, Animation_GetLastFrame(&D_06002158.common), 0.0f, 2,
- -3.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_002158, -1.0f,
+ Animation_GetLastFrame(&object_wallmaster_Anim_002158.common), 0.0f, 2, -3.0f);
}
if (this->actor.scale.x > 0.009f) {
@@ -429,7 +418,8 @@ void func_808D11BC(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D1380(EnFloormas* this, GlobalContext* globalCtx) {
- Animation_Change(&this->skelAnime, &D_06009520, 3.0f, 0.0f, Animation_GetLastFrame(&D_06009520.common), 2, -3.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_009520, 3.0f, 0.0f,
+ Animation_GetLastFrame(&object_wallmaster_Anim_009520.common), 2, -3.0f);
this->actor.speedXZ = 0.0f;
this->actor.gravity = 0.0f;
func_808D08D0(this);
@@ -502,7 +492,7 @@ void func_808D1650(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D1740(EnFloormas* this) {
- Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 41.0f, 42.0f, 2, 5.0f);
if ((this->actor.speedXZ < 0.0f) || (this->actionFunc != func_808D1650)) {
this->unk_18E = 30;
} else {
@@ -548,7 +538,7 @@ void func_808D17EC(EnFloormas* this, GlobalContext* globalCtx) {
if ((this->unk_18E == 0) && (sp24 != 0)) {
if (this->skelAnime.endFrame < 45.0f) {
- this->skelAnime.endFrame = Animation_GetLastFrame(&D_060019CC.common);
+ this->skelAnime.endFrame = Animation_GetLastFrame(&object_wallmaster_Anim_0019CC.common);
} else if (this->actor.params == ENFLOORMAS_GET_7FFF_40) {
func_808D2700(this);
} else {
@@ -568,8 +558,8 @@ void func_808D19D4(EnFloormas* this) {
this->actor.colorFilterTimer = 0;
this->unk_2C4 = 0.0f;
Actor_SetScale(&this->actor, 0.004f);
- this->actor.flags |= 0x10;
- if ((this->actor.flags & 0x80) == 0x80) {
+ this->actor.flags |= ACTOR_FLAG_10;
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_80) {
this->actor.draw = func_808D3754;
} else {
this->actor.draw = EnFloormas_Draw;
@@ -579,11 +569,12 @@ void func_808D19D4(EnFloormas* this) {
this->actor.shape.rot.y = parent->shape.rot.y + 0x5555;
this->actor.world.pos = parent->world.pos;
this->actor.params = ENFLOORMAS_GET_7FFF_10;
- Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 41.0f, Animation_GetLastFrame(&D_060019CC.common), 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 41.0f,
+ Animation_GetLastFrame(&object_wallmaster_Anim_0019CC.common), 2, 0.0f);
this->collider.dim.radius = sCylinderInit.dim.radius * 0.6f;
this->collider.dim.height = sCylinderInit.dim.height * 0.6f;
- this->actor.flags &= ~0x400;
- this->actor.flags |= 0x200;
+ this->actor.flags &= ~ACTOR_FLAG_400;
+ this->actor.flags |= ACTOR_FLAG_200;
this->actor.colChkInfo.health = 1;
this->actor.speedXZ = 4.0f;
this->actor.velocity.y = 7.0f;
@@ -593,7 +584,7 @@ void func_808D19D4(EnFloormas* this) {
void func_808D1B44(EnFloormas* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
if (SkelAnime_Update(&this->skelAnime)) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_194 = 50;
func_808D0C14(this);
}
@@ -605,7 +596,7 @@ void func_808D1B44(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D1BCC(EnFloormas* this) {
- Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 4.5f);
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 4.5f);
this->actor.speedXZ = 5.0f;
this->actionFunc = func_808D1C1C;
}
@@ -632,7 +623,7 @@ void func_808D1C1C(EnFloormas* this, GlobalContext* globalCtx) {
void func_808D1D0C(EnFloormas* this) {
if (this->actionFunc != func_808D1C1C) {
- Animation_PlayLoopSetSpeed(&this->skelAnime, &D_060041F4, 4.5f);
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &object_wallmaster_Anim_0041F4, 4.5f);
}
this->actor.speedXZ = 5.0f;
this->actionFunc = func_808D1D6C;
@@ -695,7 +686,7 @@ void func_808D1F7C(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D1FD4(EnFloormas* this) {
- Animation_Change(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_808D2040;
}
@@ -725,8 +716,8 @@ void func_808D217C(EnFloormas* this, Player* player) {
Vec3f* ptr;
u8 playerForm;
- Animation_Change(&this->skelAnime, &D_060019CC, 1.0f, 36.0f, 45.0f, 2, -3.0f);
- this->actor.flags &= ~1;
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 1.0f, 36.0f, 45.0f, 2, -3.0f);
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
func_808D08D0(this);
@@ -770,7 +761,7 @@ void func_808D22C8(EnFloormas* this, GlobalContext* globalCtx) {
this->actor.shape.rot.x = 0;
this->actor.velocity.y = 6.0f;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.speedXZ = -3.0f;
func_808D1740(this);
} else if ((this->unk_190 % 20) == 0) {
@@ -781,7 +772,7 @@ void func_808D22C8(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D2484(EnFloormas* this) {
- Animation_Change(&this->skelAnime, &D_060019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_wallmaster_Anim_0019CC, 2.0f, 0.0f, 41.0f, 2, 0.0f);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_808D24F0;
}
@@ -825,7 +816,7 @@ void func_808D24F0(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D2700(EnFloormas* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06009DB0);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0);
this->unk_18E = 0;
this->unk_194 = 1500;
this->actor.params = ENFLOORMAS_GET_7FFF_40;
@@ -882,18 +873,18 @@ void func_808D2764(EnFloormas* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->actor.scale.x >= 0.01f) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
func_808D0908(this);
this->actor.params = ENFLOORMAS_GET_7FFF_0;
- this->actor.flags &= ~0x200;
- this->actor.flags |= 0x400;
+ this->actor.flags &= ~ACTOR_FLAG_200;
+ this->actor.flags |= ACTOR_FLAG_400;
this->actor.colChkInfo.health = sColChkInfoInit.health;
func_808D0C14(this);
} else if (this->unk_18E == 0) {
- Animation_PlayOnce(&this->skelAnime, &D_060039B0);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_0039B0);
this->unk_18E = 1;
} else {
- Animation_PlayOnce(&this->skelAnime, &D_06009DB0);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_009DB0);
this->unk_18E = 0;
}
}
@@ -913,7 +904,7 @@ void func_808D2A20(EnFloormas* this) {
Actor_MarkForDeath(&this->actor);
} else {
this->actor.draw = NULL;
- this->actor.flags &= ~(0x10 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_10);
this->actionFunc = func_808D2AA8;
}
}
@@ -933,7 +924,7 @@ void func_808D2AF4(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D2B18(EnFloormas* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wallmaster_Anim_000590, -3.0f);
func_800BE504(&this->actor, &this->collider);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 20);
this->actor.speedXZ = 5.0f;
@@ -976,7 +967,7 @@ void func_808D2C08(EnFloormas* this, GlobalContext* globalCtx) {
}
void func_808D2CDC(EnFloormas* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06000EA4);
+ Animation_PlayOnce(&this->skelAnime, &object_wallmaster_Anim_000EA4);
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -1038,7 +1029,7 @@ void func_808D2E34(EnFloormas* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FLOORMASTER_SM_DEAD);
}
Enemy_StartFinishingBlow(globalCtx, &this->actor);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
} else if (this->actor.colChkInfo.damage != 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FALL_DAMAGE);
}
@@ -1116,7 +1107,7 @@ void EnFloormas_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, this->actor.scale.x * 3000.0f, 0.0f, 0x1D);
Collider_UpdateCylinder(&this->actor, &this->collider);
if (this->actionFunc == func_808D1650) {
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
@@ -1187,7 +1178,7 @@ void EnFloormas_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY);
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList((*gfx)++, D_06008688);
+ gSPDisplayList((*gfx)++, object_wallmaster_DL_008688);
Matrix_StatePop();
}
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 fb5b564510..34b43ef66c 100644
--- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c
+++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c
@@ -6,7 +6,7 @@
#include "z_en_fr.h"
-#define FLAGS 0x40000000
+#define FLAGS (ACTOR_FLAG_40000000)
#define THIS ((EnFr*)thisx)
@@ -45,8 +45,8 @@ void EnFr_Update(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, ENFR_GET_SWITCHFLAG(&this->actor))) {
Actor_MarkForDeath(&this->actor);
} else if (this->actor.xyzDistToPlayerSq < SQ(IREG(29))) {
- this->actor.flags &= ~0x40000000;
+ this->actor.flags &= ~ACTOR_FLAG_40000000;
} else {
- this->actor.flags |= 0x40000000;
+ this->actor.flags |= ACTOR_FLAG_40000000;
}
}
diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c
index 7e43657c09..31a7046cbb 100644
--- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c
+++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c
@@ -5,8 +5,10 @@
*/
#include "z_en_fsn.h"
+#include "objects/object_fsn/object_fsn.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnFsn*)thisx)
@@ -45,25 +47,6 @@ void EnFsn_SelectItem(EnFsn* this, GlobalContext* globalCtx);
void EnFsn_LookToShopkeeperFromShelf(EnFsn* this, GlobalContext* globalCtx);
void EnFsn_PlayerCannotBuy(EnFsn* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06012C34;
-extern AnimationHeader D_060131FC;
-extern AnimationHeader D_0600C58C;
-extern AnimationHeader D_0600E3EC;
-extern AnimationHeader D_0600F00C;
-extern AnimationHeader D_0600CB3C;
-extern AnimationHeader D_0600D354;
-extern AnimationHeader D_060138B0;
-extern AnimationHeader D_0601430C;
-extern AnimationHeader D_0600B9D8;
-extern AnimationHeader D_0600C26C;
-extern AnimationHeader D_0600DE34;
-extern FlexSkeletonHeader D_06013320;
-extern UNK_TYPE D_06005BC0;
-extern UNK_TYPE D_06006D40;
-extern UNK_TYPE D_06007140;
-extern Gfx D_0600F180[];
-extern Gfx D_0600F218[];
-
const ActorInit En_Fsn_InitVars = {
ACTOR_EN_FSN,
ACTORCAT_NPC,
@@ -76,12 +59,20 @@ const ActorInit En_Fsn_InitVars = {
(ActorFunc)EnFsn_Draw,
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06012C34, 1.0f, 0, -1, 0, 0 }, { &D_060131FC, 1.0f, 0, -1, 0, 0 }, { &D_0600C58C, 1.0f, 0, -1, 2, 0 },
- { &D_0600C58C, -1.0f, 0, -1, 2, 0 }, { &D_0600E3EC, 1.0f, 0, -1, 2, 0 }, { &D_0600F00C, 1.0f, 0, -1, 0, 0 },
- { &D_0600CB3C, 1.0f, 0, -1, 2, 0 }, { &D_0600D354, 1.0f, 0, -1, 0, 0 }, { &D_060138B0, 1.0f, 0, -1, 2, 0 },
- { &D_0601430C, 1.0f, 0, -1, 0, 0 }, { &D_0600B9D8, 1.0f, 0, -1, 2, 0 }, { &D_0600C26C, 1.0f, 0, -1, 0, 0 },
- { &D_0600DE34, 1.0f, 0, -1, 2, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
static ColliderCylinderInit sCylinderInit = {
@@ -140,7 +131,7 @@ u16 EnFsn_GetWelcome(GlobalContext* globalCtx) {
void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
switch (this->textId) {
case 0:
- if (!(gSaveContext.weekEventReg[0x50] & 0x10)) {
+ if (!(gSaveContext.weekEventReg[80] & 0x10)) {
this->textId = 0x29E0;
break;
} else {
@@ -153,7 +144,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_LETTER_TO_MAMA;
this->getItemId = GI_LETTER_TO_MAMA;
- gSaveContext.weekEventReg[0x50] |= 0x10;
+ gSaveContext.weekEventReg[80] |= 0x10;
this->textId = 0x29F1;
break;
} else {
@@ -173,7 +164,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
this->flags |= ENFSN_GIVE_ITEM;
this->flags |= ENFSN_GAVE_LETTER_TO_MAMA;
this->getItemId = GI_LETTER_TO_MAMA;
- gSaveContext.weekEventReg[0x50] |= 0x10;
+ gSaveContext.weekEventReg[80] |= 0x10;
this->textId = 0x29F1;
break;
case 0x29F1:
@@ -181,7 +172,7 @@ void EnFsn_HandleConversationBackroom(EnFsn* this, GlobalContext* globalCtx) {
this->flags |= ENFSN_END_CONVERSATION;
break;
}
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
if (this->flags & ENFSN_END_CONVERSATION) {
if (this->flags & ENFSN_GAVE_LETTER_TO_MAMA) {
this->flags &= ~ENFSN_GAVE_LETTER_TO_MAMA;
@@ -287,8 +278,8 @@ void EnFsn_CursorLeftRight(EnFsn* this) {
}
s16 EnFsn_GetThirdDayItemId(void) {
- if (!(gSaveContext.weekEventReg[0x21] & 4) && CURRENT_DAY == 3) {
- if (!(gSaveContext.weekEventReg[0x21] & 8) && !(gSaveContext.weekEventReg[0x4F] & 0x40)) {
+ if (!(gSaveContext.weekEventReg[33] & 4) && CURRENT_DAY == 3) {
+ if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
return SI_BOMB_BAG_30_1;
}
return SI_MASK_ALL_NIGHT;
@@ -314,14 +305,13 @@ s16 EnFsn_GetStolenItemId(u32 stolenItem) {
s32 EnFsn_HasItemsToSell(void) {
if (CURRENT_DAY != 3) {
- if (((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18) ||
- ((gSaveContext.roomInf[126][5] & 0xFF0000) >> 0x10)) {
+ if (((gSaveContext.stolenItems & 0xFF000000) >> 0x18) || ((gSaveContext.stolenItems & 0xFF0000) >> 0x10)) {
return true;
}
return false;
} else {
- if (((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18) ||
- ((gSaveContext.roomInf[126][5] & 0xFF0000) >> 0x10) || !(gSaveContext.weekEventReg[0x21] & 4)) {
+ if (((gSaveContext.stolenItems & 0xFF000000) >> 0x18) || ((gSaveContext.stolenItems & 0xFF0000) >> 0x10) ||
+ !(gSaveContext.weekEventReg[33] & 4)) {
return true;
}
return false;
@@ -329,8 +319,8 @@ s32 EnFsn_HasItemsToSell(void) {
}
void EnFsn_GetShopItemIds(EnFsn* this) {
- u32 stolenItem1 = (gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18;
- u32 stolenItem2 = (gSaveContext.roomInf[126][5] & 0xFF0000) >> 0x10;
+ u32 stolenItem1 = (gSaveContext.stolenItems & 0xFF000000) >> 0x18;
+ u32 stolenItem2 = (gSaveContext.stolenItems & 0xFF0000) >> 0x10;
s16 itemId;
this->stolenItem1 = this->stolenItem2 = 0;
@@ -377,7 +367,7 @@ void EnFsn_EndInteraction(EnFsn* this, GlobalContext* globalCtx) {
this->cutsceneState = 0;
}
Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
this->drawCursor = 0;
@@ -392,7 +382,7 @@ void EnFsn_EndInteraction(EnFsn* this, GlobalContext* globalCtx) {
s32 EnFsn_TestEndInteraction(EnFsn* this, GlobalContext* globalCtx, Input* input) {
if (CHECK_BTN_ALL(input->press.button, BTN_B)) {
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
func_80151BB4(globalCtx, 3);
this->actionFunc = EnFsn_SetupEndInteraction;
return true;
@@ -427,19 +417,19 @@ s32 EnFsn_FacingShopkeeperDialogResult(EnFsn* this, GlobalContext* globalCtx) {
func_8019F208();
if (CURRENT_DAY != 3) {
this->actor.textId = 0x29FB;
- } else if (gSaveContext.weekEventReg[0x21] & 4) {
+ } else if (gSaveContext.weekEventReg[33] & 4) {
this->actor.textId = 0x29FF;
- } else if (!(gSaveContext.weekEventReg[0x21] & 8) && !(gSaveContext.weekEventReg[0x4F] & 0x40)) {
+ } else if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
this->actor.textId = 0x29D7;
} else {
this->actor.textId = 0x29D8;
}
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
return true;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
func_80151BB4(globalCtx, 3);
this->actionFunc = EnFsn_SetupEndInteraction;
return true;
@@ -703,7 +693,7 @@ void EnFsn_InitShop(EnFsn* this, GlobalContext* globalCtx) {
this->blinkTimer = 20;
this->animationIdx = 4;
this->eyeTextureIdx = 0;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
this->actionFunc = EnFsn_Idle;
}
@@ -712,46 +702,48 @@ void EnFsn_Idle(EnFsn* this, GlobalContext* globalCtx) {
if (this->animationIdx == 4) {
s16 curFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation);
if (curFrame == frameCount) {
this->animationIdx = 5;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
}
- } else if (this->flags & ENFSN_HAGGLE) {
- dummy:;
+ return;
+ }
+
+ if (this->flags & ENFSN_HAGGLE) {
this->actionFunc = EnFsn_Haggle;
- } else {
- dummy2:;
- if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- if (this->cutsceneState == 0) {
- if (ActorCutscene_GetCurrentIndex() == 0x7C) {
- ActorCutscene_Stop(0x7C);
- }
- this->cutscene = this->lookToShopkeeperCutscene;
- ActorCutscene_SetIntentToPlay(this->cutscene);
- this->cutsceneState = 1;
+ return;
+ }
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ if (this->cutsceneState == 0) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
}
- this->actor.textId = EnFsn_GetWelcome(globalCtx);
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
- player->actor.world.pos.x = 1.0f;
- player->actor.world.pos.z = -34.0f;
- this->actionFunc = EnFsn_BeginInteraction;
- } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= 15.0f)) &&
- (player->actor.world.pos.y > 0.0f) &&
- ((player->actor.world.pos.z >= -35.0f) && (player->actor.world.pos.z <= -20.0f))) {
- func_800B8614(&this->actor, globalCtx, 400.0f);
+ this->cutscene = this->lookToShopkeeperCutscene;
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ this->cutsceneState = 1;
}
+ this->actor.textId = EnFsn_GetWelcome(globalCtx);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
+ player->actor.world.pos.x = 1.0f;
+ player->actor.world.pos.z = -34.0f;
+ this->actionFunc = EnFsn_BeginInteraction;
+ } else if (((player->actor.world.pos.x >= -50.0f) && (player->actor.world.pos.x <= 15.0f)) &&
+ (player->actor.world.pos.y > 0.0f) &&
+ ((player->actor.world.pos.z >= -35.0f) && (player->actor.world.pos.z <= -20.0f))) {
+ func_800B8614(&this->actor, globalCtx, 400.0f);
}
}
void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) {
s16 curFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(sAnimations[this->animationIdx].animation);
if (this->flags & ENFSN_ANGRY) {
this->flags &= ~ENFSN_ANGRY;
this->animationIdx = 11;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
} else {
if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
@@ -759,16 +751,16 @@ void EnFsn_Haggle(EnFsn* this, GlobalContext* globalCtx) {
if (this->flags & ENFSN_CALM_DOWN) {
this->flags &= ~ENFSN_CALM_DOWN;
this->animationIdx = 5;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
} else if (this->flags & ENFSN_OFFER_FINAL_PRICE) {
this->flags &= ~ENFSN_OFFER_FINAL_PRICE;
this->animationIdx = 12;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
} else {
if (this->animationIdx == 12) {
if (curFrame == frameCount) {
this->animationIdx = 5;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
} else {
if (Animation_OnFrame(&this->skelAnime, 28.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
@@ -814,16 +806,16 @@ void EnFsn_StartBuying(EnFsn* this, GlobalContext* globalCtx) {
switch (this->actor.textId) {
case 0x29CC:
this->actor.textId = 0x29CD;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
case 0x29CD:
this->actor.textId = 0x29CE;
EnFsn_HandleLookToShopkeeperBuyingCutscene(this);
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
case 0x29CE:
this->actor.textId = 0xFF;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_DeterminePrice;
break;
case 0x29CF:
@@ -846,24 +838,24 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) {
} else {
this->actor.textId = 0x29D2;
}
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
case 0x29D2:
- if (gSaveContext.weekEventReg[0x21] & 4) {
+ if (gSaveContext.weekEventReg[33] & 4) {
this->actor.textId = 0x2A01;
- } else if (!(gSaveContext.weekEventReg[0x21] & 8) && !(gSaveContext.weekEventReg[0x4F] & 0x40)) {
+ } else if (!(gSaveContext.weekEventReg[33] & 8) && !(gSaveContext.weekEventReg[79] & 0x40)) {
this->actor.textId = 0x29D3;
} else {
this->actor.textId = 0x29D4;
}
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
case 0x29D3:
case 0x29D4:
case 0x29FA:
case 0x2A01:
this->actor.textId = 0x29D5;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
break;
}
}
@@ -878,7 +870,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = trueTmp;
this->actor.textId = 0x29D6;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_FaceShopkeeperSelling;
break;
case 1:
@@ -886,7 +878,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) {
this->isSelling = false;
this->actor.textId = 0x29CE;
EnFsn_HandleLookToShopkeeperBuyingCutscene(this);
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_StartBuying;
break;
}
@@ -897,7 +889,7 @@ void EnFsn_AskBuyOrSell(EnFsn* this, GlobalContext* globalCtx) {
void EnFsn_SetupDeterminePrice(EnFsn* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actor.textId = 0xFF;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_DeterminePrice;
}
}
@@ -932,7 +924,7 @@ void EnFsn_DeterminePrice(EnFsn* this, GlobalContext* globalCtx) {
} else {
this->actor.textId = 0x29D1;
}
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
func_80151BB4(globalCtx, 3);
this->actionFunc = EnFsn_SetupEndInteraction;
}
@@ -947,7 +939,7 @@ void EnFsn_MakeOffer(EnFsn* this, GlobalContext* globalCtx) {
switch (globalCtx->msgCtx.choiceIndex) {
case 0:
func_8019F208();
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
if (this->cutsceneState == 2) {
ActorCutscene_Stop(this->cutscene);
@@ -1019,7 +1011,7 @@ void EnFsn_ResumeInteraction(EnFsn* this, GlobalContext* globalCtx) {
this->cutscene = this->lookToShopkeeperCutscene;
this->actor.textId = (this->numSellingItems <= 0) ? 0x29DE : 0x29D6;
}
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
if (ActorCutscene_GetCurrentIndex() == 0x7C) {
ActorCutscene_Stop(0x7C);
}
@@ -1137,7 +1129,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) {
switch (item->canBuyFunc(globalCtx, item)) {
case CANBUY_RESULT_SUCCESS_2:
func_8019F208();
- gSaveContext.weekEventReg[0x21] |= 4;
+ gSaveContext.weekEventReg[33] |= 4;
case CANBUY_RESULT_SUCCESS_1:
if (this->cutsceneState == 2) {
ActorCutscene_Stop(this->cutscene);
@@ -1147,7 +1139,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) {
item = this->items[this->cursorIdx];
item->buyFanfareFunc(globalCtx, item);
Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
this->drawCursor = 0;
@@ -1155,9 +1147,9 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, GlobalContext* globalCtx) {
item = this->items[this->cursorIdx];
item->boughtFunc(globalCtx, item);
if (this->stolenItem1 == this->cursorIdx) {
- gSaveContext.roomInf[126][5] &= ~0xFF000000;
+ gSaveContext.stolenItems &= ~0xFF000000;
} else if (this->stolenItem2 == this->cursorIdx) {
- gSaveContext.roomInf[126][5] &= ~0xFF0000;
+ gSaveContext.stolenItems &= ~0xFF0000;
}
this->numSellingItems--;
this->itemIds[this->cursorIdx] = -1;
@@ -1184,7 +1176,7 @@ void EnFsn_SetupEndInteraction(EnFsn* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.unk120B1 == 0) {
EnFsn_EndInteraction(this, globalCtx);
} else {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
}
} else {
@@ -1240,13 +1232,13 @@ void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) {
case 0:
func_8019F208();
this->actor.textId = 0xFF;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_DeterminePrice;
break;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
func_80151BB4(globalCtx, 3);
break;
}
@@ -1256,7 +1248,7 @@ void EnFsn_AskCanBuyMore(EnFsn* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.unk120B1 == 0) {
EnFsn_EndInteraction(this, globalCtx);
} else {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
}
} else {
@@ -1287,13 +1279,13 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, GlobalContext* globalCtx)
func_8019F208();
this->isSelling = false;
this->actor.textId = 0x29CE;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
this->actionFunc = EnFsn_StartBuying;
break;
case 1:
func_8019F230();
this->actor.textId = (CURRENT_DAY == 3) ? 0x29DF : 0x29D1;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
func_80151BB4(globalCtx, 3);
break;
}
@@ -1303,7 +1295,7 @@ void EnFsn_AskCanBuyAterRunningOutOfItems(EnFsn* this, GlobalContext* globalCtx)
if (globalCtx->msgCtx.unk120B1 == 0) {
EnFsn_EndInteraction(this, globalCtx);
} else {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
}
} else {
@@ -1332,7 +1324,7 @@ void EnFsn_FaceShopkeeperSelling(EnFsn* this, GlobalContext* globalCtx) {
}
} else if (talkState == 5 && func_80147624(globalCtx)) {
this->actor.textId = 0x29D6;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
if (globalCtx) {}
}
}
@@ -1357,12 +1349,12 @@ void EnFsn_ConverseBackroom(EnFsn* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) {
if (this->flags & ENFSN_END_CONVERSATION) {
this->flags &= ~ENFSN_END_CONVERSATION;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = EnFsn_IdleBackroom;
} else if (this->flags & ENFSN_GIVE_ITEM) {
this->flags &= ~ENFSN_GIVE_ITEM;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = EnFsn_GiveItem;
} else {
@@ -1398,14 +1390,15 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable,
+ this->morphTable, 19);
if (ENFSN_IS_SHOP(&this->actor)) {
this->actor.shape.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
EnFsn_GetCutscenes(this);
EnFsn_InitShop(this, globalCtx);
} else {
- if ((gSaveContext.weekEventReg[0x21] & 8) || (gSaveContext.weekEventReg[0x4F] & 0x40)) {
+ if ((gSaveContext.weekEventReg[33] & 8) || (gSaveContext.weekEventReg[79] & 0x40)) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -1413,10 +1406,10 @@ void EnFsn_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->blinkTimer = 20;
this->eyeTextureIdx = 0;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetMode = 0;
this->animationIdx = 0;
- func_8013BC6C(&this->skelAnime, sAnimations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIdx);
this->actionFunc = EnFsn_IdleBackroom;
}
}
@@ -1433,7 +1426,7 @@ void EnFsn_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
Actor_MoveWithGravity(&this->actor);
func_800E9250(globalCtx, &this->actor, &this->headRot, &this->unk27A, this->actor.focus.pos);
- func_8013D9C8(globalCtx, this->limbRotYTable, this->limbRotZTable, 19);
+ SubS_FillLimbRotTables(globalCtx, this->limbRotYTable, this->limbRotZTable, ARRAY_COUNT(this->limbRotYTable));
EnFsn_Blink(this);
if (ENFSN_IS_SHOP(&this->actor) && EnFsn_HasItemsToSell()) {
EnFsn_UpdateJoystickInputState(this, globalCtx);
@@ -1458,8 +1451,8 @@ void EnFsn_DrawCursor(EnFsn* this, GlobalContext* globalCtx, f32 x, f32 y, f32 z
func_8012C654(globalCtx->state.gfxCtx);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b,
this->cursorColor.a);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
w = 16.0f * z;
ulx = (x - w) * 4.0f;
uly = (y - w + -12.0f) * 4.0f;
@@ -1506,7 +1499,7 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) {
if (drawStickRightPrompt || drawStickLeftPrompt) {
func_8012C654(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1527,7 +1520,7 @@ void EnFsn_DrawStickDirectionPrompts(EnFsn* this, GlobalContext* globalCtx) {
this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY,
this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f);
}
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1585,7 +1578,7 @@ s32 EnFsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
if (limbIndex == 17) {
*dList = NULL;
}
- return 0;
+ return false;
}
void EnFsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@@ -1597,14 +1590,14 @@ void EnFsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
this->actor.focus.pos.z = this->actor.world.pos.z;
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_0600F180);
- gSPDisplayList(POLY_OPA_DISP++, D_0600F218);
+ gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F180);
+ gSPDisplayList(POLY_OPA_DISP++, object_fsn_DL_00F218);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
void EnFsn_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static void* sEyeTextures[] = { &D_06005BC0, &D_06006D40, &D_06007140 };
+ static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 };
EnFsn* this = THIS;
s32 pad;
s16 i;
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 c7eebb281b..e2519c7c58 100644
--- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c
+++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c
@@ -10,8 +10,10 @@
#include "overlays/actors/ovl_Bg_Fu_Kaiten/z_bg_fu_kaiten.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "z_en_fu.h"
+#include "objects/object_mu/object_mu.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x0A000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000 | ACTOR_FLAG_8000000)
#define THIS ((EnFu*)thisx)
@@ -54,16 +56,6 @@ void func_80964694(EnFu* this, EnFuUnkStruct* ptr, Vec3f* arg2, s32 len);
void func_809647EC(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len);
void func_80964950(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len);
-extern AnimationHeader D_06001F74;
-extern AnimationHeader D_06002F64;
-extern AnimationHeader D_06004904;
-extern AnimationHeader D_06005304;
-extern AnimationHeader D_060053E0;
-extern Gfx D_0600B0A0[];
-extern Gfx D_0600B0E0[];
-extern FlexSkeletonHeader D_0600B2B0;
-extern AnimationHeader D_0600BAC4;
-
const ActorInit En_Fu_InitVars = {
ACTOR_EN_FU,
ACTORCAT_NPC,
@@ -82,11 +74,14 @@ static Vec3f D_80964B0C = { 0.0f, 60.0f, -8.0f };
static Vec3f D_80964B18 = { 0.0f, 55.0f, 12.0f };
static Vec3f D_80964B24 = { 0.0f, 60.0f, 0.0f };
-static ActorAnimationEntry sAnimations[] = {
- { &D_060053E0, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06001F74, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &D_06002F64, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06004904, 1.0f, 0.0f, 0.0f, 0, 0.0f },
- { &D_06005304, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06005304, 1.0f, 0.0f, 0.0f, 0, 0.0f },
- { &D_0600BAC4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_mu_Anim_0053E0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_mu_Anim_001F74, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_mu_Anim_002F64, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_mu_Anim_004904, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &object_mu_Anim_005304, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_mu_Anim_00BAC4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
};
static ColliderCylinderInit sCylinderInit = {
@@ -200,13 +195,13 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) {
if (fuKaiten != NULL) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B2B0, &D_06001F74, this->jointTable, this->morphTable,
- 21);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_mu_Skel_00B2B0, &object_mu_Anim_001F74,
+ this->jointTable, this->morphTable, 21);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.gravity = -0.2f;
this->actor.shape.rot.y += 0x4000;
this->actor.world.rot = this->actor.shape.rot;
@@ -235,8 +230,8 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnFu* this = THIS;
- gSaveContext.weekEventReg[63] &= (u8)~0x1;
- gSaveContext.weekEventReg[8] &= (u8)~0x1;
+ gSaveContext.weekEventReg[63] &= (u8)~1;
+ gSaveContext.weekEventReg[8] &= (u8)~1;
Collider_DestroyCylinder(globalCtx, &this->collider);
}
@@ -377,7 +372,7 @@ void func_8096209C(EnFu* this, GlobalContext* globalCtx) {
}
void func_809622FC(EnFu* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80962340;
}
@@ -385,40 +380,40 @@ void func_80962340(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (this->unk_54A == 2) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (this->unk_54A == 2) {
if (this->unk_552 == 0x287D) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
- func_801518B0(globalCtx, 0x287E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x287E, &this->actor);
this->unk_552 = 0x287E;
} else if ((CURRENT_DAY == 3) && (gSaveContext.weekEventReg[22] & 0x10) &&
(gSaveContext.weekEventReg[22] & 0x20)) {
if ((gSaveContext.weekEventReg[22] & 0x40)) {
- func_801518B0(globalCtx, 0x2883, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2883, &this->actor);
this->unk_552 = 0x2883;
} else {
- func_801518B0(globalCtx, 0x2880, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2880, &this->actor);
this->unk_552 = 0x2880;
}
} else {
- func_801518B0(globalCtx, 0x287E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x287E, &this->actor);
this->unk_552 = 0x287E;
}
} else if ((gSaveContext.unk_3DE0[4] == 0) && (this->unk_552 != 0x2888)) {
- func_801518B0(globalCtx, 0x2886, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2886, &this->actor);
this->unk_552 = 0x2886;
} else {
- func_801518B0(globalCtx, 0x2889, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2889, &this->actor);
this->unk_552 = 0x2889;
}
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
player->stateFlags1 &= ~0x20;
this->unk_54A = 1;
} else {
- func_801518B0(globalCtx, 0x283C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x283C, &this->actor);
this->unk_552 = 0x283C;
}
func_809628BC(this);
@@ -440,12 +435,12 @@ void func_80962588(EnFu* this, GlobalContext* globalCtx) {
func_80963DE4(this, globalCtx);
} else {
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0x2873, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2873, &this->actor);
this->unk_552 = 0x2873;
}
} else {
func_8019F230();
- func_801518B0(globalCtx, 0x2872, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2872, &this->actor);
this->unk_552 = 0x2872;
}
}
@@ -473,7 +468,7 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) {
break;
case 0x2846:
- func_801518B0(globalCtx, 0x2849, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2849, &this->actor);
this->unk_552 = 0x2849;
break;
@@ -524,7 +519,7 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) {
case 0x286A:
case 0x286C:
case 0x286E:
- func_801518B0(globalCtx, 0x2871, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2871, &this->actor);
this->unk_552 = 0x2871;
break;
@@ -532,17 +527,17 @@ void func_80962660(EnFu* this, GlobalContext* globalCtx) {
case 0x2878:
case 0x287A:
case 0x287C:
- func_801518B0(globalCtx, 0x287D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x287D, &this->actor);
this->unk_552 = 0x287D;
break;
case 0x287D:
- gSaveContext.weekEventReg[63] |= 0x1;
- gSaveContext.weekEventReg[63] &= (u8)~0x2;
+ gSaveContext.weekEventReg[63] |= 1;
+ gSaveContext.weekEventReg[63] &= (u8)~2;
func_801477B4(globalCtx);
player->stateFlags1 |= 0x20;
this->unk_53C = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
func_801A2BB8(NA_BGM_MINI_GAME_2);
if (this->unk_542 == 0) {
if (this->unk_546 == 1) {
@@ -610,8 +605,8 @@ void func_809628D0(EnFu* this, GlobalContext* globalCtx) {
case 0x2884:
case 0x2887:
case 0x288A:
- gSaveContext.weekEventReg[63] &= (u8)~0x1;
- gSaveContext.weekEventReg[63] &= (u8)~0x2;
+ gSaveContext.weekEventReg[63] &= (u8)~1;
+ gSaveContext.weekEventReg[63] &= (u8)~2;
func_809622FC(this);
break;
@@ -641,10 +636,10 @@ void func_80962A10(EnFu* this, GlobalContext* globalCtx) {
BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child;
this->unk_53C = 0;
- if ((fuKaiten->rotationSpeed < 300) || (fuKaiten->bouceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) {
+ if ((fuKaiten->rotationSpeed < 300) || (fuKaiten->bounceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) {
Math_SmoothStepToS(&fuKaiten->rotationSpeed, 300, 10, 5, 5);
Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10);
- Math_SmoothStepToF(&fuKaiten->bouceHeight, 40.0f, 0.1f, 1.0f, 1.0f);
+ Math_SmoothStepToF(&fuKaiten->bounceHeight, 40.0f, 0.1f, 1.0f, 1.0f);
return;
}
@@ -678,11 +673,11 @@ void func_80962BCC(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child;
- if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bouceHeight < 30.0f) || (fuKaiten->bounceSpeed < 600)) {
+ if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bounceHeight < 30.0f) || (fuKaiten->bounceSpeed < 600)) {
Math_SmoothStepToS(&fuKaiten->rotationSpeed, 100, 10, 5, 5);
Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10);
Math_SmoothStepToF(&fuKaiten->elevation, 10.0f, 0.1f, 1.0f, 1.0f);
- Math_SmoothStepToF(&fuKaiten->bouceHeight, 30.0f, 0.1f, 1.0f, 1.0f);
+ Math_SmoothStepToF(&fuKaiten->bounceHeight, 30.0f, 0.1f, 1.0f, 1.0f);
return;
}
@@ -710,10 +705,10 @@ void func_80962D60(EnFu* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
BgFuKaiten* fuKaiten = (BgFuKaiten*)this->actor.child;
- if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bouceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) {
+ if ((fuKaiten->rotationSpeed < 100) || (fuKaiten->bounceHeight < 40.0f) || (fuKaiten->bounceSpeed < 600)) {
Math_SmoothStepToS(&fuKaiten->rotationSpeed, 100, 10, 5, 5);
Math_SmoothStepToS(&fuKaiten->bounceSpeed, 600, 20, 10, 10);
- Math_SmoothStepToF(&fuKaiten->bouceHeight, 40.0f, 0.1f, 1.0f, 1.0f);
+ Math_SmoothStepToF(&fuKaiten->bounceHeight, 40.0f, 0.1f, 1.0f, 1.0f);
return;
}
@@ -735,14 +730,15 @@ void func_80962D60(EnFu* this, GlobalContext* globalCtx) {
void func_80962EBC(EnFu* this, GlobalContext* globalCtx) {
if (this->unk_542 != 0) {
if (this->actor.cutscene != -1) {
- func_800DFB14(globalCtx->cameraPtrs[MAIN_CAM], ActorCutscene_GetCutscene(this->actor.cutscene)->unk4);
+ Camera_ChangeDataIdx(globalCtx->cameraPtrs[CAM_ID_MAIN],
+ ActorCutscene_GetCutscene(this->actor.cutscene)->csCamSceneDataId);
}
}
}
void func_80962F10(EnFu* this) {
this->unk_548 = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
gSaveContext.weekEventReg[8] |= 1;
this->actionFunc = func_80962F4C;
}
@@ -778,7 +774,7 @@ void func_80962F4C(EnFu* this, GlobalContext* globalCtx) {
}
if (func_80961D10(this)) {
- func_801518B0(globalCtx, 0x288B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x288B, &this->actor);
}
if ((!DynaPolyActor_IsInRidingRotatingState((DynaPolyActor*)this->actor.child) &&
@@ -789,10 +785,10 @@ void func_80962F4C(EnFu* this, GlobalContext* globalCtx) {
player->stateFlags1 |= 0x20;
if (this->unk_548 < this->unk_54C) {
if (gSaveContext.unk_3DE0[4] == 0) {
- func_801518B0(globalCtx, 0x2885, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2885, &this->actor);
this->unk_552 = 0x2885;
} else {
- func_801518B0(globalCtx, 0x2888, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2888, &this->actor);
this->unk_552 = 0x2888;
}
func_801A2C20();
@@ -830,7 +826,7 @@ void func_809632D0(EnFu* this) {
Interface_ChangeAlpha(50);
}
- gSaveContext.weekEventReg[8] &= (u8)~0x1;
+ gSaveContext.weekEventReg[8] &= (u8)~1;
if (this->unk_2D4 != NULL) {
BgFuMizu* mizu = this->unk_2D4;
@@ -838,7 +834,7 @@ void func_809632D0(EnFu* this) {
mizu->unk_160 = 0;
}
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = func_80963350;
}
@@ -858,11 +854,11 @@ void func_80963350(EnFu* this, GlobalContext* globalCtx) {
D_80964C24 = 1;
}
- if ((fuKaiten->rotationSpeed != 0) || (fuKaiten->bounceSpeed != 0) || (fuKaiten->bouceHeight > 0.0f) ||
+ if ((fuKaiten->rotationSpeed != 0) || (fuKaiten->bounceSpeed != 0) || (fuKaiten->bounceHeight > 0.0f) ||
!func_809638F8(globalCtx)) {
Math_SmoothStepToS(&fuKaiten->rotationSpeed, 0, 10, 10, 5);
Math_SmoothStepToS(&fuKaiten->bounceSpeed, 0, 10, 15, 5);
- Math_SmoothStepToF(&fuKaiten->bouceHeight, 0.0f, 0.1f, 1.0f, 1.0f);
+ Math_SmoothStepToF(&fuKaiten->bounceHeight, 0.0f, 0.1f, 1.0f, 1.0f);
Math_SmoothStepToF(&fuKaiten->elevation, 0.0f, 0.1f, 1.0f, 1.0f);
func_80962EBC(this, globalCtx);
} else if (D_80964C24 == 1) {
@@ -903,22 +899,22 @@ void func_80963630(EnFu* this, GlobalContext* globalCtx) {
if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20) && (CURRENT_DAY == 3) &&
(gSaveContext.playerForm == PLAYER_FORM_HUMAN)) {
if (gSaveContext.weekEventReg[22] & 0x40) {
- func_801518B0(globalCtx, 0x2884, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2884, &this->actor);
this->unk_552 = 0x2884;
} else if (!(gSaveContext.weekEventReg[22] & 0x80)) {
gSaveContext.weekEventReg[22] |= 0x80;
- func_801518B0(globalCtx, 0x2882, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2882, &this->actor);
this->unk_552 = 0x2882;
} else {
- func_801518B0(globalCtx, 0x2881, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2881, &this->actor);
this->unk_552 = 0x2881;
}
} else {
- func_801518B0(globalCtx, 0x287F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x287F, &this->actor);
this->unk_552 = 0x287F;
}
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.child->freezeTimer = 0;
func_809628BC(this);
@@ -973,46 +969,46 @@ s32 func_80963810(GlobalContext* globalCtx, Vec3f pos) {
s32 func_809638F8(GlobalContext* globalCtx) {
s32 ret = true;
- if (globalCtx->envCtx.unk_8C.diffuseColor1[0] > 25) {
- globalCtx->envCtx.unk_8C.diffuseColor1[0] -= 25;
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[0] > 25) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.diffuseColor1[0] = 0;
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] = 0;
}
- if (globalCtx->envCtx.unk_8C.diffuseColor1[1] > 25) {
- globalCtx->envCtx.unk_8C.diffuseColor1[1] -= 25;
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[1] > 25) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.diffuseColor1[1] = 0;
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] = 0;
}
- if (globalCtx->envCtx.unk_8C.diffuseColor1[2] > 25) {
- globalCtx->envCtx.unk_8C.diffuseColor1[2] -= 25;
+ if (globalCtx->envCtx.lightSettings.diffuseColor1[2] > 25) {
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.diffuseColor1[2] = 0;
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] = 0;
}
- if (globalCtx->envCtx.unk_8C.ambientColor[0] > 25) {
- globalCtx->envCtx.unk_8C.ambientColor[0] -= 25;
+ if (globalCtx->envCtx.lightSettings.ambientColor[0] > 25) {
+ globalCtx->envCtx.lightSettings.ambientColor[0] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.ambientColor[0] = 0;
+ globalCtx->envCtx.lightSettings.ambientColor[0] = 0;
}
- if (globalCtx->envCtx.unk_8C.ambientColor[1] > 25) {
- globalCtx->envCtx.unk_8C.ambientColor[1] -= 25;
+ if (globalCtx->envCtx.lightSettings.ambientColor[1] > 25) {
+ globalCtx->envCtx.lightSettings.ambientColor[1] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.ambientColor[1] = 0;
+ globalCtx->envCtx.lightSettings.ambientColor[1] = 0;
}
- if (globalCtx->envCtx.unk_8C.ambientColor[2] > 25) {
- globalCtx->envCtx.unk_8C.ambientColor[2] -= 25;
+ if (globalCtx->envCtx.lightSettings.ambientColor[2] > 25) {
+ globalCtx->envCtx.lightSettings.ambientColor[2] -= 25;
ret = false;
} else {
- globalCtx->envCtx.unk_8C.ambientColor[2] = 0;
+ globalCtx->envCtx.lightSettings.ambientColor[2] = 0;
}
return ret;
}
@@ -1022,50 +1018,50 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
case 1:
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
- func_801518B0(globalCtx, 0x2853, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2853, &this->actor);
this->unk_552 = 0x2853;
} else if (gSaveContext.weekEventReg[22] & 0x10) {
- func_801518B0(globalCtx, 0x284D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x284D, &this->actor);
this->unk_552 = 0x284D;
} else if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x284F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x284F, &this->actor);
this->unk_552 = 0x284F;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x2851, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2851, &this->actor);
this->unk_552 = 0x2851;
}
} else {
- func_801518B0(globalCtx, 0x286F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x286F, &this->actor);
this->unk_552 = 0x286F;
}
break;
case 2:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
- func_801518B0(globalCtx, 0x286F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x286F, &this->actor);
this->unk_552 = 0x286F;
} else if (CUR_UPG_VALUE(UPG_BOMB_BAG) == 0) {
- func_801518B0(globalCtx, 0x2853, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2853, &this->actor);
this->unk_552 = 0x2853;
} else if (!(gSaveContext.weekEventReg[22] & 0x10)) {
if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x285B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x285B, &this->actor);
this->unk_552 = 0x285B;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x285D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x285D, &this->actor);
this->unk_552 = 0x285D;
}
} else if (gSaveContext.weekEventReg[22] & 0x20) {
- func_801518B0(globalCtx, 0x2855, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2855, &this->actor);
this->unk_552 = 0x2855;
} else if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x2857, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2857, &this->actor);
this->unk_552 = 0x2857;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x2859, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2859, &this->actor);
this->unk_552 = 0x2859;
}
break;
@@ -1075,44 +1071,44 @@ void func_809639D0(EnFu* this, GlobalContext* globalCtx) {
if (gSaveContext.playerForm == PLAYER_FORM_DEKU) {
func_80963EAC(this, globalCtx);
} else {
- func_801518B0(globalCtx, 0x2841, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2841, &this->actor);
this->unk_552 = 0x2841;
}
} else if (CUR_UPG_VALUE(UPG_QUIVER) == 0) {
- func_801518B0(globalCtx, 0x284B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x284B, &this->actor);
this->unk_552 = 0x284B;
} else if (gSaveContext.weekEventReg[22] & 0x40) {
if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20)) {
- func_801518B0(globalCtx, 0x285F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x285F, &this->actor);
this->unk_552 = 0x285F;
} else {
- func_801518B0(globalCtx, 0x2861, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2861, &this->actor);
this->unk_552 = 0x2861;
}
} else if ((gSaveContext.weekEventReg[22] & 0x10) && (gSaveContext.weekEventReg[22] & 0x20)) {
if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x2863, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2863, &this->actor);
this->unk_552 = 0x2863;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x2865, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2865, &this->actor);
this->unk_552 = 0x2865;
}
} else if ((gSaveContext.weekEventReg[22] & 0x10) || (gSaveContext.weekEventReg[22] & 0x20)) {
if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x2867, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2867, &this->actor);
this->unk_552 = 0x2867;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x2869, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2869, &this->actor);
this->unk_552 = 0x2869;
}
} else if (this->unk_53E == 1) {
- func_801518B0(globalCtx, 0x286B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x286B, &this->actor);
this->unk_552 = 0x286B;
} else {
this->unk_53E = 1;
- func_801518B0(globalCtx, 0x286D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x286D, &this->actor);
this->unk_552 = 0x286D;
}
break;
@@ -1123,21 +1119,21 @@ void func_80963DE4(EnFu* this, GlobalContext* globalCtx) {
switch (this->unk_542) {
case 0:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
- func_801518B0(globalCtx, 0x2875, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2875, &this->actor);
this->unk_552 = 0x2875;
} else {
- func_801518B0(globalCtx, 0x2877, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2877, &this->actor);
this->unk_552 = 0x2877;
}
break;
case 1:
- func_801518B0(globalCtx, 0x2879, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2879, &this->actor);
this->unk_552 = 0x2879;
break;
case 2:
- func_801518B0(globalCtx, 0x287B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x287B, &this->actor);
this->unk_552 = 0x287B;
break;
}
@@ -1146,15 +1142,15 @@ void func_80963DE4(EnFu* this, GlobalContext* globalCtx) {
void func_80963EAC(EnFu* this, GlobalContext* globalCtx) {
if (gSaveContext.magicAcquired) {
if (this->unk_540 == 1) {
- func_801518B0(globalCtx, 0x2847, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2847, &this->actor);
this->unk_552 = 0x2847;
} else {
this->unk_540 = 1;
- func_801518B0(globalCtx, 0x2845, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2845, &this->actor);
this->unk_552 = 0x2845;
}
} else {
- func_801518B0(globalCtx, 0x2843, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2843, &this->actor);
this->unk_552 = 0x2843;
}
}
@@ -1162,17 +1158,17 @@ void func_80963EAC(EnFu* this, GlobalContext* globalCtx) {
void func_80963F44(EnFu* this, GlobalContext* globalCtx) {
u16 sp1E = this->unk_552 + 1;
- func_801518B0(globalCtx, sp1E, &this->actor);
+ Message_StartTextbox(globalCtx, sp1E, &this->actor);
this->unk_552 = sp1E;
}
void func_80963F88(EnFu* this, GlobalContext* globalCtx) {
if (this->unk_542 == 1) {
- func_800DFAC8(globalCtx->cameraPtrs[MAIN_CAM], 75);
+ func_800DFAC8(globalCtx->cameraPtrs[CAM_ID_MAIN], 75);
globalCtx->unk_1887E = 0;
} else if (this->unk_542 == 2) {
globalCtx->unk_1887D = 0;
- func_800DFAC8(globalCtx->cameraPtrs[MAIN_CAM], 75);
+ func_800DFAC8(globalCtx->cameraPtrs[CAM_ID_MAIN], 75);
}
}
@@ -1219,7 +1215,7 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) {
case 0x2842:
case 0x2844:
case 0x2848:
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
break;
case 0x2840:
@@ -1245,21 +1241,21 @@ void func_80964190(EnFu* this, GlobalContext* globalCtx) {
case 0x286B:
case 0x286D:
case 0x2871:
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
break;
case 0x2860:
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
break;
case 0x285F:
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
break;
case 0x287E:
case 0x2880:
case 0x2883:
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
break;
}
}
@@ -1426,7 +1422,7 @@ void func_80964694(EnFu* this, EnFuUnkStruct* ptr, Vec3f* arg2, s32 len) {
void func_809647EC(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) {
Vec3f sp44 = { 0.0f, 0.0f, 0.0f };
- s16 activeCam = func_800DFC68(GET_ACTIVE_CAM(globalCtx));
+ s16 yaw = Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx));
s32 i;
for (i = 0; i < len; i++, ptr++) {
@@ -1439,7 +1435,7 @@ void func_809647EC(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) {
ptr->unk_08.z += 2.0f * Math_CosS(ptr->unk_2C);
Matrix_StatePush();
Matrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
- Matrix_RotateY(activeCam, MTXMODE_APPLY);
+ Matrix_RotateY(yaw, MTXMODE_APPLY);
Matrix_MultiplyVector3fByState(&sp44, &ptr->unk_08);
Matrix_StatePop();
ptr->unk_2C += 6000;
@@ -1459,17 +1455,17 @@ void func_80964950(GlobalContext* globalCtx, EnFuUnkStruct* ptr, s32 len) {
for (i = 0; i < len; i++, ptr++) {
if (ptr->unk_36 == 1) {
if (!flag) {
- gSPDisplayList(POLY_OPA_DISP++, D_0600B0A0);
+ gSPDisplayList(POLY_OPA_DISP++, object_mu_DL_00B0A0);
flag = true;
}
Matrix_InsertTranslation(ptr->unk_08.x, ptr->unk_08.y, ptr->unk_08.z, MTXMODE_NEW);
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
Matrix_Scale(ptr->unk_00, ptr->unk_00, ptr->unk_00, MTXMODE_APPLY);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_0405E6F0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_0600B0E0);
+ gSPDisplayList(POLY_OPA_DISP++, object_mu_DL_00B0E0);
}
}
diff --git a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c
index ec03de6958..3cc50bbec7 100644
--- a/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c
+++ b/src/overlays/actors/ovl_En_Fu_Kago/z_en_fu_kago.c
@@ -6,7 +6,7 @@
#include "z_en_fu_kago.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnFuKago*)thisx)
diff --git a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c
index 400bd6d673..fb4fc2a450 100644
--- a/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c
+++ b/src/overlays/actors/ovl_En_Fu_Mato/z_en_fu_mato.c
@@ -6,7 +6,7 @@
#include "z_en_fu_mato.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnFuMato*)thisx)
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 1efcd42e7e..8bd7e128bf 100644
--- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c
+++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c
@@ -9,7 +9,7 @@
#include "objects/object_fz/object_fz.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnFz*)thisx)
@@ -180,7 +180,7 @@ void EnFz_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_BC8 = 0;
this->unk_BCF = 0;
this->unk_BCC = 1;
@@ -472,7 +472,7 @@ void func_80933014(EnFz* this) {
void func_809330D4(EnFz* this) {
this->unk_BD6 = 2;
this->unk_BCE = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_80933104;
}
@@ -543,7 +543,7 @@ void func_80933324(EnFz* this) {
this->unk_BCA = 40;
this->unk_BCC = 1;
this->unk_BCE = 1;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.gravity = -1.0f;
this->actionFunc = func_80933368;
}
@@ -619,7 +619,7 @@ void func_809334B8(EnFz* this, GlobalContext* globalCtx) {
sp58.y = this->actor.world.pos.y + 20.0f;
sp58.z = this->actor.world.pos.z;
- Matrix_RotateY(this->actor.shape.rot.y, 0);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
sp64.x = 0.0f;
sp64.y = -2.0f;
@@ -653,7 +653,7 @@ void func_809336C0(EnFz* this, GlobalContext* globalCtx) {
this->unk_BCC = 1;
this->unk_BCE = 0;
this->unk_BD8 = 1;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_BD7 = 0;
this->unk_BCA = 60;
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP);
@@ -671,7 +671,7 @@ void func_80933790(EnFz* this) {
this->unk_BD6 = 3;
this->unk_BCE = 0;
this->unk_BD8 = 1;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
this->unk_BBC = 0.0f;
this->actionFunc = func_809337D4;
@@ -702,7 +702,7 @@ void func_8093389C(EnFz* this) {
this->unk_BCA = 40;
this->unk_BCC = 1;
this->unk_BCE = 1;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.gravity = -1.0f;
this->actionFunc = func_809338E0;
}
@@ -736,7 +736,7 @@ void func_809338E0(EnFz* this, GlobalContext* globalCtx) {
sp58.y = this->actor.world.pos.y + 20.0f;
sp58.z = this->actor.world.pos.z;
- Matrix_RotateY(this->actor.shape.rot.y, 0);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
sp64.x = 0.0f;
sp64.y = -2.0f;
@@ -763,7 +763,7 @@ void func_80933AF4(EnFz* this) {
this->unk_BCA = 40;
this->unk_BCC = 1;
this->unk_BCE = 1;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.gravity = -1.0f;
this->actionFunc = func_80933B38;
}
diff --git a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c
index c5f6631087..024c857ea5 100644
--- a/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c
+++ b/src/overlays/actors/ovl_En_Gakufu/z_en_gakufu.c
@@ -6,7 +6,7 @@
#include "z_en_gakufu.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnGakufu*)thisx)
diff --git a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c
index a27c5bdc4c..16547c1128 100644
--- a/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c
+++ b/src/overlays/actors/ovl_En_Gamelupy/z_en_gamelupy.c
@@ -6,7 +6,7 @@
#include "z_en_gamelupy.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnGamelupy*)thisx)
diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c
index 90880e2618..4427bd3b19 100644
--- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c
+++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c
@@ -7,7 +7,7 @@
#include "z_en_gb2.h"
#include "objects/object_ps/object_ps.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnGb2*)thisx)
@@ -370,15 +370,15 @@ void func_80B0FE7C(GlobalContext* globalCtx) {
}
void func_80B0FEBC(EnGb2* this, GlobalContext* globalCtx) {
- if ((globalCtx->msgCtx.unk1202A == 3) && (globalCtx->msgCtx.unk1202E == 7)) {
- globalCtx->msgCtx.unk1202A = 4;
+ if ((globalCtx->msgCtx.ocarinaMode == 3) && (globalCtx->msgCtx.unk1202E == 7)) {
+ globalCtx->msgCtx.ocarinaMode = 4;
gSaveContext.eventInf[4] |= 0x80;
this->unk_26E = 0x14D1;
this->unk_288 = 10;
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
this->actionFunc = func_80B0FFA8;
} else if ((this->actor.xzDistToPlayer < 300.0f) || this->actor.isTargeted) {
func_800B863C(&this->actor, globalCtx);
@@ -391,7 +391,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
if (temp_v0 == 5) {
if (func_80147624(globalCtx)) {
if (this->unk_26C & 2) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_26E = 0x14D1;
this->unk_288 = 30;
@@ -400,7 +400,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
this->actionFunc = func_80B0FEBC;
} else {
this->unk_26E = func_80B0F7FC(this);
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
}
}
} else if ((temp_v0 == 4) && func_80147624(globalCtx)) {
@@ -411,11 +411,11 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
play_sound(NA_SE_SY_ERROR);
this->unk_26E = 0x14D7;
this->unk_26C |= 2;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
} else {
func_8019F208();
this->unk_26E = 0x14D8;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
}
break;
@@ -423,7 +423,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
func_8019F230();
this->unk_26E = 0x14D6;
this->unk_26C |= 2;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
break;
}
} else if (this->unk_26E == 0x14DA) {
@@ -431,7 +431,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
case 0:
func_8019F208();
func_801159EC(-this->unk_288);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
func_800B7298(globalCtx, NULL, 7);
this->actionFunc = func_80B11344;
@@ -441,7 +441,7 @@ void func_80B0FFA8(EnGb2* this, GlobalContext* globalCtx) {
func_8019F230();
this->unk_26E = 0x14DB;
this->unk_26C |= 2;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
break;
}
}
@@ -538,11 +538,11 @@ void func_80B10344(EnGb2* this, GlobalContext* globalCtx) {
void func_80B10584(EnGb2* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
- this->actor.flags &= ~0x10000;
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = func_80B10634;
} else if (this->actor.xzDistToPlayer < 300.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 300.0f);
}
}
@@ -553,7 +553,7 @@ void func_80B10634(EnGb2* this, GlobalContext* globalCtx) {
if (temp_v0 == 5) {
if (func_80147624(globalCtx)) {
if (this->unk_26C & 2) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_26C &= ~2;
if (this->unk_26E == 0x14DD) {
@@ -569,7 +569,7 @@ void func_80B10634(EnGb2* this, GlobalContext* globalCtx) {
}
} else {
this->unk_26E = func_80B0F8F8(this);
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
}
}
} else if ((temp_v0 == 4) && func_80147624(globalCtx)) {
@@ -579,11 +579,11 @@ void func_80B10634(EnGb2* this, GlobalContext* globalCtx) {
play_sound(NA_SE_SY_ERROR);
this->unk_26E = 0x14D7;
this->unk_26C |= 2;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
} else {
func_8019F208();
func_801159EC(-this->unk_288);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
func_800B7298(globalCtx, NULL, 7);
this->actionFunc = func_80B11344;
@@ -594,7 +594,7 @@ void func_80B10634(EnGb2* this, GlobalContext* globalCtx) {
func_8019F230();
this->unk_26E = 0x14E3;
this->unk_26C |= 2;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
break;
}
}
@@ -638,7 +638,7 @@ void func_80B10924(EnGb2* this, GlobalContext* globalCtx) {
void func_80B109DC(EnGb2* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
this->actionFunc = func_80B10634;
} else {
func_800B85E0(&this->actor, globalCtx, 300.0f, -1);
@@ -668,7 +668,7 @@ void func_80B10A48(EnGb2* this, GlobalContext* globalCtx) {
} else {
this->actor.draw = NULL;
this->unk_26C |= 0x100;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_80B111AC;
}
break;
@@ -692,7 +692,7 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) {
if ((this->unk_26E == 0x14EE) || (this->unk_26E == 0x14F4)) {
this->unk_26C |= 2;
}
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
this->unk_290 = 1;
this->unk_26C &= ~0x40;
this->actionFunc = func_80B10DAC;
@@ -703,8 +703,8 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) {
} else {
this->unk_26C &= ~0x40;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_26C & 0x20)) {
- this->actor.flags &= ~0x10000;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
if (this->unk_26E == 0x14EB) {
gSaveContext.weekEventReg[80] |= 0x40;
} else if (this->unk_26E == 0x14EF) {
@@ -716,7 +716,7 @@ void func_80B10B5C(EnGb2* this, GlobalContext* globalCtx) {
this->actionFunc = func_80B10DAC;
} else if (this->actor.xzDistToPlayer < 300.0f) {
if (!(this->unk_26C & 0x80)) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->unk_26C |= 0x20;
func_800B8614(&this->actor, globalCtx, 300.0f);
}
@@ -749,7 +749,7 @@ void func_80B10E98(EnGb2* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
if (this->unk_26C & 2) {
this->unk_26C &= ~2;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
if ((this->unk_26E != 0x14E8) && (this->unk_26E != 0x14EA)) {
ActorCutscene_Stop(this->unk_282[this->unk_290]);
@@ -766,7 +766,7 @@ void func_80B10E98(EnGb2* this, GlobalContext* globalCtx) {
s32 temp;
this->unk_26E = func_80B0FB24(this);
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
temp = this->unk_26E;
if ((temp == 0x14E7) || (temp == 0x14E9) || (temp == 0x14EC) || (temp == 0x14F0)) {
ActorCutscene_Stop(this->unk_282[this->unk_290]);
@@ -780,11 +780,11 @@ void func_80B10E98(EnGb2* this, GlobalContext* globalCtx) {
void func_80B11048(EnGb2* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
this->actionFunc = func_80B10DAC;
} else if (this->actor.xzDistToPlayer < 300.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 200.0f);
}
}
@@ -792,13 +792,13 @@ void func_80B11048(EnGb2* this, GlobalContext* globalCtx) {
void func_80B110F8(EnGb2* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
if (this->unk_26C & 2) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_26C &= ~2;
this->actionFunc = func_80B10A48;
} else {
this->unk_26E = func_80B0F97C(this);
- func_801518B0(globalCtx, this->unk_26E, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_26E, &this->actor);
}
}
}
@@ -844,7 +844,7 @@ void func_80B11268(EnGb2* this, GlobalContext* globalCtx) {
Flags_GetClear(globalCtx, 5)) {
this->unk_28A = 0xFF;
this->unk_26C &= ~0x100;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.draw = EnGb2_Draw;
this->unk_26E = 0x14F9;
this->actionFunc = func_80B11048;
@@ -898,8 +898,8 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->unk_28A = 255;
- this->actor.flags |= 0x10;
- this->actor.flags |= 0x2000000;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.flags |= ACTOR_FLAG_2000000;
if (gSaveContext.eventInf[4] & 0x40) {
func_80B0F728(this, globalCtx);
@@ -943,7 +943,7 @@ void EnGb2_Init(Actor* thisx, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[76] & 0x80) {
this->actor.draw = NULL;
this->unk_26C |= 0x100;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_80B111AC;
} else {
this->unk_28A = 255;
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 2f3209e975..935eacb8c5 100644
--- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
+++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
@@ -6,7 +6,7 @@
#include "z_en_ge1.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnGe1*)thisx)
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 d511788abc..b8522c2c62 100644
--- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
+++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
@@ -6,7 +6,7 @@
#include "z_en_ge2.h"
-#define FLAGS 0x80000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80000000)
#define THIS ((EnGe2*)thisx)
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 7c0bcd71fc..593c57a5ab 100644
--- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c
+++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c
@@ -6,7 +6,7 @@
#include "z_en_ge3.h"
-#define FLAGS 0x80000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
#define THIS ((EnGe3*)thisx)
diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c
index 4209efe3fe..60c5ebdb68 100644
--- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c
+++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c
@@ -11,7 +11,7 @@
#include "objects/object_hakugin_demo/object_hakugin_demo.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnGeg*)thisx)
@@ -125,18 +125,28 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, -4 },
- { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, -4 },
- { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, -4 }, { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, 0 },
- { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, 2, -4 },
- { &object_taisou_Anim_0016C8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_004DD4, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_00283C, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_007764, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_005EE0, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_002C48, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_0031D8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_005790, 1.0f, 0, -1, 0, 0 },
- { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, 0, 0 }, { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, 2, 0 },
- { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, 2, 0 },
- { &object_oF1d_map_Anim_014CE0, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_taisou_Anim_0016C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_004DD4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_00283C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_007764, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_005EE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_002C48, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_0031D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_005790, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_oF1d_map_Anim_014CE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
u16 func_80BB16D0(EnGeg* this) {
@@ -277,7 +287,7 @@ u8 func_80BB1B14(EnGeg* this, GlobalContext* globalCtx) {
return 0;
}
- if (((EnBom*)explosive)->unk_1F9 == 0) {
+ if (((EnBom*)explosive)->isPowderKeg == 0) {
return 2;
}
@@ -368,7 +378,7 @@ void func_80BB1FCC(EnGeg* this, GlobalContext* globalCtx) {
void func_80BB2020(EnGeg* this, GlobalContext* globalCtx) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[this->unk_248].segment);
- func_8013BC6C(&this->skelAnime, sAnimations, this->unk_4AC);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->unk_4AC);
}
s32 func_80BB2088(EnGeg* this, GlobalContext* globalCtx) {
@@ -432,12 +442,12 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) {
this->unk_49A = this->unk_49C[2];
this->unk_230 &= ~4;
}
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
this->actionFunc = func_80BB2520;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
} else if (this->actor.xzDistToPlayer < 300.0f) {
this->unk_230 |= 4;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 300.0f);
}
} else {
@@ -445,7 +455,7 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[35] & 0x40) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) && (this->unk_230 & 8)) {
this->unk_496 = 0xD62;
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
this->unk_230 &= ~8;
this->actionFunc = func_80BB27D4;
} else if ((this->actor.xzDistToPlayer < 300.0f) && this->actor.isTargeted) {
@@ -456,12 +466,12 @@ void func_80BB221C(EnGeg* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[35] |= 0x40;
this->unk_496 = 0xD5E;
this->unk_49A = this->unk_49C[0];
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
this->actionFunc = func_80BB2520;
this->unk_230 &= ~8;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
} else if (this->actor.xzDistToPlayer < 300.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 300.0f);
this->unk_230 |= 8;
}
@@ -541,7 +551,7 @@ void func_80BB26EC(EnGeg* this, GlobalContext* globalCtx) {
case 0xD61:
ActorCutscene_Stop(this->unk_498);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_230 &= ~0x10;
this->actionFunc = func_80BB221C;
@@ -549,7 +559,7 @@ void func_80BB26EC(EnGeg* this, GlobalContext* globalCtx) {
}
this->unk_496 = func_80BB16D0(this);
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
}
}
@@ -557,14 +567,14 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
switch (this->unk_496) {
case 0xD63:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80BB221C;
break;
case 0xD69:
this->unk_49A = this->unk_49C[6];
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80BB2520;
break;
@@ -572,7 +582,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) {
case 0xD6D:
case 0xD6F:
case 0xD8A:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80BB31B8;
break;
@@ -580,7 +590,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) {
case 0xD72:
case 0xD75:
case 0xD8B:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_230 &= ~0x10;
this->unk_49A = this->unk_49C[7];
@@ -589,7 +599,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) {
default:
this->unk_496 = func_80BB16D0(this);
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
break;
}
}
@@ -598,7 +608,7 @@ void func_80BB27D4(EnGeg* this, GlobalContext* globalCtx) {
void func_80BB2944(EnGeg* this, GlobalContext* globalCtx) {
u8 sp27 = Message_GetState(&globalCtx->msgCtx);
s16 curFrame = this->skelAnime.curFrame;
- s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animationSeg);
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation);
if (this->unk_4AC == 19) {
if (curFrame == lastFrame) {
@@ -607,7 +617,7 @@ void func_80BB2944(EnGeg* this, GlobalContext* globalCtx) {
}
} else if ((sp27 == 5) && func_80147624(globalCtx)) {
if (this->unk_496 == 0xD67) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_49A = this->unk_49C[4];
this->actionFunc = func_80BB2520;
@@ -624,12 +634,12 @@ void func_80BB2A54(EnGeg* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(this->unk_498);
this->unk_230 &= ~0x10;
this->unk_244 = 65;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80BB347C;
} else {
this->unk_496 = func_80BB16D0(this);
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
}
}
}
@@ -694,7 +704,7 @@ void func_80BB2B1C(EnGeg* this, GlobalContext* globalCtx) {
void func_80BB2E00(EnGeg* this, GlobalContext* globalCtx) {
s16 sp2E = this->skelAnime.curFrame;
- s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animationSeg);
+ s16 sp2C = Animation_GetLastFrame(sAnimations[this->unk_4AC].animation);
if (this->unk_4AC == 2) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
@@ -761,11 +771,11 @@ void func_80BB30B4(EnGeg* this, GlobalContext* globalCtx) {
} else {
this->unk_496 = 0xD6E;
}
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
this->actionFunc = func_80BB27D4;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
} else if (this->actor.xzDistToPlayer < 150.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 150.0f);
}
}
@@ -799,7 +809,7 @@ void func_80BB31B8(EnGeg* this, GlobalContext* globalCtx) {
void func_80BB32AC(EnGeg* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->unk_496, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_496, &this->actor);
this->actionFunc = func_80BB27D4;
} else {
func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
@@ -894,7 +904,7 @@ void EnGeg_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80BB1FCC(this, globalCtx);
func_80BB2088(this, globalCtx);
func_80BB1C8C(this);
- func_8013D9C8(globalCtx, &this->unk_238, &this->unk_232, 3);
+ SubS_FillLimbRotTables(globalCtx, this->unk_238, this->unk_232, ARRAY_COUNT(this->unk_238));
func_80BB1D04(this);
func_80BB178C(this, globalCtx);
}
@@ -966,7 +976,7 @@ void EnGeg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
}
-void EnGeg_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnGeg_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnGeg* this = THIS;
s32 phi_v0;
s32 phi_v1;
@@ -1025,10 +1035,10 @@ void EnGeg_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void func_80BB3BE0(EnGeg* this, GlobalContext* globalCtx) {
static TexturePtr D_80BB4088[] = {
- &object_oF1d_map_Tex_010438,
- &object_oF1d_map_Tex_010C38,
- &object_oF1d_map_Tex_011038,
- &object_oF1d_map_Tex_010838,
+ object_oF1d_map_Tex_010438,
+ object_oF1d_map_Tex_010C38,
+ object_oF1d_map_Tex_011038,
+ object_oF1d_map_Tex_010838,
};
s32 pad;
@@ -1039,8 +1049,9 @@ void func_80BB3BE0(EnGeg* this, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BB4088[this->unk_23E]));
gDPPipeSync(POLY_OPA_DISP++);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnGeg_OverrideLimbDraw, EnGeg_PostLimbDraw, EnGeg_UnkDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGeg_OverrideLimbDraw, EnGeg_PostLimbDraw,
+ EnGeg_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.h b/src/overlays/actors/ovl_En_Geg/z_en_geg.h
index c846f447b7..f5e9ad34db 100644
--- a/src/overlays/actors/ovl_En_Geg/z_en_geg.h
+++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.h
@@ -14,10 +14,8 @@ typedef struct EnGeg {
/* 0x18C */ ColliderCylinder colliderCylinder;
/* 0x1D8 */ ColliderSphere colliderSphere;
/* 0x230 */ u16 unk_230;
- /* 0x232 */ s16 unk_232;
- /* 0x234 */ UNK_TYPE1 unk234[4];
- /* 0x238 */ s16 unk_238;
- /* 0x23A */ UNK_TYPE1 unk23A[0x4];
+ /* 0x232 */ s16 unk_232[3];
+ /* 0x238 */ s16 unk_238[3];
/* 0x23E */ s16 unk_23E;
/* 0x240 */ s16 unk_240;
/* 0x242 */ s16 unk_242;
diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.c b/src/overlays/actors/ovl_En_Gg/z_en_gg.c
index 4eb259e50b..c9b6435f5c 100644
--- a/src/overlays/actors/ovl_En_Gg/z_en_gg.c
+++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.c
@@ -5,8 +5,10 @@
*/
#include "z_en_gg.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_gg/object_gg.h"
-#define FLAGS 0x00000089
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80)
#define THIS ((EnGg*)thisx)
@@ -15,7 +17,15 @@ void EnGg_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnGg_Update(Actor* thisx, GlobalContext* globalCtx);
void EnGg_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B352A4(EnGg* this, GlobalContext* globalCtx);
+void func_80B35450(EnGg* this, GlobalContext* globalCtx);
+void func_80B3556C(EnGg* this, GlobalContext* globalCtx);
+u16 func_80B357F0(EnGg* this);
+void func_80B358D8(EnGg* this, GlobalContext* globalCtx);
+void func_80B359DC(EnGg* this, GlobalContext* globalCtx);
+void func_80B363E8(EnGgStruct* ptr, GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3);
+void func_80B364D4(EnGgStruct* ptr, GlobalContext* globalCtx);
+
const ActorInit En_Gg_InitVars = {
ACTOR_EN_GG,
ACTORCAT_NPC,
@@ -28,18 +38,29 @@ const ActorInit En_Gg_InitVars = {
(ActorFunc)EnGg_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80B36C00 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 24, 72, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80B36C2C = { 0, 24, 72, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 24, 72, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80B36C38 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -74,62 +95,719 @@ static DamageTable D_80B36C38 = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-#endif
+static AnimationInfo sAnimations[] = {
+ { &object_gg_Anim_00F578, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00D528, 1.0f, 0.0f, 0.0f, 2, -10.0f },
+ { &object_gg_Anim_00D174, 1.0f, 0.0f, 0.0f, 2, -10.0f }, { &object_gg_Anim_00ECC0, 1.0f, 0.0f, 0.0f, 2, -10.0f },
+ { &object_gg_Anim_00BAF0, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00AF40, 1.0f, 0.0f, 0.0f, 0, -10.0f },
+ { &object_gg_Anim_00F578, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_00AF40, 1.0f, 0.0f, 0.0f, 0, -10.0f },
+ { &object_gg_Anim_00F578, 1.0f, 0.0f, 0.0f, 0, -10.0f }, { &object_gg_Anim_0100C8, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_gg_Anim_00CDA0, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gg_Anim_00B560, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_gg_Anim_00A4B4, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_gg_Anim_00E86C, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_gg_Anim_00D99C, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_gg_Anim_00E2A4, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+};
-extern ColliderCylinderInit D_80B36C00;
-extern CollisionCheckInfoInit2 D_80B36C2C;
-extern DamageTable D_80B36C38;
+void func_80B34F70(EnGg* this) {
+ this->actor.focus.pos.x = this->actor.world.pos.x;
+ this->actor.focus.pos.y = this->actor.world.pos.y + 80.0f;
+ this->actor.focus.pos.z = this->actor.world.pos.z;
-extern UNK_TYPE D_0600F578;
+ this->actor.focus.rot.x = this->actor.world.rot.x;
+ this->actor.focus.rot.y = this->actor.world.rot.y;
+ this->actor.focus.rot.z = this->actor.world.rot.z;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B34F70.s")
+s32 func_80B34FB4(EnGg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp40;
+ Vec3f sp34;
+ s16 pitch;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B34FB4.s")
+ sp40 = player->actor.world.pos;
+ sp40.y = player->bodyPartsPos[7].y + 3.0f;
+ sp34 = this->actor.world.pos;
+ sp34.y += 70.0f;
+ pitch = Math_Vec3f_Pitch(&sp34, &sp40);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35108.s")
+ if ((this->actor.xzDistToPlayer < 250.0f) && (this->actor.xzDistToPlayer > 50.0f) &&
+ (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (gSaveContext.weekEventReg[19] & 0x80))) {
+ Math_SmoothStepToS(&this->unk_2E8, pitch, 4, 0x2AA8, 1);
+ } else {
+ Math_SmoothStepToS(&this->unk_2E8, 0, 4, 0x2AA8, 1);
+ }
+ this->unk_2E8 = CLAMP(this->unk_2E8, 0, 0x1C70);
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B351A4.s")
+void func_80B35108(EnGg* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35250.s")
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 30.0f, 30.0f, 7);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B352A4.s")
+void func_80B351A4(EnGg* this) {
+ if ((this->unk_2E6 == 2) || (this->unk_2E6 == 3)) {
+ this->unk_2E2 = 3;
+ } else {
+ s16 temp = this->unk_2E4 - 1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35450.s")
+ if (temp >= 3) {
+ this->unk_2E2 = 0;
+ this->unk_2E4 = temp;
+ } else if (temp == 0) {
+ this->unk_2E2 = 2;
+ this->unk_2E4 = (s32)(Rand_ZeroOne() * 60.0f) + 20;
+ } else {
+ this->unk_2E2 = 1;
+ this->unk_2E4 = temp;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B3556C.s")
+void func_80B35250(EnGg* this) {
+ this->unk_2E4 = 20;
+ this->unk_2E2 = 0;
+ this->unk_2E6 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actionFunc = func_80B35450;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35634.s")
+void func_80B352A4(EnGg* this, GlobalContext* globalCtx) {
+ s16 sp26 = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E6].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B357F0.s")
+ if (sp26 == lastFrame) {
+ switch (this->actor.textId) {
+ case 0xCE5:
+ this->unk_2E6 = 1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B3584C.s")
+ case 0xCE6:
+ case 0xCEC:
+ this->unk_2E6 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B358D8.s")
+ case 0xCE8:
+ this->unk_2E6 = 2;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35968.s")
+ case 0xCE9:
+ this->unk_2E6 = 3;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B359DC.s")
+ case 0xCED:
+ case 0xCEE:
+ this->unk_2E6 = 4;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35B24.s")
+ default:
+ this->unk_2E6 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ break;
+ }
+ gSaveContext.weekEventReg[19] |= 0x80;
+ this->actionFunc = func_80B3556C;
+ } else if ((this->unk_2E6 == 0) && ((this->actor.textId == 0xCED) || (this->actor.textId == 0xCEE))) {
+ if (sp26 < (lastFrame - 1)) {
+ this->skelAnime.playSpeed = 2.0f;
+ } else {
+ this->unk_2E6 = 4;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35B44.s")
+void func_80B35450(EnGg* this, GlobalContext* globalCtx) {
+ if ((gSaveContext.weekEventReg[91] & 0x10) && (globalCtx->csCtx.state == 0)) {
+ func_80B359DC(this, globalCtx);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B35C84.s")
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_80) {
+ func_800B90F4(globalCtx);
+ }
+ this->unk_308 = 1;
+ this->actionFunc = func_80B352A4;
+ } else if ((this->actor.xzDistToPlayer < 200.0f) && (this->actor.xzDistToPlayer > 50.0f)) {
+ if (gSaveContext.weekEventReg[19] & 0x80) {
+ func_800B863C(&this->actor, globalCtx);
+ this->actor.textId = 0xCEE;
+ } else if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_80) {
+ func_800B863C(&this->actor, globalCtx);
+ this->actor.textId = 0xCE5;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B3610C.s")
+void func_80B3556C(EnGg* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ if (this->unk_2E6 == 4) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->unk_308 = 0;
+ this->actor.flags &= ~ACTOR_FLAG_80;
+ func_80B35250(this);
+ } else {
+ this->actor.textId = func_80B357F0(this);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
+ this->actionFunc = func_80B352A4;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B363E8.s")
+void func_80B35634(EnGg* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 actionIndex;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B364D4.s")
+ if (Cutscene_CheckActorAction(globalCtx, 119)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 119);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/EnGg_Init.s")
+ if (this->unk_2DB != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->unk_2DB = globalCtx->csCtx.actorActions[actionIndex]->action;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/EnGg_Destroy.s")
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ this->unk_2DA = 0;
+ this->unk_2E6 = 0;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/EnGg_Update.s")
+ case 2:
+ this->unk_2DA = 9;
+ this->unk_2E6 = 9;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B368B0.s")
+ case 3:
+ this->unk_2DA = 10;
+ this->unk_2E6 = 10;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/func_80B368F0.s")
+ case 4:
+ do {
+ this->unk_344.unk_30 = this->unk_2DA = 11;
+ } while (0);
+ this->unk_2E6 = 11;
+ func_80B364D4(&this->unk_344, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gg/EnGg_Draw.s")
+ case 5:
+ do {
+ this->unk_344.unk_30 = this->unk_2DA = 12;
+ } while (0);
+ this->unk_2E6 = 12;
+ break;
+
+ case 6:
+ do {
+ this->unk_344.unk_30 = this->unk_2DA = 13;
+ } while (0);
+ this->unk_2E6 = 13;
+ break;
+
+ case 7:
+ do {
+ this->unk_344.unk_30 = this->unk_2DA = 14;
+ } while (0);
+ this->unk_2E6 = 14;
+ func_80B364D4(&this->unk_344, globalCtx);
+ break;
+
+ case 8:
+ Actor_MarkForDeath(&this->actor);
+ return;
+
+ default:
+ this->unk_2DA = 0;
+ break;
+ }
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2DA);
+ }
+
+ if (this->unk_2DA == 14) {
+ func_80B358D8(this, globalCtx);
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ this->actor.shape.yOffset = 0.0f;
+ } else {
+ this->unk_2DB = 99;
+ }
+}
+
+u16 func_80B357F0(EnGg* this) {
+ switch (this->actor.textId) {
+ case 0xCE5:
+ return 0xCE6;
+ case 0xCE6:
+ return 0xCE8;
+ case 0xCE8:
+ return 0xCE9;
+ case 0xCE9:
+ return 0xCEC;
+ case 0xCEC:
+ return 0xCED;
+ }
+ return 0;
+}
+
+void func_80B3584C(EnGg* this) {
+ this->unk_30A += 0x72C;
+ this->actor.shape.yOffset = Math_SinS(this->unk_30A) * 100.0f;
+ this->actor.shape.shadowScale = 30.0f - (Math_SinS(this->unk_30A) * 5.0f);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+}
+
+void func_80B358D8(EnGg* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2DA].animation);
+
+ if ((this->unk_2E6 == 14) && (sp1E == lastFrame)) {
+ this->unk_2E6 = 15;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 15);
+ }
+}
+
+void func_80B35968(EnGg* this, GlobalContext* globalCtx) {
+ if (this->unk_344.unk_34 != NULL) {
+ this->unk_344.unk_34(&this->unk_344, globalCtx);
+ } else {
+ if ((this->unk_2DA == 11) || (this->unk_2DA == 14)) {
+ this->unk_344.unk_30 = this->unk_2DA;
+ }
+ func_80B363E8(&this->unk_344, globalCtx, &this->unk_320, &this->unk_32C, &this->unk_338);
+ }
+}
+
+void func_80B359DC(EnGg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->actor.xzDistToPlayer < 200.0f) {
+ if (this->unk_306 == 0) {
+ if (player->stateFlags2 & 0x8000000) {
+ this->unk_306 = 1;
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ }
+ } else if (!(player->stateFlags2 & 0x8000000)) {
+ this->unk_306 = 0;
+ }
+
+ if ((player->transformation == PLAYER_FORM_HUMAN) && (globalCtx->msgCtx.ocarinaMode == 3) &&
+ (globalCtx->msgCtx.unk1202E == 7)) {
+ if (!(gSaveContext.weekEventReg[19] & 0x80)) {
+ gSaveContext.weekEventReg[19] |= 0x80;
+ }
+ this->unk_307 = true;
+ }
+
+ if (ActorCutscene_GetCanPlayNext(this->unk_2DC)) {
+ ActorCutscene_Start(this->unk_2DC, &this->actor);
+ this->unk_307 = false;
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+
+ if (this->unk_307) {
+ ActorCutscene_SetIntentToPlay(this->unk_2DC);
+ }
+ }
+ } else {
+ this->unk_307 = false;
+ }
+}
+
+void func_80B35B24(EnGgStruct* ptr, GlobalContext* globalCtx) {
+ ptr->unk_34 = NULL;
+ ptr->unk_38 = NULL;
+ ptr->unk_3C = 0;
+ ptr->unk_40 = 0;
+ ptr->unk_44 = 0;
+}
+
+void func_80B35B44(EnGgStruct* ptr, GlobalContext* globalCtx) {
+ if (ptr->unk_30 == 0xE) {
+ ptr->unk_40++;
+ if (ptr->unk_40 > 0x46) {
+ ptr->unk_48 = 1;
+ ptr->unk_40 = 0;
+ }
+
+ if (ptr->unk_40 != 0x46) {
+ if (ptr->unk_48 != 0) {
+ ptr->unk_44 = 0x37;
+ } else {
+ ptr->unk_44 = ptr->unk_40 - 15;
+ if (ptr->unk_44 < 0) {
+ ptr->unk_44 = 0;
+ }
+ }
+ } else {
+ ptr->unk_44++;
+ if (ptr->unk_44 > 0x37) {
+ ptr->unk_44 = 0x37;
+ }
+ }
+ } else if ((ptr->unk_30 == 11) || (ptr->unk_30 == 12)) {
+ ptr->unk_40++;
+ if (ptr->unk_40 > 0x46) {
+ ptr->unk_48 = 1;
+ ptr->unk_40 = 0;
+ }
+ } else if (ptr->unk_30 == 0xD) {
+ ptr->unk_48 = 0;
+ ptr->unk_40++;
+ if (ptr->unk_40 > 0x46) {
+ ptr->unk_40 = 0x46;
+ }
+
+ if (ptr->unk_40 != 0x46) {
+ ptr->unk_44 = ptr->unk_40 - 15;
+ if (ptr->unk_44 < 0) {
+ ptr->unk_44 = 0;
+ }
+ } else {
+ ptr->unk_44++;
+ if (ptr->unk_44 > 0x37) {
+ func_80B364D4(ptr, globalCtx);
+ }
+ }
+ }
+}
+
+void func_80B35C84(EnGgStruct* ptr, GlobalContext* globalCtx) {
+ s32 sp74;
+ s32 phi_s7;
+ f32 temp_f22;
+ f32 temp_f24;
+ f32 temp_f26;
+ f32 temp_f20;
+ s32 i;
+ s32 temp = 10;
+
+ if (ptr->unk_48 != 0) {
+ sp74 = ptr->unk_40 % temp;
+ ptr->unk_40 = sp74;
+ phi_s7 = 0x46;
+ } else if (ptr->unk_30 == 0xD) {
+ sp74 = ptr->unk_40;
+ phi_s7 = 0x46;
+ } else {
+ phi_s7 = ptr->unk_40 - ptr->unk_44;
+ sp74 = ptr->unk_40 % temp;
+ }
+
+ if (phi_s7 <= 0) {
+ return;
+ }
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+
+ for (i = sp74; i < phi_s7; i += temp) {
+ temp_f20 = i * 0.14f;
+ temp_f22 = ptr->unk_00.x + (ptr->unk_18.x * temp_f20) + (0.5f * ptr->unk_24.x * temp_f20 * temp_f20);
+ temp_f24 = ptr->unk_00.y - Math_SinS((i * 0x27FFB) / 70);
+ temp_f26 = ptr->unk_00.z + (ptr->unk_18.z * temp_f20) + (0.5f * ptr->unk_24.z * temp_f20 * temp_f20);
+ temp_f20 = Rand_ZeroOne() * 0.003f;
+
+ if (1) {}
+
+ Matrix_InsertTranslation(temp_f22, temp_f24, temp_f26, MTXMODE_NEW);
+ Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 150, 0, 255);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
+ }
+
+ Matrix_StatePop();
+
+ Matrix_StatePush();
+
+ for (i = sp74; i < phi_s7; i += temp) {
+ temp_f20 = i * 0.14f;
+ temp_f22 = ptr->unk_0C.x + ((ptr->unk_18.x * temp_f20) + (0.5f * ptr->unk_24.x * temp_f20 * temp_f20));
+ temp_f24 = ptr->unk_0C.y - Math_SinS((i * 0x27FFB) / 70);
+ temp_f26 = ptr->unk_0C.z + (ptr->unk_18.z * temp_f20) + (0.5f * ptr->unk_24.z * temp_f20 * temp_f20);
+ temp_f20 = Rand_ZeroOne() * 0.003f;
+
+ Matrix_InsertTranslation(temp_f22, temp_f24, temp_f26, MTXMODE_NEW);
+ Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 150, 0, 255);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
+ }
+
+ Matrix_StatePop();
+
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80B3610C(EnGgStruct* ptr, GlobalContext* globalCtx) {
+ f32 temp_f20;
+ f32 temp_f24;
+ f32 temp_f26;
+ f32 temp_f28;
+ f32 temp_f30;
+ s32 phi_s4;
+ f32 phi_f22;
+ s32 i;
+
+ if (ptr->unk_48 != 0) {
+ phi_s4 = 0x46;
+ } else {
+ phi_s4 = ptr->unk_40;
+ }
+
+ if (phi_s4 > 0) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+
+ for (i = 0; i < phi_s4; i++) {
+ if (ptr->unk_48 != 0) {
+ phi_f22 = phi_s4 / 70.0f;
+ } else {
+ phi_f22 = i / 70.0f;
+ }
+ temp_f24 = ptr->unk_0C.x + (ptr->unk_18.x * i) + (0.5f * ptr->unk_24.x * i * i);
+ temp_f26 = ptr->unk_0C.y + (ptr->unk_18.y * i) + (0.5f * ptr->unk_24.y * i * i);
+ temp_f28 = ptr->unk_0C.z + (ptr->unk_18.z * i) + (0.5f * ptr->unk_24.z * i * i);
+ temp_f20 = Rand_ZeroOne() * 0.003f;
+
+ Matrix_InsertTranslation((Rand_Centered() * (100.0f * phi_f22)) + temp_f24, temp_f26,
+ ((30.0f * phi_f22) * Rand_Centered()) + temp_f28, MTXMODE_NEW);
+ Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 150, 0, 255);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
+ }
+
+ Matrix_StatePop();
+
+ gSPMatrix(POLY_XLU_DISP++, &gIdentityMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
+
+void func_80B363E8(EnGgStruct* ptr, GlobalContext* globalCtx, Vec3f* arg1, Vec3f* arg2, Vec3f* arg3) {
+ ptr->unk_34 = func_80B35B44;
+ ptr->unk_00 = *arg1;
+ ptr->unk_0C = *arg1;
+ ptr->unk_18 = *arg2;
+ ptr->unk_24 = *arg3;
+ ptr->unk_48 = 0;
+
+ ptr->unk_00.x += -4.0f;
+ ptr->unk_0C.x += 4.0f;
+
+ if ((ptr->unk_30 == 11) || (ptr->unk_30 == 12) || (ptr->unk_30 == 13)) {
+ ptr->unk_38 = func_80B35C84;
+ } else if (ptr->unk_30 == 14) {
+ ptr->unk_38 = func_80B3610C;
+ }
+}
+
+void func_80B364D4(EnGgStruct* ptr, GlobalContext* globalCtx) {
+ ptr->unk_34 = NULL;
+ ptr->unk_38 = NULL;
+ func_80B35B24(ptr, globalCtx);
+}
+
+void EnGg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnGg* this = THIS;
+
+ if (INV_CONTENT(ITEM_MASK_GORON) == ITEM_MASK_GORON) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
+ this->actor.bgCheckFlags |= 0x400;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable,
+ this->morphTable, 20);
+
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ gSaveContext.weekEventReg[20] &= (u8)~4;
+ gSaveContext.weekEventReg[20] &= (u8)~8;
+ gSaveContext.weekEventReg[20] &= (u8)~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_80;
+ this->unk_310 = this->actor.home.pos.y;
+ this->unk_2DC = this->actor.cutscene;
+ this->actor.flags |= ACTOR_FLAG_2000000;
+ this->unk_308 = 0;
+ this->unk_309 = 0;
+ this->unk_304 = 0;
+ this->unk_30A = 0;
+ this->actor.flags |= ACTOR_FLAG_10;
+ func_80B35B24(&this->unk_344, globalCtx);
+ func_80B35250(this);
+}
+
+void EnGg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
+
+void EnGg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnGg* this = THIS;
+
+ if (globalCtx->actorCtx.unk4 == 100) {
+ this->actor.flags |= ACTOR_FLAG_80;
+ this->actor.flags |= ACTOR_FLAG_1;
+ } else {
+ this->actor.flags &= ~ACTOR_FLAG_80;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ }
+
+ if (gSaveContext.weekEventReg[19] & 0x80) {
+ if (globalCtx->csCtx.state == 0) {
+ this->actor.flags |= ACTOR_FLAG_1;
+ } else {
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ }
+ }
+
+ if ((globalCtx->csCtx.state == 0) &&
+ ((this->unk_2DA != 14) && (this->unk_2DA != 11) && (this->unk_2DA != 12) && (this->unk_2DA != 13))) {
+ func_80B364D4(&this->unk_344, globalCtx);
+ }
+
+ if (((this->unk_2DA == 14) || (this->unk_2DA == 11) || (this->unk_2DA == 12) || (this->unk_2DA == 13)) &&
+ (this->unk_309 == 1)) {
+ func_80B35968(this, globalCtx);
+ }
+
+ if (!(gSaveContext.weekEventReg[91] & 0x10) &&
+ ((gSaveContext.weekEventReg[19] & 0x80) || CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) ||
+ (this->unk_308 == 1))) {
+ gSaveContext.weekEventReg[91] |= 0x10;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ func_80B34F70(this);
+ func_80B35108(this, globalCtx);
+ func_80B34FB4(this, globalCtx);
+ Actor_MoveWithoutGravity(&this->actor);
+ SkelAnime_Update(&this->skelAnime);
+
+ if (globalCtx->csCtx.state == 0) {
+ func_80B3584C(this);
+ } else {
+ this->unk_2E8 = 0;
+ }
+
+ func_80B35634(this, globalCtx);
+ func_800E9250(globalCtx, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos);
+ func_80B351A4(this);
+}
+
+s32 EnGg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ EnGg* this = THIS;
+
+ if (limbIndex == 2) {
+ Matrix_InsertZRotation_s(this->unk_2E8, MTXMODE_APPLY);
+ }
+ return false;
+}
+
+void EnGg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ static Vec3f D_80B36DF0 = { 1800.0f, 300.0f, 200.0f };
+ EnGg* this = THIS;
+ Vec3f sp30 = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp24 = { 0.0f, 0.0f, 0.0f };
+
+ if (this->unk_2DA == 14) {
+ sp30.y = 3.0f;
+ sp30.z = -1.0f;
+ sp24.y = -0.07f;
+ this->unk_309 = 1;
+ } else if ((this->unk_2DA == 11) || (this->unk_2DA == 12) || (this->unk_2DA == 13)) {
+ sp30.x = 3.0f;
+ sp24.x = 0.5f;
+ this->unk_309 = 1;
+ } else {
+ this->unk_309 = 0;
+ }
+
+ if (limbIndex == 4) {
+ Matrix_MultiplyVector3fByState(&D_80B36DF0, &this->unk_320);
+ Matrix_StatePush();
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_MultiplyVector3fByState(&sp30, &this->unk_32C);
+ Matrix_MultiplyVector3fByState(&sp24, &this->unk_338);
+ Matrix_StatePop();
+ }
+}
+
+TexturePtr D_80B36DFC[] = {
+ object_gg_Tex_009260,
+ object_gg_Tex_009660,
+ object_gg_Tex_009A60,
+ object_gg_Tex_009E60,
+};
+
+void EnGg_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnGg* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->unk_344.unk_38 != 0) {
+ this->unk_344.unk_38(&this->unk_344, globalCtx);
+ }
+
+ if (gSaveContext.weekEventReg[19] & 0x80) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B36DFC[this->unk_2E2]));
+
+ POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGg_OverrideLimbDraw, EnGg_PostLimbDraw,
+ &this->actor, POLY_OPA_DISP);
+ } else if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_80) || (this->unk_308 == 1)) {
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B36DFC[this->unk_2E2]));
+
+ POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGg_OverrideLimbDraw, EnGg_PostLimbDraw,
+ &this->actor, POLY_XLU_DISP);
+ }
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Gg/z_en_gg.h b/src/overlays/actors/ovl_En_Gg/z_en_gg.h
index f96a595480..eeb83cbbd2 100644
--- a/src/overlays/actors/ovl_En_Gg/z_en_gg.h
+++ b/src/overlays/actors/ovl_En_Gg/z_en_gg.h
@@ -4,14 +4,57 @@
#include "global.h"
struct EnGg;
+struct EnGgStruct;
typedef void (*EnGgActionFunc)(struct EnGg*, GlobalContext*);
+typedef void (*EnGgUnkFunc)(struct EnGgStruct*, GlobalContext*);
+
+typedef struct EnGgStruct {
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ Vec3f unk_0C;
+ /* 0x18 */ Vec3f unk_18;
+ /* 0x24 */ Vec3f unk_24;
+ /* 0x30 */ u8 unk_30;
+ /* 0x34 */ EnGgUnkFunc unk_34;
+ /* 0x38 */ EnGgUnkFunc unk_38;
+ /* 0x3C */ s32 unk_3C;
+ /* 0x40 */ s32 unk_40;
+ /* 0x44 */ s32 unk_44;
+ /* 0x48 */ u8 unk_48;
+} EnGgStruct; // size == 0x4C
typedef struct EnGg {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x90];
+ /* 0x0144 */ ColliderCylinder collider;
+ /* 0x0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnGgActionFunc actionFunc;
- /* 0x01D8 */ char unk_1D8[0x1B8];
+ /* 0x01D8 */ Vec3s unk_1D8;
+ /* 0x01DE */ Vec3s unk_1DE;
+ /* 0x01E4 */ Vec3s jointTable[20];
+ /* 0x025C */ Vec3s morphTable[20];
+ /* 0x02D4 */ UNK_TYPE1 unk_2D4[0x6];
+ /* 0x02DA */ u8 unk_2DA;
+ /* 0x02DB */ u8 unk_2DB;
+ /* 0x02DC */ s16 unk_2DC;
+ /* 0x02DE */ UNK_TYPE1 unk2DE[4];
+ /* 0x02E2 */ s16 unk_2E2;
+ /* 0x02E4 */ s16 unk_2E4;
+ /* 0x02E6 */ s16 unk_2E6;
+ /* 0x02E8 */ s16 unk_2E8;
+ /* 0x02EA */ UNK_TYPE1 unk2EA[0x1A];
+ /* 0x0304 */ s16 unk_304;
+ /* 0x0306 */ u8 unk_306;
+ /* 0x0307 */ u8 unk_307;
+ /* 0x0308 */ u8 unk_308;
+ /* 0x0309 */ u8 unk_309;
+ /* 0x030A */ s16 unk_30A;
+ /* 0x030C */ UNK_TYPE1 unk30C[4];
+ /* 0x0310 */ f32 unk_310;
+ /* 0x0314 */ UNK_TYPE1 unk314[0xC];
+ /* 0x0320 */ Vec3f unk_320;
+ /* 0x032C */ Vec3f unk_32C;
+ /* 0x0338 */ Vec3f unk_338;
+ /* 0x0344 */ EnGgStruct unk_344;
} EnGg; // size = 0x390
extern const ActorInit En_Gg_InitVars;
diff --git a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
index e415165acc..e06655c69e 100644
--- a/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
+++ b/src/overlays/actors/ovl_En_Gg2/z_en_gg2.c
@@ -6,7 +6,7 @@
#include "z_en_gg2.h"
-#define FLAGS 0x00000089
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80)
#define THIS ((EnGg2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.c b/src/overlays/actors/ovl_En_Giant/z_en_giant.c
index 85f1798e3e..c509db2b8c 100644
--- a/src/overlays/actors/ovl_En_Giant/z_en_giant.c
+++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.c
@@ -5,9 +5,8 @@
*/
#include "z_en_giant.h"
-#include "objects/object_giant/object_giant.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnGiant*)thisx)
@@ -20,6 +19,59 @@ void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, GlobalContext* globa
void EnGiant_PlayClockTowerFailureAnimation(EnGiant* this, GlobalContext* globalCtx);
void EnGiant_PerformCutsceneActions(EnGiant* this, GlobalContext* globalCtx);
+#define GIANT_TYPE_IS_NOT_TERMINA_FIELD(type) (type > GIANT_TYPE_OCEAN_TERMINA_FIELD)
+#define GIANT_TYPE_IS_TERMINA_FIELD(type) (type <= GIANT_TYPE_OCEAN_TERMINA_FIELD)
+#define GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type) \
+ (type >= GIANT_TYPE_MOUNTAIN_CLOCK_TOWER_SUCCESS && type <= GIANT_TYPE_OCEAN_CLOCK_TOWER_SUCCESS)
+#define GIANT_TYPE_IS_CHAMBER_OR_ENDING(type) \
+ (type >= GIANT_TYPE_MOUNTAIN_GIANTS_CHAMBER_AND_ENDING && type <= GIANT_TYPE_OCEAN_GIANTS_CHAMBER_AND_ENDING)
+#define GIANT_TYPE_IS_CLOCK_TOWER_FAILURE(type) \
+ (type >= GIANT_TYPE_MOUNTAIN_CLOCK_TOWER_FAILURE && type <= GIANT_TYPE_OCEAN_CLOCK_TOWER_FAILURE)
+
+/**
+ * These values are used to index into sAnimations to pick the appropriate animation.
+ */
+typedef enum {
+ /* 0 */ GIANT_ANIMATION_LOOK_UP_START,
+ /* 1 */ GIANT_ANIMATION_LOOK_UP_LOOP,
+ /* 2 */ GIANT_ANIMATION_FALLING_OVER,
+ /* 3 */ GIANT_ANIMATION_RAISED_ARMS_START,
+ /* 4 */ GIANT_ANIMATION_RAISED_ARMS_LOOP,
+ /* 5 */ GIANT_ANIMATION_STRUGGLE_START,
+ /* 6 */ GIANT_ANIMATION_STRUGGLE_LOOP,
+ /* 7 */ GIANT_ANIMATION_IDLE_LOOP,
+ /* 8 */ GIANT_ANIMATION_WALKING_LOOP,
+ /* 9 */ GIANT_ANIMATION_BIG_CALL_START,
+ /* 10 */ GIANT_ANIMATION_BIG_CALL_LOOP,
+ /* 11 */ GIANT_ANIMATION_BIG_CALL_END,
+ /* 12 */ GIANT_ANIMATION_SMALL_CALL_START,
+ /* 13 */ GIANT_ANIMATION_SMALL_CALL_LOOP,
+ /* 14 */ GIANT_ANIMATION_SMALL_CALL_END,
+ /* 15 */ GIANT_ANIMATION_MAX
+} GiantAnimationIndex;
+
+/**
+ * Used as values for csAction. The UNKNOWN ones are never used in-game.
+ */
+typedef enum {
+ /* 0 */ GIANT_CS_ACTION_NONE,
+ /* 1 */ GIANT_CS_ACTION_IDLE,
+ /* 2 */ GIANT_CS_ACTION_WALKING,
+ /* 3 */ GIANT_CS_ACTION_LOOKING_UP,
+ /* 4 */ GIANT_CS_ACTION_RAISING_ARMS,
+ /* 5 */ GIANT_CS_ACTION_STRUGGLING,
+ /* 6 */ GIANT_CS_ACTION_FALLING_OVER,
+ /* 7 */ GIANT_CS_ACTION_IDLE_FADE_IN,
+ /* 8 */ GIANT_CS_ACTION_TALKING,
+ /* 9 */ GIANT_CS_ACTION_DONE_TALKING,
+ /* 10 */ GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER,
+ /* 11 */ GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER,
+ /* 12 */ GIANT_CS_ACTION_UNKNOWN_12,
+ /* 13 */ GIANT_CS_ACTION_UNKNOWN_13,
+ /* 14 */ GIANT_CS_ACTION_UNKNOWN_14,
+ /* 15 */ GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER
+} GiantCsActionIndex;
+
const ActorInit En_Giant_InitVars = {
ACTOR_EN_GIANT,
ACTORCAT_NPC,
@@ -113,25 +165,25 @@ void EnGiant_Init(Actor* thisx, GlobalContext* globalCtx) {
case GIANT_TYPE_CANYON_TERMINA_FIELD:
case GIANT_TYPE_CANYON_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_CANYON_GIANTS_CHAMBER_AND_ENDING:
- this->actorActionCommand = 0x1C6;
+ this->actorActionCommand = 454;
break;
case GIANT_TYPE_SWAMP_TERMINA_FIELD:
case GIANT_TYPE_SWAMP_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_SWAMP_GIANTS_CHAMBER_AND_ENDING:
- this->actorActionCommand = 0x1C7;
+ this->actorActionCommand = 455;
break;
case GIANT_TYPE_OCEAN_TERMINA_FIELD:
case GIANT_TYPE_OCEAN_CLOCK_TOWER_SUCCESS:
case GIANT_TYPE_OCEAN_GIANTS_CHAMBER_AND_ENDING:
- this->actorActionCommand = 0x1C8;
+ this->actorActionCommand = 456;
break;
default:
- this->actorActionCommand = 0x1C5;
+ this->actorActionCommand = 453;
break;
}
if (GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type)) {
- if (!(gSaveContext.weekEventReg[0x19] & 2)) {
+ if (!(gSaveContext.weekEventReg[25] & 2)) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -336,20 +388,23 @@ void EnGiant_PlaySound(EnGiant* this) {
}
void EnGiant_UpdatePosition(EnGiant* this, GlobalContext* globalCtx, u32 actionIndex) {
- CsCmdActorAction* actorAction = globalCtx->csCtx.npcActions[actionIndex];
- f32 startPosY = actorAction->unk0C.y;
+ CsCmdActorAction* actorAction = globalCtx->csCtx.actorActions[actionIndex];
+ f32 startPosY = actorAction->startPos.y;
s32 pad[2];
- f32 endPosY = actorAction->unk18.y;
- f32 scale = func_800F5A8C(actorAction->endFrame, actorAction->startFrame, globalCtx->csCtx.frames, globalCtx);
+ f32 endPosY = actorAction->endPos.y;
+ f32 scale = Environment_LerpWeight(actorAction->endFrame, actorAction->startFrame, globalCtx->csCtx.frames);
this->actor.world.pos.y = ((endPosY - startPosY) * scale) + startPosY;
}
void EnGiant_PerformClockTowerSuccessActions(EnGiant* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, this->actorActionCommand)) {
- EnGiant_UpdatePosition(this, globalCtx, func_800EE200(globalCtx, this->actorActionCommand));
- if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0) {
- this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCommand)) {
+ EnGiant_UpdatePosition(this, globalCtx, Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand));
+ if (this->csAction !=
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand)]->action) {
+ this->csAction =
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand)]
+ ->action;
EnGiant_ChangeAnimationBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
@@ -369,10 +424,14 @@ void EnGiant_PlayClockTowerFailureAnimation(EnGiant* this, GlobalContext* global
void EnGiant_PerformCutsceneActions(EnGiant* this, GlobalContext* globalCtx) {
this->actor.draw = EnGiant_Draw;
- if (func_800EE29C(globalCtx, this->actorActionCommand)) {
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, this->actorActionCommand));
- if (this->csAction != globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0) {
- this->csAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, this->actorActionCommand)]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCommand)) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand));
+ if (this->csAction !=
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand)]->action) {
+ this->csAction =
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand)]
+ ->action;
EnGiant_ChangeAnimationBasedOnCsAction(this);
}
EnGiant_UpdateAlpha(this);
diff --git a/src/overlays/actors/ovl_En_Giant/z_en_giant.h b/src/overlays/actors/ovl_En_Giant/z_en_giant.h
index e28aa2a32a..c8d45ad390 100644
--- a/src/overlays/actors/ovl_En_Giant/z_en_giant.h
+++ b/src/overlays/actors/ovl_En_Giant/z_en_giant.h
@@ -2,13 +2,9 @@
#define Z_EN_GIANT_H
#include "global.h"
+#include "objects/object_giant/object_giant.h"
#define GIANT_TYPE(thisx) ((thisx)->params & 0xF)
-#define GIANT_TYPE_IS_NOT_TERMINA_FIELD(type) (type > GIANT_TYPE_OCEAN_TERMINA_FIELD)
-#define GIANT_TYPE_IS_TERMINA_FIELD(type) (type <= GIANT_TYPE_OCEAN_TERMINA_FIELD)
-#define GIANT_TYPE_IS_CLOCK_TOWER_SUCCESS(type) (type >= GIANT_TYPE_MOUNTAIN_CLOCK_TOWER_SUCCESS && type <= GIANT_TYPE_OCEAN_CLOCK_TOWER_SUCCESS)
-#define GIANT_TYPE_IS_CHAMBER_OR_ENDING(type) (type >= GIANT_TYPE_MOUNTAIN_GIANTS_CHAMBER_AND_ENDING && type <= GIANT_TYPE_OCEAN_GIANTS_CHAMBER_AND_ENDING)
-#define GIANT_TYPE_IS_CLOCK_TOWER_FAILURE(type) (type >= GIANT_TYPE_MOUNTAIN_CLOCK_TOWER_FAILURE && type <= GIANT_TYPE_OCEAN_CLOCK_TOWER_FAILURE)
/**
* The giants are divided into types based on where in the game they appear.
@@ -42,70 +38,6 @@ typedef enum {
/* 15 */ GIANT_TYPE_OCEAN_CLOCK_TOWER_FAILURE,
} GiantType;
-/**
- * These values are used to index into sAnimationTable to pick the appropriate animation.
- */
-typedef enum {
- /* 0 */ GIANT_ANIMATION_LOOK_UP_START,
- /* 1 */ GIANT_ANIMATION_LOOK_UP_LOOP,
- /* 2 */ GIANT_ANIMATION_FALLING_OVER,
- /* 3 */ GIANT_ANIMATION_RAISED_ARMS_START,
- /* 4 */ GIANT_ANIMATION_RAISED_ARMS_LOOP,
- /* 5 */ GIANT_ANIMATION_STRUGGLE_START,
- /* 6 */ GIANT_ANIMATION_STRUGGLE_LOOP,
- /* 7 */ GIANT_ANIMATION_IDLE_LOOP,
- /* 8 */ GIANT_ANIMATION_WALKING_LOOP,
- /* 9 */ GIANT_ANIMATION_BIG_CALL_START,
- /* 10 */ GIANT_ANIMATION_BIG_CALL_LOOP,
- /* 11 */ GIANT_ANIMATION_BIG_CALL_END,
- /* 12 */ GIANT_ANIMATION_SMALL_CALL_START,
- /* 13 */ GIANT_ANIMATION_SMALL_CALL_LOOP,
- /* 14 */ GIANT_ANIMATION_SMALL_CALL_END,
- /* 15 */ GIANT_ANIMATION_MAX
-} GiantAnimationIndex;
-
-/**
- * Used as values for csAction. The UNKNOWN ones are never used in-game.
- */
-typedef enum {
- /* 0 */ GIANT_CS_ACTION_NONE,
- /* 1 */ GIANT_CS_ACTION_IDLE,
- /* 2 */ GIANT_CS_ACTION_WALKING,
- /* 3 */ GIANT_CS_ACTION_LOOKING_UP,
- /* 4 */ GIANT_CS_ACTION_RAISING_ARMS,
- /* 5 */ GIANT_CS_ACTION_STRUGGLING,
- /* 6 */ GIANT_CS_ACTION_FALLING_OVER,
- /* 7 */ GIANT_CS_ACTION_IDLE_FADE_IN,
- /* 8 */ GIANT_CS_ACTION_TALKING,
- /* 9 */ GIANT_CS_ACTION_DONE_TALKING,
- /* 10 */ GIANT_CS_ACTION_TEACHING_OATH_TO_ORDER,
- /* 11 */ GIANT_CS_ACTION_PLAYER_LEARNED_OATH_TO_ORDER,
- /* 12 */ GIANT_CS_ACTION_UNKNOWN_12,
- /* 13 */ GIANT_CS_ACTION_UNKNOWN_13,
- /* 14 */ GIANT_CS_ACTION_UNKNOWN_14,
- /* 15 */ GIANT_CS_ACTION_HOLDING_UP_MOON_IN_CLOCK_TOWER
-} GiantCsActionIndex;
-
-typedef enum {
- /* 0 */ GIANT_LIMB_NONE,
- /* 1 */ GIANT_LIMB_HEAD,
- /* 2 */ GIANT_LIMB_LEFT_THIGH,
- /* 3 */ GIANT_LIMB_LEFT_LOWER_LEG,
- /* 4 */ GIANT_LIMB_LEFT_FOOT,
- /* 5 */ GIANT_LIMB_RIGHT_THIGH,
- /* 6 */ GIANT_LIMB_RIGHT_LOWER_LEG,
- /* 7 */ GIANT_LIMB_RIGHT_FOOT,
- /* 8 */ GIANT_LIMB_LEFT_SHOULDER,
- /* 9 */ GIANT_LIMB_LEFT_UPPER_ARM,
- /* 10 */ GIANT_LIMB_LEFT_FOREARM,
- /* 11 */ GIANT_LIMB_LEFT_HAND,
- /* 12 */ GIANT_LIMB_RIGHT_SHOULDER,
- /* 13 */ GIANT_LIMB_RIGHT_UPPER_ARM,
- /* 14 */ GIANT_LIMB_RIGHT_FOREARM,
- /* 15 */ GIANT_LIMB_RIGHT_HAND,
- /* 16 */ GIANT_LIMB_MAX,
-} EnGiantLimbs;
-
struct EnGiant;
typedef void (*EnGiantActionFunc)(struct EnGiant*, GlobalContext*);
diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c
index a58710030b..fe480fb14f 100644
--- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c
+++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ginko_man.h"
+#include "objects/object_boj/object_boj.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnGinkoMan*)thisx)
@@ -29,14 +30,6 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx);
void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx);
void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_0600C240; // object_ginko_skeleton
-extern Gfx D_0600B1D8[]; // object_ginko_limb15_dlist
-extern AnimationHeader D_060008C0; // object_ginko_floorsmacking_anim
-extern AnimationHeader D_060043F0; // object_ginko_sitting_anim
-extern AnimationHeader D_06004A7C; // object_ginko_amazed_anim
-extern AnimationHeader D_06004F40; // object_ginko_stamp_reach_anim
-extern AnimationHeader D_06000AC4; // object_ginko_advertising_anim
-
const ActorInit En_Ginko_Man_InitVars = {
ACTOR_EN_GINKO_MAN,
ACTORCAT_NPC,
@@ -49,12 +42,12 @@ const ActorInit En_Ginko_Man_InitVars = {
(ActorFunc)EnGinkoMan_Draw,
};
-ActorAnimationEntry animations[] = {
- { &D_060008C0, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &D_060043F0, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &D_06004F40, 1.0f, 0.0f, 0.0f, 2, -4.0f },
- { &D_06000AC4, 1.0f, 0.0f, 0.0f, 0, -4.0f }, // looking around for customers
- { &D_06004A7C, 1.0f, 0.0f, 0.0f, 0, -4.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_boj_Anim_0008C0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_boj_Anim_0043F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_boj_Anim_004F40, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
+ { &object_boj_Anim_000AC4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f }, // looking around for customers
+ { &object_boj_Anim_004A7C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
};
void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -69,7 +62,8 @@ void EnGinkoMan_Init(Actor* thisx, GlobalContext* globalCtx) {
this->isStampChecked = false;
this->choiceDepositWithdrawl = GINKOMAN_CHOICE_RESET;
this->serviceFee = 0;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C240, &D_060043F0, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boj_Skel_00C240, &object_boj_Anim_0043F0, this->jointTable,
+ this->morphTable, 16);
EnGinkoMan_SetupIdle(this);
}
@@ -77,8 +71,8 @@ void EnGinkoMan_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnGinkoMan_SetupIdle(EnGinkoMan* this) {
- this->actor.flags |= 1; // targetable
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
+ this->actor.flags |= ACTOR_FLAG_1; // targetable
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
this->actionFunc = EnGinkoMan_Idle;
}
@@ -87,17 +81,17 @@ void EnGinkoMan_Idle(EnGinkoMan* this, GlobalContext* globalCtx) {
EnGinkoMan_SwitchAnimation(this, globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- func_801518B0(globalCtx, 0x44C, &this->actor);
+ if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ Message_StartTextbox(globalCtx, 0x44C, &this->actor);
this->curTextId = 0x44C; // would you like to make an account
} else {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
- func_801518B0(globalCtx, 0x467, &this->actor);
+ Message_StartTextbox(globalCtx, 0x467, &this->actor);
this->curTextId = 0x467; // "What's this? You need somethin' on a day like this?
} else {
- func_801518B0(globalCtx, 0x466, &this->actor);
+ Message_StartTextbox(globalCtx, 0x466, &this->actor);
this->curTextId = 0x466; // What's this? You need somethin'?
}
}
@@ -115,23 +109,23 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
switch (this->curTextId) {
case 0x44C: // "Hey there, little guy! Won't you deposit some Rupees? (first dialogue)
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
if (gSaveContext.weekEventReg[10] & 8) {
- func_801518B0(globalCtx, 0x44E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
} else {
- func_801518B0(globalCtx, 0x44D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44D, &this->actor);
this->curTextId =
0x44D; // "For example, if you deposit 200 Rupees, you'll get an item that holds a lot of Rupees."
}
break;
case 0x44D: // "For example, if you deposit 200 Rupees, you'll get an item that holds a lot of Rupees."
- func_801518B0(globalCtx, 0x44E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
break;
case 0x44F: // "...So, what'll it be? Deposit Rupees Don't deposit Rupees"
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- func_801518B0(globalCtx, 0x450, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ Message_StartTextbox(globalCtx, 0x450, &this->actor);
this->curTextId = 0x450; // "How much? How much? [rupee prompt]
break;
@@ -141,55 +135,55 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
if (this->isNewAccount == true) {
this->isNewAccount = false;
if (this->curTextId != 0x453) { // "That's it? That ain't nothing at all, big spender!
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
}
- func_801518B0(globalCtx, 0x461, &this->actor);
+ Message_StartTextbox(globalCtx, 0x461, &this->actor);
this->curTextId = 0x461; // So, little guy, what's your name?
} else {
if (this->curTextId == 0x453) { // "That's it? That ain't nothing at all, big spender!
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
}
- globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
- func_801518B0(globalCtx, 0x45A, &this->actor);
+ globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
+ Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
break;
case 0x456: // "Is that so? Think about it, little guy!"
case 0x459: // "Heyyy! You don't have that much!
- func_801518B0(globalCtx, 0x44E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44E, &this->actor);
this->curTextId = 0x44E; //" ...So, what'll it be? Deposit Rupees Don't deposit Rupees"
break;
case 0x45A: // "All right, little guy, now I've got a total of [rupees] from you!"
- if (((gSaveContext.roomInf[127][0] & 0xFFFF) >= 200) && (this->previousBankValue < 200) &&
+ if (((gSaveContext.bankRupees & 0xFFFF) >= 200) && (this->previousBankValue < 200) &&
!(gSaveContext.weekEventReg[59] & 0x40)) {
gSaveContext.weekEventReg[59] |= 0x40;
- func_801518B0(globalCtx, 0x45B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x45B, &this->actor);
this->curTextId = 0x45B; // "What's this? You've already saved up 200 Rupees!?!
- } else if (((gSaveContext.roomInf[127][0] & 0xFFFF) >= 1000) && ((this->previousBankValue) < 1000) &&
+ } else if (((gSaveContext.bankRupees & 0xFFFF) >= 1000) && ((this->previousBankValue) < 1000) &&
!(gSaveContext.weekEventReg[59] & 0x80)) {
gSaveContext.weekEventReg[59] |= 0x80;
- func_801518B0(globalCtx, 0x45C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x45C, &this->actor);
this->curTextId = 0x45C; // "What's this? You've already saved up 1000 Rupees!?!
- } else if ((gSaveContext.roomInf[127][0] & 0xFFFF) >= 5000) {
+ } else if ((gSaveContext.bankRupees & 0xFFFF) >= 5000) {
if ((this->previousBankValue < 5000) && !(gSaveContext.weekEventReg[60] & 1)) {
gSaveContext.weekEventReg[60] |= 1;
- func_801518B0(globalCtx, 0x45D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x45D, &this->actor);
this->curTextId = 0x45D; // "What's this? You've already saved up 5000 Rupees?!
- } else if (this->previousBankValue < (s16)(gSaveContext.roomInf[127][0] & 0xFFFF)) {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x45E, &this->actor);
+ } else if (this->previousBankValue < (s16)(gSaveContext.bankRupees & 0xFFFF)) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x45E, &this->actor);
this->curTextId =
0x45E; // "...Hang on there, little guy. I can't take any more deposits. Sorry..."
} else {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- func_801518B0(globalCtx, 0x460, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ Message_StartTextbox(globalCtx, 0x460, &this->actor);
this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!"
}
} else {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- func_801518B0(globalCtx, 0x460, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ Message_StartTextbox(globalCtx, 0x460, &this->actor);
this->curTextId = 0x460; // "Come back and deposit some after you save up a bunch!"
}
break;
@@ -202,30 +196,30 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
EnGinkoMan_BankAward(this, globalCtx);
break;
case 0x461: // So, little guy, what's your name?
- func_801518B0(globalCtx, 0x462, &this->actor);
+ Message_StartTextbox(globalCtx, 0x462, &this->actor);
this->curTextId = 0x462; // Hmm... Link is it?
break;
case 0x462: // Hmm.. Link is it?
- func_801518B0(globalCtx, 0x463, &this->actor);
+ Message_StartTextbox(globalCtx, 0x463, &this->actor);
this->curTextId = 0x463; // Got it... I won't forget your deposits. Let me stamp you
break;
case 0x463: // Got it... I won't forget your deposits. Let me stamp you
- func_801518B0(globalCtx, 0x464, &this->actor);
+ Message_StartTextbox(globalCtx, 0x464, &this->actor);
this->curTextId = 0x464; // Hey, relax! It doesn't leave any marks
break;
case 0x464: // Hey, relax! It doesn't leave any marks
- globalCtx->msgCtx.unk11F22 = 0x44;
+ globalCtx->msgCtx.msgMode = 0x44;
EnGinkoMan_SetupStamp(this); // stamp player
break;
case 0x465: // "There! Now I'll know you when I see you!"
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
- func_801518B0(globalCtx, 0x45A, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
+ Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
break;
case 0x466: // What's this? You need somethin'?
case 0x467: // "What's this? You need somethin' on a day like this? You haven't evacuated yet?
- func_801518B0(globalCtx, 0x468, &this->actor);
+ Message_StartTextbox(globalCtx, 0x468, &this->actor);
this->curTextId = 0x468; // " Deposit Rupees Withdraw Rupees Nothing really"
break;
case 0x469: // "Excuse me, but let me take a look at you..."
@@ -235,35 +229,35 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
case 0x46C: // "Ah, yes...[Link], right? If I remember, you're the little guy who deposited [rupees]."
case 0x47E: // "Your deposits total [rupees]."
if (this->choiceDepositWithdrawl == GINKOMAN_CHOICE_DEPOSIT) {
- if ((u32)(gSaveContext.roomInf[127][0] & 0xFFFF) >= 5000) {
- func_801518B0(globalCtx, 0x45F, &this->actor);
+ if ((u32)(gSaveContext.bankRupees & 0xFFFF) >= 5000) {
+ Message_StartTextbox(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // "Excuuuse me! But I can't take anymore deposits!
} else if (gSaveContext.rupees == 0) {
- func_801518B0(globalCtx, 0x458, &this->actor);
+ Message_StartTextbox(globalCtx, 0x458, &this->actor);
this->curTextId =
0x458; // "Hmm...You play mean jokes, little guy! You haven't even got a single Rupee!
} else {
- func_801518B0(globalCtx, 0x479, &this->actor);
+ Message_StartTextbox(globalCtx, 0x479, &this->actor);
this->curTextId = 0x479; // "Well, are you gonna make a deposit?"
}
} else if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
- func_801518B0(globalCtx, 0x46D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46D, &this->actor);
// "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just rumors!"
this->curTextId = 0x46D;
} else { // GINKOMAN_CHOICE_WITHDRAWL
- func_801518B0(globalCtx, 0x46B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46B, &this->actor);
this->curTextId = 0x46B; // "So..."
}
this->choiceDepositWithdrawl = GINKOMAN_CHOICE_RESET;
break;
case 0x46B: // So...
- func_801518B0(globalCtx, 0x46E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46E, &this->actor);
this->curTextId = 0x46E; // "How much do you want? [rupee prompt]
break;
case 0x46D: // "Look, little guy, if it's 'cause of the bad rumors going around, forget it! They're just
// rumors!"
- func_801518B0(globalCtx, 0x46B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46B, &this->actor);
this->curTextId = 0x46B; // So...
break;
case 0x470: // "Is that so? Come back and deposit some after saving up a bunch!"
@@ -275,34 +269,34 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
break;
case 0x476: // "...You haven't deposited that many Rupees, so that much isn't available for withdrawal. Do the
// math!
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
case 0x475: // "What's this? Look, little guy, you can't hold this many rupees! You got that?"
case 0x47C: // "Is that so? Think it over, little guy! So what are you gonna do?"
case 0x47D: // duplicate of 48
- func_801518B0(globalCtx, 0x468, &this->actor);
+ Message_StartTextbox(globalCtx, 0x468, &this->actor);
this->curTextId = 0x468; // " Deposit Rupees Withdraw Rupees Nothing really"
break;
case 0x472: // "What's this? It's a waste to take out such a tiny bit! ...But if you say so!"
case 0x473: // Use it wisely...
case 0x474: // "Aw, you're taking out all that? If you spend it like that, it'll all be gone before you know
// it!"
- if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
- func_801518B0(globalCtx, 0x478, &this->actor);
+ if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
+ Message_StartTextbox(globalCtx, 0x478, &this->actor);
// "Look, little guy, all the Rupees you deposited are gone, so you can't use that stamp anymore."
this->curTextId = 0x478;
} else {
- globalCtx->msgCtx.bankRupees = gSaveContext.roomInf[127][0] & 0xFFFF;
- func_801518B0(globalCtx, 0x45A, &this->actor);
+ globalCtx->msgCtx.bankRupees = gSaveContext.bankRupees & 0xFFFF;
+ Message_StartTextbox(globalCtx, 0x45A, &this->actor);
this->curTextId = 0x45A; // "All right, little guy, now I've got a total of [rupees] from you!"
}
break;
case 0x477: // "...You know, at this time of day there's a 4 Rupee service charge on withdrawals!"
- func_801518B0(globalCtx, 0x471, &this->actor);
+ Message_StartTextbox(globalCtx, 0x471, &this->actor);
this->curTextId = 0x471; // "Are you really withdrawing [rupees selected]? Y/n"
this->serviceFee = globalCtx->msgCtx.unk1206C;
break;
case 0x479: // Well, are you gonna make a deposit?
- func_801518B0(globalCtx, 0x44F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44F, &this->actor);
this->curTextId = 0x44F; // "All right! So..."
break;
}
@@ -317,24 +311,24 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
switch (this->curTextId) {
case 0x44E: // "...So, what'll it be?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
- if ((gSaveContext.roomInf[127][0] & 0xFFFF) >= 5000) {
+ if ((gSaveContext.bankRupees & 0xFFFF) >= 5000) {
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0x45F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x45F, &this->actor);
this->curTextId = 0x45F; // bank full, cannot accept more
} else {
if (gSaveContext.rupees > 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x44F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x44F, &this->actor);
this->curTextId = 0x44F; // "All right! so..."
} else {
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0x458, &this->actor);
+ Message_StartTextbox(globalCtx, 0x458, &this->actor);
this->curTextId = 0x458; // you haven't even gotten a single rup
}
}
} else { // GINKOMAN_CHOICE_NO
func_8019F230();
- func_801518B0(globalCtx, 0x451, &this->actor);
+ Message_StartTextbox(globalCtx, 0x451, &this->actor);
this->curTextId = 0x451; // dont say that, come on, trust me!
}
break;
@@ -342,42 +336,41 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
if (gSaveContext.rupees < globalCtx->msgCtx.bankRupeesSelected) {
play_sound(NA_SE_SY_ERROR);
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x459, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x459, &this->actor);
this->curTextId = 0x459; // HEY you dont have that much
} else {
func_8019F208();
if (globalCtx->msgCtx.bankRupeesSelected >= 100) {
- func_801518B0(globalCtx, 0x455, &this->actor);
+ Message_StartTextbox(globalCtx, 0x455, &this->actor);
this->curTextId = 0x455; // You're really going to be give me that much? Rich little guy!
} else if (globalCtx->msgCtx.bankRupeesSelected >= 10) {
- func_801518B0(globalCtx, 0x454, &this->actor);
+ Message_StartTextbox(globalCtx, 0x454, &this->actor);
this->curTextId = 0x454; // Seriously? that's a lot. A lot!
} else {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x453, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x453, &this->actor);
this->curTextId = 0x453; // That's it? That aint nothing at all
}
- if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
+ if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
this->isNewAccount = true;
}
func_801159EC((s16)-globalCtx->msgCtx.bankRupeesSelected);
- this->previousBankValue = gSaveContext.roomInf[127][0] & 0xFFFF;
- if (1) {} // Needed to match
- gSaveContext.roomInf[127][0] =
- (gSaveContext.roomInf[127][0] & 0xFFFF0000) |
- ((gSaveContext.roomInf[127][0] & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected);
+ this->previousBankValue = gSaveContext.bankRupees & 0xFFFF;
+ gSaveContext.bankRupees =
+ ((gSaveContext.bankRupees & 0xFFFF) + globalCtx->msgCtx.bankRupeesSelected) |
+ (gSaveContext.bankRupees & 0xFFFF0000);
}
} else { // GINKOMAN_CHOICE_NO
func_8019F230();
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- if ((gSaveContext.roomInf[127][0] & 0xFFFF) == 0) {
- func_801518B0(globalCtx, 0x456, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ if ((gSaveContext.bankRupees & 0xFFFF) == 0) {
+ Message_StartTextbox(globalCtx, 0x456, &this->actor);
this->curTextId = 0x456; // Is that so? think about it
} else {
- func_801518B0(globalCtx, 0x47D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x47D, &this->actor);
this->curTextId = 0x47D; // is that so? think it over
}
}
@@ -385,57 +378,57 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
case 0x468: // Deposit OR withdrawl OR cancel screen
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_CANCEL) {
func_8019F230();
- func_801518B0(globalCtx, 0x470, &this->actor);
+ Message_StartTextbox(globalCtx, 0x470, &this->actor);
this->curTextId = 0x470; // "Is that so? Come back and deposit some after saving up a bunch!"
} else {
func_8019F208();
this->choiceDepositWithdrawl = globalCtx->msgCtx.choiceIndex;
if (!this->isStampChecked) {
this->isStampChecked = true;
- func_801518B0(globalCtx, 0x469, &this->actor);
+ Message_StartTextbox(globalCtx, 0x469, &this->actor);
this->curTextId = 0x469; // "Excuse me, but let me take a look at you..."
} else {
- func_801518B0(globalCtx, 0x47E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x47E, &this->actor);
this->curTextId = 0x47E; // "Your deposits total [rupees]."
}
}
break;
case 0x471: // Are you really withdrawling [selected rupees]?
if (globalCtx->msgCtx.choiceIndex == GINKOMAN_CHOICE_YES) {
- if ((s32)((gSaveContext.roomInf[127][0] & 0xFFFF)) <
+ if ((s32)((gSaveContext.bankRupees & 0xFFFF)) <
((s32)(globalCtx->msgCtx.bankRupeesSelected + this->serviceFee))) {
play_sound(NA_SE_SY_ERROR);
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_FLOORSMACKING);
- func_801518B0(globalCtx, 0x476, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_FLOORSMACKING);
+ Message_StartTextbox(globalCtx, 0x476, &this->actor);
this->curTextId = 0x476; // you dont have enough deposited to withdrawl
} else if (CUR_CAPACITY(UPG_WALLET) < (globalCtx->msgCtx.bankRupeesSelected + gSaveContext.rupees)) {
// check if wallet is big enough
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0x475, &this->actor);
+ Message_StartTextbox(globalCtx, 0x475, &this->actor);
this->curTextId = 0x475; // You can't hold that many in your wallet
} else {
func_8019F208();
if (globalCtx->msgCtx.bankRupeesSelected >= 100) {
- func_801518B0(globalCtx, 0x474, &this->actor);
+ Message_StartTextbox(globalCtx, 0x474, &this->actor);
this->curTextId = 0x474; // Aw, you're taking out all that?
} else if (globalCtx->msgCtx.bankRupeesSelected >= 10) {
- func_801518B0(globalCtx, 0x473, &this->actor);
+ Message_StartTextbox(globalCtx, 0x473, &this->actor);
this->curTextId = 0x473; // use it wisely
} else {
- func_801518B0(globalCtx, 0x472, &this->actor);
+ Message_StartTextbox(globalCtx, 0x472, &this->actor);
this->curTextId = 0x472; // It's a waste to take out such a tiny bit
}
- this->previousBankValue = (s16)(gSaveContext.roomInf[127][0] & 0xFFFF);
- gSaveContext.roomInf[127][0] =
- (gSaveContext.roomInf[127][0] & 0xFFFF0000) |
- (((gSaveContext.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
- this->serviceFee);
+ this->previousBankValue = (s16)(gSaveContext.bankRupees & 0xFFFF);
+ gSaveContext.bankRupees =
+ (((gSaveContext.bankRupees & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
+ this->serviceFee) |
+ (gSaveContext.bankRupees & 0xFFFF0000);
func_801159EC(globalCtx->msgCtx.bankRupeesSelected);
}
} else {
func_8019F230();
- func_801518B0(globalCtx, 0x47C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x47C, &this->actor);
this->curTextId = 0x47C; // "Is that so? Think it over, little guy! So what are you gonna do?"
}
break;
@@ -447,23 +440,23 @@ void EnGinkoMan_WaitForRupeeCount(EnGinkoMan* this, GlobalContext* globalCtx) {
switch (this->curTextId) {
case 0x450: // "How much? How much?" [rupee prompt] Set the amount with [Control Stick] and
if (globalCtx->msgCtx.bankRupeesSelected == 0) {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x457, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x457, &this->actor);
this->curTextId = 0x457; // Zero Rupees? Cruel joke!
} else {
- func_801518B0(globalCtx, 0x452, &this->actor);
+ Message_StartTextbox(globalCtx, 0x452, &this->actor);
this->curTextId = 0x452; // Really? are you really depositing [x]? Y/n
}
break;
case 0x46E: // "How much do you want?" [rupee prompt] Set the amount with [Control Stick]
if (globalCtx->msgCtx.bankRupeesSelected == 0) {
- func_801518B0(globalCtx, 0x46F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46F, &this->actor);
this->curTextId = 0x46F; // "Zero Rupees?!? That's a cruel joke!"
} else if (gSaveContext.isNight == 1) {
- func_801518B0(globalCtx, 0x477, &this->actor);
+ Message_StartTextbox(globalCtx, 0x477, &this->actor);
this->curTextId = 0x477; // "...You know, at this time of day there's a 4 Rupee service charge...
} else {
- func_801518B0(globalCtx, 0x471, &this->actor);
+ Message_StartTextbox(globalCtx, 0x471, &this->actor);
this->curTextId = 0x471; // "Are you really withdrawing [rupees selected]? Y/n
this->serviceFee = 0;
}
@@ -501,7 +494,8 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) {
break;
}
- if ((this->skelAnime.animation == &D_060008C0) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if ((this->skelAnime.animation == &object_boj_Anim_0008C0) &&
+ Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BANK_MAN_HAND_HIT);
}
}
@@ -512,7 +506,7 @@ void EnGinkoMan_SetupBankAward(EnGinkoMan* this) {
void EnGinkoMan_BankAward(EnGinkoMan* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
- // ? when would bank have a parent?
+ // Parent is the player when starting to receive the award
this->actor.parent = NULL;
EnGinkoMan_SetupBankAward2(this);
} else if (this->curTextId == 0x45B) { // "Whats this, you already saved up 200?"
@@ -535,19 +529,19 @@ void EnGinkoMan_SetupBankAward2(EnGinkoMan* this) {
this->actionFunc = EnGinkoMan_BankAward2;
}
-// separate function to handle bank rewards... if the bank has a parent actor? might be unused
+// separate function to handle bank rewards... called while the player is receiving the award
void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (!(gSaveContext.weekEventReg[10] & 8) && (this->curTextId == 0x45B)) {
// "What's this? You've already saved up 200 Rupees!?! Well, little guy, here's your special gift. Take
// it!"
gSaveContext.weekEventReg[10] |= 8;
- func_801518B0(globalCtx, 0x47A, &this->actor);
- this->curTextId = 0x47A; // "See! Doesn't it hold more than your old one?
+ Message_StartTextbox(globalCtx, 0x47A, &this->actor);
+ this->curTextId = 0x47A; // Message after receiving reward for depositing 200 rupees.
} else {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x47B, &this->actor);
- this->curTextId = 0x47B; // "Is that so? Think it over, little guy! So what are you gonna do?"
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x47B, &this->actor);
+ this->curTextId = 0x47B; // Message after receiving reward for depositing 1000 rupees.
}
EnGinkoMan_SetupDialogue(this);
@@ -564,7 +558,7 @@ void EnGinkoMan_BankAward2(EnGinkoMan* this, GlobalContext* globalCtx) {
}
void EnGinkoMan_SetupStamp(EnGinkoMan* this) {
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_REACHING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_REACHING);
this->actionFunc = EnGinkoMan_Stamp;
}
@@ -577,18 +571,18 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
switch (this->curTextId) {
case 0x464: // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt."
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- func_801518B0(globalCtx, 0x465, &this->actor);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ Message_StartTextbox(globalCtx, 0x465, &this->actor);
this->curTextId = 0x465; // "There! Now I'll know you when I see you!"
break;
case 0x469: // "Excuse me, but let me take a look at you..."
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_SITTING);
- globalCtx->msgCtx.bankRupees = (gSaveContext.roomInf[127][0] & 0xFFFF);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_SITTING);
+ globalCtx->msgCtx.bankRupees = (gSaveContext.bankRupees & 0xFFFF);
if ((CURRENT_DAY == 3) && (gSaveContext.isNight == 1)) {
- func_801518B0(globalCtx, 0x46C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46C, &this->actor);
this->curTextId = 0x46C; // "Ah, yes...[Link], right?
} else {
- func_801518B0(globalCtx, 0x46A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x46A, &this->actor);
this->curTextId = 0x46A; // "Ah, yes...[Link].
}
break;
@@ -601,14 +595,14 @@ void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) {
void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) {
if (this->actor.xzDistToPlayer > 160.0f) {
if (this->animTimer == 0) {
- if (this->skelAnime.animation != &D_06004A7C) {
+ if (this->skelAnime.animation != &object_boj_Anim_004A7C) {
this->animTimer = 40;
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_ADVERTISING);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_ADVERTISING);
}
}
- } else if ((this->animTimer == 0) && (this->skelAnime.animation != &D_06000AC4)) {
+ } else if ((this->animTimer == 0) && (this->skelAnime.animation != &object_boj_Anim_000AC4)) {
this->animTimer = 40;
- Actor_ChangeAnimation(&this->skelAnime, animations, GINKO_AMAZED);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, GINKO_AMAZED);
}
DECR(this->animTimer);
@@ -616,7 +610,7 @@ void EnGinkoMan_SwitchAnimation(EnGinkoMan* this, GlobalContext* globalCtx) {
void EnGinkoMan_FacePlayer(EnGinkoMan* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- if (this->skelAnime.animation != &D_06004A7C) {
+ if (this->skelAnime.animation != &object_boj_Anim_004A7C) {
func_800E9250(globalCtx, &this->actor, &this->limb15Rot, &this->limb8Rot, this->actor.focus.pos);
} else {
func_800E8F08(&this->limb15Rot, &this->limb8Rot);
@@ -633,11 +627,11 @@ void EnGinkoMan_Update(Actor* thisx, GlobalContext* globalCtx) {
}
s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- Actor* arg) {
- EnGinkoMan* this = (EnGinkoMan*)arg;
+ Actor* thisx) {
+ EnGinkoMan* this = THIS;
if (limbIndex == 15) {
- *dList = D_0600B1D8;
+ *dList = object_boj_DL_00B1D8;
}
if (limbIndex == 15) {
@@ -650,10 +644,10 @@ s32 EnGinkoMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
Matrix_InsertZRotation_s(-this->limb8Rot.x, MTXMODE_APPLY);
}
- return 0;
+ return false;
}
-void EnGinkoMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
+void EnGinkoMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
void EnGinkoMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
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 91ae3270fa..2142ca5f02 100644
--- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c
+++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c
@@ -6,7 +6,7 @@
#include "z_en_girla.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnGirlA*)thisx)
@@ -31,7 +31,7 @@ s32 EnGirlA_CanBuyBombBag20BombShop(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuyBombBag30BombShop(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuyBombchus(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuyBombs(GlobalContext* globalCtx, EnGirlA* this);
-s32 EnGirlA_CanBuyBottle(GlobalContext* globalCtx, EnGirlA* this);
+s32 EnGirlA_CanBuyBottleStolen(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuySword(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuyShieldMirror(GlobalContext* globalCtx, EnGirlA* this);
s32 EnGirlA_CanBuyFairy(GlobalContext* globalCtx, EnGirlA* this);
@@ -64,91 +64,91 @@ const ActorInit En_GirlA_InitVars = {
};
static ShopItemEntry sShopItemEntries[] = {
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X083F, 0X0840, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x083F, 0x0840, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0X0841, 0X0842, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
+ { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0x0841, 0x0842, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_BLUE, func_800B8050, 1, 0X0843, 0X0844, GI_POTION_BLUE, EnGirlA_CanBuyPotionBlue,
+ { OBJECT_GI_LIQUID, GID_POTION_BLUE, func_800B8050, 1, 0x0843, 0x0844, GI_POTION_BLUE, EnGirlA_CanBuyPotionBlue,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOTTLE_04, GID_FAIRY, func_800B8050, 1, 0X06B6, 0X06B7, GI_FAIRY, EnGirlA_CanBuyFairy,
+ { OBJECT_GI_BOTTLE_04, GID_FAIRY, func_800B8050, 1, 0x06B6, 0x06B7, GI_FAIRY, EnGirlA_CanBuyFairy,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_LARGE, func_800B8050, 50, 0X06BA, 0X06BB, GI_ARROWS_40, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_LARGE, func_800B8050, 50, 0x06BA, 0x06BB, GI_ARROWS_40, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0X06B2, 0X06B3, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
+ { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0x06B2, 0x06B3, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0X06AE, 0X06AF, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
+ { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0x06AE, 0x06AF, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
EnGirlA_BuyShieldHero, EnGirlA_BuyFanfare },
- { OBJECT_GI_STICK, GID_STICK, NULL, 1, 0X06B4, 0X06B5, GI_STICKS_1, EnGirlA_CanBuyStick, EnGirlA_BuyStick,
+ { OBJECT_GI_STICK, GID_STICK, NULL, 1, 0x06B4, 0x06B5, GI_STICKS_1, EnGirlA_CanBuyStick, EnGirlA_BuyStick,
EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_800B8050, 30, 0X06B8, 0X06B9, GI_ARROWS_30, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_800B8050, 30, 0x06B8, 0x06B9, GI_ARROWS_30, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_NUTS, GID_NUTS, func_800B8118, 10, 0X06B0, 0X06B1, GI_NUTS_10, EnGirlA_CanBuyNuts, EnGirlA_BuyNuts,
+ { OBJECT_GI_NUTS, GID_NUTS, func_800B8118, 10, 0x06B0, 0x06B1, GI_NUTS_10, EnGirlA_CanBuyNuts, EnGirlA_BuyNuts,
EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X06AC, 0X06AD, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x06AC, 0x06AD, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOTTLE_04, GID_FAIRY, func_800B8050, 1, 0X06D3, 0X06D4, GI_FAIRY, EnGirlA_CanBuyFairy,
+ { OBJECT_GI_BOTTLE_04, GID_FAIRY, func_800B8050, 1, 0x06D3, 0x06D4, GI_FAIRY, EnGirlA_CanBuyFairy,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_800B8050, 30, 0X06D5, 0X06D6, GI_ARROWS_30, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_800B8050, 30, 0x06D5, 0x06D6, GI_ARROWS_30, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_LARGE, func_800B8050, 50, 0X06D7, 0X06D8, GI_ARROWS_40, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_LARGE, func_800B8050, 50, 0x06D7, 0x06D8, GI_ARROWS_40, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0X06CF, 0X06D0, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
+ { OBJECT_GI_LIQUID, GID_POTION_GREEN, func_800B8050, 1, 0x06CF, 0x06D0, GI_POTION_GREEN, EnGirlA_CanBuyPotionGreen,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_NUTS, GID_NUTS, func_800B8118, 10, 0X06CD, 0X06CE, GI_NUTS_10, EnGirlA_CanBuyNuts, EnGirlA_BuyNuts,
+ { OBJECT_GI_NUTS, GID_NUTS, func_800B8118, 10, 0x06CD, 0x06CE, GI_NUTS_10, EnGirlA_CanBuyNuts, EnGirlA_BuyNuts,
EnGirlA_BuyFanfare },
- { OBJECT_GI_STICK, GID_STICK, NULL, 1, 0X06D1, 0X06D2, GI_STICKS_1, EnGirlA_CanBuyStick, EnGirlA_BuyStick,
+ { OBJECT_GI_STICK, GID_STICK, NULL, 1, 0x06D1, 0x06D2, GI_STICKS_1, EnGirlA_CanBuyStick, EnGirlA_BuyStick,
EnGirlA_BuyFanfare },
- { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0X06CB, 0X06CC, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
+ { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0x06CB, 0x06CC, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
EnGirlA_BuyShieldHero, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X06C9, 0X06CA, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x06C9, 0x06CA, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_MASK06, GID_MASK_ALL_NIGHT, func_800B8050, 1, 0X29D9, 0X29DA, GI_MASK_ALL_NIGHT,
+ { OBJECT_GI_MASK06, GID_MASK_ALL_NIGHT, func_800B8050, 1, 0x29D9, 0x29DA, GI_MASK_ALL_NIGHT,
EnGirlA_CanBuyMaskAllNight, EnGirlA_BuyMaskAllNight, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_20, func_800B8050, 1, 0X29DB, 0X29DC, GI_BOMB_BAG_20,
+ { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_20, func_800B8050, 1, 0x29DB, 0x29DC, GI_BOMB_BAG_20,
EnGirlA_CanBuyBombBagCuriosityShop, EnGirlA_BuyBombBag, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_30, func_800B8050, 2, 0X29DB, 0X29DC, GI_BOMB_BAG_30,
+ { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_30, func_800B8050, 2, 0x29DB, 0x29DC, GI_BOMB_BAG_30,
EnGirlA_CanBuyBombBagCuriosityShop, EnGirlA_BuyBombBag, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_40, func_800B8050, 3, 0X29DB, 0X29DC, GI_BOMB_BAG_40,
+ { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_40, func_800B8050, 3, 0x29DB, 0x29DC, GI_BOMB_BAG_40,
EnGirlA_CanBuyBombBagCuriosityShop, EnGirlA_BuyBombBag, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_20, func_800B8050, 1, 0X0654, 0X0655, GI_BOMB_BAG_20,
+ { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_20, func_800B8050, 1, 0x0654, 0x0655, GI_BOMB_BAG_20,
EnGirlA_CanBuyBombBag20BombShop, EnGirlA_BuyBombBag, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_30, func_800B8050, 2, 0X0656, 0X0657, GI_BOMB_BAG_30,
+ { OBJECT_GI_BOMBPOUCH, GID_BOMB_BAG_30, func_800B8050, 2, 0x0656, 0x0657, GI_BOMB_BAG_30,
EnGirlA_CanBuyBombBag30BombShop, EnGirlA_BuyBombBag, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMB_2, GID_BOMBCHU, func_800B8050, 10, 0X0652, 0X0653, GI_BOMBCHUS_10, EnGirlA_CanBuyBombchus,
+ { OBJECT_GI_BOMB_2, GID_BOMBCHU, func_800B8050, 10, 0x0652, 0x0653, GI_BOMBCHUS_10, EnGirlA_CanBuyBombchus,
EnGirlA_BuyBombchus, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0X0650, 0X0651, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
+ { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0x0650, 0x0651, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
EnGirlA_BuyFanfare },
- { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0X12DB, 0X12DC, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
+ { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0x12DB, 0x12DC, GI_SHIELD_HERO, EnGirlA_CanBuyShieldHero,
EnGirlA_BuyShieldHero, EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0X12DD, 0X12DE, GI_ARROWS_10, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0x12DD, 0x12DE, GI_ARROWS_10, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X12DF, 0X12E0, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x12DF, 0x12E0, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0X0BC5, 0X0BC6, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
+ { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0x0BC5, 0x0BC6, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0X0BC7, 0X0BC8, GI_ARROWS_10, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0x0BC7, 0x0BC8, GI_ARROWS_10, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X0BC9, 0X0BCA, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x0BC9, 0x0BCA, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0X0BCB, 0X0BCC, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
+ { OBJECT_GI_BOMB_1, GID_BOMB, func_800B8050, 10, 0x0BCB, 0x0BCC, GI_BOMBS_10, EnGirlA_CanBuyBombs, EnGirlA_BuyBombs,
EnGirlA_BuyFanfare },
- { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0X0BCD, 0X0BCE, GI_ARROWS_10, EnGirlA_CanBuyArrows,
+ { OBJECT_GI_ARROW, GID_ARROWS_SMALL, func_800B8050, 10, 0x0BCD, 0x0BCE, GI_ARROWS_10, EnGirlA_CanBuyArrows,
EnGirlA_BuyArrows, EnGirlA_BuyFanfare },
- { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0X0BCF, 0X0BD0, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
+ { OBJECT_GI_LIQUID, GID_POTION_RED, func_800B8050, 1, 0x0BCF, 0x0BD0, GI_POTION_RED, EnGirlA_CanBuyPotionRed,
EnGirlA_BuyBottleItem, EnGirlA_BuyFanfare },
- { OBJECT_GI_BOTTLE, GID_BOTTLE, func_800B8050, 1, 0X29F8, 0X29F9, GI_BOTTLE, EnGirlA_CanBuyBottle,
+ { OBJECT_GI_BOTTLE, GID_BOTTLE, func_800B8050, 1, 0x29F8, 0x29F9, GI_BOTTLE_STOLEN, EnGirlA_CanBuyBottleStolen,
EnGirlA_BuyBottle, EnGirlA_BuyFanfare },
- { OBJECT_GI_SWORD_4, GID_SWORD_GREAT_FAIRY, func_800B8050, 4, 0X29F2, 0X29F3, GI_SWORD_GREAT_FAIRY,
+ { OBJECT_GI_SWORD_4, GID_SWORD_GREAT_FAIRY, func_800B8050, 4, 0x29F2, 0x29F3, GI_SWORD_GREAT_FAIRY,
EnGirlA_CanBuySword, EnGirlA_BuySword, EnGirlA_BuyFanfare },
- { OBJECT_GI_SWORD_1, GID_SWORD_KOKIRI, func_800B8050, 1, 0X29F4, 0X29F5, GI_SWORD_KOKIRI, EnGirlA_CanBuySword,
+ { OBJECT_GI_SWORD_1, GID_SWORD_KOKIRI, func_800B8050, 1, 0x29F4, 0x29F5, GI_SWORD_KOKIRI, EnGirlA_CanBuySword,
EnGirlA_BuySword, EnGirlA_BuyFanfare },
- { OBJECT_GI_SWORD_2, GID_SWORD_RAZOR, func_800B8050, 2, 0X29F4, 0X29F5, GI_SWORD_RAZOR, EnGirlA_CanBuySword,
+ { OBJECT_GI_SWORD_2, GID_SWORD_RAZOR, func_800B8050, 2, 0x29F4, 0x29F5, GI_SWORD_RAZOR, EnGirlA_CanBuySword,
EnGirlA_BuySword, EnGirlA_BuyFanfare },
- { OBJECT_GI_SWORD_3, GID_SWORD_GILDED, func_800B8050, 3, 0X29F4, 0X29F5, GI_SWORD_GILDED, EnGirlA_CanBuySword,
+ { OBJECT_GI_SWORD_3, GID_SWORD_GILDED, func_800B8050, 3, 0x29F4, 0x29F5, GI_SWORD_GILDED, EnGirlA_CanBuySword,
EnGirlA_BuySword, EnGirlA_BuyFanfare },
- { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0X29F6, 0X29F7, GI_SHIELD_HERO_2, EnGirlA_CanBuyShieldHero,
+ { OBJECT_GI_SHIELD_2, GID_SHIELD_HERO, func_800B8050, 1, 0x29F6, 0x29F7, GI_SHIELD_HERO_2, EnGirlA_CanBuyShieldHero,
EnGirlA_BuyShieldHero, EnGirlA_BuyFanfare },
- { OBJECT_GI_SHIELD_3, GID_SHIELD_MIRROR, func_800B8050, 1, 0X29F6, 0X29F7, GI_SHIELD_MIRROR,
+ { OBJECT_GI_SHIELD_3, GID_SHIELD_MIRROR, func_800B8050, 1, 0x29F6, 0x29F7, GI_SHIELD_MIRROR,
EnGirlA_CanBuyShieldMirror, EnGirlA_BuyShieldMirror, EnGirlA_BuyFanfare },
};
@@ -185,7 +185,7 @@ void EnGirlA_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
s32 EnGirlA_CanBuyPotionRed(GlobalContext* globalCtx, EnGirlA* this) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
@@ -195,7 +195,7 @@ s32 EnGirlA_CanBuyPotionRed(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuyPotionGreen(GlobalContext* globalCtx, EnGirlA* this) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
@@ -208,7 +208,7 @@ s32 EnGirlA_CanBuyPotionBlue(GlobalContext* globalCtx, EnGirlA* this) {
if (!(gSaveContext.weekEventReg[53] & 8)) {
return CANBUY_RESULT_CANNOT_GET_NOW;
}
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (!(gSaveContext.weekEventReg[53] & 0x10)) {
@@ -341,7 +341,7 @@ s32 EnGirlA_CanBuyBombs(GlobalContext* globalCtx, EnGirlA* this) {
return CANBUY_RESULT_SUCCESS_2;
}
-s32 EnGirlA_CanBuyBottle(GlobalContext* globalCtx, EnGirlA* this) {
+s32 EnGirlA_CanBuyBottleStolen(GlobalContext* globalCtx, EnGirlA* this) {
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
return CANBUY_RESULT_NEED_RUPEES;
}
@@ -366,7 +366,7 @@ s32 EnGirlA_CanBuyShieldMirror(GlobalContext* globalCtx, EnGirlA* this) {
}
s32 EnGirlA_CanBuyFairy(GlobalContext* globalCtx, EnGirlA* this) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
return CANBUY_RESULT_NEED_EMPTY_BOTTLE;
}
if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
@@ -538,7 +538,7 @@ void EnGirlA_InitalUpdate(EnGirlA* this, GlobalContext* globalCtx) {
ShopItemEntry* shopItem = &sShopItemEntries[params];
if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.objBankIndex = this->objIndex;
this->actor.textId = shopItem->descriptionTextId;
this->choiceTextId = shopItem->choiceTextId;
@@ -558,7 +558,7 @@ void EnGirlA_InitalUpdate(EnGirlA* this, GlobalContext* globalCtx) {
this->itemParams = shopItem->params;
this->drawFunc = shopItem->drawFunc;
this->getItemDrawId = shopItem->getItemDrawId;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
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 5e3d1b136c..fa2711501b 100644
--- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.h
+++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.h
@@ -103,7 +103,7 @@ typedef enum {
/* 39 */ SI_SWORD_RAZOR,
/* 40 */ SI_SWORD_GILDED,
/* 41 */ SI_SHIELD_HERO_4,
- /* 42 */ SI_SHIELD_MIRROR,
+ /* 42 */ SI_SHIELD_MIRROR
} EnGirlAShopItemId;
extern const ActorInit En_GirlA_InitVars;
diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.c b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
index acc972053f..4f2d774980 100644
--- a/src/overlays/actors/ovl_En_Gk/z_en_gk.c
+++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.c
@@ -5,8 +5,9 @@
*/
#include "z_en_gk.h"
+#include "objects/object_gk/object_gk.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnGk*)thisx)
@@ -15,7 +16,23 @@ void EnGk_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnGk_Update(Actor* thisx, GlobalContext* globalCtx);
void EnGk_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B51698(EnGk* this, GlobalContext* globalCtx);
+void func_80B51760(EnGk* this, GlobalContext* globalCtx);
+void func_80B51970(EnGk* this, GlobalContext* globalCtx);
+void func_80B51B40(EnGk* this, GlobalContext* globalCtx);
+void func_80B51D9C(EnGk* this, GlobalContext* globalCtx);
+void func_80B51EA4(EnGk* this, GlobalContext* globalCtx);
+void func_80B51FD0(EnGk* this, GlobalContext* globalCtx);
+void func_80B5202C(EnGk* this, GlobalContext* globalCtx);
+void func_80B5216C(EnGk* this, GlobalContext* globalCtx);
+void func_80B521E8(EnGk* this, GlobalContext* globalCtx);
+void func_80B5227C(EnGk* this, GlobalContext* globalCtx);
+void func_80B52340(EnGk* this, GlobalContext* globalCtx);
+void func_80B52430(EnGk* this, GlobalContext* globalCtx);
+void func_80B5253C(EnGk* this, GlobalContext* globalCtx);
+void func_80B525E0(EnGk* this, GlobalContext* globalCtx);
+void func_80B52654(EnGk* this, GlobalContext* globalCtx);
+
const ActorInit En_Gk_InitVars = {
ACTOR_EN_GK,
ACTORCAT_NPC,
@@ -28,18 +45,29 @@ const ActorInit En_Gk_InitVars = {
(ActorFunc)EnGk_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80B53210 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 24, 32, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80B5323C = { 0, 24, 32, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 24, 32, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80B53248 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -74,89 +102,1184 @@ static DamageTable D_80B53248 = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-#endif
+static AnimationInfo sAnimations[] = {
+ { &object_gk_Anim_00787C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_007DC4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_gk_Anim_0092C0, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_005EDC, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_gk_Anim_009638, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_008774, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_gk_Anim_00AE34, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_00BD90, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_gk_Anim_00C308, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_009858, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_gk_Anim_009D88, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_gk_Anim_00A21C, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_gk_Anim_00AAEC, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+};
-extern ColliderCylinderInit D_80B53210;
-extern CollisionCheckInfoInit2 D_80B5323C;
-extern DamageTable D_80B53248;
+Color_RGBA8 D_80B533A0 = { 255, 255, 255, 255 };
+Color_RGBA8 D_80B533A4 = { 50, 150, 150, 0 };
-extern UNK_TYPE D_06006688;
-extern UNK_TYPE D_0600787C;
+u16 func_80B50410(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50410.s")
+ if (globalCtx->sceneNum == SCENE_17SETUGEN2) {
+ if (player->transformation == PLAYER_FORM_GORON) {
+ if (!(gSaveContext.weekEventReg[40] & 0x80)) {
+ switch (this->unk_31C) {
+ case 0xE7A:
+ return 0xE7B;
+ case 0xE7B:
+ return 0xE7C;
+ case 0xE7C:
+ return 0xE7D;
+ case 0xE7D:
+ return 0xE7E;
+ case 0xE7E:
+ return 0xE7F;
+ case 0xE7F:
+ gSaveContext.weekEventReg[40] |= 0x80;
+ this->unk_1E4 |= 1;
+ return 0xE80;
+ default:
+ return 0xE7A;
+ }
+ } else {
+ this->unk_1E4 |= 1;
+ return 0xE81;
+ }
+ } else if (!(gSaveContext.weekEventReg[41] & 1)) {
+ switch (this->unk_31C) {
+ case 0xE82:
+ return 0xE83;
+ case 0xE83:
+ return 0xE7D;
+ case 0xE7D:
+ return 0xE7E;
+ case 0xE7E:
+ return 0xE7F;
+ case 0xE7F:
+ gSaveContext.weekEventReg[41] |= 1;
+ this->unk_1E4 |= 1;
+ return 0xE80;
+ default:
+ return 0xE82;
+ }
+ } else {
+ this->unk_1E4 |= 1;
+ return 0xE81;
+ }
+ } else if (globalCtx->sceneNum == SCENE_GORONRACE) {
+ if (player->transformation == PLAYER_FORM_GORON) {
+ if (!(gSaveContext.weekEventReg[41] & 4)) {
+ if (this->unk_31C == 0xE88) {
+ if (!(gSaveContext.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
+ return 0xE89;
+ }
+ gSaveContext.weekEventReg[41] |= 4;
+ this->unk_1E4 |= 1;
+ return 0xE94;
+ }
+ return 0xE88;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50710.s")
+ if ((this->unk_31C == 0xE8D) || (this->unk_31C == 0xE98)) {
+ if (!(gSaveContext.weekEventReg[41] & 8) || Interface_HasEmptyBottle()) {
+ return 0xE89;
+ }
+ gSaveContext.weekEventReg[41] |= 4;
+ this->unk_1E4 |= 1;
+ return 0xE94;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B507A0.s")
+ if (this->unk_1E4 & 0x10) {
+ return 0xE8D;
+ }
+ return 0xE98;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50854.s")
+ if (!(gSaveContext.weekEventReg[41] & 2)) {
+ switch (this->unk_31C) {
+ case 0xE85:
+ return 0xE86;
+ case 0xE86:
+ gSaveContext.weekEventReg[41] |= 2;
+ this->unk_1E4 |= 1;
+ return 0xE87;
+ default:
+ return 0xE85;
+ }
+ } else {
+ this->unk_1E4 |= 1;
+ return 0xE87;
+ }
+ } else {
+ return 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50954.s")
+u16 func_80B50710(EnGk* this) {
+ switch (this->unk_31C) {
+ case 0xE8E:
+ gSaveContext.weekEventReg[41] |= 4;
+ this->unk_1E4 &= ~0x10;
+ this->unk_1E4 |= 1;
+ return 0xE8F;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B509A8.s")
+ case 0xE8A:
+ return 0xE8B;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50B38.s")
+ case 0xE8B:
+ gSaveContext.weekEventReg[41] |= 4;
+ this->unk_1E4 |= 0x10;
+ this->unk_1E4 |= 1;
+ return 0xE8C;
+ }
+ return 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50C78.s")
+void func_80B507A0(EnGk* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50E14.s")
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 30.0f, 30.0f, 7);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B50ED4.s")
+s32 func_80B50854(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5100C.s")
+ if (!(this->unk_1E4 & 0x40)) {
+ if (player->stateFlags2 & 0x8000000) {
+ this->unk_1E4 |= 0x40;
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ }
+ } else if (!(player->stateFlags2 & 0x8000000)) {
+ this->unk_1E4 &= ~0x40;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5123C.s")
+ if ((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.ocarinaMode == 3) &&
+ (globalCtx->msgCtx.unk1202E == 1)) {
+ Flags_SetSwitch(globalCtx, ENGK_GET_3F00(&this->actor));
+ this->unk_2E4 = 3;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ this->actionFunc = func_80B521E8;
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51308.s")
+void func_80B50954(EnGk* this) {
+ if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_WALK);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51398.s")
+void func_80B509A8(EnGk* this, GlobalContext* globalCtx) {
+ Vec3f sp4C;
+ s16 phi_s1 = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51410.s")
+ this->unk_300.x += 2.0f * Rand_Centered();
+ this->unk_300.y += Rand_ZeroOne();
+ this->unk_300.z += 2.0f * Rand_Centered();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51510.s")
+ this->unk_30C.x += 2.0f * Rand_Centered();
+ this->unk_30C.y += Rand_ZeroOne();
+ this->unk_30C.z += 2.0f * Rand_Centered();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51698.s")
+ if (this->unk_2E4 == 0) {
+ sp4C.x = 0.0f;
+ sp4C.z = 0.0f;
+ sp4C.y = -1.2f;
+ phi_s1 = 25;
+ } else if ((this->unk_2E4 == 2) || (this->unk_2E4 == 9) || (this->unk_2E4 == 10) || (this->unk_2E4 == 11)) {
+ sp4C.x = 0.0f;
+ sp4C.z = 0.0f;
+ sp4C.y = -0.5f;
+ phi_s1 = 10;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51760.s")
+ EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->unk_2E8, &this->unk_300, &sp4C, &D_80B533A0, &D_80B533A4,
+ Rand_S16Offset(15, 15), phi_s1, 0);
+ EffectSsDtBubble_SpawnCustomColor(globalCtx, &this->unk_2F4, &this->unk_30C, &sp4C, &D_80B533A0, &D_80B533A4,
+ Rand_S16Offset(15, 15), phi_s1, 0);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51970.s")
+void func_80B50B38(EnGk* this, GlobalContext* globalCtx) {
+ s16 i;
+ s16 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51B40.s")
+ switch (this->unk_2E4) {
+ case 0:
+ this->unk_2E0 = 3;
+ for (i = 0; i < 2; i++) {
+ func_80B509A8(this, globalCtx);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51D9C.s")
+ case 2:
+ this->unk_2E0 = 3;
+ func_80B509A8(this, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51EA4.s")
+ case 1:
+ case 3:
+ case 12:
+ this->unk_2E0 = 2;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B51FD0.s")
+ case 9:
+ case 10:
+ case 11:
+ this->unk_2E0 = 3;
+ func_80B509A8(this, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5202C.s")
+ default:
+ temp = this->unk_2E2;
+ temp--;
+ if (temp >= 3) {
+ this->unk_2E0 = 0;
+ this->unk_2E2 = temp;
+ } else if (temp == 0) {
+ this->unk_2E0 = 2;
+ this->unk_2E2 = (s32)(Rand_ZeroOne() * 60.0f) + 20;
+ } else {
+ this->unk_2E0 = 1;
+ this->unk_2E2 = temp;
+ }
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5216C.s")
+s32 func_80B50C78(EnGk* this, Path* path, s32 arg2_) {
+ Vec3s* sp5C = Lib_SegmentedToVirtual(path->points);
+ s32 sp58 = path->count;
+ s32 arg2 = arg2_;
+ s32 ret = false;
+ f32 phi_f12;
+ f32 phi_f14;
+ f32 sp44;
+ f32 sp40;
+ f32 sp3C;
+ Vec3f sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B521E8.s")
+ Math_Vec3s_ToVec3f(&sp30, &sp5C[arg2]);
+ if (arg2 == 0) {
+ phi_f12 = sp5C[1].x - sp5C[0].x;
+ phi_f14 = sp5C[1].z - sp5C[0].z;
+ } else if ((sp58 - 1) == arg2) {
+ phi_f12 = sp5C[sp58 - 1].x - sp5C[sp58 - 2].x;
+ phi_f14 = sp5C[sp58 - 1].z - sp5C[sp58 - 2].z;
+ } else {
+ phi_f12 = sp5C[arg2 + 1].x - sp5C[arg2 - 1].x;
+ phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5227C.s")
+ func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52340.s")
+ if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
+ ret = true;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52430.s")
+f32 func_80B50E14(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) {
+ Vec3s* points;
+ Vec3f sp20;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B5253C.s")
+ if (path != NULL) {
+ points = Lib_SegmentedToVirtual(path->points);
+ points = &points[arg1];
+ sp20.x = points[0].x;
+ sp20.y = points[0].y;
+ sp20.z = points[0].z;
+ }
+ arg3->y = Math_Vec3f_Yaw(arg2, &sp20);
+ arg3->x = Math_Vec3f_Pitch(arg2, &sp20);
+ return sp20.y - arg2->y;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B525E0.s")
+s32 func_80B50ED4(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5) {
+ Vec3f sp7C;
+ Vec3f sp70 = gZeroVec3f;
+ Vec3s sp68;
+ MtxF sp28;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52654.s")
+ Matrix_MultiplyVector3fByState(&sp70, &sp7C);
+ Matrix_CopyCurrentState(&sp28);
+ func_8018219C(&sp28, &sp68, 0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/EnGk_Init.s")
+ *arg2 = sp7C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/EnGk_Destroy.s")
+ if (!arg4 && !arg5) {
+ arg3->x = sp68.x;
+ arg3->y = sp68.y;
+ arg3->z = sp68.z;
+ return true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/EnGk_Update.s")
+ if (arg5) {
+ sp68.z = arg0;
+ sp68.y = arg1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52AD4.s")
+ Math_SmoothStepToS(&arg3->x, sp68.x, 3, 0x2AA8, 0xB6);
+ Math_SmoothStepToS(&arg3->y, sp68.y, 3, 0x2AA8, 0xB6);
+ Math_SmoothStepToS(&arg3->z, sp68.z, 3, 0x2AA8, 0xB6);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52AF0.s")
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/func_80B52D8C.s")
+s32 func_80B5100C(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp40;
+ Vec3f sp34;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Gk/EnGk_Draw.s")
+ Math_SmoothStepToS(&this->unk_320, (this->actor.yawTowardsPlayer - this->unk_324) - this->actor.shape.rot.y, 4,
+ 0x2AA8, 1);
+ this->unk_320 = CLAMP(this->unk_320, -0x1FFE, 0x1FFE);
+
+ Math_SmoothStepToS(&this->unk_324, (this->actor.yawTowardsPlayer - this->unk_320) - this->actor.shape.rot.y, 4,
+ 0x2AA8, 1);
+ this->unk_324 = CLAMP(this->unk_324, -0x1C70, 0x1C70);
+
+ sp40 = player->actor.world.pos;
+ sp40.y = player->bodyPartsPos[7].y + 3.0f;
+
+ sp34 = this->actor.world.pos;
+ sp34.y += 70.0f;
+
+ Math_SmoothStepToS(&this->unk_31E, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_322, 4, 0x2AA8, 1);
+ this->unk_31E = CLAMP(this->unk_31E, -0x1C70, 0x1C70);
+
+ Math_SmoothStepToS(&this->unk_322, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_31E, 4, 0x2AA8, 1);
+ this->unk_322 = CLAMP(this->unk_322, -0x1C70, 0x1C70);
+ return true;
+}
+
+s32 func_80B5123C(EnGk* this, GlobalContext* globalCtx) {
+ s16 temp_v0;
+ s16 phi_v1;
+
+ if (DECR(this->unk_34E) != 0) {
+ this->unk_31E = 0;
+ this->unk_320 = 0;
+ this->unk_1E4 &= ~8;
+ this->unk_322 = 0;
+ this->unk_324 = 0;
+ return true;
+ }
+
+ if (Actor_IsFacingAndNearPlayer(&this->actor, 300.0f, 0x7FF8)) {
+ this->unk_1E4 |= 8;
+ func_80B5100C(this, globalCtx);
+ } else {
+ if (this->unk_1E4 & 8) {
+ this->unk_34E = 20;
+ }
+ this->unk_1E4 &= ~8;
+ this->unk_31E = 0;
+ this->unk_320 = 0;
+ this->unk_322 = 0;
+ this->unk_324 = 0;
+ }
+ return true;
+}
+
+void func_80B51308(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_31A].animation);
+
+ if ((this->unk_2E4 == 7) && (sp1E == lastFrame)) {
+ this->unk_2E4 = 8;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
+ }
+}
+
+void func_80B51398(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[9].animation);
+
+ if ((this->unk_2E4 == 9) && (sp1E == lastFrame)) {
+ this->unk_2E4 = 10;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10);
+ }
+}
+
+void func_80B51410(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->actor.xzDistToPlayer < 100.0f) {
+ if ((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.ocarinaMode == 3) &&
+ (globalCtx->msgCtx.unk1202E == 0xE)) {
+ this->unk_1E4 |= 0x20;
+ }
+
+ if (ActorCutscene_GetCanPlayNext(this->unk_318)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_SOB_TALK);
+ ActorCutscene_Start(this->unk_318, &this->actor);
+ this->unk_1E4 &= ~0x20;
+ return;
+ }
+
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+
+ if (this->unk_1E4 & 0x20) {
+ ActorCutscene_SetIntentToPlay(this->unk_318);
+ }
+ } else {
+ this->unk_1E4 &= ~0x20;
+ }
+}
+
+void func_80B51510(EnGk* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 actionIndex;
+
+ if (this) {}
+
+ if (Cutscene_CheckActorAction(globalCtx, 479)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 479);
+
+ if (globalCtx->csCtx.actorActions[actionIndex]->action != this->unk_31B) {
+ this->unk_31B = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ this->unk_31A = 0;
+ this->unk_2E4 = 0;
+ break;
+
+ case 2:
+ this->unk_31A = 2;
+ this->unk_2E4 = 2;
+ break;
+
+ case 3:
+ this->unk_31A = 7;
+ this->unk_2E4 = 7;
+ break;
+
+ case 4:
+ this->unk_31A = 3;
+ this->unk_2E4 = 3;
+ break;
+
+ case 5:
+ this->unk_31A = 1;
+ this->unk_2E4 = 1;
+ this->unk_1E4 |= 0x80;
+ this->actionFunc = func_80B5227C;
+ break;
+
+ case 6:
+ this->unk_31A = 12;
+ this->unk_2E4 = 12;
+ break;
+
+ case 7:
+ Flags_SetSwitch(globalCtx, ENGK_GET_3F00(&this->actor));
+ break;
+ }
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_31A);
+ }
+
+ if (this->unk_31A == 7) {
+ func_80B51308(this, globalCtx);
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ this->actor.shape.yOffset = 0.0f;
+ } else {
+ this->unk_31B = 0x63;
+ }
+}
+
+void func_80B51698(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp26 = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
+
+ if (sp26 == lastFrame) {
+ switch (this->unk_2E4) {
+ case 0:
+ this->unk_2E4 = 2;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ this->actionFunc = func_80B5216C;
+ break;
+
+ case 2:
+ this->unk_2E4 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actionFunc = func_80B5202C;
+ break;
+ }
+ }
+}
+
+void func_80B51760(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp2E = this->skelAnime.curFrame;
+ s16 lastFrame;
+
+ if (this->unk_2E4 == 11) {
+ lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
+ if (sp2E == lastFrame) {
+ this->unk_2E4 = 5;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4);
+ }
+ } else if (this->unk_2E4 == 10) {
+ lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
+ if (sp2E == lastFrame) {
+ this->unk_2E4 = 11;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_2E4);
+ }
+ } else {
+ if (Flags_GetSwitch(globalCtx, ENGK_GET_3F00(&this->actor))) {
+ gSaveContext.weekEventReg[40] |= 0x40;
+ this->actionFunc = func_80B51D9C;
+ return;
+ }
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_1E4 |= 4;
+ this->unk_31C = func_80B50410(this, globalCtx);
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ this->actionFunc = func_80B51970;
+ if (this->unk_31C == 0xE81) {
+ this->unk_2E4 = 0;
+ this->unk_1E4 |= 2;
+ }
+ } else if (((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) &&
+ (gSaveContext.entranceIndex != 0xD010)) {
+ func_800B863C(&this->actor, globalCtx);
+ }
+
+ if (this->unk_1E4 & 4) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ }
+ }
+}
+
+void func_80B51970(EnGk* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if (((temp_v0 == 6) || (temp_v0 == 5)) && func_80147624(globalCtx)) {
+ if ((this->unk_31C == 0xE84) || (this->unk_31C == 0xE99)) {
+ ActorCutscene_Stop(this->unk_318);
+ this->unk_318 = ActorCutscene_GetAdditionalCutscene(this->unk_318);
+ ActorCutscene_SetIntentToPlay(this->unk_318);
+ this->actionFunc = func_80B51D9C;
+ return;
+ }
+
+ if (this->unk_1E4 & 1) {
+ this->unk_1E4 &= ~1;
+ this->unk_1E4 &= ~4;
+ if (this->unk_2E4 == 10) {
+ this->unk_1E4 &= ~2;
+ }
+ this->actionFunc = func_80B51760;
+ return;
+ }
+
+ this->unk_31C = func_80B50410(this, globalCtx);
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ if (this->unk_31C == 0xE80) {
+ this->unk_1E4 |= 2;
+ } else if (this->unk_31C == 0xE89) {
+ this->actionFunc = func_80B51B40;
+ }
+ }
+
+ if (this->unk_1E4 & 2) {
+ func_801A4748(&this->actor.projectedPos, NA_SE_EN_GOLON_KID_CRY - SFX_FLAG);
+ if (this->unk_2E4 != 10) {
+ if (this->unk_2E4 != 9) {
+ this->unk_2E4 = 9;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
+ } else {
+ func_80B51398(this, globalCtx);
+ }
+ }
+ }
+
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ if (this->unk_2E4 == 6) {
+ func_80B50954(this);
+ }
+}
+
+void func_80B51B40(EnGk* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if (temp_v0 == 6) {
+ if (func_80147624(globalCtx)) {
+ if (this->unk_1E4 & 1) {
+ this->unk_1E4 &= ~1;
+ this->unk_1E4 &= ~4;
+
+ if (this->unk_2E4 == 10) {
+ this->unk_1E4 &= ~2;
+ }
+
+ if (this->unk_31C == 0xE8F) {
+ globalCtx->nextEntranceIndex = 0xD010;
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 3;
+ gSaveContext.nextTransition = 3;
+ Parameter_AddMagic(globalCtx,
+ ((void)0, gSaveContext.unk_3F30) + (gSaveContext.doubleMagic * 0x30) + 0x30);
+ } else {
+ this->actionFunc = func_80B51760;
+ }
+ return;
+ }
+
+ this->unk_31C = func_80B50710(this);
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ if (this->unk_31C == 0xE8C) {
+ this->unk_1E4 |= 2;
+ }
+ }
+ } else if ((temp_v0 == 4) && (func_80147624(globalCtx) != 0)) {
+ switch (globalCtx->msgCtx.choiceIndex) {
+ case 0:
+ func_8019F208();
+ this->unk_31C = 0xE8E;
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ break;
+
+ case 1:
+ func_8019F230();
+ this->unk_31C = 0xE8A;
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ break;
+ }
+ }
+
+ if (this->unk_1E4 & 2) {
+ func_801A4748(&this->actor.projectedPos, NA_SE_EN_GOLON_KID_CRY - SFX_FLAG);
+ if (this->unk_2E4 != 10) {
+ if (this->unk_2E4 != 9) {
+ this->unk_2E4 = 9;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
+ } else {
+ func_80B51398(this, globalCtx);
+ }
+ }
+ }
+
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+}
+
+void func_80B51D9C(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (ActorCutscene_GetCanPlayNext(this->unk_318)) {
+ ActorCutscene_StartAndSetFlag(this->unk_318, &this->actor);
+ if (this->unk_1E4 & 4) {
+ this->unk_1E4 &= ~4;
+ this->unk_2E4 = 6;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
+ this->actionFunc = func_80B51EA4;
+ } else {
+ this->unk_1E4 |= 4;
+ if (player->transformation == PLAYER_FORM_GORON) {
+ this->unk_31C = 0xE84;
+ } else {
+ this->unk_31C = 0xE99;
+ }
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ this->actionFunc = func_80B51970;
+ }
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->unk_318);
+ }
+ func_80B50954(this);
+}
+
+void func_80B51EA4(EnGk* this, GlobalContext* globalCtx) {
+ Vec3s sp38;
+ s16 sp36;
+
+ if (this->path != NULL) {
+ func_80B50E14(this->path, this->unk_1EC, &this->actor.world.pos, &sp38);
+ Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 5, 0x1000, 0x100);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ sp36 = this->actor.shape.rot.y - sp38.y;
+ if (func_80B50C78(this, this->path, this->unk_1EC)) {
+ if (this->unk_1EC >= (this->path->count - 1)) {
+ ActorCutscene_Stop(this->unk_318);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ this->unk_1EC++;
+ }
+ }
+
+ if (this->actor.bgCheckFlags & 8) {
+ sp38.y = this->actor.wallYaw;
+ }
+
+ if (ABS_ALT(sp36) < 0x2AAA) {
+ Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.2f, 0.5f);
+ }
+ Actor_MoveWithGravity(&this->actor);
+ }
+ func_80B50954(this);
+}
+
+void func_80B51FD0(EnGk* this, GlobalContext* globalCtx) {
+ if (!(gSaveContext.weekEventReg[22] & 4)) {
+ if (this->unk_1E4 & 2) {
+ func_801A4748(&this->actor.projectedPos, NA_SE_EN_GOLON_KID_CRY - SFX_FLAG);
+ } else {
+ this->unk_1E4 |= 2;
+ }
+ }
+}
+
+void func_80B5202C(EnGk* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (globalCtx->csCtx.state == 0) {
+ func_80B51410(this, globalCtx);
+ }
+
+ if (!func_80B50854(this, globalCtx)) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ gSaveContext.weekEventReg[24] |= 0x80;
+ this->actionFunc = func_80B51698;
+ } else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) {
+ func_800B863C(&this->actor, globalCtx);
+ if (player->transformation == PLAYER_FORM_GORON) {
+ this->actor.textId = 0xE74;
+ } else {
+ this->actor.textId = 0xE76;
+ }
+ }
+
+ if (this->unk_1E4 & 2) {
+ if ((globalCtx->msgCtx.ocarinaMode != 1) && (globalCtx->msgCtx.ocarinaMode != 3) &&
+ (globalCtx->csCtx.state == 0)) {
+ func_801A4748(&this->actor.projectedPos, NA_SE_EN_GOLON_KID_CRY - SFX_FLAG);
+ }
+ } else {
+ this->unk_1E4 |= 2;
+ }
+ }
+}
+
+void func_80B5216C(EnGk* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actionFunc = func_80B51698;
+ }
+}
+
+void func_80B521E8(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
+
+ if (sp1E == lastFrame) {
+ this->unk_2E4 = 1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ this->actionFunc = func_80B5227C;
+ }
+}
+
+void func_80B5227C(EnGk* this, GlobalContext* globalCtx) {
+ s16 sp26 = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_2E4].animation);
+
+ if ((sp26 + 1) == lastFrame) {
+ func_800B14D4(globalCtx, 20.0f, &this->actor.home.pos);
+ this->unk_350 = 60;
+ if (!(this->unk_1E4 & 0x80)) {
+ gSaveContext.weekEventReg[22] |= 4;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT);
+ this->unk_350 = 0x4000;
+ this->actionFunc = func_80B52654;
+ }
+}
+
+void func_80B52340(EnGk* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_1E4 |= 4;
+ if (gSaveContext.eventInf[1] & 2) {
+ this->unk_31C = 0xE90;
+ this->actionFunc = func_80B52430;
+ } else {
+ this->unk_31C = 0xE93;
+ this->actionFunc = func_80B52430;
+ }
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ } else {
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ }
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+}
+
+void func_80B52430(EnGk* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) {
+ switch (this->unk_31C) {
+ case 0xE93:
+ this->unk_31C = 0xE89;
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ this->actionFunc = func_80B51B40;
+ return;
+
+ case 0xE90:
+ this->unk_31C = 0xE91;
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ return;
+
+ case 0xE91:
+ this->actionFunc = func_80B5253C;
+ return;
+
+ case 0xE92:
+ this->unk_1E4 &= ~4;
+ this->actionFunc = func_80B51760;
+ return;
+ }
+ }
+
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x1000, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+}
+
+void func_80B5253C(EnGk* this, GlobalContext* globalCtx) {
+ s32 sp24;
+
+ if (gSaveContext.weekEventReg[41] & 8) {
+ sp24 = 0x93;
+ } else {
+ sp24 = 0x6A;
+ }
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ if (sp24 == 0x6A) {
+ gSaveContext.weekEventReg[41] |= 8;
+ }
+ this->actionFunc = func_80B525E0;
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, sp24, 300.0f, 300.0f);
+ }
+}
+
+void func_80B525E0(EnGk* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_31C = 0xE92;
+ Message_StartTextbox(globalCtx, this->unk_31C, &this->actor);
+ this->actionFunc = func_80B52430;
+ } else {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ }
+}
+
+void func_80B52654(EnGk* this, GlobalContext* globalCtx) {
+ this->unk_350 += 0x400;
+ if ((this->unk_1E4 & 0x80) && (globalCtx->csCtx.frames == 250)) {
+ gSaveContext.weekEventReg[22] |= 4;
+ }
+
+ this->unk_354 = Math_SinS(this->unk_350) * 0.006f * 0.06f;
+ this->actor.scale.y = 0.006f - this->unk_354;
+ this->actor.scale.z = 0.006f - this->unk_354;
+ this->actor.scale.x = 0.006f + this->unk_354;
+ if (this->unk_350 == 0) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLONKID_SNORE);
+ }
+}
+
+void EnGk_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnGk* this = THIS;
+
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_gk_Skel_0079C0, &object_gk_Anim_00787C, this->jointTable,
+ this->morphTable, 20);
+
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ this->unk_2E2 = 20;
+ this->unk_2E0 = 0;
+ this->unk_1E4 = 0;
+ this->unk_354 = 0.006f;
+ Actor_SetScale(&this->actor, 0.006f);
+ this->actor.gravity = -1.0f;
+
+ if (ENGK_GET_F(&this->actor) == ENGK_F_1) {
+ this->unk_2E4 = 5;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
+ if (globalCtx->sceneNum == SCENE_17SETUGEN2) {
+ if (Flags_GetSwitch(globalCtx, ENGK_GET_3F00(&this->actor))) {
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ this->unk_318 = this->actor.cutscene;
+ this->path = func_8013D648(globalCtx, ENGK_GET_F0(&this->actor), 15);
+ this->actionFunc = func_80B51760;
+ }
+ } else if (globalCtx->sceneNum == SCENE_GORONRACE) {
+ if (gSaveContext.weekEventReg[33] & 0x80) {
+ if (gSaveContext.entranceIndex == 0xD010) {
+ this->actionFunc = func_80B51760;
+ } else if (gSaveContext.entranceIndex == 0xD020) {
+ this->actionFunc = func_80B52340;
+ } else {
+ this->actionFunc = func_80B51760;
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else if (ENGK_GET_F(&this->actor) == ENGK_F_2) {
+ if (!(gSaveContext.weekEventReg[22] & 4)) {
+ this->actionFunc = func_80B51FD0;
+ this->actor.draw = NULL;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else if (!(gSaveContext.weekEventReg[22] & 4)) {
+ this->unk_2E4 = 0;
+ this->unk_318 = this->actor.cutscene;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.flags |= ACTOR_FLAG_2000000;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actionFunc = func_80B5202C;
+ } else {
+ this->actionFunc = func_80B52654;
+ }
+}
+
+void EnGk_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnGk* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnGk_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnGk* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if ((ENGK_GET_F(&this->actor) == ENGK_F_1) ||
+ ((ENGK_GET_F(&this->actor) == ENGK_F_0) && !(gSaveContext.weekEventReg[22] & 4))) {
+ func_80B507A0(this, globalCtx);
+ SkelAnime_Update(&this->skelAnime);
+ func_800E9250(globalCtx, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos);
+ if (ENGK_GET_F(&this->actor) == ENGK_F_1) {
+ func_80B5123C(this, globalCtx);
+ }
+ func_80B50B38(this, globalCtx);
+ }
+
+ if (ENGK_GET_F(&this->actor) == ENGK_F_0) {
+ func_80B51510(this, globalCtx);
+ }
+}
+
+s32 EnGk_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ return false;
+}
+
+void EnGk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnGk* this = THIS;
+ Vec3f sp58 = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp4C = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp40 = { 0.0f, 0.0f, 0.0f };
+ Vec3f sp34 = { 1100.0f, -100.0f, 0.0f };
+ Vec3f sp28 = { 1100.0f, -100.0f, 0.0f };
+ f32 phi_f0;
+
+ sp34.x = 1100.0f;
+ sp34.z = 500.0f;
+
+ sp28.x = 1100.0f;
+ sp28.z = -500.0f;
+
+ if (this->unk_2E4 == 0) {
+ sp34.y = -100.0f;
+ sp28.y = -100.0f;
+
+ sp40.x = 2.0f;
+ sp40.y = 5.8f;
+ sp40.z = 0.0f;
+
+ sp4C = sp40;
+ sp4C.x *= -1.0f;
+ } else if ((this->unk_2E4 == 2) || (this->unk_2E4 == 9) || (this->unk_2E4 == 10) || (this->unk_2E4 == 11)) {
+ sp34.y = 400.0f;
+ sp28.y = 400.0f;
+
+ sp40.x = 1.0f;
+ sp40.y = 0.8f;
+ sp40.z = 0.0f;
+
+ sp4C = sp40;
+ sp4C.x *= -1.0f;
+ }
+
+ if (limbIndex == 17) {
+ if (ENGK_GET_F(&this->actor) == ENGK_F_1) {
+ phi_f0 = 100.0f;
+ } else {
+ phi_f0 = 50.0f;
+ }
+
+ this->actor.focus.pos.x = this->actor.world.pos.x;
+ this->actor.focus.pos.y = this->actor.world.pos.y + phi_f0;
+ this->actor.focus.pos.z = this->actor.world.pos.z;
+
+ Matrix_MultiplyVector3fByState(&sp58, &this->actor.focus.pos);
+ Matrix_MultiplyVector3fByState(&sp34, &this->unk_2E8);
+ Matrix_MultiplyVector3fByState(&sp28, &this->unk_2F4);
+
+ Matrix_StatePush();
+
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_MultiplyVector3fByState(&sp4C, &this->unk_30C);
+ Matrix_MultiplyVector3fByState(&sp40, &this->unk_300);
+
+ Matrix_StatePop();
+ }
+}
+
+void EnGk_TransformDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+ EnGk* this = THIS;
+ s32 phi_v0;
+ s32 phi_v1;
+
+ switch (limbIndex) {
+ case 18:
+ if (this->unk_1E4 & 8) {
+ phi_v1 = true;
+ } else {
+ phi_v1 = false;
+ }
+
+ if (this->unk_34E != 0) {
+ phi_v0 = true;
+ } else {
+ phi_v0 = false;
+ }
+ func_80B50ED4(this->unk_31E + this->unk_322 + 0x4000,
+ this->unk_320 + this->unk_324 + this->actor.shape.rot.y + 0x4000, &this->unk_328,
+ &this->unk_334, phi_v0, phi_v1);
+
+ Matrix_StatePop();
+
+ Matrix_InsertTranslation(this->unk_328.x, this->unk_328.y, this->unk_328.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_334.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_334.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_334.z, MTXMODE_APPLY);
+
+ Matrix_StatePush();
+ break;
+
+ case 9:
+ if (this->unk_1E4 & 8) {
+ phi_v1 = true;
+ } else {
+ phi_v1 = false;
+ }
+
+ if (this->unk_34E != 0) {
+ phi_v0 = true;
+ } else {
+ phi_v0 = false;
+ }
+ func_80B50ED4(this->unk_322 + 0x4000, this->unk_324 + this->actor.shape.rot.y + 0x4000, &this->unk_33C,
+ &this->unk_348, phi_v0, phi_v1);
+
+ Matrix_StatePop();
+
+ Matrix_InsertTranslation(this->unk_33C.x, this->unk_33C.y, this->unk_33C.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_348.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_348.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_348.z, MTXMODE_APPLY);
+
+ Matrix_StatePush();
+ break;
+ }
+}
+
+TexturePtr D_80B533E4[] = {
+ object_gk_Tex_00F720,
+ object_gk_Tex_00FF20,
+ object_gk_Tex_010720,
+ object_gk_Tex_010F20,
+};
+
+void EnGk_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnGk* this = THIS;
+ Vec3f sp5C;
+ Vec3f sp50;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ if ((ENGK_GET_F(&this->actor) == ENGK_F_0) && (gSaveContext.weekEventReg[22] & 4)) {
+ Matrix_InsertXRotation_s(-0x4000, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_gk_DL_006688);
+ gSPDisplayList(POLY_OPA_DISP++, object_gk_DL_006680);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ sp5C = this->actor.world.pos;
+ sp50.x = 0.2f;
+ sp50.y = 0.2f;
+ sp50.z = 0.2f;
+
+ func_800BC620(&sp5C, &sp50, 255, globalCtx);
+ } else {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B533E4[this->unk_2E0]));
+
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGk_OverrideLimbDraw, EnGk_PostLimbDraw,
+ EnGk_TransformDraw, &this->actor);
+
+ if (ENGK_GET_F(&this->actor) != ENGK_F_2) {
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ if ((this->unk_2E4 == 0) || (this->unk_2E4 == 1) || (this->unk_2E4 == 2) || (this->unk_2E4 == 3) ||
+ (this->unk_2E4 == 4)) {
+ sp5C.x = this->actor.world.pos.x - 15.0f;
+ sp5C.y = this->actor.world.pos.y;
+ sp5C.z = this->actor.world.pos.z;
+
+ sp50.x = 0.2f;
+ sp50.y = 0.2f;
+ sp50.z = 0.2f;
+ } else {
+ sp5C = this->actor.world.pos;
+ sp50.x = 0.2f;
+ sp50.y = 0.2f;
+ sp50.z = 0.2f;
+ }
+ func_800BC620(&sp5C, &sp50, 255, globalCtx);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Gk/z_en_gk.h b/src/overlays/actors/ovl_En_Gk/z_en_gk.h
index 88a71cb16d..21863c66f3 100644
--- a/src/overlays/actors/ovl_En_Gk/z_en_gk.h
+++ b/src/overlays/actors/ovl_En_Gk/z_en_gk.h
@@ -7,11 +7,53 @@ struct EnGk;
typedef void (*EnGkActionFunc)(struct EnGk*, GlobalContext*);
+#define ENGK_GET_F(thisx) ((thisx)->params & 0xF)
+#define ENGK_GET_F0(thisx) (((thisx)->params & 0xF0) >> 4)
+#define ENGK_GET_3F00(thisx) (((thisx)->params & 0x3F00) >> 8)
+
+enum {
+ /* 0 */ ENGK_F_0,
+ /* 1 */ ENGK_F_1,
+ /* 2 */ ENGK_F_2,
+ /* 3 */ ENGK_F_3,
+ /* 4 */ ENGK_F_4,
+ /* 5 */ ENGK_F_5,
+};
+
typedef struct EnGk {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x90];
+ /* 0x0144 */ ColliderCylinder collider;
+ /* 0x0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnGkActionFunc actionFunc;
- /* 0x01D8 */ char unk_1D8[0x180];
+ /* 0x01D8 */ Vec3s unk_1D8;
+ /* 0x01DE */ Vec3s unk_1DE;
+ /* 0x01E4 */ u16 unk_1E4;
+ /* 0x01E8 */ Path* path;
+ /* 0x01EC */ s32 unk_1EC;
+ /* 0x01F0 */ Vec3s jointTable[20];
+ /* 0x01F0 */ Vec3s morphTable[20];
+ /* 0x02E0 */ s16 unk_2E0;
+ /* 0x02E2 */ s16 unk_2E2;
+ /* 0x02E4 */ s16 unk_2E4;
+ /* 0x02E8 */ Vec3f unk_2E8;
+ /* 0x02F4 */ Vec3f unk_2F4;
+ /* 0x0300 */ Vec3f unk_300;
+ /* 0x030C */ Vec3f unk_30C;
+ /* 0x0318 */ s16 unk_318;
+ /* 0x031A */ u8 unk_31A;
+ /* 0x031B */ u8 unk_31B;
+ /* 0x031C */ u16 unk_31C;
+ /* 0x031E */ s16 unk_31E;
+ /* 0x0320 */ s16 unk_320;
+ /* 0x0322 */ s16 unk_322;
+ /* 0x0324 */ s16 unk_324;
+ /* 0x0328 */ Vec3f unk_328;
+ /* 0x0334 */ Vec3s unk_334;
+ /* 0x033C */ Vec3f unk_33C;
+ /* 0x0348 */ Vec3s unk_348;
+ /* 0x034E */ s16 unk_34E;
+ /* 0x0350 */ s16 unk_350;
+ /* 0x0354 */ f32 unk_354;
} EnGk; // size = 0x358
extern const ActorInit En_Gk_InitVars;
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 aee390e8dc..dc063bd353 100644
--- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c
+++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c
@@ -6,8 +6,9 @@
#include "z_en_gm.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_in2/object_in2.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnGm*)thisx)
@@ -19,25 +20,6 @@ void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80950CDC(EnGm* this, GlobalContext* globalCtx);
void func_80950DB8(EnGm* this, GlobalContext* globalCtx);
-extern UNK_PTR D_06005028;
-extern UNK_PTR D_060054A8;
-extern UNK_PTR D_06005CE8;
-extern UNK_PTR D_06006828;
-extern UNK_PTR D_06006C68;
-extern Gfx D_06007528[];
-extern FlexSkeletonHeader D_060078B0;
-extern AnimationHeader D_06008090;
-extern AnimationHeader D_0600898C;
-extern AnimationHeader D_06009450;
-extern AnimationHeader D_06009CDC;
-extern AnimationHeader D_0600A5E0;
-extern AnimationHeader D_0600A70C;
-extern AnimationHeader D_0600AD18;
-extern AnimationHeader D_0600B8B0;
-extern AnimationHeader D_0600B990;
-extern AnimationHeader D_0600BA80;
-extern AnimationHeader D_0600C03C;
-
static u32 D_80951820[] = {
0x0D000101, 0x360A0061, 0x25020600, 0x09001902, 0x0900090A, 0x0D02090A, 0x090F0105, 0x0E090A09, 0x0F0F0E09,
0x00090A18, 0x0E060009, 0x00060A00, 0x6C490209, 0x0A090F3D, 0x02090F0A, 0x0031020A, 0x000A0525, 0x020C0F0C,
@@ -146,12 +128,20 @@ static ColliderSphereInit sSphereInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS D_80951CC0[13] = {
- { &D_06009CDC, 1.0f, 0, -1, 0, 0 }, { &D_06009CDC, 1.0f, 0, -1, 0, -4 }, { &D_0600A5E0, 1.0f, 0, -1, 0, 0 },
- { &D_0600A70C, 1.0f, 0, 1, 0, 0 }, { &D_06008090, 1.0f, 0, -1, 0, 0 }, { &D_0600898C, 1.0f, 0, -1, 2, -4 },
- { &D_06009450, 1.0f, 0, -1, 2, -4 }, { &D_0600AD18, 1.0f, 0, -1, 0, 0 }, { &D_0600AD18, 1.0f, 0, -1, 0, -4 },
- { &D_0600B8B0, 1.0f, 0, -1, 2, 0 }, { &D_0600BA80, 1.0f, 0, -1, 0, -4 }, { &D_0600C03C, 1.0f, 0, -1, 0, -4 },
- { &D_0600B990, 1.0f, 0, -1, 0, -4 },
+static AnimationInfoS D_80951CC0[] = {
+ { &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in2_Anim_009CDC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in2_Anim_00A5E0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in2_Anim_00A70C, 1.0f, 0, 1, ANIMMODE_LOOP, 0 },
+ { &object_in2_Anim_008090, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in2_Anim_00898C, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_in2_Anim_009450, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_in2_Anim_00AD18, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in2_Anim_00AD18, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in2_Anim_00B8B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_in2_Anim_00BA80, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in2_Anim_00C03C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in2_Anim_00B990, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
Actor* func_8094DEE0(EnGm* this, GlobalContext* globalCtx, u8 arg2, s16 arg3) {
@@ -246,7 +236,7 @@ s32 func_8094E054(EnGm* this, GlobalContext* globalCtx, s32 arg2) {
if (phi_v1) {
if (tmp >= 0) {
this->unk_3E8 = arg2;
- ret = func_8013BC6C(&this->skelAnime, D_80951CC0, arg2);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80951CC0, arg2);
this->unk_3A8 = this->skelAnime.playSpeed;
}
}
@@ -259,7 +249,7 @@ s32 func_8094E0F8(EnGm* this, GlobalContext* globalCtx) {
if ((this->unk_260 != globalCtx->roomCtx.currRoom.num) && (globalCtx->roomCtx.unk31 == 0)) {
this->unk_260 = globalCtx->roomCtx.currRoom.num;
- this->unk_262 = func_8013D924(0x248, globalCtx);
+ this->unk_262 = SubS_GetObjectIndex(OBJECT_IN2, globalCtx);
this->actor.draw = NULL;
this->unk_3FC = 1;
}
@@ -268,7 +258,7 @@ s32 func_8094E0F8(EnGm* this, GlobalContext* globalCtx) {
return false;
}
- if ((this->unk_262 < 0) || !func_8013D8DC(this->unk_262, globalCtx)) {
+ if ((this->unk_262 < 0) || !SubS_IsObjectLoaded(this->unk_262, globalCtx)) {
ret = true;
} else {
this->actor.draw = EnGm_Draw;
@@ -395,7 +385,7 @@ s32 func_8094E52C(EnGm* this, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[86] & 0x40) && (this->unk_3E0 == 2)) {
ActorCutscene_Stop(sp2A);
} else {
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
}
this->unk_3E0++;
ret = true;
@@ -403,7 +393,8 @@ s32 func_8094E52C(EnGm* this, GlobalContext* globalCtx) {
case 1:
if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), this->actor.child);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)),
+ this->actor.child);
}
this->unk_3E0++;
ret = true;
@@ -463,7 +454,7 @@ s32 func_8094E69C(EnGm* this, GlobalContext* globalCtx) {
case 4:
case 6:
camera = Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp4A));
- func_800E0308(camera, &this->actor);
+ Camera_SetTargetActor(camera, &this->actor);
this->unk_3E0++;
ret = true;
}
@@ -474,7 +465,7 @@ s32 func_8094E69C(EnGm* this, GlobalContext* globalCtx) {
case 7:
if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
camera = Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp4A));
- func_800E0308(camera, this->actor.child);
+ Camera_SetTargetActor(camera, this->actor.child);
}
this->unk_3E0++;
ret = true;
@@ -662,7 +653,7 @@ s32 func_8094EE84(EnGm* this, GlobalContext* globalCtx) {
if (this->unk_3A4 & 7) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_3A4, 0, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 0, 7);
this->unk_3E0 = 0;
this->unk_3E4 = NULL;
this->actor.child = this->unk_268;
@@ -802,7 +793,7 @@ void func_8094F3D0(EnGm* this, GlobalContext* globalCtx) {
this->unk_3AC = 0.0f;
}
Math_SmoothStepToF(&this->unk_3B0, this->unk_3AC, 0.8f, 40.0f, 10.0f);
- Matrix_InsertTranslation(this->unk_3B0, 0.0f, 0.0f, 1);
+ Matrix_InsertTranslation(this->unk_3B0, 0.0f, 0.0f, MTXMODE_APPLY);
this->unk_3F0 = sp28;
}
@@ -931,7 +922,7 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.time - 0x3FFC;
u8 sp55 = ENGM_GET_FF(&this->actor);
- EnDoor* sp50;
+ EnDoor* door;
Vec3s* sp4C;
Vec3f sp40;
Vec3f sp34;
@@ -939,13 +930,13 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
this->unk_234 = NULL;
- sp50 = func_8094DF90(globalCtx, arg2->unk0);
+ door = func_8094DF90(globalCtx, arg2->unk0);
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp55, D_80951A0C[arg2->unk0]);
}
- if ((sp50 != NULL) && (sp50->actor.update != NULL)) {
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if (this->unk_234 != NULL) {
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
@@ -955,7 +946,7 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
- if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, sp50->actor.shape.rot.y)) <= 0x4000) {
+ if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->dyna.actor.shape.rot.y)) <= 0x4000) {
this->unk_261 = -75;
} else {
this->unk_261 = 75;
@@ -963,7 +954,7 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_3B8 = arg2->unk8 - arg2->unk4;
this->unk_3BA = sp56 - arg2->unk4;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_3A4 |= 0x100;
this->unk_3A4 |= 0x200;
func_8094E054(this, globalCtx, 7);
@@ -1009,7 +1000,7 @@ s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_250 = (this->unk_254 / this->unk_24C) + 2;
this->unk_3A4 &= ~0x8;
this->unk_3A4 &= ~0x10;
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3A4 |= 0x100;
this->unk_3A4 |= 0x200;
func_8094E054(this, globalCtx, 7);
@@ -1026,7 +1017,7 @@ s32 func_8094FCC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if (func_8094F7D0(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_TAB)) {
if (this->unk_258 == 0) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_80951D90);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
func_8094E054(this, globalCtx, 0);
} else {
func_8094E054(this, globalCtx, 9);
@@ -1044,7 +1035,7 @@ s32 func_8094FD88(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if (func_8094F7D0(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_RECEPGIRL)) {
func_8094E054(this, globalCtx, 11);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3A4 |= 0x100;
this->unk_3A4 |= 0x200;
ret = true;
@@ -1059,7 +1050,7 @@ s32 func_8094FE10(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
al = func_8094DEE0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_AL);
if (func_8094F7D0(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_TOTO) && (al != NULL) && (al->update != NULL)) {
func_8094E054(this, globalCtx, 11);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_268 = al;
if (!(gSaveContext.weekEventReg[86] & 0x20)) {
this->unk_3C8 = 2;
@@ -1096,7 +1087,7 @@ s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp3C, &sp30);
if (this->unk_258 == 0) {
Math_Vec3f_Copy(&this->actor.world.pos, &D_80951D9C);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3C8 = 4;
this->unk_3CA = 4;
this->unk_3CC = 8;
@@ -1123,7 +1114,7 @@ s32 func_80950088(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3f_Copy(&this->actor.world.pos, &D_80951DA8);
Math_Vec3s_Copy(&this->actor.world.rot, &D_80951DB4);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3A4 |= (0x2000 | 0x100);
this->unk_3A4 |= 0x200;
func_8094E054(this, globalCtx, 12);
@@ -1138,7 +1129,7 @@ s32 func_80950120(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3f_Copy(&this->actor.world.pos, &D_80951DBC);
Math_Vec3s_Copy(&this->actor.world.rot, &D_80951DC8);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3A4 |= (0x800 | 0x100);
this->unk_3A4 |= 0x200;
func_8094E054(this, globalCtx, 4);
@@ -1154,7 +1145,7 @@ s32 func_809501B8(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3s_Copy(&this->actor.world.rot, &D_80951DDC);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
this->actor.targetMode = 6;
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3A4 |= (0x1000 | 0x100);
this->unk_3A4 |= 0x200;
this->unk_3C8 = 3;
@@ -1169,7 +1160,7 @@ s32 func_809501B8(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 func_80950280(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 phi_v1;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetMode = 0;
this->unk_3A4 = 0;
this->unk_3C8 = 0;
@@ -1261,7 +1252,7 @@ s32 func_809503F8(EnGm* this, GlobalContext* globalCtx) {
if (this->unk_3E8 == 9) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
func_8094E054(this, globalCtx, 0);
} else {
AnimationContext_SetMoveActor(globalCtx, &this->actor, &this->skelAnime, 1.0f);
@@ -1293,7 +1284,7 @@ s32 func_80950490(EnGm* this, GlobalContext* globalCtx) {
case 9:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
this->unk_3C8 = 4;
this->unk_3CA = 4;
this->unk_3CC = 8;
@@ -1360,24 +1351,24 @@ s32 func_80950690(EnGm* this, GlobalContext* globalCtx) {
break;
}
- func_8013D9C8(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D2));
+ SubS_FillLimbRotTables(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D8));
return false;
}
s32 func_80950804(EnGm* this, GlobalContext* globalCtx) {
- EnDoor* sp44;
+ EnDoor* door;
Vec3f sp38;
s32 pad;
f32 temp_f0;
- sp44 = func_8094DF90(globalCtx, this->unk_258);
+ door = func_8094DF90(globalCtx, this->unk_258);
if (!func_8013AD6C(globalCtx) && (this->unk_3C4 != 0)) {
- if ((sp44 != NULL) && (sp44->actor.update != NULL)) {
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if ((this->unk_3BA / (f32)this->unk_3B8) <= 0.9f) {
- sp44->unk_1A7 = this->unk_261;
+ door->unk_1A7 = this->unk_261;
} else {
- sp44->unk_1A7 = 0;
+ door->unk_1A7 = 0;
}
}
@@ -1510,11 +1501,11 @@ void func_80950CDC(EnGm* this, GlobalContext* globalCtx) {
if (!func_80133038(globalCtx, (void*)&D_80951820, &sp20) ||
((this->unk_258 != sp20.unk0) && !func_80950280(this, globalCtx, &sp20))) {
this->actor.shape.shadowDraw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
sp20.unk0 = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_258 = sp20.unk0;
this->unk_268 = func_8094F074(this, globalCtx);
@@ -1528,7 +1519,7 @@ void func_80950DB8(EnGm* this, GlobalContext* globalCtx) {
Actor* al;
if (func_8010BF58(&this->actor, globalCtx, this->unk_264, this->unk_3E4, &this->unk_25C)) {
- func_8013AED4(&this->unk_3A4, 3, 7);
+ SubS_UpdateFlags(&this->unk_3A4, 3, 7);
al = func_8094DEE0(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_AL);
if ((this->unk_258 == 2) && (al != NULL) && (al->update != NULL)) {
this->unk_268 = al;
@@ -1548,16 +1539,11 @@ void func_80950DB8(EnGm* this, GlobalContext* globalCtx) {
Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp34, &sp40), 4, 0x2AA8);
}
}
- func_8013D9C8(globalCtx, this->unk_3D8, this->unk_3D2, 3);
+ SubS_FillLimbRotTables(globalCtx, this->unk_3D8, this->unk_3D2, ARRAY_COUNT(this->unk_3D8));
}
void func_80950F2C(EnGm* this, GlobalContext* globalCtx) {
- s32 sp50[] = {
- 0,
- 0,
- 3,
- 2,
- };
+ s32 sp50[] = { 0, 0, 3, 2 };
Player* player = GET_PLAYER(globalCtx);
s32 pad;
Vec3f sp3C;
@@ -1565,8 +1551,8 @@ void func_80950F2C(EnGm* this, GlobalContext* globalCtx) {
s32 sp2C;
s16 yaw;
- if (func_800EE29C(globalCtx, 0x20E)) {
- sp2C = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x20E)]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 526)) {
+ sp2C = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 526)]->action;
if (this->unk_259 != (sp2C & 0xFF)) {
if (sp2C == 3) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHAIR_ROLL);
@@ -1598,7 +1584,8 @@ void EnGm_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060078B0, NULL, this->jointTable, this->morphTable, 20);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_in2_Skel_0078B0, NULL, this->jointTable, this->morphTable,
+ 20);
this->unk_3E8 = -1;
func_8094E054(this, globalCtx, 0);
Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
@@ -1649,7 +1636,7 @@ void EnGm_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_809513AC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnGm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
s32 pad;
EnGm* this = THIS;
s32 phi_v0;
@@ -1684,7 +1671,7 @@ s32 func_809513AC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
return false;
}
-void func_809514BC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnGm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80951E24 = { 1400.0f, 0.0f, 0.0f };
EnGm* this = THIS;
s32 pad[4];
@@ -1699,7 +1686,7 @@ void func_809514BC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
OPEN_DISPS(globalCtx->state.gfxCtx);
if ((limbIndex == 15) && (this->unk_3A4 & 0x800)) {
- gSPDisplayList(POLY_OPA_DISP++, D_06007528);
+ gSPDisplayList(POLY_OPA_DISP++, object_in2_DL_007528);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -1710,7 +1697,7 @@ void func_809514BC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
}
-void func_80951594(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnGm_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnGm* this = THIS;
s32 phi_v0 = 1;
s32 phi_v1 = 0;
@@ -1752,7 +1739,8 @@ void func_80951594(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static UNK_PTR D_80951E30[] = { &D_060054A8, &D_06005028, &D_06006828, &D_06005028, &D_06005CE8, &D_06006C68 };
+ static TexturePtr D_80951E30[] = { object_in2_Tex_0054A8, object_in2_Tex_005028, object_in2_Tex_006828,
+ object_in2_Tex_005028, object_in2_Tex_005CE8, object_in2_Tex_006C68 };
EnGm* this = THIS;
if ((this->unk_258 != 0) && (this->unk_262 >= 0)) {
@@ -1762,8 +1750,9 @@ void EnGm_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80951E30[this->unk_3CE]));
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_809513AC, func_809514BC, func_80951594, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGm_OverrideLimbDraw, EnGm_PostLimbDraw,
+ EnGm_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 15e0b7622a..771f0ab83a 100644
--- a/src/overlays/actors/ovl_En_Go/z_en_go.c
+++ b/src/overlays/actors/ovl_En_Go/z_en_go.c
@@ -10,7 +10,7 @@
#include "objects/object_taisou/object_taisou.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnGo*)thisx)
@@ -186,20 +186,31 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, 0, -4 },
- { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, 2, -4 },
- { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, 2, 0 }, { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, 0 },
- { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, 0, -4 }, { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, 2, -4 },
- { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, 0, 0 }, { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, 2, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_011D98, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_003E28, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_oF1d_map_Anim_0039D8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_oF1d_map_Anim_003650, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_oF1d_map_Anim_0135E8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
- { &object_taisou_Anim_004DD4, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_0016C8, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_00283C, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_007764, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_005EE0, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_002C48, 1.0f, 0, -1, 0, 0 },
- { &object_taisou_Anim_0031D8, 1.0f, 0, -1, 0, 0 }, { &object_taisou_Anim_005790, 1.0f, 0, -1, 0, 0 },
+ { &object_taisou_Anim_004DD4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_0016C8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_00283C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_007764, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_005EE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_002C48, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_0031D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_taisou_Anim_005790, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
- { &object_hakugin_demo_Anim_001420, 1.0f, 0, -1, 2, 0 }, { &object_hakugin_demo_Anim_001A4C, 1.0f, 0, -1, 0, -4 },
- { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, 2, 0 }, { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, 0, -4 },
+ { &object_hakugin_demo_Anim_001420, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_hakugin_demo_Anim_001A4C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_hakugin_demo_Anim_002704, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_hakugin_demo_Anim_003378, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
EnGoStruct* func_80A10FD0(EnGoStruct ptr[], Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 arg4, f32 arg5, s32 arg6) {
@@ -290,8 +301,7 @@ void func_80A1143C(EnGoStruct ptr[], Vec3f arg1, Vec3f arg2, Vec3f arg3, f32 arg
void func_80A115B4(EnGoStruct ptr[], GlobalContext* globalCtx) {
static TexturePtr D_80A16644[] = {
- &gameplay_keep_Tex_08F7E0, &gameplay_keep_Tex_08F3E0, &gameplay_keep_Tex_08EFE0, &gameplay_keep_Tex_08EBE0,
- &gameplay_keep_Tex_08E7E0, &gameplay_keep_Tex_08E3E0, &gameplay_keep_Tex_08DFE0, &gameplay_keep_Tex_08DBE0,
+ &gDust8Tex, &gDust7Tex, &gDust6Tex, &gDust5Tex, &gDust4Tex, &gDust3Tex, &gDust2Tex, &gDust1Tex,
};
static Color_RGBA8 D_80A16664[] = {
{ 255, 255, 255, 0 },
@@ -524,10 +534,10 @@ s32 func_80A1222C(EnGo* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 ret = false;
- if (((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.unk1202A == 3) &&
+ if (((player->transformation == PLAYER_FORM_GORON) && (globalCtx->msgCtx.ocarinaMode == 3) &&
(globalCtx->msgCtx.unk1202E == 1) && (this->unk_3EC == 0) && (this->actor.xzDistToPlayer < 400.0f)) ||
(!(gSaveContext.weekEventReg[22] & 4) && (globalCtx->sceneNum == SCENE_16GORON_HOUSE) &&
- (gSaveContext.sceneSetupIndex == 0) && (this->unk_3EC == 0) && (globalCtx->csCtx.unk_12 == 1))) {
+ (gSaveContext.sceneSetupIndex == 0) && (this->unk_3EC == 0) && (globalCtx->csCtx.currentCsIndex == 1))) {
ret = true;
}
return ret;
@@ -662,7 +672,7 @@ s32 func_80A12774(EnGo* this, GlobalContext* globalCtx) {
this->unk_390 |= 0x20;
}
- func_8013AED4(&this->unk_390, 0, 7);
+ SubS_UpdateFlags(&this->unk_390, 0, 7);
this->unk_3C0 = 0;
this->unk_3C4 = 0;
this->unk_18C = this->actionFunc;
@@ -700,20 +710,20 @@ s32 func_80A12868(EnGo* this, GlobalContext* globalCtx) {
s32 func_80A12954(EnGo* this, GlobalContext* globalCtx) {
if ((ENGO_GET_F(&this->actor) == ENGO_F_4) && (globalCtx->csCtx.state != 0) && (this->actor.draw != NULL) &&
(globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneSetupIndex == 1) &&
- (globalCtx->csCtx.unk_12 == 0)) {
+ (globalCtx->csCtx.currentCsIndex == 0)) {
if (this->unk_3F0 == 0) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_394 = 255;
this->unk_3F0 = 1;
this->unk_18C = this->actionFunc;
}
- func_8013AED4(&this->unk_390, 0, 7);
+ SubS_UpdateFlags(&this->unk_390, 0, 7);
this->actionFunc = func_80A14FC8;
} else if (this->unk_3F0 != 0) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_394 = 255;
this->unk_3F0 = 0;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
this->actionFunc = this->unk_18C;
}
@@ -769,7 +779,7 @@ s32 func_80A12B78(EnGo* this, GlobalContext* globalCtx) {
s32 func_80A12C48(EnGo* this, GlobalContext* globalCtx, s32 arg2) {
s8 objIdx = this->actor.objBankIndex;
s8 objIdx2 = -1;
- s32 ret = 0;
+ s32 ret = false;
if ((arg2 >= 18) && (this->unk_289 >= 0)) {
objIdx2 = this->unk_289;
@@ -782,7 +792,7 @@ s32 func_80A12C48(EnGo* this, GlobalContext* globalCtx, s32 arg2) {
if (objIdx2 >= 0) {
gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[objIdx2].segment);
this->unk_3DC = arg2;
- ret = func_8013BC6C(&this->skelAnime, sAnimations, arg2);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg2);
this->unk_398 = this->skelAnime.playSpeed;
gSegments[6] = PHYSICAL_TO_VIRTUAL2(globalCtx->objectCtx.status[objIdx].segment);
}
@@ -931,20 +941,20 @@ void func_80A132C8(EnGo* this, GlobalContext* globalCtx) {
s16 temp_v1 = BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y);
if ((fabsf(this->actor.playerHeightRel) > 20.0f) || (this->actor.xzDistToPlayer > 300.0f)) {
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
} else if ((player->transformation != PLAYER_FORM_GORON) || (ABS_ALT(temp_v1) >= 0x1C70) ||
(gSaveContext.weekEventReg[21] & 4) || (gSaveContext.weekEventReg[21] & 8)) {
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
} else {
- func_8013AED4(&this->unk_390, 4, 7);
+ SubS_UpdateFlags(&this->unk_390, 4, 7);
}
}
void func_80A133A8(EnGo* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[21] & 8) {
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
} else {
- func_8013AED4(&this->unk_390, 4, 7);
+ SubS_UpdateFlags(&this->unk_390, 4, 7);
}
}
@@ -1035,7 +1045,7 @@ s32 func_80A13564(EnGo* this, f32 arg1, f32 arg2, s32 arg3) {
}
void func_80A136B8(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) {
- s16 sp26 = Quake_Add(Play_GetCamera(globalCtx, MAIN_CAM), 3);
+ s16 sp26 = Quake_Add(Play_GetCamera(globalCtx, CAM_ID_MAIN), 3);
Quake_SetCountdown(sp26, arg3);
Quake_SetSpeed(sp26, arg1);
@@ -1276,7 +1286,7 @@ void func_80A14018(EnGo* this, GlobalContext* globalCtx) {
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, this->actor.shape.rot.y, &D_80A166B0, &sp2C);
Math_Vec3f_Copy(&this->actor.world.pos, &sp2C);
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, this->unk_3A4);
this->unk_3EC = 0;
this->unk_390 = 0;
@@ -1291,7 +1301,7 @@ void func_80A14104(EnGo* this, GlobalContext* globalCtx) {
func_80A12C48(this, globalCtx, D_80A166D4[ENGO_GET_70(&this->actor) % 2]);
temp = Rand_ZeroOne() * this->skelAnime.endFrame;
this->skelAnime.curFrame = temp;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, this->unk_3A4);
this->unk_3EC = 0;
this->unk_390 = 0;
@@ -1321,7 +1331,7 @@ void func_80A1428C(EnGo* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
if (this->unk_284 != NULL) {
- this->actor.flags &= ~0x2000000;
+ this->actor.flags &= ~ACTOR_FLAG_2000000;
func_8013C8B8(this->unk_284, 0, &sp24);
temp = Math_Vec3f_Yaw(&sp30, &sp24);
this->actor.shape.rot.y = temp;
@@ -1338,7 +1348,7 @@ void func_80A14324(EnGo* this, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, this->unk_3A4);
this->unk_390 = 0;
this->actor.gravity = -1.0f;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
this->unk_3EC = 0;
this->unk_390 |= 0x40;
this->unk_3BC = 0;
@@ -1352,7 +1362,7 @@ void func_80A143A8(EnGo* this, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, this->unk_3A4);
this->unk_390 = 0;
this->actor.gravity = -1.0f;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
this->unk_3EC = 0;
this->unk_390 |= 0x40;
this->unk_390 |= 0x20;
@@ -1400,7 +1410,7 @@ void func_80A144F4(EnGo* this, GlobalContext* globalCtx) {
void func_80A145AC(EnGo* this, GlobalContext* globalCtx) {
if ((ENGO_GET_70(&this->actor) == ENGO_70_1) &&
(((globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA2) && (gSaveContext.sceneSetupIndex == 1) &&
- (globalCtx->csCtx.unk_12 == 0)) ||
+ (globalCtx->csCtx.currentCsIndex == 0)) ||
!(gSaveContext.weekEventReg[21] & 8))) {
this->actor.child = func_80A13400(this, globalCtx);
this->actor.child->child = &this->actor;
@@ -1427,11 +1437,11 @@ void func_80A146CC(EnGo* this, GlobalContext* globalCtx) {
func_80A12C48(this, globalCtx, 0);
this->unk_3A4 *= 5.0f;
Actor_SetScale(&this->actor, this->unk_3A4);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.targetMode = 3;
this->unk_390 = 0;
this->actor.gravity = -1.0f;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
this->unk_390 |= 0x40;
this->unk_390 |= 0x20;
this->unk_3D8 = func_80A13E80;
@@ -1441,8 +1451,8 @@ void func_80A146CC(EnGo* this, GlobalContext* globalCtx) {
void func_80A14798(EnGo* this, GlobalContext* globalCtx) {
s32 sp38[2] = { 0x0000003E, 0x00000F64 };
- if ((this->unk_288 < 0) || func_8013D8DC(this->unk_288, globalCtx) || (this->unk_289 < 0) ||
- func_8013D8DC(this->unk_289, globalCtx)) {
+ if ((this->unk_288 < 0) || SubS_IsObjectLoaded(this->unk_288, globalCtx) || (this->unk_289 < 0) ||
+ SubS_IsObjectLoaded(this->unk_289, globalCtx)) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable,
this->morphTable, 18);
@@ -1501,7 +1511,7 @@ void func_80A149B0(EnGo* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_GORON_CHEER - SFX_FLAG);
} else if (ENGO_GET_F(&this->actor) != ENGO_F_8) {
if (func_80A1222C(this, globalCtx)) {
- func_8013AED4(&this->unk_390, 0, 7);
+ SubS_UpdateFlags(&this->unk_390, 0, 7);
this->unk_3EC = 1;
this->actionFunc = func_80A14B30;
} else if (ENGO_GET_F(&this->actor) == ENGO_F_4) {
@@ -1516,9 +1526,9 @@ void func_80A149B0(EnGo* this, GlobalContext* globalCtx) {
}
} else if (ENGO_GET_F(&this->actor) == ENGO_F_1) {
if (ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y)) < 0x3FFC) {
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
} else {
- func_8013AED4(&this->unk_390, 0, 7);
+ SubS_UpdateFlags(&this->unk_390, 0, 7);
}
}
}
@@ -1569,7 +1579,7 @@ void func_80A14B30(EnGo* this, GlobalContext* globalCtx) {
}
this->unk_3AE += 0x400;
this->actor.shape.yOffset = (this->actor.scale.y / this->unk_3A4) * 14.0f;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
}
} else if ((this->actor.xzDistToPlayer >= 240.0f) || (this->actor.playerHeightRel >= 20.0f) ||
(this->unk_3EC != 0)) {
@@ -1580,7 +1590,7 @@ void func_80A14B30(EnGo* this, GlobalContext* globalCtx) {
this->actor.shape.yOffset = 0.0f;
}
- func_8013D9C8(globalCtx, &this->unk_3CE[0], &this->unk_3C8[0], 3);
+ SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE));
Math_ApproachS(&this->actor.shape.rot.y, sp26, 4, 0x2AA8);
}
@@ -1611,7 +1621,7 @@ void func_80A14EB0(EnGo* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(this->actor.cutscene);
func_80A143A8(this, globalCtx);
if ((ENGO_GET_F(&this->actor) == ENGO_F_4) && (ENGO_GET_70(&this->actor) == ENGO_70_1)) {
- func_8013AED4(&this->unk_390, 4, 7);
+ SubS_UpdateFlags(&this->unk_390, 4, 7);
func_80A143A8(sp24, globalCtx);
sp24->actionFunc = func_80A149B0;
}
@@ -1623,24 +1633,24 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) {
s32 sp38[] = {
0, 2, 6, 20, 18, 5, 5, 15,
};
- u16 sp36 = 0;
+ u16 actorActionCmd = 0;
s32 sp30;
- u32 sp2C;
+ s32 actionIndex;
switch (ENGO_GET_70(&this->actor)) {
case ENGO_70_0:
- sp36 = 0x80;
+ actorActionCmd = 128;
break;
case ENGO_70_1:
- sp36 = 0x81;
+ actorActionCmd = 129;
break;
}
- if ((sp36 == 0x80) || (sp36 == 0x81)) {
- if (func_800EE29C(globalCtx, sp36)) {
- sp2C = func_800EE200(globalCtx, sp36);
- sp30 = globalCtx->csCtx.npcActions[sp2C]->unk0;
+ if ((actorActionCmd == 128) || (actorActionCmd == 129)) {
+ if (Cutscene_CheckActorAction(globalCtx, actorActionCmd)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, actorActionCmd);
+ sp30 = globalCtx->csCtx.actorActions[actionIndex]->action;
if (this->unk_394 != (u8)sp30) {
this->unk_394 = sp30;
@@ -1689,7 +1699,7 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) {
break;
}
- if (sp36 == 0x80) {
+ if (actorActionCmd == 128) {
switch (globalCtx->csCtx.frames) {
case 55:
case 100:
@@ -1713,7 +1723,7 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_VOICE_EATFULL);
break;
}
- } else if (sp36 == 0x81) {
+ } else if (actorActionCmd == 129) {
switch (globalCtx->csCtx.frames) {
case 360:
case 390:
@@ -1734,8 +1744,8 @@ void func_80A14FC8(EnGo* this, GlobalContext* globalCtx) {
}
}
- func_8013D9C8(globalCtx, this->unk_3CE, this->unk_3C8, 3);
- func_800EDF24(&this->actor, globalCtx, sp2C);
+ SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE));
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
}
}
}
@@ -1748,8 +1758,8 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) {
if ((this->unk_390 & 0x1000) && (this->actor.colChkInfo.damageEffect == 0xF)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_SNOWBALL_BROKEN);
- this->actor.flags &= ~0x10;
- this->actor.flags |= 0x2000000;
+ this->actor.flags &= ~ACTOR_FLAG_10;
+ this->actor.flags |= ACTOR_FLAG_2000000;
func_80A118F8(this->unk_3F8, this->actor.world.pos);
this->actor.shape.rot.x = 0;
@@ -1854,7 +1864,7 @@ void func_80A157C4(EnGo* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
Math_ApproachS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&sp34, &sp40), 4, 0x2AA8);
}
- func_8013D9C8(globalCtx, this->unk_3CE, this->unk_3C8, 3);
+ SubS_FillLimbRotTables(globalCtx, this->unk_3CE, this->unk_3C8, ARRAY_COUNT(this->unk_3CE));
return;
}
@@ -1866,7 +1876,7 @@ void func_80A157C4(EnGo* this, GlobalContext* globalCtx) {
}
this->unk_390 &= ~0x8;
- func_8013AED4(&this->unk_390, 3, 7);
+ SubS_UpdateFlags(&this->unk_390, 3, 7);
this->unk_28C = 0;
this->unk_390 |= 0x40;
this->actionFunc = this->unk_18C;
@@ -1875,8 +1885,8 @@ void func_80A157C4(EnGo* this, GlobalContext* globalCtx) {
void EnGo_Init(Actor* thisx, GlobalContext* globalCtx) {
EnGo* this = THIS;
- this->unk_288 = func_8013D924(OBJECT_TAISOU, globalCtx);
- this->unk_289 = func_8013D924(OBJECT_HAKUGIN_DEMO, globalCtx);
+ this->unk_288 = SubS_GetObjectIndex(OBJECT_TAISOU, globalCtx);
+ this->unk_289 = SubS_GetObjectIndex(OBJECT_HAKUGIN_DEMO, globalCtx);
this->actionFunc = func_80A14798;
}
@@ -1993,7 +2003,7 @@ s32 EnGo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
return false;
}
-void EnGo_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnGo_TransfromLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnGo* this = THIS;
u16 temp_v0;
s32 phi_v1;
@@ -2044,9 +2054,9 @@ void EnGo_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void func_80A15FEC(Actor* thisx, GlobalContext* globalCtx) {
- static UNK_TYPE D_80A1670C[] = {
- &object_oF1d_map_Tex_010438, &object_oF1d_map_Tex_010C38, &object_oF1d_map_Tex_011038,
- &object_oF1d_map_Tex_010C38, &object_oF1d_map_Tex_010838,
+ static TexturePtr D_80A1670C[] = {
+ object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_011038,
+ object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_010838,
};
EnGo* this = THIS;
@@ -2060,8 +2070,9 @@ void func_80A15FEC(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk_3DC == 14) {
Matrix_InsertTranslation(0.0f, 0.0f, -4000.0f, MTXMODE_APPLY);
}
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnGo_OverrideLimbDraw, NULL, EnGo_UnkDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnGo_OverrideLimbDraw, NULL, EnGo_TransfromLimbDraw,
+ &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
} else {
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 7fbf4213f6..704167822f 100644
--- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
+++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c
@@ -5,8 +5,10 @@
*/
#include "z_en_goroiwa.h"
+#include "objects/object_goroiwa/object_goroiwa.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x80000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
#define THIS ((EnGoroiwa*)thisx)
@@ -30,21 +32,6 @@ void func_80941FA4(EnGoroiwa* this, GlobalContext* globalCtx);
void func_80942084(EnGoroiwa* this);
void func_809420F0(EnGoroiwa* this, GlobalContext* globalCtx);
-extern Gfx D_060032E0[];
-extern Gfx D_060082D0[];
-extern Gfx D_06005C20[];
-extern Gfx D_06003B40[];
-extern Gfx D_06008B90[];
-extern Gfx D_060042B0[];
-extern Gfx D_06004960[];
-extern Gfx D_06004EF0[];
-extern Gfx D_060003B0[];
-extern Gfx D_060028E0[];
-extern Gfx D_06002D70[];
-extern Gfx D_060072F0[];
-extern Gfx D_060077D0[];
-extern Gfx D_06007C60[];
-
const ActorInit En_Goroiwa_InitVars = {
ACTOR_EN_GOROIWA,
ACTORCAT_PROP,
@@ -94,9 +81,9 @@ static f32 D_80942DFC[] = {
};
static Gfx* D_80942E0C[][3] = {
- { D_060042B0, D_06004960, D_06004EF0 },
- { D_060003B0, D_060028E0, D_06002D70 },
- { D_060072F0, D_060077D0, D_06007C60 },
+ { object_goroiwa_DL_0042B0, object_goroiwa_DL_004960, object_goroiwa_DL_004EF0 },
+ { object_goroiwa_DL_0003B0, object_goroiwa_DL_0028E0, object_goroiwa_DL_002D70 },
+ { object_goroiwa_DL_0072F0, object_goroiwa_DL_0077D0, object_goroiwa_DL_007C60 },
};
static Color_RGBA8 D_80942E30[] = {
@@ -487,7 +474,7 @@ s32 func_8093F6F8(EnGoroiwa* this, GlobalContext* globalCtx) {
temp_f2 = temp_f14 - this->actor.world.pos.y;
if (fabsf(temp_f2) < (fabsf(this->actor.velocity.y) + 0.01f)) {
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
sp48.x = this->actor.world.pos.x;
sp48.y = temp_f14 + 10.0f;
sp48.z = this->actor.world.pos.z;
@@ -519,7 +506,7 @@ s32 func_8093F6F8(EnGoroiwa* this, GlobalContext* globalCtx) {
if ((this->actor.world.pos.y + this->unk_1DC) <= sp40) {
this->unk_1E5 |= 0x20;
if (sp40 < (this->unk_1DC + sp78)) {
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
Vec3f sp34;
sp34.x = this->actor.world.pos.x;
@@ -685,7 +672,7 @@ void func_80940090(EnGoroiwa* this, GlobalContext* globalCtx) {
f32 temp_f20;
s32 pad3;
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
spEC = (this->actor.scale.x + 0.1f) * 0.5f;
sp10C.x = this->actor.world.pos.x;
sp10C.y = this->actor.world.pos.y + this->unk_1DC;
@@ -914,7 +901,7 @@ void func_80940E38(EnGoroiwa* this, GlobalContext* globalCtx) {
s16 sp46;
s16 temp_a0;
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
if (this->actor.xzDistToPlayer < 1000.0f) {
sp5C = (1000.0f - this->actor.xzDistToPlayer) * 0.0012f * (this->actor.speedXZ * 0.1f);
if (Rand_ZeroOne() < sp5C) {
@@ -1371,7 +1358,7 @@ void func_8094220C(EnGoroiwa* this, GlobalContext* globalCtx) {
ptr->unk_18 = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &ptr->unk_28, &spD0, &this->actor, &spC4);
if (ptr->unk_10 <= 0.0f) {
- Matrix_InsertRotation(ptr->unk_1C, ptr->unk_1E, ptr->unk_20, 0);
+ Matrix_InsertRotation(ptr->unk_1C, ptr->unk_1E, ptr->unk_20, MTXMODE_NEW);
Matrix_MultiplyVector3fByState(&D_80942E6C, &spB8);
temp_f20 = this->unk_1DC * 0.9f;
@@ -1471,7 +1458,7 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
func_8093E91C(this);
sp5C = true;
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
if (this->actor.floorPoly != NULL) {
u32 temp_v0_2 = func_800C99D4(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
@@ -1530,7 +1517,7 @@ void EnGoroiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
func_8093FAA4(this, globalCtx);
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
s32 params = ENGOROIWA_GET_C000(&this->actor);
func_8093E938(this);
@@ -1577,9 +1564,9 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) {
Vec3s sp80;
if (params == ENGOROIWA_C000_1) {
- phi_fp = D_060032E0;
+ phi_fp = object_goroiwa_DL_0032E0;
} else {
- phi_fp = D_060082D0;
+ phi_fp = object_goroiwa_DL_0082D0;
}
for (i = 0; i < ARRAY_COUNT(this->unk_1E8); i++) {
@@ -1609,7 +1596,7 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_04076BC0);
+ gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1619,9 +1606,9 @@ void func_80942B1C(EnGoroiwa* this, GlobalContext* globalCtx) {
void EnGoroiwa_Draw(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* D_80942EB4[] = {
- D_06005C20,
- D_06003B40,
- D_06008B90,
+ object_goroiwa_DL_005C20,
+ object_goroiwa_DL_003B40,
+ object_goroiwa_DL_008B90,
};
EnGoroiwa* this = THIS;
s32 params = ENGOROIWA_GET_C000(&this->actor);
diff --git a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
index 1a877457fc..e19d2fa378 100644
--- a/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
+++ b/src/overlays/actors/ovl_En_Grasshopper/z_en_grasshopper.c
@@ -6,7 +6,7 @@
#include "z_en_grasshopper.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnGrasshopper*)thisx)
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 615d228599..9f4bdb7285 100644
--- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c
+++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c
@@ -5,9 +5,10 @@
*/
#include "z_en_gs.h"
+#include "objects/object_gs/object_gs.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnGs*)thisx)
@@ -36,10 +37,6 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx);
void func_80999A8C(EnGs* this, GlobalContext* globalCtx);
void func_80999AC0(EnGs* this);
-extern Gfx D_06000950[];
-extern Gfx D_060009D0[];
-extern Gfx D_06000A60[];
-
const ActorInit En_Gs_InitVars = {
ACTOR_EN_GS,
ACTORCAT_PROP,
@@ -115,7 +112,7 @@ s8 func_80997A90(s16 arg0, s16 arg1) {
if ((arg0 == 0) || ((arg0 != 1) && (arg0 != 2) && (arg0 == 3))) {
phi_v1 = 0;
} else {
- phi_v1 = (gSaveContext.roomInf[126][1] >> (arg1 * 3)) & 7;
+ phi_v1 = (gSaveContext.unk_EC4 >> (arg1 * 3)) & 7;
}
return phi_v1;
}
@@ -159,7 +156,7 @@ void EnGs_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_1F4 = this->unk_1FA;
Math_Vec3f_Copy(&this->unk_1B0[0], &D_801C5DB0);
Math_Vec3f_Copy(&this->unk_1B0[1], &D_801C5DB0);
- func_8013E3B8(&this->actor, &this->unk_212, 2);
+ SubS_FillCutscenesList(&this->actor, this->unk_212, ARRAY_COUNT(this->unk_212));
func_801A5080(0);
if (this->actor.params == ENGS_1) {
Actor_SetScale(&this->actor, 0.15f);
@@ -209,7 +206,7 @@ void func_80997DEC(EnGs* this, GlobalContext* globalCtx) {
void func_80997E4C(EnGs* this, GlobalContext* globalCtx) {
switch (Message_GetState(&globalCtx->msgCtx)) {
case 0:
- func_801518B0(globalCtx, this->unk_210, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_210, &this->actor);
break;
case 1:
@@ -265,7 +262,7 @@ void func_80997E4C(EnGs* this, GlobalContext* globalCtx) {
}
void func_80997FF0(EnGs* this, GlobalContext* globalCtx) {
- if (func_8013E2D4(&this->actor, globalCtx->unk_1879C[0], -1, 1)) {
+ if (SubS_StartActorCutscene(&this->actor, globalCtx->unk_1879C[0], -1, SUBS_CUTSCENE_NORMAL)) {
func_80998040(this, globalCtx);
}
}
@@ -276,7 +273,7 @@ void func_80998040(EnGs* this, GlobalContext* globalCtx) {
}
void func_8099807C(EnGs* this, GlobalContext* globalCtx) {
- switch (globalCtx->msgCtx.unk1202A) {
+ switch (globalCtx->msgCtx.ocarinaMode) {
case 3:
switch (globalCtx->msgCtx.unk1202E) {
case 7:
@@ -383,7 +380,7 @@ void func_809985B8(EnGs* this, GlobalContext* globalCtx) {
EnGs* gossipStone;
Vec3f sp38;
- if (func_8013E2D4(&this->actor, this->unk_212, -1, 0)) {
+ if (SubS_StartActorCutscene(&this->actor, this->unk_212[0], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
Player* player = GET_PLAYER(globalCtx);
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
@@ -391,8 +388,8 @@ void func_809985B8(EnGs* this, GlobalContext* globalCtx) {
Math_Vec3f_Sum(&player->actor.world.pos, &sp38, &player->actor.world.pos);
Math_Vec3f_Copy(&player->actor.prevPos, &player->actor.world.pos);
this->unk_200 = 0.0f;
- gSaveContext.roomInf[126][1] =
- (gSaveContext.roomInf[126][1] & ~(7 << (this->unk_198 * 3))) | ((this->unk_194 & 7) << (this->unk_198 * 3));
+ gSaveContext.unk_EC4 =
+ ((u32)gSaveContext.unk_EC4 & ~(7 << (this->unk_198 * 3))) | ((this->unk_194 & 7) << (this->unk_198 * 3));
gossipStone = NULL;
do {
@@ -449,11 +446,11 @@ void func_8099874C(EnGs* this, GlobalContext* globalCtx) {
if ((this->unk_19C == 5) && (this->unk_194 != 0)) {
s32 i;
- ActorCutscene_Stop(this->unk_212);
+ ActorCutscene_Stop(this->unk_212[0]);
phi_v0 = 1;
for (i = 0; i < 4; i++) {
- if (((gSaveContext.roomInf[126][1] >> (i * 3)) & 7) != (u32)this->unk_194) {
+ if (((gSaveContext.unk_EC4 >> (i * 3)) & 7) != (u32)this->unk_194) {
phi_v0 = 0;
}
}
@@ -536,10 +533,11 @@ s32 func_80998A48(EnGs* this, GlobalContext* globalCtx) {
} else if (this->unk_19D == 1) {
if (func_80998334(this, globalCtx, &this->unk_1DC, &this->unk_1E0, &this->unk_1D4, 0.8f, 0.007f, 0.001f, 7,
0) == 0.0f) {
- if ((this->actor.params != ENGS_0) && !func_801690CC(globalCtx) && !Message_GetState(&globalCtx->msgCtx)) {
+ if ((this->actor.params != ENGS_0) && !func_801690CC(globalCtx) &&
+ Message_GetState(&globalCtx->msgCtx) == 0) {
this->unk_216 = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_FAIVE_LUPY_COUNT);
- func_801518B0(globalCtx, 0x20D2, NULL);
+ Message_StartTextbox(globalCtx, 0x20D2, NULL);
}
this->unk_19A &= ~1;
sp3C = 0;
@@ -1008,7 +1006,7 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGs* this = THIS;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk11F22 = 0;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
this->collider.base.acFlags &= ~AC_HIT;
func_80997DEC(this, globalCtx);
@@ -1024,7 +1022,7 @@ void EnGs_Update(Actor* thisx, GlobalContext* globalCtx) {
s16 sp2E;
s16 sp2C;
- if ((this->actor.flags & 0x40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) {
+ if ((this->actor.flags & ACTOR_FLAG_40) || (this->unk_19A & 0x100) || (this->unk_19A & 0x200)) {
func_80999BC8(&this->actor, globalCtx);
Actor_GetScreenPos(globalCtx, &this->actor, &sp2E, &sp2C);
if ((this->actor.xyzDistToPlayerSq > SQ(400.0f)) || (sp2E < 0) || (sp2E > 320) || (sp2C < 0) ||
@@ -1085,10 +1083,10 @@ void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000950);
+ gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_000950);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->unk_1FA.r, this->unk_1FA.g, this->unk_1FA.b, 255);
- gSPDisplayList(POLY_OPA_DISP++, D_060009D0);
- gSPDisplayList(POLY_OPA_DISP++, D_06000A60);
+ gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_0009D0);
+ gSPDisplayList(POLY_OPA_DISP++, object_gs_DL_000A60);
Matrix_StatePop();
diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.h b/src/overlays/actors/ovl_En_Gs/z_en_gs.h
index 8b10cb68dc..c76a0c346f 100644
--- a/src/overlays/actors/ovl_En_Gs/z_en_gs.h
+++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.h
@@ -49,8 +49,7 @@ typedef struct EnGs {
/* 0x208 */ s32 unk_208;
/* 0x20C */ s32 unk_20C;
/* 0x210 */ u16 unk_210;
- /* 0x212 */ s16 unk_212;
- /* 0x214 */ UNK_TYPE1 unk214[2];
+ /* 0x212 */ s16 unk_212[2];
/* 0x216 */ s16 unk_216;
/* 0x218 */ s16 unk_218;
/* 0x21A */ s16 unk_21A;
diff --git a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c
index 8f7fa4f4ad..eefabdb3bb 100644
--- a/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c
+++ b/src/overlays/actors/ovl_En_Guard_Nuts/z_en_guard_nuts.c
@@ -6,7 +6,7 @@
#include "z_en_guard_nuts.h"
-#define FLAGS 0x80100009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_100000 | ACTOR_FLAG_80000000)
#define THIS ((EnGuardNuts*)thisx)
diff --git a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c
index b93a1befee..f3ba53251b 100644
--- a/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c
+++ b/src/overlays/actors/ovl_En_Guruguru/z_en_guruguru.c
@@ -5,8 +5,9 @@
*/
#include "z_en_guruguru.h"
+#include "objects/object_fu/object_fu.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnGuruguru*)thisx)
@@ -24,15 +25,7 @@ void func_80BC73F4(EnGuruguru* this);
void func_80BC7440(EnGuruguru* this, GlobalContext* globalCtx);
void func_80BC7520(EnGuruguru* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_06006C90;
extern ColliderCylinderInit D_80BC79A0;
-extern AnimationHeader D_06000B04;
-extern AnimationHeader D_0600057C;
-
-extern u64 D_06005F20[];
-extern u64 D_06006320[];
-extern u64 D_06006720[];
-extern u64 D_06006920[];
const ActorInit En_Guruguru_InitVars = {
ACTOR_EN_GURUGURU,
@@ -69,18 +62,19 @@ static ColliderCylinderInit sCylinderInit = {
{ 15, 20, 0, { 0, 0, 0 } },
};
-static AnimationHeader* D_80BC79CC[] = { &D_06000B04, &D_0600057C };
+static AnimationHeader* D_80BC79CC[] = { &object_fu_Anim_000B04, &object_fu_Anim_00057C };
static u8 D_80BC79D4[] = { 0 };
static f32 D_80BC79D8[] = { 1.0f, 1.0f };
-static void* sEyeTextures[] = { D_06005F20, D_06006320 };
-static void* sMouthTextures[] = { D_06006720, D_06006920 };
+static TexturePtr sEyeTextures[] = { object_fu_Tex_005F20, object_fu_Tex_006320 };
+static TexturePtr sMouthTextures[] = { object_fu_Tex_006720, object_fu_Tex_006920 };
void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) {
EnGuruguru* this = THIS;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006C90, &D_06000B04, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fu_Skel_006C90, &object_fu_Anim_000B04, this->jointTable,
+ this->morphTable, 16);
this->actor.targetMode = 0;
if (this->actor.params != 2) {
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -89,9 +83,9 @@ void EnGuruguru_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.params == 0) {
func_80BC6E10(this);
} else if (this->actor.params == 2) {
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
this->actor.draw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = EnGuruguru_DoNothing;
} else {
Actor_MarkForDeath(&this->actor);
diff --git a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
index 416ab1140a..108d62afd1 100644
--- a/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
+++ b/src/overlays/actors/ovl_En_Hakurock/z_en_hakurock.c
@@ -6,8 +6,10 @@
#include "z_en_hakurock.h"
#include "overlays/actors/ovl_Boss_Hakugin/z_boss_hakugin.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_boss_hakugin/object_boss_hakugin.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnHakurock*)thisx)
@@ -64,10 +66,7 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit sColChkInfoInit = { 0, 60, 60, MASS_IMMOVABLE };
-extern Gfx D_06011100[];
-
// Stalactite
-extern Gfx D_06011178[];
void EnHakurock_Init(Actor* thisx, GlobalContext* globalCtx) {
EnHakurock* this = THIS;
@@ -344,7 +343,7 @@ void func_80B228F4(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, 255, 185, 24, 255);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, &D_0406AB30);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_06AB30);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -353,7 +352,7 @@ void EnHakurock_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
Matrix_InsertTranslation(-100.0f, 0.0f, 0.0f, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06011100);
- gSPDisplayList(POLY_OPA_DISP++, D_06011178);
+ gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011100);
+ gSPDisplayList(POLY_OPA_DISP++, object_boss_hakugin_DL_011178);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
index ce1f2a0f0e..2b15971bf0 100644
--- a/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
+++ b/src/overlays/actors/ovl_En_Hanabi/z_en_hanabi.c
@@ -6,7 +6,7 @@
#include "z_en_hanabi.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnHanabi*)thisx)
diff --git a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c
index 229c1b65dd..c05a06a569 100644
--- a/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c
+++ b/src/overlays/actors/ovl_En_Heishi/z_en_heishi.c
@@ -6,7 +6,7 @@
#include "z_en_heishi.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnHeishi*)thisx)
diff --git a/src/overlays/actors/ovl_En_Hg/z_en_hg.c b/src/overlays/actors/ovl_En_Hg/z_en_hg.c
index c02ab0eaf2..2af301e139 100644
--- a/src/overlays/actors/ovl_En_Hg/z_en_hg.c
+++ b/src/overlays/actors/ovl_En_Hg/z_en_hg.c
@@ -5,8 +5,9 @@
*/
#include "z_en_hg.h"
+#include "objects/object_harfgibud/object_harfgibud.h"
-#define FLAGS 0x02100019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((EnHg*)thisx)
@@ -27,19 +28,8 @@ void func_80BCF6D0(EnHg* this, GlobalContext* globalCtx);
void func_80BCF8A0(EnHg* this, GlobalContext* globalCtx);
void func_80BCF93C(EnHg* this);
void func_80BCF95C(EnHg* this, GlobalContext* globalCtx);
-s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg);
-void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg);
-
-extern AnimationHeader D_06000370;
-extern AnimationHeader D_06001138;
-extern AnimationHeader D_060015D4;
-extern AnimationHeader D_06001960;
-extern AnimationHeader D_0600260C;
-extern Gfx D_06005E28[];
-extern FlexSkeletonHeader D_06008580;
-extern AnimationHeader D_06009D44;
-extern AnimationHeader D_0600A164;
-extern AnimationHeader D_0600AE1C;
+s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
+void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx);
const ActorInit En_Hg_InitVars = {
ACTOR_EN_HG,
@@ -112,11 +102,15 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, 0x80,
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_0600260C, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06009D44, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &D_0600A164, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &D_06000370, 1.0f, 0.0f, 0.0f, 2, 0.0f },
- { &D_06001138, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_060015D4, 1.0f, 0.0f, 0.0f, 2, 0.0f },
- { &D_06001960, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_0600AE1C, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_harfgibud_Anim_00260C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_harfgibud_Anim_009D44, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_harfgibud_Anim_00A164, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_harfgibud_Anim_000370, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_harfgibud_Anim_001138, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_harfgibud_Anim_0015D4, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_harfgibud_Anim_001960, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_harfgibud_Anim_00AE1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
};
static u32 D_80BD00C8 = false;
@@ -127,12 +121,12 @@ void EnHg_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 36.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008580, &D_0600260C, this->jointTable, this->morphTable,
- HG_LIMB_MAX);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_harfgibud_Skel_008580, &object_harfgibud_Anim_00260C,
+ this->jointTable, this->morphTable, HG_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
- if ((gSaveContext.weekEventReg[0x4B] & 0x20) || (gSaveContext.weekEventReg[0x34] & 0x20)) {
+ if ((gSaveContext.weekEventReg[75] & 0x20) || (gSaveContext.weekEventReg[52] & 0x20)) {
Actor_MarkForDeath(&this->actor);
}
this->actor.targetMode = 1;
@@ -155,17 +149,17 @@ void EnHg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80BCF354(EnHg* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80BCF398;
}
void func_80BCF398(EnHg* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.health == 1) {
if ((this->actor.xzDistToPlayer < 200.0f && this->actor.playerHeightRel < 40.0f) &&
- !func_800EE29C(globalCtx, 0x1E3)) {
+ !Cutscene_CheckActorAction(globalCtx, 0x1E3)) {
func_80BCF468(this);
}
- if ((gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.unk_12 == 0) &&
+ if ((gSaveContext.sceneSetupIndex == 0 && globalCtx->csCtx.currentCsIndex == 0) &&
(globalCtx->csCtx.frames == 20 || globalCtx->csCtx.frames == 60)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_HALF_REDEAD_SURPRISE);
}
@@ -173,7 +167,7 @@ void func_80BCF398(EnHg* this, GlobalContext* globalCtx) {
}
void func_80BCF468(EnHg* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80BCF4AC;
}
@@ -182,7 +176,7 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) {
s32 pad;
this->actor.speedXZ = 1.6f;
- if (!(player->stateFlags2 & 0x08000000) && !Message_GetState(&globalCtx->msgCtx)) {
+ if (!(player->stateFlags2 & 0x08000000) && Message_GetState(&globalCtx->msgCtx) == 0) {
if (((this->skelAnime.curFrame > 9.0f) && (this->skelAnime.curFrame < 16.0f)) ||
((this->skelAnime.curFrame > 44.0f) && (this->skelAnime.curFrame < 51.0f))) {
Actor_MoveWithGravity(&this->actor);
@@ -197,7 +191,7 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) {
}
void func_80BCF5F0(EnHg* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80BCF634;
}
@@ -210,7 +204,7 @@ void func_80BCF634(EnHg* this, GlobalContext* globalCtx) {
}
void func_80BCF68C(EnHg* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->actionFunc = func_80BCF6D0;
}
@@ -223,7 +217,7 @@ void func_80BCF6D0(EnHg* this, GlobalContext* globalCtx) {
void func_80BCF710(EnHg* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 0) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x24F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x24F, &this->actor);
} else {
func_800B8614(&this->actor, globalCtx, 80.0f);
}
@@ -234,7 +228,7 @@ void func_80BCF778(EnHg* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.health == 1) {
if (this->actionFunc == func_80BCF4AC || this->actionFunc == func_80BCF6D0 ||
this->actionFunc == func_80BCF634) {
- func_800B9010(&this->actor, 0x32B7);
+ func_800B9010(&this->actor, NA_SE_EN_HALF_REDEAD_LOOP - SFX_FLAG);
}
}
}
@@ -277,24 +271,25 @@ void func_80BCF93C(EnHg* this) {
}
void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x1E4)) {
- u32 actionIndex = func_800EE200(globalCtx, 0x1E4);
- if (this->cutscenes[3] != globalCtx->csCtx.npcActions[actionIndex]->unk0) {
- this->cutscenes[3] = globalCtx->csCtx.npcActions[actionIndex]->unk0;
- switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 484)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 484);
+
+ if (this->cutscenes[3] != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->cutscenes[3] = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
this->currentAnimation = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
break;
case 2:
this->cutscenes[2] = 0;
this->currentAnimation = 3;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
break;
case 3:
this->cutscenes[2] = 0;
this->currentAnimation = 5;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
break;
case 4:
this->cutscenes[2] = 0;
@@ -302,14 +297,14 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
if ((this->unk218 == 1) || (this->unk218 == 3)) {
func_8019F128(NA_SE_EN_HALF_REDEAD_TRANS);
}
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
break;
case 5:
this->currentAnimation = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
break;
case 6:
- gSaveContext.weekEventReg[0x4B] |= 0x20;
+ gSaveContext.weekEventReg[75] |= 0x20;
Actor_MarkForDeath(&this->actor);
break;
}
@@ -318,11 +313,11 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
switch (this->currentAnimation) {
case 3:
this->currentAnimation = 4;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
break;
case 5:
this->currentAnimation = 6;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
break;
}
}
@@ -342,7 +337,7 @@ void func_80BCF95C(EnHg* this, GlobalContext* globalCtx) {
}
break;
}
- func_800EDF24(&this->actor, globalCtx, actionIndex);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
return;
} else if (globalCtx->csCtx.state == 0) {
func_80BCF354(this);
@@ -362,7 +357,7 @@ void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
} else {
D_80BD00C8 = false;
}
- if (globalCtx->msgCtx.unk1202A == 3) {
+ if (globalCtx->msgCtx.ocarinaMode == 3) {
if (globalCtx->msgCtx.unk1202E == 7 && gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
if (INV_CONTENT(ITEM_MASK_GIBDO) == ITEM_MASK_GIBDO) {
this->unk218 = 3;
@@ -374,8 +369,8 @@ void func_80BCFC0C(EnHg* this, GlobalContext* globalCtx) {
} else {
if (this->actor.xzDistToPlayer < 60.0f && fabsf(this->actor.playerHeightRel) < 40.0f) {
if ((this->actionFunc != func_80BCF8A0) && (this->actionFunc != func_80BCF95C)) {
- if (!(gSaveContext.weekEventReg[0x3D] & 2)) {
- gSaveContext.weekEventReg[0x3D] |= 2;
+ if (!(gSaveContext.weekEventReg[61] & 2)) {
+ gSaveContext.weekEventReg[61] |= 2;
this->unk218 = 0;
} else {
this->unk218 = 2;
@@ -401,7 +396,7 @@ void EnHg_Update(Actor* thisx, GlobalContext* globalCtx) {
}
s32 EnHg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
- return 0;
+ return false;
}
void EnHg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@@ -422,6 +417,6 @@ void EnHg_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnHg_OverrideLimbDraw, EnHg_PostLimbDraw, &this->actor);
Matrix_SetCurrentState(&this->unk1D8);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06005E28);
+ gSPDisplayList(POLY_OPA_DISP++, object_harfgibud_DL_005E28);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
index 1793384019..d089de0da8 100644
--- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
+++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.c
@@ -5,8 +5,9 @@
*/
#include "z_en_hgo.h"
+#include "objects/object_harfgibud/object_harfgibud.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnHgo*)thisx)
@@ -15,7 +16,18 @@ void EnHgo_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnHgo_Update(Actor* thisx, GlobalContext* globalCtx);
void EnHgo_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80BD03EC(EnHgo* this);
+void func_80BD0410(EnHgo* this, GlobalContext* globalCtx);
+void func_80BD0434(EnHgo* this, GlobalContext* globalCtx);
+void func_80BD049C(EnHgo* this);
+void func_80BD04E0(EnHgo* this, GlobalContext* globalCtx);
+void EnHgo_SetupDialogueHandler(EnHgo* this);
+void EnHgo_DefaultDialogueHandler(EnHgo* this, GlobalContext* globalCtx);
+void func_80BD06FC(EnHgo* this, GlobalContext* globalCtx);
+s32 func_80BD0898(EnHgo* this, GlobalContext* globalCtx);
+s32 EnHgo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
+void EnHgo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* pos, Actor* thisx);
+
const ActorInit En_Hgo_InitVars = {
ACTOR_EN_HGO,
ACTORCAT_NPC,
@@ -28,54 +40,342 @@ const ActorInit En_Hgo_InitVars = {
(ActorFunc)EnHgo_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BD0F48 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static AnimationInfo sAnimations[] = {
+ { &object_harfgibud_Anim_00B644, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_harfgibud_Anim_013684, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_harfgibud_Anim_0152EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_harfgibud_Anim_015C70, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_harfgibud_Anim_0165F0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_harfgibud_Anim_014220, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_harfgibud_Anim_014A9C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+};
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 18, 46, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BD0F74 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-#endif
+static TexturePtr sEyeTextures[] = {
+ object_harfgibud_Tex_011138,
+ object_harfgibud_Tex_011938,
+ object_harfgibud_Tex_012138,
+};
-extern ColliderCylinderInit D_80BD0F48;
-extern CollisionCheckInfoInit2 D_80BD0F74;
+void EnHgo_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnHgo* this = THIS;
+ s32 pad;
-extern UNK_TYPE D_0600B644;
-extern UNK_TYPE D_0600F248;
+ ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_harfgibud_Skel_012A58, &object_harfgibud_Anim_00B644,
+ this->jointTable, this->morphTable, HGO_LIMB_MAX);
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&thisx->colChkInfo, NULL, &sColChkInfoInit);
+ thisx->targetMode = 6;
+ this->unk_30C = 0;
+ this->unk_30E = 0;
+ this->unk_314 = 0;
+ this->unk_310 = 0;
+ this->unk_312 = 0;
+ if ((gSaveContext.weekEventReg[75] & 0x20) || (gSaveContext.weekEventReg[52] & 0x20)) {
+ func_80BD049C(this);
+ } else {
+ thisx->draw = NULL;
+ func_80BD03EC(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/EnHgo_Init.s")
+void EnHgo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnHgo* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/EnHgo_Destroy.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD03EC.s")
+void func_80BD03EC(EnHgo* this) {
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actionFunc = func_80BD0410;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0410.s")
+void func_80BD0410(EnHgo* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0420.s")
+void func_80BD0420(EnHgo* this) {
+ this->actionFunc = func_80BD0434;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0434.s")
+void func_80BD0434(EnHgo* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.focus.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.focus.pos.z;
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD049C.s")
+void func_80BD049C(EnHgo* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actionFunc = func_80BD04E0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD04E0.s")
+void func_80BD04E0(EnHgo* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) {
+ if (!(this->unk_310 & 4)) {
+ this->unk_310 |= 4;
+ Message_StartTextbox(globalCtx, 0x15A5, &this->actor);
+ this->unk_314 = 0x15A5; // That mask is a gibdo
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD064C.s")
+ } else {
+ Message_StartTextbox(globalCtx, 0x15A7, &this->actor);
+ this->unk_314 = 0x15A7; // can I research that mask
+ }
+ } else if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
+ if (!(this->unk_310 & 1)) {
+ this->unk_310 |= 1;
+ Message_StartTextbox(globalCtx, 0x158F, &this->actor);
+ this->unk_314 = 0x158F; // Isn't this a fairy
+ } else {
+ Message_StartTextbox(globalCtx, 0x1593, &this->actor);
+ this->unk_314 = 0x1593; // Never seen a fairy this lively
+ }
+ } else {
+ if (!(this->unk_310 & 2)) {
+ this->unk_310 |= 2;
+ Message_StartTextbox(globalCtx, 0x1595, &this->actor);
+ this->unk_314 = 0x1595; // ghost radar is reacting
+ } else {
+ Message_StartTextbox(globalCtx, 0x1598, &this->actor);
+ this->unk_314 = 0x1598; // you seem to be similar to a ghost
+ }
+ }
+ EnHgo_SetupDialogueHandler(this);
+ } else {
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0660.s")
+void EnHgo_SetupDialogueHandler(EnHgo* this) {
+ this->actionFunc = EnHgo_DefaultDialogueHandler;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD06FC.s")
+void EnHgo_DefaultDialogueHandler(EnHgo* this, GlobalContext* globalCtx) {
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ break;
+ case 5:
+ func_80BD06FC(this, globalCtx);
+ break;
+ case 6:
+ if (func_80147624(globalCtx)) {
+ func_80BD049C(this);
+ }
+ }
+ Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x71C, 0xB6);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0898.s")
+void func_80BD06FC(EnHgo* this, GlobalContext* globalCtx) {
+ if (func_80147624(globalCtx)) {
+ switch (this->unk_314) {
+ case 0x158F:
+ Message_StartTextbox(globalCtx, 0x1590, &this->actor);
+ this->unk_314 = 0x1590;
+ break;
+ case 0x1590:
+ if (gSaveContext.weekEventReg[14] & 4) {
+ Message_StartTextbox(globalCtx, 0x1591, &this->actor);
+ this->unk_314 = 0x1591;
+ break;
+ }
+ Message_StartTextbox(globalCtx, 0x1592, &this->actor);
+ this->unk_314 = 0x1592;
+ break;
+ case 0x1591:
+ Message_StartTextbox(globalCtx, 0x1592, &this->actor);
+ this->unk_314 = 0x1592;
+ break;
+ case 0x1593:
+ Message_StartTextbox(globalCtx, 0x1594, &this->actor);
+ this->unk_314 = 0x1594;
+ break;
+ case 0x1595:
+ Message_StartTextbox(globalCtx, 0x1596, &this->actor);
+ this->unk_314 = 0x1596;
+ break;
+ case 0x1596:
+ Message_StartTextbox(globalCtx, 0x1597, &this->actor);
+ this->unk_314 = 0x1597;
+ break;
+ case 0x1598:
+ Message_StartTextbox(globalCtx, 0x1599, &this->actor);
+ this->unk_314 = 0x1599;
+ break;
+ case 0x15A5:
+ Message_StartTextbox(globalCtx, 0x15A6, &this->actor);
+ this->unk_314 = 0x15A6;
+ break;
+ case 0x15A6:
+ Message_StartTextbox(globalCtx, 0x15A7, &this->actor);
+ this->unk_314 = 0x15A7;
+ break;
+ case 0x15A7:
+ func_801477B4(globalCtx);
+ func_80BD049C(this);
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0B8C.s")
+s32 func_80BD0898(EnHgo* this, GlobalContext* globalCtx) {
+ s32 actionIndex;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/EnHgo_Update.s")
+ if (Cutscene_CheckActorAction(globalCtx, 486)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 486);
+ if (this->unk_316 != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->unk_316 = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ this->unk_218 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ break;
+ case 2:
+ this->actor.draw = EnHgo_Draw;
+ this->unk_218 = 1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ break;
+ case 3:
+ this->unk_218 = 2;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ break;
+ case 4:
+ this->unk_218 = 3;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ break;
+ case 5:
+ this->unk_218 = 4;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ break;
+ case 6:
+ this->unk_218 = 5;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
+ break;
+ }
+ } else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ switch (this->unk_218) {
+ case 1:
+ if ((Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) && (this->unk_312 == 0)) {
+ this->unk_312 = 1;
+ if ((gSaveContext.sceneSetupIndex == 0) &&
+ ((globalCtx->csCtx.currentCsIndex == 2) || (globalCtx->csCtx.currentCsIndex == 4))) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_GBVO02);
+ }
+ }
+ break;
+ case 2:
+ this->unk_218 = 3;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ break;
+ case 5:
+ this->unk_218 = 6;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0CF0.s")
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ return true;
+ }
+ if ((globalCtx->csCtx.state == 0) && (((gSaveContext.weekEventReg[75]) & 0x20)) &&
+ (this->actionFunc == func_80BD0410)) {
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_ELF_MSG2, this->actor.focus.pos.x, this->actor.focus.pos.y,
+ this->actor.focus.pos.z, 7, 0, 0, 0x7F5A);
+ func_80BD0420(this);
+ }
+ this->unk_316 = 0x63;
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/func_80BD0D38.s")
+void func_80BD0B8C(EnHgo* this, GlobalContext* globalCtx) {
+ func_800E9250(globalCtx, &this->actor, &this->unk_300, &this->unk_306, this->actor.focus.pos);
+ if (this->unk_30E > 2) {
+ this->unk_30E--;
+ } else if (this->unk_30E == 2) {
+ this->unk_30C = 1;
+ this->unk_30E = 1;
+ } else if (this->unk_30E == 1) {
+ this->unk_30C = 2;
+ this->unk_30E = 0;
+ } else {
+ this->unk_30C = 0;
+ this->unk_30E = 60;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hgo/EnHgo_Draw.s")
+void EnHgo_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnHgo* this = THIS;
+ s32 pad;
+
+ this->actionFunc(this, globalCtx);
+ SkelAnime_Update(&this->skelAnime);
+ if (func_80BD0898(this, globalCtx)) {
+ func_800E8F08(&this->unk_300, &this->unk_306);
+ } else if (this->actionFunc != func_80BD0410) {
+ if (this->actionFunc != func_80BD0434) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ func_80BD0B8C(this, globalCtx);
+ }
+ }
+}
+
+s32 EnHgo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnHgo* this = THIS;
+
+ if (limbIndex == HGO_LIMB_PELVIS) {
+ rot->x += this->unk_300.y;
+ rot->z += this->unk_300.x;
+ }
+ return false;
+}
+
+void EnHgo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* pos, Actor* thisx) {
+ EnHgo* this = THIS;
+
+ if (limbIndex == HGO_LIMB_PELVIS) {
+ Matrix_CopyCurrentState(&this->unk_1D8);
+ Matrix_GetStateTranslation(&this->actor.focus.pos);
+ }
+}
+
+void EnHgo_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnHgo* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->unk_30C]));
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnHgo_OverrideLimbDraw, &EnHgo_PostLimbDraw, &this->actor);
+ Matrix_SetCurrentState(&this->unk_1D8);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_harfgibud_DL_00F248);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h
index 3d7ff6e558..f39aab0fdf 100644
--- a/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h
+++ b/src/overlays/actors/ovl_En_Hgo/z_en_hgo.h
@@ -7,11 +7,47 @@ struct EnHgo;
typedef void (*EnHgoActionFunc)(struct EnHgo*, GlobalContext*);
+// Shares the same setup as en_hg
+typedef enum {
+ /* 00 */ HGO_LIMB_NONE,
+ /* 01 */ HGO_LIMB_ABDOMEN,
+ /* 02 */ HGO_LIMB_CHEST,
+ /* 03 */ HGO_LIMB_SHOULDER_LEFT,
+ /* 04 */ HGO_LIMB_ARM_LEFT,
+ /* 05 */ HGO_LIMB_HAND_LEFT,
+ /* 06 */ HGO_LIMB_SHOULDER_RIGHT,
+ /* 07 */ HGO_LIMB_ARM_RIGHT,
+ /* 08 */ HGO_LIMB_HAND_RIGHT,
+ /* 09 */ HGO_LIMB_EYEBROW,
+ /* 10 */ HGO_LIMB_HEAD,
+ /* 11 */ HGO_LIMB_PELVIS,
+ /* 12 */ HGO_LIMB_THIGH_LEFT,
+ /* 13 */ HGO_LIMB_LEG_LEFT,
+ /* 14 */ HGO_LIMB_FOOT_LEFT,
+ /* 15 */ HGO_LIMB_THIGH_RIGHT,
+ /* 16 */ HGO_LIMB_LEG_RIGHT,
+ /* 17 */ HGO_LIMB_FOOT_RIGHT,
+ /* 18 */ HGO_LIMB_UNK,
+ /* 19 */ HGO_LIMB_MAX,
+} ObjectHgoLimbs;
+
typedef struct EnHgo {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x90];
- /* 0x01D4 */ EnHgoActionFunc actionFunc;
- /* 0x01D8 */ char unk_1D8[0x140];
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ ColliderCylinder collider;
+ /* 0x190 */ SkelAnime skelAnime;
+ /* 0x1D4 */ EnHgoActionFunc actionFunc;
+ /* 0x1D8 */ MtxF unk_1D8;
+ /* 0x218 */ s32 unk_218;
+ /* 0x21C */ Vec3s jointTable[HGO_LIMB_MAX];
+ /* 0x28E */ Vec3s morphTable[HGO_LIMB_MAX];
+ /* 0x300 */ Vec3s unk_300;
+ /* 0x306 */ Vec3s unk_306;
+ /* 0x30C */ s16 unk_30C;
+ /* 0x30E */ s16 unk_30E;
+ /* 0x310 */ s16 unk_310;
+ /* 0x312 */ s16 unk_312;
+ /* 0x314 */ u16 unk_314;
+ /* 0x316 */ u16 unk_316;
} EnHgo; // size = 0x318
extern const ActorInit En_Hgo_InitVars;
diff --git a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
index 2dc8197196..c19e596ace 100644
--- a/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
+++ b/src/overlays/actors/ovl_En_Hidden_Nuts/z_en_hidden_nuts.c
@@ -6,7 +6,7 @@
#include "z_en_hidden_nuts.h"
-#define FLAGS 0x02000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_2000000)
#define THIS ((EnHiddenNuts*)thisx)
diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
index 0807f007de..fa5b8e1904 100644
--- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
+++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c
@@ -5,8 +5,9 @@
*/
#include "z_en_hint_skb.h"
+#include "objects/object_skb/object_skb.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnHintSkb*)thisx)
@@ -15,19 +16,28 @@ void EnHintSkb_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnHintSkb_Update(Actor* thisx, GlobalContext* globalCtx);
void EnHintSkb_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80C1FE0C(EnHintSkb* this);
void func_80C1FE20(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C1FE80(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C1FF30(EnHintSkb* this);
void func_80C1FF88(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C2003C(EnHintSkb* this);
void func_80C200B8(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C2016C(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C20334(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C20484(EnHintSkb* this);
void func_80C204F0(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C20590(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C2069C(EnHintSkb* this, GlobalContext* globalCtx);
void func_80C2077C(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C208BC(EnHintSkb* this);
void func_80C208D0(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C20B88(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C20C24(EnHintSkb* this, GlobalContext* globalCtx);
+s32 func_80C21414(EnHintSkb* this);
+void func_80C21468(EnHintSkb* this, GlobalContext* globalCtx);
+void func_80C215E4(GlobalContext* globalCtx, EnHintSkb* this, Vec3f* arg2);
-#if 0
const ActorInit En_Hint_Skb_InitVars = {
ACTOR_EN_HINT_SKB,
ACTORCAT_NPC,
@@ -40,29 +50,47 @@ const ActorInit En_Hint_Skb_InitVars = {
(ActorFunc)EnHintSkb_Draw,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[2] = {
-static ColliderJntSphElementInit D_80C21C80[2] = {
+static ColliderJntSphElementInit sJntSphElementsInit[2] = {
{
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x00, 0x04 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ 15, { { 0, 0, 0 }, 10 }, 100 },
},
{
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 1, { { 0, 0, 0 }, 20 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80C21CC8 = {
- { COLTYPE_HIT6, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_JNTSPH, },
- 2, D_80C21C80, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_HIT6,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_JNTSPH,
+ },
+ 2,
+ sJntSphElementsInit,
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80C21CD8 = { 2, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 2, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80C21CE4 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x1),
/* Deku Stick */ DMG_ENTRY(1, 0xD),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -97,96 +125,787 @@ static DamageTable D_80C21CE4 = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80C21E3C[] = {
+static AnimationInfo sAnimations[] = {
+ { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
+ { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
+ { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
+ { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP),
};
-#endif
+void EnHintSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnHintSkb* this = THIS;
-extern ColliderJntSphElementInit D_80C21C80[2];
-extern ColliderJntSphInit D_80C21CC8;
-extern CollisionCheckInfoInit2 D_80C21CD8;
-extern DamageTable D_80C21CE4;
-extern InitChainEntry D_80C21E3C[];
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_00697C, this->jointTable,
+ this->morphtable, 20);
+ Collider_InitJntSph(globalCtx, &this->collider);
+ Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElement);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ this->actor.hintId = 0x55;
+ this->unk_3E4 = 0;
+ this->unk_3DE = 0;
+ this->unk_3E0 = 0;
+ this->unk_3DC = 0;
+ this->unk_3E9 = 0;
+ func_80C1FE0C(this);
+}
-extern UNK_TYPE D_06002190;
-extern UNK_TYPE D_06003584;
-extern UNK_TYPE D_0600697C;
+void EnHintSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnHintSkb* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Init.s")
+ Collider_DestroyJntSph(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Destroy.s")
+void func_80C1FE0C(EnHintSkb* this) {
+ this->actionFunc = func_80C1FE20;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE0C.s")
+void func_80C1FE20(EnHintSkb* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE20.s")
+void func_80C1FE30(EnHintSkb* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ this->actor.speedXZ = 1.6f;
+ this->actionFunc = func_80C1FE80;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE30.s")
+void func_80C1FE80(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK);
+ }
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 750, 0);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) {
+ func_80C1FF30(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FE80.s")
+void func_80C1FF30(EnHintSkb* this) {
+ this->collider.base.atFlags &= ~AT_BOUNCED;
+ this->actor.speedXZ = 0.0f;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ this->actionFunc = func_80C1FF88;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FF30.s")
+void func_80C1FF88(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->collider.base.atFlags & AT_BOUNCED) {
+ this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT);
+ func_80C2003C(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C1FF88.s")
+ if (Animation_OnFrame(&this->skelAnime, 3.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2003C.s")
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if (func_80C21414(this) && (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN)) {
+ func_80C1FF30(this);
+ } else {
+ func_80C1FE30(this);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C200B8.s")
+void func_80C2003C(EnHintSkb* this) {
+ Animation_Change(&this->skelAnime, &object_skb_Anim_002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f);
+ this->collider.base.atFlags &= ~AT_BOUNCED;
+ this->actionFunc = func_80C200B8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2011C.s")
+void func_80C200B8(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if (func_80C21414(this)) {
+ func_80C1FF30(this);
+ } else {
+ func_80C1FE30(this);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2016C.s")
+void func_80C2011C(EnHintSkb* this) {
+ if (this->actor.bgCheckFlags & 1) {
+ this->actor.speedXZ = 0.0f;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE);
+ this->actionFunc = func_80C2016C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20274.s")
+void func_80C2016C(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->actor.bgCheckFlags & 2) {
+ this->actor.speedXZ = 0.0f;
+ } else if (this->actor.bgCheckFlags & 1) {
+ if (this->actor.speedXZ < 0.0f) {
+ this->actor.speedXZ += 0.05f;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20334.s")
+ if ((this->actor.colorFilterTimer == 0) && (this->actor.bgCheckFlags & 1)) {
+ if (this->actor.colChkInfo.health == 0) {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ func_80C20484(this);
+ } else if (this->skelAnime.animation == &object_skb_Anim_00697C) {
+ func_80C1FE0C(this);
+ } else if (func_80C21414(this)) {
+ func_80C1FF30(this);
+ } else {
+ func_80C1FE30(this);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20484.s")
+void func_80C20274(EnHintSkb* this) {
+ if (this->skelAnime.animation == &object_skb_Anim_00697C) {
+ this->actor.world.rot.y = this->actor.yawTowardsPlayer;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
+ this->actor.gravity = -1.0f;
+ this->actor.speedXZ = 1.0f;
+ } else {
+ this->actor.world.rot.y = this->actor.yawTowardsPlayer;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ if (this->actor.bgCheckFlags & 1) {
+ this->actor.speedXZ = -4.0f;
+ }
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ this->actionFunc = func_80C20334;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C204F0.s")
+void func_80C20334(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->actor.bgCheckFlags & 2) {
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20540.s")
+ for (i = 0; i < 10; i++) {
+ func_80C215E4(globalCtx, this, &this->actor.world.pos);
+ }
+ this->actor.speedXZ = 0.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20590.s")
+ if (this->actor.bgCheckFlags & 1) {
+ if (this->actor.speedXZ < 0.0f) {
+ this->actor.speedXZ += 0.05f;
+ } else if (this->actor.speedXZ != 0.0f) {
+ this->actor.speedXZ -= 0.05f;
+ }
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 2500, 0);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2066C.s")
+ Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 16, 2000, 100);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2069C.s")
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (this->actor.bgCheckFlags & 1)) {
+ this->actor.world.rot = this->actor.shape.rot;
+ func_80C1FE30(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2075C.s")
+void func_80C20484(EnHintSkb* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ this->unk_3E8 |= 4;
+ if (this->actor.bgCheckFlags & 1) {
+ this->actor.speedXZ = -6.0f;
+ }
+ this->actionFunc = func_80C204F0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C2077C.s")
+void func_80C204F0(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (!(this->unk_3E8 & 8)) {
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C208BC.s")
+ Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x10);
+ Actor_MarkForDeath(&this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C208D0.s")
+void func_80C20540(EnHintSkb* this) {
+ if (this->actor.bgCheckFlags & 1) {
+ this->actor.speedXZ = 0.0f;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_COMMON_FREEZE);
+ this->actionFunc = func_80C20590;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20A74.s")
+void func_80C20590(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->unk_3E2 == 0) {
+ this->unk_3E2 = 0;
+ this->unk_2D8 = 0.0f;
+ this->unk_2D4 = 0.0f;
+ if (this->actor.colChkInfo.health != 0) {
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ this->unk_3E8 |= 1;
+ func_80C20274(this);
+ } else {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ func_80C20484(this);
+ }
+ } else if (this->unk_3E2 == 1) {
+ func_80C21468(this, globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20B88.s")
+void func_80C2066C(EnHintSkb* this) {
+ if (this->actor.bgCheckFlags & 1) {
+ this->actor.speedXZ = 0.0f;
+ }
+ this->actionFunc = func_80C2069C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20C24.s")
+void func_80C2069C(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->unk_3E2 == 0) {
+ this->unk_3E2 = 0;
+ this->unk_2D8 = 0.0f;
+ this->unk_2D4 = 0.0f;
+ if (this->actor.colChkInfo.health != 0) {
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ this->unk_3E8 |= 1;
+ func_80C20274(this);
+ } else {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ func_80C20484(this);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20D64.s")
+void func_80C2075C(EnHintSkb* this) {
+ this->unk_3E0 = 0;
+ this->actor.speedXZ = 0.0f;
+ this->actionFunc = func_80C2077C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C20E90.s")
+void func_80C2077C(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_3E0 = 1;
+ if (this->unk_3DC == 0) {
+ this->unk_3DC = 1;
+ Message_StartTextbox(globalCtx, 0x1147, &this->actor);
+ this->unk_3E6 = 0x1147;
+ if (this->skelAnime.animation == &object_skb_Anim_00697C) {
+ globalCtx->msgCtx.msgMode = 0x44;
+ this->actor.speedXZ = 2.4f;
+ this->actor.gravity = -1.0f;
+ this->actor.velocity.y = 3.0f;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
+ }
+ } else {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
+ Message_StartTextbox(globalCtx, 0x1148, &this->actor);
+ this->unk_3E6 = 0x1148;
+ }
+ func_80C208BC(this);
+ } else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) {
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21250.s")
+void func_80C208BC(EnHintSkb* this) {
+ this->actionFunc = func_80C208D0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21320.s")
+void func_80C208D0(EnHintSkb* this, GlobalContext* globalCtx) {
+ this->unk_3DE = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21414.s")
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 3:
+ if ((globalCtx->gameplayFrames % 2) != 0) {
+ this->unk_3DE = 1;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21468.s")
+ case 4:
+ func_80C20B88(this, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C215E4.s")
+ case 5:
+ func_80C20C24(this, globalCtx);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Update.s")
+ case 6:
+ if (func_80147624(globalCtx)) {
+ func_80C2075C(this);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C21858.s")
+ case 0:
+ case 1:
+ case 2:
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/func_80C219D4.s")
+ if (this->unk_3E6 == 0x1147) {
+ if (this->actor.bgCheckFlags & 2) {
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Hint_Skb/EnHintSkb_Draw.s")
+ this->actor.speedXZ = 0.0f;
+
+ for (i = 0; i < 10; i++) {
+ func_80C215E4(globalCtx, this, &this->actor.world.pos);
+ }
+ }
+
+ if ((this->skelAnime.animation == &object_skb_Anim_003584) &&
+ Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ Message_StartTextbox(globalCtx, 0x1147, &this->actor);
+ this->unk_3E6 = 0x1147;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ }
+ }
+
+ if (this->actor.bgCheckFlags & 1) {
+ Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 5, 0x71C, 0xB6);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ }
+}
+
+void func_80C20A74(EnHintSkb* this, GlobalContext* globalCtx) {
+ s32 params = ENHINTSKB_GET_FF(&this->actor);
+
+ switch (params) {
+ case 1:
+ Message_StartTextbox(globalCtx, 0x1149, &this->actor);
+ this->unk_3E6 = 0x1149;
+ break;
+
+ case 2:
+ Message_StartTextbox(globalCtx, 0x114A, &this->actor);
+ this->unk_3E6 = 0x114A;
+ break;
+
+ case 3:
+ Message_StartTextbox(globalCtx, 0x114B, &this->actor);
+ this->unk_3E6 = 0x114B;
+ break;
+
+ case 4:
+ Message_StartTextbox(globalCtx, 0x114C, &this->actor);
+ this->unk_3E6 = 0x114C;
+ break;
+
+ case 5:
+ Message_StartTextbox(globalCtx, 0x114D, &this->actor);
+ this->unk_3E6 = 0x114D;
+ break;
+
+ case 6:
+ Message_StartTextbox(globalCtx, 0x114E, &this->actor);
+ this->unk_3E6 = 0x114E;
+ break;
+
+ default:
+ Message_StartTextbox(globalCtx, 0x1149, &this->actor);
+ this->unk_3E6 = 0x1149;
+ break;
+ }
+}
+
+void func_80C20B88(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (func_80147624(globalCtx)) {
+ if (globalCtx->msgCtx.choiceIndex == 0) {
+ func_8019F208();
+ this->unk_3E8 |= 0x10;
+ Message_StartTextbox(globalCtx, 0x1150, &this->actor);
+ this->unk_3E6 = 0x1150;
+ } else {
+ func_8019F230();
+ Message_StartTextbox(globalCtx, 0x1152, &this->actor);
+ this->unk_3E6 = 0x1152;
+ }
+ }
+}
+
+void func_80C20C24(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (!func_80147624(globalCtx)) {
+ return;
+ }
+
+ switch (this->unk_3E6) {
+ case 0x1147:
+ Message_StartTextbox(globalCtx, 0x1148, &this->actor);
+ this->unk_3E6 = 0x1148;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
+ break;
+
+ case 0x1148:
+ func_80C20A74(this, globalCtx);
+ break;
+
+ case 0x1149:
+ case 0x114A:
+ case 0x114B:
+ case 0x114C:
+ case 0x114D:
+ case 0x114E:
+ Message_StartTextbox(globalCtx, 0x114F, &this->actor);
+ this->unk_3E6 = 0x114F;
+ break;
+
+ case 0x1152:
+ Message_StartTextbox(globalCtx, 0x1151, &this->actor);
+ this->unk_3E6 = 0x1151;
+ break;
+
+ case 0x1150:
+ Message_StartTextbox(globalCtx, 0x1151, &this->actor);
+ this->unk_3E6 = 0x1151;
+ break;
+
+ case 0x1151:
+ func_801477B4(globalCtx);
+ if (this->unk_3E8 & 0x10) {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ func_80C20484(this);
+ } else {
+ func_80C2075C(this);
+ }
+ break;
+ }
+}
+
+void func_80C20D64(EnHintSkb* this, GlobalContext* globalCtx) {
+ if ((this->actionFunc == func_80C1FE20) || (this->actionFunc == func_80C2077C) ||
+ (this->actionFunc == func_80C1FE80)) {
+ if (this->actionFunc != func_80C2077C) {
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.hintId = 255;
+ this->actor.textId = 0;
+ if (this->actionFunc == func_80C1FE80) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
+ }
+ func_80C2075C(this);
+ }
+ } else if (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN) {
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.hintId = 0x55;
+ this->actor.textId = 0;
+ if (this->skelAnime.animation == &object_skb_Anim_00697C) {
+ func_80C1FE0C(this);
+ } else {
+ func_80C1FE30(this);
+ }
+ }
+ }
+}
+
+void func_80C20E90(EnHintSkb* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((this->actor.bgCheckFlags & 0x60) && (this->actor.depthInWater >= 40.0f)) {
+ this->actor.colChkInfo.health = 0;
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ func_80C20484(this);
+ return;
+ }
+
+ if (this->collider.base.acFlags & AC_HIT) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ if (this->actionFunc == func_80C20590) {
+ switch (this->actor.colChkInfo.damageEffect) {
+ case 1:
+ case 3:
+ case 4:
+ case 12:
+ case 13:
+ return;
+
+ default:
+ case 2:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ if (this->unk_3E2 >= 2) {
+ func_80C21468(this, globalCtx);
+ }
+ this->unk_3E2 = 0;
+ break;
+ }
+ }
+
+ if (!Actor_ApplyDamage(&this->actor)) {
+ if ((this->actor.colChkInfo.damageEffect != 3) && (this->actor.colChkInfo.damageEffect != 4)) {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
+ this->unk_3E8 |= 4;
+ func_80C20484(this);
+ return;
+ }
+ }
+
+ switch (this->actor.colChkInfo.damageEffect) {
+ case 11:
+ this->unk_3E9 = 30;
+ this->unk_3E2 = 40;
+ this->unk_2D4 = 1.0f;
+ this->unk_2D8 = 0.0f;
+ Actor_SetColorFilter(&this->actor, 0, 120, 0, 40);
+ func_80C2011C(this);
+ break;
+
+ case 1:
+ Actor_SetColorFilter(&this->actor, 0, 120, 0, 40);
+ func_80C2011C(this);
+ break;
+
+ case 2:
+ this->unk_3E2 = 80;
+ this->unk_3E9 = 0;
+ this->unk_2D4 = 1.0f;
+ this->unk_2D8 = 0.0f;
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ this->unk_3E8 |= 1;
+ func_80C20274(this);
+ break;
+ case 3:
+ if (this->actor.colChkInfo.health != 0) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ this->unk_3E2 = 80;
+ } else {
+ this->unk_3E2 = 3;
+ }
+ this->unk_3E9 = 11;
+ this->unk_2D4 = 1.0f;
+ this->unk_2D8 = 0.5f;
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ func_80C20540(this);
+ break;
+ case 4:
+ this->unk_3E2 = 40;
+ this->unk_3E9 = 20;
+ this->unk_2D4 = 1.0f;
+ this->unk_2D8 = 0.5f;
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ func_80C2066C(this);
+ break;
+
+ case 12:
+ case 14:
+ this->unk_3E8 |= 1;
+
+ case 15:
+ if ((player->swordAnimation == 4) || (player->swordAnimation == 11) || (player->swordAnimation == 22) ||
+ (player->swordAnimation == 23)) {
+ this->unk_3E8 |= 1;
+ }
+
+ case 13:
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ func_80C20274(this);
+ break;
+
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ case 10:
+ break;
+ }
+ }
+}
+
+void func_80C21250(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->unk_3E0 != 1) {
+ func_80C20E90(this, globalCtx);
+ if (this->actionFunc == func_80C1FF88) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+
+ if ((this->actionFunc != func_80C200B8) && (this->actionFunc != func_80C20334) &&
+ (this->actionFunc != func_80C204F0)) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+}
+
+void func_80C21320(EnHintSkb* this, GlobalContext* globalCtx) {
+ if (this->unk_3E2 > 0) {
+ this->unk_3E2--;
+ }
+
+ if (this->actionFunc != func_80C20590) {
+ if (this->unk_3E2 < 20) {
+ if (this->actionFunc == func_80C2069C) {
+ Math_SmoothStepToF(&this->unk_2D8, 0.0f, 0.5f, 0.03f, 0.0f);
+ } else {
+ Math_SmoothStepToF(&this->unk_2D8, 0.0f, 0.5f, 0.01f, 0.0f);
+ }
+ this->unk_2D4 = this->unk_3E2 * 0.05f;
+ } else {
+ Math_SmoothStepToF(&this->unk_2D8, 0.5f, 0.1f, 0.02f, 0.0f);
+ }
+ }
+}
+
+s32 func_80C21414(EnHintSkb* this) {
+ if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < 60.0f)) {
+ return true;
+ }
+ return false;
+}
+
+void func_80C21468(EnHintSkb* this, GlobalContext* globalCtx) {
+ static Color_RGBA8 D_80C21E44 = { 170, 255, 255, 255 };
+ static Color_RGBA8 D_80C21E48 = { 200, 200, 255, 255 };
+ static Vec3f D_80C21E4C = { 0.0f, -1.0f, 0.0f };
+ Vec3f sp84;
+ s32 phi_s4;
+ s16 temp_s1;
+ s32 i;
+
+ if (this->unk_3E8 & 2) {
+ phi_s4 = ARRAY_COUNT(this->unk_22C) - 1;
+ } else {
+ phi_s4 = ARRAY_COUNT(this->unk_22C);
+ }
+
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
+
+ for (i = 0; i < phi_s4; i++) {
+ temp_s1 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_22C[i]);
+
+ sp84.x = Math_SinS(temp_s1) * 3.0f;
+ sp84.z = Math_CosS(temp_s1) * 3.0f;
+ sp84.y = (Rand_ZeroOne() * 4.0f) + 4.0f;
+
+ EffectSsEnIce_Spawn(globalCtx, &this->unk_22C[i], 0.6f, &sp84, &D_80C21E4C, &D_80C21E44, &D_80C21E48, 30);
+ }
+}
+
+void func_80C215E4(GlobalContext* globalCtx, EnHintSkb* this, Vec3f* arg2) {
+ Vec3f sp5C;
+ Vec3f sp50 = { 0.0f, 8.0f, 0.0f };
+ Vec3f sp44 = { 0.0f, -1.5f, 0.0f };
+ f32 sp40 = (Rand_ZeroOne() - 0.5f) * 6.28f;
+ s32 pad;
+
+ sp5C.y = this->actor.floorHeight;
+ sp5C.x = (sin_rad(sp40) * 15.0f) + arg2->x;
+ sp5C.z = (cos_rad(sp40) * 15.0f) + arg2->z;
+
+ sp44.x = randPlusMinusPoint5Scaled(1.0f);
+ sp44.z = randPlusMinusPoint5Scaled(1.0f);
+
+ sp50.y += (Rand_ZeroOne() - 0.5f) * 4.0f;
+
+ EffectSsHahen_Spawn(globalCtx, &sp5C, &sp50, &sp44, 0, ((Rand_ZeroOne() * 5.0f) + 12.0f) * 0.8f, -1, 10, NULL);
+ func_800BBFB0(globalCtx, &sp5C, 10.0f, 1, 150, 0, 1);
+}
+
+void EnHintSkb_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnHintSkb* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if ((this->actionFunc != func_80C2016C) && (this->actionFunc != func_80C20590) &&
+ (this->actionFunc != func_80C2069C)) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 30.0f, 60.0f, 0x1D);
+ func_80C21250(this, globalCtx);
+ func_80C20D64(this, globalCtx);
+ func_80C21320(this, globalCtx);
+}
+
+s32 EnHintSkb_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnHintSkb* this = THIS;
+ f32 temp_f10;
+
+ if (limbIndex == 11) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ temp_f10 = fabsf(Math_SinS(globalCtx->state.frames * 6000) * 95.0f) + 160.0f;
+
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetEnvColor(POLY_OPA_DISP++, (s16)temp_f10, (s16)temp_f10, (s16)temp_f10, 255);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else if (limbIndex == 10) {
+ Matrix_GetStateTranslation(&this->actor.focus.pos);
+ } else if ((limbIndex == 12) && (this->unk_3DE == 1)) {
+ Matrix_InsertZRotation_s(0x71C, MTXMODE_APPLY);
+ }
+
+ if (((limbIndex == 11) || (limbIndex == 12)) && (this->unk_3E8 & 2)) {
+ *dList = NULL;
+ }
+
+ return false;
+}
+
+void EnHintSkb_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ static Vec3f D_80C21E70 = { 800.0f, 1200.0f, 0.0f };
+ EnHintSkb* this = THIS;
+
+ if (!(this->unk_3E8 & 8)) {
+ Collider_UpdateSpheres(limbIndex, &this->collider);
+
+ if ((limbIndex == 11) && (this->unk_3E8 & 1) && !(this->unk_3E8 & 2)) {
+ Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList);
+ this->unk_3E8 |= 2;
+ } else if ((this->unk_3E8 & 4) && !(this->unk_3E8 & 8) && ((limbIndex != 11) || !(this->unk_3E8 & 1)) &&
+ (limbIndex != 12)) {
+ Actor_SpawnBodyParts(&this->actor, globalCtx, 1, dList);
+ }
+
+ if (this->unk_3E2 != 0) {
+ if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) ||
+ (limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) ||
+ (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) {
+ Matrix_GetStateTranslation(&this->unk_22C[this->unk_2DC]);
+ this->unk_2DC++;
+ } else if ((limbIndex == 11) && !(this->unk_3E8 & 2)) {
+ Matrix_MultiplyVector3fByState(&D_80C21E70, &this->unk_22C[this->unk_2DC]);
+ this->unk_2DC++;
+ }
+ }
+ }
+}
+
+void EnHintSkb_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnHintSkb* this = THIS;
+
+ this->unk_2DC = 0;
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHintSkb_OverrideLimbDraw,
+ EnHintSkb_PostLimbDraw, &this->actor);
+ if (this->unk_3E2 > 0) {
+ func_800BE680(globalCtx, &this->actor, this->unk_22C, this->unk_2DC, this->unk_2D8, 0.5f, this->unk_2D4,
+ this->unk_3E9);
+ }
+
+ if (this->unk_3E8 & 4) {
+ this->unk_3E8 |= 8;
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h
index b6b98fc469..e399638b7d 100644
--- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h
+++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.h
@@ -7,11 +7,29 @@ struct EnHintSkb;
typedef void (*EnHintSkbActionFunc)(struct EnHintSkb*, GlobalContext*);
+#define ENHINTSKB_GET_FF(thisx) ((thisx)->params & 0xFF)
+
typedef struct EnHintSkb {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xE4];
+ /* 0x0144 */ ColliderJntSph collider;
+ /* 0x0164 */ ColliderJntSphElement colliderElement[2];
+ /* 0x01E4 */ SkelAnime skelAnime;
/* 0x0228 */ EnHintSkbActionFunc actionFunc;
- /* 0x022C */ char unk_22C[0x1C0];
+ /* 0x022C */ Vec3f unk_22C[14];
+ /* 0x02D4 */ f32 unk_2D4;
+ /* 0x02D8 */ f32 unk_2D8;
+ /* 0x02DC */ s32 unk_2DC;
+ /* 0x02E0 */ Vec3s jointTable[20];
+ /* 0x0358 */ Vec3s morphtable[20];
+ /* 0x03D0 */ UNK_TYPE1 unk3D0[0xC];
+ /* 0x03DC */ s16 unk_3DC;
+ /* 0x03DE */ s16 unk_3DE;
+ /* 0x03E0 */ s16 unk_3E0;
+ /* 0x03E2 */ s16 unk_3E2;
+ /* 0x03E4 */ s16 unk_3E4;
+ /* 0x03E6 */ u16 unk_3E6;
+ /* 0x03E8 */ u8 unk_3E8;
+ /* 0x03E9 */ u8 unk_3E9;
} EnHintSkb; // size = 0x3EC
extern const ActorInit En_Hint_Skb_InitVars;
diff --git a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c
index 3c7eac5ae8..78cfa14a09 100644
--- a/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c
+++ b/src/overlays/actors/ovl_En_Hit_Tag/z_en_hit_tag.c
@@ -6,7 +6,7 @@
#include "z_en_hit_tag.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnHitTag*)thisx)
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 ff418b5797..8d5816c16f 100644
--- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c
+++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c
@@ -39,7 +39,7 @@
#include "z_en_holl.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnHoll*)thisx)
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 3edd916d2c..aaea882523 100644
--- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c
+++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c
@@ -6,7 +6,7 @@
#include "z_en_honotrap.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnHonotrap*)thisx)
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 e03114ea80..ad9089df6c 100644
--- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c
+++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c
@@ -6,7 +6,7 @@
#include "z_en_horse.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnHorse*)thisx)
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 423acc7bfc..ff3465a0ae 100644
--- a/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
+++ b/src/overlays/actors/ovl_En_Horse_Game_Check/z_en_horse_game_check.c
@@ -6,7 +6,7 @@
#include "z_en_horse_game_check.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnHorseGameCheck*)thisx)
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 fca05f2776..da62a57e0a 100644
--- a/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c
+++ b/src/overlays/actors/ovl_En_Horse_Link_Child/z_en_horse_link_child.c
@@ -6,7 +6,7 @@
#include "z_en_horse_link_child.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnHorseLinkChild*)thisx)
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 abf9966ff4..70c021d0e3 100644
--- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c
+++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c
@@ -6,7 +6,7 @@
#include "z_en_hs.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnHs*)thisx)
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 7efec2c4d3..02625ff9ee 100644
--- a/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
+++ b/src/overlays/actors/ovl_En_Hs2/z_en_hs2.c
@@ -6,7 +6,7 @@
#include "z_en_hs2.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnHs2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c
index c059d2e08b..c43f065dcb 100644
--- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c
+++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c
@@ -5,8 +5,10 @@
*/
#include "z_en_ig.h"
+#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_dai/object_dai.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnIg*)thisx)
@@ -18,7 +20,44 @@ void EnIg_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BF2AF8(EnIg* this, GlobalContext* globalCtx);
void func_80BF2BD4(EnIg* this, GlobalContext* globalCtx);
-#if 0
+static s32 D_80BF3260[] = {
+ 0x0D000100, 0xB10A006C, 0x4E020F19, 0x0F2D4202, 0x0F2D0F32, 0x36004B10, 0x1050210, 0x32103725,
+ 0x02103711, 0x0F190211, 0x0F12000D, 0x02120006, 0x0001050E, 0x12000600, 0x040E110F, 0x0600020E,
+ 0x1037110F, 0x0B0E1032, 0x1037060E, 0x0F2D0F32, 0x050E0F19, 0x0F2D0A0A, 0x00615A02, 0x0F2D0F32,
+ 0x4E020F32, 0x100A4202, 0x100A101E, 0x36004B10, 0x1902101E, 0x10320D02, 0x10321037, 0x01050E10,
+ 0x32103708, 0x0E101E10, 0x320D0210, 0x1E10320D, 0x02103210, 0x3701050E, 0x10321037, 0x090E101E,
+ 0x10320E0E, 0x100A101E, 0x030E0F32, 0x100A0C0E, 0x0F2D0F32, 0x07050500,
+};
+
+static s32 D_80BF3318[] = { -1, -1, 3, 1, 3, 1, 2, 0, 3, 5, 0, 3, 1, 2, 4 };
+
+static s32 D_80BF3354[] = {
+ 0x0E28B00C,
+ 0x10000000,
+};
+
+static s32 D_80BF335C[] = {
+ 0x09000000, 0x4B10001F, 0x170E28B1, 0x0C090000, 0x180E28B2, 0x0C090000, 0x170E28B3, 0x2D000111, 0x37020C09,
+ 0x00001000, 0x5610002F, 0x170E28B1, 0x0C090000, 0x180E28B5, 0x0C090000, 0x170E28B6, 0x0C090000, 0x180E28B7,
+ 0x0C090000, 0x170E28B8, 0x2D00010C, 0x09000011, 0x56101009, 0x0000180E, 0x29560C09, 0x0000170E, 0x29570C09,
+ 0x0000180E, 0x29580C09, 0x0000170E, 0x29592D00, 0x010C0900, 0x00121000,
+};
+
+static s32 D_80BF33E0[] = {
+ 0x0E28B90C,
+ 0x10000000,
+};
+
+static s32 D_80BF33E8[] = {
+ 0x0E28B40C,
+ 0x10000000,
+};
+
+static s32 D_80BF33F0[] = {
+ 0x0E295B0C,
+ 0x10000000,
+};
+
const ActorInit En_Ig_InitVars = {
ACTOR_EN_IG,
ACTORCAT_NPC,
@@ -31,105 +70,956 @@ const ActorInit En_Ig_InitVars = {
(ActorFunc)EnIg_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BF3418 = {
- { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT1,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 28, 62, 0, { 0, 0, 0 } },
};
-// static ColliderSphereInit sSphereInit = {
-static ColliderSphereInit D_80BF3444 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_SPHERE, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderSphereInit sSphereInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_SPHERE,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 0, { { 0, 0, 0 }, 20 }, 100 },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BF3470 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-#endif
+static AnimationInfoS sAnimations[] = {
+ { &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dai_Anim_0048B4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dai_Anim_005100, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dai_Anim_005100, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dai_Anim_0010F8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dai_Anim_001E44, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dai_Anim_0014BC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dai_Anim_003CAC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_dai_Anim_0040E0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dai_Anim_0040E0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+};
-extern ColliderCylinderInit D_80BF3418;
-extern ColliderSphereInit D_80BF3444;
-extern CollisionCheckInfoInit2 D_80BF3470;
+Actor* func_80BF1150(EnIg* this, GlobalContext* globalCtx, u8 actorCat, s16 actorId) {
+ Actor* foundActor = NULL;
+ Actor* temp_v0;
-extern UNK_TYPE D_06008710;
-extern UNK_TYPE D_0600C538;
-extern UNK_TYPE D_060130D0;
+ while (true) {
+ foundActor = SubS_FindActor(globalCtx, foundActor, actorCat, actorId);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1150.s")
+ if (foundActor == NULL) {
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1200.s")
+ if ((this != (EnIg*)foundActor) && (foundActor->update != NULL)) {
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1258.s")
+ temp_v0 = foundActor->next;
+ if (temp_v0 == NULL) {
+ foundActor = NULL;
+ break;
+ }
+ foundActor = temp_v0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1284.s")
+ return foundActor;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1354.s")
+EnDoor* func_80BF1200(GlobalContext* globalCtx, s32 arg1) {
+ s32 phi_a1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF13E4.s")
+ switch (arg1) {
+ case 5:
+ case 6:
+ case 7:
+ case 9:
+ phi_a1 = 11;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF146C.s")
+ case 8:
+ phi_a1 = 15;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF14B0.s")
+ default:
+ phi_a1 = -1;
+ break;
+ }
+ return SubS_FindDoor(globalCtx, phi_a1);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF15EC.s")
+void func_80BF1258(EnIg* this) {
+ this->skelAnime.playSpeed = this->unk_3D4;
+ SkelAnime_Update(&this->skelAnime);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF16C8.s")
+s32 func_80BF1284(EnIg* this, s32 arg1) {
+ s32 phi_v1 = false;
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1744.s")
+ switch (arg1) {
+ case 0:
+ case 1:
+ if ((this->unk_3FC != 0) && (this->unk_3FC != 1)) {
+ phi_v1 = true;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF17BC.s")
+ case 2:
+ case 3:
+ if ((this->unk_3FC != 2) && (this->unk_3FC != 3)) {
+ phi_v1 = true;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1920.s")
+ default:
+ if (arg1 != this->unk_3FC) {
+ phi_v1 = true;
+ }
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF19A0.s")
+ if (phi_v1) {
+ this->unk_3FC = arg1;
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
+ this->unk_3D4 = this->skelAnime.playSpeed;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1A60.s")
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1AE0.s")
+void func_80BF1354(EnIg* this, GlobalContext* globalCtx) {
+ Collider_UpdateCylinder(&this->actor, &this->collider1);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ this->collider2.dim.worldSphere.radius = this->collider2.dim.modelSphere.radius * this->collider2.dim.scale;
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1B40.s")
+void func_80BF13E4(EnIg* this) {
+ if ((this->unk_3D0 & 0x100) && (DECR(this->unk_3F0) == 0)) {
+ this->unk_3F2++;
+ if (this->unk_3F2 >= 4) {
+ this->unk_3F0 = Rand_S16Offset(30, 30);
+ this->unk_3F2 = 0;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1C44.s")
+Actor* func_80BF146C(EnIg* this, GlobalContext* globalCtx) {
+ Actor* retActor;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1D78.s")
+ if (this->unk_298.unk0 == 3) {
+ retActor = func_80BF1150(this, globalCtx, ACTORCAT_NPC, ACTOR_EN_AN);
+ } else {
+ retActor = &GET_PLAYER(globalCtx)->actor;
+ }
+ return retActor;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1DF4.s")
+void func_80BF14B0(EnIg* this) {
+ s32 pad;
+ Vec3f sp40;
+ Vec3f sp34;
+ s32 pad2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF1FA8.s")
+ Math_Vec3f_Copy(&sp40, &this->unk_2A8->world.pos);
+ Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
+ Math_ApproachS(&this->unk_3EA, Math_Vec3f_Yaw(&sp34, &sp40) - this->actor.shape.rot.y, 4, 0x2AA8);
+ this->unk_3EA = CLAMP(this->unk_3EA, -0x1C70, 0x1C70);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF219C.s")
+ Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2368.s")
+ if (this->unk_2A8->id == ACTOR_PLAYER) {
+ sp40.y = ((Player*)this->unk_2A8)->bodyPartsPos[7].y + 3.0f;
+ } else {
+ Math_Vec3f_Copy(&sp40, &this->unk_2A8->focus.pos);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2400.s")
+ Math_ApproachS(&this->unk_3E8, Math_Vec3f_Pitch(&sp34, &sp40), 4, 0x2AA8);
+ this->unk_3E8 = CLAMP(this->unk_3E8, -0xE38, 0xE38);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2470.s")
+void func_80BF15EC(EnIg* this) {
+ if ((this->unk_3D0 & 0x20) && (this->unk_2A8 != 0)) {
+ if (DECR(this->unk_3EE) == 0) {
+ func_80BF14B0(this);
+ this->unk_3D0 &= ~0x200;
+ this->unk_3D0 |= 0x80;
+ return;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF25E8.s")
+ if (this->unk_3D0 & 0x80) {
+ this->unk_3D0 &= ~0x80;
+ this->unk_3E4 = 0;
+ this->unk_3E6 = 0;
+ this->unk_3E8 = 0;
+ this->unk_3EA = 0;
+ this->unk_3EE = 20;
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2890.s")
+ if (DECR(this->unk_3EE) == 0) {
+ this->unk_3D0 |= 0x200;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF293C.s")
+s32 func_80BF16C8(EnIg* this, s16 arg1) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2A50.s")
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(arg1);
+ } else if (ActorCutscene_GetCanPlayNext(arg1)) {
+ ActorCutscene_StartAndSetUnkLinkFields(arg1, &this->actor);
+ ret = true;
+ } else {
+ ActorCutscene_SetIntentToPlay(arg1);
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2AF8.s")
+s16 func_80BF1744(EnIg* this, s32 arg1) {
+ s16 cs = -1;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2BD4.s")
+ if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
+ cs = this->actor.child->cutscene;
+ for (i = 0; i < arg1; i++) {
+ cs = ActorCutscene_GetAdditionalCutscene(cs);
+ }
+ }
+ return cs;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/EnIg_Init.s")
+s32 func_80BF17BC(EnIg* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s16 sp2A;
+ s32 ret;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/EnIg_Destroy.s")
+ sp2A = func_80BF1744(this, 0);
+ ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/EnIg_Update.s")
+ switch (this->unk_3F6) {
+ case 0:
+ if (func_80BF16C8(this, sp2A)) {
+ case 2:
+ case 4:
+ if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)),
+ this->actor.child);
+ }
+ this->unk_3F6++;
+ ret = true;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2EDC.s")
+ case 1:
+ case 3:
+ if (!(gSaveContext.weekEventReg[75] & 0x10) && (this->unk_3F6 == 3)) {
+ ActorCutscene_Stop(sp2A);
+ this->unk_3F6 = 5;
+ } else {
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
+ }
+ this->unk_3F6++;
+ ret = true;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF2EFC.s")
+ case 5:
+ ActorCutscene_Stop(sp2A);
+ this->unk_3F6++;
+ ret = true;
+ break;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/func_80BF302C.s")
+s32* func_80BF1920(EnIg* this, GlobalContext* globalCtx) {
+ switch (this->unk_298.unk0) {
+ case 3:
+ this->unk_3F8 = func_80BF17BC;
+ return D_80BF335C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ig/EnIg_Draw.s")
+ case 4:
+ return D_80BF33F0;
+
+ case 2:
+ case 11:
+ case 14:
+ return D_80BF33E0;
+
+ case 10:
+ case 12:
+ return D_80BF3354;
+
+ case 13:
+ return D_80BF33E8;
+
+ default:
+ return NULL;
+ }
+}
+
+s32 func_80BF19A0(EnIg* this, GlobalContext* globalCtx) {
+ s32 ret = false;
+
+ if (this->unk_3D0 & 7) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ SubS_UpdateFlags(&this->unk_3D0, 0, 7);
+ this->unk_3F6 = 0;
+ this->unk_3F8 = NULL;
+ this->actor.child = this->unk_2A8;
+ this->unk_298.unk4 = func_80BF1920(this, globalCtx);
+ if ((this->unk_298.unk0 != 2) && (this->unk_298.unk0 != 3) && (this->unk_298.unk0 != 4)) {
+ this->unk_3D0 |= 0x20;
+ }
+ this->actionFunc = func_80BF2BD4;
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+void func_80BF1A60(EnIg* this, GlobalContext* globalCtx) {
+ if (this->unk_3F4 == 0) {
+ func_80BF1284(this, 4);
+ this->unk_3F4++;
+ } else if ((this->unk_3F4 == 1) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ func_80BF1284(this, 5);
+ this->unk_3F4++;
+ }
+}
+
+s32 func_80BF1AE0(EnIg* this, GlobalContext* globalCtx) {
+ switch (this->unk_298.unk0) {
+ case 3:
+ func_80BF1284(this, 0);
+ break;
+
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ func_80BF1284(this, 2);
+ break;
+ }
+ return true;
+}
+
+s32 func_80BF1B40(EnIg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ u16 temp = globalCtx->msgCtx.unk11F04;
+ s32 pad;
+
+ if (player->stateFlags1 & 0xC40) {
+ this->unk_3D0 |= 0x400;
+ if (this->unk_3D2 != temp) {
+ if ((this->unk_3FC == 2) || (this->unk_3FC == 3)) {
+ func_80BF1284(this, 0);
+ }
+
+ if ((temp == 0x28B0) || (temp == 0x28B7)) {
+ this->unk_18C = func_80BF1A60;
+ this->unk_3F4 = 0;
+ }
+ }
+ this->unk_3D2 = temp;
+ } else if (this->unk_3D0 & 0x400) {
+ this->unk_3D2 = 0;
+ this->unk_3D0 &= ~0x400;
+ if (1) {}
+ func_80BF1AE0(this, globalCtx);
+ }
+
+ if (this->unk_18C != NULL) {
+ this->unk_18C(this, globalCtx);
+ }
+
+ return false;
+}
+
+s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2, s32 arg3, s32 arg4) {
+ u8 sp4F = ENIG_GET_FF(&this->actor);
+ Vec3s* sp48;
+ Vec3f sp3C;
+ Vec3f sp30;
+ Actor* sp2C;
+ s32 pad;
+ s32 sp24 = false;
+
+ sp2C = func_80BF1150(this, globalCtx, arg3, arg4);
+ this->unk_274 = NULL;
+
+ if (D_80BF3318[arg2->unk0] >= 0) {
+ this->unk_274 = func_8013BB34(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
+ }
+
+ if ((sp2C != NULL) && (sp2C->update != NULL)) {
+ if (this->unk_274 != NULL) {
+ sp48 = Lib_SegmentedToVirtual(this->unk_274->points);
+ Math_Vec3s_ToVec3f(&sp3C, &sp48[this->unk_274->count - 2]);
+ Math_Vec3s_ToVec3f(&sp30, &sp48[this->unk_274->count - 1]);
+ this->actor.shape.shadowDraw = NULL;
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp3C, &sp30);
+ Math_Vec3f_Copy(&this->actor.world.pos, &sp30);
+ sp24 = true;
+ }
+ }
+ return sp24;
+}
+
+s32 func_80BF1D78(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 sp2C = 0;
+
+ if (func_80BF1C44(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_AN)) {
+ func_80BF1284(this, 0);
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ this->unk_3D0 |= 0x20;
+ this->unk_3D0 |= 0x100;
+ sp2C = true;
+ }
+ return sp2C;
+}
+
+s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ u16 sp56 = gSaveContext.time - 0x3FFC;
+ u8 sp55 = ENIG_GET_FF(&this->actor);
+ EnDoor* door;
+ Vec3s* sp4C;
+ Vec3f sp40;
+ Vec3f sp34;
+ s32 pad;
+ s32 ret = false;
+
+ this->unk_274 = NULL;
+ door = func_80BF1200(globalCtx, arg2->unk0);
+
+ if (D_80BF3318[arg2->unk0] >= 0) {
+ this->unk_274 = func_8013BB34(globalCtx, sp55, D_80BF3318[arg2->unk0]);
+ }
+
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
+ if (this->unk_274 != NULL) {
+ sp4C = Lib_SegmentedToVirtual(this->unk_274->points);
+ Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
+ Math_Vec3s_ToVec3f(&sp34, &sp4C[1]);
+ Math_Vec3f_Copy(&this->unk_2B0, &sp40);
+ Math_Vec3f_Copy(&this->unk_2BC, &sp34);
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
+ Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
+
+ if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, door->dyna.actor.shape.rot.y)) <= 0x4000) {
+ this->unk_2A4 = -75;
+ } else {
+ this->unk_2A4 = 75;
+ }
+
+ this->unk_3E0 = arg2->unk8 - arg2->unk4;
+ this->unk_3E2 = sp56 - arg2->unk4;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->unk_3D0 |= 0x100;
+ func_80BF1284(this, 3);
+ this->actor.gravity = 0.0f;
+ ret = true;
+ }
+ }
+ return ret;
+}
+
+s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ u16 sp2E = gSaveContext.time - 0x3FFC;
+ u16 phi_v1;
+ u8 sp2B = ENIG_GET_FF(&this->actor);
+ s32 temp_t8;
+ s32 ret = false;
+
+ this->unk_274 = NULL;
+
+ if (D_80BF3318[arg2->unk0] >= 0) {
+ this->unk_274 = func_8013BB34(globalCtx, sp2B, D_80BF3318[arg2->unk0]);
+ }
+
+ if ((this->unk_274 != NULL) && (this->unk_274->count < 3)) {
+ this->unk_274 = NULL;
+ }
+
+ if (this->unk_274 != NULL) {
+ temp_t8 = this->unk_298.unk0;
+ if ((temp_t8 < 10) && (temp_t8 != 0) && (this->unk_3EC >= 0)) {
+ phi_v1 = sp2E;
+ } else {
+ phi_v1 = arg2->unk4;
+ }
+
+ if (arg2->unk8 < phi_v1) {
+ this->unk_288 = (phi_v1 - arg2->unk8) + 0xFFFF;
+ } else {
+ this->unk_288 = arg2->unk8 - phi_v1;
+ }
+
+ this->unk_294 = sp2E - phi_v1;
+
+ phi_v1 = (this->unk_274->count - 2) & 0xFFFF;
+
+ this->unk_28C = this->unk_288 / phi_v1;
+ this->unk_290 = (this->unk_294 / this->unk_28C) + 2;
+
+ this->unk_3D0 &= ~0x8;
+ this->unk_3D0 &= ~0x10;
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ this->unk_3D0 |= 0x100;
+ func_80BF1284(this, 2);
+ this->actor.gravity = -1.0f;
+ ret = true;
+ }
+ return ret;
+}
+
+s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ u8 sp4F = ENIG_GET_FF(&this->actor);
+ Vec3f sp40;
+ Vec3f sp34;
+ Vec3s* sp30;
+ s32 pad;
+ s32 ret = false;
+
+ this->unk_274 = NULL;
+
+ if (D_80BF3318[arg2->unk0] >= 0) {
+ this->unk_274 = func_8013BB34(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
+ }
+
+ if ((this->unk_274 != 0) && (this->unk_274->count >= 2)) {
+ sp30 = Lib_SegmentedToVirtual(this->unk_274->points);
+ Math_Vec3s_ToVec3f(&sp40, &sp30[this->unk_274->count - 1]);
+ Math_Vec3s_ToVec3f(&sp34, &sp30[this->unk_274->count - 2]);
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp34, &sp40);
+ Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
+ Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
+ Math_Vec3f_Copy(&this->actor.prevPos, &sp40);
+
+ switch (arg2->unk0) {
+ case 2:
+ this->actor.home.rot.y = this->actor.world.rot.y;
+ this->actor.home.rot.y += 0x8000;
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ this->unk_3D0 |= 0x100;
+ func_80BF1284(this, 1);
+ break;
+
+ case 4:
+ this->actor.world.rot.y += 0x8000;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ this->unk_3D0 |= 0x100;
+ func_80BF1284(this, 8);
+ break;
+ }
+ ret = true;
+ }
+ return ret;
+}
+
+s32 func_80BF2368(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret = false;
+
+ this->actor.targetMode = 0;
+ this->unk_3D0 = 0;
+ this->actor.flags |= ACTOR_FLAG_1;
+
+ switch (arg2->unk0) {
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ ret = func_80BF1DF4(this, globalCtx, arg2);
+ break;
+
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ ret = func_80BF1FA8(this, globalCtx, arg2);
+ break;
+
+ case 2:
+ case 4:
+ ret = func_80BF219C(this, globalCtx, arg2);
+ break;
+
+ case 3:
+ ret = func_80BF1D78(this, globalCtx, arg2);
+ break;
+ }
+ return ret;
+}
+
+s32 func_80BF2400(EnIg* this, GlobalContext* globalCtx) {
+ Vec3f sp2C;
+ Vec3f sp20;
+
+ if ((this->unk_2A8 != NULL) && (this->unk_2A8->update != NULL)) {
+ Math_Vec3f_Copy(&sp2C, &this->unk_2A8->world.pos);
+ Math_Vec3f_Copy(&sp20, &this->actor.world.pos);
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp20, &sp2C);
+ }
+
+ return true;
+}
+
+s32 func_80BF2470(EnIg* this, GlobalContext* globalCtx) {
+ EnDoor* door = func_80BF1200(globalCtx, this->unk_298.unk0);
+ Vec3f sp38;
+ f32 temp;
+ s32 pad;
+
+ if (!func_8013AD6C(globalCtx) && (this->unk_3EC != 0)) {
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
+ if (((f32)this->unk_3E2 / this->unk_3E0) <= 0.9f) {
+ door->unk_1A7 = this->unk_2A4;
+ } else {
+ door->unk_1A7 = 0;
+ }
+ }
+ this->unk_3E2 = CLAMP(this->unk_3E2, 0, this->unk_3E0);
+ temp = Math_Vec3f_DistXZ(&this->unk_2B0, &this->unk_2BC) / this->unk_3E0;
+ sp38.x = 0.0f;
+ sp38.y = 0.0f;
+ sp38.z = this->unk_3E2 * temp;
+ Lib_Vec3f_TranslateAndRotateY(&this->unk_2B0, this->actor.world.rot.y, &sp38, &this->actor.world.pos);
+ this->unk_3E2 += this->unk_3EC;
+ if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK);
+ }
+ }
+ return false;
+}
+
+s32 func_80BF25E8(EnIg* this, GlobalContext* globalCtx) {
+ f32 sp7C[265];
+ Vec3f sp70;
+ Vec3f sp64;
+ Vec3f sp58;
+ s32 sp54 = 0;
+ s32 sp50 = 0;
+ s32 pad;
+
+ func_8013AF00(sp7C, 3, this->unk_274->count + 3);
+ if (!(this->unk_3D0 & 8)) {
+ sp58 = gZeroVec3f;
+ func_8013B6B0(this->unk_274, &this->unk_284, &this->unk_294, this->unk_28C, this->unk_288, &this->unk_290, sp7C,
+ &sp58, this->unk_3EC);
+ func_8013B878(globalCtx, this->unk_274, this->unk_290, &sp58);
+ this->actor.world.pos.y = sp58.y;
+ this->unk_3D0 |= 8;
+ } else {
+ sp58 = this->unk_278;
+ }
+
+ this->actor.world.pos.x = sp58.x;
+ this->actor.world.pos.z = sp58.z;
+
+ if (func_8013AD6C(globalCtx)) {
+ sp54 = this->unk_294;
+ sp50 = this->unk_290;
+ sp58 = this->actor.world.pos;
+ }
+
+ this->unk_278 = gZeroVec3f;
+
+ if (func_8013B6B0(this->unk_274, &this->unk_284, &this->unk_294, this->unk_28C, this->unk_288, &this->unk_290, sp7C,
+ &this->unk_278, this->unk_3EC)) {
+ this->unk_3D0 |= 0x10;
+ } else {
+ sp70 = this->actor.world.pos;
+ sp64 = this->unk_278;
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp70, &sp64);
+ }
+
+ if (func_8013AD6C(globalCtx)) {
+ this->unk_294 = sp54;
+ this->unk_290 = sp50;
+ this->unk_278 = sp58;
+ } else if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 13.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PIRATE_WALK);
+ }
+ return false;
+}
+
+s32 func_80BF2890(EnIg* this, GlobalContext* globalCtx) {
+ if ((this->unk_3D0 & 0x100) && (this->unk_3F2 == 2)) {
+ this->unk_3D0 &= ~0x100;
+ }
+
+ if (!(this->unk_3D0 & 0x100) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if (this->unk_408 != 0) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE1);
+ } else {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SNORE2);
+ }
+ this->unk_408 ^= 1;
+ }
+ return true;
+}
+
+s32 func_80BF293C(EnIg* this, GlobalContext* globalCtx) {
+ if (this->actor.world.rot.y != this->actor.home.rot.y) {
+ if ((this->actor.world.rot.y / 182) != (this->actor.home.rot.y / 182)) {
+ Math_ApproachS(&this->actor.world.rot.y, this->actor.home.rot.y, 3, 0x2AA8);
+ } else {
+ this->actor.world.rot.y = this->actor.home.rot.y;
+ func_80BF1284(this, 7);
+ }
+ } else if ((this->unk_3FC == 7) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ func_80BF1284(this, 9);
+ }
+ return true;
+}
+
+void func_80BF2A50(EnIg* this, GlobalContext* globalCtx) {
+ switch (this->unk_298.unk0) {
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ func_80BF25E8(this, globalCtx);
+ break;
+
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ func_80BF2470(this, globalCtx);
+ break;
+
+ case 2:
+ func_80BF293C(this, globalCtx);
+ break;
+
+ case 3:
+ func_80BF2400(this, globalCtx);
+ break;
+
+ case 4:
+ func_80BF2890(this, globalCtx);
+ break;
+ }
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 3, 0x2AA8);
+}
+
+void func_80BF2AF8(EnIg* this, GlobalContext* globalCtx) {
+ u32* unk_14 = &gSaveContext.unk_14;
+ struct_80133038_arg2 sp20;
+
+ this->unk_3EC = REG(15) + *unk_14;
+
+ if (!func_80133038(globalCtx, D_80BF3260, &sp20) ||
+ ((this->unk_298.unk0 != sp20.unk0) && !func_80BF2368(this, globalCtx, &sp20))) {
+ this->actor.shape.shadowDraw = NULL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ sp20.unk0 = 0;
+ } else {
+ this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+ this->unk_2A8 = func_80BF146C(this, globalCtx);
+ this->unk_298.unk0 = sp20.unk0;
+ func_80BF2A50(this, globalCtx);
+}
+
+void func_80BF2BD4(EnIg* this, GlobalContext* globalCtx) {
+ s16 yaw;
+ Vec3f sp38;
+ Vec3f sp2C;
+
+ if (func_8010BF58(&this->actor, globalCtx, this->unk_298.unk4, this->unk_3F8, &this->unk_298.unk8)) {
+ SubS_UpdateFlags(&this->unk_3D0, 3, 7);
+ this->unk_3D0 &= ~0x20;
+ this->unk_3D0 |= 0x200;
+ this->unk_3EE = 20;
+ this->unk_298.unk8 = 0;
+ this->actionFunc = func_80BF2AF8;
+ } else if (((this->unk_298.unk0 != 2) && (this->unk_298.unk0 != 4)) &&
+ ((this->unk_2A8 != NULL) && (this->unk_2A8->update != NULL))) {
+ Math_Vec3f_Copy(&sp38, &this->unk_2A8->world.pos);
+ Math_Vec3f_Copy(&sp2C, &this->actor.world.pos);
+ yaw = Math_Vec3f_Yaw(&sp2C, &sp38);
+ Math_ApproachS(&this->actor.shape.rot.y, yaw, 4, 0x2AA8);
+ }
+}
+
+void EnIg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnIg* this = THIS;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dai_Skel_0130D0, NULL, this->jointTable, this->morphTable,
+ 19);
+ this->unk_3FC = -1;
+ func_80BF1284(this, 0);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit);
+ Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->actor, &sSphereInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->unk_298.unk0 = 0;
+ this->actor.gravity = 0.0f;
+ this->actionFunc = func_80BF2AF8;
+ this->actionFunc(this, globalCtx);
+}
+
+void EnIg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnIg* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider1);
+ Collider_DestroySphere(globalCtx, &this->collider2);
+}
+
+void EnIg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnIg* this = THIS;
+
+ func_80BF19A0(this, globalCtx);
+
+ this->actionFunc(this, globalCtx);
+
+ func_80BF1B40(this, globalCtx);
+
+ if (this->unk_298.unk0 != 0) {
+ func_80BF1258(this);
+ func_80BF13E4(this);
+ func_80BF15EC(this);
+ func_8013C964(&this->actor, globalCtx, 60.0f, 30.0f, 0, this->unk_3D0 & 7);
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
+ func_80BF1354(this, globalCtx);
+ }
+}
+
+s32 EnIg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ EnIg* this = THIS;
+
+ if (limbIndex == 10) {
+ *dList = NULL;
+ }
+ return false;
+}
+
+void EnIg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ static Vec3f D_80BF351C = { 1800.0f, -2000.0f, 0.0f };
+ static Vec3f D_80BF3528 = { 0.0f, 0.0f, 0.0f };
+ s32 pad;
+ EnIg* this = THIS;
+ Vec3f sp2C;
+
+ if (limbIndex == 11) {
+ Matrix_MultiplyVector3fByState(&D_80BF3528, &this->actor.focus.pos);
+ Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
+
+ gSPDisplayList((*gfx)++, object_dai_DL_008710);
+ gSPDisplayList((*gfx)++, object_dai_DL_0087B8);
+ }
+
+ if (limbIndex == 12) {
+ gSPDisplayList((*gfx)++, object_dai_DL_0089D8);
+ }
+
+ if (limbIndex == 9) {
+ gSPDisplayList((*gfx)++, object_dai_DL_008B00);
+ Matrix_MultiplyVector3fByState(&D_80BF351C, &sp2C);
+ Math_Vec3f_ToVec3s(&this->collider2.dim.worldSphere.center, &sp2C);
+ }
+
+ if (limbIndex == 10) {
+ Matrix_CopyCurrentState(&this->unk_190);
+ }
+}
+
+void EnIg_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx, Gfx** gfx) {
+ EnIg* this = THIS;
+ s32 phi_v0;
+ s32 phi_v1;
+
+ if (!(this->unk_3D0 & 0x200)) {
+ if (this->unk_3D0 & 0x80) {
+ phi_v1 = 1;
+ } else {
+ phi_v1 = 0;
+ }
+ phi_v0 = 1;
+ } else {
+ phi_v1 = 0;
+ phi_v0 = 0;
+ }
+
+ if (limbIndex == 9) {
+ func_8013AD9C(this->unk_3E8 + 0x4000, this->unk_3EA + this->actor.shape.rot.y + 0x4000, &this->unk_2D4,
+ &this->unk_2E6, phi_v0, phi_v1);
+ Matrix_StatePop();
+ Matrix_InsertTranslation(this->unk_2D4.x, this->unk_2D4.y, this->unk_2D4.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_2E6.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_2E6.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_2E6.z, MTXMODE_APPLY);
+ Matrix_StatePush();
+ }
+}
+
+void EnIg_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static TexturePtr D_80BF3534[] = {
+ object_dai_Tex_0107B0, object_dai_Tex_010FB0, object_dai_Tex_0117B0,
+ object_dai_Tex_011FB0, object_dai_Tex_0127B0,
+ };
+ s32 pad;
+ EnIg* this = THIS;
+
+ if (this->unk_298.unk0 != 0) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF3534[this->unk_3F2]));
+
+ POLY_OPA_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnIg_OverrideLimbDraw, EnIg_PostLimbDraw,
+ EnIg_TransformLimbDraw, &this->actor, POLY_OPA_DISP);
+ Matrix_SetCurrentState(&this->unk_190);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dai_DL_00C538);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.h b/src/overlays/actors/ovl_En_Ig/z_en_ig.h
index 19050087ee..200c751b12 100644
--- a/src/overlays/actors/ovl_En_Ig/z_en_ig.h
+++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.h
@@ -6,12 +6,58 @@
struct EnIg;
typedef void (*EnIgActionFunc)(struct EnIg*, GlobalContext*);
+typedef s32 (*EnIgUnkFunc)(struct EnIg*, GlobalContext*);
+typedef void (*EnIgUnkFunc2)(struct EnIg*, GlobalContext*);
+
+#define ENIG_GET_FF(thisx) ((thisx)->params & 0xFF)
typedef struct EnIg {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnIgActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x280];
+ /* 0x018C */ EnIgUnkFunc2 unk_18C;
+ /* 0x0190 */ MtxF unk_190;
+ /* 0x01D0 */ ColliderCylinder collider1;
+ /* 0x021C */ ColliderSphere collider2;
+ /* 0x0274 */ Path* unk_274;
+ /* 0x0278 */ Vec3f unk_278;
+ /* 0x0284 */ f32 unk_284;
+ /* 0x0288 */ s32 unk_288;
+ /* 0x028C */ s32 unk_28C;
+ /* 0x0290 */ s32 unk_290;
+ /* 0x0294 */ s32 unk_294;
+ /* 0x0298 */ struct_80133038_arg2 unk_298;
+ /* 0x02A4 */ s8 unk_2A4;
+ /* 0x02A8 */ Actor* unk_2A8;
+ /* 0x02AC */ UNK_TYPE1 unk2AC[0x4];
+ /* 0x02B0 */ Vec3f unk_2B0;
+ /* 0x02BC */ Vec3f unk_2BC;
+ /* 0x02C8 */ UNK_TYPE1 unk2C8[0xC];
+ /* 0x02D4 */ Vec3f unk_2D4;
+ /* 0x02E0 */ UNK_TYPE1 unk2E0[0x6];
+ /* 0x02E6 */ Vec3s unk_2E6;
+ /* 0x02EC */ Vec3s jointTable[19];
+ /* 0x035E */ Vec3s morphTable[19];
+ /* 0x03D0 */ u16 unk_3D0;
+ /* 0x03D2 */ u16 unk_3D2;
+ /* 0x03D4 */ f32 unk_3D4;
+ /* 0x03D8 */ UNK_TYPE1 unk3D8[0x8];
+ /* 0x03E0 */ s16 unk_3E0;
+ /* 0x03E2 */ s16 unk_3E2;
+ /* 0x03E4 */ s16 unk_3E4;
+ /* 0x03E6 */ s16 unk_3E6;
+ /* 0x03E8 */ s16 unk_3E8;
+ /* 0x03EA */ s16 unk_3EA;
+ /* 0x03EC */ s16 unk_3EC;
+ /* 0x03EE */ s16 unk_3EE;
+ /* 0x03F0 */ s16 unk_3F0;
+ /* 0x03F2 */ s16 unk_3F2;
+ /* 0x03F4 */ s16 unk_3F4;
+ /* 0x03F6 */ s16 unk_3F6;
+ /* 0x03F8 */ EnIgUnkFunc unk_3F8;
+ /* 0x03FC */ s32 unk_3FC;
+ /* 0x0400 */ UNK_TYPE1 unk400[0x8];
+ /* 0x0408 */ s32 unk_408;
} EnIg; // size = 0x40C
extern const ActorInit En_Ig_InitVars;
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 59cd63487d..b782b82a33 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
@@ -6,7 +6,7 @@
#include "z_en_ik.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnIk*)thisx)
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 66300dda5f..e84a18bef8 100644
--- a/src/overlays/actors/ovl_En_In/z_en_in.c
+++ b/src/overlays/actors/ovl_En_In/z_en_in.c
@@ -5,8 +5,9 @@
*/
#include "z_en_in.h"
+#include "objects/object_in/object_in.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnIn*)thisx)
@@ -46,54 +47,6 @@ const ActorInit En_In_InitVars = {
(ActorFunc)EnIn_Draw,
};
-extern FlexSkeletonHeader D_06014EA8;
-extern AnimationHeader D_06015E38;
-extern AnimationHeader D_06016484;
-extern AnimationHeader D_06016A60;
-extern AnimationHeader D_060170DC;
-extern AnimationHeader D_060177AC;
-extern AnimationHeader D_06018240;
-extern AnimationHeader D_060187C8;
-extern AnimationHeader D_060198A8;
-extern Gfx D_06007A70[];
-extern Gfx D_06007C48[];
-extern Gfx D_0601C528[];
-extern AnimatedMaterial D_06001C30;
-extern UNK_TYPE D_06003520;
-extern UNK_TYPE D_060035E0;
-extern UNK_TYPE D_06004820;
-extern UNK_TYPE D_06004C20;
-extern UNK_TYPE D_060043E0;
-extern AnimationHeader D_06001D10;
-extern AnimationHeader D_06014F8C;
-extern AnimationHeader D_06000CB0;
-extern AnimationHeader D_060003B4;
-extern AnimationHeader D_06001BE0;
-extern AnimationHeader D_06015918;
-extern AnimationHeader D_0601C0B0;
-extern AnimationHeader D_0601A140;
-extern AnimationHeader D_0601B904;
-extern AnimationHeader D_0601B3C4;
-extern AnimationHeader D_06019EB4;
-extern Gfx D_060137A0[];
-extern Gfx D_06014420[];
-extern Gfx D_06014040[];
-extern Gfx D_06013670[];
-extern Gfx D_06014AE0[];
-extern Gfx D_06012A78[];
-extern Gfx D_06013DE0[];
-extern Gfx D_060138D0[];
-extern Gfx D_06013540[];
-extern Gfx D_06012DF8[];
-extern Gfx D_060145D8[];
-extern Gfx D_06014860[];
-extern Gfx D_06014710[];
-extern Gfx D_06013A00[];
-extern Gfx D_06013F10[];
-extern Gfx D_06014C30[];
-extern Gfx D_060149A8[];
-extern Gfx D_06013440[];
-
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_HIT0,
@@ -178,13 +131,25 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06001D10, 1.0f, 0, -1, 0, 0 }, { &D_06001D10, 1.0f, 0, -1, 0, -4 }, { &D_06014F8C, 1.0f, 0, -1, 0, 0 },
- { &D_06014F8C, 1.0f, 0, -1, 0, -4 }, { &D_06000CB0, 1.0f, 0, -1, 0, -4 }, { &D_060003B4, 1.0f, 0, -1, 0, -4 },
- { &D_06001BE0, 1.0f, 0, -1, 0, -4 }, { &D_06015918, 1.0f, 0, -1, 0, -4 }, { &D_0601C0B0, 1.0f, 0, -1, 0, 0 },
- { &D_0601C0B0, 1.0f, 0, -1, 0, -4 }, { &D_0601A140, 1.0f, 0, -1, 0, 0 }, { &D_0601A140, 1.0f, 0, -1, 0, -4 },
- { &D_0601B904, 1.0f, 0, -1, 0, 0 }, { &D_0601B904, 1.0f, 0, -1, 0, -4 }, { &D_0601B3C4, 1.0f, 0, -1, 0, 0 },
- { &D_0601B3C4, 0.0f, 0, -1, 2, 0 }, { &D_0601B3C4, 1.0f, 0, -1, 0, -4 }, { &D_06019EB4, 1.0f, 0, -1, 2, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_001D10, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_014F8C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_014F8C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_000CB0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_0003B4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_001BE0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_015918, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_01C0B0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_01C0B0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_01A140, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_01A140, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_01B904, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_01B904, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_01B3C4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_in_Anim_01B3C4, 0.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_in_Anim_01B3C4, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_in_Anim_019EB4, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
};
static u16 D_808F6C0C[] = {
@@ -199,11 +164,11 @@ s32 func_808F30B0(SkelAnime* skelAnime, s16 animIndex) {
ret = true;
frameCount = sAnimations[animIndex].frameCount;
if (frameCount < 0) {
- frameCount = Animation_GetLastFrame(sAnimations[animIndex].animationSeg);
+ frameCount = Animation_GetLastFrame(sAnimations[animIndex].animation);
}
- Animation_Change(skelAnime, sAnimations[animIndex].animationSeg, sAnimations[animIndex].playbackSpeed,
- sAnimations[animIndex].frame, frameCount, sAnimations[animIndex].mode,
- sAnimations[animIndex].transitionRate);
+ Animation_Change(skelAnime, sAnimations[animIndex].animation, sAnimations[animIndex].playSpeed,
+ sAnimations[animIndex].startFrame, frameCount, sAnimations[animIndex].mode,
+ sAnimations[animIndex].morphFrames);
}
return ret;
}
@@ -259,7 +224,7 @@ s32 func_808F3334(EnIn* this, GlobalContext* globalCtx) {
if (this->colliderJntSph.base.atFlags & AT_BOUNCED) {
return 0;
}
- Actor_PlaySfxAtPos(&player->actor, 0x83E);
+ Actor_PlaySfxAtPos(&player->actor, NA_SE_PL_BODY_HIT);
func_800B8D98(globalCtx, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 6.0f);
}
return 1;
@@ -282,7 +247,7 @@ void func_808F3414(EnIn* this, GlobalContext* globalCtx) {
if (this->unk23D == 0) {
this->unk494 = SkelAnime_Update(&this->skelAnime);
}
- if (func_8013D5E8(this->actor.shape.rot.y, 0x2710, this->actor.yawTowardsPlayer)) {
+ if (SubS_AngleDiffLessEqual(this->actor.shape.rot.y, 0x2710, this->actor.yawTowardsPlayer)) {
sp30.x = player->actor.world.pos.x;
sp30.y = player->bodyPartsPos[7].y + 3.0f;
sp30.z = player->actor.world.pos.z;
@@ -298,7 +263,7 @@ void func_808F3414(EnIn* this, GlobalContext* globalCtx) {
}
func_808F322C(this, 3);
func_808F3178(this, globalCtx);
- func_8013D9C8(globalCtx, this->unk376, this->unk39E, 20);
+ SubS_FillLimbRotTables(globalCtx, this->unk376, this->unk39E, ARRAY_COUNT(this->unk376));
}
void func_808F35AC(EnIn* this, GlobalContext* globalCtx) {
@@ -344,10 +309,11 @@ void func_808F3690(EnIn* this, GlobalContext* globalCtx) {
}
void func_808F374C(EnIn* this, GlobalContext* globalCtx) {
- AnimationHeader* animations[] = { &D_06015E38, &D_06016A60, &D_060177AC, &D_06016484,
- &D_060170DC, &D_06018240, &D_060187C8, &D_060198A8 };
+ AnimationHeader* animations[] = { &object_in_Anim_015E38, &object_in_Anim_016A60, &object_in_Anim_0177AC,
+ &object_in_Anim_016484, &object_in_Anim_0170DC, &object_in_Anim_018240,
+ &object_in_Anim_0187C8, &object_in_Anim_0198A8 };
- if (this->skelAnime.animation == &D_06016484 || this->skelAnime.animation == &D_060170DC) {
+ if (this->skelAnime.animation == &object_in_Anim_016484 || this->skelAnime.animation == &object_in_Anim_0170DC) {
if (Animation_OnFrame(&this->skelAnime, 8.0f)) {
func_8019F88C(&this->actor.projectedPos, NA_SE_VO_IN_LASH_0, 2);
if (Rand_ZeroOne() < 0.3f) {
@@ -356,7 +322,7 @@ void func_808F374C(EnIn* this, GlobalContext* globalCtx) {
Audio_PlaySfxAtPos(&this->actor.projectedPos, NA_SE_IT_LASH);
}
}
- if (this->skelAnime.animation == &D_060198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) {
+ if (this->skelAnime.animation == &object_in_Anim_0198A8 && Animation_OnFrame(&this->skelAnime, 20.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_IN_CRY_0);
}
if (SkelAnime_Update(&this->skelAnime)) {
@@ -383,7 +349,7 @@ void func_808F395C(EnIn* this, GlobalContext* globalCtx) {
this->actionFunc = func_808F5A94;
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = func_808F5A34;
this->unk48C = 1;
} else {
@@ -415,7 +381,7 @@ void func_808F39DC(EnIn* this, GlobalContext* globalCtx) {
}
SET_FLAGS_FINISH_RACE;
}
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actor.textId = textId;
this->actionFunc = func_808F395C;
if (this->unk4B0 == 2) {
@@ -427,7 +393,7 @@ void func_808F39DC(EnIn* this, GlobalContext* globalCtx) {
void func_808F3AD4(EnIn* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk48C = 1;
this->actionFunc = func_808F5A94;
} else {
@@ -440,18 +406,18 @@ void func_808F3B40(EnIn* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_808F3AD4;
textId = gSaveContext.day != 3 ? 0x3481 : 0x34A4;
this->actor.textId = textId;
} else {
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
}
}
void func_808F3BD4(EnIn* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk48C = 1;
this->actionFunc = func_808F5A94;
} else {
@@ -464,18 +430,18 @@ void func_808F3C40(EnIn* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_808F3BD4;
textId = gSaveContext.day != 3 ? 0x346A : 0x3492;
this->actor.textId = textId;
} else {
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
}
}
void func_808F3CD4(EnIn* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk48C = 1;
this->actionFunc = func_808F5A94;
} else {
@@ -491,7 +457,7 @@ void func_808F3D40(EnIn* this, GlobalContext* globalCtx) {
this->actionFunc = func_808F3CD4;
textId = gSaveContext.day != 3 ? 0x347D : 0x34A0;
this->actor.textId = textId;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
} else {
Actor_PickUp(&this->actor, globalCtx, GI_MASK_GARO, 500.0f, 100.0f);
}
@@ -775,7 +741,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
case 1:
switch (textId) {
case 0x3463:
- gSaveContext.weekEventReg[15] |= 16;
+ gSaveContext.weekEventReg[15] |= 0x10;
func_800E8EA0(globalCtx, &this->actor, 0x3464);
ret = false;
break;
@@ -791,9 +757,9 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) {
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
func_801159EC(-globalCtx->msgCtx.unk1206C);
ret = true;
} else {
@@ -937,9 +903,9 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x347E:
func_808F35D8(this, globalCtx);
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3B40;
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
ret = true;
} else {
func_800E8EA0(globalCtx, &this->actor, 0x347F);
@@ -1043,9 +1009,9 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.rupees >= globalCtx->msgCtx.unk1206C) {
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
func_801159EC(-globalCtx->msgCtx.unk1206C);
ret = true;
} else {
@@ -1141,9 +1107,9 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
break;
case 0x34A1:
func_808F35D8(this, globalCtx);
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3B40;
- Actor_PickUp(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_MILK, 500.0f, 100.0f);
ret = true;
} else {
func_800E8EA0(globalCtx, &this->actor, 0x34A2);
@@ -1249,7 +1215,7 @@ s32 func_808F5728(GlobalContext* globalCtx, EnIn* this, s32 arg2, s32* arg3) {
return 0;
}
if (*arg3 == 2) {
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
*arg3 = 1;
return 0;
}
@@ -1402,7 +1368,8 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06014EA8, NULL, this->jointTable, this->morphTable, 20);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_in_Skel_014EA8, NULL, this->jointTable, this->morphTable,
+ 20);
func_808F30B0(&this->skelAnime, 0);
Collider_InitCylinder(globalCtx, &this->colliderCylinder);
Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
@@ -1418,7 +1385,8 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
if (type == ENIN_HORSE_RIDER_YELLOW_SHIRT || type == ENIN_HORSE_RIDER_BLUE_SHIRT) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
this->unk488 = 1;
- Animation_Change(&this->skelAnime, &D_06016A60, 1.0f, 0.0f, Animation_GetLastFrame(&D_06016A60), 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_in_Anim_016A60, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_in_Anim_016A60), 2, 0.0f);
Actor_SetScale(&this->actor, 0.01f);
this->unk23C = 0;
this->unk23D = 1;
@@ -1525,7 +1493,7 @@ void func_808F6334(EnIn* this, GlobalContext* globalCtx) {
this->unk4C4 = CLAMP(this->unk4C4, 0.0f, 80.0f);
Matrix_InsertTranslation(this->unk4C4, 0.0f, 0.0f, MTXMODE_APPLY);
- if (this == (EnIn*)player->targetActor &&
+ if (&this->actor == player->targetActor &&
!(globalCtx->msgCtx.unk11F04 >= 0xFF && globalCtx->msgCtx.unk11F04 <= 0x200) && newUnk4C8 == 3 &&
this->unk4C8 == 3) {
if (!(globalCtx->state.frames & 1)) {
@@ -1537,13 +1505,30 @@ void func_808F6334(EnIn* this, GlobalContext* globalCtx) {
this->unk4C8 = newUnk4C8;
}
-s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg) {
- EnIn* this = (EnIn*)arg;
+s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnIn* this = THIS;
s32 pad;
Gfx* sp50[] = {
- NULL, NULL, D_060149A8, D_06014AE0, D_06014C30, D_060145D8, D_06014710,
- D_06014860, D_06014420, D_06012A78, D_06013DE0, D_06013F10, D_06014040, D_060137A0,
- D_060138D0, D_06013A00, D_06012DF8, D_06013670, D_06013540, D_06013440,
+ NULL,
+ NULL,
+ object_in_DL_0149A8,
+ object_in_DL_014AE0,
+ object_in_DL_014C30,
+ object_in_DL_0145D8,
+ object_in_DL_014710,
+ object_in_DL_014860,
+ object_in_DL_014420,
+ object_in_DL_012A78,
+ object_in_DL_013DE0,
+ object_in_DL_013F10,
+ object_in_DL_014040,
+ object_in_DL_0137A0,
+ object_in_DL_0138D0,
+ object_in_DL_013A00,
+ object_in_DL_012DF8,
+ object_in_DL_013670,
+ object_in_DL_013540,
+ object_in_DL_013440,
};
if (this->unk23C != 0 && limbIndex != 16) {
@@ -1552,16 +1537,18 @@ s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
}
}
if (this->unk4AC & 4 && limbIndex == 16) {
- *dList = D_0601C528;
+ *dList = object_in_DL_01C528;
}
OPEN_DISPS(globalCtx->state.gfxCtx);
if (limbIndex == 16) {
- void* sp38[] = { &D_060035E0, &D_06004820, &D_06004C20, &D_060043E0 };
+ TexturePtr sp38[] = { object_in_Tex_0035E0, object_in_Tex_004820, object_in_Tex_004C20, object_in_Tex_0043E0 };
+
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp38[this->unk482]));
- gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(&D_06003520));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(object_in_Tex_003520));
} else {
- AnimatedMat_DrawStep(globalCtx, Lib_SegmentedToVirtual(&D_06001C30), this->unk4AC & 8 ? 1 : 0);
+ AnimatedMat_DrawStep(globalCtx, Lib_SegmentedToVirtual(object_in_Matanimheader_001C30),
+ this->unk4AC & 8 ? 1 : 0);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -1598,8 +1585,8 @@ s32 EnIn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
return 0;
}
-void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnIn* this = (EnIn*)arg;
+void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnIn* this = THIS;
Vec3f sp50 = { 1600.0f, 0.0f, 0.0f };
Vec3f sp44 = { 0.0f, 0.0f, 0.0f };
@@ -1619,10 +1606,10 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
if (!(this->unk4AC & 8)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
if (limbIndex == 12) {
- gSPDisplayList(POLY_OPA_DISP++, D_06007A70);
+ gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007A70);
}
if (limbIndex == 15) {
- gSPDisplayList(POLY_OPA_DISP++, D_06007C48);
+ gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007C48);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1631,7 +1618,7 @@ void EnIn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
if (this->unk4AC & 0x20) {
OPEN_DISPS(globalCtx->state.gfxCtx);
if (limbIndex == 12) {
- gSPDisplayList(POLY_OPA_DISP++, D_06007C48);
+ gSPDisplayList(POLY_OPA_DISP++, object_in_DL_007C48);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 b3c1d2dd1c..75c70113e8 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 "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0x00000000
@@ -15,15 +16,22 @@ void EnInsect_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx);
void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_8091AC78(EnInsect* this);
void func_8091ACC4(EnInsect* this, GlobalContext* globalCtx);
+void func_8091AE10(EnInsect* this);
void func_8091AE5C(EnInsect* this, GlobalContext* globalCtx);
+void func_8091B030(EnInsect* this);
void func_8091B07C(EnInsect* this, GlobalContext* globalCtx);
void func_8091B2D8(EnInsect* this, GlobalContext* globalCtx);
+void func_8091B3D0(EnInsect* this);
void func_8091B440(EnInsect* this, GlobalContext* globalCtx);
+void func_8091B618(EnInsect* this);
void func_8091B670(EnInsect* this, GlobalContext* globalCtx);
+void func_8091B928(EnInsect* this);
void func_8091B984(EnInsect* this, GlobalContext* globalCtx);
-#if 0
+s16 D_8091BD60 = 0;
+
const ActorInit En_Insect_InitVars = {
ACTOR_EN_INSECT,
ACTORCAT_ITEMACTION,
@@ -36,74 +44,466 @@ const ActorInit En_Insect_InitVars = {
(ActorFunc)EnInsect_Draw,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_8091BD84[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 0, { { 0, 0, 0 }, 5 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_8091BDA8 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1, OC2_TYPE_1, COLSHAPE_JNTSPH, },
- 1, D_8091BD84, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_PLAYER | OC1_TYPE_1,
+ OC2_TYPE_1,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8091BDBC[] = {
+u16 D_8091BDB8[] = { 0, 5 };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 700, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 20, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 30, ICHAIN_STOP),
};
-#endif
+Vec3f D_8091BDCC = { 0.0f, 0.0f, 0.0f };
-extern ColliderJntSphElementInit D_8091BD84[1];
-extern ColliderJntSphInit D_8091BDA8;
-extern InitChainEntry D_8091BDBC[];
+void func_8091A8A0(EnInsect* this) {
+ this->unk_30C = D_8091BDB8[ENINSECT_GET_1(&this->actor)];
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091A8A0.s")
+f32 EnInsect_XZDistanceSquared(Vec3f* arg0, Vec3f* arg1) {
+ return SQ(arg0->x - arg1->x) + SQ(arg0->z - arg1->z);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091A8C4.s")
+s32 EnInsect_InBottleRange(EnInsect* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp1C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091A8F4.s")
+ if (this->actor.xzDistToPlayer < 32.0f) {
+ sp1C.x = player->actor.world.pos.x + (Math_SinS(BINANG_ROT180(this->actor.yawTowardsPlayer)) * 16.0f);
+ sp1C.y = player->actor.world.pos.y;
+ sp1C.z = player->actor.world.pos.z + (Math_CosS(BINANG_ROT180(this->actor.yawTowardsPlayer)) * 16.0f);
+ if (EnInsect_XZDistanceSquared(&sp1C, &this->actor.world.pos) <= SQ(20.0f)) {
+ return true;
+ }
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091A9E4.s")
+void func_8091A9E4(EnInsect* this) {
+ if (this->unk_316 > 0) {
+ this->unk_316--;
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/EnInsect_Init.s")
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MUSI_WALK);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/EnInsect_Destroy.s")
+ this->unk_316 = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.1f);
+ if (this->unk_316 < 2) {
+ this->unk_316 = 2;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091AC78.s")
+void EnInsect_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnInsect* this = THIS;
+ f32 rand;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091ACC4.s")
+ this->actor.world.rot.y = Rand_Next() & 0xFFFF;
+ this->actor.home.rot.y = this->actor.world.rot.y;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091AE10.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ func_8091A8A0(this);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091AE5C.s")
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_0527A0, &gameplay_keep_Anim_05140C,
+ this->jointTable, this->morphTable, 24);
+ Animation_Change(&this->skelAnime, &gameplay_keep_Anim_05140C, 1.0f, 0.0f, 0.0f, 1, 0.0f);
+ Collider_InitJntSph(globalCtx, &this->collider);
+ Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B030.s")
+ {
+ ColliderJntSphElement* colliderElement = &this->collider.elements[0];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B07C.s")
+ colliderElement->dim.worldSphere.radius = colliderElement->dim.modelSphere.radius * colliderElement->dim.scale;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B274.s")
+ this->actor.colChkInfo.mass = 30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B2D8.s")
+ if (this->unk_30C & 1) {
+ this->actor.gravity = -0.2f;
+ this->actor.terminalVelocity = -2.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B3D0.s")
+ if (this->unk_30C & 4) {
+ this->unk_314 = Rand_S16Offset(200, 40);
+ this->actor.flags |= ACTOR_FLAG_10;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B440.s")
+ rand = Rand_ZeroOne();
+ if (rand < 0.3f) {
+ func_8091AC78(this);
+ } else if (rand < 0.4f) {
+ func_8091AE10(this);
+ } else {
+ func_8091B030(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B618.s")
+void EnInsect_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ Collider_DestroyJntSph(globalCtx, &THIS->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B670.s")
+void func_8091AC78(EnInsect* this) {
+ this->unk_312 = Rand_S16Offset(5, 35);
+ this->actionFunc = func_8091ACC4;
+ this->unk_30C |= 0x100;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B928.s")
+void func_8091ACC4(EnInsect* this, GlobalContext* globalCtx) {
+ f32 temp_f2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/func_8091B984.s")
+ Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/EnInsect_Update.s")
+ temp_f2 = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f);
+ if (temp_f2 < 0.0f) {
+ this->skelAnime.playSpeed = 0.0f;
+ } else {
+ f32 clamped = CLAMP_MAX(temp_f2, 1.9f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Insect/EnInsect_Draw.s")
+ this->skelAnime.playSpeed = clamped;
+ }
+
+ SkelAnime_Update(&this->skelAnime);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ if (this->unk_312 <= 0) {
+ func_8091AE10(this);
+ }
+
+ if ((this->unk_30C & 4) && (this->unk_314 <= 0)) {
+ func_8091B3D0(this);
+ } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
+ func_8091B618(this);
+ } else if (this->actor.xzDistToPlayer < 40.0f) {
+ func_8091B030(this);
+ }
+}
+
+void func_8091AE10(EnInsect* this) {
+ this->unk_312 = Rand_S16Offset(10, 45);
+ this->actionFunc = func_8091AE5C;
+ this->unk_30C |= 0x100;
+}
+
+void func_8091AE5C(EnInsect* this, GlobalContext* globalCtx) {
+ s32 pad;
+ f32 temp_f0;
+
+ Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f);
+
+ if ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(40.0f)) ||
+ (this->unk_312 < 4)) {
+ Math_ScaledStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos),
+ 0x7D0);
+ } else if ((this->actor.child != NULL) && (&this->actor != this->actor.child)) {
+ Math_ScaledStepToS(&this->actor.world.rot.y,
+ Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.child->world.pos), 0x7D0);
+ }
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ temp_f0 = this->actor.speedXZ * 1.4f;
+ this->skelAnime.playSpeed = CLAMP(temp_f0, 0.7f, 1.9f);
+ SkelAnime_Update(&this->skelAnime);
+
+ if (this->unk_312 <= 0) {
+ func_8091AC78(this);
+ }
+
+ if ((this->unk_30C & 4) && (this->unk_314 <= 0)) {
+ func_8091B3D0(this);
+ } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
+ func_8091B618(this);
+ } else if (this->actor.xzDistToPlayer < 40.0f) {
+ func_8091B030(this);
+ }
+}
+
+void func_8091B030(EnInsect* this) {
+ this->unk_312 = Rand_S16Offset(10, 40);
+ this->actionFunc = func_8091B07C;
+ this->unk_30C |= 0x100;
+}
+
+void func_8091B07C(EnInsect* this, GlobalContext* globalCtx) {
+ s32 pad;
+ f32 speed;
+ s16 frames;
+ s16 yaw;
+ s32 sp38 = this->actor.xzDistToPlayer < 40.0f;
+
+ Math_SmoothStepToF(&this->actor.speedXZ, 1.8f, 0.1f, 0.5f, 0.0f);
+
+ if ((EnInsect_XZDistanceSquared(&this->actor.world.pos, &this->actor.home.pos) > SQ(160.0f)) ||
+ (this->unk_312 < 4)) {
+ Math_ScaledStepToS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos),
+ 0x7D0);
+ } else if (sp38) {
+ frames = globalCtx->state.frames;
+ yaw = BINANG_ROT180(this->actor.yawTowardsPlayer);
+ if ((frames & 0x10) != 0) {
+ if ((frames & 0x20) != 0) {
+ yaw += 0x2000;
+ }
+ } else if ((frames & 0x20) != 0) {
+ yaw -= 0x2000;
+ }
+
+ if (globalCtx) {}
+ Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 0x7D0);
+ }
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ speed = this->actor.speedXZ * 1.6f;
+ this->skelAnime.playSpeed = CLAMP(speed, 0.8f, 1.9f);
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((this->unk_312 <= 0) || !sp38) {
+ func_8091AC78(this);
+ } else if ((this->unk_30C & 1) && (this->actor.bgCheckFlags & 0x40)) {
+ func_8091B618(this);
+ }
+}
+
+void func_8091B274(EnInsect* this) {
+ this->unk_312 = 200;
+ Actor_SetScale(&this->actor, 0.001f);
+ this->actor.draw = NULL;
+ this->actor.speedXZ = 0.0f;
+ this->skelAnime.playSpeed = 0.3f;
+ this->actionFunc = func_8091B2D8;
+ this->unk_30C &= ~0x100;
+}
+
+void func_8091B2D8(EnInsect* this, GlobalContext* globalCtx) {
+ if ((this->unk_312 == 20) && !(this->unk_30C & 4)) {
+ this->actor.draw = EnInsect_Draw;
+ } else if (this->unk_312 == 0) {
+ if (this->unk_30C & 4) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ Actor_SetScale(&this->actor, 0.01f);
+ func_8091AC78(this);
+ } else if (this->unk_312 < 20) {
+ Actor_SetScale(&this->actor, CLAMP_MAX(this->actor.scale.x + 0.001f, 0.01f));
+ SkelAnime_Update(&this->skelAnime);
+ }
+}
+
+void func_8091B3D0(EnInsect* this) {
+ this->unk_312 = 60;
+ this->skelAnime.playSpeed = 1.9f;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALTURA_BOUND);
+ Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
+ this->actionFunc = func_8091B440;
+ this->unk_30C &= ~0x100;
+ this->unk_30C |= 8;
+}
+
+void func_8091B440(EnInsect* this, GlobalContext* globalCtx) {
+ s32 pad[2];
+ Vec3f sp34;
+
+ Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f);
+ Math_StepToS(&this->actor.shape.rot.x, 0x2AAA, 0x160);
+ Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.0002f, 0.001f));
+
+ this->actor.shape.yOffset -= 0.8f;
+ this->actor.world.pos.x = (Rand_ZeroOne() + this->actor.home.pos.x) - 0.5f;
+ this->actor.world.pos.z = (Rand_ZeroOne() + this->actor.home.pos.z) - 0.5f;
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((this->unk_312 > 20) && (Rand_ZeroOne() < 0.1f)) {
+ sp34.x = Math_SinS(this->actor.shape.rot.y) * -0.6f;
+ sp34.y = Math_SinS(this->actor.shape.rot.x) * 0.6f;
+ sp34.z = Math_CosS(this->actor.shape.rot.y) * -0.6f;
+ func_800B1210(globalCtx, &this->actor.world.pos, &sp34, &D_8091BDCC, (Rand_ZeroOne() * 5.0f) + 8.0f,
+ (Rand_ZeroOne() * 5.0f) + 8.0f);
+ }
+
+ if (this->unk_312 <= 0) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void func_8091B618(EnInsect* this) {
+ this->unk_312 = Rand_S16Offset(120, 50);
+ this->unk_310 = 0;
+ this->unk_30E = this->unk_310;
+ this->actionFunc = func_8091B670;
+ this->unk_30C &= ~0x100;
+}
+
+void func_8091B670(EnInsect* this, GlobalContext* globalCtx) {
+ s32 pad[2];
+ s16 temp;
+ Vec3f sp40;
+
+ if (this->unk_312 > 80) {
+ Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f);
+ } else {
+ Math_StepToF(&this->actor.speedXZ, 0.0f, 0.02f);
+ }
+
+ this->actor.velocity.y = 0.0f;
+ this->actor.world.pos.y += this->actor.depthInWater;
+
+ this->skelAnime.playSpeed = CLAMP(this->unk_312 * 0.018f, 0.1f, 1.9f);
+ SkelAnime_Update(&this->skelAnime);
+
+ if (this->unk_312 > 80) {
+ this->unk_30E += Rand_S16Offset(-50, 100);
+ this->unk_310 += Rand_S16Offset(-300, 600);
+ }
+
+ temp = this->skelAnime.playSpeed * 200.0f;
+ this->unk_30E = CLAMP(this->unk_30E, -temp, temp);
+ this->actor.world.rot.y += this->unk_30E;
+
+ temp = this->skelAnime.playSpeed * 1000.0f;
+ this->unk_310 = CLAMP(this->unk_310, -temp, temp);
+
+ this->actor.shape.rot.y += this->unk_310;
+ Math_ScaledStepToS(&this->actor.world.rot.x, 0, 0xBB8);
+ this->actor.shape.rot.x = this->actor.world.rot.x;
+
+ if (Rand_ZeroOne() < 0.03f) {
+ sp40.x = this->actor.world.pos.x;
+ sp40.y = this->actor.world.pos.y + this->actor.depthInWater;
+ sp40.z = this->actor.world.pos.z;
+ EffectSsGRipple_Spawn(globalCtx, &sp40, 40, 200, 4);
+ }
+
+ if ((this->unk_312 <= 0) || ((this->unk_30C & 4) && (this->unk_314 <= 0))) {
+ func_8091B928(this);
+ } else if (!(this->actor.bgCheckFlags & 0x40)) {
+ func_8091AC78(this);
+ }
+}
+
+void func_8091B928(EnInsect* this) {
+ this->unk_312 = 100;
+ this->actor.velocity.y = 0.0f;
+ this->actor.speedXZ = 0.0f;
+ this->actor.terminalVelocity = -0.8f;
+ this->actor.gravity = -0.04f;
+ this->unk_30C &= ~1;
+ this->actionFunc = func_8091B984;
+ this->unk_30C &= ~0x100;
+ this->unk_30C |= 8;
+}
+
+void func_8091B984(EnInsect* this, GlobalContext* globalCtx) {
+ this->actor.shape.rot.x -= 0x1F4;
+ this->actor.shape.rot.y += 0xC8;
+ Actor_SetScale(&this->actor, CLAMP_MIN(this->actor.scale.x - 0.00005f, 0.001f));
+
+ if ((this->actor.depthInWater > 5.0f) && (this->actor.depthInWater < 30.0f) && (Rand_ZeroOne() < 0.3f)) {
+ EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -5.0f, 5.0f, 5.0f, (Rand_ZeroOne() * 0.04f) + 0.02f);
+ }
+
+ if (this->unk_312 <= 0) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnInsect_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnInsect* this = THIS;
+ s32 phi_v0;
+
+ if ((this->actor.child != NULL) && (this->actor.child->update == NULL) && (&this->actor != this->actor.child)) {
+ this->actor.child = NULL;
+ }
+
+ if (this->unk_312 > 0) {
+ this->unk_312--;
+ }
+
+ if (this->unk_314 > 0) {
+ this->unk_314--;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->actor.update != NULL) {
+ Actor_MoveWithGravity(&this->actor);
+ if (this->unk_30C & 0x100) {
+ if (this->unk_30C & 1) {
+ if (this->actor.bgCheckFlags & 1) {
+ func_8091A9E4(this);
+ }
+ } else {
+ func_8091A9E4(this);
+ }
+ }
+
+ phi_v0 = 0;
+ if (this->unk_30C & 1) {
+ phi_v0 = 4;
+ }
+
+ if (phi_v0 != 0) {
+ phi_v0 |= 0x40;
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 8.0f, 5.0f, 0.0f, phi_v0);
+ }
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ func_8091B274(this);
+ } else if ((this->actor.xzDistToPlayer < 50.0f) && (this->actionFunc != func_8091B2D8)) {
+ if (!(this->unk_30C & 0x20) && (this->unk_314 < 180)) {
+ ColliderJntSphElement* colliderElement = &this->collider.elements[0];
+
+ colliderElement->dim.worldSphere.center.x = this->actor.world.pos.x;
+ colliderElement->dim.worldSphere.center.y = this->actor.world.pos.y;
+ colliderElement->dim.worldSphere.center.z = this->actor.world.pos.z;
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+
+ if (!(this->unk_30C & 8) && (D_8091BD60 < 4) && EnInsect_InBottleRange(this, globalCtx) &&
+ Actor_PickUp(&this->actor, globalCtx, GI_MAX, 60.0f, 30.0f)) {
+ D_8091BD60++;
+ }
+ }
+
+ Actor_SetFocus(&this->actor, 0.0f);
+ }
+}
+
+void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnInsect* this = THIS;
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL);
+ D_8091BD60 = 0;
+}
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 be1ea96dda..612c6ab205 100644
--- a/src/overlays/actors/ovl_En_Insect/z_en_insect.h
+++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.h
@@ -7,11 +7,22 @@ struct EnInsect;
typedef void (*EnInsectActionFunc)(struct EnInsect*, GlobalContext*);
+#define ENINSECT_GET_1(thisx) ((thisx)->params & 1)
+
typedef struct EnInsect {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x1C4];
+ /* 0x0144 */ ColliderJntSph collider;
+ /* 0x0164 */ ColliderJntSphElement colliderElements[1];
+ /* 0x01A4 */ SkelAnime skelAnime;
+ /* 0x01E8 */ Vec3s jointTable[24];
+ /* 0x0278 */ Vec3s morphTable[24];
/* 0x0308 */ EnInsectActionFunc actionFunc;
- /* 0x030C */ char unk_30C[0xC];
+ /* 0x030C */ u16 unk_30C;
+ /* 0x030E */ s16 unk_30E;
+ /* 0x0310 */ s16 unk_310;
+ /* 0x0312 */ s16 unk_312;
+ /* 0x0314 */ s16 unk_314;
+ /* 0x0316 */ s16 unk_316;
} EnInsect; // size = 0x318
extern const ActorInit En_Insect_InitVars;
diff --git a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
index f6b2438d48..667f66a51f 100644
--- a/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
+++ b/src/overlays/actors/ovl_En_Invadepoh/z_en_invadepoh.c
@@ -3,11 +3,16 @@
* Overlay: ovl_En_Invadepoh
* Description: Ranch nighttime actors
*/
-#include "prevent_bss_reordering.h"
#include "z_en_invadepoh.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_ma1/object_ma1.h"
+#include "objects/object_ma2/object_ma2.h"
+#include "objects/object_dog/object_dog.h"
+#include "objects/object_cow/object_cow.h"
+#include "objects/object_uch/object_uch.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnInvadepoh*)thisx)
@@ -170,56 +175,6 @@ void func_80B45A4C(EnInvadePohStruct* s, unkstructInvadepoh4** u);
void func_80B45A94(EnInvadePohStruct* s, unkstructInvadepoh4** u);
void func_80B45B1C(EnInvadePohStruct* s, unkstructInvadepoh4** u);
-extern AnimatedMaterial D_06000550;
-extern AnimatedMaterial D_06000560;
-
-extern AnimationHeader D_06000608;
-extern AnimationHeader D_060006C8;
-extern AnimationHeader D_06000998;
-extern AnimationHeader D_06001560;
-extern AnimationHeader D_06001674;
-extern AnimationHeader D_06001BD8;
-extern AnimationHeader D_06001D80;
-extern AnimationHeader D_060021C8;
-extern AnimationHeader D_06002A8C;
-extern AnimationHeader D_06004264;
-extern AnimationHeader D_06004E98;
-extern AnimationHeader D_06007328;
-extern AnimationHeader D_06009E58;
-extern AnimationHeader D_0600A174;
-extern AnimationHeader D_06014088;
-extern AnimationHeader D_06016720;
-
-extern FlexSkeletonHeader D_060080F0;
-extern FlexSkeletonHeader D_06004010;
-extern FlexSkeletonHeader D_06004C30;
-extern FlexSkeletonHeader D_06004E50;
-extern FlexSkeletonHeader D_06013928;
-extern FlexSkeletonHeader D_06015C28;
-
-extern Gfx D_0600FFC8[];
-extern Gfx D_060107C8[];
-extern Gfx D_06010FC8[];
-extern Gfx D_060117C8[];
-extern Gfx D_06011FC8[];
-extern Gfx D_060127C8[];
-extern Gfx D_06012BC8[];
-extern Gfx D_06012FC8[];
-extern Gfx D_060133C8[];
-extern Gfx D_06011AD8[];
-extern Gfx D_060122D8[];
-extern Gfx D_06012AD8[];
-extern Gfx D_060132D8[];
-extern Gfx D_06013AD8[];
-extern Gfx D_060142D8[];
-extern Gfx D_06014AD8[];
-extern Gfx D_06014ED8[];
-extern Gfx D_060152D8[];
-extern Gfx D_060156D8[];
-extern Gfx D_060003B0[];
-extern Gfx D_06000720[];
-extern Gfx D_06000080[];
-
extern s32 D_801BDA9C;
const ActorInit En_Invadepoh_InitVars = {
@@ -298,28 +253,29 @@ static Vec3f D_80B4E934 = { 216.0f, -20.0f, 1395.0f };
static s32 D_80B4E940 = 0;
-static Gfx* D_80B4E944[] = {
- D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8,
+static TexturePtr D_80B4E944[] = {
+ object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8,
};
-static Gfx* D_80B4E958[] = {
- D_060127C8,
- D_06012BC8,
- D_06012FC8,
- D_060133C8,
+static TexturePtr D_80B4E958[] = {
+ object_ma1_Tex_0127C8,
+ object_ma1_Tex_012BC8,
+ object_ma1_Tex_012FC8,
+ object_ma1_Tex_0133C8,
};
static s8 D_80B4E968 = 0;
-static Gfx* D_80B4E96C[] = {
- D_06011AD8, D_060122D8, D_06012AD8, D_060132D8, D_06013AD8, D_060142D8,
+static TexturePtr D_80B4E96C[] = {
+ object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8,
+ object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8,
};
-static Gfx* D_80B4E984[] = {
- D_06014AD8,
- D_06014ED8,
- D_060152D8,
- D_060156D8,
+static TexturePtr D_80B4E984[] = {
+ object_ma2_Tex_014AD8,
+ object_ma2_Tex_014ED8,
+ object_ma2_Tex_0152D8,
+ object_ma2_Tex_0156D8,
};
static s8 D_80B4E994 = 0;
@@ -672,10 +628,9 @@ void func_80B439B0(s32 arg0, s32 arg1) {
}
if (!(arg0 & 1)) {
- gSaveContext.roomInf[124][arg0 >> 1] = (gSaveContext.roomInf[124][arg0 >> 1] & 0xFFFF0000) | (arg1 & 0xFFFF);
+ gSaveContext.unk_E88[arg0 >> 1] = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF0000) | (arg1 & 0xFFFF);
} else {
- gSaveContext.roomInf[124][arg0 >> 1] =
- (gSaveContext.roomInf[124][arg0 >> 1] & 0xFFFF) | ((arg1 & 0xFFFF) << 0x10);
+ gSaveContext.unk_E88[arg0 >> 1] = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF) | ((arg1 & 0xFFFF) << 0x10);
}
}
@@ -683,19 +638,19 @@ s32 func_80B43A24(s32 arg0) {
u32 phi_v1;
if ((arg0 & 1) == 0) {
- phi_v1 = gSaveContext.roomInf[124][arg0 >> 1] & 0xFFFF;
+ phi_v1 = gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF;
} else {
- phi_v1 = (gSaveContext.roomInf[124][arg0 >> 1] & 0xFFFF0000) >> 0x10;
+ phi_v1 = (gSaveContext.unk_E88[arg0 >> 1] & 0xFFFF0000) >> 0x10;
}
return phi_v1 + 0x1AAA;
}
void func_80B43A74(s32 arg0) {
- gSaveContext.roomInf[124][4] = (gSaveContext.roomInf[124][4] & ~0xFF) | (arg0 & 0xFF);
+ gSaveContext.unk_E88[4] = (gSaveContext.unk_E88[4] & ~0xFF) | (arg0 & 0xFF);
}
s32 func_80B43A9C(void) {
- return (gSaveContext.roomInf[124][4] >> 0) & 0xFF;
+ return (gSaveContext.unk_E88[4] >> 0) & 0xFF;
}
s32 func_80B43AB0(void) {
@@ -1237,7 +1192,7 @@ void func_80B44EFC(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B44F58(void) {
s32 i;
- Gfx** iter;
+ TexturePtr* iter;
if (!D_80B4E968) {
D_80B4E968 = true;
@@ -1253,7 +1208,7 @@ void func_80B44F58(void) {
void func_80B44FEC(void) {
s32 i;
- Gfx** iter;
+ TexturePtr* iter;
if (!D_80B4E994) {
D_80B4E994 = true;
@@ -1268,8 +1223,8 @@ void func_80B44FEC(void) {
}
void func_80B45080(void) {
- D_80B50400 = Lib_SegmentedToVirtual(&D_06000560);
- D_80B503FC = Lib_SegmentedToVirtual(&D_06000550);
+ D_80B50400 = Lib_SegmentedToVirtual(object_uch_Matanimheader_000560);
+ D_80B503FC = Lib_SegmentedToVirtual(object_uch_Matanimheader_000550);
}
s32 func_80B450C0(f32* x1, f32* z1, f32 x2, f32 z2, f32 speed) {
@@ -1395,7 +1350,7 @@ s32 func_80B45550(EnInvadepoh* this, GlobalContext* globalCtx, f32 range, s32 ar
void EnInvadepoh_SetTextID(EnInvadepoh* this, GlobalContext* globalCtx, u16 arg2) {
this->textId = arg2;
- func_801518B0(globalCtx, arg2, &this->actor);
+ Message_StartTextbox(globalCtx, arg2, &this->actor);
}
void func_80B45648(EnInvadepoh* this) {
@@ -1674,7 +1629,7 @@ void func_80B4627C(EnInvadepoh* this, GlobalContext* globalCtx) {
s32 invadepohType;
s32 i;
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_20;
invadepohType = (this->actor.params >> 8) & 0x7F;
for (i = 1; i < 8; i++) {
@@ -1722,14 +1677,14 @@ void EnInvadepoh_InitAlien(EnInvadepoh* this, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
ActorShape_Init(&this->actor.shape, 6800.0f, ActorShadow_DrawWhiteCircle, 150.0f);
this->actor.shape.shadowAlpha = 140;
- this->actor.flags = 0x80001010;
+ this->actor.flags = (ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000);
if (INVADEPOH_TYPE(this) == TYPE_ALIEN1) {
this->actor.update = func_80B4D670;
this->actor.world.pos.y = this->actor.home.pos.y + 150.0f;
} else {
this->actor.update = func_80B47BAC;
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitAlien);
- this->actor.colChkInfo.mass = 0x28;
+ this->actor.colChkInfo.mass = 40;
}
this->bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_UCH);
if (this->bankIndex < 0) {
@@ -1776,7 +1731,7 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, GlobalContext* globalCtx) {
this->actor.update = func_80B48620;
} else if (temp == 5) {
this->actor.update = func_80B48FB0;
- this->actor.flags = 0x19;
+ this->actor.flags = (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10);
} else if (temp == 7) {
this->actor.update = func_80B49F88;
} else if (temp == 8) {
@@ -1792,7 +1747,7 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
}
if (temp == 5) {
- if (gSaveContext.weekEventReg[22] & 0x1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
Actor_MarkForDeath(&this->actor);
return;
}
@@ -1808,7 +1763,7 @@ void EnInvadepoh_InitRomani(EnInvadepoh* this, GlobalContext* globalCtx) {
return;
}
} else if (temp == 0xC) {
- if (!(gSaveContext.weekEventReg[22] & 0x1)) {
+ if (!(gSaveContext.weekEventReg[22] & 1)) {
Actor_MarkForDeath(&this->actor);
}
D_80B503F4 = this;
@@ -1841,7 +1796,7 @@ void EnInvadepoh_InitDog(EnInvadepoh* this, GlobalContext* globalCtx) {
this->actor.update = func_80B4B8BC;
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInitDog);
- this->actor.colChkInfo.mass = 0x50;
+ this->actor.colChkInfo.mass = 80;
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f);
this->bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_DOG);
if (this->bankIndex < 0) {
@@ -1863,7 +1818,7 @@ void EnInvadepoh_InitCremia(EnInvadepoh* this, GlobalContext* globalCtx) {
if (this->bankIndex < 0) {
Actor_MarkForDeath(&this->actor);
}
- if (!(gSaveContext.weekEventReg[0x16] & 1)) {
+ if (!(gSaveContext.weekEventReg[22] & 1)) {
Actor_MarkForDeath(&this->actor);
}
D_80B503F8 = this;
@@ -2109,10 +2064,10 @@ void EnInvadepoh_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80B47380(EnInvadepoh* this) {
- this->collider.base.atFlags &= ~1;
- this->collider.base.acFlags &= ~1;
- this->collider.base.ocFlags1 &= ~1;
- this->actor.flags &= ~0x80000000;
+ this->collider.base.atFlags &= ~AT_ON;
+ this->collider.base.acFlags &= ~AC_ON;
+ this->collider.base.ocFlags1 &= ~OC1_ON;
+ this->actor.flags &= ~ACTOR_FLAG_80000000;
this->alienAlpha = 0;
this->actor.draw = NULL;
this->drawAlien = false;
@@ -2134,10 +2089,10 @@ void func_80B473E4(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B47478(EnInvadepoh* this) {
- this->collider.base.atFlags &= ~1;
- this->collider.base.acFlags &= ~1;
- this->collider.base.ocFlags1 &= ~1;
- this->actor.flags &= ~0x80000000;
+ this->collider.base.atFlags &= ~AT_ON;
+ this->collider.base.acFlags &= ~AC_ON;
+ this->collider.base.ocFlags1 &= ~OC1_ON;
+ this->actor.flags &= ~ACTOR_FLAG_80000000;
this->alienAlpha = 0;
this->actor.draw = NULL;
this->drawAlien = false;
@@ -2159,16 +2114,16 @@ void func_80B474DC(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B47568(EnInvadepoh* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06001D80, -6.0f);
- this->collider.base.atFlags &= ~0x1;
- this->collider.base.acFlags &= ~0x1;
- this->collider.base.ocFlags1 &= ~0x1;
+ Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f);
+ this->collider.base.atFlags &= ~AT_ON;
+ this->collider.base.acFlags &= ~AC_ON;
+ this->collider.base.ocFlags1 &= ~OC1_ON;
this->alienAlpha = 0;
this->actor.draw = func_80B4DB14;
this->drawAlien = true;
this->drawAlienDeathEffect = false;
this->alienBeamAlpha = 0;
- this->actor.flags |= 0x80000000;
+ this->actor.flags |= ACTOR_FLAG_80000000;
this->actionFunc = func_80B47600;
}
@@ -2186,9 +2141,9 @@ void func_80B47600(EnInvadepoh* this, GlobalContext* globalCtx) {
this->alienAlpha += 6;
}
if (this->alienAlpha > 128) {
- this->collider.base.atFlags |= 1;
- this->collider.base.acFlags |= 1;
- this->collider.base.ocFlags1 |= 1;
+ this->collider.base.atFlags |= AT_ON;
+ this->collider.base.acFlags |= AC_ON;
+ this->collider.base.ocFlags1 |= OC1_ON;
}
if (this->alienAlpha == 255) {
if (this->alienBeamAlpha >= 245) {
@@ -2201,18 +2156,18 @@ void func_80B47600(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4770C(EnInvadepoh* this) {
- if (this->skelAnime.animation != &D_06001D80) {
- Animation_MorphToLoop(&this->skelAnime, &D_06001D80, -6.0f);
+ if (this->skelAnime.animation != &object_uch_Anim_001D80) {
+ Animation_MorphToLoop(&this->skelAnime, &object_uch_Anim_001D80, -6.0f);
}
- this->collider.base.atFlags |= 1;
- this->collider.base.acFlags |= 1;
- this->collider.base.ocFlags1 |= 1;
+ this->collider.base.atFlags |= AT_ON;
+ this->collider.base.acFlags |= AC_ON;
+ this->collider.base.ocFlags1 |= OC1_ON;
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
this->drawAlien = true;
this->drawAlienDeathEffect = false;
this->alienBeamAlpha = 255;
- this->actor.flags |= 0x80000000;
+ this->actor.flags |= ACTOR_FLAG_80000000;
this->actionFunc = func_80B477B4;
}
@@ -2227,10 +2182,10 @@ void func_80B477B4(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B47830(EnInvadepoh* this) {
- this->collider.base.atFlags &= ~1;
- this->collider.base.acFlags &= ~1;
- this->collider.base.ocFlags1 |= 1;
- Animation_PlayLoop(&this->skelAnime, &D_060006C8);
+ this->collider.base.atFlags &= ~AT_ON;
+ this->collider.base.acFlags &= ~AC_ON;
+ this->collider.base.ocFlags1 |= OC1_ON;
+ Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_0006C8);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 16);
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
@@ -2239,7 +2194,7 @@ void func_80B47830(EnInvadepoh* this) {
this->alienBeamAlpha = 0;
this->actionTimer = 8;
this->counter = 0;
- this->actor.flags |= 0x80000000;
+ this->actor.flags |= ACTOR_FLAG_80000000;
this->actionFunc = func_80B478F4;
}
@@ -2252,18 +2207,18 @@ void func_80B478F4(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B47938(EnInvadepoh* this) {
- this->collider.base.atFlags &= ~1;
- this->collider.base.acFlags &= ~1;
- this->collider.base.ocFlags1 &= ~1;
- Animation_PlayLoop(&this->skelAnime, &D_06000608);
- this->actor.flags &= ~1;
+ this->collider.base.atFlags &= ~AT_ON;
+ this->collider.base.acFlags &= ~AC_ON;
+ this->collider.base.ocFlags1 &= ~OC1_ON;
+ Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_000608);
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionTimer = 10;
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
this->drawAlien = true;
this->drawAlienDeathEffect = false;
this->alienBeamAlpha = 255;
- this->actor.flags |= 0x80000000;
+ this->actor.flags |= ACTOR_FLAG_80000000;
this->actionFunc = func_80B479E8;
}
@@ -2326,8 +2281,8 @@ void func_80B47BAC(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B45080();
this->actor.update = func_80B47D30;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001D80, this->jointTable, this->morphTable,
- 14);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001D80,
+ this->jointTable, this->morphTable, 14);
this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.125f;
func_80B444BC(this, globalCtx);
func_80B442E4(this);
@@ -2362,7 +2317,7 @@ void func_80B47D30(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
return;
}
- } else if (this->collider.base.acFlags & 2) {
+ } else if (this->collider.base.acFlags & AC_HIT) {
Actor* acAttached = this->collider.base.ac;
thisx->speedXZ = acAttached->speedXZ * 0.5f;
@@ -2409,8 +2364,9 @@ void func_80B47FA8(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, thisx);
this->actor.update = func_80B48060;
this->actor.draw = func_80B4E158;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004010, NULL, this->jointTable, this->morphTable, 6);
- Animation_PlayLoop(&this->skelAnime, &D_06004264);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowSkel, NULL, this->jointTable, this->morphTable,
+ COW_LIMB_MAX);
+ Animation_PlayLoop(&this->skelAnime, &gCowMooAnim);
}
}
@@ -2452,8 +2408,9 @@ void func_80B481C4(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->actor);
this->actor.update = func_80B4827C;
this->actor.draw = func_80B4E1B0;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004C30, NULL, this->jointTable, this->morphTable, 6);
- Animation_PlayLoop(&this->skelAnime, &D_06004E98);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gCowTailSkel, NULL, this->jointTable, this->morphTable,
+ COW_TAIL_LIMB_MAX);
+ Animation_PlayLoop(&this->skelAnime, &gCowTailSwishAnim);
}
}
@@ -2470,7 +2427,7 @@ void func_80B4827C(Actor* thisx, GlobalContext* globalCtx) {
void func_80B482D4(EnInvadepoh* this) {
this->actionTimer = 40;
- Animation_MorphToLoop(&this->skelAnime, &D_06002A8C, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f);
this->actor.draw = NULL;
this->actionFunc = func_80B48324;
}
@@ -2486,7 +2443,7 @@ void func_80B48324(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B48374(EnInvadepoh* this) {
this->actionTimer = 60;
- Animation_MorphToLoop(&this->skelAnime, &D_06002A8C, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f);
this->actor.draw = func_80B4E324;
this->actionFunc = func_80B483CC;
}
@@ -2518,7 +2475,7 @@ void func_80B4843C(EnInvadepoh* this) {
this->behaviorInfo.unk44 = 0.1f;
this->behaviorInfo.unk48 = 2000;
this->actionTimer = 50;
- Animation_Change(&this->skelAnime, &D_06007328, 2.0f, 0.0f, 0.0f, 0, -5.0f);
+ Animation_Change(&this->skelAnime, &object_ma1_Anim_007328, 2.0f, 0.0f, 0.0f, 0, -5.0f);
this->actor.draw = func_80B4E324;
this->actionFunc = func_80B484EC;
}
@@ -2548,7 +2505,7 @@ void func_80B48588(EnInvadepoh* this) {
this->behaviorInfo.unk42 = 0;
this->behaviorInfo.unk44 = 0.28f;
this->behaviorInfo.unk48 = 7000;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->actor.draw = func_80B4E324;
this->actionFunc = func_80B48610;
}
@@ -2565,10 +2522,10 @@ void func_80B48620(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
this->actor.update = func_80B4873C;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06009E58, this->jointTable, this->morphTable,
- 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_009E58,
+ this->jointTable, this->morphTable, 23);
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 5000, 0.05f, 0.3f, 0.12f);
- Animation_PlayLoop(&this->skelAnime, &D_06009E58);
+ Animation_PlayLoop(&this->skelAnime, &object_ma1_Anim_009E58);
func_80B482D4(this);
}
}
@@ -2601,7 +2558,7 @@ void func_80B487B4(EnInvadepoh* this) {
substruct->unk26.z = 0;
substruct->unk30 = 0.1f;
substruct->unk2C = 800;
- Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f);
this->actionFunc = func_80B48848;
}
@@ -2617,7 +2574,7 @@ void func_80B48848(EnInvadepoh* this, GlobalContext* globalCtx) {
Math_StepToS(&this->behaviorInfo.unk4C, 0x7D0, 0x46);
}
func_80B43E6C(this, 6, this->behaviorInfo.unk4C, 0x46);
- if (((this->actor.flags & 0x40) == 0x40) &&
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -2661,7 +2618,7 @@ void func_80B48948(EnInvadepoh* this) {
substruct->unk2C = 1000;
}
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->actionFunc = func_80B48AD4;
}
@@ -2732,7 +2689,7 @@ void func_80B48DE4(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
this->actor.speedXZ = 0.0f;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->behaviorInfo.unk4C = 0;
substruct->unk30 = 0.05f;
substruct->unk2C = 1200;
@@ -2769,8 +2726,8 @@ void func_80B48FB0(Actor* thisx, GlobalContext* globalCtx) {
this->actor.update = func_80B490F0;
this->actor.draw = func_80B4E324;
this->actor.textId = 0x3330;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06009E58, this->jointTable, this->morphTable,
- 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_009E58,
+ this->jointTable, this->morphTable, 23);
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 6, D_80B4EB00, 2, &gZeroVec3s, 100, 0.03, 0.3, 0.03);
func_80B444F4(this, globalCtx);
EnInvadepoh_SetPathPointToWorldPos(this, 0);
@@ -2783,7 +2740,7 @@ void func_80B48FB0(Actor* thisx, GlobalContext* globalCtx) {
void func_80B490F0(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnInvadepoh* this = THIS;
- s32 sp2C = (this->actor.flags & 0x40) == 0x40;
+ s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
if (isTalking) {
@@ -3039,7 +2996,7 @@ void func_80B49B1C(Actor* thisx, GlobalContext* globalCtx) {
void func_80B49BD0(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
@@ -3064,13 +3021,13 @@ void func_80B49C38(EnInvadepoh* this, GlobalContext* globalCtx) {
this->unk378 = func_80B45550(this, globalCtx, SQ(80.0f), temp_v0_2);
}
}
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
} else {
this->unk378 = 0;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
- if (((this->actor.flags & 0x40) == 0x40) &&
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -3083,7 +3040,7 @@ void func_80B49DA0(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 2000;
this->behaviorInfo.unk4C = 0;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->actionFunc = func_80B49DFC;
}
@@ -3121,8 +3078,8 @@ void func_80B49F88(Actor* thisx, GlobalContext* globalCtx) {
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable,
- 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088,
+ this->jointTable, this->morphTable, 23);
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03, 0.3, 0.03);
func_80B44540(this, globalCtx);
func_80B44570(this);
@@ -3166,7 +3123,7 @@ void func_80B4A168(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4A1B8(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnInvadepoh* this = THIS;
- s32 sp2C = (this->actor.flags & 0x40) == 0x40;
+ s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
if (isTalking) {
@@ -3188,7 +3145,7 @@ void func_80B4A1B8(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4A2C0(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
@@ -3196,7 +3153,7 @@ void func_80B4A2C0(EnInvadepoh* this) {
substruct->unk2C = 1500;
this->actionTimer = Rand_S16Offset(200, 200);
this->unk304 = this->actor.shape.rot.y;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actionFunc = func_80B4A350;
}
@@ -3247,13 +3204,13 @@ void func_80B4A350(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4A570(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06002A8C, -10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_ma1_Anim_002A8C, -10.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
substruct->unk30 = 0.1f;
substruct->unk2C = 800;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actionFunc = func_80B4A5E4;
}
@@ -3266,7 +3223,7 @@ void func_80B4A5E4(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4A614(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToLoop(&this->skelAnime, &D_06014088, 0.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, 0.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
@@ -3291,12 +3248,12 @@ void func_80B4A67C(EnInvadepoh* this, GlobalContext* globalCtx) {
if (this->unk378 == 0) {
this->unk378 = func_80B45550(this, globalCtx, SQ(80.0f), -0xF);
}
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
} else {
this->unk378 = 0;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
- if (((this->actor.flags & 0x40) == 0x40) &&
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -3309,7 +3266,7 @@ void func_80B4A7C0(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 2000;
this->behaviorInfo.unk4C = 0;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, 0.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, 0.0f);
this->actionFunc = func_80B4A81C;
}
@@ -3352,8 +3309,8 @@ void func_80B4A9C8(Actor* thisx, GlobalContext* globalCtx) {
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable,
- 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088,
+ this->jointTable, this->morphTable, 23);
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 1, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f);
func_80B44620(this, globalCtx);
if ((sp38 < CLOCK_TIME(2, 15)) || (sp38 >= CLOCK_TIME(6, 0))) {
@@ -3395,7 +3352,7 @@ void func_80B4AB8C(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4ABDC(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnInvadepoh* this = THIS;
- s32 sp2C = (this->actor.flags & 0x40) == 0x40;
+ s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
if (isTalking) {
@@ -3421,13 +3378,13 @@ void func_80B4ACDC(EnInvadepoh* this) {
void func_80B4ACF0(EnInvadepoh* this, GlobalContext* globalCtx) {
if (gSaveContext.weekEventReg[22] & 1) {
this->actor.draw = func_80B4E324;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80B4AD3C(this);
}
}
void func_80B4AD3C(EnInvadepoh* this) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actionFunc = func_80B4AD60;
}
@@ -3503,13 +3460,13 @@ void func_80B4AF94(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4B024(EnInvadepoh* this) {
- this->actor.flags &= ~9;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actionFunc = func_80B4B048;
}
void func_80B4B048(EnInvadepoh* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.unk120B1 == 0) {
- if (globalCtx->msgCtx.unk11F22 == 0) {
+ if (globalCtx->msgCtx.msgMode == 0) {
D_80B4E998 = 1;
} else if ((Message_GetState(&globalCtx->msgCtx) == 6) || (Message_GetState(&globalCtx->msgCtx) == 5)) {
D_80B4E998 = 1;
@@ -3527,9 +3484,9 @@ void func_80B4B0C4(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
this->actor.update = func_80B4B218;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable,
- 23);
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088,
+ this->jointTable, this->morphTable, 23);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, 0.0f);
substruct = &this->behaviorInfo;
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 2000, 0.08f, 0.3f, 0.03f);
substruct->unk30 = 0.08f;
@@ -3544,7 +3501,7 @@ void func_80B4B218(Actor* thisx, GlobalContext* globalCtx) {
s16 diff;
EnInvadepoh* this = THIS;
s16 temp_v1;
- s32 sp38 = (this->actor.flags & 0x40) == 0x40;
+ s32 sp38 = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
Player* player;
AlienBehaviorInfo* substruct = &this->behaviorInfo;
@@ -3576,7 +3533,7 @@ void func_80B4B3DC(EnInvadepoh* this) {
}
void func_80B4B430(EnInvadepoh* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060021C8, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dog_Anim_0021C8, -6.0f);
this->actionTimer = Rand_S16Offset(50, 80);
this->actionFunc = func_80B4B484;
}
@@ -3599,7 +3556,7 @@ void func_80B4B484(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4B510(EnInvadepoh* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06001BD8, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_dog_Anim_001BD8, -6.0f);
this->actionTimer = Rand_S16Offset(50, 200);
this->actionFunc = func_80B4B564;
}
@@ -3643,7 +3600,7 @@ void func_80B4B564(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4B724(EnInvadepoh* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000998, -6.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dog_Anim_000998, -6.0f);
this->actionFunc = func_80B4B768;
}
@@ -3663,7 +3620,7 @@ void func_80B4B768(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4B820(EnInvadepoh* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001560, -6.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_dog_Anim_001560, -6.0f);
this->actionFunc = func_80B4B864;
}
@@ -3682,8 +3639,8 @@ void func_80B4B8BC(Actor* thisx, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060080F0, &D_060021C8, this->jointTable, this->morphTable,
- 13);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dog_Skel_0080F0, &object_dog_Anim_0021C8,
+ this->jointTable, this->morphTable, 13);
func_80B45C04(&this->behaviorInfo, 0, 0, 0, 0, &gZeroVec3s, 3000, 0.1f, 0.0f, 0.0f);
func_80B44664(this, globalCtx);
EnInvadepoh_SetPathPointToWorldPos(this, 0);
@@ -3693,7 +3650,7 @@ void func_80B4B8BC(Actor* thisx, GlobalContext* globalCtx) {
if (D_80B4E940 == 2) {
this->actor.update = func_80B4BA84;
this->actor.draw = func_80B4E660;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
func_80B4B430(this);
} else if (D_80B4E940 == 1) {
this->actor.update = func_80B4BA30;
@@ -3710,7 +3667,7 @@ void func_80B4BA30(Actor* thisx, GlobalContext* globalCtx) {
if (D_80B4E940 == 2) {
this->actor.update = func_80B4BA84;
this->actor.draw = func_80B4E660;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
func_80B4B430(this);
}
}
@@ -3718,7 +3675,7 @@ void func_80B4BA30(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4BA84(Actor* thisx, GlobalContext* globalCtx) {
EnInvadepoh* this = THIS;
s32 temp_v0_3;
- s32 sp34 = (this->actor.flags & 0x40) == 0x40;
+ s32 sp34 = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 temp_v1_2;
s32 sp2C;
s32 temp_v0_2;
@@ -3763,7 +3720,7 @@ void func_80B4BA84(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4BBE0(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToLoop(&this->skelAnime, &D_06016720, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_016720, -6.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
@@ -3789,16 +3746,16 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) {
if (temp_v0 == 0) {
this->xzPosAdjFactor = 40.0f;
this->unk304 = -0x8000;
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
} else if (temp_v0 < (temp_t6->endPoint - 1)) {
this->xzPosAdjFactor = 40.0f;
Math_ScaledStepToS(&this->unk304, -0x4800, 0xC8);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
} else {
Math_StepToF(&this->xzPosAdjFactor, 5.0f, 3.0f);
Math_ScaledStepToS(&this->unk304, -0x8000, 0x12C);
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
temp_a0 = this->unk304 + temp_t6->actor.world.rot.y;
this->actor.world.pos.x = (Math_SinS(temp_a0) * this->xzPosAdjFactor) + temp_t6->actor.world.pos.x;
@@ -3830,7 +3787,7 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) {
}
}
- if (((this->actor.flags & 0x40) == 0x40) &&
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -3844,7 +3801,7 @@ void func_80B4BC4C(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4BFFC(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 2000;
- Animation_MorphToLoop(&this->skelAnime, &D_0600A174, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f);
this->behaviorInfo.unk4C = 0;
this->actionFunc = func_80B4C058;
}
@@ -3876,7 +3833,7 @@ void func_80B4C058(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4C1BC(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 2000;
- Animation_MorphToLoop(&this->skelAnime, &D_0600A174, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma2_Anim_00A174, -6.0f);
this->behaviorInfo.unk4C = 0;
this->actionFunc = func_80B4C218;
}
@@ -3916,8 +3873,8 @@ void func_80B4C3A0(Actor* thisx, GlobalContext* globalCtx) {
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44FEC();
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, &D_06016720, this->jointTable, this->morphTable,
- 22);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma2_Skel_015C28, &object_ma2_Anim_016720,
+ this->jointTable, this->morphTable, 22);
func_80B45C04(&this->behaviorInfo, D_80B4EBDC, 1, D_80B4EC08, 0, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f);
this->actor.textId = 0x33CD;
if (currentTime < 0xD5A0) {
@@ -3957,7 +3914,7 @@ void func_80B4C568(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4C5C0(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnInvadepoh* this = THIS;
- s32 sp2C = (this->actor.flags & 0x40) == 0x40;
+ s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
if (isTalking) {
@@ -3979,7 +3936,7 @@ void func_80B4C5C0(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4C6C8(EnInvadepoh* this) {
AlienBehaviorInfo* substruct = &this->behaviorInfo;
- Animation_MorphToLoop(&this->skelAnime, &D_06014088, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_014088, -10.0f);
substruct->unk26.x = 0;
substruct->unk26.y = 0;
substruct->unk26.z = 0;
@@ -4026,10 +3983,10 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) {
}
}
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
} else {
this->unk378 = 0;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
temp_v1_3 = globalCtx->gameplayFrames % 128;
@@ -4051,7 +4008,7 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) {
substruct->unk26.y = CLAMP(temp_v1_4, -8000, 8000);
}
- if (((this->actor.flags & 0x40) == 0x40) &&
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40) &&
(Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 7.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -4069,7 +4026,7 @@ void func_80B4C730(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4CAB0(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 4000;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->behaviorInfo.unk4C = 0;
this->actionFunc = func_80B4CB0C;
}
@@ -4098,7 +4055,7 @@ void func_80B4CB0C(EnInvadepoh* this, GlobalContext* globalCtx) {
void func_80B4CC70(EnInvadepoh* this) {
this->behaviorInfo.unk30 = 0.08f;
this->behaviorInfo.unk2C = 2000;
- Animation_MorphToLoop(&this->skelAnime, &D_06009E58, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_ma1_Anim_009E58, -10.0f);
this->behaviorInfo.unk4C = 0;
this->actionFunc = func_80B4CCCC;
}
@@ -4137,8 +4094,8 @@ void func_80B4CE54(Actor* thisx, GlobalContext* globalCtx) {
this->actor.objBankIndex = this->bankIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B44F58();
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, &D_06014088, this->jointTable, this->morphTable,
- 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, &object_ma1_Anim_014088,
+ this->jointTable, this->morphTable, 23);
func_80B45C04(&this->behaviorInfo, D_80B4EA90, 1, D_80B4EB00, 3, &gZeroVec3s, 100, 0.03f, 0.3f, 0.03f);
func_80B446D0(this, globalCtx);
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -4173,7 +4130,7 @@ void func_80B4CFFC(Actor* thisx, GlobalContext* globalCtx) {
void func_80B4D054(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnInvadepoh* this = THIS;
- s32 sp2C = (this->actor.flags & 0x40) == 0x40;
+ s32 sp2C = CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_40);
s32 isTalking = Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
if (isTalking) {
@@ -4197,7 +4154,7 @@ void func_80B4D15C(EnInvadepoh* this) {
s32 temp_v1 = this->actor.params & 7;
unkstruct80B4EE0C* temp_v0;
- Animation_PlayLoop(&this->skelAnime, &D_06001674);
+ Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674);
this->skelAnime.curFrame = ((this->actor.params & 7) * this->skelAnime.endFrame) * 0.25f;
this->alienAlpha = 255;
this->actor.draw = func_80B4DB14;
@@ -4249,7 +4206,7 @@ void func_80B4D290(EnInvadepoh* this, GlobalContext* globalCtx) {
}
void func_80B4D3E4(EnInvadepoh* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06001674);
+ Animation_PlayLoop(&this->skelAnime, &object_uch_Anim_001674);
this->skelAnime.curFrame = (this->actor.params & 7) * this->skelAnime.endFrame * 0.25f;
this->alienAlpha = 255;
this->actor.draw = NULL;
@@ -4326,8 +4283,8 @@ void func_80B4D670(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetObjectDependency(globalCtx, &this->actor);
func_80B45080();
this->actor.update = func_80B4D760;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004E50, &D_06001674, this->jointTable, this->morphTable,
- 14);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_uch_Skel_004E50, &object_uch_Anim_001674,
+ this->jointTable, this->morphTable, 14);
if (invadepohType < 3) {
func_80B453F4(this, globalCtx, invadepohType);
func_80B4D15C(this);
@@ -4372,7 +4329,7 @@ void func_80B4D7B8(GlobalContext* globalCtx) {
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, temp_s5, 0, 0x20, 0x40, 1, 0, temp_s6, 0x20, 0x40));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, &D_0402E510);
+ gSPDisplayList(POLY_XLU_DISP++, &gameplay_keep_DL_02E510);
}
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
@@ -4449,10 +4406,10 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(spBC++, 255, 255, 255, this->alienBeamAlpha * (150.0f / 255.0f));
Matrix_InsertMatrix(&D_80B502A0, MTXMODE_NEW);
gSPMatrix(spBC++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(spBC++, D_06000080);
+ gSPDisplayList(spBC++, object_uch_DL_000080);
Matrix_InsertMatrix(&D_80B502E0, MTXMODE_NEW);
gSPMatrix(spBC++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(spBC++, D_06000080);
+ gSPDisplayList(spBC++, object_uch_DL_000080);
spB8->polyXlu.p = spBC;
}
}
@@ -4464,7 +4421,7 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) {
MTXMODE_APPLY);
gSPMatrix(spCC->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(spCC->polyXlu.p++, D_06000720);
+ gSPDisplayList(spCC->polyXlu.p++, object_uch_DL_000720);
}
if (this->drawAlien) {
@@ -4476,7 +4433,7 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) {
gfx = sp6C->polyXlu.p;
gfx = func_8012C868(gfx);
- gSPSetOtherMode(gfx++, G_SETOTHERMODE_H, 4, 4, 0x00000080);
+ gDPSetDither(gfx++, G_CD_NOISE);
gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_NEW);
@@ -4487,10 +4444,10 @@ void func_80B4DB14(Actor* thisx, GlobalContext* globalCtx) {
Matrix_InsertTranslation(sp74.x, sp74.y, sp74.z, MTXMODE_NEW);
Matrix_Scale(0.25f, 0.25f, 0.25f, MTXMODE_APPLY);
alpha2 = this->alienAlpha * (100.0f / 255.0f);
- gSPDisplayList(gfx++, D_04029CB0);
+ gSPDisplayList(gfx++, gameplay_keep_DL_029CB0);
gDPSetPrimColor(gfx++, 0, 0, 240, 180, 100, alpha2);
gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(gfx++, D_04029CF0);
+ gSPDisplayList(gfx++, gameplay_keep_DL_029CF0);
sp6C->polyXlu.p = gfx;
if ((this->alienAlpha > 128) && func_80B456A8(globalCtx, &sp74)) {
func_800F9824(globalCtx, &globalCtx->envCtx, &globalCtx->view, globalCtx->state.gfxCtx, sp74, 10.0f, 9.0f,
@@ -4547,7 +4504,7 @@ void func_80B4E2AC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
if (limbIndex == 19) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_060003B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
} else if (limbIndex == 14) {
Matrix_MultiplyVector3fByState(&D_80B4EE30, &this->actor.focus.pos);
@@ -4585,7 +4542,7 @@ void func_80B4E3F0(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0xFF, 0x80, 255, 255, 0, 180);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 50, 0, 0);
- gSPDisplayList(POLY_XLU_DISP++, D_04023210);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
if (func_80B456A8(globalCtx, &sp5C)) {
func_800F9824(globalCtx, &globalCtx->envCtx, &globalCtx->view, globalCtx->state.gfxCtx, sp5C, 20.0f, 9.0f, 0,
0);
diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
index ff1f9b6cac..5696764dd8 100644
--- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
+++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c
@@ -6,7 +6,7 @@
#include "z_en_invadepoh_demo.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnInvadepohDemo*)thisx)
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 f4bef28664..99d19a1cf7 100644
--- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c
+++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c
@@ -9,7 +9,7 @@
#include "objects/gameplay_keep/gameplay_keep.h"
#include "objects/object_ishi/object_ishi.h"
-#define FLAGS 0x00800010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
#define THIS ((EnIshi*)thisx)
@@ -310,9 +310,9 @@ void func_8095DFF0(EnIshi* this, GlobalContext* globalCtx) {
sp3C = Item_DropCollectible(globalCtx, &this->actor.world.pos, temp | (ENISHI_GET_FE00(&this->actor) << 8));
if (sp3C != NULL) {
Matrix_StatePush();
- Matrix_RotateY(this->actor.shape.rot.y, 0);
- Matrix_InsertXRotation_s(this->actor.shape.rot.x, 1);
- Matrix_InsertZRotation_s(this->actor.shape.rot.z, 1);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
Matrix_GetStateTranslationAndScaledY(1.0f, &sp30);
sp2C = Math3D_Parallel(&sp30, &D_8095F778);
if (sp2C < 0.707f) {
@@ -430,8 +430,11 @@ void EnIshi_Init(Actor* thisx, GlobalContext* globalCtx) {
func_8095E5AC(this);
}
-void EnIshi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- Collider_DestroyCylinder(globalCtx, &THIS->collider);
+void EnIshi_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ EnIshi* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
}
void func_8095E5AC(EnIshi* this) {
@@ -441,7 +444,7 @@ void func_8095E5AC(EnIshi* this) {
void func_8095E5C0(EnIshi* this, GlobalContext* globalCtx) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_196)) {
this->actor.objBankIndex = this->unk_196;
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
if (!ENISHI_GET_8(&this->actor)) {
this->actor.draw = func_8095F61C;
} else {
@@ -508,9 +511,9 @@ void func_8095E660(EnIshi* this, GlobalContext* globalCtx) {
if ((this->actor.xzDistToPlayer < 90.0f) && (sp30 == 0)) {
if (sp38 == 1) {
- Actor_PickUp(&this->actor, globalCtx, 0, 80.0f, 20.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_NONE, 80.0f, 20.0f);
} else {
- Actor_PickUp(&this->actor, globalCtx, 0, 50.0f, 10.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_NONE, 50.0f, 10.0f);
}
}
}
@@ -519,7 +522,7 @@ void func_8095E660(EnIshi* this, GlobalContext* globalCtx) {
void func_8095E934(EnIshi* this) {
this->actionFunc = func_8095E95C;
this->actor.room = -1;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
}
void func_8095E95C(EnIshi* this, GlobalContext* globalCtx) {
@@ -649,7 +652,7 @@ void func_8095EBDC(EnIshi* this, GlobalContext* globalCtx) {
}
void func_8095F060(EnIshi* this) {
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
this->actionFunc = func_8095F0A4;
}
diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.c b/src/overlays/actors/ovl_En_Ja/z_en_ja.c
index 7d8099dbdc..340c186ef9 100644
--- a/src/overlays/actors/ovl_En_Ja/z_en_ja.c
+++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ja.h"
+#include "objects/object_boj/object_boj.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnJa*)thisx)
@@ -17,8 +18,30 @@ void EnJa_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BC21A8(EnJa* this, GlobalContext* globalCtx);
void func_80BC22F4(EnJa* this, GlobalContext* globalCtx);
+void func_80BC2EA4(EnJa* this);
+void func_80BC32D8(EnJa* this, GlobalContext* globalCtx);
+void func_80BC3594(EnJa* this, GlobalContext* globalCtx);
+
+s32 D_80BC35F0[] = {
+ 0x0C000301, 0x05020600, 0x1200080A, 0x00610304, 0x0002050A, 0x006C0304, 0x00010500,
+};
+
+s32 D_80BC360C[] = {
+ 0x0E29370C, 0x170E2938, 0x0C180E29, 0x390C170E, 0x293A0C09, 0x0000180E, 0x293B0C09, 0x00001000,
+};
+
+s32 D_80BC362C[] = {
+ 0x0E29400C, 0x170E2941, 0x0C180E29, 0x420C170E, 0x29430C09, 0x0000180E, 0x293B0C09, 0x00001000,
+};
+
+s32 D_80BC364C[] = {
+ 0x0E293C0C, 0x170E293D, 0x0C180E29, 0x3E0C170E, 0x293F0C09, 0x0000180E, 0x293B0C09, 0x00001000,
+};
+
+s32 D_80BC366C[] = {
+ 0x0E29440C, 0x170E2945, 0x0C180E29, 0x460C170E, 0x29470C09, 0x0000180E, 0x293B0C09, 0x00001000,
+};
-#if 0
const ActorInit En_Ja_InitVars = {
ACTOR_EN_JA,
ACTORCAT_NPC,
@@ -31,81 +54,708 @@ const ActorInit En_Ja_InitVars = {
(ActorFunc)EnJa_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BC36DC = {
- { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+Vec3f D_80BC36AC = { -10.0f, 56.0f, 25.0f };
+Vec3f D_80BC36B8 = { 0.0f, 60.0f, 20.0f };
+Vec3f D_80BC36C4 = { 10.0f, 60.0f, 25.0f };
+Vec3f D_80BC36D0 = { 0.0f, 58.0f, 20.0f };
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT1,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 12, 64, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BC3708 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-#endif
+static AnimationInfoS sAnimations[] = {
+ { &object_boj_Anim_002734, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, 0 },
+ { &object_boj_Anim_002734, 1.0f, 0, -1, 0, -4 }, { &object_boj_Anim_0033B0, 1.0f, 0, -1, 0, -4 },
+ { &object_boj_Anim_004078, 1.0f, 0, -1, 0, 0 }, { &object_boj_Anim_005CE4, 1.0f, 0, -1, 0, 0 },
+};
-extern ColliderCylinderInit D_80BC36DC;
-extern CollisionCheckInfoInit2 D_80BC3708;
+void func_80BC1900(EnJa* this) {
+ this->skelAnime.playSpeed = this->unk_344;
+ SkelAnime_Update(&this->skelAnime);
+}
-extern UNK_TYPE D_0600BA30;
-extern UNK_TYPE D_0600BCC8;
-extern UNK_TYPE D_0600C240;
+s32 func_80BC192C(EnJa* this, s32 arg1) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1900.s")
+ if (arg1 != this->unk_36C) {
+ this->unk_36C = arg1;
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
+ this->unk_344 = this->skelAnime.playSpeed;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC192C.s")
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1984.s")
+void func_80BC1984(EnJa* this, GlobalContext* globalCtx) {
+ s32 pad[2];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC19FC.s")
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ this->collider.dim.height = (s16)fabsf(this->actor.focus.pos.y - this->actor.world.pos.y) + 5;
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1A68.s")
+s32 func_80BC19FC(EnJa* this, GlobalContext* globalCtx) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1AE0.s")
+ if ((this->unk_340 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ SubS_UpdateFlags(&this->unk_340, 0, 7);
+ this->actionFunc = func_80BC22F4;
+ ret = true;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1B50.s")
+void func_80BC1A68(EnJa* this) {
+ if (DECR(this->unk_360) == 0) {
+ this->unk_362++;
+ if (this->unk_362 >= 4) {
+ this->unk_360 = Rand_S16Offset(30, 30);
+ this->unk_362 = 0;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1B60.s")
+s32 func_80BC1AE0(EnJa* this, GlobalContext* globalCtx) {
+ Actor* ja = SubS_FindNearestActor(&this->actor, globalCtx, ACTORCAT_NPC, ACTOR_EN_JA);
+ Vec3f sp30;
+ Vec3f sp24;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1D70.s")
+ if (ja != NULL) {
+ this->actor.child = ja;
+ Math_Vec3f_Copy(&sp24, &ja->world.pos);
+ Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
+ this->actor.world.rot.y = Math_Vec3f_Yaw(&sp30, &sp24);
+ } else {
+ this->actor.child = NULL;
+ }
+ return this->actor.child;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1E40.s")
+Player* func_80BC1B50(EnJa* this, GlobalContext* globalCtx) {
+ return GET_PLAYER(globalCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC1FC8.s")
+s32 func_80BC1B60(EnJa* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp40;
+ Vec3f sp34;
+ s16 sp32;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC203C.s")
+ Math_Vec3f_Copy(&sp40, &this->unk_1D8.player->actor.world.pos);
+ Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
+ sp32 = Math_Vec3f_Yaw(&sp34, &sp40);
+ Math_ApproachS(&this->unk_356, (sp32 - this->unk_35A) - this->actor.shape.rot.y, 4, 0x2AA8);
+ this->unk_356 = CLAMP(this->unk_356, -0x1FFE, 0x1FFE);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC20D0.s")
+ Math_ApproachS(&this->unk_35A, (sp32 - this->unk_356) - this->actor.shape.rot.y, 4, 0x2AA8);
+ this->unk_35A = CLAMP(this->unk_35A, -0x1C70, 0x1C70);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC213C.s")
+ if (this->unk_1D8.player->actor.id == ACTOR_PLAYER) {
+ sp40.y = this->unk_1D8.player->bodyPartsPos[7].y + 3.0f;
+ } else {
+ Math_Vec3f_Copy(&sp40, &this->unk_1D8.player->actor.focus.pos);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC2150.s")
+ Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
+ Math_ApproachS(&this->unk_354, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_358, 4, 0x2AA8);
+ this->unk_354 = CLAMP(this->unk_354, -0x1C70, 0x1C70);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC21A8.s")
+ Math_ApproachS(&this->unk_358, Math_Vec3f_Pitch(&sp34, &sp40) - this->unk_354, 4, 0x2AA8);
+ this->unk_358 = CLAMP(this->unk_358, -0x1C70, 0x1C70);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC2274.s")
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC22F4.s")
+s32 func_80BC1D70(EnJa* this, GlobalContext* globalCtx) {
+ if (this->unk_340 & 8) {
+ this->unk_1D8.player = func_80BC1B50(this, globalCtx);
+ if (this->unk_1D8.player != NULL) {
+ func_80BC1B60(this, globalCtx);
+ }
+ this->unk_340 &= ~0x10;
+ this->unk_340 |= 0x20;
+ } else if (this->unk_340 & 0x20) {
+ this->unk_340 &= ~0x20;
+ this->unk_354 = 0;
+ this->unk_356 = 0;
+ this->unk_358 = 0;
+ this->unk_35A = 0;
+ this->unk_35E = 20;
+ } else if (DECR(this->unk_35E) == 0) {
+ this->unk_340 |= 0x10;
+ this->unk_35E = 20;
+ }
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/EnJa_Init.s")
+void func_80BC1E40(EnJa* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 sp20 = Message_GetState(&globalCtx->msgCtx);
+ f32 phi_f0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/EnJa_Destroy.s")
+ if (((globalCtx->msgCtx.unk11F04 < 0xFF) || (globalCtx->msgCtx.unk11F04 > 0x200)) && (sp20 == 3) &&
+ (this->unk_374 == 3) && (&this->actor == player->targetActor)) {
+ if ((globalCtx->state.frames % 2) == 0) {
+ if (this->unk_348 != 0.0f) {
+ this->unk_348 = 0.0f;
+ } else {
+ this->unk_348 = 1.0f;
+ }
+ }
+ } else {
+ this->unk_348 = 0.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/EnJa_Update.s")
+ this->unk_34C += (this->unk_348 != 0.0f) ? 60.0f : -60.0f;
+ this->unk_34C = CLAMP(this->unk_34C, 0.0f, 120.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC25E0.s")
+ Matrix_InsertTranslation(this->unk_34C, 0.0f, 0.0f, MTXMODE_APPLY);
+ this->unk_374 = sp20;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC2620.s")
+s32 func_80BC1FC8(EnJa* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC2B30.s")
+ if (func_80BC1AE0(this, globalCtx)) {
+ SubS_UpdateFlags(&this->unk_340, 3, 7);
+ this->unk_340 |= 0x10;
+ func_80BC192C(this, 5);
+ func_80BC2EA4(this);
+ ret = true;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/EnJa_Draw.s")
+s32 func_80BC203C(EnJa* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC2EA4.s")
+ if (func_80BC1AE0(this, globalCtx)) {
+ if (ENJA_GET_3(&this->actor) == 0) {
+ func_80BC192C(this, 1);
+ } else {
+ func_80BC192C(this, 4);
+ }
+ SubS_UpdateFlags(&this->unk_340, 3, 7);
+ this->actor.shape.shadowDraw = NULL;
+ this->unk_340 |= 0x50;
+ ret = true;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC3154.s")
+s32 func_80BC20D0(EnJa* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
+ s32 ret = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC32D8.s")
+ this->unk_340 = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC33C0.s")
+ switch (arg2->unk0) {
+ case 1:
+ ret = func_80BC1FC8(this, globalCtx, arg2);
+ if (ret == 1) {}
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Ja/func_80BC3594.s")
+ case 2:
+ ret = func_80BC203C(this, globalCtx, arg2);
+ break;
+ }
+ return ret;
+}
+
+s32 func_80BC213C(EnJa* this, GlobalContext* globalCtx) {
+ return true;
+}
+
+void func_80BC2150(EnJa* this, GlobalContext* globalCtx) {
+ if ((this->unk_1D8.unk_00 == 1) || (this->unk_1D8.unk_00 == 2)) {
+ func_80BC213C(this, globalCtx);
+ }
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.world.rot.y, 4, 0x1554);
+}
+
+void func_80BC21A8(EnJa* this, GlobalContext* globalCtx) {
+ u32* unk_14 = &gSaveContext.unk_14;
+ struct_80133038_arg2 sp18;
+
+ this->unk_35C = REG(15) + *unk_14;
+ if (!func_80133038(globalCtx, D_80BC35F0, &sp18) ||
+ ((this->unk_1D8.unk_00 != sp18.unk0) && !func_80BC20D0(this, globalCtx, &sp18))) {
+ this->actor.shape.shadowDraw = NULL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ sp18.unk0 = 0;
+ } else {
+ this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+ this->unk_1D8.unk_00 = sp18.unk0;
+ func_80BC2150(this, globalCtx);
+}
+
+s32* func_80BC2274(EnJa* this, GlobalContext* globalCtx) {
+ switch (this->unk_1D8.unk_00) {
+ case 1:
+ if (ENJA_GET_3(&this->actor) == 0) {
+ return D_80BC360C;
+ }
+ return D_80BC364C;
+
+ case 2:
+ if (ENJA_GET_3(&this->actor) == 0) {
+ return D_80BC362C;
+ }
+ return D_80BC366C;
+ }
+ return D_80BC360C;
+}
+
+void func_80BC22F4(EnJa* this, GlobalContext* globalCtx) {
+ if (func_8010BF58(&this->actor, globalCtx, func_80BC2274(this, globalCtx), this->unk_368, &this->unk_1D8.unk_04)) {
+ this->unk_340 &= ~8;
+ SubS_UpdateFlags(&this->unk_340, 3, 7);
+ this->unk_1D8.unk_04 = 0;
+ this->unk_340 |= 0x10;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actionFunc = func_80BC21A8;
+ }
+}
+
+void EnJa_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnJa* this = THIS;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boj_Skel_00C240, NULL, this->jointTable, this->morphTable,
+ 16);
+ this->unk_36C = -1;
+ func_80BC192C(this, 0);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->actor.targetMode = 0;
+ this->actor.uncullZoneForward = 800.0f;
+ this->actor.gravity = 0.0f;
+ SubS_UpdateFlags(&this->unk_340, 0, 7);
+ this->unk_340 |= 0x10;
+ this->unk_1D8.unk_00 = 0;
+ this->unk_368 = NULL;
+ this->actionFunc = func_80BC21A8;
+}
+
+void EnJa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnJa* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnJa_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnJa* this = THIS;
+ f32 height;
+ f32 radius;
+
+ func_80BC19FC(this, globalCtx);
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_1D8.unk_00 != 0) {
+ func_80BC1900(this);
+ func_80BC1A68(this);
+ func_80BC1D70(this, globalCtx);
+
+ radius = this->collider.dim.radius + 30;
+ height = this->collider.dim.height + 10;
+ func_8013C964(&this->actor, globalCtx, radius, height, 0, this->unk_340 & 7);
+
+ if (this->unk_1D8.unk_00 != 2) {
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 12.0f, 0.0f, 4);
+ }
+ func_80BC1984(this, globalCtx);
+ }
+
+ if (this->unk_1D8.unk_00 == 1) {
+ func_80BC32D8(this, globalCtx);
+ }
+}
+
+s32 EnJa_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnJa* this = THIS;
+
+ if (limbIndex == 15) {
+ func_80BC1E40(this, globalCtx);
+ }
+ return false;
+}
+
+void EnJa_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ static Vec3f D_80BC3774 = { -87.0f, 444.0f, -49.0f };
+ static Vec3f D_80BC3780 = { 600.0f, 0.0f, 0.0f };
+ static Vec3f D_80BC378C = { 400.0f, 0.0f, -400.0f };
+ static Vec3f D_80BC3798 = { 400.0, 0.0f, 400.0f };
+ static Vec3s D_80BC37A4 = { 0x7770, -0x4BC, -0x251C };
+ s32 pad;
+ EnJa* this = THIS;
+ s32 pad2;
+
+ if (limbIndex == 15) {
+ Matrix_MultiplyVector3fByState(&D_80BC3780, &this->actor.focus.pos);
+ Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
+ } else if ((this->unk_340 & 0x40) && (limbIndex == 11)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+ Matrix_JointPosition(&D_80BC3774, &D_80BC37A4);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_00BA30);
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if (this->unk_1D8.unk_00 == 1) {
+ if ((limbIndex == 11) && (((this->skelAnime.curFrame >= 0.0f) && (this->skelAnime.curFrame <= 6.0f)) ||
+ ((this->skelAnime.curFrame >= 35.0f) && (this->skelAnime.curFrame <= 47.0f)))) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+ Matrix_InsertTranslation(D_80BC378C.x, D_80BC378C.y, D_80BC378C.z, MTXMODE_APPLY);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+
+ gDPPipeSync(POLY_OPA_DISP++);
+
+ switch (this->unk_364) {
+ case 0:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 1:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 0, 0, 255);
+ break;
+
+ case 2:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 3:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 0, 255);
+ break;
+
+ default:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
+ break;
+ }
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_00BCC8);
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else if (limbIndex == 14) {
+ if ((this->skelAnime.curFrame >= 0.0f) && (this->skelAnime.curFrame <= 18.0f)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+
+ Matrix_InsertTranslation(D_80BC3798.x, D_80BC3798.y, D_80BC3798.z, MTXMODE_APPLY);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+
+ gDPPipeSync(POLY_OPA_DISP++);
+
+ switch (this->unk_366) {
+ case 0:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 1:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 0, 0, 255);
+ break;
+
+ case 2:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 3:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 0, 255);
+ break;
+
+ default:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
+ break;
+ }
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_00BCC8);
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ }
+ }
+}
+
+void EnJa_TransformDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+ EnJa* this = THIS;
+ s32 phi_v1;
+ s32 phi_v0;
+
+ if (this->unk_340 & 0x10) {
+ phi_v1 = false;
+ } else {
+ phi_v1 = true;
+ }
+
+ if (this->unk_340 & 0x20) {
+ phi_v0 = true;
+ } else {
+ phi_v0 = false;
+ }
+
+ if (!phi_v1) {
+ phi_v0 = false;
+ }
+
+ if (limbIndex != 8) {
+ if (limbIndex == 15) {
+ func_8013AD9C(this->unk_354 + this->unk_358 + 0x4000,
+ this->unk_356 + this->unk_35A + this->actor.shape.rot.y + 0x4000, &this->unk_1EC,
+ &this->unk_274, phi_v1, phi_v0);
+ Matrix_StatePop();
+ Matrix_InsertTranslation(this->unk_1EC.x, this->unk_1EC.y, this->unk_1EC.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_274.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_274.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_274.z, MTXMODE_APPLY);
+ Matrix_StatePush();
+ }
+ } else {
+ func_8013AD9C(this->unk_358 + 0x4000, this->unk_35A + this->actor.shape.rot.y + 0x4000, &this->unk_1F8,
+ &this->unk_27A, phi_v1, phi_v0);
+ Matrix_StatePop();
+ Matrix_InsertTranslation(this->unk_1F8.x, this->unk_1F8.y, this->unk_1F8.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_27A.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_27A.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_27A.z, MTXMODE_APPLY);
+ Matrix_StatePush();
+ }
+}
+
+void EnJa_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static Color_RGBA8 D_80BC37AC[] = {
+ { 200, 0, 80, 0 },
+ { 0, 130, 220, 0 },
+ };
+ static Color_RGBA8 D_80BC37B4[] = {
+ { 255, 255, 255, 0 },
+ { 255, 255, 255, 0 },
+ };
+ static TexturePtr D_80BC37BC[] = {
+ object_boj_Tex_0062B0,
+ object_boj_Tex_0063B0,
+ object_boj_Tex_0064B0,
+ object_boj_Tex_0063B0,
+ };
+ s32 pad;
+ EnJa* this = THIS;
+ s32 phi_t2;
+
+ if (ENJA_GET_3(&this->actor) == 0) {
+ phi_t2 = 0;
+ } else {
+ phi_t2 = 1;
+ }
+
+ if (this->unk_1D8.unk_00 != 0) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08,
+ Gfx_EnvColor(globalCtx->state.gfxCtx, D_80BC37AC[phi_t2].r, D_80BC37AC[phi_t2].g,
+ D_80BC37AC[phi_t2].b, D_80BC37AC[phi_t2].a));
+ gSPSegment(POLY_OPA_DISP++, 0x09,
+ Gfx_EnvColor(globalCtx->state.gfxCtx, D_80BC37B4[phi_t2].r, D_80BC37B4[phi_t2].g,
+ D_80BC37B4[phi_t2].b, D_80BC37B4[phi_t2].a));
+ gSPSegment(POLY_OPA_DISP++, 0x0A, Lib_SegmentedToVirtual(D_80BC37BC[this->unk_362]));
+ gDPPipeSync(POLY_OPA_DISP++);
+
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnJa_OverrideLimbDraw, EnJa_PostLimbDraw,
+ EnJa_TransformDraw, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+
+ if (this->unk_1D8.unk_00 == 1) {
+ func_80BC3594(this, globalCtx);
+ }
+}
+
+void func_80BC2EA4(EnJa* this) {
+ f32 sp44;
+ f32 sp40;
+ f32 sp3C;
+ f32 sp38;
+ s32 i;
+ Vec3f sp28;
+
+ sp44 = Math_SinS(this->actor.shape.rot.y);
+ sp40 = Math_CosS(this->actor.shape.rot.y);
+ sp3C = Math_SinS(this->actor.child->shape.rot.y);
+ sp38 = Math_CosS(this->actor.child->shape.rot.y);
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_234); i++) {
+ this->unk_234[i].unk_0E = i * 0x30;
+ this->unk_234[i].unk_0C = i;
+ }
+
+ sp28 = this->actor.world.pos;
+ this->unk_210 = sp28;
+ this->unk_204 = sp28;
+
+ sp28 = this->actor.child->world.pos;
+ this->unk_228 = sp28;
+ this->unk_21C = sp28;
+
+ this->unk_204.x += (D_80BC36AC.z * sp44) + (D_80BC36AC.x * sp40);
+ this->unk_204.y += D_80BC36AC.y;
+ this->unk_204.z += (D_80BC36AC.z * sp40) - (D_80BC36AC.x * sp44);
+
+ this->unk_210.x += (D_80BC36B8.z * sp44) + (D_80BC36B8.x * sp40);
+ this->unk_210.y += D_80BC36B8.y;
+ this->unk_210.z += (D_80BC36B8.z * sp40) - (D_80BC36B8.x * sp44);
+
+ this->unk_21C.x += (D_80BC36C4.z * sp3C) + (D_80BC36C4.x * sp38);
+ this->unk_21C.y += D_80BC36C4.y;
+ this->unk_21C.z += (D_80BC36C4.z * sp38) - (D_80BC36C4.x * sp3C);
+
+ this->unk_228.x += (D_80BC36D0.z * sp3C) + (D_80BC36D0.x * sp38);
+ this->unk_228.y += D_80BC36D0.y;
+ this->unk_228.z += (D_80BC36D0.z * sp38) - (D_80BC36D0.x * sp3C);
+
+ this->unk_364 = 2;
+ this->unk_366 = 0;
+}
+
+void func_80BC3154(EnJa* this, EnJaStruct* ptr) {
+ if ((ptr->unk_0E >= 18) && (ptr->unk_0E < 83)) {
+ f32 temp_f0 = ptr->unk_0E - 18;
+
+ ptr->unk_00.x = (((65.0f - temp_f0) * this->unk_204.x) + (temp_f0 * this->unk_228.x)) / 65.0f;
+ ptr->unk_00.y = (((65.0f - temp_f0) * this->unk_204.y) + (temp_f0 * this->unk_228.y)) / 65.0f;
+ ptr->unk_00.z = (((65.0f - temp_f0) * this->unk_204.z) + (temp_f0 * this->unk_228.z)) / 65.0f;
+
+ temp_f0 -= 32.5f;
+ temp_f0 = SQ(temp_f0);
+
+ ptr->unk_00.y += -0.11360947f * temp_f0 + 120.0f;
+ } else if ((ptr->unk_0E >= 102) && (ptr->unk_0E < 191)) {
+ f32 temp_f0 = ptr->unk_0E - 102;
+
+ ptr->unk_00.x = (((89.0f - temp_f0) * this->unk_21C.x) + (temp_f0 * this->unk_210.x)) / 89.0f;
+ ptr->unk_00.y = (((89.0f - temp_f0) * this->unk_21C.y) + (temp_f0 * this->unk_210.y)) / 89.0f;
+ ptr->unk_00.z = (((89.0f - temp_f0) * this->unk_21C.z) + (temp_f0 * this->unk_210.z)) / 89.0f;
+
+ temp_f0 -= 44.5f;
+ temp_f0 = SQ(temp_f0);
+
+ ptr->unk_00.y += -0.08079788f * temp_f0 + 160.0f;
+ }
+}
+
+void func_80BC32D8(EnJa* this, GlobalContext* globalCtx) {
+ EnJaStruct* phi_s0 = &this->unk_234[0];
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_234); i++, phi_s0++) {
+ func_80BC3154(this, phi_s0);
+ if (phi_s0->unk_0E != 191) {
+ phi_s0->unk_0E++;
+ } else {
+ phi_s0->unk_0E = 0;
+ }
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ if (this->unk_366 > 0) {
+ this->unk_366--;
+ } else {
+ this->unk_366 = 3;
+ }
+ } else if (Animation_OnFrame(&this->skelAnime, 34.0f)) {
+ if (this->unk_364 > 0) {
+ this->unk_364--;
+ } else {
+ this->unk_364 = 3;
+ }
+ }
+}
+
+void func_80BC33C0(EnJaStruct* ptr, GlobalContext* globalCtx) {
+ s32 pad;
+
+ if (((ptr->unk_0E < 0) || (ptr->unk_0E >= 19)) && ((ptr->unk_0E < 83) || (ptr->unk_0E >= 103))) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_InsertTranslation(ptr->unk_00.x, ptr->unk_00.y, ptr->unk_00.z, MTXMODE_NEW);
+ Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
+ Matrix_Scale(0.01f, 0.01f, 0.01f, MTXMODE_APPLY);
+
+ switch (ptr->unk_0C) {
+ case 0:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 1:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 0, 0, 255);
+ break;
+
+ case 2:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0, 0, 255, 255);
+ break;
+
+ case 3:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 0, 255);
+ break;
+
+ default:
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
+ break;
+ }
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_00BCC8);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
+
+void func_80BC3594(EnJa* this, GlobalContext* globalCtx) {
+ EnJaStruct* phi_s0 = this->unk_234;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_234); i++, phi_s0++) {
+ func_80BC33C0(phi_s0, globalCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Ja/z_en_ja.h b/src/overlays/actors/ovl_En_Ja/z_en_ja.h
index 1df6d89628..561f76f555 100644
--- a/src/overlays/actors/ovl_En_Ja/z_en_ja.h
+++ b/src/overlays/actors/ovl_En_Ja/z_en_ja.h
@@ -7,11 +7,57 @@ struct EnJa;
typedef void (*EnJaActionFunc)(struct EnJa*, GlobalContext*);
+#define ENJA_GET_3(thisx) (((thisx)->params & 3) & 0xFF)
+
+typedef struct {
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ s16 unk_0C;
+ /* 0x0E */ s16 unk_0E;
+} EnJaStruct; // size = 0x10
+
+typedef struct {
+ /* 0x00 */ u8 unk_00;
+ /* 0x04 */ s32 unk_04;
+ /* 0x08 */ Player* player;
+} EnJaStruct2; // size = 0x10
+
typedef struct EnJa {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnJaActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x1EC];
+ /* 0x018C */ ColliderCylinder collider;
+ /* 0x01D8 */ EnJaStruct2 unk_1D8;
+ /* 0x01E4 */ Vec3s unk_1E4;
+ /* 0x01EC */ Vec3f unk_1EC;
+ /* 0x01F8 */ Vec3f unk_1F8;
+ /* 0x0204 */ Vec3f unk_204;
+ /* 0x0210 */ Vec3f unk_210;
+ /* 0x021C */ Vec3f unk_21C;
+ /* 0x0228 */ Vec3f unk_228;
+ /* 0x0234 */ EnJaStruct unk_234[4];
+ /* 0x0274 */ Vec3s unk_274;
+ /* 0x027A */ Vec3s unk_27A;
+ /* 0x0280 */ Vec3s jointTable[16];
+ /* 0x02E0 */ Vec3s morphTable[16];
+ /* 0x0340 */ u16 unk_340;
+ /* 0x0344 */ f32 unk_344;
+ /* 0x0348 */ f32 unk_348;
+ /* 0x034C */ f32 unk_34C;
+ /* 0x0350 */ UNK_TYPE1 unk350[0x4];
+ /* 0x0354 */ s16 unk_354;
+ /* 0x0356 */ s16 unk_356;
+ /* 0x0358 */ s16 unk_358;
+ /* 0x035A */ s16 unk_35A;
+ /* 0x035C */ s16 unk_35C;
+ /* 0x035E */ s16 unk_35E;
+ /* 0x0360 */ s16 unk_360;
+ /* 0x0362 */ s16 unk_362;
+ /* 0x0364 */ s16 unk_364;
+ /* 0x0366 */ s16 unk_366;
+ /* 0x0368 */ void* unk_368;
+ /* 0x036C */ s32 unk_36C;
+ /* 0x0370 */ UNK_TYPE1 unk370[4];
+ /* 0x0374 */ s32 unk_374;
} EnJa; // size = 0x378
extern const ActorInit En_Ja_InitVars;
diff --git a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c
index c1b5d13277..8051f71f4c 100644
--- a/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c
+++ b/src/overlays/actors/ovl_En_Jc_Mato/z_en_jc_mato.c
@@ -5,8 +5,9 @@
*/
#include "z_en_jc_mato.h"
+#include "objects/object_tru/object_tru.h"
-#define FLAGS 0x00004030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000)
#define THIS ((EnJcMato*)thisx)
@@ -86,8 +87,6 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-extern Gfx D_06000390[];
-
s32 EnJcMato_CheckForHit(EnJcMato* this, GlobalContext* globalCtx) {
this->collider.dim.worldSphere.center.x = this->pos.x;
this->collider.dim.worldSphere.center.y = this->pos.y;
@@ -162,7 +161,7 @@ void EnJcMato_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000390);
+ gSPDisplayList(POLY_OPA_DISP++, object_tru_DL_000390);
Matrix_MultiplyVector3fByState(&movement, &this->pos);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.c b/src/overlays/actors/ovl_En_Jg/z_en_jg.c
index ce8651d3cd..7797f2ad40 100644
--- a/src/overlays/actors/ovl_En_Jg/z_en_jg.c
+++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.c
@@ -5,17 +5,65 @@
*/
#include "z_en_jg.h"
+#include "overlays/actors/ovl_En_S_Goro/z_en_s_goro.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnJg*)thisx)
+#define FLAG_SHRINE_GORON_ARMS_RAISED (1 << 0)
+#define FLAG_LOOKING_AT_PLAYER (1 << 2)
+#define FLAG_DRUM_SPAWNED (1 << 3)
+
void EnJg_Init(Actor* thisx, GlobalContext* globalCtx);
void EnJg_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnJg_Update(Actor* thisx, GlobalContext* globalCtx);
void EnJg_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void EnJg_GoronShrineTalk(EnJg* this, GlobalContext* globalCtx);
+void EnJg_GoronShrineCheer(EnJg* this, GlobalContext* globalCtx);
+void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, GlobalContext* globalCtx);
+void EnJg_Walk(EnJg* this, GlobalContext* globalCtx);
+void EnJg_Talk(EnJg* this, GlobalContext* globalCtx);
+void EnJg_SetupWalk(EnJg* this, GlobalContext* globalCtx);
+void EnJg_FrozenIdle(EnJg* this, GlobalContext* globalCtx);
+void EnJg_EndFrozenInteraction(EnJg* this, GlobalContext* globalCtx);
+void EnJg_TeachLullabyIntro(EnJg* this, GlobalContext* globalCtx);
+void EnJg_LullabyIntroCutsceneAction(EnJg* this, GlobalContext* globalCtx);
+s32 EnJg_GetNextTextId(EnJg* this);
+s32 EnJg_GetStartingConversationTextId(EnJg* this, GlobalContext* globalCtx);
+void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, GlobalContext* globalCtx);
+
+typedef enum {
+ /* 0 */ EN_JG_ANIMATION_IDLE,
+ /* 1 */ EN_JG_ANIMATION_WALK,
+ /* 2 */ EN_JG_ANIMATION_WAVING,
+ /* 3 */ EN_JG_ANIMATION_SHAKING_HEAD,
+ /* 4 */ EN_JG_ANIMATION_SURPRISE_START,
+ /* 5 */ EN_JG_ANIMATION_SURPRISE_LOOP,
+ /* 6 */ EN_JG_ANIMATION_ANGRY,
+ /* 7 */ EN_JG_ANIMATION_FROZEN_START,
+ /* 8 */ EN_JG_ANIMATION_FROZEN_LOOP,
+ /* 9 */ EN_JG_ANIMATION_WALK_2,
+ /* 10 */ EN_JG_ANIMATION_TAKING_OUT_DRUM,
+ /* 11 */ EN_JG_ANIMATION_DRUM_IDLE,
+ /* 12 */ EN_JG_ANIMATION_PLAYING_DRUM,
+ /* 13 */ EN_JG_ANIMATION_THINKING,
+ /* 14 */ EN_JG_ANIMATION_REMEMBERING,
+ /* 15 */ EN_JG_ANIMATION_STRONG_REMEMBERING,
+ /* 16 */ EN_JG_ANIMATION_DEPRESSED,
+ /* 17 */ EN_JG_ANIMATION_CUTSCENE_IDLE,
+ /* 18 */ EN_JG_ANIMATION_CRADLE,
+ /* 19 */ EN_JG_ANIMATION_MAX,
+} EnJgAnimationIndex;
+
+typedef enum {
+ /* 0x0 */ EN_JG_ACTION_FIRST_THAW,
+ /* 0x1 */ EN_JG_ACTION_SPAWNING,
+ /* 0x2 */ EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW,
+ /* 0x3 */ EN_JG_ACTION_LULLABY_INTRO_CS,
+} EnJgAction;
+
const ActorInit En_Jg_InitVars = {
ACTOR_EN_JG,
ACTORCAT_NPC,
@@ -28,18 +76,29 @@ const ActorInit En_Jg_InitVars = {
(ActorFunc)EnJg_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80B75820 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 60, 80, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80B7584C = { 0, 50, 80, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 50, 80, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80B75858 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -74,70 +133,905 @@ static DamageTable D_80B75858 = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-#endif
+static AnimationInfoS sAnimations[] = {
+ { &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderWavingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderHeadShakeAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderSurpriseStartAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -10 },
+ { &gGoronElderSurpriseLoopAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderAngryAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderSurpriseStartAnim, 2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gGoronElderSurpriseStartAnim, -2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gGoronElderWalkAnim, -1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gGoronElderTakeOutDrumAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gGoronElderDrumIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gGoronElderPlayingDrumAnim, 1.0f, 1, 44, ANIMMODE_ONCE, 0 },
+ { &gGoronElderThinkingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gGoronElderRememberingAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gGoronElderStrongRememberingAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gGoronElderDepressedAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gGoronElderIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gGoronElderCradleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+};
-extern ColliderCylinderInit D_80B75820;
-extern CollisionCheckInfoInit2 D_80B7584C;
-extern DamageTable D_80B75858;
+static Vec3f sSfxPos = { 0.0f, 0.0f, 0.0f };
-extern UNK_TYPE D_0601ADC0;
+static Vec3f sFocusOffset = { 0.0f, 0.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73A90.s")
+static Vec3f sBreathPosOffset = { 1000.0f, -500.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73AE4.s")
+static Vec3f sBreathVelOffset = { 0.0f, 0.0f, 0.75f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73B98.s")
+static Vec3f sBreathAccelOffset = { 0.0f, 0.0f, -0.070000000298f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73C58.s")
+/**
+ * When the elder and the Gorons in the shrine are doing a cheer
+ * for Darmani, the camera will focus on specific Gorons for
+ * certain parts of the cheer. This function is responsible for
+ * returning a pointer to the specified Goron so the camera
+ * can focus on them.
+ */
+Actor* EnJg_GetShrineGoronToFocusOn(GlobalContext* globalCtx, u8 focusedShrineGoronParam) {
+ Actor* actorIterator = globalCtx->actorCtx.actorLists[ACTORCAT_NPC].first;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73DF4.s")
+ while (actorIterator != NULL) {
+ if ((actorIterator->id == ACTOR_EN_S_GORO) &&
+ (EN_S_GORO_GET_PARAM_F(actorIterator) == focusedShrineGoronParam)) {
+ return actorIterator;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73E3C.s")
+ actorIterator = actorIterator->next;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B73F1C.s")
+ return NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B7406C.s")
+void EnJg_UpdateCollision(EnJg* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B7408C.s")
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 30.0f, 30.0f, 7);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74134.s")
+s16 EnJg_GetWalkingYRotation(Path* path, s32 pointIndex, Vec3f* pos, f32* distSQ) {
+ Vec3s* points;
+ f32 diffX;
+ f32 diffZ;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B741F8.s")
+ if (path != NULL) {
+ points = Lib_SegmentedToVirtual(path->points);
+ points = &points[pointIndex];
+ diffX = points[0].x - pos->x;
+ diffZ = points[0].z - pos->z;
+ } else {
+ diffX = 0.0f;
+ diffZ = 0.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B742F8.s")
+ *distSQ = SQ(diffX) + SQ(diffZ);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74440.s")
+ return RADF_TO_BINANG(Math_Acot2F(diffZ, diffX));
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74550.s")
+s32 EnJg_ReachedPoint(EnJg* this, Path* path, s32 pointIndex) {
+ Vec3s* points = Lib_SegmentedToVirtual(path->points);
+ s32 pathCount = path->count;
+ s32 currentPoint = pointIndex;
+ s32 reached = false;
+ f32 diffX;
+ f32 diffZ;
+ f32 px;
+ f32 pz;
+ f32 d;
+ Vec3f point;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B747C8.s")
+ Math_Vec3s_ToVec3f(&point, &points[pointIndex]);
+ if (currentPoint == 0) {
+ diffX = points[1].x - points[0].x;
+ diffZ = points[1].z - points[0].z;
+ } else if (currentPoint == (pathCount - 1)) {
+ diffX = points[pathCount - 1].x - points[pathCount - 2].x;
+ diffZ = points[pathCount - 1].z - points[pathCount - 2].z;
+ } else {
+ diffX = points[currentPoint + 1].x - points[currentPoint - 1].x;
+ diffZ = points[currentPoint + 1].z - points[currentPoint - 1].z;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74840.s")
+ func_8017B7F8(&point, RADF_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B749D0.s")
+ if (((this->actor.world.pos.x * px) + (pz * this->actor.world.pos.z) + d) > 0.0f) {
+ reached = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74AD8.s")
+ return reached;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74B54.s")
+s16 EnJg_GetCutsceneForTeachingLullabyIntro(EnJg* this) {
+ s16 temp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74BC8.s")
+ if (temp > 0) {
+ return this->actor.cutscene;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B74E5C.s")
+ return ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B750A0.s")
+void EnJg_SetupGoronShrineCheer(EnJg* this) {
+ ActorCutscene_Stop(this->cutscene);
+ if (this->focusedShrineGoronParam == 10) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ this->actionFunc = EnJg_GoronShrineTalk;
+ } else {
+ this->cutscene = 0x7C;
+ }
+ } else {
+ this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene);
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B7517C.s")
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ this->actionFunc = EnJg_GoronShrineCheer;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B751F8.s")
+ switch (this->textId) {
+ case 0xDD0: // The greatest Goron hero of all?
+ case 0xDD2: // The immortal Goron?
+ case 0xDD3: // The star we wish upon?
+ case 0xDD4: // "Darmani, greatest of Gorons!"
+ case 0xDD6: // Darmani, greatest in the world!
+ this->flags |= FLAG_SHRINE_GORON_ARMS_RAISED;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/EnJg_Init.s")
+ default:
+ this->flags &= ~FLAG_SHRINE_GORON_ARMS_RAISED;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/EnJg_Destroy.s")
+void EnJg_SetupTalk(EnJg* this, GlobalContext* globalCtx) {
+ switch (this->textId) {
+ case 0xDAC: // What was I doing?
+ this->animationIndex = EN_JG_ANIMATION_SHAKING_HEAD;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Talk;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/EnJg_Update.s")
+ case 0xDAD: // I must hurry!
+ this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_AlternateTalkOrWalkInPlace;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B75658.s")
+ case 0xDB7: // You're Darmani!
+ this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Talk;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/func_80B75708.s")
+ case 0xDAE: // Do you have business with the Elder?
+ case 0xDB3: // As Elder, I must do something
+ case 0xDB6: // "Hunh???"
+ case 0xDBA: // I've been made a fool of!
+ case 0xDBD: // "...What?"
+ case 0xDC4: // It's so cold I can't play
+ this->animationIndex = EN_JG_ANIMATION_IDLE;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Talk;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Jg/EnJg_Draw.s")
+ case 0xDB0: // It's this cold snap
+ case 0xDBB: // If I can see past the illusion, you'll vanish
+ case 0xDBC: // Following me won't do you any good
+ case 0xDC6: // I am counting on you
+ this->animationIndex = EN_JG_ANIMATION_ANGRY;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Talk;
+ break;
+
+ case 0xDB4: // This is our problem (first)
+ case 0xDB5: // This is our problem (repeat)
+ this->animationIndex = EN_JG_ANIMATION_WAVING;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Talk;
+ break;
+ }
+}
+
+void EnJg_Idle(EnJg* this, GlobalContext* globalCtx) {
+ EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, globalCtx);
+}
+
+void EnJg_GoronShrineIdle(EnJg* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->flags |= FLAG_LOOKING_AT_PLAYER;
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ this->actionFunc = EnJg_GoronShrineTalk;
+ } else if ((this->actor.xzDistToPlayer < 100.0f) || (this->actor.isTargeted)) {
+ func_800B863C(&this->actor, globalCtx);
+ this->textId = EnJg_GetStartingConversationTextId(this, globalCtx);
+ }
+}
+
+void EnJg_GoronShrineTalk(EnJg* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && (func_80147624(globalCtx))) {
+ if ((this->textId == 0xDCC) || (this->textId == 0xDDD) || (this->textId == 0xDE0)) {
+ // There is nothing more to say after these lines, so end the current conversation.
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->flags &= ~FLAG_LOOKING_AT_PLAYER;
+ this->actionFunc = EnJg_GoronShrineIdle;
+ } else {
+ this->textId = EnJg_GetNextTextId(this);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ }
+ }
+}
+
+void EnJg_GoronShrineCheer(EnJg* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
+ switch (this->textId) {
+ case 0xDD0: // The greatest Goron hero of all?
+ case 0xDD2: // The immortal Goron?
+ case 0xDD3: // The star we wish upon?
+ case 0xDD4: // "Darmani, greatest of Gorons!"
+ case 0xDD6: // Darmani, greatest in the world!
+ // Focus on a specifc Goron for these lines
+ this->shrineGoron = EnJg_GetShrineGoronToFocusOn(globalCtx, this->focusedShrineGoronParam);
+ ActorCutscene_Start(this->cutscene, this->shrineGoron);
+ Camera_SetTargetActor(globalCtx->cameraPtrs[CAM_ID_MAIN], this->shrineGoron);
+ break;
+
+ default:
+ // Focus on the whole group for these lines
+ ActorCutscene_Start(this->cutscene, &this->actor);
+ Camera_SetTargetActor(globalCtx->cameraPtrs[CAM_ID_MAIN], this->shrineGoron);
+ break;
+ }
+ this->actionFunc = EnJg_GoronShrineTalk;
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ if (this->focusedShrineGoronParam == 10) {
+ this->actionFunc = EnJg_GoronShrineTalk;
+ } else {
+ ActorCutscene_Stop(0x7C);
+ }
+ }
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ }
+}
+
+/**
+ * You need to reach a certain point in the conversation when talking with the elder before
+ * he starts walking for the first time. This function specifically handles this scenario; the
+ * reason they used this instead of EnJg_Talk is seemingly to bypass EnJg_SetupWalk resetting
+ * the freeze timer.
+ *
+ * Additionally, when the elder has reached the end of his specified path, this function will
+ * set his speed to 0, causing him to walk in place.
+ */
+void EnJg_AlternateTalkOrWalkInPlace(EnJg* this, GlobalContext* globalCtx) {
+ u8 messageState = Message_GetState(&globalCtx->msgCtx);
+ s16 currentFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
+
+ if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) {
+ if (currentFrame == lastFrame) {
+ this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ }
+ } else if (this->animationIndex == EN_JG_ANIMATION_SURPRISE_LOOP) {
+ if ((messageState == 5) && (func_80147624(globalCtx))) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->flags &= ~FLAG_LOOKING_AT_PLAYER;
+ this->animationIndex = EN_JG_ANIMATION_WALK;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Walk;
+ }
+ } else if (this->animationIndex == EN_JG_ANIMATION_WALK) {
+ Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f);
+ EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, globalCtx);
+ }
+}
+
+void EnJg_Walk(EnJg* this, GlobalContext* globalCtx) {
+ s16 yRotation;
+ f32 distSQ;
+
+ if (this->path != NULL) {
+ yRotation = EnJg_GetWalkingYRotation(this->path, this->currentPoint, &this->actor.world.pos, &distSQ);
+ if (this->actor.bgCheckFlags & 8) {
+ yRotation = this->actor.wallYaw;
+ }
+
+ Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 4, 0x3E8, 1);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ if (EnJg_ReachedPoint(this, this->path, this->currentPoint)) {
+ if (this->currentPoint >= (this->path->count - 1)) {
+ // Force the elder to walk in place
+ this->animationIndex = EN_JG_ANIMATION_WALK;
+ this->actionFunc = EnJg_AlternateTalkOrWalkInPlace;
+ } else {
+ this->currentPoint++;
+ Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
+ }
+ } else {
+ Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
+ }
+ }
+
+ EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(this, globalCtx);
+}
+
+void EnJg_Talk(EnJg* this, GlobalContext* globalCtx) {
+ u8 messageState = Message_GetState(&globalCtx->msgCtx);
+ s16 currentFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
+ u16 temp;
+
+ if ((this->animationIndex == EN_JG_ANIMATION_SURPRISE_START) && (currentFrame == lastFrame)) {
+ this->animationIndex = EN_JG_ANIMATION_SURPRISE_LOOP;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ }
+
+ if ((messageState == 5) && (func_80147624(globalCtx))) {
+ temp = this->textId;
+ if ((temp == 0xDB4) || (temp == 0xDB5) || (temp == 0xDC4) || (temp == 0xDC6)) {
+ // There is nothing more to say after these lines, so end the current conversation.
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->flags &= ~FLAG_LOOKING_AT_PLAYER;
+ this->actionFunc = EnJg_SetupWalk;
+ return;
+ }
+
+ temp = this->textId;
+ if ((temp == 0xDBB) || (temp == 0xDBC)) {
+ if (!(gSaveContext.weekEventReg[24] & 0x80)) {
+ // The player hasn't talked to the Goron Child at least once, so they can't learn
+ // the Lullaby Intro. End the current conversation with the player.
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->flags &= ~FLAG_LOOKING_AT_PLAYER;
+ this->actionFunc = EnJg_SetupWalk;
+ } else if (((gSaveContext.weekEventReg[24] & 0x40)) ||
+ (CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO))) {
+ // The player already has the Lullaby or Lullaby Intro, so say "I'm counting on you"
+ this->textId = EnJg_GetNextTextId(this);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ this->actionFunc = EnJg_SetupTalk;
+ } else {
+ // To get to this point, the player *has* talked to the Goron Child, but doesn't
+ // already have the Lullaby or Lullaby Intro. End the current conversation and
+ // start the cutscene that teaches the Lullaby Intro.
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->flags &= ~FLAG_LOOKING_AT_PLAYER;
+ this->cutscene = EnJg_GetCutsceneForTeachingLullabyIntro(this);
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ this->actionFunc = EnJg_TeachLullabyIntro;
+ }
+ } else {
+ this->textId = EnJg_GetNextTextId(this);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ this->actionFunc = EnJg_SetupTalk;
+ }
+ }
+}
+
+void EnJg_SetupWalk(EnJg* this, GlobalContext* globalCtx) {
+ if (this->animationIndex != EN_JG_ANIMATION_WALK) {
+ this->animationIndex = EN_JG_ANIMATION_WALK;
+ this->freezeTimer = 1000;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Walk;
+ } else {
+ this->freezeTimer = 1000;
+ this->actionFunc = EnJg_Walk;
+ }
+}
+
+void EnJg_Freeze(EnJg* this, GlobalContext* globalCtx) {
+ s16 currentFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
+
+ if (this->action == EN_JG_ACTION_SPAWNING) {
+ this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW;
+ this->freezeTimer = 1000;
+ this->skelAnime.curFrame = lastFrame;
+ this->icePoly = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x,
+ this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x,
+ this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50);
+ this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_FrozenIdle;
+ } else if (this->animationIndex == EN_JG_ANIMATION_FROZEN_START) {
+ this->action = EN_JG_ACTION_FROZEN_OR_NON_FIRST_THAW;
+ if (currentFrame == lastFrame) {
+ this->freezeTimer = 1000;
+ this->icePoly = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x,
+ this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x,
+ this->actor.world.rot.y, this->actor.world.rot.z, 0xFF50);
+ this->animationIndex = EN_JG_ANIMATION_FROZEN_LOOP;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_FrozenIdle;
+ }
+ }
+}
+
+void EnJg_FrozenIdle(EnJg* this, GlobalContext* globalCtx) {
+ if (this->icePoly->update == NULL) {
+ this->icePoly = NULL;
+ if (this->animationIndex == EN_JG_ANIMATION_FROZEN_LOOP) {
+ if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
+ this->animationIndex = EN_JG_ANIMATION_IDLE;
+
+ // If you've never talked to the elder before, he stands
+ // around idle until you've talked to him at least once.
+ // Otherwise, he immediately begins walking after being
+ // thawed out.
+ if (this->textId == 0xDAC) {
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Idle;
+ } else {
+ this->freezeTimer = 1000;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Walk;
+ }
+ }
+ }
+ } else {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ Message_StartTextbox(globalCtx, 0x236, &this->actor); // The old Goron is frozen solid!
+ this->actionFunc = EnJg_EndFrozenInteraction;
+ } else if (this->actor.isTargeted) {
+ func_800B863C(&this->actor, globalCtx);
+ }
+ }
+}
+
+void EnJg_EndFrozenInteraction(EnJg* this, GlobalContext* globalCtx) {
+ if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx) != 0) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actionFunc = EnJg_FrozenIdle;
+ }
+}
+
+void EnJg_TeachLullabyIntro(EnJg* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
+ ActorCutscene_Start(this->cutscene, &this->actor);
+ this->actionFunc = EnJg_LullabyIntroCutsceneAction;
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ }
+}
+
+void EnJg_LullabyIntroCutsceneAction(EnJg* this, GlobalContext* globalCtx) {
+ s32 pad;
+
+ if (Cutscene_CheckActorAction(globalCtx, 470)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 470);
+
+ if (this->csAction != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->csAction = globalCtx->csCtx.actorActions[actionIndex]->action;
+
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_CUTSCENE_IDLE;
+ if (this->drum != NULL) {
+ Actor_MarkForDeath(this->drum);
+ this->drum = NULL;
+ }
+ break;
+
+ case 2:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_TAKING_OUT_DRUM;
+ break;
+
+ case 3:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_DRUM_IDLE;
+ break;
+
+ case 4:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_PLAYING_DRUM;
+ break;
+
+ case 5:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_THINKING;
+ break;
+
+ case 6:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_REMEMBERING;
+ break;
+
+ case 7:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_STRONG_REMEMBERING;
+ break;
+
+ case 8:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_DEPRESSED;
+ break;
+
+ case 9:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_CRADLE;
+ break;
+
+ default:
+ this->cutsceneAnimationIndex = EN_JG_ANIMATION_IDLE;
+ break;
+ }
+
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->cutsceneAnimationIndex);
+ }
+
+ if ((!(this->flags & FLAG_DRUM_SPAWNED)) &&
+ (((this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) &&
+ (Animation_OnFrame(&this->skelAnime, 14.0f)) && (this->action != EN_JG_ACTION_LULLABY_INTRO_CS)) ||
+ (((this->cutsceneAnimationIndex == EN_JG_ANIMATION_DRUM_IDLE) ||
+ (this->cutsceneAnimationIndex == EN_JG_ANIMATION_PLAYING_DRUM)) &&
+ (this->action == EN_JG_ACTION_LULLABY_INTRO_CS)))) {
+ this->flags |= FLAG_DRUM_SPAWNED;
+ this->drum = Actor_SpawnAsChildAndCutscene(
+ &globalCtx->actorCtx, globalCtx, ACTOR_OBJ_JG_GAKKI, this->actor.world.pos.x, this->actor.world.pos.y,
+ this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, this->actor.shape.rot.z,
+ this->actor.params, this->actor.cutscene, this->actor.unk20, NULL);
+ }
+
+ if (this->cutsceneAnimationIndex == EN_JG_ANIMATION_TAKING_OUT_DRUM) {
+ if (Animation_OnFrame(&this->skelAnime, 23.0f)) {
+ Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_WOOD_BOUND_S);
+ } else if (Animation_OnFrame(&this->skelAnime, 38.0f)) {
+ Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_OBJECT_SLIDE);
+ }
+ }
+ } else {
+ this->csAction = 99;
+ this->freezeTimer = 1000;
+ gSaveContext.weekEventReg[24] |= 0x40;
+ this->actionFunc = EnJg_Idle;
+ }
+}
+
+/**
+ * Returns the "next" text ID that the elder should use based on his current text ID.
+ * Note that the results here can be counterintuitive, because his current text ID can
+ * cause multiple text boxes to display in sequence; this function will return the text
+ * ID that starts the *next* sequence.
+ *
+ * Sequences generally seem to be tied to text IDs that should all share the same animation.
+ */
+s32 EnJg_GetNextTextId(EnJg* this) {
+ switch (this->textId) {
+ case 0xDAC: // What was I doing?
+ return 0xDAD; // I must hurry!
+
+ case 0xDAE: // Do you have business with the Elder?
+ return 0xDB0; // It's this cold snap
+
+ case 0xDB0: // It's this cold snap
+ return 0xDB3; // As Elder, I must do something
+
+ case 0xDB3: // As Elder, I must do something
+ return 0xDB4; // This is our problem (first)
+
+ case 0xDB6: // "Hunh???"
+ return 0xDB7; // You're Darmani!
+
+ case 0xDB7: // You're Darmani!
+ return 0xDBA; // I've been made a fool of!
+
+ case 0xDBA: // I've been made a fool of!
+ return 0xDBB; // If I can see past the illusion, you'll vanish
+
+ case 0xDBB: // If I can see past the illusion, you'll vanish
+ case 0xDBC: // Following me won't do you any good
+ return 0xDC6; // I am counting on you
+
+ case 0xDCB: // Welcome to spring
+ return 0xDCC; // We're holding the Goron Races
+
+ case 0xDDE: // Come back after entering the race
+ return 0xDDF; // My son is waiting for you
+
+ case 0xDDF: // My son is waiting for you
+ return 0xDE0; // Go beyond Twin Islands Cave
+
+ case 0xDCD: // I've been waiting impatiently for you
+ return 0xDCE; // I heard you sealed the blizzard
+
+ case 0xDCE: // I heard you sealed the blizzard
+ return 0xDCF; // Spring has come thanks to you
+
+ case 0xDCF: // Spring has come thanks to you
+ this->focusedShrineGoronParam = 3;
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+ this->actionFunc = EnJg_GoronShrineCheer;
+ return 0xDD0; // The greatest Goron hero of all?
+
+ case 0xDD0: // The greatest Goron hero of all?
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD1; // "Darmani!"
+
+ case 0xDD1: // "Darmani!"
+ switch (this->focusedShrineGoronParam) {
+ case 3:
+ this->focusedShrineGoronParam = 4;
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD2; // The immortal Goron?
+
+ case 4:
+ this->focusedShrineGoronParam = 5;
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD3; // The star we wish upon?
+
+ case 5:
+ this->focusedShrineGoronParam = 6;
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD4; // "Darmani, greatest of Gorons!"
+
+ default:
+ return 0xDD4; // "Darmani, greatest of Gorons!"
+ }
+ break;
+
+ case 0xDD2: // The immortal Goron?
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD1; // "Darmani!"
+
+ case 0xDD3: // The star we wish upon?
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD1; // "Darmani!"
+
+ case 0xDD4: // "Darmani, greatest of Gorons!"
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD5; // "Greatest of Gorons!"
+
+ case 0xDD5: // "Greatest of Gorons!"
+ this->focusedShrineGoronParam = 7;
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD6; // Darmani, greatest in the world!
+
+ case 0xDD6: // Darmani, greatest in the world!
+ EnJg_SetupGoronShrineCheer(this);
+ return 0xDD7; // "Greatest in the world!"
+
+ case 0xDD7: // "Greatest in the world!"
+ this->focusedShrineGoronParam = 10;
+ EnJg_SetupGoronShrineCheer(this);
+ this->flags &= ~FLAG_SHRINE_GORON_ARMS_RAISED;
+ return 0xDD8; // My son went to see the races
+
+ case 0xDD8: // My son went to see the races
+ return 0xDD9; // I yield to a younger one
+
+ case 0xDD9: // I yield to a younger one
+ return 0xDDA; // A Goron who takes care of all
+
+ case 0xDDA: // A Goron who takes care of all
+ return 0xDDB; // The chosen one, Darmani!
+
+ case 0xDDB: // The chosen one, Darmani!
+ return 0xDDC; // Everyone would accept you
+
+ case 0xDDC: // Everyone would accept you
+ gSaveContext.weekEventReg[77] |= 0x80;
+ return 0xDDD; // Think it over slowly
+
+ default:
+ return 0;
+ }
+}
+
+/**
+ * Returns the text ID of the first thing the elder should say when you talk to him
+ * under most circumstances. Some circumstances (like the very first time the player
+ * talks to him after he thaws) bypass this function.
+ */
+s32 EnJg_GetStartingConversationTextId(EnJg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (!EN_JG_IS_IN_GORON_SHRINE(&this->actor)) {
+ if (player->transformation == PLAYER_FORM_GORON) {
+ if ((gSaveContext.weekEventReg[24] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) ||
+ CHECK_QUEST_ITEM(QUEST_SONG_LULLABY_INTRO)) {
+ // The player has already talked as a Goron at least once.
+ return 0xDBC; // Following me won't do you any good
+ }
+
+ // The player has never talked as a Goron.
+ return 0xDB6; // "Hunh???"
+ }
+
+ if (gSaveContext.weekEventReg[24] & 0x20) {
+ // The player has already talked as a non-Goron at least once.
+ return 0xDB5; // This is our problem (repeat)
+ }
+
+ // The player has never talked as a non-Goron.
+ return 0xDAE; // Do you have business with the Elder?
+ }
+
+ if (player->transformation == PLAYER_FORM_GORON) {
+ if (gSaveContext.weekEventReg[77] & 0x80) {
+ // The player has heard the Goron Shrine cheer as a Goron at least once.
+ return 0xDDE; // Come back after entering the race
+ }
+
+ // The player has never heard the Goron Shrine cheer as a Goron.
+ return 0xDCD; // I've been waiting impatiently for you
+ }
+
+ // The player is talking to the elder in Goron Shrine as a non-Goron.
+ return 0xDCB; // Welcome to spring
+}
+
+void EnJg_SpawnBreath(EnJg* this, GlobalContext* globalCtx) {
+ s16 scale = (Rand_ZeroOne() * 20.0f) + 30.0f;
+
+ if (globalCtx->state.frames % 8 == 0) {
+ EffectSsIceSmoke_Spawn(globalCtx, &this->breathPos, &this->breathVelocity, &this->breathAccel, scale);
+ }
+}
+
+/**
+ * This function has two purposes:
+ * - If the player starts talking to the elder, this stops him from moving, makes him face
+ * towards the player, updates certain weekEventRegs, and calls EnJg_SetupTalk.
+ * - If the player is *not* talking to the elder, this decrements his freeze timer. If his
+ * freeze timer is 0 or negative, this function starts the process of freezing him before
+ * handing it off to EnJg_Freeze.
+ */
+void EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer(EnJg* this, GlobalContext* globalCtx) {
+ s16 currentFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->animationIndex].animation);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->flags |= FLAG_LOOKING_AT_PLAYER;
+ this->actor.speedXZ = 0.0f;
+
+ if (this->textId == 0xDAC) {
+ this->action = EN_JG_ACTION_FIRST_THAW;
+ } else if (this->textId == 0xDAE) {
+ gSaveContext.weekEventReg[24] |= 0x20;
+ } else if (this->textId == 0xDB6) {
+ gSaveContext.weekEventReg[24] |= 0x10;
+ }
+
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ this->actionFunc = EnJg_SetupTalk;
+ } else {
+ if ((this->actor.xzDistToPlayer < 100.0f) || (this->actor.isTargeted)) {
+ func_800B863C(&this->actor, globalCtx);
+ if (this->action == EN_JG_ACTION_FIRST_THAW) {
+ this->textId = EnJg_GetStartingConversationTextId(this, globalCtx);
+ }
+ }
+
+ this->freezeTimer--;
+ if ((this->freezeTimer <= 0) && (currentFrame == lastFrame)) {
+ this->animationIndex = EN_JG_ANIMATION_FROZEN_START;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ Audio_PlaySfxAtPos(&sSfxPos, NA_SE_EV_FREEZE_S);
+ this->actionFunc = EnJg_Freeze;
+ }
+ }
+}
+
+void EnJg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnJg* this = THIS;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGoronElderSkel, &gGoronElderIdleAnim, this->jointTable,
+ this->morphTable, GORON_ELDER_LIMB_MAX);
+
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ Actor_SetScale(&this->actor, 0.01f);
+
+ if (!EN_JG_IS_IN_GORON_SHRINE(thisx)) {
+ if ((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7) &&
+ (globalCtx->csCtx.currentCsIndex == 0)) {
+ // This is the elder that appears in the cutscene for learning the full Goron Lullaby.
+ this->animationIndex = EN_JG_ANIMATION_IDLE;
+ this->action = EN_JG_ACTION_LULLABY_INTRO_CS;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_LullabyIntroCutsceneAction;
+ } else {
+ // This is the elder that appears in Mountain Village or the Path to Goron Village in winter.
+ this->path = func_8013D648(globalCtx, EN_JG_GET_PATH(thisx), 0x3F);
+ this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
+ this->action = EN_JG_ACTION_SPAWNING;
+ this->freezeTimer = 1000;
+ this->textId = 0xDAC; // What was I doing?
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_Freeze;
+ }
+ } else {
+ // This is the elder that appears in Goron Shrine in spring.
+ this->animationIndex = EN_JG_ANIMATION_IDLE;
+ this->cutscene = this->actor.cutscene;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, this->animationIndex);
+ this->actionFunc = EnJg_GoronShrineIdle;
+ }
+}
+
+void EnJg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnJg* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnJg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnJg* this = THIS;
+
+ if ((this->actionFunc != EnJg_FrozenIdle) && (this->actionFunc != EnJg_EndFrozenInteraction)) {
+ EnJg_UpdateCollision(this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((this->action != EN_JG_ACTION_LULLABY_INTRO_CS) && (!EN_JG_IS_IN_GORON_SHRINE(&this->actor))) {
+ EnJg_SpawnBreath(this, globalCtx);
+ }
+
+ func_800E9250(globalCtx, &this->actor, &this->unusedRotation1, &this->unusedRotation2, this->actor.focus.pos);
+ }
+ this->actionFunc(this, globalCtx);
+}
+
+s32 EnJg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnJg* this = THIS;
+
+ if (limbIndex == GORON_ELDER_LIMB_ROOT) {
+ if (this->flags & FLAG_LOOKING_AT_PLAYER) {
+ Math_SmoothStepToS(&this->rootRotationWhenTalking, this->actor.yawTowardsPlayer - this->actor.shape.rot.y,
+ 5, 0x1000, 0x100);
+ Matrix_RotateY(this->rootRotationWhenTalking, MTXMODE_APPLY);
+ } else {
+ Math_SmoothStepToS(&this->rootRotationWhenTalking, 0, 5, 0x1000, 0x100);
+ Matrix_RotateY(this->rootRotationWhenTalking, MTXMODE_APPLY);
+ }
+ }
+
+ return false;
+}
+
+void EnJg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnJg* this = THIS;
+
+ if (limbIndex == GORON_ELDER_LIMB_HEAD) {
+ Matrix_MultiplyVector3fByState(&sFocusOffset, &this->actor.focus.pos);
+ }
+
+ if (limbIndex == GORON_ELDER_LIMB_LOWER_LIP) {
+ Matrix_MultiplyVector3fByState(&sBreathPosOffset, &this->breathPos);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_MultiplyVector3fByState(&sBreathVelOffset, &this->breathVelocity);
+ Matrix_MultiplyVector3fByState(&sBreathAccelOffset, &this->breathAccel);
+ }
+}
+
+void EnJg_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnJg* this = THIS;
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnJg_OverrideLimbDraw, EnJg_PostLimbDraw, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Jg/z_en_jg.h b/src/overlays/actors/ovl_En_Jg/z_en_jg.h
index 3a860feb2b..67ba1d6389 100644
--- a/src/overlays/actors/ovl_En_Jg/z_en_jg.h
+++ b/src/overlays/actors/ovl_En_Jg/z_en_jg.h
@@ -2,16 +2,42 @@
#define Z_EN_JG_H
#include "global.h"
+#include "objects/object_jg/object_jg.h"
+
+#define EN_JG_IS_IN_GORON_SHRINE(thisx) ((thisx)->params & 0x1)
+#define EN_JG_GET_PATH(thisx) (((thisx)->params & 0xFC00) >> 10)
struct EnJg;
typedef void (*EnJgActionFunc)(struct EnJg*, GlobalContext*);
typedef struct EnJg {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x98];
- /* 0x01DC */ EnJgActionFunc actionFunc;
- /* 0x01E0 */ char unk_1E0[0x1F4];
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ Actor* shrineGoron;
+ /* 0x148 */ Actor* icePoly;
+ /* 0x14C */ ColliderCylinder collider;
+ /* 0x198 */ SkelAnime skelAnime;
+ /* 0x1DC */ EnJgActionFunc actionFunc;
+ /* 0x1E0 */ Path* path;
+ /* 0x1E4 */ s32 currentPoint;
+ /* 0x1E8 */ Actor* drum;
+ /* 0x1EC */ Vec3s unusedRotation1; // probably meant to be a head rotation to look at the player
+ /* 0x1F2 */ Vec3s unusedRotation2; // probably meant to be a body rotation to look at the player
+ /* 0x1F8 */ Vec3s jointTable[GORON_ELDER_LIMB_MAX];
+ /* 0x2CA */ Vec3s morphTable[GORON_ELDER_LIMB_MAX];
+ /* 0x39C */ s16 rootRotationWhenTalking;
+ /* 0x39E */ s16 animationIndex;
+ /* 0x3A0 */ s16 action;
+ /* 0x3A2 */ s16 freezeTimer;
+ /* 0x3A4 */ Vec3f breathPos;
+ /* 0x3B0 */ Vec3f breathVelocity;
+ /* 0x3BC */ Vec3f breathAccel;
+ /* 0x3C8 */ s16 cutscene;
+ /* 0x3CA */ u8 cutsceneAnimationIndex;
+ /* 0x3CB */ u8 csAction;
+ /* 0x3CC */ u16 flags;
+ /* 0x3CE */ u16 textId;
+ /* 0x3D0 */ u8 focusedShrineGoronParam;
} EnJg; // size = 0x3D4
extern const ActorInit En_Jg_InitVars;
diff --git a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
index 46f9ec21d0..8218d7c632 100644
--- a/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
+++ b/src/overlays/actors/ovl_En_Jgame_Tsn/z_en_jgame_tsn.c
@@ -6,7 +6,7 @@
#include "z_en_jgame_tsn.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnJgameTsn*)thisx)
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 ecd2fafa19..15426db829 100644
--- a/src/overlays/actors/ovl_En_Js/z_en_js.c
+++ b/src/overlays/actors/ovl_En_Js/z_en_js.c
@@ -6,7 +6,7 @@
#include "z_en_js.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnJs*)thisx)
diff --git a/src/overlays/actors/ovl_En_Jso/z_en_jso.c b/src/overlays/actors/ovl_En_Jso/z_en_jso.c
index e20a4de3ae..3c7e5ce75a 100644
--- a/src/overlays/actors/ovl_En_Jso/z_en_jso.c
+++ b/src/overlays/actors/ovl_En_Jso/z_en_jso.c
@@ -6,7 +6,7 @@
#include "z_en_jso.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnJso*)thisx)
diff --git a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c
index ad00e6d872..8d29b93834 100644
--- a/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c
+++ b/src/overlays/actors/ovl_En_Jso2/z_en_jso2.c
@@ -6,7 +6,7 @@
#include "z_en_jso2.h"
-#define FLAGS 0x80100035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_100000 | ACTOR_FLAG_80000000)
#define THIS ((EnJso2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
index eef75acf9b..721e8c1a4d 100644
--- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
+++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c
@@ -6,7 +6,7 @@
#include "z_en_kaizoku.h"
-#define FLAGS 0x00100015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_100000)
#define THIS ((EnKaizoku*)thisx)
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 0ccec50154..f1d1737e45 100644
--- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
+++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c
@@ -5,8 +5,9 @@
*/
#include "z_en_kakasi.h"
+#include "objects/object_ka/object_ka.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnKakasi*)thisx)
@@ -45,7 +46,8 @@ void EnKakasi_SetupSongTeach(EnKakasi* this, GlobalContext* globalCtx);
void EnKakasi_SetupDialogue(EnKakasi* this);
-void EnKakasi_LimbDraw(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, struct Actor* actor);
+void EnKakasi_PostLimbDraw(struct GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot,
+ struct Actor* thisx);
static ColliderCylinderInit D_80971D80 = {
{
@@ -124,22 +126,16 @@ typedef enum {
/* 0x8 */ ENKAKASI_ANIM_IDLE, // slow stretching wiggle, ends in regular position
} EnKakasi_Animations;
-extern AnimationHeader D_06007444;
-extern AnimationHeader D_0600686C;
-extern AnimationHeader D_060081A4;
-extern AnimationHeader D_06007B90;
-extern AnimationHeader D_060071EC;
-extern AnimationHeader D_06007444;
-extern AnimationHeader D_0600686C;
-extern AnimationHeader D_060081A4;
-extern AnimationHeader D_06000214;
-
static AnimationHeader* kakasiAnimations[] = {
- &D_06007444, &D_0600686C, &D_060081A4, &D_06007B90, &D_060071EC, &D_06007444, &D_0600686C, &D_060081A4, &D_06000214,
+ &object_ka_Anim_007444, &object_ka_Anim_00686C, &object_ka_Anim_0081A4,
+ &object_ka_Anim_007B90, &object_ka_Anim_0071EC, &object_ka_Anim_007444,
+ &object_ka_Anim_00686C, &object_ka_Anim_0081A4, &object_ka_Anim_000214,
};
-static u8 sAnimModes[] = { ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE,
- ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE };
+static u8 sAnimModes[] = {
+ ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE,
+ ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE,
+};
void EnKakasi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnKakasi* this = THIS;
@@ -147,15 +143,13 @@ void EnKakasi_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyCylinder(globalCtx, &this->collider);
}
-extern FlexSkeletonHeader D_060065B0;
-
void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) {
EnKakasi* this = THIS;
s32 tempCutscene;
s32 i;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &D_80971D80);
- SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_060065B0, &D_06000214, 0, 0, 0);
+ SkelAnime_InitFlex(globalCtx, &this->skelanime, &object_ka_Skel_0065B0, &object_ka_Anim_000214, 0, 0, 0);
this->songSummonDist = GET_KAKASI_SUMMON_DISTANCE(this) * 20.0f;
if (this->songSummonDist < 40.0f) {
@@ -172,7 +166,7 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) {
this->aboveGroundStatus = GET_KAKASI_ABOVE_GROUND(this);
this->actor.world.rot.x = 0;
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
Actor_SetScale(&this->actor, 0.01f);
@@ -185,14 +179,14 @@ void EnKakasi_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->aboveGroundStatus) {
- if (gSaveContext.weekEventReg[79] & 0x8) {
+ if (gSaveContext.weekEventReg[79] & 8) {
this->aboveGroundStatus = ENKAKASI_ABOVE_GROUND_TYPE;
this->songSummonDist = 80.0f;
EnKakasi_SetupIdleUnderground(this);
} else {
Actor_SetFocus(&this->actor, 60.0f);
this->unkFunc = EnKakasi_8096F88C;
- if (gSaveContext.weekEventReg[83] & 0x1) {
+ if (gSaveContext.weekEventReg[83] & 1) {
EnKakasi_InitTimeSkipDialogue(this);
} else {
EnKakasi_SetupIdleStanding(this);
@@ -265,7 +259,7 @@ void EnKakasi_CheckPlayerPosition(EnKakasi* this, GlobalContext* globalCtx) {
* something to do with cutscene camera?
*/
void func_8096FAAC(EnKakasi* this, GlobalContext* globalCtx) {
- if (this->cutsceneCamId != MAIN_CAM) {
+ if (this->cutsceneCamId != CAM_ID_MAIN) {
Math_ApproachF(&this->unk214.x, this->unk238.x, 0.4f, 4.0f);
Math_ApproachF(&this->unk214.y, this->unk238.y, 0.4f, 4.0f);
Math_ApproachF(&this->unk214.z, this->unk238.z, 0.4f, 4.0f);
@@ -277,7 +271,7 @@ void func_8096FAAC(EnKakasi* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->unk20C, this->unk210, 0.3f, 10.0f);
Play_CameraSetAtEye(globalCtx, this->cutsceneCamId, &this->unk220, &this->unk214);
- func_80169940(globalCtx, this->cutsceneCamId, this->unk20C);
+ Play_CameraSetFov(globalCtx, this->cutsceneCamId, this->unk20C);
}
}
@@ -317,16 +311,16 @@ void EnKakasi_TimeSkipDialogue(EnKakasi* this, GlobalContext* globalCtx) {
if (this->actor.textId == 0) {
// dialogue after skipped time 'did you feel that? went by in an instant'
this->actor.textId = 0x1653;
- gSaveContext.weekEventReg[0x53] &= (u8)~1;
+ gSaveContext.weekEventReg[83] &= (u8)~1;
this->unkMsgState1AC = 5;
player->stateFlags1 |= 0x20;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
}
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
player->stateFlags1 &= ~0x20;
this->unkState196 = 2;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actionFunc = EnKakasi_RegularDialogue;
} else {
func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, -1);
@@ -555,8 +549,8 @@ void EnKakasi_RegularDialogue(EnKakasi* this, GlobalContext* globalCtx) {
void EnKakasi_SetupSongTeach(EnKakasi* this, GlobalContext* globalCtx) {
this->actor.textId = 0x1646;
- func_801518B0(globalCtx, this->actor.textId, &this->actor);
- this->cutsceneCamId = MAIN_CAM;
+ Message_StartTextbox(globalCtx, this->actor.textId, &this->actor);
+ this->cutsceneCamId = CAM_ID_MAIN;
this->unk20C = 0.0f;
this->unk210 = 60.0f;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_TWIRL);
@@ -627,21 +621,21 @@ void EnKakasi_TeachingSong(EnKakasi* this, GlobalContext* globalCtx) {
func_8096FAAC(this, globalCtx);
func_8096FBB8(this, globalCtx);
- if (globalCtx->msgCtx.unk1202A == 4) { // song failed
+ if (globalCtx->msgCtx.ocarinaMode == 4) { // song failed
this->unk190 = 0;
this->unkCounter1A4 = 0;
ActorCutscene_Stop(this->actorCutscenes[0]);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_YASE_DEAD);
if (this) {}
this->unkState196 = 2;
- this->cutsceneCamId = MAIN_CAM;
+ this->cutsceneCamId = CAM_ID_MAIN;
this->actor.textId = 0x1647;
this->unkState1A8 = 2;
this->unkMsgState1AC = 5;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_ARMS_CROSSED_ROCKING);
this->actionFunc = EnKakasi_RegularDialogue;
- } else if (globalCtx->msgCtx.unk1202A == 3) { // song success
+ } else if (globalCtx->msgCtx.ocarinaMode == 3) { // song success
this->postTeachTimer = 30;
this->skelanime.playSpeed = 2.0f;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR);
@@ -664,11 +658,11 @@ void EnKakasi_PostSongLearnTwirl(EnKakasi* this, GlobalContext* globalCtx) {
void EnKakasi_SetupPostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(this->actorCutscenes[0]);
- globalCtx->msgCtx.unk1202A = 4;
+ globalCtx->msgCtx.ocarinaMode = 4;
this->unk190 = 0;
this->unkCounter1A4 = 0;
EnKakasi_SetAnimation(this, ENKAKASI_ANIM_HOPPING_REGULAR);
- this->cutsceneCamId = MAIN_CAM;
+ this->cutsceneCamId = CAM_ID_MAIN;
this->unkMsgState1AC = 5;
this->unkState1A8 = 1;
this->actionFunc = EnKakasi_PostSongLearnDialogue;
@@ -688,7 +682,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) {
func_801477B4(globalCtx);
func_800B7298(globalCtx, &this->actor, 0x56);
this->actor.textId = 0x1648;
- func_801518B0(globalCtx, (this->actor.textId), &this->actor);
+ Message_StartTextbox(globalCtx, (this->actor.textId), &this->actor);
this->unkState1A8 = 0;
this->unk190 = 1;
}
@@ -726,7 +720,7 @@ void EnKakasi_PostSongLearnDialogue(EnKakasi* this, GlobalContext* globalCtx) {
this->unkState1A8 = 1;
}
- if (this->cutsceneCamId != MAIN_CAM) {
+ if (this->cutsceneCamId != CAM_ID_MAIN) {
this->unk22C.y = this->actor.home.pos.y + 50.0f;
EnKakasi_CheckPlayerPosition(this, globalCtx);
this->unk238.x = D_80971FA0[this->unk190].x;
@@ -953,7 +947,7 @@ void EnKakasi_DancingNightAway(EnKakasi* this, GlobalContext* globalCtx) {
gSaveContext.time = CLOCK_TIME(18, 0);
gSaveContext.respawnFlag = -8;
}
- gSaveContext.weekEventReg[0x53] |= 1;
+ gSaveContext.weekEventReg[83] |= 1;
this->unk190 = 0;
this->actionFunc = EnKakasi_DoNothing;
}
@@ -980,7 +974,7 @@ void EnKakasi_DiggingAway(EnKakasi* this, GlobalContext* globalCtx) {
Vec3f tempunk238;
Vec3f tempWorldPos;
- if (this->cutsceneCamId != MAIN_CAM) {
+ if (this->cutsceneCamId != CAM_ID_MAIN) {
this->unk22C.y = this->actor.home.pos.y + 50.0f;
this->unk238.x = D_80972030.x;
this->unk238.y = D_80972030.y;
@@ -1034,16 +1028,16 @@ void EnKakasi_DiggingAway(EnKakasi* this, GlobalContext* globalCtx) {
void EnKakasi_SetupIdleUnderground(EnKakasi* this) {
this->actor.shape.yOffset = -7000.0;
this->actor.draw = NULL;
- this->actor.flags |= 0x8000000;
+ this->actor.flags |= ACTOR_FLAG_8000000;
this->unkState196 = 5;
this->actionFunc = EnKakasi_IdleUnderground;
}
void EnKakasi_IdleUnderground(EnKakasi* this, GlobalContext* globalCtx) {
- if ((gSaveContext.weekEventReg[79] & 0x8) && this->actor.xzDistToPlayer < this->songSummonDist &&
- (BREG(1) != 0 || globalCtx->msgCtx.unk1202A == 0xD)) {
- this->actor.flags &= ~0x8000000;
- globalCtx->msgCtx.unk1202A = 4;
+ if ((gSaveContext.weekEventReg[79] & 8) && this->actor.xzDistToPlayer < this->songSummonDist &&
+ (BREG(1) != 0 || globalCtx->msgCtx.ocarinaMode == 0xD)) {
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
+ globalCtx->msgCtx.ocarinaMode = 4;
this->actionFunc = EnKakasi_SetupRiseOutOfGround;
}
}
@@ -1133,7 +1127,7 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->unk1BC.x != 0.0f || this->unk1BC.z != 0.0f) {
Math_Vec3f_Copy(&this->actor.focus.pos, &this->unk1BC);
this->actor.focus.pos.y += 10.0f;
- if (this->cutsceneCamId == MAIN_CAM) {
+ if (this->cutsceneCamId == CAM_ID_MAIN) {
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.world.rot);
} else {
Math_Vec3s_Copy(&this->actor.focus.rot, &this->actor.home.rot);
@@ -1153,8 +1147,8 @@ void EnKakasi_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-void EnKakasi_LimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* actor) {
- EnKakasi* this = (EnKakasi*)actor;
+void EnKakasi_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnKakasi* this = THIS;
if (limbIndex == 4) {
Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->unk1BC);
@@ -1165,5 +1159,5 @@ void EnKakasi_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnKakasi* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount,
- NULL, EnKakasi_LimbDraw, &this->actor);
+ NULL, EnKakasi_PostLimbDraw, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Kame/z_en_kame.c b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
index 86c9242989..1ec39194de 100644
--- a/src/overlays/actors/ovl_En_Kame/z_en_kame.c
+++ b/src/overlays/actors/ovl_En_Kame/z_en_kame.c
@@ -7,7 +7,7 @@
#include "z_en_kame.h"
#include "objects/object_tl/object_tl.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnKame*)thisx)
@@ -169,7 +169,7 @@ void func_80AD6F9C(EnKame* this) {
this->unk_2B0 = 1.0f;
this->collider.base.colType = COLTYPE_HIT3;
this->unk_2A2 = 80;
- this->actor.flags &= ~0x400;
+ this->actor.flags &= ~ACTOR_FLAG_400;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
}
@@ -179,7 +179,7 @@ void func_80AD7018(EnKame* this, GlobalContext* globalCtx) {
this->collider.base.colType = COLTYPE_HIT6;
this->unk_2B0 = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2C8, 10, 2, 0.3f, 0.2f);
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -320,7 +320,7 @@ void func_80AD76CC(EnKame* this) {
Math_Vec3f_Copy(&this->unk_2BC, &this->actor.home.pos);
this->unk_29E = 0;
}
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->actionFunc = func_80AD7798;
}
@@ -388,7 +388,7 @@ void func_80AD7948(EnKame* this, GlobalContext* globalCtx) {
this->unk_2AC -= 0.1f;
this->collider.base.atFlags &= ~AT_ON;
if (this->unk_2AC < 0.5f) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
func_80AD7B18(this);
}
} else {
@@ -438,7 +438,7 @@ void func_80AD7C54(EnKame* this) {
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.atFlags &= ~AT_ON;
this->collider.base.atFlags &= ~(AT_BOUNCED | AT_HIT);
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.shape.rot.z = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_REVERSE);
this->actionFunc = func_80AD7D40;
@@ -555,8 +555,8 @@ void func_80AD8148(EnKame* this, GlobalContext* globalCtx) {
}
}
this->actor.bgCheckFlags &= ~0x1;
- this->actor.flags &= ~0x1;
- this->actor.flags |= 0x10;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PAMET_DEAD);
this->unk_29E = 0;
this->actionFunc = func_80AD825C;
@@ -683,7 +683,7 @@ void func_80AD84C0(EnKame* this, GlobalContext* globalCtx) {
}
}
- if ((globalCtx->actorCtx.unk2 != 0) && (this->actor.xyzDistToPlayerSq < 40000.0f) &&
+ if ((globalCtx->actorCtx.unk2 != 0) && (this->actor.xyzDistToPlayerSq < SQ(200.0f)) &&
(this->collider.base.acFlags & AC_ON)) {
func_80AD7018(this, globalCtx);
func_80AD7C54(this);
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 fdf1c3e48d..e3edc73116 100644
--- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
+++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
@@ -8,7 +8,7 @@
#include "objects/object_kanban/object_kanban.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnKanban*)thisx)
@@ -146,7 +146,7 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
if (this->actor.params != ENKANBAN_PIECE) {
this->actor.targetMode = 0;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_19A = Rand_ZeroFloat(1.9f);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -230,7 +230,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->zTargetTimer == 1) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
if (this->partFlags == 0xFFFF) {
@@ -381,8 +381,8 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx) {
piece->direction = -1;
}
piece->airTimer = 100;
- piece->actor.flags &= ~1;
- piece->actor.flags |= 0x2000000;
+ piece->actor.flags &= ~ACTOR_FLAG_1;
+ piece->actor.flags |= ACTOR_FLAG_2000000;
this->cutMarkTimer = 5;
Actor_PlaySfxAtPos(&this->actor, NA_SE_IT_SWORD_STRIKE);
}
@@ -397,7 +397,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->actor.xzDistToPlayer > 500.0f) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->partFlags = 0xFFFF;
}
@@ -825,13 +825,13 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx) {
switch (this->ocarinaFlag) {
case 0:
- if (globalCtx->msgCtx.unk1202A == 1) {
+ if (globalCtx->msgCtx.ocarinaMode == 1) {
this->ocarinaFlag = 1;
}
break;
case 1:
- if ((globalCtx->msgCtx.unk1202A == 4) && (globalCtx->msgCtx.unk1202E == 7)) {
+ if ((globalCtx->msgCtx.ocarinaMode == 4) && (globalCtx->msgCtx.unk1202E == 7)) {
this->actionState = ENKANBAN_REPAIR;
this->bounceX = 1;
play_sound(NA_SE_SY_TRE_BOX_APPEAR);
@@ -875,7 +875,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx) {
((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 |= 1;
+ signpost->actor.flags |= ACTOR_FLAG_1;
Actor_MarkForDeath(&this->actor);
return;
}
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 dd2233e4c7..f6b1f7b402 100644
--- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c
+++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c
@@ -5,8 +5,10 @@
*/
#include "z_en_karebaba.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_dekubaba/object_dekubaba.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnKarebaba*)thisx)
@@ -15,19 +17,28 @@ void EnKarebaba_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx);
void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_808F155C(EnKarebaba* this);
void func_808F15B0(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F1648(EnKarebaba* this);
void func_808F169C(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F16FC(EnKarebaba* this);
void func_808F1778(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F1878(EnKarebaba* this);
void func_808F190C(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F1A3C(EnKarebaba* this);
void func_808F1A58(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F1BF8(EnKarebaba* this);
void func_808F1C84(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F1FAC(EnKarebaba* this);
void func_808F200C(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F20FC(EnKarebaba* this, GlobalContext* globalCtx);
void func_808F21A4(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F220C(EnKarebaba* this);
void func_808F228C(EnKarebaba* this, GlobalContext* globalCtx);
+void func_808F238C(EnKarebaba* this);
void func_808F241C(EnKarebaba* this, GlobalContext* globalCtx);
void func_808F254C(EnKarebaba* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Karebaba_InitVars = {
ACTOR_EN_KAREBABA,
ACTORCAT_ENEMY,
@@ -40,25 +51,49 @@ const ActorInit En_Karebaba_InitVars = {
(ActorFunc)EnKarebaba_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_808F2DA0 = {
- { COLTYPE_HARD, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_HARD,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 7, 25, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_808F2DCC = {
- { COLTYPE_HARD, AT_ON | AT_TYPE_ENEMY, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x04 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_WOOD, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_HARD,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x00, 0x04 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_WOOD,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 4, 25, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit D_808F2DF8 = { 1, 15, 80, MASS_HEAVY };
+static CollisionCheckInfoInit sColChkInfoInit = { 1, 15, 80, MASS_HEAVY };
-// static DamageTable sDamageTable = {
-static DamageTable D_808F2E00 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(3, 0x0),
/* Horse trample */ DMG_ENTRY(1, 0x0),
@@ -93,79 +128,614 @@ static DamageTable D_808F2E00 = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_808F2E20[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_CONTINUE),
ICHAIN_U8(targetMode, 1, ICHAIN_STOP),
};
-#endif
+Color_RGBA8 D_808F2E28 = { 0, 0, 0, 0 };
-extern ColliderCylinderInit D_808F2DA0;
-extern ColliderCylinderInit D_808F2DCC;
-extern CollisionCheckInfoInit D_808F2DF8;
-extern DamageTable D_808F2E00;
-extern InitChainEntry D_808F2E20[];
+Gfx* D_808F2E2C[] = { object_dekubaba_DL_001330, object_dekubaba_DL_001628, object_dekubaba_DL_001828 };
-extern UNK_TYPE D_060002B8;
-extern UNK_TYPE D_06003070;
+void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnKarebaba* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/EnKarebaba_Init.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 22.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_dekubaba_Skel_002A40, &object_dekubaba_Anim_0002B8,
+ this->jointTable, this->morphTable, 8);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/EnKarebaba_Destroy.s")
+ Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit1);
+ Collider_UpdateCylinder(&this->actor, &this->collider2);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit2);
+ Collider_UpdateCylinder(&this->actor, &this->collider1);
+ CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1374.s")
+ this->unk_22C = NULL;
+ if (this->actor.params == ENKAREBABA_2) {
+ this->actor.hintId = 2;
+ } else {
+ this->actor.hintId = 9;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F13FC.s")
+ if (this->actor.params == ENKAREBABA_0) {
+ func_808F155C(this);
+ } else {
+ func_808F1648(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F152C.s")
+void EnKarebaba_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnKarebaba* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F155C.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider2);
+ Collider_DestroyCylinder(globalCtx, &this->collider1);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F15B0.s")
+void func_808F1374(EnKarebaba* this, GlobalContext* globalCtx) {
+ s32 phi_a3;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1648.s")
+ if (this->unk_1EC == 10) {
+ this->unk_1EC = 0;
+ this->unk_1F0 = 0.0f;
+ if (this->actor.params == ENKAREBABA_2) {
+ phi_a3 = 1;
+ } else {
+ phi_a3 = 4;
+ }
+ Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_1FC, phi_a3, 4, 0.3f, 0.2f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F169C.s")
+void func_808F13FC(EnKarebaba* this, GlobalContext* globalCtx) {
+ if (this->actor.colChkInfo.damageEffect == 2) {
+ this->unk_1EC = 0;
+ this->unk_1F4 = 0.75f;
+ this->unk_1F0 = 3.0f;
+ } else if (this->actor.colChkInfo.damageEffect == 4) {
+ this->unk_1F4 = 0.75f;
+ this->unk_1EC = 20;
+ this->unk_1F0 = 3.0f;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->collider2.info.bumper.hitPos.x,
+ this->collider2.info.bumper.hitPos.y, this->collider2.info.bumper.hitPos.z, 0, 0, 0,
+ CLEAR_TAG_SMALL_LIGHT_RAYS);
+ } else if (this->actor.colChkInfo.damageEffect == 3) {
+ this->unk_1EC = 10;
+ this->unk_1F4 = 0.75f;
+ this->unk_1F0 = 1.0f;
+ this->unk_1F8 = 1.125f;
+ } else if (this->actor.colChkInfo.damageEffect == 5) {
+ this->unk_1EC = 31;
+ this->unk_1F4 = 0.75f;
+ this->unk_1F0 = 3.0f;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F16FC.s")
+void func_808F152C(EnKarebaba* this) {
+ this->collider2.dim.radius = 7;
+ this->collider2.dim.height = 25;
+ this->collider2.base.colType = COLTYPE_HARD;
+ this->collider2.base.acFlags |= AC_HARD;
+ this->collider1.dim.height = 25;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1778.s")
+void func_808F155C(EnKarebaba* this) {
+ Actor_SetScale(&this->actor, 0.0f);
+ this->actor.shape.rot.x = -0x4000;
+ this->unk_1EE = 0;
+ this->actor.world.pos.y = this->actor.home.pos.y + 14.0f;
+ this->actionFunc = func_808F15B0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1878.s")
+void func_808F15B0(EnKarebaba* this, GlobalContext* globalCtx) {
+ f32 sp1C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F190C.s")
+ this->unk_1EE++;
+ sp1C = this->unk_1EE * 0.05f;
+ Actor_SetScale(&this->actor, 0.005f * sp1C);
+ this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C);
+ if (this->unk_1EE == 20) {
+ func_808F1648(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1A3C.s")
+void func_808F1648(EnKarebaba* this) {
+ Actor_SetScale(&this->actor, 0.005f);
+ this->actor.shape.rot.x = -0x4000;
+ this->actor.world.pos.y = this->actor.home.pos.y + 14.0f;
+ this->actionFunc = func_808F169C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1A58.s")
+void func_808F169C(EnKarebaba* this, GlobalContext* globalCtx) {
+ if ((this->actor.xzDistToPlayer < 200.0f) && (fabsf(this->actor.playerHeightRel) < 30.0f)) {
+ func_808F16FC(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1BF8.s")
+void func_808F16FC(EnKarebaba* this) {
+ Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 4.0f, 0.0f,
+ Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), 0, -3.0f);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_WAKEUP);
+ this->actionFunc = func_808F1778;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1C84.s")
+void func_808F1778(EnKarebaba* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F1FAC.s")
+ if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) {
+ func_808F1878(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F200C.s")
+ this->actor.scale.z = this->actor.scale.x;
+ this->actor.scale.y = this->actor.scale.x;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F20FC.s")
+ if ((this->actor.params == ENKAREBABA_1) &&
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 5.0f)) {
+ func_808F1878(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F21A4.s")
+ this->actor.shape.rot.y += 0x1999;
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F220C.s")
+void func_808F1878(EnKarebaba* this) {
+ if (this->actionFunc != func_808F1A58) {
+ Actor_SetScale(&this->actor, 0.01f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F228C.s")
+ this->collider2.base.colType = COLTYPE_HIT6;
+ this->collider2.base.acFlags &= ~AC_HARD;
+ this->collider2.dim.radius = 15;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F238C.s")
+ if (this->actor.params == ENKAREBABA_1) {
+ this->collider2.dim.height = 80;
+ this->collider1.dim.height = 80;
+ } else {
+ this->collider2.dim.height = 35;
+ this->collider1.dim.height = 35;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F241C.s")
+ this->unk_1EE = 40;
+ this->actionFunc = func_808F190C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F24F8.s")
+void func_808F190C(EnKarebaba* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F254C.s")
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/EnKarebaba_Update.s")
+ if (this->unk_1EE != 0) {
+ this->unk_1EE--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/func_808F280C.s")
+ if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Karebaba/EnKarebaba_Draw.s")
+ if (this->collider2.base.acFlags & AC_HIT) {
+ func_808F13FC(this, globalCtx);
+ if (this->actor.params == ENKAREBABA_1) {
+ func_808F1BF8(this);
+ } else {
+ func_808F1FAC(this);
+ }
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ } else if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 240.0f) {
+ func_808F220C(this);
+ } else if ((this->unk_1EE == 0) && (this->actor.params == ENKAREBABA_1)) {
+ func_808F1A3C(this);
+ }
+}
+
+void func_808F1A3C(EnKarebaba* this) {
+ this->unk_1EE = 40;
+ this->actionFunc = func_808F1A58;
+}
+
+void func_808F1A58(EnKarebaba* this, GlobalContext* globalCtx) {
+ s32 phi_v0;
+ f32 sp28;
+
+ if (this->unk_1EE != 0) {
+ this->unk_1EE--;
+ }
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_MIZUBABA1_MOUTH);
+ }
+
+ phi_v0 = 20 - this->unk_1EE;
+ phi_v0 = 20 - ABS_ALT(phi_v0);
+ if (phi_v0 > 10) {
+ phi_v0 = 10;
+ }
+
+ this->collider1.dim.radius = sCylinderInit2.dim.radius + (phi_v0 * 2);
+ this->actor.shape.rot.x = 0xC000 - (phi_v0 << 8);
+ this->actor.shape.rot.y += phi_v0 * 0x2C0;
+ this->actor.world.pos.y = (Math_SinS(this->actor.shape.rot.x) * -60.0f) + this->actor.home.pos.y;
+
+ sp28 = Math_CosS(this->actor.shape.rot.x) * 60.0f;
+ this->actor.world.pos.x = (Math_SinS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.x;
+ this->actor.world.pos.z = (Math_CosS(this->actor.shape.rot.y) * sp28) + this->actor.home.pos.z;
+
+ if (this->collider2.base.acFlags & AC_HIT) {
+ func_808F13FC(this, globalCtx);
+ func_808F1BF8(this);
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ } else if (this->unk_1EE == 0) {
+ func_808F1878(this);
+ }
+}
+
+void func_808F1BF8(EnKarebaba* this) {
+ if (this->unk_1EC != 10) {
+ this->unk_1EE = 0;
+ this->actor.gravity = -0.8f;
+ this->actor.velocity.y = 4.0f;
+ this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
+ this->actor.speedXZ = 3.0f;
+ } else {
+ this->unk_1EE = 3;
+ }
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD);
+ this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
+ this->actionFunc = func_808F1C84;
+}
+
+void func_808F1C84(EnKarebaba* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f sp78;
+ f32 temp_f20;
+ f32 temp_f22;
+ f32 temp_f24;
+
+ if (this->unk_1EC == 10) {
+ this->unk_1EE--;
+ if (this->unk_1EE == 0) {
+ this->actor.gravity = -0.8f;
+ this->actor.speedXZ = 3.0f;
+ this->actor.velocity.y = 4.0f;
+ this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
+ func_808F1374(this, globalCtx);
+ }
+ } else {
+ Math_StepToF(&this->actor.speedXZ, 0.0f, 0.1f);
+
+ if (this->unk_1EE == 0) {
+ Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4800, 0x71C);
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
+
+ if ((this->actor.scale.x > 0.005f) && ((this->actor.bgCheckFlags & 2) || (this->actor.bgCheckFlags & 8))) {
+ this->actor.scale.z = 0.0f;
+ this->actor.scale.y = 0.0f;
+ this->actor.scale.x = 0.0f;
+ this->actor.speedXZ = 0.0f;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 15, -1, 10, NULL);
+ }
+
+ if (this->actor.bgCheckFlags & 2) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_EYEGOLE_ATTACK);
+ this->unk_1EE = 1;
+ }
+ } else if (this->unk_1EE == 1) {
+ Math_Vec3f_Copy(&sp78, &this->actor.world.pos);
+
+ temp_f24 = Math_SinS(this->actor.shape.rot.x) * 20.0f;
+ temp_f20 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_SinS(this->actor.shape.rot.y);
+ temp_f22 = (-20.0f * Math_CosS(this->actor.shape.rot.x)) * Math_CosS(this->actor.shape.rot.y);
+
+ for (i = 0; i < 4; i++) {
+ func_800B1210(globalCtx, &sp78, &gZeroVec3f, &gZeroVec3f, 500, 50);
+ sp78.x += temp_f20;
+ sp78.y += temp_f24;
+ sp78.z += temp_f22;
+ }
+
+ func_800B1210(globalCtx, &this->actor.home.pos, &gZeroVec3f, &gZeroVec3f, 500, 100);
+ func_808F20FC(this, globalCtx);
+ }
+ }
+}
+
+void func_808F1FAC(EnKarebaba* this) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_DEKU_JR_DEAD);
+ this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ if (this->unk_1EC == 10) {
+ this->unk_1EE = 3;
+ }
+ this->actionFunc = func_808F200C;
+}
+
+void func_808F200C(EnKarebaba* this, GlobalContext* globalCtx) {
+ if (this->unk_1EC == 10) {
+ this->unk_1EE--;
+ if (this->unk_1EE == 0) {
+ func_808F1374(this, globalCtx);
+ }
+ } else {
+ if (Math_StepToF(&this->actor.scale.x, 0.0f, 0.0005f)) {
+ Item_DropCollectible(globalCtx, &this->actor.world.pos, ITEM00_NUTS_1);
+ func_808F238C(this);
+ } else {
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 1.0f);
+ }
+ this->actor.scale.y = this->actor.scale.x;
+ this->actor.scale.z = this->actor.scale.x;
+ }
+}
+
+void func_808F20FC(EnKarebaba* this, GlobalContext* globalCtx) {
+ Actor_SetScale(&this->actor, 0.03f);
+ this->actor.shape.rot.x -= 0x4000;
+ this->actor.shape.yOffset = 1000.0f;
+ this->actor.gravity = 0.0f;
+ this->actor.velocity.y = 0.0f;
+ this->actor.shape.shadowScale = 3.0f;
+ func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 8);
+ this->unk_1EE = 200;
+ this->actor.flags &= ~ACTOR_FLAG_20;
+ this->unk_1F0 = 0.0f;
+ this->actionFunc = func_808F21A4;
+}
+
+void func_808F21A4(EnKarebaba* this, GlobalContext* globalCtx) {
+ if (this->unk_1EE != 0) {
+ this->unk_1EE--;
+ }
+
+ if (Actor_HasParent(&this->actor, globalCtx) || (this->unk_1EE == 0)) {
+ func_808F238C(this);
+ } else {
+ Actor_PickUpNearby(&this->actor, globalCtx, GI_STICKS_1);
+ }
+}
+
+void func_808F220C(EnKarebaba* this) {
+ Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, -3.0f,
+ Animation_GetLastFrame(&object_dekubaba_Anim_0002B8), 0.0f, 2, -3.0f);
+ func_808F152C(this);
+ this->actionFunc = func_808F228C;
+}
+
+void func_808F228C(EnKarebaba* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Math_StepToF(&this->actor.scale.x, 0.005f, 0.0005f) && (this->actor.params == ENKAREBABA_2)) {
+ func_808F1648(this);
+ }
+
+ this->actor.scale.z = this->actor.scale.x;
+ this->actor.scale.y = this->actor.scale.x;
+
+ if ((this->actor.params == ENKAREBABA_1) &&
+ Math_StepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 14.0f, 5.0f)) {
+ func_808F1648(this);
+ }
+
+ this->actor.shape.rot.y += 0x1999;
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.home.pos, 3.0f, 0, 12, 5, 1, -1, 10, NULL);
+}
+
+void func_808F238C(EnKarebaba* this) {
+ Animation_Change(&this->skelAnime, &object_dekubaba_Anim_0002B8, 0.0f, 0.0f, 0.0f, 2, 0.0f);
+ func_808F152C(this);
+ this->actor.shape.rot.x = -0x4000;
+ this->unk_1EE = 200;
+ this->actor.parent = NULL;
+ this->actor.shape.shadowScale = 0.0f;
+ this->unk_1F0 = 0.0f;
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.home.pos);
+ this->actionFunc = func_808F254C;
+}
+
+void func_808F241C(EnKarebaba* this, GlobalContext* globalCtx) {
+ f32 sp1C;
+
+ this->unk_1EE++;
+ sp1C = this->unk_1EE * 0.05f;
+ Actor_SetScale(&this->actor, 0.005f * sp1C);
+ this->actor.world.pos.y = this->actor.home.pos.y + (14.0f * sp1C);
+
+ if (this->unk_1EE == 20) {
+ this->actor.flags &= ~ACTOR_FLAG_10;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ if (this->actor.params == ENKAREBABA_1) {
+ func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 5);
+ }
+ func_808F1648(this);
+ }
+}
+
+void func_808F24F8(EnKarebaba* this) {
+ this->actor.shape.yOffset = 0.0f;
+ this->actor.shape.shadowScale = 22.0f;
+ this->collider1.dim.radius = sCylinderInit2.dim.radius;
+ Actor_SetScale(&this->actor, 0.0f);
+ this->actionFunc = func_808F241C;
+}
+
+void func_808F254C(EnKarebaba* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (this->unk_1EE != 0) {
+ this->unk_1EE--;
+ }
+
+ if (this->unk_1EE == 0) {
+ func_808F24F8(this);
+ }
+}
+
+void EnKarebaba_Update(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ EnKarebaba* this = THIS;
+ f32 max;
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_1F0 > 0.0f) {
+ if (this->unk_1EC != 10) {
+ Math_StepToF(&this->unk_1F0, 0.0f, 0.05f);
+ this->unk_1F4 = (this->unk_1F0 + 1.0f) * 0.375f;
+ if (this->unk_1F4 > 0.75f) {
+ this->unk_1F4 = 0.75f;
+ } else {
+ this->unk_1F4 = this->unk_1F4;
+ }
+ } else if (!Math_StepToF(&this->unk_1F8, 0.75f, 0.01875f)) {
+ func_800B9010(&this->actor, NA_SE_EV_ICE_FREEZE - SFX_FLAG);
+ }
+ }
+
+ if (this->actionFunc != func_808F254C) {
+ if (this->actionFunc == func_808F1C84) {
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 10.0f, 5);
+ } else {
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+ if (this->unk_22C == 0) {
+ this->unk_22C = this->actor.floorPoly;
+ }
+ }
+
+ if ((this->actionFunc != func_808F1C84) && (this->actionFunc != func_808F200C) &&
+ (this->actionFunc != func_808F21A4)) {
+ if ((this->actionFunc != func_808F241C) && (this->actionFunc != func_808F15B0)) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ }
+
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ Actor_SetFocus(&this->actor, (this->actor.scale.x * 10.0f) / 0.01f);
+
+ max = this->actor.home.pos.y + 40.0f;
+ this->actor.focus.pos.x = this->actor.home.pos.x;
+ this->actor.focus.pos.y = CLAMP_MAX(this->actor.focus.pos.y, max);
+ this->actor.focus.pos.z = this->actor.home.pos.z;
+ }
+ }
+}
+
+void func_808F280C(EnKarebaba* this, GlobalContext* globalCtx) {
+ MtxF sp40;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C448(globalCtx->state.gfxCtx);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 255);
+
+ func_800C0094(this->unk_22C, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, &sp40);
+ Matrix_InsertMatrix(&sp40, MTXMODE_NEW);
+ Matrix_Scale(0.15f, 1.0f, 0.15f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gCircleShadowDL);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void EnKarebaba_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnKarebaba* this = THIS;
+ s32 i;
+ s32 sp94;
+ s16 phi_a3;
+ f32 sp8C = 0.01f;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Math_Vec3f_Copy(this->unk_1FC, &this->actor.world.pos);
+
+ if (this->actionFunc == func_808F21A4) {
+ if ((this->unk_1EE > 40) || (this->unk_1EE & 1)) {
+ Matrix_InsertTranslation(0.0f, 0.0f, 200.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dekubaba_DL_003070);
+ }
+ } else if (this->actionFunc != func_808F254C) {
+ func_800AE2A0(globalCtx, &D_808F2E28, 1, 2);
+ SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL);
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
+ MTXMODE_NEW);
+
+ if ((this->actionFunc == func_808F241C) || (this->actionFunc == func_808F200C) ||
+ (this->actionFunc == func_808F15B0)) {
+ sp8C = this->unk_1EE * 0.0005f;
+ }
+
+ Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY);
+ Matrix_InsertRotation(this->actor.shape.rot.x, this->actor.shape.rot.y, 0, MTXMODE_APPLY);
+
+ if (this->actor.params == ENKAREBABA_2) {
+ sp94 = 1;
+ } else if (this->actionFunc == func_808F1C84) {
+ sp94 = 2;
+ } else {
+ sp94 = 3;
+ }
+
+ for (i = 0; i < sp94; i++) {
+ Matrix_InsertTranslation(0.0f, 0.0f, -2000.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, D_808F2E2C[i]);
+
+ Matrix_GetStateTranslation(&this->unk_1FC[1 + i]);
+ if ((i == 0) && (this->actionFunc == func_808F1C84)) {
+ Matrix_GetStateTranslation(&this->actor.focus.pos);
+ }
+ }
+
+ func_800AE5A0(globalCtx);
+ }
+
+ func_800AE2A0(globalCtx, &D_808F2E28, 1, 2);
+ Matrix_InsertTranslation(this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z, MTXMODE_NEW);
+
+ if (this->actionFunc != func_808F15B0) {
+ sp8C = 0.01f;
+ }
+
+ Matrix_Scale(sp8C, sp8C, sp8C, MTXMODE_APPLY);
+ Matrix_RotateY(this->actor.home.rot.y, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dekubaba_DL_0010F0);
+
+ if (this->actionFunc == func_808F1C84) {
+ Matrix_InsertRotation(-0x4000, this->actor.shape.rot.y - this->actor.home.rot.y, 0, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dekubaba_DL_001828);
+
+ Matrix_GetStateTranslation(&this->unk_1FC[3]);
+ }
+
+ func_800AE5A0(globalCtx);
+
+ if (this->actor.params == ENKAREBABA_2) {
+ phi_a3 = 1;
+ } else {
+ phi_a3 = 4;
+ }
+
+ func_800BE680(globalCtx, &this->actor, this->unk_1FC, phi_a3, this->unk_1F4, this->unk_1F8, this->unk_1F0,
+ this->unk_1EC);
+
+ if (this->unk_22C != 0) {
+ func_808F280C(this, globalCtx);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
index 0948766430..9fd021e5fb 100644
--- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
+++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.h
@@ -7,11 +7,27 @@ struct EnKarebaba;
typedef void (*EnKarebabaActionFunc)(struct EnKarebaba*, GlobalContext*);
+enum {
+ /* 0 */ ENKAREBABA_0,
+ /* 1 */ ENKAREBABA_1,
+ /* 2 */ ENKAREBABA_2,
+};
+
typedef struct EnKarebaba {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnKarebabaActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x13C];
+ /* 0x018C */ Vec3s jointTable[8];
+ /* 0x01BC */ Vec3s morphTable[8];
+ /* 0x01EC */ u8 unk_1EC;
+ /* 0x01EE */ s16 unk_1EE;
+ /* 0x01F0 */ f32 unk_1F0;
+ /* 0x01F4 */ f32 unk_1F4;
+ /* 0x01F8 */ f32 unk_1F8;
+ /* 0x01FC */ Vec3f unk_1FC[4];
+ /* 0x022C */ CollisionPoly* unk_22C;
+ /* 0x0230 */ ColliderCylinder collider1;
+ /* 0x027C */ ColliderCylinder collider2;
} EnKarebaba; // size = 0x2C8
extern const ActorInit En_Karebaba_InitVars;
diff --git a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c
index a937dbcd64..deedb3e787 100644
--- a/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c
+++ b/src/overlays/actors/ovl_En_Kbt/z_en_kbt.c
@@ -6,7 +6,7 @@
#include "z_en_kbt.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnKbt*)thisx)
diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
index 2cd8dd5e90..eee97c5f7a 100644
--- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
+++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c
@@ -5,8 +5,10 @@
*/
#include "z_en_kendo_js.h"
+#include "overlays/actors/ovl_En_Maruta/z_en_maruta.h"
+#include "objects/object_js/object_js.h"
-#define FLAGS 0x0A000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000 | ACTOR_FLAG_8000000)
#define THIS ((EnKendoJs*)thisx)
@@ -15,7 +17,26 @@ void EnKendoJs_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnKendoJs_Update(Actor* thisx, GlobalContext* globalCtx);
void EnKendoJs_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B26538(EnKendoJs* this);
+void func_80B2654C(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B26AE8(EnKendoJs* this);
+void func_80B26AFC(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B2701C(EnKendoJs* this);
+void func_80B27030(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B2714C(EnKendoJs* this);
+void func_80B27188(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B273D0(EnKendoJs* this);
+void func_80B2740C(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B274BC(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B276C4(EnKendoJs* this);
+void func_80B276D8(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B27760(EnKendoJs* this);
+void func_80B27774(EnKendoJs* this, GlobalContext* globalCtx);
+void func_80B2783C(EnKendoJs* this, GlobalContext* globalCtx);
+s32 func_80B278C4(GlobalContext* globalCtx, Vec3f arg1);
+void func_80B279F0(EnKendoJs* this, GlobalContext* globalCtx, s32 arg2);
+void func_80B27A90(EnKendoJs* this, GlobalContext* globalCtx);
+
const ActorInit En_Kendo_Js_InitVars = {
ACTOR_EN_KENDO_JS,
ACTORCAT_NPC,
@@ -28,86 +49,719 @@ const ActorInit En_Kendo_Js_InitVars = {
(ActorFunc)EnKendoJs_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80B27C30 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 18, 30, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80B27C5C = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-#endif
+static AnimationInfo sAnimations[] = {
+ { &object_js_Anim_000C7C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_000F4C, 1.0f, 0.0f, 0.0f, 0, -8.0f },
+ { &object_js_Anim_00016C, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_js_Anim_0003DC, 1.0f, 0.0f, 0.0f, 2, -8.0f },
+ { &object_js_Anim_000AD4, 1.0f, 0.0f, 0.0f, 0, -8.0f },
+};
-extern ColliderCylinderInit D_80B27C30;
-extern CollisionCheckInfoInit2 D_80B27C5C;
+s16 D_80B27CE0[][3] = {
+ { 0x2731, 0x2732, 0x2733 },
+ { 0x2734, 0x2735, 0x2736 },
+ { 0x2737, 0x2738, 0x2739 },
+};
-extern UNK_TYPE D_0600016C;
-extern UNK_TYPE D_06000F4C;
+s16 D_80B27CF4[][3] = {
+ { 0x2710, 0x2712, 0x2714 },
+ { 0x2711, 0x2713, 0x2715 },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/EnKendoJs_Init.s")
+s16 D_80B27D00[] = {
+ 0x271C, 0x271E, 0x2720, 0x2722, 0x2724, 0x2726, 0x2728,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/EnKendoJs_Destroy.s")
+s16 D_80B27D10[] = {
+ 0x271B, 0x271D, 0x271F, 0x2721, 0x2723, 0x2725, 0x2727,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26538.s")
+void EnKendoJs_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnKendoJs* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B2654C.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26758.s")
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B269A4.s")
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_js_Skel_006990, &object_js_Anim_000F4C, this->jointTable,
+ this->morphTable, 13);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26AE8.s")
+ if ((CURRENT_DAY == 3) && !((gSaveContext.time <= CLOCK_TIME(23, 0)) && (gSaveContext.time >= CLOCK_TIME(6, 0)))) {
+ if (ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) {
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_KANBAN, this->actor.home.pos.x,
+ this->actor.home.pos.y, this->actor.home.pos.z - 10.0f, this->actor.home.rot.x,
+ this->actor.home.rot.y, this->actor.home.rot.z, 0x10);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
+ }
+ } else if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) {
+ Actor_MarkForDeath(&this->actor);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26AFC.s")
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26BF8.s")
+ if (ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) {
+ Path* path = &globalCtx->setupPathList[ENKENDOJS_GET_FF00(&this->actor)];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26EB4.s")
+ this->unk_274 = Lib_SegmentedToVirtual(path->points);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26F14.s")
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.focus.pos = this->actor.world.pos;
+ this->actor.focus.pos.y += 30.0f;
+ this->actor.child = NULL;
+ this->unk_28A = 0;
+ this->unk_28C = 0;
+ this->unk_28E = 0;
+ this->unk_286 = 0;
+ func_80B26538(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B26F6C.s")
+void EnKendoJs_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnKendoJs* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B2701C.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+ gSaveContext.weekEventReg[82] &= (u8)~8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27030.s")
+void func_80B26538(EnKendoJs* this) {
+ this->actionFunc = func_80B2654C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B2714C.s")
+void func_80B2654C(EnKendoJs* this, GlobalContext* globalCtx) {
+ s32 phi_v0;
+ s32 sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27188.s")
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) {
+ if (CURRENT_DAY != 0) {
+ sp30 = CURRENT_DAY - 1;
+ } else {
+ sp30 = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B273D0.s")
+ if (ENKENDOJS_GET_FF(&this->actor) == ENKENDOJS_FF_1) {
+ Message_StartTextbox(globalCtx, 0x273C, &this->actor);
+ this->unk_288 = 0x273C;
+ } else if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
+ switch (gSaveContext.playerForm) {
+ case PLAYER_FORM_DEKU:
+ phi_v0 = 0;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B2740C.s")
+ case PLAYER_FORM_GORON:
+ phi_v0 = 1;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B274BC.s")
+ case PLAYER_FORM_ZORA:
+ phi_v0 = 2;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B276C4.s")
+ default:
+ phi_v0 = 0;
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B276D8.s")
+ Message_StartTextbox(globalCtx, D_80B27CE0[phi_v0][sp30], &this->actor);
+ this->unk_288 = D_80B27CE0[phi_v0][sp30];
+ } else if ((Player_GetMask(globalCtx) != PLAYER_MASK_NONE) && (Player_GetMask(globalCtx) < PLAYER_MASK_GIANT)) {
+ u16 sp2E = Player_GetMask(globalCtx) + 0x273C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27760.s")
+ if (0) {}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27774.s")
+ Message_StartTextbox(globalCtx, sp2E, &this->actor);
+ this->unk_288 = sp2E;
+ } else {
+ if (this->unk_28A == 0) {
+ this->unk_28A = 1;
+ phi_v0 = 0;
+ } else {
+ phi_v0 = 1;
+ }
+ Message_StartTextbox(globalCtx, D_80B27CF4[phi_v0][sp30], &this->actor);
+ this->unk_288 = D_80B27CF4[phi_v0][sp30];
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B2783C.s")
+ func_80B26AE8(this);
+ } else {
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27880.s")
+void func_80B26758(EnKendoJs* this, GlobalContext* globalCtx) {
+ if (func_80147624(globalCtx) && (this->unk_288 == 0x2716)) {
+ switch (globalCtx->msgCtx.choiceIndex) {
+ case 0:
+ if (CUR_EQUIP_VALUE_VOID(EQUIP_SWORD) == EQUIP_SWORD) {
+ play_sound(NA_SE_SY_ERROR);
+ Message_StartTextbox(globalCtx, 0x272C, &this->actor);
+ this->unk_288 = 0x272C;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ } else if (gSaveContext.rupees < globalCtx->msgCtx.unk1206C) {
+ play_sound(NA_SE_SY_ERROR);
+ Message_StartTextbox(globalCtx, 0x2718, &this->actor);
+ this->unk_288 = 0x2718;
+ } else {
+ func_8019F208();
+ func_801159EC(-globalCtx->msgCtx.unk1206C);
+ Message_StartTextbox(globalCtx, 0x2719, &this->actor);
+ this->unk_288 = 0x2719;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B278C4.s")
+ case 1:
+ if (CUR_EQUIP_VALUE_VOID(EQUIP_SWORD) == EQUIP_SWORD) {
+ play_sound(NA_SE_SY_ERROR);
+ Message_StartTextbox(globalCtx, 0x272C, &this->actor);
+ this->unk_288 = 0x272C;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ } else if (gSaveContext.rupees < globalCtx->msgCtx.unk12070) {
+ play_sound(NA_SE_SY_ERROR);
+ Message_StartTextbox(globalCtx, 0x2718, &this->actor);
+ this->unk_288 = 0x2718;
+ } else {
+ func_8019F208();
+ func_801159EC(-globalCtx->msgCtx.unk12070);
+ Message_StartTextbox(globalCtx, 0x273A, &this->actor);
+ this->unk_288 = 0x273A;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B279AC.s")
+ case 2:
+ func_8019F230();
+ Message_StartTextbox(globalCtx, 0x2717, &this->actor);
+ this->unk_288 = 0x2717;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B279F0.s")
+void func_80B269A4(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27A90.s")
+ if (!func_80147624(globalCtx)) {
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/EnKendoJs_Update.s")
+ switch (this->unk_288) {
+ case 0x2710:
+ case 0x2711:
+ case 0x2712:
+ case 0x2713:
+ case 0x2714:
+ case 0x2715:
+ Message_StartTextbox(globalCtx, 0x2716, &this->actor);
+ this->unk_288 = 0x2716;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27B54.s")
+ case 0x2719:
+ func_801477B4(globalCtx);
+ player->stateFlags1 |= 0x20;
+ func_80B2701C(this);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/func_80B27B8C.s")
+ case 0x271A:
+ func_801477B4(globalCtx);
+ func_80B2714C(this);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Kendo_Js/EnKendoJs_Draw.s")
+ case 0x273A:
+ Message_StartTextbox(globalCtx, 0x273B, &this->actor);
+ this->unk_288 = 0x273B;
+ break;
+
+ case 0x273B:
+ func_801477B4(globalCtx);
+ func_80112AFC(globalCtx);
+ player->stateFlags1 |= 0x20;
+ func_80B273D0(this);
+ break;
+
+ case 0x272D:
+ func_801477B4(globalCtx);
+ gSaveContext.minigameState = 3;
+ func_80B276C4(this);
+ func_80B276D8(this, globalCtx);
+ break;
+ }
+}
+
+void func_80B26AE8(EnKendoJs* this) {
+ this->actionFunc = func_80B26AFC;
+}
+
+void func_80B26AFC(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 4:
+ func_80B26758(this, globalCtx);
+ break;
+
+ case 5:
+ func_80B269A4(this, globalCtx);
+ break;
+
+ case 6:
+ if (func_80147624(globalCtx)) {
+ if (this->unk_288 == 0x272C) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ }
+
+ if ((this->unk_288 == 0x272E) || (this->unk_288 == 0x272F) || (this->unk_288 == 0x2730)) {
+ gSaveContext.minigameState = 3;
+ }
+
+ player->stateFlags1 &= ~0x20;
+ func_80B26538(this);
+ }
+
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ break;
+ }
+}
+
+s32 func_80B26BF8(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ switch (this->unk_284) {
+ case 0:
+ if (func_80122FCC(globalCtx)) {
+ return 0;
+ }
+
+ if ((player->swordState != 0) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ return 1;
+ }
+ break;
+
+ case 1:
+ if ((player->stateFlags3 & 0x8000000)) {
+ return 0;
+ }
+
+ if ((player->swordState != 0) || (player->stateFlags2 & 0x80000)) {
+ return 1;
+ }
+ break;
+
+ case 2:
+ if (func_80122F9C(globalCtx)) {
+ return 0;
+ }
+
+ if ((player->swordState != 0) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ return 1;
+ }
+ this->unk_28E = 0;
+ break;
+
+ case 3:
+ if ((this->unk_28E == 1) && ((player->swordAnimation == 4) || (player->swordAnimation == 6))) {
+ this->unk_28E = 0;
+ return 0;
+ }
+
+ if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ this->unk_28E = 0;
+ return 1;
+ }
+ break;
+
+ case 4:
+ if ((this->unk_28E == 1) && ((player->swordAnimation == 0) || (player->swordAnimation == 2))) {
+ this->unk_28E = 0;
+ return 0;
+ }
+
+ if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ this->unk_28E = 0;
+ return 1;
+ }
+ break;
+
+ case 5:
+ if ((this->unk_28E == 1) && (player->swordAnimation == 12)) {
+ this->unk_28E = 0;
+ return 0;
+ }
+
+ if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ this->unk_28E = 0;
+ return 1;
+ }
+ break;
+
+ case 6:
+ if ((this->unk_28E == 1) && ((player->swordAnimation == 17) || (player->swordAnimation == 20))) {
+ this->unk_28E = 0;
+ return 0;
+ }
+
+ if ((this->unk_28E == 1) || (player->stateFlags3 & 0x8000000) || (player->stateFlags2 & 0x80000)) {
+ this->unk_28E = 0;
+ return 1;
+ }
+ break;
+ }
+ return 2;
+}
+
+void func_80B26EB4(EnKendoJs* this, GlobalContext* globalCtx) {
+ Message_StartTextbox(globalCtx, D_80B27D00[this->unk_284], &this->actor);
+ this->unk_288 = D_80B27D00[this->unk_284];
+ this->unk_284++;
+}
+
+void func_80B26F14(EnKendoJs* this, GlobalContext* globalCtx) {
+ Message_StartTextbox(globalCtx, D_80B27D10[this->unk_284], &this->actor);
+ this->unk_288 = D_80B27D10[this->unk_284];
+}
+
+s32 func_80B26F6C(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ switch (this->unk_288) {
+ case 0x271D:
+ if (func_80124190(player)) {
+ Message_StartTextbox(globalCtx, 0x272A, &this->actor);
+ this->unk_288 = 0x272A;
+ return true;
+ }
+ break;
+
+ case 0x2721:
+ if (this->unk_292 != 0) {
+ Message_StartTextbox(globalCtx, 0x272B, &this->actor);
+ this->unk_288 = 0x272B;
+ return true;
+ }
+ break;
+ }
+ return false;
+}
+
+void func_80B2701C(EnKendoJs* this) {
+ this->actionFunc = func_80B27030;
+}
+
+void func_80B27030(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp20 = this->actor.world.pos;
+
+ sp20.z += 200.0f;
+
+ if (func_80B278C4(globalCtx, sp20)) {
+ this->actor.flags |= ACTOR_FLAG_10000;
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ player->stateFlags1 &= ~0x20;
+ func_80B279F0(this, globalCtx, 0);
+ Message_StartTextbox(globalCtx, 0x271A, &this->actor);
+ this->unk_288 = 0x271A;
+ func_80B26AE8(this);
+ } else {
+ func_800B8614(&this->actor, globalCtx, 800.0f);
+ }
+ }
+}
+
+void func_80B2714C(EnKendoJs* this) {
+ gSaveContext.weekEventReg[82] |= 8;
+ this->unk_28C = 1;
+ this->unk_290 = 0;
+ this->unk_284 = 0;
+ this->unk_286 = 1;
+ this->actionFunc = func_80B27188;
+}
+
+void func_80B27188(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ if (this->unk_288 == 0x2729) {
+ func_80B26F14(this, globalCtx);
+ } else if (!func_80B26F6C(this, globalCtx)) {
+ if (this->skelAnime.animation == &object_js_Anim_00016C) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ }
+ this->unk_286 = 2;
+ func_801477B4(globalCtx);
+ player->stateFlags1 &= ~0x20;
+ }
+ } else if (this->unk_286 == 2) {
+ this->unk_286 = 1;
+ }
+
+ if (this->unk_286 == 1) {
+ switch (func_80B26BF8(this, globalCtx)) {
+ case 0:
+ this->unk_286 = 0;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
+ player->stateFlags1 |= 0x20;
+ func_80B26EB4(this, globalCtx);
+ break;
+
+ case 1:
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR);
+ this->unk_286 = 0;
+ player->stateFlags1 |= 0x20;
+ Message_StartTextbox(globalCtx, 0x2729, &this->actor);
+ this->unk_288 = 0x2729;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ break;
+
+ default:
+ if (this->unk_28C == 0) {
+ this->unk_290++;
+ if (this->unk_290 == 30) {
+ this->unk_290 = 0;
+ func_80B279F0(this, globalCtx, 0);
+ }
+ }
+ break;
+ }
+
+ if ((this->skelAnime.animation == &object_js_Anim_0003DC) &&
+ Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ }
+
+ if (this->unk_284 == 7) {
+ gSaveContext.weekEventReg[82] &= (u8)~8;
+ func_80B26AE8(this);
+ }
+ }
+}
+
+void func_80B273D0(EnKendoJs* this) {
+ gSaveContext.weekEventReg[82] |= 8;
+ this->unk_290 = 120;
+ this->unk_284 = 0;
+ this->unk_286 = 1;
+ this->actionFunc = func_80B2740C;
+}
+
+void func_80B2740C(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp18 = this->actor.world.pos;
+
+ sp18.z += 300.0f;
+
+ if (func_80B278C4(globalCtx, sp18)) {
+ this->unk_28C = 0;
+ player->stateFlags1 &= ~0x20;
+ this->actionFunc = func_80B274BC;
+ }
+}
+
+void func_80B274BC(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->unk_290 >= 140) {
+ if (this->unk_284 == 5) {
+ if (gSaveContext.minigameScore == 30) {
+ Message_StartTextbox(globalCtx, 0x272D, &this->actor);
+ this->unk_288 = 0x272D;
+ } else {
+ Message_StartTextbox(globalCtx, 0x272E, &this->actor);
+ this->unk_288 = 0x272E;
+ }
+ player->stateFlags1 |= 0x20;
+ gSaveContext.weekEventReg[82] &= (u8)~8;
+ func_80B26AE8(this);
+ return;
+ }
+
+ play_sound(NA_SE_SY_FOUND);
+ func_80B279F0(this, globalCtx, ((Rand_Next() & 0xFF) % 3) + 1);
+ func_80B279F0(this, globalCtx, ((Rand_Next() & 0xFF) % 3) + 4);
+ this->unk_290 = 0;
+ this->unk_284++;
+ } else if (this->unk_290 == 120) {
+ func_80B27A90(this, globalCtx);
+ this->unk_290++;
+ } else {
+ this->unk_290++;
+ }
+
+ if (this->unk_28E == 1) {
+ if ((player->swordAnimation == 17) || (player->swordAnimation == 20)) {
+ globalCtx->interfaceCtx.unk_25C = 3;
+ if (gSaveContext.minigameScore >= 27) {
+ player->stateFlags1 |= 0x20;
+ }
+ } else if (player->swordAnimation == 12) {
+ globalCtx->interfaceCtx.unk_25C = 2;
+ } else {
+ globalCtx->interfaceCtx.unk_25C = 1;
+ }
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
+ this->unk_28E = 0;
+ }
+ func_80B2783C(this, globalCtx);
+}
+
+void func_80B276C4(EnKendoJs* this) {
+ this->actionFunc = func_80B276D8;
+}
+
+void func_80B276D8(EnKendoJs* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ func_80B27760(this);
+ } else if (!(gSaveContext.weekEventReg[63] & 0x20)) {
+ Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 800.0f, 100.0f);
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_RUPEE_RED, 800.0f, 100.0f);
+ }
+}
+
+void func_80B27760(EnKendoJs* this) {
+ this->actionFunc = func_80B27774;
+}
+
+void func_80B27774(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ if (!(gSaveContext.weekEventReg[63] & 0x20)) {
+ gSaveContext.weekEventReg[63] |= 0x20;
+ Message_StartTextbox(globalCtx, 0x272F, &this->actor);
+ this->unk_288 = 0x272F;
+ } else {
+ Message_StartTextbox(globalCtx, 0x2730, &this->actor);
+ this->unk_288 = 0x2730;
+ }
+ func_80B26AE8(this);
+ player->stateFlags1 &= ~0x20;
+ } else {
+ func_800B85E0(&this->actor, globalCtx, 1000.0f, -1);
+ }
+}
+
+void func_80B2783C(EnKendoJs* this, GlobalContext* globalCtx) {
+ if (this->actor.cutscene != -1) {
+ Camera_ChangeDataIdx(globalCtx->cameraPtrs[CAM_ID_MAIN],
+ ActorCutscene_GetCutscene(this->actor.cutscene)->csCamSceneDataId);
+ }
+}
+
+void func_80B27880(EnKendoJs* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 temp_f0 = this->actor.world.pos.z + 70.0f;
+
+ if ((ENKENDOJS_GET_FF(&this->actor) != ENKENDOJS_FF_1) && (player->actor.world.pos.z < temp_f0)) {
+ player->actor.world.pos.z = temp_f0;
+ }
+}
+
+s32 func_80B278C4(GlobalContext* globalCtx, Vec3f arg1) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 temp_f0;
+ f32 sp28;
+ s16 sp22 = Math_Vec3f_Yaw(&player->actor.world.pos, &arg1);
+
+ temp_f0 = Math_Vec3f_DistXZ(&player->actor.world.pos, &arg1);
+
+ if (temp_f0 < 20.0f) {
+ sp28 = 10.0f;
+ } else if (temp_f0 < 40.0f) {
+ sp28 = 40.0f;
+ } else {
+ sp28 = 80.0f;
+ }
+
+ globalCtx->actorCtx.unk268 = 1;
+ func_800B6F20(globalCtx, &globalCtx->actorCtx.unk_26C, sp28, sp22);
+
+ if (temp_f0 < 20.0f) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void func_80B279AC(EnKendoJs* this, GlobalContext* globalCtx) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
+
+void func_80B279F0(EnKendoJs* this, GlobalContext* globalCtx, s32 arg2) {
+ f32 x = this->unk_274[arg2].x;
+ f32 y = this->unk_274[arg2].y;
+ f32 z = this->unk_274[arg2].z;
+
+ Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_MARUTA, x, y, z, 0, 0, 0, 0);
+ this->unk_28C++;
+}
+
+void func_80B27A90(EnKendoJs* this, GlobalContext* globalCtx) {
+ Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].first;
+
+ while (actor != NULL) {
+ if (actor->id == ACTOR_EN_MARUTA) {
+ ((EnMaruta*)actor)->unk_220 = 1;
+ }
+ actor = actor->next;
+ }
+
+ this->unk_28C = 0;
+}
+
+void EnKendoJs_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnKendoJs* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ SkelAnime_Update(&this->skelAnime);
+ func_800E9250(globalCtx, &this->actor, &this->unk_278, &this->unk_27E, this->actor.focus.pos);
+ func_80B279AC(this, globalCtx);
+ func_80B27880(this, globalCtx);
+}
+
+s32 EnKendoJs_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnKendoJs* this = THIS;
+
+ if (limbIndex == 12) {
+ rot->y -= this->unk_278.y;
+ }
+ return false;
+}
+
+void EnKendoJs_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+}
+
+void EnKendoJs_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnKendoJs* this = THIS;
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnKendoJs_OverrideLimbDraw, EnKendoJs_PostLimbDraw, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h
index 33da3ea09e..2820aac217 100644
--- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h
+++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.h
@@ -7,11 +7,29 @@ struct EnKendoJs;
typedef void (*EnKendoJsActionFunc)(struct EnKendoJs*, GlobalContext*);
+#define ENKENDOJS_GET_FF(thisx) ((thisx)->params & 0xFF)
+#define ENKENDOJS_GET_FF00(thisx) (((thisx)->params & 0xFF00) >> 8)
+
+#define ENKENDOJS_FF_1 1
+
typedef struct EnKendoJs {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x90];
+ /* 0x0144 */ ColliderCylinder collider;
+ /* 0x0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnKendoJsActionFunc actionFunc;
- /* 0x01D8 */ char unk_1D8[0xBC];
+ /* 0x01D8 */ Vec3s jointTable[13];
+ /* 0x0226 */ Vec3s morphTable[13];
+ /* 0x0274 */ Vec3s* unk_274;
+ /* 0x0278 */ Vec3s unk_278;
+ /* 0x027E */ Vec3s unk_27E;
+ /* 0x0284 */ s16 unk_284;
+ /* 0x0286 */ s16 unk_286;
+ /* 0x0288 */ s16 unk_288;
+ /* 0x028A */ s16 unk_28A;
+ /* 0x028C */ s16 unk_28C;
+ /* 0x028E */ s16 unk_28E;
+ /* 0x0290 */ s16 unk_290;
+ /* 0x0292 */ u8 unk_292;
} EnKendoJs; // size = 0x294
extern const ActorInit En_Kendo_Js_InitVars;
diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
index 4d0e7f9fe1..0099ff9671 100644
--- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
+++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c
@@ -7,8 +7,10 @@
#include "overlays/actors/ovl_En_Kbt/z_en_kbt.h"
#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h"
#include "z_en_kgy.h"
+#include "objects/object_kgy/object_kgy.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnKgy*)thisx)
@@ -31,24 +33,6 @@ void func_80B425A0(EnKgy* this, GlobalContext* globalCtx);
void func_80B42714(EnKgy* this, GlobalContext* globalCtx);
void func_80B42D28(EnKgy* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060008FC;
-extern AnimationHeader D_06001764;
-extern Gfx D_04001D00[];
-extern AnimationHeader D_06001EA4;
-extern Gfx D_040021A8[];
-extern AnimationHeader D_0600292C;
-extern AnimationHeader D_06003334;
-extern AnimationHeader D_06003D88;
-extern AnimationHeader D_060042E4;
-extern AnimationHeader D_06004B98;
-extern Gfx D_0600E8F0[];
-extern Gfx D_0600EE58[];
-extern Gfx D_0600F180[];
-extern Gfx D_0600F6A0[];
-extern FlexSkeletonHeader D_0600F910;
-extern AnimationHeader D_06010B84;
-extern AnimationHeader D_060101F0;
-
const ActorInit En_Kgy_InitVars = {
ACTOR_EN_KGY,
ACTORCAT_NPC,
@@ -67,7 +51,8 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 i;
Actor_SetScale(&this->actor, 0.01f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600F910, &D_06004B98, this->jointTable, this->morphTable, 23);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_kgy_Skel_00F910, &object_kgy_Anim_004B98, this->jointTable,
+ this->morphTable, 23);
this->unk_2D2 = -1;
this->unk_29C = 0;
this->unk_2E4 = 0;
@@ -77,7 +62,7 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) {
Flags_UnsetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1);
if (Flags_GetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor)) || (gSaveContext.weekEventReg[33] & 0x80)) {
Flags_SetSwitch(globalCtx, ENKGY_GET_FE00(&this->actor) + 1);
- globalCtx->envCtx.unk_C3 = 1;
+ globalCtx->envCtx.lightSettingOverride = 1;
gSaveContext.weekEventReg[21] |= 1;
if (!func_80B40D64(globalCtx)) {
EnKgy_ChangeAnim(this, 4, 0, 0);
@@ -116,7 +101,7 @@ void EnKgy_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.pos.z, 255, 64, 64, -1);
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
this->unk_300 = -1;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
void EnKgy_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -127,8 +112,9 @@ void EnKgy_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnKgy_ChangeAnim(EnKgy* this, s16 animIndex, u8 mode, f32 transitionRate) {
static AnimationHeader* sAnimations[] = {
- &D_06004B98, &D_060008FC, &D_0600292C, &D_060042E4, &D_060101F0,
- &D_06001764, &D_06003334, &D_06010B84, &D_06001EA4, &D_06003D88,
+ &object_kgy_Anim_004B98, &object_kgy_Anim_0008FC, &object_kgy_Anim_00292C, &object_kgy_Anim_0042E4,
+ &object_kgy_Anim_0101F0, &object_kgy_Anim_001764, &object_kgy_Anim_003334, &object_kgy_Anim_010B84,
+ &object_kgy_Anim_001EA4, &object_kgy_Anim_003D88,
};
Animation_Change(&this->skelAnime, sAnimations[animIndex], 1.0f, 0.0f,
@@ -167,32 +153,33 @@ ObjIcePoly* EnKgy_FindIceBlock(GlobalContext* globalCtx) {
}
void func_80B40C74(GlobalContext* globalCtx) {
- gSaveContext.roomInf[globalCtx->sceneNum][5] |= 1;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 1;
if (CURRENT_DAY == 1) {
- gSaveContext.roomInf[globalCtx->sceneNum][5] |= 2;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 2;
} else {
- gSaveContext.roomInf[globalCtx->sceneNum][5] &= ~2;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~2;
}
}
void func_80B40D00(GlobalContext* globalCtx) {
- gSaveContext.roomInf[globalCtx->sceneNum][5] |= 4;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= 4;
}
void func_80B40D30(GlobalContext* globalCtx) {
- gSaveContext.roomInf[globalCtx->sceneNum][5] &= ~7;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~7;
}
s32 func_80B40D64(GlobalContext* globalCtx) {
- return gSaveContext.roomInf[globalCtx->sceneNum][5] & 1;
+ return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 1;
}
s32 func_80B40D8C(GlobalContext* globalCtx) {
- return gSaveContext.roomInf[globalCtx->sceneNum][5] & 4;
+ return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 4;
}
s32 func_80B40DB4(GlobalContext* globalCtx) {
- if ((CURRENT_DAY == 3) || ((CURRENT_DAY == 2) && (gSaveContext.roomInf[globalCtx->sceneNum][5] & 2))) {
+ if ((CURRENT_DAY == 3) ||
+ ((CURRENT_DAY == 2) && (gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 2))) {
return true;
}
return false;
@@ -473,7 +460,7 @@ void func_80B417B8(EnKgy* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
func_801477B4(globalCtx);
func_80B413C8(this);
- this->actor.flags &= ~0x100;
+ this->actor.flags &= ~ACTOR_FLAG_100;
this->actionFunc = func_80B419B0;
func_80B40E18(this, 7);
}
@@ -501,7 +488,7 @@ void func_80B418C4(EnKgy* this, GlobalContext* globalCtx) {
func_80B413C8(this);
ActorCutscene_SetIntentToPlay(this->unk_2D4[5]);
this->actionFunc = func_80B41858;
- this->actor.flags &= ~0x100;
+ this->actor.flags &= ~ACTOR_FLAG_100;
}
func_80B40EE8(this, globalCtx);
}
@@ -588,7 +575,7 @@ void func_80B41C54(EnKgy* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
this->actionFunc = func_80B41C30;
- this->actor.flags &= ~0x100;
+ this->actor.flags &= ~ACTOR_FLAG_100;
}
func_80B40EE8(this, globalCtx);
}
@@ -596,7 +583,7 @@ void func_80B41C54(EnKgy* this, GlobalContext* globalCtx) {
void func_80B41CBC(EnKgy* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80B40E18(this, this->actor.textId);
this->actionFunc = func_80B41E18;
func_80B411DC(this, globalCtx, 4);
@@ -609,7 +596,7 @@ void func_80B41D64(EnKgy* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actionFunc = func_80B41CBC;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1);
} else {
Actor_PickUp(&this->actor, globalCtx, this->unk_2EA, 2000.0f, 1000.0f);
@@ -731,7 +718,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) {
func_80B41368(this, globalCtx, 0);
this->actor.textId = 0xC43;
CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_NONE;
- TAKE_EQUIPPED_ITEM(EQUIP_SWORD);
+ SET_EQUIP_VALUE(EQUIP_SWORD, 0);
func_80112B40(globalCtx, 0);
func_80B40C74(globalCtx);
break;
@@ -872,7 +859,7 @@ void func_80B42660(EnKgy* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
func_801477B4(globalCtx);
func_80B413C8(this);
- this->actor.flags &= ~0x100;
+ this->actor.flags &= ~ACTOR_FLAG_100;
this->actionFunc = func_80B42714;
func_80B40E18(this, 7);
}
@@ -960,9 +947,9 @@ void func_80B4296C(EnKgy* this, GlobalContext* globalCtx) {
}
func_80B411DC(this, globalCtx, 0);
func_80B40E18(this, this->actor.textId);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
} else {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_NONE);
}
}
@@ -1155,20 +1142,20 @@ void func_80B43074(EnKgy* this, GlobalContext* globalCtx) {
Matrix_InsertXRotation_s(0x4000, MTXMODE_APPLY);
if (func_80B40D8C(globalCtx)) {
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(D_0600F6A0));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_kgy_Matanimheader_00F6A0));
} else {
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(D_0600EE58));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_kgy_Matanimheader_00EE58));
}
gfx = POLY_OPA_DISP;
gSPMatrix(gfx, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (func_80B40D8C(globalCtx)) {
- gSPDisplayList(&gfx[1], D_04001D00);
- gSPDisplayList(&gfx[2], D_0600F180);
+ gSPDisplayList(&gfx[1], gameplay_keep_DL_001D00);
+ gSPDisplayList(&gfx[2], object_kgy_DL_00F180);
} else {
- gSPDisplayList(&gfx[1], D_040021A8);
- gSPDisplayList(&gfx[2], D_0600E8F0);
+ gSPDisplayList(&gfx[1], gameplay_keep_DL_0021A8);
+ gSPDisplayList(&gfx[2], object_kgy_DL_00E8F0);
}
POLY_OPA_DISP = &gfx[3];
diff --git a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c
index 3ad020f922..5a83ecad48 100644
--- a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c
+++ b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c
@@ -6,7 +6,7 @@
#include "z_en_kitan.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnKitan*)thisx)
diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.c b/src/overlays/actors/ovl_En_Knight/z_en_knight.c
index 3c71d5a408..8f64644116 100644
--- a/src/overlays/actors/ovl_En_Knight/z_en_knight.c
+++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.c
@@ -6,7 +6,7 @@
#include "z_en_knight.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnKnight*)thisx)
diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.h b/src/overlays/actors/ovl_En_Knight/z_en_knight.h
index 00c48db914..8191b13a20 100644
--- a/src/overlays/actors/ovl_En_Knight/z_en_knight.h
+++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.h
@@ -9,9 +9,21 @@ typedef void (*EnKnightActionFunc)(struct EnKnight*, GlobalContext*);
typedef struct EnKnight {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x2DC];
+ /* 0x0144 */ s16 unk_144;
+ /* 0x0146 */ char unk_146[0x2];
+ /* 0x0148 */ s8 unk_148;
+ /* 0x0149 */ char pad149[8];
+ /* 0x0151 */ s8 unk_151;
+ /* 0x0152 */ char pad152[1];
+ /* 0x0153 */ u8 unk_153;
+ /* 0x0154 */ u8 unk_154;
+ /* 0x0155 */ char pad155[0x2CB];
/* 0x0420 */ EnKnightActionFunc actionFunc;
- /* 0x0424 */ char unk_424[0x2B0];
+ /* 0x0424 */ char unk_424[0x25C];
+ /* 0x0680 */ u8 unk_680;
+ /* 0x0681 */ char pad681[9];
+ /* 0x068A */ s16 unk_68A;
+ /* 0x068C */ char pad68C[0x48];
} EnKnight; // size = 0x6D4
extern const ActorInit En_Knight_InitVars;
diff --git a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c
index b7abdebdfe..cde9056535 100644
--- a/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c
+++ b/src/overlays/actors/ovl_En_Kujiya/z_en_kujiya.c
@@ -6,7 +6,7 @@
#include "z_en_kujiya.h"
-#define FLAGS 0x08000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_8000000)
#define THIS ((EnKujiya*)thisx)
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 194b99b7a1..9b8b869691 100644
--- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c
+++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c
@@ -6,7 +6,7 @@
#include "z_en_kusa.h"
-#define FLAGS 0x00800010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
#define THIS ((EnKusa*)thisx)
diff --git a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
index d32735035d..1d37f0fa95 100644
--- a/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
+++ b/src/overlays/actors/ovl_En_Kusa2/z_en_kusa2.c
@@ -5,8 +5,10 @@
*/
#include "z_en_kusa2.h"
+#include "objects/gameplay_field_keep/gameplay_field_keep.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00800010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
#define THIS ((EnKusa2*)thisx)
@@ -280,7 +282,7 @@ void func_80A5BB40(EnKusa2* this, GlobalContext* globalCtx, s32 arg2) {
f32 temp_f24;
s16 temp_s0;
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
for (i = 0; i <= arg2; i++) {
temp_s0 = Rand_S16Offset(-16000, 32000) + this->actor.world.rot.y;
temp_f20 = Math_SinS(temp_s0);
@@ -370,7 +372,7 @@ void func_80A5BF84(EnKusa2* this, GlobalContext* globalCtx) {
}
s32 func_80A5BFD8(EnKusa2* this, GlobalContext* globalCtx) {
- if (this->collider.base.acFlags & 2) {
+ if (this->collider.base.acFlags & AC_HIT) {
s32 pad;
func_80A5CF44(this);
@@ -858,7 +860,7 @@ void EnKusa2_Init(Actor* thisx, GlobalContext* globalCtx) {
if (!ENKUSA2_GET_1(&this->actor)) {
this->actor.update = func_80A5E604;
this->actor.draw = NULL;
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_20;
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 1);
this->unk_1BE = 0;
if (D_80A5EAEC != 0) {
@@ -1308,8 +1310,8 @@ void EnKusa2_Update(Actor* thisx, GlobalContext* globalCtx) {
void func_80A5E6F0(Actor* thisx, GlobalContext* globalCtx) {
static Gfx* D_80A5EB68[] = {
- D_040528B0,
- D_040527F0,
+ gameplay_keep_DL_0528B0,
+ gameplay_keep_DL_0527F0,
};
EnKusa2* this = THIS;
s32 i;
@@ -1341,7 +1343,7 @@ void func_80A5E80C(GlobalContext* globalCtx, s32 arg1) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, arg1);
- gSPDisplayList(POLY_XLU_DISP++, D_05007938);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_field_keep_DL_007938);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1354,7 +1356,7 @@ void EnKusa2_Draw(Actor* thisx, GlobalContext* globalCtx) {
(this->actor.projectedPos.z < 400.0f)) {
func_80A5B954(&D_80A60908[this->unk_1CE], 0.0015f);
}
- Gfx_DrawDListOpa(globalCtx, D_050078A0);
+ Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0);
} else if (this->actor.projectedPos.z < 1300.0f) {
func_80A5E80C(globalCtx, (1300.0f - this->actor.projectedPos.z) * 2.55f);
}
@@ -1368,14 +1370,14 @@ void func_80A5E9B4(Actor* thisx, GlobalContext* globalCtx) {
sp18.z = thisx->shape.rot.z + D_80A5EAFC.z;
Matrix_SetStateRotationAndTranslation(thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, &sp18);
Matrix_Scale(thisx->scale.x, thisx->scale.y, thisx->scale.z, MTXMODE_APPLY);
- Gfx_DrawDListOpa(globalCtx, D_050078A0);
+ Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0);
}
void func_80A5EA48(Actor* thisx, GlobalContext* globalCtx) {
EnKusa2* this = THIS;
if (this->unk_1CF == 0xFF) {
- Gfx_DrawDListOpa(globalCtx, D_050078A0);
+ Gfx_DrawDListOpa(globalCtx, gameplay_field_keep_DL_0078A0);
} else {
func_80A5E80C(globalCtx, this->unk_1CF);
}
diff --git a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c
index bfe535600d..8669a3544c 100644
--- a/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c
+++ b/src/overlays/actors/ovl_En_Lift_Nuts/z_en_lift_nuts.c
@@ -6,7 +6,7 @@
#include "z_en_lift_nuts.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnLiftNuts*)thisx)
diff --git a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
index 22a1f73cc2..c38faff3e3 100644
--- a/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
+++ b/src/overlays/actors/ovl_En_Look_Nuts/z_en_look_nuts.c
@@ -6,7 +6,7 @@
#include "z_en_look_nuts.h"
-#define FLAGS 0x80000000
+#define FLAGS (ACTOR_FLAG_80000000)
#define THIS ((EnLookNuts*)thisx)
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 4a21cdefdf..a7f83a42c9 100644
--- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c
+++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c
@@ -6,7 +6,7 @@
#include "z_en_m_thunder.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnMThunder*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
index 0901fd9b22..b5080ec794 100644
--- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
+++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ma4.h"
+#include "objects/object_ma1/object_ma1.h"
-#define FLAGS 0x02000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((EnMa4*)thisx)
@@ -54,35 +55,6 @@ typedef enum {
/* 3 */ MA4_STATE_AFTERDESCRIBETHEMCS,
} EnMa4State;
-extern FlexSkeletonHeader D_06013928;
-
-extern AnimationHeader D_06009E58;
-extern AnimationHeader D_06002A8C;
-extern AnimationHeader D_06018948;
-extern AnimationHeader D_0601B76C;
-extern AnimationHeader D_06007328;
-extern AnimationHeader D_06014088;
-extern AnimationHeader D_06015B7C;
-extern AnimationHeader D_06007D98;
-extern AnimationHeader D_0600852C;
-extern AnimationHeader D_06008F6C;
-
-extern u64 D_0600FFC8[];
-extern u64 D_060107C8[];
-extern u64 D_06010FC8[];
-extern u64 D_060117C8[];
-extern u64 D_06011FC8[];
-
-extern u64 D_060127C8[];
-extern u64 D_06012BC8[];
-extern u64 D_06012FC8[];
-extern u64 D_060133C8[];
-
-extern Gfx D_060003B0[];
-
-// Box
-extern Gfx D_06000A20[];
-
const ActorInit En_Ma4_InitVars = {
ACTOR_EN_MA4,
ACTORCAT_NPC,
@@ -117,15 +89,15 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit2 D_80AC00DC = { 0, 0, 0, 0, MASS_IMMOVABLE };
-static void* sEyeTextures[] = {
- D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8,
+static TexturePtr sEyeTextures[] = {
+ object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8,
};
-static void* sMouthTextures[] = {
- D_060127C8,
- D_06012BC8,
- D_06012FC8,
- D_060133C8,
+static TexturePtr sMouthTextures[] = {
+ object_ma1_Tex_0127C8,
+ object_ma1_Tex_012BC8,
+ object_ma1_Tex_012FC8,
+ object_ma1_Tex_0133C8,
};
void EnMa4_UpdateEyes(EnMa4* this) {
@@ -140,32 +112,42 @@ void EnMa4_UpdateEyes(EnMa4* this) {
}
}
-static struct_80B8E1A8 sAnimationInfo[] = {
- { &D_06009E58, 1.0f, 0, 0.0f }, { &D_06009E58, 1.0f, 0, -6.0f }, // Idle anim
- { &D_06002A8C, 1.0f, 0, 0.0f }, { &D_06002A8C, 1.0f, 0, -6.0f }, // Looking around anim
- { &D_06018948, 1.0f, 2, 0.0f }, { &D_06018948, 1.0f, 2, -6.0f }, // Starts holding hands anim
- { &D_0601B76C, 1.0f, 0, 0.0f }, { &D_0601B76C, 1.0f, 0, -6.0f }, // Holnding hands anim
- { &D_06007328, 1.0f, 0, 0.0f }, { &D_06007328, 1.0f, 0, -6.0f }, // Walking anim
- { &D_06014088, 1.0f, 0, 0.0f }, { &D_06014088, 1.0f, 0, -6.0f }, //
- { &D_06015B7C, 1.0f, 2, 0.0f }, { &D_06015B7C, 1.0f, 2, -6.0f }, // Shoot arrow anim
- { &D_06007D98, 1.0f, 0, 0.0f }, { &D_06007D98, 1.0f, 0, -6.0f }, // Sitting anim
- { &D_0600852C, 1.0f, 0, 0.0f }, { &D_0600852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim
- { &D_06008F6C, 1.0f, 0, 0.0f }, { &D_06008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim
+static AnimationSpeedInfo sAnimationInfo[] = {
+ { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, -6.0f }, // Idle anim
+ { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Looking around anim
+ { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, -6.0f }, // Starts holding hands anim
+ { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Holnding hands anim
+ { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, -6.0f }, // Walking anim
+ { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, -6.0f }, //
+ { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_ONCE, -6.0f }, // Shoot arrow anim
+ { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting anim
+ { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting traumatized anim
+ { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting sad anim
};
void EnMa4_ChangeAnim(EnMa4* this, s32 index) {
- Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f,
- Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode,
- sAnimationInfo[index].transitionRate);
+ Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
+ Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
+ sAnimationInfo[index].morphFrames);
}
void func_80ABDD9C(EnMa4* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 flag;
- if (this->unk_1D8.unk_00 == 0 &&
- ((this->skelAnime.animation == &D_06007328) || (this->skelAnime.animation == &D_06002A8C) ||
- (this->skelAnime.animation == &D_06015B7C))) {
+ if (this->unk_1D8.unk_00 == 0 && ((this->skelAnime.animation == &object_ma1_Anim_007328) ||
+ (this->skelAnime.animation == &object_ma1_Anim_002A8C) ||
+ (this->skelAnime.animation == &object_ma1_Anim_015B7C))) {
flag = 1;
} else {
flag = (this->type == MA4_TYPE_ALIENS_WON && this->actionFunc != EnMa4_DialogueHandler) ? 1 : 0;
@@ -201,7 +183,7 @@ void EnMa4_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable,
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, NULL, this->jointTable, this->morphTable,
MA1_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
@@ -220,14 +202,14 @@ void EnMa4_Init(Actor* thisx, GlobalContext* globalCtx) {
if (CURRENT_DAY == 1) {
this->type = MA4_TYPE_DAY1;
- } else if (gSaveContext.weekEventReg[0x16] & 1) { // Aliens defeated
+ } else if (gSaveContext.weekEventReg[22] & 1) { // Aliens defeated
this->type = MA4_TYPE_ALIENS_DEFEATED;
} else {
this->type = MA4_TYPE_ALIENS_WON;
this->hasBow = false;
}
- if (func_800EE1D8(globalCtx) != 0) { // if (sceneSetupIndex != 0)
+ if (Cutscene_GetSceneSetupIndex(globalCtx) != 0) { // if (sceneSetupIndex != 0)
EnMa4_ChangeAnim(this, 0);
this->state = MA4_STATE_HORSEBACKGAME;
EnMa4_InitHorsebackGame(this, globalCtx);
@@ -258,7 +240,7 @@ void EnMa4_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnMa4* this = THIS;
Collider_DestroyCylinder(globalCtx, &this->collider);
- gSaveContext.weekEventReg[0x8] &= (u8)~0x01;
+ gSaveContext.weekEventReg[8] &= (u8)~1;
}
// Running in circles in the ranch
@@ -318,7 +300,7 @@ void EnMa4_RunInCircles(EnMa4* this, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
Actor_MoveWithGravity(&this->actor);
- if (this->skelAnime.animation == &D_06007328) { // Walking animation
+ if (this->skelAnime.animation == &object_ma1_Anim_007328) { // Walking animation
if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 4.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_ROMANI_WALK);
}
@@ -350,7 +332,7 @@ void EnMa4_Wait(EnMa4* this, GlobalContext* globalCtx) {
s16 yaw = this->actor.shape.rot.y - this->actor.yawTowardsPlayer;
if ((this->state == MA4_STATE_AFTERHORSEBACKGAME) || (this->state == MA4_STATE_AFTERDESCRIBETHEMCS)) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
} else if (this->type != MA4_TYPE_ALIENS_WON) {
EnMa4_RunInCircles(this, globalCtx);
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
@@ -380,11 +362,11 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3339:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x333A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x333A, &this->actor);
this->textId = 0x333A;
} else {
func_8019F208();
- func_801518B0(globalCtx, 0x333B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x333B, &this->actor);
this->textId = 0x333B;
}
break;
@@ -392,13 +374,13 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3341:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- gSaveContext.weekEventReg[0x15] |= 0x20;
- func_801518B0(globalCtx, 0x3343, &this->actor);
+ gSaveContext.weekEventReg[21] |= 0x20;
+ Message_StartTextbox(globalCtx, 0x3343, &this->actor);
this->textId = 0x3343;
} else {
func_8019F230();
EnMa4_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x3342, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3342, &this->actor);
this->textId = 0x3342;
this->state = MA4_STATE_DEFAULT;
func_80151BB4(globalCtx, 5);
@@ -408,13 +390,13 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3346:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- gSaveContext.weekEventReg[0x15] |= 0x20;
- func_801518B0(globalCtx, 0x3343, &this->actor);
+ gSaveContext.weekEventReg[21] |= 0x20;
+ Message_StartTextbox(globalCtx, 0x3343, &this->actor);
this->textId = 0x3343;
} else {
func_8019F230();
EnMa4_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x3342, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3342, &this->actor);
this->textId = 0x3342;
}
break;
@@ -422,11 +404,11 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3347:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x3349, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3349, &this->actor);
this->textId = 0x3349;
} else {
func_8019F230();
- func_801518B0(globalCtx, 0x3348, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3348, &this->actor);
this->textId = 0x3348;
func_80151BB4(globalCtx, 5);
}
@@ -437,7 +419,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
s32 aux;
func_8019F208();
- func_801518B0(globalCtx, 0x334E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334E, &this->actor);
this->textId = 0x334E;
if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
func_80151BB4(globalCtx, 0x1C);
@@ -446,7 +428,7 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
} else { // No.
func_8019F230();
EnMa4_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x334C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334C, &this->actor);
this->textId = 0x334C;
}
break;
@@ -454,12 +436,12 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3354:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x3349, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3349, &this->actor);
this->textId = 0x3349;
} else {
func_8019F230();
EnMa4_SetFaceExpression(this, 1, 0);
- func_801518B0(globalCtx, 0x3355, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3355, &this->actor);
this->textId = 0x3355;
func_80151BB4(globalCtx, 5);
}
@@ -475,13 +457,13 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
if (this->type == MA4_TYPE_ALIENS_DEFEATED) {
func_8019F230();
EnMa4_SetFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x3357, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3357, &this->actor);
this->textId = 0x3357;
func_80151BB4(globalCtx, 5);
} else {
func_8019F230();
EnMa4_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x335B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x335B, &this->actor);
this->textId = 0x335B;
func_80151BB4(globalCtx, 5);
}
@@ -491,12 +473,12 @@ void EnMa4_HandlePlayerChoice(EnMa4* this, GlobalContext* globalCtx) {
case 0x3359:
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x3349, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3349, &this->actor);
this->textId = 0x3349;
} else {
func_8019F230();
EnMa4_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x335A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x335A, &this->actor);
this->textId = 0x335A;
func_80151BB4(globalCtx, 5);
}
@@ -518,31 +500,31 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
case 0x3335:
EnMa4_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3336, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3336, &this->actor);
this->textId = 0x3336;
func_80151BB4(globalCtx, 5);
break;
case 0x3338:
- func_801518B0(globalCtx, 0x3339, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3339, &this->actor);
this->textId = 0x3339;
break;
case 0x333A:
case 0x333B:
EnMa4_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x333C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x333C, &this->actor);
this->textId = 0x333C;
break;
case 0x333C:
EnMa4_SetFaceExpression(this, 0, 2);
- func_801518B0(globalCtx, 0x333D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x333D, &this->actor);
this->textId = 0x333D;
break;
case 0x333D:
- func_801518B0(globalCtx, 0x333E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x333E, &this->actor);
this->textId = 0x333E;
break;
@@ -552,34 +534,34 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
break;
case 0x333F:
- func_801518B0(globalCtx, 0x3340, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3340, &this->actor);
this->textId = 0x3340;
break;
case 0x3340:
EnMa4_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3341, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3341, &this->actor);
this->textId = 0x3341;
break;
case 0x3343:
EnMa4_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x3344, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3344, &this->actor);
this->textId = 0x3344;
break;
case 0x3344:
- func_801518B0(globalCtx, 0x3345, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3345, &this->actor);
this->textId = 0x3345;
break;
case 0x3345:
- func_801518B0(globalCtx, 0x3349, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3349, &this->actor);
this->textId = 0x3349;
break;
case 0x3349:
- func_801518B0(globalCtx, 0x334A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334A, &this->actor);
this->textId = 0x334A;
break;
@@ -589,7 +571,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
break;
case 0x334C:
- func_801518B0(globalCtx, 0x334D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334D, &this->actor);
this->textId = 0x334D;
break;
@@ -598,10 +580,10 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
case 0x335D:
case 0x335E:
if (this->type == MA4_TYPE_DAY1) {
- func_801518B0(globalCtx, 0x3352, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3352, &this->actor);
this->textId = 0x3352;
} else {
- func_801518B0(globalCtx, 0x3356, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3356, &this->actor);
this->textId = 0x3356;
}
break;
@@ -612,7 +594,7 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
// Check if player has Epona's song
if (CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) {
- func_801518B0(globalCtx, 0x334C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334C, &this->actor);
this->textId = 0x334C;
} else {
func_801477B4(globalCtx);
@@ -624,11 +606,11 @@ void EnMa4_ChooseNextDialogue(EnMa4* this, GlobalContext* globalCtx) {
case 0x3358:
if ((gSaveContext.playerForm != PLAYER_FORM_HUMAN) || !(CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) {
- func_801518B0(globalCtx, 0x335C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x335C, &this->actor);
this->textId = 0x335C;
func_80151BB4(globalCtx, 5);
} else {
- func_801518B0(globalCtx, 0x3359, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3359, &this->actor);
this->textId = 0x3359;
}
break;
@@ -694,7 +676,7 @@ void EnMa4_BeginHorsebackGame(EnMa4* this, GlobalContext* globalCtx) {
void EnMa4_HorsebackGameCheckPlayerInteractions(EnMa4* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
// "You're feeling confident"
- func_801518B0(globalCtx, 0x336E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x336E, &this->actor);
this->actionFunc = EnMa4_HorsebackGameTalking;
} else if ((gSaveContext.unk_3DE0[4] < 115 * 100)) { // timer < 115 seconds
func_800B8614(&this->actor, globalCtx, 100.0f);
@@ -712,7 +694,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, GlobalContext* globalCtx) {
globalCtx->interfaceCtx.unk_280 = 1;
func_8010E9F0(4, 0);
- gSaveContext.weekEventReg[0x8] |= 0x01;
+ gSaveContext.weekEventReg[8] |= 1;
func_80112AFC(globalCtx);
player->stateFlags1 |= 0x20;
this->actionFunc = EnMa4_SetupHorsebackGameWait;
@@ -748,7 +730,7 @@ void EnMa4_HorsebackGameWait(EnMa4* this, GlobalContext* globalCtx) {
}
void EnMa4_SetupHorsebackGameEnd(EnMa4* this, GlobalContext* globalCtx) {
- gSaveContext.weekEventReg[0x8] &= (u8)~0x01;
+ gSaveContext.weekEventReg[8] &= (u8)~1;
this->actionFunc = EnMa4_HorsebackGameEnd;
Audio_QueueSeqCmd(NA_BGM_STOP);
Audio_QueueSeqCmd(NA_BGM_HORSE_GOAL | 0x8000);
@@ -767,10 +749,10 @@ void EnMa4_HorsebackGameEnd(EnMa4* this, GlobalContext* globalCtx) {
if (sFrameCounter == 25) {
if (this->poppedBalloonCounter == 10) {
- func_801518B0(globalCtx, 0x334F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334F, &this->actor);
this->textId = 0x334F;
} else {
- func_801518B0(globalCtx, 0x334B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334B, &this->actor);
this->textId = 0x334B;
}
} else if (sFrameCounter == 50) {
@@ -820,15 +802,15 @@ void EnMa4_SetupEponasSongCs(EnMa4* this) {
static u16 D_80AC0260 = 99;
void EnMa4_EponasSongCs(EnMa4* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x78) != 0) {
- u32 actionIndex = func_800EE200(globalCtx, 0x78);
+ if (Cutscene_CheckActorAction(globalCtx, 120)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 120);
- if (globalCtx->csCtx.frames == globalCtx->csCtx.npcActions[actionIndex]->startFrame) {
- if (globalCtx->csCtx.npcActions[actionIndex]->unk0 != D_80AC0260) {
- D_80AC0260 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ if (globalCtx->csCtx.actorActions[actionIndex]->action != D_80AC0260) {
+ D_80AC0260 = globalCtx->csCtx.actorActions[actionIndex]->action;
this->animTimer = 0;
- switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
this->hasBow = true;
EnMa4_ChangeAnim(this, 1);
@@ -842,7 +824,7 @@ void EnMa4_EponasSongCs(EnMa4* this, GlobalContext* globalCtx) {
}
}
- func_800EDF24(&this->actor, globalCtx, actionIndex);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
if (D_80AC0260 == 2 && this->animTimer == 0 && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnMa4_ChangeAnim(this, 7);
}
@@ -864,12 +846,12 @@ void EnMa4_SetupEndEponasSongCs(EnMa4* this) {
void EnMa4_EndEponasSongCs(EnMa4* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state) != 0) {
player->stateFlags1 &= ~0x20;
- func_801518B0(globalCtx, 0x334C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x334C, &this->actor);
this->textId = 0x334C;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
EnMa4_SetupDialogueHandler(this);
} else {
func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1);
@@ -895,128 +877,128 @@ void EnMa4_StartDialogue(EnMa4* this, GlobalContext* globalCtx) {
switch (this->type) {
case MA4_TYPE_DAY1:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
- if ((gSaveContext.weekEventReg[0x15] & 0x80)) {
+ if ((gSaveContext.weekEventReg[21] & 0x80)) {
EnMa4_SetFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x3337, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3337, &this->actor);
this->textId = 0x3337;
func_80151BB4(globalCtx, 5);
} else {
- func_801518B0(globalCtx, 0x3335, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3335, &this->actor);
this->textId = 0x3335;
- gSaveContext.weekEventReg[0x15] |= 0x80;
+ gSaveContext.weekEventReg[21] |= 0x80;
}
} else if (this->state == MA4_STATE_DEFAULT) {
- if ((gSaveContext.weekEventReg[0x15] & 0x40)) {
- if (!(gSaveContext.weekEventReg[0x15] & 0x20)) {
- func_801518B0(globalCtx, 0x3346, &this->actor);
+ if ((gSaveContext.weekEventReg[21] & 0x40)) {
+ if (!(gSaveContext.weekEventReg[21] & 0x20)) {
+ Message_StartTextbox(globalCtx, 0x3346, &this->actor);
this->textId = 0x3346;
} else {
- func_801518B0(globalCtx, 0x3347, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3347, &this->actor);
this->textId = 0x3347;
}
} else {
- func_801518B0(globalCtx, 0x3338, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3338, &this->actor);
this->textId = 0x3338;
- gSaveContext.weekEventReg[0x15] |= 0x40;
+ gSaveContext.weekEventReg[21] |= 0x40;
}
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
// "Too bad Grasshopper"
EnMa4_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x336D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x336D, &this->actor);
this->textId = 0x336D;
} else {
time = gSaveContext.unk_3DE0[4];
- if ((s32)time < (s32)gSaveContext.roomInf[127][4]) {
+ if ((s32)time < (s32)gSaveContext.horseBackBalloonHighScore) {
// [Score] New record!
- gSaveContext.roomInf[127][4] = time;
+ gSaveContext.horseBackBalloonHighScore = time;
EnMa4_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3350, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3350, &this->actor);
this->textId = 0x3350;
} else {
// [Score] Great.
- func_801518B0(globalCtx, 0x3351, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3351, &this->actor);
this->textId = 0x3351;
}
}
this->state = MA4_STATE_DEFAULT;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
} else if (this->state == MA4_STATE_AFTERDESCRIBETHEMCS) {
// "Cremia doesn't believe me..."
- func_801518B0(globalCtx, 0x3340, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3340, &this->actor);
this->textId = 0x3340;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
break;
case MA4_TYPE_ALIENS_DEFEATED:
if (gSaveContext.playerForm != PLAYER_FORM_HUMAN) {
- if ((gSaveContext.weekEventReg[0x15] & 0x80)) {
+ if ((gSaveContext.weekEventReg[21] & 0x80)) {
EnMa4_SetFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x3337, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3337, &this->actor);
this->textId = 0x3337;
func_80151BB4(globalCtx, 5);
} else {
- func_801518B0(globalCtx, 0x3335, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3335, &this->actor);
this->textId = 0x3335;
- gSaveContext.weekEventReg[0x15] |= 0x80;
+ gSaveContext.weekEventReg[21] |= 0x80;
}
} else if (this->state == MA4_STATE_DEFAULT) {
- func_801518B0(globalCtx, 0x3354, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3354, &this->actor);
this->textId = 0x3354;
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
// "Try again?"
- func_801518B0(globalCtx, 0x3356, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3356, &this->actor);
this->textId = 0x3356;
} else {
time = gSaveContext.unk_3DE0[4];
- if ((s32)time < (s32)gSaveContext.roomInf[127][4]) {
- gSaveContext.roomInf[127][4] = time;
+ if ((s32)time < (s32)gSaveContext.horseBackBalloonHighScore) {
+ gSaveContext.horseBackBalloonHighScore = time;
EnMa4_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3350, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3350, &this->actor);
this->textId = 0x3350;
} else {
- func_801518B0(globalCtx, 0x3351, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3351, &this->actor);
this->textId = 0x3351;
}
}
this->state = MA4_STATE_DEFAULT;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
break;
case MA4_TYPE_ALIENS_WON:
if (this->state == MA4_STATE_DEFAULT) {
// "Huh... You?"
- func_801518B0(globalCtx, 0x3358, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3358, &this->actor);
this->textId = 0x3358;
} else if (this->state == MA4_STATE_AFTERHORSEBACKGAME) {
if (gSaveContext.unk_3DE0[4] >= 2 * 60 * 100) {
// "Try again?"
- func_801518B0(globalCtx, 0x3356, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3356, &this->actor);
this->textId = 0x3356;
} else {
time = gSaveContext.unk_3DE0[4];
- if ((s32)time < (s32)gSaveContext.roomInf[127][4]) {
+ if ((s32)time < (s32)gSaveContext.horseBackBalloonHighScore) {
// New record
- gSaveContext.roomInf[127][4] = time;
- func_801518B0(globalCtx, 0x335D, &this->actor);
+ gSaveContext.horseBackBalloonHighScore = time;
+ Message_StartTextbox(globalCtx, 0x335D, &this->actor);
this->textId = 0x335D;
} else {
// "Old record was: [record]"
- func_801518B0(globalCtx, 0x335E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x335E, &this->actor);
this->textId = 0x335E;
}
}
this->state = MA4_STATE_DEFAULT;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
break;
default:
// Dead code
- func_801518B0(globalCtx, 0x3335, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3335, &this->actor);
this->textId = 0x3335;
break;
}
@@ -1074,7 +1056,7 @@ void EnMa4_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
} else if (limbIndex == MA1_LIMB_HAND_LEFT) {
if (this->hasBow == true) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_060003B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
@@ -1086,7 +1068,7 @@ void EnMa4_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
if (this->type == MA4_TYPE_ALIENS_WON) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000A20);
+ gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_000A20);
}
func_8012C28C(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c
index 92a56a4198..9294a6a71b 100644
--- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c
+++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ma_yto.h"
+#include "objects/object_ma2/object_ma2.h"
-#define FLAGS 0x02100009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((EnMaYto*)thisx)
@@ -108,60 +109,31 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, MASS_IMMOVABLE,
};
-extern FlexSkeletonHeader D_06015C28;
-
-extern AnimationHeader D_0600A174;
-extern AnimationHeader D_0600AF7C;
-extern AnimationHeader D_06000CC0;
-extern AnimationHeader D_06016720;
-extern AnimationHeader D_06005314;
-extern AnimationHeader D_060093E8;
-extern AnimationHeader D_06007E28;
-extern AnimationHeader D_060070EC;
-extern AnimationHeader D_06003D54;
-extern AnimationHeader D_06001FD0;
-extern AnimationHeader D_060030B4;
-extern AnimationHeader D_06004370;
-
-extern void* D_06014AD8[];
-extern void* D_06014ED8[];
-extern void* D_060152D8[];
-extern void* D_060156D8[];
-
-extern void* D_06011AD8[];
-extern void* D_060122D8[];
-extern void* D_06012AD8[];
-extern void* D_060132D8[];
-extern void* D_06013AD8[];
-extern void* D_060142D8[];
-
-// gCremiaWoodenBox
-extern Gfx D_06005430[];
-
-static struct_80B8E1A8 sAnimationInfo[] = {
- { &D_0600A174, 1.0f, 0, 0.0f }, { &D_0600A174, 1.0f, 0, -6.0f }, //
- { &D_0600AF7C, 1.0f, 2, 0.0f }, { &D_0600AF7C, 1.0f, 2, -6.0f }, //
- { &D_06000CC0, 1.0f, 0, 0.0f }, { &D_06000CC0, 1.0f, 0, -6.0f }, //
- { &D_06016720, 1.0f, 0, 0.0f }, { &D_06016720, 1.0f, 0, -8.0f }, //
- { &D_06005314, 1.0f, 0, 0.0f }, { &D_06005314, 1.0f, 0, -8.0f }, //
- { &D_060093E8, 1.0f, 0, 0.0f }, { &D_060093E8, 1.0f, 0, -10.0f }, //
- { &D_06007E28, 1.0f, 0, 0.0f }, { &D_06007E28, 1.0f, 0, -8.0f }, //
- { &D_060070EC, 1.0f, 0, 0.0f }, { &D_060070EC, 1.0f, 0, -8.0f }, //
- { &D_06003D54, 1.0f, 0, 0.0f }, { &D_06003D54, 1.0f, 0, -8.0f }, //
- { &D_06001FD0, 1.0f, 0, 0.0f }, { &D_06001FD0, 1.0f, 0, -8.0f }, //
- { &D_060030B4, 1.0f, 0, 0.0f }, { &D_060030B4, 1.0f, 0, -8.0f }, //
- { &D_06004370, 1.0f, 0, 0.0f }, { &D_06004370, 1.0f, 0, -8.0f }, //
+static AnimationSpeedInfo sAnimationInfo[] = {
+ { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_00A174, 1.0f, ANIMMODE_LOOP, -6.0f }, //
+ { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, 0.0f }, { &object_ma2_Anim_00AF7C, 1.0f, ANIMMODE_ONCE, -6.0f }, //
+ { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_000CC0, 1.0f, ANIMMODE_LOOP, -6.0f }, //
+ { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_016720, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_005314, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0093E8, 1.0f, ANIMMODE_LOOP, -10.0f }, //
+ { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_007E28, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0070EC, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_003D54, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_001FD0, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_0030B4, 1.0f, ANIMMODE_LOOP, -8.0f }, //
+ { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_ma2_Anim_004370, 1.0f, ANIMMODE_LOOP, -8.0f }, //
};
-static void* sMouthTextures[] = {
- D_06014AD8,
- D_06014ED8,
- D_060152D8,
- D_060156D8,
+static TexturePtr sMouthTextures[] = {
+ object_ma2_Tex_014AD8,
+ object_ma2_Tex_014ED8,
+ object_ma2_Tex_0152D8,
+ object_ma2_Tex_0156D8,
};
-static void* sEyesTextures[] = {
- D_06011AD8, D_060122D8, D_06012AD8, D_060132D8, D_06013AD8, D_060142D8,
+static TexturePtr sEyesTextures[] = {
+ object_ma2_Tex_011AD8, object_ma2_Tex_0122D8, object_ma2_Tex_012AD8,
+ object_ma2_Tex_0132D8, object_ma2_Tex_013AD8, object_ma2_Tex_0142D8,
};
void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -174,7 +146,7 @@ void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk320 = 0;
this->eyeTexIndex = 0;
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
EnMaYto_SetFaceExpression(this, 0, 1);
} else {
EnMaYto_SetFaceExpression(this, 5, 2);
@@ -189,7 +161,7 @@ void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06015C28, NULL, this->jointTable, this->morphTable,
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma2_Skel_015C28, NULL, this->jointTable, this->morphTable,
MA2_LIMB_MAX);
EnMaYto_InitAnimation(this, globalCtx);
@@ -208,19 +180,19 @@ void EnMaYto_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 EnMaYto_CheckValidSpawn(EnMaYto* this, GlobalContext* globalCtx) {
switch (this->type) {
case MA_YTO_TYPE_DEFAULT:
- if (CURRENT_DAY == 3 && !(gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 3 && !(gSaveContext.weekEventReg[22] & 1)) {
return false;
}
break;
case MA_YTO_TYPE_DINNER:
- if (CURRENT_DAY != 1 && (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY != 1 && (gSaveContext.weekEventReg[22] & 1)) {
return false;
}
break;
case MA_YTO_TYPE_BARN:
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
if (((this->actor.params & 0x0F00) >> 8) != 0) {
return false;
}
@@ -233,9 +205,9 @@ s32 EnMaYto_CheckValidSpawn(EnMaYto* this, GlobalContext* globalCtx) {
break;
case MA_YTO_TYPE_AFTERMILKRUN:
- // if (!(ProtectedCremia) && !(gSaveContext.weekEventReg[0x34] & 2)) || (PlayedMilkMinigame))
- if ((!(gSaveContext.weekEventReg[0x34] & 1) && !(gSaveContext.weekEventReg[0x34] & 2)) ||
- (gSaveContext.weekEventReg[0xE] & 1)) {
+ // if (!(ProtectedCremia) && !(gSaveContext.weekEventReg[52] & 2)) || (PlayedMilkMinigame))
+ if ((!(gSaveContext.weekEventReg[52] & 1) && !(gSaveContext.weekEventReg[52] & 2)) ||
+ (gSaveContext.weekEventReg[14] & 1)) {
return false;
}
break;
@@ -263,7 +235,7 @@ void EnMaYto_InitAnimation(EnMaYto* this, GlobalContext* globalCtx) {
case MA_YTO_TYPE_BARN:
// if (AliensDefeated)
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
EnMaYto_ChangeAnim(this, 12);
} else {
EnMaYto_ChangeAnim(this, 8);
@@ -301,7 +273,7 @@ void EnMaYto_ChooseAction(EnMaYto* this, GlobalContext* globalCtx) {
case MA_YTO_TYPE_AFTERMILKRUN:
this->unk310 = 0;
- if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI && (gSaveContext.weekEventReg[0x34] & 1) &&
+ if (INV_CONTENT(ITEM_MASK_ROMANI) == ITEM_MASK_ROMANI && (gSaveContext.weekEventReg[52] & 1) &&
(Rand_Next() & 0x80)) {
EnMaYto_SetupBeginWarmFuzzyFeelingCs(this);
} else {
@@ -310,7 +282,7 @@ void EnMaYto_ChooseAction(EnMaYto* this, GlobalContext* globalCtx) {
break;
case MA_YTO_TYPE_4:
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
EnMaYto_SetupWarmFuzzyFeelingCs(this);
break;
@@ -356,7 +328,7 @@ s32 EnMaYto_TryFindRomani(EnMaYto* this, GlobalContext* globalCtx) {
return 0;
case MA_YTO_TYPE_DINNER:
- if (!(gSaveContext.weekEventReg[0x16] & 1) && CURRENT_DAY == 2) {
+ if (!(gSaveContext.weekEventReg[22] & 1) && CURRENT_DAY == 2) {
return 0;
}
if (EnMaYto_SearchRomani(this, globalCtx)) {
@@ -366,7 +338,7 @@ s32 EnMaYto_TryFindRomani(EnMaYto* this, GlobalContext* globalCtx) {
case MA_YTO_TYPE_BARN:
// if (AliensDefeated)
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
if (EnMaYto_SearchRomani(this, globalCtx)) {
return 2;
}
@@ -464,7 +436,7 @@ void EnMaYto_DefaultDialogueHandler(EnMaYto* this, GlobalContext* globalCtx) {
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3000, 0x100);
- if (this->textId == 0x3395 && this->skelAnime.animation == &D_0600AF7C &&
+ if (this->textId == 0x3395 && this->skelAnime.animation == &object_ma2_Anim_00AF7C &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnMaYto_ChangeAnim(this, 4);
}
@@ -476,12 +448,12 @@ void EnMaYto_DefaultHandlePlayerChoice(EnMaYto* this, GlobalContext* globalCtx)
func_8019F208();
EnMaYto_SetFaceExpression(this, 0, 3);
// "Milk Road is fixed!"
- func_801518B0(globalCtx, 0x3392, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3392, &this->actor);
this->textId = 0x3392;
} else { // No
func_8019F230();
// "Don't lie!"
- func_801518B0(globalCtx, 0x3391, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3391, &this->actor);
this->textId = 0x3391;
}
}
@@ -492,26 +464,26 @@ void EnMaYto_DefaultChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx)
switch (this->textId) {
case 0x3391:
EnMaYto_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3392, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3392, &this->actor);
this->textId = 0x3392;
break;
case 0x3392:
EnMaYto_SetFaceExpression(this, 3, 1);
- func_801518B0(globalCtx, 0x3393, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3393, &this->actor);
this->textId = 0x3393;
func_80151BB4(globalCtx, 6);
break;
case 0x3394:
EnMaYto_ChangeAnim(this, 2);
- func_801518B0(globalCtx, 0x3395, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3395, &this->actor);
this->textId = 0x3395;
break;
case 0x3395:
EnMaYto_ChangeAnim(this, 1);
- func_801518B0(globalCtx, 0x3396, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3396, &this->actor);
this->textId = 0x3396;
func_80151BB4(globalCtx, 6);
break;
@@ -520,7 +492,7 @@ void EnMaYto_DefaultChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx)
}
void EnMaYto_SetupDinnerWait(EnMaYto* this) {
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
func_80B90E50(this, 0);
this->unk31E = 0;
} else {
@@ -561,7 +533,7 @@ void EnMaYto_DinnerWait(EnMaYto* this, GlobalContext* globalCtx) {
}
void EnMaYto_SetupDinnerDialogueHandler(EnMaYto* this) {
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
func_80B90E50(this, 1);
} else {
func_80B90E50(this, 2);
@@ -601,12 +573,12 @@ void EnMaYto_DinnerHandlePlayerChoice(EnMaYto* this, GlobalContext* globalCtx) {
func_8019F208();
EnMaYto_SetFaceExpression(this, 0, 3);
// "Milk Road is fixed!"
- func_801518B0(globalCtx, 0x3399, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3399, &this->actor);
this->textId = 0x3399;
} else { // No
func_8019F230();
// "Don't lie!"
- func_801518B0(globalCtx, 0x3398, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3398, &this->actor);
this->textId = 0x3398;
}
}
@@ -617,20 +589,20 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
switch (this->textId) {
case 0x3398:
EnMaYto_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x3399, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3399, &this->actor);
this->textId = 0x3399;
break;
case 0x3399:
EnMaYto_SetFaceExpression(this, 3, 1);
- func_801518B0(globalCtx, 0x339A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339A, &this->actor);
this->textId = 0x339A;
break;
case 0x339A:
this->unk31E = 1;
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x339B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339B, &this->actor);
this->textId = 0x339B;
break;
@@ -638,7 +610,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
func_80B90E50(this, 0);
EnMaYto_SetRomaniFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x339C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339C, &this->actor);
this->textId = 0x339C;
break;
@@ -646,7 +618,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
this->unk31E = 1;
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
EnMaYto_SetFaceExpression(this, 0, 2);
- func_801518B0(globalCtx, 0x339D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339D, &this->actor);
this->textId = 0x339D;
break;
@@ -654,7 +626,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
func_80B90E50(this, 1);
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
EnMaYto_SetRomaniFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x339E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339E, &this->actor);
this->textId = 0x339E;
func_80151BB4(globalCtx, 6);
func_80151BB4(globalCtx, 5);
@@ -662,12 +634,12 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
case 0x339F:
this->unk31E = 0;
- func_801518B0(globalCtx, 0x33A0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A0, &this->actor);
this->textId = 0x33A0;
break;
case 0x33A0:
- func_801518B0(globalCtx, 0x33A1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A1, &this->actor);
this->textId = 0x33A1;
break;
@@ -675,7 +647,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
func_80B90E50(this, 1);
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
EnMaYto_SetRomaniFaceExpression(this, 0, 2);
- func_801518B0(globalCtx, 0x33A2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A2, &this->actor);
this->textId = 0x33A2;
break;
@@ -683,27 +655,27 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
this->unk31E = 1;
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
EnMaYto_SetFaceExpression(this, 4, 3);
- func_801518B0(globalCtx, 0x33A3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A3, &this->actor);
this->textId = 0x33A3;
break;
case 0x33A3:
this->unk31E = 0;
EnMaYto_SetFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x33A4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A4, &this->actor);
this->textId = 0x33A4;
func_80151BB4(globalCtx, 6);
func_80151BB4(globalCtx, 5);
break;
case 0x33A5:
- func_801518B0(globalCtx, 0x33A6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A6, &this->actor);
this->textId = 0x33A6;
func_80151BB4(globalCtx, 6);
break;
case 0x33A7:
- func_801518B0(globalCtx, 0x33A8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A8, &this->actor);
this->textId = 0x33A8;
func_80151BB4(globalCtx, 6);
break;
@@ -712,7 +684,7 @@ void EnMaYto_DinnerChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
}
void EnMaYto_SetupBarnWait(EnMaYto* this) {
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
EnMaYto_ChangeAnim(this, 13);
func_80B90E50(this, 0);
this->unk31E = 0;
@@ -740,7 +712,7 @@ void EnMaYto_BarnWait(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
EnMaYto_BarnStartDialogue(this, globalCtx);
EnMaYto_SetupBarnDialogueHandler(this);
- } else if (!(gSaveContext.weekEventReg[0x16] & 1) || ABS_ALT(direction) < 0x2000) {
+ } else if (!(gSaveContext.weekEventReg[22] & 1) || ABS_ALT(direction) < 0x2000) {
func_800B8614(&this->actor, globalCtx, 100.0f);
child = this->actor.child;
@@ -752,7 +724,7 @@ void EnMaYto_BarnWait(EnMaYto* this, GlobalContext* globalCtx) {
}
void EnMaYto_SetupBarnDialogueHandler(EnMaYto* this) {
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
func_80B90E50(this, 1);
} else {
func_80B90E50(this, 2);
@@ -790,14 +762,14 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
func_80B90E50(this, 0);
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
EnMaYto_SetRomaniFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x33AA, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AA, &this->actor);
this->textId = 0x33AA;
break;
case 0x33AA:
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
this->unk31E = 1;
- func_801518B0(globalCtx, 0x33AB, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AB, &this->actor);
this->textId = 0x33AB;
break;
@@ -805,14 +777,14 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
func_80B90E50(this, 1);
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
EnMaYto_SetRomaniFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33AC, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AC, &this->actor);
this->textId = 0x33AC;
break;
case 0x33AC:
this->unk31E = 0;
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
- func_801518B0(globalCtx, 0x33AD, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AD, &this->actor);
this->textId = 0x33AD;
func_80151BB4(globalCtx, 6);
func_80151BB4(globalCtx, 5);
@@ -822,7 +794,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
func_80B90E50(this, 1);
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
EnMaYto_SetRomaniFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x33AF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AF, &this->actor);
this->textId = 0x33AF;
break;
@@ -830,7 +802,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
this->unk31E = 1;
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
EnMaYto_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x33B0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33B0, &this->actor);
this->textId = 0x33B0;
func_80151BB4(globalCtx, 6);
func_80151BB4(globalCtx, 5);
@@ -840,7 +812,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
this->unk31E = 2;
EnMaYto_SetFaceExpression(this, 5, 3);
// "I should had believed what Romani said"
- func_801518B0(globalCtx, 0x33B2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33B2, &this->actor);
this->textId = 0x33B2;
func_80151BB4(globalCtx, 6);
break;
@@ -849,7 +821,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
this->unk31E = 0;
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33C7, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C7, &this->actor);
this->textId = 0x33C7;
break;
@@ -857,7 +829,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
this->unk31E = 1;
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33C8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C8, &this->actor);
this->textId = 0x33C8;
break;
@@ -865,7 +837,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
func_80B90E50(this, 1);
EnMaYto_SetRomaniFaceExpression(this, 0, 2);
- func_801518B0(globalCtx, 0x33C9, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C9, &this->actor);
this->textId = 0x33C9;
break;
@@ -873,13 +845,13 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, &this->actor);
this->unk31E = 1;
EnMaYto_SetFaceExpression(this, 3, 1);
- func_801518B0(globalCtx, 0x33CA, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33CA, &this->actor);
this->textId = 0x33CA;
break;
case 0x33CA:
this->unk31E = 1;
- func_801518B0(globalCtx, 0x33CB, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33CB, &this->actor);
this->textId = 0x33CB;
break;
@@ -887,7 +859,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
Actor_ChangeFocus(&this->actor, globalCtx, this->actor.child);
func_80B90E50(this, 1);
EnMaYto_SetRomaniFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x33CC, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33CC, &this->actor);
this->textId = 0x33CC;
func_80151BB4(globalCtx, 6);
func_80151BB4(globalCtx, 5);
@@ -900,7 +872,7 @@ void EnMaYto_BarnChooseNextDialogue(EnMaYto* this, GlobalContext* globalCtx) {
}
void EnMaYto_SetupAfterMilkRunInit(EnMaYto* this) {
- if (gSaveContext.weekEventReg[0x34] & 1) { // if (ProtectedCremia)
+ if (gSaveContext.weekEventReg[52] & 1) { // if (ProtectedCremia)
EnMaYto_SetFaceExpression(this, 3, 1);
} else {
func_801A3098(NA_BGM_FAILURE_1);
@@ -910,21 +882,21 @@ void EnMaYto_SetupAfterMilkRunInit(EnMaYto* this) {
}
void EnMaYto_AfterMilkRunInit(EnMaYto* this, GlobalContext* globalCtx) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
- if (gSaveContext.weekEventReg[0x34] & 1) { // if (ProtectedCremia)
- func_801518B0(globalCtx, 0x33C1, &this->actor);
+ if (gSaveContext.weekEventReg[52] & 1) { // if (ProtectedCremia)
+ Message_StartTextbox(globalCtx, 0x33C1, &this->actor);
this->textId = 0x33C1;
} else {
// Fails milk minigame
EnMaYto_SetFaceExpression(this, 5, 2);
- func_801518B0(globalCtx, 0x33C0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C0, &this->actor);
this->textId = 0x33C0;
// Attempted Cremia Cart Ride
- gSaveContext.weekEventReg[0xE] |= 0x1;
+ gSaveContext.weekEventReg[14] |= 1;
this->unk310 = 4;
EnMaYto_SetupPostMilkRunWaitDialogueEnd(this);
func_80151BB4(globalCtx, 6);
@@ -965,7 +937,7 @@ void EnMaYto_AfterMilkRunChooseNextDialogue(EnMaYto* this, GlobalContext* global
case 0x33C1:
EnMaYto_SetFaceExpression(this, 3, 1);
// "Thank you. You were cool back there."
- func_801518B0(globalCtx, 0x33C2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C2, &this->actor);
this->textId = 0x33C2;
break;
@@ -1003,10 +975,10 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, GlobalContext* globalCtx) {
if (this->unk310 == 1) {
// Romani's mask explanation
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33C3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C3, &this->actor);
this->textId = 0x33C3;
// Attempted Cremia Cart Ride
- gSaveContext.weekEventReg[0xE] |= 0x1;
+ gSaveContext.weekEventReg[14] |= 1;
this->unk310 = 3;
func_80151BB4(globalCtx, 0x20);
func_80151BB4(globalCtx, 0x1F);
@@ -1015,10 +987,10 @@ void EnMaYto_PostMilkRunExplainReward(EnMaYto* this, GlobalContext* globalCtx) {
} else {
// You already have the mask
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33D0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33D0, &this->actor);
this->textId = 0x33D0;
// Attempted Cremia Cart Ride
- gSaveContext.weekEventReg[0xE] |= 0x1;
+ gSaveContext.weekEventReg[14] |= 1;
this->unk310 = 3;
func_80151BB4(globalCtx, 6);
EnMaYto_SetupPostMilkRunWaitDialogueEnd(this);
@@ -1052,11 +1024,11 @@ void EnMaYto_SetupWarmFuzzyFeelingCs(EnMaYto* this) {
static u16 D_80B915F0 = 99;
void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x22C) != 0) {
- u32 csActionIndex = func_800EE200(globalCtx, 0x22C);
+ if (Cutscene_CheckActorAction(globalCtx, 556)) {
+ s32 csActionIndex = Cutscene_GetActorActionIndex(globalCtx, 556);
- if (globalCtx->csCtx.frames == globalCtx->csCtx.npcActions[csActionIndex]->startFrame) {
- u16 action = globalCtx->csCtx.npcActions[csActionIndex]->unk0;
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[csActionIndex]->startFrame) {
+ u16 action = globalCtx->csCtx.actorActions[csActionIndex]->action;
if (1) {}
@@ -1069,7 +1041,7 @@ void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, GlobalContext* globalCtx) {
case 2:
// Attempted Cremia Cart Ride
- gSaveContext.weekEventReg[0xE] |= 1;
+ gSaveContext.weekEventReg[14] |= 1;
EnMaYto_ChangeAnim(this, 18);
break;
@@ -1080,8 +1052,8 @@ void EnMaYto_WarmFuzzyFeelingCs(EnMaYto* this, GlobalContext* globalCtx) {
}
}
- func_800EDF24(&this->actor, globalCtx, csActionIndex);
- if (D_80B915F0 == 2 && this->skelAnime.animation == &D_06001FD0 &&
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, csActionIndex);
+ if (D_80B915F0 == 2 && this->skelAnime.animation == &object_ma2_Anim_001FD0 &&
Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
EnMaYto_ChangeAnim(this, 20);
}
@@ -1130,53 +1102,53 @@ void EnMaYto_DefaultStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) != PLAYER_MASK_NONE && gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
switch (Player_GetMask(globalCtx)) {
case PLAYER_MASK_ROMANI:
- func_801518B0(globalCtx, 0x235D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235D, &this->actor);
this->textId = 0x235D;
break;
case PLAYER_MASK_CIRCUS_LEADER:
EnMaYto_SetFaceExpression(this, 1, 3);
- func_801518B0(globalCtx, 0x235E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235E, &this->actor);
this->textId = 0x235E;
break;
case PLAYER_MASK_KAFEIS_MASK:
EnMaYto_SetFaceExpression(this, 1, 2);
- func_801518B0(globalCtx, 0x235F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235F, &this->actor);
this->textId = 0x235F;
break;
case PLAYER_MASK_COUPLE:
- func_801518B0(globalCtx, 0x2360, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2360, &this->actor);
this->textId = 0x2360;
break;
default:
- func_801518B0(globalCtx, 0x2361, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2361, &this->actor);
this->textId = 0x2361;
break;
}
} else {
if (EnMaYto_HasSpokeToPlayer()) {
- func_801518B0(globalCtx, 0x3394, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3394, &this->actor);
this->textId = 0x3394;
} else {
EnMaYto_SetTalkedFlag();
// Asks the player if he came from town.
- func_801518B0(globalCtx, 0x3390, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3390, &this->actor);
this->textId = 0x3390;
}
}
} else if (CURRENT_DAY == 3) {
if (EnMaYto_HasSpokeToPlayerToday()) {
EnMaYto_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x33C5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C5, &this->actor);
this->textId = 0x33C5;
func_80151BB4(globalCtx, 6);
} else {
EnMaYto_SetTalkedFlag();
EnMaYto_SetFaceExpression(this, 0, 3);
- func_801518B0(globalCtx, 0x33C4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C4, &this->actor);
this->textId = 0x33C4;
func_80151BB4(globalCtx, 6);
}
@@ -1189,37 +1161,37 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) != PLAYER_MASK_NONE && gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
switch (Player_GetMask(globalCtx)) {
case PLAYER_MASK_ROMANI:
- func_801518B0(globalCtx, 0x235D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235D, &this->actor);
this->textId = 0x235D;
break;
case PLAYER_MASK_CIRCUS_LEADER:
- func_801518B0(globalCtx, 0x235E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235E, &this->actor);
this->textId = 0x235E;
break;
case PLAYER_MASK_KAFEIS_MASK:
- func_801518B0(globalCtx, 0x235F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x235F, &this->actor);
this->textId = 0x235F;
break;
case PLAYER_MASK_COUPLE:
- func_801518B0(globalCtx, 0x2360, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2360, &this->actor);
this->textId = 0x2360;
break;
default:
- func_801518B0(globalCtx, 0x2361, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2361, &this->actor);
this->textId = 0x2361;
break;
}
} else {
if (EnMaYto_HasSpokeToPlayer()) {
- func_801518B0(globalCtx, 0x339F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x339F, &this->actor);
this->textId = 0x339F;
} else {
EnMaYto_SetTalkedFlag();
- func_801518B0(globalCtx, 0x3397, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3397, &this->actor);
this->textId = 0x3397;
}
}
@@ -1227,24 +1199,24 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
case 2:
if (EnMaYto_HasSpokeToPlayer()) {
- func_801518B0(globalCtx, 0x33A6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A6, &this->actor);
this->textId = 0x33A6;
func_80151BB4(globalCtx, 6);
} else {
EnMaYto_SetTalkedFlag();
- func_801518B0(globalCtx, 0x33A5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A5, &this->actor);
this->textId = 0x33A5;
}
break;
case 3:
if (EnMaYto_HasSpokeToPlayer()) {
- func_801518B0(globalCtx, 0x33A8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A8, &this->actor);
this->textId = 0x33A8;
func_80151BB4(globalCtx, 6);
} else {
EnMaYto_SetTalkedFlag();
- func_801518B0(globalCtx, 0x33A7, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A7, &this->actor);
this->textId = 0x33A7;
}
break;
@@ -1253,26 +1225,26 @@ void EnMaYto_DinnerStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
void EnMaYto_BarnStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
// if (AliensDefeated)
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
if (CURRENT_DAY == 2) {
if (this->unk310 == 1) {
- func_801518B0(globalCtx, 0x33AE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33AE, &this->actor);
this->textId = 0x33AE;
} else {
this->unk310 = 1;
EnMaYto_SetTalkedFlag();
- func_801518B0(globalCtx, 0x33A9, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33A9, &this->actor);
this->textId = 0x33A9;
}
} else if (CURRENT_DAY == 3) {
if (this->unk310 == 1) {
- func_801518B0(globalCtx, 0x33CB, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33CB, &this->actor);
this->textId = 0x33CB;
} else {
this->unk310 = 1;
EnMaYto_SetTalkedFlag();
EnMaYto_SetFaceExpression(this, 0, 1);
- func_801518B0(globalCtx, 0x33C6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33C6, &this->actor);
this->textId = 0x33C6;
}
}
@@ -1280,22 +1252,22 @@ void EnMaYto_BarnStartDialogue(EnMaYto* this, GlobalContext* globalCtx) {
if (EnMaYto_HasSpokeToPlayer()) {
this->unk31E = 2;
EnMaYto_SetFaceExpression(this, 5, 3);
- func_801518B0(globalCtx, 0x33B3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33B3, &this->actor);
this->textId = 0x33B3;
func_80151BB4(globalCtx, 6);
} else {
EnMaYto_SetTalkedFlag();
EnMaYto_SetFaceExpression(this, 5, 3);
- func_801518B0(globalCtx, 0x33B1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x33B1, &this->actor);
this->textId = 0x33B1;
}
}
}
void EnMaYto_ChangeAnim(EnMaYto* this, s32 index) {
- Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f,
- Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode,
- sAnimationInfo[index].transitionRate);
+ Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
+ Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
+ sAnimationInfo[index].morphFrames);
}
void func_80B90C78(EnMaYto* this, GlobalContext* globalCtx) {
@@ -1376,7 +1348,7 @@ void EnMaYto_SetFaceExpression(EnMaYto* this, s16 overrideEyeTexIndex, s16 mouth
}
void EnMaYto_InitFaceExpression(EnMaYto* this) {
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
EnMaYto_SetFaceExpression(this, 0, 1);
EnMaYto_SetRomaniFaceExpression(this, 0, 0);
} else {
@@ -1388,19 +1360,19 @@ void EnMaYto_InitFaceExpression(EnMaYto* this) {
s32 EnMaYto_HasSpokeToPlayerToday(void) {
switch (CURRENT_DAY) {
case 1:
- if (gSaveContext.weekEventReg[0xD] & 0x4) {
+ if (gSaveContext.weekEventReg[13] & 4) {
return true;
}
break;
case 2:
- if (gSaveContext.weekEventReg[0xD] & 0x8) {
+ if (gSaveContext.weekEventReg[13] & 8) {
return true;
}
break;
case 3:
- if (gSaveContext.weekEventReg[0xD] & 0x10) {
+ if (gSaveContext.weekEventReg[13] & 0x10) {
return true;
}
break;
@@ -1412,17 +1384,17 @@ s32 EnMaYto_HasSpokeToPlayer(void) {
// Please note each case doesn't have their respective `break`s.
switch (CURRENT_DAY) {
case 3:
- if (gSaveContext.weekEventReg[0xD] & 0x10) {
+ if (gSaveContext.weekEventReg[13] & 0x10) {
return true;
}
case 2:
- if (gSaveContext.weekEventReg[0xD] & 0x8) {
+ if (gSaveContext.weekEventReg[13] & 8) {
return true;
}
case 1:
- if (gSaveContext.weekEventReg[0xD] & 0x4) {
+ if (gSaveContext.weekEventReg[13] & 4) {
return true;
}
}
@@ -1432,15 +1404,15 @@ s32 EnMaYto_HasSpokeToPlayer(void) {
void EnMaYto_SetTalkedFlag(void) {
switch (CURRENT_DAY) {
case 1:
- gSaveContext.weekEventReg[0xD] |= 0x4;
+ gSaveContext.weekEventReg[13] |= 4;
break;
case 2:
- gSaveContext.weekEventReg[0xD] |= 0x8;
+ gSaveContext.weekEventReg[13] |= 8;
break;
case 3:
- gSaveContext.weekEventReg[0xD] |= 0x10;
+ gSaveContext.weekEventReg[13] |= 0x10;
break;
}
}
@@ -1464,12 +1436,14 @@ s32 EnMaYto_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
rot->x += sp4.y;
rot->z += sp4.x;
} else if (limbIndex == MA2_LIMB_TORSO) {
- if (this->skelAnime.animation != &D_06007E28 && this->skelAnime.animation != &D_06003D54) {
+ if (this->skelAnime.animation != &object_ma2_Anim_007E28 &&
+ this->skelAnime.animation != &object_ma2_Anim_003D54) {
sp4 = this->unk_1D8.unk_0E;
rot->x += sp4.y;
- if (this->skelAnime.animation == &D_0600A174 || this->skelAnime.animation == &D_060070EC ||
- this->skelAnime.animation == &D_06003D54) {
+ if (this->skelAnime.animation == &object_ma2_Anim_00A174 ||
+ this->skelAnime.animation == &object_ma2_Anim_0070EC ||
+ this->skelAnime.animation == &object_ma2_Anim_003D54) {
rot->z += sp4.x;
}
}
@@ -1490,9 +1464,9 @@ void EnMaYto_Draw(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
OPEN_DISPS(globalCtx->state.gfxCtx);
- if (this->type == MA_YTO_TYPE_BARN && (gSaveContext.weekEventReg[0x16] & 1)) { // Alieans defeated
+ if (this->type == MA_YTO_TYPE_BARN && (gSaveContext.weekEventReg[22] & 1)) { // Aliens defeated
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06005430);
+ gSPDisplayList(POLY_OPA_DISP++, gCremiaWoodenBox);
}
func_8012C28C(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c
index 1ed32213a7..bb88e44355 100644
--- a/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c
+++ b/src/overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ma_yts.h"
+#include "objects/object_ma1/object_ma1.h"
-#define FLAGS 0x02100009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((EnMaYts*)thisx)
@@ -29,40 +30,6 @@ void EnMaYts_SetFaceExpression(EnMaYts* this, s16 overrideEyeTexIndex, s16 mouth
void EnMaYts_DrawSleeping(Actor* thisx, GlobalContext* globalCtx);
-extern AnimationHeader D_06009E58;
-extern AnimationHeader D_06018948;
-extern AnimationHeader D_0601B76C;
-extern AnimationHeader D_06007328;
-extern AnimationHeader D_06014088;
-extern AnimationHeader D_06002A8C;
-extern AnimationHeader D_06015B7C;
-extern AnimationHeader D_06007D98;
-extern AnimationHeader D_0600852C;
-extern AnimationHeader D_06008F6C;
-extern AnimationHeader D_060180DC;
-
-extern u64 D_060127C8[];
-extern u64 D_06012BC8[];
-extern u64 D_06012FC8[];
-extern u64 D_060133C8[];
-
-extern u64 D_0600FFC8[];
-extern u64 D_060107C8[];
-extern u64 D_06010FC8[];
-extern u64 D_060117C8[];
-extern u64 D_06011FC8[];
-
-extern FlexSkeletonHeader D_06013928;
-
-extern AnimationHeader D_06009E58;
-extern AnimationHeader D_06007D98;
-
-// Bow
-extern Gfx D_060003B0[];
-
-// Sleeping
-extern Gfx D_060043A0[];
-
const ActorInit En_Ma_Yts_InitVars = {
ACTOR_EN_MA_YTS,
ACTORCAT_NPC,
@@ -111,35 +78,46 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, MASS_IMMOVABLE,
};
-static struct_80B8E1A8 sAnimationInfo[] = {
- { &D_06009E58, 1.0f, 0, 0.0f }, { &D_06009E58, 1.0f, 0, -6.0f }, // Idle anim
- { &D_06018948, 1.0f, 2, 0.0f }, { &D_06018948, 1.0f, 2, -6.0f }, // Starts holding hands anim
- { &D_0601B76C, 1.0f, 0, 0.0f }, { &D_0601B76C, 1.0f, 0, -6.0f }, // Holnding hands anim
- { &D_06007328, 1.0f, 0, 0.0f }, { &D_06007328, 1.0f, 0, -6.0f }, // Walking anim
- { &D_06014088, 1.0f, 0, 0.0f }, { &D_06014088, 1.0f, 0, -6.0f }, //
- { &D_06002A8C, 1.0f, 0, 0.0f }, { &D_06002A8C, 1.0f, 0, -6.0f }, // Looking around anim
- { &D_06015B7C, 1.0f, 0, 0.0f }, { &D_06015B7C, 1.0f, 0, -6.0f }, // Shoot arrow anim
- { &D_06007D98, 1.0f, 0, 0.0f }, { &D_06007D98, 1.0f, 0, -6.0f }, // Sitting anim
- { &D_0600852C, 1.0f, 0, 0.0f }, { &D_0600852C, 1.0f, 0, -6.0f }, // Sitting traumatized anim
- { &D_06008F6C, 1.0f, 0, 0.0f }, { &D_06008F6C, 1.0f, 0, -6.0f }, // Sitting sad anim
- { &D_060180DC, 1.0f, 2, 0.0f }, { &D_060180DC, 1.0f, 2, -6.0f }, // Turns around anim
+static AnimationSpeedInfo sAnimationInfo[] = {
+ { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_009E58, 1.0f, ANIMMODE_LOOP, -6.0f }, // Idle anim
+ { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_ma1_Anim_018948, 1.0f, ANIMMODE_ONCE, -6.0f }, // Starts holding hands anim
+ { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_01B76C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Holnding hands anim
+ { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_007328, 1.0f, ANIMMODE_LOOP, -6.0f }, // Walking anim
+ { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_014088, 1.0f, ANIMMODE_LOOP, -6.0f }, //
+ { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_002A8C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Looking around anim
+ { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_015B7C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Shoot arrow anim
+ { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_007D98, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting anim
+ { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_00852C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting traumatized anim
+ { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_ma1_Anim_008F6C, 1.0f, ANIMMODE_LOOP, -6.0f }, // Sitting sad anim
+ { &object_ma1_Anim_0180DC, 1.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_ma1_Anim_0180DC, 1.0f, ANIMMODE_ONCE, -6.0f }, // Turns around anim
};
-static void* sMouthTextures[] = {
- D_060127C8,
- D_06012BC8,
- D_06012FC8,
- D_060133C8,
+static TexturePtr sMouthTextures[] = {
+ object_ma1_Tex_0127C8,
+ object_ma1_Tex_012BC8,
+ object_ma1_Tex_012FC8,
+ object_ma1_Tex_0133C8,
};
-static void* sEyeTextures[] = {
- D_0600FFC8, D_060107C8, D_06010FC8, D_060117C8, D_06011FC8,
+static TexturePtr sEyeTextures[] = {
+ object_ma1_Tex_00FFC8, object_ma1_Tex_0107C8, object_ma1_Tex_010FC8, object_ma1_Tex_0117C8, object_ma1_Tex_011FC8,
};
void EnMaYts_ChangeAnim(EnMaYts* this, s32 index) {
- Animation_Change(&this->skelAnime, sAnimationInfo[index].animationSeg, 1.0f, 0.0f,
- Animation_GetLastFrame(sAnimationInfo[index].animationSeg), sAnimationInfo[index].mode,
- sAnimationInfo[index].transitionRate);
+ Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, 1.0f, 0.0f,
+ Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode,
+ sAnimationInfo[index].morphFrames);
}
void func_80B8D12C(EnMaYts* this, GlobalContext* globalCtx) {
@@ -167,7 +145,7 @@ void EnMaYts_InitAnimation(EnMaYts* this, GlobalContext* globalCtx) {
case MA_YTS_TYPE_SITTING:
this->actor.targetMode = 6;
// Day 1 or "Winning" the alien invasion
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
EnMaYts_ChangeAnim(this, 14);
} else {
EnMaYts_ChangeAnim(this, 18);
@@ -200,14 +178,14 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, GlobalContext* globalCtx) {
case 2:
// Failing the alien invasion
- if (!(gSaveContext.weekEventReg[0x16] & 1)) {
+ if (!(gSaveContext.weekEventReg[22] & 1)) {
return false;
}
break;
case 3:
// "Winning" the alien invasion
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
return false;
}
break;
@@ -216,7 +194,7 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, GlobalContext* globalCtx) {
case MA_YTS_TYPE_BARN:
// Failing the alien invasion
- if (!(gSaveContext.weekEventReg[0x16] & 1)) {
+ if (!(gSaveContext.weekEventReg[22] & 1)) {
return false;
} else if (gSaveContext.time >= CLOCK_TIME(20, 0) && CURRENT_DAY == 3) {
return false;
@@ -225,7 +203,7 @@ s32 EnMaYts_CheckValidSpawn(EnMaYts* this, GlobalContext* globalCtx) {
case MA_YTS_TYPE_SLEEPING:
// "Winning" the alien invasion
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
return false;
}
break;
@@ -247,7 +225,7 @@ void EnMaYts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 18.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013928, NULL, this->jointTable, this->morphTable,
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ma1_Skel_013928, NULL, this->jointTable, this->morphTable,
MA1_LIMB_MAX);
EnMaYts_InitAnimation(this, globalCtx);
@@ -272,7 +250,7 @@ void EnMaYts_Init(Actor* thisx, GlobalContext* globalCtx) {
this->hasBow = false;
}
- if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[0x16] & 1)) {
+ if (CURRENT_DAY == 1 || (gSaveContext.weekEventReg[22] & 1)) {
this->overrideEyeTexIndex = 0;
this->eyeTexIndex = 0;
this->mouthTexIndex = 0;
@@ -290,7 +268,7 @@ void EnMaYts_Init(Actor* thisx, GlobalContext* globalCtx) {
this->mouthTexIndex = 0;
this->unk_32C = 2;
EnMaYts_SetupEndCreditsHandler(this);
- } else if (CURRENT_DAY == 2 && gSaveContext.isNight == 1 && (gSaveContext.weekEventReg[0x16] & 1)) {
+ } else if (CURRENT_DAY == 2 && gSaveContext.isNight == 1 && (gSaveContext.weekEventReg[22] & 1)) {
EnMaYts_SetupStartDialogue(this);
} else {
EnMaYts_SetupDoNothing(this);
@@ -320,46 +298,46 @@ void EnMaYts_StartDialogue(EnMaYts* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (!(gSaveContext.playerForm == PLAYER_FORM_HUMAN)) {
- if (!(gSaveContext.weekEventReg[0x41] & 0x80)) {
+ if (!(gSaveContext.weekEventReg[65] & 0x80)) {
// Saying to non-human Link: "Cremia went to town."
- gSaveContext.weekEventReg[0x41] |= 0x80;
+ gSaveContext.weekEventReg[65] |= 0x80;
EnMaYts_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x335F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x335F, &this->actor);
this->textId = 0x335F;
} else {
// Saying to non-human Link: "Pretend you did not hear that."
EnMaYts_SetFaceExpression(this, 4, 3);
- func_801518B0(globalCtx, 0x3362, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3362, &this->actor);
this->textId = 0x3362;
func_80151BB4(globalCtx, 5);
}
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_NONE) {
- if (!(gSaveContext.weekEventReg[0x41] & 0x40)) {
- gSaveContext.weekEventReg[0x41] |= 0x40;
+ if (!(gSaveContext.weekEventReg[65] & 0x40)) {
+ gSaveContext.weekEventReg[65] |= 0x40;
EnMaYts_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x3363, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3363, &this->actor);
this->textId = 0x3363;
} else {
EnMaYts_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x3366, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3366, &this->actor);
this->textId = 0x3366;
func_80151BB4(globalCtx, 5);
}
- } else if (!(gSaveContext.weekEventReg[0x15] & 0x20)) {
+ } else if (!(gSaveContext.weekEventReg[21] & 0x20)) {
EnMaYts_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x3367, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3367, &this->actor);
this->textId = 0x3367;
} else {
- if (!(gSaveContext.weekEventReg[0x41] & 0x20)) {
+ if (!(gSaveContext.weekEventReg[65] & 0x20)) {
// Saying to Grasshopper: "Cremia went to town."
- gSaveContext.weekEventReg[0x41] |= 0x20;
+ gSaveContext.weekEventReg[65] |= 0x20;
EnMaYts_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x3369, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3369, &this->actor);
this->textId = 0x3369;
} else {
// Saying to Grasshopper: "You're our bodyguard."
EnMaYts_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x336C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x336C, &this->actor);
this->textId = 0x336C;
func_80151BB4(globalCtx, 5);
}
@@ -396,21 +374,21 @@ void EnMaYts_DialogueHandler(EnMaYts* this, GlobalContext* globalCtx) {
}
void EnMaYts_SetupEndCreditsHandler(EnMaYts* this) {
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
EnMaYts_SetFaceExpression(this, 0, 0);
this->actionFunc = EnMaYts_EndCreditsHandler;
}
static u16 D_80B8E32C = 99;
void EnMaYts_EndCreditsHandler(EnMaYts* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x78) != 0) {
- u32 actionIndex = func_800EE200(globalCtx, 0x78);
+ if (Cutscene_CheckActorAction(globalCtx, 120)) {
+ s32 actionIndex = Cutscene_GetActorActionIndex(globalCtx, 120);
- if (globalCtx->csCtx.frames == globalCtx->csCtx.npcActions[actionIndex]->startFrame) {
- if (globalCtx->csCtx.npcActions[actionIndex]->unk0 != D_80B8E32C) {
- D_80B8E32C = globalCtx->csCtx.npcActions[actionIndex]->unk0;
+ if (globalCtx->csCtx.frames == globalCtx->csCtx.actorActions[actionIndex]->startFrame) {
+ if (globalCtx->csCtx.actorActions[actionIndex]->action != D_80B8E32C) {
+ D_80B8E32C = globalCtx->csCtx.actorActions[actionIndex]->action;
this->endCreditsFlag = 0;
- switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
this->hasBow = true;
EnMaYts_ChangeAnim(this, 0);
@@ -434,9 +412,9 @@ void EnMaYts_EndCreditsHandler(EnMaYts* this, GlobalContext* globalCtx) {
}
}
- func_800EDF24(&this->actor, globalCtx, actionIndex);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
if ((D_80B8E32C == 2) && (this->endCreditsFlag == 0) &&
- (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) != 0)) {
+ Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->endCreditsFlag++;
EnMaYts_ChangeAnim(this, 5);
}
@@ -452,46 +430,46 @@ void EnMaYts_ChooseNextDialogue(EnMaYts* this, GlobalContext* globalCtx) {
switch (this->textId) {
case 0x335F:
EnMaYts_SetFaceExpression(this, 0, 2);
- func_801518B0(globalCtx, 0x3360, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3360, &this->actor);
this->textId = 0x3360;
break;
case 0x3360:
EnMaYts_SetFaceExpression(this, 4, 3);
- func_801518B0(globalCtx, 0x3361, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3361, &this->actor);
this->textId = 0x3361;
func_80151BB4(globalCtx, 5);
break;
case 0x3363:
EnMaYts_SetFaceExpression(this, 1, 1);
- func_801518B0(globalCtx, 0x3364, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3364, &this->actor);
this->textId = 0x3364;
break;
case 0x3364:
EnMaYts_SetFaceExpression(this, 4, 2);
- func_801518B0(globalCtx, 0x3365, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3365, &this->actor);
this->textId = 0x3365;
func_80151BB4(globalCtx, 5);
break;
case 0x3367:
EnMaYts_SetFaceExpression(this, 4, 3);
- func_801518B0(globalCtx, 0x3368, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3368, &this->actor);
this->textId = 0x3368;
func_80151BB4(globalCtx, 5);
break;
case 0x3369:
EnMaYts_SetFaceExpression(this, 0, 0);
- func_801518B0(globalCtx, 0x336A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x336A, &this->actor);
this->textId = 0x336A;
break;
case 0x336A:
EnMaYts_SetFaceExpression(this, 3, 3);
- func_801518B0(globalCtx, 0x336B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x336B, &this->actor);
this->textId = 0x336B;
func_80151BB4(globalCtx, 5);
break;
@@ -523,14 +501,16 @@ void EnMaYts_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80B8D12C(this, globalCtx);
}
-s32 EnMaYts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg) {
- EnMaYts* this = (EnMaYts*)arg;
+s32 EnMaYts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnMaYts* this = THIS;
Vec3s sp4;
if (limbIndex == MA1_LIMB_HEAD) {
sp4 = this->unk_1D8.unk_08;
rot->x += sp4.y;
- if ((this->skelAnime.animation == &D_06009E58) || (this->skelAnime.animation == &D_06007D98)) {
+ if ((this->skelAnime.animation == &object_ma1_Anim_009E58) ||
+ (this->skelAnime.animation == &object_ma1_Anim_007D98)) {
rot->z += sp4.x;
}
} else if (limbIndex == MA1_LIMB_TORSO) {
@@ -539,18 +519,18 @@ s32 EnMaYts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLis
rot->z += sp4.x;
}
- return 0;
+ return false;
}
-void EnMaYts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnMaYts* this = (EnMaYts*)arg;
+void EnMaYts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnMaYts* this = THIS;
if (limbIndex == MA1_LIMB_HEAD) {
Matrix_GetStateTranslation(&this->actor.focus.pos);
} else if (limbIndex == MA1_LIMB_HAND_LEFT) {
if (this->hasBow == true) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_060003B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0003B0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
@@ -577,7 +557,7 @@ void EnMaYts_DrawSleeping(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060043A0);
+ gSPDisplayList(POLY_OPA_DISP++, object_ma1_DL_0043A0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 6b18d43fd5..9e6b3e9e9e 100644
--- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c
+++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c
@@ -5,8 +5,9 @@
*/
#include "z_en_mag.h"
+#include "objects/object_mag/object_mag.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnMag*)thisx)
@@ -15,7 +16,75 @@ void EnMag_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnMag_Update(Actor* thisx, GlobalContext* globalCtx);
void EnMag_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+/**
+ * Steps `var` towards `target` linearly, so that it will arrive in `timeRemaining` seconds. Can be used from either
+ * direction. `timeRemaining` must be decremented separately for this to work properly, and obviously timeRemaining = 0
+ * must be handled separately.
+ *
+ * @param var Variable to step.
+ * @param target Target to step towards.
+ * @param timeRemaining Number of times this function should be run for `var` to reach `target`
+ * @param stepVar Variable to use for the step (required to match).
+ *
+ * The progression is not quite linear because of truncation in the division, but the variable will always reach
+ * `target` at the appropriate time since the last step is always the full difference.
+ */
+#define TIMED_STEP_TO(var, target, timeRemaining, stepVar) \
+ { \
+ stepVar = ABS_ALT(var - target) / timeRemaining; \
+ if (var >= target) { \
+ var -= stepVar; \
+ } else { \
+ var += stepVar; \
+ } \
+ } \
+ (void)0
+
+/**
+ * Similar to `TIMED_STEP_TO`, but will always increase `var`. If var > target, this will eventually increase `var` by
+ * an amount that is at most ( timeRemaining + 1 ) * | var - target |, but which depends on the amount lost to
+ * truncation from the divisions.
+ */
+#define TIMED_STEP_UP_TO(var, target, timeRemaining, stepVar) \
+ { \
+ stepVar = ABS_ALT(var - target) / timeRemaining; \
+ var += stepVar; \
+ } \
+ (void)0
+
+/**
+ * Similar to `TIMED_STEP_TO`, but will always increase `var`. If var < target, this will eventually dncrease `var` by
+ * an amount that is at most ( timeRemaining + 1 ) * | var - target |, but which depends on the amount lost to
+ * truncation from the divisions.
+ */
+#define TIMED_STEP_DOWN_TO(var, target, timeRemaining, stepVar) \
+ { \
+ stepVar = ABS_ALT(var - target) / timeRemaining; \
+ var -= stepVar; \
+ } \
+ (void)0
+
+typedef enum {
+ /* 0 */ MAG_STATE_INITIAL,
+ /* 1 */ MAG_STATE_FADE_IN_MASK_EFFECTS,
+ /* 2 */ MAG_STATE_FADE_IN_MASK,
+ /* 3 */ MAG_STATE_FADE_IN_MAIN_TITLE,
+ /* 5 */ MAG_STATE_FADE_IN_SUBTITLE = 5,
+ /* 6 */ MAG_STATE_FADE_IN_COPYRIGHT, // And PRESS START
+ /* 10 */ MAG_STATE_CALLED = 10, // by a button press
+ /* 13 */ MAG_STATE_DISPLAY = 13, // Buttons will trigger File Select state
+ /* 20 */ MAG_STATE_FADE_OUT = 20,
+ /* 21 */ MAG_STATE_POST_DISPLAY // Go to next scene
+} EnMagState;
+
+static s16 sInputDelayTimer = 0;
+
+static s16 sZeldaEffectColorTimer = 30;
+static s16 sZeldaEffectColorTargetIndex = 0;
+
+static s16 sTextAlphaTargetIndex = 0;
+static s16 sTextAlphaTimer = 20;
+
const ActorInit En_Mag_InitVars = {
ACTOR_EN_MAG,
ACTORCAT_PROP,
@@ -28,28 +97,878 @@ const ActorInit En_Mag_InitVars = {
(ActorFunc)EnMag_Draw,
};
-#endif
+void EnMag_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnMag* this = THIS;
+ u16 i;
-extern UNK_TYPE D_06011E48;
+ this->unk11F54 = 6;
+ this->unk11F56 = 10;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/EnMag_Init.s")
+ for (i = 0; i < 6; i++) {
+ this->effectScrollSs[i] = 0;
+ this->effectScrollTs[i] = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/EnMag_Destroy.s")
+ this->appearEffectPrimColor[0] = 255;
+ this->appearEffectPrimColor[1] = 155;
+ this->appearEffectPrimColor[2] = 255;
+ this->appearEffectEnvColor[0] = 0;
+ this->appearEffectEnvColor[1] = 255;
+ this->appearEffectEnvColor[2] = 155;
+ this->appearEffectPrimLodFrac = 20;
+ this->appearEffectAlpha = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096B604.s")
+ this->displayEffectPrimColor[0] = 255;
+ this->displayEffectPrimColor[1] = 155;
+ this->displayEffectPrimColor[2] = 255;
+ this->displayEffectEnvColor[0] = 0;
+ this->displayEffectEnvColor[1] = 255;
+ this->displayEffectEnvColor[2] = 155;
+ this->displayEffectPrimLodFrac = 55;
+ this->displayEffectAlpha = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/EnMag_Update.s")
+ this->majorasMaskAlpha = 0;
+ this->majorasMaskEnvColor[0] = this->majorasMaskEnvColor[1] = this->majorasMaskEnvColor[2] = 255;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096C998.s")
+ this->mainTitleAlpha = this->subtitleAlpha = this->unk11F32 = this->copyrightAlpha = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096CBB0.s")
+ this->unk11F02 = 30;
+ this->unk11F00 = this->state = MAG_STATE_INITIAL;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096CDC8.s")
+ if (gSaveContext.unk_3F1E != 0) {
+ this->mainTitleAlpha = 210;
+ this->unk11F32 = 255;
+ this->copyrightAlpha = 255;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096D230.s")
+ this->appearEffectPrimLodFrac = 100;
+ this->appearEffectAlpha = 255;
+ this->appearEffectPrimColor[0] = 255;
+ this->appearEffectPrimColor[1] = 255;
+ this->appearEffectPrimColor[2] = 255;
+ this->appearEffectEnvColor[0] = 0;
+ this->appearEffectEnvColor[1] = 255;
+ this->appearEffectEnvColor[2] = 155;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096D60C.s")
+ this->displayEffectPrimLodFrac = 100;
+ this->displayEffectAlpha = 255;
+ this->displayEffectPrimColor[0] = 255;
+ this->displayEffectPrimColor[1] = 255;
+ this->displayEffectPrimColor[2] = 255;
+ this->displayEffectEnvColor[0] = 0;
+ this->displayEffectEnvColor[1] = 255;
+ this->displayEffectEnvColor[2] = 155;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/func_8096D74C.s")
+ gSaveContext.unk_3F1E = 0;
+ this->state = MAG_STATE_FADE_IN_MASK;
+ sInputDelayTimer = 20;
+ gSaveContext.fadeDuration = 1;
+ gSaveContext.unk_3F51 = 255;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Mag/EnMag_Draw.s")
+ Font_LoadOrderedFont(&this->font);
+
+ this->unk11F58 = 0;
+ this->unk11F5A = 0;
+ this->unk11F5C = 0;
+ this->unk11F60 = 0;
+
+ this->majorasMaskEffectsFadeInTimer = 25;
+ this->majorasMaskFadeInTimer = 25;
+ this->mainTitleAlphaFadeInTimer = 20;
+ this->effectAlphaFadeInTimer = 40;
+ this->subtitleFadeInTimer = 10;
+ this->copyrightFadeInTimer = 10;
+ this->fadeOutTimer = 15;
+
+ sZeldaEffectColorTimer = 30;
+ sZeldaEffectColorTargetIndex = 0;
+}
+
+void EnMag_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
+
+void EnMag_UpdateDisplayEffectColors(Actor* thisx) {
+ static s16 sDisplayEffectPrimRedTargets[] = { 155, 255 };
+ static s16 sDisplayEffectPrimGreenTargets[] = { 255, 155 };
+ static s16 sDisplayEffectPrimBlueTargets[] = { 55, 255 };
+ static s16 sDisplayEffectEnvRedTargets[] = { 255, 0 };
+ static s16 sDisplayEffectEnvBlueTargets[] = { 255, 155 };
+ EnMag* this = THIS;
+ s16 colorStep;
+
+ TIMED_STEP_TO(this->displayEffectPrimColor[0], sDisplayEffectPrimRedTargets[sZeldaEffectColorTargetIndex],
+ sZeldaEffectColorTimer, colorStep);
+ TIMED_STEP_TO(this->displayEffectPrimColor[1], sDisplayEffectPrimGreenTargets[sZeldaEffectColorTargetIndex],
+ sZeldaEffectColorTimer, colorStep);
+ TIMED_STEP_TO(this->displayEffectPrimColor[2], sDisplayEffectPrimBlueTargets[sZeldaEffectColorTargetIndex],
+ sZeldaEffectColorTimer, colorStep);
+ TIMED_STEP_TO(this->displayEffectEnvColor[0], sDisplayEffectEnvRedTargets[sZeldaEffectColorTargetIndex],
+ sZeldaEffectColorTimer, colorStep);
+ // Skips 1, i.e. green.
+ TIMED_STEP_TO(this->displayEffectEnvColor[2], sDisplayEffectEnvBlueTargets[sZeldaEffectColorTargetIndex],
+ sZeldaEffectColorTimer, colorStep);
+
+ sZeldaEffectColorTimer--;
+ if (sZeldaEffectColorTimer == 0) {
+ this->displayEffectPrimColor[0] = sDisplayEffectPrimRedTargets[sZeldaEffectColorTargetIndex];
+ this->displayEffectPrimColor[1] = sDisplayEffectPrimGreenTargets[sZeldaEffectColorTargetIndex];
+ this->displayEffectPrimColor[2] = sDisplayEffectPrimBlueTargets[sZeldaEffectColorTargetIndex];
+ this->displayEffectEnvColor[0] = sDisplayEffectEnvRedTargets[sZeldaEffectColorTargetIndex];
+ // Skips 1, i.e. green.
+ this->displayEffectEnvColor[2] = sDisplayEffectEnvBlueTargets[sZeldaEffectColorTargetIndex];
+ sZeldaEffectColorTimer = 30;
+ sZeldaEffectColorTargetIndex ^= 1;
+ }
+}
+
+/**
+ * Controls the actions performed using a switch and the `state` struct variable rather than action functions. Most of
+ * these are to do with fading various parts in and out.
+ */
+void EnMag_Update(Actor* thisx, GlobalContext* globalCtx) {
+ static s16 sAppearEffectPrimGreenTargets[] = { 255, 155 };
+ static s16 sAppearEffectEnvRedTargets[] = { 255, 0 };
+ static s16 sAppearEffectEnvBlueTargets[] = { 0, 155 };
+ s16 step;
+ s32 pad[2];
+ EnMag* this = THIS;
+
+ if (gSaveContext.fileNum != 0xFEDC) {
+ if (this->state == MAG_STATE_INITIAL) {
+ if (CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_START) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_A) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_B)) {
+
+ if (!EnvFlags_Get(globalCtx, 4)) {
+ play_sound(NA_SE_SY_PIECE_OF_HEART);
+ this->state = MAG_STATE_CALLED;
+ this->unk11F00 = 0;
+ this->unk11F02 = 30;
+ sInputDelayTimer = 20;
+ gSaveContext.fadeDuration = 1;
+ gSaveContext.unk_3F51 = 255;
+ }
+ }
+ } else {
+ switch (this->state) {
+ case MAG_STATE_FADE_IN_MASK_EFFECTS:
+ TIMED_STEP_TO(this->appearEffectPrimColor[1], sAppearEffectPrimGreenTargets[0],
+ this->majorasMaskEffectsFadeInTimer, step);
+ TIMED_STEP_TO(this->appearEffectEnvColor[0], sAppearEffectEnvRedTargets[0],
+ this->majorasMaskEffectsFadeInTimer, step);
+ TIMED_STEP_TO(this->appearEffectEnvColor[2], sAppearEffectEnvBlueTargets[0],
+ this->majorasMaskEffectsFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->appearEffectAlpha, 255, this->majorasMaskEffectsFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->appearEffectPrimLodFrac, 32, this->majorasMaskEffectsFadeInTimer, step);
+
+ this->majorasMaskEffectsFadeInTimer--;
+ if (this->majorasMaskEffectsFadeInTimer == 0) {
+ this->appearEffectPrimColor[1] = sAppearEffectPrimGreenTargets[0];
+ this->appearEffectEnvColor[0] = sAppearEffectEnvRedTargets[0];
+ this->appearEffectEnvColor[2] = sAppearEffectEnvBlueTargets[0];
+ this->appearEffectAlpha = 255;
+ this->state = MAG_STATE_FADE_IN_MASK;
+ this->delayTimer = 5;
+ }
+ break;
+
+ case MAG_STATE_FADE_IN_MASK:
+ if (this->delayTimer == 0) {
+ TIMED_STEP_TO(this->appearEffectPrimColor[1], sAppearEffectPrimGreenTargets[1],
+ this->majorasMaskFadeInTimer, step);
+ TIMED_STEP_TO(this->appearEffectEnvColor[0], sAppearEffectEnvRedTargets[1],
+ this->majorasMaskFadeInTimer, step);
+ TIMED_STEP_TO(this->appearEffectEnvColor[2], sAppearEffectEnvBlueTargets[1],
+ this->majorasMaskFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->appearEffectPrimLodFrac, 128, this->majorasMaskFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->majorasMaskAlpha, 255, this->majorasMaskFadeInTimer, step);
+
+ this->majorasMaskFadeInTimer--;
+ if (this->majorasMaskFadeInTimer == 0) {
+ this->appearEffectPrimColor[1] = sAppearEffectPrimGreenTargets[1];
+ this->appearEffectEnvColor[0] = sAppearEffectEnvRedTargets[1];
+ this->appearEffectEnvColor[2] = sAppearEffectEnvBlueTargets[1];
+ this->appearEffectPrimLodFrac = 128;
+ this->majorasMaskAlpha = 255;
+ this->state = MAG_STATE_FADE_IN_MAIN_TITLE;
+ this->delayTimer = 5;
+ }
+ } else {
+ this->delayTimer--;
+ }
+ break;
+
+ case MAG_STATE_FADE_IN_MAIN_TITLE:
+ if (this->delayTimer == 0) {
+ TIMED_STEP_UP_TO(this->mainTitleAlpha, 255, this->mainTitleAlphaFadeInTimer, step);
+
+ this->mainTitleAlphaFadeInTimer--;
+ if (this->mainTitleAlphaFadeInTimer == 0) {
+ this->mainTitleAlphaFadeInTimer = 1;
+ this->mainTitleAlpha = 255;
+ }
+
+ TIMED_STEP_DOWN_TO(this->appearEffectAlpha, 60, this->effectAlphaFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->displayEffectAlpha, 255, this->effectAlphaFadeInTimer, step);
+ TIMED_STEP_UP_TO(this->displayEffectPrimLodFrac, 128, this->effectAlphaFadeInTimer, step);
+
+ this->effectAlphaFadeInTimer--;
+
+ if (this->effectAlphaFadeInTimer == 0) {
+ this->appearEffectAlpha = 60;
+ this->displayEffectAlpha = 255;
+ this->displayEffectPrimLodFrac = 128;
+ this->state = MAG_STATE_FADE_IN_SUBTITLE;
+ this->delayTimer = 20;
+ }
+ } else {
+ this->delayTimer--;
+ }
+ break;
+
+ case MAG_STATE_FADE_IN_SUBTITLE:
+ EnMag_UpdateDisplayEffectColors(&this->actor);
+
+ if (this->delayTimer == 0) {
+ TIMED_STEP_UP_TO(this->subtitleAlpha, 255, this->subtitleFadeInTimer, step);
+
+ this->subtitleFadeInTimer--;
+ if (this->subtitleFadeInTimer == 0) {
+ this->displayEffectAlpha = 255;
+ this->state = MAG_STATE_FADE_IN_COPYRIGHT;
+ this->delayTimer = 20;
+ }
+ } else {
+ this->delayTimer--;
+ }
+ break;
+
+ case MAG_STATE_FADE_IN_COPYRIGHT:
+ EnMag_UpdateDisplayEffectColors(&this->actor);
+
+ if (this->delayTimer == 0) {
+ TIMED_STEP_UP_TO(this->copyrightAlpha, 255, this->copyrightFadeInTimer, step);
+
+ this->copyrightFadeInTimer--;
+ if (this->copyrightFadeInTimer == 0) {
+ this->copyrightAlpha = 255;
+ this->state = MAG_STATE_DISPLAY;
+ }
+ } else {
+ this->delayTimer--;
+ }
+ break;
+
+ case MAG_STATE_CALLED:
+ this->appearEffectPrimColor[1] = sAppearEffectPrimGreenTargets[0];
+ this->appearEffectEnvColor[0] = sAppearEffectEnvRedTargets[0];
+ this->appearEffectEnvColor[2] = sAppearEffectEnvBlueTargets[0];
+ this->appearEffectAlpha = 60;
+ this->appearEffectPrimLodFrac = 128;
+ this->majorasMaskAlpha = 255;
+ this->mainTitleAlpha = 255;
+ this->displayEffectAlpha = 255;
+ this->displayEffectPrimLodFrac = 128;
+ this->subtitleAlpha = 255;
+ this->copyrightAlpha = 255;
+ this->state = MAG_STATE_DISPLAY;
+ break;
+
+ case MAG_STATE_DISPLAY:
+ EnMag_UpdateDisplayEffectColors(&this->actor);
+
+ if (sInputDelayTimer == 0) {
+ if (CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_START) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_A) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_B)) {
+ if (globalCtx->sceneLoadFlag != 0x14) {
+ Audio_SetCutsceneFlag(false);
+ D_801BB12C++;
+ if (D_801BB12C >= 2) {
+ D_801BB12C = 0;
+ }
+ play_sound(NA_SE_SY_PIECE_OF_HEART);
+ gSaveContext.gameMode = 2; // Go to FileChoose
+ globalCtx->sceneLoadFlag = 0x14;
+ globalCtx->unk_1887F = 2;
+ globalCtx->nextEntranceIndex = 0x1C00;
+ gSaveContext.cutscene = 0;
+ gSaveContext.sceneSetupIndex = 0;
+ }
+ this->unk11F54 = 15;
+ this->unk11F56 = 25;
+ this->state = MAG_STATE_FADE_OUT;
+ }
+ } else {
+ sInputDelayTimer--;
+ }
+ break;
+
+ case MAG_STATE_FADE_OUT:
+ TIMED_STEP_DOWN_TO(this->appearEffectAlpha, 0, this->fadeOutTimer, step);
+ TIMED_STEP_DOWN_TO(this->majorasMaskAlpha, 0, this->fadeOutTimer, step);
+ TIMED_STEP_DOWN_TO(this->displayEffectAlpha, 0, this->fadeOutTimer, step);
+ TIMED_STEP_DOWN_TO(this->mainTitleAlpha, 0, this->fadeOutTimer, step);
+ TIMED_STEP_DOWN_TO(this->subtitleAlpha, 0, this->fadeOutTimer, step);
+ TIMED_STEP_DOWN_TO(this->copyrightAlpha, 0, this->fadeOutTimer, step);
+
+ this->fadeOutTimer--;
+ if (this->fadeOutTimer == 0) {
+ this->appearEffectAlpha = 0;
+ this->majorasMaskAlpha = 0;
+ this->mainTitleAlpha = 0;
+ this->subtitleAlpha = 0;
+ this->displayEffectAlpha = 0;
+ this->copyrightAlpha = 0;
+ this->state = MAG_STATE_POST_DISPLAY;
+ }
+ break;
+ }
+
+ // Appear fully immediately if called during fade-in states.
+ if ((this->state > MAG_STATE_INITIAL) && (this->state < MAG_STATE_CALLED)) {
+ if (CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_START) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_A) ||
+ CHECK_BTN_ALL(CONTROLLER1(globalCtx)->press.button, BTN_B)) {
+ play_sound(NA_SE_SY_PIECE_OF_HEART);
+ this->state = MAG_STATE_CALLED;
+ }
+ }
+ }
+ }
+
+ if (this->state == MAG_STATE_INITIAL) {
+ if (EnvFlags_Get(globalCtx, 3)) {
+ this->unk11F02 = 40;
+ this->state = MAG_STATE_FADE_IN_MASK_EFFECTS;
+ }
+ } else if (this->state < MAG_STATE_FADE_OUT) {
+ if (EnvFlags_Get(globalCtx, 4)) {
+ this->state = MAG_STATE_FADE_OUT;
+ }
+ }
+}
+
+/**
+ * Draws an i8 texture.
+ *
+ * @param[in,out] gfxp Pointer to current displaylist.
+ * @param[in] texture Texture to draw.
+ * @param[in] texWidth Width of the texture.
+ * @param[in] texHeight Height of the texture.
+ * @param[in] rectLeft X coordinate of the top-left of the draw position.
+ * @param[in] rectTop Y coordinate of the top-left of the draw position.
+ */
+void EnMag_DrawTextureI8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) {
+ Gfx* gfx = *gfxp;
+
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_I, G_IM_SIZ_8b, texWidth, texHeight, 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++, rectLeft << 2, rectTop << 2, (rectLeft + texWidth) << 2, (rectTop + texHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
+
+ *gfxp = gfx;
+}
+
+/**
+ * Draws an ia8 texture.
+ *
+ * @param[in,out] gfxp Pointer to current displaylist.
+ * @param[in] texture Texture to draw.
+ * @param[in] texWidth Width of the texture.
+ * @param[in] texHeight Height of the texture.
+ * @param[in] rectLeft X coordinate of the top-left of the draw position.
+ * @param[in] rectTop Y coordinate of the top-left of the draw position.
+ */
+void EnMag_DrawTextureIA8(Gfx** gfxp, TexturePtr texture, s16 texWidth, s16 texHeight, s16 rectLeft, s16 rectTop) {
+ Gfx* gfx = *gfxp;
+
+ gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, texWidth, texHeight, 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++, rectLeft << 2, rectTop << 2, (rectLeft + texWidth) << 2, (rectTop + texHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
+
+ *gfxp = gfx;
+}
+
+/**
+ * Draws an i8 effect texture, masking it with an i4 mask, with shifting
+ *
+ * @param[in,out] gfxp Pointer to current displaylist.
+ * @param[in] maskTex Texture with which to mask, i4.
+ * @param[in] effectTex Effect texture to draw, i8.
+ * @param[in] maskWidth Width of masking texture.
+ * @param[in] maskHeight Height of masking texture.
+ * @param[in] effectWidth Width of effect texture.
+ * @param[in] effectHeight Height of effect texture.
+ * @param[in] rectLeft X coordinate of the top-left of the draw position.
+ * @param[in] rectTop Y coordinate of the top-left of the draw position.
+ * @param[in] shifts Shift to apply to effect texture's S coordinate to control LOD.
+ * @param[in] shiftt Shift to apply to effect texture's T coordinate to control LOD.
+ * @param[in] index Index into the scrolling arrays to use for gDPSetTileSize.
+ * @param[in] this Pointer to EnMag instance.
+ */
+void EnMag_DrawEffectTextures(Gfx** gfxp, TexturePtr maskTex, TexturePtr effectTex, s16 maskWidth, s16 maskHeight,
+ s16 effectWidth, s16 effectHeight, s16 rectLeft, s16 rectTop, u16 shifts, u16 shiftt,
+ u16 index, EnMag* this) {
+ Gfx* gfx = *gfxp;
+
+ gDPLoadMultiBlock_4b(gfx++, maskTex, 0x0000, G_TX_RENDERTILE, G_IM_FMT_I, maskWidth, maskHeight, 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(gfx++, effectTex, 0x0100, 1, G_IM_FMT_I, G_IM_SIZ_8b, effectWidth, effectHeight, 0,
+ G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, shifts, shiftt);
+
+ gDPSetTileSize(gfx++, 1, this->effectScrollSs[index] & 0x7F, this->effectScrollTs[index] & 0x7F,
+ (this->effectScrollSs[index] & 0x7F) + 15, (this->effectScrollTs[index] & 0x7F) + 15);
+
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + maskWidth) << 2, (rectTop + maskHeight) << 2,
+ G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
+
+ *gfxp = gfx;
+}
+
+/**
+ * Draws an rgba32 texture. Because these are so large, this will draw the texture in horizontal stripes, each narrow
+ * enough that that part of the texture will fit into TMEM's 4kB.
+ *
+ * @param[in,out] gfxp Pointer to current displaylist.
+ * @param[in] centerX X coordinate of the center of the draw position.
+ * @param[in] centerY Y coordinate of the center of the draw position.
+ * @param[in] source Texture to draw.
+ * @param[in] width Width of the texture.
+ * @param[in] height Height of the texture.
+ */
+void EnMag_DrawImageRGBA32(Gfx** gfxp, s16 centerX, s16 centerY, TexturePtr source, u32 width, u32 height) {
+ Gfx* gfx = *gfxp;
+ uintptr_t curTexture;
+ s32 textureCount;
+ u32 rectLeft;
+ u32 rectTop;
+ u32 textureHeight;
+ s32 remainingSize;
+ s32 textureSize;
+ s32 pad;
+ s32 i;
+
+ func_8012CA0C(&gfx);
+
+ curTexture = source;
+ rectLeft = centerX - (width / 2);
+ rectTop = centerY - (height / 2);
+ textureHeight = TMEM_SIZE / (width << 2);
+ remainingSize = (width * height) << 2;
+ textureSize = (width * textureHeight) << 2;
+ textureCount = remainingSize / textureSize;
+ if ((remainingSize % textureSize) != 0) {
+ textureCount++;
+ }
+
+ 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);
+
+ remainingSize -= textureSize;
+
+ for (i = 0; i < textureCount; i++) {
+ gDPSetTextureImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_32b, width, curTexture);
+
+ gDPLoadSync(gfx++);
+ gDPLoadTile(gfx++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2);
+
+ gSPTextureRectangle(gfx++, 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(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);
+ }
+ } else {
+ remainingSize -= textureSize;
+ }
+ }
+
+ *gfxp = gfx;
+}
+
+/**
+ * Draws one character, expected to be a 16 by 16 i4 texture. It will draw shrunk to 10 by 10.
+ *
+ * @param[in,out] gfxp Pointer to current displaylist.
+ * @param[in] texture Texture to draw.
+ * @param[in] rectLeft X coordinate of the top-left of the draw position.
+ * @param[in] rectTop Y coordinate of the top-left of the draw position.
+ */
+void EnMag_DrawCharTexture(Gfx** gfxp, TexturePtr texture, s32 rectLeft, s32 rectTop) {
+ Gfx* gfx = *gfxp;
+
+ gDPLoadTextureBlock_4b(gfx++, texture, G_IM_FMT_I, 16, 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);
+
+ // The dsdx and dtdy are roughly 1.587 * 0x400, to fit the texture into 10 by 10 pixels. It is not the more
+ // obvious 1.6 * 0x400 = 1656.
+ gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + 10) << 2, (rectTop + 10) << 2, G_TX_RENDERTILE,
+ 0, 0, 1625, 1625);
+
+ *gfxp = gfx;
+}
+
+#define EFFECT_MASK_TEX_WIDTH 64
+#define EFFECT_MASK_TEX_HEIGHT 64
+#define EFFECT_TEX_WIDTH 32
+#define EFFECT_TEX_HEIGHT 32
+#define EFFECT_TEX_LEFT 38
+#define EFFECT_TEX_TOP 57
+
+#define MAJORAS_MASK_TEX_WIDTH 128
+#define MAJORAS_MASK_TEX_HEIGHT 112
+#define MAJORAS_MASK_TEX_CENTER_X 124
+#define MAJORAS_MASK_TEX_CENTER_Y 103
+
+#define ZELDA_TEX_WIDTH 144
+#define ZELDA_TEX_HEIGHT 64
+#define ZELDA_TEX_CENTER_X 177
+#define ZELDA_TEX_CENTER_Y 105
+
+#define SUBTITLE_TEX_WIDTH 104
+#define SUBTITLE_TEX_HEIGHT 16
+#define SUBTITLE_TEX_LEFT 151
+#define SUBTITLE_TEX_TOP 124
+
+#define THE_LEGEND_OF_TEX_WIDTH 72
+#define THE_LEGEND_OF_TEX_HEIGHT 8
+#define THE_LEGEND_OF_TEX_LEFT 158
+#define THE_LEGEND_OF_TEX_TOP 71
+
+#define COPYRIGHT_TEX_WIDTH 128
+#define COPYRIGHT_TEX_HEIGHT 16
+#define COPYRIGHT_TEX_LEFT 94
+#define COPYRIGHT_TEX_TOP 198
+
+#define NO_CONTROLLER_FIRST_TEX_WIDTH 256
+#define NO_CONTROLLER_FIRST_TEX_HEIGHT 9
+#define NO_CONTROLLER_FIRST_TEX_LEFT 35
+#define NO_CONTROLLER_FIRST_TEX_TOP 175
+
+#define NO_CONTROLLER_SECOND_TEX_WIDTH 144
+#define NO_CONTROLLER_SECOND_TEX_HEIGHT 9
+#define NO_CONTROLLER_SECOND_TEX_LEFT 91
+#define NO_CONTROLLER_SECOND_TEX_TOP 188
+
+// Top-left of the text itself, not the shadow
+#define PRESS_START_LEFT 119
+#define PRESS_START_TOP 174
+#define PRESS_START_CHAR_SPACING 7 // Amount of rightward shift before printing next char
+#define PRESS_START_SPACE 5 // Extra space between the words
+
+/**
+ * Loads title, PRESS START text, etc. graphics to gfxp, which is made to live on
+ * POLY_OPA_DISP, but is used by OVERLAY_DISP.
+ */
+void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
+ static u8 pressStartFontIndices[] = {
+ 0x19, 0x1B, 0x0E, 0x1C, 0x1C, 0x1C, 0x1D, 0x0A, 0x1B, 0x1D,
+ }; // Indices into this->font.fontBuf
+ static TexturePtr sAppearEffectMaskTextures[] = {
+ gTitleScreenAppearEffectMask00Tex, gTitleScreenAppearEffectMask01Tex, gTitleScreenAppearEffectMask02Tex,
+ gTitleScreenAppearEffectMask10Tex, gTitleScreenAppearEffectMask11Tex, gTitleScreenAppearEffectMask12Tex,
+ }; // Visible when mask appearing
+ static TexturePtr sDisplayEffectMaskTextures[] = {
+ gTitleScreenDisplayEffectMask00Tex, gTitleScreenDisplayEffectMask01Tex, gTitleScreenDisplayEffectMask02Tex,
+ gTitleScreenDisplayEffectMask10Tex, gTitleScreenDisplayEffectMask11Tex, gTitleScreenDisplayEffectMask12Tex,
+ }; // Visible when full game logo displayed
+ static TexturePtr sEffectTextures[] = {
+ gTitleScreenFlame0Tex, gTitleScreenFlame1Tex, gTitleScreenFlame1Tex,
+ gTitleScreenFlame2Tex, gTitleScreenFlame3Tex, gTitleScreenFlame3Tex,
+ };
+ static s16 sEffectScrollVelocitySs[] = { -1, 1, 1, -1, 1, 1 };
+ static s16 sEffectScrollVelocityTs[] = { -2, -2, -2, 2, 2, 2 };
+ static s16 sTextAlpha = 0; // For drawing both the No Controller message and "PRESS START"
+ static s16 sTextAlphaTargets[] = { 255, 0 };
+ s32 pad;
+ EnMag* this = THIS;
+ Font* font = &this->font;
+ Gfx* gfx = *gfxp;
+ u16 i;
+ u16 j;
+ u16 k;
+ s32 rectLeft;
+ s32 rectTop;
+ s16 step;
+
+ // Set segment 6 to the object, since this will be read by OVERLAY_DISP where it is not set by default.
+ gSPSegment(gfx++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment);
+
+ func_8012C680(&gfx);
+
+ // Mask appearing effects
+ gDPPipeSync(gfx++);
+ gDPSetCycleType(gfx++, G_CYC_2CYCLE);
+ gDPSetAlphaCompare(gfx++, G_AC_THRESHOLD);
+ gDPSetRenderMode(gfx++, G_RM_PASS, G_RM_CLD_SURF2);
+ gDPSetCombineLERP(gfx++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL1, 1, PRIM_LOD_FRAC, TEXEL0, PRIMITIVE,
+ ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0);
+
+ gDPSetPrimColor(gfx++, 0, this->appearEffectPrimLodFrac, this->appearEffectPrimColor[0],
+ this->appearEffectPrimColor[1], this->appearEffectPrimColor[2], this->appearEffectAlpha);
+ gDPSetEnvColor(gfx++, this->appearEffectEnvColor[0], this->appearEffectEnvColor[1], this->appearEffectEnvColor[2],
+ 255);
+
+ if (this->appearEffectPrimLodFrac != 0) {
+ for (k = 0, i = 0, rectTop = EFFECT_TEX_LEFT; i < 2; i++, rectTop += EFFECT_MASK_TEX_HEIGHT) {
+ for (j = 0, rectLeft = EFFECT_TEX_TOP; j < 3; j++, k++, rectLeft += EFFECT_MASK_TEX_WIDTH) {
+ this->effectScrollSs[k] += sEffectScrollVelocitySs[k];
+ this->effectScrollTs[k] += sEffectScrollVelocityTs[k];
+ EnMag_DrawEffectTextures(&gfx, sAppearEffectMaskTextures[k], sEffectTextures[k], EFFECT_MASK_TEX_WIDTH,
+ EFFECT_MASK_TEX_HEIGHT, EFFECT_TEX_WIDTH, EFFECT_TEX_HEIGHT, rectLeft, rectTop,
+ 1, 1, k, this);
+ }
+ }
+ }
+
+ func_8012C680(&gfx);
+
+ if (this->majorasMaskAlpha != 0) {
+ gDPSetCombineLERP(gfx++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE,
+ ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
+
+ gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, this->majorasMaskAlpha);
+ gDPSetEnvColor(gfx++, this->majorasMaskEnvColor[0], this->majorasMaskEnvColor[1], this->majorasMaskEnvColor[2],
+ 255);
+
+ EnMag_DrawImageRGBA32(&gfx, MAJORAS_MASK_TEX_CENTER_X, MAJORAS_MASK_TEX_CENTER_Y, gTitleScreenMajorasMaskTex,
+ MAJORAS_MASK_TEX_WIDTH, MAJORAS_MASK_TEX_HEIGHT);
+ }
+
+ // Flame glow effects on full game logo when displayed
+ gDPPipeSync(gfx++);
+ gDPSetCycleType(gfx++, G_CYC_2CYCLE);
+ gDPSetAlphaCompare(gfx++, G_AC_THRESHOLD);
+ gDPSetRenderMode(gfx++, G_RM_PASS, G_RM_CLD_SURF2);
+ gDPSetCombineLERP(gfx++, TEXEL1, PRIMITIVE, PRIM_LOD_FRAC, TEXEL0, TEXEL1, 1, PRIM_LOD_FRAC, TEXEL0, PRIMITIVE,
+ ENVIRONMENT, COMBINED, ENVIRONMENT, COMBINED, 0, PRIMITIVE, 0);
+
+ gDPSetPrimColor(gfx++, 0, this->displayEffectPrimLodFrac, this->displayEffectPrimColor[0],
+ this->displayEffectPrimColor[1], this->displayEffectPrimColor[2], this->displayEffectAlpha);
+ gDPSetEnvColor(gfx++, this->displayEffectEnvColor[0], this->displayEffectEnvColor[1],
+ this->displayEffectEnvColor[2], 255);
+
+ if (this->displayEffectPrimLodFrac != 0) {
+ for (k = 0, i = 0, rectTop = EFFECT_TEX_LEFT; i < 2; i++, rectTop += EFFECT_MASK_TEX_HEIGHT) {
+ for (j = 0, rectLeft = EFFECT_TEX_TOP; j < 3; j++, k++, rectLeft += EFFECT_MASK_TEX_WIDTH) {
+ EnMag_DrawEffectTextures(&gfx, sDisplayEffectMaskTextures[k], sEffectTextures[k], EFFECT_MASK_TEX_WIDTH,
+ EFFECT_MASK_TEX_HEIGHT, EFFECT_TEX_WIDTH, EFFECT_TEX_HEIGHT, rectLeft, rectTop,
+ 1, 1, k, this);
+ }
+ }
+ }
+
+ if (this->subtitleAlpha != 0) {
+ func_8012C680(&gfx);
+
+ gDPSetAlphaCompare(gfx++, G_AC_NONE);
+ gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+
+ if (this->mainTitleAlpha < 100) {
+ gDPSetRenderMode(gfx++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
+ } else {
+ gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ }
+
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, this->subtitleAlpha);
+ gDPSetEnvColor(gfx++, 100, 0, 100, 255);
+
+ EnMag_DrawTextureI8(&gfx, gTitleScreenMajorasMaskSubtitleMaskTex, SUBTITLE_TEX_WIDTH, SUBTITLE_TEX_HEIGHT,
+ SUBTITLE_TEX_LEFT, SUBTITLE_TEX_TOP);
+ }
+
+ func_8012C680(&gfx);
+
+ gDPSetAlphaCompare(gfx++, G_AC_NONE);
+ gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+
+ if (this->mainTitleAlpha < 100) {
+ gDPSetRenderMode(gfx++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
+ } else {
+ gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ }
+
+ gDPSetPrimColor(gfx++, 0, 120, 208, 102, 222, this->subtitleAlpha);
+
+ EnMag_DrawTextureI8(&gfx, gTitleScreenMajorasMaskSubtitleTex, SUBTITLE_TEX_WIDTH, SUBTITLE_TEX_HEIGHT,
+ SUBTITLE_TEX_LEFT, SUBTITLE_TEX_TOP);
+
+ func_8012C680(&gfx);
+
+ gDPSetAlphaCompare(gfx++, G_AC_NONE);
+ gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+
+ if (this->mainTitleAlpha != 0) {
+ gDPSetPrimColor(gfx++, 0, 0, 255, 255, 255, this->mainTitleAlpha);
+
+ EnMag_DrawImageRGBA32(&gfx, ZELDA_TEX_CENTER_X, ZELDA_TEX_CENTER_Y, gTitleScreenZeldaLogoTex, ZELDA_TEX_WIDTH,
+ ZELDA_TEX_HEIGHT);
+
+ gDPPipeSync(gfx++);
+
+ if (this->mainTitleAlpha < 100) {
+ gDPSetRenderMode(gfx++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
+ } else {
+ gDPSetRenderMode(gfx++, G_RM_XLU_SURF, G_RM_XLU_SURF2);
+ }
+
+ gDPSetPrimColor(gfx++, 0, 0, 208, 102, 222, this->mainTitleAlpha);
+
+ EnMag_DrawTextureI8(&gfx, gTitleScreenTheLegendOfTextTex, THE_LEGEND_OF_TEX_WIDTH, THE_LEGEND_OF_TEX_HEIGHT,
+ THE_LEGEND_OF_TEX_LEFT, THE_LEGEND_OF_TEX_TOP);
+ }
+
+ func_8012C680(&gfx);
+
+ if (this->copyrightAlpha != 0) {
+ gDPSetAlphaCompare(gfx++, G_AC_NONE);
+ gDPSetCombineMode(gfx++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
+ gDPSetPrimColor(gfx++, 0, 0, this->copyrightAlpha, this->copyrightAlpha, this->copyrightAlpha,
+ this->copyrightAlpha);
+
+ EnMag_DrawTextureIA8(&gfx, gTitleScreenCopyright2000NintendoTex, COPYRIGHT_TEX_WIDTH, COPYRIGHT_TEX_HEIGHT,
+ COPYRIGHT_TEX_LEFT, COPYRIGHT_TEX_TOP);
+ }
+
+ if (gSaveContext.fileNum == 0xFEDC) {
+ // Draw No controller message
+
+ TIMED_STEP_TO(sTextAlpha, sTextAlphaTargets[sTextAlphaTargetIndex], sTextAlphaTimer, step);
+
+ gDPPipeSync(gfx++);
+ gDPSetAlphaCompare(gfx++, G_AC_THRESHOLD);
+
+ gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
+ 0);
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, sTextAlpha);
+ gDPLoadTextureBlock_4b(gfx++, gTitleScreenControllerNotConnectedTextTex, G_IM_FMT_I,
+ NO_CONTROLLER_FIRST_TEX_WIDTH, NO_CONTROLLER_FIRST_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);
+ // Texture shadow
+ gSPTextureRectangle(gfx++, (NO_CONTROLLER_FIRST_TEX_LEFT + 1) << 2, (NO_CONTROLLER_FIRST_TEX_TOP + 1) << 2,
+ (NO_CONTROLLER_FIRST_TEX_LEFT + 1 + NO_CONTROLLER_FIRST_TEX_WIDTH) << 2,
+ (NO_CONTROLLER_FIRST_TEX_TOP + 1 + NO_CONTROLLER_FIRST_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0,
+ 0, 1 << 10, 1 << 10);
+ // Actual texture
+ gDPSetPrimColor(gfx++, 0, 0, 205, 255, 255, sTextAlpha);
+ gSPTextureRectangle(gfx++, NO_CONTROLLER_FIRST_TEX_LEFT << 2, NO_CONTROLLER_FIRST_TEX_TOP << 2,
+ (NO_CONTROLLER_FIRST_TEX_LEFT + NO_CONTROLLER_FIRST_TEX_WIDTH) << 2,
+ (NO_CONTROLLER_FIRST_TEX_TOP + NO_CONTROLLER_FIRST_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0, 0,
+ 1 << 10, 1 << 10);
+
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, sTextAlpha);
+ gDPLoadTextureBlock_4b(gfx++, gTitleScreenInsertControllerTextTex, G_IM_FMT_I, NO_CONTROLLER_SECOND_TEX_WIDTH,
+ NO_CONTROLLER_SECOND_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);
+ // Texture shadow
+ gSPTextureRectangle(gfx++, (NO_CONTROLLER_SECOND_TEX_LEFT + 1) << 2, (NO_CONTROLLER_SECOND_TEX_TOP + 1) << 2,
+ (NO_CONTROLLER_SECOND_TEX_LEFT + 1 + NO_CONTROLLER_SECOND_TEX_WIDTH) << 2,
+ (NO_CONTROLLER_SECOND_TEX_TOP + 1 + NO_CONTROLLER_SECOND_TEX_HEIGHT) << 2, G_TX_RENDERTILE,
+ 0, 0, 1 << 10, 1 << 10);
+ // Actual texture
+ gDPSetPrimColor(gfx++, 0, 0, 205, 255, 255, sTextAlpha);
+ gSPTextureRectangle(gfx++, NO_CONTROLLER_SECOND_TEX_LEFT << 2, NO_CONTROLLER_SECOND_TEX_TOP << 2,
+ (NO_CONTROLLER_SECOND_TEX_LEFT + NO_CONTROLLER_SECOND_TEX_WIDTH) << 2,
+ (NO_CONTROLLER_SECOND_TEX_TOP + NO_CONTROLLER_SECOND_TEX_HEIGHT) << 2, G_TX_RENDERTILE, 0,
+ 0, 1 << 10, 1 << 10);
+
+ sTextAlphaTimer--;
+ if (sTextAlphaTimer == 0) {
+ sTextAlpha = sTextAlphaTargets[sTextAlphaTargetIndex];
+ if (gSaveContext.fileNum == 0xFEDC) {
+ sTextAlphaTimer = 40;
+ } else {
+ sTextAlphaTimer = 20;
+ }
+ sTextAlphaTargetIndex ^= 1;
+ }
+ } else if (this->copyrightAlpha != 0) {
+ // Draw "PRESS START" characters
+
+ TIMED_STEP_TO(sTextAlpha, sTextAlphaTargets[sTextAlphaTargetIndex], sTextAlphaTimer, step);
+
+ // Text shadow
+ gDPPipeSync(gfx++);
+ gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
+ 0);
+ gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, sTextAlpha);
+
+ rectLeft = PRESS_START_LEFT + 1;
+ for (i = 0; i < ARRAY_COUNT(pressStartFontIndices); i++) {
+ EnMag_DrawCharTexture(&gfx, font->fontBuf + pressStartFontIndices[i] * FONT_CHAR_TEX_SIZE, rectLeft,
+ PRESS_START_TOP + 1);
+
+ rectLeft += PRESS_START_CHAR_SPACING;
+ if (i == 4) {
+ rectLeft += PRESS_START_SPACE;
+ }
+ }
+
+ // Actual text
+ gDPPipeSync(gfx++);
+ gDPSetPrimColor(gfx++, 0, 0, 255, 30, 30, sTextAlpha);
+
+ rectLeft = PRESS_START_LEFT;
+ for (i = 0; i < ARRAY_COUNT(pressStartFontIndices); i++) {
+ EnMag_DrawCharTexture(&gfx, font->fontBuf + pressStartFontIndices[i] * FONT_CHAR_TEX_SIZE, rectLeft,
+ PRESS_START_TOP);
+ rectLeft += PRESS_START_CHAR_SPACING;
+ if (i == 4) {
+ rectLeft += PRESS_START_SPACE;
+ }
+ }
+
+ sTextAlphaTimer--;
+ if (sTextAlphaTimer == 0) {
+ sTextAlpha = sTextAlphaTargets[sTextAlphaTargetIndex];
+ if (gSaveContext.fileNum == 0xFEDC) {
+ sTextAlphaTimer = 40;
+ } else {
+ sTextAlphaTimer = 20;
+ }
+ sTextAlphaTargetIndex ^= 1;
+ }
+ }
+
+ *gfxp = gfx;
+}
+
+/**
+ * Jumps drawing to POLY_OPA_DISP to take advantage of the extra space available, but jmups back and actually draws
+ * using OVERLAY_DISP.
+ */
+void EnMag_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ Gfx* gfx;
+ Gfx* gfxRef;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gfxRef = POLY_OPA_DISP;
+ gfx = Graph_GfxPlusOne(gfxRef);
+ gSPDisplayList(OVERLAY_DISP++, gfx);
+
+ EnMag_DrawInner(thisx, globalCtx, &gfx);
+
+ gSPEndDisplayList(gfx++);
+ Graph_BranchDlist(gfxRef, gfx);
+ POLY_OPA_DISP = gfx;
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
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 3543b5cea8..c116ae98dd 100644
--- a/src/overlays/actors/ovl_En_Mag/z_en_mag.h
+++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.h
@@ -7,7 +7,45 @@ struct EnMag;
typedef struct EnMag {
/* 0x00000 */ Actor actor;
- /* 0x00144 */ char unk_00144[0x11E34];
+ /* 0x00144 */ UNK_TYPE1 unk144[0x2C];
+ /* 0x00170 */ Font font;
+ /* 0x11EFC */ UNK_TYPE1 unk11EFC[4];
+ /* 0x11F00 */ s16 unk11F00; // Set and not used.
+ /* 0x11F02 */ s16 unk11F02; // Set and not used.
+ /* 0x11F04 */ s16 state; // State of whole actor, uses EnMagState enum
+ /* 0x11F06 */ s16 appearEffectPrimLodFrac;
+ /* 0x11F08 */ s16 appearEffectPrimColor[3];
+ /* 0x11F08 */ s16 appearEffectEnvColor[3];
+ /* 0x11F14 */ s16 appearEffectAlpha;
+ /* 0x11F16 */ s16 displayEffectPrimLodFrac;
+ /* 0x11F18 */ s16 displayEffectPrimColor[3];
+ /* 0x11F18 */ s16 displayEffectEnvColor[3];
+ /* 0x11F24 */ s16 displayEffectAlpha;
+ /* 0x11F26 */ s16 majorasMaskAlpha;
+ /* 0x11F28 */ s16 majorasMaskEnvColor[3];
+ /* 0x11F2E */ s16 mainTitleAlpha;
+ /* 0x11F30 */ s16 subtitleAlpha;
+ /* 0x11F32 */ s16 unk11F32; // Set but not used, likely a spare alpha.
+ /* 0x11F34 */ s16 copyrightAlpha;
+ /* 0x11F36 */ s16 effectScrollSs[6];
+ /* 0x11F42 */ UNK_TYPE1 unk11F42[2];
+ /* 0x11F44 */ s16 effectScrollTs[6];
+ /* 0x11F50 */ UNK_TYPE1 unk11F50[4];
+ /* 0x11F54 */ s16 unk11F54; // Set but not used.
+ /* 0x11F56 */ s16 unk11F56; // Set but not used.
+ /* 0x11F58 */ s16 unk11F58; // Set but not used.
+ /* 0x11F5A */ s16 unk11F5A; // Set but not used.
+ /* 0x11F5C */ s32 unk11F5C; // Set but not used.
+ /* 0x11F60 */ s32 unk11F60; // Set but not used.
+ /* 0x11F64 */ s16 majorasMaskEffectsFadeInTimer;
+ /* 0x11F66 */ s16 majorasMaskFadeInTimer;
+ /* 0x11F68 */ s16 mainTitleAlphaFadeInTimer;
+ /* 0x11F6A */ s16 effectAlphaFadeInTimer;
+ /* 0x11F6C */ s16 subtitleFadeInTimer;
+ /* 0x11F6E */ s16 copyrightFadeInTimer;
+ /* 0x11F70 */ s16 fadeOutTimer;
+ /* 0x11F72 */ s16 delayTimer; // Delays start of next action in Update.
+ /* 0x11F74 */ UNK_TYPE1 unk11F74[4];
} EnMag; // size = 0x11F78
extern const ActorInit En_Mag_InitVars;
diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c
index 7d379c08d6..0c736886ef 100644
--- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c
+++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.c
@@ -6,7 +6,7 @@
#include "z_en_maruta.h"
-#define FLAGS 0x00000011
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_10)
#define THIS ((EnMaruta*)thisx)
diff --git a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h
index df53fbe499..0fc546e4d0 100644
--- a/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h
+++ b/src/overlays/actors/ovl_En_Maruta/z_en_maruta.h
@@ -10,7 +10,8 @@ typedef void (*EnMarutaActionFunc)(struct EnMaruta*, GlobalContext*);
typedef struct EnMaruta {
/* 0x0000 */ Actor actor;
/* 0x0144 */ EnMarutaActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0xDC];
+ /* 0x0148 */ char unk_148[0xD8];
+ /* 0x0220 */ s16 unk_220;
} EnMaruta; // size = 0x224
extern const ActorInit En_Maruta_InitVars;
diff --git a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c
index 6750c81da5..d5e15c04d1 100644
--- a/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c
+++ b/src/overlays/actors/ovl_En_Minideath/z_en_minideath.c
@@ -6,7 +6,7 @@
#include "z_en_minideath.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnMinideath*)thisx)
diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
index eecc287908..806ffe71a5 100644
--- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
+++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c
@@ -5,8 +5,10 @@
*/
#include "z_en_minifrog.h"
+#include "objects/object_fr/object_fr.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnMinifrog*)thisx)
@@ -24,12 +26,6 @@ void EnMinifrog_UpdateMissingFrog(Actor* thisx, GlobalContext* globalCtx);
void EnMinifrog_YellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx);
void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060007BC;
-extern AnimationHeader D_06001534;
-extern FlexSkeletonHeader D_0600B538;
-extern UNK_TYPE4 D_060059A0;
-extern UNK_TYPE4 D_06005BA0;
-
const ActorInit En_Minifrog_InitVars = {
ACTOR_EN_MINIFROG,
ACTORCAT_NPC,
@@ -65,9 +61,9 @@ static ColliderCylinderInit sCylinderInit = {
static CollisionCheckInfoInit sColChkInfoInit = { 1, 12, 14, MASS_IMMOVABLE };
// sEyeTextures???
-static UNK_TYPE4* D_808A4D74[] = {
- &D_060059A0,
- &D_06005BA0,
+static TexturePtr D_808A4D74[] = {
+ object_fr_Tex_0059A0,
+ object_fr_Tex_005BA0,
};
// gSaveContext.weekEventReg[KEY] = VALUE
@@ -92,7 +88,8 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B538, &D_06001534, this->jointTable, this->morphTable, 24);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fr_Skel_00B538, &object_fr_Anim_001534, this->jointTable,
+ this->morphTable, 24);
CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -133,14 +130,14 @@ void EnMinifrog_Init(Actor* thisx, GlobalContext* globalCtx) {
// Not spoken to MINIFROG_YELLOW
if (!(gSaveContext.weekEventReg[34] & 1)) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
}
this->actor.home.rot.x = this->actor.home.rot.z = 0;
this->frog = NULL;
} else {
this->frog = EnMinifrog_GetFrog(globalCtx);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
// Frog has been returned
if ((gSaveContext.weekEventReg[isFrogReturnedFlags[this->frogIndex] >> 8] &
@@ -180,7 +177,7 @@ EnMinifrog* EnMinifrog_GetFrog(GlobalContext* globalCtx) {
void EnMinifrog_SetJumpState(EnMinifrog* this) {
if (this->jumpState == MINIFROG_STATE_GROUND) {
this->jumpState = MINIFROG_STATE_JUMP;
- Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, 7.0f, 2, -5.0f);
+ Animation_Change(&this->skelAnime, &object_fr_Anim_0007BC, 1.0f, 0.0f, 7.0f, 2, -5.0f);
}
}
@@ -207,7 +204,7 @@ void EnMinifrog_Jump(EnMinifrog* this) {
case MINIFROG_STATE_AIR:
if (this->actor.bgCheckFlags & 1) {
this->jumpState = MINIFROG_STATE_GROUND;
- Animation_MorphToLoop(&this->skelAnime, &D_06001534, -2.5f);
+ Animation_MorphToLoop(&this->skelAnime, &object_fr_Anim_001534, -2.5f);
SkelAnime_Update(&this->skelAnime);
}
break;
@@ -227,22 +224,22 @@ void EnMinifrog_TurnToMissingFrog(EnMinifrog* this) {
static Color_RGBA8 sPrimColor = { 255, 255, 255, 255 };
static Color_RGBA8 sEnvColor = { 80, 80, 80, 255 };
-void EnMinifrog_SetCamera(EnMinifrog* this, GlobalContext* globalCtx) {
+void EnMinifrog_SpawnDust(EnMinifrog* this, GlobalContext* globalCtx) {
Vec3f pos;
Vec3f vec5;
Vec3f vel;
Vec3f accel;
s16 yaw;
s16 pitch;
- Vec3f eye;
+ Vec3f eye = GET_ACTIVE_CAM(globalCtx)->eye;
s32 i;
- eye = GET_ACTIVE_CAM(globalCtx)->eye;
yaw = Math_Vec3f_Yaw(&eye, &this->actor.world.pos);
pitch = -Math_Vec3f_Pitch(&eye, &this->actor.world.pos);
vec5.x = this->actor.world.pos.x - (5.0f * Math_SinS(yaw) * Math_CosS(pitch));
vec5.y = this->actor.world.pos.y - (5.0f * Math_SinS(pitch));
vec5.z = this->actor.world.pos.z - (5.0f * Math_CosS(yaw) * Math_CosS(pitch));
+
for (i = 0; i < 5; i++) {
vel.x = randPlusMinusPoint5Scaled(4.0f);
vel.y = randPlusMinusPoint5Scaled(4.0f);
@@ -287,7 +284,7 @@ void EnMinifrog_ReturnFrogCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
case 0xD85: // "I understand. I shall head for the mountains immediately."
default:
func_801477B4(globalCtx);
- EnMinifrog_SetCamera(this, globalCtx);
+ EnMinifrog_SpawnDust(this, globalCtx);
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_NPC_FADEAWAY);
if (this->actor.cutscene != -1) {
if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) {
@@ -413,7 +410,7 @@ void EnMinifrog_NextFrogReturned(EnMinifrog* this, GlobalContext* globalCtx) {
this->actionFunc = EnMinifrog_ContinueChoirCutscene;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
- globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0);
+ globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00DEA8, 0);
}
}
@@ -444,7 +441,7 @@ void EnMinifrog_SetupNextFrogChoir(EnMinifrog* this, GlobalContext* globalCtx) {
this->flags &= ~0x100;
this->flags &= ~(0x2 << MINIFROG_YELLOW | 0x2 << MINIFROG_CYAN | 0x2 << MINIFROG_PINK | 0x2 << MINIFROG_BLUE |
0x2 << MINIFROG_WHITE);
- globalCtx->setPlayerTalkAnim(globalCtx, &D_0400DEA8, 0);
+ globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00DEA8, 0);
} else if (this->timer <= 0) {
this->actionFunc = EnMinifrog_NextFrogReturned;
this->timer = 30;
@@ -464,7 +461,7 @@ void EnMinifrog_BeginChoirCutscene(EnMinifrog* this, GlobalContext* globalCtx) {
this->timer = 5;
func_801A1F00(3, NA_BGM_FROG_SONG);
this->flags |= 0x100;
- globalCtx->setPlayerTalkAnim(globalCtx, &D_0400E2A8, 0);
+ globalCtx->setPlayerTalkAnim(globalCtx, &gameplay_keep_Linkanim_00E2A8, 0);
} else {
ActorCutscene_SetIntentToPlay(this->actor.cutscene);
}
@@ -474,7 +471,7 @@ void EnMinifrog_EndChoir(EnMinifrog* this, GlobalContext* globalCtx) {
EnMinifrog_TurnToPlayer(this);
EnMinifrog_Jump(this);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0xD7E, &this->actor); // "Let us do it again sometime."
+ Message_StartTextbox(globalCtx, 0xD7E, &this->actor); // "Let us do it again sometime."
this->actionFunc = EnMinifrog_YellowFrogDialog;
} else {
func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1);
@@ -487,7 +484,7 @@ void EnMinifrog_GetFrogHP(EnMinifrog* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = EnMinifrog_EndChoir;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_NONE);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 50.0f);
@@ -520,7 +517,7 @@ void EnMinifrog_YellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx) {
case 0xD76: // "I have been waiting for you, Don Gero. Forgive me if I'm mistaken, but it looks like
// you've lost a little weight..."
func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
gSaveContext.weekEventReg[34] |= 1; // Spoken to MINIFROG_YELLOW
break;
case 0xD78: // "Unfortunately, it seems not all of our members have gathered."
@@ -552,7 +549,7 @@ void EnMinifrog_YellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx) {
default:
func_801477B4(globalCtx);
this->actionFunc = EnMinifrog_SetupYellowFrogDialog;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
break;
}
}
@@ -568,14 +565,15 @@ void EnMinifrog_SetupYellowFrogDialog(EnMinifrog* this, GlobalContext* globalCtx
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actionFunc = EnMinifrog_YellowFrogDialog;
if (!(gSaveContext.weekEventReg[34] & 1)) { // Not spoken with MINIFROG_YELLOW
- func_801518B0(globalCtx, 0xD76,
- &this->actor); // "I have been waiting for you, Don Gero. Forgive me if I'm mistaken, but it
- // looks like you've lost a little weight..."
+ Message_StartTextbox(globalCtx, 0xD76,
+ &this->actor); // "I have been waiting for you, Don Gero. Forgive me if I'm mistaken,
+ // but it looks like you've lost a little weight..."
} else {
- func_801518B0(globalCtx, 0xD7F, &this->actor); // "Well, if it isn't the great Don Gero."
+ Message_StartTextbox(globalCtx, 0xD7F, &this->actor); // "Well, if it isn't the great Don Gero."
}
} else if ((this->actor.xzDistToPlayer < 150.0f) &&
- (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) || ((this->actor.flags & 0x10000) == 0x10000)) &&
+ (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) ||
+ CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_10000)) &&
Player_GetMask(globalCtx) == PLAYER_MASK_DON_GERO) {
func_800B8614(&this->actor, globalCtx, 160.0f);
}
@@ -604,7 +602,7 @@ void EnMinifrog_UpdateMissingFrog(Actor* thisx, GlobalContext* globalCtx) {
}
s32 EnMinifrog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- Actor* arg) {
+ Actor* thisx) {
if (limbIndex == 1) {
pos->z -= 500.0f;
}
@@ -613,11 +611,11 @@ s32 EnMinifrog_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
*dList = NULL;
}
- return 0;
+ return false;
}
-void EnMinifrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnMinifrog* this = (EnMinifrog*)arg;
+void EnMinifrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnMinifrog* this = THIS;
if ((limbIndex == 7) || (limbIndex == 8)) {
OPEN_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
index b2b8dd5ba7..ea43899175 100644
--- a/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
+++ b/src/overlays/actors/ovl_En_Minislime/z_en_minislime.c
@@ -7,7 +7,7 @@
#include "z_en_minislime.h"
#include "overlays/actors/ovl_En_Bigslime/z_en_bigslime.h"
-#define FLAGS 0x00000235
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200)
#define THIS ((EnMinislime*)thisx)
@@ -121,7 +121,7 @@ static DamageTable sDamageTable = {
void EnMinislime_Init(Actor* thisx, GlobalContext* globalCtx) {
EnMinislime* this = THIS;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->id = this->actor.params;
@@ -506,8 +506,8 @@ void EnMinislime_SetupMoveToBigslime(EnMinislime* this) {
}
this->frozenAlpha = 0;
- if ((this->actor.flags & 0x2000) == 0x2000) {
- this->actor.flags &= ~0x2000;
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
+ this->actor.flags &= ~ACTOR_FLAG_2000;
}
this->actionFunc = EnMinislime_MoveToBigslime;
}
@@ -562,8 +562,8 @@ void EnMinislime_SetupDefeatIdle(EnMinislime* this) {
}
this->frozenAlpha = 0;
- if ((this->actor.flags & 0x2000) == 0x2000) {
- this->actor.flags &= ~0x2000;
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
+ this->actor.flags &= ~ACTOR_FLAG_2000;
}
this->actor.shape.rot.x = 0;
@@ -630,8 +630,8 @@ void EnMinislime_SetupMoveToGekko(EnMinislime* this) {
this->actor.velocity.y = 0.0f;
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 &= ~OC1_ON;
- if ((this->actor.flags & 0x2000) == 0x2000) {
- this->actor.flags &= ~0x2000;
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
+ this->actor.flags &= ~ACTOR_FLAG_2000;
}
this->actionFunc = EnMinislime_MoveToGekko;
@@ -720,7 +720,7 @@ void EnMinislime_Update(Actor* thisx, GlobalContext* globalCtx) {
} else if ((this->actor.params == MINISLIME_FORM_BIGSLIME) && (this->actionFunc != EnMinislime_MoveToBigslime)) {
EnMinislime_SetupMoveToBigslime(this);
} else {
- if ((this->actor.flags & 0x2000) == 0x2000) {
+ if CHECK_FLAG_ALL (this->actor.flags, ACTOR_FLAG_2000) {
this->collider.base.acFlags &= ~AC_HIT;
return;
}
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 514816f10e..1cc0cffcea 100644
--- a/src/overlays/actors/ovl_En_Mk/z_en_mk.c
+++ b/src/overlays/actors/ovl_En_Mk/z_en_mk.c
@@ -6,7 +6,7 @@
#include "z_en_mk.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnMk*)thisx)
diff --git a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
index 019e7a848f..45eff8050b 100644
--- a/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
+++ b/src/overlays/actors/ovl_En_Mkk/z_en_mkk.c
@@ -6,7 +6,7 @@
#include "z_en_mkk.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnMkk*)thisx)
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 58de48dbd7..dfb69be0f5 100644
--- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c
+++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c
@@ -5,8 +5,9 @@
*/
#include "z_en_mm.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnMm*)thisx)
@@ -216,6 +217,6 @@ void EnMm_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(-rotY, MTXMODE_APPLY);
}
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, &D_04055628);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_055628);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 94507b0014..718f384f32 100644
--- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
+++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
@@ -6,7 +6,7 @@
#include "z_en_mm2.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnMm2*)thisx)
@@ -64,7 +64,7 @@ void EnMm2_Reading(EnMm2* this, GlobalContext* globalCtx) {
*/
void EnMm2_WaitForRead(EnMm2* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x277B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x277B, &this->actor);
this->actionFunc = EnMm2_Reading;
} else if ((this->actor.xzDistToPlayer < 60.0f) && (Player_IsFacingActor(&this->actor, 0x3000, globalCtx))) {
func_800B8614(&this->actor, globalCtx, 110.0f);
diff --git a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
index 3c97190084..8ff09e32b3 100644
--- a/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
+++ b/src/overlays/actors/ovl_En_Mm3/z_en_mm3.c
@@ -6,7 +6,7 @@
#include "z_en_mm3.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnMm3*)thisx)
diff --git a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c
index cf9d23cb04..85996fe6c5 100644
--- a/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c
+++ b/src/overlays/actors/ovl_En_Mnk/z_en_mnk.c
@@ -6,7 +6,7 @@
#include "z_en_mnk.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnMnk*)thisx)
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 77b3d70dda..59aa5a22bc 100644
--- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c
+++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c
@@ -5,8 +5,9 @@
*/
#include "z_en_ms.h"
+#include "objects/object_ms/object_ms.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnMs*)thisx)
@@ -56,14 +57,12 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP),
};
-extern AnimationHeader D_060005EC;
-extern FlexSkeletonHeader D_06003DC0;
-
void EnMs_Init(Actor* thisx, GlobalContext* globalCtx) {
EnMs* this = THIS;
Actor_ProcessInitChain(thisx, sInitChain);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DC0, &D_060005EC, this->jointTable, this->morphTable, 9);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ms_Skel_003DC0, &object_ms_Anim_0005EC, this->jointTable,
+ this->morphTable, 9);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
diff --git a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
index 789f308caa..d74f329265 100644
--- a/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
+++ b/src/overlays/actors/ovl_En_Mt_tag/z_en_mt_tag.c
@@ -6,7 +6,7 @@
#include "z_en_mt_tag.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnMttag*)thisx)
diff --git a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
index ab94425ea8..60de874221 100644
--- a/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
+++ b/src/overlays/actors/ovl_En_Mushi2/z_en_mushi2.c
@@ -6,8 +6,9 @@
#include "overlays/actors/ovl_Obj_Bean/z_obj_bean.h"
#include "z_en_mushi2.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnMushi2*)thisx)
@@ -31,8 +32,6 @@ void func_80A6AE7C(EnMushi2* this, GlobalContext* globalCtx);
void func_80A6B078(EnMushi2* this);
void func_80A6B0D8(EnMushi2* this, GlobalContext* globalCtx);
-extern SkeletonHeader D_040527A0;
-
const ActorInit En_Mushi2_InitVars = {
ACTOR_EN_MUSHI2,
ACTORCAT_ITEMACTION,
@@ -199,7 +198,7 @@ void func_80A68B6C(EnMushi2* this) {
}
s32 func_80A68BA0(EnMushi2* this) {
- return (D_80A6B994 > 3) && this->unk_34C == 0;
+ return (D_80A6B994 > 3) && this->unk_34C == NULL;
}
void func_80A68BC8(EnMushi2* this) {
@@ -606,11 +605,11 @@ void func_80A69ADC(Actor* thisx) {
sp44 = Math3D_SignedDistanceFromPlane(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
- &bean->actor.world.pos);
+ &bean->dyna.actor.world.pos);
sp40 = Math3D_SignedDistanceFromPlane(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
- &bean->actor.world.pos);
+ &bean->dyna.actor.world.pos);
sp3C = Math3D_XZLength(sp44, sp40);
if (fabsf(sp3C) > 0.1f) {
@@ -652,11 +651,11 @@ void func_80A69D3C(EnMushi2* this) {
sp40 = Math3D_SignedDistanceFromPlane(
this->unk_310.x, this->unk_310.y, this->unk_310.z,
func_80A69AA8(this->unk_310.x, this->unk_310.y, this->unk_310.z, &this->actor.world.pos),
- &this->unk_34C->actor.world.pos);
+ &this->unk_34C->dyna.actor.world.pos);
sp3C = Math3D_SignedDistanceFromPlane(
this->unk_328.x, this->unk_328.y, this->unk_328.z,
func_80A69AA8(this->unk_328.x, this->unk_328.y, this->unk_328.z, &this->actor.world.pos),
- &this->unk_34C->actor.world.pos);
+ &this->unk_34C->dyna.actor.world.pos);
sp38 = Math3D_XZLengthSquared(sp40, sp3C);
if (fabsf(sp38) > 0.010000001f) {
@@ -751,8 +750,9 @@ void EnMushi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.home.rot.y = this->actor.shape.rot.y;
this->actor.world.rot.y = this->actor.shape.rot.y;
func_80A68F24(this);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_040527A0, &D_0405140C, this->jointTable, this->morphTable, 24);
- Animation_Change(&this->skelAnime, &D_0405140C, 1.0f, 0.0f, 0.0f, 1, 0.0f);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gameplay_keep_Skel_0527A0, &gameplay_keep_Anim_05140C,
+ this->jointTable, this->morphTable, 24);
+ Animation_Change(&this->skelAnime, &gameplay_keep_Anim_05140C, 1.0f, 0.0f, 0.0f, 1, 0.0f);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
func_80A68808(this);
@@ -840,7 +840,7 @@ void func_80A6A508(Actor* thisx) {
}
this->unk_368 = Rand_S16Offset(10, 30);
- if (this->unk_34C == 0) {
+ if (this->unk_34C == NULL) {
func_80A69CE0(thisx);
} else {
func_80A69ADC(thisx);
@@ -991,7 +991,7 @@ void func_80A6AB08(EnMushi2* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.world.rot.z, 0, 0xBB8);
this->actor.shape.rot.z = this->actor.world.rot.z;
- if ((this->actor.flags & 0x40) && (Rand_ZeroOne() < 0.03f)) {
+ if ((this->actor.flags & ACTOR_FLAG_40) && (Rand_ZeroOne() < 0.03f)) {
Vec3f sp3C;
sp3C.x = this->actor.world.pos.x;
@@ -1033,8 +1033,8 @@ void func_80A6AE7C(EnMushi2* this, GlobalContext* globalCtx) {
func_80A69424(this, globalCtx);
temp_f2 = this->actor.scale.x - (1.0f / 20000.0f);
Actor_SetScale(&this->actor, CLAMP_MIN(temp_f2, 0.001f));
- if ((this->actor.flags & 0x40) && (this->actor.depthInWater > 5.0f) && (this->actor.depthInWater < 30.0f) &&
- ((Rand_Next() & 0x1FF) < this->unk_368)) {
+ if ((this->actor.flags & ACTOR_FLAG_40) && (this->actor.depthInWater > 5.0f) &&
+ (this->actor.depthInWater < 30.0f) && ((Rand_Next() & 0x1FF) < this->unk_368)) {
EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, -5.0f, 5.0f, 5.0f,
((Rand_ZeroOne() * 4.0f) + 2.0f) * this->actor.scale.x);
}
@@ -1082,7 +1082,7 @@ void func_80A6B0D8(EnMushi2* this, GlobalContext* globalCtx) {
this->actor.velocity.z =
(this->actor.speedXZ * this->unk_328.z) + (-0.01f * this->unk_31C.z) + (this->unk_310.z * temp_f2);
- if ((this->actor.flags & 0x40) && (this->unk_368 > 20) && (Rand_ZeroOne() < 0.15f)) {
+ if ((this->actor.flags & ACTOR_FLAG_40) && (this->unk_368 > 20) && (Rand_ZeroOne() < 0.15f)) {
Vec3f sp48;
s32 sp44 = 0;
@@ -1118,7 +1118,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
f32 phi_f0;
s32 temp;
- if ((this->unk_34C != NULL) && (this->unk_34C->actor.update == NULL)) {
+ if ((this->unk_34C != NULL) && (this->unk_34C->dyna.actor.update == NULL)) {
this->unk_34C = NULL;
}
@@ -1137,7 +1137,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_36A--;
}
- if ((this->unk_34C != 0) && ((this->actionFunc == func_80A6A5C0) || (this->actionFunc == func_80A6A824)) &&
+ if ((this->unk_34C != NULL) && ((this->actionFunc == func_80A6A5C0) || (this->actionFunc == func_80A6A824)) &&
(this->unk_354 < SQ(3.0f))) {
this->unk_30C |= 0x80;
func_80A6B078(this);
@@ -1176,15 +1176,15 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80A68BC8(this);
}
- if (this->unk_34C != 0) {
+ if (this->unk_34C != NULL) {
sp4C = 0.0f;
- this->unk_354 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->unk_34C->actor.world.pos);
+ this->unk_354 = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->unk_34C->dyna.actor.world.pos);
if (this->unk_354 < this->unk_350) {
- f32 dist = Math3D_DistPlaneToPos(COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.x),
- COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.y),
- COLPOLY_GET_NORMAL(this->unk_34C->actor.floorPoly->normal.z),
- this->unk_34C->actor.floorPoly->dist, &this->actor.world.pos);
+ f32 dist = Math3D_DistPlaneToPos(COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.x),
+ COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.y),
+ COLPOLY_GET_NORMAL(this->unk_34C->dyna.actor.floorPoly->normal.z),
+ this->unk_34C->dyna.actor.floorPoly->dist, &this->actor.world.pos);
if (fabsf(dist) < 3.0f) {
sp4C = 1.9f;
@@ -1195,7 +1195,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
if ((this->actionFunc != func_80A6AE7C) && (this->actionFunc != func_80A6B0D8) &&
((this->actionFunc != func_80A6A36C) || (this->unk_36A < 0xDD)) &&
(((this->actionFunc != func_80A6A5C0) && (this->actionFunc != func_80A6A824) &&
@@ -1203,7 +1203,7 @@ void EnMushi2_Update(Actor* thisx, GlobalContext* globalCtx) {
!(this->unk_358 > 0.999f) || !(this->unk_354 < SQ(20.0f)))) {
s32 phi_v0 = true;
- if (this->unk_34C == 0) {
+ if (this->unk_34C == NULL) {
this->collider.base.ocFlags1 |= OC1_TYPE_PLAYER;
} else {
this->collider.base.ocFlags1 &= ~OC1_TYPE_PLAYER;
diff --git a/src/overlays/actors/ovl_En_Muto/z_en_muto.c b/src/overlays/actors/ovl_En_Muto/z_en_muto.c
index 00c3ed0c98..0e3cbded40 100644
--- a/src/overlays/actors/ovl_En_Muto/z_en_muto.c
+++ b/src/overlays/actors/ovl_En_Muto/z_en_muto.c
@@ -5,8 +5,9 @@
*/
#include "z_en_muto.h"
+#include "objects/object_toryo/object_toryo.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnMuto*)thisx)
@@ -23,9 +24,6 @@ void EnMuto_SetupDialogue(EnMuto* this, GlobalContext* globalCtx);
void EnMuto_InDialogue(EnMuto* this, GlobalContext* globalCtx);
s32 EnMuto_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx);
-extern AnimationHeader D_06000E50;
-extern FlexSkeletonHeader D_06007150;
-
const ActorInit En_Muto_InitVars = {
ACTOR_EN_MUTO,
ACTORCAT_NPC,
@@ -65,7 +63,8 @@ void EnMuto_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007150, &D_06000E50, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_toryo_Skel_007150, &object_toryo_Anim_000E50,
+ this->jointTable, this->morphTable, 17);
this->isInMayorsRoom = this->actor.params;
if (!this->isInMayorsRoom) {
@@ -101,8 +100,8 @@ void EnMuto_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnMuto_ChangeAnim(EnMuto* this, s32 animIndex) {
- static AnimationHeader* sAnimations[] = { &D_06000E50, &D_06000E50 };
- static u8 sAnimationModes[] = { 0, 2 };
+ static AnimationHeader* sAnimations[] = { &object_toryo_Anim_000E50, &object_toryo_Anim_000E50 };
+ static u8 sAnimationModes[] = { ANIMMODE_LOOP, ANIMMODE_ONCE };
this->animIndex = animIndex;
this->frameIndex = Animation_GetLastFrame(&sAnimations[animIndex]->common);
@@ -135,7 +134,7 @@ void EnMuto_Idle(EnMuto* this, GlobalContext* globalCtx) {
this->actor.textId = sTextIds[this->textIdIndex];
if (!this->isInMayorsRoom && (player = GET_PLAYER(globalCtx))->transformation == PLAYER_FORM_DEKU) {
- if (!(gSaveContext.weekEventReg[0x58] & 8)) {
+ if (!(gSaveContext.weekEventReg[88] & 8)) {
this->actor.textId = 0x62C;
} else {
this->actor.textId = 0x62B;
@@ -162,7 +161,7 @@ void EnMuto_Idle(EnMuto* this, GlobalContext* globalCtx) {
}
} else {
this->textIdIndex = 0;
- if (gSaveContext.weekEventReg[0x3C] & 8) {
+ if (gSaveContext.weekEventReg[60] & 8) {
this->textIdIndex = 1;
}
if (Player_GetMask(globalCtx) == PLAYER_MASK_COUPLE) {
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 ffd002a40f..5f24e5b018 100644
--- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c
+++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c
@@ -6,7 +6,7 @@
#include "z_en_nb.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnNb*)thisx)
diff --git a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c
index 4c3859efd5..5e288df38b 100644
--- a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c
+++ b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c
@@ -6,7 +6,7 @@
#include "z_en_neo_reeba.h"
-#define FLAGS 0x00000205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200)
#define THIS ((EnNeoReeba*)thisx)
diff --git a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
index 050d22dac7..779de0b8ac 100644
--- a/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
+++ b/src/overlays/actors/ovl_En_Nimotsu/z_en_nimotsu.c
@@ -6,7 +6,7 @@
#include "z_en_nimotsu.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnNimotsu*)thisx)
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 41730f4d44..f6e398a33d 100644
--- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c
+++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c
@@ -5,8 +5,9 @@
*/
#include "z_en_niw.h"
+#include "objects/object_niw/object_niw.h"
-#define FLAGS 0x00800010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000)
#define THIS ((EnNiw*)thisx)
@@ -32,11 +33,6 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx);
void func_80891320(EnNiw* this, GlobalContext* globalCtx, s16 arg2);
void EnNiw_SpawnFeather(EnNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 scale);
-extern FlexSkeletonHeader D_06002530;
-extern AnimationHeader D_060000E8;
-extern Gfx D_060023B0[]; // gNiwFeatherMaterialDL
-extern Gfx D_06002428[]; // gNiwFeatherDL
-
// turned on during cucco storm, but not read by anything?
// maybe read by En_Attack_Niw
s16 D_80893460 = false;
@@ -110,7 +106,7 @@ static Vec3f D_808934E8 = {
static s32 pad = 0;
void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) {
- EnNiw* this = (EnNiw*)thisx;
+ EnNiw* this = THIS;
Vec3f dTemp = D_808934C4;
if (this->actor.params < 0) { // all neg values become zero
@@ -122,12 +118,12 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) {
this->niwType = this->actor.params;
Actor_ProcessInitChain(&this->actor, sInitChain);
- this->actor.flags |= 0x1; // targetable ON
+ this->actor.flags |= ACTOR_FLAG_1; // targetable ON
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelanime, &D_06002530, &D_060000E8, this->jointTable, this->morphTable,
- ENNIW_LIMBCOUNT);
+ SkelAnime_InitFlex(globalCtx, &this->skelanime, &object_niw_Skel_002530, &object_niw_Anim_0000E8, this->jointTable,
+ this->morphTable, ENNIW_LIMBCOUNT);
Math_Vec3f_Copy(&this->unk2A4, &this->actor.world.pos);
Math_Vec3f_Copy(&this->unk2B0, &this->actor.world.pos);
@@ -150,7 +146,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow
this->sfxTimer1 = 30;
this->unkTimer250 = 30;
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->unknownState28E = 4;
this->actionFunc = EnNiw_Held;
this->actor.speedXZ = 0.0f;
@@ -163,7 +159,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) {
}
void EnNiw_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- EnNiw* this = (EnNiw*)thisx;
+ EnNiw* this = THIS;
if (this->niwType == ENNIW_TYPE_REGULAR) {
Collider_DestroyCylinder(globalCtx, &this->collider);
@@ -327,7 +323,8 @@ void func_808917F8(EnNiw* this, GlobalContext* globalCtx, s32 arg2) {
}
void EnNiw_SetupIdle(EnNiw* this) {
- Animation_Change(&this->skelanime, &D_060000E8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000E8), 0, -10.0f);
+ Animation_Change(&this->skelanime, &object_niw_Anim_0000E8, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_niw_Anim_0000E8), 0, -10.0f);
this->unknownState28E = 0;
this->actionFunc = EnNiw_Idle;
}
@@ -345,7 +342,7 @@ void EnNiw_Idle(EnNiw* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CHICKEN_CRY_M); // crow
this->sfxTimer1 = 30;
this->unkTimer250 = 30;
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->unknownState28E = 4;
this->actor.speedXZ = 0.0f;
this->actionFunc = EnNiw_Held;
@@ -441,7 +438,7 @@ void EnNiw_Held(EnNiw* this, GlobalContext* globalCtx) {
this->actor.shape.rot.z = 0;
rotZ = this->actor.shape.rot.z;
this->unknownState28E = 5;
- this->actor.flags |= 0x1; // targetable ON
+ this->actor.flags |= ACTOR_FLAG_1; // targetable ON
this->actionFunc = EnNiw_Thrown;
this->actor.shape.rot.y = rotZ;
this->actor.shape.rot.x = rotZ;
@@ -459,7 +456,7 @@ void EnNiw_Held(EnNiw* this, GlobalContext* globalCtx) {
this->actor.shape.rot.x = rotZ;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Math_Vec3f_Copy(&this->unk2BC, &vec3fcopy);
- this->actor.flags |= 0x1; // targetable ON
+ this->actor.flags |= ACTOR_FLAG_1; // targetable ON
this->actionFunc = EnNiw_Thrown;
}
func_80891320(this, globalCtx, 2);
@@ -497,7 +494,7 @@ void EnNiw_Thrown(EnNiw* this, GlobalContext* globalCtx) {
this->sfxTimer1 = 30;
this->unk2EC = 0;
this->unkTimer250 = 30;
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->unknownState28E = 4;
this->actionFunc = EnNiw_Held;
this->actor.speedXZ = 0.0f;
@@ -608,7 +605,7 @@ void EnNiw_SetupCuccoStorm(EnNiw* this, GlobalContext* globalCtx) {
if (this->unkTimer252 == 0) {
this->unkTimer252 = 10;
this->yawTowardsPlayer = this->actor.yawTowardsPlayer;
- this->actor.flags &= ~0x1; // targetable OFF
+ this->actor.flags &= ~ACTOR_FLAG_1; // targetable OFF
this->unknownState28E = 3;
this->actionFunc = EnNiw_CuccoStorm;
}
@@ -629,7 +626,8 @@ void EnNiw_CuccoStorm(EnNiw* this, GlobalContext* globalCtx) {
}
void EnNiw_SetupRunAway(EnNiw* this) {
- Animation_Change(&this->skelanime, &D_060000E8, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000E8), 0, -10.0f);
+ Animation_Change(&this->skelanime, &object_niw_Anim_0000E8, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_niw_Anim_0000E8), 0, -10.0f);
this->unk29A = Rand_ZeroFloat(1.99f);
this->unknownState28E = 7;
this->actionFunc = EnNiw_RunAway;
@@ -732,7 +730,7 @@ void EnNiw_CheckRage(EnNiw* this, GlobalContext* globalCtx) {
}
void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
- EnNiw* this = (EnNiw*)thisx;
+ EnNiw* this = THIS;
s8 pad0;
s16 i;
Player* player = GET_PLAYER(globalCtx);
@@ -744,7 +742,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
s32 pad2[9];
s16 temp29C;
f32 featherScale;
- f32 camResult;
+ f32 viewAtToEyeNormY;
f32 floorHeight;
f32 dist = 20.0f;
s32 pad3;
@@ -810,17 +808,19 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 60.0f, 0x1F);
+ // if cucco is off the map?
if (this->actor.floorHeight <= BGCHECK_Y_MIN || this->actor.floorHeight >= BGCHECK_Y_MAX) {
- // if cucco is off the map?
- Vec3f camera;
- camera.x = globalCtx->view.at.x - globalCtx->view.eye.x;
- camera.y = globalCtx->view.at.y - globalCtx->view.eye.y;
- camera.z = globalCtx->view.at.z - globalCtx->view.eye.z;
- camResult = camera.y / sqrtf(SQXYZ(camera));
+ Vec3f viewAtToEye;
+
+ // Direction vector for the direction the camera is facing
+ viewAtToEye.x = globalCtx->view.at.x - globalCtx->view.eye.x;
+ viewAtToEye.y = globalCtx->view.at.y - globalCtx->view.eye.y;
+ viewAtToEye.z = globalCtx->view.at.z - globalCtx->view.eye.z;
+ viewAtToEyeNormY = viewAtToEye.y / sqrtf(SQXYZ(viewAtToEye));
this->actor.world.pos.x = this->actor.home.pos.x;
this->actor.world.pos.z = this->actor.home.pos.z;
- this->actor.world.pos.y = (this->actor.home.pos.y + globalCtx->view.eye.y) + (camResult * 160.0f);
+ this->actor.world.pos.y = (this->actor.home.pos.y + globalCtx->view.eye.y) + (viewAtToEyeNormY * 160.0f);
if (this->actor.world.pos.y < this->actor.home.pos.y) {
this->actor.world.pos.y = this->actor.home.pos.y + 300.0f;
@@ -906,7 +906,7 @@ void EnNiw_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 EnNiw_LimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnNiw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnNiw* this = THIS;
if (limbIndex == 13) {
@@ -925,15 +925,15 @@ s32 EnNiw_LimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f*
rot->y += (s16)this->limb7Roty;
rot->z += (s16)this->limb7Rotz;
}
- return 0;
+ return false;
}
void EnNiw_Draw(Actor* thisx, GlobalContext* globalCtx) {
- EnNiw* this = (EnNiw*)thisx;
+ EnNiw* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount,
- EnNiw_LimbDraw, NULL, &this->actor);
+ EnNiw_OverrideLimbDraw, NULL, &this->actor);
EnNiw_DrawFeathers(this, globalCtx);
}
@@ -1002,7 +1002,7 @@ void EnNiw_DrawFeathers(EnNiw* this, GlobalContext* globalCtx) {
if (feather->isEnabled == true) {
// Apply the feather material if it has not already been applied.
if (!isMaterialApplied) {
- gSPDisplayList(POLY_XLU_DISP++, D_060023B0);
+ gSPDisplayList(POLY_XLU_DISP++, gNiwFeatherMaterialDL);
isMaterialApplied++;
}
@@ -1014,7 +1014,7 @@ void EnNiw_DrawFeathers(EnNiw* this, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06002428);
+ gSPDisplayList(POLY_XLU_DISP++, gNiwFeatherDL);
}
}
diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
index d106901045..1400e3c067 100644
--- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
+++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
@@ -5,8 +5,9 @@
*/
#include "z_en_nnh.h"
+#include "objects/object_nnh/object_nnh.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnNnh*)thisx)
@@ -52,8 +53,6 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 50, 0, { 0, 0, 0 } },
};
-extern Gfx D_06001510[];
-
void EnNnh_Init(Actor* thisx, GlobalContext* globalCtx) {
EnNnh* this = THIS;
@@ -78,7 +77,7 @@ void func_80C08828(EnNnh* this) {
void func_80C0883C(EnNnh* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x228U, &this->actor);
+ Message_StartTextbox(globalCtx, 0x228U, &this->actor);
func_80C088A4(this);
return;
}
@@ -110,5 +109,5 @@ void EnNnh_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(gfxCtx->polyOpa.p++, D_06001510);
+ gSPDisplayList(gfxCtx->polyOpa.p++, object_nnh_DL_001510);
}
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 c99daf298b..3eed47b710 100644
--- a/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
+++ b/src/overlays/actors/ovl_En_Nutsball/z_en_nutsball.c
@@ -6,8 +6,9 @@
#include "z_en_nutsball.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnNutsball*)thisx)
@@ -85,10 +86,9 @@ void EnNutsball_InitColliderParams(EnNutsball* this) {
this->collider.info.toucher.damage = 2;
}
-void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
+void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
EnNutsball* this = THIS;
- GlobalContext* globalCtx2 = globalCtx;
-
Player* player = GET_PLAYER(globalCtx);
Vec3f worldPos;
Vec3s worldRot;
@@ -138,11 +138,11 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 5.0f, 10.0f, 0x7);
if (this->actor.bgCheckFlags & 8) {
- if (func_800C9A4C(&globalCtx2->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) {
+ if (func_800C9A4C(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId) & 0x30) {
this->actor.bgCheckFlags &= ~8;
- if (BgCheck_EntityLineTest1(&globalCtx2->colCtx, &this->actor.prevPos, &worldPos,
- &this->actor.world.pos, &poly, true, false, false, true, &bgId)) {
- if (func_800C9A4C(&globalCtx2->colCtx, poly, bgId) & 0x30) {
+ if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.prevPos, &worldPos, &this->actor.world.pos,
+ &poly, true, false, false, true, &bgId)) {
+ if (func_800C9A4C(&globalCtx->colCtx, poly, bgId) & 0x30) {
this->actor.world.pos.x += this->actor.velocity.x * 0.01f;
this->actor.world.pos.z += this->actor.velocity.z * 0.01f;
} else {
@@ -155,13 +155,13 @@ void EnNutsball_Update(Actor* thisx, GlobalContext* globalCtx) {
}
Collider_UpdateCylinder(&this->actor, &this->collider);
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->timer < this->timerThreshold) {
- CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx2->colChkCtx, &this->collider.base);
}
}
}
@@ -174,6 +174,6 @@ void EnNutsball_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_InsertMatrix(&globalCtx->billboardMtxF, MTXMODE_APPLY);
Matrix_InsertZRotation_s(this->actor.home.rot.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_04058BA0);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_058BA0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 53c38ab6b3..4c0fdce1ef 100644
--- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
+++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c
@@ -6,7 +6,7 @@
#include "z_en_nwc.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnNwc*)thisx)
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 9b0d89cddf..8ce5507737 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,7 +6,7 @@
#include "z_en_okarina_effect.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnOkarinaEffect*)thisx)
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 096fd94217..5a54da7b12 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
@@ -6,7 +6,7 @@
#include "z_en_okarina_tag.h"
-#define FLAGS 0x0A000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000 | ACTOR_FLAG_8000000)
#define THIS ((EnOkarinaTag*)thisx)
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 251f23a30f..b11997b822 100644
--- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c
+++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c
@@ -6,7 +6,7 @@
#include "z_en_okuta.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnOkuta*)thisx)
diff --git a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c
index 1f93a97867..c904cdd420 100644
--- a/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c
+++ b/src/overlays/actors/ovl_En_Onpuman/z_en_onpuman.c
@@ -6,7 +6,7 @@
#include "z_en_onpuman.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnOnpuman*)thisx)
diff --git a/src/overlays/actors/ovl_En_Osk/z_en_osk.c b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
index c71650ef1e..2faed6abb7 100644
--- a/src/overlays/actors/ovl_En_Osk/z_en_osk.c
+++ b/src/overlays/actors/ovl_En_Osk/z_en_osk.c
@@ -6,7 +6,7 @@
#include "z_en_osk.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnOsk*)thisx)
diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c
index 758da16f43..620d4450a3 100644
--- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c
+++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c
@@ -5,8 +5,9 @@
*/
#include "z_en_osn.h"
+#include "objects/object_osn/object_osn.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnOsn*)thisx)
@@ -15,7 +16,6 @@ void EnOsn_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnOsn_Update(Actor* thisx, GlobalContext* globalCtx);
void EnOsn_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Osn_InitVars = {
ACTOR_EN_OSN,
ACTORCAT_NPC,
@@ -28,18 +28,45 @@ const ActorInit En_Osn_InitVars = {
(ActorFunc)EnOsn_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80AD2518 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static AnimationInfo sAnimations[] = {
+ { &object_osn_Anim_0201BC, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_002F74, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_0037C4, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_004320, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_004C8C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0094E4, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_009BB8, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_00AC60, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_001614, 1.0f, 1.0f, 39.0f, 0, 0.0f }, { &object_osn_Anim_001034, 1.0f, 1.0f, 70.0f, 0, 0.0f },
+ { &object_osn_Anim_00AE9C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_003A1C, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_0055F8, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_007220, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_0000C4, 0.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_osn_Anim_0000C4, 0.0f, 1.0f, 1.0f, 2, 0.0f }, { &object_osn_Anim_006D48, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_001D6C, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_002634, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_008D80, 1.0f, 0.0f, 0.0f, 2, 0.0f }, { &object_osn_Anim_005D78, 1.0f, 0.0f, 0.0f, 2, 0.0f },
+ { &object_osn_Anim_006564, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &object_osn_Anim_00A444, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+ { &object_osn_Anim_008D80, 0.0f, 77.0f, 0.0f, 2, 0.0f },
+};
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 30, 40, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80AD2544 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80AD2550 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -74,59 +101,824 @@ static DamageTable D_80AD2550 = {
/* Powder Keg */ DMG_ENTRY(0, 0x0),
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80AD2570[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 0, ICHAIN_STOP),
};
-#endif
+void func_80AD1634(EnOsn*, GlobalContext*);
+void func_80AD16A8(EnOsn*, GlobalContext*);
+void func_80AD14C8(EnOsn*, GlobalContext*);
+void func_80AD19A0(EnOsn* this, GlobalContext* globalCtx);
-extern ColliderCylinderInit D_80AD2518;
-extern CollisionCheckInfoInit2 D_80AD2544;
-extern DamageTable D_80AD2550;
-extern InitChainEntry D_80AD2570[];
+void func_80AD0830(EnOsn* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-extern UNK_TYPE D_060192A0;
-extern UNK_TYPE D_060201BC;
+s32 func_80AD08B0(GlobalContext* globalCtx) {
+ switch (Player_GetMask(globalCtx)) {
+ case PLAYER_MASK_GREAT_FAIRY:
+ return 0x1FD6;
+ case PLAYER_MASK_GIBDO:
+ return 0x1FD8;
+ case PLAYER_MASK_TRUTH:
+ return 0x1FDA;
+ case PLAYER_MASK_GIANT:
+ return 0x1FDC;
+ case PLAYER_MASK_KAFEIS_MASK:
+ return 0x1FDE;
+ case PLAYER_MASK_DON_GERO:
+ return 0x1FE0;
+ case PLAYER_MASK_BLAST:
+ return 0x1FE2;
+ case PLAYER_MASK_COUPLE:
+ return 0x1FE4;
+ case PLAYER_MASK_SCENTS:
+ return 0x1FE6;
+ case PLAYER_MASK_KAMARO:
+ return 0x1FE8;
+ case PLAYER_MASK_STONE:
+ return 0x1FEA;
+ case PLAYER_MASK_POSTMAN:
+ return 0x1FEC;
+ case PLAYER_MASK_BUNNY:
+ return 0x1FEE;
+ case PLAYER_MASK_CAPTAIN:
+ return 0x1FF0;
+ case PLAYER_MASK_BREMEN:
+ return 0x1FF2;
+ case PLAYER_MASK_CIRCUS_LEADER:
+ return 0x1FF4;
+ case PLAYER_MASK_KEATON:
+ return 0x1FF6;
+ case PLAYER_MASK_GARO:
+ return 0x1FF8;
+ case PLAYER_MASK_ALL_NIGHT:
+ return 0x1FFA;
+ case PLAYER_MASK_ROMANI:
+ return 0x1FFC;
+ default:
+ return 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0830.s")
+void func_80AD0998(EnOsn* this) {
+ s16 curFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD08B0.s")
+ if (this->unk_1EC == 0x12 && curFrame == lastFrame) {
+ this->unk_1EC = 0x13;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x13);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0998.s")
+void func_80AD0A24(EnOsn* this) {
+ s16 curFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0A24.s")
+ if (this->unk_1EC == 0x15 && curFrame == lastFrame) {
+ this->unk_1EC = 0x16;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0x16);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0AB0.s")
+void func_80AD0AB0(EnOsn* this) {
+ s16 curFrame = this->skelAnime.curFrame;
+ s16 lastFrame = Animation_GetLastFrame(sAnimations[this->unk_1EC].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0B38.s")
+ if (curFrame == lastFrame) {
+ this->unk_1FA -= 8;
+ if (this->unk_1FA < 8) {
+ this->unk_1FA = 0;
+ Actor_MarkForDeath(&this->actor);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD0E10.s")
+s32 func_80AD0B38(EnOsn* this, GlobalContext* globalCtx) {
+ switch (Player_GetMask(globalCtx)) {
+ case PLAYER_MASK_GREAT_FAIRY:
+ if (!(this->unk_1F6 & 1)) {
+ this->unk_1F6 |= 1;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_GIBDO:
+ if (!(this->unk_1F6 & 2)) {
+ this->unk_1F6 |= 2;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_TRUTH:
+ if (!(this->unk_1F6 & 4)) {
+ this->unk_1F6 |= 4;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_GIANT:
+ if (!(this->unk_1F6 & 8)) {
+ this->unk_1F6 |= 8;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_KAFEIS_MASK:
+ if (!(this->unk_1F6 & 0x10)) {
+ this->unk_1F6 |= 0x10;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_DON_GERO:
+ if (!(this->unk_1F6 & 0x20)) {
+ this->unk_1F6 |= 0x20;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_BLAST:
+ if (!(this->unk_1F6 & 0x40)) {
+ this->unk_1F6 |= 0x40;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_COUPLE:
+ if (!(this->unk_1F6 & 0x80)) {
+ this->unk_1F6 |= 0x80;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_SCENTS:
+ if (!(this->unk_1F6 & 0x100)) {
+ this->unk_1F6 |= 0x100;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_KAMARO:
+ if (!(this->unk_1F6 & 0x200)) {
+ this->unk_1F6 |= 0x200;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_STONE:
+ if (!(this->unk_1F6 & 0x400)) {
+ this->unk_1F6 |= 0x400;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_POSTMAN:
+ if (!(this->unk_1F6 & 0x800)) {
+ this->unk_1F6 |= 0x800;
+ return 0x1FD2;
+ }
+ break;
+ case PLAYER_MASK_BUNNY:
+ if (!(this->unk_1F6 & 0x1000)) {
+ this->unk_1F6 |= 0x1000;
+ return 0x1FD2;
+ }
+ break;
+ case PLAYER_MASK_CAPTAIN:
+ if (!(this->unk_1F6 & 0x2000)) {
+ this->unk_1F6 |= 0x2000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_BREMEN:
+ if (!(this->unk_1F6 & 0x4000)) {
+ this->unk_1F6 |= 0x4000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_CIRCUS_LEADER:
+ if (!(this->unk_1F6 & 0x8000)) {
+ this->unk_1F6 |= 0x8000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_KEATON:
+ if (!(this->unk_1F6 & 0x10000)) {
+ this->unk_1F6 |= 0x10000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_GARO:
+ if (!(this->unk_1F6 & 0x20000)) {
+ this->unk_1F6 |= 0x20000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_ALL_NIGHT:
+ if (!(this->unk_1F6 & 0x40000)) {
+ this->unk_1F6 |= 0x40000;
+ return 0x1FD1;
+ }
+ break;
+ case PLAYER_MASK_ROMANI:
+ if (!(this->unk_1F6 & 0x80000)) {
+ this->unk_1F6 |= 0x80000;
+ return 0x1FD1;
+ }
+ break;
+ default:
+ break;
+ }
+ this->unk_1EA |= 0x20;
+ if (gSaveContext.day == 3 && gSaveContext.time >= CLOCK_TIME(5, 0) && gSaveContext.time < CLOCK_TIME(6, 0)) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD10FC.s")
+s32 func_80AD0E10(EnOsn* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD1398.s")
+ if ((gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE) && CHECK_QUEST_ITEM(QUEST_SONG_HEALING)) {
+ if (this->unk_1EA & 1) {
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE) &&
+ (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) {
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+ }
+ return 0x1FAF;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD144C.s")
+ if (player->transformation == PLAYER_FORM_DEKU) {
+ if (this->unk_1EA & 4) {
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+ }
+ this->unk_1EA |= 4;
+ return 0x1FC8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD14C8.s")
+ if (player->transformation == PLAYER_FORM_GORON) {
+ if (this->unk_1EA & 8) {
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+ }
+ this->unk_1EA |= 8;
+ if (gSaveContext.weekEventReg[76] & 0x20) {
+ return 0x1FC8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD1634.s")
+ gSaveContext.weekEventReg[76] |= 0x20;
+ return 0x1FCE;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD16A8.s")
+ if (player->transformation == PLAYER_FORM_ZORA) {
+ if (this->unk_1EA & 0x10) {
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+ }
+ this->unk_1EA |= 0x10;
+ if (gSaveContext.weekEventReg[76] & 0x40) {
+ return 0x1FC8;
+ }
+ gSaveContext.weekEventReg[76] |= 0x40;
+ return 0x1FD0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD19A0.s")
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_NONE) {
+ if (this->unk_1EA & 2) {
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2006;
+ }
+ return 0x1FCD;
+ }
+ this->unk_1EA |= 2;
+ return 0x1FC8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD1A4C.s")
+ return func_80AD0B38(this, globalCtx);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/EnOsn_Init.s")
+ this->unk_1EA |= 0x20;
+ if ((gSaveContext.day == 3) && (gSaveContext.time >= CLOCK_TIME(5, 0)) && (gSaveContext.time < CLOCK_TIME(6, 0))) {
+ return 0x2004;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/EnOsn_Destroy.s")
+ return 0x1FAE;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/EnOsn_Update.s")
+void func_80AD10FC(EnOsn* this, GlobalContext* globalCtx) {
+ switch (this->unk_1F4) {
+ case 0x1FC8:
+ this->unk_1F4 = 0x1FC9;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD1DA8.s")
+ case 0x1FC9:
+ this->unk_1F4 = 0x1FCA;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/func_80AD1E28.s")
+ case 0x1FCA:
+ if ((gSaveContext.day == 3 && gSaveContext.time >= CLOCK_TIME(5, 0)) &&
+ gSaveContext.time < CLOCK_TIME(6, 0)) {
+ this->unk_1F4 = 0x2007;
+ } else {
+ this->unk_1F4 = 0x1FCB;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Osn/EnOsn_Draw.s")
+ case 0x1FCB:
+ case 0x2007:
+ this->unk_1F4 = 0x1FCC;
+ this->unk_1EA |= 0x20;
+ break;
+
+ case 0x1FCE:
+ case 0x1FD0:
+ this->unk_1F4 = 0x1FCF;
+ break;
+
+ case 0x1FCF:
+ this->unk_1F4 = 0x1FCA;
+ break;
+
+ case 0x1FD1:
+ case 0x1FD2:
+ this->unk_1F4 = func_80AD08B0(globalCtx);
+ break;
+
+ case 0x1FD6:
+ this->unk_1F4 = 0x1FD7;
+ break;
+
+ case 0x1FD8:
+ this->unk_1F4 = 0x1FD9;
+ break;
+
+ case 0x1FDA:
+ this->unk_1F4 = 0x1FDB;
+ break;
+
+ case 0x1FDC:
+ this->unk_1F4 = 0x1FDD;
+ break;
+
+ case 0x1FDE:
+ this->unk_1F4 = 0x1FDF;
+ break;
+
+ case 0x1FE0:
+ this->unk_1F4 = 0x1FE1;
+ break;
+
+ case 0x1FE2:
+ this->unk_1F4 = 0x1FE3;
+ break;
+
+ case 0x1FE4:
+ this->unk_1F4 = 0x1FE5;
+ break;
+
+ case 0x1FE6:
+ this->unk_1F4 = 0x1FE7;
+ break;
+
+ case 0x1FE8:
+ this->unk_1F4 = 0x1FE9;
+ break;
+
+ case 0x1FEA:
+ this->unk_1F4 = 0x1FEB;
+ break;
+
+ case 0x1FEC:
+ this->unk_1F4 = 0x1FED;
+ break;
+
+ case 0x1FEE:
+ this->unk_1F4 = 0x1FEF;
+ break;
+
+ case 0x1FF0:
+ this->unk_1F4 = 0x1FF1;
+ break;
+
+ case 0x1FF2:
+ this->unk_1F4 = 0x1FF3;
+ break;
+
+ case 0x1FF4:
+ this->unk_1F4 = 0x1FF5;
+ break;
+
+ case 0x1FF6:
+ this->unk_1F4 = 0x1FF7;
+ break;
+
+ case 0x1FF8:
+ this->unk_1F4 = 0x1FF9;
+ break;
+
+ case 0x1FFA:
+ this->unk_1F4 = 0x1FFB;
+ break;
+
+ case 0x1FFC:
+ this->unk_1F4 = 0x1FFD;
+ break;
+
+ case 0x1FD7:
+ case 0x1FDB:
+ case 0x1FDD:
+ case 0x1FDF:
+ case 0x1FE1:
+ case 0x1FE7:
+ case 0x1FF1:
+ case 0x1FF3:
+ case 0x1FF7:
+ case 0x1FF9:
+ case 0x1FFB:
+ this->unk_1F4 = 0x1FD3;
+ break;
+
+ case 0x1FD9:
+ case 0x1FE3:
+ case 0x1FE9:
+ case 0x1FEB:
+ case 0x1FED:
+ case 0x1FEF:
+ case 0x1FF5:
+ case 0x1FFD:
+ this->unk_1F4 = 0x1FD4;
+ break;
+
+ case 0x1FE5:
+ this->unk_1F4 = 0x1FFE;
+ break;
+
+ case 0x1FD3:
+ case 0x1FD4:
+ case 0x1FFE:
+ this->unk_1F4 = 0x1FD5;
+ this->unk_1EA |= 0x20;
+ }
+
+ Message_StartTextbox(globalCtx, this->unk_1F4, &this->actor);
+}
+
+void func_80AD1398(EnOsn* this) {
+ this->cutscene = this->actor.cutscene;
+ if ((gSaveContext.inventory.items[SLOT_OCARINA] == ITEM_NONE) || (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) {
+ this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene);
+
+ if ((gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE) ||
+ (INV_CONTENT(ITEM_MASK_DEKU) == ITEM_MASK_DEKU)) {
+ this->cutscene = ActorCutscene_GetAdditionalCutscene(this->cutscene);
+ }
+ }
+}
+
+void func_80AD144C(EnOsn* this, GlobalContext* globalCtx) {
+ u32 sp1C = Flags_GetSwitch(globalCtx, 0);
+ this->cutscene = this->actor.cutscene;
+
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
+ if (sp1C == 0) {
+ this->actionFunc = func_80AD16A8;
+ } else {
+ this->actionFunc = func_80AD14C8;
+ }
+}
+
+void func_80AD14C8(EnOsn* this, GlobalContext* globalCtx) {
+ s16 temp_v1 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
+
+ if (gSaveContext.inventory.items[SLOT_OCARINA] != ITEM_NONE && !CHECK_QUEST_ITEM(QUEST_SONG_HEALING)) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80AD1634;
+ } else if ((((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (temp_v1 < 0x4000)) &&
+ (temp_v1 > -0x4000)) {
+ func_800B863C(&this->actor, globalCtx);
+ this->actor.textId = 0xFFFF;
+ }
+ } else {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_1F4 = func_80AD0E10(this, globalCtx);
+ Message_StartTextbox(globalCtx, this->unk_1F4, &this->actor);
+ this->actionFunc = func_80AD19A0;
+ } else if ((((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) && (temp_v1 < 0x4000)) &&
+ (temp_v1 > -0x4000)) {
+ func_800B863C(&this->actor, globalCtx);
+ }
+ }
+}
+
+void func_80AD1634(EnOsn* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
+ ActorCutscene_Start(this->cutscene, &this->actor);
+ this->actionFunc = func_80AD16A8;
+ return;
+ }
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->cutscene);
+}
+
+void func_80AD16A8(EnOsn* this, GlobalContext* globalCtx) {
+ u8 pad;
+ s32 actionIndex;
+
+ if (Cutscene_CheckActorAction(globalCtx, 130)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 130);
+ this->unk_1F0 = 0;
+ if (this->unk_1ED != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->unk_1ED = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
+ case 1:
+ this->unk_1EC = 2;
+ break;
+ case 2:
+ this->unk_1EC = 1;
+ break;
+ case 3:
+ this->unk_1EC = 7;
+ break;
+ case 4:
+ this->unk_1EC = 3;
+ break;
+ case 5:
+ this->unk_1EC = 6;
+ break;
+ case 6:
+ this->unk_1EC = 5;
+ break;
+ case 7:
+ this->unk_1EC = 4;
+ break;
+ case 8:
+ this->unk_1EC = 0;
+ break;
+ case 10:
+ this->unk_1EC = 8;
+ break;
+ case 11:
+ this->unk_1EC = 9;
+ break;
+ case 13:
+ this->unk_1EC = 0xA;
+ break;
+ case 15:
+ this->unk_1EC = 0xB;
+ break;
+ case 16:
+ this->unk_1EC = 0xC;
+ break;
+ case 17:
+ this->unk_1EC = 0xD;
+ break;
+ case 18:
+ this->unk_1EC = 0xE;
+ break;
+ case 19:
+ this->unk_1EC = 0x11;
+ break;
+ case 20:
+ this->unk_1EC = 0x12;
+ break;
+ case 21:
+ this->unk_1EC = 0x14;
+ break;
+ case 22:
+ this->unk_1EC = 0x15;
+ break;
+ case 23:
+ this->unk_1EC = 0x17;
+ break;
+ case 24:
+ this->unk_1EC = 0x18;
+ break;
+ default:
+ this->unk_1EC = 0;
+ break;
+ }
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
+ }
+
+ if ((this->unk_1EC == 5) && (globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0xB) &&
+ (globalCtx->csCtx.frames == 400)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_VO_OMVO00);
+ }
+ if (this->unk_1EC == 0x12) {
+ func_80AD0998(this);
+ }
+ if (this->unk_1EC == 0x15) {
+ func_80AD0A24(this);
+ }
+ if (this->unk_1EC == 0x18) {
+ func_80AD0AB0(this);
+ }
+ if ((this->unk_1EC == 0x14) &&
+ (((Animation_OnFrame(&this->skelAnime, 17.0f))) || (Animation_OnFrame(&this->skelAnime, 27.0f)) ||
+ (Animation_OnFrame(&this->skelAnime, 37.0f)) || (Animation_OnFrame(&this->skelAnime, 47.0f)) ||
+ (Animation_OnFrame(&this->skelAnime, 57.0f)) || (Animation_OnFrame(&this->skelAnime, 67.0f)))) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OMENYA_WALK);
+ }
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
+ } else {
+ this->unk_1F0 = 1;
+ this->unk_1ED = 0x63;
+ func_80AD144C(this, globalCtx);
+ }
+}
+
+void func_80AD19A0(EnOsn* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if ((temp_v0 == 6 || temp_v0 == 5) && func_80147624(globalCtx)) {
+ if (this->unk_1EA & 0x20) {
+ this->unk_1EA &= ~0x20;
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actionFunc = func_80AD14C8;
+ } else {
+ func_80AD10FC(this, globalCtx);
+ }
+ }
+}
+
+void EnOsn_Idle(EnOsn* this, GlobalContext* globalCtx) {
+}
+
+void EnOsn_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnOsn* this = THIS;
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_osn_Skel_0202F0, &object_osn_Anim_0201BC, 0, 0, 0);
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ this->unk_1FA = 255;
+ switch (ENOSN_GET_3(&this->actor)) {
+ case 0:
+ if (((gSaveContext.entranceIndex == 0xC020) || (gSaveContext.entranceIndex == 0xC030)) ||
+ (gSaveContext.entranceIndex == 0xC060)) {
+ this->unk_1EA |= 1;
+ }
+ this->unk_1F0 = 1;
+ if (globalCtx->sceneNum == SCENE_INSIDETOWER) {
+ if ((gSaveContext.entranceIndex == 0xC020) || (gSaveContext.entranceIndex == 0xC060)) {
+ this->actionFunc = func_80AD16A8;
+ return;
+ }
+ if (gSaveContext.entranceIndex == 0xC030) {
+ func_80AD1398(this);
+ this->actionFunc = func_80AD1634;
+ return;
+ }
+ func_80AD144C(this, globalCtx);
+ return;
+ }
+ func_80AD144C(this, globalCtx);
+ break;
+
+ case 1:
+ this->unk_1EC = 0xF;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
+ this->actionFunc = EnOsn_Idle;
+ break;
+
+ case 2:
+ this->unk_1EC = 0x10;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->unk_1EC);
+ this->actionFunc = EnOsn_Idle;
+ break;
+
+ case 3:
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actionFunc = func_80AD16A8;
+ break;
+
+ default:
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnOsn_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnOsn* this = THIS;
+
+ SkelAnime_Free(&this->skelAnime, globalCtx);
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnOsn_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnOsn* this = THIS;
+ u32 sp34;
+
+ sp34 = Flags_GetSwitch(globalCtx, 0);
+ this->actionFunc(this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+ SkelAnime_Update(&this->skelAnime);
+ if (!(ENOSN_GET_3(&this->actor))) {
+ if (sp34 != 0) {
+ this->actor.flags |= ACTOR_FLAG_1;
+ func_80AD0830(this, globalCtx);
+ this->actor.draw = EnOsn_Draw;
+ } else {
+ this->actor.draw = NULL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ }
+ }
+ func_800E9250(globalCtx, &this->actor, &this->unk_1D8, &this->unk_1DE, this->actor.focus.pos);
+}
+
+s32 EnOsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ EnOsn* this = (EnOsn*)thisx;
+
+ if (this->unk_1F0 && limbIndex == 11) {
+ Matrix_InsertXRotation_s(this->unk_1D8.y, MTXMODE_APPLY);
+ }
+ if ((this->unk_1EC == 9 || this->unk_1EC == 8) && limbIndex == 10) {
+ *dList = NULL;
+ }
+ return false;
+}
+
+void EnOsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ EnOsn* this = (EnOsn*)thisx;
+ Vec3f sp30 = { 0.0f, 0.0f, 0.0f };
+ Vec3s sp28 = { 0x9920, -0x384, -0x320 };
+
+ if (limbIndex == 11) {
+ Matrix_MultiplyVector3fByState(&sp30, &thisx->focus.pos);
+ }
+ if (((this->unk_1EC == 17) || (this->unk_1EC == 21) || (this->unk_1EC == 22)) && (limbIndex == 6)) {
+ Matrix_StatePush();
+ Matrix_InsertTranslation(-400.0f, 1100.0f, -200.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(sp28.x, MTXMODE_APPLY);
+ Matrix_RotateY(sp28.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(sp28.z, MTXMODE_APPLY);
+
+ gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList((*gfx)++, &object_osn_DL_0192A0);
+ Matrix_StatePop();
+ }
+}
+
+void EnOsn_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static TexturePtr D_80AD2588 = object_osn_Tex_0166F8;
+ static TexturePtr D_80AD258C = object_osn_Tex_016EF8;
+ static TexturePtr D_80AD2590 = object_osn_Tex_0176F8;
+ static TexturePtr D_80AD2594 = object_osn_Tex_017EF8;
+ static TexturePtr D_80AD2598 = object_osn_Tex_0182F8;
+ s32 pad;
+ EnOsn* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->unk_1FA == 0xFF) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ if ((this->unk_1EC == 0xB) || (this->unk_1EC == 0xC) || (this->unk_1EC == 0x17) ||
+ (globalCtx->msgCtx.unk11F04 == 0x1FCA)) {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD258C));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594));
+ } else if ((this->unk_1EC == 7) || (this->unk_1EC == 3) || (this->unk_1EC == 0xD)) {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2590));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2598));
+ } else {
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2588));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594));
+ }
+ gDPSetEnvColor(POLY_OPA_DISP++, 255, 255, 255, 255);
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnOsn_OverrideLimbDraw, EnOsn_PostLimbDraw,
+ &this->actor, POLY_OPA_DISP);
+ } else {
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD2588));
+ gSPSegment(POLY_XLU_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD2594));
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->unk_1FA);
+ Scene_SetRenderModeXlu(globalCtx, 1, 2);
+ POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnOsn_OverrideLimbDraw, EnOsn_PostLimbDraw,
+ &this->actor, POLY_XLU_DISP);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.h b/src/overlays/actors/ovl_En_Osn/z_en_osn.h
index 112a73e470..4cb99b9250 100644
--- a/src/overlays/actors/ovl_En_Osn/z_en_osn.h
+++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.h
@@ -9,11 +9,25 @@ typedef void (*EnOsnActionFunc)(struct EnOsn*, GlobalContext*);
typedef struct EnOsn {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x90];
+ /* 0x0144 */ ColliderCylinder collider;
+ /* 0X0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnOsnActionFunc actionFunc;
- /* 0x01D8 */ char unk_1D8[0x28];
-} EnOsn; // size = 0x200
+ /* 0x01D8 */ Vec3s unk_1D8;
+ /* 0x01DE */ Vec3s unk_1DE;
+ /* 0x01E4 */ UNK_TYPE1 unk_1E4[0x6];
+ /* 0x01EA */ u16 unk_1EA;
+ /* 0x01EC */ u8 unk_1EC;
+ /* 0x01ED */ u8 unk_1ED;
+ /* 0x01EE */ s16 cutscene;
+ /* 0x01F0 */ u8 unk_1F0;
+ /* 0x01F1 */ UNK_TYPE1 unk_1F1[0x3];
+ /* 0x01F4 */ u16 unk_1F4;
+ /* 0x01F6 */ s32 unk_1F6;
+ /* 0x01FA */ u8 unk_1FA;
+} EnOsn; // size = 0x1FB
extern const ActorInit En_Osn_InitVars;
+#define ENOSN_GET_3(this) ((thisx)->params & 3)
+
#endif // Z_EN_OSN_H
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 9a1a076402..7e32762637 100644
--- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
+++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c
@@ -5,8 +5,11 @@
*/
#include "z_en_ossan.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_fsn/object_fsn.h"
+#include "objects/object_ani/object_ani.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnOssan*)thisx)
@@ -50,29 +53,6 @@ void EnOssan_GetCutscenes(EnOssan* this, GlobalContext* globalCtx);
s32 EnOssan_ReturnItemToShelf(EnOssan* this);
s32 EnOssan_TakeItemOffShelf(EnOssan* this);
-extern FlexSkeletonHeader D_060028A0;
-extern TexturePtr D_06005BC0;
-extern TexturePtr D_06006498;
-extern TexturePtr D_06006B18;
-extern TexturePtr D_06006D40;
-extern TexturePtr D_06006F18;
-extern TexturePtr D_06007140;
-extern AnimationHeader D_06009D34;
-extern AnimationHeader D_0600A460;
-extern AnimationHeader D_0600CB3C;
-extern AnimationHeader D_0600DE34;
-extern AnimationHeader D_0600E3EC;
-extern AnimationHeader D_0600C58C;
-extern AnimationHeader D_0600F00C;
-extern AnimationHeader D_0600B9D8;
-extern AnimationHeader D_0600C26C;
-extern AnimationHeader D_0600D354;
-extern AnimationHeader D_06012C34;
-extern AnimationHeader D_060131FC;
-extern FlexSkeletonHeader D_06013320;
-extern AnimationHeader D_060138B0;
-extern AnimationHeader D_0601430C;
-
const ActorInit En_Ossan_InitVars = {
ACTOR_EN_OSSAN,
ACTORCAT_NPC,
@@ -85,24 +65,40 @@ const ActorInit En_Ossan_InitVars = {
(ActorFunc)NULL,
};
-static ActorAnimationEntryS sAnimationsCuriosityShopMan[] = {
- { &D_06012C34, 1.0f, 0, -1, 0, 0 }, { &D_060131FC, 1.0f, 0, -1, 0, 0 }, { &D_0600C58C, 1.0f, 0, -1, 2, 0 },
- { &D_0600C58C, -1.0f, 0, -1, 2, 0 }, { &D_0600E3EC, 1.0f, 0, -1, 2, 0 }, { &D_0600F00C, 1.0f, 0, -1, 0, 0 },
- { &D_0600CB3C, 1.0f, 0, -1, 2, 0 }, { &D_0600D354, 1.0f, 0, -1, 0, 0 }, { &D_060138B0, 1.0f, 0, -1, 2, 0 },
- { &D_0601430C, 1.0f, 0, -1, 0, 0 }, { &D_0600B9D8, 1.0f, 0, -1, 2, 0 }, { &D_0600C26C, 1.0f, 0, -1, 0, 0 },
- { &D_0600DE34, 1.0f, 0, -1, 2, 0 },
+static AnimationInfoS sAnimationsCuriosityShopMan[] = {
+ { &object_fsn_Anim_012C34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_0131FC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00C58C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00C58C, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00E3EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00F00C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00CB3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00D354, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_0138B0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_01430C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00B9D8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_fsn_Anim_00C26C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_fsn_Anim_00DE34, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
-static ActorAnimationEntryS sAnimationsPartTimeWorker[] = {
- { &D_06009D34, 1.0f, 0, -1, 0, -10 }, { &D_06009D34, 1.0f, 0, -1, 0, -10 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 },
- { &D_06009D34, -1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 },
- { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 }, { &D_0600A460, 1.0f, 0, -1, 2, -5 },
- { &D_0600A460, 1.0f, 0, -1, 0, -5 }, { &D_06009D34, 1.0f, 0, -1, 2, 0 }, { &D_06009D34, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimationsPartTimeWorker[] = {
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -10 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gAniStandingNormalAnim, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gAniHandBehindHeadApologyAnim, 1.0f, 0, -1, ANIMMODE_ONCE, -5 },
+ { &gAniHandBehindHeadApologyAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -5 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &gAniStandingNormalAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
static s16 sObjectIds[] = { OBJECT_FSN, OBJECT_ANI };
-static ActorAnimationEntryS* sAnimations[] = { sAnimationsCuriosityShopMan, sAnimationsPartTimeWorker };
+static AnimationInfoS* sAnimations[] = { sAnimationsCuriosityShopMan, sAnimationsPartTimeWorker };
static f32 sActorScales[] = { 0.01f, 0.01f };
@@ -265,7 +261,7 @@ void EnOssan_EndInteraction(GlobalContext* globalCtx, EnOssan* this) {
Player* player = GET_PLAYER(globalCtx);
Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
this->drawCursor = 0;
@@ -329,7 +325,7 @@ void EnOssan_SetupLookToShopkeeperFromShelf(GlobalContext* globalCtx, EnOssan* t
void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- func_8013D9C8(globalCtx, this->limbRotTableY, this->limbRotTableZ, 19);
+ SubS_FillLimbRotTables(globalCtx, this->limbRotTableY, this->limbRotTableZ, ARRAY_COUNT(this->limbRotTableY));
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
player->stateFlags2 |= 0x20000000;
EnOssan_SetupAction(this, EnOssan_BeginInteraction);
@@ -354,9 +350,9 @@ void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx) {
}
void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) {
- ActorAnimationEntryS* animations = sAnimations[this->actor.params];
+ AnimationInfoS* animations = sAnimations[this->actor.params];
s16 curFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(animations[this->animationIdx].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(animations[this->animationIdx].animation);
if (this->animationIdx == 3) {
frameCount = 0;
@@ -374,20 +370,20 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) {
switch (this->animationIdx) {
case 1:
this->animationIdx = 2;
- func_8013BC6C(&this->skelAnime, animations, 2);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 2);
break;
case 2:
EnOssan_SetHaveMet(this);
this->textId = EnOssan_GetWelcomeCuriosityShopMan(this, globalCtx);
- func_8013BC6C(&this->skelAnime, animations, this->animationIdx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx);
break;
case 4:
case 6:
case 8:
case 10:
this->animationIdx++;
- func_8013BC6C(&this->skelAnime, animations, this->animationIdx);
- func_801518B0(globalCtx, this->textId, &this->actor);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, this->animationIdx);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
EnOssan_SetupStartShopping(globalCtx, this, false);
break;
case 5:
@@ -395,16 +391,16 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) {
case 9:
case 11:
this->animationIdx = 3;
- func_8013BC6C(&this->skelAnime, animations, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 3);
break;
case 3:
this->animationIdx = 1;
- func_8013BC6C(&this->skelAnime, animations, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
EnOssan_SetupAction(this, EnOssan_Idle);
break;
default:
this->animationIdx = 1;
- func_8013BC6C(&this->skelAnime, animations, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
EnOssan_SetupAction(this, EnOssan_Idle);
break;
}
@@ -412,7 +408,7 @@ void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx) {
} else {
EnOssan_SetHaveMet(this);
this->textId = EnOssan_GetWelcomePartTimeWorker(this, globalCtx);
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
EnOssan_SetupStartShopping(globalCtx, this, false);
}
}
@@ -522,7 +518,7 @@ u8 EnOssan_CursorLeft(EnOssan* this, u8 cursorIdx, u8 shelfSlotMax) {
}
void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) {
- ActorAnimationEntryS* animations = sAnimations[this->actor.params];
+ AnimationInfoS* animations = sAnimations[this->actor.params];
u8 talkState = Message_GetState(&globalCtx->msgCtx);
s32 pad;
Player* player = GET_PLAYER(globalCtx);
@@ -531,7 +527,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) {
if (talkState == 5 && func_80147624(globalCtx)) {
if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) {
this->animationIdx = 1;
- func_8013BC6C(&this->skelAnime, animations, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
}
this->flags &= ~LOOKED_AT_PLAYER;
if (player->transformation == PLAYER_FORM_DEKU) {
@@ -548,7 +544,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) {
if (talkState == 10 && this->actor.params == ENOSSAN_PART_TIME_WORKER &&
player->transformation == PLAYER_FORM_ZORA && func_80147624(globalCtx)) {
this->animationIdx = 9;
- func_8013BC6C(&this->skelAnime, animations, 9);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9);
}
if (this->animationIdx == 11 && Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_HANKO);
@@ -556,7 +552,7 @@ void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx) {
}
s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx) {
- ActorAnimationEntryS* animations = sAnimations[this->actor.params];
+ AnimationInfoS* animations = sAnimations[this->actor.params];
Player* player = GET_PLAYER(globalCtx);
switch (globalCtx->msgCtx.choiceIndex) {
@@ -564,7 +560,7 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx
func_8019F208();
if (this->actor.params == ENOSSAN_PART_TIME_WORKER && player->transformation == PLAYER_FORM_ZORA) {
this->animationIdx = 9;
- func_8013BC6C(&this->skelAnime, animations, 9);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 9);
}
EnOssan_SetupAction(this, EnOssan_TalkToShopkeeper);
func_80151938(globalCtx, sTalkOptionTextIds[this->actor.params]);
@@ -628,12 +624,12 @@ void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx) {
}
void EnOssan_TalkToShopkeeper(EnOssan* this, GlobalContext* globalCtx) {
- ActorAnimationEntryS* animations = sAnimations[this->actor.params];
+ AnimationInfoS* animations = sAnimations[this->actor.params];
if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) {
if (this->animationIdx == 9 && this->actor.params == ENOSSAN_PART_TIME_WORKER) {
this->animationIdx = 1;
- func_8013BC6C(&this->skelAnime, animations, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, animations, 1);
}
EnOssan_StartShopping(globalCtx, this);
}
@@ -947,7 +943,7 @@ void EnOssan_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnOssan* this) {
Player* player = GET_PLAYER(globalCtx);
Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->stateFlags2 &= ~0x20000000;
Interface_ChangeAlpha(50);
@@ -1064,7 +1060,7 @@ void EnOssan_BuyItemWithFanfare(EnOssan* this, GlobalContext* globalCtx) {
void EnOssan_SetupItemPurchased(EnOssan* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
EnOssan_SetupAction(this, EnOssan_ItemPurchased);
if (this->cutsceneState == ENOSSAN_CUTSCENESTATE_STOPPED) {
@@ -1095,7 +1091,7 @@ void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) {
func_8019F208();
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
player->stateFlags2 |= 0x20000000;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
EnOssan_SetupStartShopping(globalCtx, this, true);
func_800B85E0(&this->actor, globalCtx, 100.0f, EXCH_ITEM_MINUS1);
break;
@@ -1113,7 +1109,7 @@ void EnOssan_ContinueShopping(EnOssan* this, GlobalContext* globalCtx) {
item->restockFunc(globalCtx, item);
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
player->stateFlags2 |= 0x20000000;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
EnOssan_SetupStartShopping(globalCtx, this, true);
func_800B85E0(&this->actor, globalCtx, 100.0f, EXCH_ITEM_MINUS1);
}
@@ -1329,12 +1325,14 @@ void EnOssan_Blink(EnOssan* this) {
}
void EnOssan_InitCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06013320, &D_06012C34, this->jointTable, this->morphTable, 19);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_fsn_Skel_013320, &object_fsn_Anim_012C34, this->jointTable,
+ this->morphTable, 19);
this->actor.draw = EnOssan_DrawCuriosityShopMan;
}
void EnOssan_InitPartTimeWorker(EnOssan* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060028A0, &D_06009D34, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gAniSkeleton, &gAniStandingNormalAnim, this->jointTable,
+ this->morphTable, 16);
this->actor.draw = EnOssan_DrawPartTimeWorker;
}
@@ -1350,19 +1348,19 @@ u16 EnOssan_GetWelcomeCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx)
switch (player->transformation) {
case PLAYER_FORM_DEKU:
this->animationIdx = 10;
- if (gSaveContext.weekEventReg[0x12] & 0x10) {
+ if (gSaveContext.weekEventReg[18] & 0x10) {
return sWelcomeDekuTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeDekuFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_ZORA:
this->animationIdx = 8;
- if (gSaveContext.weekEventReg[0x12] & 8) {
+ if (gSaveContext.weekEventReg[18] & 8) {
return sWelcomeZoraTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeZoraFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
case PLAYER_FORM_GORON:
this->animationIdx = 6;
- if (gSaveContext.weekEventReg[0x12] & 4) {
+ if (gSaveContext.weekEventReg[18] & 4) {
return sWelcomeGoronTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
}
return sWelcomeGoronFirstTimeTextIds[ENOSSAN_CURIOSITY_SHOP_MAN];
@@ -1381,17 +1379,17 @@ u16 EnOssan_GetWelcomePartTimeWorker(EnOssan* this, GlobalContext* globalCtx) {
}
switch (player->transformation) {
case PLAYER_FORM_DEKU:
- if (gSaveContext.weekEventReg[0x37] & 0x10) {
+ if (gSaveContext.weekEventReg[55] & 0x10) {
return sWelcomeDekuTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeDekuFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
case PLAYER_FORM_ZORA:
- if (gSaveContext.weekEventReg[0x37] & 8) {
+ if (gSaveContext.weekEventReg[55] & 8) {
return sWelcomeZoraTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeZoraFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
case PLAYER_FORM_GORON:
- if (gSaveContext.weekEventReg[0x37] & 4) {
+ if (gSaveContext.weekEventReg[55] & 4) {
return sWelcomeGoronTextIds[ENOSSAN_PART_TIME_WORKER];
}
return sWelcomeGoronFirstTimeTextIds[ENOSSAN_PART_TIME_WORKER];
@@ -1402,22 +1400,22 @@ u16 EnOssan_GetWelcomePartTimeWorker(EnOssan* this, GlobalContext* globalCtx) {
void EnOssan_SetHaveMet(EnOssan* this) {
switch (this->textId) {
case 0x06A9:
- gSaveContext.weekEventReg[0x12] |= 0x10;
+ gSaveContext.weekEventReg[18] |= 0x10;
break;
case 0x06C6:
- gSaveContext.weekEventReg[0x37] |= 0x10;
+ gSaveContext.weekEventReg[55] |= 0x10;
break;
case 0x06A7:
- gSaveContext.weekEventReg[0x12] |= 8;
+ gSaveContext.weekEventReg[18] |= 8;
break;
case 0x06C4:
- gSaveContext.weekEventReg[0x37] |= 8;
+ gSaveContext.weekEventReg[55] |= 8;
break;
case 0x06A5:
- gSaveContext.weekEventReg[0x12] |= 4;
+ gSaveContext.weekEventReg[18] |= 4;
break;
case 0x06C2:
- gSaveContext.weekEventReg[0x37] |= 4;
+ gSaveContext.weekEventReg[55] |= 4;
break;
}
}
@@ -1427,7 +1425,7 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) {
ShopItem* shopItems;
if (Object_IsLoaded(&globalCtx->objectCtx, this->objIndex)) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.objBankIndex = this->objIndex;
Actor_SetObjectDependency(globalCtx, &this->actor);
shopItems = sShops[this->actor.params];
@@ -1490,12 +1488,12 @@ void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx) {
this->shopItemSelectedTween = 0.0f;
Actor_SetScale(&this->actor, sActorScales[this->actor.params]);
this->animationIdx = 1;
- func_8013BC6C(&this->skelAnime, sAnimations[this->actor.params], 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations[this->actor.params], 1);
EnOssan_SpawnShopItems(this, globalCtx, shopItems);
this->blinkTimer = 20;
this->eyeTexIndex = 0;
this->blinkFunc = EnOssan_WaitForBlink;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
EnOssan_SetupAction(this, EnOssan_Idle);
}
}
@@ -1537,8 +1535,8 @@ void EnOssan_DrawCursor(GlobalContext* globalCtx, EnOssan* this, f32 x, f32 y, f
func_8012C654(globalCtx->state.gfxCtx);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b,
this->cursorColor.a);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
w = 16.0f * z;
ulx = (x - w) * 4.0f;
uly = (y - w) * 4.0f;
@@ -1589,7 +1587,7 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this)
if (drawStickRightPrompt || drawStickLeftPrompt) {
func_8012C654(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1610,7 +1608,7 @@ void EnOssan_DrawStickDirectionPrompts(GlobalContext* globalCtx, EnOssan* this)
this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY,
this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f);
}
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1677,7 +1675,7 @@ void EnOssan_PostLimbDrawPartTimeWorker(GlobalContext* globalCtx, s32 limbIndex,
}
void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr sEyeTextures[] = { &D_06005BC0, &D_06006D40, &D_06007140 };
+ static TexturePtr sEyeTextures[] = { object_fsn_Tex_005BC0, object_fsn_Tex_006D40, object_fsn_Tex_007140 };
EnOssan* this = THIS;
s32 pad;
@@ -1692,7 +1690,7 @@ void EnOssan_DrawCuriosityShopMan(Actor* thisx, GlobalContext* globalCtx) {
}
void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr sEyeTextures[] = { &D_06006498, &D_06006B18, &D_06006F18 };
+ static TexturePtr sEyeTextures[] = { gAniOpenEyeTex, gAniClosingEyeTex, gAniClosedEyeTex };
EnOssan* this = THIS;
s32 pad;
diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
index 24acaa6a1b..f7f41a2c13 100644
--- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c
+++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c
@@ -6,8 +6,10 @@
#include "z_en_ot.h"
#include "prevent_bss_reordering.h"
+#include "objects/object_ot/object_ot.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnOt*)thisx)
@@ -57,15 +59,6 @@ EnOtUnkStruct* func_80B5DF58(EnOtUnkStruct* arg0, u8 arg1, Vec3f* arg2, Vec3s* a
void func_80B5E078(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2);
void func_80B5E1D8(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2);
-extern Gfx D_06000040[];
-extern Gfx D_06000078[];
-extern AnimationHeader D_06000420;
-extern Gfx D_060004A0[];
-extern AnimatedMaterial D_060005F8;
-extern AnimationHeader D_060008D8;
-extern FlexSkeletonHeader D_06004800;
-extern AnimationHeader D_06004B30;
-
static EnOt* D_80B5E880;
static EnOt* D_80B5E884;
static EnOt* D_80B5E888;
@@ -102,10 +95,10 @@ static ColliderCylinderInit sCylinderInit = {
{ 5, 33, -20, { 0, 0, 0 } },
};
-static struct_80B8E1A8 sAnimations[] = {
- { &D_06004B30, 1.0f, 0, -5.0f },
- { &D_060008D8, 1.0f, 0, -5.0f },
- { &D_06000420, 1.0f, 0, 0.0f },
+static AnimationSpeedInfo sAnimations[] = {
+ { &object_ot_Anim_004B30, 1.0f, ANIMMODE_LOOP, -5.0f },
+ { &object_ot_Anim_0008D8, 1.0f, ANIMMODE_LOOP, -5.0f },
+ { &object_ot_Anim_000420, 1.0f, ANIMMODE_LOOP, 0.0f },
};
static InitChainEntry sInitChain[] = {
@@ -148,28 +141,29 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_33C = ENOT_GET_C000(&this->actor);
if (this->unk_33C == 0) {
D_80B5E880 = this;
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.update = func_80B5DB6C;
this->actor.draw = NULL;
return;
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06004800, &D_060008D8, this->jointTable, this->morphTable, 19);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ot_Skel_004800, &object_ot_Anim_0008D8, this->jointTable,
+ this->morphTable, 19);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
- Animation_Change(&this->skelAnime, sAnimations[0].animationSeg, 1.0f,
- Animation_GetLastFrame(&sAnimations[0].animationSeg->common) * Rand_ZeroOne(),
- Animation_GetLastFrame(&sAnimations[0].animationSeg->common), sAnimations[0].mode,
- sAnimations[0].transitionRate);
+ Animation_Change(&this->skelAnime, sAnimations[0].animation, 1.0f,
+ Animation_GetLastFrame(&sAnimations[0].animation->common) * Rand_ZeroOne(),
+ Animation_GetLastFrame(&sAnimations[0].animation->common), sAnimations[0].mode,
+ sAnimations[0].morphFrames);
this->unk_346 = ENOT_GET_7F(&this->actor);
this->unk_344 = this->actor.world.rot.z;
this->actor.world.rot.z = 0;
this->actor.shape.rot.z = 0;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.gravity = 0.0f;
- func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->skelAnime.curFrame = Rand_ZeroOne() * this->skelAnime.endFrame;
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
this->unk_744.r = 255;
@@ -271,8 +265,8 @@ void EnOt_Init(Actor* thisx, GlobalContext* globalCtx) {
case 3:
if (!(gSaveContext.weekEventReg[26] & 8)) {
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
Actor_SetScale(&this->actor, 0.0064999997f);
this->collider.dim.radius *= 0.5f;
this->collider.dim.height *= 0.5f;
@@ -306,21 +300,21 @@ void func_80B5BB38(Color_RGB8* arg0, Color_RGB8* arg1, f32 arg2) {
}
void func_80B5BDA8(EnOt* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx);
- func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
+ SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
this->actionFunc = func_80B5BE04;
}
void func_80B5BE04(EnOt* this, GlobalContext* globalCtx) {
switch (this->unk_388) {
case 0:
- if (func_8013E2D4(&this->actor, this->cutscenes[2], -1, 0)) {
+ if (SubS_StartActorCutscene(&this->actor, this->cutscenes[2], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
func_80B5BF60(this, globalCtx);
}
break;
case 1:
- if (func_8013E2D4(&this->actor, this->cutscenes[3], -1, 0)) {
+ if (SubS_StartActorCutscene(&this->actor, this->cutscenes[3], -1, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
func_80B5BF60(this, globalCtx);
}
break;
@@ -328,7 +322,7 @@ void func_80B5BE04(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5BE88(EnOt* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
this->actionFunc = func_80B5BED4;
}
@@ -343,7 +337,7 @@ void func_80B5BED4(EnOt* this, GlobalContext* globalCtx) {
void func_80B5BF60(EnOt* this, GlobalContext* globalCtx) {
this->unk_32C |= 0x40;
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->actionFunc = func_80B5BFB8;
}
@@ -416,12 +410,12 @@ void func_80B5C25C(EnOt* this, GlobalContext* globalCtx) {
if ((this->unk_33C == 2) && (this->unk_32C & 0x80) && (this->unk_360->unk_32C & 0x80)) {
this->unk_32C |= 0x100;
this->unk_360->unk_32C |= 0x100;
- func_8013E1C8(&this->skelAnime, sAnimations, 2, &this->animIdx);
- func_8013E1C8(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx);
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~(0x8 | 0x1);
- this->unk_360->actor.flags |= 0x8000000;
- this->unk_360->actor.flags &= ~(0x8 | 0x1);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 2, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->unk_360->skelAnime, sAnimations, 2, &this->unk_360->animIdx);
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->unk_360->actor.flags |= ACTOR_FLAG_8000000;
+ this->unk_360->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80B5C9A8(this->unk_360, globalCtx);
func_80B5C3B8(this, globalCtx);
}
@@ -443,7 +437,7 @@ void func_80B5C3D8(EnOt* this, GlobalContext* globalCtx) {
Vec3f sp38;
this->unk_3A0 += 0x2D8;
- Matrix_RotateY(this->unk_3A0, 0);
+ Matrix_RotateY(this->unk_3A0, MTXMODE_NEW);
Matrix_GetStateTranslationAndScaledZ(26.259998f, &sp5C);
Matrix_GetStateTranslationAndScaledZ(-26.259998f, &sp50);
this->unk_348.x = this->unk_394.x + sp5C.x;
@@ -467,7 +461,7 @@ void func_80B5C3D8(EnOt* this, GlobalContext* globalCtx) {
}
if (Animation_OnFrame(&this->skelAnime, 12.0f)) {
- Matrix_RotateY(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)), 0);
+ Matrix_RotateY(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)), MTXMODE_NEW);
sp38.x = 1.0f;
sp38.y = 8.1f;
sp38.z = 0.0f;
@@ -495,7 +489,7 @@ void func_80B5C64C(EnOt* this, GlobalContext* globalCtx) {
void func_80B5C684(EnOt* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->actionFunc = func_80B5C6DC;
}
@@ -597,7 +591,7 @@ void func_80B5CA30(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5CAD0(EnOt* this, GlobalContext* globalCtx) {
- func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes) / 2);
+ SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes) / 2);
this->actionFunc = func_80B5CB0C;
}
@@ -611,14 +605,14 @@ void func_80B5CB0C(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5CBA0(EnOt* this, GlobalContext* globalCtx) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
this->actionFunc = func_80B5CBEC;
}
void func_80B5CBEC(EnOt* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80B5CC88(this, globalCtx);
} else {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
@@ -632,7 +626,7 @@ void func_80B5CC88(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5CCA0(EnOt* this, GlobalContext* globalCtx) {
- if (func_8013E2D4(&this->actor, this->cutscenes[0], 0x7C, 1)) {
+ if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_NORMAL)) {
Player* player = GET_PLAYER(globalCtx);
player->stateFlags2 |= 0x20000000;
@@ -641,7 +635,7 @@ void func_80B5CCA0(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5CCF4(EnOt* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->actionFunc = func_80B5CD40;
}
@@ -651,13 +645,13 @@ void func_80B5CD40(EnOt* this, GlobalContext* globalCtx) {
switch (Message_GetState(&globalCtx->msgCtx)) {
case 0:
- temp = Math_SmoothStepToS(&this->actor.shape.rot.y, BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))),
- 3, 0xE38, 0x38E);
+ temp = Math_SmoothStepToS(&this->actor.shape.rot.y,
+ BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), 3, 0xE38, 0x38E);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (1) {}
if (!temp) {
gSaveContext.weekEventReg[23] |= 0x10;
- func_801518B0(globalCtx, 0x1069, NULL);
+ Message_StartTextbox(globalCtx, 0x1069, NULL);
}
break;
@@ -682,7 +676,7 @@ void func_80B5CD40(EnOt* this, GlobalContext* globalCtx) {
void func_80B5CE6C(EnOt* this, GlobalContext* globalCtx) {
this->unk_384 = 0;
this->unk_32C |= 0x20;
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->actionFunc = func_80B5CEC8;
}
@@ -698,10 +692,10 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0xE38, 0x38E);
if (this->unk_32C & 0x800) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, this->actor.xzDistToPlayer, this->actor.playerHeightRel, 0);
} else {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
if ((player->actor.bgCheckFlags & 1) && !func_801242B4(player) && (this->actor.xzDistToPlayer < 130.0f)) {
func_800B8614(&this->actor, globalCtx, 130.0f);
}
@@ -737,7 +731,7 @@ void func_80B5CEC8(EnOt* this, GlobalContext* globalCtx) {
}
void func_80B5D114(EnOt* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, sAnimations, 0, &this->animIdx);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 0, &this->animIdx);
this->actionFunc = func_80B5D160;
}
@@ -771,12 +765,12 @@ void func_80B5D160(EnOt* this, GlobalContext* globalCtx) {
} else {
phi_a1 = 0x10A5;
}
- func_801518B0(globalCtx, phi_a1, &this->actor);
+ Message_StartTextbox(globalCtx, phi_a1, &this->actor);
func_80B5D114(this, globalCtx);
break;
case 1:
- func_801518B0(globalCtx, 0x106D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x106D, &this->actor);
func_80B5D114(this, globalCtx);
break;
}
@@ -897,9 +891,9 @@ void func_80B5D648(EnOt* this, GlobalContext* globalCtx) {
this->unk_2C0.unk_2C.z = 0.0f;
this->actor.gravity = 0.0f;
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, sAnimations, 1, &this->animIdx);
- this->actor.flags |= 0x8000000;
- this->actor.flags &= ~(0x8 | 0x1);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimations, 1, &this->animIdx);
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
Flags_SetSwitch(globalCtx, ENOT_GET_3F80(&this->actor));
this->actionFunc = func_80B5D750;
}
@@ -924,8 +918,8 @@ void func_80B5D750(EnOt* this, GlobalContext* globalCtx) {
}
if ((this->unk_32C & 1) && (this->actor.xzDistToPlayer <= 180.0f)) {
- this->actor.flags &= ~0x8000000;
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~ACTOR_FLAG_8000000;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
if (D_80B5E884 != 0) {
func_80B5C9A8(this, globalCtx);
} else {
@@ -945,7 +939,7 @@ void EnOt_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
if (this->actor.bgCheckFlags & 0x20) {
if (DECR(this->unk_354) == 0) {
- if (this->actor.flags & 0x40) {
+ if (this->actor.flags & ACTOR_FLAG_40) {
s32 i;
for (i = 0; i < 2; i++) {
@@ -1044,7 +1038,7 @@ void EnOt_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, (AnimatedMaterial*)Lib_SegmentedToVirtual(&D_060005F8));
+ AnimatedMat_Draw(globalCtx, (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ot_Matanimheader_0005F8));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
NULL, EnOt_PostLimbDraw, &this->actor);
Matrix_InsertTranslation(this->unk_378.x, this->unk_378.y, this->unk_378.z, MTXMODE_NEW);
@@ -1054,13 +1048,13 @@ void EnOt_Draw(Actor* thisx, GlobalContext* globalCtx) {
gfx = func_8012C7FC(POLY_XLU_DISP);
- gSPSetOtherMode(&gfx[0], G_SETOTHERMODE_H, 4, 4, 0x00000080);
+ gDPSetDither(&gfx[0], G_CD_NOISE);
gDPSetCombineLERP(&gfx[1], 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE,
0);
- gSPDisplayList(&gfx[2], D_04029CB0);
+ gSPDisplayList(&gfx[2], gameplay_keep_DL_029CB0);
gDPSetPrimColor(&gfx[3], 0, 0, this->unk_747.r, this->unk_747.g, this->unk_747.b, 50);
gSPMatrix(&gfx[4], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(&gfx[5], D_04029CF0);
+ gSPDisplayList(&gfx[5], gameplay_keep_DL_029CF0);
POLY_XLU_DISP = &gfx[6];
@@ -1075,7 +1069,7 @@ void EnOt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
OPEN_DISPS(globalCtx->state.gfxCtx);
Gfx* gfx = POLY_OPA_DISP;
- gSPDisplayList(&gfx[0], D_060004A0);
+ gSPDisplayList(&gfx[0], object_ot_DL_0004A0);
POLY_OPA_DISP = &gfx[1];
Matrix_MultiplyVector3fByState(&D_80B5E410, &this->unk_74C);
@@ -1118,7 +1112,7 @@ EnOtUnkStruct* func_80B5DF58(EnOtUnkStruct* arg0, u8 arg1, Vec3f* arg2, Vec3s* a
void func_80B5E078(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2) {
Vec3f sp54;
s32 i;
- s16 temp = func_800DFC68(GET_ACTIVE_CAM(globalCtx));
+ s16 temp = Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx));
for (i = 0; i < arg2; i++, arg1++) {
if ((arg1->unk_00 == 1) || (arg1->unk_00 == 2)) {
@@ -1152,19 +1146,19 @@ void func_80B5E1D8(GlobalContext* globalCtx, EnOtUnkStruct* arg1, s32 arg2) {
for (i = 0; i < arg2; i++, arg1++) {
if (arg1->unk_00) {
if (!flag) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000040);
+ gSPDisplayList(POLY_OPA_DISP++, object_ot_DL_000040);
flag = true;
if (globalCtx) {}
}
Matrix_InsertTranslation(arg1->unk_0C.x, arg1->unk_0C.y, arg1->unk_0C.z, MTXMODE_NEW);
- Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
+ Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), MTXMODE_APPLY);
Matrix_Scale(arg1->unk_04, arg1->unk_04, arg1->unk_04, MTXMODE_APPLY);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_0405E6F0));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_05E6F0));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000078);
+ gSPDisplayList(POLY_OPA_DISP++, object_ot_DL_000078);
}
}
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 5bf520f91b..ceacff185d 100644
--- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c
+++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c
@@ -5,8 +5,9 @@
*/
#include "z_en_owl.h"
+#include "objects/object_owl/object_owl.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnOwl*)thisx)
@@ -40,25 +41,13 @@ void func_8095C484(EnOwl* this);
void func_8095CCF4(Actor* thisx, GlobalContext* globalCtx);
void func_8095D074(Actor* thisx, GlobalContext* globalCtx);
void EnOwl_ChangeMode(EnOwl* this, EnOwlActionFunc actionFunc, EnOwlFunc unkFunc, SkelAnime* skelAnime,
- AnimationHeader* animationSeg, f32 transitionRate);
+ AnimationHeader* animation, f32 morphFrames);
typedef enum {
/* 0x00 */ OWL_REPEAT,
/* 0x01 */ OWL_OK
} EnOwlMessageChoice;
-extern AnimationHeader D_06001168;
-extern Gfx D_06001200[];
-extern AnimationHeader D_06001ADC;
-extern TexturePtr D_06008EB8;
-extern TexturePtr D_060092B8;
-extern TexturePtr D_060096B8;
-extern FlexSkeletonHeader D_0600C5F8;
-extern AnimationHeader D_0600C6D4;
-extern AnimationHeader D_0600CB94;
-extern AnimationHeader D_0600CDB0;
-extern FlexSkeletonHeader D_060105C0;
-
const ActorInit En_Owl_InitVars = {
ACTOR_EN_OWL,
ACTORCAT_NPC,
@@ -131,7 +120,7 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.1f);
this->actor.update = func_8095CCF4;
this->actor.draw = func_8095D074;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_3D8 = 0;
this->unk_3DA = 0x320;
this->unk_3DC = 0x12C;
@@ -139,15 +128,15 @@ void EnOwl_Init(Actor* thisx, GlobalContext* globalCtx) {
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime1, &D_0600C5F8, &D_06001ADC, this->jointTable1, this->morphTable1,
- 21);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &D_060105C0, &D_0600CDB0, this->jointTable2, this->morphTable2,
- 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime1, &object_owl_Skel_00C5F8, &object_owl_Anim_001ADC,
+ this->jointTable1, this->morphTable1, 21);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime2, &object_owl_Skel_0105C0, &object_owl_Anim_00CDB0,
+ this->jointTable2, this->morphTable2, 16);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.terminalVelocity = -10.0f;
this->actor.targetArrowOffset = 500.0f;
- EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f);
+ EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f);
this->actionFlags = 0;
this->unk_40D = 0;
@@ -239,7 +228,7 @@ s32 func_8095A978(EnOwl* this, GlobalContext* globalCtx, u16 textId, f32 targetD
this->actor.textId = textId;
if (this->actor.xzDistToPlayer < targetDist) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, targetDist, arg4, EXCH_ITEM_NONE);
}
@@ -260,7 +249,7 @@ s32 func_8095A9FC(EnOwl* this, GlobalContext* globalCtx, u16 textId) {
}
void func_8095AA70(EnOwl* this) {
- EnOwl_ChangeMode(this, func_8095C1C8, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f);
+ EnOwl_ChangeMode(this, func_8095C1C8, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94, 0.0f);
this->eyeTexIndex = 0;
this->blinkTimer = Rand_S16Offset(60, 60);
}
@@ -305,7 +294,7 @@ void func_8095ABF0(EnOwl* this, GlobalContext* globalCtx) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
Audio_QueueSeqCmd(0x110000FF);
func_8095AAD0(this, globalCtx);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
}
@@ -320,7 +309,7 @@ void func_8095AC50(EnOwl* this, GlobalContext* globalCtx) {
func_8095ABA8(this);
this->actionFunc = func_8095AB1C;
}
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
}
@@ -450,9 +439,9 @@ void func_8095B254(EnOwl* this, GlobalContext* globalCtx) {
}
if (this->actionFlags & 1) {
- EnOwl_ChangeMode(this, func_8095B1E4, func_8095C328, &this->skelAnime1, &D_06001ADC, 0.0f);
+ EnOwl_ChangeMode(this, func_8095B1E4, func_8095C328, &this->skelAnime1, &object_owl_Anim_001ADC, 0.0f);
this->unk_3EA = 6;
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_20;
}
func_8095B158(this);
@@ -468,7 +457,7 @@ void func_8095B2F8(EnOwl* this, GlobalContext* globalCtx) {
if ((this->actor.shape.rot.y == this->unk_3EC) && (this->actionFlags & 1)) {
this->actionFunc = func_8095B254;
Animation_Change(this->skelAnime3, this->skelAnime3->animation, 1.0f, 19.0f,
- Animation_GetLastFrame(&D_06001168), 2, 0.0f);
+ Animation_GetLastFrame(&object_owl_Anim_001168), 2, 0.0f);
this->unk_414 = func_8095C484;
}
@@ -478,7 +467,7 @@ void func_8095B2F8(EnOwl* this, GlobalContext* globalCtx) {
void func_8095B3DC(EnOwl* this, GlobalContext* globalCtx) {
if (this->actionFlags & 1) {
this->actionFunc = func_8095B2F8;
- Animation_Change(this->skelAnime3, &D_06001168, 1.0f, 0.0f, 35.0f, 2, 0.0f);
+ Animation_Change(this->skelAnime3, &object_owl_Anim_001168, 1.0f, 0.0f, 35.0f, 2, 0.0f);
this->unk_414 = func_8095C408;
this->unk_3EC = 0x5500;
this->actor.world.pos.y += 100.0f;
@@ -491,7 +480,7 @@ void func_8095B480(EnOwl* this, GlobalContext* globalCtx) {
if (player->stateFlags3 & 0x10000000) {
this->actor.textId = 0xBF1;
- EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f);
+ EnOwl_ChangeMode(this, func_8095BF58, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f);
this->eyeTexIndex = 0;
this->actionFlags &= ~8;
this->blinkTimer = Rand_S16Offset(60, 60);
@@ -515,17 +504,17 @@ void func_8095B574(EnOwl* this, GlobalContext* globalCtx) {
this->actionFlags |= 0x40;
this->unk_406 = 2;
} else if (this->actor.xzDistToPlayer < 200.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 200.0f, 400.0f, EXCH_ITEM_NONE);
} else {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
func_8095B480(this, globalCtx);
}
void func_8095B650(EnOwl* this, GlobalContext* globalCtx) {
if (this->actionFlags & 1) {
- EnOwl_ChangeMode(this, func_8095B574, func_8095C484, &this->skelAnime2, &D_0600CDB0, 0.0f);
+ EnOwl_ChangeMode(this, func_8095B574, func_8095C484, &this->skelAnime2, &object_owl_Anim_00CDB0, 0.0f);
this->actor.textId = 0xBF5;
this->actionFlags &= ~8;
}
@@ -534,7 +523,8 @@ void func_8095B650(EnOwl* this, GlobalContext* globalCtx) {
void func_8095B6C8(EnOwl* this, GlobalContext* globalCtx) {
if (this->actionFlags & 1) {
- Animation_Change(this->skelAnime3, &D_0600CB94, -1.0f, Animation_GetLastFrame(&D_0600CB94), 0.0f, 2, 0.0f);
+ Animation_Change(this->skelAnime3, &object_owl_Anim_00CB94, -1.0f,
+ Animation_GetLastFrame(&object_owl_Anim_00CB94), 0.0f, 2, 0.0f);
this->unk_414 = func_8095C484;
this->actionFunc = func_8095B650;
}
@@ -606,7 +596,7 @@ void func_8095B960(EnOwl* this, GlobalContext* globalCtx) {
void func_8095B9FC(EnOwl* this, GlobalContext* globalCtx) {
if (this->actionFlags & 1) {
this->actionFunc = func_8095B960;
- Animation_Change(this->skelAnime3, &D_06001168, 1.0f, 0.0f, 35.0f, 2, 0.0f);
+ Animation_Change(this->skelAnime3, &object_owl_Anim_001168, 1.0f, 0.0f, 35.0f, 2, 0.0f);
this->unk_414 = func_8095C408;
func_8095B0C8(this);
}
@@ -676,11 +666,12 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) {
case 0xBEE:
func_801477B4(globalCtx);
Audio_QueueSeqCmd(0x110000FF);
- EnOwl_ChangeMode(this, func_8095B9FC, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f);
+ EnOwl_ChangeMode(this, func_8095B9FC, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94,
+ 0.0f);
this->eyeTexIndex = 0;
this->blinkTimer = Rand_S16Offset(60, 60);
this->actionFlags |= 8;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.home.rot.x = 0;
func_8095ACEC(this);
this->unk_406 = 0;
@@ -692,7 +683,7 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) {
func_801477B4(globalCtx);
Audio_QueueSeqCmd(0x110000FF);
func_8095ACEC(this);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.textId = 0xBF0;
this->actionFunc = func_8095BE0C;
break;
@@ -704,8 +695,9 @@ void func_8095BA84(EnOwl* this, GlobalContext* globalCtx) {
case 0xBF5:
func_801477B4(globalCtx);
Audio_QueueSeqCmd(0x110000FF);
- this->actor.flags &= ~0x10000;
- EnOwl_ChangeMode(this, func_8095B3DC, func_8095C484, &this->skelAnime1, &D_0600CB94, 0.0f);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ EnOwl_ChangeMode(this, func_8095B3DC, func_8095C484, &this->skelAnime1, &object_owl_Anim_00CB94,
+ 0.0f);
this->eyeTexIndex = 0;
this->blinkTimer = Rand_S16Offset(60, 60);
this->actionFlags |= 8;
@@ -729,10 +721,10 @@ void func_8095BE0C(EnOwl* this, GlobalContext* globalCtx) {
func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, EXCH_ITEM_NONE);
}
} else if (this->actor.xzDistToPlayer < 200.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 200.0f, 200.0f, EXCH_ITEM_NONE);
} else {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
}
}
@@ -746,7 +738,7 @@ void func_8095BF58(EnOwl* this, GlobalContext* globalCtx) {
}
void func_8095BF78(EnOwl* this, GlobalContext* globalCtx) {
- this->actor.flags |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_20;
if (this->actor.xzDistToPlayer > 6000.0f) {
Actor_MarkForDeath(&this->actor);
}
@@ -783,7 +775,7 @@ void func_8095C09C(EnOwl* this, GlobalContext* globalCtx) {
}
if (this->actionFlags & 1) {
- EnOwl_ChangeMode(this, func_8095BF78, func_8095C328, &this->skelAnime1, &D_06001ADC, 0.0f);
+ EnOwl_ChangeMode(this, func_8095BF78, func_8095C328, &this->skelAnime1, &object_owl_Anim_001ADC, 0.0f);
this->unk_3EA = 6;
this->unk_3EC += 0x2000;
}
@@ -794,7 +786,7 @@ void func_8095C09C(EnOwl* this, GlobalContext* globalCtx) {
void func_8095C1C8(EnOwl* this, GlobalContext* globalCtx) {
if (this->actionFlags & 1) {
this->unk_3EA = 3;
- EnOwl_ChangeMode(this, func_8095C09C, func_8095C484, &this->skelAnime1, &D_06001168, 0.0f);
+ EnOwl_ChangeMode(this, func_8095C09C, func_8095C484, &this->skelAnime1, &object_owl_Anim_001168, 0.0f);
this->unk_3EC = BINANG_ADD(this->actor.world.rot.y, 0x4000);
this->unk_3E4 = this->actor.world.pos.y;
this->actor.velocity.y = 2.0f;
@@ -810,7 +802,8 @@ void func_8095C258(EnOwl* this) {
} else {
this->unk_414 = func_8095C328;
this->unk_3EA = 6;
- Animation_Change(this->skelAnime3, &D_06001ADC, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001ADC), 2, 5.0f);
+ Animation_Change(this->skelAnime3, &object_owl_Anim_001ADC, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_owl_Anim_001ADC), 2, 5.0f);
}
}
@@ -823,7 +816,8 @@ void func_8095C328(EnOwl* this) {
} else {
this->unk_3EA = 160;
this->unk_414 = func_8095C258;
- Animation_Change(this->skelAnime3, &D_0600C6D4, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600C6D4), 0, 5.0f);
+ Animation_Change(this->skelAnime3, &object_owl_Anim_00C6D4, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_owl_Anim_00C6D4), 0, 5.0f);
}
}
}
@@ -904,7 +898,7 @@ void EnOwl_Update(Actor* thisx, GlobalContext* globalCtx) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (this->actor.update != NULL) {
- if ((this->skelAnime1.animation == &D_06001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) {
+ if ((this->skelAnime1.animation == &object_owl_Anim_001ADC) && Animation_OnFrame(&this->skelAnime1, 4.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_OWL_FLUTTER);
}
@@ -1148,9 +1142,9 @@ void EnOwl_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
void EnOwl_Draw(Actor* thisx, GlobalContext* globalCtx) {
static TexturePtr eyeTextures[] = {
- &D_06008EB8,
- &D_060092B8,
- &D_060096B8,
+ object_owl_Tex_008EB8,
+ object_owl_Tex_0092B8,
+ object_owl_Tex_0096B8,
};
s32 pad;
EnOwl* this = THIS;
@@ -1182,7 +1176,7 @@ void func_8095D074(Actor* thisx, GlobalContext* globalCtx) {
gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2);
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
- gSPDisplayList(POLY_OPA_DISP++, D_06001200);
+ gSPDisplayList(POLY_OPA_DISP++, object_owl_DL_001200);
} else {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -1190,17 +1184,16 @@ void func_8095D074(Actor* thisx, GlobalContext* globalCtx) {
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_XLU_SURF2);
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, (u8)(this->unk_3DC * 8));
- gSPDisplayList(POLY_XLU_DISP++, D_06001200);
+ gSPDisplayList(POLY_XLU_DISP++, object_owl_DL_001200);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
void EnOwl_ChangeMode(EnOwl* this, EnOwlActionFunc actionFunc, EnOwlFunc unkFunc, SkelAnime* skelAnime,
- AnimationHeader* animationSeg, f32 transitionRate) {
+ AnimationHeader* animation, f32 morphFrames) {
this->skelAnime3 = skelAnime;
- Animation_Change(this->skelAnime3, animationSeg, 1.0f, 0.0f, Animation_GetLastFrame(animationSeg), 2,
- transitionRate);
+ Animation_Change(this->skelAnime3, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), 2, morphFrames);
this->actionFunc = actionFunc;
this->unk_414 = unkFunc;
}
diff --git a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
index 525606bc38..467ef3901f 100644
--- a/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
+++ b/src/overlays/actors/ovl_En_Pamera/z_en_pamera.c
@@ -7,8 +7,9 @@
#include "z_en_pamera.h"
#include "../ovl_En_Bom/z_en_bom.h"
#include "../ovl_En_Door/z_en_door.h"
+#include "objects/object_pamera/object_pamera.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnPamera*)thisx)
@@ -69,29 +70,6 @@ void func_80BDA288(EnPamera* this);
void func_80BDA2E0(EnPamera* this, GlobalContext* globalCtx);
void func_80BDA344(Actor* thisx, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_06008448;
-extern AnimationHeader D_060005BC;
-extern AnimationHeader D_06008AE0; // Pamela Walking
-extern AnimationHeader D_06008E38;
-extern AnimationHeader D_0600A844; // Pamela Looking down the well
-extern AnimationHeader D_0600B0C4;
-extern AnimationHeader D_06009870;
-extern AnimationHeader D_06009F54; // HoldBack En_Hgo
-extern AnimationHeader D_0600B5B0; // PushBack En_Hgo
-extern AnimationHeader D_0600BCC4; // Defend En_Hgo
-extern AnimationHeader D_0600D9DC;
-extern AnimationHeader D_0600E16C; // Hugging En_Hg
-extern AnimationHeader D_0600C9F4;
-extern AnimationHeader D_0600D0F0;
-
-extern TexturePtr D_060074E8;
-extern TexturePtr D_060078E8;
-extern TexturePtr D_060066E8;
-extern TexturePtr D_06006AE8;
-extern TexturePtr D_06006EE8;
-extern TexturePtr D_060072E8;
-extern TexturePtr D_060073E8;
-
const ActorInit En_Pamera_InitVars = {
ACTOR_EN_PAMERA,
ACTORCAT_NPC,
@@ -128,23 +106,29 @@ static CollisionCheckInfoInit2 sColChkInfoInit2 = {
0, 0, 0, 0, MASS_IMMOVABLE,
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_060005BC, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_06008AE0, 1.0f, 0, 0.0f, 0, -4.0f },
- { &D_06008E38, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_0600A844, 1.0f, 0, 0.0f, 0, -4.0f },
- { &D_0600B0C4, 1.0f, 0, 0.0f, 0, -4.0f }, { &D_06009870, 1.0f, 0, 0.0f, 0, 0.0f },
- { &D_06009F54, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600B5B0, 1.0f, 0, 0.0f, 0, 0.0f },
- { &D_0600BCC4, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600D9DC, 1.0f, 0, 0.0f, 0, 0.0f },
- { &D_0600E16C, 1.0f, 0, 0.0f, 0, 0.0f }, { &D_0600C9F4, 1.0f, 0, 0.0f, 2, 0.0f },
- { &D_0600D0F0, 1.0f, 0, 0.0f, 0, 0.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_pamera_Anim_0005BC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_pamera_Anim_008AE0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_pamera_Anim_008E38, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_pamera_Anim_00A844, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_pamera_Anim_00B0C4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_pamera_Anim_009870, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_009F54, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_00B5B0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_00BCC4, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_00D9DC, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_00E16C, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_pamera_Anim_00C9F4, 1.0f, 0, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_pamera_Anim_00D0F0, 1.0f, 0, 0.0f, ANIMMODE_LOOP, 0.0f },
};
static Vec3f D_80BDA5F0 = { 1000.0f, 0.0f, 0.0f };
-static TexturePtr D_80BDA5FC[] = { &D_060074E8, &D_060078E8 };
+static TexturePtr D_80BDA5FC[] = { object_pamera_Tex_0074E8, object_pamera_Tex_0078E8 };
-static TexturePtr D_80BDA604[] = { &D_060066E8, &D_06006AE8, &D_06006EE8 };
+static TexturePtr D_80BDA604[] = { object_pamera_Tex_0066E8, object_pamera_Tex_006AE8, object_pamera_Tex_006EE8 };
-static TexturePtr D_80BDA610[] = { &D_060072E8, &D_060073E8 };
+static TexturePtr D_80BDA610[] = { object_pamera_Tex_0072E8, object_pamera_Tex_0073E8 };
void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
@@ -152,8 +136,8 @@ void EnPamera_Init(Actor* thisx, GlobalContext* globalCtx) {
Vec3f sp44;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 15.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008448, &D_060005BC, this->jointTable, this->morphTable,
- PAMERA_LIMB_MAX);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_pamera_Skel_008448, &object_pamera_Anim_0005BC,
+ this->jointTable, this->morphTable, PAMERA_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit2);
@@ -248,8 +232,8 @@ void EnPamera_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80BD8700(EnPamera* this) {
this->hideInisdeTimer = 0;
- this->actor.flags &= ~1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80BD8758;
}
@@ -257,9 +241,10 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) {
if (this->hideInisdeTimer++ > 1800) {
if (ActorCutscene_GetCanPlayNext(this->cutscenes[0]) && (this->cutscenes[0] != -1)) {
ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[0], &this->actor);
- func_800E02AC(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[0])), &this->actor);
+ Camera_SetToTrackActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[0])),
+ &this->actor);
this->actor.speedXZ = 1.5f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, globalCtx);
@@ -268,7 +253,7 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) {
ActorCutscene_SetIntentToPlay(this->cutscenes[0]);
} else {
this->actor.speedXZ = 1.5f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actor.shape.rot.y = this->actor.home.rot.y;
this->actor.world.rot.y = this->actor.home.rot.y;
func_80BD9338(this, globalCtx);
@@ -289,8 +274,8 @@ void func_80BD8758(EnPamera* this, GlobalContext* globalCtx) {
void func_80BD8908(EnPamera* this) {
this->actor.draw = EnPamera_Draw;
- this->actor.flags |= 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ this->actor.flags |= ACTOR_FLAG_1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80BD8964;
}
@@ -303,14 +288,14 @@ void func_80BD8964(EnPamera* this, GlobalContext* globalCtx) {
if (Math_Vec3f_StepTo(&this->actor.world.pos, &vec, 1.0f) < 5.0f) {
this->actor.speedXZ = 1.5f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
gSaveContext.weekEventReg[59] |= 1;
func_80BD8B50(this);
}
}
void func_80BD8A38(EnPamera* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80BD8A7C;
}
@@ -357,14 +342,14 @@ void func_80BD8B70(EnPamera* this, GlobalContext* globalCtx) {
void func_80BD8CCC(EnPamera* this) {
this->hideInisdeTimer = 0;
this->actor.speedXZ = 0.0f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->actionFunc = func_80BD8D1C;
}
void func_80BD8D1C(EnPamera* this, GlobalContext* globalCtx) {
if (this->hideInisdeTimer++ > 200) {
this->actor.speedXZ = 1.5f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
func_80BD8D80(this);
}
}
@@ -400,14 +385,14 @@ void func_80BD8DB0(EnPamera* this, GlobalContext* globalCtx) {
void EnPamera_LookDownWell(EnPamera* this) {
func_80BD93CC(this, 1, 1);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
this->actionFunc = func_80BD8F60;
}
void func_80BD8F60(EnPamera* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, 0x3000, 0x1000);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->actor.speedXZ = 3.0f;
func_80BD93CC(this, 0, 0);
func_80BD8D80(this);
@@ -424,7 +409,7 @@ void func_80BD8FF0(EnPamera* this) {
pameraYaw = Math_Vec3f_Yaw(&pameraPos, &this->actor.world.pos);
this->actor.shape.rot.y = pameraYaw;
this->actor.world.rot.y = pameraYaw;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->actionFunc = func_80BD909C;
}
@@ -443,7 +428,8 @@ void func_80BD90AC(EnPamera* this, GlobalContext* globalCtx) {
(Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < 200.0f)))) {
if ((ActorCutscene_GetCanPlayNext(this->cutscenes[1])) && ((this->cutscenes[1] != -1))) {
ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[1], &this->actor);
- func_800E02AC(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[1])), &this->actor);
+ Camera_SetToTrackActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(this->cutscenes[1])),
+ &this->actor);
EnPamera_LookDownWell(this);
} else if (this->cutscenes[1] != -1) {
ActorCutscene_SetIntentToPlay(this->cutscenes[1]);
@@ -510,11 +496,11 @@ void func_80BD93CC(EnPamera* this, s16 arg1, s16 arg2) {
void func_80BD93F4(EnPamera* this, GlobalContext* globalCtx) {
if ((this->actionFunc == func_80BD8B70) || (this->actionFunc == func_80BD8DB0) ||
(this->actionFunc == func_80BD8964) || (this->actionFunc == func_80BD8A7C)) {
- if (this->skelAnime.animation == &D_06008AE0) {
+ if (this->skelAnime.animation == &object_pamera_Anim_008AE0) {
if (Animation_OnFrame(&this->skelAnime, 9.0f) || Animation_OnFrame(&this->skelAnime, 18.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK);
}
- } else if ((this->skelAnime.animation == &D_06008E38) &&
+ } else if ((this->skelAnime.animation == &object_pamera_Anim_008E38) &&
(Animation_OnFrame(&this->skelAnime, 2.0f) || Animation_OnFrame(&this->skelAnime, 6.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_PAMERA_WALK);
}
@@ -553,7 +539,7 @@ s32 EnPamera_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
rot->x += this->limb9Rot.y;
rot->z += this->limb9Rot.x;
}
- return 0;
+ return false;
}
void EnPamera_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@@ -579,8 +565,8 @@ void EnPamera_Draw(Actor* thisx, GlobalContext* globalCtx) {
void func_80BD9840(EnPamera* this, GlobalContext* globalCtx) {
this->actor.update = func_80BDA344;
- this->actor.flags |= 0x2000000;
- this->actor.flags |= 0x100000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
+ this->actor.flags |= ACTOR_FLAG_100000;
if ((gSaveContext.weekEventReg[75] & 0x20) || (gSaveContext.weekEventReg[52] & 0x20)) {
func_80BD9E60(this);
func_80BD9938(this);
@@ -597,7 +583,7 @@ void func_80BD9840(EnPamera* this, GlobalContext* globalCtx) {
}
void func_80BD9904(EnPamera* this) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = &func_80BD9928;
}
@@ -613,21 +599,21 @@ void func_80BD994C(EnPamera* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) {
if (1) {}
func_80BD93CC(this, 0, 1);
- func_801518B0(globalCtx, 0x15A8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A8, &this->actor);
this->unk_324 = 0x15A8;
} else if ((gSaveContext.playerForm != PLAYER_FORM_HUMAN) ||
((gSaveContext.weekEventReg[52] & 0x20) && (!(gSaveContext.weekEventReg[75] & 0x20)))) {
func_80BD93CC(this, 1, 0);
- func_801518B0(globalCtx, 0x158E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x158E, &this->actor);
this->unk_324 = 0x158E;
} else {
if (!(this->unk_322 & 1)) {
this->unk_322 |= 1;
- func_801518B0(globalCtx, 0x1587, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1587, &this->actor);
this->unk_324 = 0x1587;
} else {
- func_801518B0(globalCtx, 0x158C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x158C, &this->actor);
this->unk_324 = 0x158C;
}
}
@@ -668,23 +654,23 @@ void func_80BD9B4C(EnPamera* this, GlobalContext* globalCtx) {
if (func_80147624(globalCtx)) {
switch (this->unk_324) {
case 0x1587:
- func_801518B0(globalCtx, 0x1588, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1588, &this->actor);
this->unk_324 = 0x1588;
break;
case 0x1588:
- func_801518B0(globalCtx, 0x1589, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1589, &this->actor);
this->unk_324 = 0x1589;
break;
case 0x1589:
- func_801518B0(globalCtx, 0x158A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x158A, &this->actor);
this->unk_324 = 0x158A;
break;
case 0x158A:
- func_801518B0(globalCtx, 0x158B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x158B, &this->actor);
this->unk_324 = 0x158B;
break;
case 0x158C:
- func_801518B0(globalCtx, 0x158D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x158D, &this->actor);
this->unk_324 = 0x158D;
break;
case 0x158E:
@@ -704,21 +690,21 @@ void func_80BD9C70(EnPamera* this, GlobalContext* globalCtx) {
}
s32 func_80BD9CB8(EnPamera* this, GlobalContext* globalCtx) {
- u32 actionIndex;
+ s32 actionIndex;
- if (func_800EE29C(globalCtx, 0x1E5)) {
- actionIndex = func_800EE200(globalCtx, 0x1E5);
- if (this->unk_326 != globalCtx->csCtx.npcActions[actionIndex]->unk0) {
- this->unk_326 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
+ if (Cutscene_CheckActorAction(globalCtx, 0x1E5)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 0x1E5);
+ if (this->unk_326 != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->unk_326 = globalCtx->csCtx.actorActions[actionIndex]->action;
- switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
func_80BD9E88(this);
break;
case 2:
if (this->actor.draw == NULL) {
this->actor.draw = EnPamera_Draw;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
func_80BD9EE0(this);
break;
@@ -736,7 +722,7 @@ s32 func_80BD9CB8(EnPamera* this, GlobalContext* globalCtx) {
break;
}
}
- func_800EDF24(&this->actor, globalCtx, actionIndex);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
this->setupFunc(this, globalCtx);
return 1;
}
@@ -760,7 +746,7 @@ void func_80BD9E78(EnPamera* this, GlobalContext* globalCtx) {
}
void func_80BD9E88(EnPamera* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->unk_31E = 0;
this->setupFunc = func_80BD9ED0;
}
@@ -769,7 +755,7 @@ void func_80BD9ED0(EnPamera* this, GlobalContext* globalCtx) {
}
void func_80BD9EE0(EnPamera* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
func_80BD93CC(this, 1, 0);
this->unk_31E = 1;
this->setupFunc = func_80BD9F3C;
@@ -786,14 +772,14 @@ void func_80BD9F3C(EnPamera* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
}
}
}
void func_80BDA038(EnPamera* this) {
func_80BD93CC(this, 0, 1);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
this->unk_31E = 0;
this->setupFunc = func_80BDA090;
}
@@ -803,7 +789,7 @@ void func_80BDA090(EnPamera* this, GlobalContext* globalCtx) {
void func_80BDA0A0(EnPamera* this) {
func_80BD93CC(this, 0, 1);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
this->unk_31E = 1;
this->setupFunc = func_80BDA0FC;
}
@@ -813,7 +799,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
}
}
}
@@ -821,7 +807,7 @@ void func_80BDA0FC(EnPamera* this, GlobalContext* globalCtx) {
void func_80BDA170(EnPamera* this) {
this->unk_31E = 1;
func_80BD93CC(this, 0, 1);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
this->setupFunc = func_80BDA1C8;
}
@@ -834,7 +820,7 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
func_80BD93CC(this, 0, 0);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 10);
}
}
}
@@ -842,7 +828,7 @@ void func_80BDA1C8(EnPamera* this, GlobalContext* globalCtx) {
void func_80BDA288(EnPamera* this) {
this->unk_31E = 1;
func_80BD93CC(this, 0, 0);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
this->setupFunc = func_80BDA2E0;
}
@@ -850,7 +836,7 @@ void func_80BDA2E0(EnPamera* this, GlobalContext* globalCtx) {
if (this->unk_31E == 1) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_31E = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
}
}
}
diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
index 22f9693796..bab9aee20e 100644
--- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
+++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c
@@ -9,7 +9,7 @@
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_bigslime/object_bigslime.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnPametfrog*)thisx)
@@ -325,24 +325,24 @@ s32 func_8086A2CC(EnPametfrog* this, CollisionPoly* floorPoly) {
}
void EnPametfrog_ShakeCamera(EnPametfrog* this, GlobalContext* globalCtx, f32 magShakeXZ, f32 magShakeY) {
- Camera* camera = Play_GetCamera(globalCtx, this->camId);
- s16 y;
- Vec3f eye;
+ Camera* subCam = Play_GetCamera(globalCtx, this->subCamId);
+ s16 subCamYaw;
+ Vec3f subCamEye;
- y = BINANG_ROT180(func_800DFCDC(camera));
- eye.x = (Math_SinS(y) * magShakeXZ) + camera->at.x;
- eye.y = camera->at.y + magShakeY;
- eye.z = (Math_CosS(y) * magShakeXZ) + camera->at.z;
- Play_CameraSetAtEye(globalCtx, this->camId, &camera->at, &eye);
+ subCamYaw = BINANG_ROT180(Camera_GetCamDirYaw(subCam));
+ subCamEye.x = (Math_SinS(subCamYaw) * magShakeXZ) + subCam->at.x;
+ subCamEye.y = subCam->at.y + magShakeY;
+ subCamEye.z = (Math_CosS(subCamYaw) * magShakeXZ) + subCam->at.z;
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &subCam->at, &subCamEye);
}
void EnPametfrog_StopCutscene(EnPametfrog* this, GlobalContext* globalCtx) {
- Camera* camera;
+ Camera* subCam;
- if (this->camId != 0) {
- camera = Play_GetCamera(globalCtx, this->camId);
- Play_CameraSetAtEye(globalCtx, 0, &camera->at, &camera->eye);
- this->camId = 0;
+ if (this->subCamId != CAM_ID_MAIN) {
+ subCam = Play_GetCamera(globalCtx, this->subCamId);
+ Play_CameraSetAtEye(globalCtx, CAM_ID_MAIN, &subCam->at, &subCam->eye);
+ this->subCamId = CAM_ID_MAIN;
ActorCutscene_Stop(this->cutscene);
func_800B724C(globalCtx, &this->actor, 6);
}
@@ -426,7 +426,7 @@ void EnPametfrog_SetupRearOnSnapper(EnPametfrog* this) {
Animation_PlayOnce(&this->skelAnime, &gGekkoStandingIdleAnim);
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.params = GEKKO_ON_SNAPPER;
this->actionFunc = EnPametfrog_RearOnSnapper;
}
@@ -494,7 +494,7 @@ void EnPametfrog_RearOnSnapperRise(EnPametfrog* this, GlobalContext* globalCtx)
}
void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
- Vec3f eye;
+ Vec3f subCamEye;
s16 yaw;
Animation_PlayOnce(&this->skelAnime, &gGekkoFallInAirAnim);
@@ -503,14 +503,14 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx
this->actor.velocity.y = 15.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.child->world.rot.y);
this->actor.shape.rot.y = this->actor.world.rot.y;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->timer = 30;
this->collider.base.ocFlags1 |= OC1_ON;
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
- eye.x = (Math_SinS(yaw) * 300.0f) + this->actor.focus.pos.x;
- eye.y = this->actor.focus.pos.y + 100.0f;
- eye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z;
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.focus.pos, &eye);
+ subCamEye.x = (Math_SinS(yaw) * 300.0f) + this->actor.focus.pos.x;
+ subCamEye.y = this->actor.focus.pos.y + 100.0f;
+ subCamEye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z;
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.focus.pos, &subCamEye);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_DAMAGE);
this->actionFunc = EnPametfrog_FallOffSnapper;
}
@@ -683,7 +683,7 @@ void EnPametfrog_WallPause(EnPametfrog* this, GlobalContext* globalCtx) {
} else {
SkelAnime_Update(&this->skelAnime);
this->timer--;
- Matrix_InsertRotationAroundUnitVector_f(this->wallRotation, &this->unk_2DC, 0);
+ Matrix_InsertRotationAroundUnitVector_f(this->wallRotation, &this->unk_2DC, MTXMODE_NEW);
Matrix_MultiplyVector3fByState(&this->unk_2D0, &vec);
Math_Vec3f_Copy(&this->unk_2D0, &vec);
Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8);
@@ -806,7 +806,7 @@ void EnPametfrog_LandOnSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) {
s16 yaw;
- Vec3f eye;
+ Vec3f subCamEye;
f32 xzDist;
Animation_PlayOnce(&this->skelAnime, &gGekkoFallInAirAnim);
@@ -828,7 +828,7 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) {
yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
this->actor.world.pos.x += 30.0f * Math_SinS(yaw);
this->actor.world.pos.z += 30.0f * Math_CosS(yaw);
- if (this->camId != 0) {
+ if (this->subCamId != CAM_ID_MAIN) {
xzDist = sqrtf(SQXZ(this->unk_2DC));
if (xzDist > 0.001f) {
xzDist = 200.0f / xzDist;
@@ -838,10 +838,10 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) {
this->unk_2DC.z = 0.0f;
}
- eye.x = this->actor.world.pos.x + (xzDist * this->unk_2DC.x);
- eye.y = (this->actor.world.pos.y + this->actor.home.pos.y) * 0.5f;
- eye.z = this->actor.world.pos.z + (xzDist * this->unk_2DC.z);
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.world.pos, &eye);
+ subCamEye.x = this->actor.world.pos.x + (xzDist * this->unk_2DC.x);
+ subCamEye.y = (this->actor.world.pos.y + this->actor.home.pos.y) * 0.5f;
+ subCamEye.z = this->actor.world.pos.z + (xzDist * this->unk_2DC.z);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.world.pos, &subCamEye);
}
this->actionFunc = EnPametfrog_FallInAir;
@@ -858,9 +858,9 @@ void EnPametfrog_FallInAir(EnPametfrog* this, GlobalContext* globalCtx) {
}
} else {
this->spinYaw += 0xF00;
- if (this->camId != 0) {
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.world.pos,
- &Play_GetCamera(globalCtx, this->camId)->eye);
+ if (this->subCamId != CAM_ID_MAIN) {
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.world.pos,
+ &Play_GetCamera(globalCtx, this->subCamId)->eye);
}
if (this->actor.bgCheckFlags & 1) {
@@ -900,15 +900,15 @@ void EnPametfrog_FallOnGround(EnPametfrog* this, GlobalContext* globalCtx) {
}
void EnPametfrog_SetupDefeatGekko(EnPametfrog* this, GlobalContext* globalCtx) {
- Vec3f eye;
+ Vec3f subCamEye;
s16 yaw = Actor_YawToPoint(this->actor.child, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000;
- eye.x = this->actor.child->focus.pos.x + 150.0f * Math_SinS(yaw);
- eye.y = this->actor.child->focus.pos.y + 20.0f;
- eye.z = this->actor.child->focus.pos.z + 150.0f * Math_CosS(yaw);
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.child->focus.pos, &eye);
+ subCamEye.x = this->actor.child->focus.pos.x + 150.0f * Math_SinS(yaw);
+ subCamEye.y = this->actor.child->focus.pos.y + 20.0f;
+ subCamEye.z = this->actor.child->focus.pos.z + 150.0f * Math_CosS(yaw);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.child->focus.pos, &subCamEye);
this->actor.params = GEKKO_DEFEAT;
this->timer = 38;
this->actionFunc = EnPametfrog_DefeatGekko;
@@ -925,15 +925,15 @@ void EnPametfrog_DefeatGekko(EnPametfrog* this, GlobalContext* globalCtx) {
}
void EnPametfrog_SetupDefeatSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
- Vec3f eye;
+ Vec3f subCamEye;
s16 yaw = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
s16 yawDiff = this->actor.yawTowardsPlayer - yaw;
yaw = yawDiff > 0 ? yaw - 0x2000 : yaw + 0x2000;
- eye.x = this->actor.world.pos.x + Math_SinS(yaw) * 150.0f;
- eye.y = this->actor.world.pos.y + 20.0f;
- eye.z = this->actor.world.pos.z + Math_CosS(yaw) * 150.0f;
- Play_CameraSetAtEye(globalCtx, this->camId, &this->actor.world.pos, &eye);
+ subCamEye.x = this->actor.world.pos.x + Math_SinS(yaw) * 150.0f;
+ subCamEye.y = this->actor.world.pos.y + 20.0f;
+ subCamEye.z = this->actor.world.pos.z + Math_CosS(yaw) * 150.0f;
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &this->actor.world.pos, &subCamEye);
this->timer = 20;
this->actionFunc = EnPametfrog_DefeatSnapper;
}
@@ -952,7 +952,7 @@ void EnPametfrog_SetupSpawnFrog(EnPametfrog* this, GlobalContext* globalCtx) {
static Vec3f sAccel = { 0.0f, -0.5f, 0.0f };
static Color_RGBA8 primColor = { 250, 250, 250, 255 };
static Color_RGBA8 envColor = { 180, 180, 180, 255 };
- s16 yaw = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
+ s16 yaw = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)));
Vec3f vec1;
Vec3f vel;
s32 i;
@@ -1007,7 +1007,7 @@ void EnPametfrog_SetupCutscene(EnPametfrog* this) {
void EnPametfrog_PlayCutscene(EnPametfrog* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
ActorCutscene_Start(this->cutscene, &this->actor);
- this->camId = ActorCutscene_GetCurrentCamera(this->cutscene);
+ this->subCamId = ActorCutscene_GetCurrentCamera(this->cutscene);
func_800B724C(globalCtx, &this->actor, 7);
if (this->actor.colChkInfo.health == 0) {
if (this->actor.params == GEKKO_PRE_SNAPPER) {
@@ -1166,13 +1166,13 @@ void EnPametfrog_Stun(EnPametfrog* this, GlobalContext* globalCtx) {
}
void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
- Vec3f eye;
- Vec3f at;
+ Vec3f subCamEye;
+ Vec3f subCamAt;
s16 yawDiff;
Animation_MorphToPlayOnce(&this->skelAnime, &gGekkoCallAnim, 3.0f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_FROG_GREET);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.colChkInfo.health = 6;
this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
@@ -1183,15 +1183,15 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
}
this->actor.shape.rot.y = this->actor.world.rot.y;
- at.x = this->actor.world.pos.x;
- at.z = this->actor.world.pos.z;
- at.y = this->actor.world.pos.y + 45.0f;
- eye.x = (Math_SinS(this->actor.shape.rot.y) * 90.0f) + at.x;
- eye.z = (Math_CosS(this->actor.shape.rot.y) * 90.0f) + at.z;
- eye.y = at.y + 4.0f;
+ subCamAt.x = this->actor.world.pos.x;
+ subCamAt.z = this->actor.world.pos.z;
+ subCamAt.y = this->actor.world.pos.y + 45.0f;
+ subCamEye.x = (Math_SinS(this->actor.shape.rot.y) * 90.0f) + subCamAt.x;
+ subCamEye.z = (Math_CosS(this->actor.shape.rot.y) * 90.0f) + subCamAt.z;
+ subCamEye.y = subCamAt.y + 4.0f;
// Zooms in on Gekko
- Play_CameraSetAtEye(globalCtx, this->camId, &at, &eye);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye);
this->timer = 0;
this->actor.hintId = 0x5F;
this->actionFunc = EnPametfrog_CallSnapper;
@@ -1204,26 +1204,26 @@ void EnPametfrog_CallSnapper(EnPametfrog* this, GlobalContext* globalCtx) {
}
void EnPametfrog_SetupSnapperSpawn(EnPametfrog* this, GlobalContext* globalCtx) {
- Vec3f at;
- Vec3f eye;
+ Vec3f subCamAt;
+ Vec3f subCamEye;
s16 yaw;
EnPametfrog_PlaceSnapper(this, globalCtx);
- at.x = this->actor.child->world.pos.x;
- at.z = this->actor.child->world.pos.z;
- at.y = this->actor.child->floorHeight + 50.0f;
+ subCamAt.x = this->actor.child->world.pos.x;
+ subCamAt.z = this->actor.child->world.pos.z;
+ subCamAt.y = this->actor.child->floorHeight + 50.0f;
if ((s16)(Actor_YawToPoint(&this->actor, &this->actor.home.pos) - this->actor.shape.rot.y) > 0) {
yaw = this->actor.child->shape.rot.y - 0x1000;
} else {
yaw = this->actor.child->shape.rot.y + 0x1000;
}
- eye.x = (Math_SinS(yaw) * 500.0f) + at.x;
- eye.y = at.y + 55.0f;
- eye.z = (Math_CosS(yaw) * 500.0f) + at.z;
+ subCamEye.x = (Math_SinS(yaw) * 500.0f) + subCamAt.x;
+ subCamEye.y = subCamAt.y + 55.0f;
+ subCamEye.z = (Math_CosS(yaw) * 500.0f) + subCamAt.z;
// Zooms in on Snapper spawn point
- Play_CameraSetAtEye(globalCtx, this->camId, &at, &eye);
+ Play_CameraSetAtEye(globalCtx, this->subCamId, &subCamAt, &subCamEye);
this->quake = Quake_Add(GET_ACTIVE_CAM(globalCtx), 6);
Quake_SetSpeed(this->quake, 18000);
Quake_SetQuakeValues(this->quake, 2, 0, 0, 0);
@@ -1305,7 +1305,7 @@ void EnPametfrog_ApplyDamageEffect(EnPametfrog* this, GlobalContext* globalCtx)
this->collider.base.acFlags &= ~AC_ON;
EnPametfrog_ApplyMagicArrowEffects(this, globalCtx);
Enemy_StartFinishingBlow(globalCtx, &this->actor);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
func_801A2ED8();
EnPametfrog_SetupCutscene(this);
} else if (this->actor.colChkInfo.damageEffect == GEKKO_DMGEFF_ZORA_BARRIER) {
@@ -1387,8 +1387,8 @@ static s8 limbPosIndex[] = {
-1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, 6, -1, 7, 8, 9, -1, 10, -1, 11, -1, -1,
};
-void EnPametfrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnPametfrog* this = (EnPametfrog*)arg;
+void EnPametfrog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnPametfrog* this = THIS;
Vec3f vec;
Vec3s* center;
s8 index;
diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h
index 957a46cfc4..97a682825b 100644
--- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h
+++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h
@@ -69,7 +69,7 @@ typedef struct EnPametfrog {
/* 0x2B4 */ s16 quake;
/* 0x2B6 */ s16 timer;
/* 0x2B8 */ s16 spinYaw;
- /* 0x2BA */ s16 camId;
+ /* 0x2BA */ s16 subCamId;
/* 0x2BC */ s16 freezeTimer;
/* 0x2C0 */ f32 wallRotation;
/* 0x2C4 */ f32 unk_2C4;
diff --git a/src/overlays/actors/ovl_En_Paper/z_en_paper.c b/src/overlays/actors/ovl_En_Paper/z_en_paper.c
index e629ebf9a6..50e3645296 100644
--- a/src/overlays/actors/ovl_En_Paper/z_en_paper.c
+++ b/src/overlays/actors/ovl_En_Paper/z_en_paper.c
@@ -6,7 +6,7 @@
#include "z_en_paper.h"
-#define FLAGS 0x02100010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((EnPaper*)thisx)
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 4f9a7e64ff..bbf098c923 100644
--- a/src/overlays/actors/ovl_En_Part/z_en_part.c
+++ b/src/overlays/actors/ovl_En_Part/z_en_part.c
@@ -6,7 +6,7 @@
#include "z_en_part.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnPart*)thisx)
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 c47f67c278..4f6f5ceb38 100644
--- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
+++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c
@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "objects/object_ph/object_ph.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnPeehat*)thisx)
@@ -297,7 +297,7 @@ void func_80897498(EnPeehat* this) {
void func_80897520(EnPeehat* this, GlobalContext* globalCtx) {
if (!gSaveContext.isNight) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->colliderSphere.base.acFlags |= AC_ON;
if (this->actor.xzDistToPlayer < 740.0f) {
func_80897648(this);
@@ -305,7 +305,7 @@ void func_80897520(EnPeehat* this, GlobalContext* globalCtx) {
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 10.0f);
}
} else {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->colliderSphere.base.acFlags &= ~AC_ON;
Math_StepToF(&this->actor.shape.yOffset, -1000.0f, 50.0f);
if (this->unk_2B0 != 0) {
diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c
index df73227a2b..10648fa3f7 100644
--- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c
+++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c
@@ -6,8 +6,9 @@
#include "z_en_pm.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_mm/object_mm.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnPm*)thisx)
@@ -19,25 +20,6 @@ void EnPm_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80AFA4D0(EnPm* this, GlobalContext* globalCtx);
void func_80AFA5FC(EnPm* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000468;
-extern AnimationHeader D_0600099C;
-extern AnimationHeader D_06000FC4;
-extern AnimationHeader D_06001F84;
-extern AnimationHeader D_06002238;
-extern UNK_PTR D_06002750;
-extern UNK_PTR D_06002950;
-extern Gfx D_06008348[];
-extern Gfx D_060083E0[];
-extern Gfx D_060085C8[];
-extern FlexSkeletonHeader D_060096E8;
-extern AnimationHeader D_060099B4;
-extern AnimationHeader D_0600A4E0;
-extern AnimationHeader D_0600A8D8;
-extern AnimationHeader D_0600B09C;
-extern AnimationHeader D_0600BA78;
-extern AnimationHeader D_0600C32C;
-extern AnimationHeader D_0600C640;
-
// Game scripts
static UNK_TYPE D_80AFAD80[] = {
0x0D000102, 0x3B030900, 0x0C00010B, 0x030C000D, 0x0100F902, 0x0D010F00, 0x12020F00, 0x00050105, 0x0A002E06,
@@ -248,12 +230,21 @@ static ColliderSphereInit sSphereInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06002238, 1.0f, 0, -1, 0, 0 }, { &D_06002238, 1.0f, 0, -1, 0, -4 }, { &D_0600A4E0, 1.0f, 0, -1, 2, 0 },
- { &D_0600B09C, 1.0f, 0, -1, 0, 0 }, { &D_0600B09C, 1.0f, 0, -1, 0, -4 }, { &D_0600BA78, 1.0f, 0, -1, 2, 0 },
- { &D_0600C32C, 1.0f, 0, -1, 0, -4 }, { &D_060099B4, 1.0f, 0, -1, 0, 0 }, { &D_06000FC4, 1.0f, 0, -1, 0, 0 },
- { &D_0600A8D8, 1.0f, 0, -1, 0, 0 }, { &D_0600099C, 1.0f, 0, -1, 0, 0 }, { &D_06001F84, 1.0f, 0, -1, 2, 0 },
- { &D_06000468, 1.0f, 0, -1, 0, 0 }, { &D_0600C640, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_mm_Anim_002238, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_002238, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_mm_Anim_00A4E0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_mm_Anim_00B09C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_00B09C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_mm_Anim_00BA78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_mm_Anim_00C32C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_mm_Anim_0099B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_000FC4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_00A8D8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_00099C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_001F84, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_mm_Anim_000468, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_mm_Anim_00C640, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
s32 func_80AF7B40(void) {
@@ -431,7 +422,7 @@ s32 func_80AF7E98(EnPm* this, s32 arg1) {
if (phi_v1) {
this->unk_384 = arg1;
- ret = func_8013BC6C(&this->skelAnime, sAnimations, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, arg1);
this->unk_35C = this->skelAnime.playSpeed;
}
@@ -546,7 +537,8 @@ s32 func_80AF81E8(EnPm* this, GlobalContext* globalCtx) {
case 4:
case 6:
if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), this->actor.child);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)),
+ this->actor.child);
}
this->unk_378++;
ret = true;
@@ -558,7 +550,7 @@ s32 func_80AF81E8(EnPm* this, GlobalContext* globalCtx) {
if ((gSaveContext.weekEventReg[86] & 8) && (this->unk_378 == 3)) {
ActorCutscene_Stop(sp2A);
} else {
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
}
this->unk_378++;
ret = true;
@@ -588,7 +580,7 @@ s32 func_80AF8348(EnPm* this, GlobalContext* globalCtx) {
case 4:
case 6:
case 8:
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), &this->actor);
this->unk_378++;
ret = true;
break;
@@ -598,7 +590,8 @@ s32 func_80AF8348(EnPm* this, GlobalContext* globalCtx) {
case 5:
case 7:
if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) {
- func_800E0308(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)), this->actor.child);
+ Camera_SetTargetActor(Play_GetCamera(globalCtx, ActorCutscene_GetCurrentCamera(sp2A)),
+ this->actor.child);
}
this->unk_378++;
ret = true;
@@ -711,7 +704,7 @@ s32 func_80AF86F0(EnPm* this, GlobalContext* globalCtx) {
s32 ret = false;
if ((this->unk_356 & 7) && Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_8013AED4(&this->unk_356, 0, 7);
+ SubS_UpdateFlags(&this->unk_356, 0, 7);
this->unk_398 = 0;
this->unk_378 = 0;
this->unk_37C = NULL;
@@ -754,19 +747,19 @@ void func_80AF8890(EnPm* this, Gfx** gfx, s32 arg2) {
switch (arg2) {
case 0:
if (this->unk_356 & 0x800) {
- gSPDisplayList((*gfx)++, D_06008348);
+ gSPDisplayList((*gfx)++, object_mm_DL_008348);
}
break;
case 1:
if (this->unk_356 & 0x1000) {
- gSPDisplayList((*gfx)++, D_060085C8);
+ gSPDisplayList((*gfx)++, object_mm_DL_0085C8);
}
break;
case 2:
if (this->unk_356 & 0x1000) {
- gSPDisplayList((*gfx)++, D_060083E0);
+ gSPDisplayList((*gfx)++, object_mm_DL_0083E0);
}
break;
}
@@ -824,7 +817,7 @@ void func_80AF8BA8(s32 arg0) {
s32 temp;
if (!(gSaveContext.weekEventReg[88] & 2)) {
- if (gSaveContext.weekEventReg[D_80AFB8D4[arg0] >> 8] & (D_80AFB8D4[arg0] & 0xFF)) {
+ if (gSaveContext.weekEventReg[D_80AFB8D4[arg0] >> 8] & (D_80AFB8D4[arg0] & (1 | 2 | 4 | 0x38 | 0x40 | 0x80))) {
switch (gSaveContext.day) {
case 2:
gSaveContext.weekEventReg[28] |= 8;
@@ -840,7 +833,7 @@ void func_80AF8BA8(s32 arg0) {
}
temp = gSaveContext.weekEventReg[D_80AFB8E0[arg0] >> 8];
- gSaveContext.weekEventReg[D_80AFB8E0[arg0] >> 8] = temp | (D_80AFB8E0[arg0] & 0xFF);
+ gSaveContext.weekEventReg[D_80AFB8E0[arg0] >> 8] = temp | (D_80AFB8E0[arg0] & (1 | 2 | 4 | 0x38 | 0x40 | 0x80));
}
void func_80AF8C68(EnPm* this, GlobalContext* globalCtx) {
@@ -942,7 +935,7 @@ s32 func_80AF8ED4(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
u16 sp56 = gSaveContext.time - 0x3FFC;
u8 sp55 = this->actor.params & 0xFF;
- EnDoor* sp50;
+ EnDoor* door;
Vec3s* sp4C;
Vec3f sp40;
Vec3f sp34;
@@ -950,12 +943,12 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
this->unk_234 = NULL;
- sp50 = func_80AF7D60(globalCtx, arg2->unk0);
+ door = func_80AF7D60(globalCtx, arg2->unk0);
if (D_80AFB430[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp55, D_80AFB430[arg2->unk0]);
}
- if ((sp50 != NULL) && (sp50->actor.update != NULL)) {
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if (this->unk_234 != 0) {
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
@@ -964,7 +957,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3f_Copy(&this->unk_278, &sp34);
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
- temp = this->actor.world.rot.y - sp50->actor.shape.rot.y;
+ temp = this->actor.world.rot.y - door->dyna.actor.shape.rot.y;
if (ABS_ALT(temp) <= 0x4000) {
this->unk_260 = -0x4B;
} else {
@@ -973,7 +966,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_36C = arg2->unk8 - arg2->unk4;
this->unk_36E = sp56 - arg2->unk4;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (gSaveContext.weekEventReg[90] & 8) {
this->unk_356 |= 0x800;
}
@@ -1050,7 +1043,7 @@ s32 func_80AF91E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
break;
default:
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
func_80AF7E98(this, 0);
if (gSaveContext.weekEventReg[90] & 8) {
this->unk_356 |= 0x800;
@@ -1147,7 +1140,7 @@ s32 func_80AF95E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ROOM_CARTAIN);
Flags_SetSwitch(globalCtx, 0);
this->unk_36C = 20;
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
func_80AF7E98(this, 3);
break;
@@ -1177,7 +1170,7 @@ s32 func_80AF95E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
if (arg2->unk0 == 0x1D) {
this->actor.world.rot.y = BINANG_ROT180(this->actor.world.rot.y);
}
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->unk_356 |= 0x9000;
func_80AF7E98(this, 3);
break;
@@ -1206,7 +1199,7 @@ s32 func_80AF992C(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
Math_Vec3f_Copy(&this->actor.world.pos, &D_80AFB8EC);
Math_Vec3s_Copy(&this->actor.world.rot, &D_80AFB8F8);
Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->actor.targetMode = 6;
this->actor.gravity = -1.0f;
this->unk_368 = 80.0f;
@@ -1224,7 +1217,7 @@ s32 func_80AF9A0C(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
if (func_80AF8ED4(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_AN)) {
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->unk_356 |= 0x20;
this->unk_356 |= 0x9000;
if (this->unk_258 != 0) {
@@ -1242,7 +1235,7 @@ s32 func_80AF9AB0(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
if (func_80AF8ED4(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_TEST3)) {
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->unk_356 |= 0x20;
this->unk_356 |= 0x9000;
if (this->unk_258 != 0) {
@@ -1260,7 +1253,7 @@ s32 func_80AF9B54(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 ret = false;
if (func_80AF8ED4(this, globalCtx, arg2, ACTORCAT_NPC, ACTOR_EN_AL)) {
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->unk_356 |= 0x9000;
this->unk_356 |= 0x20;
if (this->unk_258 != 0) {
@@ -1277,7 +1270,7 @@ s32 func_80AF9B54(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
s32 func_80AF9BF8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
s32 ret;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetMode = 0;
this->unk_394 = 0;
this->unk_356 = 0;
@@ -1409,17 +1402,17 @@ s32 func_80AF9BF8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
s32 func_80AF9D04(EnPm* this, GlobalContext* globalCtx) {
- EnDoor* sp44 = func_80AF7D60(globalCtx, this->unk_258);
+ EnDoor* door = (EnDoor*)func_80AF7D60(globalCtx, this->unk_258);
Vec3f sp38;
Vec3f* sp28;
f32 temp;
if (!func_8013AD6C(globalCtx) && (this->unk_374 != 0)) {
- if ((sp44 != NULL) && (sp44->actor.update != NULL)) {
+ if ((door != NULL) && (door->dyna.actor.update != NULL)) {
if (((f32)this->unk_36E / this->unk_36C) <= 0.9f) {
- sp44->unk_1A7 = this->unk_260;
+ door->unk_1A7 = this->unk_260;
} else {
- sp44->unk_1A7 = 0;
+ door->unk_1A7 = 0;
}
}
this->unk_36E = CLAMP(this->unk_36E, 0, this->unk_36C);
@@ -1561,9 +1554,9 @@ s32 func_80AFA334(EnPm* this, GlobalContext* globalCtx) {
case 24:
temp_v0 = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
if (ABS_ALT(temp_v0) < 0x4000) {
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
} else {
- func_8013AED4(&this->unk_356, 0, 7);
+ SubS_UpdateFlags(&this->unk_356, 0, 7);
}
break;
@@ -1711,11 +1704,11 @@ void func_80AFA4D0(EnPm* this, GlobalContext* globalCtx) {
if (!func_80133038(globalCtx, D_80AFB900[this->unk_38C], &sp2C) ||
((this->unk_258 != sp2C.unk0) && !func_80AF9BF8(this, globalCtx, &sp2C))) {
this->actor.shape.shadowDraw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
sp2C.unk0 = 0;
} else {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk_258 = sp2C.unk0;
@@ -1732,7 +1725,7 @@ void func_80AFA5FC(EnPm* this, GlobalContext* globalCtx) {
Vec3f sp2C;
if (func_8010BF58(&this->actor, globalCtx, this->unk_25C, this->unk_37C, &this->unk_264)) {
- func_8013AED4(&this->unk_356, 3, 7);
+ SubS_UpdateFlags(&this->unk_356, 3, 7);
this->unk_356 &= ~0x20;
this->unk_356 |= 0x200;
this->actor.child = NULL;
@@ -1766,7 +1759,8 @@ void EnPm_Init(Actor* thisx, GlobalContext* globalCtx) {
EnPm* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 14.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060096E8, NULL, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_mm_Skel_0096E8, NULL, this->jointTable, this->morphTable,
+ 16);
this->unk_384 = -1;
func_80AF7E98(this, 0);
Collider_InitAndSetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit);
@@ -1809,8 +1803,8 @@ void EnPm_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_80AFAA04(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
- Gfx** gfx) {
+s32 EnPm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
EnPm* this = THIS;
if (limbIndex == 15) {
@@ -1819,7 +1813,7 @@ s32 func_80AFAA04(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
return false;
}
-void func_80AFAA44(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+void EnPm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
EnPm* this = THIS;
s32 pad;
Vec3f sp2C;
@@ -1854,7 +1848,7 @@ void func_80AFAA44(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
}
-void func_80AFABAC(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx) {
+void EnPm_TransformLimbDraw(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx) {
EnPm* this = THIS;
s32 phi_v0;
s32 phi_v1;
@@ -1885,9 +1879,9 @@ void func_80AFABAC(GlobalContext* globalCtx, s32 arg1, Actor* thisx, Gfx** gfx)
}
void EnPm_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static UNK_PTR D_80AFB914[] = {
- &D_06002950,
- &D_06002750,
+ static TexturePtr D_80AFB914[] = {
+ object_mm_Tex_002950,
+ object_mm_Tex_002750,
};
EnPm* this = THIS;
s32 pad;
@@ -1901,9 +1895,9 @@ void EnPm_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AFB914[0]));
- POLY_OPA_DISP =
- func_8013AB00(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80AFAA04, func_80AFAA44, func_80AFABAC, &this->actor, POLY_OPA_DISP);
+ POLY_OPA_DISP = SubS_DrawTransformFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnPm_OverrideLimbDraw, EnPm_PostLimbDraw,
+ EnPm_TransformLimbDraw, &this->actor, POLY_OPA_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
index dce3a55fda..744644e58f 100644
--- a/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
+++ b/src/overlays/actors/ovl_En_Po_Composer/z_en_po_composer.c
@@ -6,7 +6,7 @@
#include "z_en_po_composer.h"
-#define FLAGS 0x02100019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((EnPoComposer*)thisx)
diff --git a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c
index fe96f5a37f..52223aaae7 100644
--- a/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c
+++ b/src/overlays/actors/ovl_En_Po_Fusen/z_en_po_fusen.c
@@ -6,8 +6,9 @@
#include "z_en_po_fusen.h"
#include "overlays/actors/ovl_En_Ma4/z_en_ma4.h"
+#include "objects/object_po_fusen/object_po_fusen.h"
-#define FLAGS 0x80100030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_100000 | ACTOR_FLAG_80000000)
#define THIS ((EnPoFusen*)thisx)
@@ -26,10 +27,7 @@ void EnPoFusen_Pop(EnPoFusen* this, GlobalContext* globalCtx);
void EnPoFusen_Idle(EnPoFusen* this, GlobalContext* globalCtx);
void EnPoFusen_IdleFuse(EnPoFusen* this, GlobalContext* globalCtx);
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- Actor* arg);
-
-extern AnimationHeader D_06000040;
-extern FlexSkeletonHeader D_060024F0;
+ Actor* thisx);
const ActorInit En_Po_Fusen_InitVars = {
ACTOR_EN_PO_FUSEN,
@@ -111,7 +109,8 @@ void EnPoFusen_Init(Actor* thisx, GlobalContext* globalCtx) {
if (0) {}
this->collider.dim.worldSphere.radius = 40;
- SkelAnime_InitFlex(globalCtx, &this->anime, &D_060024F0, &D_06000040, this->jointTable, this->morphTable, 10);
+ SkelAnime_InitFlex(globalCtx, &this->anime, &object_po_fusen_Skel_0024F0, &object_po_fusen_Anim_000040,
+ this->jointTable, this->morphTable, 10);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 0x4);
@@ -271,8 +270,8 @@ void EnPoFusen_Update(Actor* thisx, GlobalContext* globalCtx) {
}
s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
- Actor* arg) {
- EnPoFusen* this = (EnPoFusen*)arg;
+ Actor* thisx) {
+ EnPoFusen* this = THIS;
f32 zScale;
f32 yScale;
f32 xScale;
@@ -307,18 +306,19 @@ s32 EnPoFusen_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
rot->y += (s16)(this->limb9Rot * Math_SinS(this->randBaseRotChange));
rot->z += (s16)(this->limb9Rot * Math_CosS(this->randBaseRotChange));
}
- return 0;
+ return false;
}
-void EnPoFusen_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
+void EnPoFusen_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
-void EnPoFusen_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnPoFusen_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnPoFusen_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnPoFusen* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
- func_801343C0(globalCtx, this->anime.skeleton, this->anime.jointTable, this->anime.dListCount,
- EnPoFusen_OverrideLimbDraw, EnPoFusen_PostLimbDraw, EnPoFusen_UnkActorDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->anime.skeleton, this->anime.jointTable, this->anime.dListCount,
+ EnPoFusen_OverrideLimbDraw, EnPoFusen_PostLimbDraw, EnPoFusen_TransformLimbDraw,
+ &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
index a2e299290f..b5a3655ac5 100644
--- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
+++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c
@@ -6,8 +6,9 @@
#include "z_en_po_sisters.h"
#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_po_sisters/object_po_sisters.h"
-#define FLAGS 0x00005015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_1000 | ACTOR_FLAG_4000)
#define THIS ((EnPoSisters*)thisx)
@@ -47,24 +48,6 @@ void func_80B1C0A4(EnPoSisters* this, GlobalContext* globalCtx);
void func_80B1C2E8(EnPoSisters* this);
void func_80B1C340(EnPoSisters* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000114;
-extern AnimationHeader D_060008C0;
-extern AnimationHeader D_06000A54;
-extern AnimationHeader D_06000D40;
-extern AnimationHeader D_0600119C;
-extern AnimationHeader D_060014CC;
-extern Gfx D_06001CB0[];
-extern Gfx D_06001DE0[];
-extern Gfx D_060027B0[];
-extern Gfx D_06002EB8[];
-extern Gfx D_06002F88[];
-extern Gfx D_06003628[];
-extern Gfx D_06003880[];
-extern Gfx D_06003DC8[];
-extern Gfx D_06004020[];
-extern Gfx D_060046E0[];
-extern SkeletonHeader D_060065C8;
-
static Color_RGBA8 D_80B1DA30[] = {
{ 255, 170, 255, 255 },
{ 255, 200, 0, 255 },
@@ -159,7 +142,8 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 50.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_060065C8, &D_060014CC, this->jointTable, this->morphTable, 12);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_po_sisters_Skel_0065C8, &object_po_sisters_Anim_0014CC,
+ this->jointTable, this->morphTable, 12);
this->unk_226 = 255;
this->unk_227 = 255;
this->unk_228 = 210;
@@ -189,7 +173,7 @@ void EnPoSisters_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80B1BCF0(this, globalCtx);
func_80B1C2E8(this);
} else {
- this->actor.flags &= ~(0x4000 | 0x200);
+ this->actor.flags &= ~(ACTOR_FLAG_200 | ACTOR_FLAG_4000);
this->collider.info.elemType = ELEMTYPE_UNK4;
this->collider.info.bumper.dmgFlags |= (0x40000 | 0x1);
this->collider.base.ocFlags1 = OC1_NONE;
@@ -293,7 +277,7 @@ void func_80B1A9B0(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1AA88(EnPoSisters* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060014CC, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_0014CC, -3.0f);
this->actor.speedXZ = 0.0f;
this->unk_192 = Rand_S16Offset(100, 50);
this->actionFunc = func_80B1AAE8;
@@ -308,7 +292,7 @@ void func_80B1AAE8(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1AB5C(EnPoSisters* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060014CC, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_0014CC, -3.0f);
this->unk_192 = Rand_S16Offset(2, 3);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_80B1ABB8;
@@ -329,7 +313,7 @@ void func_80B1ABB8(EnPoSisters* this, GlobalContext* globalCtx) {
void func_80B1AC40(EnPoSisters* this) {
if (this->actionFunc != func_80B1AE3C) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f);
}
this->unk_192 = Rand_S16Offset(15, 3);
this->unk_191 |= (0x6 | 0x1);
@@ -391,9 +375,9 @@ void func_80B1AF8C(EnPoSisters* this) {
this->collider.base.acFlags |= AC_HARD;
}
- Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000114, -5.0f);
this->actor.speedXZ = 0.0f;
- this->unk_192 = Animation_GetLastFrame(&D_06000114.common) * 3 + 3;
+ this->unk_192 = Animation_GetLastFrame(&object_po_sisters_Anim_000114.common) * 3 + 3;
this->unk_191 &= ~2;
this->actionFunc = func_80B1B020;
}
@@ -418,7 +402,7 @@ void func_80B1B0E0(EnPoSisters* this) {
if (this->unk_18C == 0) {
this->collider.base.colType = COLTYPE_METAL;
this->collider.base.acFlags |= AC_HARD;
- Animation_MorphToLoop(&this->skelAnime, &D_06000114, -5.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000114, -5.0f);
}
this->unk_192 = 5;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
@@ -456,7 +440,7 @@ void func_80B1B168(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1B280(EnPoSisters* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f);
this->actor.world.rot.y = BINANG_ROT180(this->actor.yawTowardsPlayer);
if (this->unk_18C != 0) {
this->collider.base.colType = COLTYPE_HIT3;
@@ -480,7 +464,7 @@ void func_80B1B2F0(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1B3A8(EnPoSisters* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060008C0, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_po_sisters_Anim_0008C0, -3.0f);
if (this->collider.base.ac != NULL) {
func_800BE504(&this->actor, &this->collider);
}
@@ -497,7 +481,7 @@ void func_80B1B3A8(EnPoSisters* this) {
void func_80B1B444(EnPoSisters* this, GlobalContext* globalCtx) {
s32 temp_f18;
- if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & 0x8000)) {
+ if (SkelAnime_Update(&this->skelAnime) && !(this->actor.flags & ACTOR_FLAG_8000)) {
if (this->actor.colChkInfo.health != 0) {
if (this->unk_18C != 0) {
func_80B1B5B4(this);
@@ -524,7 +508,7 @@ void func_80B1B444(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1B5B4(EnPoSisters* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000A54, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000A54, -3.0f);
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
this->unk_192 = 5;
this->unk_191 |= (0x8 | 0x2 | 0x1);
@@ -552,7 +536,8 @@ void func_80B1B628(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1B70C(EnPoSisters* this) {
- Animation_Change(&this->skelAnime, &D_0600119C, 1.5f, 0.0f, Animation_GetLastFrame(&D_0600119C.common), 2, -3.0f);
+ Animation_Change(&this->skelAnime, &object_po_sisters_Anim_00119C, 1.5f, 0.0f,
+ Animation_GetLastFrame(&object_po_sisters_Anim_00119C.common), 2, -3.0f);
this->unk_194 = 100;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -576,7 +561,8 @@ void func_80B1B7BC(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1B860(EnPoSisters* this, GlobalContext* globalCtx) {
- Animation_Change(&this->skelAnime, &D_0600119C, 1.5f, 0.0f, Animation_GetLastFrame(&D_0600119C.common), 2, -3.0f);
+ Animation_Change(&this->skelAnime, &object_po_sisters_Anim_00119C, 1.5f, 0.0f,
+ Animation_GetLastFrame(&object_po_sisters_Anim_00119C.common), 2, -3.0f);
if (this->unk_18C == 0) {
this->unk_2EC = 110.0f;
func_80B1A768(this, globalCtx);
@@ -625,7 +611,7 @@ void func_80B1BA3C(EnPoSisters* this) {
this->actor.speedXZ = 0.0f;
this->actor.world.pos.y += 42.0f;
this->actor.shape.yOffset = -6000.0f;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_191 = 0;
this->actionFunc = func_80B1BA90;
}
@@ -717,7 +703,7 @@ void func_80B1BE4C(EnPoSisters* this, s32 arg1) {
Vec3f sp34;
this->actor.draw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_194 = 100;
this->unk_191 = 0x20;
this->collider.base.colType = COLTYPE_HIT3;
@@ -758,12 +744,12 @@ void func_80B1BF2C(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1C030(EnPoSisters* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000D40, -3.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_sisters_Anim_000D40, -3.0f);
this->unk_229 = 255;
this->unk_192 = 300;
this->unk_194 = 3;
this->unk_191 |= (0x8 | 0x1);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = func_80B1C0A4;
}
@@ -825,7 +811,7 @@ void func_80B1C0A4(EnPoSisters* this, GlobalContext* globalCtx) {
}
void func_80B1C2E8(EnPoSisters* this) {
- Animation_PlayOnce(&this->skelAnime, &D_0600119C);
+ Animation_PlayOnce(&this->skelAnime, &object_po_sisters_Anim_00119C);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKIDS_APPEAR);
this->unk_229 = 0;
this->unk_191 = 0x20;
@@ -835,7 +821,7 @@ void func_80B1C2E8(EnPoSisters* this) {
void func_80B1C340(EnPoSisters* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
this->unk_229 = 255;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_191 |= (0x10 | 0x8);
if (this->unk_18C == 0) {
func_80B1BE4C(this, globalCtx);
@@ -959,7 +945,7 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
}
if (this->actionFunc == func_80B1B168) {
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
@@ -980,15 +966,15 @@ void EnPoSisters_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80B1C974(EnPoSisters* this) {
- if (this->skelAnime.animation == &D_06000114) {
+ if (this->skelAnime.animation == &object_po_sisters_Anim_000114) {
this->unk_226 = CLAMP_MAX(this->unk_226 + 5, 255);
this->unk_227 = CLAMP_MIN(this->unk_227 - 5, 50);
this->unk_228 = CLAMP_MIN(this->unk_228 - 5, 0);
- } else if (this->skelAnime.animation == &D_06000A54) {
+ } else if (this->skelAnime.animation == &object_po_sisters_Anim_000A54) {
this->unk_226 = CLAMP_MAX(this->unk_226 + 5, 80);
this->unk_227 = CLAMP_MAX(this->unk_227 + 5, 255);
this->unk_228 = CLAMP_MAX(this->unk_228 + 5, 225);
- } else if (this->skelAnime.animation == &D_060008C0) {
+ } else if (this->skelAnime.animation == &object_po_sisters_Anim_0008C0) {
if (this->actor.colorFilterTimer & 0x2) {
this->unk_226 = 0;
this->unk_227 = 0;
@@ -1014,16 +1000,16 @@ void func_80B1C974(EnPoSisters* this) {
s32 EnPoSisters_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx, Gfx** gfx) {
static Gfx* D_80B1DACC[] = {
- D_06001DE0,
- D_06002F88,
- D_06003628,
- D_06003DC8,
+ object_po_sisters_DL_001DE0,
+ object_po_sisters_DL_002F88,
+ object_po_sisters_DL_003628,
+ object_po_sisters_DL_003DC8,
};
static Gfx* D_80B1DADC[] = {
- D_06001CB0,
- D_06002EB8,
- D_06003880,
- D_06004020,
+ object_po_sisters_DL_001CB0,
+ object_po_sisters_DL_002EB8,
+ object_po_sisters_DL_003880,
+ object_po_sisters_DL_004020,
};
static Color_RGBA8 D_80B1DAEC[] = {
{ 80, 0, 100, 0 },
@@ -1083,7 +1069,7 @@ void EnPoSisters_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
if ((this->actionFunc == func_80B1BA90) && (this->unk_192 >= 8) && (limbIndex == 9)) {
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList((*gfx)++, D_060046E0);
+ gSPDisplayList((*gfx)++, object_po_sisters_DL_0046E0);
}
if (limbIndex == 8) {
@@ -1153,7 +1139,7 @@ void EnPoSisters_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_SetCurrentState(&this->unk_358);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060027B0);
+ gSPDisplayList(POLY_OPA_DISP++, object_po_sisters_DL_0027B0);
}
gSPSegment(POLY_XLU_DISP++, 0x08,
@@ -1178,7 +1164,7 @@ void EnPoSisters_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, temp_s7->r, temp_s7->g, temp_s7->b, phi_s5);
Matrix_InsertTranslation(this->unk_22C[i].x, this->unk_22C[i].y, this->unk_22C[i].z, MTXMODE_NEW);
- Matrix_InsertRotation(0, BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx))), 0, MTXMODE_APPLY);
+ Matrix_InsertRotation(0, BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx))), 0, MTXMODE_APPLY);
if (this->actionFunc == func_80B1BA90) {
f32 phi_f0;
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 aedd9efc18..e3a5d30be7 100644
--- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c
+++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c
@@ -5,8 +5,9 @@
*/
#include "z_en_poh.h"
+#include "objects/object_po/object_po.h"
-#define FLAGS 0x00001205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_1000)
#define THIS ((EnPoh*)thisx)
@@ -45,17 +46,6 @@ void func_80B2E3F8(EnPoh* this, GlobalContext* globalCtx);
void func_80B2F328(Actor* thisx, GlobalContext* globalCtx);
void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx);
-extern AnimationHeader D_060001A8;
-extern AnimationHeader D_060004EC;
-extern AnimationHeader D_060006E0;
-extern AnimationHeader D_06000A60;
-extern AnimationHeader D_060011C4;
-extern AnimationHeader D_060015B0;
-extern Gfx D_06002608[];
-extern Gfx D_06002D28[];
-extern Gfx D_06003850[];
-extern SkeletonHeader D_060050D0;
-
const ActorInit En_Poh_InitVars = {
ACTOR_EN_POH,
ACTORCAT_ENEMY,
@@ -175,7 +165,8 @@ void EnPoh_Init(Actor* thisx, GlobalContext* globalCtx) {
this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
Lights_PointGlowSetInfo(&this->lightInfo, this->actor.home.pos.x, this->actor.home.pos.y, this->actor.home.pos.z,
255, 255, 255, 0);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_060050D0, &D_06000A60, this->jointTable, this->morphTable, 21);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_po_Skel_0050D0, &object_po_Anim_000A60, this->jointTable,
+ this->morphTable, 21);
this->actor.bgCheckFlags |= 0x400;
func_80B2D0E8(this);
}
@@ -222,7 +213,7 @@ void func_80B2C9B8(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2CA4C(EnPoh* this) {
- Animation_PlayLoop(&this->skelAnime, &D_060015B0);
+ Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0);
this->unk_18E = Rand_S16Offset(2, 3);
this->actionFunc = func_80B2CAA4;
this->actor.speedXZ = 0.0f;
@@ -248,7 +239,7 @@ void func_80B2CAA4(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2CB60(EnPoh* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06000A60);
+ Animation_PlayLoop(&this->skelAnime, &object_po_Anim_000A60);
this->unk_18E = Rand_S16Offset(15, 3);
this->colliderCylinder.base.acFlags |= AC_ON;
this->actionFunc = func_80B2CBBC;
@@ -283,7 +274,7 @@ void func_80B2CBBC(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2CD14(EnPoh* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06000A60);
+ Animation_PlayLoop(&this->skelAnime, &object_po_Anim_000A60);
this->actionFunc = func_80B2CD64;
this->unk_18E = 0;
this->actor.speedXZ = 2.0f;
@@ -322,7 +313,7 @@ void func_80B2CD64(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2CEC8(EnPoh* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060001A8, -6.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0001A8, -6.0f);
this->unk_18E = 12;
this->actor.speedXZ = 0.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PO_LAUGH);
@@ -351,7 +342,7 @@ void func_80B2CF28(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2CFF8(EnPoh* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060004EC, -6.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_po_Anim_0004EC, -6.0f);
func_800BE504(&this->actor, &this->colliderCylinder);
this->colliderCylinder.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 5.0f;
@@ -372,8 +363,8 @@ void func_80B2D07C(EnPoh* this, GlobalContext* globalCtx) {
void func_80B2D0E8(EnPoh* this) {
this->unk_197 = 0;
- this->actor.flags &= ~1;
- Animation_PlayOnceSetSpeed(&this->skelAnime, &D_060011C4, 0.0f);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ Animation_PlayOnceSetSpeed(&this->skelAnime, &object_po_Anim_0011C4, 0.0f);
this->actionFunc = func_80B2D140;
}
@@ -381,7 +372,7 @@ void func_80B2D140(EnPoh* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
this->unk_197 = 255;
this->unk_190 = Rand_S16Offset(700, 300);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
func_80B2CB60(this);
} else if (this->skelAnime.curFrame > 10.0f) {
this->unk_197 = (this->skelAnime.curFrame - 10.0f) * 0.05f * 255.0f;
@@ -398,7 +389,7 @@ void func_80B2D2C0(EnPoh* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
this->unk_18E = 0;
this->actor.hintId = 0xFF;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_80B2D300;
}
@@ -413,7 +404,7 @@ void func_80B2D300(EnPoh* this, GlobalContext* globalCtx) {
this->unk_18E++;
if (this->unk_18E < 8) {
- sp38 = func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x4800;
+ sp38 = Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x4800;
if (this->unk_18E < 5) {
sp3A = (this->unk_18E * 0x1000) - 0x4000;
sp44.y = (Math_SinS(sp3A) * 23.0f) + (this->actor.world.pos.y + 40.0f);
@@ -452,7 +443,7 @@ void func_80B2D300(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2D5DC(EnPoh* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06000A60);
+ Animation_PlayOnce(&this->skelAnime, &object_po_Anim_000A60);
this->actionFunc = func_80B2D628;
this->actor.speedXZ = -5.0f;
}
@@ -469,7 +460,7 @@ void func_80B2D628(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2D694(EnPoh* this) {
- Animation_PlayLoop(&this->skelAnime, &D_060015B0);
+ Animation_PlayLoop(&this->skelAnime, &object_po_Anim_0015B0);
this->unk_192 = BINANG_ROT180(this->actor.world.rot.y);
this->actionFunc = func_80B2D6EC;
this->actor.speedXZ = 0.0f;
@@ -547,7 +538,7 @@ void func_80B2D980(EnPoh* this, GlobalContext* globalCtx) {
}
void func_80B2DAD0(EnPoh* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060006E0, -5.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_po_Anim_0006E0, -5.0f);
this->actor.speedXZ = 5.0f;
this->actor.world.rot.y = BINANG_ROT180(this->actor.shape.rot.y);
this->colliderCylinder.base.acFlags |= AC_ON;
@@ -580,19 +571,20 @@ void func_80B2DC50(EnPoh* this, GlobalContext* globalCtx) {
this->actor.world.pos.y = this->unk_3D8.wy;
this->actor.world.pos.z = this->unk_3D8.wz;
Actor_SetScale(&this->actor, 0.01f);
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->actor.gravity = -1.0f;
this->actor.shape.yOffset = 1500.0f;
this->actor.world.pos.y -= 15.0f;
this->actor.shape.rot.x = -0x8000;
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 8);
- this->actor.flags &= ~(0x4 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
this->actionFunc = func_80B2DD2C;
}
void func_80B2DD2C(EnPoh* this, GlobalContext* globalCtx) {
if ((this->actor.bgCheckFlags & 1) || (this->actor.floorHeight <= BGCHECK_Y_MIN)) {
- EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10, D_06002D28);
+ EffectSsHahen_SpawnBurst(globalCtx, &this->actor.world.pos, 6.0f, 0, 1, 1, 15, OBJECT_PO, 10,
+ object_po_DL_002D28);
func_80B2E0B0(this);
}
@@ -655,7 +647,7 @@ void func_80B2E1D8(EnPoh* this) {
Actor_SetFocus(&this->actor, -10.0f);
this->unk_18E = 200;
this->unk_18D = 32;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = func_80B2E230;
}
@@ -805,8 +797,8 @@ void func_80B2E8E0(EnPoh* this) {
}
void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx2) {
- EnPoh* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnPoh* this = THIS;
s32 pad;
if (this->colliderSph.base.atFlags & AT_HIT) {
@@ -819,7 +811,7 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->actionFunc(this, globalCtx);
Actor_MoveWithGravity(&this->actor);
if ((this->actionFunc == func_80B2CF28) && (this->unk_18E < 10)) {
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderSph.base);
}
@@ -888,7 +880,7 @@ void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
Collider_UpdateSpheres(limbIndex, &this->colliderSph);
if ((this->actionFunc == func_80B2D300) && (this->unk_18E >= 2) && (limbIndex == 5)) {
gSPMatrix((*gfx)++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList((*gfx)++, D_06002608);
+ gSPDisplayList((*gfx)++, object_po_DL_002608);
}
if (limbIndex == 18) {
@@ -963,7 +955,7 @@ void EnPoh_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_SetCurrentState(&this->unk_3D8);
gSPMatrix(&gfx[2], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(&gfx[3], D_06002D28);
+ gSPDisplayList(&gfx[3], object_po_DL_002D28);
POLY_OPA_DISP = &gfx[4];
func_800BE680(globalCtx, &this->actor, this->unk_2A0, 10, this->actor.scale.x * 100.0f * this->unk_29C, 0.0f,
@@ -1002,7 +994,7 @@ void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.pos.z + sp7C.z, this->unk_198, this->unk_199, this->unk_19A, 200);
gSPMatrix(&gfx[2], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(&gfx[3], D_06002D28);
+ gSPDisplayList(&gfx[3], object_po_DL_002D28);
POLY_OPA_DISP = &gfx[4];
} else {
@@ -1014,10 +1006,11 @@ void func_80B2F37C(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 170, 255, this->unk_197);
gDPSetEnvColor(POLY_XLU_DISP++, this->unk_194, this->unk_195, this->unk_196, 255);
- Matrix_InsertYRotation_f((func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 32768), MTXMODE_APPLY);
+ Matrix_InsertYRotation_f((Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) + 0x8000) * (M_PI / 32768),
+ MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06003850);
+ gSPDisplayList(POLY_XLU_DISP++, object_po_DL_003850);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Pp/z_en_pp.c b/src/overlays/actors/ovl_En_Pp/z_en_pp.c
index 0fb1e08d09..67f9512997 100644
--- a/src/overlays/actors/ovl_En_Pp/z_en_pp.c
+++ b/src/overlays/actors/ovl_En_Pp/z_en_pp.c
@@ -6,7 +6,7 @@
#include "z_en_pp.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnPp*)thisx)
diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.c b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
index 696abb358e..cbc26c8b76 100644
--- a/src/overlays/actors/ovl_En_Pr/z_en_pr.c
+++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.c
@@ -5,8 +5,10 @@
*/
#include "z_en_pr.h"
+#include "overlays/actors/ovl_En_Prz/z_en_prz.h"
+#include "objects/object_pr/object_pr.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnPr*)thisx)
@@ -15,18 +17,21 @@ void EnPr_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnPr_Update(Actor* thisx, GlobalContext* globalCtx);
void EnPr_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80A326F0(EnPr* this);
void func_80A32740(EnPr* this, GlobalContext* globalCtx);
+void func_80A32854(EnPr* this);
void func_80A3289C(EnPr* this, GlobalContext* globalCtx);
+void func_80A3295C(EnPr* this);
void func_80A32984(EnPr* this, GlobalContext* globalCtx);
void func_80A32A40(EnPr* this, GlobalContext* globalCtx);
+void func_80A32AF8(EnPr* this);
void func_80A32B20(EnPr* this, GlobalContext* globalCtx);
+void func_80A32CDC(EnPr* this);
void func_80A32D28(EnPr* this, GlobalContext* globalCtx);
void func_80A32EA4(EnPr* this, GlobalContext* globalCtx);
void func_80A32F48(EnPr* this, GlobalContext* globalCtx);
-#if 0
-// static DamageTable sDamageTable = {
-static DamageTable D_80A338A0 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -61,6 +66,8 @@ static DamageTable D_80A338A0 = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
+f32 D_80A338C0[PLAYER_FORM_MAX] = { 30.0f, 30.0f, 30.0f, 15.0f, 15.0f };
+
const ActorInit En_Pr_InitVars = {
ACTOR_EN_PR,
ACTORCAT_ENEMY,
@@ -73,64 +80,546 @@ const ActorInit En_Pr_InitVars = {
(ActorFunc)EnPr_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80A338F4 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK4, { 0x20000000, 0x00, 0x04 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK4,
+ { 0x20000000, 0x00, 0x04 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 18, 20, 5, { 0, 0, 0 } },
};
-#endif
+static AnimationHeader* sAnimations[] = {
+ &object_pr_Anim_0021E8, &object_pr_Anim_001E10, &object_pr_Anim_0021E8,
+ &object_pr_Anim_000740, &object_pr_Anim_000268,
+};
-extern DamageTable D_80A338A0;
-extern ColliderCylinderInit D_80A338F4;
+u8 D_80A33934[] = {
+ 0, 2, 0, 0, 2,
+};
-extern UNK_TYPE D_060021E8;
+void EnPr_Init(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ EnPr* this = THIS;
+ EnPrz* prz;
+ s32 i;
+ s32 temp_s4;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/EnPr_Init.s")
+ this->actor.colChkInfo.health = 3;
+ this->actor.colChkInfo.mass = 50;
+ this->actor.hintId = 0x5C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/EnPr_Destroy.s")
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A3242C.s")
+ this->unk_208 = 255;
+ this->unk_2CC = 0.01f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A324E0.s")
+ Actor_SetScale(&this->actor, 0.01f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A325E4.s")
+ this->actor.targetMode = 3;
+ this->unk_2B8 = this->actor.world.pos.y;
+ this->actor.shape.yOffset = 1500.0f;
+ this->actor.colChkInfo.damageTable = &sDamageTable;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A326F0.s")
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_pr_Skel_0038B8, &object_pr_Anim_0021E8, this->jointTable,
+ this->morphTable, 10);
+ this->unk_2C8 = this->actor.world.rot.z * 20.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32740.s")
+ if (this->unk_2C8 < 80.0f) {
+ this->unk_2C8 = 80.0f;
+ }
+ this->actor.world.rot.z = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32854.s")
+ temp_s4 = ENPR_GET_FF00(&this->actor);
+ if (temp_s4 > ENPR_FF00_MAX) {
+ temp_s4 = ENPR_FF00_MAX;
+ } else if (temp_s4 < ENPR_FF00_MIN) {
+ temp_s4 = ENPR_FF00_MIN;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A3289C.s")
+ this->unk_2F8 = &this->actor;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A3295C.s")
+ for (i = 0; i < temp_s4; i++) {
+ prz = (EnPrz*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_PRZ,
+ this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0,
+ this->actor.world.rot.y, 0, i + 1);
+ if (prz != NULL) {
+ prz->unk_220 = this->unk_2F8;
+ this->unk_2F8 = &prz->actor;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32984.s")
+ this->unk_2D0 = 255;
+ this->unk_20E = 30;
+ this->unk_216 = this->actor.world.rot.y;
+ this->unk_214 = this->actor.world.rot.y;
+ this->unk_2B4 = this->actor.world.pos.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32A40.s")
+ func_80A326F0(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32AF8.s")
+void EnPr_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32B20.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32CDC.s")
+void func_80A3242C(EnPr* this, s32 arg0) {
+ f32 sp34;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32D28.s")
+ this->unk_21C = arg0;
+ sp34 = 1.0f;
+ this->unk_2BC = Animation_GetLastFrame(sAnimations[arg0]);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32E60.s")
+ if (this->unk_21C == 2) {
+ sp34 = 2.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32EA4.s")
+ Animation_Change(&this->skelAnime, sAnimations[this->unk_21C], sp34, 0.0f, this->unk_2BC, D_80A33934[this->unk_21C],
+ -2.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A32F48.s")
+s32 func_80A324E0(EnPr* this, GlobalContext* globalCtx) {
+ CollisionPoly* sp54;
+ Vec3f sp48;
+ s32 sp44;
+ WaterBox* sp40;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A33098.s")
+ if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &this->unk_2E0, &sp48, &sp54, 1, 0, 0, 1,
+ &sp44)) {
+ return 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/EnPr_Update.s")
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->unk_2B4, &sp40)) {
+ if ((this->unk_2B4 - 30.0f) < this->actor.world.pos.y) {
+ this->unk_2B8 = this->unk_2B4 - 30.0f;
+ return 2;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A3357C.s")
+ if (this->actor.world.pos.y < (this->actor.floorHeight + 20.0f)) {
+ this->unk_2B8 = this->actor.floorHeight + 20.0f;
+ return 2;
+ }
+ return 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/func_80A335B4.s")
+s32 func_80A325E4(EnPr* this) {
+ s16 temp = this->unk_214 * 0.2f;
+ s32 abs = ABS_ALT(temp) & 0xFFFF;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr/EnPr_Draw.s")
+ Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_22C, 1, abs + 1, 0);
+ this->unk_216 = this->actor.world.rot.y - this->unk_22C;
+
+ if (this->unk_216 > 10000) {
+ this->unk_216 = 10000;
+ } else if (this->unk_216 < -10000) {
+ this->unk_216 = -10000;
+ }
+
+ if (ABS_ALT(BINANG_SUB(this->actor.world.rot.y, this->unk_22C)) > 0x100) {
+ return true;
+ }
+ this->unk_216 = 0;
+ return false;
+}
+
+void func_80A326F0(EnPr* this) {
+ if (this->unk_21C != 0) {
+ func_80A3242C(this, 0);
+ }
+ this->unk_206 = 0;
+ this->actor.speedXZ = 1.0f;
+ this->actionFunc = func_80A32740;
+}
+
+void func_80A32740(EnPr* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ switch (func_80A324E0(this, globalCtx)) {
+ case 1:
+ func_80A3295C(this);
+ return;
+
+ case 2:
+ this->unk_206 = 3;
+ this->actionFunc = func_80A32A40;
+ break;
+ }
+
+ if (this->unk_2C8 < sqrtf(SQ(this->actor.world.pos.x - this->actor.home.pos.x) +
+ SQ(this->actor.world.pos.z - this->actor.home.pos.z))) {
+ func_80A32854(this);
+ } else if ((this->unk_20E == 0) && (player->stateFlags1 & 0x8000000)) {
+ if (sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) +
+ SQ(player->actor.world.pos.z - this->actor.home.pos.z)) < this->unk_2C8) {
+ func_80A32AF8(this);
+ }
+ }
+}
+
+void func_80A32854(EnPr* this) {
+ if (this->unk_21C != 0) {
+ func_80A3242C(this, 0);
+ }
+ this->unk_206 = 1;
+ this->actionFunc = func_80A3289C;
+}
+
+void func_80A3289C(EnPr* this, GlobalContext* globalCtx) {
+ this->unk_22C = Math_Vec3f_Yaw(&this->actor.world.pos, &this->actor.home.pos);
+ func_80A325E4(this);
+
+ if (sqrtf(SQ(this->actor.world.pos.x - this->actor.home.pos.x) +
+ SQ(this->actor.world.pos.z - this->actor.home.pos.z)) < (((BREG(53) * 0.1f) + 0.5f) * this->unk_2C8)) {
+ this->unk_206 = 3;
+ this->actionFunc = func_80A32A40;
+ }
+}
+
+void func_80A3295C(EnPr* this) {
+ this->unk_22C = BINANG_ADD(this->actor.world.rot.y, 0x4000);
+ this->unk_206 = 2;
+ this->actionFunc = func_80A32984;
+}
+
+void func_80A32984(EnPr* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((player->stateFlags1 & 0x8000000) && (this->unk_20E == 0)) {
+ this->unk_22C = this->actor.world.rot.y;
+ func_80A32AF8(this);
+ } else if (!func_80A325E4(this)) {
+ if (func_80A324E0(this, globalCtx)) {
+ this->unk_22C += 0x1000;
+ } else {
+ if (this->unk_21C != 0) {
+ func_80A3242C(this, 0);
+ }
+ this->unk_206 = 3;
+ this->actionFunc = func_80A32A40;
+ }
+ }
+}
+
+void func_80A32A40(EnPr* this, GlobalContext* globalCtx) {
+ Vec3f sp34;
+ WaterBox* sp30;
+
+ Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
+ sp34.y = randPlusMinusPoint5Scaled(50.0f) + this->actor.home.pos.y;
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->unk_2B4, &sp30)) {
+ if (sp34.y < (this->unk_2B4 - 30.0f)) {
+ this->unk_2B8 = sp34.y;
+ } else {
+ this->unk_2B8 = this->unk_2B4 - 30.0f;
+ }
+ }
+
+ this->unk_206 = 0;
+ this->actionFunc = func_80A32740;
+}
+
+void func_80A32AF8(EnPr* this) {
+ this->unk_206 = 4;
+ this->skelAnime.playSpeed = 2.0f;
+ this->actionFunc = func_80A32B20;
+}
+
+void func_80A32B20(EnPr* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ this->actor.speedXZ = BREG(57) + 3.0f;
+ Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51));
+ this->unk_2B8 = D_80A338C0[(void)0, gSaveContext.playerForm] + player->actor.world.pos.y;
+ func_80A324E0(this, globalCtx);
+
+ if (!(player->stateFlags1 & 0x8000000)) {
+ this->skelAnime.playSpeed = 1.0f;
+ this->actor.speedXZ = 1.0f;
+ func_80A32854(this);
+ } else if (this->unk_2C8 < sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) +
+ SQ(player->actor.world.pos.z - this->actor.home.pos.z))) {
+ this->skelAnime.playSpeed = 1.0f;
+ this->actor.speedXZ = 1.0f;
+ func_80A32854(this);
+ } else if (!func_80A325E4(this) && (this->actor.xzDistToPlayer < 200.0f) &&
+ (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 80.0f)) {
+ this->skelAnime.playSpeed = 1.0f;
+ func_80A32CDC(this);
+ }
+}
+
+void func_80A32CDC(EnPr* this) {
+ func_80A3242C(this, 3);
+ this->unk_206 = 5;
+ this->unk_20A = 400;
+ this->unk_2C0 = 0.0f;
+ this->actionFunc = func_80A32D28;
+}
+
+void func_80A32D28(EnPr* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (!(player->stateFlags1 & 0x8000000)) {
+ this->skelAnime.playSpeed = 1.0f;
+ this->actor.speedXZ = 1.0f;
+ func_80A32854(this);
+ } else {
+ Math_SmoothStepToS(&this->unk_22C, this->actor.yawTowardsPlayer, BREG(49) + 1, BREG(50) + 1000, BREG(51));
+ func_80A325E4(this);
+ this->unk_2B8 = D_80A338C0[(void)0, gSaveContext.playerForm] + player->actor.world.pos.y;
+ func_80A324E0(this, globalCtx);
+ if (this->unk_2C8 < sqrtf(SQ(player->actor.world.pos.x - this->actor.home.pos.x) +
+ SQ(player->actor.world.pos.z - this->actor.home.pos.z))) {
+ this->skelAnime.playSpeed = 1.0f;
+ this->actor.speedXZ = 1.0f;
+ func_80A32854(this);
+ }
+ }
+}
+
+void func_80A32E60(EnPr* this) {
+ func_80A3242C(this, 4);
+ this->unk_206 = 6;
+ this->actor.speedXZ = 0.0f;
+ this->actionFunc = func_80A32EA4;
+}
+
+void func_80A32EA4(EnPr* this, GlobalContext* globalCtx) {
+ f32 curFrame = this->skelAnime.curFrame;
+
+ if (this->unk_2BC <= curFrame) {
+ if (this->actor.colChkInfo.health <= 0) {
+ this->unk_206 = 7;
+ this->unk_20A = 50;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->unk_2C4 = 0.0f;
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEWALK_DEAD);
+ this->unk_216 = 0;
+ this->actionFunc = func_80A32F48;
+ } else {
+ func_80A326F0(this);
+ }
+ }
+}
+
+void func_80A32F48(EnPr* this, GlobalContext* globalCtx) {
+ WaterBox* sp2C;
+
+ if (this->unk_208 > 0) {
+ this->unk_208 -= 2;
+ } else {
+ this->unk_208 = 0;
+ }
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->unk_2B4, &sp2C)) {
+ if ((this->unk_2B4 - 100.0f) < this->actor.world.pos.y) {
+ this->unk_212 += 0xBB8;
+ this->unk_2C4 = 2.0f * Math_SinS(this->unk_212);
+ }
+ Math_ApproachF(&this->actor.world.pos.y, (this->unk_2B4 - 16.0f) + this->unk_2C4, 0.5f, 2.0f);
+ Math_SmoothStepToS(&this->actor.world.rot.z, 0x7700, 0x12C, 0x3E8, 0x3E8);
+ }
+
+ if ((this->unk_20A == 0) && (this->unk_208 == 0)) {
+ this->unk_2D2 = 1;
+ }
+
+ if (this->unk_2D2 != 0) {
+ Math_SmoothStepToS(&this->unk_2D0, 0, 1, 15, 50);
+ if (this->unk_2D0 < 2) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ }
+}
+
+void func_80A33098(EnPr* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if ((this->unk_206 != 7) && (this->unk_206 != 6)) {
+ if (this->collider.base.acFlags & AC_HIT) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ if (this->actor.colChkInfo.damageEffect == 4) {
+ this->unk_22E = 40;
+ this->unk_230 = 20;
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.focus.pos.x,
+ this->actor.focus.pos.y, this->actor.focus.pos.z, 0, 0, 0, CLEAR_TAG_LARGE_LIGHT_RAYS);
+ }
+
+ if ((player->stateFlags1 & 0x8000000) && (this->actor.colChkInfo.damageEffect == 5)) {
+ this->unk_22E = 40;
+ this->unk_230 = 31;
+ }
+
+ if ((this->unk_206 != 6) && (this->unk_206 != 7)) {
+ Actor_ApplyDamage(&this->actor);
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_BUBLEWALK_DAMAGE);
+ func_80A32E60(this);
+ }
+ }
+ }
+}
+
+void EnPr_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnPr* this = THIS;
+ s32 i;
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if (this->unk_20A != 0) {
+ this->unk_20A--;
+ }
+
+ if (this->unk_20E != 0) {
+ this->unk_20E--;
+ }
+
+ if (this->unk_20C != 0) {
+ this->unk_20C--;
+ }
+
+ if (this->unk_210 != 0) {
+ this->unk_210--;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ Actor_SetFocus(&this->actor, 20.0f);
+ func_80A33098(this, globalCtx);
+ Math_Vec3f_Copy(&this->unk_2E0, &this->actor.world.pos);
+
+ this->unk_2E0.x += (Math_SinS(this->actor.world.rot.y) * 70.0f);
+ this->unk_2E0.y = this->unk_2D4.y - 10.0f;
+ this->unk_2E0.z += Math_CosS(this->actor.world.rot.y) * 70.0f;
+
+ Math_SmoothStepToS(&this->unk_214, this->unk_216, 1, 0x7D0, 0);
+
+ if (this->unk_210 == 0) {
+ this->unk_210 = Rand_S16Offset(10, 30);
+ this->unk_204 = 1;
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+
+ if (this->unk_206 != 7) {
+ Vec3f sp50;
+ s16 pitch;
+
+ Math_ApproachF(&this->actor.world.pos.y, this->unk_2B8, 0.3f, BREG(11) + 1.0f);
+ Math_Vec3f_Copy(&sp50, &this->actor.world.pos);
+ sp50.y = this->unk_2B8;
+ pitch = Math_Vec3f_Pitch(&this->actor.world.pos, &sp50) * 0.3f;
+
+ if (fabsf(this->actor.world.pos.y - this->unk_2B8) > 8.0f) {
+ Math_SmoothStepToS(&this->actor.world.rot.x, pitch, 1, BREG(48) + 500, 0);
+ } else {
+ Math_SmoothStepToS(&this->actor.world.rot.x, 0, 1, BREG(52) + 500, 0);
+ }
+ }
+
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 30.0f, 20.0f, 0x1D);
+ Math_Vec3s_Copy(&this->actor.shape.rot, &this->actor.world.rot);
+
+ if (this->unk_206 != 7) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+
+ if (this->unk_204 != 0) {
+ Vec3f sp40;
+
+ Math_Vec3f_Copy(&sp40, &this->unk_2D4);
+ this->unk_204 = 0;
+ sp40.x += randPlusMinusPoint5Scaled(20.0f);
+ sp40.y += randPlusMinusPoint5Scaled(5.0f);
+ sp40.z += randPlusMinusPoint5Scaled(20.0f);
+
+ for (i = 0; i < (s32)Rand_ZeroFloat(5.0f) + 5; i++) {
+ EffectSsBubble_Spawn(globalCtx, &sp40, 0.0f, 5.0f, 5.0f, Rand_ZeroFloat(0.03f) + 0.07f);
+ }
+ }
+ }
+}
+
+s32 EnPr_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnPr* this = THIS;
+
+ if (limbIndex == 2) {
+ rot->y += this->unk_214;
+ }
+ return false;
+}
+
+void EnPr_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ Vec3f sp24 = { 0.0f, 0.0f, 0.0f };
+ EnPr* this = THIS;
+
+ if (limbIndex == 2) {
+ Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_MultiplyVector3fByState(&sp24, &this->unk_2D4);
+ }
+
+ if ((limbIndex == 0) || (limbIndex == 1) || (limbIndex == 2) || (limbIndex == 3) || (limbIndex == 4) ||
+ (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 9)) {
+ Matrix_GetStateTranslation(&this->unk_23C[this->unk_228]);
+ this->unk_228++;
+ if (this->unk_228 >= ARRAY_COUNT(this->unk_23C)) {
+ this->unk_228 = 0;
+ }
+ }
+}
+
+void EnPr_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ if (this->unk_2D2 == 0) {
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->unk_208, this->unk_208, this->unk_208, this->unk_2D0);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->unk_2D0);
+
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnPr_OverrideLimbDraw, EnPr_PostLimbDraw, &this->actor);
+ } else {
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_2D0);
+
+ Scene_SetRenderModeXlu(globalCtx, 1, 2);
+ POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, NULL, &this->actor, POLY_XLU_DISP);
+ }
+
+ if (this->unk_22E != 0) {
+ f32 temp = this->unk_22E * 0.05f;
+
+ this->unk_238 = 0.8f;
+ this->unk_234 = 0.8f;
+ func_800BE680(globalCtx, &this->actor, this->unk_23C, 10, 0.8f, 0.8f, temp, this->unk_230);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Pr/z_en_pr.h b/src/overlays/actors/ovl_En_Pr/z_en_pr.h
index fb2a1c8a2b..6506c0d74d 100644
--- a/src/overlays/actors/ovl_En_Pr/z_en_pr.h
+++ b/src/overlays/actors/ovl_En_Pr/z_en_pr.h
@@ -7,11 +7,51 @@ struct EnPr;
typedef void (*EnPrActionFunc)(struct EnPr*, GlobalContext*);
+#define ENPR_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
+
+#define ENPR_FF00_MAX 20
+#define ENPR_FF00_MIN 0
+
typedef struct EnPr {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xBC];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[10];
+ /* 0x01C4 */ Vec3s morphTable[10];
/* 0x0200 */ EnPrActionFunc actionFunc;
- /* 0x0204 */ char unk_204[0x144];
+ /* 0x0204 */ u8 unk_204;
+ /* 0x0206 */ s16 unk_206;
+ /* 0x0208 */ s16 unk_208;
+ /* 0x020A */ s16 unk_20A;
+ /* 0x020C */ s16 unk_20C;
+ /* 0x020E */ s16 unk_20E;
+ /* 0x0210 */ s16 unk_210;
+ /* 0x0212 */ s16 unk_212;
+ /* 0x0214 */ s16 unk_214;
+ /* 0x0216 */ s16 unk_216;
+ /* 0x0218 */ UNK_TYPE1 unk218[4];
+ /* 0x021C */ s32 unk_21C;
+ /* 0x0220 */ UNK_TYPE1 unk220[0x8];
+ /* 0x0228 */ s32 unk_228;
+ /* 0x022C */ s16 unk_22C;
+ /* 0x022E */ s16 unk_22E;
+ /* 0x0230 */ s16 unk_230;
+ /* 0x0234 */ f32 unk_234;
+ /* 0x0238 */ f32 unk_238;
+ /* 0x023C */ Vec3f unk_23C[10];
+ /* 0x02B4 */ f32 unk_2B4;
+ /* 0x02B8 */ f32 unk_2B8;
+ /* 0x02BC */ f32 unk_2BC;
+ /* 0x02C0 */ f32 unk_2C0;
+ /* 0x02C4 */ f32 unk_2C4;
+ /* 0x02C8 */ f32 unk_2C8;
+ /* 0x02CC */ f32 unk_2CC;
+ /* 0x02D0 */ s16 unk_2D0;
+ /* 0x02D2 */ s16 unk_2D2;
+ /* 0x02D4 */ Vec3f unk_2D4;
+ /* 0x02E0 */ Vec3f unk_2E0;
+ /* 0x02EC */ UNK_TYPE1 unk2EC[0xC];
+ /* 0x02F8 */ Actor* unk_2F8;
+ /* 0x02FC */ ColliderCylinder collider;
} EnPr; // size = 0x348
extern const ActorInit En_Pr_InitVars;
diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
index b1ef7eacad..6fa76d817b 100644
--- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
+++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.c
@@ -5,8 +5,10 @@
*/
#include "z_en_pr2.h"
+#include "objects/object_pr/object_pr.h"
+#include "overlays/actors/ovl_En_Encount1/z_en_encount1.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnPr2*)thisx)
@@ -15,9 +17,16 @@ void EnPr2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnPr2_Update(Actor* thisx, GlobalContext* globalCtx);
void EnPr2_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
-// static DamageTable sDamageTable = {
-static DamageTable D_80A75BC0 = {
+void func_80A745C4(EnPr2* this);
+void func_80A745FC(EnPr2* this, GlobalContext* globalCtx);
+void func_80A74888(EnPr2* this);
+void func_80A748E8(EnPr2* this, GlobalContext* globalCtx);
+void func_80A74DEC(EnPr2* this, GlobalContext* globalCtx);
+void func_80A74E90(EnPr2* this, GlobalContext* globalCtx);
+void func_80A751B4(EnPr2* this);
+void func_80A75310(EnPr2* this, GlobalContext* globalCtx);
+
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(0, 0x0),
/* Deku Stick */ DMG_ENTRY(0, 0x0),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -52,10 +61,23 @@ static DamageTable D_80A75BC0 = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80A75BE0 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_1, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x08, 0x04 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_1,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x08, 0x04 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 17, 32, -10, { 0, 0, 0 } },
};
@@ -71,48 +93,668 @@ const ActorInit En_Pr2_InitVars = {
(ActorFunc)EnPr2_Draw,
};
-#endif
+static AnimationHeader* sAnimations[] = {
+ &object_pr_Anim_004340,
+ &object_pr_Anim_004274,
+ &object_pr_Anim_003904,
+};
-extern DamageTable D_80A75BC0;
-extern ColliderCylinderInit D_80A75BE0;
+u8 D_80A75C38[] = { 0, 0, 2, 0 };
-extern UNK_TYPE D_06003904;
-extern UNK_TYPE D_06004340;
+s16 D_80A75C3C[] = {
+ 0x00, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/EnPr2_Init.s")
+void EnPr2_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/EnPr2_Destroy.s")
+ this->actor.targetMode = 3;
+ this->actor.hintId = 0x5B;
+ this->unk_1EC = 255;
+ this->actor.colChkInfo.health = 1;
+ this->actor.colChkInfo.damageTable = &sDamageTable;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A7429C.s")
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_pr_Skel_004188, &object_pr_Anim_004340, this->jointTable,
+ this->morphtable, 5);
+ this->unk_1E0 = ENPR2_GET_F(&this->actor);
+ this->actor.colChkInfo.mass = 10;
+ Math_Vec3f_Copy(&this->unk_228, &this->actor.home.pos);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A7436C.s")
+ if (this->unk_1E0 == 2) {
+ this->unk_208 = ENPR2_GET_FF0(&this->actor) * 20.0f;
+ }
+ this->unk_1F4 = 255;
+ this->actor.shape.yOffset = 500.0f;
+ this->actor.shape.shadowScale = 12.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A74510.s")
+ if (this->unk_1E0 < 10) {
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 19.0f);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->unk_218 = -1;
+ this->unk_204 = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A745C4.s")
+ if (this->actor.parent != NULL) {
+ Actor* parent = this->actor.parent;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A745FC.s")
+ if (parent->update != NULL) {
+ if (parent->world.rot.y != 0) {
+ this->unk_218 = parent->world.rot.y - 1;
+ }
+ }
+ } else if (this->actor.world.rot.z != 0) {
+ this->unk_218 = this->actor.world.rot.z - 1;
+ this->actor.world.rot.z = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A74888.s")
+ if (this->unk_1E0 == 3) {
+ if (this->actor.parent != NULL) {
+ Actor* parent = this->actor.parent;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A748E8.s")
+ if (parent->update != NULL) {
+ this->unk_1C8 = ((EnEncount1*)parent)->unk_15A;
+ this->path = func_8013D648(globalCtx, this->unk_1C8, 0x3F);
+ this->unk_208 = parent->world.rot.z * 20.0f;
+ if (this->unk_208 < 20.0f) {
+ this->unk_208 = 20.0f;
+ }
+ }
+ func_80A745C4(this);
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else {
+ func_80A74888(this);
+ }
+ } else {
+ this->unk_204 = 0.02f;
+ func_80A751B4(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A74DEC.s")
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 20.0f, 20.0f, 0x1D);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A74E90.s")
+ if (!(this->actor.bgCheckFlags & 0x60)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A751B4.s")
+void EnPr2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A75310.s")
+ if (this->unk_1E0 < 10) {
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A755D8.s")
+ if (this->actor.parent != NULL) {
+ Actor* parent = this->actor.parent;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/EnPr2_Update.s")
+ if ((parent->update != NULL) && (((EnEncount1*)parent)->unk_14E > 0)) {
+ ((EnEncount1*)parent)->unk_14E--;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A758E8.s")
+s32 func_80A7429C(EnPr2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s16 sp1A;
+ s16 sp18;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A75950.s")
+ Actor_GetScreenPos(globalCtx, &this->actor, &sp1A, &sp18);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/func_80A759D8.s")
+ if ((fabsf(player->actor.world.pos.y - this->actor.world.pos.y) > 160.0f) ||
+ (this->actor.projectedPos.z < -40.0f) || (sp1A < 0) || (sp1A > 320) || (sp18 < 0) || (sp18 > 240)) {
+ return false;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Pr2/EnPr2_Draw.s")
+ if (!(player->stateFlags1 & 0x8000000)) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+void func_80A7436C(EnPr2* this, s16 arg1) {
+ s16 sp2E = arg1 - this->actor.world.rot.y;
+
+ if (sp2E > 10000) {
+ sp2E = 10000;
+ } else if (sp2E < -10000) {
+ sp2E = -10000;
+ }
+
+ Math_ApproachF(&this->actor.world.pos.y, this->unk_21C.y, 0.3f, 5.0f);
+
+ if (fabsf(this->actor.world.pos.y - this->unk_21C.y) > 10.0f) {
+ Math_SmoothStepToS(&this->actor.world.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_21C) * 0.3f,
+ 20, 5000, 500);
+ } else {
+ Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 5000, 500);
+ }
+
+ if (fabsf(this->actor.world.rot.y - arg1) < 30.0f) {
+ Math_ApproachZeroF(&this->unk_1FC, 0.5f, 20.0f);
+ } else {
+ Math_ApproachF(&this->unk_1FC, sp2E, 0.5f, 3000.0f);
+ }
+
+ Math_SmoothStepToS(&this->actor.world.rot.y, arg1, 1, 2000, 300);
+}
+
+void func_80A74510(EnPr2* this, s32 arg0) {
+ f32 sp34 = 1.0f;
+
+ this->unk_210 = arg0;
+ this->unk_1F8 = Animation_GetLastFrame(sAnimations[arg0]);
+ if (this->unk_210 == 3) {
+ sp34 = 0.0f;
+ }
+ Animation_Change(&this->skelAnime, sAnimations[arg0], sp34, 0.0f, this->unk_1F8, D_80A75C38[arg0], 0.0f);
+}
+
+void func_80A745C4(EnPr2* this) {
+ func_80A74510(this, 0);
+ this->unk_1D4 = 0;
+ this->actionFunc = func_80A745FC;
+}
+
+void func_80A745FC(EnPr2* this, GlobalContext* globalCtx) {
+ f32 x;
+ f32 y;
+ f32 z;
+ f32 sqrtXYZ;
+
+ if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 200.0f) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG);
+ Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
+
+ if (this->path->unk2 < this->unk_1D0) {
+ Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f);
+ } else {
+ Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.3f, 1.0f);
+ }
+
+ if ((this->path != NULL) && !func_8013D68C(this->path, this->unk_1D0, &this->unk_21C)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+
+ Math_ApproachF(&this->actor.world.pos.y, this->unk_21C.y, 0.3f, 5.0f);
+
+ if (fabsf(this->actor.world.pos.y - this->unk_21C.y) > 10.0f) {
+ Math_SmoothStepToS(&this->actor.world.rot.x, Math_Vec3f_Pitch(&this->actor.world.pos, &this->unk_21C) * 0.3f,
+ 20, 5000, 500);
+ } else {
+ Math_SmoothStepToS(&this->actor.world.rot.x, 0, 20, 5000, 500);
+ }
+
+ x = this->actor.world.pos.x - this->unk_21C.x;
+ y = this->actor.world.pos.y - this->unk_21C.y;
+ z = this->actor.world.pos.z - this->unk_21C.z;
+ sqrtXYZ = sqrtf(SQ(x) + SQ(y) + SQ(z));
+
+ if (sqrtXYZ < (Rand_ZeroFloat(20.0f) + 15.0f)) {
+ this->unk_1D0++;
+ Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
+ if (this->unk_1D0 >= this->path->count) {
+ this->unk_1E0 = 2;
+ func_80A74888(this);
+ }
+ }
+
+ this->unk_1EE = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_21C);
+ func_80A7436C(this, this->unk_1EE);
+}
+
+void func_80A74888(EnPr2* this) {
+ func_80A74510(this, 0);
+ this->unk_1DA = 2;
+ this->unk_1D8 = 0;
+ Math_Vec3f_Copy(&this->unk_21C, &this->unk_228);
+ this->unk_1D4 = 1;
+ this->actionFunc = func_80A748E8;
+}
+
+void func_80A748E8(EnPr2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 temp_f12;
+ f32 temp_f2;
+ f32 sqrtXZ;
+ s32 sp4C = false;
+ s32 sp48 = false;
+ Vec3f sp3C;
+
+ Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_EXIST - SFX_FLAG);
+
+ if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 200.0f) {
+ sp48 = true;
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ if (this->unk_1F4 != 255) {
+ this->actor.speedXZ = 0.0f;
+ Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100);
+ if (this->unk_1F4 < 2) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else {
+ switch (this->unk_1E0) {
+ case 1:
+ if (this->unk_1DC == 0) {
+ sp4C = true;
+ func_80A74DEC(this, globalCtx);
+ } else if (!func_80A7429C(this, globalCtx) && (this->unk_1F4 == 255)) {
+ this->unk_1F4 = 254;
+ }
+ break;
+
+ case 2:
+ if (this->unk_1DE == 0) {
+ temp_f2 = player->actor.world.pos.x - this->unk_228.x;
+ temp_f12 = player->actor.world.pos.z - this->unk_228.z;
+ sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12));
+
+ if (sp48 && (player->stateFlags1 & 0x8000000) && (sqrtXZ < this->unk_208)) {
+ sp4C = true;
+ func_80A74DEC(this, globalCtx);
+ }
+ } else {
+ temp_f2 = this->actor.world.pos.x - this->unk_228.x;
+ temp_f12 = this->actor.world.pos.z - this->unk_228.z;
+ sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12));
+
+ if (sqrtXZ > 20.0f) {
+ this->unk_1DE = 5;
+ sp4C = true;
+ this->unk_1DC = 0;
+ Math_Vec3f_Copy(&this->unk_21C, &this->unk_228);
+ Math_ApproachF(&this->actor.speedXZ, 3.0f, 0.3f, 0.2f);
+ }
+ }
+ break;
+ }
+
+ if (!sp4C) {
+ this->unk_21C.y = this->actor.world.pos.y;
+ if (this->unk_1DA != 0) {
+ if ((Rand_ZeroOne() < 0.3f) && !this->unk_1D6) {
+ this->unk_1D6 = true;
+ }
+
+ Math_ApproachZeroF(&this->actor.speedXZ, 0.1f, 0.2f);
+
+ if (this->unk_1DA == 1) {
+ this->unk_1D8 = Rand_S16Offset(100, 100);
+ Math_Vec3f_Copy(&sp3C, &this->unk_228);
+ sp3C.x += randPlusMinusPoint5Scaled(300.0f);
+ sp3C.z += randPlusMinusPoint5Scaled(300.0f);
+ Math_Vec3f_Copy(&this->unk_21C, &sp3C);
+ }
+ } else {
+ Math_ApproachF(&this->actor.speedXZ, 2.0f, 0.3f, 0.2f);
+ Math_Vec3f_Copy(&sp3C, &this->actor.world.pos);
+ sp3C.x += Math_SinS(this->actor.world.rot.y) * 20.0f;
+ sp3C.z += Math_CosS(this->actor.world.rot.y) * 20.0f;
+ if (fabsf(this->actor.world.rot.y - this->unk_1EE) < 100.0f) {
+ if (BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &sp3C, 20.0f) || (this->actor.bgCheckFlags & 8)) {
+ this->unk_1DC = 0;
+ this->unk_1F2++;
+ Math_Vec3f_Copy(&this->unk_21C, &this->unk_228);
+ if (this->unk_1F2 > 10) {
+ this->unk_1F0 += 0x2000;
+ }
+ } else {
+ Math_SmoothStepToS(&this->unk_1F0, 0, 1, 1000, 100);
+ this->unk_1F2 = 0;
+ }
+ }
+
+ if ((this->unk_1D8 == 0) || ((fabsf(this->unk_21C.x - this->actor.world.pos.x) < 10.0f) &&
+ (fabsf(this->unk_21C.z - this->actor.world.pos.z) < 10.0f))) {
+ this->unk_1DA = Rand_S16Offset(20, 30);
+ }
+ }
+ }
+
+ if (this->unk_1DA == 0) {
+ this->unk_1EE = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_21C) + this->unk_1F0;
+ func_80A7436C(this, this->unk_1EE);
+ }
+ }
+}
+
+void func_80A74DEC(EnPr2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ this->unk_1F0 = 0;
+ func_80A74510(this, 1);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_ATTACK);
+ Math_Vec3f_Copy(&this->unk_21C, &player->actor.world.pos);
+
+ this->unk_1EE = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_21C);
+ this->unk_20C = Rand_ZeroFloat(30.0f);
+ this->unk_1DC = 0;
+ this->unk_1D8 = 70;
+ this->unk_1D4 = 2;
+ this->actionFunc = func_80A74E90;
+}
+
+void func_80A74E90(EnPr2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ WaterBox* sp40;
+
+ Math_ApproachF(&this->unk_204, 0.02f, 0.1f, 0.005f);
+ if ((this->unk_1D8 == 0) || !(player->stateFlags1 & 0x8000000) || (this->unk_1E0 == 0)) {
+ func_80A74888(this);
+ return;
+ }
+
+ if (this->unk_1F4 != 255) {
+ this->actor.speedXZ = 0.0f;
+ Math_SmoothStepToS(&this->unk_1F4, 0, 1, 30, 100);
+ if (this->unk_1F4 < 2) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else {
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((this->unk_1DC == 0) && (fabsf(this->actor.world.rot.y - this->unk_1EE) < 200.0f)) {
+ Math_Vec3f_Copy(&this->unk_21C, &player->actor.world.pos);
+ }
+
+ if ((Rand_ZeroOne() < 0.3f) && !this->unk_1D6) {
+ this->unk_1D6 = true;
+ this->unk_20C = Rand_ZeroFloat(30.0f);
+ }
+
+ this->unk_21C.y = player->actor.world.pos.y + 30.0f + this->unk_20C;
+ Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.3f, 1.0f);
+ this->unk_1F0 = 0;
+
+ if (this->unk_1E0 == 2) {
+ f32 temp_f2 = this->actor.world.pos.x - this->unk_228.x;
+ f32 temp_f12 = this->actor.world.pos.z - this->unk_228.z;
+ f32 sqrtXZ = sqrtf(SQ(temp_f2) + SQ(temp_f12));
+
+ if (this->unk_208 < sqrtXZ) {
+ this->unk_1DE = 20;
+ func_80A74888(this);
+ return;
+ }
+ } else {
+ Math_Vec3f_Copy(&this->unk_228, &this->actor.world.pos);
+ }
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->unk_200, &sp40)) {
+ if ((this->unk_200 - 40.0f) < this->unk_21C.y) {
+ this->unk_21C.y = this->unk_200 - 40.0f;
+ }
+ }
+
+ if ((this->unk_1E0 == 1) && !func_80A7429C(this, globalCtx)) {
+ if (this->unk_1F4 == 255) {
+ this->unk_1F4 = 254;
+ }
+ } else {
+ if (this->collider.base.atFlags & AT_HIT) {
+ this->unk_1DC = Rand_S16Offset(30, 30);
+ this->unk_1D8 = 100;
+ if (this->unk_1E0 != 2) {
+ func_80A74888(this);
+ }
+ }
+ this->unk_1EE = Math_Vec3f_Yaw(&this->actor.world.pos, &this->unk_21C);
+ func_80A7436C(this, this->unk_1EE);
+ }
+ }
+}
+
+void func_80A751B4(EnPr2* this) {
+ this->unk_1EC = 0;
+ this->actor.flags |= ACTOR_FLAG_8000000;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ if (this->unk_1E0 < 10) {
+ func_80A74510(this, 2);
+ } else {
+ this->unk_1F8 = Animation_GetLastFrame(&object_pr_Anim_003904);
+ Animation_Change(&this->skelAnime, &object_pr_Anim_003904, 1.0f, this->unk_1F8, this->unk_1F8, 2, 0.0f);
+ this->unk_1D8 = Rand_S16Offset(20, 30);
+ this->unk_1E4 = 0x4000;
+ if (Rand_ZeroOne() < 0.5f) {
+ this->unk_1E4 = -0x4000;
+ }
+ this->unk_1E6 = this->actor.world.rot.y;
+ this->actor.shape.rot.x = this->actor.world.rot.x;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actor.shape.rot.z = this->actor.world.rot.z;
+ this->unk_1D8 = 30;
+ this->actor.speedXZ = Rand_ZeroFloat(0.5f);
+ this->actor.world.rot.y = randPlusMinusPoint5Scaled(0x8000);
+ }
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 10);
+ this->unk_1D4 = 3;
+ this->actionFunc = func_80A75310;
+}
+
+void func_80A75310(EnPr2* this, GlobalContext* globalCtx) {
+ s32 temp;
+ f32 frame;
+ WaterBox* sp74;
+
+ SkelAnime_Update(&this->skelAnime);
+ if (this->unk_1E0 < 10) {
+ s32 i;
+
+ frame = this->skelAnime.curFrame;
+
+ if (this->unk_1F8 <= frame) {
+ for (i = 0; i < ARRAY_COUNT(this->unk_234); i++) {
+ Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_PR2, this->unk_234[i].x, this->unk_234[i].y,
+ this->unk_234[i].z, this->actor.world.rot.x, this->actor.world.rot.y,
+ this->actor.world.rot.z, i + 10);
+ }
+
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else {
+ Vec3f sp64;
+
+ temp = false;
+ Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 5, 10000, 1000);
+ Math_SmoothStepToS(&this->actor.shape.rot.z, this->unk_1E4, 5, 10000, 1000);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_1E6, 5, 10000, 1000);
+
+ if ((Rand_ZeroOne() < 0.3f) && !this->unk_1D6) {
+ this->unk_1D6 = true;
+ }
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
+ &this->unk_200, &sp74)) {
+ frame = this->unk_200 - 15.0f;
+
+ if (frame <= this->actor.world.pos.y) {
+ temp = true;
+ } else {
+ Math_ApproachF(&this->actor.world.pos.y, frame, 0.3f, 1.0f);
+ }
+ }
+
+ if ((this->unk_1D8 == 0) || temp) {
+ s32 i;
+
+ Math_SmoothStepToS(&this->unk_1F4, 0, 1, 15, 50);
+
+ if (this->unk_1F4 < 2) {
+ for (i = 0; i < 10; i++) {
+ Math_Vec3f_Copy(&sp64, &this->actor.world.pos);
+
+ sp64.x += randPlusMinusPoint5Scaled(20.0f);
+ sp64.y += randPlusMinusPoint5Scaled(5.0f);
+ sp64.z += randPlusMinusPoint5Scaled(20.0f);
+ frame = Rand_ZeroFloat(0.03f) + 0.07f;
+
+ EffectSsBubble_Spawn(globalCtx, &sp64, 0.0f, 5.0f, 5.0f, frame);
+ }
+
+ Actor_MarkForDeath(&this->actor);
+ }
+ }
+ }
+}
+
+void func_80A755D8(EnPr2* this, GlobalContext* globalCtx) {
+ s32 temp_v0;
+
+ if (this->collider.base.acFlags & AC_HIT) {
+ Actor_ApplyDamage(&this->actor);
+ if ((this->actor.colChkInfo.health <= 0) && (this->unk_1D4 != 3)) {
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ this->actor.speedXZ = 0.0f;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_PIRANHA_DEAD);
+
+ if (this->unk_218 >= 0) {
+ Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, D_80A75C3C[this->unk_218]);
+ }
+
+ this->actor.colChkInfo.health = 0;
+ func_80A751B4(this);
+ }
+ }
+
+ if (this->collider.base.atFlags & AT_BOUNCED) {
+ this->actor.speedXZ = -10.0f;
+ }
+}
+
+void EnPr2_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr2* this = THIS;
+ f32 rand;
+
+ if (thisx) {}
+
+ Actor_SetScale(&this->actor, this->unk_204);
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_1DA != 0) {
+ this->unk_1DA--;
+ }
+
+ if (this->unk_1D8 != 0) {
+ this->unk_1D8--;
+ }
+
+ if (this->unk_1DC != 0) {
+ this->unk_1DC--;
+ }
+
+ if (this->unk_1DE != 0) {
+ this->unk_1DE--;
+ }
+
+ Actor_SetFocus(&this->actor, 10.0f);
+ func_80A755D8(this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0, 10.0f, 20.0f, 0x1F);
+
+ if (this->unk_1D6) {
+ s32 i;
+ Vec3f sp58;
+ f32 rand;
+
+ Math_Vec3f_Copy(&sp58, &this->unk_270);
+ this->unk_1D6 = false;
+
+ sp58.x += randPlusMinusPoint5Scaled(20.0f);
+ sp58.y += randPlusMinusPoint5Scaled(5.0f);
+ sp58.z += randPlusMinusPoint5Scaled(20.0f);
+
+ for (i = 0; i < 2; i++) {
+ rand = Rand_ZeroFloat(0.03f) + 0.07f;
+ EffectSsBubble_Spawn(globalCtx, &sp58, 0, 5.0f, 5.0f, rand);
+ }
+ }
+
+ if ((this->unk_1F4 == 255) && (this->unk_1E0 < 10)) {
+ this->actor.shape.rot.x = this->actor.world.rot.x;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->actor.shape.rot.z = this->actor.world.rot.z;
+ if (this->unk_1D4 != 3) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+ }
+}
+
+s32 func_80A758E8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnPr2* this = THIS;
+
+ if (this->unk_1E0 < 10) {
+ if (limbIndex == 2) {
+ rot->y += (s16)this->unk_1FC * -1;
+ }
+ } else if ((limbIndex + 10) != this->unk_1E0) {
+ *dList = NULL;
+ }
+ return false;
+}
+
+void func_80A75950(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnPr2* this = THIS;
+
+ if (this->unk_1E0 < 10) {
+ if (limbIndex == 2) {
+ Matrix_InsertTranslation(0.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_GetStateTranslation(&this->unk_270);
+ }
+ Matrix_GetStateTranslation(&this->unk_234[limbIndex]);
+ }
+}
+
+s32 func_80A759D8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ EnPr2* this = THIS;
+
+ if (this->unk_1E0 < 10) {
+ if (limbIndex == 2) {
+ rot->y += (s16)this->unk_1FC * -1;
+ }
+ } else if ((limbIndex + 10) != this->unk_1E0) {
+ *dList = NULL;
+ }
+ return false;
+}
+
+void EnPr2_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnPr2* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ if (this->unk_1F4 == 255) {
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, this->unk_1EC, this->unk_1EC, this->unk_1EC, 255);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->unk_1F4);
+
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, func_80A758E8, func_80A75950, &this->actor);
+ } else {
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1F4);
+
+ Scene_SetRenderModeXlu(globalCtx, 1, 2);
+ POLY_XLU_DISP =
+ SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, func_80A759D8, NULL, &this->actor, POLY_XLU_DISP);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h
index 68fb09b823..4ae14db77a 100644
--- a/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h
+++ b/src/overlays/actors/ovl_En_Pr2/z_en_pr2.h
@@ -7,11 +7,48 @@ struct EnPr2;
typedef void (*EnPr2ActionFunc)(struct EnPr2*, GlobalContext*);
+#define ENPR2_GET_F(thisx) ((thisx)->params & 0xF)
+#define ENPR2_GET_FF0(thisx) (((thisx)->params >> 4) & 0xFF)
+
typedef struct EnPr2 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x80];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[5];
+ /* 0x01A6 */ Vec3s morphtable[5];
/* 0x01C4 */ EnPr2ActionFunc actionFunc;
- /* 0x01C8 */ char unk_1C8[0x100];
+ /* 0x01C8 */ s16 unk_1C8;
+ /* 0x01CC */ Path* path;
+ /* 0x01D0 */ s32 unk_1D0;
+ /* 0x01D4 */ s16 unk_1D4;
+ /* 0x01D6 */ s16 unk_1D6;
+ /* 0x01D8 */ s16 unk_1D8;
+ /* 0x01DA */ s16 unk_1DA;
+ /* 0x01DC */ s16 unk_1DC;
+ /* 0x01DE */ s16 unk_1DE;
+ /* 0x01E0 */ s16 unk_1E0;
+ /* 0x01E2 */ UNK_TYPE1 unk1E2[2];
+ /* 0x01E4 */ s16 unk_1E4;
+ /* 0x01E6 */ s16 unk_1E6;
+ /* 0x01E8 */ UNK_TYPE1 unk1E8[4];
+ /* 0x01EC */ s16 unk_1EC;
+ /* 0x01EE */ s16 unk_1EE;
+ /* 0x01F0 */ s16 unk_1F0;
+ /* 0x01F2 */ s16 unk_1F2;
+ /* 0x01F4 */ s16 unk_1F4;
+ /* 0x01F8 */ f32 unk_1F8;
+ /* 0x01FC */ f32 unk_1FC;
+ /* 0x0200 */ f32 unk_200;
+ /* 0x0204 */ f32 unk_204;
+ /* 0x0208 */ f32 unk_208;
+ /* 0x020C */ f32 unk_20C;
+ /* 0x0210 */ s32 unk_210;
+ /* 0x0214 */ UNK_TYPE1 unk214[4];
+ /* 0x0218 */ s32 unk_218;
+ /* 0x021C */ Vec3f unk_21C;
+ /* 0x0228 */ Vec3f unk_228;
+ /* 0x0234 */ Vec3f unk_234[5];
+ /* 0x0270 */ Vec3f unk_270;
+ /* 0x027C */ ColliderCylinder collider;
} EnPr2; // size = 0x2C8
extern const ActorInit En_Pr2_InitVars;
diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.c b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
index 960340d7e9..f89204a151 100644
--- a/src/overlays/actors/ovl_En_Prz/z_en_prz.c
+++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.c
@@ -6,7 +6,7 @@
#include "z_en_prz.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnPrz*)thisx)
diff --git a/src/overlays/actors/ovl_En_Prz/z_en_prz.h b/src/overlays/actors/ovl_En_Prz/z_en_prz.h
index 396ed84aa4..a4e5840902 100644
--- a/src/overlays/actors/ovl_En_Prz/z_en_prz.h
+++ b/src/overlays/actors/ovl_En_Prz/z_en_prz.h
@@ -11,7 +11,9 @@ typedef struct EnPrz {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x80];
/* 0x01C4 */ EnPrzActionFunc actionFunc;
- /* 0x01C8 */ char unk_1C8[0xA8];
+ /* 0x01C8 */ char unk_1C8[0x58];
+ /* 0x0220 */ Actor* unk_220;
+ /* 0x0224 */ char unk_224[0x4C];
} EnPrz; // size = 0x270
extern const ActorInit En_Prz_InitVars;
diff --git a/src/overlays/actors/ovl_En_Pst/z_en_pst.c b/src/overlays/actors/ovl_En_Pst/z_en_pst.c
index df0355ce94..02a9ea7437 100644
--- a/src/overlays/actors/ovl_En_Pst/z_en_pst.c
+++ b/src/overlays/actors/ovl_En_Pst/z_en_pst.c
@@ -6,7 +6,7 @@
#include "z_en_pst.h"
-#define FLAGS 0x00000001
+#define FLAGS (ACTOR_FLAG_1)
#define THIS ((EnPst*)thisx)
diff --git a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
index 489fe63df0..34ba306528 100644
--- a/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
+++ b/src/overlays/actors/ovl_En_Racedog/z_en_racedog.c
@@ -6,7 +6,7 @@
#include "z_en_racedog.h"
-#define FLAGS 0x80000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
#define THIS ((EnRacedog*)thisx)
diff --git a/src/overlays/actors/ovl_En_Raf/z_en_raf.c b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
index 38fb9e9659..a328116202 100644
--- a/src/overlays/actors/ovl_En_Raf/z_en_raf.c
+++ b/src/overlays/actors/ovl_En_Raf/z_en_raf.c
@@ -6,7 +6,7 @@
#include "z_en_raf.h"
-#define FLAGS 0x08000000
+#define FLAGS (ACTOR_FLAG_8000000)
#define THIS ((EnRaf*)thisx)
diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c
index 8f15008106..b2850d7d1f 100644
--- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c
+++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c
@@ -8,7 +8,7 @@
#include "z_en_rail_skb.h"
#include "objects/object_skb/object_skb.h"
-#define FLAGS 0x00000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10)
#define THIS ((EnRailSkb*)thisx)
@@ -62,14 +62,20 @@ const ActorInit En_Rail_Skb_InitVars = {
(ActorFunc)EnRailSkb_Draw,
};
-static ActorAnimationEntry sAnimations[] = {
- { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -1.0f },
- { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0f },
- { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, 2, -4.0f }, { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, 0, -4.0f }, { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0f },
- { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, 2, -16.0f },
- { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, 2, -8.0f },
- { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, 0, -8.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_skb_Anim_0064E0, 0.96f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
+ { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
+ { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
+ { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
};
static ColliderJntSphElementInit sJntSphElementsInit[2] = {
@@ -290,8 +296,9 @@ void EnRailSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_3F8 = 0;
}
- if ((globalCtx->sceneNum == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) && (globalCtx->csCtx.unk_12 == 0)) {
- this->actor.flags |= 0x100000;
+ if ((globalCtx->sceneNum == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) &&
+ (globalCtx->csCtx.currentCsIndex == 0)) {
+ this->actor.flags |= ACTOR_FLAG_100000;
}
func_80B70FA0(this);
@@ -306,7 +313,7 @@ void EnRailSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80B70FA0(EnRailSkb* this) {
this->unk_3F2 = 0;
if (this->actionFunc != func_80B716A8) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
}
this->actionFunc = func_80B70FF8;
}
@@ -350,7 +357,7 @@ void func_80B7114C(EnRailSkb* this, GlobalContext* globalCtx) {
this->unk_2EC = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
this->unk_402 |= 1;
func_80B712FC(this);
@@ -374,7 +381,7 @@ void func_80B7123C(EnRailSkb* this, GlobalContext* globalCtx) {
this->unk_2EC = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
this->unk_402 |= 1;
func_80B712FC(this);
@@ -400,7 +407,7 @@ void func_80B71314(EnRailSkb* this, GlobalContext* globalCtx) {
void func_80B71354(EnRailSkb* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->actionFunc = func_80B713A4;
}
@@ -409,7 +416,7 @@ void func_80B713A4(EnRailSkb* this, GlobalContext* globalCtx) {
if ((this->actor.xzDistToPlayer > 65.0f) || (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN)) {
func_80B70FA0(this);
} else {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
}
}
@@ -422,7 +429,7 @@ void func_80B713A4(EnRailSkb* this, GlobalContext* globalCtx) {
void func_80B71488(EnRailSkb* this) {
this->unk_402 |= 0x40;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (this->unk_2E0 != 0) {
this->unk_2E4 = this->unk_2E0 - 1;
} else {
@@ -445,12 +452,12 @@ void func_80B7151C(EnRailSkb* this) {
this->actor.shape.yOffset = -5000.0f;
this->actor.colChkInfo.health = 2;
this->unk_402 = 0;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR);
this->actor.draw = EnRailSkb_Draw;
this->actor.shape.shadowAlpha = 0;
this->actor.shape.rot.y = this->actor.world.rot.y;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
this->actionFunc = func_80B715AC;
}
@@ -473,7 +480,7 @@ void func_80B715AC(EnRailSkb* this, GlobalContext* globalCtx) {
void func_80B71650(EnRailSkb* this) {
this->unk_3FE = 0;
if (this->actionFunc != func_80B70FF8) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
}
this->actionFunc = func_80B716A8;
}
@@ -483,14 +490,14 @@ void func_80B716A8(EnRailSkb* this, GlobalContext* globalCtx) {
this->unk_3FE = 1;
func_80B71D8C(this, globalCtx, func_80B723F8);
if (!func_80B7285C(this)) {
- func_801518B0(globalCtx, 0x13EC, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13EC, &this->actor);
this->unk_400 = 0x13EC;
func_80B72830(this, 1);
} else {
- func_801518B0(globalCtx, 0x13F5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F5, &this->actor);
this->unk_400 = 0x13F5;
}
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
func_80B717C8(this);
} else if ((this->actor.xzDistToPlayer < 100.0f) && !(this->collider.base.acFlags & AC_HIT)) {
func_800B8614(&this->actor, globalCtx, 100.0f);
@@ -552,7 +559,7 @@ void func_80B718C4(EnRailSkb* this, GlobalContext* globalCtx) {
}
void func_80B71910(EnRailSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80B71954;
}
@@ -570,7 +577,7 @@ void func_80B71954(EnRailSkb* this, GlobalContext* globalCtx) {
void func_80B71A08(EnRailSkb* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->actionFunc = func_80B71A58;
}
@@ -579,7 +586,7 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
if (this->unk_2E8 < this->unk_22C->actor.colChkInfo.health) {
this->unk_22C->actor.colChkInfo.health--;
} else {
@@ -602,7 +609,7 @@ void func_80B71A58(EnRailSkb* this, GlobalContext* globalCtx) {
void func_80B71B6C(EnRailSkb* this) {
this->unk_3F2 = 10;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80B71BB8;
}
@@ -635,7 +642,7 @@ void func_80B71BB8(EnRailSkb* this, GlobalContext* globalCtx) {
if ((sp34 < 50.0f) && (this->actor.bgCheckFlags & 1)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_ATTACK);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
this->actor.velocity.y = 10.0f;
for (i = 0; i < 4; i++) {
@@ -660,7 +667,7 @@ void func_80B71DF0(EnRailSkb* this) {
this->actor.shape.yOffset = -5000.0f;
this->actor.colChkInfo.health = 2;
this->unk_402 = 0;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.draw = EnRailSkb_Draw;
this->actor.shape.shadowAlpha = 0;
this->actor.shape.rot.y = this->actor.world.rot.y;
@@ -668,7 +675,7 @@ void func_80B71DF0(EnRailSkb* this) {
this->unk_3F0 = 0;
}
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
this->actionFunc = func_80B71EA8;
}
@@ -696,34 +703,34 @@ void func_80B71F3C(EnRailSkb* this, GlobalContext* globalCtx) {
if (func_80147624(globalCtx)) {
switch (this->unk_400) {
case 0x13EC:
- func_801518B0(globalCtx, 0x13ED, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13ED, &this->actor);
this->unk_400 = 0x13ED;
break;
case 0x13ED:
- func_801518B0(globalCtx, 0x13EE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13EE, &this->actor);
this->unk_400 = 0x13EE;
break;
case 0x13EE:
- func_801518B0(globalCtx, 0x13EF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13EF, &this->actor);
this->unk_400 = 0x13EF;
break;
case 0x13EF:
case 0x13F5:
- func_801518B0(globalCtx, 0x13F0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F0, &this->actor);
this->unk_400 = 0x13F0;
break;
case 0x13F1:
- func_801518B0(globalCtx, 0x13F2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F2, &this->actor);
this->unk_400 = 0x13F2;
break;
case 0x13F2:
if (this->unk_3FC == 1) {
- func_801518B0(globalCtx, 0x13F4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F4, &this->actor);
this->unk_400 = 0x13F4;
} else {
func_801477B4(globalCtx);
@@ -732,7 +739,7 @@ void func_80B71F3C(EnRailSkb* this, GlobalContext* globalCtx) {
break;
case 0x13F3:
- func_801518B0(globalCtx, 0x13F2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F2, &this->actor);
this->unk_400 = 0x13F2;
this->unk_3FC = 1;
break;
@@ -749,11 +756,11 @@ void func_80B72100(EnRailSkb* this, GlobalContext* globalCtx) {
if (func_80147624(globalCtx)) {
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- func_801518B0(globalCtx, 0x13F1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F1, &this->actor);
this->unk_400 = 0x13F1;
} else {
func_8019F208();
- func_801518B0(globalCtx, 0x13F3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F3, &this->actor);
this->unk_400 = 0x13F3;
}
}
@@ -816,9 +823,9 @@ void func_80B72190(EnRailSkb* this, GlobalContext* globalCtx) {
}
void func_80B723F8(EnRailSkb* this) {
- this->actor.flags &= ~(4 | 1);
- this->actor.flags |= (8 | 1);
- this->actor.flags |= 0x100000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.flags |= ACTOR_FLAG_100000;
this->actor.hintId = 0xFF;
this->actor.textId = 0;
}
@@ -917,17 +924,17 @@ void func_80B72880(EnRailSkb* this, GlobalContext* globalCtx) {
if ((this->actionFunc == func_80B70FF8) || (this->actionFunc == func_80B716A8)) {
if (this->actionFunc != func_80B716A8) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(4 | 1);
- this->actor.flags |= (8 | 1);
- this->actor.flags |= 0x100000;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.flags |= ACTOR_FLAG_100000;
this->actor.hintId = 0xFF;
this->actor.textId = 0;
func_80B71650(this);
}
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(8 | 1);
- this->actor.flags &= ~0x100000;
- this->actor.flags |= 5;
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.flags &= ~ACTOR_FLAG_100000;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
this->actor.hintId = 0x55;
this->actor.textId = 0;
func_80B70FA0(this);
@@ -994,7 +1001,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) {
this->unk_2F0 = 0.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->unk_402 |= 1;
func_80B712FC(this);
break;
@@ -1020,7 +1027,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) {
this->unk_2F0 = 0.5f;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
func_80B71228(this);
break;
@@ -1037,7 +1044,7 @@ void func_80B72970(EnRailSkb* this, GlobalContext* globalCtx) {
case 13:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
func_80B712FC(this);
break;
diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
index 16b8d4fe6d..39232befa9 100644
--- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
+++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.c
@@ -5,8 +5,9 @@
*/
#include "z_en_railgibud.h"
+#include "objects/object_rd/object_rd.h"
-#define FLAGS 0x00000415
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((EnRailgibud*)thisx)
@@ -15,59 +16,71 @@ void EnRailgibud_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnRailgibud_Update(Actor* thisx, GlobalContext* globalCtx);
void EnRailgibud_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_80BA57A8(EnRailgibud* this);
-void func_80BA57F8(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA59F0(EnRailgibud* this);
-void func_80BA5A34(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA5AF0(EnRailgibud* this);
-void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA5DBC(EnRailgibud* this);
-void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6054(EnRailgibud* this);
-void func_80BA60B0(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6158(EnRailgibud* this);
-void func_80BA61A0(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6284(EnRailgibud* this);
-void func_80BA62D4(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA64AC(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6604(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6664(EnRailgibud* this);
-void func_80BA66C8(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA6974(GlobalContext* globalCtx, Vec3f* vec, f32 arg2, s32 arg3, s16 arg4, s16 arg5);
-void func_80BA6B9C(EnRailgibud* this, GlobalContext* globalCtx);
-s32 func_80BA6D10(EnRailgibud* this, GlobalContext* globalCtx);
-s32 func_80BA6DAC(EnRailgibud* this, GlobalContext* globalCtx);
-s32 func_80BA7088(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA7578(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA7878(Actor* thisx, GlobalContext* globalCtx);
-void func_80BA7B6C(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA7C78(EnRailgibud* this);
-void func_80BA7CF0(EnRailgibud* this);
-void func_80BA7D04(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA7D30(EnRailgibud* this, GlobalContext* globalCtx);
-void func_80BA8050(Actor* thisx, GlobalContext* globalCtx);
+void EnRailgibud_SetupWalkInCircles(EnRailgibud* this);
+void EnRailgibud_WalkInCircles(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupAttemptPlayerFreeze(EnRailgibud* this);
+void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupWalkToPlayer(EnRailgibud* this);
+void EnRailgibud_WalkToPlayer(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupGrab(EnRailgibud* this);
+void EnRailgibud_Grab(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupGrabFail(EnRailgibud* this);
+void EnRailgibud_GrabFail(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupTurnAwayAndShakeHead(EnRailgibud* this);
+void EnRailgibud_TurnAwayAndShakeHead(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupWalkToHome(EnRailgibud* this);
+void EnRailgibud_WalkToHome(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_Damage(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_Stunned(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SetupDead(EnRailgibud* this);
+void EnRailgibud_Dead(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SpawnDust(GlobalContext* globalCtx, Vec3f* vec, f32 arg2, s32 arg3, s16 arg4, s16 arg5);
+void EnRailgibud_TurnTowardsPlayer(EnRailgibud* this, GlobalContext* globalCtx);
+s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, GlobalContext* globalCtx);
+s32 EnRailgibud_PlayerOutOfRange(EnRailgibud* this, GlobalContext* globalCtx);
+s32 EnRailgibud_MoveToIdealGrabPositionAndRotation(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_MainGibdo_DeadUpdate(Actor* thisx, GlobalContext* globalCtx);
+void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_InitActorActionCommand(EnRailgibud* this);
+void EnRailgibud_SetupDoNothing(EnRailgibud* this);
+void EnRailgibud_DoNothing(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_SinkIntoGround(EnRailgibud* this, GlobalContext* globalCtx);
+void EnRailgibud_Cutscene_Update(Actor* thisx, GlobalContext* globalCtx);
-extern AnimationHeader D_060009C4;
-extern AnimationHeader D_06000F1C;
-extern AnimationHeader D_06001600;
-extern FlexSkeletonHeader D_060053E8;
-extern AnimationHeader D_06005DF4;
-extern AnimationHeader D_060061E4;
-extern AnimationHeader D_06006678;
-extern AnimationHeader D_06006B08;
-extern AnimationHeader D_06006EEC;
-extern AnimationHeader D_060073A4;
-extern AnimationHeader D_06007BBC;
-extern AnimationHeader D_060081A8;
-extern AnimationHeader D_06009298;
-extern AnimationHeader D_06009900;
-extern AnimationHeader D_0600A450;
-extern AnimationHeader D_0600ABE0;
-extern FlexSkeletonHeader D_06010B88;
-extern AnimationHeader D_060113EC;
-extern AnimationHeader D_060118D8;
-extern AnimationHeader D_06011DB8;
-extern AnimationHeader D_0601216C;
+typedef enum {
+ /* 0 */ EN_RAILGIBUD_ANIMATION_GRAB_ATTACK,
+ /* 1 */ EN_RAILGIBUD_ANIMATION_GRAB_END,
+ /* 2 */ EN_RAILGIBUD_ANIMATION_GRAB_START,
+ /* 3 */ EN_RAILGIBUD_ANIMATION_LOOK_BACK,
+ /* 4 */ EN_RAILGIBUD_ANIMATION_CROUCH_WIPING_TEARS,
+ /* 5 */ EN_RAILGIBUD_ANIMATION_CROUCH_CRYING,
+ /* 6 */ EN_RAILGIBUD_ANIMATION_DEATH,
+ /* 7 */ EN_RAILGIBUD_ANIMATION_DAMAGE,
+ /* 8 */ EN_RAILGIBUD_ANIMATION_CROUCH_END,
+ /* 9 */ EN_RAILGIBUD_ANIMATION_IDLE,
+ /* 10 */ EN_RAILGIBUD_ANIMATION_WALK,
+ /* 11 */ EN_RAILGIBUD_ANIMATION_DANCE_SQUAT,
+ /* 12 */ EN_RAILGIBUD_ANIMATION_DANCE_PIROUETTE,
+ /* 13 */ EN_RAILGIBUD_ANIMATION_DANCE_CLAP,
+ /* 14 */ EN_RAILGIBUD_ANIMATION_CROUCH_END_2,
+ /* 15 */ EN_RAILGIBUD_ANIMATION_SLUMP_START,
+ /* 16 */ EN_RAILGIBUD_ANIMATION_SLUMP_LOOP,
+ /* 17 */ EN_RAILGIBUD_ANIMATION_CONVULSION,
+ /* 18 */ EN_RAILGIBUD_ANIMATION_ARMS_UP_START,
+ /* 19 */ EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP,
+} EnRailgibudAnimations;
+
+typedef enum {
+ /* 0 */ EN_RAILGIBUD_TYPE_GIBDO,
+ /* 1 */ EN_RAILGIBUD_TYPE_REDEAD,
+} EnRailgibudType;
+
+typedef enum {
+ /* 0 */ EN_RAILGIBUD_GRAB_START,
+ /* 1 */ EN_RAILGIBUD_GRAB_ATTACK,
+ /* 2 */ EN_RAILGIBUD_GRAB_RELEASE,
+} EnRailgibudGrabState;
const ActorInit En_Railgibud_InitVars = {
ACTOR_EN_RAILGIBUD,
@@ -81,17 +94,27 @@ const ActorInit En_Railgibud_InitVars = {
(ActorFunc)EnRailgibud_Draw,
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_06006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f },
- { &D_06006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f },
- { &D_06007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_06009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06009900, 1.0f, 0.0f, 0.0f, 2, -8.0f },
- { &D_0600A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_0600ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_060113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &D_0601216C, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_060118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_0600A450, 3.0f, 0.0f, 0.0f, 2, -6.0f }, { &D_06005DF4, 1.0f, 0.0f, 0.0f, 2, -8.0f },
- { &D_060061E4, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &D_06001600, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_060009C4, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06000F1C, 1.0f, 0.0f, 0.0f, 0, -8.0f },
+static AnimationInfo sAnimations[] = {
+ { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f },
+ { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadWipingTearsAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadSobbingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadDeathAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadDamageAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadWalkAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f },
+ { &gGibdoRedeadSquattingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadPirouetteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadClappingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadStandUpAnim, 3.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -6.0f },
+ { &gGibdoRedeadSlumpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadSlumpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadConvulsionAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadArmsUpStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadArmsUpLoopAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
};
static ColliderCylinderInit sCylinderInit = {
@@ -114,76 +137,98 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 70, 0, { 0, 0, 0 } },
};
+typedef enum {
+ /* 0x0 */ EN_RAILGIBUD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all
+ /* 0x1 */ EN_RAILGIBUD_DMGEFF_STUN, // Stuns without applying any effect
+ /* 0x2 */ EN_RAILGIBUD_DMGEFF_FIRE_ARROW, // Damages, applies a fire effect, and changes a Gibdo into a Redead
+ /* 0x4 */ EN_RAILGIBUD_DMGEFF_LIGHT_ARROW = 0x4, // Damages and applies a light effect
+ /* 0xC */ EN_RAILGIBUD_DMGEFF_ZORA_MAGIC = 0xC, // Stuns and applies an electric effect
+ /* 0xD */ EN_RAILGIBUD_DMGEFF_RECOIL, // Deals no damage, but displays hit mark and recoil animation
+ /* 0xE */ EN_RAILGIBUD_DMGEFF_LIGHT_RAY, // Instantly kills a Redead on contact
+ /* 0xF */ EN_RAILGIBUD_DMGEFF_DAMAGE, // Deals damage and plays the damage animation
+} EnRailgibudDamageEffect;
+
static DamageTable sDamageTable = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(2, 0xF),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(1, 0xF),
- /* Zora boomerang */ DMG_ENTRY(0, 0xD),
- /* Normal arrow */ DMG_ENTRY(0, 0xD),
- /* UNK_DMG_0x06 */ DMG_ENTRY(2, 0xF),
- /* Hookshot */ DMG_ENTRY(0, 0xD),
- /* Goron punch */ DMG_ENTRY(1, 0xF),
- /* Sword */ DMG_ENTRY(1, 0xF),
- /* Goron pound */ DMG_ENTRY(1, 0xF),
- /* Fire arrow */ DMG_ENTRY(1, 0x2),
- /* Ice arrow */ DMG_ENTRY(0, 0xD),
- /* Light arrow */ DMG_ENTRY(2, 0x4),
- /* Goron spikes */ DMG_ENTRY(1, 0xF),
- /* Deku spin */ DMG_ENTRY(0, 0x1),
- /* Deku bubble */ DMG_ENTRY(0, 0xD),
- /* Deku launch */ DMG_ENTRY(2, 0xF),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0xC),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0xE),
- /* Thrown object */ DMG_ENTRY(1, 0xF),
- /* Zora punch */ DMG_ENTRY(1, 0xF),
- /* Spin attack */ DMG_ENTRY(1, 0xF),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(1, 0xF),
+ /* Deku Nut */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Deku Stick */ DMG_ENTRY(2, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Horse trample */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Explosives */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Zora boomerang */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_RECOIL),
+ /* Normal arrow */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_RECOIL),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(2, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Hookshot */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_RECOIL),
+ /* Goron punch */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Sword */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Goron pound */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Fire arrow */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_FIRE_ARROW),
+ /* Ice arrow */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_RECOIL),
+ /* Light arrow */ DMG_ENTRY(2, EN_RAILGIBUD_DMGEFF_LIGHT_ARROW),
+ /* Goron spikes */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Deku spin */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_STUN),
+ /* Deku bubble */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_RECOIL),
+ /* Deku launch */ DMG_ENTRY(2, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Zora barrier */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_ZORA_MAGIC),
+ /* Normal shield */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Light ray */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_LIGHT_RAY),
+ /* Thrown object */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Zora punch */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Spin attack */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
+ /* Sword beam */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Normal Roll */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Unblockable */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, EN_RAILGIBUD_DMGEFF_NONE),
+ /* Powder Keg */ DMG_ENTRY(1, EN_RAILGIBUD_DMGEFF_DAMAGE),
};
static CollisionCheckInfoInit2 sColChkInfoInit = { 8, 0, 0, 0, MASS_IMMOVABLE };
-void func_80BA5400(EnRailgibud* this, GlobalContext* globalCtx) {
- static s32 D_80BA82F8 = 0;
- s32 phi_a3;
- Vec3f sp70;
- Path* path = &globalCtx->setupPathList[ENRAILGIBUD_GET_FF00(&this->actor)];
+/**
+ * The design behind this actor is that scene files should only spawn a single "main" Gibdo
+ * who then spawns all the other Gibdos. It spawns enough Gibdos for one to exist on every
+ * point along the path up to a maximum of nine additional Gibdos (not counting itself).
+ */
+void EnRailgibud_SpawnOtherGibdosAndSetPositionAndRotation(EnRailgibud* this, GlobalContext* globalCtx) {
+ static s32 currentGibdoIndex = 0;
+ s32 nextPoint;
+ Vec3f targetPos;
+ Path* path = &globalCtx->setupPathList[ENRAILGIBUD_GET_PATH(&this->actor)];
- this->unk_294 = Lib_SegmentedToVirtual(path->points);
- this->unk_298 = D_80BA82F8;
- this->unk_29C = path->count;
- if (D_80BA82F8 == 0) {
+ this->points = Lib_SegmentedToVirtual(path->points);
+ this->currentPoint = currentGibdoIndex;
+ this->pathCount = path->count;
+
+ // This branch will only be taken for the first, "main" Gibdo. The subsequent
+ // Gibdos created by Actor_SpawnAsChild will go through this function to set
+ // their position and rotation, but they will not be able to spawn any more
+ // Gibdos themselves because currentGibdoIndex will be non-zero.
+ if (currentGibdoIndex == 0) {
s32 i;
- for (i = 1; i < this->unk_29C && i < 10; i++) {
- D_80BA82F8++;
+ for (i = 1; i < this->pathCount && i < 10; i++) {
+ currentGibdoIndex++;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_RAILGIBUD, 0.0f, 0.0f, 0.0f, 0,
0, 0, this->actor.params);
}
- D_80BA82F8 = 0;
+
+ currentGibdoIndex = 0;
}
- this->actor.world.pos.x = this->unk_294[this->unk_298].x;
- this->actor.world.pos.y = this->unk_294[this->unk_298].y;
- this->actor.world.pos.z = this->unk_294[this->unk_298].z;
- if (this->unk_298 < (this->unk_29C - 1)) {
- phi_a3 = this->unk_298 + 1;
+ this->actor.world.pos.x = this->points[this->currentPoint].x;
+ this->actor.world.pos.y = this->points[this->currentPoint].y;
+ this->actor.world.pos.z = this->points[this->currentPoint].z;
+ if (this->currentPoint < (this->pathCount - 1)) {
+ nextPoint = this->currentPoint + 1;
} else {
- phi_a3 = 0;
+ nextPoint = 0;
}
- sp70.x = this->unk_294[phi_a3].x;
- sp70.y = this->unk_294[phi_a3].y;
- sp70.z = this->unk_294[phi_a3].z;
- this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &sp70);
+ targetPos.x = this->points[nextPoint].x;
+ targetPos.y = this->points[nextPoint].y;
+ targetPos.z = this->points[nextPoint].z;
+ this->actor.world.rot.y = this->actor.shape.rot.y = Math_Vec3f_Yaw(&this->actor.world.pos, &targetPos);
this->actor.home = this->actor.world;
}
@@ -202,25 +247,26 @@ void EnRailgibud_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 0;
this->actor.hintId = 0x2D;
this->actor.textId = 0;
- if (ENRAILGIBUD_GET_80(&this->actor)) {
- func_80BA7B6C(this, globalCtx);
+ if (ENRAILGIBUD_IS_CUTSCENE_TYPE(&this->actor)) {
+ EnRailgibud_InitCutsceneGibdo(this, globalCtx);
return;
}
- func_80BA5400(this, globalCtx);
- this->unk_3F2 = 0;
- this->unk_402 = gSaveContext.time;
- this->unk_404 = 0;
- this->unk_3F8 = 0;
+ EnRailgibud_SpawnOtherGibdosAndSetPositionAndRotation(this, globalCtx);
+ this->playerStunWaitTimer = 0;
+ this->timeInitialized = gSaveContext.time;
+ this->effectType = 0;
+ this->type = EN_RAILGIBUD_TYPE_GIBDO;
this->textId = 0;
- this->unk_3FA = 0;
+ this->isInvincible = false;
if (this->actor.parent == NULL) {
- this->unk_3EC = 1;
- this->unk_3EE = 1;
+ this->shouldWalkForward = true;
+ this->shouldWalkForwardNextFrame = true;
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGibdoSkel, &gGibdoRedeadIdleAnim, this->jointTable,
+ this->morphTable, GIBDO_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@@ -228,7 +274,7 @@ void EnRailgibud_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
}
- func_80BA57A8(this);
+ EnRailgibud_SetupWalkInCircles(this);
}
void EnRailgibud_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -237,63 +283,66 @@ void EnRailgibud_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyCylinder(globalCtx, &this->collider);
}
-void func_80BA57A8(EnRailgibud* this) {
+void EnRailgibud_SetupWalkInCircles(EnRailgibud* this) {
this->actor.speedXZ = 0.6f;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
- this->actionFunc = func_80BA57F8;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK);
+ this->actionFunc = EnRailgibud_WalkInCircles;
}
-void func_80BA57F8(EnRailgibud* this, GlobalContext* globalCtx) {
- Vec3f sp3C;
+void EnRailgibud_WalkInCircles(EnRailgibud* this, GlobalContext* globalCtx) {
+ Vec3f targetPos;
s32 pad;
- s16 sp36;
+ s16 yRotation;
- sp3C.x = this->unk_294[this->unk_298].x;
- sp3C.y = this->unk_294[this->unk_298].y;
- sp3C.z = this->unk_294[this->unk_298].z;
+ targetPos.x = this->points[this->currentPoint].x;
+ targetPos.y = this->points[this->currentPoint].y;
+ targetPos.z = this->points[this->currentPoint].z;
if ((this->actor.xzDistToPlayer <= 100.0f) && func_800B715C(globalCtx) &&
(Player_GetMask(globalCtx) != PLAYER_MASK_GIBDO)) {
this->actor.home = this->actor.world;
- func_80BA59F0(this);
+ EnRailgibud_SetupAttemptPlayerFreeze(this);
}
- Math_SmoothStepToS(&this->unk_3E2, 0, 1, 0x64, 0);
- Math_SmoothStepToS(&this->unk_3E8, 0, 1, 0x64, 0);
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0);
+ // If we're not supposed to walk forward, then stop here;
+ // don't rotate the Gibdo or move it around.
if (this->actor.parent == NULL) {
- if (this->unk_3EC != 0) {
+ if (this->shouldWalkForward) {
} else {
return;
}
} else {
EnRailgibud* parent = (EnRailgibud*)this->actor.parent;
- if (parent->unk_3EC == 0) {
+ if (!parent->shouldWalkForward) {
return;
}
}
- sp36 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp3C);
- if (Math_Vec3f_DistXZ(&this->actor.world.pos, &sp3C) > 60.0f) {
- Math_SmoothStepToS(&this->actor.world.rot.y, sp36, 1, 0x190, 0xA);
+ yRotation = Math_Vec3f_Yaw(&this->actor.world.pos, &targetPos);
+ if (Math_Vec3f_DistXZ(&this->actor.world.pos, &targetPos) > 60.0f) {
+ Math_SmoothStepToS(&this->actor.world.rot.y, yRotation, 1, 0x190, 0xA);
this->actor.shape.rot.y = this->actor.world.rot.y;
- } else if (this->unk_298 < (this->unk_29C - 1)) {
- this->unk_298++;
+ } else if (this->currentPoint < (this->pathCount - 1)) {
+ this->currentPoint++;
} else {
- this->unk_298 = 0;
+ this->currentPoint = 0;
}
+
Actor_MoveWithGravity(&this->actor);
}
-void func_80BA59F0(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
- this->actionFunc = func_80BA5A34;
+void EnRailgibud_SetupAttemptPlayerFreeze(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_IDLE);
+ this->actionFunc = EnRailgibud_AttemptPlayerFreeze;
}
-void func_80BA5A34(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_AttemptPlayerFreeze(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- s16 rot = this->actor.shape.rot.y + this->unk_3E2 + this->unk_3E8;
+ s16 rot = this->actor.shape.rot.y + this->headRotation.y + this->upperBodyRotation.y;
s16 yaw = BINANG_SUB(this->actor.yawTowardsPlayer, rot);
if (ABS_ALT(yaw) < 0x2008) {
@@ -301,105 +350,111 @@ void func_80BA5A34(EnRailgibud* this, GlobalContext* globalCtx) {
func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150);
func_80123E90(globalCtx, &this->actor);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
- func_80BA5AF0(this);
+ EnRailgibud_SetupWalkToPlayer(this);
}
- func_80BA6B9C(this, globalCtx);
+
+ EnRailgibud_TurnTowardsPlayer(this, globalCtx);
}
-void func_80BA5AF0(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
+void EnRailgibud_SetupWalkToPlayer(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK);
this->actor.speedXZ = 0.4f;
- if (this->actionFunc == func_80BA5A34) {
- this->unk_3F2 = 80;
+
+ if (this->actionFunc == EnRailgibud_AttemptPlayerFreeze) {
+ this->playerStunWaitTimer = 80;
} else {
- this->unk_3F2 = 20;
+ this->playerStunWaitTimer = 20;
}
- this->actionFunc = func_80BA5B64;
+
+ this->actionFunc = EnRailgibud_WalkToPlayer;
}
-void func_80BA5B64(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_WalkToPlayer(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 pad;
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xFA);
this->actor.world.rot = this->actor.shape.rot;
- Math_SmoothStepToS(&this->unk_3E2, 0, 1, 0x64, 0);
- Math_SmoothStepToS(&this->unk_3E8, 0, 1, 0x64, 0);
- if (func_80BA6D10(this, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
- if ((this->unk_3F4 == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0);
+
+ if (EnRailgibud_PlayerInRangeWithCorrectState(this, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
+ if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
player->actor.freezeTimer = 0;
if ((gSaveContext.playerForm == PLAYER_FORM_GORON) || (gSaveContext.playerForm == PLAYER_FORM_DEKU)) {
- func_80BA6054(this);
+ // If the Gibdo/Redead tries to grab Goron or Deku Link, it will fail to
+ // do so. It will appear to take damage and shake its head side-to-side.
+ EnRailgibud_SetupGrabFail(this);
} else if (globalCtx->grabPlayer(globalCtx, player)) {
- func_80BA5DBC(this);
+ EnRailgibud_SetupGrab(this);
}
} else {
- if (this->unk_3F2 == 0) {
+ if (this->playerStunWaitTimer == 0) {
player->actor.freezeTimer = 40;
- this->unk_3F2 = 60;
+ this->playerStunWaitTimer = 60;
func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150);
func_80123E90(globalCtx, &this->actor);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
} else {
- this->unk_3F2--;
+ this->playerStunWaitTimer--;
}
}
- } else if ((this->unk_3F4 == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
- func_80BA6284(this);
- } else if (func_80BA6DAC(this, globalCtx)) {
- func_80BA6284(this);
+ } else if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
+ EnRailgibud_SetupWalkToHome(this);
+ } else if (EnRailgibud_PlayerOutOfRange(this, globalCtx)) {
+ EnRailgibud_SetupWalkToHome(this);
}
- if (this->unk_3F4 > 0) {
- this->unk_3F4--;
+ if (this->grabWaitTimer > 0) {
+ this->grabWaitTimer--;
}
if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK);
- } else if ((globalCtx->gameplayFrames & 95) == 0) {
+ } else if (!(globalCtx->gameplayFrames & 95)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY);
}
}
-void func_80BA5DBC(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
- this->actor.flags &= ~1;
- this->unk_3F2 = 0;
- this->unk_3F0 = 0;
- this->actionFunc = func_80BA5E18;
+void EnRailgibud_SetupGrab(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_START);
+ this->grabDamageTimer = 0;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->grabState = EN_RAILGIBUD_GRAB_START;
+ this->actionFunc = EnRailgibud_Grab;
}
-void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_Grab(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player2 = GET_PLAYER(globalCtx);
Player* player = player2;
- s32 sp34;
- u16 sp32;
+ s32 inPositionToAttack;
+ u16 damageSfxId;
- switch (this->unk_3F0) {
- case 0:
- sp34 = func_80BA7088(this, globalCtx);
- if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (sp34 == 1)) {
- this->unk_3F0 = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ switch (this->grabState) {
+ case EN_RAILGIBUD_GRAB_START:
+ inPositionToAttack = EnRailgibud_MoveToIdealGrabPositionAndRotation(this, globalCtx);
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) {
+ this->grabState = EN_RAILGIBUD_GRAB_ATTACK;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_ATTACK);
} else if (!(player->stateFlags2 & 0x80)) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
- this->actor.flags |= 1;
- this->unk_3F0 = 2;
- this->unk_3F2 = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_END);
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->grabState = EN_RAILGIBUD_GRAB_RELEASE;
+ this->grabDamageTimer = 0;
}
break;
- case 1:
- if (this->unk_3F2 == 20) {
+ case EN_RAILGIBUD_GRAB_ATTACK:
+ if (this->grabDamageTimer == 20) {
s16 requiredScopeTemp;
- sp32 = player->ageProperties->unk_92 + 0x6805;
+ damageSfxId = player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S;
globalCtx->damagePlayer(globalCtx, -8);
- func_800B8E58(player, sp32);
+ func_800B8E58(player, damageSfxId);
func_8013ECE0(this->actor.xzDistToPlayer, 240, 1, 12);
- this->unk_3F2 = 0;
+ this->grabDamageTimer = 0;
} else {
- this->unk_3F2++;
+ this->grabDamageTimer++;
}
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
@@ -411,18 +466,19 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) {
player->stateFlags2 &= ~0x80;
player->unk_AE8 = 100;
}
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
- this->actor.flags |= 1;
- this->unk_3F0 = 2;
- this->unk_3F2 = 0;
+
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_GRAB_END);
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->grabState = EN_RAILGIBUD_GRAB_RELEASE;
+ this->grabDamageTimer = 0;
}
break;
- case 2:
+ case EN_RAILGIBUD_GRAB_RELEASE:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->unk_3F4 = 40;
+ this->grabWaitTimer = 40;
this->actor.shape.yOffset = 0.0f;
- func_80BA5AF0(this);
+ EnRailgibud_SetupWalkToPlayer(this);
} else {
Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 400.0f, 0.0f);
}
@@ -430,88 +486,90 @@ void func_80BA5E18(EnRailgibud* this, GlobalContext* globalCtx) {
}
}
-void func_80BA6054(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7);
+void EnRailgibud_SetupGrabFail(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DAMAGE);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
this->actor.speedXZ = -2.0f;
- this->actionFunc = func_80BA60B0;
+ this->actionFunc = EnRailgibud_GrabFail;
}
-void func_80BA60B0(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_GrabFail(EnRailgibud* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.15f;
}
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- Math_SmoothStepToS(&this->unk_3E2, 0, 1, 0x12C, 0);
- Math_SmoothStepToS(&this->unk_3E8, 0, 1, 0x12C, 0);
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x12C, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x12C, 0);
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->actor.world.rot.y = this->actor.shape.rot.y;
- func_80BA6158(this);
+ EnRailgibud_SetupTurnAwayAndShakeHead(this);
}
}
-void func_80BA6158(EnRailgibud* this) {
- this->unk_3F2 = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
- this->actionFunc = func_80BA61A0;
+void EnRailgibud_SetupTurnAwayAndShakeHead(EnRailgibud* this) {
+ this->headShakeTimer = 0;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK);
+ this->actionFunc = EnRailgibud_TurnAwayAndShakeHead;
}
-void func_80BA61A0(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_TurnAwayAndShakeHead(EnRailgibud* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 3500, 200);
this->actor.shape.rot.y = this->actor.world.rot.y;
- if (this->unk_3F2 > 60) {
- func_80BA6284(this);
- this->unk_3F2 = 0;
+ if (this->headShakeTimer > 60) {
+ EnRailgibud_SetupWalkToHome(this);
+ this->playerStunWaitTimer = 0;
} else {
- this->unk_3E2 = Math_SinS(this->unk_3F2 * 0xFA0) * (0x256F * ((60 - this->unk_3F2) / 60.0f));
- this->unk_3F2++;
+ this->headRotation.y =
+ Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f));
+ this->headShakeTimer++;
}
}
-void func_80BA6284(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
+void EnRailgibud_SetupWalkToHome(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK);
this->actor.speedXZ = 0.4f;
- this->actionFunc = func_80BA62D4;
+ this->actionFunc = EnRailgibud_WalkToHome;
}
-void func_80BA62D4(EnRailgibud* this, GlobalContext* globalCtx) {
- Math_SmoothStepToS(&this->unk_3E2, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3E8, 0, 1, 100, 0);
+void EnRailgibud_WalkToHome(EnRailgibud* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0);
if (Actor_XZDistanceToPoint(&this->actor, &this->actor.home.pos) < 5.0f) {
if (this->actor.speedXZ > 0.2f) {
this->actor.speedXZ -= 0.2f;
} else {
this->actor.speedXZ = 0.0f;
}
+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.world.rot.y == this->actor.home.rot.y) {
- func_80BA57A8(this);
+ EnRailgibud_SetupWalkInCircles(this);
}
} else {
Math_ScaledStepToS(&this->actor.shape.rot.y, Actor_YawToPoint(&this->actor, &this->actor.home.pos), 450);
this->actor.world.rot = this->actor.shape.rot;
}
- if (func_80BA6D10(this, globalCtx)) {
+ if (EnRailgibud_PlayerInRangeWithCorrectState(this, globalCtx)) {
if ((gSaveContext.playerForm != PLAYER_FORM_GORON) && (gSaveContext.playerForm != PLAYER_FORM_DEKU) &&
Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
- func_80BA5AF0(this);
+ EnRailgibud_SetupWalkToPlayer(this);
}
}
}
-void func_80BA6440(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7);
+void EnRailgibud_SetupDamage(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DAMAGE);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
- this->unk_3F2 = 0;
- this->unk_3F4 = 0;
+ this->stunTimer = 0;
+ this->grabWaitTimer = 0;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.speedXZ = -2.0f;
- this->actionFunc = func_80BA64AC;
+ this->actionFunc = EnRailgibud_Damage;
}
-void func_80BA64AC(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_Damage(EnRailgibud* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.15f;
}
@@ -519,57 +577,65 @@ void func_80BA64AC(EnRailgibud* this, GlobalContext* globalCtx) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_405 = -1;
this->actor.world.rot.y = this->actor.shape.rot.y;
- if ((this->unk_3F6 > 0) && (this->unk_404 == 0) && (this->unk_3F8 == 0)) {
+ if ((this->effectTimer > 0) && (this->effectType == 0) && (this->type == EN_RAILGIBUD_TYPE_GIBDO)) {
this->actor.hintId = 0x2A;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, NULL, this->jointTable, this->morphTable, 26);
- this->unk_3F8 = 1;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gRedeadSkel, NULL, this->jointTable, this->morphTable,
+ GIBDO_LIMB_MAX);
+ this->type = EN_RAILGIBUD_TYPE_REDEAD;
}
- func_80BA6284(this);
+
+ EnRailgibud_SetupWalkToHome(this);
}
}
-void func_80BA6584(EnRailgibud* this) {
+void EnRailgibud_SetupStunned(EnRailgibud* this) {
this->actor.world.rot.y = this->actor.shape.rot.y;
- this->unk_3F2 = 10;
- if (this->unk_3F6 != 0) {
+ this->stunTimer = 10;
+
+ if (this->effectTimer != 0) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28);
} else {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28);
}
- this->actionFunc = func_80BA6604;
+
+ this->actionFunc = EnRailgibud_Stunned;
}
-void func_80BA6604(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_Stunned(EnRailgibud* this, GlobalContext* globalCtx) {
if (this->actor.colorFilterTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
- func_80BA6664(this);
+ EnRailgibud_SetupDead(this);
} else {
- func_80BA6440(this);
+ EnRailgibud_SetupDamage(this);
}
}
- if (this->unk_3F2 != 0) {
- this->unk_3F2--;
+ if (this->stunTimer != 0) {
+ this->stunTimer--;
}
}
-void func_80BA6664(EnRailgibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
- this->actor.flags &= ~1;
+void EnRailgibud_SetupDead(EnRailgibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_DEATH);
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD);
- this->unk_3F2 = 0;
- this->actionFunc = func_80BA66C8;
+ this->deathTimer = 0;
+ this->actionFunc = EnRailgibud_Dead;
}
-void func_80BA66C8(EnRailgibud* this, GlobalContext* globalCtx) {
- if (this->unk_3F2 > 300) {
+void EnRailgibud_Dead(EnRailgibud* this, GlobalContext* globalCtx) {
+ if (this->deathTimer > 300) {
if (this->actor.shape.shadowAlpha == 0) {
if (this->actor.parent != NULL) {
Actor_MarkForDeath(&this->actor);
} else {
+ // Don't delete the "main" Gibdo, since that will break the surviving
+ // Gibdos' ability to start and stop walking forward. Instead, just
+ // stop drawing it, and make its Update function only check to see if
+ // the Gibdos should move forward.
this->actor.draw = NULL;
- this->actor.flags &= ~1;
- this->actor.update = func_80BA7878;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.update = EnRailgibud_MainGibdo_DeadUpdate;
}
} else {
this->actor.shape.shadowAlpha -= 5;
@@ -578,106 +644,124 @@ void func_80BA66C8(EnRailgibud* this, GlobalContext* globalCtx) {
}
}
} else {
- Math_SmoothStepToS(&this->unk_3E2, 0, 1, 250, 0);
- Math_SmoothStepToS(&this->unk_3E8, 0, 1, 250, 0);
- this->unk_3F2++;
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 250, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 250, 0);
+ this->deathTimer++;
}
- if ((this->unk_3F2 == 20) && (this->unk_3F6 > 0) && (this->unk_404 == 0) && (this->unk_3F8 == 0)) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, NULL, this->jointTable, this->morphTable, 26);
- this->unk_3F8 = 1;
+ if ((this->deathTimer == 20) && (this->effectTimer > 0) && (this->effectType == 0) &&
+ (this->type == EN_RAILGIBUD_TYPE_GIBDO)) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gRedeadSkel, NULL, this->jointTable, this->morphTable,
+ GIBDO_LIMB_MAX);
+ this->type = EN_RAILGIBUD_TYPE_REDEAD;
}
}
-void func_80BA6800(EnRailgibud* this, GlobalContext* globalCtx, s32 arg2) {
- Vec3f sp5C = this->actor.world.pos;
- Vec3f sp50 = { 0.0f, 8.0f, 0.0f };
- Vec3f sp44 = { 0.0f, -1.5f, 0.0f };
+void EnRailgibud_SpawnEffectsForSinkingIntoTheGround(EnRailgibud* this, GlobalContext* globalCtx, s32 arg2) {
+ Vec3f rockFragmentPos = this->actor.world.pos;
+ Vec3f rockFragmentVelocity = { 0.0f, 8.0f, 0.0f };
+ Vec3f rockFragmentAccel = { 0.0f, -1.5f, 0.0f };
s16 rand;
s32 pad;
if ((globalCtx->gameplayFrames & arg2) == 0) {
rand = Rand_Next();
- sp5C.x += 15.0f * Math_SinS(rand);
- sp5C.z += 15.0f * Math_CosS(rand);
- sp44.x = Rand_Centered();
- sp44.z = Rand_Centered();
- sp50.y += Rand_Centered() * 4.0f;
- EffectSsHahen_Spawn(globalCtx, &sp5C, &sp50, &sp44, 0, (Rand_Next() & 7) + 10, -1, 10, NULL);
- func_80BA6974(globalCtx, &sp5C, 10.0f, 10, 150, 0);
+ rockFragmentPos.x += 15.0f * Math_SinS(rand);
+ rockFragmentPos.z += 15.0f * Math_CosS(rand);
+ rockFragmentAccel.x = Rand_Centered();
+ rockFragmentAccel.z = Rand_Centered();
+ rockFragmentVelocity.y += Rand_Centered() * 4.0f;
+ EffectSsHahen_Spawn(globalCtx, &rockFragmentPos, &rockFragmentVelocity, &rockFragmentAccel, 0,
+ (Rand_Next() & 7) + 10, -1, 10, NULL);
+ EnRailgibud_SpawnDust(globalCtx, &rockFragmentPos, 10.0f, 10, 150, 0);
}
}
-void func_80BA6974(GlobalContext* globalCtx, Vec3f* vec, f32 arg2, s32 arg3, s16 arg4, s16 arg5) {
- Vec3f sp8C;
- Vec3f sp80 = { 0.0f, 0.3f, 0.0f };
- Vec3f sp74 = gZeroVec3f;
+void EnRailgibud_SpawnDust(GlobalContext* globalCtx, Vec3f* basePos, f32 randomnessScale, s32 dustCount, s16 dustScale,
+ s16 scaleStep) {
+ Vec3f dustPos;
+ Vec3f dustAccel = { 0.0f, 0.3f, 0.0f };
+ Vec3f dustVelocity = gZeroVec3f;
s32 i;
s32 pad;
- sp74.y = 2.5f;
+ dustVelocity.y = 2.5f;
- for (i = arg3; i >= 0; i--) {
- sp74.x = (Rand_ZeroOne() - 0.5f) * arg2;
- sp74.z = (Rand_ZeroOne() - 0.5f) * arg2;
+ for (i = dustCount; i >= 0; i--) {
+ dustVelocity.x = (Rand_ZeroOne() - 0.5f) * randomnessScale;
+ dustVelocity.z = (Rand_ZeroOne() - 0.5f) * randomnessScale;
- sp8C.x = vec->x + sp74.x;
- sp8C.y = ((Rand_ZeroOne() - 0.5f) * arg2) + vec->y;
- sp8C.z = vec->z + sp74.z;
+ dustPos.x = basePos->x + dustVelocity.x;
+ dustPos.y = ((Rand_ZeroOne() - 0.5f) * randomnessScale) + basePos->y;
+ dustPos.z = basePos->z + dustVelocity.z;
- sp74.x *= 0.5f;
- sp74.z *= 0.5f;
- func_800B1210(globalCtx, &sp8C, &sp74, &sp80, (s16)(Rand_ZeroOne() * arg4 * 0.2f) + arg4, arg5);
+ dustVelocity.x *= 0.5f;
+ dustVelocity.z *= 0.5f;
+ func_800B1210(globalCtx, &dustPos, &dustVelocity, &dustAccel,
+ (s16)(Rand_ZeroOne() * dustScale * 0.2f) + dustScale, scaleStep);
}
}
-void func_80BA6B30(EnRailgibud* this) {
+/**
+ * If any Gibdo in the ring of Gibdos is doing any other action besides walking in
+ * circles or being dead, then this function will update the "main" Gibdo's
+ * walking forward variables such that all Gibdos in the ring will stop moving.
+ * Similarly, this will make all Gibdos in the ring start walking forward again
+ * if the Gibdos are all performing the appropriate action.
+ */
+void EnRailgibud_UpdateWalkForwardState(EnRailgibud* this) {
if (this->actor.parent == NULL) {
- this->unk_3EC = this->unk_3EE;
- this->unk_3EE = 1;
- if ((this->actionFunc != func_80BA57F8) && (this->actionFunc != func_80BA66C8)) {
- this->unk_3EE = 0;
+ this->shouldWalkForward = this->shouldWalkForwardNextFrame;
+ this->shouldWalkForwardNextFrame = true;
+ if ((this->actionFunc != EnRailgibud_WalkInCircles) && (this->actionFunc != EnRailgibud_Dead)) {
+ this->shouldWalkForwardNextFrame = false;
}
- } else if ((this->actionFunc != func_80BA57F8) && (this->actionFunc != func_80BA66C8)) {
- ((EnRailgibud*)this->actor.parent)->unk_3EE = 0;
+ } else if ((this->actionFunc != EnRailgibud_WalkInCircles) && (this->actionFunc != EnRailgibud_Dead)) {
+ ((EnRailgibud*)this->actor.parent)->shouldWalkForwardNextFrame = false;
}
}
-void func_80BA6B9C(EnRailgibud* this, GlobalContext* globalCtx) {
- s16 temp_v0 = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->unk_3E8;
- s16 phi_a2 = CLAMP(temp_v0, -500, 500);
+void EnRailgibud_TurnTowardsPlayer(EnRailgibud* this, GlobalContext* globalCtx) {
+ s16 headAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->upperBodyRotation.y;
+ s16 upperBodyAngle = CLAMP(headAngle, -500, 500);
- temp_v0 -= this->unk_3E2;
- temp_v0 = CLAMP(temp_v0, -500, 500);
+ headAngle -= this->headRotation.y;
+ headAngle = CLAMP(headAngle, -500, 500);
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) >= 0) {
- this->unk_3E8 += ABS_ALT(phi_a2);
- this->unk_3E2 += ABS_ALT(temp_v0);
+ this->upperBodyRotation.y += ABS_ALT(upperBodyAngle);
+ this->headRotation.y += ABS_ALT(headAngle);
} else {
- this->unk_3E8 -= ABS_ALT(phi_a2);
- this->unk_3E2 -= ABS_ALT(temp_v0);
+ this->upperBodyRotation.y -= ABS_ALT(upperBodyAngle);
+ this->headRotation.y -= ABS_ALT(headAngle);
}
- this->unk_3E8 = CLAMP(this->unk_3E8, -0x495F, 0x495F);
- this->unk_3E2 = CLAMP(this->unk_3E2, -0x256F, 0x256F);
+ this->upperBodyRotation.y = CLAMP(this->upperBodyRotation.y, -0x495F, 0x495F);
+ this->headRotation.y = CLAMP(this->headRotation.y, -0x256F, 0x256F);
}
-s32 func_80BA6D10(EnRailgibud* this, GlobalContext* globalCtx) {
+s32 EnRailgibud_PlayerInRangeWithCorrectState(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) {
return false;
}
- if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f) && !(player->stateFlags1 & 0x2C6080) &&
- !(player->stateFlags2 & 0x4080)) {
+ if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 100.0f) &&
+ !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
+ !(player->stateFlags2 & (0x4000 | 0x80))) {
return true;
}
return false;
}
-s32 func_80BA6DAC(EnRailgibud* this, GlobalContext* globalCtx) {
+/**
+ * Gibdos/Redeads have a very short range around their home where they will
+ * engage with the player. If the player is out of this range, they will simply
+ * walk back to their home.
+ */
+s32 EnRailgibud_PlayerOutOfRange(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 100.0f) {
@@ -687,188 +771,204 @@ s32 func_80BA6DAC(EnRailgibud* this, GlobalContext* globalCtx) {
return false;
}
-void func_80BA6DF8(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_UpdateDamage(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((this->unk_3FA != 1) && (this->collider.base.acFlags & AC_HIT)) {
- if (this->actionFunc == func_80BA57F8) {
+ if ((this->isInvincible != true) && (this->collider.base.acFlags & AC_HIT)) {
+ if (this->actionFunc == EnRailgibud_WalkInCircles) {
this->actor.home = this->actor.world;
}
this->collider.base.acFlags &= ~AC_HIT;
Actor_ApplyDamage(&this->actor);
switch (this->actor.colChkInfo.damageEffect) {
- case 15:
+ case EN_RAILGIBUD_DMGEFF_DAMAGE:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
if (player->unk_ADC != 0) {
this->unk_405 = player->unk_ADD;
}
this->actor.shape.yOffset = 0.0f;
if (this->actor.colChkInfo.health == 0) {
- func_80BA6664(this);
+ EnRailgibud_SetupDead(this);
} else {
- func_80BA6440(this);
+ EnRailgibud_SetupDamage(this);
}
break;
- case 14:
- if (this->unk_3F8 == 1) {
+ case EN_RAILGIBUD_DMGEFF_LIGHT_RAY:
+ if (this->type == EN_RAILGIBUD_TYPE_REDEAD) {
this->actor.colChkInfo.health = 0;
this->actor.shape.yOffset = 0.0f;
- func_80BA6664(this);
+ EnRailgibud_SetupDead(this);
}
break;
- case 2:
+ case EN_RAILGIBUD_DMGEFF_FIRE_ARROW:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
if (this->actor.colChkInfo.health == 0) {
- func_80BA6664(this);
+ EnRailgibud_SetupDead(this);
} else {
- func_80BA6440(this);
+ EnRailgibud_SetupDamage(this);
}
- this->unk_404 = 0;
- this->unk_3F6 = 180;
- this->unk_2A0 = 1.0f;
+ this->effectType = 0;
+ this->effectTimer = 180;
+ this->effectAlpha = 1.0f;
break;
- case 4:
+ case EN_RAILGIBUD_DMGEFF_LIGHT_ARROW:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
if (this->actor.colChkInfo.health == 0) {
- func_80BA6664(this);
+ EnRailgibud_SetupDead(this);
} else {
- func_80BA6440(this);
+ EnRailgibud_SetupDamage(this);
}
- this->unk_404 = 20;
- this->unk_3F6 = 60;
- this->unk_2A0 = 1.0f;
+ this->effectType = 20;
+ this->effectTimer = 60;
+ this->effectAlpha = 1.0f;
break;
- case 12:
- if ((this->actionFunc != func_80BA5E18) &&
- ((this->actionFunc != func_80BA6604) || (this->unk_3F2 == 0))) {
- this->unk_404 = 30;
- this->unk_3F6 = 40;
- this->unk_2A0 = 1.0f;
- func_80BA6584(this);
+ case EN_RAILGIBUD_DMGEFF_ZORA_MAGIC:
+ if ((this->actionFunc != EnRailgibud_Grab) &&
+ ((this->actionFunc != EnRailgibud_Stunned) || (this->stunTimer == 0))) {
+ this->effectType = 30;
+ this->effectTimer = 40;
+ this->effectAlpha = 1.0f;
+ EnRailgibud_SetupStunned(this);
}
break;
- case 1:
- if ((this->actionFunc != func_80BA6604) || (this->unk_3F2 == 0)) {
- func_80BA6584(this);
+ case EN_RAILGIBUD_DMGEFF_STUN:
+ if ((this->actionFunc != EnRailgibud_Stunned) || (this->stunTimer == 0)) {
+ EnRailgibud_SetupStunned(this);
}
break;
}
}
}
-s32 func_80BA7088(EnRailgibud* this, GlobalContext* globalCtx) {
+/**
+ * Returns true if the Gibdo is in the correct position and rotation to start
+ * performing its grab attack. Regardless of what this returns, the Gibdo is
+ * moved closer to this ideal position and rotation.
+ */
+s32 EnRailgibud_MoveToIdealGrabPositionAndRotation(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- Vec3f sp40;
- f32 sp3C;
- f32 sp38 = 0.0f;
- s16 temp_s0_2;
+ Vec3f targetPos;
+ f32 distanceFromTargetPos;
+ f32 distanceFromTargetYOffset = 0.0f;
+ s16 distanceFromTargetAngle;
- sp40 = player->actor.world.pos;
-
- sp40.x -= 25.0f * Math_SinS(player->actor.shape.rot.y);
- sp40.z -= 25.0f * Math_CosS(player->actor.shape.rot.y);
- sp3C = Math_Vec3f_StepTo(&this->actor.world.pos, &sp40, 10.0f);
- temp_s0_2 = Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 0x1770, 0x64);
+ targetPos = player->actor.world.pos;
+ targetPos.x -= 25.0f * Math_SinS(player->actor.shape.rot.y);
+ targetPos.z -= 25.0f * Math_CosS(player->actor.shape.rot.y);
+ distanceFromTargetPos = Math_Vec3f_StepTo(&this->actor.world.pos, &targetPos, 10.0f);
+ distanceFromTargetAngle = Math_SmoothStepToS(&this->actor.shape.rot.y, player->actor.shape.rot.y, 1, 0x1770, 0x64);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
- sp38 = Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f);
+ distanceFromTargetYOffset = Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f);
}
- if ((sp3C == 0.0f) && (ABS_ALT(temp_s0_2) < 100) && (sp38 == 0.0f)) {
+ if ((distanceFromTargetPos == 0.0f) && (ABS_ALT(distanceFromTargetAngle) < 100) &&
+ (distanceFromTargetYOffset == 0.0f)) {
return true;
}
return false;
}
-void func_80BA71E4(EnRailgibud* this, GlobalContext* globalCtx) {
- if ((this->actionFunc == func_80BA5B64) || (this->actionFunc == func_80BA62D4) ||
- (this->actionFunc == func_80BA64AC)) {
+void EnRailgibud_MoveWithGravity(EnRailgibud* this, GlobalContext* globalCtx) {
+ if ((this->actionFunc == EnRailgibud_WalkToPlayer) || (this->actionFunc == EnRailgibud_WalkToHome) ||
+ (this->actionFunc == EnRailgibud_Damage)) {
Actor_MoveWithGravity(&this->actor);
}
}
-void func_80BA7234(EnRailgibud* this, GlobalContext* globalCtx) {
+/**
+ * If the Gibdo is starting a grab and is touching a wall, the player is moved
+ * away from that wall with this function. This can happen when the player's
+ * back is close to a wall before being grabbed. The Gibdo changes its own
+ * position to match the player's position at the start of a grab, so moving
+ * the player like this will help prevent the Gibdo from looking like it's
+ * clipping into the wall as it grabs onto the player.
+ */
+void EnRailgibud_MoveGrabbedPlayerAwayFromWall(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- Vec3f sp30;
+ Vec3f targetPos;
- if ((this->actionFunc == func_80BA5E18) && (this->unk_3F0 != 2)) {
+ if ((this->actionFunc == EnRailgibud_Grab) && (this->grabState != EN_RAILGIBUD_GRAB_RELEASE)) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 1);
} else {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D);
}
- if ((this->actionFunc == func_80BA5E18) && (this->unk_3F0 == 0) && (this->actor.bgCheckFlags & 8)) {
- sp30 = player->actor.world.pos;
- sp30.x += 10.0f * Math_SinS(this->actor.wallYaw);
- sp30.z += 10.0f * Math_CosS(this->actor.wallYaw);
- Math_Vec3f_StepTo(&player->actor.world.pos, &sp30, 5.0f);
+ if ((this->actionFunc == EnRailgibud_Grab) && (this->grabState == EN_RAILGIBUD_GRAB_START) &&
+ (this->actor.bgCheckFlags & 8)) {
+ targetPos = player->actor.world.pos;
+ targetPos.x += 10.0f * Math_SinS(this->actor.wallYaw);
+ targetPos.z += 10.0f * Math_CosS(this->actor.wallYaw);
+ Math_Vec3f_StepTo(&player->actor.world.pos, &targetPos, 5.0f);
}
}
-void func_80BA7388(EnRailgibud* this, GlobalContext* globalCtx) {
- if (this->unk_3F6 > 0) {
- this->unk_3F6--;
+void EnRailgibud_UpdateEffect(EnRailgibud* this, GlobalContext* globalCtx) {
+ if (this->effectTimer > 0) {
+ this->effectTimer--;
}
- if (this->unk_3F6 < 20) {
- Math_SmoothStepToF(&this->unk_2A4, 0.0f, 0.5f, 0.03f, 0.0f);
- this->unk_2A0 = this->unk_3F6 * 0.05f;
+ if (this->effectTimer < 20) {
+ Math_SmoothStepToF(&this->effectScale, 0.0f, 0.5f, 0.03f, 0.0f);
+ this->effectAlpha = this->effectTimer * 0.05f;
} else {
- Math_SmoothStepToF(&this->unk_2A4, 0.5f, 0.1f, 0.02f, 0.0f);
+ Math_SmoothStepToF(&this->effectScale, 0.5f, 0.1f, 0.02f, 0.0f);
}
}
-void func_80BA7434(EnRailgibud* this, GlobalContext* globalCtx) {
- if ((this->actionFunc != func_80BA5E18) && (this->actionFunc != func_80BA64AC) &&
- (this->actionFunc != func_80BA60B0) && (this->actionFunc != func_80BA61A0) &&
- (this->actionFunc != func_80BA66C8)) {
- if ((this->actor.flags & 5) == 5) {
+void EnRailgibud_CheckForGibdoMask(EnRailgibud* this, GlobalContext* globalCtx) {
+ if ((this->actionFunc != EnRailgibud_Grab) && (this->actionFunc != EnRailgibud_Damage) &&
+ (this->actionFunc != EnRailgibud_GrabFail) && (this->actionFunc != EnRailgibud_TurnAwayAndShakeHead) &&
+ (this->actionFunc != EnRailgibud_Dead)) {
+ if (CHECK_FLAG_ALL(this->actor.flags, (ACTOR_FLAG_1 | ACTOR_FLAG_4))) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) {
- this->actor.flags &= ~5;
- this->actor.flags |= 9;
+ this->actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_1);
+ this->actor.flags |= (ACTOR_FLAG_8 | ACTOR_FLAG_1);
this->actor.hintId = 0xFF;
this->actor.textId = 0;
- if ((this->actionFunc != func_80BA57F8) && (this->actionFunc != func_80BA62D4)) {
- func_80BA6284(this);
+ if ((this->actionFunc != EnRailgibud_WalkInCircles) && (this->actionFunc != EnRailgibud_WalkToHome)) {
+ EnRailgibud_SetupWalkToHome(this);
}
}
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_GIBDO) {
- this->actor.flags &= ~(0x8 | 0x1);
- this->actor.flags |= (0x4 | 0x1);
- if (this->unk_3F8 == 1) {
+ this->actor.flags &= ~(ACTOR_FLAG_8 | ACTOR_FLAG_1);
+ this->actor.flags |= (ACTOR_FLAG_4 | ACTOR_FLAG_1);
+ if (this->type == EN_RAILGIBUD_TYPE_REDEAD) {
this->actor.hintId = 0x2A;
} else {
this->actor.hintId = 0x2D;
}
this->actor.textId = 0;
}
- func_80BA7578(this, globalCtx);
+
+ EnRailgibud_CheckIfTalkingToPlayer(this, globalCtx);
}
}
-void func_80BA7578(EnRailgibud* this, GlobalContext* globalCtx) {
- if ((this->textId == 0) && (this->unk_3F8 == 0)) {
+void EnRailgibud_CheckIfTalkingToPlayer(EnRailgibud* this, GlobalContext* globalCtx) {
+ if ((this->textId == 0) && (this->type == EN_RAILGIBUD_TYPE_GIBDO)) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->unk_3FA = 1;
- func_801518B0(globalCtx, 0x13B2, &this->actor);
+ this->isInvincible = true;
+ Message_StartTextbox(globalCtx, 0x13B2, &this->actor);
this->textId = 0x13B2;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
this->actor.speedXZ = 0.0f;
- } else if (((this->actor.flags & 9) == 9) && !(this->collider.base.acFlags & AC_HIT)) {
+ } else if (CHECK_FLAG_ALL(this->actor.flags, (ACTOR_FLAG_1 | ACTOR_FLAG_8)) &&
+ !(this->collider.base.acFlags & AC_HIT)) {
func_800B8614(&this->actor, globalCtx, 100.0f);
}
} else {
switch (Message_GetState(&globalCtx->msgCtx)) {
case 5:
if (func_80147624(globalCtx)) {
- func_801518B0(globalCtx, 0x13B3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13B3, &this->actor);
this->textId = 0x13B3;
}
break;
@@ -876,7 +976,7 @@ void func_80BA7578(EnRailgibud* this, GlobalContext* globalCtx) {
case 6:
if (func_80147624(globalCtx)) {
this->textId = 0;
- this->unk_3FA = 0;
+ this->isInvincible = false;
this->actor.speedXZ = 0.6f;
}
break;
@@ -891,14 +991,16 @@ void func_80BA7578(EnRailgibud* this, GlobalContext* globalCtx) {
}
}
-void func_80BA76C4(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_UpdateCollision(EnRailgibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((this->actionFunc != func_80BA66C8) && ((this->actionFunc != func_80BA5E18) || (this->unk_3F0 == 2))) {
+ if ((this->actionFunc != EnRailgibud_Dead) &&
+ ((this->actionFunc != EnRailgibud_Grab) || (this->grabState == EN_RAILGIBUD_GRAB_RELEASE))) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
- if (((this->actionFunc != func_80BA64AC) || ((player->unk_ADC != 0) && (player->unk_ADD != this->unk_405))) &&
- ((this->actionFunc != func_80BA6604) || (this->unk_3F2 == 0))) {
+ if (((this->actionFunc != EnRailgibud_Damage) ||
+ ((player->unk_ADC != 0) && (player->unk_ADD != this->unk_405))) &&
+ ((this->actionFunc != EnRailgibud_Stunned) || (this->stunTimer == 0))) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -907,35 +1009,38 @@ void func_80BA76C4(EnRailgibud* this, GlobalContext* globalCtx) {
void EnRailgibud_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRailgibud* this = THIS;
- func_80BA6B30(this);
- func_80BA7434(this, globalCtx);
- func_80BA6DF8(this, globalCtx);
+ EnRailgibud_UpdateWalkForwardState(this);
+ EnRailgibud_CheckForGibdoMask(this, globalCtx);
+ EnRailgibud_UpdateDamage(this, globalCtx);
+
this->actionFunc(this, globalCtx);
- if (this->actionFunc != func_80BA6604) {
+ if (this->actionFunc != EnRailgibud_Stunned) {
SkelAnime_Update(&this->skelAnime);
}
- func_80BA71E4(this, globalCtx);
- func_80BA76C4(this, globalCtx);
- func_80BA7234(this, globalCtx);
- func_80BA7388(this, globalCtx);
+
+ EnRailgibud_MoveWithGravity(this, globalCtx);
+ EnRailgibud_UpdateCollision(this, globalCtx);
+ EnRailgibud_MoveGrabbedPlayerAwayFromWall(this, globalCtx);
+ EnRailgibud_UpdateEffect(this, globalCtx);
+
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 50.0f;
}
-void func_80BA7878(Actor* thisx, GlobalContext* globalCtx) {
+void EnRailgibud_MainGibdo_DeadUpdate(Actor* thisx, GlobalContext* globalCtx) {
EnRailgibud* this = THIS;
- func_80BA6B30(this);
+ EnRailgibud_UpdateWalkForwardState(this);
}
s32 EnRailgibud_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
Actor* thisx, Gfx** gfx) {
EnRailgibud* this = THIS;
- if (limbIndex == 12) {
- rot->y += this->unk_3E8;
- } else if (limbIndex == 23) {
- rot->y += this->unk_3E2;
+ if (limbIndex == GIBDO_LIMB_UPPER_BODY_ROOT) {
+ rot->y += this->upperBodyRotation.y;
+ } else if (limbIndex == GIBDO_LIMB_HEAD_ROOT) {
+ rot->y += this->headRotation.y;
}
return false;
@@ -945,12 +1050,16 @@ void EnRailgibud_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
Gfx** gfx) {
EnRailgibud* this = THIS;
- if ((this->unk_3F6 != 0) &&
- ((limbIndex == 3) || (limbIndex == 4) || (limbIndex == 6) || (limbIndex == 8) || (limbIndex == 9) ||
- (limbIndex == 11) || (limbIndex == 14) || (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18) ||
- (limbIndex == 20) || (limbIndex == 21) || (limbIndex == 22) || (limbIndex == 24) || (limbIndex == 25))) {
- Matrix_GetStateTranslation(&this->unk_1D8[this->unk_28C]);
- this->unk_28C++;
+ if ((this->effectTimer != 0) &&
+ ((limbIndex == GIBDO_LIMB_LEFT_THIGH) || (limbIndex == GIBDO_LIMB_LEFT_SHIN) ||
+ (limbIndex == GIBDO_LIMB_LEFT_FOOT) || (limbIndex == GIBDO_LIMB_RIGHT_THIGH) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_SHIN) || (limbIndex == GIBDO_LIMB_RIGHT_FOOT) ||
+ (limbIndex == GIBDO_LIMB_TORSO) || (limbIndex == GIBDO_LIMB_LEFT_SHOULDER_AND_UPPER_ARM) ||
+ (limbIndex == GIBDO_LIMB_LEFT_FOREARM) || (limbIndex == GIBDO_LIMB_LEFT_HAND) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) || (limbIndex == GIBDO_LIMB_RIGHT_FOREARM) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_HAND) || (limbIndex == GIBDO_LIMB_HEAD) || (limbIndex == GIBDO_LIMB_PELVIS))) {
+ Matrix_GetStateTranslation(&this->limbPos[this->limbIndex]);
+ this->limbIndex++;
}
}
@@ -959,7 +1068,7 @@ void EnRailgibud_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- this->unk_28C = 0;
+ this->limbIndex = 0;
if (this->actor.shape.shadowAlpha == 255) {
func_8012C28C(globalCtx->state.gfxCtx);
@@ -980,132 +1089,136 @@ void EnRailgibud_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnRailgibud_PostLimbDraw, &this->actor, POLY_XLU_DISP);
}
- if (this->unk_3F6 > 0) {
- func_800BE680(globalCtx, &this->actor, this->unk_1D8, ARRAY_COUNT(this->unk_1D8), this->unk_2A4, 0.5f,
- this->unk_2A0, this->unk_404);
+ if (this->effectTimer > 0) {
+ func_800BE680(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->effectScale, 0.5f,
+ this->effectAlpha, this->effectType);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-void func_80BA7B6C(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_InitCutsceneGibdo(EnRailgibud* this, GlobalContext* globalCtx) {
s32 pad[2];
- func_80BA7C78(this);
- this->unk_3FE = 99;
- this->actor.flags |= 0x100000;
- this->actor.flags |= 0x10;
+ EnRailgibud_InitActorActionCommand(this);
+ this->csAction = 99;
+ this->actor.flags |= ACTOR_FLAG_100000;
+ this->actor.flags |= ACTOR_FLAG_10;
+
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable, 26);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGibdoSkel, &gGibdoRedeadIdleAnim, this->jointTable,
+ this->morphTable, GIBDO_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
if (gSaveContext.entranceIndex != 0x2090) { // NOT Cutscene: Music Box House Opens
Actor_MarkForDeath(&this->actor);
}
- func_80BA7CF0(this);
- this->actor.update = func_80BA8050;
+
+ EnRailgibud_SetupDoNothing(this);
+ this->actor.update = EnRailgibud_Cutscene_Update;
}
-void func_80BA7C78(EnRailgibud* this) {
- switch (ENRAILGIBUD_GET_7F(&this->actor)) {
+void EnRailgibud_InitActorActionCommand(EnRailgibud* this) {
+ switch (ENRAILGIBUD_GET_CUTSCENE_TYPE(&this->actor)) {
case 1:
- this->unk_3FC = 0x207;
+ this->actorActionCommand = 519;
break;
case 2:
- this->unk_3FC = 0x208;
+ this->actorActionCommand = 520;
break;
case 3:
- this->unk_3FC = 0x209;
+ this->actorActionCommand = 521;
break;
case 4:
- this->unk_3FC = 0x20A;
+ this->actorActionCommand = 522;
break;
case 5:
- this->unk_3FC = 0x20B;
+ this->actorActionCommand = 523;
break;
default:
- this->unk_3FC = 0x207;
+ this->actorActionCommand = 519;
break;
}
}
-void func_80BA7CF0(EnRailgibud* this) {
- this->actionFunc = func_80BA7D04;
+void EnRailgibud_SetupDoNothing(EnRailgibud* this) {
+ this->actionFunc = EnRailgibud_DoNothing;
}
-void func_80BA7D04(EnRailgibud* this, GlobalContext* globalCtx) {
+void EnRailgibud_DoNothing(EnRailgibud* this, GlobalContext* globalCtx) {
}
-void func_80BA7D14(EnRailgibud* this) {
- this->unk_3F2 = 30;
- this->actionFunc = func_80BA7D30;
+void EnRailgibud_SetupSinkIntoGround(EnRailgibud* this) {
+ this->sinkTimer = 30;
+ this->actionFunc = EnRailgibud_SinkIntoGround;
}
-void func_80BA7D30(EnRailgibud* this, GlobalContext* globalCtx) {
- if (this->unk_3F2 != 0) {
- this->unk_3F2--;
+void EnRailgibud_SinkIntoGround(EnRailgibud* this, GlobalContext* globalCtx) {
+ if (this->sinkTimer != 0) {
+ this->sinkTimer--;
} else if (Math_SmoothStepToF(&this->actor.shape.yOffset, -9500.0f, 0.5f, 200.0f, 10.0f) < 10.0f) {
Actor_MarkForDeath(&this->actor);
} else {
- func_80BA6800(this, globalCtx, 0);
+ EnRailgibud_SpawnEffectsForSinkingIntoTheGround(this, globalCtx, 0);
}
}
-s32 func_80BA7DC8(EnRailgibud* this, GlobalContext* globalCtx) {
- u32 sp2C;
+s32 EnRailgibud_PerformCutsceneActions(EnRailgibud* this, GlobalContext* globalCtx) {
+ s32 actionIndex;
- if (func_800EE29C(globalCtx, this->unk_3FC)) {
- sp2C = func_800EE200(globalCtx, this->unk_3FC);
- if (this->unk_3FE != globalCtx->csCtx.npcActions[sp2C]->unk0) {
- this->unk_3FE = globalCtx->csCtx.npcActions[sp2C]->unk0;
- switch (globalCtx->csCtx.npcActions[sp2C]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCommand)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, this->actorActionCommand);
+ if (this->csAction != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->csAction = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
- this->unk_3F0 = 9;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_IDLE;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_IDLE);
break;
case 2:
- this->unk_3F0 = 15;
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_SLUMP_START;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_WEAKENED2);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 15);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_SLUMP_START);
break;
case 3:
- this->unk_3F0 = 17;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 17);
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_CONVULSION;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_CONVULSION);
break;
case 4:
- this->unk_3F0 = 18;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 18);
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_ARMS_UP_START;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_ARMS_UP_START);
break;
case 5:
- this->unk_3F0 = 10;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 10);
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_WALK;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_WALK);
break;
}
} else if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- if (this->unk_3F0 == 15) {
- this->unk_3F0 = 16;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 16);
- } else if (this->unk_3F0 == 18) {
- this->unk_3F0 = 19;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 19);
- func_80BA7D14(this);
+ if (this->cutsceneAnimationIndex == EN_RAILGIBUD_ANIMATION_SLUMP_START) {
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_SLUMP_LOOP;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_SLUMP_LOOP);
+ } else if (this->cutsceneAnimationIndex == EN_RAILGIBUD_ANIMATION_ARMS_UP_START) {
+ this->cutsceneAnimationIndex = EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_RAILGIBUD_ANIMATION_ARMS_UP_LOOP);
+ EnRailgibud_SetupSinkIntoGround(this);
}
}
- switch (this->unk_3FE) {
+ switch (this->csAction) {
case 3:
case 4:
- if (this->actionFunc == func_80BA7D30) {
+ if (this->actionFunc == EnRailgibud_SinkIntoGround) {
func_800B9010(&this->actor, NA_SE_EN_REDEAD_WEAKENED_L2 - SFX_FLAG);
} else {
func_800B9010(&this->actor, NA_SE_EN_REDEAD_WEAKENED_L1 - SFX_FLAG);
@@ -1123,18 +1236,18 @@ s32 func_80BA7DC8(EnRailgibud* this, GlobalContext* globalCtx) {
break;
}
- func_800EDF24(&this->actor, globalCtx, sp2C);
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, actionIndex);
return true;
}
- this->unk_3FE = 99;
+ this->csAction = 99;
return false;
}
-void func_80BA8050(Actor* thisx, GlobalContext* globalCtx) {
+void EnRailgibud_Cutscene_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRailgibud* this = THIS;
this->actionFunc(this, globalCtx);
- func_80BA7DC8(this, globalCtx);
+ EnRailgibud_PerformCutsceneActions(this, globalCtx);
SkelAnime_Update(&this->skelAnime);
}
diff --git a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h
index 546a885b5b..0ca4ec0b83 100644
--- a/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h
+++ b/src/overlays/actors/ovl_En_Railgibud/z_en_railgibud.h
@@ -2,49 +2,57 @@
#define Z_EN_RAILGIBUD_H
#include "global.h"
+#include "objects/object_rd/object_rd.h"
struct EnRailgibud;
typedef void (*EnRailgibudActionFunc)(struct EnRailgibud*, GlobalContext*);
-#define ENRAILGIBUD_GET_7F(thisx) ((thisx)->params & 0x7F)
-#define ENRAILGIBUD_GET_80(thisx) ((thisx)->params & 0x80)
-#define ENRAILGIBUD_GET_FF00(thisx) (((thisx)->params & 0xFF00) >> 8)
+#define ENRAILGIBUD_GET_CUTSCENE_TYPE(thisx) ((thisx)->params & 0x7F)
+#define ENRAILGIBUD_IS_CUTSCENE_TYPE(thisx) ((thisx)->params & 0x80)
+#define ENRAILGIBUD_GET_PATH(thisx) (((thisx)->params & 0xFF00) >> 8)
typedef struct EnRailgibud {
/* 0x0000 */ Actor actor;
/* 0x0144 */ ColliderCylinder collider;
/* 0x0190 */ SkelAnime skelAnime;
/* 0x01D4 */ EnRailgibudActionFunc actionFunc;
- /* 0x01D8 */ Vec3f unk_1D8[15];
- /* 0x028C */ s32 unk_28C;
+ /* 0x01D8 */ Vec3f limbPos[15];
+ /* 0x028C */ s32 limbIndex;
/* 0x0290 */ UNK_TYPE1 unk290[0x4];
- /* 0x0294 */ Vec3s* unk_294;
- /* 0x0298 */ s32 unk_298;
- /* 0x029C */ s32 unk_29C;
- /* 0x02A0 */ f32 unk_2A0;
- /* 0x02A4 */ f32 unk_2A4;
- /* 0x02A8 */ Vec3s jointTable[26];
- /* 0x0344 */ Vec3s morphTable[26];
- /* 0x03E0 */ UNK_TYPE1 unk3E0[0x2];
- /* 0x03E2 */ s16 unk_3E2;
- /* 0x03E4 */ UNK_TYPE1 unk3E4[0x4];
- /* 0x03E8 */ s16 unk_3E8;
- /* 0x03EA */ UNK_TYPE1 unk3EA[0x2];
- /* 0x03EC */ s16 unk_3EC;
- /* 0x03EE */ s16 unk_3EE;
- /* 0x03F0 */ s16 unk_3F0;
- /* 0x03F2 */ s16 unk_3F2;
- /* 0x03F4 */ s16 unk_3F4;
- /* 0x03F6 */ s16 unk_3F6;
- /* 0x03F8 */ s16 unk_3F8;
- /* 0x03FA */ s16 unk_3FA;
- /* 0x03FC */ u16 unk_3FC;
- /* 0x03FE */ u16 unk_3FE;
+ /* 0x0294 */ Vec3s* points;
+ /* 0x0298 */ s32 currentPoint;
+ /* 0x029C */ s32 pathCount;
+ /* 0x02A0 */ f32 effectAlpha;
+ /* 0x02A4 */ f32 effectScale;
+ /* 0x02A8 */ Vec3s jointTable[GIBDO_LIMB_MAX];
+ /* 0x0344 */ Vec3s morphTable[GIBDO_LIMB_MAX];
+ /* 0x03E0 */ Vec3s headRotation;
+ /* 0x03E6 */ Vec3s upperBodyRotation;
+ /* 0x03EC */ s16 shouldWalkForward; // Only used by the "main" Gibdo
+ /* 0x03EE */ s16 shouldWalkForwardNextFrame; // Only used by the "main" Gibdo
+ /* 0x03F0 */ union {
+ s16 grabState;
+ s16 cutsceneAnimationIndex;
+ };
+ /* 0x03F2 */ union {
+ s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero
+ s16 grabDamageTimer;
+ s16 headShakeTimer;
+ s16 stunTimer;
+ s16 deathTimer;
+ s16 sinkTimer;
+ };
+ /* 0x03F4 */ s16 grabWaitTimer; // Cannot grab the player if this is non-zero
+ /* 0x03F6 */ s16 effectTimer;
+ /* 0x03F8 */ s16 type;
+ /* 0x03FA */ s16 isInvincible;
+ /* 0x03FC */ u16 actorActionCommand;
+ /* 0x03FE */ u16 csAction;
/* 0x0400 */ u16 textId;
- /* 0x0402 */ s16 unk_402;
- /* 0x0404 */ u8 unk_404;
- /* 0x0405 */ s8 unk_405;
+ /* 0x0402 */ s16 timeInitialized; // unused other than setting it
+ /* 0x0404 */ u8 effectType;
+ /* 0x0405 */ s8 unk_405; // related to player->unk_ADD
} EnRailgibud; // size = 0x408
extern const ActorInit En_Railgibud_InitVars;
diff --git a/src/overlays/actors/ovl_En_Rat/z_en_rat.c b/src/overlays/actors/ovl_En_Rat/z_en_rat.c
index 5160203b22..583d3637cb 100644
--- a/src/overlays/actors/ovl_En_Rat/z_en_rat.c
+++ b/src/overlays/actors/ovl_En_Rat/z_en_rat.c
@@ -6,7 +6,7 @@
#include "z_en_rat.h"
-#define FLAGS 0x00000205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200)
#define THIS ((EnRat*)thisx)
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 766d03070d..4548364943 100644
--- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c
+++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c
@@ -1,12 +1,31 @@
/*
* File: z_en_rd.c
* Overlay: ovl_En_Rd
- * Description: Redead/Gibdo (able to dance)
+ * Description: Redead/Gibdo that cannot talk to the player.
+ *
+ * A variety of different Redeads/Gibdos are represented by this actor;
+ * one of the few things they all have in common is that none of them
+ * can talk with the player, which separates them from Talk_Gibud and
+ * Railgibud. Some of the different kinds of Redeads/Gibdos that this
+ * actor controls are:
+ * - Three different types of dancing Redeads. These are the only
+ * Redead/Gidbo variations that are actually used in the final game.
+ * - A Redead frozen in a block of ice.
+ * - An invisible Redead.
+ * - A crying Redead.
+ * - A Gidbo that rises out of a "coffin"; this is leftover from OoT.
+ *
+ * Another thing that separates this actor from Talk_Gibud and Railgibud
+ * is that most Redead variations will "mourn" other fallen Redeads in
+ * the same area by walking over to their corpse. Note that some Redeads,
+ * depending on their params, will refuse to mourn under certain
+ * circumstances, and all Gibdo variations will refuse to mourn as well.
*/
#include "z_en_rd.h"
+#include "objects/object_rd/object_rd.h"
-#define FLAGS 0x00000415
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((EnRd*)thisx)
@@ -15,56 +34,67 @@ void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnRd_Update(Actor* thisx, GlobalContext* globalCtx);
void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx);
-s32 func_808D41FC(GlobalContext* globalCtx);
-void func_808D4308(EnRd* this);
-void func_808D43AC(EnRd* this, GlobalContext* globalCtx);
-void func_808D45D4(EnRd* this);
-void func_808D4660(EnRd* this, GlobalContext* globalCtx);
-void func_808D47DC(EnRd* this);
-void func_808D4868(EnRd* this, GlobalContext* globalCtx);
-void func_808D49E4(EnRd* this, GlobalContext* globalCtx);
-void func_808D4A90(EnRd* this);
-void func_808D4B20(EnRd* this, GlobalContext* globalCtx);
-void func_808D4CA8(EnRd* this, GlobalContext* globalCtx);
-void func_808D4DC4(EnRd* this);
-void func_808D4E60(EnRd* this, GlobalContext* globalCtx);
-void func_808D506C(EnRd* this, GlobalContext* globalCtx);
-void func_808D53C0(EnRd* this, GlobalContext* globalCtx);
-void func_808D5440(EnRd* this, GlobalContext* globalCtx);
-void func_808D5660(EnRd* this);
-void func_808D56E4(EnRd* this, GlobalContext* globalCtx);
-void func_808D586C(EnRd* this);
-void func_808D58CC(EnRd* this, GlobalContext* globalCtx);
-void func_808D5C54(EnRd* this);
-void func_808D5CCC(EnRd* this, GlobalContext* globalCtx);
-void func_808D5D88(EnRd* this);
-void func_808D5DF4(EnRd* this, GlobalContext* globalCtx);
-void func_808D5E98(EnRd* this);
-void func_808D5F18(EnRd* this, GlobalContext* globalCtx);
-void func_808D6008(EnRd* this);
-void func_808D6054(EnRd* this, GlobalContext* globalCtx);
-void func_808D60B0(EnRd* this);
-void func_808D6130(EnRd* this, GlobalContext* globalCtx);
-void func_808D6200(EnRd* this, GlobalContext* globalCtx);
-void func_808D6388(EnRd* this, GlobalContext* globalCtx);
-void func_808D65BC(EnRd* this, GlobalContext* globalCtx);
+s32 EnRd_ShouldNotDance(GlobalContext* globalCtx);
+void EnRd_SetupIdle(EnRd* this);
+void EnRd_Idle(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupSquattingDance(EnRd* this);
+void EnRd_SquattingDance(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupClappingDance(EnRd* this);
+void EnRd_ClappingDance(EnRd* this, GlobalContext* globalCtx);
+void EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupPirouette(EnRd* this);
+void EnRd_Pirouette(EnRd* this, GlobalContext* globalCtx);
+void EnRd_EndPirouetteWhenPlayerIsClose(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupRiseFromCoffin(EnRd* this);
+void EnRd_RiseFromCoffin(EnRd* this, GlobalContext* globalCtx);
+void EnRd_WalkToPlayer(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupWalkToHome(EnRd* this, GlobalContext* globalCtx);
+void EnRd_WalkToHome(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupWalkToParent(EnRd* this);
+void EnRd_WalkToParent(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupGrab(EnRd* this);
+void EnRd_Grab(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupAttemptPlayerFreeze(EnRd* this);
+void EnRd_AttemptPlayerFreeze(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupGrabFail(EnRd* this);
+void EnRd_GrabFail(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupTurnAwayAndShakeHead(EnRd* this);
+void EnRd_TurnAwayAndShakeHead(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupStandUp(EnRd* this);
+void EnRd_StandUp(EnRd* this, GlobalContext* globalCtx);
+void EnRd_SetupCrouch(EnRd* this);
+void EnRd_Crouch(EnRd* this, GlobalContext* globalCtx);
+void EnRd_Damage(EnRd* this, GlobalContext* globalCtx);
+void EnRd_Dead(EnRd* this, GlobalContext* globalCtx);
+void EnRd_Stunned(EnRd* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_060053E8;
-extern AnimationHeader D_06006678;
-extern AnimationHeader D_06006B08;
-extern AnimationHeader D_06006EEC;
-extern AnimationHeader D_060073A4;
-extern AnimationHeader D_06007BBC;
-extern AnimationHeader D_060081A8;
-extern AnimationHeader D_06009298;
-extern AnimationHeader D_06009900;
-extern AnimationHeader D_0600A450;
-extern AnimationHeader D_0600ABE0;
-extern FlexSkeletonHeader D_06010B88;
-extern AnimationHeader D_060113EC;
-extern AnimationHeader D_060118D8;
-extern AnimationHeader D_06011DB8;
-extern AnimationHeader D_0601216C;
+typedef enum {
+ /* 0 */ EN_RD_ACTION_IDLE,
+ /* 1 */ EN_RD_ACTION_STUNNED,
+ /* 2 */ EN_RD_ACTION_WALKING_TO_HOME,
+ /* 3 */ EN_RD_ACTION_WALKING_TO_PARENT,
+ /* 4 */ EN_RD_ACTION_WALKING_TO_PLAYER_OR_RELEASING_GRAB,
+ /* 5 */ EN_RD_ACTION_STANDING_UP,
+ /* 6 */ EN_RD_ACTION_CROUCHING,
+ /* 7 */ EN_RD_ACTION_ATTEMPTING_PLAYER_STUN,
+ /* 8 */ EN_RD_ACTION_FAILING_GRAB,
+ /* 9 */ EN_RD_ACTION_TURNING_AWAY_AND_SHAKING_HEAD,
+ /* 10 */ EN_RD_ACTION_GRABBING,
+ /* 11 */ EN_RD_ACTION_DAMAGE,
+ /* 12 */ EN_RD_ACTION_DEAD,
+ /* 13 */ EN_RD_ACTION_RISING_FROM_COFFIN,
+ /* 14 */ EN_RD_ACTION_SQUATTING_DANCE,
+ /* 15 */ EN_RD_ACTION_CLAPPING_DANCE,
+ /* 16 */ EN_RD_ACTION_PIROUETTE
+} EnRdAction;
+
+typedef enum {
+ /* 0 */ EN_RD_GRAB_START,
+ /* 1 */ EN_RD_GRAB_INITIAL_DAMAGE,
+ /* 2 */ EN_RD_GRAB_ATTACK,
+ /* 3 */ EN_RD_GRAB_RELEASE,
+ /* 4 */ EN_RD_GRAB_END,
+} EnRdGrabState;
const ActorInit En_Rd_InitVars = {
ACTOR_EN_RD,
@@ -98,39 +128,52 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 70, 0, { 0, 0, 0 } },
};
+typedef enum {
+ /* 0x0 */ EN_RD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all
+ /* 0x1 */ EN_RD_DMGEFF_STUN, // Stuns without applying any effect
+ /* 0x2 */ EN_RD_DMGEFF_FIRE_ARROW, // Damages and applies a fire effect
+ /* 0x4 */ EN_RD_DMGEFF_LIGHT_ARROW = 0x4, // Damages and applies a light effect
+ /* 0x6 */ EN_RD_DMGEFF_UNUSED_6 = 0x6, // Referenced in EnRd_Update, but no attack uses this damage effect.
+ // Likely to have originally been used for Ice Arrows like OoT.
+ /* 0xC */ EN_RD_DMGEFF_ZORA_MAGIC = 0xC, // Stuns and applies an electric effect
+ /* 0xD */ EN_RD_DMGEFF_RECOIL, // Deals no damage, but displays hit mark and recoil animation
+ /* 0xE */ EN_RD_DMGEFF_LIGHT_RAY, // Instantly kills on contact
+ /* 0xF */ EN_RD_DMGEFF_DAMAGE, // Deals damage and plays the damage animation
+} EnRdDamageEffect;
+
static DamageTable sDamageTable = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(2, 0xF),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(1, 0xF),
- /* Zora boomerang */ DMG_ENTRY(0, 0xD),
- /* Normal arrow */ DMG_ENTRY(0, 0xD),
- /* UNK_DMG_0x06 */ DMG_ENTRY(2, 0xF),
- /* Hookshot */ DMG_ENTRY(0, 0xD),
- /* Goron punch */ DMG_ENTRY(1, 0xF),
- /* Sword */ DMG_ENTRY(1, 0xF),
- /* Goron pound */ DMG_ENTRY(1, 0xF),
- /* Fire arrow */ DMG_ENTRY(1, 0x2),
- /* Ice arrow */ DMG_ENTRY(0, 0xD),
- /* Light arrow */ DMG_ENTRY(2, 0x4),
- /* Goron spikes */ DMG_ENTRY(1, 0xF),
- /* Deku spin */ DMG_ENTRY(0, 0x1),
- /* Deku bubble */ DMG_ENTRY(0, 0xD),
- /* Deku launch */ DMG_ENTRY(2, 0xF),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0xC),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0xE),
- /* Thrown object */ DMG_ENTRY(1, 0xF),
- /* Zora punch */ DMG_ENTRY(1, 0xF),
- /* Spin attack */ DMG_ENTRY(1, 0xF),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(1, 0xF),
+ /* Deku Nut */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Deku Stick */ DMG_ENTRY(2, EN_RD_DMGEFF_DAMAGE),
+ /* Horse trample */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Explosives */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Zora boomerang */ DMG_ENTRY(0, EN_RD_DMGEFF_RECOIL),
+ /* Normal arrow */ DMG_ENTRY(0, EN_RD_DMGEFF_RECOIL),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(2, EN_RD_DMGEFF_DAMAGE),
+ /* Hookshot */ DMG_ENTRY(0, EN_RD_DMGEFF_RECOIL),
+ /* Goron punch */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Sword */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Goron pound */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Fire arrow */ DMG_ENTRY(1, EN_RD_DMGEFF_FIRE_ARROW),
+ /* Ice arrow */ DMG_ENTRY(0, EN_RD_DMGEFF_RECOIL),
+ /* Light arrow */ DMG_ENTRY(2, EN_RD_DMGEFF_LIGHT_ARROW),
+ /* Goron spikes */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Deku spin */ DMG_ENTRY(0, EN_RD_DMGEFF_STUN),
+ /* Deku bubble */ DMG_ENTRY(0, EN_RD_DMGEFF_RECOIL),
+ /* Deku launch */ DMG_ENTRY(2, EN_RD_DMGEFF_DAMAGE),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Zora barrier */ DMG_ENTRY(0, EN_RD_DMGEFF_ZORA_MAGIC),
+ /* Normal shield */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Light ray */ DMG_ENTRY(0, EN_RD_DMGEFF_LIGHT_RAY),
+ /* Thrown object */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Zora punch */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Spin attack */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
+ /* Sword beam */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Normal Roll */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Unblockable */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, EN_RD_DMGEFF_NONE),
+ /* Powder Keg */ DMG_ENTRY(1, EN_RD_DMGEFF_DAMAGE),
};
static InitChainEntry sInitChain[] = {
@@ -147,86 +190,86 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 0;
this->actor.colChkInfo.damageTable = &sDamageTable;
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
- this->unk_3DA = this->unk_3D8 = 0;
+ this->upperBodyYRotation = this->headYRotation = 0;
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 50.0f;
this->actor.colChkInfo.mass = MASS_HEAVY;
this->actor.colChkInfo.health = 8;
- this->unk_3DE = 255;
+ this->alpha = 255;
this->unk_3F1 = -1;
- this->unk_3DC = ENRD_GET_FF00(thisx);
+ this->flags = EN_RD_GET_FLAGS(thisx);
- if (ENRD_GET_80(&this->actor)) {
+ if (EN_RD_GET_80(&this->actor)) {
this->actor.params |= 0xFF00;
} else {
this->actor.params &= 0xFF;
}
- if (this->actor.params >= ENRD_GET_MINUS_1) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06010B88, &D_0600ABE0, this->jointTable, this->morphTable,
- 26);
+ if (EN_RD_GET_TYPE(&this->actor) > EN_RD_TYPE_GIBDO) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gRedeadSkel, &gGibdoRedeadIdleAnim, this->jointTable,
+ this->morphTable, REDEAD_LIMB_MAX);
} else {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060053E8, &D_0600ABE0, this->jointTable, this->morphTable,
- 26);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGibdoSkel, &gGibdoRedeadIdleAnim, this->jointTable,
+ this->morphTable, REDEAD_LIMB_MAX);
}
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
- if (this->actor.params >= ENRD_GET_MINUS_2) {
- switch (this->actor.params) {
- case 5:
- if (!func_808D41FC(globalCtx)) {
- func_808D45D4(this);
+ if (EN_RD_GET_TYPE(&this->actor) >= EN_RD_TYPE_GIBDO) {
+ switch (EN_RD_GET_TYPE(&this->actor)) {
+ case EN_RD_TYPE_SQUATTING_DANCE:
+ if (!EnRd_ShouldNotDance(globalCtx)) {
+ EnRd_SetupSquattingDance(this);
} else {
this->actor.hintId = 0x2A;
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
- this->unkFunc = func_808D45D4;
+ this->setupDanceFunc = EnRd_SetupSquattingDance;
break;
- case 6:
- if (!func_808D41FC(globalCtx)) {
- func_808D47DC(this);
+ case EN_RD_TYPE_CLAPPING_DANCE:
+ if (!EnRd_ShouldNotDance(globalCtx)) {
+ EnRd_SetupClappingDance(this);
} else {
this->actor.hintId = 0x2A;
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
- this->unkFunc = func_808D47DC;
+ this->setupDanceFunc = EnRd_SetupClappingDance;
break;
- case 7:
- if (!func_808D41FC(globalCtx)) {
- func_808D4A90(this);
+ case EN_RD_TYPE_PIROUETTE:
+ if (!EnRd_ShouldNotDance(globalCtx)) {
+ EnRd_SetupPirouette(this);
} else {
this->actor.hintId = 0x2A;
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
- this->unkFunc = func_808D4A90;
+ this->setupDanceFunc = EnRd_SetupPirouette;
break;
default:
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- func_808D4308(this);
- this->unkFunc = func_808D4308;
+ EnRd_SetupIdle(this);
+ this->setupDanceFunc = EnRd_SetupIdle;
break;
}
} else {
- func_808D4DC4(this);
+ EnRd_SetupRiseFromCoffin(this);
}
SkelAnime_Update(&this->skelAnime);
- if (this->actor.params == ENRD_GET_3) {
- this->actor.flags |= 0x80;
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_INVISIBLE) {
+ this->actor.flags |= ACTOR_FLAG_80;
}
- if (this->actor.params == ENRD_GET_4) {
- s32 pad2;
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_FROZEN) {
+ s32 requiredScopeTemp;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_OBJ_ICE_POLY, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x,
@@ -237,102 +280,130 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) {
void EnRd_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnRd* this = THIS;
- if (gSaveContext.unk_3F58 != 0) {
- gSaveContext.unk_3F58 = 0;
+ if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
+ gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
}
Collider_DestroyCylinder(globalCtx, &this->collider);
}
-void func_808D4190(GlobalContext* globalCtx, EnRd* this, s32 arg2) {
- Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first;
+/**
+ * This function does two things depending on whether setParent is true or false.
+ * - If setParent is true, this function sets thisx to be the parent for all Redeads
+ * in the area that are capable of mourning. This is used right when thisx first
+ * dies to make the other Redeads mourn it.
+ * - If setParent is false, this function nulls out the parent for all Redeads in the
+ * are whose parents is thisx. This is used when thisx is fading away to make the
+ * other Redeads stop mourning over it.
+ */
+void EnRd_UpdateParentForOtherRedeads(GlobalContext* globalCtx, Actor* thisx, s32 setParent) {
+ Actor* enemyIterator = globalCtx->actorCtx.actorLists[ACTORCAT_ENEMY].first;
- while (actor != NULL) {
- if ((actor->id != ACTOR_EN_RD) || (this == (EnRd*)actor) || (actor->params < ENRD_GET_0)) {
- actor = actor->next;
+ while (enemyIterator != NULL) {
+ if ((enemyIterator->id != ACTOR_EN_RD) || (enemyIterator == thisx) ||
+ (EN_RD_GET_TYPE(enemyIterator) < EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING)) {
+ enemyIterator = enemyIterator->next;
continue;
- } else if (arg2 != 0) {
- actor->parent = &this->actor;
- } else if (this == (EnRd*)actor->parent) {
- actor->parent = NULL;
}
- actor = actor->next;
+
+ if (setParent) {
+ enemyIterator->parent = thisx;
+ } else if (thisx == enemyIterator->parent) {
+ enemyIterator->parent = NULL;
+ }
+
+ enemyIterator = enemyIterator->next;
}
}
-s32 func_808D41FC(GlobalContext* globalCtx) {
+/**
+ * Returns true if the various dancing Redead types *should not* be dancing
+ * and returns false if they *should* be dancing. The non-dancing Redeads
+ * do not call this function in the final game and thus don't care about
+ * what mask the player has equipped.
+ */
+s32 EnRd_ShouldNotDance(GlobalContext* globalCtx) {
if ((Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) || (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) ||
(Player_GetMask(globalCtx) == PLAYER_MASK_GARO)) {
return false;
}
+
return true;
}
-void func_808D4260(EnRd* this, GlobalContext* globalCtx) {
- if ((this->actor.params >= ENRD_GET_5) && (this->actionFunc != func_808D4660) &&
- (this->actionFunc != func_808D4868) && (this->actionFunc != func_808D4B20) &&
- (this->actionFunc != func_808D65BC) && (this->actionFunc != func_808D58CC) &&
- (this->actionFunc != func_808D6200) && (this->actionFunc != func_808D6388)) {
- if (!func_808D41FC(globalCtx)) {
- this->unkFunc(this);
+/**
+ * If the Redead/Gibdo is a dancing Redead; if it isn't already dancing; if it isn't stunned,
+ * taking damage, dead, or currently grabbing the player; and if the player is wearing the
+ * appropriate mask, this function will make the Redead start dancing.
+ */
+void EnRd_SetupDanceIfConditionsMet(EnRd* this, GlobalContext* globalCtx) {
+ if ((EN_RD_GET_TYPE(&this->actor) >= EN_RD_TYPE_SQUATTING_DANCE) && (this->actionFunc != EnRd_SquattingDance) &&
+ (this->actionFunc != EnRd_ClappingDance) && (this->actionFunc != EnRd_Pirouette) &&
+ (this->actionFunc != EnRd_Stunned) && (this->actionFunc != EnRd_Grab) && (this->actionFunc != EnRd_Damage) &&
+ (this->actionFunc != EnRd_Dead)) {
+ if (!EnRd_ShouldNotDance(globalCtx)) {
+ this->setupDanceFunc(this);
}
}
}
-void func_808D4308(EnRd* this) {
- if (this->actor.params != ENRD_GET_2) {
- Animation_MorphToLoop(&this->skelAnime, &D_0600ABE0, -6.0f);
+void EnRd_SetupIdle(EnRd* this) {
+ if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) {
+ Animation_MorphToLoop(&this->skelAnime, &gGibdoRedeadIdleAnim, -6.0f);
} else {
- Animation_PlayLoop(&this->skelAnime, &D_060081A8);
+ Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadSobbingAnim);
}
- this->unk_3EF = 0;
- this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f;
+ this->action = EN_RD_ACTION_IDLE;
+ this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
- this->actionFunc = func_808D43AC;
+ this->actionFunc = EnRd_Idle;
}
-void func_808D43AC(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_Idle(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
- if ((this->actor.params == ENRD_GET_2) && Animation_OnFrame(&this->skelAnime, 0.0f)) {
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
+
+ if ((EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_CRYING) && Animation_OnFrame(&this->skelAnime, 0.0f)) {
if (Rand_ZeroOne() >= 0.5f) {
- Animation_PlayLoop(&this->skelAnime, &D_060081A8);
+ Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadSobbingAnim);
} else {
- Animation_PlayLoop(&this->skelAnime, &D_06007BBC);
+ Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadWipingTearsAnim);
}
} else {
- this->unk_3D6--;
- if (this->unk_3D6 == 0) {
- this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 10.0f;
+ this->animationJudderTimer--;
+ if (this->animationJudderTimer == 0) {
+ // This resets the idle animation back to its first frame, making the
+ // Redead/Gibdo appear to "judder" in place.
+ this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 10.0f;
this->skelAnime.curFrame = 0.0f;
}
}
if (this->actor.parent != NULL) {
- if (this->unk_3EC == 0) {
- if (this->actor.params != ENRD_GET_2) {
- func_808D5660(this);
+ if (!this->isMourning) {
+ if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) {
+ EnRd_SetupWalkToParent(this);
} else {
- func_808D6008(this);
+ EnRd_SetupStandUp(this);
}
}
} else {
- if (this->unk_3EC != 0) {
- if (this->actor.params != ENRD_GET_2) {
- func_808D5C54(this);
+ if (this->isMourning) {
+ if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) {
+ EnRd_SetupAttemptPlayerFreeze(this);
} else {
- func_808D6008(this);
+ EnRd_SetupStandUp(this);
}
}
- this->unk_3EC = 0;
+ this->isMourning = false;
if ((this->actor.xzDistToPlayer <= 150.0f) && func_800B715C(globalCtx)) {
- if ((this->actor.params != ENRD_GET_2) && (this->unk_3EC == 0)) {
- func_808D5C54(this);
+ if ((EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) && (!this->isMourning)) {
+ EnRd_SetupAttemptPlayerFreeze(this);
} else {
- func_808D6008(this);
+ EnRd_SetupStandUp(this);
}
}
}
@@ -342,42 +413,43 @@ void func_808D43AC(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D45D4(EnRd* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_0601216C, -6.0f);
- this->unk_3EF = 14;
- this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f;
- this->unk_3E4 = 0;
+void EnRd_SetupSquattingDance(EnRd* this) {
+ Animation_MorphToLoop(&this->skelAnime, &gGibdoRedeadSquattingDanceAnim, -6.0f);
+ this->action = EN_RD_ACTION_SQUATTING_DANCE;
+ this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f;
+ this->danceEndTimer = 0;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
- this->actionFunc = func_808D4660;
+ this->actionFunc = EnRd_SquattingDance;
}
-void func_808D4660(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_SquattingDance(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
- if (this->unk_3EC != 0) {
- func_808D5C54(this);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
+
+ if (this->isMourning) {
+ EnRd_SetupAttemptPlayerFreeze(this);
}
- this->unk_3EC = 0;
- if ((this->actor.xzDistToPlayer <= 150.0f) && func_808D41FC(globalCtx) && func_800B715C(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ this->isMourning = false;
+ if ((this->actor.xzDistToPlayer <= 150.0f) && EnRd_ShouldNotDance(globalCtx) && func_800B715C(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f);
- this->actionFunc = func_808D49E4;
+ Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 19.0f, 2, -10.0f);
+ this->actionFunc = EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose;
}
- if (func_808D41FC(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ if (EnRd_ShouldNotDance(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
@@ -385,42 +457,43 @@ void func_808D4660(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D47DC(EnRd* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06011DB8, -6.0f);
- this->unk_3EF = 15;
- this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f;
- this->unk_3E4 = 0;
+void EnRd_SetupClappingDance(EnRd* this) {
+ Animation_MorphToLoop(&this->skelAnime, &gGibdoRedeadClappingDanceAnim, -6.0f);
+ this->action = EN_RD_ACTION_CLAPPING_DANCE;
+ this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f;
+ this->danceEndTimer = 0;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
- this->actionFunc = func_808D4868;
+ this->actionFunc = EnRd_ClappingDance;
}
-void func_808D4868(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_ClappingDance(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
- if (this->unk_3EC != 0) {
- func_808D5C54(this);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
+
+ if (this->isMourning) {
+ EnRd_SetupAttemptPlayerFreeze(this);
}
- this->unk_3EC = 0;
- if ((this->actor.xzDistToPlayer <= 150.0f) && func_808D41FC(globalCtx) && func_800B715C(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ this->isMourning = false;
+ if ((this->actor.xzDistToPlayer <= 150.0f) && EnRd_ShouldNotDance(globalCtx) && func_800B715C(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f);
- this->actionFunc = func_808D49E4;
+ Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 19.0f, 2, -10.0f);
+ this->actionFunc = EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose;
}
- if (func_808D41FC(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ if (EnRd_ShouldNotDance(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
@@ -428,58 +501,59 @@ void func_808D4868(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D49E4(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY);
}
- this->unk_3E4++;
- if (this->unk_3E4 > 10) {
- if ((this->actor.params != ENRD_GET_2) && (this->unk_3EC == 0)) {
- func_808D5C54(this);
+ this->danceEndTimer++;
+ if (this->danceEndTimer > 10) {
+ if ((EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) && (!this->isMourning)) {
+ EnRd_SetupAttemptPlayerFreeze(this);
} else {
- func_808D6008(this);
+ EnRd_SetupStandUp(this);
}
- this->unk_3E4 = 0;
+ this->danceEndTimer = 0;
}
}
-void func_808D4A90(EnRd* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060118D8, -6.0f);
- this->unk_3EF = 16;
- this->unk_3D6 = (Rand_ZeroOne() * 10.0f) + 5.0f;
- this->unk_3E4 = 4370;
+void EnRd_SetupPirouette(EnRd* this) {
+ Animation_MorphToLoop(&this->skelAnime, &gGibdoRedeadPirouetteAnim, -6.0f);
+ this->action = EN_RD_ACTION_PIROUETTE;
+ this->animationJudderTimer = (Rand_ZeroOne() * 10.0f) + 5.0f;
+ this->pirouetteRotationalVelocity = 0x1112;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
- this->actionFunc = func_808D4B20;
+ this->actionFunc = EnRd_Pirouette;
}
-void func_808D4B20(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_Pirouette(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
- if (this->unk_3EC != 0) {
- func_808D5C54(this);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
+
+ if (this->isMourning) {
+ EnRd_SetupAttemptPlayerFreeze(this);
}
- this->unk_3EC = 0;
- if ((this->actor.xzDistToPlayer <= 150.0f) && func_808D41FC(globalCtx) && func_800B715C(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ this->isMourning = false;
+ if ((this->actor.xzDistToPlayer <= 150.0f) && EnRd_ShouldNotDance(globalCtx) && func_800B715C(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- this->actionFunc = func_808D4CA8;
+ this->actionFunc = EnRd_EndPirouetteWhenPlayerIsClose;
}
- if (func_808D41FC(globalCtx)) {
- if (this->actor.params == ENRD_GET_MINUS_2) {
+ if (EnRd_ShouldNotDance(globalCtx)) {
+ if (EN_RD_GET_TYPE(&this->actor) == EN_RD_TYPE_GIBDO) {
this->actor.hintId = 0x2D;
} else {
this->actor.hintId = 0x2A;
}
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
@@ -487,53 +561,54 @@ void func_808D4B20(EnRd* this, GlobalContext* globalCtx) {
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- this->unk_3E4 = 4370;
+ this->pirouetteRotationalVelocity = 0x1112;
} else if (Animation_OnFrame(&this->skelAnime, 15.0f)) {
- this->unk_3E4 = 6554;
+ this->pirouetteRotationalVelocity = 0x199A;
}
- this->actor.world.rot.y -= this->unk_3E4;
+ this->actor.world.rot.y -= this->pirouetteRotationalVelocity;
this->actor.shape.rot.y = this->actor.world.rot.y;
}
-void func_808D4CA8(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_EndPirouetteWhenPlayerIsClose(EnRd* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY);
}
- this->actor.world.rot.y -= this->unk_3E4;
+ this->actor.world.rot.y -= this->pirouetteRotationalVelocity;
this->actor.shape.rot.y = this->actor.world.rot.y;
- this->unk_3E4 -= 100;
- if ((this->unk_3E4 < 2100) && (this->unk_3E4 >= 2000)) {
- Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, 19.0f, 2, -10.0f);
- } else if (this->unk_3E4 < 1000) {
- if ((this->actor.params != ENRD_GET_2) && (this->unk_3EC == 0)) {
- func_808D5C54(this);
+ this->pirouetteRotationalVelocity -= 0x64;
+ if ((this->pirouetteRotationalVelocity < 0x834) && (this->pirouetteRotationalVelocity >= 0x7D0)) {
+ Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 19.0f, 2, -10.0f);
+ } else if (this->pirouetteRotationalVelocity < 0x3E8) {
+ if ((EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) && (!this->isMourning)) {
+ EnRd_SetupAttemptPlayerFreeze(this);
} else {
- func_808D6008(this);
+ EnRd_SetupStandUp(this);
}
}
}
-void func_808D4DC4(EnRd* this) {
- Animation_Change(&this->skelAnime, &D_0600ABE0, 0.0f, 0.0f, Animation_GetLastFrame(&D_0600ABE0), 0, -6.0f);
- this->unk_3EF = 13;
- this->unk_3D6 = 6;
+void EnRd_SetupRiseFromCoffin(EnRd* this) {
+ Animation_Change(&this->skelAnime, &gGibdoRedeadIdleAnim, 0.0f, 0.0f, Animation_GetLastFrame(&gGibdoRedeadIdleAnim),
+ 0, -6.0f);
+ this->action = EN_RD_ACTION_RISING_FROM_COFFIN;
+ this->coffinRiseForwardAccelTimer = 6;
this->actor.shape.rot.x = -0x4000;
this->actor.gravity = 0.0f;
this->actor.shape.yOffset = 0.0f;
this->actor.speedXZ = 0.0f;
- this->actionFunc = func_808D4E60;
+ this->actionFunc = EnRd_RiseFromCoffin;
}
-void func_808D4E60(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_RiseFromCoffin(EnRd* this, GlobalContext* globalCtx) {
if (this->actor.shape.rot.x != -0x4000) {
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0);
if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y, 0.3f, 2.0f, 0.3f) == 0.0f) {
this->actor.gravity = -3.5f;
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
} else {
if (this->actor.world.pos.y == this->actor.home.pos.y) {
@@ -541,8 +616,8 @@ void func_808D4E60(EnRd* this, GlobalContext* globalCtx) {
}
if (Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 50.0f, 0.3f, 2.0f, 0.3f) == 0.0f) {
- if (this->unk_3D6 != 0) {
- this->unk_3D6--;
+ if (this->coffinRiseForwardAccelTimer != 0) {
+ this->coffinRiseForwardAccelTimer--;
Math_SmoothStepToF(&this->actor.speedXZ, 6.0f, 0.3f, 1.0f, 0.3f);
} else if (Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.3f, 1.0f, 0.3f) == 0.0f) {
Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x7D0, 0);
@@ -551,71 +626,74 @@ void func_808D4E60(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D4FE0(EnRd* this, GlobalContext* globalCtx) {
- f32 frameCount = Animation_GetLastFrame(&D_060113EC);
+void EnRd_SetupWalkToPlayer(EnRd* this, GlobalContext* globalCtx) {
+ f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim);
- Animation_Change(&this->skelAnime, &D_060113EC, 1.0f, 4.0f, frameCount, 1, -4.0f);
+ Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 1.0f, 4.0f, frameCount, 1, -4.0f);
this->actor.speedXZ = 0.4f;
- this->unk_3EF = 4;
- this->actionFunc = func_808D506C;
+ this->action = EN_RD_ACTION_WALKING_TO_PLAYER_OR_RELEASING_GRAB;
+ this->actionFunc = EnRd_WalkToPlayer;
}
-void func_808D506C(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_WalkToPlayer(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 pad;
- s16 sp36 = ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->unk_3D8) - this->unk_3DA;
+ s16 yaw =
+ ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->headYRotation) - this->upperBodyYRotation;
this->skelAnime.playSpeed = this->actor.speedXZ;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 250, 0);
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime);
if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
- func_808D53C0(this, globalCtx);
+ EnRd_SetupWalkToHome(this, globalCtx);
}
- if ((ABS_ALT(sp36) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) {
+ if ((ABS_ALT(yaw) < 0x1554) && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 150.0f)) {
if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
- !(player->stateFlags2 & 0x4080)) {
- if (this->unk_3ED == 0) {
- if (!(this->unk_3DC & 0x80)) {
+ !(player->stateFlags2 & (0x4000 | 0x80))) {
+ if (this->playerStunWaitTimer == 0) {
+ if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) {
player->actor.freezeTimer = 40;
func_80123E90(globalCtx, &this->actor);
GET_PLAYER(globalCtx)->unk_A78 = &this->actor;
func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150);
}
- this->unk_3ED = 60;
+ this->playerStunWaitTimer = 60;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
}
} else {
- func_808D53C0(this, globalCtx);
+ EnRd_SetupWalkToHome(this, globalCtx);
}
}
- if (this->unk_3EE != 0) {
- this->unk_3EE--;
+ if (this->grabWaitTimer != 0) {
+ this->grabWaitTimer--;
}
- if (!this->unk_3EE && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 45.0f) &&
+ if (!this->grabWaitTimer && (Actor_DistanceBetweenActors(&this->actor, &player->actor) <= 45.0f) &&
Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
player->actor.freezeTimer = 0;
if ((player->transformation == PLAYER_FORM_GORON) || (player->transformation == PLAYER_FORM_DEKU)) {
if (Actor_DistanceToPoint(&this->actor, &this->actor.home.pos) < 150.0f) {
- func_808D5D88(this);
+ // If the Gibdo/Redead tries to grab Goron or Deku Link, it will fail to
+ // do so. It will appear to take damage and shake its head side-to-side.
+ EnRd_SetupGrabFail(this);
} else {
- func_808D53C0(this, globalCtx);
+ EnRd_SetupWalkToHome(this, globalCtx);
}
} else if (globalCtx->grabPlayer(globalCtx, player)) {
- this->actor.flags &= ~1;
- func_808D586C(this);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ EnRd_SetupGrab(this);
}
- } else if (this->actor.params > ENRD_GET_0) {
+ } else if (EN_RD_GET_TYPE(&this->actor) > EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING) {
if (this->actor.parent != NULL) {
- func_808D5660(this);
+ EnRd_SetupWalkToParent(this);
} else {
- this->unk_3EC = 0;
+ this->isMourning = false;
}
}
@@ -626,13 +704,14 @@ void func_808D506C(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D53C0(EnRd* this, GlobalContext* globalCtx) {
- Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, Animation_GetLastFrame(&D_060113EC), 1, -4.0f);
- this->unk_3EF = 2;
- this->actionFunc = func_808D5440;
+void EnRd_SetupWalkToHome(EnRd* this, GlobalContext* globalCtx) {
+ Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, Animation_GetLastFrame(&gGibdoRedeadWalkAnim),
+ 1, -4.0f);
+ this->action = EN_RD_ACTION_WALKING_TO_HOME;
+ this->actionFunc = EnRd_WalkToHome;
}
-void func_808D5440(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_WalkToHome(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 pad;
s16 sp36 = Actor_YawToPoint(&this->actor, &this->actor.home.pos);
@@ -642,30 +721,30 @@ void func_808D5440(EnRd* this, GlobalContext* globalCtx) {
} else {
this->actor.speedXZ = 0.0f;
if (!Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 450, 0)) {
- if (this->actor.params != ENRD_GET_2) {
- func_808D4308(this);
+ if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) {
+ EnRd_SetupIdle(this);
} else {
- func_808D60B0(this);
+ EnRd_SetupCrouch(this);
}
}
}
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
SkelAnime_Update(&this->skelAnime);
if (!(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
- !(player->stateFlags2 & 0x4080) && (player->transformation != PLAYER_FORM_GORON) &&
+ !(player->stateFlags2 & (0x4000 | 0x80)) && (player->transformation != PLAYER_FORM_GORON) &&
(player->transformation != PLAYER_FORM_DEKU) &&
(Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f)) {
this->actor.targetMode = 0;
- func_808D4FE0(this, globalCtx);
- } else if (this->actor.params > ENRD_GET_0) {
+ EnRd_SetupWalkToPlayer(this, globalCtx);
+ } else if (EN_RD_GET_TYPE(&this->actor) > EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING) {
if (this->actor.parent != NULL) {
- func_808D5660(this);
+ EnRd_SetupWalkToParent(this);
} else {
- this->unk_3EC = 0;
+ this->isMourning = false;
}
}
@@ -676,39 +755,45 @@ void func_808D5440(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D5660(EnRd* this) {
- f32 frameCount = Animation_GetLastFrame(&D_060113EC);
+void EnRd_SetupWalkToParent(EnRd* this) {
+ f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim);
- Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, frameCount, 1, -4.0f);
- this->unk_3EF = 3;
- this->unk_3EC = 1;
- this->actionFunc = func_808D56E4;
+ Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, frameCount, 1, -4.0f);
+ this->action = EN_RD_ACTION_WALKING_TO_PARENT;
+ this->isMourning = true;
+ this->actionFunc = EnRd_WalkToParent;
}
-void func_808D56E4(EnRd* this, GlobalContext* globalCtx) {
+/**
+ * When a Redead or Gibdo dies, it sets itself to be the parent for all other
+ * Redeads in the area that are capable of mourning. This function will make
+ * these Redeads walk over to the corpse and stand near until it begins to
+ * fade away.
+ */
+void EnRd_WalkToParent(EnRd* this, GlobalContext* globalCtx) {
s32 pad;
s16 yaw;
- Vec3f sp2C;
+ Vec3f parentPos;
if (this->actor.parent != NULL) {
- sp2C = this->actor.parent->world.pos;
- yaw = Actor_YawToPoint(&this->actor, &sp2C);
+ parentPos = this->actor.parent->world.pos;
+ yaw = Actor_YawToPoint(&this->actor, &parentPos);
Math_SmoothStepToS(&this->actor.shape.rot.y, yaw, 1, 250, 0);
- if (Actor_DistanceToPoint(&this->actor, &sp2C) >= 45.0f) {
+ if (Actor_DistanceToPoint(&this->actor, &parentPos) >= 45.0f) {
this->actor.speedXZ = 0.4f;
} else {
this->actor.speedXZ = 0.0f;
- if (this->actor.params != ENRD_GET_2) {
- func_808D4308(this);
+ if (EN_RD_GET_TYPE(&this->actor) != EN_RD_TYPE_CRYING) {
+ EnRd_SetupIdle(this);
} else {
- func_808D60B0(this);
+ EnRd_SetupCrouch(this);
}
}
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 100, 0);
} else {
- func_808D4FE0(this, globalCtx);
+ EnRd_SetupWalkToPlayer(this, globalCtx);
}
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -721,57 +806,57 @@ void func_808D56E4(EnRd* this, GlobalContext* globalCtx) {
}
}
-void func_808D586C(EnRd* this) {
- Animation_PlayOnce(&this->skelAnime, &D_06006EEC);
- this->unk_3D6 = 0;
- this->unk_3EB = 0;
- this->unk_3EA = 200;
- this->unk_3EF = 10;
+void EnRd_SetupGrab(EnRd* this) {
+ Animation_PlayOnce(&this->skelAnime, &gGibdoRedeadGrabStartAnim);
+ this->animationJudderTimer = 0;
+ this->grabState = 0;
+ this->grabDamageTimer = 200;
+ this->action = EN_RD_ACTION_GRABBING;
this->actor.speedXZ = 0.0f;
- this->actionFunc = func_808D58CC;
+ this->actionFunc = EnRd_Grab;
}
-void func_808D58CC(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_Grab(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s32 pad;
if (SkelAnime_Update(&this->skelAnime)) {
- this->unk_3EB++;
+ this->grabState++;
}
- switch (this->unk_3EB) {
- case 1:
- Animation_PlayLoop(&this->skelAnime, &D_06006678);
- this->unk_3EB++;
+ switch (this->grabState) {
+ case EN_RD_GRAB_INITIAL_DAMAGE:
+ Animation_PlayLoop(&this->skelAnime, &gGibdoRedeadGrabAttackAnim);
+ this->grabState++;
globalCtx->damagePlayer(globalCtx, -8);
func_8013ECE0(this->actor.xzDistToPlayer, 255, 1, 12);
- this->unk_3EA = 20;
+ this->grabDamageTimer = 20;
- case 0:
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 1500, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 1500, 0);
+ case EN_RD_GRAB_START:
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 1500, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 1500, 0);
- case 2:
+ case EN_RD_GRAB_ATTACK:
if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) {
if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) {
player->stateFlags2 &= ~0x80;
player->unk_AE8 = 100;
}
- Animation_Change(&this->skelAnime, &D_06006B08, 0.5f, 0.0f, Animation_GetLastFrame(&D_06006B08), 3,
- 0.0f);
- this->unk_3EB++;
- this->unk_3EF = 4;
+ Animation_Change(&this->skelAnime, &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f,
+ Animation_GetLastFrame(&gGibdoRedeadGrabEndAnim), 3, 0.0f);
+ this->grabState++;
+ this->action = EN_RD_ACTION_WALKING_TO_PLAYER_OR_RELEASING_GRAB;
break;
}
switch (player->transformation) {
- case 0:
- case 1:
- case 2:
- case 3:
+ case PLAYER_FORM_FIERCE_DEITY:
+ case PLAYER_FORM_GORON:
+ case PLAYER_FORM_ZORA:
+ case PLAYER_FORM_DEKU:
break;
- case 4:
+ case PLAYER_FORM_HUMAN:
Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f);
break;
}
@@ -789,142 +874,145 @@ void func_808D58CC(EnRd* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK);
}
- this->unk_3EA--;
- if (this->unk_3EA == 0) {
+ this->grabDamageTimer--;
+ if (this->grabDamageTimer == 0) {
globalCtx->damagePlayer(globalCtx, -8);
func_8013ECE0(this->actor.xzDistToPlayer, 240, 1, 12);
- this->unk_3EA = 20;
- func_800B8E58(player, player->ageProperties->unk_92 + 0x6805);
+ this->grabDamageTimer = 20;
+ func_800B8E58(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DAMAGE_S);
}
break;
- case 3:
+ case EN_RD_GRAB_RELEASE:
if (player->transformation != PLAYER_FORM_FIERCE_DEITY) {
Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 400.0f, 0.0f);
}
break;
- case 4:
+ case EN_RD_GRAB_END:
if (player->transformation != PLAYER_FORM_FIERCE_DEITY) {
Math_SmoothStepToF(&this->actor.shape.yOffset, 0.0f, 1.0f, 400.0f, 0.0f);
}
this->actor.targetMode = 0;
- this->actor.flags |= 1;
- this->unk_3ED = 10;
- this->unk_3EE = 15;
- func_808D4FE0(this, globalCtx);
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->playerStunWaitTimer = 10;
+ this->grabWaitTimer = 15;
+ EnRd_SetupWalkToPlayer(this, globalCtx);
break;
}
}
-void func_808D5C54(EnRd* this) {
- Animation_Change(&this->skelAnime, &D_060073A4, 0.0f, 0.0f, Animation_GetLastFrame(&D_060073A4), 2, 0.0f);
- this->unk_3EF = 7;
- this->actionFunc = func_808D5CCC;
+void EnRd_SetupAttemptPlayerFreeze(EnRd* this) {
+ Animation_Change(&this->skelAnime, &gGibdoRedeadLookBackAnim, 0.0f, 0.0f,
+ Animation_GetLastFrame(&gGibdoRedeadLookBackAnim), 2, 0.0f);
+ this->action = EN_RD_ACTION_ATTEMPTING_PLAYER_STUN;
+ this->actionFunc = EnRd_AttemptPlayerFreeze;
}
-void func_808D5CCC(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_AttemptPlayerFreeze(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- s16 temp_v0 = ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->unk_3D8) - this->unk_3DA;
+ s16 yaw =
+ ((this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->headYRotation) - this->upperBodyYRotation;
- if (ABS_ALT(temp_v0) < 0x2008) {
- if (!(this->unk_3DC & 0x80)) {
+ if (ABS_ALT(yaw) < 0x2008) {
+ if (!(this->flags & EN_RD_FLAG_CANNOT_FREEZE_PLAYER)) {
player->actor.freezeTimer = 60;
func_8013ECE0(this->actor.xzDistToPlayer, 255, 20, 150);
func_80123E90(globalCtx, &this->actor);
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
- func_808D4FE0(this, globalCtx);
+ EnRd_SetupWalkToPlayer(this, globalCtx);
}
}
-void func_808D5D88(EnRd* this) {
- this->unk_3EF = 8;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009900, -6.0f);
+void EnRd_SetupGrabFail(EnRd* this) {
+ this->action = EN_RD_ACTION_FAILING_GRAB;
+ Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f);
this->actor.speedXZ = -2.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
- this->unk_3EF = 8;
- this->actionFunc = func_808D5DF4;
+ this->action = EN_RD_ACTION_FAILING_GRAB;
+ this->actionFunc = EnRd_GrabFail;
}
-void func_808D5DF4(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_GrabFail(EnRd* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.15f;
}
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 300, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 300, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 300, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 300, 0);
if (SkelAnime_Update(&this->skelAnime)) {
this->actor.world.rot.y = this->actor.shape.rot.y;
- func_808D5E98(this);
+ EnRd_SetupTurnAwayAndShakeHead(this);
}
}
-void func_808D5E98(EnRd* this) {
- f32 frameCount = Animation_GetLastFrame(&D_060113EC);
+void EnRd_SetupTurnAwayAndShakeHead(EnRd* this) {
+ f32 frameCount = Animation_GetLastFrame(&gGibdoRedeadWalkAnim);
- Animation_Change(&this->skelAnime, &D_060113EC, 0.5f, 0.0f, frameCount, 1, -4.0f);
- this->unk_3EF = 9;
- this->unk_3D4 = 0;
- this->actionFunc = func_808D5F18;
+ Animation_Change(&this->skelAnime, &gGibdoRedeadWalkAnim, 0.5f, 0.0f, frameCount, 1, -4.0f);
+ this->action = EN_RD_ACTION_TURNING_AWAY_AND_SHAKING_HEAD;
+ this->headShakeTimer = 0;
+ this->actionFunc = EnRd_TurnAwayAndShakeHead;
}
-void func_808D5F18(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_TurnAwayAndShakeHead(EnRd* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.world.rot.y, BINANG_ROT180(this->actor.yawTowardsPlayer), 5, 3500, 200);
this->actor.shape.rot.y = this->actor.world.rot.y;
- if (this->unk_3D4 > 60) {
- func_808D53C0(this, globalCtx);
- this->unk_3D4 = 0;
+ if (this->headShakeTimer > 60) {
+ EnRd_SetupWalkToHome(this, globalCtx);
+ this->headShakeTimer = 0;
} else {
- this->unk_3D8 = Math_SinS(this->unk_3D4 * 4000) * (9583.0f * ((60 - this->unk_3D4) / 60.0f));
+ this->headYRotation = Math_SinS(this->headShakeTimer * 4000) * (0x256F * ((60 - this->headShakeTimer) / 60.0f));
SkelAnime_Update(&this->skelAnime);
- this->unk_3D4++;
+ this->headShakeTimer++;
}
}
-void func_808D6008(EnRd* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A450, -4.0f);
- this->unk_3EF = 5;
- this->actionFunc = func_808D6054;
+void EnRd_SetupStandUp(EnRd* this) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadStandUpAnim, -4.0f);
+ this->action = EN_RD_ACTION_STANDING_UP;
+ this->actionFunc = EnRd_StandUp;
}
-void func_808D6054(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_StandUp(EnRd* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
if (this->actor.parent != NULL) {
- func_808D5660(this);
+ EnRd_SetupWalkToParent(this);
} else {
- func_808D5C54(this);
+ EnRd_SetupAttemptPlayerFreeze(this);
}
}
}
-void func_808D60B0(EnRd* this) {
- Animation_Change(&this->skelAnime, &D_0600A450, -1.0f, Animation_GetLastFrame(&D_0600A450), 0.0f, 2, -4.0f);
- this->unk_3EF = 6;
- this->actionFunc = func_808D6130;
+void EnRd_SetupCrouch(EnRd* this) {
+ Animation_Change(&this->skelAnime, &gGibdoRedeadStandUpAnim, -1.0f,
+ Animation_GetLastFrame(&gGibdoRedeadStandUpAnim), 0.0f, 2, -4.0f);
+ this->action = EN_RD_ACTION_CROUCHING;
+ this->actionFunc = EnRd_Crouch;
}
-void func_808D6130(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_Crouch(EnRd* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime)) {
- func_808D4308(this);
+ EnRd_SetupIdle(this);
}
}
-void func_808D616C(EnRd* this) {
+void EnRd_SetupDamage(EnRd* this) {
this->actor.shape.yOffset = 0.0f;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009900, -6.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDamageAnim, -6.0f);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -2.0f;
}
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
- this->unk_3EF = 11;
- this->actionFunc = func_808D6200;
+ this->action = EN_RD_ACTION_DAMAGE;
+ this->actionFunc = EnRd_Damage;
}
-void func_808D6200(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_Damage(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (this->actor.speedXZ < 0.0f) {
@@ -932,145 +1020,146 @@ void func_808D6200(EnRd* this, GlobalContext* globalCtx) {
}
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 300, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 300, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 300, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 300, 0);
if (SkelAnime_Update(&this->skelAnime)) {
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.parent != NULL) {
- func_808D5660(this);
+ EnRd_SetupWalkToParent(this);
} else if (Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) >= 150.0f) {
- func_808D53C0(this, globalCtx);
+ EnRd_SetupWalkToHome(this, globalCtx);
} else {
- func_808D4FE0(this, globalCtx);
+ EnRd_SetupWalkToPlayer(this, globalCtx);
}
this->unk_3F1 = -1;
}
}
-void func_808D6310(EnRd* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009298, -1.0f);
- this->unk_3EF = 12;
- this->unk_3D6 = 300;
- this->actor.flags &= ~1;
+void EnRd_SetupDead(EnRd* this) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f);
+ this->action = EN_RD_ACTION_DEAD;
+ this->deathTimer = 300;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD);
- this->actionFunc = func_808D6388;
+ this->actionFunc = EnRd_Dead;
}
-void func_808D6388(EnRd* this, GlobalContext* globalCtx) {
- if (this->actor.category != 6) {
- func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 6);
+void EnRd_Dead(EnRd* this, GlobalContext* globalCtx) {
+ if (this->actor.category != ACTORCAT_PROP) {
+ func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_PROP);
}
- Math_SmoothStepToS(&this->unk_3D8, 0, 1, 2000, 0);
- Math_SmoothStepToS(&this->unk_3DA, 0, 1, 2000, 0);
+ Math_SmoothStepToS(&this->headYRotation, 0, 1, 2000, 0);
+ Math_SmoothStepToS(&this->upperBodyYRotation, 0, 1, 2000, 0);
if (SkelAnime_Update(&this->skelAnime)) {
- if (this->unk_3D6 == 0) {
- if (!Flags_GetSwitch(globalCtx, this->unk_3DC & 0x7F)) {
- Flags_SetSwitch(globalCtx, this->unk_3DC & 0x7F);
+ if (this->deathTimer == 0) {
+ if (!Flags_GetSwitch(globalCtx, EN_RD_GET_SWITCH_FLAG(this))) {
+ Flags_SetSwitch(globalCtx, EN_RD_GET_SWITCH_FLAG(this));
}
- if (this->unk_3DE != 0) {
- if (this->unk_3DE == 180) {
- func_808D4190(globalCtx, this, 0);
+ if (this->alpha != 0) {
+ if (this->alpha == 180) {
+ EnRd_UpdateParentForOtherRedeads(globalCtx, &this->actor, false);
}
this->actor.scale.y -= (75.0f / 1000000.0f);
- this->unk_3DE -= 5;
+ this->alpha -= 5;
} else {
Actor_MarkForDeath(&this->actor);
}
} else {
- this->unk_3D6--;
+ this->deathTimer--;
}
} else if (Animation_OnFrame(&this->skelAnime, 33.0f) || Animation_OnFrame(&this->skelAnime, 40.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GERUDOFT_DOWN);
}
}
-void func_808D64D0(EnRd* this) {
- this->unk_3EF = 1;
- this->unk_3D6 = 0xA;
+void EnRd_SetupStunned(EnRd* this) {
+ this->action = EN_RD_ACTION_STUNNED;
+ this->stunTimer = 10;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
- if (gSaveContext.unk_3F58 != 0) {
- this->unk_3E9 = 1;
- this->unk_3E0 = 600;
+ if (gSaveContext.sunsSongState != SUNSSONG_INACTIVE) {
+ this->stunnedBySunsSong = true;
+ this->sunsSongStunTimer = 600;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIGHT_ARROW_HIT);
Actor_SetColorFilter(&this->actor, 0x8000, 0x80C8, 0, 255);
- } else if (this->unk_3F0 == 1) {
+ } else if (this->damageEffect == EN_RD_DMGEFF_STUN) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 40);
- } else if (this->unk_3F0 == 12) {
+ } else if (this->damageEffect == EN_RD_DMGEFF_ZORA_MAGIC) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 40);
}
- this->actionFunc = func_808D65BC;
+ this->actionFunc = EnRd_Stunned;
}
-void func_808D65BC(EnRd* this, GlobalContext* globalCtx) {
- if (this->unk_3D6 > 0) {
- this->unk_3D6--;
+void EnRd_Stunned(EnRd* this, GlobalContext* globalCtx) {
+ if (this->stunTimer > 0) {
+ this->stunTimer--;
}
- if (this->unk_3E9 != 0) {
- if (this->unk_3E0 != 0) {
- this->unk_3E0--;
- if (this->unk_3E0 >= 255) {
+ if (this->stunnedBySunsSong) {
+ if (this->sunsSongStunTimer != 0) {
+ this->sunsSongStunTimer--;
+ if (this->sunsSongStunTimer >= 255) {
Actor_SetColorFilter(&this->actor, 0x8000, 0x80C8, 0, 255);
}
- if (this->unk_3E0 == 0) {
- this->unk_3E9 = 0;
- gSaveContext.unk_3F58 = 0;
+ if (this->sunsSongStunTimer == 0) {
+ this->stunnedBySunsSong = false;
+ gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
}
}
}
if (this->actor.colorFilterTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
- func_808D4190(globalCtx, this, 1);
- func_808D6310(this);
+ EnRd_UpdateParentForOtherRedeads(globalCtx, &this->actor, true);
+ EnRd_SetupDead(this);
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, 0x90);
} else {
- func_808D616C(this);
+ EnRd_SetupDamage(this);
}
}
}
-void func_808D66A0(EnRd* this, GlobalContext* globalCtx) {
- s16 phi_v0 = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->unk_3DA;
- s16 temp_v0 = CLAMP(phi_v0, -0x1F4, 0x1F4);
+void EnRd_TurnTowardsPlayer(EnRd* this, GlobalContext* globalCtx) {
+ s16 headAngle = (this->actor.yawTowardsPlayer - this->actor.shape.rot.y) - this->upperBodyYRotation;
+ s16 upperBodyAngle = CLAMP(headAngle, -500, 500);
- phi_v0 -= this->unk_3D8;
- phi_v0 = CLAMP(phi_v0, -0x1F4, 0x1F4);
+ headAngle -= this->headYRotation;
+ headAngle = CLAMP(headAngle, -500, 500);
if (BINANG_SUB(this->actor.yawTowardsPlayer, this->actor.shape.rot.y) >= 0) {
- this->unk_3DA += ABS_ALT(temp_v0);
- this->unk_3D8 += ABS_ALT(phi_v0);
+ this->upperBodyYRotation += ABS_ALT(upperBodyAngle);
+ this->headYRotation += ABS_ALT(headAngle);
} else {
- this->unk_3DA -= ABS_ALT(temp_v0);
- this->unk_3D8 -= ABS_ALT(phi_v0);
+ this->upperBodyYRotation -= ABS_ALT(upperBodyAngle);
+ this->headYRotation -= ABS_ALT(headAngle);
}
- this->unk_3DA = CLAMP(this->unk_3DA, -0x495F, 0x495F);
- this->unk_3D8 = CLAMP(this->unk_3D8, -0x256F, 0x256F);
+ this->upperBodyYRotation = CLAMP(this->upperBodyYRotation, -0x495F, 0x495F);
+ this->headYRotation = CLAMP(this->headYRotation, -0x256F, 0x256F);
}
-void func_808D6814(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_UpdateDamage(EnRd* this, GlobalContext* globalCtx) {
s32 pad;
Player* player = GET_PLAYER(globalCtx);
- if ((gSaveContext.unk_3F58 != 0) && (this->actor.shape.rot.x == 0) && (this->unk_3E9 == 0) &&
- (this->unk_3EF != 11) && (this->unk_3EF != 12) && (this->unk_3EF != 1)) {
- func_808D64D0(this);
+ if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (this->actor.shape.rot.x == 0) &&
+ (!this->stunnedBySunsSong) && (this->action != EN_RD_ACTION_DAMAGE) && (this->action != EN_RD_ACTION_DEAD) &&
+ (this->action != EN_RD_ACTION_STUNNED)) {
+ EnRd_SetupStunned(this);
return;
}
if (this->collider.base.acFlags & AC_HIT) {
this->collider.base.acFlags &= ~AC_HIT;
- this->unk_3F0 = this->actor.colChkInfo.damageEffect;
+ this->damageEffect = this->actor.colChkInfo.damageEffect;
- if (this->unk_3EF == 13) {
+ if (this->action == EN_RD_ACTION_RISING_FROM_COFFIN) {
return;
}
@@ -1080,49 +1169,48 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) {
this->unk_3F1 = player->unk_ADD;
}
- switch (this->unk_3F0) {
- case 12:
- if ((this->actionFunc != func_808D58CC) &&
- ((this->actionFunc != func_808D65BC) || (this->unk_3D6 == 0))) {
- this->unk_3E6 = 40;
- this->unk_3E8 = 30;
- this->unk_294 = 1.0f;
- func_808D64D0(this);
+ switch (this->damageEffect) {
+ case EN_RD_DMGEFF_ZORA_MAGIC:
+ if ((this->actionFunc != EnRd_Grab) && ((this->actionFunc != EnRd_Stunned) || (this->stunTimer == 0))) {
+ this->effectTimer = 40;
+ this->effectType = 30;
+ this->effectAlpha = 1.0f;
+ EnRd_SetupStunned(this);
}
return;
- case 1:
- func_808D64D0(this);
+ case EN_RD_DMGEFF_STUN:
+ EnRd_SetupStunned(this);
return;
- case 2:
+ case EN_RD_DMGEFF_FIRE_ARROW:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
- this->unk_3E6 = 180;
- this->unk_3E8 = 0;
- this->unk_3E9 = 0;
- this->unk_3E0 = 0;
- this->unk_294 = 1.0f;
+ this->effectTimer = 180;
+ this->effectType = 0;
+ this->stunnedBySunsSong = false;
+ this->sunsSongStunTimer = 0;
+ this->effectAlpha = 1.0f;
break;
- case 4:
+ case EN_RD_DMGEFF_LIGHT_ARROW:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
- this->unk_3E6 = 60;
- this->unk_3E8 = 20;
- this->unk_3E9 = 0;
- this->unk_3E0 = 0;
- this->unk_294 = 1.0f;
+ this->effectTimer = 60;
+ this->effectType = 20;
+ this->stunnedBySunsSong = false;
+ this->sunsSongStunTimer = 0;
+ this->effectAlpha = 1.0f;
break;
- case 15:
+ case EN_RD_DMGEFF_DAMAGE:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
- this->unk_3E9 = 0;
- this->unk_3E0 = 0;
+ this->stunnedBySunsSong = false;
+ this->sunsSongStunTimer = 0;
break;
- case 14:
+ case EN_RD_DMGEFF_LIGHT_RAY:
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
- this->unk_3E9 = 0;
- this->unk_3E0 = 0;
+ this->stunnedBySunsSong = false;
+ this->sunsSongStunTimer = 0;
this->actor.colChkInfo.health = 0;
break;
@@ -1132,84 +1220,87 @@ void func_808D6814(EnRd* this, GlobalContext* globalCtx) {
Actor_ApplyDamage(&this->actor);
if (this->actor.colChkInfo.health == 0) {
- func_808D4190(globalCtx, this, 1);
- func_808D6310(this);
+ EnRd_UpdateParentForOtherRedeads(globalCtx, &this->actor, true);
+ EnRd_SetupDead(this);
Item_DropCollectibleRandom(globalCtx, NULL, &this->actor.world.pos, 0x90);
} else {
- func_808D616C(this);
+ EnRd_SetupDamage(this);
}
}
}
-void func_808D6A94(EnRd* this, GlobalContext* globalCtx) {
+void EnRd_UpdateCollision(EnRd* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((this->actor.colChkInfo.health > 0) && (this->unk_3EF != 10)) {
+ if ((this->actor.colChkInfo.health > 0) && (this->action != EN_RD_ACTION_GRABBING)) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
- if (((this->unk_3EF != 11) || ((player->unk_ADC != 0) && (player->unk_ADD != this->unk_3F1))) &&
- ((this->actionFunc != func_808D65BC) || (this->unk_3D6 == 0))) {
+ if (((this->action != EN_RD_ACTION_DAMAGE) || ((player->unk_ADC != 0) && (player->unk_ADD != this->unk_3F1))) &&
+ ((this->actionFunc != EnRd_Stunned) || (this->stunTimer == 0))) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
}
-void func_808D6B64(EnRd* this, GlobalContext* globalCtx) {
- if (this->unk_3E6 > 0) {
- this->unk_3E6--;
+void EnRd_UpdateEffect(EnRd* this, GlobalContext* globalCtx) {
+ if (this->effectTimer > 0) {
+ this->effectTimer--;
}
- if (this->unk_3E6 < 20) {
- Math_SmoothStepToF(&this->unk_298, 0.0f, 0.5f, 0.03f, 0.0f);
- this->unk_294 = this->unk_3E6 * 0.05f;
+ if (this->effectTimer < 20) {
+ Math_SmoothStepToF(&this->effectScale, 0.0f, 0.5f, 0.03f, 0.0f);
+ this->effectAlpha = this->effectTimer * 0.05f;
} else {
- Math_SmoothStepToF(&this->unk_298, 0.5f, 0.1f, 0.02f, 0.0f);
+ Math_SmoothStepToF(&this->effectScale, 0.5f, 0.1f, 0.02f, 0.0f);
}
}
void EnRd_Update(Actor* thisx, GlobalContext* globalCtx) {
EnRd* this = THIS;
- func_808D6814(this, globalCtx);
- if ((gSaveContext.unk_3F58 != 0) && (this->unk_3E9 == 0)) {
- gSaveContext.unk_3F58 = 0;
+ EnRd_UpdateDamage(this, globalCtx);
+ if ((gSaveContext.sunsSongState != SUNSSONG_INACTIVE) && (!this->stunnedBySunsSong)) {
+ gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
}
- if ((this->unk_3F0 != 6) && ((this->unk_3EF != 13) || (this->unk_3F0 != 2))) {
- if (this->unk_3ED != 0) {
- this->unk_3ED--;
+ if ((this->damageEffect != EN_RD_DMGEFF_UNUSED_6) &&
+ ((this->action != EN_RD_ACTION_RISING_FROM_COFFIN) || (this->damageEffect != EN_RD_DMGEFF_FIRE_ARROW))) {
+ if (this->playerStunWaitTimer != 0) {
+ this->playerStunWaitTimer--;
}
this->actionFunc(this, globalCtx);
- if ((this->unk_3EF != 10) && (this->actor.speedXZ != 0.0f)) {
+ if ((this->action != EN_RD_ACTION_GRABBING) && (this->actor.speedXZ != 0.0f)) {
Actor_MoveWithGravity(&this->actor);
}
- if ((this->actor.shape.rot.x == 0) && (this->unk_3EF != 10) && (this->actor.speedXZ != 0.0f)) {
+ if ((this->actor.shape.rot.x == 0) && (this->action != EN_RD_ACTION_GRABBING) &&
+ (this->actor.speedXZ != 0.0f)) {
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 35.0f, 0x1D);
}
- if (this->unk_3EF == 7) {
- func_808D66A0(this, globalCtx);
+ if (this->action == EN_RD_ACTION_ATTEMPTING_PLAYER_STUN) {
+ EnRd_TurnTowardsPlayer(this, globalCtx);
}
}
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 50.0f;
- func_808D6A94(this, globalCtx);
- func_808D4260(this, globalCtx);
- func_808D6B64(this, globalCtx);
+
+ EnRd_UpdateCollision(this, globalCtx);
+ EnRd_SetupDanceIfConditionsMet(this, globalCtx);
+ EnRd_UpdateEffect(this, globalCtx);
}
s32 EnRd_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
Gfx** gfx) {
EnRd* this = THIS;
- if (limbIndex == 23) {
- rot->y += this->unk_3D8;
- } else if (limbIndex == 12) {
- rot->y += this->unk_3DA;
+ if (limbIndex == REDEAD_LIMB_HEAD_ROOT) {
+ rot->y += this->headYRotation;
+ } else if (limbIndex == REDEAD_LIMB_UPPER_BODY_ROOT) {
+ rot->y += this->upperBodyYRotation;
}
return false;
}
@@ -1217,12 +1308,17 @@ s32 EnRd_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
void EnRd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
EnRd* this = THIS;
- if ((this->unk_3E6 != 0) &&
- ((limbIndex == 3) || (limbIndex == 4) || (limbIndex == 6) || (limbIndex == 8) || (limbIndex == 9) ||
- (limbIndex == 11) || (limbIndex == 14) || (limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18) ||
- (limbIndex == 20) || (limbIndex == 21) || (limbIndex == 22) || (limbIndex == 24) || (limbIndex == 25))) {
- Matrix_GetStateTranslation(&this->unk_1DC[this->unk_290]);
- this->unk_290++;
+ if ((this->effectTimer != 0) &&
+ ((limbIndex == REDEAD_LIMB_LEFT_THIGH) || (limbIndex == REDEAD_LIMB_LEFT_SHIN) ||
+ (limbIndex == REDEAD_LIMB_LEFT_FOOT) || (limbIndex == REDEAD_LIMB_RIGHT_THIGH) ||
+ (limbIndex == REDEAD_LIMB_RIGHT_SHIN) || (limbIndex == REDEAD_LIMB_RIGHT_FOOT) ||
+ (limbIndex == REDEAD_LIMB_TORSO) || (limbIndex == REDEAD_LIMB_LEFT_SHOULDER_AND_UPPER_ARM) ||
+ (limbIndex == REDEAD_LIMB_LEFT_FOREARM) || (limbIndex == REDEAD_LIMB_LEFT_HAND) ||
+ (limbIndex == REDEAD_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) || (limbIndex == REDEAD_LIMB_RIGHT_FOREARM) ||
+ (limbIndex == REDEAD_LIMB_RIGHT_HAND) || (limbIndex == REDEAD_LIMB_HEAD) ||
+ (limbIndex == REDEAD_LIMB_PELVIS))) {
+ Matrix_GetStateTranslation(&this->limbPos[this->limbIndex]);
+ this->limbIndex++;
}
}
@@ -1234,12 +1330,12 @@ void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- this->unk_290 = 0;
+ this->limbIndex = 0;
- if (this->unk_3DE == 255) {
+ if (this->alpha == 255) {
func_8012C28C(globalCtx->state.gfxCtx);
- gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->unk_3DE);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_OPA_DISP++, 0x08, D_801AEFA0);
POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
@@ -1250,19 +1346,19 @@ void EnRd_Draw(Actor* thisx, GlobalContext* globalCtx) {
} else {
func_8012C2DC(globalCtx->state.gfxCtx);
- gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_3DE);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
gSPSegment(POLY_XLU_DISP++, 0x08, D_801AEF88);
POLY_XLU_DISP =
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnRd_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
- func_800BC620(&sp54, &D_808D7138, this->unk_3DE, globalCtx);
+ func_800BC620(&sp54, &D_808D7138, this->alpha, globalCtx);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
- if (this->unk_3E6 > 0) {
- func_800BE680(globalCtx, &this->actor, this->unk_1DC, ARRAY_COUNT(this->unk_1DC), this->unk_298, 0.5f,
- this->unk_294, this->unk_3E8);
+ if (this->effectTimer > 0) {
+ func_800BE680(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->effectScale, 0.5f,
+ this->effectAlpha, this->effectType);
}
}
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 2c6637d766..0340c7833a 100644
--- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h
+++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h
@@ -2,58 +2,74 @@
#define Z_EN_RD_H
#include "global.h"
+#include "objects/object_rd/object_rd.h"
struct EnRd;
typedef void (*EnRdActionFunc)(struct EnRd*, GlobalContext*);
-typedef void (*EnRdFunc)(struct EnRd*);
+typedef void (*EnRdSetupDanceFunc)(struct EnRd*);
-#define ENRD_GET_80(thisx) ((thisx)->params & 0x80)
-#define ENRD_GET_FF00(thisx) (((thisx)->params & 0xFF00) >> 8)
+#define EN_RD_GET_80(thisx) ((thisx)->params & 0x80)
+#define EN_RD_GET_FLAGS(thisx) (((thisx)->params & 0xFF00) >> 8)
+#define EN_RD_GET_TYPE(thisx) ((thisx)->params)
+#define EN_RD_GET_SWITCH_FLAG(this) ((this)->flags & 0x7F)
-enum {
- /* -2 */ ENRD_GET_MINUS_2 = -2,
- /* -1 */ ENRD_GET_MINUS_1 = -1,
- /* 0x00 */ ENRD_GET_0 = 0,
- /* 0x01 */ ENRD_GET_1,
- /* 0x02 */ ENRD_GET_2,
- /* 0x03 */ ENRD_GET_3,
- /* 0x04 */ ENRD_GET_4,
- /* 0x05 */ ENRD_GET_5,
-};
+#define EN_RD_FLAG_CANNOT_FREEZE_PLAYER (1 << 7)
+
+typedef enum {
+ /* -3 */ EN_RD_TYPE_GIBDO_RISING_OUT_OF_COFFIN = -3, // Unused OoT leftover
+ /* -2 */ EN_RD_TYPE_GIBDO = -2, // Unused OoT leftover
+ /* -1 */ EN_RD_TYPE_DOES_NOT_MOURN = -1, // Unused OoT leftover
+ /* 0 */ EN_RD_TYPE_DOES_NOT_MOURN_IF_WALKING = 0, // Unused OoT leftover. Still mourns, but it must come to a complete stop first
+ /* 1 */ EN_RD_TYPE_REGULAR, // Unused OoT leftover
+ /* 2 */ EN_RD_TYPE_CRYING, // Unused in the final game
+ /* 3 */ EN_RD_TYPE_INVISIBLE, // Unused OoT leftover
+ /* 4 */ EN_RD_TYPE_FROZEN, // Unused in the final game
+ /* 5 */ EN_RD_TYPE_SQUATTING_DANCE,
+ /* 6 */ EN_RD_TYPE_CLAPPING_DANCE,
+ /* 7 */ EN_RD_TYPE_PIROUETTE,
+} EnRdType;
typedef struct EnRd {
/* 0x0000 */ Actor actor;
/* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnRdActionFunc actionFunc;
- /* 0x018C */ EnRdFunc unkFunc;
+ /* 0x018C */ EnRdSetupDanceFunc setupDanceFunc;
/* 0x0190 */ ColliderCylinder collider;
- /* 0x01DC */ Vec3f unk_1DC[15];
- /* 0x0290 */ s32 unk_290;
- /* 0x0294 */ f32 unk_294;
- /* 0x0298 */ f32 unk_298;
- /* 0x029C */ Vec3s jointTable[26];
- /* 0x0338 */ Vec3s morphTable[26];
- /* 0x03D4 */ s16 unk_3D4;
- /* 0x03D6 */ s16 unk_3D6;
- /* 0x03D8 */ s16 unk_3D8;
- /* 0x03DA */ s16 unk_3DA;
- /* 0x03DC */ s16 unk_3DC;
- /* 0x03DE */ s16 unk_3DE;
- /* 0x03E0 */ s16 unk_3E0;
- /* 0x03E2 */ s16 unk_3E2;
- /* 0x03E4 */ s16 unk_3E4;
- /* 0x03E6 */ s16 unk_3E6;
- /* 0x03E8 */ u8 unk_3E8;
- /* 0x03E9 */ u8 unk_3E9;
- /* 0x03EA */ u8 unk_3EA;
- /* 0x03EB */ u8 unk_3EB;
- /* 0x03EC */ u8 unk_3EC;
- /* 0x03ED */ u8 unk_3ED;
- /* 0x03EE */ u8 unk_3EE;
- /* 0x03EF */ u8 unk_3EF;
- /* 0x03F0 */ u8 unk_3F0;
- /* 0x03F1 */ s8 unk_3F1;
+ /* 0x01DC */ Vec3f limbPos[15];
+ /* 0x0290 */ s32 limbIndex;
+ /* 0x0294 */ f32 effectAlpha;
+ /* 0x0298 */ f32 effectScale;
+ /* 0x029C */ Vec3s jointTable[REDEAD_LIMB_MAX];
+ /* 0x0338 */ Vec3s morphTable[REDEAD_LIMB_MAX];
+ /* 0x03D4 */ s16 headShakeTimer;
+ /* 0x03D6 */ union {
+ s16 animationJudderTimer;
+ s16 stunTimer;
+ s16 deathTimer;
+ s16 coffinRiseForwardAccelTimer;
+ };
+ /* 0x03D8 */ s16 headYRotation;
+ /* 0x03DA */ s16 upperBodyYRotation;
+ /* 0x03DC */ s16 flags;
+ /* 0x03DE */ s16 alpha;
+ /* 0x03E0 */ s16 sunsSongStunTimer;
+ /* 0x03E2 */ UNK_TYPE1 unk3E2[0x2];
+ /* 0x03E4 */ union {
+ s16 danceEndTimer;
+ s16 pirouetteRotationalVelocity;
+ };
+ /* 0x03E6 */ s16 effectTimer;
+ /* 0x03E8 */ u8 effectType;
+ /* 0x03E9 */ u8 stunnedBySunsSong;
+ /* 0x03EA */ u8 grabDamageTimer;
+ /* 0x03EB */ u8 grabState;
+ /* 0x03EC */ u8 isMourning;
+ /* 0x03ED */ u8 playerStunWaitTimer; // Cannot stun the player if this is non-zero
+ /* 0x03EE */ u8 grabWaitTimer; // Cannot grab the player if this is non-zero
+ /* 0x03EF */ u8 action;
+ /* 0x03F0 */ u8 damageEffect;
+ /* 0x03F1 */ s8 unk_3F1; // related to player->unk_ADD
} EnRd; // size = 0x3F4
extern const ActorInit En_Rd_InitVars;
diff --git a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c
index baa7aadadc..226cc821df 100644
--- a/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c
+++ b/src/overlays/actors/ovl_En_Recepgirl/z_en_recepgirl.c
@@ -5,8 +5,9 @@
*/
#include "z_en_recepgirl.h"
+#include "objects/object_bg/object_bg.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnRecepgirl*)thisx)
@@ -32,11 +33,8 @@ const ActorInit En_Recepgirl_InitVars = {
(ActorFunc)EnRecepgirl_Draw,
};
-extern TexturePtr D_0600F8F0;
-extern TexturePtr D_0600FCF0;
-extern TexturePtr D_060100F0;
-
-static TexturePtr sEyeTextures[] = { &D_0600F8F0, &D_0600FCF0, &D_060100F0, &D_0600FCF0 };
+static TexturePtr sEyeTextures[] = { object_bg_Tex_00F8F0, object_bg_Tex_00FCF0, object_bg_Tex_0100F0,
+ object_bg_Tex_00FCF0 };
static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 6, ICHAIN_CONTINUE),
@@ -45,20 +43,14 @@ static InitChainEntry sInitChain[] = {
static s32 texturesDesegmented = false;
-extern AnimationHeader D_06000968;
-extern AnimationHeader D_06001384;
-extern AnimationHeader D_06009890;
-extern AnimationHeader D_0600A280;
-extern AnimationHeader D_0600AD98;
-extern FlexSkeletonHeader D_06011B60;
-
void EnRecepgirl_Init(Actor* thisx, GlobalContext* globalCtx) {
EnRecepgirl* this = THIS;
s32 i;
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, -60.0f, NULL, 0.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011B60, &D_06009890, this->jointTable, this->morphTable, 24);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_bg_Skel_011B60, &object_bg_Anim_009890, this->jointTable,
+ this->morphTable, 24);
if (!texturesDesegmented) {
for (i = 0; i < ARRAY_COUNT(sEyeTextures); i++) {
@@ -93,18 +85,18 @@ void EnRecepgirl_UpdateEyes(EnRecepgirl* this) {
}
void EnRecepgirl_SetupWait(EnRecepgirl* this) {
- if (this->skelAnime.animation == &D_06001384) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_001384) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
}
this->actionFunc = EnRecepgirl_Wait;
}
void EnRecepgirl_Wait(EnRecepgirl* this, GlobalContext* globalCtx) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 5.0f);
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 5.0f);
} else {
- Animation_MorphToLoop(&this->skelAnime, &D_06009890, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, -4.0f);
}
}
@@ -123,7 +115,7 @@ void EnRecepgirl_Wait(EnRecepgirl* this, GlobalContext* globalCtx) {
}
void EnRecepgirl_SetupTalk(EnRecepgirl* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
this->actionFunc = EnRecepgirl_Talk;
}
@@ -131,19 +123,19 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) {
u8 temp_v0_2;
if (SkelAnime_Update(&this->skelAnime)) {
- if (this->skelAnime.animation == &D_0600A280) {
- Animation_PlayLoop(&this->skelAnime, &D_06001384);
- } else if (this->skelAnime.animation == &D_0600AD98) {
+ if (this->skelAnime.animation == &object_bg_Anim_00A280) {
+ Animation_PlayLoop(&this->skelAnime, &object_bg_Anim_001384);
+ } else if (this->skelAnime.animation == &object_bg_Anim_00AD98) {
if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing)
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
} else {
- Animation_MorphToLoop(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
}
} else {
if (this->actor.textId == 0x2ADA) { // Mayor's office is on the left (meeting ongoing)
- Animation_MorphToLoop(&this->skelAnime, &D_06009890, 10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_bg_Anim_009890, 10.0f);
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600A280, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00A280, -4.0f);
}
}
}
@@ -155,7 +147,7 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) {
} else if ((temp_v0_2 == 5) && (func_80147624(globalCtx) != 0)) {
if (this->actor.textId == 0x2AD9) { // "Welcome..."
Flags_SetSwitch(globalCtx, this->actor.params);
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
if (gSaveContext.weekEventReg[63] & 0x80) { // showed Couple's Mask to meeting
this->actor.textId = 0x2ADF; // Mayor's office is on the left (meeting ended)
@@ -163,10 +155,10 @@ void EnRecepgirl_Talk(EnRecepgirl* this, GlobalContext* globalCtx) {
this->actor.textId = 0x2ADA; // Mayor's office is on the left (meeting ongoing)
}
} else if (this->actor.textId == 0x2ADC) { // hear directions again?
- Animation_MorphToPlayOnce(&this->skelAnime, &D_0600AD98, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_00AD98, 10.0f);
this->actor.textId = 0x2ADD; // "So..."
} else {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000968, 10.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_bg_Anim_000968, 10.0f);
if (this->actor.textId == 0x2ADD) { // "So..."
this->actor.textId = 0x2ADE; // Mayor's office is on the left, drawing room on the right
@@ -200,7 +192,7 @@ s32 EnRecepgirl_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
return false;
}
-void EnRecepgirl_UnkLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnRecepgirl_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnRecepgirl* this = THIS;
if (limbIndex == 5) {
@@ -217,8 +209,9 @@ void EnRecepgirl_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, sEyeTextures[this->eyeTexIndex]);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnRecepgirl_OverrideLimbDraw, NULL, EnRecepgirl_UnkLimbDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnRecepgirl_OverrideLimbDraw, NULL,
+ EnRecepgirl_TransformLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.c b/src/overlays/actors/ovl_En_Rg/z_en_rg.c
index 00f96e291a..f8fd33a271 100644
--- a/src/overlays/actors/ovl_En_Rg/z_en_rg.c
+++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.c
@@ -5,8 +5,10 @@
*/
#include "z_en_rg.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_oF1d_map/object_oF1d_map.h"
-#define FLAGS 0x80000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80000000)
#define THIS ((EnRg*)thisx)
@@ -18,7 +20,8 @@ void EnRg_Draw(Actor* thisx, GlobalContext* globalCtx);
void func_80BF4EBC(EnRg* this, GlobalContext* globalCtx);
void func_80BF4FC4(EnRg* this, GlobalContext* globalCtx);
-#if 0
+s32 D_80BF5C10;
+
const ActorInit En_Rg_InitVars = {
ACTOR_EN_RG,
ACTORCAT_NPC,
@@ -31,25 +34,49 @@ const ActorInit En_Rg_InitVars = {
(ActorFunc)EnRg_Draw,
};
-// static ColliderSphereInit sSphereInit = {
-static ColliderSphereInit D_80BF5760 = {
- { COLTYPE_METAL, AT_ON | AT_TYPE_PLAYER | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_SPHERE, },
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderSphereInit sSphereInit = {
+ {
+ COLTYPE_METAL,
+ AT_ON | AT_TYPE_PLAYER | AT_TYPE_ENEMY,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_SPHERE,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 0, { { 0, 0, 0 }, 20 }, 100 },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BF578C = {
- { COLTYPE_HIT1, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT1,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 20, 62, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80BF57B8 = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80BF57C4 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(1, 0x0),
/* Deku Stick */ DMG_ENTRY(1, 0x0),
/* Horse trample */ DMG_ENTRY(1, 0x0),
@@ -84,75 +111,767 @@ static DamageTable D_80BF57C4 = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
+s32 D_80BF57E4[][4] = {
+ { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 1, 1, 1, 1 },
+ { 11, 11, 8, 10 }, { 16, 12, 12, 14 }, { 19, 15, 15, 18 }, { 25, 17, 18, 22 }, { 29, 20, 23, 28 },
+ { 39, 24, 28, 33 }, { 43, 27, 33, 37 }, { 46, 28, 36, 37 }, { 51, 30, 38, 39 }, { 54, 33, 42, 40 },
+ { 56, 34, 44, 41 }, { 60, 38, 50, 45 }, { 67, 42, 55, 49 }, { 74, 47, 61, 54 },
+};
+
+AnimationInfoS D_80BF5914[] = {
+ { &object_oF1d_map_Anim_012DE0, 2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_oF1d_map_Anim_012DE0, -2.0f, 0, -1, ANIMMODE_ONCE, 0 },
+};
+
+TexturePtr D_80BF5934[] = {
+ gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
+};
+
+Color_RGBA8 D_80BF5954[] = {
+ { 255, 255, 255, 0 },
+ { 170, 130, 90, 0 },
+ { 0, 0, 0, 0 },
+};
+
+Color_RGBA8 D_80BF5960[] = {
+ { 255, 255, 255, 0 },
+ { 100, 60, 20, 0 },
+ { 0, 0, 0, 0 },
+};
+
+Vec3f D_80BF596C[] = {
+ { -2473.0f, 39.0f, 7318.0f }, { -2223.0f, 142.0f, 7184.0f }, { -2281.0f, 41.0f, 7718.0f },
+ { -2136.0f, 96.0f, 7840.0f }, { -2432.0f, 6.0f, 7857.0f }, { -2412.0f, 139.0f, 6872.0f },
+ { -2719.0f, 39.0f, 7110.0f }, { -2289.0f, 67.0f, 7463.0f }, { -2820.0f, 85.0f, 6605.0f },
+ { -2088.0f, 160.0f, 7584.0f }, { -2503.0f, 1.0f, 7643.0f },
+};
+
+EffectTireMarkInit D_80BF59F0 = {
+ 0,
+ 62,
+ { 0, 0, 15, 100 },
+};
+
+TexturePtr D_80BF59F8[] = {
+ object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_011038,
+ object_oF1d_map_Tex_010C38, object_oF1d_map_Tex_010838,
+};
+
+void func_80BF3920(EnRgStruct* ptr, GlobalContext* globalCtx) {
+ f32 temp_f20;
+ u8 phi_fp = false;
+ s32 i;
+ s32 idx;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ for (i = 0; i < 32; i++, ptr++) {
+ if ((ptr->unk_00 >= 4) && (ptr->unk_00 < 7)) {
+ if (!phi_fp) {
+ POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, sizeof(Gfx) * 0);
+ gSPDisplayList(POLY_XLU_DISP++, object_oF1d_map_DL_014CF0);
+ phi_fp = true;
+ }
+
+ Matrix_StatePush();
+
+ if (globalCtx) {}
+ temp_f20 = (f32)ptr->unk_02 / ptr->unk_01;
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, D_80BF5954[ptr->unk_00 - 4].r, D_80BF5954[ptr->unk_00 - 4].g,
+ D_80BF5954[ptr->unk_00 - 4].b, (u8)(temp_f20 * 255.0f));
+ gDPSetEnvColor(POLY_XLU_DISP++, D_80BF5960[ptr->unk_00 - 4].r, D_80BF5960[ptr->unk_00 - 4].g,
+ D_80BF5960[ptr->unk_00 - 4].b, 0);
+
+ Matrix_InsertTranslation(ptr->unk_10.x, ptr->unk_10.y, ptr->unk_10.z, MTXMODE_NEW);
+ Matrix_Scale(ptr->unk_34, ptr->unk_34, 1.0f, MTXMODE_APPLY);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ idx = temp_f20 * 7.0f;
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF5934[idx]));
+ gSPDisplayList(POLY_XLU_DISP++, object_oF1d_map_DL_014D00);
+
+ Matrix_StatePop();
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80BF3C64(EnRg* this) {
+ EnRgStruct* ptr = this->unk_34C;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_34C); i++, ptr++) {
+ if (ptr->unk_00) {
+ if (!ptr->unk_02) {
+ ptr->unk_00 = 0;
+ } else {
+ ptr->unk_10.x += ptr->unk_28.x;
+ ptr->unk_10.y += ptr->unk_28.y;
+ ptr->unk_10.z += ptr->unk_28.z;
+ ptr->unk_28.x += ptr->unk_1C.x;
+ ptr->unk_28.y += ptr->unk_1C.y;
+ ptr->unk_28.z += ptr->unk_1C.z;
+ ptr->unk_34 += ptr->unk_38;
+ ptr->unk_02--;
+ }
+ }
+ }
+}
+
+void func_80BF3DA0(EnRg* this, GlobalContext* globalCtx) {
+ func_80BF3920(this->unk_34C, globalCtx);
+}
+
+void func_80BF3DC4(EnRg* this, GlobalContext* globalCtx) {
+ this->collider2.dim.worldSphere.center.x = this->actor.world.pos.x;
+ this->collider2.dim.worldSphere.center.y = this->actor.world.pos.y + this->actor.shape.yOffset;
+ this->collider2.dim.worldSphere.center.z = this->actor.world.pos.z;
+
+ if (this->actor.speedXZ >= 10.0f) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ }
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+}
+
+void func_80BF3E88(EnRg* this, GlobalContext* globalCtx) {
+ Math_Vec3f_ToVec3s(&this->collider1.dim.pos, &this->actor.world.pos);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+}
+
+void func_80BF3ED4(EnRg* this, GlobalContext* globalCtx) {
+ if (this->unk_310 & 0x10) {
+ func_80BF3DC4(this, globalCtx);
+ } else {
+ func_80BF3E88(this, globalCtx);
+ }
+}
+
+s32 func_80BF3F14(EnRg* this, GlobalContext* globalCtx) {
+ this->unk_310 &= ~0x20;
+ this->unk_310 &= ~0x40;
+ this->unk_310 &= ~0x80;
+
+ if ((this->collider1.base.atFlags & AT_HIT) || (this->collider2.base.atFlags & AT_HIT)) {
+ this->collider1.base.atFlags &= ~AT_HIT;
+ this->collider2.base.atFlags &= ~AT_HIT;
+ this->unk_310 |= 0x20;
+ }
+
+ if ((this->collider1.base.acFlags & AC_HIT) || (this->collider2.base.acFlags & AC_HIT)) {
+ this->collider1.base.acFlags &= ~AC_HIT;
+ this->collider2.base.acFlags &= ~AC_HIT;
+ this->unk_310 |= 0x40;
+ }
+
+ if ((this->collider1.base.ocFlags1 & OC1_HIT) || (this->collider2.base.ocFlags1 & OC1_HIT)) {
+ this->collider1.base.ocFlags1 &= ~OC1_HIT;
+ this->collider2.base.ocFlags1 &= ~OC1_HIT;
+ this->unk_310 |= 0x80;
+ }
+
+ return false;
+}
+
+void func_80BF3FF8(EnRg* this) {
+ this->skelAnime.playSpeed = this->unk_314;
+ SkelAnime_Update(&this->skelAnime);
+}
+
+s32 func_80BF4024(EnRg* this, GlobalContext* globalCtx) {
+ if ((globalCtx->csCtx.state == 0) && (this->unk_334 == 1)) {
+ if (Animation_OnFrame(&this->skelAnime, 2.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_CIRCLE);
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, 22.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_SIT_IMT);
+ }
+ }
+
+ return false;
+}
+
+s32 func_80BF409C(EnRg* this, s32 arg1) {
+ s32 ret = false;
+
+ if (arg1 != this->unk_334) {
+ this->unk_334 = arg1;
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80BF5914, arg1);
+ this->unk_314 = this->skelAnime.playSpeed;
+ }
+ return ret;
+}
+
+void func_80BF40F4(EnRg* this) {
+ if (DECR(this->unk_31C) == 0) {
+ this->unk_31E++;
+ if (this->unk_31E >= 4) {
+ this->unk_31C = Rand_S16Offset(30, 30);
+ this->unk_31E = 0;
+ }
+ }
+}
+
+s32 func_80BF416C(EnRg* this, GlobalContext* globalCtx) {
+ if ((this->actor.bgCheckFlags & 1) && (this->actor.speedXZ >= 0.01f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_ROLLING - SFX_FLAG);
+ func_800AE930(&globalCtx->colCtx, Effect_GetByIndex(this->unk_340), &this->actor.world.pos, 18.0f,
+ this->actor.shape.rot.y, this->actor.floorPoly, this->actor.floorBgId);
+ } else {
+ func_800AEF44(Effect_GetByIndex(this->unk_340));
+ }
+ return false;
+}
+
+s32 func_80BF4220(EnRg* this, GlobalContext* globalCtx, Actor* arg2) {
+ CollisionPoly* sp44 = NULL;
+ s32 sp40;
+ Vec3f sp34;
+
+ if (Actor_ActorAIsFacingAndNearActorB(&this->actor, arg2, 400.0f, 0x2000) &&
+ !BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &arg2->world.pos, &sp34, &sp44, true,
+ false, false, true, &sp40)) {
+ return true;
+ }
+ return false;
+}
+
+s32 func_80BF42BC(EnRg* this, f32 arg1) {
+ f32 sp2C;
+ s32 sp24;
+
+ Math_ApproachF(&this->actor.speedXZ, arg1, 0.3f, 0.5f);
+
+ sp2C = this->actor.speedXZ * (1.0f / 26);
+ if (sp2C > 1.0f) {
+ sp2C = 1.0f;
+ }
+ sp24 = 5460.0f * sp2C;
+
+ this->actor.scale.x = 0.01f - (Math_SinS(sp24) * 0.01f);
+ this->actor.scale.y = (Math_SinS(sp24) * 0.01f) + 0.01f;
+ this->actor.scale.z = (Math_SinS(sp24) * 0.01f) + 0.01f;
+
+ this->actor.shape.yOffset = this->actor.scale.y * 100.0f * 14.0f;
+ if (!(this->unk_310 & 0x1000)) {
+ this->actor.shape.rot.x += (s16)(13650.0f * sp2C);
+ }
+
+ this->actor.world.rot.x = this->actor.shape.rot.x;
+ return false;
+}
+
+#ifdef NON_MATCHING
+s32 func_80BF43FC(EnRg* this) {
+ Vec3f sp9C;
+ Vec3f sp90;
+ f32 sp8C;
+ f32 sp88;
+ f32 sp84;
+ f32 phi_f20 = 0.0f;
+ s32 temp_s7 = ENRG_GET_7F80(&this->actor);
+ s32 phi_s4 = -1;
+ s16 phi_s6 = 0;
+ s32 temp_s5 = this->unk_344;
+ s32 phi_s0 = D_80BF57E4[this->unk_344][temp_s7];
+
+ while (true) {
+ func_8013C8B8(this->path, phi_s0 - 1, &sp9C);
+ func_8013C8B8(this->path, phi_s0 + 1, &sp90);
+ if (Math3D_PointDistToLine2D(this->actor.world.pos.x, this->actor.world.pos.z, sp9C.x, sp9C.z, sp90.x, sp90.z,
+ &sp8C, &sp88, &sp84) &&
+ (!phi_s6 || ((phi_s4 + 1) == phi_s0) || (sp84 < phi_f20))) {
+ phi_s6 = 1;
+ phi_f20 = sp84;
+ phi_s4 = phi_s0;
+ }
+ phi_s0++;
+ if ((temp_s5 == 18) || (phi_s0 >= D_80BF57E4[temp_s5 + 1][temp_s7])) {
+ break;
+ }
+ }
+
+ return phi_s4;
+}
+#else
+#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF43FC.s")
#endif
-extern ColliderSphereInit D_80BF5760;
-extern ColliderCylinderInit D_80BF578C;
-extern CollisionCheckInfoInit2 D_80BF57B8;
-extern DamageTable D_80BF57C4;
+s32 func_80BF4560(EnRg* this, GlobalContext* globalCtx) {
+ s32 temp_v0 = SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
-extern UNK_TYPE D_060091A8;
-extern UNK_TYPE D_06011AC8;
-extern UNK_TYPE D_06014D00;
+ if ((temp_v0 < 4) || (temp_v0 >= 19)) {
+ temp_v0 = -1;
+ }
+ return temp_v0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3920.s")
+s32 func_80BF45B4(EnRg* this) {
+ s32 sp24 = 0;
+ s32 ret = false;
+ s16 temp_v0;
+ s16 temp_v1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3C64.s")
+ if ((this->actor.bgCheckFlags & 8) && (this->actor.speedXZ >= 5.0f)) {
+ temp_v1 = this->actor.world.rot.y;
+ temp_v0 = temp_v1 - BINANG_ROT180(this->actor.wallYaw);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3DA0.s")
+ if (ABS_ALT(temp_v0) >= 0x3400) {
+ this->actor.world.rot.y = BINANG_ROT180(BINANG_ROT180(this->actor.wallYaw) - temp_v0);
+ this->unk_322 = 0xA;
+ } else if (ABS_ALT(temp_v0) >= 0x1000) {
+ this->actor.world.rot.y = BINANG_ROT180(BINANG_ROT180(this->actor.wallYaw) - temp_v0);
+ this->actor.speedXZ *= 0.75f;
+ this->unk_322 = 0xA;
+ } else {
+ this->actor.world.rot.y = BINANG_ROT180(temp_v1);
+ ret = 1;
+ this->actor.speedXZ *= 0.25f;
+ }
+ sp24 = 1;
+ } else if (this->unk_310 & 0x40) {
+ s16 yaw = Actor_YawBetweenActors(&this->actor, ((void)0, this->collider2.base.ac));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3DC4.s")
+ sp24 = 2;
+ if (this->actor.colorFilterTimer == 0) {
+ this->actor.speedXZ *= 0.5f;
+ if ((s16)(yaw - this->actor.world.rot.y) > 0) {
+ this->actor.world.rot.y -= 0x2000;
+ } else {
+ this->actor.world.rot.y += 0x2000;
+ }
+ }
+ Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
+ this->unk_322 = 0xA;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3E88.s")
+ if (sp24) {
+ this->unk_310 &= ~0x800;
+ this->unk_310 &= ~0x40;
+ if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) {
+ D_80BF5C10 = 0;
+ }
+ this->unk_18C = NULL;
+ this->unk_324 = 0;
+ }
+ return ret;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3ED4.s")
+s32 func_80BF47AC(EnRg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 phi_f0;
+ f32 phi_f2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3F14.s")
+ if (player->linearVelocity < 20.0f) {
+ phi_f2 = 20.0f;
+ } else {
+ phi_f2 = player->linearVelocity;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF3FF8.s")
+ if ((this->unk_310 & 0x400) || (this->unk_310 & 0x1000)) {
+ phi_f0 = 0.0f;
+ } else if (this->unk_348 >= 2) {
+ phi_f0 = phi_f2 * 0.5f;
+ } else if (this->unk_348 == 1) {
+ phi_f0 = phi_f2 * 0.75f;
+ } else if (this->unk_348 == 0) {
+ s16 temp_v0_3 = this->actor.yawTowardsPlayer - this->actor.world.rot.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4024.s")
+ if ((ABS_ALT(temp_v0_3) > 0x4000) || (this->unk_326 > 0)) {
+ phi_f0 = phi_f2 * 0.72f;
+ } else {
+ phi_f0 = phi_f2 * 0.94f;
+ }
+ } else if (this->unk_348 == -1) {
+ phi_f0 = phi_f2 * 1.6f;
+ } else {
+ phi_f0 = 2.0f * phi_f2;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF409C.s")
+ if (phi_f0 > 0.0f) {
+ if (this->unk_320 != 0) {
+ this->unk_320--;
+ }
+ phi_f2 = this->unk_320 * 0.01f;
+ phi_f0 += phi_f2;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF40F4.s")
+ func_80BF42BC(this, phi_f0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF416C.s")
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4220.s")
+void func_80BF4934(EnRg* this) {
+ if (this->unk_318 == 1) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_GOLON_DASH);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF42BC.s")
+void func_80BF4964(EnRg* this) {
+ Vec3s* sp3C;
+ Vec3f sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF43FC.s")
+ if (this->path != NULL) {
+ sp3C = Lib_SegmentedToVirtual(this->path->points);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4560.s")
+ if (func_8013BD40(&this->actor, this->path, this->unk_33C)) {
+ if ((this->path->count - 1) < (this->unk_33C + 1)) {
+ this->unk_33C = this->path->count - 1;
+ } else {
+ this->unk_33C++;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF45B4.s")
+ if (this->unk_322 != 0) {
+ this->unk_322--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF47AC.s")
+ if (this->unk_324 != 0) {
+ this->unk_324--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4934.s")
+ if (this->unk_326 != 0) {
+ this->unk_326--;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4964.s")
+ if (!(this->unk_310 & 0x400) && !(this->unk_310 & 0x1000) && (this->unk_322 == 0) && (this->unk_324 == 0) &&
+ (this->actor.bgCheckFlags & 1)) {
+ if (this->unk_18C == NULL) {
+ Math_Vec3s_ToVec3f(&sp30, &sp3C[this->unk_33C]);
+ } else {
+ Math_Vec3f_Copy(&sp30, &this->unk_18C->world.pos);
+ }
+ Math_ApproachS(&this->actor.world.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &sp30), 10, 0x71C);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4AB8.s")
+void func_80BF4AB8(EnRg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Actor* phi_s0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4D64.s")
+ phi_s0 = NULL;
+ if (!(this->unk_310 & 0x800)) {
+ if (this->unk_320 == 0) {
+ do {
+ phi_s0 = SubS_FindActor(globalCtx, phi_s0, 6, ACTOR_OBJ_TSUBO);
+ if (phi_s0 != NULL) {
+ if (func_80BF4220(this, globalCtx, phi_s0) && (phi_s0->update != NULL)) {
+ this->unk_18C = phi_s0;
+ this->unk_310 |= 0x800;
+ break;
+ }
+ phi_s0 = phi_s0->next;
+ }
+ } while (phi_s0 != NULL);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4DA8.s")
+ if ((phi_s0 == NULL) && (D_80BF5C10 == 0) && (this->unk_326 == 0) && (player->stateFlags3 & 0x80000) &&
+ (player->invincibilityTimer == 0) && func_80BF4220(this, globalCtx, &player->actor)) {
+ this->unk_18C = &player->actor;
+ this->unk_310 |= 0x800;
+ D_80BF5C10 = 1;
+ }
+ } else if ((this->unk_18C != NULL) && !func_80BF4220(this, globalCtx, this->unk_18C)) {
+ if (this->unk_18C->id == ACTOR_PLAYER) {
+ D_80BF5C10 = 0;
+ }
+ this->unk_18C = NULL;
+ this->unk_310 &= ~0x800;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4EBC.s")
+ if (this->unk_310 & 0x20) {
+ if (this->collider2.base.at != NULL) {
+ if (this->collider2.base.at->id == ACTOR_OBJ_TSUBO) {
+ this->collider2.base.at->params |= 0x3F;
+ this->unk_320 += 0x190;
+ this->unk_320 = CLAMP_MAX(this->unk_320, 0x190);
+ } else if (this->collider2.base.at->id == ACTOR_PLAYER) {
+ this->unk_326 = 0x28;
+ if (player->stateFlags3 & 0x1000) {
+ player->linearVelocity *= 0.5f;
+ player->unk_B08[0] = player->linearVelocity;
+ player->unk_B08[1] += player->linearVelocity * 0.05f;
+ if (BINANG_SUB(this->actor.yawTowardsPlayer, player->currentYaw) > 0) {
+ player->currentYaw += 0x2000;
+ } else {
+ player->currentYaw -= 0x2000;
+ }
+ player->unk_B8C = 4;
+ player->invincibilityTimer = 20;
+ player->actor.home.rot.y = player->actor.world.rot.y;
+ player->actor.shape.rot.y = player->actor.world.rot.y;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF4FC4.s")
+ if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) {
+ D_80BF5C10 = 0;
+ }
+ }
+ }
+ this->unk_18C = NULL;
+ this->unk_310 &= ~0x800;
+ this->unk_310 &= ~0x20;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Init.s")
+s32 func_80BF4D64(Vec3f* arg0) {
+ return Math3D_XZBoundCheck(-1261.0f, -901.0f, -1600.0f, -1520.0f, arg0->x, arg0->z);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Destroy.s")
+s32 func_80BF4DA8(EnRg* this) {
+ s32 pad[4];
+ s32 ret = false;
+ f32 temp_f20;
+ s16 temp_v1;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Update.s")
+ for (i = 0; i < ARRAY_COUNT(D_80BF596C); i++) {
+ temp_f20 = Actor_XZDistanceToPoint(&this->actor, &D_80BF596C[i]);
+ temp_v1 = Actor_YawToPoint(&this->actor, &D_80BF596C[i]) - this->actor.world.rot.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF547C.s")
+ if ((temp_f20 < 100.0f) && (ABS_ALT(temp_v1) < 0xC00)) {
+ if (temp_v1 > 0) {
+ this->actor.world.rot.y -= 0x1600;
+ } else {
+ this->actor.world.rot.y += 0x1600;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/func_80BF5588.s")
+ this->unk_324 = 20;
+ this->unk_310 &= ~0x800;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Rg/EnRg_Draw.s")
+ if ((this->unk_18C != NULL) && (this->unk_18C->id == ACTOR_PLAYER)) {
+ D_80BF5C10 = 0;
+ }
+
+ this->unk_18C = NULL;
+ ret = true;
+ break;
+ }
+ }
+ return ret;
+}
+
+void func_80BF4EBC(EnRg* this, GlobalContext* globalCtx) {
+ if (this->unk_310 & 0x100) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->unk_310 &= ~0x100;
+ this->unk_310 |= 0x10;
+ this->unk_320 = 0;
+ this->actor.shape.yOffset = 14.0f;
+ this->actionFunc = func_80BF4FC4;
+ }
+ } else if (gSaveContext.weekEventReg[12] & 2) {
+ if (DECR(this->unk_318) == 0) {
+ func_80BF409C(this, 1);
+ this->unk_310 &= ~8;
+ this->unk_310 &= ~0x10;
+ this->unk_310 |= 0x100;
+ this->actor.shape.yOffset = 0.0f;
+ this->unk_318 = Rand_S16Offset(0, 20);
+ }
+ }
+ SubS_FillLimbRotTables(globalCtx, this->unk_32E, this->unk_328, ARRAY_COUNT(this->unk_328));
+}
+
+void func_80BF4FC4(EnRg* this, GlobalContext* globalCtx) {
+ this->unk_344 = func_80BF4560(this, globalCtx);
+
+ if (!func_801690CC(globalCtx)) {
+ if (this->actor.bgCheckFlags & 2) {
+ if (this->unk_310 & 0x400) {
+ this->unk_310 &= ~0x400;
+ this->actor.speedXZ = 0.0f;
+ }
+
+ if (this->unk_344 != -1) {
+ this->unk_33C = func_80BF43FC(this);
+ if (this->unk_33C >= 0) {
+ this->unk_33C++;
+ }
+ }
+ } else if ((this->actor.bgCheckFlags & 1) && !(this->unk_310 & 0x1000) &&
+ func_80BF4D64(&this->actor.world.pos)) {
+ this->unk_310 |= 0x1000;
+ }
+
+ if ((this->unk_18C != NULL) && (this->unk_18C->update == NULL)) {
+ this->unk_18C = NULL;
+ this->unk_310 &= ~0x800;
+ }
+
+ if (gSaveContext.eventInf[1] & 1) {
+ if (DECR(this->unk_318) == 0) {
+ func_80BF47AC(this, globalCtx);
+
+ if ((this->unk_324 == 0) && !func_80BF4DA8(this)) {
+ func_80BF4AB8(this, globalCtx);
+ }
+
+ if (func_80BF45B4(this)) {
+ this->unk_310 |= 0x400;
+ this->actor.velocity.y = 7.0f;
+ }
+
+ func_80BF4964(this);
+ Actor_UpdateVelocityWithGravity(&this->actor);
+ Actor_UpdatePos(&this->actor);
+ func_80BF416C(this, globalCtx);
+ return;
+ }
+ }
+ func_80BF4934(this);
+ }
+}
+
+void EnRg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnRg* this = THIS;
+
+ if (gSaveContext.entranceIndex == 0xD010) {
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable,
+ this->morphTable, 18);
+
+ this->unk_334 = -1;
+ func_80BF409C(this, 0);
+ this->skelAnime.curFrame = this->skelAnime.endFrame;
+
+ Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->actor, &sSphereInit);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit);
+ this->collider2.dim.worldSphere.radius = this->collider2.dim.modelSphere.radius;
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ Effect_Add(globalCtx, &this->unk_340, EFFECT_TIRE_MARK, 0, 0, &D_80BF59F0);
+
+ this->path = func_8013BEDC(globalCtx, ENRG_GET_7F80(&this->actor), 255, &this->unk_33C);
+ if (this->path != NULL) {
+ this->unk_33C = 1;
+ }
+
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->unk_310 = 8;
+ this->actor.gravity = -1.0f;
+ SubS_UpdateFlags(&this->unk_310, 3, 7);
+
+ if (!(gSaveContext.weekEventReg[12] & 2)) {
+ this->unk_318 = Rand_S16Offset(30, 30);
+ }
+
+ this->unk_31C = 0;
+ this->unk_31E = 0;
+ this->actionFunc = func_80BF4EBC;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnRg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnRg* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider1);
+ Collider_DestroySphere(globalCtx, &this->collider2);
+ Effect_Destroy(globalCtx, this->unk_340);
+}
+
+void EnRg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnRg* this = THIS;
+
+ func_80BF3F14(this, globalCtx);
+
+ this->actionFunc(this, globalCtx);
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+
+ if (!(this->unk_310 & 0x10)) {
+ func_80BF40F4(this);
+ func_80BF3FF8(this);
+ func_80BF4024(this, globalCtx);
+ }
+
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 20.0f, 0.0f, 0x1D);
+
+ if (this->actor.floorHeight <= BGCHECK_Y_MIN) {
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
+ }
+
+ func_80BF3ED4(this, globalCtx);
+
+ if (!func_801690CC(globalCtx)) {
+ func_80BF3C64(this);
+ }
+}
+
+void func_80BF547C(EnRg* this, GlobalContext* globalCtx) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + this->actor.shape.yOffset,
+ this->actor.world.pos.z, MTXMODE_NEW);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, -this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, this->actor.shape.yOffset, 0.0f, MTXMODE_APPLY);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_oF1d_map_DL_0091A8);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+s32 func_80BF5588(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnRg* this = THIS;
+ s32 phi_v0;
+
+ switch (limbIndex) {
+ case 10:
+ phi_v0 = 0;
+ break;
+
+ case 11:
+ phi_v0 = 1;
+ break;
+
+ case 14:
+ phi_v0 = 2;
+ break;
+
+ default:
+ phi_v0 = 9;
+ break;
+ }
+
+ if (((this->unk_310 & 8) != 0) && (phi_v0 < 9)) {
+ rot->y += (s16)(Math_SinS(this->unk_32E[phi_v0]) * 200.0f);
+ rot->z += (s16)(Math_CosS(this->unk_328[phi_v0]) * 200.0f);
+ }
+
+ return false;
+}
+
+void EnRg_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnRg* this = THIS;
+
+ if (!(this->unk_310 & 0x10)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BF59F8[this->unk_31E]));
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, func_80BF5588, NULL, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else {
+ func_80BF547C(this, globalCtx);
+ }
+ func_80BF3DA0(this, globalCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Rg/z_en_rg.h b/src/overlays/actors/ovl_En_Rg/z_en_rg.h
index 2a34ecf8eb..87f712fe84 100644
--- a/src/overlays/actors/ovl_En_Rg/z_en_rg.h
+++ b/src/overlays/actors/ovl_En_Rg/z_en_rg.h
@@ -7,11 +7,49 @@ struct EnRg;
typedef void (*EnRgActionFunc)(struct EnRg*, GlobalContext*);
+#define ENRG_GET_7F80(thisx) ((((thisx)->params & 0x7F80) >> 7) & 0xFF)
+
+typedef struct {
+ /* 0x00 */ u8 unk_00;
+ /* 0x01 */ u8 unk_01;
+ /* 0x02 */ u8 unk_02;
+ /* 0x03 */ UNK_TYPE1 unk_03[0xD];
+ /* 0x10 */ Vec3f unk_10;
+ /* 0x1C */ Vec3f unk_1C;
+ /* 0x28 */ Vec3f unk_28;
+ /* 0x34 */ f32 unk_34;
+ /* 0x38 */ f32 unk_38;
+} EnRgStruct; // size = 0x3C
+
typedef struct EnRg {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x44];
+ /* 0x0144 */ SkelAnime skelAnime;
/* 0x0188 */ EnRgActionFunc actionFunc;
- /* 0x018C */ char unk_18C[0x940];
+ /* 0x018C */ Actor* unk_18C;
+ /* 0x0190 */ ColliderCylinder collider1;
+ /* 0x01DC */ ColliderSphere collider2;
+ /* 0x0234 */ Path* path;
+ /* 0x0238 */ Vec3s jointTable[18];
+ /* 0x02A4 */ Vec3s morphTable[18];
+ /* 0x0310 */ u16 unk_310;
+ /* 0x0314 */ f32 unk_314;
+ /* 0x0318 */ s16 unk_318;
+ /* 0x031A */ UNK_TYPE1 unk31A[2];
+ /* 0x031C */ s16 unk_31C;
+ /* 0x031E */ s16 unk_31E;
+ /* 0x0320 */ s16 unk_320;
+ /* 0x0322 */ s16 unk_322;
+ /* 0x0324 */ s16 unk_324;
+ /* 0x0326 */ s16 unk_326;
+ /* 0x0328 */ s16 unk_328[3];
+ /* 0x032E */ s16 unk_32E[3];
+ /* 0x0334 */ s32 unk_334;
+ /* 0x0338 */ UNK_TYPE1 unk338[4];
+ /* 0x033C */ s32 unk_33C;
+ /* 0x0340 */ s32 unk_340;
+ /* 0x0344 */ s32 unk_344;
+ /* 0x0348 */ s32 unk_348;
+ /* 0x034C */ EnRgStruct unk_34C[32];
} EnRg; // size = 0xACC
extern const ActorInit En_Rg_InitVars;
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 2dc6842c92..db20137b18 100644
--- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c
+++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c
@@ -6,7 +6,7 @@
#include "z_en_river_sound.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnRiverSound*)thisx)
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 f1c6e9a168..71d08787e2 100644
--- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c
+++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c
@@ -5,8 +5,9 @@
*/
#include "z_en_rr.h"
+#include "objects/object_rr/object_rr.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnRr*)thisx)
@@ -26,8 +27,6 @@ void func_808FB710(EnRr* this, GlobalContext* globalCtx);
void func_808FAD1C(EnRr* this, GlobalContext* globalCtx);
void func_808FB398(EnRr* this, GlobalContext* globalCtx);
-extern Gfx D_06000470[];
-
const ActorInit En_Rr_InitVars = {
ACTOR_EN_RR,
ACTORCAT_ENEMY,
@@ -196,7 +195,7 @@ void func_808FA11C(EnRr* this) {
this->unk_220 = 0.85f;
this->unk_224 = 1.2750001f;
this->unk_21C = 1.0f;
- this->actor.flags &= ~0x400;
+ this->actor.flags &= ~ACTOR_FLAG_400;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
}
@@ -209,7 +208,7 @@ void func_808FA19C(EnRr* this, GlobalContext* globalCtx) {
this->unk_21C = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_234, 20, 2, this->actor.scale.y * 23.333334f,
this->actor.scale.y * 20.000002f);
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -268,7 +267,7 @@ void func_808FA3F8(EnRr* this, Player* player) {
this->unk_1EA = 100;
this->unk_1FC = 20;
this->collider1.base.ocFlags1 &= ~OC1_TYPE_PLAYER;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_1F0 = 8;
this->unk_1E1 = 0;
this->actor.speedXZ = 0.0f;
@@ -299,7 +298,7 @@ void func_808FA4F4(EnRr* this, GlobalContext* globalCtx) {
if (player->stateFlags2 & 0x80) {
player->actor.parent = NULL;
player->unk_AE8 = 100;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->unk_1F0 = 110;
this->unk_1F6 = 2500;
this->unk_210 = 0.0f;
@@ -308,13 +307,13 @@ void func_808FA4F4(EnRr* this, GlobalContext* globalCtx) {
if (((this->unk_1E2 == 0) && (gSaveContext.playerForm == PLAYER_FORM_HUMAN)) &&
(CUR_EQUIP_VALUE_VOID(EQUIP_SHIELD) == EQUIP_SHIELD)) {
sp34 = true;
- this->unk_1E2 = func_8012ED78(globalCtx, 1);
+ this->unk_1E2 = Inventory_DeleteEquipment(globalCtx, 1);
} else {
sp34 = false;
}
if (sp34 && (Message_GetState(&globalCtx->msgCtx) == 0)) {
- func_801518B0(globalCtx, 0xF6, NULL);
+ Message_StartTextbox(globalCtx, 0xF6, NULL);
}
if (this->actor.params == ENRR_0) {
@@ -416,7 +415,7 @@ void func_808FA910(EnRr* this) {
this->actionFunc = func_808FB42C;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LIKE_DEAD);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
void func_808FA9CC(EnRr* this) {
@@ -931,7 +930,7 @@ void EnRr_Draw(Actor* thisx, GlobalContext* globalCtx2) {
this->collider2.dim.pos.y = ((this->unk_228.y - spA4.y) * 0.85f) + spA4.y;
this->collider2.dim.pos.z = ((this->unk_228.z - spA4.z) * 0.85f) + spA4.z;
- gSPDisplayList(POLY_OPA_DISP++, D_06000470);
+ gSPDisplayList(POLY_OPA_DISP++, object_rr_DL_000470);
func_800BE680(globalCtx, &this->actor, this->unk_234, ARRAY_COUNT(this->unk_234),
this->actor.scale.y * 66.66667f * this->unk_220, this->unk_224, this->unk_21C, this->unk_1E0);
diff --git a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c
index 78af19c644..cb110f780a 100644
--- a/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c
+++ b/src/overlays/actors/ovl_En_Rsn/z_en_rsn.c
@@ -5,8 +5,9 @@
*/
#include "z_en_rsn.h"
+#include "objects/object_rs/object_rs.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnRsn*)thisx)
@@ -29,15 +30,10 @@ const ActorInit En_Rsn_InitVars = {
(ActorFunc)EnRsn_Draw,
};
-extern FlexSkeletonHeader D_06009220;
-extern AnimationHeader D_06009120;
-extern AnimationHeader D_0600788C;
-extern Gfx D_06005458[];
-
-static ActorAnimationEntry animations[] = { { &D_0600788C, 1.0f, 0.0f, 0.0f, 0x00, 0.0f } };
+static AnimationInfo sAnimations[] = { { &object_rs_Anim_00788C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f } };
void func_80C25D40(EnRsn* this) {
- Actor_ChangeAnimation(&this->skelAnime, animations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actionFunc = func_80C25D84;
}
@@ -48,8 +44,8 @@ void EnRsn_Init(Actor* thisx, GlobalContext* globalCtx) {
EnRsn* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, NULL, NULL, 0);
- this->actor.flags &= ~1;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rs_Skel_009220, &object_rs_Anim_009120, NULL, NULL, 0);
+ this->actor.flags &= ~ACTOR_FLAG_1;
func_80C25D40(this);
}
@@ -68,19 +64,19 @@ void EnRsn_Update(Actor* thisx, GlobalContext* globalCtx) {
func_800E9250(globalCtx, &this->actor, &this->unk1D8, &this->unk1DE, this->actor.focus.pos);
}
-s32 EnRsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* arg) {
- EnRsn* this = (EnRsn*)arg;
+s32 EnRsn_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnRsn* this = THIS;
if (limbIndex == 14) {
Matrix_InsertXRotation_s(this->unk1D8.y, MTXMODE_APPLY);
}
- return 0;
+ return false;
}
static Vec3f D_80C26028 = { 0.0f, 0.0f, 0.0f };
-void EnRsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* arg) {
- EnRsn* this = (EnRsn*)arg;
+void EnRsn_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnRsn* this = THIS;
Vec3f sp18 = D_80C26028;
if (limbIndex == 14) {
@@ -93,7 +89,7 @@ void EnRsn_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C5B0(globalCtx->state.gfxCtx);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_06005458));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_rs_Tex_005458));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnRsn_OverrideLimbDraw, EnRsn_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Ru/z_en_ru.c b/src/overlays/actors/ovl_En_Ru/z_en_ru.c
index f3edfa7c3e..3e9538f61b 100644
--- a/src/overlays/actors/ovl_En_Ru/z_en_ru.c
+++ b/src/overlays/actors/ovl_En_Ru/z_en_ru.c
@@ -6,7 +6,7 @@
#include "z_en_ru.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnRu*)thisx)
diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
index 414e1123b4..7cfefa59cc 100644
--- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
+++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
@@ -7,7 +7,7 @@
#include "z_en_ruppecrow.h"
#include "objects/object_crow/object_crow.h"
-#define FLAGS 0x00004030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000)
#define THIS ((EnRuppecrow*)thisx)
@@ -285,7 +285,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL);
rupee = this->rupees[rupeeIndex];
rupee->unk152 = 60;
- this->rupees[rupeeIndex]->actor.flags |= 0x10;
+ this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10;
} else {
rupee = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
this->actor.world.pos.x + xOffset, this->actor.world.pos.y,
@@ -296,7 +296,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL);
rupee = this->rupees[rupeeIndex];
rupee->unk152 = 60;
- this->rupees[rupeeIndex]->actor.flags |= 0x10;
+ this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10;
}
} else if (this->rupeeIndex == 19) {
rupee =
@@ -308,7 +308,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL);
rupee = this->rupees[rupeeIndex];
rupee->unk152 = 60;
- this->rupees[rupeeIndex]->actor.flags |= 0x10;
+ this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10;
} else {
rupee =
(EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, this->actor.world.pos.x + xOffset,
@@ -319,7 +319,7 @@ void EnRuppecrow_SpawnRupee(EnRuppecrow* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_RUPY_FALL);
rupee = this->rupees[rupeeIndex];
rupee->unk152 = 60;
- this->rupees[rupeeIndex]->actor.flags |= 0x10;
+ this->rupees[rupeeIndex]->actor.flags |= ACTOR_FLAG_10;
}
this->rupeeIndex++;
@@ -367,7 +367,7 @@ void EnRuppecrow_UpdatePosition(EnRuppecrow* this, GlobalContext* globalCtx) {
s32 EnRuppecrow_CheckPlayedMatchingSong(GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if (globalCtx->msgCtx.unk1202A == 0x3) {
+ if (globalCtx->msgCtx.ocarinaMode == 0x3) {
switch (player->transformation) {
case PLAYER_FORM_DEKU:
if (globalCtx->msgCtx.unk1202E == OCARINA_SONG_SONATA) {
@@ -465,12 +465,12 @@ void EnRuppecrow_HandleDeath(EnRuppecrow* this) {
}
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x0, 0x28);
- if (this->actor.flags & 0x8000) {
+ if (this->actor.flags & ACTOR_FLAG_8000) {
this->actor.speedXZ = 0.0f;
}
this->collider.base.acFlags &= ~AC_ON;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->actionFunc = EnRuppecrow_FallToDespawn;
}
@@ -481,7 +481,7 @@ void EnRuppecrow_UpdateDamage(EnRuppecrow* this, GlobalContext* globalCtx) {
if (this->actor.colChkInfo.damageEffect != 0x1) {
this->actor.colChkInfo.health = 0;
- this->actor.flags &= ~0x1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
Enemy_StartFinishingBlow(globalCtx, &this->actor);
EnRuppecrow_HandleDeath(this);
}
@@ -602,7 +602,7 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, GlobalContext* globalCtx) {
}
this->actor.colorFilterTimer = 40;
- if (!(this->actor.flags & 0x8000)) {
+ if (!(this->actor.flags & ACTOR_FLAG_8000)) {
if (this->currentEffect != ENRUPPECROW_EFFECT_ICE) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x4000, 0x200);
this->actor.shape.rot.z += 0x1780;
@@ -623,8 +623,8 @@ void EnRuppecrow_FallToDespawn(EnRuppecrow* this, GlobalContext* globalCtx) {
}
void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) {
- EnRuppecrow* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnRuppecrow* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_crow_Skel_0010C0, &object_crow_Anim_0000F0, this->joinTable,
@@ -637,7 +637,7 @@ void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) {
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01f);
- this->actor.flags |= 0x2000000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
this->path = func_8013D648(globalCtx, ENRUPPECROW_GET_PATH(&this->actor), 0x3F);
if (this->path != NULL) {
diff --git a/src/overlays/actors/ovl_En_Rz/z_en_rz.c b/src/overlays/actors/ovl_En_Rz/z_en_rz.c
index 26551895a6..57f6798035 100644
--- a/src/overlays/actors/ovl_En_Rz/z_en_rz.c
+++ b/src/overlays/actors/ovl_En_Rz/z_en_rz.c
@@ -6,7 +6,7 @@
#include "z_en_rz.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnRz*)thisx)
diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c
index 07d0dc3f95..99e92b0179 100644
--- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c
+++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c
@@ -1,12 +1,12 @@
/*
* File: z_en_s_goro.c
* Overlay: ovl_En_S_Goro
- * Description: Goron Complaining About Crying / Bomb Shop Goron
+ * Description: Goron in Goron Shrine / Bomb Shop Goron
*/
#include "z_en_s_goro.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnSGoro*)thisx)
diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h
index 489499b333..99c35127a3 100644
--- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h
+++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.h
@@ -3,6 +3,8 @@
#include "global.h"
+#define EN_S_GORO_GET_PARAM_F(thisx) ((thisx)->params & 0xF)
+
struct EnSGoro;
typedef void (*EnSGoroActionFunc)(struct EnSGoro*, GlobalContext*);
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 59417e2b23..7ffeb543b8 100644
--- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c
+++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c
@@ -5,8 +5,9 @@
*/
#include "z_en_sb.h"
+#include "objects/object_sb/object_sb.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnSb*)thisx)
@@ -103,25 +104,19 @@ static Vec3f sFlamePosOffsets[] = {
{ 0.0f, 0.0f, -5.0f },
};
-extern FlexSkeletonHeader D_06002BF0;
-extern AnimationHeader D_06000194;
-extern AnimationHeader D_0600004C;
-extern AnimationHeader D_06000124;
-extern AnimationHeader D_06002C8C;
-extern AnimationHeader D_060000B4;
-
void EnSb_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSb* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
this->actor.colChkInfo.damageTable = &sDamageTable;
- this->actor.colChkInfo.mass = 0xA;
+ this->actor.colChkInfo.mass = 10;
this->actor.colChkInfo.health = 2;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06002BF0, &D_06000194, this->jointTable, this->morphTable, 9);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_sb_Skel_002BF0, &object_sb_Anim_000194, this->jointTable,
+ this->morphTable, 9);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->isDead = false;
- this->actor.colChkInfo.mass = 0x5A;
+ this->actor.colChkInfo.mass = 90;
this->actor.shape.rot.y = 0;
this->actor.speedXZ = 0.0f;
this->actor.gravity = -0.35f;
@@ -149,45 +144,49 @@ void EnSb_SpawnBubbles(GlobalContext* globalCtx, EnSb* this) {
}
void EnSb_SetupWaitClosed(EnSb* this) {
- Animation_Change(&this->skelAnime, &D_0600004C, 1.0f, 0, Animation_GetLastFrame(&D_0600004C), 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_00004C, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_00004C),
+ 2, 0.0f);
this->state = SHELLBLADE_WAIT_CLOSED;
this->actionFunc = EnSb_Idle;
}
void EnSb_SetupOpen(EnSb* this) {
- Animation_Change(&this->skelAnime, &D_06000194, 1.0f, 0, Animation_GetLastFrame(&D_06000194), 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_000194, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_000194),
+ 2, 0.0f);
this->state = SHELLBLADE_OPEN;
this->actionFunc = EnSb_Open;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE);
}
void EnSb_SetupWaitOpen(EnSb* this) {
- Animation_Change(&this->skelAnime, &D_06002C8C, 1.0f, 0, Animation_GetLastFrame(&D_06002C8C), 0, 0.0f);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_002C8C, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_002C8C),
+ 0, 0.0f);
this->state = SHELLBLADE_WAIT_OPEN;
this->actionFunc = EnSb_WaitOpen;
}
void EnSb_SetupLunge(EnSb* this) {
- f32 frameCount = Animation_GetLastFrame(&D_06000124);
+ f32 frameCount = Animation_GetLastFrame(&object_sb_Anim_000124);
f32 playbackSpeed = this->actor.depthInWater > 0.0f ? 1.0f : 0.0f;
- Animation_Change(&this->skelAnime, &D_06000124, playbackSpeed, 0.0f, frameCount, 2, 0);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_000124, playbackSpeed, 0.0f, frameCount, 2, 0);
this->state = SHELLBLADE_LUNGE;
this->actionFunc = EnSb_Lunge;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KUSAMUSHI_VIBE);
}
void EnSb_SetupBounce(EnSb* this) {
- Animation_Change(&this->skelAnime, &D_060000B4, 1.0f, 0, Animation_GetLastFrame(&D_060000B4), 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_0000B4, 1.0f, 0, Animation_GetLastFrame(&object_sb_Anim_0000B4),
+ 2, 0.0f);
this->state = SHELLBLADE_BOUNCE;
this->actionFunc = EnSb_Bounce;
}
void EnSb_SetupIdle(EnSb* this, s32 changeSpeed) {
- f32 frameCount = Animation_GetLastFrame(&D_0600004C);
+ f32 frameCount = Animation_GetLastFrame(&object_sb_Anim_00004C);
if (this->state != SHELLBLADE_WAIT_CLOSED) {
- Animation_Change(&this->skelAnime, &D_0600004C, 1.0f, 0, frameCount, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &object_sb_Anim_00004C, 1.0f, 0, frameCount, 2, 0.0f);
}
this->state = SHELLBLADE_WAIT_CLOSED;
if (changeSpeed) {
@@ -217,7 +216,7 @@ void EnSb_Idle(EnSb* this, GlobalContext* globalCtx) {
void EnSb_Open(EnSb* this, GlobalContext* globalCtx) {
f32 currentFrame = this->skelAnime.curFrame;
- if (Animation_GetLastFrame(&D_06000194) <= currentFrame) {
+ if (Animation_GetLastFrame(&object_sb_Anim_000194) <= currentFrame) {
this->vulnerableTimer = 20;
EnSb_SetupWaitOpen(this);
} else {
@@ -281,7 +280,7 @@ void EnSb_Lunge(EnSb* this, GlobalContext* globalCtx) {
void EnSb_Bounce(EnSb* this, GlobalContext* globalCtx) {
s32 pad;
f32 currentFrame = currentFrame = this->skelAnime.curFrame;
- f32 frameCount = frameCount = Animation_GetLastFrame(&D_060000B4);
+ f32 frameCount = frameCount = Animation_GetLastFrame(&object_sb_Anim_0000B4);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.2f);
if (currentFrame == frameCount) {
diff --git a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c
index c813759cbb..357d41ba74 100644
--- a/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c
+++ b/src/overlays/actors/ovl_En_Sc_Ruppe/z_en_sc_ruppe.c
@@ -6,7 +6,7 @@
#include "z_en_sc_ruppe.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnScRuppe*)thisx)
diff --git a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c
index e71a241e7c..dd64537730 100644
--- a/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c
+++ b/src/overlays/actors/ovl_En_Scopecoin/z_en_scopecoin.c
@@ -5,8 +5,9 @@
*/
#include "z_en_scopecoin.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnScopecoin*)thisx)
@@ -83,8 +84,10 @@ void EnScopecoin_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
-static UNK_PTR D_80BFD280[] = { &D_04061FC0, &D_04061FE0, &D_04062000, &D_04062040,
- &D_04062020, &D_04062060, &D_04062000 };
+static TexturePtr D_80BFD280[] = {
+ gameplay_keep_Tex_061FC0, gameplay_keep_Tex_061FE0, gameplay_keep_Tex_062000, gameplay_keep_Tex_062040,
+ gameplay_keep_Tex_062020, gameplay_keep_Tex_062060, gameplay_keep_Tex_062000,
+};
void EnScopecoin_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnScopecoin* this = THIS;
@@ -96,7 +99,7 @@ void EnScopecoin_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80BFD280[this->unk148]));
- gSPDisplayList(POLY_OPA_DISP++, D_040622C0);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_keep_DL_0622C0);
CLOSE_DISPS(gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
index 76665f67ae..bf0b6a839a 100644
--- a/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
+++ b/src/overlays/actors/ovl_En_Scopecrow/z_en_scopecrow.c
@@ -6,7 +6,7 @@
#include "z_en_scopecrow.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnScopecrow*)thisx)
diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
index 9e2a1579d7..0eabcd80f7 100644
--- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
+++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.c
@@ -5,8 +5,10 @@
*/
#include "z_en_scopenuts.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_dnt/object_dnt.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnScopenuts*)thisx)
@@ -15,7 +17,22 @@ void EnScopenuts_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnScopenuts_Update(Actor* thisx, GlobalContext* globalCtx);
void EnScopenuts_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80BCB078(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB1C8(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB4DC(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB52C(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB90C(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCB980(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCBC60(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCBF0C(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCBFFC(EnScopenuts* this, GlobalContext* globalCtx);
+void func_80BCC288(EnScopenuts* this, GlobalContext* globalCtx);
+s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_);
+f32 func_80BCC448(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3);
+
const ActorInit En_Scopenuts_InitVars = {
ACTOR_EN_SCOPENUTS,
ACTORCAT_NPC,
@@ -28,81 +45,786 @@ const ActorInit En_Scopenuts_InitVars = {
(ActorFunc)EnScopenuts_Draw,
};
-// static ColliderCylinderInitType1 sCylinderInit = {
-static ColliderCylinderInitType1 D_80BCCB40 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInitType1 sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 27, 32, 0, { 0, 0, 0 } },
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80BCCCF0[] = {
+static AnimationInfoS sAnimations[] = {
+ { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+};
+
+Gfx* D_80BCCCDC[] = { gameplay_keep_DL_0527F0, gameplay_keep_DL_0528B0 };
+
+Vec3f D_80BCCCE4 = { 0.0f, -0.5f, 0.0f };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 0, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP),
};
-#endif
+s16 func_80BCABF0(Path* path) {
+ Vec3s* sp34 = Lib_SegmentedToVirtual(path->points);
+ Vec3f sp28;
+ Vec3f sp1C;
-extern ColliderCylinderInit D_80BCCB40;
-extern InitChainEntry D_80BCCCF0[];
+ Math_Vec3s_ToVec3f(&sp28, &sp34[0]);
+ Math_Vec3s_ToVec3f(&sp1C, &sp34[1]);
+ return Math_Vec3f_Yaw(&sp28, &sp1C);
+}
-extern UNK_TYPE D_06001420;
-extern UNK_TYPE D_06005488;
+void func_80BCAC40(EnScopenuts* this, GlobalContext* globalCtx) {
+ s16 i;
+ Vec3f sp60;
+ Vec3f sp54;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCABF0.s")
+ sp60 = this->actor.world.pos;
+ sp60.y += 100.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAC40.s")
+ for (i = 0; i < 36; i++) {
+ sp54.x = Rand_Centered() * 10.0f;
+ sp54.y = 2.0f * Rand_Centered();
+ sp54.z = Rand_Centered() * 10.0f;
+ EffectSsHahen_Spawn(globalCtx, &sp60, &sp54, &D_80BCCCE4, 0, 0x96, 1, 0x10, D_80BCCCDC[i & 1]);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAD64.s")
+void func_80BCAD64(EnScopenuts* this, s16 arg1) {
+ f32 sp24 = Math_CosS(this->actor.world.rot.x) * this->actor.speedXZ;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAE78.s")
+ switch (arg1) {
+ case 1:
+ this->actor.velocity.y = this->actor.speedXZ;
+ this->actor.velocity.x = 0.0f;
+ this->actor.velocity.z = 0.0f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAF0C.s")
+ case 2:
+ this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ;
+ this->actor.velocity.y = 0.0f;
+ this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCAFA8.s")
+ case 3:
+ this->actor.velocity.x = 0.0f;
+ this->actor.velocity.y = 0.0f;
+ this->actor.velocity.z = 0.0f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB078.s")
+ default:
+ this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * sp24;
+ this->actor.velocity.y = Math_SinS(this->actor.world.rot.x) * this->actor.speedXZ;
+ this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * sp24;
+ break;
+ }
+ Actor_UpdatePos(&this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB1C8.s")
+void func_80BCAE78(EnScopenuts* this, GlobalContext* globalCtx) {
+ if (this->unk_328 & 4) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB230.s")
+ if (this->unk_328 & 2) {
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 20.0f, 20.0f, 5);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB4DC.s")
+s16 func_80BCAF0C(EnScopenuts* this) {
+ switch (this->unk_33C) {
+ case 0x0:
+ if (gSaveContext.weekEventReg[53] & 2) {
+ this->unk_328 |= 1;
+ return 0x1638;
+ }
+ return 0x162F;
+ case 0x162F:
+ return 0x1630;
+ case 0x1630:
+ return 0x1631;
+ case 0x1631:
+ this->unk_358 = 150;
+ return 0x1632;
+ case 0x1633:
+ this->unk_358 = 100;
+ return 0x1634;
+ }
+ return 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB52C.s")
+void func_80BCAFA8(EnScopenuts* this, GlobalContext* globalCtx) {
+ Vec3f sp1C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB6D0.s")
+ func_80169474(globalCtx, &this->actor.world.pos, &sp1C);
+ if ((sp1C.x >= 130.0f) && (sp1C.x < 190.0f) && (sp1C.y >= 90.0f)) {
+ if (sp1C.y < 150.0f) {
+ this->actor.draw = EnScopenuts_Draw;
+ this->unk_348 = 10;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10);
+ this->actionFunc = func_80BCB078;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB90C.s")
+void func_80BCB078(EnScopenuts* this, GlobalContext* globalCtx) {
+ Vec3s sp30;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCB980.s")
+ if (this->path != NULL) {
+ func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp30);
+ if (this->actor.bgCheckFlags & 8) {
+ sp30.y = this->actor.wallYaw;
+ }
+ Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 10, 300, 0);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->unk_33E = 0x1000;
+ this->unk_340 += 0x1C71;
+ this->actor.world.rot.x = -sp30.x;
+ if (func_80BCC2AC(this, this->path, this->unk_334)) {
+ if (this->unk_334 >= (this->path->count - 1)) {
+ this->actionFunc = func_80BCB1C8;
+ this->actor.speedXZ = 0.0f;
+ this->actor.gravity = -1.0f;
+ return;
+ }
+ this->unk_334++;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBA00.s")
+ if (this->unk_334 >= (this->path->count - 2)) {
+ Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f);
+ } else {
+ Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f);
+ }
+ Actor_MoveWithoutGravity(&this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBC60.s")
+void func_80BCB1C8(EnScopenuts* this, GlobalContext* globalCtx) {
+ this->unk_350 *= 0.92f;
+ Actor_SetScale(&this->actor, this->unk_350);
+ if (this->actor.bgCheckFlags & 1) {
+ gSaveContext.weekEventReg[52] |= 0x40;
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBD28.s")
+void func_80BCB230(EnScopenuts* this, GlobalContext* globalCtx) {
+ s16 sp26 = this->skelAnime.curFrame;
+ s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBF0C.s")
+ Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCBFFC.s")
+ if ((((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) &&
+ ((this->actor.xzDistToPlayer < 200.0f) ? true : false)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
+ this->actionFunc = func_80BCB4DC;
+ this->unk_348 = 3;
+ this->collider.dim.height = 64;
+ func_80BCAC40(this, globalCtx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
+ } else if (sp26 == sp24) {
+ if ((this->unk_348 == 4) || (this->unk_348 == 18)) {
+ this->unk_348 = 17;
+ this->collider.dim.height = 0;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 17);
+ } else if (this->unk_348 == 2) {
+ this->unk_348 = 16;
+ this->collider.dim.height = 32;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 16);
+ } else if (this->unk_348 == 17) {
+ if (DECR(this->unk_34E) == 0) {
+ this->unk_34E = Rand_ZeroOne() * 10.0f;
+ this->unk_348 = 2;
+ this->collider.dim.height = 32;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 2);
+ }
+ } else if ((this->unk_348 == 16) && (DECR(this->unk_34E) == 0)) {
+ this->unk_34E = Rand_S16Offset(40, 40);
+ this->unk_348 = 18;
+ this->collider.dim.height = 32;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 18);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC288.s")
+void func_80BCB4DC(EnScopenuts* this, GlobalContext* globalCtx) {
+ if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
+ this->actionFunc = func_80BCB52C;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC2AC.s")
+void func_80BCB52C(EnScopenuts* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_33C = func_80BCAF0C(this);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
+ this->actionFunc = func_80BCB6D0;
+ } else if (((this->actor.xzDistToPlayer < 100.0f) &&
+ (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false)) ||
+ this->actor.isTargeted) {
+ func_800B8614(&this->actor, globalCtx, 100.0f);
+ } else if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) ||
+ !((this->actor.xzDistToPlayer < 200.0f) ? true : false)) {
+ this->unk_348 = 4;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
+ this->actionFunc = func_80BCB230;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC448.s")
+void func_80BCB6D0(EnScopenuts* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Init.s")
+ if (temp_v0 == 5) {
+ if (func_80147624(globalCtx)) {
+ if (this->unk_328 & 1) {
+ this->unk_328 &= ~1;
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->unk_328 &= ~4;
+ this->unk_348 = 8;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 8);
+ this->actionFunc = func_80BCBA00;
+ } else {
+ this->unk_33C = func_80BCAF0C(this);
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
+ }
+ }
+ } else if (temp_v0 == 4) {
+ if (func_80147624(globalCtx) != 0) {
+ switch (globalCtx->msgCtx.choiceIndex) {
+ case 0:
+ if (gSaveContext.rupees < this->unk_358) {
+ play_sound(NA_SE_SY_ERROR);
+ this->unk_33C = 0x1636;
+ this->unk_328 |= 1;
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
+ } else {
+ func_8019F208();
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ func_801159EC(this->unk_358 * -1);
+ this->actionFunc = func_80BCB90C;
+ }
+ break;
+ case 1:
+ func_8019F230();
+ if (this->unk_358 == 150) {
+ this->unk_33C = 0x1633;
+ } else {
+ this->unk_33C = 0x1635;
+ this->unk_328 |= 1;
+ }
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
+ break;
+ }
+ }
+ } else if (temp_v0 == 6) {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ this->actionFunc = func_80BCB980;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Destroy.s")
+void func_80BCB90C(EnScopenuts* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ gSaveContext.weekEventReg[53] |= 2;
+ this->actionFunc = func_80BCB6D0;
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_HEART_PIECE, 300.0f, 300.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Update.s")
+void func_80BCB980(EnScopenuts* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_33C = 0x1637;
+ this->unk_328 |= 1;
+ Message_StartTextbox(globalCtx, this->unk_33C, &this->actor);
+ this->actionFunc = func_80BCB6D0;
+ } else {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC828.s")
+void func_80BCBA00(EnScopenuts* this, GlobalContext* globalCtx) {
+ s16 sp26 = this->skelAnime.curFrame;
+ s16 sp24 = Animation_GetLastFrame(sAnimations[this->unk_348].animation);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC9CC.s")
+ switch (sp26) {
+ case 10:
+ this->unk_35A = 1;
+ this->unk_35C = 0.1f;
+ this->unk_360 = 0.1f;
+ this->unk_364 = 0.1f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/func_80BCC9E4.s")
+ case 11:
+ case 12:
+ this->unk_35C += 0.15f;
+ this->unk_360 += 0.32f;
+ this->unk_364 += 0.15f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Scopenuts/EnScopenuts_Draw.s")
+ case 13:
+ this->unk_35C = 0.55f;
+ this->unk_360 = 1.05f;
+ this->unk_364 = 0.55f;
+ break;
+
+ case 14:
+ this->unk_35C = 1.0f;
+ this->unk_360 = 2.0f;
+ this->unk_364 = 1.0f;
+ break;
+
+ case 15:
+ case 16:
+ this->unk_360 -= 0.33f;
+ break;
+
+ case 17:
+ this->unk_360 = 1.0f;
+ break;
+
+ case 18:
+ case 19:
+ this->unk_360 += 0.27f;
+ break;
+
+ case 20:
+ this->unk_35A = 2;
+ this->unk_360 = 1.8f;
+ break;
+
+ case 21:
+ case 22:
+ case 23:
+ this->unk_360 -= 0.2f;
+ break;
+
+ case 24:
+ this->unk_360 = 1.0f;
+ break;
+ }
+
+ if (this->unk_36C == 0) {
+ if (ActorCutscene_GetCanPlayNext(this->unk_338)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor);
+ this->unk_36C = 1;
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->unk_338);
+ return;
+ }
+ }
+
+ if (sp26 == sp24) {
+ this->unk_35A = 3;
+ this->unk_348 = 19;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 19);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
+ this->unk_328 &= ~2;
+ this->unk_34E = 50;
+ this->unk_328 |= 8;
+ this->unk_32C = this->actor.world.pos.y;
+ this->actionFunc = func_80BCBC60;
+ }
+}
+
+void func_80BCBC60(EnScopenuts* this, GlobalContext* globalCtx) {
+ f32 sp24;
+ Vec3f sp18;
+
+ this->unk_340 += this->unk_34C;
+ sp24 = this->unk_32C - this->actor.world.pos.y;
+
+ if (!(this->unk_370 & 3)) {
+ sp18.x = this->actor.world.pos.x;
+ sp18.y = this->unk_32C;
+ sp18.z = this->actor.world.pos.z;
+ func_800B14D4(globalCtx, 20.0f, &sp18);
+ }
+
+ if (sp24 > 5.0f) {
+ this->actor.velocity.y = 0.0f;
+ this->actor.gravity = 0.0f;
+ this->unk_372 = func_80BCABF0(this->path);
+ this->actionFunc = func_80BCBD28;
+ }
+}
+
+void func_80BCBD28(EnScopenuts* this, GlobalContext* globalCtx) {
+ Vec3f sp44;
+ s16 sp42 = this->skelAnime.curFrame;
+ s16 sp40 = Animation_GetLastFrame(sAnimations[this->unk_348].animation);
+ Vec3s sp38;
+
+ func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38);
+ if (sp42 == sp40) {
+ Math_SmoothStepToS(&this->unk_34C, 0x1C71, 3, 0x100, 0);
+ this->unk_340 += this->unk_34C;
+ this->actor.shape.yOffset = 1500.0f;
+ }
+
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_372, 3, 2000, 0);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+
+ if (DECR(this->unk_34E) == 0) {
+ if (!(this->unk_370 & 3)) {
+ sp44 = this->actor.world.pos;
+ func_800B14D4(globalCtx, 20.0f, &sp44);
+ }
+ this->actor.velocity.y = 5.0f;
+ } else if (!(this->unk_370 & 3)) {
+ sp44.x = this->actor.world.pos.x;
+ sp44.y = this->unk_32C;
+ sp44.z = this->actor.world.pos.z;
+ func_800B14D4(globalCtx, 20.0f, &sp44);
+ }
+
+ if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) {
+ this->unk_368 = 0.3f;
+ this->unk_348 = 9;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 9);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
+ func_80BCAC40(this, globalCtx);
+ this->actionFunc = func_80BCBF0C;
+ }
+}
+
+void func_80BCBF0C(EnScopenuts* this, GlobalContext* globalCtx) {
+ this->unk_340 += this->unk_34C;
+ if (this->unk_368 >= 1.0f) {
+ this->unk_368 = 1.0f;
+ this->actor.velocity.y = 5.0f;
+ } else {
+ this->actor.velocity.y = 5.0f;
+ this->unk_368 += 0.1f;
+ }
+
+ if ((this->actor.home.pos.y + 50.0f) < this->actor.world.pos.y) {
+ Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f);
+ this->unk_348 = 10;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 10);
+ this->unk_328 |= 2;
+ this->unk_36E = 0;
+ this->actionFunc = func_80BCBFFC;
+ }
+}
+
+void func_80BCBFFC(EnScopenuts* this, GlobalContext* globalCtx) {
+ Vec3s sp38;
+ f32 sp34;
+ s16 sp32 = 0;
+
+ this->actor.velocity.y = 0.0f;
+ this->actor.gravity = 0.0f;
+
+ if (this->path != NULL) {
+ sp34 = func_80BCC448(this->path, this->unk_334, &this->actor.world.pos, &sp38);
+ if (this->actor.bgCheckFlags & 8) {
+ sp38.y = this->actor.wallYaw;
+ }
+
+ if (this->unk_334 < 6) {
+ Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 300, 0);
+ } else {
+ Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 1500, 0);
+ }
+
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ this->unk_33E = 0x1000;
+ this->unk_340 += this->unk_34C;
+ this->actor.world.rot.x = -sp38.x;
+
+ if (func_80BCC2AC(this, this->path, this->unk_334)) {
+ sp32 = 1;
+ }
+
+ if (sp34 < 10.0f) {
+ if (sp32 == 1) {
+ sp32 = 3;
+ } else {
+ sp32 = 2;
+ }
+ }
+
+ if (sp32 == 3) {
+ if (this->unk_334 >= (this->path->count - 1)) {
+ ActorCutscene_Stop(this->unk_338);
+ gSaveContext.weekEventReg[52] &= (u8)~0x40;
+ this->actionFunc = func_80BCC288;
+ } else {
+ this->unk_334++;
+ }
+ }
+ } else if (this->actor.playerHeightRel > 500.0f) {
+ ActorCutscene_Stop(this->unk_338);
+ this->actionFunc = func_80BCC288;
+ }
+
+ Math_ApproachF(&this->actor.speedXZ, 1.0f, 0.2f, 1.0f);
+ func_80BCAD64(this, sp32);
+
+ if (this->unk_36C == 2) {
+ if (ActorCutscene_GetCanPlayNext(this->unk_338)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_338, &this->actor);
+ this->unk_36C = 3;
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_338);
+ return;
+ }
+ } else if ((this->unk_36C == 1) && (this->unk_36E == 20)) {
+ ActorCutscene_Stop(this->unk_338);
+ this->unk_338 = ActorCutscene_GetAdditionalCutscene(this->unk_338);
+ ActorCutscene_SetIntentToPlay(this->unk_338);
+ this->unk_36C = 2;
+ }
+ this->unk_36E++;
+}
+
+void func_80BCC288(EnScopenuts* this, GlobalContext* globalCtx) {
+ Actor_MarkForDeath(&this->actor);
+}
+
+s32 func_80BCC2AC(EnScopenuts* this, Path* path, s32 arg2_) {
+ Vec3s* sp5C = Lib_SegmentedToVirtual(path->points);
+ s32 sp58 = path->count;
+ s32 arg2 = arg2_;
+ s32 sp50 = false;
+ f32 phi_f12;
+ f32 phi_f14;
+ f32 sp44;
+ f32 sp40;
+ f32 sp3C;
+ Vec3f sp30;
+
+ Math_Vec3s_ToVec3f(&sp30, &sp5C[arg2]);
+
+ if (arg2 == 0) {
+ phi_f12 = sp5C[1].x - sp5C[0].x;
+ phi_f14 = sp5C[1].z - sp5C[0].z;
+ } else if ((sp58 - 1) == arg2) {
+ phi_f12 = sp5C[sp58 - 1].x - sp5C[sp58 - 2].x;
+ phi_f14 = sp5C[sp58 - 1].z - sp5C[sp58 - 2].z;
+ } else {
+ phi_f12 = sp5C[arg2 + 1].x - sp5C[arg2 - 1].x;
+ phi_f14 = sp5C[arg2 + 1].z - sp5C[arg2 - 1].z;
+ }
+
+ func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+
+ if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
+ sp50 = true;
+ }
+ return sp50;
+}
+
+f32 func_80BCC448(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) {
+ Vec3s* temp_v1;
+ Vec3f sp20;
+
+ if (path != NULL) {
+ temp_v1 = Lib_SegmentedToVirtual(path->points);
+ temp_v1 = &temp_v1[arg1];
+ sp20.x = temp_v1[0].x;
+ sp20.y = temp_v1[0].y;
+ sp20.z = temp_v1[0].z;
+ }
+
+ arg3->y = Math_Vec3f_Yaw(arg2, &sp20);
+ arg3->x = Math_Vec3f_Pitch(arg2, &sp20);
+
+ return sp20.y - arg2->y;
+}
+
+void EnScopenuts_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnScopenuts* this = THIS;
+
+ if (!(gSaveContext.weekEventReg[74] & 0x40) && (gSaveContext.inventory.items[ITEM_OCARINA] == ITEM_NONE)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable,
+ this->morphTable, 28);
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
+ this->unk_350 = 0.01f;
+ Actor_SetScale(&this->actor, 0.01f);
+ this->actor.colChkInfo.cylRadius = 0;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->unk_328 |= 2;
+ this->unk_328 |= 4;
+ this->actor.speedXZ = 0.0f;
+
+ if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_0) {
+ if (gSaveContext.weekEventReg[52] & 0x40) {
+ Actor_MarkForDeath(&this->actor);
+ } else if (globalCtx->actorCtx.unk5 & 2) {
+ this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
+ this->actor.draw = NULL;
+ this->actionFunc = func_80BCAFA8;
+ this->actor.gravity = 0.0f;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) {
+ if (gSaveContext.weekEventReg[52] & 0x40) {
+ this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
+ if (this->path == NULL) {
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ this->actor.gravity = -1.0f;
+ this->actor.draw = EnScopenuts_Draw;
+ this->unk_338 = this->actor.cutscene;
+ this->unk_33C = 0;
+ this->unk_358 = 150;
+ this->unk_348 = 4;
+ this->unk_35A = 0;
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
+ this->actionFunc = func_80BCB230;
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnScopenuts_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnScopenuts* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnScopenuts_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnScopenuts* this = THIS;
+
+ Actor_SetFocus(&this->actor, 60.0f);
+ SkelAnime_Update(&this->skelAnime);
+ Actor_MoveWithGravity(&this->actor);
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_328 & 8) {
+ func_800B9010(&this->actor, NA_SE_EN_AKINDO_FLY - SFX_FLAG);
+ }
+ func_80BCAE78(this, globalCtx);
+}
+
+s32 EnScopenuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnScopenuts* this = THIS;
+
+ if (((this->unk_348 == 4) && (this->unk_35A == 0)) || ((this->unk_348 == 8) && (this->unk_35A == 0)) ||
+ (this->unk_348 == 18) || (this->unk_348 == 2) || (this->unk_348 == 3) || (this->unk_348 == 17) ||
+ (this->unk_348 == 16)) {
+ if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 23) || (limbIndex == 24) ||
+ (limbIndex == 15)) {
+ *dList = NULL;
+ }
+ } else if ((this->unk_348 == 8) || (this->unk_348 == 19)) {
+ switch (this->unk_35A) {
+ case 1:
+ if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 25)) {
+ *dList = NULL;
+ }
+ break;
+
+ case 2:
+ case 3:
+ if ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27) || (limbIndex == 15) ||
+ (limbIndex == 25)) {
+ *dList = NULL;
+ }
+ break;
+ }
+ } else if (((this->unk_348 == 9) || (this->unk_348 == 10)) && ((limbIndex == 15) || (limbIndex == 25))) {
+ *dList = NULL;
+ }
+
+ if (limbIndex == 26) {
+ if ((this->unk_33C == 0x162F) || (this->unk_33C == 0x1630)) {
+ *dList = object_dnt_DL_001420;
+ } else {
+ *dList = object_dnt_DL_008290;
+ }
+ }
+
+ return false;
+}
+
+void EnScopenuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+}
+
+void EnScopenuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+ EnScopenuts* this = THIS;
+
+ if (((this->unk_35A == 1) || (this->unk_35A == 2)) && ((limbIndex == 23) || (limbIndex == 24))) {
+ Matrix_Scale(this->unk_35C, this->unk_360, this->unk_364, MTXMODE_APPLY);
+ }
+
+ if ((this->unk_348 == 9) && ((limbIndex == 16) || (limbIndex == 21) || (limbIndex == 27))) {
+ Matrix_Scale(this->unk_368, this->unk_368, this->unk_368, MTXMODE_APPLY);
+ }
+
+ if (limbIndex == 24) {
+ Matrix_RotateY(this->unk_340, MTXMODE_APPLY);
+ }
+}
+
+void EnScopenuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnScopenuts* this = THIS;
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnScopenuts_OverrideLimbDraw, EnScopenuts_PostLimbDraw,
+ EnScopenuts_TransformLimbDraw, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h
index 2eed1584fb..c4a00f84a4 100644
--- a/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h
+++ b/src/overlays/actors/ovl_En_Scopenuts/z_en_scopenuts.h
@@ -7,11 +7,44 @@ struct EnScopenuts;
typedef void (*EnScopenutsActionFunc)(struct EnScopenuts*, GlobalContext*);
+#define ENSCOPENUTS_GET_3E0(thisx) (((thisx)->params & 0x3E0) >> 5)
+#define ENSCOPENUTS_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
+
+#define ENSCOPENUTS_3E0_0 0
+#define ENSCOPENUTS_3E0_1 1
+
typedef struct EnScopenuts {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x194];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[28];
+ /* 0x0230 */ Vec3s morphTable[28];
/* 0x02D8 */ EnScopenutsActionFunc actionFunc;
- /* 0x02DC */ char unk_2DC[0x98];
+ /* 0x02DC */ ColliderCylinder collider;
+ /* 0x0328 */ u16 unk_328;
+ /* 0x032C */ f32 unk_32C;
+ /* 0x0330 */ Path* path;
+ /* 0x0334 */ s32 unk_334;
+ /* 0x0338 */ s16 unk_338;
+ /* 0x033A */ UNK_TYPE1 unk33A[2];
+ /* 0x033C */ u16 unk_33C;
+ /* 0x033E */ s16 unk_33E;
+ /* 0x0340 */ s16 unk_340;
+ /* 0x0342 */ UNK_TYPE1 unk342[0x6];
+ /* 0x0348 */ s32 unk_348;
+ /* 0x034C */ s16 unk_34C;
+ /* 0x034E */ s16 unk_34E;
+ /* 0x0350 */ f32 unk_350;
+ /* 0x0354 */ UNK_TYPE1 unk354[4];
+ /* 0x0358 */ s16 unk_358;
+ /* 0x035A */ s16 unk_35A;
+ /* 0x035C */ f32 unk_35C;
+ /* 0x0360 */ f32 unk_360;
+ /* 0x0364 */ f32 unk_364;
+ /* 0x0368 */ f32 unk_368;
+ /* 0x036C */ s16 unk_36C;
+ /* 0x036E */ s16 unk_36E;
+ /* 0x0370 */ s16 unk_370;
+ /* 0x0372 */ s16 unk_372;
} EnScopenuts; // size = 0x374
extern const ActorInit En_Scopenuts_InitVars;
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 e423a2046b..3a355b3611 100644
--- a/src/overlays/actors/ovl_En_Sda/z_en_sda.c
+++ b/src/overlays/actors/ovl_En_Sda/z_en_sda.c
@@ -6,7 +6,7 @@
#include "z_en_sda.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnSda*)thisx)
diff --git a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c
index 29b6737604..5ce4184a6f 100644
--- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c
+++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c
@@ -6,7 +6,7 @@
#include "z_en_sekihi.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnSekihi*)thisx)
diff --git a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
index e07b6895c0..6b299ae9af 100644
--- a/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
+++ b/src/overlays/actors/ovl_En_Sellnuts/z_en_sellnuts.c
@@ -5,8 +5,9 @@
*/
#include "z_en_sellnuts.h"
+#include "objects/object_dnt/object_dnt.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnSellnuts*)thisx)
@@ -34,33 +35,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx);
s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2);
f32 func_80ADCFE8(Path* path, s32 arg1, Vec3f* pos, Vec3s* arg3);
-extern AnimationHeader D_06000994;
-extern AnimationHeader D_060012F4;
-extern Gfx D_06001350[];
-extern AnimationHeader D_06001BC8;
-extern AnimationHeader D_06001E2C;
-extern AnimationHeader D_06002268;
-extern AnimationHeader D_06002670;
-extern AnimationHeader D_060029E8;
-extern AnimationHeader D_06002F08;
-extern AnimationHeader D_06003438;
-extern AnimationHeader D_060038CC;
-extern AnimationHeader D_06003CC0;
-extern AnimationHeader D_06004700;
-extern AnimationHeader D_06004AA0;
-extern AnimationHeader D_06004E38;
-extern AnimationHeader D_06005488;
-extern AnimationHeader D_0600577C;
-extern AnimationHeader D_06005CA8;
-extern Gfx D_06008290[];
-extern FlexSkeletonHeader D_0600AC70;
-extern AnimationHeader D_0600B0B4;
-
-static u16 D_80ADD910[] = {
- 0x0614,
- 0x060E,
- 0x0628,
-};
+static u16 D_80ADD910[] = { 0x0614, 0x060E, 0x0628 };
static u16 D_80ADD918[] = { 0x0616, 0x0610, 0x0629 };
@@ -105,15 +80,30 @@ static ColliderCylinderInitType1 sCylinderInit = {
{ 27, 32, 0, { 0, 0, 0 } },
};
-static ActorAnimationEntryS D_80ADD990[] = {
- { &D_06005488, 1.0f, 0, -1, 0, 0 }, { &D_0600B0B4, 1.0f, 0, -1, 0, 0 }, { &D_06004AA0, 1.0f, 0, -1, 2, 0 },
- { &D_06004E38, 1.0f, 0, -1, 2, 0 }, { &D_060029E8, 1.0f, 0, -1, 2, 0 }, { &D_06005CA8, 1.0f, 0, -1, 2, 0 },
- { &D_060038CC, 1.0f, 0, -1, 0, 0 }, { &D_06003CC0, 1.0f, 0, -1, 0, 0 }, { &D_060012F4, 1.0f, 0, -1, 2, 0 },
- { &D_06004700, 1.0f, 0, -1, 2, 0 }, { &D_06001BC8, 1.0f, 0, -1, 0, 0 }, { &D_06003438, 1.0f, 0, -1, 2, 0 },
- { &D_06001E2C, 1.0f, 0, -1, 0, 0 }, { &D_06000994, 1.0f, 0, -1, 0, 0 }, { &D_06002268, 1.0f, 0, -1, 2, 0 },
- { &D_06002F08, 1.0f, 0, -1, 0, 0 }, { &D_0600577C, 1.0f, 0, -1, 0, -4 }, { &D_060029E8, 1.0f, 8, -1, 2, 0 },
- { &D_060029E8, 1.0f, 4, -1, 2, -4 }, { &D_060029E8, 1.0f, 0, -1, 2, 0 }, { &D_06001BC8, 1.0f, 0, -1, 0, 0 },
- { &D_060012F4, -1.0f, 0, -1, 2, 0 }, { &D_06002670, 1.0f, 0, -1, 2, 0 },
+static AnimationInfoS D_80ADD990[] = {
+ { &object_dnt_Anim_005488, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00B0B4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_004AA0, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004E38, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_005CA8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0038CC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_004700, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_003438, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001E2C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_000994, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_002268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002F08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_00577C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 8, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_0029E8, 1.0f, 4, -1, ANIMMODE_ONCE, -4 },
+ { &object_dnt_Anim_0029E8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_001BC8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_dnt_Anim_0012F4, -1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_dnt_Anim_002670, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
};
static InitChainEntry sInitChain[] = {
@@ -245,25 +235,25 @@ f32 func_80ADB08C(GlobalContext* globalCtx) {
void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) {
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if (currentFrame == frameCount) {
switch (this->unk_340) {
case 0x611:
case 0x62A:
this->unk_34C = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0);
this->actionFunc = func_80ADBFA0;
break;
case 0x618:
if (this->unk_34C == 1) {
this->unk_34C = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0);
this->actionFunc = func_80ADB544;
} else {
this->unk_34C = 1;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1);
this->actionFunc = func_80ADBFA0;
}
break;
@@ -274,7 +264,7 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) {
case 0x614:
case 0x628:
this->unk_34C = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0);
this->actionFunc = func_80ADB924;
break;
@@ -283,14 +273,14 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) {
case 0x616:
case 0x629:
this->unk_34C = 1;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 1);
this->actionFunc = func_80ADB924;
break;
case 0x613:
case 0x619:
this->unk_34C = 7;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 7);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 7);
this->actionFunc = func_80ADBD64;
break;
}
@@ -299,7 +289,7 @@ void func_80ADB0D8(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) {
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0xE38);
if (((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f) ? true : false) &&
@@ -308,31 +298,31 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) {
this->actionFunc = func_80ADB4F4;
this->unk_34C = 3;
this->collider.dim.height = 64;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 3);
} else if (currentFrame == frameCount) {
if ((this->unk_34C == 4) || (this->unk_34C == 18)) {
this->unk_34C = 17;
this->collider.dim.height = 0;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
- func_8013BC6C(&this->skelAnime, D_80ADD990, 17);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 17);
} else if (this->unk_34C == 2) {
this->unk_34C = 16;
this->collider.dim.height = 32;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
- func_8013BC6C(&this->skelAnime, D_80ADD990, 16);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 16);
} else if (this->unk_34C == 17) {
if (DECR(this->unk_34E) == 0) {
this->unk_34E = Rand_ZeroOne() * 10.0f;
this->unk_34C = 2;
this->collider.dim.height = 32;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 2);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 2);
}
} else if (this->unk_34C == 16) {
if (DECR(this->unk_34E) == 0) {
this->unk_34E = Rand_S16Offset(40, 40);
this->unk_34C = 18;
this->collider.dim.height = 32;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 18);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 18);
}
}
}
@@ -341,7 +331,7 @@ void func_80ADB254(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADB4F4(EnSellnuts* this, GlobalContext* globalCtx) {
if (this->skelAnime.curFrame == this->skelAnime.endFrame) {
this->actionFunc = func_80ADB544;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0);
}
}
@@ -360,27 +350,27 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) {
case 0x60E:
gSaveContext.weekEventReg[17] |= 0x20;
gSaveContext.weekEventReg[86] |= 4;
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
this->actionFunc = func_80ADB0D8;
break;
case 0x628:
gSaveContext.weekEventReg[77] |= 0x40;
gSaveContext.weekEventReg[86] |= 4;
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
this->actionFunc = func_80ADB0D8;
break;
case 0x614:
gSaveContext.weekEventReg[17] |= 0x40;
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
this->actionFunc = func_80ADB0D8;
break;
case 0x610:
case 0x616:
case 0x629:
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
this->actionFunc = func_80ADB0D8;
break;
@@ -419,7 +409,7 @@ void func_80ADB544(EnSellnuts* this, GlobalContext* globalCtx) {
if (!(((this->actor.playerHeightRel < 50.0f) && (this->actor.playerHeightRel > -50.0f)) ? true : false) ||
!((this->actor.xzDistToPlayer < 200.0f) ? true : false)) {
this->unk_34C = 4;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 4);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 4);
this->actionFunc = func_80ADB254;
}
}
@@ -464,22 +454,22 @@ void func_80ADB924(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADBAB8(EnSellnuts* this, GlobalContext* globalCtx) {
u8 sp27 = Message_GetState(&globalCtx->msgCtx);
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if (this->unk_368 == 0x28) {
this->unk_34C = 5;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 5);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 5);
}
this->unk_368++;
if ((currentFrame == frameCount) && (this->unk_34C == 5)) {
this->unk_34C = 6;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 6);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 6);
}
if ((sp27 == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = func_80ADBBEC;
func_800B7298(globalCtx, NULL, 0x13);
@@ -498,7 +488,7 @@ void func_80ADBBEC(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADBC60(EnSellnuts* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
this->actionFunc = func_80ADB0D8;
} else {
func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1);
@@ -517,27 +507,27 @@ void func_80ADBCE4(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADBD64(EnSellnuts* this, GlobalContext* globalCtx) {
u8 sp27 = Message_GetState(&globalCtx->msgCtx);
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if ((currentFrame == frameCount) && (this->unk_34C == 7)) {
this->unk_34C = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 0);
}
if ((sp27 == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_338 &= ~2;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_34C = 8;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 8);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 8);
this->actionFunc = func_80ADBE80;
}
}
void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) {
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
func_80ADAE64(this);
if (this->unk_366 == 0) {
@@ -556,7 +546,7 @@ void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) {
if (currentFrame == frameCount) {
this->unk_350 = 4;
this->unk_34C = 19;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 19);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 19);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
this->unk_338 &= ~1;
this->unk_338 |= 8;
@@ -567,7 +557,7 @@ void func_80ADBE80(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADBFA0(EnSellnuts* this, GlobalContext* globalCtx) {
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
if (this->unk_34C == 0) {
this->actionFunc = func_80ADB544;
@@ -590,7 +580,7 @@ void func_80ADC034(EnSellnuts* this, GlobalContext* globalCtx) {
if ((this->actor.home.pos.y + 200.0f) < this->actor.world.pos.y) {
Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.2f, 1.0f);
this->unk_34C = 10;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 10);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 10);
this->unk_368 = 0;
this->actionFunc = func_80ADC37C;
}
@@ -599,7 +589,7 @@ void func_80ADC034(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADC118(EnSellnuts* this, GlobalContext* globalCtx) {
Vec3f sp34;
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if (currentFrame == frameCount) {
Math_SmoothStepToS(&this->unk_364, 0x1C71, 3, 0x100, 0);
@@ -625,7 +615,7 @@ void func_80ADC118(EnSellnuts* this, GlobalContext* globalCtx) {
if ((this->actor.home.pos.y + 22.5f) < this->actor.world.pos.y) {
this->unk_34C = 9;
this->unk_360 = 0.3f;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 9);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 9);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->actionFunc = func_80ADC034;
}
@@ -708,8 +698,8 @@ void func_80ADC5A4(EnSellnuts* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
player->linearVelocity = 0.0f;
- this->actor.flags &= ~0x10000;
- func_801518B0(globalCtx, this->unk_340, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ Message_StartTextbox(globalCtx, this->unk_340, &this->actor);
if (this->unk_340 == 0x625) {
this->unk_338 |= 1;
this->actor.draw = EnSellnuts_Draw;
@@ -721,7 +711,7 @@ void func_80ADC5A4(EnSellnuts* this, GlobalContext* globalCtx) {
this->actionFunc = func_80ADC6D0;
}
} else if (func_80ADB08C(globalCtx) < 80.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, this->actor.xzDistToPlayer);
}
}
@@ -730,7 +720,7 @@ void func_80ADC6D0(EnSellnuts* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
if (player->transformation == PLAYER_FORM_DEKU) {
if (gSaveContext.day == 3) {
@@ -760,7 +750,7 @@ void func_80ADC7B4(EnSellnuts* this, GlobalContext* globalCtx) {
ActorCutscene_SetIntentToPlay(this->cutscene);
}
} else if ((this->unk_366 == 1) && (temp == 5) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_366 = 0;
ActorCutscene_Stop(this->cutscene);
@@ -803,7 +793,7 @@ void func_80ADC8C4(EnSellnuts* this, GlobalContext* globalCtx) {
this->actor.gravity = -1.0f;
this->actor.velocity.y = -1.0f;
this->actor.speedXZ = 0.0f;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->unk_338 &= ~1;
this->unk_338 &= ~2;
this->actionFunc = func_80ADCA64;
@@ -818,7 +808,7 @@ void func_80ADC8C4(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) {
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if (this->unk_34C == 22) {
Math_SmoothStepToS(&this->unk_364, 0, 3, 0x100, 0);
@@ -831,7 +821,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) {
this->unk_350 = 4;
this->unk_34C = 19;
this->actor.velocity.y = 0.0f;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_DOWN);
}
return;
@@ -842,7 +832,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) {
if (this->unk_34C == 19) {
this->unk_34C = 17;
this->collider.dim.height = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, 17);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, 17);
} else if (this->unk_34C == 17) {
ActorCutscene_Stop(this->cutscene);
gSaveContext.weekEventReg[73] |= 4;
@@ -853,7 +843,7 @@ void func_80ADCA64(EnSellnuts* this, GlobalContext* globalCtx) {
void func_80ADCC04(EnSellnuts* this, GlobalContext* globalCtx) {
s16 currentFrame = this->skelAnime.curFrame;
- s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animationSeg);
+ s16 frameCount = Animation_GetLastFrame(D_80ADD990[this->unk_34C].animation);
if (this->unk_34C == 3) {
if (currentFrame == frameCount) {
@@ -862,18 +852,18 @@ void func_80ADCC04(EnSellnuts* this, GlobalContext* globalCtx) {
this->unk_354 = 1.0f;
this->unk_358 = 1.0f;
this->unk_35C = 1.0f;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
}
} else if (this->unk_34C == 21) {
func_80ADAFC0(this);
if (currentFrame == 0) {
if (func_80ADB08C(globalCtx) < 9999.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 9999.0f);
}
this->unk_340 = 0x626;
this->unk_34C = 0;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->actionFunc = func_80ADC5A4;
}
}
@@ -885,7 +875,7 @@ void func_80ADCD3C(EnSellnuts* this, GlobalContext* globalCtx) {
this->unk_338 |= 2;
this->unk_338 |= 1;
this->unk_340 = 0x626;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.gravity = -1.0f;
this->actor.draw = EnSellnuts_Draw;
this->unk_34A = 50;
@@ -894,7 +884,7 @@ void func_80ADCD3C(EnSellnuts* this, GlobalContext* globalCtx) {
this->unk_34C = 3;
this->unk_350 = 4;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->actionFunc = func_80ADCC04;
} else if (D_80ADD940 != 0) {
this->collider.dim.height = 64;
@@ -962,7 +952,8 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
Actor_ProcessInitChain(&this->actor, sInitChain);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600AC70, &D_06005488, this->jointTable, this->morphTable, 28);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_dnt_Skel_00AC70, &object_dnt_Anim_005488, this->jointTable,
+ this->morphTable, 28);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
@@ -998,7 +989,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -1.0f;
this->unk_34A = 50;
this->unk_34C = 4;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->actionFunc = func_80ADB254;
return;
}
@@ -1011,23 +1002,23 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = 0.0f;
this->actor.draw = NULL;
this->unk_34C = 20;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_35C = 1.0f;
this->unk_358 = 1.0f;
this->unk_354 = 1.0f;
this->unk_360 = 1.0f;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->actionFunc = func_80ADC5A4;
} else {
this->unk_338 |= 2;
this->unk_338 &= ~1;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.gravity = 0.0f;
this->actor.draw = NULL;
this->unk_34C = 4;
this->unk_34E = 20;
this->collider.dim.height = 64;
- func_8013BC6C(&this->skelAnime, D_80ADD990, this->unk_34C);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80ADD990, this->unk_34C);
this->actionFunc = func_80ADCD3C;
}
}
@@ -1115,9 +1106,9 @@ s32 EnSellnuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
if (limbIndex == 26) {
if ((this->unk_34C == 6) || (this->unk_34C == 5) || (this->unk_34C == 7)) {
- *dList = D_06001350;
+ *dList = object_dnt_DL_001350;
} else {
- *dList = D_06008290;
+ *dList = object_dnt_DL_008290;
}
}
@@ -1127,7 +1118,7 @@ s32 EnSellnuts_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** d
void EnSellnuts_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
}
-void func_80ADD7CC(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnSellnuts_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnSellnuts* this = THIS;
if (((this->unk_350 == 1) || (this->unk_350 == 3)) && ((limbIndex == 23) || (limbIndex == 24))) {
@@ -1148,6 +1139,7 @@ void EnSellnuts_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnSellnuts* this = THIS;
func_8012C28C(globalCtx->state.gfxCtx);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnSellnuts_OverrideLimbDraw, EnSellnuts_PostLimbDraw, func_80ADD7CC, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnSellnuts_OverrideLimbDraw, EnSellnuts_PostLimbDraw,
+ EnSellnuts_TransformLimbDraw, &this->actor);
}
diff --git a/src/overlays/actors/ovl_En_Shn/z_en_shn.c b/src/overlays/actors/ovl_En_Shn/z_en_shn.c
index c93402fbc0..c47c8fb672 100644
--- a/src/overlays/actors/ovl_En_Shn/z_en_shn.c
+++ b/src/overlays/actors/ovl_En_Shn/z_en_shn.c
@@ -6,7 +6,7 @@
#include "z_en_shn.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnShn*)thisx)
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 35eddf10b0..8933d53057 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 0x00000201
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_200)
#define THIS ((EnSi*)thisx)
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 32802fb01e..166f0377e6 100644
--- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c
+++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c
@@ -7,8 +7,9 @@
#include "z_en_skb.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "overlays/actors/ovl_En_Encount4/z_en_encount4.h"
+#include "objects/object_skb/object_skb.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnSkb*)thisx)
@@ -48,26 +49,20 @@ void func_809964A0(EnSkb* this, GlobalContext* globalCtx);
s32 func_80996594(EnSkb* this, GlobalContext* globalCtx);
void func_80996BEC(EnSkb* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060009E4;
-extern AnimationHeader D_060015EC;
-extern AnimationHeader D_06001D1C;
-extern AnimationHeader D_06002190;
-extern AnimationHeader D_0600270C;
-extern AnimationHeader D_06002AC8;
-extern AnimationHeader D_06003584;
-extern SkeletonHeader D_06005EF8;
-extern AnimationHeader D_060064E0;
-extern AnimationHeader D_0600697C;
-extern AnimationHeader D_06006D90;
-
-static ActorAnimationEntry sAnimations[] = {
- { &D_060064E0, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -1.0f },
- { &D_06002190, 0.6f, 0.0f, 0.0f, 3, 4.0f }, { &D_06002AC8, 1.0f, 0.0f, 0.0f, 2, -4.0 },
- { &D_0600270C, 1.0f, 0.0f, 0.0f, 2, -4.0 }, { &D_0600697C, 1.0f, 0.0f, 0.0f, 0, -4.0 },
- { &D_06006D90, 1.0f, 0.0f, 0.0f, 0, -4.0 }, { &D_06001D1C, 1.0f, 0.0f, 0.0f, 0, -4.0 },
- { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_06003584, 1.0f, 0.0f, 0.0f, 2, -16.0f },
- { &D_06002AC8, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &D_060015EC, 1.0f, 0.0f, 0.0f, 2, -4.0 },
- { &D_060009E4, 1.0f, 0.0f, 0.0f, 0, -4.0 },
+static AnimationInfo sAnimations[] = {
+ { &object_skb_Anim_0064E0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
+ { &object_skb_Anim_002190, 0.6f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 4.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 },
+ { &object_skb_Anim_00270C, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 },
+ { &object_skb_Anim_00697C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 },
+ { &object_skb_Anim_006D90, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 },
+ { &object_skb_Anim_001D1C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_003584, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -16.0f },
+ { &object_skb_Anim_002AC8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &object_skb_Anim_0015EC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0 },
+ { &object_skb_Anim_0009E4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -4.0 },
};
static Vec3f D_80997468[] = {
@@ -181,25 +176,29 @@ void func_809947B0(GlobalContext* globalCtx, EnSkb* this, Vec3f* inPos) {
}
void func_8099495C(EnSkb* this, GlobalContext* globalCtx) {
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06003584, this->jointTable, this->morphTable, 20);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_003584, this->jointTable,
+ this->morphTable, 20);
this->unk_3DC = 0;
func_80994E2C(this);
}
void func_809949C4(EnSkb* this, GlobalContext* globalCtx) {
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_0600697C, this->jointTable, this->morphTable, 20);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_00697C, this->jointTable,
+ this->morphTable, 20);
this->unk_3DC = 1;
func_809952D8(this);
}
void func_80994A30(EnSkb* this, GlobalContext* globalCtx) {
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06006D90, this->jointTable, this->morphTable, 20);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_006D90, this->jointTable,
+ this->morphTable, 20);
this->unk_3DC = 1;
func_809953E8(this);
}
void func_80994A9C(EnSkb* this, GlobalContext* globalCtx) {
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005EF8, &D_06001D1C, this->jointTable, this->morphTable, 20);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_skb_Skel_005EF8, &object_skb_Anim_001D1C, this->jointTable,
+ this->morphTable, 20);
this->unk_3DC = 1;
func_809954F8(this);
}
@@ -231,8 +230,9 @@ void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_3D6 = ENSKB_GET_F0(&this->actor);
this->actor.floorHeight = this->actor.world.pos.y;
- if ((globalCtx->sceneNum == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) && (globalCtx->csCtx.unk_12 == 0)) {
- this->actor.flags |= 0x100000;
+ if ((globalCtx->sceneNum == SCENE_BOTI) && (gSaveContext.sceneSetupIndex == 1) &&
+ (globalCtx->csCtx.currentCsIndex == 0)) {
+ this->actor.flags |= ACTOR_FLAG_100000;
}
switch (this->unk_3D6) {
@@ -249,7 +249,7 @@ void EnSkb_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
default:
- this->actor.flags &= ~0x100000;
+ this->actor.flags &= ~ACTOR_FLAG_100000;
this->actor.hintId = 0x55;
func_8099495C(this, globalCtx);
break;
@@ -288,8 +288,8 @@ void func_80994DA8(EnSkb* this, GlobalContext* globalCtx) {
}
void func_80994E2C(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 1);
- this->actor.flags &= ~1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_APPEAR);
this->unk_3D0 = 0;
this->unk_3DE = 0;
@@ -301,7 +301,7 @@ void func_80994E94(EnSkb* this, GlobalContext* globalCtx) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
Math_ApproachZeroF(&this->actor.shape.yOffset, 1.0f, 800.0f);
@@ -320,9 +320,9 @@ void func_80994F7C(EnSkb* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_3E2 = 1;
if (this->unk_3E0 == 1) {
- func_801518B0(globalCtx, 0x13F8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F8, &this->actor);
} else {
- func_801518B0(globalCtx, 0x13F6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F6, &this->actor);
this->unk_3E0 = 1;
}
this->actionFunc = func_80995190;
@@ -341,19 +341,19 @@ void func_80995068(EnSkb* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_3E2 = 1;
if (this->unk_3E0 == 1) {
- func_801518B0(globalCtx, 0x13F8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F8, &this->actor);
if (this->unk_3DE == 2) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
}
} else {
- func_801518B0(globalCtx, 0x13F6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F6, &this->actor);
this->unk_3E0 = 1;
}
this->actionFunc = func_80995190;
this->actor.speedXZ = 0.0f;
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_CAPTAIN) {
- this->actor.flags |= (0x4 | 0x1);
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.hintId = 0x55;
this->actor.colChkInfo.mass = MASS_HEAVY;
func_80995A30(this);
@@ -373,9 +373,9 @@ void func_80995190(EnSkb* this, GlobalContext* globalCtx) {
case 5:
if (func_80147624(globalCtx)) {
- func_801518B0(globalCtx, 0x13F7, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13F7, &this->actor);
if (this->unk_3DE == 2) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 11);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 11);
}
}
break;
@@ -389,8 +389,8 @@ void func_80995190(EnSkb* this, GlobalContext* globalCtx) {
}
void func_80995244(EnSkb* this, GlobalContext* globalCtx) {
- this->actor.flags &= ~(0x8 | 0x1);
- this->actor.flags |= (0x4 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_4);
this->unk_3E2 = 0;
switch (this->unk_3DE) {
@@ -413,7 +413,7 @@ void func_80995244(EnSkb* this, GlobalContext* globalCtx) {
}
void func_809952D8(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 5);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->unk_3DE = 9;
this->actionFunc = func_8099533C;
@@ -424,8 +424,8 @@ void func_809952D8(EnSkb* this) {
void func_8099533C(EnSkb* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(0x4 | 0x1);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80994F7C(this, globalCtx);
} else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) {
this->actor.hintId = 0x55;
@@ -435,7 +435,7 @@ void func_8099533C(EnSkb* this, GlobalContext* globalCtx) {
}
void func_809953E8(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 6);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->unk_3DE = 10;
this->actionFunc = func_8099544C;
@@ -446,8 +446,8 @@ void func_809953E8(EnSkb* this) {
void func_8099544C(EnSkb* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(0x4 | 0x1);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80994F7C(this, globalCtx);
} else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f)) {
this->actor.hintId = 0x55;
@@ -457,7 +457,7 @@ void func_8099544C(EnSkb* this, GlobalContext* globalCtx) {
}
void func_809954F8(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 7);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 7);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->unk_3DE = 11;
this->actionFunc = func_8099556C;
@@ -483,8 +483,8 @@ void func_8099556C(EnSkb* this, GlobalContext* globalCtx) {
this->actor.shape.rot.x = Math_SinS(this->unk_3D4 * sp26) * 20000.0f;
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(0x4 | 0x1);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80994F7C(this, globalCtx);
} else if (Actor_IsFacingPlayer(&this->actor, 0x2AAA) && (this->actor.xzDistToPlayer < 200.0f) &&
(this->skelAnime.curFrame > 24.0f) && (this->skelAnime.curFrame < 28.0f)) {
@@ -500,14 +500,14 @@ void func_8099571C(EnSkb* this) {
this->unk_3DC = 0;
this->actor.shape.shadowScale = 0.0f;
if (this->unk_3DE == 9) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
this->actor.speedXZ = 2.4f;
this->actor.gravity = -1.0f;
this->actor.velocity.y = 3.0f;
} else if (this->unk_3DE == 0xA) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
} else if (this->unk_3DE == 0xB) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
this->actor.speedXZ = 3.2f;
this->actor.gravity = -1.0f;
this->actor.velocity.y = 2.0f;
@@ -536,9 +536,10 @@ void func_80995818(EnSkb* this, GlobalContext* globalCtx) {
}
void func_809958F4(EnSkb* this) {
- Animation_Change(&this->skelAnime, &D_06003584, -1.0f, Animation_GetLastFrame(&D_06003584), 0.0f, 2, -4.0f);
+ Animation_Change(&this->skelAnime, &object_skb_Anim_003584, -1.0f, Animation_GetLastFrame(&object_skb_Anim_003584),
+ 0.0f, 2, -4.0f);
this->unk_3E4 = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.speedXZ = 0.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_AKINDONUTS_HIDE);
this->unk_3DE = 1;
@@ -560,7 +561,7 @@ void func_8099599C(EnSkb* this, GlobalContext* globalCtx) {
}
void func_80995A30(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
this->actor.speedXZ = 1.6f;
this->unk_3DA = 0;
this->unk_3DE = 2;
@@ -569,11 +570,11 @@ void func_80995A30(EnSkb* this) {
void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- this->actor.flags &= ~(0x4 | 0x1);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_4);
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.hintId = 0xFF;
this->actor.colChkInfo.mass = MASS_HEAVY;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 12);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 12);
func_8099504C(this);
return;
}
@@ -585,7 +586,7 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer + this->unk_3DA, 1, 0x2EE, 0);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (Animation_OnFrame(&this->skelAnime, 8.0f) || Animation_OnFrame(&this->skelAnime, 15.0f)) {
- Actor_PlaySfxAtPos(&this->actor, 0x3830);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_WALK);
}
if ((this->actor.xzDistToPlayer > 800.0f) || func_80996594(this, globalCtx)) {
@@ -596,7 +597,7 @@ void func_80995A8C(EnSkb* this, GlobalContext* globalCtx) {
}
void func_80995C24(EnSkb* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
this->collider.base.atFlags &= ~AT_BOUNCED;
this->actor.speedXZ = 0.0f;
this->unk_3DE = 3;
@@ -620,7 +621,7 @@ void func_80995C84(EnSkb* this, GlobalContext* globalCtx) {
}
void func_80995D3C(EnSkb* this) {
- Animation_Change(&this->skelAnime, &D_06002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f);
+ Animation_Change(&this->skelAnime, &object_skb_Anim_002190, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f);
this->collider.base.atFlags &= ~AT_BOUNCED;
this->unk_3DE = 4;
this->unk_3E4 = 0;
@@ -681,17 +682,17 @@ void func_80995E64(EnSkb* this, GlobalContext* globalCtx) {
void func_80995F98(EnSkb* this) {
if ((this->unk_3DE == 9) || (this->unk_3DE == 0xA)) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 8);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 8);
this->actor.gravity = -1.0f;
this->actor.speedXZ = 1.0f;
} else if (this->unk_3DE == 0xB) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 9);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 9);
this->actor.speedXZ = 3.2f;
this->actor.velocity.y = 2.0f;
this->actor.gravity = -1.0f;
} else {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -4.0f;
}
@@ -727,13 +728,13 @@ void func_809960AC(EnSkb* this, GlobalContext* globalCtx) {
}
void func_809961E4(EnSkb* this, GlobalContext* globalCtx) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 4);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 4);
this->unk_3D8 |= 0x40;
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -6.0f;
}
this->unk_3E4 = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALKID_DEAD);
this->unk_3DE = 7;
this->actionFunc = func_80996284;
@@ -759,7 +760,7 @@ void func_8099630C(EnSkb* this, GlobalContext* globalCtx) {
this->unk_22C = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->unk_3D8 |= 1;
func_80995F98(this);
} else {
@@ -781,7 +782,7 @@ void func_809963D8(EnSkb* this, GlobalContext* globalCtx) {
this->unk_22C = 0.0f;
if (this->actor.colChkInfo.health != 0) {
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 8);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
this->unk_3D8 |= 1;
func_80995F98(this);
} else {
@@ -793,7 +794,7 @@ void func_809963D8(EnSkb* this, GlobalContext* globalCtx) {
void func_80996474(EnSkb* this) {
this->unk_3D0 = 0;
this->actor.draw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_809964A0;
}
@@ -952,7 +953,7 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) {
this->unk_230 = 0.5f;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALKID_DAMAGE);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
func_809963C4(this);
break;
@@ -968,7 +969,7 @@ void func_8099672C(EnSkb* this, GlobalContext* globalCtx) {
case 13:
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 8);
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 3);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
func_80995F98(this);
break;
}
diff --git a/src/overlays/actors/ovl_En_Slime/z_en_slime.c b/src/overlays/actors/ovl_En_Slime/z_en_slime.c
index d313450f56..539d458ad6 100644
--- a/src/overlays/actors/ovl_En_Slime/z_en_slime.c
+++ b/src/overlays/actors/ovl_En_Slime/z_en_slime.c
@@ -6,7 +6,7 @@
#include "z_en_slime.h"
-#define FLAGS 0x00000215
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_200)
#define THIS ((EnSlime*)thisx)
diff --git a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
index 8f28748b79..32d38ecb92 100644
--- a/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
+++ b/src/overlays/actors/ovl_En_Snowman/z_en_snowman.c
@@ -6,7 +6,7 @@
#include "z_en_snowman.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnSnowman*)thisx)
diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
index 4d0b5f094b..c05c589be3 100644
--- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
+++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c
@@ -5,8 +5,14 @@
*/
#include "z_en_sob1.h"
+#include "objects/object_rs/object_rs.h"
+#include "objects/object_zo/object_zo.h"
+#include "objects/object_mastergolon/object_mastergolon.h"
+#include "objects/object_masterzoora/object_masterzoora.h"
+#include "objects/object_oF1d_map/object_oF1d_map.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnSob1*)thisx)
@@ -48,30 +54,10 @@ s32 EnSob1_TakeItemOffShelf(EnSob1* this);
s32 EnSob1_ReturnItemToShelf(EnSob1* this);
s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
-extern UNK_TYPE D_0401F740;
-extern UNK_TYPE D_0401F8C0;
-extern UNK_TYPE D_0401F7C0;
-extern AnimationHeader D_06009120;
-extern AnimationHeader D_06008268;
-extern FlexSkeletonHeader D_0600D208;
-extern AnimationHeader D_0600078C;
-extern AnimationHeader D_060087BC;
-extern FlexSkeletonHeader D_06011AC8;
-extern AnimationHeader D_060000FC;
-extern FlexSkeletonHeader D_06009220;
-extern Gfx D_06000970[];
-extern UNK_TYPE D_06005458;
-extern TexturePtr D_060050A0;
-extern TexturePtr D_060058A0;
-extern TexturePtr D_060060A0;
-extern TexturePtr D_06010438;
-extern TexturePtr D_06010C38;
-extern TexturePtr D_06011038;
-
-static ActorAnimationEntryS sAnimationsBombShopkeeper[] = {
- { &D_06009120, 2.0f, 0, -1, 0, 20 },
- { &D_06008268, 1.0f, 0, -1, 2, 0 },
- { &D_060087BC, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimationsBombShopkeeper[] = {
+ { &object_rs_Anim_009120, 2.0f, 0, -1, ANIMMODE_LOOP, 20 },
+ { &object_rs_Anim_008268, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_rs_Anim_0087BC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
const ActorInit En_Sob1_InitVars = {
@@ -166,17 +152,17 @@ static Vec3f sPosOffset[] = {
{ 0.0f, -4.0f, 0.0f },
};
-void EnSob1_ChangeAnim(SkelAnime* skelAnime, ActorAnimationEntryS* animations, s32 idx) {
+void EnSob1_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 idx) {
f32 frameCount;
animations += idx;
if (animations->frameCount < 0) {
- frameCount = Animation_GetLastFrame(animations->animationSeg);
+ frameCount = Animation_GetLastFrame(animations->animation);
} else {
frameCount = animations->frameCount;
}
- Animation_Change(skelAnime, animations->animationSeg, animations->playbackSpeed, animations->frame, frameCount,
- animations->mode, animations->transitionRate);
+ Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount,
+ animations->mode, animations->morphFrames);
}
void EnSob1_SetupAction(EnSob1* this, EnSob1ActionFunc action) {
@@ -200,7 +186,7 @@ u16 EnSob1_GetTalkOption(EnSob1* this, GlobalContext* globalCtx) {
if (this->shopType == BOMB_SHOP) {
if (gSaveContext.day == 1 && gSaveContext.time >= CLOCK_TIME(6, 00)) {
return 0x648;
- } else if (gSaveContext.weekEventReg[0x21] & 8) {
+ } else if (gSaveContext.weekEventReg[33] & 8) {
return 0x649;
} else {
return 0x64A;
@@ -270,58 +256,58 @@ u16 EnSob1_GetWelcome(EnSob1* this, GlobalContext* globalCtx) {
} else if (this->shopType == ZORA_SHOP) {
switch (player->transformation) {
case PLAYER_FORM_HUMAN:
- if (gSaveContext.weekEventReg[0x39] & 0x10) {
+ if (gSaveContext.weekEventReg[57] & 0x10) {
return 0x12CF;
}
- gSaveContext.weekEventReg[0x39] |= 0x10;
+ gSaveContext.weekEventReg[57] |= 0x10;
return 0x12CE;
case PLAYER_FORM_DEKU:
- if (gSaveContext.weekEventReg[0x39] & 0x20) {
+ if (gSaveContext.weekEventReg[57] & 0x20) {
return 0x12D1;
}
- gSaveContext.weekEventReg[0x39] |= 0x20;
+ gSaveContext.weekEventReg[57] |= 0x20;
return 0x12D0;
case PLAYER_FORM_GORON:
- if (gSaveContext.weekEventReg[0x39] & 0x40) {
+ if (gSaveContext.weekEventReg[57] & 0x40) {
return 0x12D3;
}
- gSaveContext.weekEventReg[0x39] |= 0x40;
+ gSaveContext.weekEventReg[57] |= 0x40;
return 0x12D2;
case PLAYER_FORM_ZORA:
- if (gSaveContext.weekEventReg[0x39] & 0x80) {
+ if (gSaveContext.weekEventReg[57] & 0x80) {
return 0x12D5;
}
- gSaveContext.weekEventReg[0x39] |= 0x80;
+ gSaveContext.weekEventReg[57] |= 0x80;
return 0x12D4;
default:
return 0x12CE;
}
} else if (this->shopType == GORON_SHOP) {
if (player->transformation != PLAYER_FORM_GORON) {
- if (gSaveContext.weekEventReg[0x3A] & 4) {
+ if (gSaveContext.weekEventReg[58] & 4) {
return 0xBB9;
}
- gSaveContext.weekEventReg[0x3A] |= 4;
+ gSaveContext.weekEventReg[58] |= 4;
return 0xBB8;
} else {
- if (gSaveContext.weekEventReg[0x3A] & 8) {
+ if (gSaveContext.weekEventReg[58] & 8) {
return 0xBBB;
}
- gSaveContext.weekEventReg[0x3A] |= 8;
+ gSaveContext.weekEventReg[58] |= 8;
return 0xBBA;
}
} else if (this->shopType == GORON_SHOP_SPRING) {
if (player->transformation != PLAYER_FORM_GORON) {
- if (gSaveContext.weekEventReg[0x3A] & 0x10) {
+ if (gSaveContext.weekEventReg[58] & 0x10) {
return 0xBBD;
}
- gSaveContext.weekEventReg[0x3A] |= 0x10;
+ gSaveContext.weekEventReg[58] |= 0x10;
return 0xBBC;
} else {
- if (gSaveContext.weekEventReg[0x3A] & 0x20) {
+ if (gSaveContext.weekEventReg[58] & 0x20) {
return 0xBBF;
}
- gSaveContext.weekEventReg[0x3A] |= 0x20;
+ gSaveContext.weekEventReg[58] |= 0x20;
return 0xBBE;
}
}
@@ -348,7 +334,7 @@ void EnSob1_EndInteractionBombShop(EnSob1* this, GlobalContext* globalCtx) {
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = false;
this->goodbyeTextId = EnSob1_GetGoodbye(this);
- func_801518B0(globalCtx, this->goodbyeTextId, &this->actor);
+ Message_StartTextbox(globalCtx, this->goodbyeTextId, &this->actor);
EnSob1_SetupAction(this, EnSob1_EndingInteraction);
}
@@ -396,7 +382,7 @@ void EnSob1_Init(Actor* thisx, GlobalContext* globalCtx) {
this->shopType = ZORA_SHOP;
break;
case GORON_SHOP:
- if (gSaveContext.weekEventReg[0x21] & 0x80) {
+ if (gSaveContext.weekEventReg[33] & 0x80) {
this->shopType = GORON_SHOP_SPRING;
} else {
this->shopType = GORON_SHOP;
@@ -450,7 +436,7 @@ void EnSob1_EndInteraction(GlobalContext* globalCtx, EnSob1* this) {
this->cutsceneState = ENSOB1_CUTSCENESTATE_STOPPED;
}
Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
this->drawCursor = 0;
@@ -545,7 +531,7 @@ void EnSob1_Idle(EnSob1* this, GlobalContext* globalCtx) {
}
player->stateFlags2 |= 0x20000000;
this->welcomeTextId = EnSob1_GetWelcome(this, globalCtx);
- func_801518B0(globalCtx, this->welcomeTextId, &this->actor);
+ Message_StartTextbox(globalCtx, this->welcomeTextId, &this->actor);
if (ENSOB1_GET_SHOPTYPE(&this->actor) == BOMB_SHOP) {
this->headRotTarget = -0x2000;
}
@@ -722,7 +708,7 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) {
s32 pad;
f32 distSq;
s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed;
- s16 animLastFrame = Animation_GetLastFrame(&D_06009120) / (s16)this->skelAnime.playSpeed;
+ s16 animLastFrame = Animation_GetLastFrame(&object_rs_Anim_009120) / (s16)this->skelAnime.playSpeed;
Math_SmoothStepToS(
&this->actor.world.rot.y,
@@ -743,7 +729,7 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) {
void EnSob1_SetupIdle(EnSob1* this, GlobalContext* globalCtx) {
s16 curFrame = this->skelAnime.curFrame;
- if (Animation_GetLastFrame(&D_06008268) == curFrame) {
+ if (Animation_GetLastFrame(&object_rs_Anim_008268) == curFrame) {
EnSob1_ChangeAnim(&this->skelAnime, sAnimationsBombShopkeeper, 2);
EnSob1_SetupAction(this, EnSob1_Idle);
}
@@ -803,7 +789,7 @@ void EnSob1_Walking(EnSob1* this, GlobalContext* globalCtx) {
}
player->stateFlags2 |= 0x20000000;
this->welcomeTextId = EnSob1_GetWelcome(this, globalCtx);
- func_801518B0(globalCtx, this->welcomeTextId, &this->actor);
+ Message_StartTextbox(globalCtx, this->welcomeTextId, &this->actor);
this->wasTalkedToWhileWalking = true;
} else {
if ((player->actor.world.pos.x >= this->posXZRange.xMin &&
@@ -941,7 +927,7 @@ void EnSob1_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnSob1* this) {
Player* player = GET_PLAYER(globalCtx);
Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->stateFlags2 &= ~0x20000000;
Interface_ChangeAlpha(50);
@@ -1081,7 +1067,7 @@ void EnSob1_BuyItemWithFanfare(EnSob1* this, GlobalContext* globalCtx) {
void EnSob1_SetupItemPurchased(EnSob1* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 6 && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
EnSob1_SetupAction(this, EnSob1_ItemPurchased);
if (this->cutsceneState == ENSOB1_CUTSCENESTATE_STOPPED) {
@@ -1105,7 +1091,7 @@ void EnSob1_ContinueShopping(EnSob1* this, GlobalContext* globalCtx) {
item->restockFunc(globalCtx, item);
player->actor.shape.rot.y += 0x8000;
player->stateFlags2 |= 0x20000000;
- func_801518B0(globalCtx, this->welcomeTextId, &this->actor);
+ Message_StartTextbox(globalCtx, this->welcomeTextId, &this->actor);
EnSob1_SetupStartShopping(globalCtx, this, true);
func_800B85E0(&this->actor, globalCtx, 200.0f, EXCH_ITEM_MINUS1);
}
@@ -1334,23 +1320,27 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, GlobalContext* globalCtx) {
}
void EnSob1_InitZoraShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, NULL, this->jointTable, this->morphTable, 20);
- gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
- Animation_Change(&this->skelAnime, &D_0600078C, 1.0f, 0.0f, Animation_GetLastFrame(&D_0600078C), 0, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20);
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
+ Animation_Change(&this->skelAnime, &object_masterzoora_Anim_00078C, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_masterzoora_Anim_00078C), 0, 0.0f);
this->actor.draw = EnSob1_DrawZoraShopkeeper;
this->changeObjectFunc = EnSob1_ChangeObject;
}
void EnSob1_InitGoronShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06011AC8, NULL, this->jointTable, this->morphTable, 18);
- gSegments[0x06] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
- Animation_Change(&this->skelAnime, &D_060000FC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060000FC), 0, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_oF1d_map_Skel_011AC8, NULL, this->jointTable,
+ this->morphTable, 18);
+ gSegments[6] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[this->objIndices[2]].segment);
+ Animation_Change(&this->skelAnime, &object_mastergolon_Anim_0000FC, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_mastergolon_Anim_0000FC), 0, 0.0f);
this->actor.draw = EnSob1_DrawGoronShopkeeper;
this->changeObjectFunc = EnSob1_ChangeObject;
}
void EnSob1_InitBombShopkeeper(EnSob1* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06009220, &D_06009120, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rs_Skel_009220, &object_rs_Anim_009120, this->jointTable,
+ this->morphTable, 16);
this->actor.draw = EnSob1_DrawBombShopkeeper;
this->changeObjectFunc = NULL;
this->skelAnime.playSpeed = 2.0f;
@@ -1366,7 +1356,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) {
u32 maxColor = 255;
if (EnSob1_AreObjectsLoaded(this, globalCtx)) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.objBankIndex = this->objIndices[0];
Actor_SetObjectDependency(globalCtx, &this->actor);
posOffset = &sPosOffset[this->shopType];
@@ -1374,7 +1364,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) {
this->actor.world.pos.y += posOffset->y;
this->actor.world.pos.z += posOffset->z;
shopItems = sShops[this->shopType];
- if ((this->shopType == BOMB_SHOP) && (gSaveContext.weekEventReg[0x21] & 8)) {
+ if ((this->shopType == BOMB_SHOP) && (gSaveContext.weekEventReg[33] & 8)) {
sShops[this->shopType][0].shopItemId = SI_BOMB_BAG_30_2;
}
@@ -1457,7 +1447,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) {
this2->blinkTimer = 20;
this2->eyeTexIndex = 0;
this->blinkFunc = EnSob1_WaitForBlink;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
}
@@ -1495,8 +1485,8 @@ void EnSob1_DrawCursor(GlobalContext* globalCtx, EnSob1* this, f32 x, f32 y, f32
func_8012C654(globalCtx->state.gfxCtx);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b,
this->cursorColor.a);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
w = 16.0f * z;
ulx = (x - w) * 4.0f;
uly = (y - w + -12.0f) * 4.0f;
@@ -1547,7 +1537,7 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) {
if (drawStickRightPrompt || drawStickLeftPrompt) {
func_8012C654(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1568,7 +1558,7 @@ void EnSob1_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnSob1* this) {
this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY,
this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f);
}
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1616,7 +1606,7 @@ s32 EnSob1_OverrideLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbInde
void EnSob1_PostLimbDrawBombShopkeeper(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
if (limbIndex == 11) {
- gSPDisplayList(POLY_OPA_DISP++, D_06000970);
+ gSPDisplayList(POLY_OPA_DISP++, object_rs_DL_000970);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -1632,7 +1622,7 @@ Gfx* EnSob1_EndDList(GraphicsContext* gfxCtx) {
}
void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr sZoraShopkeeperEyeTextures[] = { &D_060050A0, &D_060058A0, &D_060060A0 };
+ static TexturePtr sZoraShopkeeperEyeTextures[] = { gZoraEyeOpenTex, gZoraEyeHalfTex, gZoraEyeClosedTex };
EnSob1* this = THIS;
s32 pad;
s32 i;
@@ -1655,7 +1645,8 @@ void EnSob1_DrawZoraShopkeeper(Actor* thisx, GlobalContext* globalCtx) {
}
void EnSob1_DrawGoronShopkeeper(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr sGoronShopkeeperEyeTextures[] = { &D_06010438, &D_06010C38, &D_06011038 };
+ static TexturePtr sGoronShopkeeperEyeTextures[] = { object_oF1d_map_Tex_010438, object_oF1d_map_Tex_010C38,
+ object_oF1d_map_Tex_011038 };
EnSob1* this = THIS;
s32 pad;
s32 i;
@@ -1683,7 +1674,7 @@ void EnSob1_DrawBombShopkeeper(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
- gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(&D_06005458));
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(object_rs_Tex_005458));
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnSob1_OverrideLimbDrawBombShopkeeper, EnSob1_PostLimbDrawBombShopkeeper, &this->actor);
for (i = 0; i < ARRAY_COUNT(this->items); i++) {
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 26fdf6f08d..fbd391f32a 100644
--- a/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
+++ b/src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
@@ -7,7 +7,7 @@
#include "z_en_ssh.h"
#include "objects/object_ssh/object_ssh.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnSsh*)thisx)
@@ -653,7 +653,7 @@ void EnSsh_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = 0.0f;
this->initialYaw = this->actor.world.rot.y;
EnSsh_SetupAction(this, EnSsh_Start);
- if (func_8012F22C(globalCtx->sceneNum) >= 30) {
+ if (Inventory_GetSkullTokenCount(globalCtx->sceneNum) >= 30) {
Actor_MarkForDeath(&this->actor);
}
}
@@ -713,7 +713,7 @@ void func_809756D0(EnSsh* this, GlobalContext* globalCtx) {
phi_a1 = 0x910;
gSaveContext.weekEventReg[34] |= 8;
}
- func_801518B0(globalCtx, phi_a1, &this->actor);
+ Message_StartTextbox(globalCtx, phi_a1, &this->actor);
}
void EnSsh_Idle(EnSsh* this, GlobalContext* globalCtx) {
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 e3116fb3c2..0bd9a6125d 100644
--- a/src/overlays/actors/ovl_En_St/z_en_st.c
+++ b/src/overlays/actors/ovl_En_St/z_en_st.c
@@ -8,7 +8,7 @@
#include "objects/object_st/object_st.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x01004035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000 | ACTOR_FLAG_1000000)
#define THIS ((EnSt*)thisx)
@@ -152,11 +152,15 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &object_st_Anim_000304, 1.0f, 0, -1, 0, 0 }, { &object_st_Anim_005B98, 1.0f, 0, -1, 2, -4 },
- { &object_st_Anim_000304, 4.0f, 0, -1, 2, -4 }, { &object_st_Anim_000304, 1.0f, 0, -1, 0, -4 },
- { &object_st_Anim_0055A8, 1.0f, 0, -1, 2, -4 }, { &object_st_Anim_000304, 8.0f, 0, -1, 0, -4 },
- { &object_st_Anim_000304, 6.0f, 0, -1, 2, -4 }, { &object_st_Anim_005B98, 2.0f, 0, -1, 0, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_st_Anim_000304, 4.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_st_Anim_000304, 8.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_st_Anim_000304, 6.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_st_Anim_005B98, 2.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
void func_808A5050(EnSt* this, GlobalContext* globalCtx) {
@@ -452,7 +456,7 @@ void func_808A60E0(EnSt* this) {
sp1C = this->skelAnime.curFrame / (this->skelAnime.animLength - 1.0f);
if (sp1C == 1.0f) {
- func_8013BC6C(&this->skelAnime, sAnimations, idx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx);
Actor_PlaySfxAtPos(&this->actor, sfxId);
}
@@ -504,7 +508,7 @@ void func_808A6220(EnSt* this, GlobalContext* globalCtx) {
}
void func_808A63E8(EnSt* this) {
- func_8013BC6C(&this->skelAnime, sAnimations, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
this->unk_2C8 = 1.0f;
func_808A5D7C(this);
this->unk_30C = 0;
@@ -517,7 +521,7 @@ void func_808A63E8(EnSt* this) {
void func_808A6468(EnSt* this, GlobalContext* globalCtx) {
func_808A5050(this, globalCtx);
- func_8013BC6C(&this->skelAnime, sAnimations, 4);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 4);
this->unk_18C |= (0x8 | 0x4);
this->unk_18C &= ~(0x10 | 0x2);
this->unk_2C8 = -1.0f;
@@ -534,7 +538,7 @@ void func_808A6468(EnSt* this, GlobalContext* globalCtx) {
void func_808A650C(EnSt* this) {
s32 idx = (this->unk_2C8 > 0.0f) ? 2 : 6;
- func_8013BC6C(&this->skelAnime, sAnimations, idx);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, idx);
this->unk_2CC = 0.0f;
this->unk_2D4 = 0.0f;
this->unk_2D8 = 0.0f;
@@ -601,7 +605,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) {
this->unk_314 = 20;
this->unk_312 = 0;
Actor_SetColorFilter(&this->actor, 0x4000, 200, 0, this->unk_314);
- func_8013BC6C(&this->skelAnime, sAnimations, 1);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 1);
this->unk_18C |= 8;
this->actionFunc = func_808A6D84;
this->unk_2C8 = -1.0f;
@@ -614,7 +618,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) {
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALTU_DEAD);
Enemy_StartFinishingBlow(globalCtx, &this->actor);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
switch (this->actor.colChkInfo.damageEffect) {
case 4:
@@ -642,7 +646,7 @@ s32 func_808A6580(EnSt* this, GlobalContext* globalCtx) {
}
if (this->unk_18E != 10) {
- func_8013BC6C(&this->skelAnime, sAnimations, 7);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7);
this->unk_2CC = 0.0f;
this->unk_2D4 = 0.0f;
this->actor.gravity = -1.0f;
@@ -688,7 +692,7 @@ void func_808A6A78(EnSt* this, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 8.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable,
30);
- func_8013BC6C(&this->skelAnime, sAnimations, 0);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0);
Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit1);
Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit2);
@@ -697,7 +701,7 @@ void func_808A6A78(EnSt* this, GlobalContext* globalCtx) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (ENST_GET_1C0(&this->actor) == ENST_1C0_1) {
- this->actor.flags |= 0x80;
+ this->actor.flags |= ACTOR_FLAG_80;
}
Actor_SetScale(&this->actor, 0.04f);
@@ -719,7 +723,7 @@ void func_808A6C04(EnSt* this, GlobalContext* globalCtx) {
Actor_MoveWithGravity(&this->actor);
if ((this->unk_18C & 8) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013BC6C(&this->skelAnime, sAnimations, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
this->unk_18C &= ~8;
} else if ((this->unk_310 == 0) && func_808A5F28(this, globalCtx) && !func_808A6064(this)) {
func_808A650C(this);
@@ -761,7 +765,7 @@ void func_808A6E24(EnSt* this, GlobalContext* globalCtx) {
}
if (count == ARRAY_COUNT(this->unk_31C)) {
- func_8013BC6C(&this->skelAnime, sAnimations, 7);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 7);
this->unk_18E = 1;
this->unk_2CC = 0.0f;
this->unk_2D4 = 0.0f;
@@ -855,14 +859,14 @@ void EnSt_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnSt_Update(Actor* thisx, GlobalContext* globalCtx) {
EnSt* this = THIS;
- if (this->actor.flags & 0x8000) {
+ if (this->actor.flags & ACTOR_FLAG_8000) {
SkelAnime_Update(&this->skelAnime);
this->unk_18C |= 0x80;
return;
}
- if (!(this->actor.flags & 0x80) && func_808A6A3C(this)) {
- this->actor.flags |= 0x80;
+ if (!(this->actor.flags & ACTOR_FLAG_80) && func_808A6A3C(this)) {
+ this->actor.flags |= ACTOR_FLAG_80;
}
if (func_808A6580(this, globalCtx)) {
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 9b6d621a01..601e9e4f32 100644
--- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c
+++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c
@@ -5,8 +5,11 @@
*/
#include "z_en_sth.h"
+#include "objects/object_sth/object_sth.h"
+#include "objects/object_ahg/object_ahg.h"
+#include "objects/object_mask_truth/object_mask_truth.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnSth*)thisx)
@@ -14,7 +17,16 @@ void EnSth_Init(Actor* thisx, GlobalContext* globalCtx);
void EnSth_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSth_Update(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B67208(EnSth* this, GlobalContext* globalCtx);
+void func_80B67540(EnSth* this, GlobalContext* globalCtx);
+void func_80B677BC(EnSth* this, GlobalContext* globalCtx);
+void func_80B678A8(EnSth* this, GlobalContext* globalCtx);
+void func_80B67958(EnSth* this, GlobalContext* globalCtx);
+void func_80B67C1C(EnSth* this, GlobalContext* globalCtx);
+void func_80B67DA0(EnSth* this, GlobalContext* globalCtx);
+void func_80B680A8(Actor* thisx, GlobalContext* globalCtx);
+void func_80B6849C(Actor* thisx, GlobalContext* globalCtx);
+
const ActorInit En_Sth_InitVars = {
ACTOR_EN_STH,
ACTORCAT_NPC,
@@ -27,68 +39,675 @@ const ActorInit En_Sth_InitVars = {
(ActorFunc)NULL,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80B6D19C = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+#include "overlays/ovl_En_Sth/ovl_En_Sth.c"
+
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 30, 40, 0, { 0, 0, 0 } },
};
-#endif
+AnimationHeader* D_80B6D1C8[] = {
+ &ovl_En_Sth_Anim_003F50, &ovl_En_Sth_Anim_0045B4, &ovl_En_Sth_Anim_004CC0, &ovl_En_Sth_Anim_00533C,
+ &ovl_En_Sth_Anim_0059B8, &ovl_En_Sth_Anim_005E40, &ovl_En_Sth_Anim_006354, &ovl_En_Sth_Anim_00645C,
+};
-extern ColliderCylinderInit D_80B6D19C;
+u16 D_80B6D1E8[] = { 0x1144, 0x1145, 0x1146 };
-extern UNK_TYPE D_06005998;
-extern UNK_TYPE D_0A0001A0;
+u16 D_80B6D1F0[] = { 0x1139, 0x113E, 0x1143 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/EnSth_Init.s")
+u16 D_80B6D1F8[] = { 0x1132, 0x113A, 0x113F };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/EnSth_Destroy.s")
+Vec3f D_80B6D200 = { 700.0f, 400.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B6703C.s")
+Color_RGB8 D_80B6D20C[] = {
+ { 190, 110, 0 }, { 0, 180, 110 }, { 0, 255, 0x50 }, { 255, 160, 60 }, { 190, 230, 250 }, { 240, 230, 120 },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B670A4.s")
+void EnSth_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnSth* this = THIS;
+ s32 objectId;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67148.s")
+ if (ENSTH_GET_100(&this->actor)) {
+ objectId = Object_GetIndex(&globalCtx->objectCtx, OBJECT_AHG);
+ } else {
+ objectId = Object_GetIndex(&globalCtx->objectCtx, OBJECT_STH);
+ }
+ this->unk_29E = objectId;
+ this->unk_29F = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MASK_TRUTH);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B671A0.s")
+ Actor_SetScale(&this->actor, 0.01f);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67208.s")
+ this->unk_29C = 0;
+ this->unk_29A = 8;
+ this->actor.terminalVelocity = -9.0f;
+ this->actor.gravity = -1.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B672A4.s")
+ switch (ENSTH_GET_F(&this->actor)) {
+ case ENSTH_F_1:
+ if (globalCtx->actorCtx.unk5 & 2) {
+ this->actor.flags |= (ACTOR_FLAG_10 | ACTOR_FLAG_20);
+ this->actionFunc = func_80B67958;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67348.s")
+ case ENSTH_F_2:
+ if (Inventory_GetSkullTokenCount(globalCtx->sceneNum) >= 30) {
+ this->actionFunc = func_80B67DA0;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+ this->actor.textId = 0;
+ if (!(gSaveContext.weekEventReg[34] & 0x40) || !(gSaveContext.weekEventReg[34] & 8)) {
+ this->unk_29C |= 1;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67458.s")
+ case ENSTH_F_3:
+ if ((gSaveContext.skullTokenCount & 0xFFFF) >= 30) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ this->actionFunc = func_80B678A8;
+ this->unk_29C |= 8;
+ this->actor.targetMode = 3;
+ this->actor.uncullZoneForward = 800.0f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67540.s")
+ case ENSTH_F_4:
+ if (gSaveContext.weekEventReg[13] & 0x20) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ this->actor.textId = 0;
+ this->actionFunc = func_80B677BC;
+ if (gSaveContext.weekEventReg[13] & 0x80) {
+ this->unk_29C |= 2;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B677BC.s")
+ case ENSTH_F_5:
+ if (!(gSaveContext.weekEventReg[13] & 0x20) || (Inventory_GetSkullTokenCount(globalCtx->sceneNum) < 30)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ this->actionFunc = func_80B67208;
+ this->actor.textId = 0;
+ this->unk_29C |= 8;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67838.s")
+ default:
+ this->actionFunc = func_80B67958;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B678A8.s")
+void EnSth_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnSth* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67958.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67984.s")
+s32 func_80B6703C(EnSth* this, GlobalContext* globalCtx) {
+ if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) &&
+ Actor_IsFacingPlayer(&this->actor, 0x2000)) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67AB4.s")
+void func_80B670A4(EnSth* this, s16 arg1) {
+ if ((arg1 >= 0) && (arg1 < ARRAY_COUNT(D_80B6D1C8)) && (arg1 != this->unk_29A)) {
+ Animation_Change(&this->skelAnime, D_80B6D1C8[arg1], 1.0f, 0.0f, Animation_GetLastFrame(D_80B6D1C8[arg1]), 0,
+ -5.0f);
+ this->unk_29A = arg1;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67B50.s")
+void func_80B67148(EnSth* this, GlobalContext* globalCtx) {
+ s32 day = CURRENT_DAY - 1;
+ u16 val;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67C1C.s")
+ if (day < 0) {
+ day = 0;
+ }
+ val = D_80B6D1E8[day];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67DA0.s")
+ Message_StartTextbox(globalCtx, val, &this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B67E20.s")
+void func_80B671A0(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/EnSth_Update.s")
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ this->actionFunc = func_80B67208;
+ func_801477B4(globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B680A8.s")
+void func_80B67208(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B681E8.s")
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80B67148(this, globalCtx);
+ this->actionFunc = func_80B671A0;
+ } else if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 110.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B68310.s")
+void func_80B672A4(EnSth* this, GlobalContext* globalCtx) {
+ u16 sp1E;
+ s32 day = CURRENT_DAY - 1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Sth/func_80B6849C.s")
+ if (day < 0) {
+ day = 0;
+ }
+
+ if (this->unk_29C & 2) {
+ s32 pad;
+
+ sp1E = D_80B6D1F0[day];
+ if (day == 2) {
+ func_80B670A4(this, 5);
+ }
+ } else {
+ sp1E = D_80B6D1F8[day];
+ }
+ Message_StartTextbox(globalCtx, sp1E, &this->actor);
+}
+
+void func_80B67348(EnSth* this, GlobalContext* globalCtx) {
+ u16 phi_a1;
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ this->actionFunc = func_80B67540;
+
+ switch (this->actor.home.rot.z) {
+ case 8:
+ case 9:
+ phi_a1 = 0x1137;
+ break;
+
+ case 6:
+ phi_a1 = 0x1138;
+ break;
+
+ case 5:
+ if (gSaveContext.weekEventReg[13] & 0x40) {
+ phi_a1 = 0x113D;
+ } else {
+ phi_a1 = 0x113C;
+ }
+ break;
+
+ default:
+ if (gSaveContext.weekEventReg[13] & 0x40) {
+ phi_a1 = 0x1142;
+ } else {
+ phi_a1 = 0x1141;
+ }
+ break;
+ }
+ Message_StartTextbox(globalCtx, phi_a1, &this->actor);
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+}
+
+void func_80B67458(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ this->actionFunc = func_80B67348;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ if (CURRENT_DAY == 3) {
+ func_80B670A4(this, 6);
+ } else {
+ func_80B670A4(this, 3);
+ }
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, this->actor.home.rot.z, 10000.0f, 500.0f);
+ }
+}
+
+void func_80B67540(EnSth* this, GlobalContext* globalCtx) {
+ s32 sp2C = CURRENT_DAY - 1;
+
+ if (sp2C < 0) {
+ sp2C = 0;
+ }
+
+ if (this->unk_29A == 6) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ }
+
+ SkelAnime_Update(&this->skelAnime);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 5:
+ if (func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x1134:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1132:
+ case 0x113A:
+ case 0x113F:
+ func_80151938(globalCtx, 0x1133);
+ break;
+
+ case 0x1133:
+ func_80151938(globalCtx, 0x1136);
+ func_80B670A4(this, 6);
+ break;
+
+ case 0x1136:
+ gSaveContext.weekEventReg[13] |= 0x80;
+
+ switch (sp2C) {
+ case 0:
+ if (gSaveContext.weekEventReg[13] & 0x40) {
+ this->actor.home.rot.z = 6;
+ } else {
+ gSaveContext.weekEventReg[13] |= 0x40;
+ switch (CUR_UPG_VALUE(UPG_WALLET)) {
+ case 0:
+ this->actor.home.rot.z = 8;
+ break;
+
+ case 1:
+ this->actor.home.rot.z = 9;
+ break;
+ }
+ }
+ break;
+
+ case 1:
+ this->actor.home.rot.z = 5;
+ break;
+
+ default:
+ this->actor.home.rot.z = 4;
+ break;
+ }
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80B67458;
+ func_80B67458(this, globalCtx);
+ break;
+
+ case 0x113C:
+ func_80151938(globalCtx, 0x113B);
+ break;
+
+ case 0x1141:
+ func_80151938(globalCtx, 0x1140);
+ func_80B670A4(this, 3);
+ break;
+
+ default:
+ this->actionFunc = func_80B677BC;
+ func_801477B4(globalCtx);
+ this->unk_29C |= 2;
+ break;
+ }
+ }
+ break;
+
+ case 2:
+ this->actionFunc = func_80B677BC;
+ this->unk_29C |= 2;
+ break;
+ }
+}
+
+void func_80B677BC(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80B672A4(this, globalCtx);
+ this->actionFunc = func_80B67540;
+ } else if (func_80B6703C(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 110.0f);
+ }
+}
+
+void func_80B67838(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ this->actionFunc = func_80B678A8;
+ func_801477B4(globalCtx);
+ }
+ this->unk_294.x = -0x1388;
+}
+
+void func_80B678A8(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80B67838;
+ } else if (func_80B6703C(this, globalCtx) || this->actor.isTargeted) {
+ if ((gSaveContext.time >= CLOCK_TIME(6, 0)) && (gSaveContext.time <= CLOCK_TIME(18, 0))) {
+ this->actor.textId = 0x1130;
+ } else {
+ this->actor.textId = 0x1131;
+ }
+ func_800B8614(&this->actor, globalCtx, 110.0f);
+ }
+ this->unk_294.x = -0x1388;
+}
+
+void func_80B67958(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+}
+
+void func_80B67984(EnSth* this, GlobalContext* globalCtx) {
+ u16 sp1E;
+
+ if (gSaveContext.weekEventReg[34] & 0x10) {
+ sp1E = 0x903;
+ func_80B670A4(this, 2);
+ } else if (gSaveContext.weekEventReg[34] & 0x20) {
+ sp1E = 0x90F;
+ func_80B670A4(this, 2);
+ } else if (gSaveContext.weekEventReg[34] & 0x40) {
+ if (!(gSaveContext.weekEventReg[34] & 8)) {
+ sp1E = 0x91B;
+ } else {
+ sp1E = 0x918;
+ }
+ func_80B670A4(this, 2);
+ } else if (Inventory_GetSkullTokenCount(globalCtx->sceneNum) >= 30) {
+ if (INV_CONTENT(ITEM_MASK_TRUTH) == ITEM_MASK_TRUTH) {
+ this->unk_29C |= 4;
+ sp1E = 0x919;
+ } else {
+ sp1E = 0x916;
+ }
+ } else if (gSaveContext.weekEventReg[34] & 2) {
+ sp1E = 0x8FF;
+ } else {
+ sp1E = 0x8FC;
+ gSaveContext.weekEventReg[34] |= 2;
+ }
+ Message_StartTextbox(globalCtx, sp1E, &this->actor);
+}
+
+void func_80B67AB4(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80B67C1C;
+ gSaveContext.weekEventReg[34] |= 0x40;
+ Message_StartTextbox(globalCtx, 0x918, &this->actor);
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+}
+
+void func_80B67B50(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ this->actionFunc = func_80B67AB4;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ } else {
+ this->unk_29C &= ~1;
+ gSaveContext.weekEventReg[34] |= 8;
+ Actor_PickUp(&this->actor, globalCtx, GI_MASK_TRUTH, 10000.0f, 50.0f);
+ }
+}
+
+void func_80B67C1C(EnSth* this, GlobalContext* globalCtx) {
+ s32 pad;
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x90C:
+ func_80B670A4(this, 2);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x916:
+ case 0x919:
+ func_80B670A4(this, 3);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x8FC:
+ case 0x8FD:
+ case 0x900:
+ case 0x90A:
+ case 0x90D:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x901:
+ case 0x90B:
+ case 0x917:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80B67B50;
+ func_80B67B50(this, globalCtx);
+ break;
+
+ case 0x91A:
+ gSaveContext.weekEventReg[34] |= 0x40;
+ gSaveContext.weekEventReg[34] &= (u8)~8;
+
+ case 0x902:
+ case 0x903:
+ case 0x90E:
+ case 0x90F:
+ case 0x918:
+ case 0x91B:
+ func_80B670A4(this, 3);
+
+ default:
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80B67DA0;
+ break;
+ }
+ }
+}
+
+void func_80B67DA0(EnSth* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80B67984(this, globalCtx);
+ this->actionFunc = func_80B67C1C;
+ } else if (func_80B6703C(this, globalCtx)) {
+ this->actor.textId = 0;
+ func_800B8614(&this->actor, globalCtx, 110.0f);
+ }
+}
+
+void func_80B67E20(Actor* thisx, GlobalContext* globalCtx) {
+ EnSth* this = THIS;
+
+ if (Inventory_GetSkullTokenCount(globalCtx->sceneNum) >= 30) {
+ this->actor.update = func_80B680A8;
+ this->actor.draw = func_80B6849C;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+}
+
+void EnSth_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnSth* this = THIS;
+
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_29E)) {
+ this->actor.objBankIndex = this->unk_29E;
+ Actor_SetObjectDependency(globalCtx, &this->actor);
+
+ if (ENSTH_GET_100(&this->actor)) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_ahg_Skel_005998, &ovl_En_Sth_Anim_0045B4,
+ this->jointTable, this->morphTable, 16);
+ Animation_PlayLoop(&this->skelAnime, &ovl_En_Sth_Anim_0045B4);
+ this->unk_29A = 1;
+ if ((gSaveContext.weekEventReg[34] & 0x10) || (gSaveContext.weekEventReg[34] & 0x20) ||
+ (gSaveContext.weekEventReg[34] & 0x40) || (Inventory_GetSkullTokenCount(globalCtx->sceneNum) >= 30)) {
+ func_80B670A4(this, 3);
+ }
+ } else {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_sth_Skel_0031F8, &ovl_En_Sth_Anim_003F50,
+ this->jointTable, this->morphTable, 16);
+ Animation_PlayLoop(&this->skelAnime, &ovl_En_Sth_Anim_003F50);
+ }
+
+ this->actor.update = func_80B680A8;
+ this->actor.draw = func_80B6849C;
+
+ switch (ENSTH_GET_F(&this->actor)) {
+ case ENSTH_F_3:
+ func_80B670A4(this, 4);
+ break;
+
+ case ENSTH_F_4:
+ if (gSaveContext.weekEventReg[13] & 0x80) {
+ func_80B670A4(this, 5);
+ } else {
+ func_80B670A4(this, 5);
+ }
+ break;
+
+ case ENSTH_F_5:
+ func_80B670A4(this, 7);
+ break;
+ }
+
+ if ((ENSTH_GET_F(&this->actor) == ENSTH_F_4) && (Inventory_GetSkullTokenCount(globalCtx->sceneNum) < 30)) {
+ this->actor.update = func_80B67E20;
+ this->actor.draw = NULL;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ }
+ }
+}
+
+void func_80B680A8(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnSth* this = THIS;
+ Vec3s sp38;
+
+ Actor_MoveWithGravity(&this->actor);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+
+ this->actionFunc(this, globalCtx);
+
+ if (func_80B6703C(this, globalCtx) && !(this->unk_29C & 8) && (this->unk_29A != 5)) {
+ sp38.x = sp38.y = sp38.z = 0;
+
+ func_800E9250(globalCtx, &this->actor, &this->unk_294, &sp38, this->actor.focus.pos);
+ } else {
+ Math_SmoothStepToS(&this->unk_294.x, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->unk_294.y, 0, 6, 6200, 100);
+ }
+}
+
+s32 func_80B681E8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ s32 pad;
+ EnSth* this = THIS;
+
+ if (limbIndex == 15) {
+ rot->x += this->unk_294.y;
+ rot->z += this->unk_294.x;
+ *dList = ovl_En_Sth_DL_0034A0;
+ }
+
+ if ((limbIndex == 8) || (limbIndex == 10) || (limbIndex == 13)) {
+ rot->y += (s16)(Math_SinS(globalCtx->state.frames * ((limbIndex * 50) + 0x814)) * 200.0f);
+ rot->z += (s16)(Math_CosS(globalCtx->state.frames * ((limbIndex * 50) + 0x940)) * 200.0f);
+ }
+ return false;
+}
+
+void func_80B68310(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnSth* this = THIS;
+
+ if (limbIndex == 15) {
+ s32 pad;
+
+ Matrix_MultiplyVector3fByState(&D_80B6D200, &this->actor.focus.pos);
+
+ if (!ENSTH_GET_100(&this->actor)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPDisplayList(POLY_OPA_DISP++, ovl_En_Sth_DL_0037C0);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->unk_29C & 1) {
+ if (Object_IsLoaded(&globalCtx->objectCtx, this->unk_29F)) {
+ Matrix_StatePush();
+ Matrix_InsertZRotation_s(0x3A98, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, 190.0f, 0.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPSegment(POLY_OPA_DISP++, 0x0A, globalCtx->objectCtx.status[this->unk_29F].segment);
+ gSPDisplayList(POLY_OPA_DISP++, object_mask_truth_DL_0001A0);
+
+ Matrix_StatePop();
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+ }
+}
+
+void func_80B6849C(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnSth* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08,
+ Gfx_EnvColor(globalCtx->state.gfxCtx, D_80B6D20C[1].r, D_80B6D20C[1].g, D_80B6D20C[1].b, 255));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 90, 110, 130, 255));
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ func_80B681E8, func_80B68310, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.h b/src/overlays/actors/ovl_En_Sth/z_en_sth.h
index fcd6042aa8..422a92c34a 100644
--- a/src/overlays/actors/ovl_En_Sth/z_en_sth.h
+++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.h
@@ -5,9 +5,31 @@
struct EnSth;
+typedef void (*EnSthActionFunc)(struct EnSth*, GlobalContext*);
+
+#define ENSTH_GET_F(thisx) ((thisx)->params & 0xF)
+#define ENSTH_GET_100(thisx) ((thisx)->params & 0x100)
+
+enum {
+ /* 1 */ ENSTH_F_1 = 1,
+ /* 2 */ ENSTH_F_2,
+ /* 3 */ ENSTH_F_3,
+ /* 4 */ ENSTH_F_4,
+ /* 5 */ ENSTH_F_5,
+};
+
typedef struct EnSth {
/* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x160];
+ /* 0x144 */ ColliderCylinder collider;
+ /* 0x190 */ SkelAnime skelAnime;
+ /* 0x1D4 */ Vec3s jointTable[16];
+ /* 0x234 */ Vec3s morphTable[16];
+ /* 0x294 */ Vec3s unk_294;
+ /* 0x29A */ s16 unk_29A;
+ /* 0x29C */ u16 unk_29C;
+ /* 0x29E */ u8 unk_29E;
+ /* 0x29F */ u8 unk_29F;
+ /* 0x2A0 */ EnSthActionFunc actionFunc;
} EnSth; // size = 0x2A4
extern const ActorInit En_Sth_InitVars;
diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c
index 97b463567e..0bf0ae73c0 100644
--- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c
+++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c
@@ -6,7 +6,7 @@
#include "z_en_sth2.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnSth2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c
index 387afd7e9f..54a1f84a81 100644
--- a/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c
+++ b/src/overlays/actors/ovl_En_Stone_heishi/z_en_stone_heishi.c
@@ -6,7 +6,7 @@
#include "z_en_stone_heishi.h"
-#define FLAGS 0x00000089
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_80)
#define THIS ((EnStoneheishi*)thisx)
diff --git a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c
index c5746771c7..3ca829630c 100644
--- a/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c
+++ b/src/overlays/actors/ovl_En_Stop_heishi/z_en_stop_heishi.c
@@ -6,7 +6,7 @@
#include "z_en_stop_heishi.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnStopheishi*)thisx)
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 9ce7ac906f..abf58da86c 100644
--- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c
+++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c
@@ -7,7 +7,7 @@
#include "z_en_stream.h"
#include "objects/object_stream/object_stream.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnStream*)thisx)
diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
index dc10640406..07b1df03fb 100644
--- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
+++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c
@@ -7,8 +7,9 @@
#include "z_en_suttari.h"
#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_boj/object_boj.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnSuttari*)thisx)
@@ -36,17 +37,6 @@ void func_80BADE14(EnSuttari* this, GlobalContext* globalCtx);
void func_80BADE8C(EnSuttari* this, GlobalContext* globalCtx);
void func_80BADF3C(EnSuttari* this, GlobalContext* globalCtx);
-extern FlexSkeletonHeader D_0600C240;
-extern AnimationHeader D_0600071C;
-extern AnimationHeader D_06010BDC;
-extern AnimationHeader D_0601139C;
-extern AnimationHeader D_06011F84;
-extern AnimationHeader D_06011C38;
-extern AnimationHeader D_060128F4;
-extern AnimationHeader D_06012E84;
-extern Gfx D_0600AF90[];
-extern Gfx D_06013380[];
-
const ActorInit En_Suttari_InitVars = {
ACTOR_EN_SUTTARI,
ACTORCAT_NPC,
@@ -59,12 +49,16 @@ const ActorInit En_Suttari_InitVars = {
(ActorFunc)EnSuttari_Draw,
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_0600071C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_060128F4, 1.0f, 0.0f, 0.0f, 0, 0.0f },
- { &D_06011F84, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_06012E84, 1.0f, 0.0f, 0.0f, 0, -6.0f },
- { &D_0601139C, 1.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_0600071C, 2.0f, 0.0f, 0.0f, 0, 0.0f },
- { &D_06011F84, 2.0f, 0.0f, 0.0f, 0, 0.0f }, { &D_06011C38, 1.0f, 0.0f, 0.0f, 2, 0.0f },
- { &D_06010BDC, 1.0f, 0.0f, 0.0f, 0, 0.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_boj_Anim_00071C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_0128F4, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_011F84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_012E84, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -6.0f },
+ { &object_boj_Anim_01139C, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_00071C, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_011F84, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
+ { &object_boj_Anim_011C38, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 0.0f },
+ { &object_boj_Anim_010BDC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f },
};
static ColliderCylinderInit sCylinderInit = {
@@ -229,13 +223,13 @@ void func_80BAA9B4(EnSuttari* this) {
case 0x145B:
if ((this->animationIdx != 8) && (curFrame == frameCount)) {
this->animationIdx = 8;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
break;
default:
if ((this->animationIdx != 1) && (curFrame == frameCount)) {
this->animationIdx = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
}
}
@@ -244,7 +238,7 @@ void func_80BAAA94(EnSuttari* this) {
switch (this->textId) {
case 0x29E5:
this->animationIdx = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
break;
case 0x29E9:
this->enFsn->flags |= ENFSN_ANGRY;
@@ -257,11 +251,11 @@ void func_80BAAA94(EnSuttari* this) {
break;
case 0x29EC:
this->animationIdx = 7;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
break;
case 0x29ED:
this->animationIdx = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
break;
}
}
@@ -329,7 +323,7 @@ void func_80BAAB78(EnSuttari* this, GlobalContext* globalCtx) {
} else if (this->flags1 & 1) {
switch (this->textId) {
case 0:
- if (gSaveContext.weekEventReg[0x51] & 1) {
+ if (gSaveContext.weekEventReg[81] & 1) {
this->textId = 0x1455;
((EnElf*)GET_PLAYER(globalCtx)->tatlActor)->unk_264 |= 8;
this->flags2 |= 1;
@@ -347,12 +341,12 @@ void func_80BAAB78(EnSuttari* this, GlobalContext* globalCtx) {
} else {
this->flags1 |= 0x400;
this->textId = 0x1452;
- gSaveContext.weekEventReg[0x51] |= 1;
+ gSaveContext.weekEventReg[81] |= 1;
}
break;
case 0x1453:
this->flags1 |= 0x400;
- gSaveContext.weekEventReg[0x51] |= 1;
+ gSaveContext.weekEventReg[81] |= 1;
((EnElf*)GET_PLAYER(globalCtx)->tatlActor)->unk_264 |= 8;
this->flags2 |= 1;
this->textId = 0x1454;
@@ -378,7 +372,7 @@ void func_80BAAB78(EnSuttari* this, GlobalContext* globalCtx) {
break;
}
}
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
}
void func_80BAAF1C(EnSuttari* this) {
@@ -387,10 +381,10 @@ void func_80BAAF1C(EnSuttari* this) {
if (this->animationIdx == 5) {
this->animationIdx = 3;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
} else if ((this->animationIdx == 3) && (curFrame == frameCount)) {
this->animationIdx = 6;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->flags1 &= ~0x100;
}
}
@@ -420,7 +414,7 @@ void func_80BAAFDC(EnSuttari* this, GlobalContext* globalCtx) {
if (this->unk1F4[0] != 0) {
this->unk1F4[0]--;
}
- gSaveContext.weekEventReg[0x3D] |= 8;
+ gSaveContext.weekEventReg[61] |= 8;
this->unk3F6 = 20;
this->actionFunc = func_80BADE8C;
}
@@ -452,7 +446,7 @@ void func_80BAB1A0(EnSuttari* this, GlobalContext* globalCtx) {
if (this->unk1F4[0] != 0) {
this->unk1F4[0]--;
}
- gSaveContext.weekEventReg[0x3D] |= 8;
+ gSaveContext.weekEventReg[61] |= 8;
this->unk3F6 = 20;
this->actionFunc = func_80BADE8C;
} else {
@@ -492,7 +486,7 @@ void func_80BAB4F0(EnSuttari* this, GlobalContext* globalCtx) {
}
SkelAnime_Update(&this->skelAnime);
if (!(this->flags1 & 4) && (Player_GetMask(globalCtx) != PLAYER_MASK_STONE)) {
- if (func_8013D5E8(this->actor.shape.rot.y, 0x36B0, this->actor.yawTowardsPlayer) != 0) {
+ if (SubS_AngleDiffLessEqual(this->actor.shape.rot.y, 0x36B0, this->actor.yawTowardsPlayer)) {
sp30.x = player->actor.world.pos.x;
sp30.y = player->bodyPartsPos[7].y + 3.0f;
sp30.z = player->actor.world.pos.z;
@@ -507,7 +501,7 @@ void func_80BAB4F0(EnSuttari* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->unk2E2.y, 0, 4, 0x3E8, 1);
}
}
- func_8013D9C8(globalCtx, this->unk2FA, this->unk31A, 16);
+ SubS_FillLimbRotTables(globalCtx, this->unk2FA, this->unk31A, ARRAY_COUNT(this->unk2FA));
}
s16 func_80BAB698(Path* path, s32 idx, Vec3f* pos, f32* distSQ) {
@@ -823,9 +817,9 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
case 15:
if ((this->animationIdx == 1) && (curFrame == frameCount)) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
- if (!(gSaveContext.weekEventReg[0x53] & 4) && !(this->flags1 & 0x1000)) {
+ if (!(gSaveContext.weekEventReg[83] & 4) && !(this->flags1 & 0x1000)) {
if (ActorCutscene_GetCanPlayNext(this->cutscenes[0])) {
ActorCutscene_Start(this->cutscenes[0], &this->actor);
if (!(player->stateFlags1 & 0x10000000)) {
@@ -856,7 +850,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
this->enFsn->flags &= ~ENFSN_HAGGLE;
if (this->animationIdx != 2) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
func_80BAC220(this, globalCtx);
break;
@@ -874,7 +868,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
break;
case 2:
- if (!(gSaveContext.weekEventReg[0x51] & 4)) {
+ if (!(gSaveContext.weekEventReg[81] & 4)) {
this->flags1 |= 0x80;
this->actor.world.pos.x = -16.0f;
this->actor.world.pos.z = -16.0f;
@@ -884,10 +878,10 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
}
break;
case 4:
- if (!(gSaveContext.weekEventReg[0x21] & 8)) {
+ if (!(gSaveContext.weekEventReg[33] & 8)) {
if (this->animationIdx == 2 || this->animationIdx == 1) {
this->animationIdx = 5;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
this->flags1 |= 0x10;
if (this->flags2 & 2) {
@@ -898,7 +892,7 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
player->stateFlags1 |= 0x10000000;
}
this->textId = 0x2A30;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->actionFunc = func_80BAD2B4;
}
break;
@@ -908,22 +902,23 @@ void func_80BAC2FC(EnSuttari* this, GlobalContext* globalCtx) {
void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600C240, &D_0600071C, this->jointTable, this->morphTable, 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_boj_Skel_00C240, &object_boj_Anim_00071C, this->jointTable,
+ this->morphTable, 16);
this->actor.draw = EnSuttari_Draw;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (globalCtx->sceneNum == SCENE_IKANA) {
this->flags1 |= 1;
if (gSaveContext.day == 1 || gSaveContext.day == 2) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->flags1 |= 0x80;
this->actionFunc = func_80BACA14;
return;
} else if ((gSaveContext.day == 3) && (gSaveContext.time <= CLOCK_TIME(19, 00)) &&
- !(gSaveContext.weekEventReg[0x3D] & 8) && !(gSaveContext.weekEventReg[0x21] & 8) &&
- (gSaveContext.weekEventReg[0x33] & 8)) {
+ !(gSaveContext.weekEventReg[61] & 8) && !(gSaveContext.weekEventReg[33] & 8) &&
+ (gSaveContext.weekEventReg[51] & 8)) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->actionFunc = func_80BACEE0;
return;
}
@@ -931,7 +926,7 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) {
if (gSaveContext.time >= CLOCK_TIME(0, 20) && gSaveContext.time < CLOCK_TIME(6, 00)) {
Actor_MarkForDeath(&this->actor);
}
- if ((gSaveContext.entranceIndex == 0xD670) || (gSaveContext.weekEventReg[0x3A] & 0x40)) {
+ if ((gSaveContext.entranceIndex == 0xD670) || (gSaveContext.weekEventReg[58] & 0x40)) {
Actor_MarkForDeath(&this->actor);
}
this->cutscenes[0] = this->actor.cutscene;
@@ -939,26 +934,26 @@ void func_80BAC6E8(EnSuttari* this, GlobalContext* globalCtx) {
this->flags1 |= 0x80;
this->flags1 |= 8;
this->animationIdx = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->actionFunc = func_80BAD004;
return;
} else if (globalCtx->sceneNum == SCENE_ICHIBA) {
- if (gSaveContext.weekEventReg[0x21] & 8) {
+ if (gSaveContext.weekEventReg[33] & 8) {
Actor_MarkForDeath(&this->actor);
return;
}
this->animationIdx = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->flags1 |= 2;
this->actionFunc = func_80BAD5F8;
return;
} else if (globalCtx->sceneNum == SCENE_AYASHIISHOP) {
- if (gSaveContext.weekEventReg[0x21] & 8) {
+ if (gSaveContext.weekEventReg[33] & 8) {
Actor_MarkForDeath(&this->actor);
return;
}
this->animationIdx = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
this->cutscenes[0] = this->actor.cutscene;
this->cutscenes[1] = ActorCutscene_GetAdditionalCutscene(this->cutscenes[0]);
this->flags1 |= 4;
@@ -978,7 +973,7 @@ void func_80BACA14(EnSuttari* this, GlobalContext* globalCtx) {
if (this->animationIdx == 1 || this->animationIdx == 8) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
func_80BABA90(this, 0, 0);
func_80BAB434(this);
@@ -1072,16 +1067,16 @@ void func_80BACEE0(EnSuttari* this, GlobalContext* globalCtx) {
this->unk42A = REG(15) + *unk_14;
if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) ||
((this->unk428 != unkStruct.unk0) && !func_80BABF64(this, globalCtx, &unkStruct))) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
unkStruct.unk0 = 0;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk428 = unkStruct.unk0;
func_80BAC2FC(this, globalCtx);
func_80BAB434(this);
if (this->unk428 == 5) {
- gSaveContext.weekEventReg[0x3A] |= 0x80;
+ gSaveContext.weekEventReg[58] |= 0x80;
this->actionFunc = func_80BADDB4;
this->actor.speedXZ = 0.0f;
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_STONE) {
@@ -1097,15 +1092,15 @@ void func_80BAD004(EnSuttari* this, GlobalContext* globalCtx) {
this->unk42A = REG(15) + *unk_14;
if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) ||
((this->unk428 != unkStruct.unk0) && !func_80BABF64(this, globalCtx, &unkStruct))) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
unkStruct.unk0 = 0;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk428 = unkStruct.unk0;
func_80BAC2FC(this, globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x2A3A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2A3A, &this->actor);
this->actionFunc = func_80BAD130;
} else if ((this->actor.xzDistToPlayer < 200.0f) || this->actor.isTargeted) {
func_800B863C(&this->actor, globalCtx);
@@ -1117,7 +1112,7 @@ void func_80BAD130(EnSuttari* this, GlobalContext* globalCtx) {
u8 talkState = Message_GetState(&globalCtx->msgCtx);
if ((talkState == 5 || talkState == 6) && func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
if (this->flags1 & 8) {
this->actionFunc = func_80BAD004;
@@ -1137,7 +1132,7 @@ void func_80BAD230(EnSuttari* this, GlobalContext* globalCtx) {
if (ActorCutscene_GetCanPlayNext(this->cutscenes[1])) {
ActorCutscene_Start(this->cutscenes[1], &this->actor);
this->textId = 0x2A31;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->flags1 |= 0x4000;
Audio_QueueSeqCmd(NA_BGM_CHASE | 0x8000);
this->actionFunc = func_80BAD380;
@@ -1154,7 +1149,7 @@ void func_80BAD2B4(EnSuttari* this, GlobalContext* globalCtx) {
this->actionFunc = func_80BAD230;
} else {
ActorCutscene_Stop(this->cutscenes[1]);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->flags1 |= 0x40;
this->actionFunc = func_80BAD380;
@@ -1178,7 +1173,7 @@ void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) {
player->stateFlags1 &= ~0x10000000;
this->flags1 &= ~0x4000;
ActorCutscene_Stop(this->cutscenes[1]);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->flags1 |= 0x40;
}
@@ -1186,7 +1181,7 @@ void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) {
this->flags2 |= 8;
func_80BAAF1C(this);
} else if (this->flags1 & 0x200) {
- gSaveContext.weekEventReg[0x4F] |= 0x40;
+ gSaveContext.weekEventReg[79] |= 0x40;
this->flags2 |= 4;
this->actor.speedXZ = 0.0f;
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, this->actor.world.pos.x,
@@ -1197,7 +1192,7 @@ void func_80BAD380(EnSuttari* this, GlobalContext* globalCtx) {
}
if (this->unk1F4[1] == -0x63) {
if (this->flags2 & 8) {
- gSaveContext.weekEventReg[0x21] |= 8;
+ gSaveContext.weekEventReg[33] |= 8;
}
this->actor.speedXZ = 0.0f;
Audio_QueueSeqCmd(0x101400FF);
@@ -1220,15 +1215,15 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) {
if ((curFrame == frameCount) && (this->animationIdx == 0) && (this->flags1 & 0x20)) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
this->unk42A = REG(15) + *unk_14;
if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) ||
((this->unk428 != unkStruct.unk0) && !func_80BABF64(this, globalCtx, &unkStruct))) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
unkStruct.unk0 = 0;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk428 = unkStruct.unk0;
func_80BAC2FC(this, globalCtx);
@@ -1239,7 +1234,7 @@ void func_80BAD5F8(EnSuttari* this, GlobalContext* globalCtx) {
func_80BAB434(this);
if ((this->flags1 & 0x20) && (this->unk430 == 0) && (unkStruct.unk0 != 7)) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x2A02, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2A02, &this->actor);
this->actionFunc = func_80BAD130;
} else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) {
func_800B863C(&this->actor, globalCtx);
@@ -1259,15 +1254,15 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) {
} else {
if ((this->flags1 & 0x2000) && (this->animationIdx == 1) && (curFrame == frameCount)) {
this->animationIdx = 2;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
this->unk42A = REG(15) + *unk_14;
if (!func_80133038(globalCtx, D_80BAE820, &unkStruct) ||
((this->unk428 != unkStruct.unk0) && !func_80BABF64(this, globalCtx, &unkStruct))) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
unkStruct.unk0 = 0;
} else {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
}
this->unk428 = unkStruct.unk0;
func_80BAC2FC(this, globalCtx);
@@ -1277,7 +1272,7 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) {
}
if ((this->flags1 & 0x20) && (unkStruct.unk0 != 9)) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x2A02, &this->actor);
+ Message_StartTextbox(globalCtx, 0x2A02, &this->actor);
this->actionFunc = func_80BAD130;
} else if ((this->actor.xzDistToPlayer < 100.0f) || this->actor.isTargeted) {
func_800B863C(&this->actor, globalCtx);
@@ -1289,11 +1284,11 @@ void func_80BAD7F8(EnSuttari* this, GlobalContext* globalCtx) {
void func_80BADA08(EnSuttari* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_80BAAB78(this, globalCtx);
- gSaveContext.weekEventReg[0x51] |= 4;
+ gSaveContext.weekEventReg[81] |= 4;
} else if (this->actor.xzDistToPlayer < 500.0f) {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 500.0f);
}
}
@@ -1308,7 +1303,7 @@ void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) {
func_80BAA9B4(this);
} else if ((this->animationIdx == 7) && (curFrame == frameCount)) {
this->animationIdx = 1;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, this->animationIdx);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, this->animationIdx);
}
if (talkstate == 5) {
if (func_80147624(globalCtx)) {
@@ -1321,7 +1316,7 @@ void func_80BADA9C(EnSuttari* this, GlobalContext* globalCtx) {
((EnElf*)GET_PLAYER(globalCtx)->tatlActor)->unk_264 |= 0x10;
this->flags2 &= ~1;
}
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->textId = 0;
if (this->flags1 & 1) {
@@ -1369,7 +1364,7 @@ void func_80BADD0C(EnSuttari* this, GlobalContext* globalCtx) {
void func_80BADDB4(EnSuttari* this, GlobalContext* globalCtx) {
func_80BABA90(this, 1, 1);
func_80BAB434(this);
- if (gSaveContext.weekEventReg[0x33] & 0x10) {
+ if (gSaveContext.weekEventReg[51] & 0x10) {
this->actionFunc = func_80BADE14;
}
Actor_MoveWithGravity(&this->actor);
@@ -1390,11 +1385,11 @@ void func_80BADE8C(EnSuttari* this, GlobalContext* globalCtx) {
this->unk3F2 = this->unk2DC.y;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0xBB8, 0);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
- func_801518B0(globalCtx, 0x2A3A, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ Message_StartTextbox(globalCtx, 0x2A3A, &this->actor);
this->actionFunc = func_80BAD130;
} else {
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 500.0f);
}
}
@@ -1415,14 +1410,14 @@ void EnSuttari_Init(Actor* thisx, GlobalContext* globalCtx) {
EnSuttari* this = THIS;
s32 pad;
- if (gSaveContext.weekEventReg[0x4F] & 0x40) {
+ if (gSaveContext.weekEventReg[79] & 0x40) {
Actor_MarkForDeath(&this->actor);
return;
}
Collider_InitCylinder(globalCtx, &this->collider);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit2);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
EnSuttari_GetPaths(this, globalCtx);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80BAC6E8;
@@ -1471,7 +1466,7 @@ s32 EnSuttari_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
EnSuttari* this = THIS;
if (limbIndex == 15) {
- *dList = D_0600AF90;
+ *dList = object_boj_DL_00AF90;
if (!(this->flags1 & 4)) {
Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
Matrix_InsertXRotation_s(this->unk3F2, MTXMODE_APPLY);
@@ -1514,7 +1509,7 @@ void EnSuttari_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
} else {
func_8012C28C(globalCtx->state.gfxCtx);
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_06013380);
+ gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_013380);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
@@ -1525,7 +1520,7 @@ void EnSuttari_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
}
}
-void EnSuttari_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnSuttari_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnSuttari_Draw(Actor* thisx, GlobalContext* globalCtx) {
@@ -1540,8 +1535,9 @@ void EnSuttari_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Gfx_EnvColor(globalCtx->state.gfxCtx, 255, 255, 255, 0));
gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_EnvColor(globalCtx->state.gfxCtx, 55, 55, 255, 0));
gDPPipeSync(POLY_OPA_DISP++);
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnSuttari_OverrideLimbDraw, EnSuttari_PostLimbDraw, EnSuttari_UnkDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnSuttari_OverrideLimbDraw, EnSuttari_PostLimbDraw,
+ EnSuttari_TransformLimbDraw, &this->actor);
if (this->flags1 & 0x80) {
func_8012C2DC(globalCtx->state.gfxCtx);
sp5C = this->actor.world.pos;
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 a851f2ee9b..abf7b3a407 100644
--- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c
+++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c
@@ -5,8 +5,9 @@
*/
#include "z_en_sw.h"
+#include "objects/object_st/object_st.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnSw*)thisx)
@@ -27,21 +28,6 @@ void func_808DB100(EnSw* this, GlobalContext* globalCtx);
void func_808DB25C(EnSw* this, GlobalContext* globalCtx);
void func_808DB2E0(EnSw* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000304;
-extern Gfx D_06003FB0[];
-extern Gfx D_060043D8[];
-extern Gfx D_060045C0[];
-extern Gfx D_06004658[];
-extern Gfx D_060046F0[];
-extern Gfx D_06004788[];
-extern Gfx D_06004820[];
-extern Gfx D_060048B8[];
-extern Gfx D_06004950[];
-extern Gfx D_060049E8[];
-extern SkeletonHeader D_06005298;
-extern AnimationHeader D_060055A8;
-extern AnimationHeader D_06005B98;
-
const ActorInit En_Sw_InitVars = {
ACTOR_EN_SW,
ACTORCAT_NPC,
@@ -148,11 +134,11 @@ static DamageTable sDamageTable2 = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-static ActorAnimationEntryS sAnimations[] = {
- { &D_06000304, 1.0f, 0, -1, 3, 0 },
- { &D_06000304, 1.0f, 0, -1, 3, -4 },
- { &D_060055A8, 1.0f, 0, -1, 1, -4 },
- { &D_06005B98, 1.0f, 0, -1, 1, -4 },
+static AnimationInfoS sAnimations[] = {
+ { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, 0 },
+ { &object_st_Anim_000304, 1.0f, 0, -1, ANIMMODE_ONCE_INTERP, -4 },
+ { &object_st_Anim_0055A8, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 },
+ { &object_st_Anim_005B98, 1.0f, 0, -1, ANIMMODE_LOOP_INTERP, -4 },
};
void func_808D8940(EnSw* this, GlobalContext* globalCtx) {
@@ -289,7 +275,7 @@ void func_808D90F0(EnSw* this, s32 arg1, s16 arg2) {
temp = arg2;
}
- Matrix_InsertRotationAroundUnitVector_f(BINANG_TO_RAD(temp), &this->unk_368, 0);
+ Matrix_InsertRotationAroundUnitVector_f(BINANG_TO_RAD(temp), &this->unk_368, MTXMODE_NEW);
Matrix_MultiplyVector3fByState(&this->unk_350, &sp2C);
Math_Vec3f_Copy(&this->unk_350, &sp2C);
Math3D_CrossProduct(&this->unk_368, &this->unk_350, &this->unk_35C);
@@ -688,9 +674,9 @@ s32 func_808DA08C(EnSw* this, GlobalContext* globalCtx) {
} else if (!func_808D90C4(this)) {
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_STALTU_DEAD);
Enemy_StartFinishingBlow(globalCtx, &this->actor);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (!ENSW_GET_3(&this->actor)) {
- func_8013BC6C(&this->skelAnime, sAnimations, 3);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 3);
}
switch (this->actor.colChkInfo.damageEffect) {
@@ -1171,8 +1157,9 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) {
if (!func_808D9968(this, globalCtx)) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06005298, NULL, this->jointTable, this->morphTable, 30);
- func_8013BC6C(&this->skelAnime, sAnimations, 0);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_st_Skel_005298, NULL, this->jointTable, this->morphTable,
+ 30);
+ SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, 0);
this->skelAnime.playSpeed = 4.0f;
Collider_InitAndSetSphere(globalCtx, &this->collider, &this->actor, &sSphereInit);
@@ -1198,8 +1185,8 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) {
break;
case 1:
- this->actor.flags &= ~1;
- this->actor.flags |= 0x10;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10;
if (this->actor.world.rot.z < 0) {
this->unk_460 = -thisx->world.rot.z;
@@ -1219,8 +1206,8 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) {
case 2:
case 3:
- this->actor.flags &= ~1;
- this->actor.flags |= 0x10;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10;
if (this->actor.world.rot.z < 0) {
this->unk_460 = -thisx->world.rot.z;
@@ -1276,43 +1263,43 @@ s32 EnSw_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
if (ENSW_GET_3(&this->actor)) {
switch (limbIndex) {
case 23:
- *dList = D_06004788;
+ *dList = object_st_DL_004788;
break;
case 8:
- *dList = D_060046F0;
+ *dList = object_st_DL_0046F0;
break;
case 14:
- *dList = D_06004658;
+ *dList = object_st_DL_004658;
break;
case 11:
- *dList = D_060045C0;
+ *dList = object_st_DL_0045C0;
break;
case 26:
- *dList = D_06004820;
+ *dList = object_st_DL_004820;
break;
case 20:
- *dList = D_060048B8;
+ *dList = object_st_DL_0048B8;
break;
case 17:
- *dList = D_06004950;
+ *dList = object_st_DL_004950;
break;
case 29:
- *dList = D_060049E8;
+ *dList = object_st_DL_0049E8;
break;
case 5:
- *dList = D_06003FB0;
+ *dList = object_st_DL_003FB0;
break;
case 4:
- *dList = D_060043D8;
+ *dList = object_st_DL_0043D8;
break;
}
}
diff --git a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
index 4b6d4a5d67..ca3e3d6942 100644
--- a/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
+++ b/src/overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.c
@@ -6,7 +6,7 @@
#include "z_en_syateki_crow.h"
-#define FLAGS 0x08000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
#define THIS ((EnSyatekiCrow*)thisx)
diff --git a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c
index 6d606f8b78..65849b7e51 100644
--- a/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c
+++ b/src/overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.c
@@ -6,7 +6,7 @@
#include "z_en_syateki_dekunuts.h"
-#define FLAGS 0x08000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
#define THIS ((EnSyatekiDekunuts*)thisx)
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 6defe10cb3..d461712e2f 100644
--- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
+++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c
@@ -5,8 +5,9 @@
*/
#include "z_en_syateki_man.h"
+#include "objects/object_shn/object_shn.h"
-#define FLAGS 0x08000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_8000000)
#define THIS ((EnSyatekiMan*)thisx)
@@ -34,16 +35,6 @@ void func_809C8808(EnSyatekiMan* this, GlobalContext* globalCtx);
void func_809C898C(EnSyatekiMan* this, GlobalContext* globalCtx);
void func_809C8BF0(EnSyatekiMan* this, GlobalContext* globalCtx);
-extern UNK_PTR D_06005AC8;
-extern UNK_PTR D_060062C8;
-extern AnimationHeader D_0600D2F8;
-extern AnimationHeader D_0600D9D0;
-extern AnimationHeader D_0600DFEC;
-extern FlexSkeletonHeader D_0600E7D0;
-extern Gfx D_0600F2D0[];
-extern UNK_PTR D_0600FB90;
-extern UNK_PTR D_06010390;
-
const ActorInit En_Syateki_Man_InitVars = {
ACTOR_EN_SYATEKI_MAN,
ACTORCAT_NPC,
@@ -56,10 +47,10 @@ const ActorInit En_Syateki_Man_InitVars = {
(ActorFunc)EnSyatekiMan_Draw,
};
-static ActorAnimationEntry sAnimations[] = {
- { &D_0600D9D0, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_0600DFEC, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &D_0600D2F8, 1.0f, 0.0f, 0.0f, 2, -8.0f },
+static AnimationInfo sAnimations[] = {
+ { &object_shn_Anim_00D9D0, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &object_shn_Anim_00DFEC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &object_shn_Anim_00D2F8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
};
static s16 D_809C91C8[] = {
@@ -141,11 +132,11 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 1;
Actor_SetScale(&this->actor, 0.01f);
if (globalCtx->sceneNum == SCENE_SYATEKI_MORI) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E7D0, &D_0600DFEC, this->jointTable, this->morphTable,
- 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_shn_Skel_00E7D0, &object_shn_Anim_00DFEC,
+ this->jointTable, this->morphTable, 16);
} else {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E7D0, &D_0600D9D0, this->jointTable, this->morphTable,
- 16);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_shn_Skel_00E7D0, &object_shn_Anim_00D9D0,
+ this->jointTable, this->morphTable, 16);
}
this->actor.colChkInfo.cylRadius = 100;
@@ -216,34 +207,34 @@ void func_809C6848(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
u16 sp22;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 2);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
sp22 = Text_GetFaceReaction(globalCtx, 0x31);
if (sp22 != 0) {
- func_801518B0(globalCtx, sp22, &this->actor);
+ Message_StartTextbox(globalCtx, sp22, &this->actor);
this->unk_284 = sp22;
} else if (player->transformation == PLAYER_FORM_HUMAN) {
if (this->unk_282 == 0) {
this->unk_282 = 1;
- func_801518B0(globalCtx, 0xA28, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA28, &this->actor);
this->unk_284 = 0xA28;
} else {
- func_801518B0(globalCtx, 0xA29, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA29, &this->actor);
this->unk_284 = 0xA29;
}
} else {
switch (CURRENT_DAY) {
case 1:
- func_801518B0(globalCtx, 0xA38, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA38, &this->actor);
this->unk_284 = 0xA38;
break;
case 2:
- func_801518B0(globalCtx, 0xA39, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA39, &this->actor);
this->unk_284 = 0xA39;
break;
case 3:
- func_801518B0(globalCtx, 0xA3A, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA3A, &this->actor);
this->unk_284 = 0xA3A;
break;
}
@@ -265,11 +256,11 @@ void func_809C6A04(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.choiceIndex == 0) {
if (!CUR_UPG_VALUE(UPG_QUIVER)) {
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0xA30, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA30, &this->actor);
this->unk_284 = 0xA30;
} else if (gSaveContext.rupees < 20) {
play_sound(NA_SE_SY_ERROR);
- func_801518B0(globalCtx, 0xA31, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA31, &this->actor);
this->unk_284 = 0xA31;
if (this->unk_26A == 4) {
gSaveContext.minigameState = 3;
@@ -280,7 +271,7 @@ void func_809C6A04(EnSyatekiMan* this, GlobalContext* globalCtx) {
func_801159EC(-20);
gSaveContext.weekEventReg[63] |= 1;
gSaveContext.weekEventReg[63] &= (u8)~2;
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->unk_26A = 7;
player->stateFlags1 |= 0x20;
@@ -291,17 +282,17 @@ void func_809C6A04(EnSyatekiMan* this, GlobalContext* globalCtx) {
switch (CURRENT_DAY) {
case 1:
- func_801518B0(globalCtx, 0xA2D, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2D, &this->actor);
this->unk_284 = 0xA2D;
break;
case 2:
- func_801518B0(globalCtx, 0xA2E, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2E, &this->actor);
this->unk_284 = 0xA2E;
break;
case 3:
- func_801518B0(globalCtx, 0xA2F, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2F, &this->actor);
this->unk_284 = 0xA2F;
break;
}
@@ -322,14 +313,14 @@ void func_809C6C2C(EnSyatekiMan* this, GlobalContext* globalCtx) {
switch (this->unk_284) {
case 0xA28:
case 0xA29:
- func_801518B0(globalCtx, 0xA2A, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2A, &this->actor);
this->unk_284 = 0xA2A;
break;
case 0xA2B:
case 0xA2C:
case 0xA35:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->actor.freezeTimer = 0;
func_80112AFC(globalCtx);
@@ -350,19 +341,19 @@ void func_809C6C2C(EnSyatekiMan* this, GlobalContext* globalCtx) {
gSaveContext.minigameState = 3;
this->unk_26A = 0;
} else {
- func_801518B0(globalCtx, 0xA33, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA33, &this->actor);
this->unk_284 = 0xA33;
}
break;
case 0xA33:
- func_801518B0(globalCtx, 0xA2A, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2A, &this->actor);
this->unk_284 = 0xA2A;
this->unk_26A = 4;
break;
case 0xA34:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->actor.freezeTimer = 0;
gSaveContext.minigameState = 3;
@@ -397,7 +388,7 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) {
case 6:
if (func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->stateFlags1 &= ~0x20;
gSaveContext.weekEventReg[63] &= (u8)~1;
@@ -417,9 +408,9 @@ void func_809C6E30(EnSyatekiMan* this, GlobalContext* globalCtx) {
break;
}
- if (this->skelAnime.animation == &D_0600D2F8) {
+ if (this->skelAnime.animation == &object_shn_Anim_00D2F8) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, 0);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
}
}
}
@@ -431,18 +422,18 @@ void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (CURRENT_DAY != 3) {
if (!(this->unk_282 & 1)) {
this->unk_282 |= 1;
- func_801518B0(globalCtx, 0x3E8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3E8, &this->actor);
this->unk_284 = 0x3E8;
} else {
- func_801518B0(globalCtx, 0x3E9, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3E9, &this->actor);
this->unk_284 = 0x3E9;
}
} else if (!(this->unk_282 & 1)) {
this->unk_282 |= 1;
- func_801518B0(globalCtx, 0x3EA, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EA, &this->actor);
this->unk_284 = 0x3EA;
} else {
- func_801518B0(globalCtx, 0x3EB, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EB, &this->actor);
this->unk_284 = 0x3EB;
}
break;
@@ -451,18 +442,18 @@ void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (CURRENT_DAY != 3) {
if (!(this->unk_282 & 2)) {
this->unk_282 |= 2;
- func_801518B0(globalCtx, 0x3EC, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EC, &this->actor);
this->unk_284 = 0x3EC;
} else {
- func_801518B0(globalCtx, 0x3ED, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3ED, &this->actor);
this->unk_284 = 0x3ED;
}
} else if (!(this->unk_282 & 2)) {
this->unk_282 |= 2;
- func_801518B0(globalCtx, 0x3EE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EE, &this->actor);
this->unk_284 = 0x3EE;
} else {
- func_801518B0(globalCtx, 0x3EF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EF, &this->actor);
this->unk_284 = 0x3EF;
}
break;
@@ -471,18 +462,18 @@ void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (CURRENT_DAY != 3) {
if (!(this->unk_282 & 8)) {
this->unk_282 |= 8;
- func_801518B0(globalCtx, 0x3F0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F0, &this->actor);
this->unk_284 = 0x3F0;
} else {
- func_801518B0(globalCtx, 0x3F1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F1, &this->actor);
this->unk_284 = 0x3F1;
}
} else if (!(this->unk_282 & 8)) {
this->unk_282 |= 8;
- func_801518B0(globalCtx, 0x3F4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F4, &this->actor);
this->unk_284 = 0x3F4;
} else {
- func_801518B0(globalCtx, 0x3F5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F5, &this->actor);
this->unk_284 = 0x3F5;
}
break;
@@ -491,18 +482,18 @@ void func_809C6F98(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (CURRENT_DAY != 3) {
if (!(this->unk_282 & 4)) {
this->unk_282 |= 4;
- func_801518B0(globalCtx, 0x3F2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F2, &this->actor);
this->unk_284 = 0x3F2;
} else {
- func_801518B0(globalCtx, 0x3F3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F3, &this->actor);
this->unk_284 = 0x3F3;
}
} else if (!(this->unk_282 & 4)) {
this->unk_282 |= 4;
- func_801518B0(globalCtx, 0x3F4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F4, &this->actor);
this->unk_284 = 0x3F4;
} else {
- func_801518B0(globalCtx, 0x3F5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F5, &this->actor);
this->unk_284 = 0x3F5;
}
break;
@@ -514,7 +505,7 @@ void func_809C72D8(EnSyatekiMan* this, GlobalContext* globalCtx) {
u16 sp26 = Text_GetFaceReaction(globalCtx, 0x30);
if (sp26 != 0) {
- func_801518B0(globalCtx, sp26, &this->actor);
+ Message_StartTextbox(globalCtx, sp26, &this->actor);
this->unk_284 = sp26;
} else {
func_809C6F98(this, globalCtx);
@@ -533,19 +524,19 @@ void func_809C7380(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (!CUR_UPG_VALUE(UPG_QUIVER)) {
play_sound(NA_SE_SY_ERROR);
if (CURRENT_DAY != 3) {
- func_801518B0(globalCtx, 0x3F9, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F9, &this->actor);
this->unk_284 = 0x3F9;
} else {
- func_801518B0(globalCtx, 0x3FA, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FA, &this->actor);
this->unk_284 = 0x3FA;
}
} else if (gSaveContext.rupees < 20) {
play_sound(NA_SE_SY_ERROR);
if (CURRENT_DAY != 3) {
- func_801518B0(globalCtx, 0x3FB, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FB, &this->actor);
this->unk_284 = 0x3FB;
} else {
- func_801518B0(globalCtx, 0x3FC, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FC, &this->actor);
this->unk_284 = 0x3FC;
}
@@ -560,10 +551,10 @@ void func_809C7380(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 2;
if (!(this->unk_282 & 0x10)) {
this->unk_282 |= 0x10;
- func_801518B0(globalCtx, 0x3FD, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FD, &this->actor);
this->unk_284 = 0x3FD;
} else {
- func_801518B0(globalCtx, 0x3FF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FF, &this->actor);
this->unk_284 = 0x3FF;
}
gSaveContext.weekEventReg[63] |= 1;
@@ -572,10 +563,10 @@ void func_809C7380(EnSyatekiMan* this, GlobalContext* globalCtx) {
} else {
func_8019F230();
if (CURRENT_DAY != 3) {
- func_801518B0(globalCtx, 0x3F7, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F7, &this->actor);
this->unk_284 = 0x3F7;
} else {
- func_801518B0(globalCtx, 0x3F8, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F8, &this->actor);
this->unk_284 = 0x3F8;
}
@@ -597,32 +588,32 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
case 0x3E9:
case 0x3EA:
case 0x3EB:
- func_801518B0(globalCtx, 0x3F6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F6, &this->actor);
this->unk_284 = 0x3F6;
break;
case 0x3EC:
- func_801518B0(globalCtx, 0x3ED, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3ED, &this->actor);
this->unk_284 = 0x3ED;
break;
case 0x3EE:
- func_801518B0(globalCtx, 0x3EF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3EF, &this->actor);
this->unk_284 = 0x3EF;
break;
case 0x3F0:
- func_801518B0(globalCtx, 0x3F1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F1, &this->actor);
this->unk_284 = 0x3F1;
break;
case 0x3F2:
- func_801518B0(globalCtx, 0x3F3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F3, &this->actor);
this->unk_284 = 0x3F3;
break;
case 0x3F4:
- func_801518B0(globalCtx, 0x3F5, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F5, &this->actor);
this->unk_284 = 0x3F5;
break;
@@ -630,14 +621,14 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
case 0x3FF:
if (this->unk_26A == 4) {
if (this->unk_284 == 0x3FD) {
- func_801518B0(globalCtx, 0x3FE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FE, &this->actor);
this->unk_284 = 0x3FE;
} else {
- func_801518B0(globalCtx, 0x400, &this->actor);
+ Message_StartTextbox(globalCtx, 0x400, &this->actor);
this->unk_284 = 0x400;
}
} else {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->actor.freezeTimer = 0;
this->unk_26A = 7;
@@ -650,7 +641,7 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
case 0x3FE:
case 0x400:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->actor.freezeTimer = 0;
this->unk_27E = 0;
@@ -669,7 +660,7 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 0;
this->actionFunc = func_809C72D8;
} else {
- func_801518B0(globalCtx, 0x402, &this->actor);
+ Message_StartTextbox(globalCtx, 0x402, &this->actor);
this->unk_284 = 0x402;
}
break;
@@ -682,14 +673,14 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 0;
this->actionFunc = func_809C72D8;
} else {
- func_801518B0(globalCtx, 0x404, &this->actor);
+ Message_StartTextbox(globalCtx, 0x404, &this->actor);
this->unk_284 = 0x404;
}
break;
case 0x402:
case 0x404:
- func_801518B0(globalCtx, 0x3F6, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3F6, &this->actor);
this->unk_284 = 0x3F6;
this->unk_26A = 4;
break;
@@ -697,7 +688,7 @@ void func_809C7620(EnSyatekiMan* this, GlobalContext* globalCtx) {
case 0x405:
case 0x406:
case 0x407:
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->actor.freezeTimer = 0;
gSaveContext.minigameState = 3;
@@ -784,14 +775,14 @@ void func_809C7C14(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if ((CURRENT_DAY == 3) && (gSaveContext.time > CLOCK_TIME(12, 00))) {
- func_801518B0(globalCtx, 0xA36, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA36, &this->actor);
this->unk_284 = 0xA36;
} else {
- func_801518B0(globalCtx, 0xA37, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA37, &this->actor);
this->unk_284 = 0xA37;
}
player->stateFlags1 &= ~0x20;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk_280 = 0;
this->unk_26A = 0;
this->actionFunc = func_809C6E30;
@@ -850,10 +841,10 @@ void func_809C7EB4(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->actionFunc = func_809C6810;
}
} else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, 0x408, &this->actor);
+ Message_StartTextbox(globalCtx, 0x408, &this->actor);
this->unk_284 = 0x408;
player->stateFlags1 &= ~0x20;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk_280 = 0;
this->unk_26A = 0;
this->actionFunc = func_809C7990;
@@ -870,10 +861,10 @@ void func_809C7FFC(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 2;
if (this->unk_282 != 2) {
this->unk_282 = 2;
- func_801518B0(globalCtx, 0xA2B, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2B, &this->actor);
this->unk_284 = 0xA2B;
} else {
- func_801518B0(globalCtx, 0xA2C, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA2C, &this->actor);
this->unk_284 = 0xA2C;
}
this->actionFunc = func_809C6E30;
@@ -983,12 +974,12 @@ void func_809C8488(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_274 = 0;
this->unk_276 = 0;
if (this->unk_270 <= 0) {
- if ((s32)((gSaveContext.roomInf[127][6] & 0xFFFF0000) >> 0x10) < this->unk_280) {
- gSaveContext.roomInf[127][6] = ((gSaveContext.roomInf[127][6]) & 0xFFFF) | ((u16)this->unk_280 << 0x10);
+ if ((s32)((gSaveContext.unk_EF4 & 0xFFFF0000) >> 0x10) < this->unk_280) {
+ gSaveContext.unk_EF4 = ((gSaveContext.unk_EF4) & 0xFFFF) | ((u16)this->unk_280 << 0x10);
}
this->unk_270 = 15;
if (this->unk_280 >= 0x848) {
- func_801518B0(globalCtx, 0xA34, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA34, &this->actor);
this->unk_284 = 0xA34;
this->unk_26A = 6;
} else if (this->unk_280 >= 0x7D0) {
@@ -1000,12 +991,12 @@ void func_809C8488(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->actionFunc = func_809C6848;
return;
}
- func_801518B0(globalCtx, 0xA35, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA35, &this->actor);
this->unk_284 = 0xA35;
this->unk_26A = 4;
this->unk_280 = 0;
} else {
- func_801518B0(globalCtx, 0xA32, &this->actor);
+ Message_StartTextbox(globalCtx, 0xA32, &this->actor);
this->unk_284 = 0xA32;
this->unk_26A = 6;
}
@@ -1056,10 +1047,10 @@ void func_809C8710(EnSyatekiMan* this, GlobalContext* globalCtx) {
if (func_809C6720(globalCtx, sp24)) {
if (this->unk_284 == 0x3FD) {
- func_801518B0(globalCtx, 0x3FE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x3FE, &this->actor);
this->unk_284 = 0x3FE;
} else {
- func_801518B0(globalCtx, 0x400, &this->actor);
+ Message_StartTextbox(globalCtx, 0x400, &this->actor);
this->unk_284 = 0x400;
}
this->unk_26A = 2;
@@ -1173,30 +1164,30 @@ void func_809C8BF0(EnSyatekiMan* this, GlobalContext* globalCtx) {
if ((this->unk_270 <= 0) && (globalCtx->interfaceCtx.unk_286 == 0)) {
Flags_SetAllTreasure(globalCtx, this->unk_280);
this->unk_270 = 15;
- if (((s32)(gSaveContext.roomInf[127][6] & 0xFFFF) < this->unk_280) || (this->unk_280 == 50)) {
- if ((s32)(gSaveContext.roomInf[127][6] & 0xFFFF) < this->unk_280) {
+ if (((s32)(gSaveContext.unk_EF4 & 0xFFFF) < this->unk_280) || (this->unk_280 == 50)) {
+ if ((s32)(gSaveContext.unk_EF4 & 0xFFFF) < this->unk_280) {
if (!(gSaveContext.weekEventReg[59] & 0x20)) {
- func_801518B0(globalCtx, 0x407, &this->actor);
+ Message_StartTextbox(globalCtx, 0x407, &this->actor);
this->unk_284 = 0x407;
} else if (this->unk_280 == 50) {
- func_801518B0(globalCtx, 0x405, &this->actor);
+ Message_StartTextbox(globalCtx, 0x405, &this->actor);
this->unk_284 = 0x405;
} else {
- func_801518B0(globalCtx, 0x407, &this->actor);
+ Message_StartTextbox(globalCtx, 0x407, &this->actor);
this->unk_284 = 0x407;
}
} else if (this->unk_280 == 50) {
- func_801518B0(globalCtx, 0x406, &this->actor);
+ Message_StartTextbox(globalCtx, 0x406, &this->actor);
this->unk_284 = 0x406;
}
- gSaveContext.roomInf[127][6] = (gSaveContext.roomInf[127][6] & 0xFFFF0000) | (this->unk_280 & 0xFFFF);
+ gSaveContext.unk_EF4 = (gSaveContext.unk_EF4 & 0xFFFF0000) | (this->unk_280 & 0xFFFF);
this->unk_26A = 6;
} else {
if (CURRENT_DAY != 3) {
- func_801518B0(globalCtx, 0x401, &this->actor);
+ Message_StartTextbox(globalCtx, 0x401, &this->actor);
this->unk_284 = 0x401;
} else {
- func_801518B0(globalCtx, 0x403, &this->actor);
+ Message_StartTextbox(globalCtx, 0x403, &this->actor);
this->unk_284 = 0x403;
}
this->unk_26A = 4;
@@ -1251,7 +1242,7 @@ s32 EnSyatekiMan_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
EnSyatekiMan* this = THIS;
if ((globalCtx->sceneNum == SCENE_SYATEKI_MIZU) && (limbIndex == 15)) {
- *dList = D_0600F2D0;
+ *dList = object_shn_DL_00F2D0;
}
if (limbIndex == 15) {
@@ -1276,22 +1267,22 @@ void EnSyatekiMan_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
}
void EnSyatekiMan_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static UNK_PTR D_809C94B8[] = {
- &D_06005AC8,
- &D_060062C8,
- &D_060062C8,
+ static TexturePtr D_809C94B8[] = {
+ object_shn_Tex_005AC8,
+ object_shn_Tex_0062C8,
+ object_shn_Tex_0062C8,
};
EnSyatekiMan* this = THIS;
s32 pad;
if (globalCtx->sceneNum == SCENE_SYATEKI_MIZU) {
- D_809C94B8[0] = &D_0600FB90;
- D_809C94B8[1] = &D_06010390;
- D_809C94B8[2] = &D_06010390;
+ D_809C94B8[0] = object_shn_Tex_00FB90;
+ D_809C94B8[1] = object_shn_Tex_010390;
+ D_809C94B8[2] = object_shn_Tex_010390;
} else {
- D_809C94B8[0] = &D_06005AC8;
- D_809C94B8[1] = &D_060062C8;
- D_809C94B8[2] = &D_060062C8;
+ D_809C94B8[0] = object_shn_Tex_005AC8;
+ D_809C94B8[1] = object_shn_Tex_0062C8;
+ D_809C94B8[2] = object_shn_Tex_0062C8;
}
OPEN_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
index 6360f0f39e..cffef2fc95 100644
--- a/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
+++ b/src/overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.c
@@ -6,7 +6,7 @@
#include "z_en_syateki_okuta.h"
-#define FLAGS 0x08000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
#define THIS ((EnSyatekiOkuta*)thisx)
diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
index 952861c835..6e53877a36 100644
--- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
+++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.c
@@ -5,8 +5,10 @@
*/
#include "z_en_syateki_wf.h"
+#include "overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h"
+#include "objects/object_wf/object_wf.h"
-#define FLAGS 0x08000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_8000000)
#define THIS ((EnSyatekiWf*)thisx)
@@ -15,43 +17,91 @@ void EnSyatekiWf_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnSyatekiWf_Update(Actor* thisx, GlobalContext* globalCtx);
void EnSyatekiWf_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80A201CC(EnSyatekiWf* this);
void func_80A20284(EnSyatekiWf* this, GlobalContext* globalCtx);
+void func_80A2030C(EnSyatekiWf* this);
void func_80A20320(EnSyatekiWf* this, GlobalContext* globalCtx);
+void func_80A20378(EnSyatekiWf* this);
void func_80A203DC(EnSyatekiWf* this, GlobalContext* globalCtx);
+void func_80A20670(EnSyatekiWf* this);
void func_80A206DC(EnSyatekiWf* this, GlobalContext* globalCtx);
+void func_80A20710(EnSyatekiWf* this);
void func_80A2075C(EnSyatekiWf* this, GlobalContext* globalCtx);
+void func_80A2079C(EnSyatekiWf* this);
void func_80A20800(EnSyatekiWf* this, GlobalContext* globalCtx);
void func_80A208F8(EnSyatekiWf* this, GlobalContext* globalCtx);
-#if 0
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80A20E74 = {
- { COLTYPE_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
- { 40, 60, 0, { 0, 0, 0 } },
-};
-
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_80A20E50[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 17, { { 800, 0, 0 }, 25 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80A20EA0 = {
- { COLTYPE_HIT5, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_JNTSPH, },
- 1, D_80A20E50, // sJntSphElementsInit,
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_HIT5,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
+ { 40, 60, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80A20EB0 = {
- { COLTYPE_HIT5, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_HIT5,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit,
+};
+
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_HIT5,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 15, 20, -15, { 0, 0, 0 } },
};
+static Vec3f D_80A20EDC = { 0.0f, 20.0f, 0.0f };
+
+static Vec3f D_80A20EE8 = { 0.0f, 0.0f, 0.0f };
+
const ActorInit En_Syateki_Wf_InitVars = {
ACTOR_EN_SYATEKI_WF,
ACTORCAT_ENEMY,
@@ -64,60 +114,372 @@ const ActorInit En_Syateki_Wf_InitVars = {
(ActorFunc)EnSyatekiWf_Draw,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80A20FBC[] = {
+static AnimationInfo sAnimations[] = {
+ { &object_wf_Anim_00A3CC, 2.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -1.0f },
+ { &object_wf_Anim_005700, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &object_wf_Anim_005700, 1.0f, 0.0f, 4.0f, ANIMMODE_ONCE, 1.0f },
+ { &object_wf_Anim_005700, 1.0f, 4.0f, 8.0f, ANIMMODE_ONCE, 1.0f },
+ { &object_wf_Anim_004A90, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
+ { &object_wf_Anim_009A50, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, 8.0f },
+ { &object_wf_Anim_0053D0, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -1.0f },
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE),
ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP),
};
-#endif
+static Vec3f D_80A20FC4 = { 0.0f, 0.5f, 0.0f };
-extern ColliderCylinderInit D_80A20E74;
-extern ColliderJntSphElementInit D_80A20E50[1];
-extern ColliderJntSphInit D_80A20EA0;
-extern ColliderCylinderInit D_80A20EB0;
-extern InitChainEntry D_80A20FBC[];
+static Vec3f D_80A20FD0 = { 1200.0f, 0.0f, 0.0f };
-extern UNK_TYPE D_0600A3CC;
+static TexturePtr sEyeTextures[] = {
+ object_wf_Tex_007AA8,
+ object_wf_Tex_0082A8,
+ object_wf_Tex_0084A8,
+ object_wf_Tex_0082A8,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/EnSyatekiWf_Init.s")
+void EnSyatekiWf_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnSyatekiWf* this = THIS;
+ Path* path;
+ EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
+ s32 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/EnSyatekiWf_Destroy.s")
+ path = syatekiMan->path;
+ while (path->unk2 != 2) {
+ path = &globalCtx->setupPathList[path->unk1];
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A200E0.s")
+ temp = 0;
+ while (temp < EN_SYATEKI_WF_GET_PARAM_FF00(&this->actor)) {
+ temp++;
+ path = &globalCtx->setupPathList[path->unk1];
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A201CC.s")
+ if (path == NULL) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20284.s")
+ this->unk_2A0 = Lib_SegmentedToVirtual(path->points);
+ this->unk_2A4 = 1;
+ this->unk_2A6 = path->count;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A2030C.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ this->unk_29C = 0;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
+ this->actor.focus.pos = this->actor.world.pos;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->actor.colChkInfo.health = 2;
+ this->actor.colChkInfo.cylRadius = 50;
+ this->actor.colChkInfo.cylHeight = 100;
+ this->eyeIndex = 0;
+ this->unk_2AC = 10.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20320.s")
+ Collider_InitCylinder(globalCtx, &this->unk_2B4);
+ Collider_SetCylinder(globalCtx, &this->unk_2B4, &this->actor, &sCylinderInit1);
+ Collider_InitCylinder(globalCtx, &this->unk_300);
+ Collider_SetCylinder(globalCtx, &this->unk_300, &this->actor, &sCylinderInit2);
+ Collider_InitJntSph(globalCtx, &this->unk_34C);
+ Collider_SetJntSph(globalCtx, &this->unk_34C, &this->actor, &sJntSphInit, &this->unk_36C);
+ this->unk_34C.elements->dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20378.s")
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wf_Skel_0095D0, &object_wf_Anim_00A3CC, this->jointTable,
+ this->morphTable, 22);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->actor.hintId = 0x4C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A203DC.s")
+ func_80A201CC(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20670.s")
+void EnSyatekiWf_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnSyatekiWf* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A206DC.s")
+ Collider_DestroyCylinder(globalCtx, &this->unk_2B4);
+ Collider_DestroyCylinder(globalCtx, &this->unk_300);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20710.s")
+void func_80A200E0(EnSyatekiWf* this) {
+ Vec3f sp24;
+ s16 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A2075C.s")
+ this->actor.world.pos.x = this->unk_2A0[0].x;
+ this->actor.world.pos.y = this->unk_2A0[0].y;
+ this->actor.world.pos.z = this->unk_2A0[0].z;
+ sp24.x = this->unk_2A0[this->unk_2A4].x;
+ sp24.y = this->unk_2A0[this->unk_2A4].y;
+ sp24.z = this->unk_2A0[this->unk_2A4].z;
+ temp = Math_Vec3f_Yaw(&this->actor.world.pos, &sp24);
+ this->actor.shape.rot.y = temp;
+ this->actor.world.rot.y = temp;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A2079C.s")
+void func_80A201CC(EnSyatekiWf* this) {
+ EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20800.s")
+ this->actor.speedXZ = 0.0f;
+ this->actor.world = this->actor.home;
+ this->actor.prevPos = this->actor.home.pos;
+ this->actor.shape.rot = this->actor.world.rot;
+ this->actor.colChkInfo.health = 2;
+ this->actor.draw = NULL;
+ this->unk_2A4 = 1;
+ this->unk_298 = 0;
+ syatekiMan->unk_276 &= ~(1 << EN_SYATEKI_WF_GET_PARAM_FF00(&this->actor));
+ this->actionFunc = func_80A20284;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20858.s")
+void func_80A20284(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ EnSyatekiMan* syatekiMan;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A208F8.s")
+ if (this->actor.parent != NULL) {
+ syatekiMan = (EnSyatekiMan*)this->actor.parent;
+ if ((syatekiMan->unk_26A == 1) && (this->unk_298 == 1)) {
+ func_80A200E0(this);
+ func_80A2030C(this);
+ } else if (syatekiMan->unk_276 & (1 << EN_SYATEKI_WF_GET_PARAM_FF00(&this->actor))) {
+ this->unk_298 = 1;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/EnSyatekiWf_Update.s")
+void func_80A2030C(EnSyatekiWf* this) {
+ this->actionFunc = func_80A20320;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20CF4.s")
+void func_80A20320(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ if (this->unk_29C >= 11) {
+ Actor_PlaySfxAtPos(this->actor.parent, NA_SE_EN_WOLFOS_APPEAR);
+ this->unk_29C = 0;
+ func_80A20378(this);
+ } else {
+ this->unk_29C++;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/func_80A20D10.s")
+void func_80A20378(EnSyatekiWf* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 1);
+ this->actor.speedXZ = 10.0f;
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ this->actor.draw = EnSyatekiWf_Draw;
+ this->actionFunc = func_80A203DC;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Syateki_Wf/EnSyatekiWf_Draw.s")
+void func_80A203DC(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ Vec3f sp54;
+ f32 sp50;
+ s16 temp_v0;
+ EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
+
+ if (syatekiMan->unk_26A != 1) {
+ func_80A201CC(this);
+ }
+
+ sp54.x = this->unk_2A0[this->unk_2A4].x;
+ sp54.y = this->unk_2A0[this->unk_2A4].y;
+ sp54.z = this->unk_2A0[this->unk_2A4].z;
+ temp_v0 = (this->actor.wallYaw - this->actor.world.rot.y) + 0x8000;
+
+ if (this->actor.bgCheckFlags & 1) {
+ if (this->actor.bgCheckFlags & 8) {
+ if ((ABS(temp_v0) < 0x1555) && (this->actor.wallPoly != this->actor.floorPoly)) {
+ func_80A20670(this);
+ return;
+ }
+ }
+
+ if (this->actor.bgCheckFlags & 4) {
+ this->actor.velocity.y = 2.0f;
+ }
+
+ sp50 = Math_Vec3f_DistXZ(&this->actor.world.pos, &sp54);
+ this->unk_2A8 = Math_Vec3f_Yaw(&this->actor.world.pos, &sp54);
+
+ if (sp50 > 15.0f) {
+ Math_SmoothStepToS(&this->actor.world.rot.y, this->unk_2A8, 5, 0x3000, 0x100);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ if (sp50 < 50.0f) {
+ if (this->actor.speedXZ > 3.0f) {
+ this->actor.speedXZ = this->actor.speedXZ - 0.5f;
+ } else {
+ this->actor.speedXZ = this->actor.speedXZ;
+ }
+ }
+ } else {
+ if (this->unk_2A4 < (this->unk_2A6 - 1)) {
+ if (this->unk_2A4 == EN_SYATEKI_WF_GET_PARAM_F0(&this->actor)) {
+ func_80A2079C(this);
+ }
+
+ this->unk_2A4++;
+ } else {
+ this->unk_298 = 0;
+ this->unk_2A4 = 1;
+ func_80A201CC(this);
+ }
+ }
+
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ Actor_SpawnFloorDustRing(globalCtx, &this->actor, &this->actor.world.pos, 10.0f, 3, 2.0f, 0, 0, 0);
+ }
+ }
+}
+
+void func_80A20670(EnSyatekiWf* this) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP);
+ this->actor.velocity.y = 20.0f;
+ this->actor.speedXZ = 5.0f;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 2);
+ this->actionFunc = func_80A206DC;
+}
+
+void func_80A206DC(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ if (this->actor.bgCheckFlags & 2) {
+ func_80A20710(this);
+ }
+}
+
+void func_80A20710(EnSyatekiWf* this) {
+ this->actor.speedXZ = 0.0f;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 3);
+ this->actionFunc = func_80A2075C;
+}
+
+void func_80A2075C(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ func_80A20378(this);
+ }
+}
+
+void func_80A2079C(EnSyatekiWf* this) {
+ this->unk_29A = 40;
+ this->actor.speedXZ = 0.0f;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 5);
+ this->actionFunc = func_80A20800;
+}
+
+void func_80A20800(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->unk_29A--;
+ if (this->unk_29A == 0) {
+ func_80A20378(this);
+ }
+ }
+}
+
+void func_80A20858(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ EnSyatekiMan* syatekiMan = (EnSyatekiMan*)this->actor.parent;
+
+ this->unk_298 = 0;
+ this->actor.speedXZ = 0.0f;
+ EffectSsExtra_Spawn(globalCtx, &this->actor.world.pos, &D_80A20EDC, &D_80A20EE8, 5, 2);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 6);
+ syatekiMan->unk_280 += 100;
+ this->actionFunc = func_80A208F8;
+}
+
+void func_80A208F8(EnSyatekiWf* this, GlobalContext* globalCtx) {
+ s32 pad;
+
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ func_80A201CC(this);
+ } else {
+ Vec3f sp68;
+ Vec3f sp5C = D_80A20FC4;
+ s32 i;
+
+ for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i--) {
+ sp68.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
+ sp68.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
+ sp68.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ func_800B3030(globalCtx, &sp68, &sp5C, &sp5C, 0x64, 0, 2);
+ }
+ }
+}
+
+void EnSyatekiWf_Update(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ EnSyatekiWf* this = THIS;
+
+ if (this->actionFunc != func_80A20284) {
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 32.0f, 30.0f, 60.0f, 5);
+ this->actionFunc(this, globalCtx);
+
+ if (this->actor.bgCheckFlags & 3) {
+ func_800BE3D0(&this->actor, this->actor.shape.rot.y, &this->actor.shape.rot);
+ } else {
+ Math_SmoothStepToS(&this->actor.shape.rot.x, 0, 1, 0x3E8, 0);
+ Math_SmoothStepToS(&this->actor.shape.rot.z, 0, 1, 0x3E8, 0);
+ }
+
+ if ((this->unk_2B4.base.acFlags & AC_HIT) || (this->unk_300.base.acFlags & AC_HIT) ||
+ (this->unk_34C.base.acFlags & AC_HIT)) {
+ this->unk_2B4.base.acFlags &= ~AC_HIT;
+ this->unk_300.base.acFlags &= ~AC_HIT;
+ this->unk_34C.base.acFlags &= ~AC_HIT;
+ this->actor.colChkInfo.health -= 2;
+ if (this->actor.colChkInfo.health == 0) {
+ func_801A3098(NA_BGM_GET_ITEM | 0x900);
+ func_80A20858(this, globalCtx);
+ } else {
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ EffectSsExtra_Spawn(globalCtx, &this->actor.world.pos, &D_80A20EDC, &D_80A20EE8, 3, 0);
+ }
+ }
+
+ Collider_UpdateCylinder(&this->actor, &this->unk_2B4);
+ if ((this->actionFunc != func_80A20284) && (this->actionFunc != func_80A208F8) && (this->actor.draw != NULL)) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->unk_300.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->unk_2B4.base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->unk_34C.base);
+ this->actor.focus.pos = this->actor.world.pos;
+ this->actor.focus.pos.y += 25.0f;
+ }
+
+ if (this->eyeIndex == 0) {
+ if ((Rand_ZeroOne() < 0.2f) && ((globalCtx->gameplayFrames & 3) == 0) && (this->actor.colorFilterTimer == 0)) {
+ this->eyeIndex++;
+ }
+ } else {
+ this->eyeIndex = (this->eyeIndex + 1) & 3;
+ }
+}
+
+s32 EnSyatekiWf_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ return false;
+}
+
+void EnSyatekiWf_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnSyatekiWf* this = THIS;
+ Vec3f sp18;
+
+ Collider_UpdateSpheres(limbIndex, &this->unk_34C);
+ if (limbIndex == 6) {
+ Matrix_MultiplyVector3fByState(&D_80A20FD0, &sp18);
+ this->unk_300.dim.pos.x = sp18.x;
+ this->unk_300.dim.pos.y = sp18.y;
+ this->unk_300.dim.pos.z = sp18.z;
+ }
+}
+
+void EnSyatekiWf_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnSyatekiWf* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeIndex]));
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnSyatekiWf_OverrideLimbDraw, EnSyatekiWf_PostLimbDraw, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h
index ff552ed19c..23977fa021 100644
--- a/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h
+++ b/src/overlays/actors/ovl_En_Syateki_Wf/z_en_syateki_wf.h
@@ -3,15 +3,34 @@
#include "global.h"
+#define EN_SYATEKI_WF_GET_PARAM_F0(thisx) (((thisx)->params & 0xF0) >> 4)
+#define EN_SYATEKI_WF_GET_PARAM_FF00(thisx) (((thisx)->params & 0xFF00) >> 8)
+
struct EnSyatekiWf;
typedef void (*EnSyatekiWfActionFunc)(struct EnSyatekiWf*, GlobalContext*);
typedef struct EnSyatekiWf {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x150];
- /* 0x0294 */ EnSyatekiWfActionFunc actionFunc;
- /* 0x0298 */ char unk_298[0x134];
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ SkelAnime skelAnime;
+ /* 0x188 */ Vec3s jointTable[22];
+ /* 0x20C */ Vec3s morphTable[22];
+ /* 0x290 */ UNK_TYPE1 unk_290[0x4];
+ /* 0x294 */ EnSyatekiWfActionFunc actionFunc;
+ /* 0x298 */ s16 unk_298;
+ /* 0x29A */ s16 unk_29A;
+ /* 0x29C */ s16 unk_29C;
+ /* 0x2A0 */ Vec3s* unk_2A0;
+ /* 0x2A4 */ s16 unk_2A4;
+ /* 0x2A6 */ s16 unk_2A6;
+ /* 0x2A8 */ s16 unk_2A8;
+ /* 0x2AC */ f32 unk_2AC;
+ /* 0x2B0 */ u8 eyeIndex;
+ /* 0x2B4 */ ColliderCylinder unk_2B4;
+ /* 0x300 */ ColliderCylinder unk_300;
+ /* 0x34C */ ColliderJntSph unk_34C;
+ /* 0x36C */ ColliderJntSphElement unk_36C;
+ /* 0x3AC */ UNK_TYPE1 unk_3AC[0x20];
} EnSyatekiWf; // size = 0x3CC
extern const ActorInit En_Syateki_Wf_InitVars;
diff --git a/src/overlays/actors/ovl_En_Tab/z_en_tab.c b/src/overlays/actors/ovl_En_Tab/z_en_tab.c
index d39849ee68..4dfaa44d09 100644
--- a/src/overlays/actors/ovl_En_Tab/z_en_tab.c
+++ b/src/overlays/actors/ovl_En_Tab/z_en_tab.c
@@ -6,7 +6,7 @@
#include "z_en_tab.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTab*)thisx)
diff --git a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c
index 2c4c50049c..5504dabdb7 100644
--- a/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c
+++ b/src/overlays/actors/ovl_En_Tag_Obj/z_en_tag_obj.c
@@ -47,7 +47,7 @@ const ActorInit En_Tag_Obj_InitVars = {
};
void EnTagObj_Init(Actor* thisx, GlobalContext* globalCtx) {
- EnTagObj* this = (EnTagObj*)thisx;
+ EnTagObj* this = THIS;
this->hasSpawnedSeahorse = 0;
}
@@ -56,7 +56,7 @@ void EnTagObj_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnTagObj_Update(Actor* thisx, GlobalContext* globalCtx) {
- EnTagObj* this = (EnTagObj*)thisx;
+ EnTagObj* this = THIS;
if (!this->hasSpawnedSeahorse) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_OT, this->actor.world.pos.x, this->actor.world.pos.y,
diff --git a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c
index f579719d25..35dc1ba303 100644
--- a/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c
+++ b/src/overlays/actors/ovl_En_Takaraya/z_en_takaraya.c
@@ -6,7 +6,7 @@
#include "z_en_takaraya.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTakaraya*)thisx)
diff --git a/src/overlays/actors/ovl_En_Talk/z_en_talk.c b/src/overlays/actors/ovl_En_Talk/z_en_talk.c
index fcfa36a4d6..4cf4ca407b 100644
--- a/src/overlays/actors/ovl_En_Talk/z_en_talk.c
+++ b/src/overlays/actors/ovl_En_Talk/z_en_talk.c
@@ -6,7 +6,7 @@
#include "z_en_talk.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnTalk*)thisx)
diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
index 931715a53d..a4822cad3d 100644
--- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
+++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.c
@@ -5,9 +5,8 @@
*/
#include "z_en_talk_gibud.h"
-#include "objects/object_rd/object_rd.h"
-#define FLAGS 0x00000415
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((EnTalkGibud*)thisx)
@@ -18,8 +17,8 @@ void EnTalkGibud_Draw(Actor* thisx, GlobalContext* globalCtx);
void EnTalkGibud_SetupIdle(EnTalkGibud* this);
void EnTalkGibud_Idle(EnTalkGibud* this, GlobalContext* globalCtx);
-void EnTalkGibud_SetupAttemptPlayerStun(EnTalkGibud* this);
-void EnTalkGibud_AttemptPlayerStun(EnTalkGibud* this, GlobalContext* globalCtx);
+void EnTalkGibud_SetupAttemptPlayerFreeze(EnTalkGibud* this);
+void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, GlobalContext* globalCtx);
void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this);
void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx);
void EnTalkGibud_SetupGrab(EnTalkGibud* this);
@@ -55,23 +54,6 @@ typedef struct {
/* 0xC */ s16 isBottledItem;
} EnTalkGibudRequestedItem;
-typedef enum {
- /* 0 */ EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK,
- /* 1 */ EN_TALK_GIBUD_ANIMATION_GRAB_END,
- /* 2 */ EN_TALK_GIBUD_ANIMATION_GRAB_START,
- /* 3 */ EN_TALK_GIBUD_ANIMATION_LOOK_AWAY,
- /* 4 */ EN_TALK_GIBUD_ANIMATION_CROUCH_WIPING_TEARS,
- /* 5 */ EN_TALK_GIBUD_ANIMATION_CROUCH_CRYING,
- /* 6 */ EN_TALK_GIBUD_ANIMATION_DEATH,
- /* 7 */ EN_TALK_GIBUD_ANIMATION_DAMAGE,
- /* 8 */ EN_TALK_GIBUD_ANIMATION_CROUCH_END,
- /* 9 */ EN_TALK_GIBUD_ANIMATION_IDLE,
- /* 10 */ EN_TALK_GIBUD_ANIMATION_WALK,
- /* 11 */ EN_TALK_GIBUD_ANIMATION_DANCE_SQUAT,
- /* 12 */ EN_TALK_GIBUD_ANIMATION_DANCE_PIROUETTE,
- /* 13 */ EN_TALK_GIBUD_ANIMATION_DANCE_CLAP,
-} EnTalkGibudAnimations;
-
typedef enum {
/* 0 */ EN_TALK_GIBUD_REQUESTED_ITEM_MET,
/* 1 */ EN_TALK_GIBUD_REQUESTED_ITEM_NOT_ENOUGH_AMMO,
@@ -91,6 +73,34 @@ typedef enum {
/* 9 */ EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK,
} EnTalkGibudRequestedItemIndex;
+typedef enum {
+ /* 0 */ EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK,
+ /* 1 */ EN_TALK_GIBUD_ANIMATION_GRAB_END,
+ /* 2 */ EN_TALK_GIBUD_ANIMATION_GRAB_START,
+ /* 3 */ EN_TALK_GIBUD_ANIMATION_LOOK_BACK,
+ /* 4 */ EN_TALK_GIBUD_ANIMATION_CROUCH_WIPING_TEARS,
+ /* 5 */ EN_TALK_GIBUD_ANIMATION_CROUCH_CRYING,
+ /* 6 */ EN_TALK_GIBUD_ANIMATION_DEATH,
+ /* 7 */ EN_TALK_GIBUD_ANIMATION_DAMAGE,
+ /* 8 */ EN_TALK_GIBUD_ANIMATION_CROUCH_END,
+ /* 9 */ EN_TALK_GIBUD_ANIMATION_IDLE,
+ /* 10 */ EN_TALK_GIBUD_ANIMATION_WALK,
+ /* 11 */ EN_TALK_GIBUD_ANIMATION_DANCE_SQUAT,
+ /* 12 */ EN_TALK_GIBUD_ANIMATION_DANCE_PIROUETTE,
+ /* 13 */ EN_TALK_GIBUD_ANIMATION_DANCE_CLAP,
+} EnTalkGibudAnimations;
+
+typedef enum {
+ /* 0 */ EN_TALK_GIBUD_TYPE_GIBDO,
+ /* 1 */ EN_TALK_GIBUD_TYPE_REDEAD,
+} EnTalkGibudType;
+
+typedef enum {
+ /* 0 */ EN_TALK_GIBUD_GRAB_START,
+ /* 1 */ EN_TALK_GIBUD_GRAB_ATTACK,
+ /* 2 */ EN_TALK_GIBUD_GRAB_RELEASE,
+} EnTalkGibudGrabState;
+
const ActorInit En_Talk_Gibud_InitVars = {
ACTOR_EN_TALK_GIBUD,
ACTORCAT_ENEMY,
@@ -103,14 +113,21 @@ const ActorInit En_Talk_Gibud_InitVars = {
(ActorFunc)EnTalkGibud_Draw,
};
-static ActorAnimationEntry sAnimations[] = {
- { &object_rd_Anim_006678, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_006B08, 0.5f, 0.0f, 0.0f, 3, 0.0f },
- { &object_rd_Anim_006EEC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0073A4, 0.0f, 0.0f, 0.0f, 2, -8.0f },
- { &object_rd_Anim_007BBC, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_0081A8, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &object_rd_Anim_009298, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_009900, 1.0f, 0.0f, 0.0f, 2, -8.0f },
- { &object_rd_Anim_00A450, 1.0f, 0.0f, 0.0f, 2, -8.0f }, { &object_rd_Anim_00ABE0, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &object_rd_Anim_0113EC, 0.4f, 0.0f, 0.0f, 1, -8.0f }, { &object_rd_Anim_01216C, 1.0f, 0.0f, 0.0f, 0, -8.0f },
- { &object_rd_Anim_0118D8, 1.0f, 0.0f, 0.0f, 0, -8.0f }, { &object_rd_Anim_011DB8, 1.0f, 0.0f, 0.0f, 0, -8.0f },
+static AnimationInfo sAnimations[] = {
+ { &gGibdoRedeadGrabAttackAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadGrabEndAnim, 0.5f, 0.0f, 0.0f, ANIMMODE_ONCE_INTERP, 0.0f },
+ { &gGibdoRedeadGrabStartAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadLookBackAnim, 0.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadWipingTearsAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadSobbingAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadDeathAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadDamageAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadStandUpAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
+ { &gGibdoRedeadIdleAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadWalkAnim, 0.4f, 0.0f, 0.0f, ANIMMODE_LOOP_INTERP, -8.0f },
+ { &gGibdoRedeadSquattingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadPirouetteAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
+ { &gGibdoRedeadClappingDanceAnim, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
};
static ColliderCylinderInit sCylinderInit = {
@@ -134,9 +151,9 @@ static ColliderCylinderInit sCylinderInit = {
};
typedef enum {
- /* 0x0 */ EN_TALK_GIBUD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all
- /* 0x1 */ EN_TALK_GIBUD_DMGEFF_STUN, // Stuns without applying any effect
- /* 0x2 */ EN_TALK_GIBUD_DMGEFF_FIRE_ARROW, // Damages and changes a Gibdo into a Redead
+ /* 0x0 */ EN_TALK_GIBUD_DMGEFF_NONE, // Does not interact with the Gibdo/Redead at all
+ /* 0x1 */ EN_TALK_GIBUD_DMGEFF_STUN, // Stuns without applying any effect
+ /* 0x2 */ EN_TALK_GIBUD_DMGEFF_FIRE_ARROW, // Damages, applies a fire effect, and changes a Gibdo into a Redead
/* 0x4 */ EN_TALK_GIBUD_DMGEFF_LIGHT_ARROW = 0x4, // Damages and applies a light effect
/* 0xC */ EN_TALK_GIBUD_DMGEFF_ZORA_MAGIC = 0xC, // Stuns and applies an electric effect
/* 0xD */ EN_TALK_GIBUD_DMGEFF_RECOIL, // Deals no damage, but displays hit mark and recoil animation
@@ -213,12 +230,14 @@ void EnTalkGibud_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 0;
this->actor.hintId = 0x2D;
this->actor.textId = 0;
+
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 28.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_0053E8, &object_rd_Anim_00ABE0, this->jointTable,
- this->morphTable, EN_TALK_GIBUD_LIMB_MAX);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGibdoSkel, &gGibdoRedeadIdleAnim, this->jointTable,
+ this->morphTable, GIBDO_LIMB_MAX);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
this->playerStunWaitTimer = 0;
this->grabState = EN_TALK_GIBUD_GRAB_START;
this->grabWaitTimer = 0;
@@ -239,6 +258,7 @@ void EnTalkGibud_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->requestedItemIndex < EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BLUE_POTION) {
this->requestedItemIndex = EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BLUE_POTION;
}
+
if (this->requestedItemIndex > EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK) {
this->requestedItemIndex = EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK;
}
@@ -246,6 +266,7 @@ void EnTalkGibud_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->switchFlag == 0xFF) {
this->switchFlag = -1;
}
+
if (this->switchFlag != -1 && Flags_GetSwitch(globalCtx, this->switchFlag)) {
Actor_MarkForDeath(&this->actor);
}
@@ -260,7 +281,7 @@ void EnTalkGibud_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnTalkGibud_SetupIdle(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
this->actionFunc = EnTalkGibud_Idle;
}
@@ -270,18 +291,19 @@ void EnTalkGibud_SetupIdle(EnTalkGibud* this) {
*/
void EnTalkGibud_Idle(EnTalkGibud* this, GlobalContext* globalCtx) {
if (this->actor.xzDistToPlayer <= 150.0f && func_800B715C(globalCtx)) {
- EnTalkGibud_SetupAttemptPlayerStun(this);
+ EnTalkGibud_SetupAttemptPlayerFreeze(this);
}
+
Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0);
Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0);
}
-void EnTalkGibud_SetupAttemptPlayerStun(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
- this->actionFunc = EnTalkGibud_AttemptPlayerStun;
+void EnTalkGibud_SetupAttemptPlayerFreeze(EnTalkGibud* this) {
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
+ this->actionFunc = EnTalkGibud_AttemptPlayerFreeze;
}
-void EnTalkGibud_AttemptPlayerStun(EnTalkGibud* this, GlobalContext* globalCtx) {
+void EnTalkGibud_AttemptPlayerFreeze(EnTalkGibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
s16 rot = this->actor.shape.rot.y + this->headRotation.y + this->upperBodyRotation.y;
s16 yaw = BINANG_SUB(this->actor.yawTowardsPlayer, rot);
@@ -293,17 +315,20 @@ void EnTalkGibud_AttemptPlayerStun(EnTalkGibud* this, GlobalContext* globalCtx)
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
EnTalkGibud_SetupWalkToPlayer(this);
}
+
EnTalkGibud_TurnTowardsPlayer(this, globalCtx);
}
void EnTalkGibud_SetupWalkToPlayer(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
this->actor.speedXZ = 0.4f;
- if (this->actionFunc == EnTalkGibud_AttemptPlayerStun) {
+
+ if (this->actionFunc == EnTalkGibud_AttemptPlayerFreeze) {
this->playerStunWaitTimer = 80;
} else {
this->playerStunWaitTimer = 20;
}
+
this->actionFunc = EnTalkGibud_WalkToPlayer;
}
@@ -313,12 +338,13 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xFA);
this->actor.world.rot = this->actor.shape.rot;
- Math_SmoothStepToS(&this->headRotation.y, 0, 1, 100, 0);
- Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 100, 0);
+ Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x64, 0);
+ Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x64, 0);
+
if (EnTalkGibud_PlayerInRangeWithCorrectState(this, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
- if (this->grabWaitTimer == 0 && this->actor.xzDistToPlayer <= 45.0f) {
+ if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
player->actor.freezeTimer = 0;
- if (gSaveContext.playerForm == PLAYER_FORM_GORON || gSaveContext.playerForm == PLAYER_FORM_DEKU) {
+ if ((gSaveContext.playerForm == PLAYER_FORM_GORON) || (gSaveContext.playerForm == PLAYER_FORM_DEKU)) {
// If the Gibdo/Redead tries to grab Goron or Deku Link, it will fail to
// do so. It will appear to take damage and shake its head side-to-side.
EnTalkGibud_SetupGrabFail(this);
@@ -336,46 +362,43 @@ void EnTalkGibud_WalkToPlayer(EnTalkGibud* this, GlobalContext* globalCtx) {
this->playerStunWaitTimer--;
}
}
- } else if (this->grabWaitTimer == 0 && this->actor.xzDistToPlayer <= 45.0f) {
+ } else if ((this->grabWaitTimer == 0) && (this->actor.xzDistToPlayer <= 45.0f)) {
EnTalkGibud_SetupWalkToHome(this);
} else if (EnTalkGibud_PlayerOutOfRange(this, globalCtx)) {
EnTalkGibud_SetupWalkToHome(this);
}
+
if (this->grabWaitTimer > 0) {
this->grabWaitTimer--;
}
if (Animation_OnFrame(&this->skelAnime, 10.0f) || Animation_OnFrame(&this->skelAnime, 22.0f)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_RIZA_WALK);
- } else if (!(globalCtx->gameplayFrames & 0x5F)) {
+ } else if (!(globalCtx->gameplayFrames & 95)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_CRY);
}
}
void EnTalkGibud_SetupGrab(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_START);
this->grabDamageTimer = 0;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->grabState = EN_TALK_GIBUD_GRAB_START;
this->actionFunc = EnTalkGibud_Grab;
}
void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) {
- // This function needs to have two different temps for Player to match,
- // but you don't have to necessarily use them both. This is just the most
- // likely scenario; they got an Actor* pointer in the first temp, then
- // casted it to Player* in the second temp.
- Actor* playerActor = &GET_PLAYER(globalCtx)->actor;
- Player* player = (Player*)playerActor;
+ Player* player2 = GET_PLAYER(globalCtx);
+ Player* player = player2;
s32 inPositionToAttack;
u16 damageSfxId;
switch (this->grabState) {
case EN_TALK_GIBUD_GRAB_START:
inPositionToAttack = EnTalkGibud_MoveToIdealGrabPositionAndRotation(this, globalCtx);
- if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && inPositionToAttack == true) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame) && (inPositionToAttack == true)) {
this->grabState = EN_TALK_GIBUD_GRAB_ATTACK;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_ATTACK);
}
break;
@@ -396,13 +419,14 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_ATTACK);
}
- if (!(player->stateFlags2 & 0x80) || player->unk_B62 != 0) {
- if (player->unk_B62 != 0 && (player->stateFlags2 & 0x80)) {
+ if (!(player->stateFlags2 & 0x80) || (player->unk_B62 != 0)) {
+ if ((player->unk_B62 != 0) && (player->stateFlags2 & 0x80)) {
player->stateFlags2 &= ~0x80;
player->unk_AE8 = 100;
}
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END);
- this->actor.flags |= 1;
+
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_GRAB_END);
+ this->actor.flags |= ACTOR_FLAG_1;
this->grabState = EN_TALK_GIBUD_GRAB_RELEASE;
this->grabDamageTimer = 0;
}
@@ -421,16 +445,17 @@ void EnTalkGibud_Grab(EnTalkGibud* this, GlobalContext* globalCtx) {
}
void EnTalkGibud_SetupGrabFail(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
- this->actionFunc = EnTalkGibud_GrabFail;
this->actor.speedXZ = -2.0f;
+ this->actionFunc = EnTalkGibud_GrabFail;
}
void EnTalkGibud_GrabFail(EnTalkGibud* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.15f;
}
+
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Math_SmoothStepToS(&this->headRotation.y, 0, 1, 0x12C, 0);
Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 0x12C, 0);
@@ -442,7 +467,7 @@ void EnTalkGibud_GrabFail(EnTalkGibud* this, GlobalContext* globalCtx) {
void EnTalkGibud_SetupTurnAwayAndShakeHead(EnTalkGibud* this) {
this->headShakeTimer = 0;
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
this->actionFunc = EnTalkGibud_TurnAwayAndShakeHead;
}
@@ -460,7 +485,7 @@ void EnTalkGibud_TurnAwayAndShakeHead(EnTalkGibud* this, GlobalContext* globalCt
}
void EnTalkGibud_SetupWalkToHome(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_WALK);
this->actor.speedXZ = 0.4f;
this->actionFunc = EnTalkGibud_WalkToHome;
}
@@ -474,6 +499,7 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, GlobalContext* globalCtx) {
} else {
this->actor.speedXZ = 0.0f;
}
+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 1, 200, 10);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->actor.world.rot.y == this->actor.home.rot.y) {
@@ -484,7 +510,7 @@ void EnTalkGibud_WalkToHome(EnTalkGibud* this, GlobalContext* globalCtx) {
this->actor.world.rot = this->actor.shape.rot;
}
if (EnTalkGibud_PlayerInRangeWithCorrectState(this, globalCtx)) {
- if (gSaveContext.playerForm != PLAYER_FORM_GORON && gSaveContext.playerForm != PLAYER_FORM_DEKU &&
+ if ((gSaveContext.playerForm != PLAYER_FORM_GORON) && (gSaveContext.playerForm != PLAYER_FORM_DEKU) &&
Actor_IsFacingPlayer(&this->actor, 0x38E3)) {
EnTalkGibud_SetupWalkToPlayer(this);
}
@@ -495,11 +521,13 @@ void EnTalkGibud_SetupStunned(EnTalkGibud* this) {
this->stunTimer = 10;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
+
if (this->effectTimer != 0) {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28);
} else {
Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x28);
}
+
this->actionFunc = EnTalkGibud_Stunned;
}
@@ -511,36 +539,39 @@ void EnTalkGibud_Stunned(EnTalkGibud* this, GlobalContext* globalCtx) {
EnTalkGibud_SetupDamage(this);
}
}
+
if (this->stunTimer != 0) {
this->stunTimer--;
}
}
void EnTalkGibud_SetupDamage(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DAMAGE);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DAMAGE);
this->stunTimer = 0;
this->grabWaitTimer = 0;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
- this->actionFunc = EnTalkGibud_Damage;
this->actor.speedXZ = -2.0f;
+ this->actionFunc = EnTalkGibud_Damage;
}
void EnTalkGibud_Damage(EnTalkGibud* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 0.0f) {
this->actor.speedXZ += 0.15f;
}
+
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->unk_3F7 = -1;
this->actor.world.rot.y = this->actor.shape.rot.y;
- if (this->effectTimer > 0 && this->effectType == 0 && this->type == EN_TALK_GIBUD_TYPE_GIBDO) {
+ if ((this->effectTimer > 0) && (this->effectType == 0) && (this->type == EN_TALK_GIBUD_TYPE_GIBDO)) {
this->actor.hintId = 0x2A;
- this->actor.flags &= ~(0x8 | 0x1);
- this->actor.flags |= (0x4 | 0x1);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_010B88, NULL, this->jointTable,
- this->morphTable, EN_TALK_GIBUD_LIMB_MAX);
+ this->actor.flags &= ~(ACTOR_FLAG_8 | ACTOR_FLAG_1);
+ this->actor.flags |= (ACTOR_FLAG_4 | ACTOR_FLAG_1);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gRedeadSkel, NULL, this->jointTable, this->morphTable,
+ GIBDO_LIMB_MAX);
this->type = EN_TALK_GIBUD_TYPE_REDEAD;
}
+
if (EnTalkGibud_PlayerOutOfRange(this, globalCtx)) {
EnTalkGibud_SetupWalkToHome(this);
} else {
@@ -550,8 +581,8 @@ void EnTalkGibud_Damage(EnTalkGibud* this, GlobalContext* globalCtx) {
}
void EnTalkGibud_SetupDead(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH);
- this->actor.flags &= ~1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_DEATH);
+ this->actor.flags &= ~ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_DEAD);
this->deathTimer = 0;
this->actionFunc = EnTalkGibud_Dead;
@@ -565,18 +596,19 @@ void EnTalkGibud_Dead(EnTalkGibud* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->upperBodyRotation.y, 0, 1, 250, 0);
this->deathTimer++;
}
- if (this->deathTimer == 20 && this->effectTimer > 0 && this->effectType == 0 &&
- this->type == EN_TALK_GIBUD_TYPE_GIBDO) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_rd_Skel_010B88, NULL, this->jointTable,
- this->morphTable, EN_TALK_GIBUD_LIMB_MAX);
+
+ if ((this->deathTimer == 20) && (this->effectTimer > 0) && (this->effectType == 0) &&
+ (this->type == EN_TALK_GIBUD_TYPE_GIBDO)) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gRedeadSkel, NULL, this->jointTable, this->morphTable,
+ GIBDO_LIMB_MAX);
this->type = EN_TALK_GIBUD_TYPE_REDEAD;
}
}
void EnTalkGibud_SetupRevive(EnTalkGibud* this) {
- Animation_Change(&this->skelAnime, &object_rd_Anim_009298, -1.0f, Animation_GetLastFrame(&object_rd_Anim_009298),
+ Animation_Change(&this->skelAnime, &gGibdoRedeadDeathAnim, -1.0f, Animation_GetLastFrame(&gGibdoRedeadDeathAnim),
0.0f, 2, -8.0f);
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_REVERSE);
this->deathTimer = 0;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -593,43 +625,52 @@ void EnTalkGibud_Revive(EnTalkGibud* this, GlobalContext* globalCtx) {
void EnTalkGibud_GetTextIdForRequestedItem(EnTalkGibud* this, GlobalContext* globalCtx) {
switch (this->requestedItemIndex) {
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BLUE_POTION:
- func_801518B0(globalCtx, 0x138C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x138C, &this->actor);
this->textId = 0x138C;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BEANS:
- func_801518B0(globalCtx, 0x138D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x138D, &this->actor);
this->textId = 0x138D;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_SPRING_WATER:
- func_801518B0(globalCtx, 0x138E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x138E, &this->actor);
this->textId = 0x138E;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_FISH:
- func_801518B0(globalCtx, 0x138F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x138F, &this->actor);
this->textId = 0x138F;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BUGS:
- func_801518B0(globalCtx, 0x1390, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1390, &this->actor);
this->textId = 0x1390;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_DEKU_NUTS:
- func_801518B0(globalCtx, 0x1391, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1391, &this->actor);
this->textId = 0x1391;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BOMBS:
- func_801518B0(globalCtx, 0x1392, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1392, &this->actor);
this->textId = 0x1392;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_HOT_SPRING_WATER:
- func_801518B0(globalCtx, 0x1393, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1393, &this->actor);
this->textId = 0x1393;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_BIG_POE:
- func_801518B0(globalCtx, 0x1394, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1394, &this->actor);
this->textId = 0x1394;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_INDEX_MILK:
- func_801518B0(globalCtx, 0x1395, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1395, &this->actor);
this->textId = 0x1395;
break;
}
@@ -641,6 +682,7 @@ void EnTalkGibud_GetNextTextBoxId(EnTalkGibud* this, GlobalContext* globalCtx) {
case 0x1388:
EnTalkGibud_GetTextIdForRequestedItem(this, globalCtx);
break;
+
case 0x138C:
case 0x138D:
case 0x138E:
@@ -652,7 +694,7 @@ void EnTalkGibud_GetNextTextBoxId(EnTalkGibud* this, GlobalContext* globalCtx) {
case 0x1394:
case 0x1395:
// Prompts the player to choose an item
- func_801518B0(globalCtx, 0xFF, &this->actor);
+ Message_StartTextbox(globalCtx, 0xFF, &this->actor);
this->textId = 0xFF;
break;
}
@@ -670,7 +712,7 @@ s32 EnTalkGibud_PresentedItemMatchesRequest(EnTalkGibud* this, GlobalContext* gl
return EN_TALK_GIBUD_REQUESTED_ITEM_NOT_ENOUGH_AMMO;
}
}
- if (func_80114F2C(requestedItem->item)) {
+ if (Interface_HasItemInBottle(requestedItem->item)) {
return EN_TALK_GIBUD_REQUESTED_ITEM_MET;
}
}
@@ -692,20 +734,23 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, GlobalContext* globalCtx)
player->actor.textId = 0x138A;
this->textId = 0x138A;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_NOT_ENOUGH_AMMO:
player->actor.textId = 0x138B;
this->textId = 0x138B;
break;
+
case EN_TALK_GIBUD_REQUESTED_ITEM_NOT_MET:
player->actor.textId = 0x1389;
this->textId = 0x1389;
break;
+
default:
break;
}
func_801477B4(globalCtx);
} else if (this->itemActionParam < PLAYER_AP_NONE) {
- func_801518B0(globalCtx, 0x1389, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1389, &this->actor);
this->textId = 0x1389;
}
}
@@ -714,7 +759,7 @@ void EnTalkGibud_CheckPresentedItem(EnTalkGibud* this, GlobalContext* globalCtx)
void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) {
this->isTalking = false;
if (this->actionFunc != EnTalkGibud_Talk) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
}
this->actionFunc = EnTalkGibud_PassiveIdle;
}
@@ -726,7 +771,7 @@ void EnTalkGibud_SetupPassiveIdle(EnTalkGibud* this) {
void EnTalkGibud_PassiveIdle(EnTalkGibud* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->isTalking = true;
- func_801518B0(globalCtx, 0x1388, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1388, &this->actor);
this->textId = 0x1388;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_REDEAD_AIM);
EnTalkGibud_SetupTalk(this);
@@ -762,9 +807,11 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) {
case 12:
case 13:
break;
+
case 5:
EnTalkGibud_GetNextTextBoxId(this, globalCtx);
break;
+
case 6:
if (func_80147624(globalCtx)) {
if (this->textId == 0x138A) {
@@ -777,13 +824,14 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) {
}
player->stateFlags1 |= 0x20;
player->stateFlags1 |= 0x20000000;
- this->actor.flags |= 0x100000;
+ this->actor.flags |= ACTOR_FLAG_100000;
EnTalkGibud_SetupDisappear(this);
} else {
EnTalkGibud_SetupPassiveIdle(this);
}
}
break;
+
case 16:
EnTalkGibud_CheckPresentedItem(this, globalCtx);
break;
@@ -792,8 +840,8 @@ void EnTalkGibud_Talk(EnTalkGibud* this, GlobalContext* globalCtx) {
}
void EnTalkGibud_SetupDisappear(EnTalkGibud* this) {
- Actor_ChangeAnimation(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
- this->actor.flags &= ~1;
+ Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimations, EN_TALK_GIBUD_ANIMATION_IDLE);
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->disappearanceTimer = 40;
this->actionFunc = EnTalkGibud_Disappear;
}
@@ -844,8 +892,9 @@ void EnTalkGibud_FacePlayerWhenTalking(EnTalkGibud* this, GlobalContext* globalC
s32 EnTalkGibud_PlayerInRangeWithCorrectState(EnTalkGibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) && !(player->stateFlags1 & 0x2C6080) &&
- !(player->stateFlags2 & 0x4080)) {
+ if ((Actor_DistanceToPoint(&player->actor, &this->actor.home.pos) < 150.0f) &&
+ !(player->stateFlags1 & (0x200000 | 0x80000 | 0x40000 | 0x4000 | 0x2000 | 0x80)) &&
+ !(player->stateFlags2 & (0x4000 | 0x80))) {
return true;
}
@@ -868,20 +917,20 @@ s32 EnTalkGibud_PlayerOutOfRange(EnTalkGibud* this, GlobalContext* globalCtx) {
}
void EnTalkGibud_CheckForGibdoMask(EnTalkGibud* this, GlobalContext* globalCtx) {
- if (this->actionFunc != EnTalkGibud_Grab && this->actionFunc != EnTalkGibud_Dead &&
- this->actionFunc != EnTalkGibud_Disappear && this->actionFunc != EnTalkGibud_Revive &&
- this->actionFunc != EnTalkGibud_Damage && this->actionFunc != EnTalkGibud_Talk) {
+ if ((this->actionFunc != EnTalkGibud_Grab) && (this->actionFunc != EnTalkGibud_Dead) &&
+ (this->actionFunc != EnTalkGibud_Disappear) && (this->actionFunc != EnTalkGibud_Revive) &&
+ (this->actionFunc != EnTalkGibud_Damage) && (this->actionFunc != EnTalkGibud_Talk)) {
if (this->actionFunc != EnTalkGibud_PassiveIdle) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_GIBDO) {
- this->actor.flags &= ~(0x4 | 0x1);
- this->actor.flags |= (0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_4 | ACTOR_FLAG_1);
+ this->actor.flags |= (ACTOR_FLAG_8 | ACTOR_FLAG_1);
this->actor.hintId = 0xFF;
this->actor.textId = 0;
EnTalkGibud_SetupPassiveIdle(this);
}
} else if (Player_GetMask(globalCtx) != PLAYER_MASK_GIBDO) {
- this->actor.flags &= ~(0x8 | 0x1);
- this->actor.flags |= (0x4 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_8 | ACTOR_FLAG_1);
+ this->actor.flags |= (ACTOR_FLAG_4 | ACTOR_FLAG_1);
if (this->type == EN_TALK_GIBUD_TYPE_REDEAD) {
this->actor.hintId = 0x2A;
} else {
@@ -934,7 +983,8 @@ s32 EnTalkGibud_MoveToIdealGrabPositionAndRotation(EnTalkGibud* this, GlobalCont
distanceFromTargetYOffset = Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f);
}
- if (distanceFromTargetPos == 0.0f && ABS_ALT(distanceFromTargetAngle) < 100 && distanceFromTargetYOffset == 0.0f) {
+ if ((distanceFromTargetPos == 0.0f) && (ABS_ALT(distanceFromTargetAngle) < 100) &&
+ (distanceFromTargetYOffset == 0.0f)) {
return true;
}
@@ -948,13 +998,13 @@ void EnTalkGibud_PlayAnimation(EnTalkGibud* this, GlobalContext* globalCtx) {
}
void EnTalkGibud_MoveWithGravity(EnTalkGibud* this, GlobalContext* globalCtx) {
- if (this->actionFunc == EnTalkGibud_WalkToPlayer || this->actionFunc == EnTalkGibud_WalkToHome ||
- this->actionFunc == EnTalkGibud_Damage) {
+ if ((this->actionFunc == EnTalkGibud_WalkToPlayer) || (this->actionFunc == EnTalkGibud_WalkToHome) ||
+ (this->actionFunc == EnTalkGibud_Damage)) {
Actor_MoveWithGravity(&this->actor);
}
}
-void EnTalkGibud_CheckDamageEffect(EnTalkGibud* this, GlobalContext* globalCtx) {
+void EnTalkGibud_UpdateDamage(EnTalkGibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (this->collider.base.acFlags & AC_HIT) {
@@ -1026,18 +1076,18 @@ void EnTalkGibud_CheckDamageEffect(EnTalkGibud* this, GlobalContext* globalCtx)
}
}
-void EnTalkGibud_CheckCollision(EnTalkGibud* this, GlobalContext* globalCtx) {
+void EnTalkGibud_UpdateCollision(EnTalkGibud* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if (this->actionFunc != EnTalkGibud_Dead && this->actionFunc != EnTalkGibud_Disappear &&
- this->actionFunc != EnTalkGibud_Revive &&
- (this->actionFunc != EnTalkGibud_Grab || this->grabState == EN_TALK_GIBUD_GRAB_RELEASE)) {
+ if ((this->actionFunc != EnTalkGibud_Dead) && (this->actionFunc != EnTalkGibud_Disappear) &&
+ (this->actionFunc != EnTalkGibud_Revive) &&
+ ((this->actionFunc != EnTalkGibud_Grab) || (this->grabState == EN_TALK_GIBUD_GRAB_RELEASE))) {
if (this->isTalking != true) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
- if ((this->actionFunc != EnTalkGibud_Damage ||
- (player->unk_ADC != 0 && player->unk_ADD != this->unk_3F7)) &&
- (this->actionFunc != EnTalkGibud_Stunned || this->stunTimer == 0)) {
+ if (((this->actionFunc != EnTalkGibud_Damage) ||
+ ((player->unk_ADC != 0) && (player->unk_ADD != this->unk_3F7))) &&
+ ((this->actionFunc != EnTalkGibud_Stunned) || (this->stunTimer == 0))) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@@ -1070,6 +1120,7 @@ void EnTalkGibud_UpdateEffect(EnTalkGibud* this, GlobalContext* globalCtx) {
if (this->effectTimer > 0) {
this->effectTimer--;
}
+
if (this->effectTimer < 20) {
Math_SmoothStepToF(&this->effectScale, 0.0f, 0.5f, 0.03f, 0.0f);
this->effectAlpha = this->effectTimer * 0.05f;
@@ -1082,13 +1133,16 @@ void EnTalkGibud_Update(Actor* thisx, GlobalContext* globalCtx) {
EnTalkGibud* this = THIS;
EnTalkGibud_CheckForGibdoMask(this, globalCtx);
- EnTalkGibud_CheckDamageEffect(this, globalCtx);
+ EnTalkGibud_UpdateDamage(this, globalCtx);
+
this->actionFunc(this, globalCtx);
+
EnTalkGibud_PlayAnimation(this, globalCtx);
EnTalkGibud_MoveWithGravity(this, globalCtx);
- EnTalkGibud_CheckCollision(this, globalCtx);
+ EnTalkGibud_UpdateCollision(this, globalCtx);
EnTalkGibud_MoveGrabbedPlayerAwayFromWall(this, globalCtx);
EnTalkGibud_UpdateEffect(this, globalCtx);
+
this->actor.focus.pos = this->actor.world.pos;
this->actor.focus.pos.y += 50.0f;
}
@@ -1097,9 +1151,9 @@ s32 EnTalkGibud_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx**
Actor* thisx, Gfx** gfx) {
EnTalkGibud* this = THIS;
- if (limbIndex == EN_TALK_GIBUD_LIMB_UPPER_BODY_ROOT) {
+ if (limbIndex == GIBDO_LIMB_UPPER_BODY_ROOT) {
rot->y += this->upperBodyRotation.y;
- } else if (limbIndex == EN_TALK_GIBUD_LIMB_HEAD_ROOT) {
+ } else if (limbIndex == GIBDO_LIMB_HEAD_ROOT) {
rot->y += this->headRotation.y;
}
@@ -1111,14 +1165,13 @@ void EnTalkGibud_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
EnTalkGibud* this = THIS;
if ((this->effectTimer != 0) &&
- ((limbIndex == EN_TALK_GIBUD_LIMB_LEFT_THIGH) || (limbIndex == EN_TALK_GIBUD_LIMB_LEFT_LOWER_LEG) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_LEFT_FOOT) || (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_THIGH) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_LOWER_LEG) || (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_FOOT) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_TORSO) || (limbIndex == EN_TALK_GIBUD_LIMB_LEFT_SHOULDER_AND_UPPER_ARM) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_LEFT_FOREARM) || (limbIndex == EN_TALK_GIBUD_LIMB_LEFT_HAND) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_FOREARM) || (limbIndex == EN_TALK_GIBUD_LIMB_RIGHT_HAND) ||
- (limbIndex == EN_TALK_GIBUD_LIMB_HEAD) || (limbIndex == EN_TALK_GIBUD_LIMB_PELVIS))) {
+ ((limbIndex == GIBDO_LIMB_LEFT_THIGH) || (limbIndex == GIBDO_LIMB_LEFT_SHIN) ||
+ (limbIndex == GIBDO_LIMB_LEFT_FOOT) || (limbIndex == GIBDO_LIMB_RIGHT_THIGH) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_SHIN) || (limbIndex == GIBDO_LIMB_RIGHT_FOOT) ||
+ (limbIndex == GIBDO_LIMB_TORSO) || (limbIndex == GIBDO_LIMB_LEFT_SHOULDER_AND_UPPER_ARM) ||
+ (limbIndex == GIBDO_LIMB_LEFT_FOREARM) || (limbIndex == GIBDO_LIMB_LEFT_HAND) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) || (limbIndex == GIBDO_LIMB_RIGHT_FOREARM) ||
+ (limbIndex == GIBDO_LIMB_RIGHT_HAND) || (limbIndex == GIBDO_LIMB_HEAD) || (limbIndex == GIBDO_LIMB_PELVIS))) {
Matrix_GetStateTranslation(&this->limbPos[this->limbIndex]);
this->limbIndex++;
}
@@ -1149,6 +1202,7 @@ void EnTalkGibud_Draw(Actor* thisx, GlobalContext* globalCtx) {
this->skelAnime.dListCount, EnTalkGibud_OverrideLimbDraw,
EnTalkGibud_PostLimbDraw, &this->actor, POLY_XLU_DISP);
}
+
if (this->effectTimer > 0) {
func_800BE680(globalCtx, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->effectScale, 0.5f,
this->effectAlpha, this->effectType);
diff --git a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h
index 2c154ea89b..ae3afab497 100644
--- a/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h
+++ b/src/overlays/actors/ovl_En_Talk_Gibud/z_en_talk_gibud.h
@@ -2,51 +2,11 @@
#define Z_EN_TALK_GIBUD_H
#include "global.h"
+#include "objects/object_rd/object_rd.h"
#define EN_TALK_GIBUD_REQUESTED_ITEM_INDEX(thisx) ((thisx)->params & 0xF)
#define EN_TALK_GIBUD_SWITCH_FLAG(thisx) (((thisx)->params & 0xFF0) >> 4)
-typedef enum {
- /* 0 */ EN_TALK_GIBUD_TYPE_GIBDO,
- /* 1 */ EN_TALK_GIBUD_TYPE_REDEAD,
-} EnTalkGibudType;
-
-typedef enum {
- /* 0 */ EN_TALK_GIBUD_GRAB_START,
- /* 1 */ EN_TALK_GIBUD_GRAB_ATTACK,
- /* 2 */ EN_TALK_GIBUD_GRAB_RELEASE,
-} EnTalkGibudGrabState;
-
-typedef enum {
- /* 0 */ EN_TALK_GIBUD_LIMB_NONE,
- /* 1 */ EN_TALK_GIBUD_LIMB_ROOT, // Root of Left Leg Root, Right Leg Root, Upper Body Root, and Pelvis
- /* 2 */ EN_TALK_GIBUD_LIMB_LEFT_LEG_ROOT,
- /* 3 */ EN_TALK_GIBUD_LIMB_LEFT_THIGH,
- /* 4 */ EN_TALK_GIBUD_LIMB_LEFT_LOWER_LEG,
- /* 5 */ EN_TALK_GIBUD_LIMB_LEFT_FOOT_ROOT,
- /* 6 */ EN_TALK_GIBUD_LIMB_LEFT_FOOT,
- /* 7 */ EN_TALK_GIBUD_LIMB_RIGHT_LEG_ROOT,
- /* 8 */ EN_TALK_GIBUD_LIMB_RIGHT_THIGH,
- /* 9 */ EN_TALK_GIBUD_LIMB_RIGHT_LOWER_LEG,
- /* 10 */ EN_TALK_GIBUD_LIMB_RIGHT_FOOT_ROOT,
- /* 11 */ EN_TALK_GIBUD_LIMB_RIGHT_FOOT,
- /* 12 */ EN_TALK_GIBUD_LIMB_UPPER_BODY_ROOT,
- /* 13 */ EN_TALK_GIBUD_LIMB_UPPER_BODY, // Root of Torso
- /* 14 */ EN_TALK_GIBUD_LIMB_TORSO, // Root of Left Arm Root, Right Arm Root, and Head Root
- /* 15 */ EN_TALK_GIBUD_LIMB_LEFT_ARM_ROOT,
- /* 16 */ EN_TALK_GIBUD_LIMB_LEFT_SHOULDER_AND_UPPER_ARM,
- /* 17 */ EN_TALK_GIBUD_LIMB_LEFT_FOREARM,
- /* 18 */ EN_TALK_GIBUD_LIMB_LEFT_HAND,
- /* 19 */ EN_TALK_GIBUD_LIMB_RIGHT_ARM_ROOT,
- /* 20 */ EN_TALK_GIBUD_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM,
- /* 21 */ EN_TALK_GIBUD_LIMB_RIGHT_FOREARM,
- /* 22 */ EN_TALK_GIBUD_LIMB_RIGHT_HAND,
- /* 23 */ EN_TALK_GIBUD_LIMB_HEAD_ROOT,
- /* 24 */ EN_TALK_GIBUD_LIMB_HEAD,
- /* 25 */ EN_TALK_GIBUD_LIMB_PELVIS,
- /* 26 */ EN_TALK_GIBUD_LIMB_MAX,
-} EnTalkGibudLimbs;
-
struct EnTalkGibud;
typedef void (*EnTalkGibudActionFunc)(struct EnTalkGibud*, GlobalContext*);
@@ -63,19 +23,19 @@ typedef struct EnTalkGibud {
/* 0x298 */ s32 switchFlag;
/* 0x29C */ f32 effectAlpha;
/* 0x2A0 */ f32 effectScale;
- /* 0x2A4 */ Vec3s jointTable[EN_TALK_GIBUD_LIMB_MAX];
- /* 0x340 */ Vec3s morphTable[EN_TALK_GIBUD_LIMB_MAX];
+ /* 0x2A4 */ Vec3s jointTable[GIBDO_LIMB_MAX];
+ /* 0x340 */ Vec3s morphTable[GIBDO_LIMB_MAX];
/* 0x3DC */ s16 textId;
/* 0x3DE */ Vec3s headRotation;
/* 0x3E4 */ Vec3s upperBodyRotation;
/* 0x3EA */ union {
- s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero
- s16 grabDamageTimer;
- s16 headShakeTimer;
- s16 stunTimer;
- s16 deathTimer;
- s16 disappearanceTimer;
- };
+ s16 playerStunWaitTimer; // Cannot stun the player if this is non-zero
+ s16 grabDamageTimer;
+ s16 headShakeTimer;
+ s16 stunTimer;
+ s16 deathTimer;
+ s16 disappearanceTimer;
+ };
/* 0x3EC */ s16 grabState;
/* 0x3EE */ s16 grabWaitTimer; // Cannot grab the player if this is non-zero
/* 0x3F0 */ s16 effectTimer;
diff --git a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
index 1b2e044728..5985e77f98 100644
--- a/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
+++ b/src/overlays/actors/ovl_En_Tanron1/z_en_tanron1.c
@@ -6,7 +6,7 @@
#include "z_en_tanron1.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTanron1*)thisx)
diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
index be89681f10..e391669e58 100644
--- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
+++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.c
@@ -5,8 +5,11 @@
*/
#include "z_en_tanron2.h"
+#include "overlays/actors/ovl_Boss_04/z_boss_04.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_boss04/object_boss04.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTanron2*)thisx)
@@ -15,12 +18,18 @@ void EnTanron2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnTanron2_Update(Actor* thisx, GlobalContext* globalCtx);
void EnTanron2_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80BB69C0(EnTanron2* this);
void func_80BB69FC(EnTanron2* this, GlobalContext* globalCtx);
void func_80BB6BD8(EnTanron2* this, GlobalContext* globalCtx);
+void func_80BB6F64(EnTanron2* this);
void func_80BB6F78(EnTanron2* this, GlobalContext* globalCtx);
void func_80BB7408(EnTanron2* this, GlobalContext* globalCtx);
+void func_80BB7B90(Actor* thisx, GlobalContext* globalCtx);
+
+Boss04* D_80BB8450;
+f32 D_80BB8454;
+EnTanron2* D_80BB8458[82];
-#if 0
const ActorInit En_Tanron2_InitVars = {
ACTOR_EN_TANRON2,
ACTORCAT_BOSS,
@@ -33,8 +42,7 @@ const ActorInit En_Tanron2_InitVars = {
(ActorFunc)EnTanron2_Draw,
};
-// static DamageTable sDamageTable = {
-static DamageTable D_80BB8170 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(1, 0xF),
/* Deku Stick */ DMG_ENTRY(1, 0xF),
/* Horse trample */ DMG_ENTRY(0, 0x0),
@@ -69,54 +77,607 @@ static DamageTable D_80BB8170 = {
/* Powder Keg */ DMG_ENTRY(1, 0xF),
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BB8190 = {
- { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x04 }, { 0xFFFFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_HIT3,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK3,
+ { 0xF7CFFFFF, 0x00, 0x04 },
+ { 0xFFFFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 30, 50, -25, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BB81BC = {
- { COLTYPE_HIT3, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK3, { 0xF7CFFFFF, 0x00, 0x04 }, { 0xF7FFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_ON | BUMP_HOOKABLE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_HIT3,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK3,
+ { 0xF7CFFFFF, 0x00, 0x04 },
+ { 0xF7FFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_ON | BUMP_HOOKABLE,
+ OCELEM_ON,
+ },
{ 22, 42, -21, { 0, 0, 0 } },
};
-#endif
+Color_RGBA8 D_80BB81E8 = { 255, 255, 255, 255 };
+Color_RGBA8 D_80BB81EC = { 255, 100, 100, 255 };
-extern DamageTable D_80BB8170;
-extern ColliderCylinderInit D_80BB8190;
-extern ColliderCylinderInit D_80BB81BC;
+void EnTanron2_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnTanron2* this = THIS;
-extern UNK_TYPE D_06003450;
+ D_80BB8450 = (Boss04*)this->actor.parent;
+ this->actor.flags &= ~ACTOR_FLAG_1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/EnTanron2_Init.s")
+ if (this->actor.params == 100) {
+ this->actor.update = func_80BB7B90;
+ func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, 5);
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/EnTanron2_Destroy.s")
+ this->actor.flags |= ACTOR_FLAG_200;
+ Actor_SetScale(&this->actor, 1.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB69C0.s")
+ this->actor.draw = NULL;
+ this->actor.colChkInfo.health = 1;
+ this->actor.colChkInfo.damageTable = &sDamageTable;
+ this->actor.targetMode = 5;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB69FC.s")
+ Collider_InitAndSetCylinder(globalCtx, &this->collider1, &this->actor, &sCylinderInit1);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider2, &this->actor, &sCylinderInit2);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB6B80.s")
+ if ((KREG(64) != 0) || (gSaveContext.eventInf[6] & 1)) {
+ func_80BB69C0(this);
+ } else {
+ func_80BB6F64(this);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB6BD8.s")
+ this->unk_14A = Rand_ZeroFloat(0x10000);
+ this->unk_14C = Rand_ZeroFloat(800.0f) + 1400.0f;
+ if (Rand_ZeroOne() < 0.5f) {
+ this->unk_14C = -this->unk_14C;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB6F64.s")
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 35.0f, 60.0f, 60.0f, 4);
+ this->actor.floorHeight += 20.0f;
+ this->unk_148 = Rand_ZeroFloat(32.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB6F78.s")
+void EnTanron2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB71C8.s")
+void func_80BB69C0(EnTanron2* this) {
+ this->actionFunc = func_80BB69FC;
+ this->unk_160 = 0.0f;
+ this->unk_15C = 0.0f;
+ this->collider1.dim.radius = 25;
+ this->collider1.dim.height = 46;
+ this->collider1.dim.yShift = -23;
+ this->unk_158 = 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB7398.s")
+void func_80BB69FC(EnTanron2* this, GlobalContext* globalCtx) {
+ f32 sp34;
+ f32 sp30;
+ f32 sp2C;
+ Vec3f* temp_s1 = &D_80BB8450->unk_2E4[this->actor.params];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB7408.s")
+ if (this->unk_15C == 1.0f) {
+ Math_Vec3f_Copy(&this->actor.world.pos, temp_s1);
+ } else {
+ sp34 = Math_SmoothStepToF(&this->actor.world.pos.x, temp_s1->x, this->unk_15C, this->unk_160, 0.0f);
+ sp30 = Math_SmoothStepToF(&this->actor.world.pos.y, temp_s1->y, this->unk_15C, this->unk_160, 0.0f);
+ sp2C = Math_SmoothStepToF(&this->actor.world.pos.z, temp_s1->z, this->unk_15C, this->unk_160, 0.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB7578.s")
+ if ((this->unk_158 == 0) && ((sp34 + sp30 + sp2C) < 2.0f)) {
+ this->unk_158 = 1;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_B_SLIME_EAT);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/EnTanron2_Update.s")
+ Math_ApproachF(&this->unk_15C, 1.0f, 1.0f, 0.02f);
+ Math_ApproachF(&this->unk_160, 20.0f, 1.0f, 1.0f);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/func_80BB7B90.s")
+ Math_ApproachF(&this->actor.scale.x, 1.0f, 0.1f, 0.2f);
+ Math_ApproachF(&this->actor.scale.y, 1.0f, 0.1f, 0.2f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Tanron2/EnTanron2_Draw.s")
+void func_80BB6B80(EnTanron2* this) {
+ this->actionFunc = func_80BB6BD8;
+ this->actor.speedXZ = 0.0f;
+ this->actor.velocity.z = 0.0f;
+ this->actor.velocity.y = 0.0f;
+ this->actor.velocity.x = 0.0f;
+ this->unk_158 = 0;
+ this->unk_159 = 1;
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->collider1.dim.radius = 30;
+ this->collider1.dim.height = 50;
+ this->collider1.dim.yShift = -25;
+}
+
+void func_80BB6BD8(EnTanron2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s16 sp32;
+ f32 sp2C;
+ f32 sp28;
+
+ if (this->unk_14E == 0) {
+ this->actor.world.pos.x += this->actor.velocity.x;
+ this->actor.world.pos.y += this->actor.velocity.y;
+ this->actor.world.pos.z += this->actor.velocity.z;
+ this->actor.velocity.y = this->actor.velocity.y - 2.0f;
+
+ if (this->actor.world.pos.y <= this->actor.floorHeight) {
+ this->actor.world.pos.y = this->actor.floorHeight;
+
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP2);
+
+ sp2C = D_80BB8450->unk_6BC.x - this->actor.world.pos.x;
+ sp28 = D_80BB8450->unk_6BC.z - this->actor.world.pos.z;
+
+ switch (this->unk_158) {
+ case 0:
+ if (Rand_ZeroOne() > 0.2f) {
+ sp32 = Rand_ZeroFloat(65536.0f);
+ } else {
+ sp32 = Math_Atan2S(sp2C, sp28);
+ }
+ this->actor.speedXZ = Rand_ZeroFloat(5.0f) + 5.0f;
+ break;
+
+ case 1:
+ sp32 = Math_Atan2S(sp2C, sp28);
+ this->actor.speedXZ += 2.0f;
+ if (this->actor.speedXZ > 10.0f) {
+ this->actor.speedXZ = 10.0f;
+ }
+ break;
+
+ case 2:
+ sp32 = Math_Atan2S(player->actor.world.pos.x - this->actor.world.pos.x,
+ player->actor.world.pos.z - this->actor.world.pos.z) +
+ (s16)Rand_ZeroFloat(20000.0f);
+ this->actor.speedXZ = Rand_ZeroFloat(7.0f) + 7.0f;
+ if ((this->unk_152 == 0) && (D_80BB8450->unk_1F6 == 0)) {
+ this->unk_158 = 1;
+ }
+ break;
+ }
+ Matrix_RotateY(sp32, MTXMODE_NEW);
+ Matrix_GetStateTranslationAndScaledZ(this->actor.speedXZ, &this->actor.velocity);
+ this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 12.0f;
+ this->unk_14E = 5;
+ }
+
+ if (this->unk_150 != 0) {
+ Math_ApproachF(&this->actor.scale.x, 0.75f, 0.5f, 1.0f);
+ Math_ApproachF(&this->actor.scale.y, 1.2f, 0.5f, 1.0f);
+ } else {
+ Math_ApproachF(&this->actor.scale.x, 1.0f, 0.1f, 0.2f);
+ Math_ApproachF(&this->actor.scale.y, 1.0f, 0.1f, 0.2f);
+ }
+ } else {
+ Math_ApproachF(&this->actor.scale.x, 1.2f, 0.75f, 1.5f);
+ Math_ApproachF(&this->actor.scale.y, 0.75f, 0.75f, 1.5f);
+ if (this->unk_14E == 1) {
+ sp2C = D_80BB8450->unk_6BC.x - this->actor.world.pos.x;
+ sp28 = D_80BB8450->unk_6BC.z - this->actor.world.pos.z;
+
+ if ((this->unk_158 != 0) && ((SQ(sp2C) + SQ(sp28)) < 14400.0f)) {
+ func_80BB69C0(this);
+ } else {
+ this->unk_150 = 10;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP1);
+ }
+ }
+ }
+}
+
+void func_80BB6F64(EnTanron2* this) {
+ this->actionFunc = func_80BB6F78;
+}
+
+void func_80BB6F78(EnTanron2* this, GlobalContext* globalCtx) {
+ switch (this->unk_158) {
+ case 0:
+ if (D_80BB8450->unk_708 == 13) {
+ this->unk_158 = 10;
+ this->unk_14E = Rand_ZeroFloat(50.0f);
+ }
+ break;
+
+ case 10:
+ if (this->unk_14E == 0) {
+ this->unk_150 = 10;
+ this->unk_158 = 1;
+ }
+ break;
+
+ case 1:
+ if (this->unk_14E == 0) {
+ this->actor.world.pos.y += this->actor.velocity.y;
+ this->actor.velocity.y = this->actor.velocity.y - 2.0f;
+
+ if (this->actor.world.pos.y <= this->actor.floorHeight) {
+ this->actor.world.pos.y = this->actor.floorHeight;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP2);
+ if (D_80BB8450->unk_6F8 > 0.1f) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER_L);
+ }
+ this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 12.0f;
+ this->unk_14E = 5;
+ }
+
+ if (this->unk_150 != 0) {
+ Math_ApproachF(&this->actor.scale.x, 0.75f, 0.5f, 1.0f);
+ Math_ApproachF(&this->actor.scale.y, 1.2f, 0.5f, 1.0f);
+ } else {
+ Math_ApproachF(&this->actor.scale.x, 1.0f, 0.1f, 0.2f);
+ Math_ApproachF(&this->actor.scale.y, 1.0f, 0.1f, 0.2f);
+ }
+ } else {
+ Math_ApproachF(&this->actor.scale.x, 1.2f, 0.75f, 1.5f);
+ Math_ApproachF(&this->actor.scale.y, 0.75f, 0.75f, 1.5f);
+
+ if (this->unk_14E == 1) {
+ if (D_80BB8450->unk_708 == 3) {
+ func_80BB6B80(this);
+ this->unk_158 = 1;
+ this->unk_159 = 0;
+ } else {
+ this->unk_150 = 0xA;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_JUMP1);
+ }
+ }
+ }
+ break;
+ }
+}
+
+void func_80BB71C8(EnTanron2* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f spA8;
+ Vec3f sp9C;
+ Vec3f sp90;
+
+ for (i = 0; i < 15; i++) {
+ Matrix_InsertYRotation_f(Rand_ZeroFloat(6.2831855f), MTXMODE_NEW);
+ Matrix_RotateStateAroundXAxis(Rand_ZeroFloat(6.2831855f));
+ Matrix_GetStateTranslationAndScaledZ(Rand_ZeroFloat(10.0f) + 5.0f, &spA8);
+ sp90.x = this->actor.world.pos.x + spA8.x;
+ sp90.y = this->actor.world.pos.y + spA8.y;
+ sp90.z = this->actor.world.pos.z + spA8.z;
+
+ sp9C.x = spA8.x * -0.03f;
+ sp9C.y = spA8.y * -0.03f;
+ sp9C.z = spA8.z * -0.03f;
+
+ EffectSsDtBubble_SpawnCustomColor(globalCtx, &sp90, &spA8, &sp9C, &D_80BB81E8, &D_80BB81EC,
+ Rand_ZeroFloat(100.0f) + 200.0f, Rand_ZeroFloat(5.0f) + 15.0f, 0);
+ }
+}
+
+void func_80BB7398(EnTanron2* this, GlobalContext* globalCtx) {
+ this->actionFunc = func_80BB7408;
+ if ((s8)this->actor.colChkInfo.health <= 0) {
+ Enemy_StartFinishingBlow(globalCtx, &this->actor);
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 30, NA_SE_EN_IKURA_DEAD);
+ } else {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE);
+ }
+}
+
+void func_80BB7408(EnTanron2* this, GlobalContext* globalCtx) {
+ this->actor.world.pos.x += this->actor.velocity.x;
+ this->actor.world.pos.y += this->actor.velocity.y;
+ this->actor.world.pos.z += this->actor.velocity.z;
+ this->actor.velocity.y -= 2.0f;
+
+ if (this->actor.world.pos.y <= this->actor.floorHeight) {
+ this->actor.world.pos.y = this->actor.floorHeight;
+ if ((s8)this->actor.colChkInfo.health <= 0) {
+ Actor_MarkForDeath(&this->actor);
+ func_80BB71C8(this, globalCtx);
+ D_80BB8450->unk_6F6--;
+ D_80BB8450->unk_2E2 += 4;
+ D_80BB8450->unk_2E0 += 4;
+ } else {
+ this->actor.velocity.x *= 0.5f;
+ this->actor.velocity.z *= 0.5f;
+ Math_ApproachF(&this->actor.scale.x, 1.2f, 0.75f, 1.5f);
+ Math_ApproachF(&this->actor.scale.y, 0.75f, 0.75f, 1.5f);
+ if ((this->actor.velocity.x < 0.1f) && (this->actor.velocity.z < 0.1f)) {
+ func_80BB6B80(this);
+ this->unk_158 = 1;
+ }
+ }
+ }
+}
+
+void func_80BB7578(EnTanron2* this, GlobalContext* globalCtx) {
+ ColliderInfo* acHitInfo;
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ s32 pad2;
+ s32 pad3;
+ u8 damage;
+
+ if (this->unk_154 == 0) {
+ if (this->collider1.base.acFlags & AC_HIT) {
+ this->collider1.base.acFlags &= ~AC_HIT;
+ acHitInfo = this->collider1.info.acHitInfo;
+ if (acHitInfo->toucher.dmgFlags & 0x80) {
+ func_80BB6B80(this);
+ this->unk_158 = 1;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE);
+ if ((player->unk_730 != 0) && (&this->actor != player->unk_730)) {
+ player->unk_730 = &this->actor;
+ globalCtx->actorCtx.targetContext.arrowPointedActor = &this->actor;
+ globalCtx->actorCtx.targetContext.targetedActor = &this->actor;
+ }
+ } else {
+ this->unk_154 = 15;
+ if (this->actionFunc != func_80BB69FC) {
+ Matrix_RotateY(this->actor.yawTowardsPlayer, MTXMODE_NEW);
+ if ((acHitInfo->toucher.dmgFlags & 0x300000) != 0) {
+ this->unk_154 = 10;
+ Matrix_GetStateTranslationAndScaledZ(-10.0f, &this->actor.velocity);
+ } else {
+ this->unk_156 = 15;
+ Matrix_GetStateTranslationAndScaledZ(-20.0f, &this->actor.velocity);
+ damage = this->actor.colChkInfo.damage;
+ this->actor.colChkInfo.health -= damage;
+ func_80BB7398(this, globalCtx);
+ }
+ } else {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_IKURA_DAMAGE);
+ goto block_18;
+ }
+ }
+ }
+ }
+
+ if ((this->actionFunc == func_80BB69FC) &&
+ ((D_80BB8450->unk_1F6 == 1) || ((D_80BB8450->unk_1F7 != 0) && (Rand_ZeroOne() < 0.1f)))) {
+ if (D_80BB8450->unk_1F7 != 0) {
+ D_80BB8450->unk_1F7--;
+ }
+
+ block_18:
+ func_80BB6B80(this);
+ this->unk_158 = 2;
+ Matrix_RotateY(Math_Atan2S(this->actor.world.pos.x - D_80BB8450->unk_6BC.x,
+ this->actor.world.pos.z - D_80BB8450->unk_6BC.z),
+ MTXMODE_NEW);
+ Matrix_GetStateTranslationAndScaledZ(10.0f, &this->actor.velocity);
+ this->unk_152 = Rand_ZeroFloat(100.0f) + 200.0f;
+ } else if (D_80BB8450->unk_1F6 == 10) {
+ Actor_MarkForDeath(&this->actor);
+ func_80BB71C8(this, globalCtx);
+ }
+}
+
+void EnTanron2_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnTanron2* this = THIS;
+ s32 pad2[2];
+ Input* input;
+
+ this->unk_148++;
+ Actor_SetFocus(&this->actor, 0.0f);
+
+ if (this->unk_14E != 0) {
+ this->unk_14E--;
+ }
+
+ if (this->unk_150 != 0) {
+ this->unk_150--;
+ }
+
+ if (this->unk_152 != 0) {
+ this->unk_152--;
+ }
+
+ if (this->unk_154 != 0) {
+ this->unk_154--;
+ }
+
+ if (this->unk_156 != 0) {
+ this->unk_156--;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->actionFunc != func_80BB69FC) {
+ if ((this->actor.world.pos.x < (D_80BB8450->unk_6D8 + 20.0f)) ||
+ ((D_80BB8450->unk_6DC - 20.0f) < this->actor.world.pos.x)) {
+ this->actor.world.pos.x = this->actor.prevPos.x;
+ this->actor.velocity.x *= -1.0f;
+ }
+
+ if ((this->actor.world.pos.z < (D_80BB8450->unk_6E0 + 20.0f)) ||
+ ((D_80BB8450->unk_6E4 - 20.0f) < this->actor.world.pos.z)) {
+ this->actor.world.pos.z = this->actor.prevPos.z;
+ this->actor.velocity.z *= -1.0f;
+ }
+ }
+
+ this->unk_14A += this->unk_14C;
+ func_80BB7578(this, globalCtx);
+
+ if (this->unk_159 != 0) {
+ if (this->actor.xzDistToPlayer < 100.0f) {
+ if (this->unk_15A == 0) {
+ Collider_UpdateCylinder(&this->actor, &this->collider2);
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ } else {
+ this->unk_15A--;
+ }
+ }
+
+ Collider_UpdateCylinder(&this->actor, &this->collider1);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ }
+
+ if (!(this->unk_148 & 0x1F)) {
+ if ((this->actionFunc != func_80BB69FC) && (this->actor.xyzDistToPlayerSq < SQ(200.0f))) {
+ this->unk_15B = 1;
+ } else {
+ this->unk_15B = 0;
+ }
+
+ if (this->actionFunc == func_80BB69FC) {
+ s16 atan = Math_Atan2S(this->actor.world.pos.x - D_80BB8450->unk_6BC.x,
+ this->actor.world.pos.z - D_80BB8450->unk_6BC.z);
+
+ if (ABS_ALT(BINANG_SUB(D_80BB8450->actor.yawTowardsPlayer, atan)) > 0x3000) {
+ this->unk_159 = 0;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ } else {
+ this->unk_159 = 1;
+ this->actor.flags |= ACTOR_FLAG_1;
+ }
+ }
+ }
+
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_2000) && (this->actor.xzDistToPlayer < 80.0f)) {
+ this->actor.flags &= ~ACTOR_FLAG_2000;
+ this->unk_15A = 25;
+ this->unk_159 = 1;
+ }
+
+ input = CONTROLLER3(globalCtx);
+ if (CHECK_BTN_ALL(input->press.button, BTN_L)) {
+ this->unk_158 = 1;
+ }
+
+ if (CHECK_BTN_ALL(input->press.button, BTN_R)) {
+ func_80BB6B80(this);
+ }
+}
+
+void func_80BB7B90(Actor* thisx, GlobalContext* globalCtx) {
+ EnTanron2* this = THIS;
+
+ D_80BB8454 = (Math_SinS(globalCtx->gameplayFrames * 0x3000) * 0.1f) + 1.0f;
+ if (D_80BB8450->unk_1F6 == 11) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnTanron2_Draw(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ s32 i;
+ s32 j;
+ s32 found;
+ Actor* tanron2;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPDisplayList(POLY_XLU_DISP++, object_boss04_DL_003450);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 150);
+
+ tanron2 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first;
+
+ for (i = 0; i < ARRAY_COUNT(D_80BB8458); i++) {
+ D_80BB8458[i] = NULL;
+ }
+
+ found = 0;
+ while (tanron2 != NULL) {
+ if (tanron2->params < 100) {
+ D_80BB8458[found] = (EnTanron2*)tanron2;
+ found++;
+ }
+ tanron2 = tanron2->next;
+ }
+
+ for (j = 0; j < found - 1; j++) {
+ for (i = 0; i < found - 1; i++) {
+ if (D_80BB8458[i + 1] != NULL) {
+ if (D_80BB8458[i]->actor.projectedPos.z < D_80BB8458[i + 1]->actor.projectedPos.z) {
+ SWAP(EnTanron2*, D_80BB8458[i], D_80BB8458[i + 1]);
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < ARRAY_COUNT(D_80BB8458); i++) {
+ if (D_80BB8458[i] != NULL) {
+ Matrix_InsertTranslation(D_80BB8458[i]->actor.world.pos.x, D_80BB8458[i]->actor.world.pos.y,
+ D_80BB8458[i]->actor.world.pos.z, MTXMODE_NEW);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+ Matrix_Scale(D_80BB8458[i]->actor.scale.x, D_80BB8458[i]->actor.scale.y, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(D_80BB8458[i]->unk_14A, MTXMODE_APPLY);
+ Matrix_Scale(0.13f, 0.14299999f, 0.13f, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-D_80BB8458[i]->unk_14A, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss04_DL_0034C8);
+ }
+ }
+
+ func_8012C448(globalCtx->state.gfxCtx);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, 150);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss04_DL_004510);
+
+ tanron2 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first;
+ while (tanron2 != NULL) {
+ if ((tanron2->params < 100) && (((EnTanron2*)tanron2)->unk_15B != 0)) {
+ Matrix_InsertTranslation(tanron2->world.pos.x, D_80BB8450->actor.floorHeight, tanron2->world.pos.z,
+ MTXMODE_NEW);
+ Matrix_Scale(0.6f, 0.0f, 0.6f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_boss04_DL_004550);
+ }
+ tanron2 = tanron2->next;
+ }
+
+ func_8012C974(globalCtx->state.gfxCtx);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
+ gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 255);
+ gDPSetAlphaDither(POLY_XLU_DISP++, G_AD_NOISE);
+ gDPSetColorDither(POLY_XLU_DISP++, G_CD_NOISE);
+
+ tanron2 = globalCtx->actorCtx.actorLists[ACTORCAT_BOSS].first;
+ while (tanron2 != NULL) {
+ if ((tanron2->params < 100) && (((EnTanron2*)tanron2)->unk_15B != 0) &&
+ (tanron2->world.pos.y <= tanron2->floorHeight)) {
+ Matrix_InsertTranslation(tanron2->world.pos.x, D_80BB8450->actor.floorHeight + 2.0f, tanron2->world.pos.z,
+ MTXMODE_NEW);
+ Matrix_Scale(D_80BB8454, 0.0f, D_80BB8454, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_0377B0);
+ }
+ tanron2 = tanron2->next;
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h
index 5e9512c7cf..755bb4ff4d 100644
--- a/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h
+++ b/src/overlays/actors/ovl_En_Tanron2/z_en_tanron2.h
@@ -10,7 +10,22 @@ typedef void (*EnTanron2ActionFunc)(struct EnTanron2*, GlobalContext*);
typedef struct EnTanron2 {
/* 0x0000 */ Actor actor;
/* 0x0144 */ EnTanron2ActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0xB4];
+ /* 0x0148 */ s16 unk_148;
+ /* 0x014A */ s16 unk_14A;
+ /* 0x014C */ s16 unk_14C;
+ /* 0x014E */ s16 unk_14E;
+ /* 0x0150 */ s16 unk_150;
+ /* 0x0152 */ s16 unk_152;
+ /* 0x0154 */ s16 unk_154;
+ /* 0x0156 */ s16 unk_156;
+ /* 0x0158 */ u8 unk_158;
+ /* 0x0159 */ u8 unk_159;
+ /* 0x015A */ u8 unk_15A;
+ /* 0x015B */ u8 unk_15B;
+ /* 0x015C */ f32 unk_15C;
+ /* 0x0160 */ f32 unk_160;
+ /* 0x0164 */ ColliderCylinder collider1;
+ /* 0x01B0 */ ColliderCylinder collider2;
} EnTanron2; // size = 0x1FC
extern const ActorInit En_Tanron2_InitVars;
diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
index c735f4ca25..f845d9fa24 100644
--- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
+++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.c
@@ -6,11 +6,18 @@
#include "z_en_tanron3.h"
#include "overlays/actors/ovl_Boss_03/z_boss_03.h"
+#include "objects/object_boss03/object_boss03.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTanron3*)thisx)
+#define WORK_TIMER_PICK_NEW_DEVIATION 0
+#define WORK_TIMER_DIE 0
+#define WORK_TIMER_OUT_OF_WATER 1
+#define WORK_TIMER_ATTACK 2
+#define WORK_TIMER_WAIT 2
+
void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx);
void EnTanron3_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx);
@@ -78,9 +85,6 @@ static ColliderCylinderInit sUnusedCylinderInit = {
{ 20, 20, -10, { 0, 0, 0 } },
};
-extern FlexSkeletonHeader D_0600DA20;
-extern AnimationHeader D_0600DAAC;
-
void EnTanron3_CreateEffect(GlobalContext* globalCtx, Vec3f* effectPos) {
UnkTanron3Effect* effectPtr = (UnkTanron3Effect*)globalCtx->specialEffects;
s16 i;
@@ -109,10 +113,11 @@ void EnTanron3_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -1.0f;
Collider_InitAndSetCylinder(globalCtx, &this->atCollider, &this->actor, &sCylinderInit);
Collider_InitAndSetCylinder(globalCtx, &this->acCollider, &this->actor, &sCylinderInit);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600DA20, &D_0600DAAC, this->jointTable, this->morphTable, 10);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gGyorgSmallFishSkel, &gGyorgSmallFishSwimAnim, this->jointTable,
+ this->morphTable, GYORG_SMALL_FISH_LIMB_MAX);
Actor_SetScale(&this->actor, 0.02f);
EnTanron3_SetupLive(this, globalCtx);
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->currentRotationAngle = Rand_ZeroFloat(500000.0f);
this->waterSurfaceYPos = 430.0f;
sGyorg = (Boss03*)this->actor.parent;
@@ -143,10 +148,10 @@ void EnTanron3_SpawnBubbles(EnTanron3* this, GlobalContext* globalCtx) {
void EnTanron3_SetupLive(EnTanron3* this, GlobalContext* globalCtx) {
this->actionFunc = EnTanron3_Live;
- Animation_MorphToLoop(&this->skelAnime, &D_0600DAAC, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &gGyorgSmallFishSwimAnim, -10.0f);
this->rotationStep = 0;
this->rotationScale = 5;
- this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = 50;
+ this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = 50;
this->actor.speedXZ = 5.0f;
this->speedMaxStep = 0.5f;
this->deviation.x = randPlusMinusPoint5Scaled(500.0f);
@@ -177,13 +182,13 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) {
if ((player->actor.bgCheckFlags & 1) && player->actor.shape.feetPos[0].y >= 438.0f) {
// Player is standing on the central platform, so stop chasing them
this->isNonHostile = true;
- } else if (this->isNonHostile && this->workTimer[TANRON3_WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) {
+ } else if (this->isNonHostile && this->workTimer[WORK_TIMER_WAIT] == 0 && !(this->timer & 0x1F)) {
xDistance = this->targetPos.x - player->actor.world.pos.x;
zDistance = this->targetPos.z - player->actor.world.pos.z;
if (sqrtf(SQ(xDistance) + SQ(zDistance)) < 500.0f) {
// Player is in the water and close enough, so start chasing them
this->isNonHostile = false;
- this->workTimer[TANRON3_WORK_TIMER_ATTACK] = 150;
+ this->workTimer[WORK_TIMER_ATTACK] = 150;
}
}
@@ -205,8 +210,8 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) {
// If the player gets eaten by Gyorg, or if the attack timer ran out,
// stop chasing the player for a little bit.
- if (this->workTimer[TANRON3_WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) {
- this->workTimer[TANRON3_WORK_TIMER_WAIT] = 150;
+ if (this->workTimer[WORK_TIMER_ATTACK] == 0 || (player->stateFlags2 & 0x80)) {
+ this->workTimer[WORK_TIMER_WAIT] = 150;
this->isNonHostile = true;
}
break;
@@ -235,9 +240,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) {
break;
}
- if (this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] == 0) {
- if (this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) {
- this->workTimer[TANRON3_WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f);
+ if (this->workTimer[WORK_TIMER_OUT_OF_WATER] == 0) {
+ if (this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] == 0 && this->actor.speedXZ > 1.0f) {
+ this->workTimer[WORK_TIMER_PICK_NEW_DEVIATION] = Rand_ZeroFloat(20.0f);
this->deviation.x = randPlusMinusPoint5Scaled(100.0f);
this->deviation.y = randPlusMinusPoint5Scaled(50.0f + extraScaleY);
this->deviation.z = randPlusMinusPoint5Scaled(100.0f);
@@ -267,7 +272,7 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) {
// Fish is above water but hasn't touched land before
this->actor.gravity = -1.0f;
this->targetPosWithDeviation.y = this->waterSurfaceYPos - 50.0f;
- this->workTimer[TANRON3_WORK_TIMER_OUT_OF_WATER] = 25;
+ this->workTimer[WORK_TIMER_OUT_OF_WATER] = 25;
Math_ApproachS(&this->actor.world.rot.x, 0x3000, 5, 0xBD0);
if (this->actor.bgCheckFlags & 8) {
this->actor.speedXZ = 0.0f;
@@ -319,9 +324,9 @@ void EnTanron3_Live(EnTanron3* this, GlobalContext* globalCtx) {
}
this->currentRotationAngle += this->nextRotationAngle;
- this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f;
- this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f;
this->tailRotation = Math_SinS(this->currentRotationAngle) * 5000.0f;
+ this->bodyRotation = Math_SinS(this->currentRotationAngle + 0x6978) * 5000.0f;
+ this->trunkRotation = Math_SinS(this->currentRotationAngle) * 5000.0f;
if (!this->isBeached) {
this->actor.shape.rot = this->actor.world.rot;
}
@@ -339,14 +344,14 @@ void EnTanron3_SetupDie(EnTanron3* this, GlobalContext* globalCtx) {
zDistance = this->actor.world.pos.z - player->actor.world.pos.z;
this->actor.world.rot.x = Math_FAtan2F(sqrtf(SQ(xDistance) + SQ(zDistance)), -yDistance);
this->actor.world.rot.y = Math_FAtan2F(zDistance, xDistance);
- this->workTimer[TANRON3_WORK_TIMER_DIE] = 6;
+ this->workTimer[WORK_TIMER_DIE] = 6;
this->actor.speedXZ = 10.0f;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KONB_MINI_DEAD);
}
void EnTanron3_Die(EnTanron3* this, GlobalContext* globalCtx) {
Actor_MoveWithoutGravityReverse(&this->actor);
- if (this->workTimer[TANRON3_WORK_TIMER_DIE] == 0) {
+ if (this->workTimer[WORK_TIMER_DIE] == 0) {
EnTanron3_SpawnBubbles(this, globalCtx);
Actor_MarkForDeath(&this->actor);
if (Rand_ZeroOne() < 0.3f) {
@@ -419,7 +424,7 @@ void EnTanron3_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((s8)sGyorg->actor.colChkInfo.health <= 0 && this->actionFunc != EnTanron3_Die) {
EnTanron3_SetupDie(this, globalCtx);
- this->workTimer[TANRON3_WORK_TIMER_DIE] = 0;
+ this->workTimer[WORK_TIMER_DIE] = 0;
}
}
@@ -427,15 +432,18 @@ s32 EnTanron3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
Actor* thisx) {
EnTanron3* this = THIS;
- if (limbIndex == 1) {
+ if (limbIndex == GYORG_SMALL_FISH_LIMB_ROOT) {
rot->y += this->bodyRotation;
}
- if (limbIndex == 3) {
- rot->y += this->tailRotation;
- }
- if (limbIndex == 4) {
+
+ if (limbIndex == GYORG_SMALL_FISH_LIMB_TRUNK_ROOT) {
rot->y += this->trunkRotation;
}
+
+ if (limbIndex == GYORG_SMALL_FISH_LIMB_TAIL_FIN) {
+ rot->y += this->tailRotation;
+ }
+
return false;
}
@@ -443,6 +451,7 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnTanron3* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
+
func_8012C28C(globalCtx->state.gfxCtx);
if ((this->fogTimer % 2) != 0) {
POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 255, 0, 0, 255, 900, 1099);
@@ -450,5 +459,6 @@ void EnTanron3_Draw(Actor* thisx, GlobalContext* globalCtx) {
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnTanron3_OverrideLimbDraw, NULL, &this->actor);
POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
+
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h
index 9a2cb25da7..9d67154df6 100644
--- a/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h
+++ b/src/overlays/actors/ovl_En_Tanron3/z_en_tanron3.h
@@ -2,16 +2,12 @@
#define Z_EN_TANRON3_H
#include "global.h"
+#include "objects/object_boss03/object_boss03.h"
struct EnTanron3;
typedef void (*EnTanron3ActionFunc)(struct EnTanron3*, GlobalContext*);
-#define TANRON3_WORK_TIMER_PICK_NEW_DEVIATION 0
-#define TANRON3_WORK_TIMER_DIE 0
-#define TANRON3_WORK_TIMER_OUT_OF_WATER 1
-#define TANRON3_WORK_TIMER_ATTACK 2
-#define TANRON3_WORK_TIMER_WAIT 2
#define TANRON3_WORK_TIMER_MAX 3
typedef struct {
@@ -28,8 +24,8 @@ typedef struct {
typedef struct EnTanron3 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
- /* 0x188 */ Vec3s jointTable[10];
- /* 0x1C4 */ Vec3s morphTable[10];
+ /* 0x188 */ Vec3s jointTable[GYORG_SMALL_FISH_LIMB_MAX];
+ /* 0x1C4 */ Vec3s morphTable[GYORG_SMALL_FISH_LIMB_MAX];
/* 0x200 */ s16 timer;
/* 0x202 */ u8 isNonHostile; // If true, the fish will not move towards the player to attack them
/* 0x203 */ u8 isBeached; // If true, the fish is on the central platform flopping around
@@ -48,8 +44,8 @@ typedef struct EnTanron3 {
/* 0x248 */ Vec3s targetShapeRotation;
/* 0x250 */ s32 currentRotationAngle;
/* 0x254 */ s32 nextRotationAngle;
- /* 0x258 */ s16 tailRotation;
- /* 0x25A */ s16 trunkRotation;
+ /* 0x258 */ s16 trunkRotation;
+ /* 0x25A */ s16 tailRotation;
/* 0x25C */ s16 bodyRotation;
/* 0x260 */ ColliderCylinder atCollider;
/* 0x2AC */ ColliderCylinder acCollider;
diff --git a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
index 45330247dc..9912baf601 100644
--- a/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
+++ b/src/overlays/actors/ovl_En_Tanron4/z_en_tanron4.c
@@ -6,7 +6,7 @@
#include "z_en_tanron4.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnTanron4*)thisx)
diff --git a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
index f79aea9375..36f5073271 100644
--- a/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
+++ b/src/overlays/actors/ovl_En_Tanron5/z_en_tanron5.c
@@ -6,7 +6,7 @@
#include "z_en_tanron5.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTanron5*)thisx)
diff --git a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c
index c34d2e5b5d..bb57ff92fc 100644
--- a/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c
+++ b/src/overlays/actors/ovl_En_Tanron6/z_en_tanron6.c
@@ -6,7 +6,7 @@
#include "z_en_tanron6.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnTanron6*)thisx)
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 2f13b66403..0a0b86ea1c 100644
--- a/src/overlays/actors/ovl_En_Test/z_en_test.c
+++ b/src/overlays/actors/ovl_En_Test/z_en_test.c
@@ -6,7 +6,7 @@
#include "z_en_test.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnTest*)thisx)
diff --git a/src/overlays/actors/ovl_En_Test2/z_en_test2.c b/src/overlays/actors/ovl_En_Test2/z_en_test2.c
index 9beb862632..c16a4133d3 100644
--- a/src/overlays/actors/ovl_En_Test2/z_en_test2.c
+++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.c
@@ -6,7 +6,7 @@
#include "z_en_test2.h"
-#define FLAGS 0x00000090
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_80)
#define THIS ((EnTest2*)thisx)
diff --git a/src/overlays/actors/ovl_En_Test3/z_en_test3.c b/src/overlays/actors/ovl_En_Test3/z_en_test3.c
index 63d0cf9544..ce9a8f3c9e 100644
--- a/src/overlays/actors/ovl_En_Test3/z_en_test3.c
+++ b/src/overlays/actors/ovl_En_Test3/z_en_test3.c
@@ -6,7 +6,7 @@
#include "z_en_test3.h"
-#define FLAGS 0x04000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_4000000)
#define THIS ((EnTest3*)thisx)
diff --git a/src/overlays/actors/ovl_En_Test4/z_en_test4.c b/src/overlays/actors/ovl_En_Test4/z_en_test4.c
index 9e1417c841..7913231237 100644
--- a/src/overlays/actors/ovl_En_Test4/z_en_test4.c
+++ b/src/overlays/actors/ovl_En_Test4/z_en_test4.c
@@ -8,7 +8,7 @@
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
#include "overlays/actors/ovl_En_Horse/z_en_horse.h"
-#define FLAGS 0x00100030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_100000)
#define THIS ((EnTest4*)thisx)
diff --git a/src/overlays/actors/ovl_En_Test5/z_en_test5.c b/src/overlays/actors/ovl_En_Test5/z_en_test5.c
index 0360af9271..4a93cf5e88 100644
--- a/src/overlays/actors/ovl_En_Test5/z_en_test5.c
+++ b/src/overlays/actors/ovl_En_Test5/z_en_test5.c
@@ -6,7 +6,7 @@
#include "z_en_test5.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnTest5*)thisx)
@@ -33,10 +33,10 @@ void EnTest5_SetupAction(EnTest5* this, EnTest5ActionFunc actionFunc) {
}
void EnTest5_Init(Actor* thisx, GlobalContext* globalCtx2) {
- EnTest5* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnTest5* this = THIS;
WaterBox* water;
- f32 ySurface; // Unused
+ f32 ySurface;
// If not spawned above a water source, immediately despawn
if (!WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z,
@@ -80,11 +80,11 @@ void EnTest5_HandleBottleAction(EnTest5* this, GlobalContext* globalCtx) {
}
void EnTest5_Update(Actor* thisx, GlobalContext* globalCtx2) {
- EnTest5* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnTest5* this = THIS;
Vec3f steamPos;
- CollisionPoly* poly; // Unused
- s32 pad; // Unused
+ CollisionPoly* poly;
+ s32 pad;
this->actionFunc(this, globalCtx);
diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c
index 04365b5dd3..3305d4c042 100644
--- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c
+++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c
@@ -6,7 +6,7 @@
#include "z_en_test6.h"
-#define FLAGS 0x02200030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200000 | ACTOR_FLAG_2000000)
#define THIS ((EnTest6*)thisx)
diff --git a/src/overlays/actors/ovl_En_Test7/z_en_test7.c b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
index 81ab55e272..e84e2d3fd0 100644
--- a/src/overlays/actors/ovl_En_Test7/z_en_test7.c
+++ b/src/overlays/actors/ovl_En_Test7/z_en_test7.c
@@ -6,7 +6,7 @@
#include "z_en_test7.h"
-#define FLAGS 0x02300030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_100000 | ACTOR_FLAG_200000 | ACTOR_FLAG_2000000)
#define THIS ((EnTest7*)thisx)
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 c53e096f0b..fe3aadc7b8 100644
--- a/src/overlays/actors/ovl_En_Tg/z_en_tg.c
+++ b/src/overlays/actors/ovl_En_Tg/z_en_tg.c
@@ -6,7 +6,7 @@
#include "z_en_tg.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnTg*)thisx)
diff --git a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
index cee811bdf9..5aaf7adb60 100644
--- a/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
+++ b/src/overlays/actors/ovl_En_Thiefbird/z_en_thiefbird.c
@@ -5,8 +5,9 @@
*/
#include "z_en_thiefbird.h"
+#include "objects/object_thiefbird/object_thiefbird.h"
-#define FLAGS 0x80001205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200 | ACTOR_FLAG_1000 | ACTOR_FLAG_80000000)
#define THIS ((EnThiefbird*)thisx)
@@ -32,19 +33,6 @@ void func_80C126D8(EnThiefbird* this, GlobalContext* globalCtx);
void func_80C12744(EnThiefbird* this);
void func_80C127F4(EnThiefbird* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06000088;
-extern AnimationHeader D_06000278;
-extern AnimationHeader D_06000604;
-extern Gfx D_06003060[];
-extern Gfx D_060030D8[];
-extern Gfx D_060033B0[];
-extern Gfx D_06003D58[];
-extern Gfx D_06004348[];
-extern Gfx D_06004B88[];
-extern Gfx D_060055E0[];
-extern FlexSkeletonHeader D_060061A0;
-extern AnimationHeader D_060063C4;
-
const ActorInit En_Thiefbird_InitVars = {
ACTOR_EN_THIEFBIRD,
ACTORCAT_ENEMY,
@@ -162,7 +150,8 @@ void EnThiefbird_Init(Actor* thisx, GlobalContext* globalCtx) {
ColliderJntSphElementDim* dim;
Actor_ProcessInitChain(&this->actor, sInitChain);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060061A0, &D_06000604, this->jointTable, this->morphTable, 17);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_thiefbird_Skel_0061A0, &object_thiefbird_Anim_000604,
+ this->jointTable, this->morphTable, 17);
Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
@@ -179,7 +168,7 @@ void EnThiefbird_Init(Actor* thisx, GlobalContext* globalCtx) {
D_80C1392C = 1;
Math_Vec3f_Copy(&D_80C13920, &this->actor.world.pos);
Actor_MarkForDeath(&this->actor);
- } else if ((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18) {
+ } else if ((gSaveContext.stolenItems & 0xFF000000) >> 0x18) {
Actor_MarkForDeath(&this->actor);
} else {
func_80C11538(this);
@@ -217,7 +206,7 @@ void func_80C10984(EnThiefbird* this, s32 arg1) {
}
s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) {
- static Gfx* D_80C13680[] = { D_06004348, D_06004B88, D_060055E0 };
+ static Gfx* D_80C13680[] = { object_thiefbird_DL_004348, object_thiefbird_DL_004B88, object_thiefbird_DL_0055E0 };
s32 isItemFound = false;
s32 phi_a3 = 0;
s32 slotId = SLOT_BOTTLE_1;
@@ -250,9 +239,9 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) {
if (isItemFound) {
func_801149A0(itemId2, slotId);
- this->unk_3E8 = D_060033B0;
- if (!Message_GetState(&globalCtx->msgCtx)) {
- func_801518B0(globalCtx, 0xF4, NULL);
+ this->unk_3E8 = object_thiefbird_DL_0033B0;
+ if (Message_GetState(&globalCtx->msgCtx) == 0) {
+ Message_StartTextbox(globalCtx, 0xF4, NULL);
}
itemId1 = ITEM_BOTTLE;
} else if (phi_a3 != 0) {
@@ -267,25 +256,25 @@ s32 func_80C10B0C(EnThiefbird* this, GlobalContext* globalCtx) {
itemId1 = phi_a3 + (ITEM_SWORD_KOKIRI - 1);
if (phi_a3 == 4) {
func_801149A0(ITEM_SWORD_GREAT_FAIRY, SLOT_SWORD_GREAT_FAIRY);
- this->unk_3E8 = D_06003D58;
+ this->unk_3E8 = object_thiefbird_DL_003D58;
itemId1 = ITEM_SWORD_GREAT_FAIRY;
} else {
CUR_FORM_EQUIP(EQUIP_SLOT_B) = ITEM_NONE;
- TAKE_EQUIPPED_ITEM(EQUIP_SWORD);
+ SET_EQUIP_VALUE(EQUIP_SWORD, 0);
this->unk_3E8 = D_80C13680[phi_a3 - 1];
}
- if (!Message_GetState(&globalCtx->msgCtx)) {
- func_801518B0(globalCtx, 0xF5, NULL);
+ if (Message_GetState(&globalCtx->msgCtx) == 0) {
+ Message_StartTextbox(globalCtx, 0xF5, NULL);
}
} else {
return false;
}
- if (!((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18)) {
- gSaveContext.roomInf[126][5] = (gSaveContext.roomInf[126][5] & 0xFFFFFF) | ((itemId1 & 0xFF) << 0x18);
+ if (!((gSaveContext.stolenItems & 0xFF000000) >> 0x18)) {
+ gSaveContext.stolenItems = (gSaveContext.stolenItems & 0xFFFFFF) | ((itemId1 & 0xFF) << 0x18);
} else {
- gSaveContext.roomInf[126][5] = (gSaveContext.roomInf[126][5] & 0xFF00FFFF) | ((itemId1 & 0xFF) << 0x10);
+ gSaveContext.stolenItems = (gSaveContext.stolenItems & 0xFF00FFFF) | ((itemId1 & 0xFF) << 0x10);
}
return true;
@@ -458,7 +447,7 @@ void func_80C11454(EnThiefbird* this) {
this->unk_3D8 = 0.5f;
this->unk_3DC = 0.75f;
this->unk_3D4 = 1.0f;
- this->actor.flags &= ~0x200;
+ this->actor.flags &= ~ACTOR_FLAG_200;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
}
@@ -467,12 +456,12 @@ void func_80C114C0(EnThiefbird* this, GlobalContext* globalCtx) {
this->unk_18C = 0;
this->unk_3D4 = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_350, 11, 2, 0.2f, 0.2f);
- this->actor.flags |= 0x200;
+ this->actor.flags |= ACTOR_FLAG_200;
}
}
void func_80C11538(EnThiefbird* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000604, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000604, -4.0f);
this->unk_18E = 60;
this->collider.base.acFlags |= AC_ON;
this->actionFunc = func_80C11590;
@@ -536,7 +525,7 @@ void func_80C11590(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C118E4(EnThiefbird* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060063C4, -10.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_0063C4, -10.0f);
this->unk_18E = 300;
this->actionFunc = func_80C1193C;
this->actor.speedXZ = 5.0f;
@@ -581,8 +570,8 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_VOICE);
if (!(this->collider.base.atFlags & AT_BOUNCED)) {
if ((D_80C1392C != 0) && CUR_UPG_VALUE(UPG_QUIVER) &&
- (!((gSaveContext.roomInf[126][5] & 0xFF000000) >> 0x18) ||
- !((gSaveContext.roomInf[126][5] & 0xFF0000) >> 0x10)) &&
+ (!((gSaveContext.stolenItems & 0xFF000000) >> 0x18) ||
+ !((gSaveContext.stolenItems & 0xFF0000) >> 0x10)) &&
(Rand_ZeroOne() < 0.5f) && func_80C10B0C(this, globalCtx)) {
func_80C1242C(this);
} else if (func_80C10E98(globalCtx)) {
@@ -603,7 +592,7 @@ void func_80C1193C(EnThiefbird* this, GlobalContext* globalCtx) {
void func_80C11C60(EnThiefbird* this) {
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
- Animation_PlayOnce(&this->skelAnime, &D_06000088);
+ Animation_PlayOnce(&this->skelAnime, &object_thiefbird_Anim_000088);
this->actor.bgCheckFlags &= ~1;
this->actor.shape.rot.x = 0;
this->unk_18E = 40;
@@ -611,7 +600,7 @@ void func_80C11C60(EnThiefbird* this) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_THIEFBIRD_DEAD);
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 40);
this->collider.base.acFlags &= ~AC_ON;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->unk_192 = 0x1C00;
this->actionFunc = func_80C11D14;
}
@@ -642,7 +631,7 @@ void func_80C11D14(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C11DC0(EnThiefbird* this) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actionFunc = func_80C11DF0;
this->actor.gravity = -0.5f;
}
@@ -675,7 +664,7 @@ void func_80C11DF0(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C11F6C(EnThiefbird* this, GlobalContext* globalCtx) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000278, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000278, -4.0f);
func_80C10984(this, 15);
if (this->actor.colChkInfo.damageEffect != 3) {
this->actor.speedXZ = 4.0f;
@@ -759,7 +748,7 @@ void func_80C1215C(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C12308(EnThiefbird* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000278, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000278, -4.0f);
func_80C10984(this, 15);
this->unk_190 = -0x1000;
this->unk_192 = BINANG_ROT180(this->actor.yawTowardsPlayer);
@@ -788,8 +777,8 @@ void func_80C12378(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C1242C(EnThiefbird* this) {
- Animation_Change(&this->skelAnime, &D_06000278, 2.0f, 0.0f, 0.0f, 0, -4.0f);
- this->actor.flags |= 0x10;
+ Animation_Change(&this->skelAnime, &object_thiefbird_Anim_000278, 2.0f, 0.0f, 0.0f, 0, -4.0f);
+ this->actor.flags |= ACTOR_FLAG_10;
this->collider.base.acFlags |= AC_ON;
this->actionFunc = func_80C124B0;
this->actor.speedXZ = 12.0f;
@@ -834,7 +823,7 @@ void func_80C124B0(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C126A8(EnThiefbird* this) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->collider.base.acFlags &= ~AC_ON;
this->actionFunc = func_80C126D8;
}
@@ -848,11 +837,11 @@ void func_80C126D8(EnThiefbird* this, GlobalContext* globalCtx) {
}
void func_80C12744(EnThiefbird* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06000604, -4.0f);
- Animation_Change(&this->skelAnime, &D_06000604, 1.0f, 0.0f, 0.0f, 1, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_thiefbird_Anim_000604, -4.0f);
+ Animation_Change(&this->skelAnime, &object_thiefbird_Anim_000604, 1.0f, 0.0f, 0.0f, 1, -4.0f);
this->unk_190 = 0;
this->collider.base.acFlags |= AC_ON;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->actionFunc = func_80C127F4;
this->actor.speedXZ = 4.0f;
this->skelAnime.playSpeed = 3.0f;
@@ -918,7 +907,7 @@ void func_80C127F4(EnThiefbird* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.x, -0x800, 4, 0x800, 0x80);
if (this->unk_194 == 0) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
func_80C11538(this);
}
}
@@ -936,7 +925,7 @@ void func_80C12B1C(EnThiefbird* this, GlobalContext* globalCtx) {
this->unk_194 = 0;
for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
- if (this->collider.elements[i].info.bumperFlags & 2) {
+ if (this->collider.elements[i].info.bumperFlags & BUMP_HIT) {
break;
}
}
@@ -1008,8 +997,8 @@ void func_80C12D00(EnThiefbird* this) {
}
void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) {
- EnThiefbird* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnThiefbird* this = THIS;
func_80C12B1C(this, globalCtx);
this->actionFunc(this, globalCtx);
@@ -1042,8 +1031,8 @@ void EnThiefbird_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
func_80C12D00(this);
- if (((this->skelAnime.animation == &D_06000604) && Animation_OnFrame(&this->skelAnime, 13.0f)) ||
- ((this->skelAnime.animation == &D_06000278) && Animation_OnFrame(&this->skelAnime, 1.0f))) {
+ if (((this->skelAnime.animation == &object_thiefbird_Anim_000604) && Animation_OnFrame(&this->skelAnime, 13.0f)) ||
+ ((this->skelAnime.animation == &object_thiefbird_Anim_000278) && Animation_OnFrame(&this->skelAnime, 1.0f))) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KAICHO_FLUTTER);
}
}
@@ -1088,7 +1077,7 @@ void EnThiefbird_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
if (this->unk_3E8 != NULL) {
OPEN_DISPS(globalCtx->state.gfxCtx);
- if (this->unk_3E8 == D_060033B0) {
+ if (this->unk_3E8 == object_thiefbird_DL_0033B0) {
gfx = POLY_XLU_DISP;
} else {
gfx = POLY_OPA_DISP;
@@ -1097,7 +1086,7 @@ void EnThiefbird_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dLi
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&gfx[1], this->unk_3E8);
- if (this->unk_3E8 == D_060033B0) {
+ if (this->unk_3E8 == object_thiefbird_DL_0033B0) {
POLY_XLU_DISP = &gfx[2];
} else {
POLY_OPA_DISP = &gfx[2];
@@ -1130,7 +1119,7 @@ void func_80C13354(EnThiefbird* this, GlobalContext* globalCtx2) {
gfx = POLY_OPA_DISP;
gSPDisplayList(&gfx[0], &sSetupDL[6 * 25]);
- gSPDisplayList(&gfx[1], D_06003060);
+ gSPDisplayList(&gfx[1], object_thiefbird_DL_003060);
gfx = &gfx[2];
for (i = 0; i < ARRAY_COUNT(this->unk_3F0); i++, ptr++) {
@@ -1143,7 +1132,7 @@ void func_80C13354(EnThiefbird* this, GlobalContext* globalCtx2) {
Matrix_Scale(ptr->unk_18, ptr->unk_18, 1.0f, MTXMODE_APPLY);
gSPMatrix(&gfx[0], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(&gfx[1], D_060030D8);
+ gSPDisplayList(&gfx[1], object_thiefbird_DL_0030D8);
gfx = &gfx[2];
}
}
diff --git a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
index db71ae58df..cd0403c714 100644
--- a/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
+++ b/src/overlays/actors/ovl_En_Time_Tag/z_en_time_tag.c
@@ -6,7 +6,7 @@
#include "z_en_time_tag.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnTimeTag*)thisx)
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 5afdd500f6..3665cdfde8 100644
--- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c
+++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c
@@ -5,8 +5,9 @@
*/
#include "z_en_tite.h"
+#include "objects/object_tite/object_tite.h"
-#define FLAGS 0x00000205
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_200)
#define THIS ((EnTite*)thisx)
@@ -45,20 +46,6 @@ void func_80895CB0(EnTite* this);
void func_80895D08(EnTite* this, GlobalContext* globalCtx);
void func_80895E28(EnTite* this, GlobalContext* globalCtx);
-extern AnimationHeader D_060004F8;
-extern AnimationHeader D_0600069C;
-extern AnimationHeader D_0600083C;
-extern AnimationHeader D_06000A14;
-extern AnimationHeader D_06000C70;
-extern AnimationHeader D_060012E4;
-extern SkeletonHeader D_06003A20;
-extern UNK_PTR D_06001300;
-extern UNK_PTR D_06001700;
-extern UNK_PTR D_06001900;
-extern UNK_PTR D_06001B00;
-extern UNK_PTR D_06001F00;
-extern UNK_PTR D_06002100;
-
const ActorInit En_Tite_InitVars = {
ACTOR_EN_TITE,
ACTORCAT_ENEMY,
@@ -128,9 +115,9 @@ static DamageTable sDamageTable = {
static CollisionCheckInfoInit sColChkInfoInit = { 2, 40, 40, MASS_HEAVY };
-static UNK_PTR D_80896B24[2][3] = {
- { &D_06001300, &D_06001700, &D_06001900 },
- { &D_06001B00, &D_06001F00, &D_06002100 },
+static TexturePtr D_80896B24[2][3] = {
+ { object_tite_Tex_001300, object_tite_Tex_001700, object_tite_Tex_001900 },
+ { object_tite_Tex_001B00, object_tite_Tex_001F00, object_tite_Tex_002100 },
};
static Color_RGBA8 D_80896B3C = { 250, 250, 250, 255 };
@@ -153,7 +140,8 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 j;
Actor_ProcessInitChain(&this->actor, sInitChain);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_06003A20, &D_060012E4, this->jointTable, this->morphTable, 25);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &object_tite_Skel_003A20, &object_tite_Anim_0012E4, this->jointTable,
+ this->morphTable, 25);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 60.0f);
Actor_SetFocus(&this->actor, 20.0f);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@@ -173,7 +161,7 @@ void EnTite_Init(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.params == ENTITE_MINUS_3) {
this->actor.params = ENTITE_MINUS_2;
this->unk_2BE = 240;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.shape.yOffset = -3000.0f;
this->actor.shape.shadowDraw = NULL;
func_80895A10(this);
@@ -283,7 +271,7 @@ void func_80893DD4(EnTite* this) {
this->unk_2CC = 0.75f;
this->unk_2C4 = 1.0f;
Actor_SetColorFilter(&this->actor, 0x4000, 255, 0, 80);
- this->actor.flags &= ~0x200;
+ this->actor.flags &= ~ACTOR_FLAG_200;
}
void func_80893E54(EnTite* this, GlobalContext* globalCtx) {
@@ -292,12 +280,12 @@ void func_80893E54(EnTite* this, GlobalContext* globalCtx) {
this->collider.base.colType = COLTYPE_HIT6;
this->unk_2C4 = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2D0, 9, 2, 0.2f, 0.2f);
- this->actor.flags |= 0x200;
+ this->actor.flags |= ACTOR_FLAG_200;
}
}
void func_80893ED4(EnTite* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f);
this->unk_2BC = Rand_S16Offset(15, 30);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_80893F30;
@@ -315,7 +303,7 @@ void func_80893F30(EnTite* this, GlobalContext* globalCtx) {
}
void func_80893FD0(EnTite* this) {
- Animation_PlayOnce(&this->skelAnime, &D_0600083C);
+ Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_00083C);
this->actor.velocity.y = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
@@ -333,7 +321,7 @@ void func_80894024(EnTite* this, GlobalContext* globalCtx) {
}
void func_8089408C(EnTite* this, GlobalContext* globalCtx) {
- Animation_PlayOnce(&this->skelAnime, &D_060004F8);
+ Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_0004F8);
if (!func_80893ADC(this)) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_TEKU_JUMP);
} else {
@@ -362,7 +350,7 @@ void func_8089408C(EnTite* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.velocity.y = 10.0f;
} else {
this->actor.velocity.y = 8.0f;
@@ -394,7 +382,7 @@ void func_808942B4(EnTite* this, GlobalContext* globalCtx) {
}
}
} else if (!(this->collider.base.atFlags & AT_HIT)) {
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
} else {
this->collider.base.atFlags &= ~AT_HIT;
@@ -403,7 +391,7 @@ void func_808942B4(EnTite* this, GlobalContext* globalCtx) {
}
void func_80894414(EnTite* this) {
- Animation_PlayOnce(&this->skelAnime, &D_0600069C);
+ Animation_PlayOnce(&this->skelAnime, &object_tite_Anim_00069C);
this->actionFunc = func_80894454;
}
@@ -441,7 +429,7 @@ void func_808945B4(EnTite* this, GlobalContext* globalCtx) {
}
void func_808945EC(EnTite* this) {
- Animation_PlayLoop(&this->skelAnime, &D_06000A14);
+ Animation_PlayLoop(&this->skelAnime, &object_tite_Anim_000A14);
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actionFunc = func_80894638;
@@ -486,7 +474,7 @@ void func_80894638(EnTite* this, GlobalContext* globalCtx) {
}
void func_8089484C(EnTite* this) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000C70, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_tite_Anim_000C70, -3.0f);
if (this->actionFunc != func_80894910) {
this->unk_2B8 = Rand_S16Offset(1, 3);
}
@@ -547,7 +535,7 @@ void func_80894910(EnTite* this, GlobalContext* globalCtx) {
}
void func_80894B2C(EnTite* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_060012E4, 4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_tite_Anim_0012E4, 4.0f);
this->actor.speedXZ = -6.0f;
this->actor.gravity = -1.0f;
if (this->collider.base.ac != NULL) {
@@ -645,8 +633,8 @@ void func_80895020(EnTite* this, GlobalContext* globalCtx) {
this->collider.base.acFlags &= ~AC_ON;
this->actor.colorFilterTimer = 0;
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EN_TEKU_DEAD);
- this->actor.flags &= ~1;
- this->actor.flags |= 0x10;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10;
this->unk_2BA = 1;
Item_DropCollectibleRandom(globalCtx, &this->actor, &this->actor.world.pos, this->unk_2BE);
this->unk_2BC = 25;
@@ -690,7 +678,7 @@ void func_808951B8(EnTite* this, GlobalContext* globalCtx) {
}
void func_808952EC(EnTite* this) {
- Animation_PlayLoopSetSpeed(&this->skelAnime, &D_06000A14, 1.5f);
+ Animation_PlayLoopSetSpeed(&this->skelAnime, &object_tite_Anim_000A14, 1.5f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_LAST1_GROW_HEAD);
this->collider.base.acFlags &= ~AC_ON;
func_80893A18(this);
@@ -790,7 +778,7 @@ void func_80895738(EnTite* this, GlobalContext* globalCtx) {
} else if (this->unk_2BC > 0) {
this->unk_2BC--;
Math_StepToF(&this->actor.speedXZ, 10.0f, 0.3f);
- this->actor.flags |= 0x1000000;
+ this->actor.flags |= ACTOR_FLAG_1000000;
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (!func_80893A34(this, globalCtx)) {
this->unk_2BC = 0;
@@ -823,7 +811,7 @@ void func_80895A10(EnTite* this) {
s32 pad;
s16 rand;
- Animation_Change(&this->skelAnime, &D_06000A14, 2.0f, 0.0f, 0.0f, 0, 4.0f);
+ Animation_Change(&this->skelAnime, &object_tite_Anim_000A14, 2.0f, 0.0f, 0.0f, 0, 4.0f);
this->actor.speedXZ = 0.0f;
rand = Rand_S16Offset(20, 20);
this->unk_2BC = ((Rand_ZeroOne() < 0.5f) ? -1 : 1) * rand;
@@ -933,7 +921,7 @@ void func_80895E28(EnTite* this, GlobalContext* globalCtx) {
func_800B0DE0(globalCtx, &sp44, &sp38, &D_80896B44, &D_80896B3C, &D_80896B40, 500, 50);
if (Math_StepToF(&this->actor.shape.yOffset, 0.0f, 200.0f)) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->collider.base.acFlags |= AC_ON;
func_808945EC(this);
@@ -1025,7 +1013,7 @@ void func_80895FF8(EnTite* this, GlobalContext* globalCtx) {
} else if ((this->actor.bgCheckFlags & 1) && (this->collider.base.acFlags & AC_ON) &&
(this->actor.colChkInfo.health != 0) && (globalCtx->actorCtx.unk2 != 0) &&
(this->actor.xyzDistToPlayerSq < SQ(200.0f))) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
if (this->actor.shape.yOffset < 0.0f) {
this->actor.shape.yOffset = 0.0f;
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
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 102286a257..32e4c9c814 100644
--- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c
+++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c
@@ -7,8 +7,9 @@
#include "z_en_tk.h"
#include "overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
+#include "objects/object_tk/object_tk.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnTk*)thisx)
@@ -59,19 +60,6 @@ void func_80AEF2C8(Actor* thisx, GlobalContext* globalCtx);
void func_80AEF2D8(Actor* thisx, GlobalContext* globalCtx);
void func_80AEF5F4(Actor* thisx, GlobalContext* globalCtx);
-extern AnimationHeader D_06001144;
-extern AnimationHeader D_06001FA8;
-extern AnimationHeader D_060020C8;
-extern AnimationHeader D_060030A4;
-extern AnimationHeader D_06003724;
-extern AnimationHeader D_06003B10;
-extern AnimationHeader D_06003FB8;
-extern UNK_PTR D_06004390;
-extern UNK_PTR D_06004B90;
-extern UNK_PTR D_06005390;
-extern Gfx D_0600B530[];
-extern FlexSkeletonHeader D_0600B9E8;
-
static s32 D_80AF0050;
static u32 D_80AEF800[] = {
@@ -120,10 +108,11 @@ static u32 D_80AEF85C[] = {
0xFF000000,
};
-static struct_80B8E1A8 D_80AEF868[] = {
- { &D_06001FA8, 1.0f, 0, -10.0f }, { &D_06001FA8, 2.0f, 0, -10.0f }, { &D_060030A4, 1.0f, 0, -10.0f },
- { &D_06001144, 1.0f, 2, -10.0f }, { &D_06003724, 1.0f, 2, -10.0f }, { &D_06003FB8, 1.0f, 0, -10.0f },
- { &D_060020C8, 1.0f, 0, -10.0f }, { &D_06003B10, 1.0f, 0, -10.0f },
+static AnimationSpeedInfo D_80AEF868[] = {
+ { &object_tk_Anim_001FA8, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_001FA8, 2.0f, ANIMMODE_LOOP, -10.0f },
+ { &object_tk_Anim_0030A4, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_001144, 1.0f, ANIMMODE_ONCE, -10.0f },
+ { &object_tk_Anim_003724, 1.0f, ANIMMODE_ONCE, -10.0f }, { &object_tk_Anim_003FB8, 1.0f, ANIMMODE_LOOP, -10.0f },
+ { &object_tk_Anim_0020C8, 1.0f, ANIMMODE_LOOP, -10.0f }, { &object_tk_Anim_003B10, 1.0f, ANIMMODE_LOOP, -10.0f },
};
static s32 D_80AEF8E8[2] = { 0, 0 };
@@ -229,15 +218,17 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if ((this->unk_2B0 == 1) || (this->unk_2B0 == 3)) {
- this->actor.flags &= ~(0x8 | 0x1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
this->actor.update = func_80AEF2C8;
this->actor.draw = NULL;
return;
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B9E8, NULL, this->jointTable, this->morphTable, 18);
- Animation_Change(&this->skelAnime, &D_060030A4, 1.0f, 0.0f, Animation_GetLastFrame(&D_060030A4.common), 0, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_tk_Skel_00B9E8, NULL, this->jointTable, this->morphTable,
+ 18);
+ Animation_Change(&this->skelAnime, &object_tk_Anim_0030A4, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_tk_Anim_0030A4.common), 0, 0.0f);
this->unk_318 = 0;
this->unk_2D4 = -1;
Actor_SetScale(&this->actor, 0.01f);
@@ -255,9 +246,9 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.gravity = -1.0f;
this->actor.shape.rot.y = this->actor.world.rot.y;
- this->actor.flags |= 0x10;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
- func_8013E3B8(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
+ this->actor.flags |= ACTOR_FLAG_10;
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
+ SubS_FillCutscenesList(&this->actor, this->cutscenes, ARRAY_COUNT(this->cutscenes));
switch (this->unk_2B0) {
case 4:
@@ -294,13 +285,13 @@ void EnTk_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80AECA3C(EnTk* this, GlobalContext* globalCtx) {
this->unk_316 = 0;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->actionFunc = func_80AECA90;
}
void func_80AECA90(EnTk* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk11F22 = 0;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
func_80AEDE10(this, globalCtx);
} else if (this->actor.xzDistToPlayer < 100.0f) {
@@ -312,7 +303,7 @@ void func_80AECB0C(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
this->unk_3CC = 0xFF;
this->unk_2DC = 0.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
this->actionFunc = func_80AECB6C;
}
@@ -327,7 +318,7 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) {
this->actor.textId = 0;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk11F22 = 0;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
func_80AED4F8(this, globalCtx);
return;
@@ -340,7 +331,7 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) {
}
if (this->unk_2CA & 0x10) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4);
sp48 = 1.0f;
sp44 = 22.0f;
} else {
@@ -368,9 +359,9 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) {
if (!temp4 && (this->unk_3CC != 0)) {
this->actor.draw = NULL;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
} else if (temp4 && (this->unk_3CC == 0)) {
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.draw = EnTk_Draw;
}
@@ -378,7 +369,7 @@ void func_80AECB6C(EnTk* this, GlobalContext* globalCtx) {
func_80AECE0C(this, globalCtx);
if (this->unk_3CE & 8) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.draw = NULL;
}
}
@@ -392,7 +383,7 @@ void func_80AECE0C(EnTk* this, GlobalContext* globalCtx) {
}
s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
- EnDoor* sp4C4;
+ EnDoor* door;
f32 spA0[265];
Vec3f sp94;
Vec3f sp88;
@@ -445,7 +436,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
this->unk_3D4 = sp7C;
}
- sp4C4 = NULL;
+ door = NULL;
if (!(this->unk_2CA & 0xC00)) {
door1 = NULL;
label:
@@ -456,7 +447,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
if (ABS(BINANG_SUB(Actor_YawToPoint(&this->actor, &door1->world.pos), this->actor.shape.rot.y)) <=
0x2000) {
this->unk_2CA |= 0x400;
- sp4C4 = (EnDoor*)door1;
+ door = (EnDoor*)door1;
break;
}
}
@@ -469,7 +460,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
door2 = SubS_FindActor(globalCtx, door2, ACTORCAT_DOOR, ACTOR_EN_DOOR);
if (door2 != NULL) {
if (Actor_XZDistanceBetweenActors(&this->actor, door2) <= 160.0f) {
- sp4C4 = (EnDoor*)door2;
+ door = (EnDoor*)door2;
break;
}
door2 = door2->next;
@@ -477,19 +468,19 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
} while (door2 != NULL);
}
- if ((sp4C4 != NULL) && (this->unk_2CA & 0x400)) {
+ if ((door != NULL) && (this->unk_2CA & 0x400)) {
Vec3f sp5C;
- Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &sp4C4->actor.world.pos);
- sp4C4->unk_1A7 = 2;
+ Actor_OffsetOfPointInActorCoords(&this->actor, &sp5C, &door->dyna.actor.world.pos);
+ door->unk_1A7 = 2;
if (sp5C.z < -20.0f) {
this->unk_2CA &= ~0x400;
this->unk_2CA |= 0x800;
}
}
- if (sp4C4 != NULL) {
- if ((this->unk_2CA & 0x800) && (sp4C4->unk_1A7 == 0)) {
+ if (door != NULL) {
+ if ((this->unk_2CA & 0x800) && (door->unk_1A7 == 0)) {
this->unk_2CA &= ~0x800;
}
}
@@ -538,44 +529,44 @@ s32 func_80AED38C(EnTk* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
}
void func_80AED4F8(EnTk* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->actionFunc = func_80AED610;
}
void func_80AED544(EnTk* this, GlobalContext* globalCtx) {
if (!(gSaveContext.weekEventReg[31] & 0x10)) {
- func_801518B0(globalCtx, 0x13FE, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13FE, &this->actor);
gSaveContext.weekEventReg[31] |= 0x10;
} else if (gSaveContext.time < CLOCK_TIME(9, 0)) {
- func_801518B0(globalCtx, 0x13FF, &this->actor);
+ Message_StartTextbox(globalCtx, 0x13FF, &this->actor);
} else if (gSaveContext.time < CLOCK_TIME(12, 0)) {
- func_801518B0(globalCtx, 0x1400, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1400, &this->actor);
} else if (gSaveContext.time < CLOCK_TIME(15, 0)) {
- func_801518B0(globalCtx, 0x1401, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1401, &this->actor);
} else {
- func_801518B0(globalCtx, 0x1402, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1402, &this->actor);
}
}
void func_80AED610(EnTk* this, GlobalContext* globalCtx) {
if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
}
switch (Message_GetState(&globalCtx->msgCtx)) {
case 0:
if (Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer - 0x1555, 0x71C)) {
if (Player_GetMask(globalCtx) == PLAYER_MASK_CAPTAIN) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4);
- func_801518B0(globalCtx, 0x13FD, &this->actor);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4);
+ Message_StartTextbox(globalCtx, 0x13FD, &this->actor);
} else if (CURRENT_DAY != 2) {
func_80AED544(this, globalCtx);
} else if (!Flags_GetSwitch(globalCtx, ENTK_GET_7F0(&this->actor))) {
- func_801518B0(globalCtx, 0x1403, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1403, &this->actor);
} else if (gSaveContext.weekEventReg[60] & 2) {
func_80AED544(this, globalCtx);
} else {
- func_801518B0(globalCtx, 0x1413, &this->actor);
+ Message_StartTextbox(globalCtx, 0x1413, &this->actor);
}
break;
}
@@ -592,7 +583,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) {
switch (globalCtx->msgCtx.unk11F04) {
case 0x13FD:
this->unk_2CA |= 0x10;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
this->skelAnime.playSpeed = 10.0f;
this->actionFunc = func_80AECB6C;
break;
@@ -628,7 +619,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) {
case 0x1411:
case 0x1412:
default:
- func_8013E1C8(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 0, &this->unk_2D4);
this->actionFunc = func_80AECB6C;
break;
}
@@ -642,10 +633,10 @@ void func_80AED898(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
if (this->unk_2CA & 0x1000) {
if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
}
} else {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
}
this->actionFunc = func_80AED940;
}
@@ -675,7 +666,7 @@ void func_80AED940(EnTk* this, GlobalContext* globalCtx) {
}
if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
}
if (!(this->unk_2CA & 0x40)) {
@@ -698,8 +689,8 @@ void func_80AED940(EnTk* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_2CA &= ~0x80;
- this->actor.flags &= ~0x10000;
- globalCtx->msgCtx.unk11F22 = 0;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ globalCtx->msgCtx.msgMode = 0;
globalCtx->msgCtx.unk11F10 = 0;
func_80AEDE10(this, globalCtx);
} else if (!(this->unk_2CA & 0x80)) {
@@ -715,12 +706,13 @@ void func_80AEDBEC(EnTk* this, GlobalContext* globalCtx) {
this->actor.params = -1;
this->unk_2E8 = 0;
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->actionFunc = func_80AEDC4C;
}
void func_80AEDC4C(EnTk* this, GlobalContext* globalCtx) {
- if ((this->actor.params >= 0) && func_8013E2D4(&this->actor, this->cutscenes[1], this->actor.params, 0)) {
+ if ((this->actor.params >= 0) && SubS_StartActorCutscene(&this->actor, this->cutscenes[1], this->actor.params,
+ SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
this->unk_2E8 = ActorCutscene_GetLength(this->cutscenes[1]);
func_80151938(globalCtx, 0x1411);
func_80AEDCBC(this, globalCtx);
@@ -729,7 +721,7 @@ void func_80AEDC4C(EnTk* this, GlobalContext* globalCtx) {
void func_80AEDCBC(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 10.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 5, &this->unk_2D4);
Math_Vec3f_Copy(&this->actor.world.pos, &this->unk_2EC);
Math_Vec3f_Copy(&this->actor.prevPos, &this->unk_2EC);
Math_Vec3s_Copy(&this->actor.world.rot, &this->unk_2F8);
@@ -748,8 +740,8 @@ void func_80AEDD4C(EnTk* this, GlobalContext* globalCtx) {
void func_80AEDDA0(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
- this->actor.flags |= 0x10000;
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ this->actor.flags |= ACTOR_FLAG_10000;
this->unk_2CA |= 0x80;
this->actionFunc = func_80AED940;
}
@@ -777,13 +769,13 @@ void func_80AEDE10(EnTk* this, GlobalContext* globalCtx) {
break;
case 4:
- func_801518B0(globalCtx, 0x140F, &this->actor);
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ Message_StartTextbox(globalCtx, 0x140F, &this->actor);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
break;
case 3:
- func_801518B0(globalCtx, 0x1410, &this->actor);
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ Message_StartTextbox(globalCtx, 0x1410, &this->actor);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
break;
}
break;
@@ -798,7 +790,7 @@ void func_80AEDE10(EnTk* this, GlobalContext* globalCtx) {
void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) {
if ((this->unk_2D4 == 4) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 7, &this->unk_2D4);
}
switch (Message_GetState(&globalCtx->msgCtx)) {
@@ -814,16 +806,16 @@ void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) {
!Math_SmoothStepToS(&this->unk_31C, 0, 3, 0x71C, 10) &&
(this->actor.shape.rot.y == (s16)(this->actor.yawTowardsPlayer - 0x1555))) {
if (this->unk_2E6 == 0x1404) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 4, &this->unk_2D4);
} else {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
}
- func_801518B0(globalCtx, this->unk_2E6, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_2E6, &this->actor);
}
break;
case 0x1414:
- func_801518B0(globalCtx, this->unk_2E6, &this->actor);
+ Message_StartTextbox(globalCtx, this->unk_2E6, &this->actor);
break;
}
break;
@@ -880,7 +872,7 @@ void func_80AEDF5C(EnTk* this, GlobalContext* globalCtx) {
this->unk_2CA |= 2;
if (globalCtx->msgCtx.choiceIndex == 0) {
func_8019F208();
- globalCtx->msgCtx.unk11F22 = 0x44;
+ globalCtx->msgCtx.msgMode = 0x44;
func_80AEE2A8(this, globalCtx);
} else {
func_8019F230();
@@ -908,7 +900,7 @@ void func_80AEE2A8(EnTk* this, GlobalContext* globalCtx) {
}
void func_80AEE2C0(EnTk* this, GlobalContext* globalCtx) {
- if (func_8013E2D4(&this->actor, this->cutscenes[0], 0x7C, 0)) {
+ if (SubS_StartActorCutscene(&this->actor, this->cutscenes[0], 0x7C, SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
func_80AEE374(this, globalCtx);
}
}
@@ -952,7 +944,7 @@ void func_80AEE414(EnTk* this, GlobalContext* globalCtx) {
void func_80AEE478(EnTk* this, GlobalContext* globalCtx) {
this->unk_310 = 2;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 3, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 3, &this->unk_2D4);
this->actionFunc = func_80AEE4D0;
}
@@ -1004,12 +996,12 @@ void func_80AEE6B8(EnTk* this, GlobalContext* globalCtx) {
ActorCutscene_Stop(this->cutscenes[0]);
func_801477B4(globalCtx);
func_80AEDBEC(this, globalCtx);
- } else if (func_8013E2D4(&this->actor, 0x7C, this->cutscenes[0], 0)) {
+ } else if (SubS_StartActorCutscene(&this->actor, 0x7C, this->cutscenes[0], SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
this->unk_310 = 3;
func_80AEDE10(this, globalCtx);
this->unk_2CA &= ~0x20;
}
- } else if (func_8013E2D4(&this->actor, 0x7C, this->cutscenes[0], 0)) {
+ } else if (SubS_StartActorCutscene(&this->actor, 0x7C, this->cutscenes[0], SUBS_CUTSCENE_SET_UNK_LINK_FIELDS)) {
this->unk_310 = 4;
func_80AEDE10(this, globalCtx);
}
@@ -1145,7 +1137,7 @@ void func_80AEEB88(EnTk* this, GlobalContext* globalCtx) {
}
this->unk_2C6 = 100;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
this->unk_30C = func_80AEED38;
}
@@ -1186,9 +1178,9 @@ void func_80AEED38(EnTk* this, GlobalContext* globalCtx) {
}
if (this->unk_2CA & 0x200) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
} else {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp64);
}
@@ -1197,15 +1189,15 @@ void func_80AEED38(EnTk* this, GlobalContext* globalCtx) {
this->actor.shape.rot.y = this->actor.world.rot.y;
}
- if (!Message_GetState(&globalCtx->msgCtx) && !func_801690CC(globalCtx) && (this->unk_2C6-- <= 0)) {
- func_801518B0(globalCtx, 0x140C, NULL);
+ if (Message_GetState(&globalCtx->msgCtx) == 0 && !func_801690CC(globalCtx) && (this->unk_2C6-- <= 0)) {
+ Message_StartTextbox(globalCtx, 0x140C, NULL);
this->unk_2CA |= 0x4000;
this->unk_2C6 = 200;
}
}
void func_80AEF048(EnTk* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
this->unk_30C = func_80AEF094;
}
@@ -1213,9 +1205,9 @@ void func_80AEF094(EnTk* this, GlobalContext* globalCtx) {
f32 sp2C;
if (this->unk_2CA & 0x200) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
} else {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 1, &this->unk_2D4);
func_80AEC658(&this->skelAnime, this->unk_320, 1.0f, &this->actor.speedXZ, &sp2C);
}
@@ -1227,7 +1219,7 @@ void func_80AEF094(EnTk* this, GlobalContext* globalCtx) {
void func_80AEF15C(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->unk_30C = func_80AEF1B4;
}
@@ -1235,7 +1227,7 @@ void func_80AEF1B4(EnTk* this, GlobalContext* globalCtx) {
}
void func_80AEF1C4(EnTk* this, GlobalContext* globalCtx) {
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->unk_30C = func_80AEF210;
}
@@ -1244,7 +1236,7 @@ void func_80AEF210(EnTk* this, GlobalContext* globalCtx) {
void func_80AEF220(EnTk* this, GlobalContext* globalCtx) {
this->actor.speedXZ = 0.0f;
- func_8013E1C8(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
+ SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, D_80AEF868, 2, &this->unk_2D4);
this->unk_30C = func_80AEF278;
}
@@ -1344,7 +1336,7 @@ void func_80AEF5F4(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
-s32 func_80AEF65C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnTk_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnTk* this = THIS;
if (limbIndex == 16) {
@@ -1354,7 +1346,7 @@ s32 func_80AEF65C(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
return false;
}
-void func_80AEF6A4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80AEFA84 = { 0.0f, 0.0f, 4600.0f };
EnTk* this = THIS;
@@ -1369,7 +1361,7 @@ void func_80AEF6A4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
OPEN_DISPS(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, D_0600B530);
+ gSPDisplayList(POLY_OPA_DISP++, object_tk_DL_00B530);
CLOSE_DISPS(globalCtx->state.gfxCtx);
break;
@@ -1378,10 +1370,10 @@ void func_80AEF6A4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
}
void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static UNK_PTR D_80AEFA90[] = {
- &D_06004390,
- &D_06004B90,
- &D_06005390,
+ static TexturePtr D_80AEFA90[] = {
+ object_tk_Tex_004390,
+ object_tk_Tex_004B90,
+ object_tk_Tex_005390,
};
s32 pad;
EnTk* this = THIS;
@@ -1394,7 +1386,7 @@ void EnTk_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_RotateY(this->unk_318, MTXMODE_APPLY);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- func_80AEF65C, func_80AEF6A4, &this->actor);
+ EnTk_OverrideLimbDraw, EnTk_PostLimbDraw, &this->actor);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 9f0ce13f8d..98ea88f83b 100644
--- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
+++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c
@@ -5,7 +5,9 @@
*/
#include "z_en_torch2.h"
-#define FLAGS 0x00000010
+#include "objects/gameplay_keep/gameplay_keep.h"
+
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnTorch2*)thisx)
@@ -43,11 +45,11 @@ static InitChainEntry sInitChain[] = {
// Shells for each of Link's different forms
// (Playing elegy as Fierce Deity puts down a human shell)
static Gfx* sShellDLists[] = {
- D_0401C430, // Human
- D_04048DF0, // Zora
- D_04089070, // Deku
- D_04057B10, // Goron
- D_0401C430, // Human
+ gameplay_keep_DL_01C430, // Human
+ gameplay_keep_DL_048DF0, // Zora
+ gameplay_keep_DL_089070, // Deku
+ gameplay_keep_DL_057B10, // Goron
+ gameplay_keep_DL_01C430, // Human
};
void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -60,9 +62,9 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx) {
// params: which form Link is in (e.g. human, deku, etc.)
params = this->actor.params;
if (params != TORCH2_PARAM_DEKU) {
- this->actor.flags |= 0x4000000; // Can press switch
+ this->actor.flags |= ACTOR_FLAG_4000000; // Can press switch
if (params == TORCH2_PARAM_GORON) {
- this->actor.flags |= 0x20000; // Can press heavy switches
+ this->actor.flags |= ACTOR_FLAG_20000; // Can press heavy switches
}
}
this->framesUntilNextState = 20;
diff --git a/src/overlays/actors/ovl_En_Toto/z_en_toto.c b/src/overlays/actors/ovl_En_Toto/z_en_toto.c
index f92ef5afda..746aec8830 100644
--- a/src/overlays/actors/ovl_En_Toto/z_en_toto.c
+++ b/src/overlays/actors/ovl_En_Toto/z_en_toto.c
@@ -5,8 +5,9 @@
*/
#include "z_en_toto.h"
+#include "objects/object_zm/object_zm.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnToto*)thisx)
@@ -61,23 +62,6 @@ const ActorInit En_Toto_InitVars = {
(ActorFunc)EnToto_Draw,
};
-extern AnimationHeader D_06000C80;
-extern AnimationHeader D_06001324;
-extern AnimationHeader D_060016A4;
-extern AnimationHeader D_06001DF0;
-extern AnimationHeader D_060022C8;
-extern AnimationHeader D_060028B8;
-extern AnimationHeader D_06002F20;
-extern AnimationHeader D_06003AA8;
-extern UNK_TYPE D_06008AE8;
-extern UNK_TYPE D_0600A068;
-extern UNK_TYPE D_0600A468;
-extern FlexSkeletonHeader D_0600A978;
-extern AnimationHeader D_0600B3E0;
-extern AnimationHeader D_0600B894;
-extern AnimationHeader D_0600BC08;
-extern AnimationHeader D_0600C880;
-
static ColliderCylinderInit sCylinderInit = {
{
COLTYPE_METAL,
@@ -142,7 +126,8 @@ static EnTotoText D_80BA5074[] = {
{ 4, 0, 0x2AE4 },
};
-static AnimationHeader* D_80BA5078[] = { &D_060028B8, &D_0600B894, &D_06002F20, &D_0600BC08 };
+static AnimationHeader* D_80BA5078[] = { &object_zm_Anim_0028B8, &object_zm_Anim_00B894, &object_zm_Anim_002F20,
+ &object_zm_Anim_00BC08 };
static EnTotoText D_80BA5088[] = {
{ 5, 0, 0 }, { 6, 20, 0 }, { 7, 0, 0 }, { 8, 9, 0 }, { 9, 10, 0 }, { 1, 0, 0 }, { 10, 0, 0 },
@@ -199,15 +184,15 @@ void EnToto_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
- if (globalCtx->sceneNum == 0x15 && (gSaveContext.time >= 0x4000 && gSaveContext.time < 0xE555)) {
+ if (globalCtx->sceneNum == SCENE_MILK_BAR && (gSaveContext.time >= 0x4000 && gSaveContext.time < 0xE555)) {
Actor_MarkForDeath(&this->actor);
return;
}
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
this->actor.bgCheckFlags |= 0x400;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600A978,
- ((globalCtx->sceneNum == 0x12) ? &D_06003AA8 : &D_0600C880), this->jointTable, this->morphTable,
- 18);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zm_Skel_00A978,
+ ((globalCtx->sceneNum == SCENE_SONCHONOIE) ? &object_zm_Anim_003AA8 : &object_zm_Anim_00C880),
+ this->jointTable, this->morphTable, 18);
func_80BA36C0(this, globalCtx, 0);
this->actor.shape.rot.x = 0;
}
@@ -219,7 +204,8 @@ void EnToto_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void func_80BA383C(EnToto* this, GlobalContext* globalCtx) {
- if (SkelAnime_Update(&this->skelAnime) && this->actionFuncIndex == 1 && this->skelAnime.animation != &D_06000C80) {
+ if (SkelAnime_Update(&this->skelAnime) && this->actionFuncIndex == 1 &&
+ this->skelAnime.animation != &object_zm_Anim_000C80) {
if (globalCtx->msgCtx.unk11F04 != 0x2A98 && globalCtx->msgCtx.unk11F04 != 0x2A99) {
if (this->unk2B4 & 1 || Rand_ZeroOne() > 0.5f) {
this->unk2B4 = (this->unk2B4 + 1) & 3;
@@ -231,10 +217,10 @@ void func_80BA383C(EnToto* this, GlobalContext* globalCtx) {
}
void func_80BA3930(EnToto* this, GlobalContext* globalCtx) {
- AnimationHeader* animationHeader = &D_0600C880;
+ AnimationHeader* animationHeader = &object_zm_Anim_00C880;
- if (globalCtx->sceneNum == 0x12) {
- animationHeader = &D_06003AA8;
+ if (globalCtx->sceneNum == SCENE_SONCHONOIE) {
+ animationHeader = &object_zm_Anim_003AA8;
}
Animation_MorphToLoop(&this->skelAnime, animationHeader, -4.0f);
}
@@ -255,7 +241,7 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) {
func_80BA383C(this, globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
func_80BA36C0(this, globalCtx, 1);
- if (globalCtx->sceneNum != 0x12) {
+ if (globalCtx->sceneNum != SCENE_SONCHONOIE) {
Flags_SetSwitch(globalCtx, this->actor.params & 0x7F);
} else if (player->transformation == PLAYER_FORM_DEKU) {
Flags_SetSwitch(globalCtx, this->actor.home.rot.x);
@@ -264,16 +250,16 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) {
return;
}
- if ((globalCtx->sceneNum == 0x15 && !(gSaveContext.time >= 0x4000 && gSaveContext.time < 0xED02)) ||
- (globalCtx->sceneNum != 0x15 && func_80BA397C(this, 0x2000))) {
+ if ((globalCtx->sceneNum == SCENE_MILK_BAR && !(gSaveContext.time >= 0x4000 && gSaveContext.time < 0xED02)) ||
+ (globalCtx->sceneNum != SCENE_MILK_BAR && func_80BA397C(this, 0x2000))) {
if (this->unk2B6 != 0) {
this->text = D_80BA5044;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 9999.9f, 9999.9f, EXCH_ITEM_NONE);
} else {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 50.0f);
- if (globalCtx->sceneNum == 0x12) {
+ if (globalCtx->sceneNum == SCENE_SONCHONOIE) {
if (player->transformation == PLAYER_FORM_DEKU) {
if (!Flags_GetSwitch(globalCtx, this->actor.home.rot.x)) {
this->text = D_80BA5068;
@@ -297,14 +283,14 @@ void func_80BA39C8(EnToto* this, GlobalContext* globalCtx) {
}
void func_80BA3BFC(EnToto* this, GlobalContext* globalCtx) {
- if (globalCtx->sceneNum == 0x12) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06000C80, -4.0f);
+ if (globalCtx->sceneNum == SCENE_SONCHONOIE) {
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_000C80, -4.0f);
this->unk2B4 = 0;
} else {
if (this->text->unk0 == 4) {
func_80151BB4(globalCtx, 9);
}
- Animation_MorphToLoop(&this->skelAnime, &D_0600B3E0, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_zm_Anim_00B3E0, -4.0f);
}
}
@@ -393,7 +379,7 @@ s32 func_80BA3FB0(EnToto* this, GlobalContext* globalCtx) {
s32 func_80BA3FCC(EnToto* this, GlobalContext* globalCtx) {
if (DECR(this->unk2B1) == 0) {
- func_801518B0(globalCtx, this->text->textId, NULL);
+ Message_StartTextbox(globalCtx, this->text->textId, NULL);
return 1;
}
return 0;
@@ -450,7 +436,7 @@ s32 func_80BA4204(EnToto* this, GlobalContext* globalCtx) {
if (DECR(this->unk2B1) == 0) {
if (!ENTOTO_WEEK_EVENT_FLAGS) {
temp_v1_2 = &D_80BA50DC[gSaveContext.playerForm - 1];
- func_801518B0(globalCtx, (this->text->unk0 == 6) ? temp_v1_2->unk0 : temp_v1_2->unk4, NULL);
+ Message_StartTextbox(globalCtx, (this->text->unk0 == 6) ? temp_v1_2->unk0 : temp_v1_2->unk4, NULL);
}
return 1;
}
@@ -542,7 +528,7 @@ s32 func_80BA4530(EnToto* this, GlobalContext* globalCtx) {
this->unk2B1++;
if (this->unk2B1 >= 10) {
tmp = gSaveContext.playerForm; // Needed for regalloc possible FAKE MATCH
- func_801518B0(globalCtx, D_80BA50DC[tmp - 1].unk2, NULL);
+ Message_StartTextbox(globalCtx, D_80BA50DC[tmp - 1].unk2, NULL);
}
}
return 0;
@@ -561,7 +547,7 @@ s32 func_80BA46D8(EnToto* this, GlobalContext* globalCtx) {
}
s32 func_80BA4740(EnToto* this, GlobalContext* globalCtx) {
- if (globalCtx->msgCtx.unk1202A == 4) {
+ if (globalCtx->msgCtx.ocarinaMode == 4) {
if (gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
gSaveContext.weekEventReg[56] |= 0x10;
}
@@ -652,7 +638,7 @@ s32 func_80BA4B24(EnToto* this, GlobalContext* globalCtx) {
if (func_80BA40D4(this, globalCtx)) {
player = GET_PLAYER(globalCtx);
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060028B8, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_0028B8, -4.0f);
if (player->transformation == PLAYER_FORM_ZORA) {
if (!Flags_GetSwitch(globalCtx, this->actor.params & 0x7F)) {
Flags_SetSwitch(globalCtx, this->actor.params & 0x7F);
@@ -688,16 +674,16 @@ s32 func_80BA4C44(EnToto* this, GlobalContext* globalCtx) {
}
void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) {
- CsCmdActorAction* action;
+ CsCmdActorAction* action = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 525)];
- action = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x20D)];
- if (this->unk2B5 != action->unk0) {
- this->unk2B5 = action->unk0;
+ if (this->unk2B5 != action->action) {
+ this->unk2B5 = action->action;
if (this->unk2B5 != 4) {
if (this->unk2B5 == 3) {
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06001DF0, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_zm_Anim_001DF0, -4.0f);
} else {
- Animation_PlayOnce(&this->skelAnime, this->unk2B5 == 1 ? &D_060016A4 : &D_060022C8);
+ Animation_PlayOnce(&this->skelAnime,
+ this->unk2B5 == 1 ? &object_zm_Anim_0016A4 : &object_zm_Anim_0022C8);
if (this->unk2B5 == 2 && this->unk2B3 != 0xF) {
func_80151BB4(globalCtx, 9);
func_80151BB4(globalCtx, 10);
@@ -708,7 +694,7 @@ void func_80BA4CB4(EnToto* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 0x320);
if (SkelAnime_Update(&this->skelAnime)) {
if (this->unk2B5 != 3) {
- Animation_PlayLoop(&this->skelAnime, this->unk2B5 == 1 ? &D_0600C880 : &D_06001324);
+ Animation_PlayLoop(&this->skelAnime, this->unk2B5 == 1 ? &object_zm_Anim_00C880 : &object_zm_Anim_001324);
}
}
if (this->unk2B5 == 4 && !Actor_HasParent(&this->actor, globalCtx)) {
@@ -720,7 +706,7 @@ void EnToto_Update(Actor* thisx, GlobalContext* globalCtx) {
EnToto* this = THIS;
s32 pad;
- if (func_800EE29C(globalCtx, 0x20D)) {
+ if (Cutscene_CheckActorAction(globalCtx, 0x20D)) {
func_80BA4CB4(this, globalCtx);
} else {
D_80BA51B8[this->actionFuncIndex](this, globalCtx);
@@ -734,7 +720,7 @@ void EnToto_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnToto_Draw(Actor* thisx, GlobalContext* globalCtx) {
- void* sp4C[] = { &D_06008AE8, &D_0600A068, &D_0600A468 };
+ TexturePtr sp4C[] = { object_zm_Tex_008AE8, object_zm_Tex_00A068, object_zm_Tex_00A468 };
EnToto* this = THIS;
s32 pad;
diff --git a/src/overlays/actors/ovl_En_Trt/z_en_trt.c b/src/overlays/actors/ovl_En_Trt/z_en_trt.c
index 98bcf100b7..075d42337d 100644
--- a/src/overlays/actors/ovl_En_Trt/z_en_trt.c
+++ b/src/overlays/actors/ovl_En_Trt/z_en_trt.c
@@ -5,8 +5,10 @@
*/
#include "z_en_trt.h"
+#include "objects/object_trt/object_trt.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnTrt*)thisx)
@@ -62,29 +64,17 @@ void EnTrt_Blink(EnTrt* this);
void EnTrt_OpenEyes2(EnTrt* this);
void EnTrt_NodOff(EnTrt* this);
-extern UNK_TYPE D_0401F740;
-extern UNK_TYPE D_0401F8C0;
-extern UNK_TYPE D_0401F7C0;
-extern FlexSkeletonHeader D_0600FEF0;
-extern AnimationHeader D_0600FD34;
-extern AnimationHeader D_0600DE68;
-extern AnimationHeader D_06002224;
-extern AnimationHeader D_06001EF4;
-extern AnimationHeader D_060030EC;
-extern AnimationHeader D_0600D52C;
-extern AnimationHeader D_06002CB0;
-extern AnimationHeader D_0600EE98;
-extern AnimationHeader D_06003D78;
-extern AnimationHeader D_06000A44;
-extern TexturePtr D_0600B0B8;
-extern TexturePtr D_0600B8B8;
-extern TexturePtr D_0600C0B8;
-
-static ActorAnimationEntryS sAnimations[] = {
- { &D_0600DE68, 1.0f, 0, -1, 2, 0 }, { &D_0600EE98, 1.0f, 0, -1, 2, 0 }, { &D_0600FD34, 1.0f, 0, -1, 0, 0 },
- { &D_060030EC, 1.0f, 0, -1, 2, 0 }, { &D_06003D78, 1.0f, 0, -1, 2, 0 }, { &D_0600D52C, 1.0f, 0, -1, 0, 0 },
- { &D_06000A44, 1.0f, 0, -1, 0, 0 }, { &D_06001EF4, 1.0f, 0, -1, 0, 0 }, { &D_06002224, 1.0f, 0, -1, 0, 0 },
- { &D_06002CB0, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS sAnimations[] = {
+ { &object_trt_Anim_00DE68, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00EE98, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00FD34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_0030EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_003D78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00D52C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_000A44, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_001EF4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_002224, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_002CB0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
const ActorInit En_Trt_InitVars = {
@@ -107,17 +97,17 @@ static ShopItem sShop[] = {
{ SI_POTION_BLUE, { -12, 32, -36 } },
};
-void EnTrt_ChangeAnim(SkelAnime* skelAnime, ActorAnimationEntryS* animations, s32 idx) {
+void EnTrt_ChangeAnim(SkelAnime* skelAnime, AnimationInfoS* animations, s32 idx) {
f32 frameCount;
animations += idx;
if (animations->frameCount < 0) {
- frameCount = Animation_GetLastFrame(animations->animationSeg);
+ frameCount = Animation_GetLastFrame(animations->animation);
} else {
frameCount = animations->frameCount;
}
- Animation_Change(skelAnime, animations->animationSeg, animations->playbackSpeed, animations->frame, frameCount,
- animations->mode, animations->transitionRate);
+ Animation_Change(skelAnime, animations->animation, animations->playSpeed, animations->startFrame, frameCount,
+ animations->mode, animations->morphFrames);
}
s32 EnTrt_TestItemSelected(GlobalContext* globalCtx) {
@@ -199,7 +189,7 @@ u16 EnTrt_GetItemTextId(EnTrt* this) {
u16 EnTrt_GetItemChoiceTextId(EnTrt* this) {
EnGirlA* item = this->items[this->cursorIdx];
- if (item->actor.params == SI_POTION_BLUE && !(gSaveContext.weekEventReg[0x35] & 0x10)) {
+ if (item->actor.params == SI_POTION_BLUE && !(gSaveContext.weekEventReg[53] & 0x10)) {
this->textId = 0x881;
return 0x881;
}
@@ -214,7 +204,7 @@ void EnTrt_EndInteraction(GlobalContext* globalCtx, EnTrt* this) {
this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED;
}
Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
Interface_ChangeAlpha(50);
this->drawCursor = 0;
@@ -344,20 +334,20 @@ void EnTrt_GetMushroom(EnTrt* this, GlobalContext* globalCtx) {
switch (this->textId) {
case 0x883:
this->textId = 0x884;
- func_801518B0(globalCtx, this->textId, &this->actor);
- gSaveContext.weekEventReg[0x35] |= 8;
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
+ gSaveContext.weekEventReg[53] |= 8;
func_80123D50(globalCtx, GET_PLAYER(globalCtx), ITEM_BOTTLE, PLAYER_AP_BOTTLE);
break;
case 0x888:
this->textId = 0x889;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
break;
case 0x889:
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING_SPECIAL) {
ActorCutscene_Stop(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED;
}
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = EnTrt_PayForMushroom;
break;
@@ -397,43 +387,43 @@ void EnTrt_Goodbye(EnTrt* this, GlobalContext* globalCtx) {
void EnTrt_SetupTryToGiveRedPotion(EnTrt* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) {
if (this->textId == 0x88F) {
- if (func_80114E90() || !(gSaveContext.weekEventReg[0xC] & 0x10)) {
+ if (Interface_HasEmptyBottle() || !(gSaveContext.weekEventReg[12] & 0x10)) {
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) {
ActorCutscene_Stop(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED;
}
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = EnTrt_GiveRedPotionForKoume;
} else {
this->tmpTextId = this->textId;
this->textId = 0x88E;
- gSaveContext.weekEventReg[0x55] |= 8;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ gSaveContext.weekEventReg[85] |= 8;
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->actionFunc = EnTrt_EndConversation;
}
} else {
- if (gSaveContext.weekEventReg[0xC] & 8) {
+ if (gSaveContext.weekEventReg[12] & 8) {
this->textId = 0x83D;
EnTrt_SetupStartShopping(globalCtx, this, 0);
- } else if (gSaveContext.weekEventReg[0x54] & 0x40) {
+ } else if (gSaveContext.weekEventReg[84] & 0x40) {
this->textId = 0x83B;
- if (func_80114F2C(ITEM_POTION_RED)) {
+ if (Interface_HasItemInBottle(ITEM_POTION_RED)) {
EnTrt_SetupStartShopping(globalCtx, this, false);
} else {
this->actionFunc = EnTrt_TryToGiveRedPotion;
}
- } else if (gSaveContext.weekEventReg[0x10] & 0x10) {
+ } else if (gSaveContext.weekEventReg[16] & 0x10) {
this->timer = 30;
this->textId = 0x838;
this->cutsceneState = ENTRT_CUTSCENESTATE_PLAYING_SPECIAL;
this->actionFunc = EnTrt_Surprised;
return;
- } else if (gSaveContext.weekEventReg[0x11] & 1) {
+ } else if (gSaveContext.weekEventReg[17] & 1) {
this->textId = 0x835;
EnTrt_SetupStartShopping(globalCtx, this, false);
}
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
}
}
}
@@ -443,13 +433,13 @@ void EnTrt_GiveRedPotionForKoume(EnTrt* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
- if (!(gSaveContext.weekEventReg[0xC] & 0x10)) {
- gSaveContext.weekEventReg[0xC] |= 0x10;
+ if (!(gSaveContext.weekEventReg[12] & 0x10)) {
+ gSaveContext.weekEventReg[12] |= 0x10;
}
- gSaveContext.weekEventReg[0x54] |= 0x40;
+ gSaveContext.weekEventReg[84] |= 0x40;
player->stateFlags2 &= ~0x20000000;
this->actionFunc = EnTrt_GivenRedPotionForKoume;
- } else if (gSaveContext.weekEventReg[0xC] & 0x10) {
+ } else if (gSaveContext.weekEventReg[12] & 0x10) {
Actor_PickUp(&this->actor, globalCtx, GI_POTION_RED, 300.0f, 300.0f);
} else {
Actor_PickUp(&this->actor, globalCtx, GI_BOTTLE_POTION_RED, 300.0f, 300.0f);
@@ -647,7 +637,7 @@ void EnTrt_SetupBuyItemWithFanfare(GlobalContext* globalCtx, EnTrt* this) {
Player* player = GET_PLAYER(globalCtx);
Actor_PickUp(&this->actor, globalCtx, this->items[this->cursorIdx]->getItemId, 300.0f, 300.0f);
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
player->stateFlags2 &= ~0x20000000;
Interface_ChangeAlpha(50);
@@ -730,7 +720,7 @@ void EnTrt_SelectItem(EnTrt* this, GlobalContext* globalCtx) {
}
}
} else if (talkState == 5 && func_80147624(globalCtx)) {
- if (!func_80114E90()) {
+ if (!Interface_HasEmptyBottle()) {
play_sound(NA_SE_SY_ERROR);
EnTrt_SetupCannotBuy(globalCtx, this, 0x846);
} else {
@@ -742,7 +732,7 @@ void EnTrt_SelectItem(EnTrt* this, GlobalContext* globalCtx) {
this->drawCursor = 0;
this->shopItemSelectedTween = 0.0f;
item->boughtFunc(globalCtx, item);
- gSaveContext.weekEventReg[0x35] |= 0x10;
+ gSaveContext.weekEventReg[53] |= 0x10;
}
}
}
@@ -751,14 +741,14 @@ void EnTrt_SelectItem(EnTrt* this, GlobalContext* globalCtx) {
void EnTrt_IdleSleeping(EnTrt* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
- if ((gSaveContext.weekEventReg[0x55] & 8) && !(gSaveContext.weekEventReg[0x54] & 0x40)) {
+ if ((gSaveContext.weekEventReg[85] & 8) && !(gSaveContext.weekEventReg[84] & 0x40)) {
this->textId = 0x88F;
} else if (!(this->flags & ENTRT_MET)) {
this->textId = 0x834;
} else {
this->textId = 0x83E;
}
- if (!(gSaveContext.weekEventReg[0x35] & 8)) {
+ if (!(gSaveContext.weekEventReg[53] & 8)) {
this->talkOptionTextId = 0x845;
} else if (this->flags & ENTRT_GIVEN_MUSHROOM) {
this->talkOptionTextId = 0x882;
@@ -852,7 +842,7 @@ void EnTrt_IdleAwake(EnTrt* this, GlobalContext* globalCtx) {
void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) {
s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed;
- s16 animLastFrame = Animation_GetLastFrame(&D_060030EC) / (s16)this->skelAnime.playSpeed;
+ s16 animLastFrame = Animation_GetLastFrame(&object_trt_Anim_0030EC) / (s16)this->skelAnime.playSpeed;
if (this->cutsceneState == ENTRT_CUTSCENESTATE_WAITING) {
if (ActorCutscene_GetCanPlayNext(this->cutscene)) {
@@ -879,12 +869,12 @@ void EnTrt_BeginInteraction(EnTrt* this, GlobalContext* globalCtx) {
} else if (DECR(this->timer) == 0) {
this->timer = Rand_S16Offset(40, 20);
EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5);
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->animationIdx = 5;
switch (this->textId) {
case 0x834:
- if (!(gSaveContext.weekEventReg[0xC] & 8) && !(gSaveContext.weekEventReg[0x54] & 0x40) &&
- !(gSaveContext.weekEventReg[0x10] & 0x10) && !(gSaveContext.weekEventReg[0x11] & 1)) {
+ if (!(gSaveContext.weekEventReg[12] & 8) && !(gSaveContext.weekEventReg[84] & 0x40) &&
+ !(gSaveContext.weekEventReg[16] & 0x10) && !(gSaveContext.weekEventReg[17] & 1)) {
func_8011552C(globalCtx, 6);
this->stickLeftPrompt.isEnabled = false;
this->stickRightPrompt.isEnabled = true;
@@ -930,7 +920,7 @@ void EnTrt_Surprised(EnTrt* this, GlobalContext* globalCtx) {
} else if (DECR(this->timer) == 0) {
this->timer = Rand_S16Offset(40, 20);
EnTrt_ChangeAnim(&this->skelAnime, sAnimations, 5);
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->animationIdx = 5;
this->actionFunc = EnTrt_TryToGiveRedPotionAfterSurprised;
}
@@ -941,7 +931,7 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, GlobalContext* globalCt
this->blinkFunc = EnTrt_Blink;
if (talkState == 6 && func_80147624(globalCtx)) {
- if (func_80114E90() || !(gSaveContext.weekEventReg[0xC] & 0x10)) {
+ if (Interface_HasEmptyBottle() || !(gSaveContext.weekEventReg[12] & 0x10)) {
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) {
ActorCutscene_Stop(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED;
@@ -950,8 +940,8 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, GlobalContext* globalCt
} else {
this->tmpTextId = this->textId;
this->textId = 0x88E;
- gSaveContext.weekEventReg[0x55] |= 8;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ gSaveContext.weekEventReg[85] |= 8;
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->actionFunc = EnTrt_EndConversation;
}
}
@@ -960,24 +950,24 @@ void EnTrt_TryToGiveRedPotionAfterSurprised(EnTrt* this, GlobalContext* globalCt
void EnTrt_TryToGiveRedPotion(EnTrt* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx)) {
if (this->textId == 0x83C) {
- if (func_80114E90()) {
+ if (Interface_HasEmptyBottle()) {
if (this->cutsceneState == ENTRT_CUTSCENESTATE_PLAYING) {
ActorCutscene_Stop(this->cutscene);
this->cutsceneState = ENTRT_CUTSCENESTATE_STOPPED;
}
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
this->actionFunc = EnTrt_GiveRedPotionForKoume;
} else {
this->tmpTextId = this->textId;
this->textId = 0x88E;
- gSaveContext.weekEventReg[0x55] |= 8;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ gSaveContext.weekEventReg[85] |= 8;
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->actionFunc = EnTrt_EndConversation;
}
} else {
this->textId = 0x83C;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
}
}
}
@@ -1035,7 +1025,7 @@ void EnTrt_ShopkeeperGone(EnTrt* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
} else {
if ((player->actor.world.pos.x >= -50.0f && player->actor.world.pos.x <= 50.0f) &&
(player->actor.world.pos.z >= -19.0f && player->actor.world.pos.z <= 30.0f)) {
@@ -1043,7 +1033,7 @@ void EnTrt_ShopkeeperGone(EnTrt* this, GlobalContext* globalCtx) {
}
}
if (talkState == 6 && func_80147624(globalCtx)) {
- if (gSaveContext.weekEventReg[0x14] & 2) {
+ if (gSaveContext.weekEventReg[20] & 2) {
globalCtx->nextEntranceIndex = 0xC50;
} else {
globalCtx->nextEntranceIndex = 0x8450;
@@ -1114,7 +1104,7 @@ void EnTrt_ContinueShopping(EnTrt* this, GlobalContext* globalCtx) {
func_8019F208();
player->actor.shape.rot.y = BINANG_ROT180(player->actor.shape.rot.y);
player->stateFlags2 |= 0x20000000;
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
EnTrt_SetupStartShopping(globalCtx, this, true);
func_800B85E0(&this->actor, globalCtx, 400.0f, EXCH_ITEM_MINUS1);
break;
@@ -1384,7 +1374,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) {
itemGiven = func_80123810(globalCtx);
if (itemGiven > EXCH_ITEM_NONE) {
if (itemGiven == EXCH_ITEM_1E) {
- if (gSaveContext.weekEventReg[0x35] & 8) {
+ if (gSaveContext.weekEventReg[53] & 8) {
player->actor.textId = 0x888;
} else {
player->actor.textId = 0x883;
@@ -1408,7 +1398,7 @@ void EnTrt_TalkToShopkeeper(EnTrt* this, GlobalContext* globalCtx) {
} else {
this->textId = 0x886;
}
- func_801518B0(globalCtx, this->textId, &this->actor);
+ Message_StartTextbox(globalCtx, this->textId, &this->actor);
this->actionFunc = EnTrt_Goodbye;
}
}
@@ -1452,8 +1442,8 @@ void EnTrt_LookToShopkeeperFromShelf(EnTrt* this, GlobalContext* globalCtx) {
}
void EnTrt_InitShopkeeper(EnTrt* this, GlobalContext* globalCtx) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600FEF0, &D_0600FD34, NULL, NULL, 0);
- if (!(gSaveContext.weekEventReg[0xC] & 8) && !(gSaveContext.weekEventReg[0x54] & 0x40) && gSaveContext.day >= 2) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_trt_Skel_00FEF0, &object_trt_Anim_00FD34, NULL, NULL, 0);
+ if (!(gSaveContext.weekEventReg[12] & 8) && !(gSaveContext.weekEventReg[84] & 0x40) && gSaveContext.day >= 2) {
this->actor.draw = NULL;
} else {
this->actor.draw = EnTrt_Draw;
@@ -1471,7 +1461,7 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.colChkInfo.cylRadius = 50;
this->timer = Rand_S16Offset(40, 20);
- if (!(gSaveContext.weekEventReg[0xC] & 8) && !(gSaveContext.weekEventReg[0x54] & 0x40) && gSaveContext.day >= 2) {
+ if (!(gSaveContext.weekEventReg[12] & 8) && !(gSaveContext.weekEventReg[84] & 0x40) && gSaveContext.day >= 2) {
this->textId = 0x84A;
this->actionFunc = EnTrt_ShopkeeperGone;
} else {
@@ -1539,11 +1529,11 @@ void EnTrt_InitShop(EnTrt* this, GlobalContext* globalCtx) {
this->blinkTimer = 20;
this->eyeTextureIdx = 0;
this->blinkFunc = EnTrt_EyesClosed;
- if (gSaveContext.weekEventReg[0x35] & 8) {
+ if (gSaveContext.weekEventReg[53] & 8) {
this->flags |= ENTRT_GIVEN_MUSHROOM;
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
}
void EnTrt_GetCutscenes(EnTrt* this, GlobalContext* globalCtx) {
@@ -1564,8 +1554,8 @@ void EnTrt_DrawCursor(GlobalContext* globalCtx, EnTrt* this, f32 x, f32 y, f32 z
func_8012C654(globalCtx->state.gfxCtx);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, this->cursorColor.r, this->cursorColor.g, this->cursorColor.b,
this->cursorColor.a);
- gDPLoadTextureBlock_4b(OVERLAY_DISP++, &D_0401F740, G_IM_FMT_IA, 16, 16, 0, G_TX_MIRROR | G_TX_WRAP,
- G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
+ gDPLoadTextureBlock_4b(OVERLAY_DISP++, gameplay_keep_Tex_01F740, G_IM_FMT_IA, 16, 16, 0,
+ G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD);
w = 16.0f * z;
ulx = (x - w) * 4.0f;
uly = (y - w + -12.0f) * 4.0f;
@@ -1616,7 +1606,7 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) {
if (drawStickRightPrompt || drawStickLeftPrompt) {
func_8012C654(globalCtx->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F8C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F8C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1637,7 +1627,7 @@ void EnTrt_DrawStickDirectionPrompt(GlobalContext* globalCtx, EnTrt* this) {
this->stickRightPrompt.arrowTexX, this->stickRightPrompt.arrowTexY,
this->stickRightPrompt.texZ, 0, 0, 1.0f, 1.0f);
}
- gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, &D_0401F7C0);
+ gDPSetTextureImage(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, gameplay_keep_Tex_01F7C0);
gDPSetTile(OVERLAY_DISP++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 4, G_TX_NOLOD);
gDPLoadSync(OVERLAY_DISP++);
@@ -1746,7 +1736,7 @@ s32 EnTrt_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
if (limbIndex == 14) {
*dList = NULL;
}
- return 0;
+ return false;
}
void EnTrt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
@@ -1767,7 +1757,7 @@ void EnTrt_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
}
-void EnTrt_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnTrt_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnTrt* this = THIS;
if (limbIndex == 21) {
@@ -1780,7 +1770,7 @@ void EnTrt_UnkActorDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
}
void EnTrt_Draw(Actor* thisx, GlobalContext* globalCtx) {
- static TexturePtr sEyeTextures[] = { &D_0600B0B8, &D_0600B8B8, &D_0600C0B8 };
+ static TexturePtr sEyeTextures[] = { object_trt_Tex_00B0B8, object_trt_Tex_00B8B8, object_trt_Tex_00C0B8 };
EnTrt* this = THIS;
s32 pad;
@@ -1789,8 +1779,9 @@ void EnTrt_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTextureIdx]));
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(sEyeTextures[this->eyeTextureIdx]));
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnTrt_OverrideLimbDraw, EnTrt_PostLimbDraw, EnTrt_UnkActorDraw, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnTrt_OverrideLimbDraw, EnTrt_PostLimbDraw,
+ EnTrt_TransformLimbDraw, &this->actor);
EnTrt_DrawCursor(globalCtx, this, this->cursorPos.x, this->cursorPos.y, this->cursorPos.z, this->drawCursor);
EnTrt_DrawStickDirectionPrompt(globalCtx, this);
diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
index e74a5dd4d6..f17a6a80f4 100644
--- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
+++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.c
@@ -5,8 +5,9 @@
*/
#include "z_en_trt2.h"
+#include "objects/object_trt/object_trt.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnTrt2*)thisx)
@@ -14,10 +15,30 @@ void EnTrt2_Init(Actor* thisx, GlobalContext* globalCtx);
void EnTrt2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnTrt2_Update(Actor* thisx, GlobalContext* globalCtx);
+void func_80AD46F8(EnTrt2* this);
+s32 func_80AD475C(EnTrt2* this, Path* path, s32 arg2);
+s16 func_80AD48F8(Path* path, s32 arg1, Vec3f* arg2, f32* arg3);
+f32 func_80AD49B8(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3);
+void func_80AD4A78(EnTrt2* this, GlobalContext* globalCtx);
+s32 func_80AD4B08(GlobalContext* globalCtx);
void func_80AD4DB4(EnTrt2* this, GlobalContext* globalCtx);
void func_80AD4FE4(EnTrt2* this, GlobalContext* globalCtx);
+void func_80AD5234(EnTrt2* this, GlobalContext* globalCtx);
+void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx);
+
+static AnimationInfoS sAnimations[] = {
+ { &object_trt_Anim_00DE68, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00EE98, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00FD34, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_0030EC, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_003D78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_trt_Anim_00D52C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_000A44, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_001EF4, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_002224, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_trt_Anim_002CB0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+};
-#if 0
const ActorInit En_Trt2_InitVars = {
ACTOR_EN_TRT2,
ACTORCAT_NPC,
@@ -30,18 +51,29 @@ const ActorInit En_Trt2_InitVars = {
(ActorFunc)NULL,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80AD58A0 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 32, 56, 30, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_80AD58CC = { 1, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_80AD58D8 = {
+static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(1, 0x0),
/* Deku Stick */ DMG_ENTRY(1, 0x0),
/* Horse trample */ DMG_ENTRY(1, 0x0),
@@ -76,111 +108,833 @@ static DamageTable D_80AD58D8 = {
/* Powder Keg */ DMG_ENTRY(1, 0x0),
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80AD5964[] = {
+void func_80AD3380(SkelAnime* skelAnime, AnimationInfoS* animation, s32 arg2) {
+ f32 phi_f0;
+
+ animation += arg2;
+
+ if (animation->frameCount < 0) {
+ phi_f0 = Animation_GetLastFrame(animation->animation);
+ } else {
+ phi_f0 = animation->frameCount;
+ }
+ Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, phi_f0,
+ animation->mode, animation->morphFrames);
+}
+
+void func_80AD341C(EnTrt2* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
+
+void func_80AD349C(EnTrt2* this) {
+ if ((gSaveContext.weekEventReg[85] & 0x10) && !(gSaveContext.weekEventReg[84] & 0x40)) {
+ this->unk_3A8 = 0x88F;
+ } else if (this->unk_3A8 == 0) {
+ this->unk_3A8 = 0x84B;
+ } else if (gSaveContext.weekEventReg[16] & 0x10) {
+ this->unk_3A8 = 0x838;
+ } else if (gSaveContext.weekEventReg[17] & 1) {
+ this->unk_3A8 = 0x84D;
+ } else {
+ this->unk_3A8 = 0x849;
+ }
+}
+
+void func_80AD3530(EnTrt2* this, GlobalContext* globalCtx) {
+ s16 phi_a1;
+ f32 sp30;
+
+ func_80AD46F8(this);
+ if (this->path != NULL) {
+ phi_a1 = func_80AD48F8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30);
+ if (this->actor.bgCheckFlags & 8) {
+ phi_a1 = this->actor.wallYaw;
+ }
+ Math_SmoothStepToS(&this->actor.world.rot.y, phi_a1, 4, 1000, 1);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ if (func_80AD475C(this, this->path, this->unk_1E4)) {
+ if (this->unk_1E4 >= (this->path->count - 1)) {
+ this->unk_1E4 = 0;
+ } else {
+ this->unk_1E4++;
+ }
+ }
+ Math_ApproachF(&this->actor.speedXZ, 1.5f, 0.2f, 1.0f);
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+
+ if (DECR(this->unk_3AE) == 0) {
+ this->unk_3AE = Rand_S16Offset(20, 20);
+ func_80AD3380(&this->skelAnime, sAnimations, 7);
+ this->unk_3B2 = 5;
+ }
+}
+
+void func_80AD3664(EnTrt2* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor);
+ if (this->unk_3D9 == 0) {
+ this->unk_3B2 = 1;
+ } else {
+ this->unk_3B2 = 2;
+ }
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_3DA);
+ return;
+ }
+ func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG);
+}
+
+void func_80AD36EC(EnTrt2* this, GlobalContext* globalCtx) {
+ Vec3s sp30;
+ f32 sp2C;
+
+ if (this->path != NULL) {
+ sp2C = func_80AD49B8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30);
+ this->actor.shape.rot.y += 0x1000;
+ Math_ApproachF(&this->actor.velocity.y, 0.5f, 0.2f, 1.0f);
+ if (sp2C < 5.0f) {
+ if (this->unk_1E4 >= (this->path->count - 1)) {
+ this->unk_1E4 = 0;
+ this->unk_3D9 = 1;
+ this->actor.velocity.y = 0.0f;
+ this->path = func_8013D648(globalCtx, this->path->unk1, -1);
+ ActorCutscene_Stop(this->unk_3DA);
+ this->unk_3DA = ActorCutscene_GetAdditionalCutscene(this->unk_3DA);
+ ActorCutscene_SetIntentToPlay(this->unk_3DA);
+ this->unk_3B2 = 0;
+ } else {
+ this->unk_1E4++;
+ }
+ }
+ }
+ Actor_MoveWithGravity(&this->actor);
+ func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG);
+ if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL);
+ }
+}
+
+void func_80AD381C(EnTrt2* this, GlobalContext* globalCtx) {
+ if ((CURRENT_DAY == 2) || (CURRENT_DAY == 3)) {
+ if (func_80AD4B08(globalCtx) == 1) {
+ this->actor.world.pos.y -= 50.0f;
+ this->unk_3D9 = 0;
+ this->unk_3B2 = 0;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->actor.flags |= ACTOR_FLAG_10;
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void func_80AD38B8(EnTrt2* this, GlobalContext* globalCtx) {
+ Vec3s sp30;
+
+ if (this->unk_3D9 == 2) {
+ Actor_MarkForDeath(&this->actor);
+ }
+
+ if (this->path != NULL) {
+ func_80AD49B8(this->path, this->unk_1E4, &this->actor.world.pos, &sp30);
+ Math_SmoothStepToS(&this->actor.world.rot.y, sp30.y, 4, 1000, 1);
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ Math_SmoothStepToS(&this->actor.shape.rot.x, sp30.x, 4, 1000, 1);
+ this->actor.world.rot.x = -this->actor.shape.rot.x;
+ if (func_80AD475C(this, this->path, this->unk_1E4)) {
+ if (this->unk_1E4 >= (this->path->count - 1)) {
+ ActorCutscene_Stop(this->unk_3DA);
+ this->unk_3D9 = 2;
+ } else {
+ this->unk_1E4++;
+ }
+ }
+
+ if (this->actor.bgCheckFlags & 8) {
+ if (this->unk_1E4 >= (this->path->count - 1)) {
+ ActorCutscene_Stop(this->unk_3DA);
+ this->unk_3D9 = 2;
+ } else {
+ sp30.y = this->actor.wallYaw;
+ }
+ }
+ Math_ApproachF(&this->actor.speedXZ, 5.0f, 0.2f, 1.0f);
+ }
+
+ Actor_MoveWithoutGravity(&this->actor);
+ func_800B9010(&this->actor, NA_SE_EN_KOTAKE_FLY - SFX_FLAG);
+}
+
+void func_80AD3A24(EnTrt2* this, GlobalContext* globalCtx) {
+ func_80AD46F8(this);
+ if (this->actor.speedXZ > 0.05f) {
+ Math_ApproachF(&this->actor.speedXZ, 0.0f, 0.2f, 1.0f);
+ } else if (DECR(this->unk_3AE) == 0) {
+ this->unk_3AE = Rand_S16Offset(100, 50);
+ func_80AD3380(&this->skelAnime, sAnimations, 6);
+ this->unk_3B2 = 4;
+ }
+ Actor_MoveWithGravity(&this->actor);
+}
+
+void func_80AD3AE4(EnTrt2* this, GlobalContext* globalCtx) {
+ if (this->actor.world.pos.y < this->actor.home.pos.y) {
+ Math_ApproachF(&this->actor.velocity.y, 0.5f, 0.2f, 0.1f);
+ } else {
+ this->actor.velocity.y = 0.0f;
+ func_80AD3380(&this->skelAnime, sAnimations, 6);
+ this->unk_3B2 = 4;
+ }
+ Actor_MoveWithGravity(&this->actor);
+}
+
+void func_80AD3B6C(EnTrt2* this, GlobalContext* globalCtx) {
+ if (DECR(this->unk_3B0) == 0) {
+ this->unk_3B0 = 10;
+ this->actor.velocity.y = -1.0f;
+ func_80AD3380(&this->skelAnime, sAnimations, 8);
+ this->unk_3B2 = 8;
+ }
+}
+
+void func_80AD3BE4(EnTrt2* this, GlobalContext* globalCtx) {
+ s16 sp2E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
+
+ Math_ScaledStepToS(&this->unk_3C0, sp2E, 400);
+ Math_SmoothStepToS(&this->unk_3C0, sp2E, 4, 10000, 0);
+ this->actor.world.rot.y += this->unk_3C0;
+ this->actor.shape.rot.y = this->actor.world.rot.y;
+ if (this->actor.world.pos.y < 5.0f) {
+ func_80AD3380(&this->skelAnime, sAnimations, 9);
+ this->unk_3B2 = 9;
+ }
+}
+
+void func_80AD3C94(EnTrt2* this, GlobalContext* globalCtx) {
+ if (this->actor.world.pos.y < 5.0f) {
+ func_80AD4A78(this, globalCtx);
+ if (this->actor.bgCheckFlags & 1) {
+ this->unk_3B2 = 0xF;
+ }
+ }
+}
+
+void func_80AD3CEC(EnTrt2* this, GlobalContext* globalCtx) {
+ u8 sp27 = Message_GetState(&globalCtx->msgCtx);
+
+ func_80AD46F8(this);
+ if (this->unk_3D8) {
+ Message_StartTextbox(globalCtx, this->unk_3A8, &this->actor);
+ this->unk_3D8 = false;
+ } else if ((sp27 == 5) && func_80147624(globalCtx)) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ func_80AD3380(&this->skelAnime, sAnimations, 6);
+ this->unk_3B2 = 4;
+ }
+}
+
+void func_80AD3DA4(EnTrt2* this, GlobalContext* globalCtx) {
+ this->actor.velocity.y = 0.0f;
+ Message_StartTextbox(globalCtx, this->unk_3A8, &this->actor);
+
+ if (this->unk_3A8 == 0x838) {
+ this->unk_3B2 = 11;
+ return;
+ } else if (this->unk_3A8 == 0x88F) {
+ if (Interface_HasEmptyBottle()) {
+ this->unk_3B2 = 11;
+ } else {
+ this->unk_3B2 = 10;
+ }
+ } else {
+ this->unk_3B2 = 10;
+ }
+}
+
+void func_80AD3E34(EnTrt2* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ if (Interface_HasEmptyBottle()) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->unk_3B2 = 12;
+ } else {
+ gSaveContext.weekEventReg[85] |= 0x10;
+ this->unk_3A8 = 0x88E;
+ Message_StartTextbox(globalCtx, this->unk_3A8, &this->actor);
+ this->unk_3B2 = 10;
+ }
+ }
+}
+
+void func_80AD3EF0(EnTrt2* this, GlobalContext* globalCtx) {
+ u8 temp_v0 = Message_GetState(&globalCtx->msgCtx);
+
+ if (temp_v0 == 6) {
+ if (func_80147624(globalCtx)) {
+ if ((Interface_HasEmptyBottle() && !(gSaveContext.weekEventReg[84] & 0x40)) ||
+ !(gSaveContext.weekEventReg[12] & 0x10)) {
+ this->unk_3B2 = 12;
+ } else {
+ gSaveContext.weekEventReg[85] |= 0x10;
+ this->unk_3A8 = 0x88E;
+ Message_StartTextbox(globalCtx, this->unk_3A8, &this->actor);
+ this->unk_3B2 = 10;
+ }
+ }
+ } else if ((temp_v0 == 5) && func_80147624(globalCtx)) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ this->unk_3B2 = 12;
+ }
+}
+
+void func_80AD3FF4(EnTrt2* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ if (!(gSaveContext.weekEventReg[12] & 0x10)) {
+ gSaveContext.weekEventReg[12] |= 0x10;
+ }
+ gSaveContext.weekEventReg[84] |= 0x40;
+ this->actor.parent = NULL;
+ this->unk_3B2 = 14;
+ } else if (gSaveContext.weekEventReg[12] & 0x10) {
+ Actor_PickUp(&this->actor, globalCtx, GI_POTION_RED, 300.0f, 300.0f);
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_BOTTLE_POTION_RED, 300.0f, 300.0f);
+ }
+}
+
+void func_80AD40AC(EnTrt2* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 6) && func_80147624(globalCtx)) {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ this->unk_3B2 = 13;
+ }
+}
+
+void func_80AD4110(EnTrt2* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->unk_3A8 = 0x84C;
+ func_80151938(globalCtx, this->unk_3A8);
+ this->unk_3B2 = 10;
+ } else {
+ func_800B85E0(&this->actor, globalCtx, 400.0f, -1);
+ }
+}
+
+void func_80AD417C(EnTrt2* this, GlobalContext* globalCtx) {
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ if (this->unk_3A8 == 0x84B) {
+ func_80AD349C(this);
+ func_80AD3DA4(this, globalCtx);
+ } else {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ if (this->unk_3A8 == 0x84C) {
+ func_80AD3380(&this->skelAnime, sAnimations, 6);
+ this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
+ this->unk_3B2 = 18;
+ } else if (this->unk_3A8 == 0x88F) {
+ this->unk_3A8 = 0x88E;
+ Message_StartTextbox(globalCtx, this->unk_3A8, &this->actor);
+ } else {
+ this->actor.textId = 0;
+ this->unk_3B2 = 15;
+ }
+ }
+ }
+}
+
+void func_80AD4298(EnTrt2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (ActorCutscene_GetCanPlayNext(this->unk_3DA)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->unk_3DA, &this->actor);
+ player->stateFlags1 |= 0x20;
+ this->unk_3B2 = 6;
+ } else {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ }
+ ActorCutscene_SetIntentToPlay(this->unk_3DA);
+ }
+}
+
+void func_80AD431C(EnTrt2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ player->stateFlags1 &= ~0x20;
+ Actor_MarkForDeath(&this->actor);
+}
+
+void func_80AD434C(EnTrt2* this, GlobalContext* globalCtx) {
+ this->actor.shape.rot.y += 0x1000;
+ Math_ApproachF(&this->actor.velocity.y, 1.5f, 0.2f, 0.1f);
+
+ if (this->actor.world.pos.y > 200.0f) {
+ if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
+ this->unk_3B2 = 0x13;
+ ActorCutscene_Stop(this->unk_3DA);
+ } else {
+ s32 i;
+ Vec3f sp68;
+ Vec3f sp5C = { 0.0f, 0.5f, 0.0f };
+
+ for (i = (s32)this->skelAnime.animLength - (s32)this->skelAnime.curFrame; i >= 0; i -= 2) {
+ sp68.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
+ sp68.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
+ sp68.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ func_800B3030(globalCtx, &sp68, &sp5C, &sp5C, 100, 0, 3);
+ }
+
+ func_800B9010(&this->actor, NA_SE_EN_COMMON_EXTINCT_LEV - SFX_FLAG);
+ }
+ } else if (this->actor.world.pos.y < 5.0f) {
+ func_80AD4A78(this, globalCtx);
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+
+ if ((this->actor.shape.rot.y >= 0x2800) && (this->actor.shape.rot.y < 0x3800)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_KOTAKE_ROLL);
+ }
+}
+
+void func_80AD4550(EnTrt2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ u8 sp23 = Message_GetState(&globalCtx->msgCtx);
+
+ if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) {
+ func_80AD3380(&this->skelAnime, sAnimations, 7);
+ this->unk_3B2 = 17;
+ }
+
+ if ((sp23 == 5) && func_80147624(globalCtx)) {
+ globalCtx->msgCtx.msgMode = 0x43;
+ globalCtx->msgCtx.unk12023 = 4;
+ }
+}
+
+void func_80AD4608(EnTrt2* this) {
+ s16 temp = this->unk_3B6 - 1;
+
+ if (temp != 0) {
+ this->unk_3B6 = temp;
+ return;
+ }
+
+ temp = this->unk_3B8 + 1;
+ if (temp >= 3) {
+ this->unk_3B8 = 0;
+ this->unk_3B6 = (s32)(Rand_ZeroOne() * 60.0f) + 20;
+ } else {
+ this->unk_3B8 = temp;
+ this->unk_3B6 = 1;
+ }
+}
+
+void func_80AD469C(EnTrt2* this, GlobalContext* globalCtx) {
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_trt_Skel_00FEF0, &object_trt_Anim_000A44, NULL, NULL, 0);
+ this->actor.draw = func_80AD56E8;
+}
+
+void func_80AD46F8(EnTrt2* this) {
+ if ((this->actor.home.pos.y + 60.0f) < this->actor.world.pos.y) {
+ this->actor.velocity.y = -0.2f;
+ } else if (this->actor.world.pos.y <= (this->actor.home.pos.y + 50.0f)) {
+ this->actor.velocity.y = 0.2f;
+ }
+}
+
+s32 func_80AD475C(EnTrt2* this, Path* path, s32 arg2) {
+ Vec3s* points;
+ s32 count;
+ f32 phi_f12;
+ s32 ret;
+ f32 phi_f14;
+ s32 arg = arg2;
+ f32 sp44;
+ f32 sp40;
+ f32 sp3C;
+ Vec3f sp30;
+
+ points = Lib_SegmentedToVirtual(path->points);
+ count = path->count;
+ ret = false;
+ Math_Vec3s_ToVec3f(&sp30, &points[arg]);
+
+ if (arg == 0) {
+ phi_f12 = points[1].x - points[0].x;
+ phi_f14 = points[1].z - points[0].z;
+ } else if ((count - 1) == arg) {
+ phi_f12 = points[count - 1].x - points[count - 2].x;
+ phi_f14 = points[count - 1].z - points[count - 2].z;
+ } else {
+ phi_f12 = points[arg + 1].x - points[arg - 1].x;
+ phi_f14 = points[arg + 1].z - points[arg - 1].z;
+ }
+
+ func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
+
+ if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
+ ret = true;
+ }
+ return ret;
+}
+
+s16 func_80AD48F8(Path* path, s32 arg1, Vec3f* arg2, f32* arg3) {
+ Vec3s* points;
+ f32 phi_f14;
+ f32 phi_f12;
+
+ if (path != NULL) {
+ points = Lib_SegmentedToVirtual(path->points);
+ points = &points[arg1];
+ phi_f14 = points->x - arg2->x;
+ phi_f12 = points->z - arg2->z;
+ } else {
+ phi_f14 = 0.0f;
+ phi_f12 = 0.0f;
+ }
+ *arg3 = SQ(phi_f14) + SQ(phi_f12);
+ return RADF_TO_BINANG(Math_Acot2F(phi_f12, phi_f14));
+}
+
+f32 func_80AD49B8(Path* path, s32 arg1, Vec3f* arg2, Vec3s* arg3) {
+ s32 pad;
+ Vec3f sp20;
+ Vec3s* temp_v1;
+
+ if (path != NULL) {
+ temp_v1 = Lib_SegmentedToVirtual(path->points);
+ temp_v1 = &temp_v1[arg1];
+
+ sp20.x = temp_v1->x;
+ sp20.y = temp_v1->y;
+ sp20.z = temp_v1->z;
+ }
+ arg3->y = Math_Vec3f_Yaw(arg2, &sp20);
+ arg3->x = Math_Vec3f_Pitch(arg2, &sp20);
+ return sp20.y - arg2->y;
+}
+
+void func_80AD4A78(EnTrt2* this, GlobalContext* globalCtx) {
+ Vec3f sp34;
+
+ sp34.x = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.x;
+ sp34.y = this->actor.world.pos.y;
+ sp34.z = randPlusMinusPoint5Scaled(15.0f) + this->actor.world.pos.z;
+ Actor_SpawnFloorDustRing(globalCtx, &this->actor, &sp34, 50.0f, 0, 2.0f, 0, 0, 0);
+}
+
+s32 func_80AD4B08(GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 ret;
+
+ if (SurfaceType_GetSceneExitIndex(&globalCtx->colCtx, player->actor.floorPoly, player->actor.floorBgId) == 0x15) {
+ ret = true;
+ } else {
+ ret = false;
+ }
+ return ret;
+}
+
+s32 func_80AD4B4C(EnTrt2* this, GlobalContext* globalCtx) {
+ s32 sp24 = false;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ sp24 = true;
+ this->actor.speedXZ = 0.0f;
+ func_80AD349C(this);
+ this->unk_3B4 = this->unk_3B2;
+ if (this->actor.bgCheckFlags & 1) {
+ if ((player->transformation != PLAYER_FORM_HUMAN) && (player->transformation != PLAYER_FORM_FIERCE_DEITY)) {
+ this->unk_3A8 = 0x84F;
+ }
+ func_80AD3DA4(this, globalCtx);
+ } else if ((player->transformation == PLAYER_FORM_HUMAN) ||
+ (player->transformation == PLAYER_FORM_FIERCE_DEITY)) {
+ this->unk_3B2 = 16;
+ this->actor.velocity.y = 1.5f;
+ } else {
+ this->unk_3A8 = 0x84F;
+ this->unk_3D8 = true;
+ func_80AD3380(&this->skelAnime, sAnimations, 7);
+ this->unk_3B2 = 7;
+ }
+ }
+ return sp24;
+}
+
+s32 func_80AD4C4C(EnTrt2* this) {
+ if (this->actor.bgCheckFlags & 1) {
+ if (this->actor.xzDistToPlayer < 100.0f) {
+ return true;
+ }
+ } else if ((this->actor.xzDistToPlayer > 50.0f) && (this->actor.xzDistToPlayer < 200.0f)) {
+ return true;
+ }
+ return false;
+}
+
+s32 func_80AD4CCC(EnTrt2* this, GlobalContext* globalCtx) {
+ s16 sp1E = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (((this->unk_3B2 == 4) || (this->unk_3B2 == 5)) && this->actor.isTargeted && !(this->actor.bgCheckFlags & 1) &&
+ ((player->transformation == PLAYER_FORM_HUMAN) || (player->transformation == PLAYER_FORM_FIERCE_DEITY))) {
+ this->actor.speedXZ = 0.0f;
+ this->actor.velocity.y = 1.5f;
+ this->unk_3B2 = 16;
+ return true;
+ }
+
+ if (func_80AD4C4C(this) && this->actor.isTargeted && (sp1E < 0x4000) && (sp1E > -0x4000)) {
+ func_800B863C(&this->actor, globalCtx);
+ }
+
+ return true;
+}
+
+void func_80AD4DB4(EnTrt2* this, GlobalContext* globalCtx) {
+ static Vec3f D_80AD5904 = { 0.0f, 50.0f, 0.0 };
+
+ this->actor.flags &= ~ACTOR_FLAG_10;
+ Actor_SetObjectDependency(globalCtx, &this->actor);
+ Actor_SetScale(&this->actor, 0.008f);
+ this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
+ this->unk_3AE = Rand_S16Offset(100, 50);
+ this->unk_3B0 = 10;
+ this->unk_3A8 = 0;
+
+ this->actor.world.pos.x += D_80AD5904.x;
+ this->actor.world.pos.y += D_80AD5904.y;
+ this->actor.world.pos.z += D_80AD5904.z;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ func_80AD469C(this, globalCtx);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->actor.colChkInfo.cylRadius = 50;
+
+ this->unk_3C0 = 0;
+ this->unk_3D8 = false;
+ this->unk_3DA = this->actor.cutscene;
+ this->unk_3B6 = 20;
+ this->unk_3B8 = 0;
+ this->unk_3BC = func_80AD4608;
+
+ if (gSaveContext.weekEventReg[12] & 8) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ if (gSaveContext.weekEventReg[84] & 0x40) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ if ((globalCtx->sceneNum == SCENE_20SICHITAI) || (globalCtx->sceneNum == SCENE_20SICHITAI2)) {
+ if (gSaveContext.day == 2) {
+ if (!(gSaveContext.weekEventReg[15] & 0x80)) {
+ gSaveContext.weekEventReg[15] |= 0x80;
+ this->unk_3B2 = 3;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else if (gSaveContext.day == 2) {
+ if (gSaveContext.weekEventReg[15] & 0x80) {
+ this->unk_3B2 = 4;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ } else if (gSaveContext.day == 3) {
+ this->unk_3B2 = 4;
+ }
+ this->actionFunc = func_80AD4FE4;
+}
+
+void func_80AD4FE4(EnTrt2* this, GlobalContext* globalCtx) {
+ static EnTrt2UnkFunc2 D_80AD5910[] = {
+ func_80AD3664, func_80AD36EC, func_80AD38B8, func_80AD381C, func_80AD3530, func_80AD3A24, func_80AD434C,
+ func_80AD3CEC, func_80AD3BE4, func_80AD3C94, func_80AD417C, func_80AD3EF0, func_80AD3FF4, func_80AD4110,
+ func_80AD40AC, func_80AD4550, func_80AD3B6C, func_80AD3AE4, func_80AD4298, func_80AD431C, func_80AD3E34,
+ };
+
+ this->unk_3BC(this);
+
+ D_80AD5910[this->unk_3B2](this, globalCtx);
+ Actor_MoveWithGravity(&this->actor);
+
+ if (globalCtx->sceneNum != SCENE_20SICHITAI) {
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 26.0f, 10.0f, 0.0f, 5);
+ }
+
+ Actor_SetFocus(&this->actor, 90.0f);
+ SkelAnime_Update(&this->skelAnime);
+}
+
+static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE),
ICHAIN_F32(targetArrowOffset, 500, ICHAIN_STOP),
};
-#endif
+void EnTrt2_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnTrt2* this = THIS;
-extern ColliderCylinderInit D_80AD58A0;
-extern CollisionCheckInfoInit2 D_80AD58CC;
-extern DamageTable D_80AD58D8;
-extern InitChainEntry D_80AD5964[];
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ this->actionFunc = func_80AD4DB4;
+}
-extern UNK_TYPE D_06000A44;
+void EnTrt2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnTrt2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3380.s")
+ SkelAnime_Free(&this->skelAnime, globalCtx);
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD341C.s")
+void EnTrt2_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnTrt2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD349C.s")
+ if ((this->unk_3B2 != 6) && (this->unk_3B2 != 10) && (this->unk_3B2 != 13) && (this->unk_3B2 != 14) &&
+ (this->unk_3B2 != 16) && (this->unk_3B2 != 8) && (this->unk_3B2 != 9)) {
+ func_80AD4B4C(this, globalCtx);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3530.s")
+ this->actionFunc(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3664.s")
+ func_80AD341C(this, globalCtx);
+ func_80AD5234(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD36EC.s")
+ if ((this->unk_3B2 != 6) && (this->unk_3B2 != 10) && (this->unk_3B2 != 13) && (this->unk_3B2 != 14) &&
+ (this->unk_3B2 != 16) && (this->unk_3B2 != 8) && (this->unk_3B2 != 9)) {
+ func_80AD4CCC(this, globalCtx);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD381C.s")
+void func_80AD5234(EnTrt2* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp40;
+ Vec3f sp34;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD38B8.s")
+ Math_SmoothStepToS(&this->unk_3D6, this->actor.yawTowardsPlayer - this->actor.shape.rot.y, 4, 0x38E0, 1);
+ this->unk_3D6 = CLAMP(this->unk_3D6, -0x38E0, 0x38E0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3A24.s")
+ sp40 = player->actor.world.pos;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3AE4.s")
+ if (this->unk_3B2 == 8) {
+ sp40.y = player->bodyPartsPos[7].y + 3.0f;
+ } else {
+ sp40.y = player->bodyPartsPos[7].y + 45.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3B6C.s")
+ sp34 = this->actor.world.pos;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3BE4.s")
+ Math_SmoothStepToS(&this->unk_3D4, Math_Vec3f_Pitch(&sp34, &sp40), 4, 0x1C70, 1);
+ this->unk_3D4 = CLAMP(this->unk_3D4, -0x1C70, 0x1C70);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3C94.s")
+void func_80AD5394(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4) {
+ Vec3f sp7C;
+ Vec3f sp70 = gZeroVec3f;
+ Vec3s sp68;
+ MtxF sp28;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3CEC.s")
+ Matrix_MultiplyVector3fByState(&sp70, &sp7C);
+ Matrix_CopyCurrentState(&sp28);
+ func_8018219C(&sp28, &sp68, 0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3DA4.s")
+ *arg2 = sp7C;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3E34.s")
+ if (arg4) {
+ sp68.x += arg0;
+ sp68.y += arg1;
+ Math_SmoothStepToS(&arg3->x, sp68.x, 4, 0x1FFE, 1);
+ Math_SmoothStepToS(&arg3->y, sp68.y, 4, 0x1FFE, 1);
+ Math_SmoothStepToS(&arg3->z, sp68.z, 4, 0x1FFE, 1);
+ } else {
+ arg3->x = sp68.x;
+ arg3->y = sp68.y;
+ arg3->z = sp68.z;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3EF0.s")
+s32 EnTrt2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnTrt2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD3FF4.s")
+ if ((limbIndex == 8) || (limbIndex == 13) || (limbIndex == 19)) {
+ rot->y += (s16)Math_SinS(this->unk_33C[limbIndex]) * 200;
+ rot->z += (s16)Math_CosS(this->unk_372[limbIndex]) * 200;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD40AC.s")
+void EnTrt2_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnTrt2* this = THIS;
+ Vec3f sp30 = { 0.0f, -30.0f, 0.0f };
+ s32 phi_v0 = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4110.s")
+ if (this->unk_3B2 >= 8) {
+ phi_v0 = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD417C.s")
+ if (limbIndex == 21) {
+ func_80AD5394(this->unk_3D4, this->unk_3D6, &this->unk_3C8, &this->unk_3C2, phi_v0);
+ Matrix_InsertTranslation(this->unk_3C8.x, this->unk_3C8.y, this->unk_3C8.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_3C2.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_3C2.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_3C2.z, MTXMODE_APPLY);
+ Matrix_MultiplyVector3fByState(&sp30, &this->actor.focus.pos);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4298.s")
+void EnTrt2_UnkDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+ EnTrt2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD431C.s")
+ if (limbIndex == 21) {
+ Matrix_InsertTranslation(this->unk_3C8.x, this->unk_3C8.y, this->unk_3C8.z, MTXMODE_NEW);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Matrix_RotateY(this->unk_3C2.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->unk_3C2.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->unk_3C2.z, MTXMODE_APPLY);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD434C.s")
+void func_80AD56E8(Actor* thisx, GlobalContext* globalCtx) {
+ static TexturePtr D_80AD5978[] = {
+ object_trt_Tex_00B0B8,
+ object_trt_Tex_00B8B8,
+ object_trt_Tex_00C0B8,
+ };
+ s32 pad;
+ EnTrt2* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4550.s")
+ OPEN_DISPS(globalCtx->state.gfxCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4608.s")
+ func_8012C28C(globalCtx->state.gfxCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD469C.s")
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80AD5978[this->unk_3B8]));
+ gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80AD5978[this->unk_3B8]));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD46F8.s")
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnTrt2_OverrideLimbDraw, EnTrt2_PostLimbDraw,
+ EnTrt2_UnkDraw, &this->actor);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD475C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD48F8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD49B8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4A78.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4B08.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4B4C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4C4C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4CCC.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4DB4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD4FE4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Init.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Destroy.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/EnTrt2_Update.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5234.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5394.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD54C8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD5584.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD566C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Trt2/func_80AD56E8.s")
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h
index 11320af0cb..bab2747212 100644
--- a/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h
+++ b/src/overlays/actors/ovl_En_Trt2/z_en_trt2.h
@@ -6,11 +6,39 @@
struct EnTrt2;
typedef void (*EnTrt2ActionFunc)(struct EnTrt2*, GlobalContext*);
+typedef void (*EnTrt2UnkFunc)(struct EnTrt2*);
+typedef void (*EnTrt2UnkFunc2)(struct EnTrt2*, GlobalContext*);
+
+#define ENTRT2_GET_FC00(thisx) (((thisx)->params & 0xFC00) >> 0xA)
typedef struct EnTrt2 {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ EnTrt2ActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x294];
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ EnTrt2ActionFunc actionFunc;
+ /* 0x148 */ UNK_TYPE1 unk_148[8];
+ /* 0x150 */ SkelAnime skelAnime;
+ /* 0x194 */ ColliderCylinder collider;
+ /* 0x1E0 */ Path* path;
+ /* 0x1E4 */ s32 unk_1E4;
+ /* 0x1E8 */ UNK_TYPE1 unk_1E8[0x154];
+ /* 0x33C */ s16 unk_33C[27];
+ /* 0x372 */ s16 unk_372[27];
+ /* 0x3A8 */ u16 unk_3A8;
+ /* 0x3AA */ UNK_TYPE1 unk_3AA[4];
+ /* 0x3AE */ s16 unk_3AE;
+ /* 0x3B0 */ s16 unk_3B0;
+ /* 0x3B2 */ s16 unk_3B2;
+ /* 0x3B4 */ s16 unk_3B4;
+ /* 0x3B6 */ s16 unk_3B6;
+ /* 0x3B8 */ s16 unk_3B8;
+ /* 0x3BC */ EnTrt2UnkFunc unk_3BC;
+ /* 0x3C0 */ s16 unk_3C0;
+ /* 0x3C2 */ Vec3s unk_3C2;
+ /* 0x3C8 */ Vec3f unk_3C8;
+ /* 0x3D4 */ s16 unk_3D4;
+ /* 0x3D6 */ s16 unk_3D6;
+ /* 0x3D8 */ u8 unk_3D8;
+ /* 0x3D9 */ u8 unk_3D9;
+ /* 0x3DA */ s16 unk_3DA;
} EnTrt2; // size = 0x3DC
extern const ActorInit En_Trt2_InitVars;
diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c
index 74037ce2f7..db7b7a1fc0 100644
--- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c
+++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c
@@ -7,7 +7,7 @@
#include "z_en_tru.h"
#include "objects/object_tru/object_tru.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTru*)thisx)
@@ -69,6 +69,7 @@ const ActorInit En_Tru_InitVars = {
};
#include "overlays/ovl_En_Tru/ovl_En_Tru.c"
+#include "objects/gameplay_keep/gameplay_keep.h"
static Vec3f D_80A8B250 = { 0.0f, 0.02f, 0.0f };
@@ -79,8 +80,8 @@ static Color_RGBA8 D_80A8B25C[] = {
static f32 D_80A8B274[] = { 60.0f, 255.0f, 60.0f };
-static UNK_TYPE D_80A8B280[] = {
- &D_0408F7E0, &D_0408F3E0, &D_0408EFE0, &D_0408EBE0, &D_0408E7E0, &D_0408E3E0, &D_0408DFE0, &D_0408DBE0,
+static TexturePtr D_80A8B280[] = {
+ gDust8Tex, gDust7Tex, gDust6Tex, gDust5Tex, gDust4Tex, gDust3Tex, gDust2Tex, gDust1Tex,
};
static ColliderSphereInit sSphereInit = {
@@ -105,15 +106,23 @@ static ColliderSphereInit sSphereInit = {
static CollisionCheckInfoInit2 sColChkInfoInit = { 1, 20, 0, 0, MASS_IMMOVABLE };
-static ActorAnimationEntryS D_80A8B2D8[] = {
- { &object_tru_Anim_00F9A0, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_00F9A0, 1.0f, 0, -1, 0, -4 },
- { &object_tru_Anim_0108AC, 1.0f, 0, -1, 2, -4 }, { &object_tru_Anim_009348, 1.0f, 0, -1, 2, 0 },
- { &object_tru_Anim_00EEDC, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_015CA0, 1.0f, 0, -1, 0, 0 },
- { &object_tru_Anim_015CA0, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_014728, 1.0f, 0, -1, 2, 0 },
- { &object_tru_Anim_01B5C4, 1.0f, 0, -1, 2, 0 }, { &object_tru_Anim_007FA0, 1.0f, 0, -1, 2, -4 },
- { &object_tru_Anim_016B4C, 1.0f, 0, -1, 0, -4 }, { &object_tru_Anim_011F88, 1.0f, 0, -1, 2, -4 },
- { &object_tru_Anim_00446C, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_003698, 1.0f, 0, -1, 2, -4 },
- { &object_tru_Anim_002BD8, 1.0f, 0, -1, 0, 0 }, { &object_tru_Anim_00446C, 1.0f, 0, -1, 0, 0 },
+static AnimationInfoS D_80A8B2D8[] = {
+ { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_tru_Anim_00F9A0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_tru_Anim_0108AC, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_tru_Anim_009348, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_tru_Anim_00EEDC, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_tru_Anim_015CA0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_tru_Anim_015CA0, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_tru_Anim_014728, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_tru_Anim_01B5C4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
+ { &object_tru_Anim_007FA0, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_tru_Anim_016B4C, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &object_tru_Anim_011F88, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_tru_Anim_00446C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_tru_Anim_003698, 1.0f, 0, -1, ANIMMODE_ONCE, -4 },
+ { &object_tru_Anim_002BD8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &object_tru_Anim_00446C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
};
static Vec3f D_80A8B3D8 = { 0.0f, 24.0f, 16.0f };
@@ -417,7 +426,7 @@ s32 func_80A86924(EnTru* this, s32 arg1) {
if (arg1 != this->unk_37C) {
this->unk_37C = arg1;
- ret = func_8013BC6C(&this->skelAnime, D_80A8B2D8, arg1);
+ ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, D_80A8B2D8, arg1);
this->unk_358 = this->skelAnime.playSpeed;
}
@@ -678,7 +687,7 @@ s32 func_80A872AC(EnTru* this, GlobalContext* globalCtx) {
this->unk_390 = 0;
this->unk_364 = 0;
this->unk_354 = func_80A871E0(this, globalCtx);
- func_8013AED4(&this->unk_34E, 0, 7);
+ SubS_UpdateFlags(&this->unk_34E, 0, 7);
this->actionFunc = func_80A881E0;
ret = true;
}
@@ -930,7 +939,7 @@ s32 func_80A87B48(Actor* thisx, GlobalContext* globalCtx) {
case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
- sp3E = BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)));
+ sp3E = BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)));
Math_Vec3f_Copy(&sp4C, &gZeroVec3f);
sp4C.z = 40.0f;
Lib_Vec3f_TranslateAndRotateY(&this->actor.world.pos, sp3E, &sp4C, &sp40);
@@ -1026,7 +1035,7 @@ s32 func_80A87DC0(Actor* thisx, GlobalContext* globalCtx) {
}
if (ret == true) {
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->actor.draw = NULL;
this->unk_378 = NULL;
this->unk_34E = 0;
@@ -1039,15 +1048,15 @@ void func_80A87FD0(EnTru* this, GlobalContext* globalCtx) {
if (this->actor.draw != NULL) {
if ((this->unk_34E & 0x80) || (gSaveContext.weekEventReg[16] & 0x10)) {
if (func_80A873B8(this)) {
- func_8013AED4(&this->unk_34E, 3, 7);
+ SubS_UpdateFlags(&this->unk_34E, 3, 7);
} else {
- func_8013AED4(&this->unk_34E, 0, 7);
+ SubS_UpdateFlags(&this->unk_34E, 0, 7);
}
} else if (this->unk_34E & 0x40) {
if (func_80A873B8(this)) {
- func_8013AED4(&this->unk_34E, 3, 7);
+ SubS_UpdateFlags(&this->unk_34E, 3, 7);
} else {
- func_8013AED4(&this->unk_34E, 0, 7);
+ SubS_UpdateFlags(&this->unk_34E, 0, 7);
}
if ((this->unk_37C == 2) && Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
@@ -1061,13 +1070,13 @@ void func_80A87FD0(EnTru* this, GlobalContext* globalCtx) {
}
} else if (!(gSaveContext.weekEventReg[16] & 0x10) && (fabsf(this->actor.playerHeightRel) < 10.0f) &&
(this->actor.xzDistToPlayer < 140.0f)) {
- func_8013AED4(&this->unk_34E, 4, 7);
+ SubS_UpdateFlags(&this->unk_34E, 4, 7);
this->unk_34E |= 0x1040;
this->unk_362 = Rand_S16Offset(40, 20);
} else if (func_80A873B8(this)) {
- func_8013AED4(&this->unk_34E, 3, 7);
+ SubS_UpdateFlags(&this->unk_34E, 3, 7);
} else {
- func_8013AED4(&this->unk_34E, 0, 7);
+ SubS_UpdateFlags(&this->unk_34E, 0, 7);
}
}
}
@@ -1093,11 +1102,11 @@ void func_80A881E0(EnTru* this, GlobalContext* globalCtx) {
func_80A86924(this, 6);
}
- func_8013AED4(&this->unk_34E, 0, 7);
+ SubS_UpdateFlags(&this->unk_34E, 0, 7);
this->unk_34E &= ~(0x1000 | 0x8);
this->unk_34E |= 0x10;
this->actor.shape.rot.y = this->actor.world.rot.y;
- this->actor.flags &= ~0x100;
+ this->actor.flags &= ~ACTOR_FLAG_100;
this->unk_1E8 = 0;
this->actionFunc = func_80A87FD0;
}
@@ -1192,7 +1201,7 @@ void EnTru_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
}
-void func_80A886D4(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
+void EnTru_TransformLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
EnTru* this = THIS;
s32 pad[3];
s32 sp2C;
@@ -1235,10 +1244,10 @@ void func_80A886D4(GlobalContext* globalCtx, s32 limbIndex, Actor* thisx) {
void EnTru_Draw(Actor* thisx, GlobalContext* globalCtx) {
static TexturePtr D_80A8B408[] = {
- &object_tru_Tex_018FA0,
- &object_tru_Tex_0197A0,
- &object_tru_Tex_019FA0,
- &object_tru_Tex_0197A0,
+ object_tru_Tex_018FA0,
+ object_tru_Tex_0197A0,
+ object_tru_Tex_019FA0,
+ object_tru_Tex_0197A0,
};
s32 pad;
EnTru* this = THIS;
@@ -1250,8 +1259,9 @@ void EnTru_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80A8B408[this->unk_36E]));
gSPSegment(POLY_OPA_DISP++, 0x09, Lib_SegmentedToVirtual(D_80A8B408[this->unk_36E]));
- func_801343C0(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
- EnTru_OverrideLimbDraw, EnTru_PostLimbDraw, func_80A886D4, &this->actor);
+ SkelAnime_DrawTransformFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, EnTru_OverrideLimbDraw, EnTru_PostLimbDraw,
+ EnTru_TransformLimbDraw, &this->actor);
func_80A85788(this->unk_394, globalCtx);
func_80A85BCC(this->unk_394, globalCtx);
func_80A85F84(this->unk_394, globalCtx);
diff --git a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
index 2d956d4941..2cb79a8c16 100644
--- a/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
+++ b/src/overlays/actors/ovl_En_Tru_Mt/z_en_tru_mt.c
@@ -6,7 +6,7 @@
#include "z_en_tru_mt.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnTruMt*)thisx)
diff --git a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c
index 4205bf035b..022aa44bcb 100644
--- a/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c
+++ b/src/overlays/actors/ovl_En_Tsn/z_en_tsn.c
@@ -6,7 +6,7 @@
#include "z_en_tsn.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnTsn*)thisx)
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 05f4e76d73..18476aa4e0 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
@@ -120,7 +120,8 @@ void EnTuboTrap_SpawnEffectsOnLand(EnTuboTrap* this, GlobalContext* globalCtx) {
arg5 = 0x20;
}
EffectSsKakera_Spawn(globalCtx, &pos, &vel, actorPos, -0xF0, arg5, 0x14, 0, 0,
- ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x3C, -1, GAMEPLAY_DANGEON_KEEP, D_05018090);
+ ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x3C, -1, GAMEPLAY_DANGEON_KEEP,
+ gameplay_dangeon_keep_DL_018090);
}
func_800BBFB0(globalCtx, actorPos, 30.0f, 4, 0x14, 0x32, 0);
@@ -165,7 +166,8 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx)
}
EffectSsKakera_Spawn(globalCtx, &pos, &vel, actorPos, -0xAA, arg5, 0x32, 5, 0,
- ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x46, -1, GAMEPLAY_DANGEON_KEEP, D_05018090);
+ ((Rand_ZeroOne() * 85.0f) + 15.0f), 0, 0, 0x46, -1, GAMEPLAY_DANGEON_KEEP,
+ gameplay_dangeon_keep_DL_018090);
}
}
@@ -236,7 +238,7 @@ void EnTuboTrap_Idle(EnTuboTrap* this, GlobalContext* globalCtx) {
if ((startingRotation == 0) || (this->actor.playerHeightRel <= (startingRotation * 10.0f))) {
func_800BC154(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORCAT_ENEMY);
currentHeight = this->actor.world.pos.y;
- this->actor.flags |= 0x11; // always update and can target
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_10); // always update and can target
transformationHeight = sTransformationHeight[player->transformation];
diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.c b/src/overlays/actors/ovl_En_Twig/z_en_twig.c
index aa1b3e1d48..c2cae36c3d 100644
--- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c
+++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c
@@ -6,7 +6,7 @@
#include "z_en_twig.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnTwig*)thisx)
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 84d9a83566..170cc6edb4 100644
--- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c
+++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c
@@ -6,7 +6,7 @@
#include "z_en_viewer.h"
-#define FLAGS 0x00200030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_200000)
#define THIS ((EnViewer*)thisx)
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 b1fcfad5e5..81ef8312b0 100644
--- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c
+++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c
@@ -6,7 +6,7 @@
#include "z_en_vm.h"
-#define FLAGS 0x00000405
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_400)
#define THIS ((EnVm*)thisx)
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 05078f541e..0bdb51729a 100644
--- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
+++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c
@@ -6,7 +6,7 @@
#include "z_en_wallmas.h"
-#define FLAGS 0x00000415
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((EnWallmas*)thisx)
diff --git a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c
index 5959841904..3c19559afe 100644
--- a/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c
+++ b/src/overlays/actors/ovl_En_Warp_Uzu/z_en_warp_uzu.c
@@ -5,8 +5,9 @@
*/
#include "z_en_warp_uzu.h"
+#include "objects/object_warp_uzu/object_warp_uzu.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnWarpUzu*)thisx)
@@ -59,8 +60,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern Gfx D_06000EC0[];
-
void EnWarpUzu_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWarpUzu* this = THIS;
@@ -133,5 +132,5 @@ void EnWarpUzu_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void EnWarpUzu_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000EC0);
+ Gfx_DrawDListOpa(globalCtx, object_warp_uzu_DL_000EC0);
}
diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
index 1f376ace38..ce6367b877 100644
--- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
+++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c
@@ -6,7 +6,7 @@
#include "z_en_warp_tag.h"
-#define FLAGS 0x0A000011
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000 | ACTOR_FLAG_8000000)
#define THIS ((EnWarptag*)thisx)
diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
index 5e45f8c033..314d168cc5 100644
--- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
+++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c
@@ -8,7 +8,7 @@
#include "objects/object_water_effect/object_water_effect.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000035
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnWaterEffect*)thisx)
@@ -82,7 +82,7 @@ void EnWaterEffect_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
EnWaterEffect* this = THIS;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_DC4 = Rand_ZeroFloat(100.0f);
if (this->actor.params == ENWATEREFFECT_1) {
@@ -285,7 +285,7 @@ void EnWaterEffect_Draw(Actor* thisx, GlobalContext* globalCtx2) {
if (!phi_s4) {
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0));
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex));
gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0);
phi_s4++;
@@ -296,7 +296,7 @@ void EnWaterEffect_Draw(Actor* thisx, GlobalContext* globalCtx2) {
Matrix_InsertTranslation(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, MTXMODE_NEW);
if (ptr->unk_00 == 1) {
- Matrix_RotateY(func_800DFC68(GET_ACTIVE_CAM(globalCtx)), MTXMODE_APPLY);
+ Matrix_RotateY(Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx)), MTXMODE_APPLY);
} else {
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
}
@@ -317,7 +317,7 @@ void EnWaterEffect_Draw(Actor* thisx, GlobalContext* globalCtx2) {
if (!phi_s4) {
func_8012C448(gfxCtx);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0));
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex));
gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0);
gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260);
phi_s4++;
@@ -535,7 +535,7 @@ void func_80A5A184(Actor* thisx, GlobalContext* globalCtx2) {
if (ptr->unk_2A >= 2) {
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
} else {
- Matrix_RotateY(func_800DFC68(GET_ACTIVE_CAM(globalCtx)), MTXMODE_APPLY);
+ Matrix_RotateY(Camera_GetInputDirYaw(GET_ACTIVE_CAM(globalCtx)), MTXMODE_APPLY);
}
Matrix_Scale(ptr->unk_2C.x, ptr->unk_2C.y, 1.0f, MTXMODE_APPLY);
@@ -624,7 +624,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) {
if ((this->actor.params == ENWATEREFFECT_777) || (this->actor.params == ENWATEREFFECT_778)) {
if (this->unk_E2C > 1.0f) {
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000DE0));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000DE0));
Matrix_Scale(this->unk_DC8[1].y, this->unk_DC8[1].z, this->unk_DC8[1].y, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
@@ -637,7 +637,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) {
if (this->unk_E30 > 1.0f) {
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E0C));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E0C));
Matrix_Scale(this->unk_DC8[2].y, this->unk_DC8[2].z, this->unk_DC8[2].y, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
@@ -653,7 +653,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) {
if ((this->unk_E34 > 1.0f) && (this->actor.params != ENWATEREFFECT_780)) {
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E40));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E40));
Matrix_Scale(this->unk_DC8[3].y, this->unk_DC8[3].z, this->unk_DC8[3].y, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -665,7 +665,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) {
if ((this->actor.params == ENWATEREFFECT_777) || (this->actor.params == ENWATEREFFECT_780)) {
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_water_effect_Matanimheader_000E58));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_water_effect_Matanimheader_000E58));
Matrix_Scale(this->unk_DC8[4].y, this->unk_DC8[4].z, this->unk_DC8[4].y, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -681,7 +681,7 @@ void func_80A5A6B8(Actor* thisx, GlobalContext* globalCtx2) {
if (!phi_s4) {
func_8012C448(globalCtx->state.gfxCtx);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08DBE0));
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust1Tex));
gDPSetEnvColor(POLY_XLU_DISP++, 250, 250, 255, 0);
gSPDisplayList(POLY_XLU_DISP++, object_water_effect_DL_004260);
phi_s4++;
diff --git a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c
index b04de536bf..b21e2f0b8e 100644
--- a/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c
+++ b/src/overlays/actors/ovl_En_Wdhand/z_en_wdhand.c
@@ -6,7 +6,7 @@
#include "z_en_wdhand.h"
-#define FLAGS 0x00000005
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4)
#define THIS ((EnWdhand*)thisx)
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 b230a767f2..b15cb51194 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,7 +6,7 @@
#include "z_en_weather_tag.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnWeatherTag*)thisx)
@@ -61,13 +61,13 @@ void EnWeatherTag_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) {
- EnWeatherTag* this = (EnWeatherTag*)thisx;
+ EnWeatherTag* this = THIS;
s32 pad;
Path* path;
s32 pathID;
// flag: is targetable. Should do nothing as not set by default above
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
switch (WEATHER_TAG_TYPE(this)) {
case WEATHERTAG_TYPE_UNK0:
@@ -77,7 +77,7 @@ void EnWeatherTag_Init(Actor* thisx, GlobalContext* globalCtx) {
EnWeatherTag_SetupAction(this, func_80966A08);
break;
case WEATHERTAG_TYPE_UNK1:
- if (gSaveContext.weekEventReg[0x34] & 0x20) { // if cleared STT
+ if (gSaveContext.weekEventReg[52] & 0x20) { // if cleared STT
Actor_MarkForDeath(&this->actor);
}
EnWeatherTag_SetupAction(this, func_80966B08);
@@ -191,11 +191,11 @@ void func_8096689C(EnWeatherTag* this, GlobalContext* globalCtx) {
globalCtx->envCtx.windSpeed = (this->actor.world.rot.z * partialResult) + 30.0f;
if (partialResult > 0.01f) {
- globalCtx->envCtx.unk_EA = 8;
+ globalCtx->envCtx.sandstormState = 8;
D_801F4E30 = 0x9B;
- } else if (globalCtx->envCtx.unk_EA == 8) {
+ } else if (globalCtx->envCtx.sandstormState == 8) {
D_801F4E30 = 0;
- globalCtx->envCtx.unk_EA = 9;
+ globalCtx->envCtx.sandstormState = 9;
}
}
@@ -249,9 +249,9 @@ void func_80966BF4(EnWeatherTag* this, GlobalContext* globalCtx) {
u8 newUnk20;
CsCmdActorAction* tmpAction;
- if (func_800EE29C(globalCtx, 0x237) != 0) {
- tmpAction = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x237)];
- if ((globalCtx->csCtx.frames >= tmpAction->startFrame) && (tmpAction->unk0 >= 2)) {
+ if (Cutscene_CheckActorAction(globalCtx, 567)) {
+ tmpAction = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 567)];
+ if ((globalCtx->csCtx.frames >= tmpAction->startFrame) && (tmpAction->action >= 2)) {
switch (gSaveContext.day) {
case 0:
case 1:
@@ -429,20 +429,20 @@ void func_809672DC(EnWeatherTag* this, GlobalContext* globalCtx) {
range = WEATHER_TAG_RANGE100(this);
if (distance < range) {
- globalCtx->envCtx.unk_EA = 6;
+ globalCtx->envCtx.sandstormState = 6;
strength = 1.0f - (distance / range);
if (0.8f < strength) {
strength = 1.0f;
}
D_801F4E30 = (200.0f * strength);
} else {
- if (globalCtx->envCtx.unk_EA == 6) {
+ if (globalCtx->envCtx.sandstormState == 6) {
D_801F4E30 = 0;
- globalCtx->envCtx.unk_EA = 7;
+ globalCtx->envCtx.sandstormState = 7;
}
}
- Math_SmoothStepToS(&globalCtx->envCtx.unk_8C.fogNear, (s16)(-40.0f * strength), 1, 1, 1);
+ Math_SmoothStepToS(&globalCtx->envCtx.lightSettings.fogNear, (s16)(-40.0f * strength), 1, 1, 1);
}
// WEATHERTAG_TYPE_LOCALDAY2RAIN: rain proximity as approaching rainy scene
@@ -480,11 +480,11 @@ void func_80967608(EnWeatherTag* this, GlobalContext* globalCtx) {
}
void EnWeatherTag_Update(Actor* thisx, GlobalContext* globalCtx) {
- EnWeatherTag* this = (EnWeatherTag*)thisx;
+ EnWeatherTag* this = THIS;
u16 oldTime;
this->actionFunc(this, globalCtx);
- if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.unk11F22 != 0) && (globalCtx->msgCtx.unk11F04 == 0x5E6) &&
+ if ((globalCtx->actorCtx.unk5 & 2) && (globalCtx->msgCtx.msgMode != 0) && (globalCtx->msgCtx.unk11F04 == 0x5E6) &&
(!FrameAdvance_IsEnabled(globalCtx)) && (globalCtx->sceneLoadFlag == 0) &&
(ActorCutscene_GetCurrentIndex() == -1) && (globalCtx->csCtx.state == 0)) {
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 a453e23e77..9f109b1cd9 100644
--- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c
+++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c
@@ -7,8 +7,9 @@
#include "z_en_wf.h"
#include "overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.h"
#include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h"
+#include "objects/object_wf/object_wf.h"
-#define FLAGS 0x00000415
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((EnWf*)thisx)
@@ -55,23 +56,6 @@ void func_80993524(EnWf* this);
void func_8099357C(EnWf* this, GlobalContext* globalCtx);
s32 func_8099408C(GlobalContext* globalCtx, EnWf* this);
-extern UNK_TYPE D_06000300;
-extern UNK_TYPE D_060027D8;
-extern UNK_TYPE D_060029D8;
-extern FlexSkeletonHeader D_06003BC0;
-extern AnimationHeader D_06004638;
-extern AnimationHeader D_06004A90;
-extern AnimationHeader D_06004C44;
-extern AnimationHeader D_060053D0;
-extern AnimationHeader D_06005700;
-extern UNK_TYPE D_06007AA8;
-extern UNK_TYPE D_060082A8;
-extern UNK_TYPE D_060084A8;
-extern FlexSkeletonHeader D_060095D0;
-extern AnimationHeader D_06009808;
-extern AnimationHeader D_06009A50;
-extern AnimationHeader D_0600A3CC;
-
const ActorInit En_Wf_InitVars = {
ACTOR_EN_WF,
ACTORCAT_PROP,
@@ -256,18 +240,18 @@ static DamageTable sDamageTable2 = {
static CollisionCheckInfoInit sColChkInfoInit = { 8, 50, 100, MASS_HEAVY };
-static UNK_TYPE D_809942B0[] = {
- &D_06007AA8,
- &D_060082A8,
- &D_060084A8,
- &D_060082A8,
+static TexturePtr D_809942B0[] = {
+ object_wf_Tex_007AA8,
+ object_wf_Tex_0082A8,
+ object_wf_Tex_0084A8,
+ object_wf_Tex_0082A8,
};
-static UNK_TYPE D_809942C0[] = {
- &D_06000300,
- &D_060027D8,
- &D_060029D8,
- &D_060027D8,
+static TexturePtr D_809942C0[] = {
+ object_wf_Tex_000300,
+ object_wf_Tex_0027D8,
+ object_wf_Tex_0029D8,
+ object_wf_Tex_0027D8,
};
static InitChainEntry sInitChain[] = {
@@ -334,16 +318,16 @@ void EnWf_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.0075f);
if (this->actor.params == 0) {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_060095D0, &D_0600A3CC, this->jointTable, this->morphTable,
- 22);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wf_Skel_0095D0, &object_wf_Anim_00A3CC,
+ this->jointTable, this->morphTable, 22);
this->actor.hintId = 0x4C;
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable2, &sColChkInfoInit);
this->collider1.elements[0].info.toucher.damage = 8;
this->collider1.elements[1].info.toucher.damage = 8;
this->actor.colChkInfo.health = 6;
} else {
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003BC0, &D_0600A3CC, this->jointTable, this->morphTable,
- 22);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_wf_Skel_003BC0, &object_wf_Anim_00A3CC,
+ this->jointTable, this->morphTable, 22);
this->actor.hintId = 0x57;
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable1, &sColChkInfoInit);
}
@@ -383,7 +367,7 @@ void func_809907D4(EnWf* this) {
this->collider2.base.colType = COLTYPE_HIT3;
this->collider3.base.colType = COLTYPE_HIT3;
this->unk_2A0 = 80;
- this->actor.flags &= ~0x400;
+ this->actor.flags &= ~ACTOR_FLAG_400;
Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0, 80);
}
@@ -394,7 +378,7 @@ void func_80990854(EnWf* this, GlobalContext* globalCtx) {
this->collider3.base.colType = COLTYPE_HIT5;
this->unk_2AC = 0.0f;
Actor_SpawnIceEffects(globalCtx, &this->actor, this->unk_2B8, 10, 2, 0.3f, 0.2f);
- this->actor.flags |= 0x400;
+ this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -542,7 +526,7 @@ void func_80990F0C(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
this->actor.shape.shadowScale = 0.0f;
this->actor.scale.y = 0.0f;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_2A0 = 60;
this->actionFunc = func_80990F50;
}
@@ -566,9 +550,9 @@ void func_80990F50(EnWf* this, GlobalContext* globalCtx) {
}
void func_80990FC8(EnWf* this) {
- Animation_Change(&this->skelAnime, &D_060053D0, 0.5f, 0.0f, 7.0f, 3, 0.0f);
+ Animation_Change(&this->skelAnime, &object_wf_Anim_0053D0, 0.5f, 0.0f, 7.0f, 3, 0.0f);
this->unk_2A0 = 5;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actionFunc = func_80991040;
}
@@ -589,7 +573,7 @@ void func_80991040(EnWf* this, GlobalContext* globalCtx) {
void func_809910F0(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
this->actor.speedXZ = 0.0f;
- Animation_Change(&this->skelAnime, &D_060053D0, 0.5f, 0.0f, 7.0f, 3, -5.0f);
+ Animation_Change(&this->skelAnime, &object_wf_Anim_0053D0, 0.5f, 0.0f, 7.0f, 3, -5.0f);
this->unk_2A0 = 5;
this->actionFunc = func_80991174;
}
@@ -608,7 +592,7 @@ void func_80991174(EnWf* this, GlobalContext* globalCtx) {
void func_80991200(EnWf* this) {
this->collider2.base.acFlags |= AC_ON;
- Animation_MorphToLoop(&this->skelAnime, &D_0600A3CC, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_00A3CC, -4.0f);
this->unk_2A0 = (s32)Rand_ZeroFloat(10.0f) + 2;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_80991280;
@@ -659,7 +643,7 @@ void func_80991280(EnWf* this, GlobalContext* globalCtx) {
void func_80991438(EnWf* this) {
this->collider2.base.acFlags |= AC_ON;
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actor.speedXZ = 8.0f;
this->actionFunc = func_8099149C;
@@ -720,7 +704,7 @@ void func_8099149C(EnWf* this, GlobalContext* globalCtx) {
}
void func_80991738(EnWf* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06009808, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_009808, -4.0f);
this->actionFunc = func_8099177C;
}
@@ -772,7 +756,7 @@ void func_8099177C(EnWf* this, GlobalContext* globalCtx) {
void func_80991948(EnWf* this) {
this->collider2.base.acFlags |= AC_ON;
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
if (Rand_ZeroOne() > 0.5f) {
this->unk_29A = 16000;
} else {
@@ -826,7 +810,7 @@ void func_809919F4(EnWf* this, GlobalContext* globalCtx) {
void func_80991C04(EnWf* this) {
this->collider2.base.acFlags |= AC_ON;
- Animation_PlayOnce(&this->skelAnime, &D_06004638);
+ Animation_PlayOnce(&this->skelAnime, &object_wf_Anim_004638);
this->collider1.base.atFlags &= ~AT_BOUNCED;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
this->unk_2A0 = 7;
@@ -896,7 +880,7 @@ void func_80991FD8(EnWf* this) {
if (this->skelAnime.curFrame > 15.0f) {
phi_f0 = 15.0f;
}
- Animation_Change(&this->skelAnime, &D_06004638, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, 3, 0.0f);
+ Animation_Change(&this->skelAnime, &object_wf_Anim_004638, -0.5f, this->skelAnime.curFrame - 1.0f, phi_f0, 3, 0.0f);
this->collider1.base.atFlags &= ~AT_ON;
this->actionFunc = func_80992068;
}
@@ -939,7 +923,7 @@ void func_80992068(EnWf* this, GlobalContext* globalCtx) {
void func_8099223C(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06004A90, -3.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_004A90, -3.0f);
this->unk_2A0 = 0;
this->actor.speedXZ = -6.0f;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
@@ -989,7 +973,7 @@ void func_809923E4(EnWf* this, GlobalContext* globalCtx) {
void func_8099245C(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_06009A50, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_009A50, -4.0f);
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -4.0f;
}
@@ -1037,7 +1021,8 @@ void func_809924EC(EnWf* this, GlobalContext* globalCtx) {
void func_809926D0(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
- Animation_Change(&this->skelAnime, &D_06004A90, -1.0f, Animation_GetLastFrame(&D_06004A90.common), 0.0f, 2, -3.0f);
+ Animation_Change(&this->skelAnime, &object_wf_Anim_004A90, -1.0f,
+ Animation_GetLastFrame(&object_wf_Anim_004A90.common), 0.0f, 2, -3.0f);
this->unk_2A0 = 0;
this->actor.speedXZ = 6.5f;
this->actor.velocity.y = 15.0f;
@@ -1068,7 +1053,8 @@ void func_8099282C(EnWf* this) {
this->collider1.base.atFlags &= ~AT_ON;
this->unk_2A0 = 10;
this->actor.speedXZ = 0.0f;
- Animation_Change(&this->skelAnime, &D_06004C44, -1.0f, Animation_GetLastFrame(&D_06004C44.common), 0.0f, 2, -2.0f);
+ Animation_Change(&this->skelAnime, &object_wf_Anim_004C44, -1.0f,
+ Animation_GetLastFrame(&object_wf_Anim_004C44.common), 0.0f, 2, -2.0f);
this->actionFunc = func_809928CC;
}
@@ -1105,7 +1091,7 @@ void func_80992A74(EnWf* this, GlobalContext* globalCtx) {
f32 temp_f0;
this->collider2.base.acFlags |= AC_ON;
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
player = GET_PLAYER(globalCtx);
temp_f0 = Math_SinS((player->actor.shape.rot.y + this->unk_29A) - this->actor.yawTowardsPlayer);
if (temp_f0 > 0.0f) {
@@ -1167,12 +1153,12 @@ void func_80992B8C(EnWf* this, GlobalContext* globalCtx) {
void func_80992D6C(EnWf* this) {
this->collider2.base.acFlags &= ~AC_ON;
- Animation_MorphToPlayOnce(&this->skelAnime, &D_060053D0, -4.0f);
+ Animation_MorphToPlayOnce(&this->skelAnime, &object_wf_Anim_0053D0, -4.0f);
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (this->actor.bgCheckFlags & 1) {
this->actor.speedXZ = -6.0f;
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
this->unk_2A0 = 25;
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_DEAD);
this->actionFunc = func_80992E0C;
@@ -1219,7 +1205,7 @@ void func_80992E0C(EnWf* this, GlobalContext* globalCtx) {
}
void func_80992FD4(EnWf* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_0600A3CC, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_00A3CC, -4.0f);
this->actionFunc = func_80993018;
}
@@ -1246,7 +1232,7 @@ void func_80993018(EnWf* this, GlobalContext* globalCtx) {
}
void func_80993148(EnWf* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
this->actor.speedXZ = 0.0f;
this->actionFunc = func_80993194;
}
@@ -1291,7 +1277,7 @@ void func_80993194(EnWf* this, GlobalContext* globalCtx) {
}
void func_80993350(EnWf* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_WOLFOS_APPEAR);
this->actionFunc = func_809933A0;
}
@@ -1331,7 +1317,7 @@ void func_809933A0(EnWf* this, GlobalContext* globalCtx) {
}
void func_80993524(EnWf* this) {
- Animation_MorphToLoop(&this->skelAnime, &D_06005700, -4.0f);
+ Animation_MorphToLoop(&this->skelAnime, &object_wf_Anim_005700, -4.0f);
this->actor.speedXZ = 6.0f;
this->actor.world.rot.y = this->actor.shape.rot.y;
this->actionFunc = func_8099357C;
@@ -1546,7 +1532,7 @@ void EnWf_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-s32 func_80993E50(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+s32 EnWf_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnWf* this = THIS;
if ((limbIndex == 17) || (limbIndex == 18)) {
@@ -1555,7 +1541,7 @@ s32 func_80993E50(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
return false;
}
-void func_80993E94(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnWf_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static s8 D_809942FC[] = {
-1, -1, -1, -1, -1, 0, 1, -1, -1, -1, -1, 2, -1, 3, 4, 5, 6, -1, -1, 7, 8, 9,
};
@@ -1593,7 +1579,7 @@ void EnWf_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
- this->skelAnime.dListCount, func_80993E50, func_80993E94, &this->actor);
+ this->skelAnime.dListCount, EnWf_OverrideLimbDraw, EnWf_PostLimbDraw, &this->actor);
func_800BE680(globalCtx, &this->actor, this->unk_2B8, 10, this->unk_2B0, this->unk_2B4, this->unk_2AC,
this->unk_296);
}
diff --git a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
index 9264f42fb0..7279650e77 100644
--- a/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
+++ b/src/overlays/actors/ovl_En_Wiz/z_en_wiz.c
@@ -6,7 +6,9 @@
#include "z_en_wiz.h"
-#define FLAGS 0x88101035
+#define FLAGS \
+ (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_1000 | ACTOR_FLAG_100000 | \
+ ACTOR_FLAG_8000000 | ACTOR_FLAG_80000000)
#define THIS ((EnWiz*)thisx)
diff --git a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c
index 1fa6bd35b8..d6ae083312 100644
--- a/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c
+++ b/src/overlays/actors/ovl_En_Wiz_Brock/z_en_wiz_brock.c
@@ -6,7 +6,7 @@
#include "z_en_wiz_brock.h"
-#define FLAGS 0x08000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_8000000)
#define THIS ((EnWizBrock*)thisx)
diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
index 0bdbf86794..80dd47feb5 100644
--- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
+++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c
@@ -8,7 +8,7 @@
#include "overlays/actors/ovl_En_Wiz/z_en_wiz.h"
#include "objects/object_wiz/object_wiz.h"
-#define FLAGS 0x08000015
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_4 | ACTOR_FLAG_10 | ACTOR_FLAG_8000000)
#define THIS ((EnWizFire*)thisx)
@@ -70,7 +70,7 @@ void EnWizFire_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.targetMode = 3;
this->unk_172 = 10;
this->unk_1FC = 255.0f;
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
if (!func_8012405C(globalCtx)) {
this->collider.info.toucher.dmgFlags = 0x20000000;
@@ -108,19 +108,19 @@ void EnWizFire_Destroy(Actor* thisx, GlobalContext* globalCtx) {
EnWizFire* this = THIS;
if (this->unk_162 == 0) {
- globalCtx->envCtx.unk_8C.fogColor[2] = 0;
- globalCtx->envCtx.unk_8C.fogColor[1] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.fogColor[0] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor2[2] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor2[1] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor2[0] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor1[2] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor1[1] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.diffuseColor1[0] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.ambientColor[2] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.ambientColor[1] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.ambientColor[0] = globalCtx->envCtx.unk_8C.fogColor[2];
- globalCtx->envCtx.unk_8C.fogNear = globalCtx->envCtx.unk_8C.fogColor[2];
+ globalCtx->envCtx.lightSettings.fogColor[2] = 0;
+ globalCtx->envCtx.lightSettings.fogColor[1] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.fogColor[0] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor2[2] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor2[1] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor2[0] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.ambientColor[2] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.ambientColor[1] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.ambientColor[0] = globalCtx->envCtx.lightSettings.fogColor[2];
+ globalCtx->envCtx.lightSettings.fogNear = globalCtx->envCtx.lightSettings.fogColor[2];
}
Collider_DestroyCylinder(globalCtx, &this->collider);
}
@@ -483,37 +483,37 @@ void EnWizFire_Update(Actor* thisx, GlobalContext* globalCtx2) {
phi_f0 = 968.0f;
}
- globalCtx->envCtx.unk_8C.fogNear = (phi_f0 - (s16)globalCtx->envCtx.unk_C4.fogNear) * this->unk_204;
+ globalCtx->envCtx.lightSettings.fogNear = (phi_f0 - (s16)globalCtx->envCtx.unk_C4.fogNear) * this->unk_204;
- globalCtx->envCtx.unk_8C.ambientColor[0] =
+ globalCtx->envCtx.lightSettings.ambientColor[0] =
((f32)D_80A4C234[idx].r - globalCtx->envCtx.unk_C4.ambientColor[0]) * this->unk_204;
- globalCtx->envCtx.unk_8C.ambientColor[1] =
+ globalCtx->envCtx.lightSettings.ambientColor[1] =
((f32)D_80A4C234[idx].g - globalCtx->envCtx.unk_C4.ambientColor[1]) * this->unk_204;
- globalCtx->envCtx.unk_8C.ambientColor[2] =
+ globalCtx->envCtx.lightSettings.ambientColor[2] =
((f32)D_80A4C234[idx].b - globalCtx->envCtx.unk_C4.ambientColor[2]) * this->unk_204;
idx++;
- globalCtx->envCtx.unk_8C.diffuseColor1[0] =
+ globalCtx->envCtx.lightSettings.diffuseColor1[0] =
((f32)D_80A4C234[idx].r - globalCtx->envCtx.unk_C4.diffuseColor1[0]) * this->unk_204;
- globalCtx->envCtx.unk_8C.diffuseColor1[1] =
+ globalCtx->envCtx.lightSettings.diffuseColor1[1] =
((f32)D_80A4C234[idx].g - globalCtx->envCtx.unk_C4.diffuseColor1[1]) * this->unk_204;
- globalCtx->envCtx.unk_8C.diffuseColor1[2] =
+ globalCtx->envCtx.lightSettings.diffuseColor1[2] =
((f32)D_80A4C234[idx].b - globalCtx->envCtx.unk_C4.diffuseColor1[2]) * this->unk_204;
idx++;
- globalCtx->envCtx.unk_8C.diffuseColor2[0] =
+ globalCtx->envCtx.lightSettings.diffuseColor2[0] =
((f32)D_80A4C234[idx].r - globalCtx->envCtx.unk_C4.diffuseColor[0]) * this->unk_204;
- globalCtx->envCtx.unk_8C.diffuseColor2[1] =
+ globalCtx->envCtx.lightSettings.diffuseColor2[1] =
((f32)D_80A4C234[idx].g - globalCtx->envCtx.unk_C4.diffuseColor[1]) * this->unk_204;
- globalCtx->envCtx.unk_8C.diffuseColor2[2] =
+ globalCtx->envCtx.lightSettings.diffuseColor2[2] =
((f32)D_80A4C234[idx].b - globalCtx->envCtx.unk_C4.diffuseColor[2]) * this->unk_204;
idx++;
- globalCtx->envCtx.unk_8C.fogColor[0] =
+ globalCtx->envCtx.lightSettings.fogColor[0] =
((f32)D_80A4C234[idx].r - globalCtx->envCtx.unk_C4.fogColor[0]) * this->unk_204;
- globalCtx->envCtx.unk_8C.fogColor[1] =
+ globalCtx->envCtx.lightSettings.fogColor[1] =
((f32)D_80A4C234[idx].g - globalCtx->envCtx.unk_C4.fogColor[1]) * this->unk_204;
- globalCtx->envCtx.unk_8C.fogColor[2] =
+ globalCtx->envCtx.lightSettings.fogColor[2] =
((f32)D_80A4C234[idx].b - globalCtx->envCtx.unk_C4.fogColor[2]) * this->unk_204;
}
}
@@ -699,7 +699,8 @@ void func_80A4B33C(EnWizFire* this, GlobalContext* globalCtx2) {
gSPDisplayList(POLY_XLU_DISP++, object_wiz_DL_003640);
Matrix_StatePop();
- Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z, 0);
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.floorHeight, this->actor.world.pos.z,
+ MTXMODE_NEW);
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
gSPSegment(POLY_XLU_DISP++, 0x08,
diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.c b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
index bb3f81576d..fec9af08fa 100644
--- a/src/overlays/actors/ovl_En_Yb/z_en_yb.c
+++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.c
@@ -5,8 +5,9 @@
*/
#include "z_en_yb.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x02000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((EnYb*)thisx)
@@ -15,16 +16,22 @@ void EnYb_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnYb_Update(Actor* thisx, GlobalContext* globalCtx);
void EnYb_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_80BFA730(EnYb* this, GlobalContext* globalCtx);
-void func_80BFA868(EnYb* this, GlobalContext* globalCtx);
-void func_80BFA91C(EnYb* this, GlobalContext* globalCtx);
-void func_80BFA9D4(EnYb* this, GlobalContext* globalCtx);
-void func_80BFAB4C(EnYb* this, GlobalContext* globalCtx);
-void func_80BFABF0(EnYb* this, GlobalContext* globalCtx);
-void func_80BFAC88(EnYb* this, GlobalContext* globalCtx);
-void func_80BFAE80(EnYb* this, GlobalContext* globalCtx);
+void EnYb_Idle(EnYb* this, GlobalContext* globalCtx);
+void EnYb_TeachingDanceFinish(EnYb* this, GlobalContext* globalCtx);
+void EnYb_SetupLeaving(EnYb* this, GlobalContext* globalCtx);
+
+void EnYb_UpdateAnimation(EnYb* this, GlobalContext* globalCtx);
+void EnYb_FinishTeachingCutscene(EnYb* this);
+void EnYb_Disappear(EnYb* this, GlobalContext* globalCtx);
+void EnYb_ReceiveMask(EnYb* this, GlobalContext* globalCtx);
+void EnYb_Talk(EnYb* this, GlobalContext* globalCtx);
+void EnYb_TeachingDance(EnYb* this, GlobalContext* globalCtx);
+void EnYb_WaitForMidnight(EnYb* this, GlobalContext* globalCtx);
+
+void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, GlobalContext* globalCtx);
+void EnYb_SetAnimation(GlobalContext*, EnYb*, s16, u8, f32);
+s32 EnYb_CanTalk(EnYb* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Yb_InitVars = {
ACTOR_EN_YB,
ACTORCAT_NPC,
@@ -37,59 +44,439 @@ const ActorInit En_Yb_InitVars = {
(ActorFunc)EnYb_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BFB2B0 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 20, 40, 0, { 0, 0, 0 } },
};
-#endif
+// crashes if I try to mod it in to look at it
+// assumption: draw uses two different skeleton functions, might be incompatible
+static AnimationHeader* gYbUnusedAnimations[] = { &object_yb_Anim_000200 };
-extern ColliderCylinderInit D_80BFB2B0;
+static LinkAnimationHeader* gLinkAnimations[] = { &gameplay_keep_Linkanim_00DF28, &gameplay_keep_Linkanim_00CF98 };
-extern UNK_TYPE D_06000200;
+static Vec3f D_80BFB2E8 = { 0.0f, 0.5f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Init.s")
+static Vec3f D_80BFB2F4 = { 500.0f, -500.0, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Destroy.s")
+static Vec3f D_80BFB300 = { 500.0f, -500.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA2FC.s")
+void EnYb_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnYb* this = THIS;
+ s16 tempCutscene;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA350.s")
+ Actor_SetScale(&this->actor, 0.01f);
+ ActorShape_Init(&this->actor.shape, 0.0f, EnYb_ActorShadowFunc, 20.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA444.s")
+ // @Bug this alignment is because of player animations, but should be using ALIGN16
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gYbSkeleton, &object_yb_Anim_000200,
+ (uintptr_t)this->jointTable & ~0xF, (uintptr_t)this->morphTable & ~0xF, YB_LIMB_MAX);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA5CC.s")
+ Animation_PlayLoop(&this->skelAnime, &object_yb_Anim_000200);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA634.s")
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->actionFunc = EnYb_Idle;
+ this->currentAnimIndex = 3; // gets overwritten to 2 in EnYb_SetAnimation later
+ this->actor.terminalVelocity = -9.0f;
+ this->actor.gravity = -1.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA67C.s")
+ EnYb_SetAnimation(globalCtx, this, 2, ANIMMODE_LOOP, 0.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA6E0.s")
+ tempCutscene = this->actor.cutscene;
+ for (i = 0; i < ARRAY_COUNT(this->cutscenes); i++) {
+ this->cutscenes[i] = tempCutscene;
+ if (tempCutscene != -1) {
+ this->actor.cutscene = tempCutscene;
+ tempCutscene = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA710.s")
+ this->cutsceneIndex = -1;
+ this->actor.cutscene = this->cutscenes[0];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA730.s")
+ // between midnight and morning start spawned
+ if (gSaveContext.time < CLOCK_TIME(6, 0)) {
+ this->alpha = 255;
+ } else { // else (night 6pm to midnight): wait to appear
+ this->alpha = 0;
+ this->actionFunc = EnYb_WaitForMidnight;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA868.s")
+ // check if already healed
+ if (gSaveContext.weekEventReg[82] & 4) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA91C.s")
+void EnYb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnYb* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFA9D4.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAB4C.s")
+void func_80BFA2FC(GlobalContext* globalCtx) {
+ if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) {
+ func_80151BB4(globalCtx, 0x34);
+ }
+ func_80151BB4(globalCtx, 0xF);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFABF0.s")
+/**
+ * Custom shadow draw function of type ActorShadowFunc.
+ */
+void EnYb_ActorShadowFunc(Actor* thisx, Lights* mapper, GlobalContext* globalCtx) {
+ Vec3f oldPos;
+ EnYb* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAC88.s")
+ if (this->alpha > 0) {
+ if (this->currentAnimIndex == 2) {
+ f32 tempScale = (((27.0f - this->shadowPos.y) + this->actor.world.pos.y) * ((1 / 2.25f) * 0.001f)) + 0.01f;
+ this->actor.scale.x = tempScale;
+ }
+ Math_Vec3f_Copy(&oldPos, &this->actor.world.pos);
+ Math_Vec3f_Copy(&this->actor.world.pos, &this->shadowPos);
+ func_800B4AEC(globalCtx, &this->actor, 50.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFAE80.s")
+ if (oldPos.y < this->actor.floorHeight) {
+ this->actor.world.pos.y = this->actor.floorHeight;
+ } else {
+ this->actor.world.pos.y = oldPos.y;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Update.s")
+ ActorShadow_DrawCircle(&this->actor, mapper, globalCtx);
+ Math_Vec3f_Copy(&this->actor.world.pos, &oldPos);
+ this->actor.scale.x = 0.01f;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFB074.s")
+void EnYb_SetAnimation(GlobalContext* globalCtx, EnYb* this, s16 animIndex, u8 animMode, f32 transitionRate) {
+ if (animIndex >= 0 && animIndex < 3) {
+ if (animIndex != this->currentAnimIndex || animMode != ANIMMODE_LOOP) {
+ if (animIndex > 0) {
+ if (animMode == ANIMMODE_LOOP) {
+ LinkAnimation_Change(globalCtx, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f,
+ Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP,
+ transitionRate);
+ } else {
+ // unused case, (only called once with animMode = ANIMMODE_LOOP)
+ LinkAnimation_Change(globalCtx, &this->skelAnime, gLinkAnimations[animIndex - 1], 1.0f, 0.0f,
+ Animation_GetLastFrame(gLinkAnimations[animIndex - 1]), ANIMMODE_LOOP,
+ transitionRate);
+ }
+ } else {
+ // unused case, (only called once with animIndex = 2)
+ AnimationHeader* animationPtr = gYbUnusedAnimations[animIndex];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/func_80BFB0E0.s")
+ if (1) {}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Yb/EnYb_Draw.s")
+ Animation_Change(&this->skelAnime, gYbUnusedAnimations[animIndex], 1.0f, 0.0f,
+ Animation_GetLastFrame(animationPtr), animMode, transitionRate);
+ }
+ this->currentAnimIndex = animIndex;
+ }
+ }
+}
+
+s32 EnYb_CanTalk(EnYb* this, GlobalContext* globalCtx) {
+ if (this->actor.xzDistToPlayer < 100.0f && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) &&
+ Actor_IsFacingPlayer(&this->actor, 0x3000)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void EnYb_UpdateAnimation(EnYb* this, GlobalContext* globalCtx) {
+ if (this->currentAnimIndex <= 0) {
+ SkelAnime_Update(&this->skelAnime);
+ } else {
+ LinkAnimation_Update(globalCtx, &this->skelAnime);
+ }
+}
+
+void EnYb_FinishTeachingCutscene(EnYb* this) {
+ if (this->cutsceneIndex != -1) {
+ if (ActorCutscene_GetCurrentIndex() == this->cutscenes[this->cutsceneIndex]) {
+ ActorCutscene_Stop(this->cutscenes[this->cutsceneIndex]);
+ }
+ this->cutsceneIndex = -1;
+ }
+}
+
+void EnYb_ChangeCutscene(EnYb* this, s16 cutsceneId) {
+ EnYb_FinishTeachingCutscene(this);
+ this->cutsceneIndex = cutsceneId;
+}
+
+/**
+ * Sets a flag that enables the Kamaro dancing proximity music at night.
+ */
+void EnYb_EnableProximityMusic(EnYb* this) {
+ func_800B9084(&this->actor);
+}
+
+void EnYb_Disappear(EnYb* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp60;
+ s32 i;
+
+ EnYb_UpdateAnimation(this, globalCtx);
+ for (i = 3; i >= 0; i--) {
+ sp60.x = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.x;
+ sp60.z = randPlusMinusPoint5Scaled(60.0f) + this->actor.world.pos.z;
+ sp60.y = randPlusMinusPoint5Scaled(50.0f) + (this->actor.world.pos.y + 20.0f);
+ func_800B3030(globalCtx, &sp60, &D_80BFB2E8, &D_80BFB2E8, 100, 0, 2);
+ }
+
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_EN_EXTINCT);
+ if (this->alpha > 10) {
+ this->alpha -= 10;
+ } else {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void EnYb_SetupLeaving(EnYb* this, GlobalContext* globalCtx) {
+ EnYb_UpdateAnimation(this, globalCtx);
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ this->actionFunc = EnYb_Talk;
+ // I am counting on you
+ Message_StartTextbox(globalCtx, 0x147D, &this->actor);
+ func_80BFA2FC(globalCtx);
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+ EnYb_EnableProximityMusic(this);
+}
+
+void EnYb_ReceiveMask(EnYb* this, GlobalContext* globalCtx) {
+ EnYb_UpdateAnimation(this, globalCtx);
+ // Player is parent: receiving the Kamaro mask
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ this->actionFunc = EnYb_SetupLeaving;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_MASK_KAMARO, 10000.0f, 100.0f);
+ }
+ EnYb_EnableProximityMusic(this);
+}
+
+void EnYb_Talk(EnYb* this, GlobalContext* globalCtx) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ EnYb_UpdateAnimation(this, globalCtx);
+
+ if (Message_GetState(&globalCtx->msgCtx) == 5 && func_80147624(globalCtx) != 0) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x147D: // I am counting on you
+ func_801477B4(globalCtx);
+ this->actionFunc = EnYb_Disappear;
+ gSaveContext.weekEventReg[82] |= 0x4;
+ break;
+ case 0x147C: // Spread my dance across the world
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_KAMARO) {
+ func_801477B4(globalCtx);
+ this->actionFunc = EnYb_Idle;
+
+ } else if (INV_CONTENT(ITEM_MASK_KAMARO) == ITEM_MASK_KAMARO) {
+ func_80151938(globalCtx, 0x147D); // I am counting on you
+ func_80BFA2FC(globalCtx);
+
+ } else {
+ func_801477B4(globalCtx);
+ this->actionFunc = EnYb_ReceiveMask;
+ EnYb_ReceiveMask(this, globalCtx);
+ }
+ break;
+ default:
+ func_801477B4(globalCtx);
+ this->actionFunc = EnYb_Idle;
+ break;
+ }
+ }
+ EnYb_EnableProximityMusic(this);
+}
+
+void EnYb_TeachingDanceFinish(EnYb* this, GlobalContext* globalCtx) {
+ EnYb_UpdateAnimation(this, globalCtx);
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = EnYb_Talk;
+ // Spread my dance across the world
+ Message_StartTextbox(globalCtx, 0x147C, &this->actor);
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+ EnYb_EnableProximityMusic(this);
+}
+
+// dancing countdown
+void EnYb_TeachingDance(EnYb* this, GlobalContext* globalCtx) {
+ EnYb_UpdateAnimation(this, globalCtx);
+
+ if (this->teachingCutsceneTimer > 0) {
+ this->teachingCutsceneTimer--;
+ } else {
+ EnYb_FinishTeachingCutscene(this);
+ this->actionFunc = EnYb_TeachingDanceFinish;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+ EnYb_EnableProximityMusic(this);
+}
+
+void EnYb_Idle(EnYb* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ EnYb_UpdateAnimation(this, globalCtx);
+ if (this->actor.xzDistToPlayer < 180.0f && fabsf(this->actor.playerHeightRel) < 50.0f &&
+ globalCtx->msgCtx.ocarinaMode == 3 && globalCtx->msgCtx.unk1202E == 7 &&
+ gSaveContext.playerForm == PLAYER_FORM_HUMAN) {
+ this->actionFunc = EnYb_TeachingDance;
+ this->teachingCutsceneTimer = 200;
+ EnYb_ChangeCutscene(this, 0);
+ } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ func_80BFA2FC(globalCtx);
+ this->actionFunc = EnYb_Talk;
+ if (Player_GetMask(globalCtx) == PLAYER_MASK_KAMARO) {
+ // I have taught you, go use it
+ Message_StartTextbox(globalCtx, 0x147C, &this->actor);
+ } else {
+ // regular talk to him first dialogue
+ Message_StartTextbox(globalCtx, 0x147B, &this->actor);
+ }
+ } else if (EnYb_CanTalk(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+
+ if (this->playerOcarinaOut & 1) {
+ if (!(player->stateFlags2 & 0x8000000)) {
+ this->playerOcarinaOut &= ~1;
+ }
+ } else if ((player->stateFlags2 & 0x8000000) && this->actor.xzDistToPlayer < 180.0f &&
+ fabsf(this->actor.playerHeightRel) < 50.0f) {
+ this->playerOcarinaOut |= 1;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
+ }
+
+ EnYb_EnableProximityMusic(this);
+}
+
+void EnYb_WaitForMidnight(EnYb* this, GlobalContext* globalCtx) {
+ if (gSaveContext.time < CLOCK_TIME(6, 0)) {
+ EnYb_UpdateAnimation(this, globalCtx);
+ this->alpha += 5;
+ if (this->alpha > 250) {
+ this->alpha = 255;
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actionFunc = EnYb_Idle;
+ }
+ EnYb_EnableProximityMusic(this);
+ }
+}
+
+void EnYb_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnYb* this = THIS;
+
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_1)) {
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+ if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_1)) {
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 25.0f, 40.0f, 5);
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->cutsceneIndex != -1 && ActorCutscene_GetCurrentIndex() != this->cutscenes[this->cutsceneIndex]) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]);
+ } else if (ActorCutscene_GetCanPlayNext(this->cutscenes[this->cutsceneIndex])) {
+ if (this->cutsceneIndex == 0) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->cutscenes[this->cutsceneIndex], &this->actor);
+ }
+ } else {
+ ActorCutscene_SetIntentToPlay(this->cutscenes[this->cutsceneIndex]);
+ }
+ }
+}
+
+void EnYb_PostLimbDrawOpa(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnYb* this = THIS;
+
+ if (limbIndex == YB_LIMB_HEAD) {
+ Matrix_MultiplyVector3fByState(&D_80BFB2F4, &this->actor.focus.pos);
+ }
+ if (limbIndex == YB_LIMB_LEGS_ROOT) {
+ Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->shadowPos);
+ }
+}
+
+void EnYb_PostLimbDrawXlu(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ EnYb* this = THIS;
+
+ if (limbIndex == YB_LIMB_HEAD) {
+ Matrix_MultiplyVector3fByState(&D_80BFB300, &this->actor.focus.pos);
+ }
+ if (limbIndex == YB_LIMB_LEGS_ROOT) {
+ Matrix_MultiplyVector3fByState(&gZeroVec3f, &this->shadowPos);
+ }
+}
+
+void EnYb_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnYb* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->alpha != 0) {
+ if (this->alpha < 255) {
+ if (this->alpha > 128) {
+ func_8012C2B4(POLY_XLU_DISP++);
+ Scene_SetRenderModeXlu(globalCtx, 2, 2);
+ } else {
+ func_8012C304(POLY_XLU_DISP++);
+ Scene_SetRenderModeXlu(globalCtx, 1, 2);
+ }
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
+
+ if (1) {}
+
+ POLY_XLU_DISP =
+ SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, EnYb_PostLimbDrawXlu, &this->actor, POLY_XLU_DISP);
+
+ } else {
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Scene_SetRenderModeXlu(globalCtx, 0, 1);
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, EnYb_PostLimbDrawOpa, &this->actor);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Yb/z_en_yb.h b/src/overlays/actors/ovl_En_Yb/z_en_yb.h
index ca8a59d932..1b4c898a2e 100644
--- a/src/overlays/actors/ovl_En_Yb/z_en_yb.h
+++ b/src/overlays/actors/ovl_En_Yb/z_en_yb.h
@@ -2,17 +2,28 @@
#define Z_EN_YB_H
#include "global.h"
+#include "objects/object_yb/object_yb.h"
struct EnYb;
typedef void (*EnYbActionFunc)(struct EnYb*, GlobalContext*);
typedef struct EnYb {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x2DC];
- /* 0x0420 */ EnYbActionFunc actionFunc;
+ /* 0x000 */ Actor actor;
+ /* 0x144 */ SkelAnime skelAnime;
+ /* 0x188 */ Vec3s jointTable[YB_LIMB_MAX];
+ /* 0x20C */ UNK_TYPE1 unkPadding20C[0x94];
+ /* 0x2A0 */ Vec3s morphTable[YB_LIMB_MAX];
+ /* 0x324 */ UNK_TYPE1 unkPadding324[0x94];
+ /* 0x3B8 */ ColliderCylinder collider;
+ /* 0x404 */ Vec3f shadowPos;
+ /* 0x410 */ u16 playerOcarinaOut;
+ /* 0x412 */ s16 currentAnimIndex;
+ /* 0x414 */ s16 alpha;
+ /* 0x416 */ s16 cutscenes[2];
+ /* 0x41A */ s16 cutsceneIndex;
+ /* 0x41C */ s16 teachingCutsceneTimer;
+ /* 0x420 */ EnYbActionFunc actionFunc;
} EnYb; // size = 0x424
-extern const ActorInit En_Yb_InitVars;
-
#endif // Z_EN_YB_H
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 0ef9f83af7..004907003a 100644
--- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c
+++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1.c
@@ -6,7 +6,7 @@
#include "z_en_zl1.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnZl1*)thisx)
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 d2b5e03788..731af37720 100644
--- a/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
+++ b/src/overlays/actors/ovl_En_Zl4/z_en_zl4.c
@@ -6,7 +6,7 @@
#include "z_en_zl4.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((EnZl4*)thisx)
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 730bcf10ba..3a9872406c 100644
--- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c
+++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c
@@ -1,12 +1,13 @@
/*
* File: z_en_zo.c
* Overlay: ovl_En_Zo
- * Description: Zoras
+ * Description: Zoras (unused)
*/
#include "z_en_zo.h"
+#include "objects/object_zo/object_zo.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnZo*)thisx)
@@ -15,12 +16,10 @@ void EnZo_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnZo_Update(Actor* thisx, GlobalContext* globalCtx);
void EnZo_Draw(Actor* thisx, GlobalContext* globalCtx);
-void func_8099EBD8(EnZo* this, GlobalContext* globalCtx);
-void func_8099EC50(EnZo* this, GlobalContext* globalCtx);
-void func_8099ED4C(EnZo* this, GlobalContext* globalCtx);
-void func_8099EE24(EnZo* this, GlobalContext* globalCtx);
+void EnZo_FollowPath(EnZo* this, GlobalContext* globalCtx);
+void EnZo_TreadWater(EnZo* this, GlobalContext* globalCtx);
+void EnZo_DoNothing(EnZo* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Zo_InitVars = {
ACTOR_EN_ZO,
ACTORCAT_NPC,
@@ -33,86 +32,336 @@ const ActorInit En_Zo_InitVars = {
(ActorFunc)EnZo_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_8099F4B0 = {
- { COLTYPE_HIT0, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_HIT0,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK1,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 18, 64, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit2 D_8099F4DC = { 0, 0, 0, 0, MASS_IMMOVABLE };
+static CollisionCheckInfoInit2 sColChkInfoInit = { 0, 0, 0, 0, MASS_IMMOVABLE };
-// static DamageTable sDamageTable = {
-static DamageTable D_8099F4E8 = {
- /* Deku Nut */ DMG_ENTRY(0, 0x0),
- /* Deku Stick */ DMG_ENTRY(0, 0x0),
- /* Horse trample */ DMG_ENTRY(0, 0x0),
- /* Explosives */ DMG_ENTRY(0, 0x0),
- /* Zora boomerang */ DMG_ENTRY(0, 0x0),
- /* Normal arrow */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0x0),
- /* Hookshot */ DMG_ENTRY(0, 0x0),
- /* Goron punch */ DMG_ENTRY(0, 0x0),
- /* Sword */ DMG_ENTRY(0, 0x0),
- /* Goron pound */ DMG_ENTRY(0, 0x0),
- /* Fire arrow */ DMG_ENTRY(0, 0x0),
- /* Ice arrow */ DMG_ENTRY(0, 0x0),
- /* Light arrow */ DMG_ENTRY(0, 0x0),
- /* Goron spikes */ DMG_ENTRY(0, 0x0),
- /* Deku spin */ DMG_ENTRY(0, 0x0),
- /* Deku bubble */ DMG_ENTRY(0, 0x0),
- /* Deku launch */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0x0),
- /* Zora barrier */ DMG_ENTRY(0, 0x0),
- /* Normal shield */ DMG_ENTRY(0, 0x0),
- /* Light ray */ DMG_ENTRY(0, 0x0),
- /* Thrown object */ DMG_ENTRY(0, 0x0),
- /* Zora punch */ DMG_ENTRY(0, 0x0),
- /* Spin attack */ DMG_ENTRY(0, 0x0),
- /* Sword beam */ DMG_ENTRY(0, 0x0),
- /* Normal Roll */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0x0),
- /* Unblockable */ DMG_ENTRY(0, 0x0),
- /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0x0),
- /* Powder Keg */ DMG_ENTRY(0, 0x0),
+static DamageTable sDamageTable = {
+ /* Deku Nut */ DMG_ENTRY(0, 0),
+ /* Deku Stick */ DMG_ENTRY(0, 0),
+ /* Horse trample */ DMG_ENTRY(0, 0),
+ /* Explosives */ DMG_ENTRY(0, 0),
+ /* Zora boomerang */ DMG_ENTRY(0, 0),
+ /* Normal arrow */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x06 */ DMG_ENTRY(0, 0),
+ /* Hookshot */ DMG_ENTRY(0, 0),
+ /* Goron punch */ DMG_ENTRY(0, 0),
+ /* Sword */ DMG_ENTRY(0, 0),
+ /* Goron pound */ DMG_ENTRY(0, 0),
+ /* Fire arrow */ DMG_ENTRY(0, 0),
+ /* Ice arrow */ DMG_ENTRY(0, 0),
+ /* Light arrow */ DMG_ENTRY(0, 0),
+ /* Goron spikes */ DMG_ENTRY(0, 0),
+ /* Deku spin */ DMG_ENTRY(0, 0),
+ /* Deku bubble */ DMG_ENTRY(0, 0),
+ /* Deku launch */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x12 */ DMG_ENTRY(0, 0),
+ /* Zora barrier */ DMG_ENTRY(0, 0),
+ /* Normal shield */ DMG_ENTRY(0, 0),
+ /* Light ray */ DMG_ENTRY(0, 0),
+ /* Thrown object */ DMG_ENTRY(0, 0),
+ /* Zora punch */ DMG_ENTRY(0, 0),
+ /* Spin attack */ DMG_ENTRY(0, 0),
+ /* Sword beam */ DMG_ENTRY(0, 0),
+ /* Normal Roll */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1B */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1C */ DMG_ENTRY(0, 0),
+ /* Unblockable */ DMG_ENTRY(0, 0),
+ /* UNK_DMG_0x1E */ DMG_ENTRY(0, 0),
+ /* Powder Keg */ DMG_ENTRY(0, 0),
};
-#endif
+static AnimationInfoS sAnimations[] = {
+ { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
+ { &gZoraIdleAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gZoraSurfacingAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gZoraHandsOnHipsTappingFootAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gZoraArmsOpenAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gZoraThrowRupeeAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+ { &gZoraWalkAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
+};
-extern ColliderCylinderInit D_8099F4B0;
-extern CollisionCheckInfoInit2 D_8099F4DC;
-extern DamageTable D_8099F4E8;
+s8 D_8099F578[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2, -1, -1, -1, -1 };
+s8 D_8099F58C[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13 };
+u8 D_8099F59C[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-extern UNK_TYPE D_0600D208;
+s32 EnZo_SetAnimation(SkelAnime* skelAnime, s16 index) {
+ s16 frameCount;
+ s32 didChange = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E790.s")
+ if ((index >= 0) && (index < ARRAY_COUNT(sAnimations))) {
+ didChange = true;
+ frameCount = sAnimations[index].frameCount;
+ if (frameCount < 0) {
+ frameCount = Animation_GetLastFrame(sAnimations[index].animation);
+ }
+ Animation_Change(skelAnime, sAnimations[index].animation, sAnimations[index].playSpeed,
+ sAnimations[index].startFrame, frameCount, sAnimations[index].mode,
+ sAnimations[index].morphFrames);
+ }
+ return didChange;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E858.s")
+s32 EnZo_PlayWalkingSound(EnZo* this, GlobalContext* globalCtx) {
+ u8 leftWasGrounded;
+ u8 rightWasGrounded;
+ s32 waterSfxId;
+ u16 sfxId;
+ u8 isFootGrounded;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E96C.s")
+ leftWasGrounded = this->isLeftFootGrounded;
+ rightWasGrounded = this->isRightFootGrounded;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099E9E0.s")
+ if (this->actor.bgCheckFlags & 0x20) {
+ if (this->actor.depthInWater < 20.0f) {
+ waterSfxId = NA_SE_PL_WALK_WATER0 - SFX_FLAG;
+ } else {
+ waterSfxId = NA_SE_PL_WALK_WATER1 - SFX_FLAG;
+ }
+ sfxId = waterSfxId + SFX_FLAG;
+ } else {
+ sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) + SFX_FLAG;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EA60.s")
+ this->isLeftFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->leftFootPos, -6.0f);
+ if ((this->isLeftFootGrounded) && (!leftWasGrounded) && (isFootGrounded)) {
+ Actor_PlaySfxAtPos(&this->actor, sfxId);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EBD8.s")
+ this->isRightFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->rightFootPos, -6.0f);
+ if ((this->isRightFootGrounded) && (!rightWasGrounded) && (isFootGrounded)) {
+ Actor_PlaySfxAtPos(&this->actor, sfxId);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EC50.s")
+ return 0;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099ED4C.s")
+void EnZo_Blink(EnZo* this, s32 maxEyeIndex) {
+ if (DECR(this->blinkTimer) == 0) {
+ this->eyeIndex++;
+ if (this->eyeIndex >= maxEyeIndex) {
+ this->eyeIndex = 0;
+ this->blinkTimer = Rand_S16Offset(30, 30);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EE24.s")
+void EnZo_UpdateCollider(EnZo* this, GlobalContext* globalCtx) {
+ this->collider.dim.pos.x = this->actor.world.pos.x;
+ this->collider.dim.pos.y = this->actor.world.pos.y;
+ this->collider.dim.pos.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Init.s")
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Destroy.s")
+void EnZo_LookAtPlayer(EnZo* this, GlobalContext* globalCtx) {
+ static u16 D_8099F5AC[] = { 4000, 4, 1, 3, 6000, 4, 1, 6, 4000, 4, 1, 3, 6000, 4, 1, 6 };
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f focus;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Update.s")
+ SkelAnime_Update(&this->skelAnime);
+ if (SubS_AngleDiffLessEqual(this->actor.shape.rot.y, 0x2710, this->actor.yawTowardsPlayer)) {
+ focus.x = player->actor.world.pos.x;
+ focus.y = player->bodyPartsPos[7].y + 3.0f;
+ focus.z = player->actor.world.pos.z;
+ func_8013D2E0(&focus, &this->actor.focus.pos, &this->actor.shape.rot, &this->headRotTarget, &this->headRot,
+ &this->upperBodyRot, D_8099F5AC);
+ } else {
+ Math_SmoothStepToS(&this->headRotTarget.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->headRotTarget.y, 0, 4, 1000, 1);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099EFF4.s")
+ Math_SmoothStepToS(&this->headRot.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->headRot.y, 0, 4, 1000, 1);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/func_8099F15C.s")
+ Math_SmoothStepToS(&this->upperBodyRot.x, 0, 4, 1000, 1);
+ Math_SmoothStepToS(&this->upperBodyRot.y, 0, 4, 1000, 1);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zo/EnZo_Draw.s")
+ EnZo_Blink(this, 3);
+ SubS_FillLimbRotTables(globalCtx, this->limbRotY, this->limbRotZ, 20);
+}
+
+void EnZo_Walk(EnZo* this, GlobalContext* globalCtx) {
+ if (ENZO_GET_PATH(&this->actor) != ENZO_NO_PATH) {
+ EnZo_SetAnimation(&this->skelAnime, 6);
+ }
+
+ if (ENZO_GET_PATH(&this->actor) != ENZO_NO_PATH) {
+ this->actionFunc = EnZo_FollowPath;
+ } else {
+ this->actionFunc = EnZo_DoNothing;
+ }
+}
+
+void EnZo_FollowPath(EnZo* this, GlobalContext* globalCtx) {
+ s16 speed;
+ Vec3f pos;
+
+ Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f);
+ speed = this->actor.speedXZ * 400.0f;
+ if (func_8013D68C(this->path, this->waypoint, &pos) && func_8013D768(&this->actor, &pos, speed)) {
+ this->waypoint++;
+ if (this->waypoint >= this->path->count) {
+ this->waypoint = 0;
+ }
+ }
+
+ if (this->actor.depthInWater > 60.0f) {
+ EnZo_SetAnimation(&this->skelAnime, 1);
+ this->actionFunc = EnZo_TreadWater;
+ this->actor.gravity = 0.0f;
+ this->actor.speedXZ = 0.0f;
+ }
+}
+
+void EnZo_TreadWater(EnZo* this, GlobalContext* globalCtx) {
+ f32 targetYVel;
+
+ if (this->actor.depthInWater < (sREG(0) + 50.0f)) {
+ targetYVel = -1.0f;
+ } else {
+ targetYVel = 1.0f;
+ }
+ Math_ApproachF(&this->actor.velocity.y, targetYVel, (sREG(1) + 18.0f) * 0.01f, (sREG(2) + 12.0f) * 0.01f);
+}
+
+void EnZo_DoNothing(EnZo* this, GlobalContext* globalCtx) {
+}
+
+void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnZo* this = THIS;
+ s32 pad;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, 20);
+ EnZo_SetAnimation(&this->skelAnime, 0);
+
+ Collider_InitCylinder(globalCtx, &this->collider);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
+
+ this->path = func_8013D648(globalCtx, ENZO_GET_PATH(&this->actor), ENZO_NO_PATH);
+ Actor_SetScale(&this->actor, 0.01f);
+
+ this->actionFunc = EnZo_Walk;
+ this->actor.gravity = -4.0f;
+}
+
+void EnZo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnZo* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void EnZo_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnZo* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+ EnZo_LookAtPlayer(this, globalCtx);
+ EnZo_PlayWalkingSound(this, globalCtx);
+ EnZo_UpdateCollider(this, globalCtx);
+}
+
+s32 EnZo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx,
+ Gfx** gfx) {
+ EnZo* this = THIS;
+
+ if (limbIndex == 15) {
+ Matrix_InsertTranslation(1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->headRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->headRot.x, MTXMODE_APPLY);
+ Matrix_InsertTranslation(-1500.0f, 0.0f, 0.0f, MTXMODE_APPLY);
+ }
+
+ if (limbIndex == 8) {
+ Matrix_InsertXRotation_s(-this->upperBodyRot.y, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->upperBodyRot.x, MTXMODE_APPLY);
+ }
+
+ if ((limbIndex == 8) || (limbIndex == 9) || (limbIndex == 12)) {
+ rot->y += (s16)(Math_SinS(this->limbRotY[limbIndex]) * 200.0f);
+ rot->z += (s16)(Math_CosS(this->limbRotZ[limbIndex]) * 200.0f);
+ }
+ return false;
+}
+
+void EnZo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ EnZo* this = THIS;
+ Vec3f sp30 = { 400.0f, 0.0f, 0.0f };
+ Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
+
+ if (D_8099F578[limbIndex] >= 0) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->unk_364[D_8099F578[limbIndex]]);
+ }
+ if (limbIndex == 15) {
+ Matrix_MultiplyVector3fByState(&sp30, &this->actor.focus.pos);
+ }
+ if (limbIndex == 4) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->leftFootPos);
+ }
+ if (limbIndex == 7) {
+ Matrix_MultiplyVector3fByState(&zeroVec, &this->rightFootPos);
+ }
+}
+
+static Gfx sTransparencyDlist[] = {
+ gsDPSetRenderMode(AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ G_RM_FOG_SHADE_A,
+ AA_EN | Z_CMP | Z_UPD | IM_RD | CLR_ON_CVG | CVG_DST_WRAP | ZMODE_XLU | FORCE_BL |
+ GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
+ gsDPSetAlphaCompare(G_AC_THRESHOLD),
+ gsSPEndDisplayList(),
+};
+
+void EnZo_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnZo* this = THIS;
+ s32 i;
+ u8* shadowTex = GRAPH_ALLOC(globalCtx->state.gfxCtx, sizeof(u8) * SQ(64));
+ u8* shadowTexIter;
+ TexturePtr eyeTextures[] = { &gZoraEyeOpenTex, &gZoraEyeHalfTex, &gZoraEyeClosedTex };
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
+ gDPPipeSync(POLY_OPA_DISP++);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(eyeTextures[this->eyeIndex]));
+ gSPSegment(POLY_OPA_DISP++, 0x0C, &sTransparencyDlist[2]);
+
+ POLY_OPA_DISP =
+ SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnZo_OverrideLimbDraw, EnZo_PostLimbDraw, &this->actor, POLY_OPA_DISP);
+ Matrix_InsertXRotation_s(0, 0);
+
+ for (i = 0, shadowTexIter = shadowTex; i < (s32)sizeof(u8) * SQ(64); i++) {
+ *shadowTexIter = 0;
+ shadowTexIter++;
+ }
+ for (i = 0; i < 5; i++) {
+ func_8013CD64(this->unk_364, &this->actor.world.pos, shadowTex, i / 5.0f, 15, D_8099F59C, D_8099F58C);
+ }
+
+ func_8013CF04(&this->actor, &globalCtx->state.gfxCtx, shadowTex);
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
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 a823a1ec07..0b9f8dab16 100644
--- a/src/overlays/actors/ovl_En_Zo/z_en_zo.h
+++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.h
@@ -7,12 +7,33 @@ struct EnZo;
typedef void (*EnZoActionFunc)(struct EnZo*, GlobalContext*);
+#define ENZO_GET_PATH(thisx) (((thisx)->params & 0x7E00) >> 9)
+#define ENZO_NO_PATH 0x3F
+
typedef struct EnZo {
/* 0x0000 */ Actor actor;
/* 0x0144 */ EnZoActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x2DC];
+ /* 0x0148 */ SkelAnime skelAnime;
+ /* 0x0194 */ ColliderCylinder collider;
+ /* 0x01D8 */ UNK_TYPE1 unk_1D8[0x4];
+ /* 0x01DC */ Path* path;
+ /* 0x01E0 */ s16 waypoint;
+ /* 0x01E4 */ Vec3f leftFootPos;
+ /* 0x01F0 */ Vec3f rightFootPos;
+ /* 0x01FC */ u8 isLeftFootGrounded;
+ /* 0x01FD */ u8 isRightFootGrounded;
+ /* 0x01FE */ Vec3s jointTable[20];
+ /* 0x0276 */ Vec3s morphTable[20];
+ /* 0x02EE */ Vec3s headRotTarget;
+ /* 0x02F4 */ Vec3s headRot;
+ /* 0x02FA */ Vec3s upperBodyRot;
+ /* 0x0300 */ UNK_TYPE1 unk_300[0x12];
+ /* 0x0312 */ s16 limbRotY[20];
+ /* 0x033A */ s16 limbRotZ[20];
+ /* 0x0364 */ Vec3f unk_364[15];
+ /* 0x041A */ UNK_TYPE1 unk_41A[0x6];
+ /* 0x041E */ s16 eyeIndex;
+ /* 0x0420 */ s16 blinkTimer;
} EnZo; // size = 0x424
-extern const ActorInit En_Zo_InitVars;
-
#endif // Z_EN_ZO_H
diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.c b/src/overlays/actors/ovl_En_Zob/z_en_zob.c
index 51fcf53bc3..a3f5038743 100644
--- a/src/overlays/actors/ovl_En_Zob/z_en_zob.c
+++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.c
@@ -5,8 +5,9 @@
*/
#include "z_en_zob.h"
+#include "objects/object_zob/object_zob.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnZob*)thisx)
@@ -15,10 +16,13 @@ void EnZob_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnZob_Update(Actor* thisx, GlobalContext* globalCtx);
void EnZob_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80B9F7E4(EnZob* this, s16 arg1, u8 arg2);
void func_80B9FD24(EnZob* this, GlobalContext* globalCtx);
void func_80B9FDDC(EnZob* this, GlobalContext* globalCtx);
void func_80B9FE1C(EnZob* this, GlobalContext* globalCtx);
+void func_80B9FE5C(EnZob* this, GlobalContext* globalCtx);
void func_80B9FF20(EnZob* this, GlobalContext* globalCtx);
+void func_80B9FF80(EnZob* this, GlobalContext* globalCtx);
void func_80BA005C(EnZob* this, GlobalContext* globalCtx);
void func_80BA00BC(EnZob* this, GlobalContext* globalCtx);
void func_80BA0318(EnZob* this, GlobalContext* globalCtx);
@@ -33,7 +37,6 @@ void func_80BA0BB4(EnZob* this, GlobalContext* globalCtx);
void func_80BA0C14(EnZob* this, GlobalContext* globalCtx);
void func_80BA0CF4(EnZob* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Zob_InitVars = {
ACTOR_EN_ZOB,
ACTORCAT_NPC,
@@ -46,79 +49,727 @@ const ActorInit En_Zob_InitVars = {
(ActorFunc)EnZob_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BA10D0 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 30, 40, 0, { 0, 0, 0 } },
};
-#endif
+static AnimationHeader* sAnimations[] = {
+ &object_zob_Anim_0027D0, &object_zob_Anim_002B38, &object_zob_Anim_0037A0,
+ &object_zob_Anim_0043C4, &object_zob_Anim_005224, &object_zob_Anim_005E90,
+ &object_zob_Anim_006998, &object_zob_Anim_011144, &object_zob_Anim_001FD4,
+};
-extern ColliderCylinderInit D_80BA10D0;
+Vec3f D_80BA1120 = { 300.0f, 900.0f, 0.0f };
-extern UNK_TYPE D_06006998;
+void EnZob_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnZob* this = THIS;
+ s32 i;
+ s16 cs;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/EnZob_Init.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ Actor_SetScale(&this->actor, 0.0115f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zob_Skel_010810, &object_zob_Anim_006998, this->jointTable,
+ this->morphTable, 24);
+ Animation_PlayLoop(&this->skelAnime, &object_zob_Anim_006998);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->unk_2F4 = 0;
+ this->unk_30E = -1;
+ this->unk_310 = 0;
+ this->unk_302 = 9;
+ this->unk_304 = 0;
+ this->actor.terminalVelocity = -4.0f;
+ this->actor.gravity = -4.0f;
+ func_80B9F7E4(this, 6, 2);
+ this->actionFunc = func_80BA0728;
+ this->actor.textId = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/EnZob_Destroy.s")
+ cs = this->actor.cutscene;
+ for (i = 0; i < ARRAY_COUNT(this->unk_306); i++) {
+ this->unk_306[i] = cs;
+ if (cs != -1) {
+ this->actor.cutscene = cs;
+ cs = ActorCutscene_GetAdditionalCutscene(this->actor.cutscene);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9F7E4.s")
+ this->actor.cutscene = this->unk_306[0];
+ this->actor.flags |= ACTOR_FLAG_2000000;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9F86C.s")
+ switch (ENZOB_GET_F(&this->actor)) {
+ case ENZOB_F_1:
+ if (gSaveContext.weekEventReg[78] & 1) {
+ this->actionFunc = func_80BA0BB4;
+ } else {
+ this->actionFunc = func_80BA0AD8;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FA3C.s")
+ if (!(gSaveContext.weekEventReg[55] & 0x80)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FC0C.s")
+ case ENZOB_F_2:
+ this->actionFunc = func_80BA0CF4;
+ this->unk_2F4 |= 0x20;
+ this->unk_312 = -1;
+ func_80B9F7E4(this, 0, 2);
+ this->unk_304 = 5;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FC70.s")
+ default:
+ if (gSaveContext.weekEventReg[55] & 0x80) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ this->actor.flags |= ACTOR_FLAG_10;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FCA0.s")
+void EnZob_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnZob* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FD24.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FDDC.s")
+void func_80B9F7E4(EnZob* this, s16 arg1, u8 arg2) {
+ Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[arg1]), arg2,
+ -5.0f);
+ this->unk_302 = arg1;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FE1C.s")
+void func_80B9F86C(EnZob* this) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ switch (this->unk_304) {
+ case 0:
+ if (Rand_ZeroFloat(1.0f) > 0.7f) {
+ if (this->unk_302 == 6) {
+ func_80B9F7E4(this, 7, 2);
+ } else {
+ func_80B9F7E4(this, 6, 2);
+ }
+ } else {
+ func_80B9F7E4(this, this->unk_302, 2);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FE5C.s")
+ case 1:
+ func_80B9F7E4(this, 3, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FF20.s")
+ case 2:
+ func_80B9F7E4(this, 4, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80B9FF80.s")
+ case 3:
+ func_80B9F7E4(this, 5, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA005C.s")
+ case 4:
+ if (this->unk_302 == 3) {
+ func_80B9F7E4(this, 0, 0);
+ } else {
+ func_80B9F7E4(this, 3, 2);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA00BC.s")
+ case 5:
+ if (Rand_ZeroFloat(1.0f) < 0.8f) {
+ func_80B9F7E4(this, this->unk_302, 2);
+ } else if (this->unk_302 == 0) {
+ func_80B9F7E4(this, 1, 2);
+ } else {
+ func_80B9F7E4(this, 0, 2);
+ }
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0318.s")
+ SkelAnime_Update(&this->skelAnime);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0374.s")
+void func_80B9FA3C(EnZob* this, GlobalContext* globalCtx) {
+ u16 textId;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0610.s")
+ this->unk_2F4 |= 1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA06BC.s")
+ if (gSaveContext.playerForm != PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[30] & 2) {
+ textId = 0x11F9;
+ } else {
+ textId = 0x11F8;
+ }
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 0);
+ } else if (this->unk_2F4 & 0x10) {
+ textId = 0x1210;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ } else if (gSaveContext.weekEventReg[31] & 8) {
+ textId = 0x1205;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 3, 0);
+ } else if (this->unk_2F4 & 8) {
+ textId = 0x1215;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ } else if (this->unk_2F4 & 2) {
+ textId = 0x1203;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ } else if (gSaveContext.weekEventReg[30] & 8) {
+ textId = 0x11FA;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ } else if (!(gSaveContext.weekEventReg[30] & 4)) {
+ gSaveContext.weekEventReg[30] |= 4;
+ textId = 0x11FB;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ } else {
+ textId = 0x1201;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 4, 2);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0728.s")
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA08E8.s")
+void func_80B9FC0C(EnZob* this) {
+ if (this->unk_30E != -1) {
+ if (ActorCutscene_GetCurrentIndex() == this->unk_306[this->unk_30E]) {
+ ActorCutscene_Stop(this->unk_306[this->unk_30E]);
+ }
+ this->unk_30E = -1;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA09E0.s")
+void func_80B9FC70(EnZob* this, s16 arg1) {
+ func_80B9FC0C(this);
+ this->unk_30E = arg1;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0A04.s")
+void func_80B9FCA0(EnZob* this, GlobalContext* globalCtx) {
+ func_801477B4(globalCtx);
+ globalCtx->msgCtx.ocarinaMode = 4;
+ func_80B9FC0C(this);
+ this->unk_2F4 &= ~1;
+ this->actionFunc = func_80BA0728;
+ this->unk_304 = 0;
+ func_80B9F7E4(this, 6, 2);
+ func_800B8718(&this->actor, &globalCtx->state);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0AD8.s")
+void func_80B9FD24(EnZob* this, GlobalContext* globalCtx) {
+ s32 actionIndex;
+ s16 action;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0BB4.s")
+ func_80B9F86C(this);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0C14.s")
+ if (Cutscene_CheckActorAction(globalCtx, 500)) {
+ this->unk_30E = -1;
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 500);
+ action = globalCtx->csCtx.actorActions[actionIndex]->action;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0CF4.s")
+ if (action != this->unk_310) {
+ this->unk_310 = action;
+ switch (action) {
+ case 1:
+ func_80B9F7E4(this, 8, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/EnZob_Update.s")
+ case 2:
+ func_80B9F7E4(this, 7, 0);
+ break;
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0F64.s")
+void func_80B9FDDC(EnZob* this, GlobalContext* globalCtx) {
+ Message_StartTextbox(globalCtx, 0x120C, &this->actor);
+ this->actionFunc = func_80BA00BC;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/func_80BA0FAC.s")
+void func_80B9FE1C(EnZob* this, GlobalContext* globalCtx) {
+ Message_StartTextbox(globalCtx, 0x1211, &this->actor);
+ this->actionFunc = func_80BA00BC;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zob/EnZob_Draw.s")
+void func_80B9FE5C(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (globalCtx->msgCtx.ocarinaMode == 3) {
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->actionFunc = func_80B9FDDC;
+ func_80B9FC70(this, 0);
+ } else if (Message_GetState(&globalCtx->msgCtx) == 11) {
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->actionFunc = func_80B9FE1C;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ func_80B9FC70(this, 0);
+ }
+}
+
+void func_80B9FF20(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (Message_GetState(&globalCtx->msgCtx) == 7) {
+ func_80152434(globalCtx, 0x42);
+ this->actionFunc = func_80B9FE5C;
+ func_80B9FC70(this, 2);
+ }
+}
+
+void func_80B9FF80(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (globalCtx->msgCtx.ocarinaMode == 3) {
+ this->actionFunc = func_80B9FF20;
+ this->unk_304 = 6;
+ func_80B9F7E4(this, 1, 0);
+ func_80152434(globalCtx, 0x3E);
+ func_80B9FC70(this, 1);
+ } else if (Message_GetState(&globalCtx->msgCtx) == 11) {
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->actionFunc = func_80B9FE1C;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ func_80B9FC70(this, 0);
+ }
+}
+
+void func_80BA005C(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (Message_GetState(&globalCtx->msgCtx) == 7) {
+ func_80152434(globalCtx, 0x41);
+ this->actionFunc = func_80B9FF80;
+ func_80B9FC70(this, 2);
+ }
+}
+
+void func_80BA00BC(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 4:
+ if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk11F04 == 0x1212)) {
+ switch (globalCtx->msgCtx.choiceIndex) {
+ case 1:
+ func_8019F208();
+ func_80151938(globalCtx, 0x1209);
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ break;
+
+ case 0:
+ func_8019F230();
+ func_80151938(globalCtx, 0x1213);
+ break;
+ }
+ }
+ break;
+
+ case 5:
+ if (func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x1208:
+ case 0x120E:
+ case 0x1216:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x120C:
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->actionFunc = func_80B9FD24;
+ func_80B9F7E4(this, 8, 0);
+ func_80B9FC70(this, 3);
+ break;
+
+ case 0x120D:
+ case 0x1211:
+ case 0x1213:
+ case 0x1217:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 4, 2);
+ break;
+
+ case 0x1218:
+ func_80B9FCA0(this, globalCtx);
+ break;
+
+ case 0x1214:
+ this->unk_2F4 |= 8;
+ func_80B9FCA0(this, globalCtx);
+ break;
+
+ case 0x120F:
+ gSaveContext.weekEventReg[31] |= 8;
+ this->unk_2F4 |= 0x10;
+ func_80B9FCA0(this, globalCtx);
+ break;
+
+ case 0x1209:
+ func_80152434(globalCtx, 0x3D);
+ this->unk_304 = 4;
+ func_80B9F7E4(this, 0, 0);
+ this->actionFunc = func_80BA005C;
+ func_80B9FC70(this, 1);
+ break;
+ }
+ }
+ break;
+ }
+}
+
+void func_80BA0318(EnZob* this, GlobalContext* globalCtx) {
+ func_80152434(globalCtx, 0x3D);
+ this->unk_304 = 4;
+ func_80B9F7E4(this, 0, 0);
+ this->actionFunc = func_80BA005C;
+ func_80B9FC70(this, 1);
+}
+
+void func_80BA0374(EnZob* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ func_80B9F86C(this);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 4:
+ if (func_80147624(globalCtx) && (globalCtx->msgCtx.unk11F04 == 0x1205)) {
+ switch (globalCtx->msgCtx.choiceIndex) {
+ case 0:
+ func_8019F208();
+ func_80151938(globalCtx, 0x1207);
+ func_80B9F7E4(this, 2, 2);
+ break;
+
+ case 1:
+ func_8019F230();
+ func_80151938(globalCtx, 0x1206);
+ break;
+ }
+ }
+ break;
+
+ case 5:
+ if (func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x11F8:
+ gSaveContext.weekEventReg[30] |= 2;
+ func_80151938(globalCtx, 0x11F9);
+ break;
+
+ case 0x11F9:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BA0728;
+ this->unk_304 = 0;
+ func_80B9F7E4(this, 6, 2);
+ this->unk_2F4 &= ~1;
+ break;
+
+ case 0x11FB:
+ case 0x11FC:
+ case 0x11FF:
+ case 0x1201:
+ case 0x1203:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x11FD:
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 4, 2);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x11FE:
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 3, 0);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x11FA:
+ case 0x1200:
+ case 0x1202:
+ case 0x1204:
+ case 0x1206:
+ case 0x120F:
+ case 0x1210:
+ case 0x1215:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BA0728;
+ this->unk_304 = 0;
+ func_80B9F7E4(this, 6, 2);
+ this->unk_2F4 &= ~1;
+ this->unk_2F4 |= 2;
+ break;
+
+ case 0x1207:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BA0318;
+ player->unk_A90 = &this->actor;
+ player->stateFlags3 |= 0x20;
+ break;
+ }
+ }
+ break;
+ }
+}
+
+void func_80BA0610(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ Message_StartTextbox(globalCtx, 0x120D, &this->actor);
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ func_80B9FC70(this, 0);
+ this->actionFunc = func_80BA00BC;
+ } else {
+ func_800B8614(&this->actor, globalCtx, 500.0f);
+ }
+}
+
+void func_80BA06BC(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9FD24(this, globalCtx);
+ if (!Cutscene_CheckActorAction(globalCtx, 500)) {
+ this->actionFunc = func_80BA0610;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_80BA0610(this, globalCtx);
+ }
+}
+
+void func_80BA0728(EnZob* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp28;
+
+ func_80B9F86C(this);
+
+ if (func_800B8718(&this->actor, &globalCtx->state)) {
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ Message_StartTextbox(globalCtx, 0x1208, NULL);
+ gSaveContext.weekEventReg[30] |= 8;
+ } else {
+ Message_StartTextbox(globalCtx, 0x1216, NULL);
+ }
+ this->actionFunc = func_80BA00BC;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ this->unk_30E = 0;
+ this->unk_2F4 |= 1;
+ } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BA0374;
+ func_80B9FA3C(this, globalCtx);
+ } else if (Cutscene_CheckActorAction(globalCtx, 500)) {
+ this->actionFunc = func_80BA06BC;
+ } else if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.xzDistToPlayer > 60.0f) &&
+ Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x3000)) {
+ func_800B8614(&this->actor, globalCtx, 150.0f);
+ func_800B874C(&this->actor, globalCtx, 200.0f, 150.0f);
+ }
+
+ sp28.x = this->actor.projectedPos.x;
+ sp28.y = this->actor.projectedPos.y;
+ sp28.z = this->actor.projectedPos.z;
+ func_801A1FB4(3, &sp28, 0x6C, 1000.0f);
+}
+
+void func_80BA08E8(EnZob* this, GlobalContext* globalCtx) {
+ s32 textId;
+
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[79] & 1) {
+ textId = 0x1257;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 4, 2);
+ } else if (gSaveContext.weekEventReg[78] & 0x40) {
+ textId = 0x1256;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ } else {
+ textId = 0x1255;
+ gSaveContext.weekEventReg[78] |= 0x40;
+ this->unk_304 = 1;
+ func_80B9F7E4(this, 2, 2);
+ }
+ } else {
+ textId = 0x1254;
+ this->unk_304 = 3;
+ func_80B9F7E4(this, 5, 2);
+ }
+
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+}
+
+void func_80BA09E0(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+}
+
+void func_80BA0A04(EnZob* this, GlobalContext* globalCtx) {
+ u8 temp_v0;
+
+ func_80B9F86C(this);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+
+ temp_v0 = Message_GetState(&globalCtx->msgCtx);
+ if (temp_v0 != 2) {
+ if ((temp_v0 == 5) && func_80147624(globalCtx)) {
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BA0AD8;
+ this->unk_304 = 0;
+ func_80B9F7E4(this, 6, 2);
+ }
+ } else {
+ this->actionFunc = func_80BA0AD8;
+ this->unk_304 = 0;
+ func_80B9F7E4(this, 6, 2);
+ }
+}
+
+void func_80BA0AD8(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+
+ if (this->actor.home.rot.y != this->actor.shape.rot.y) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ }
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BA0A04;
+ func_80BA08E8(this, globalCtx);
+ } else if ((this->actor.xzDistToPlayer < 120.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) &&
+ Actor_IsFacingPlayer(&this->actor, 0x3000)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+}
+
+void func_80BA0BB4(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (gSaveContext.weekEventReg[79] & 1) {
+ this->actionFunc = func_80BA09E0;
+ func_80B9F7E4(this, 0, 2);
+ this->unk_304 = 5;
+ }
+}
+
+void func_80BA0C14(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+
+ if (this->unk_312 < 799) {
+ this->unk_312 += 200;
+ } else {
+ this->unk_312 += 30;
+ }
+
+ if (this->unk_312 > 999) {
+ this->unk_312 = 999;
+ }
+
+ if (Cutscene_CheckActorAction(globalCtx, 515)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 515)]->action == 1) {
+ this->actionFunc = func_80BA0CF4;
+ this->unk_312 = -1;
+ }
+ } else {
+ this->actionFunc = func_80BA0CF4;
+ this->unk_312 = -1;
+ }
+}
+
+void func_80BA0CF4(EnZob* this, GlobalContext* globalCtx) {
+ func_80B9F86C(this);
+ if (Cutscene_CheckActorAction(globalCtx, 515) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 515)]->action == 2)) {
+ this->actionFunc = func_80BA0C14;
+ }
+}
+
+void EnZob_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZob* this = THIS;
+
+ Actor_MoveWithGravity(&this->actor);
+
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4);
+
+ this->actionFunc(this, globalCtx);
+
+ if ((this->unk_30E != -1) && (ActorCutscene_GetCurrentIndex() != this->unk_306[this->unk_30E])) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_306[this->unk_30E]);
+ } else if (ActorCutscene_GetCanPlayNext(this->unk_306[this->unk_30E])) {
+ ActorCutscene_Start(this->unk_306[this->unk_30E], &this->actor);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_306[this->unk_30E]);
+ }
+ }
+
+ if (this->unk_2F4 & 1) {
+ func_800E9250(globalCtx, &this->actor, &this->unk_2F6, &this->unk_2FC, this->actor.focus.pos);
+ } else {
+ Math_SmoothStepToS(&this->unk_2F6.x, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->unk_2F6.y, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->unk_2FC.x, 0, 6, 6200, 100);
+ Math_SmoothStepToS(&this->unk_2FC.y, 0, 6, 6200, 100);
+ }
+}
+
+s32 func_80BA0F64(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnZob* this = THIS;
+
+ if (limbIndex == 9) {
+ rot->x += this->unk_2F6.y;
+ rot->y += this->unk_2F6.x;
+ }
+ return false;
+}
+
+void func_80BA0FAC(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnZob* this = THIS;
+
+ if (limbIndex == 9) {
+ Matrix_MultiplyVector3fByState(&D_80BA1120, &this->actor.focus.pos);
+ }
+}
+
+void EnZob_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnZob* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ if (this->unk_2F4 & 0x20) {
+ POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 0, 0, this->unk_312, 1000);
+ }
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ func_80BA0F64, func_80BA0FAC, &this->actor);
+
+ if (this->unk_2F4 & 0x20) {
+ POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Zob/z_en_zob.h b/src/overlays/actors/ovl_En_Zob/z_en_zob.h
index 2338423032..18834f17ed 100644
--- a/src/overlays/actors/ovl_En_Zob/z_en_zob.h
+++ b/src/overlays/actors/ovl_En_Zob/z_en_zob.h
@@ -7,9 +7,28 @@ struct EnZob;
typedef void (*EnZobActionFunc)(struct EnZob*, GlobalContext*);
+#define ENZOB_GET_F(thisx) ((thisx)->params & 0xF)
+
+enum {
+ /* 1 */ ENZOB_F_1 = 1,
+ /* 2 */ ENZOB_F_2,
+};
+
typedef struct EnZob {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x1D0];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[24];
+ /* 0x0218 */ Vec3s morphTable[24];
+ /* 0x02A8 */ ColliderCylinder collider;
+ /* 0x02F4 */ u16 unk_2F4;
+ /* 0x02F6 */ Vec3s unk_2F6;
+ /* 0x02FC */ Vec3s unk_2FC;
+ /* 0x0302 */ s16 unk_302;
+ /* 0x0304 */ u16 unk_304;
+ /* 0x0306 */ s16 unk_306[4];
+ /* 0x030E */ s16 unk_30E;
+ /* 0x0310 */ s16 unk_310;
+ /* 0x0312 */ s16 unk_312;
/* 0x0314 */ EnZobActionFunc actionFunc;
} EnZob; // size = 0x318
diff --git a/src/overlays/actors/ovl_En_Zod/z_en_zod.c b/src/overlays/actors/ovl_En_Zod/z_en_zod.c
index f8a38bd52f..f908ceafac 100644
--- a/src/overlays/actors/ovl_En_Zod/z_en_zod.c
+++ b/src/overlays/actors/ovl_En_Zod/z_en_zod.c
@@ -6,7 +6,7 @@
#include "z_en_zod.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnZod*)thisx)
diff --git a/src/overlays/actors/ovl_En_Zog/z_en_zog.c b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
index 3306fc7866..5e12cba0d2 100644
--- a/src/overlays/actors/ovl_En_Zog/z_en_zog.c
+++ b/src/overlays/actors/ovl_En_Zog/z_en_zog.c
@@ -7,7 +7,7 @@
#include "z_en_zog.h"
#include "objects/object_zog/object_zog.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnZog*)thisx)
@@ -65,9 +65,9 @@ static ColliderCylinderInit sCylinderInit = {
{ 30, 40, 0, { 0, 0, 0 } },
};
-static TexturePtr D_80B958AC[] = { &object_zog_Tex_024750, &object_zog_Tex_024F50, &object_zog_Tex_025750 };
+static TexturePtr D_80B958AC[] = { object_zog_Tex_024750, object_zog_Tex_024F50, object_zog_Tex_025750 };
-static TexturePtr D_80B958B8[] = { &object_zog_Tex_025F50, &object_zog_Tex_026750 };
+static TexturePtr D_80B958B8[] = { object_zog_Tex_025F50, object_zog_Tex_026750 };
static AnimationHeader* D_80B958C0[] = {
&object_zog_Anim_00FC0C, &object_zog_Anim_0106B0, &object_zog_Anim_0166F4, &object_zog_Anim_017170,
@@ -206,7 +206,7 @@ void EnZog_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (INV_CONTENT(ITEM_MASK_ZORA) == ITEM_MASK_ZORA) &&
- ((globalCtx->csCtx.unk_12 != 2) || (gSaveContext.sceneSetupIndex != 0) ||
+ ((globalCtx->csCtx.currentCsIndex != 2) || (gSaveContext.sceneSetupIndex != 0) ||
(globalCtx->sceneNum != SCENE_30GYOSON))) {
Actor_MarkForDeath(&this->actor);
return;
@@ -256,7 +256,7 @@ void EnZog_Init(Actor* thisx, GlobalContext* globalCtx) {
}
}
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
this->actor.home.rot.z = 0;
if (ENZOG_GET_F(&this->actor) != ENZOG_F_2) {
for (i = 0; i < 5; i++) {
@@ -268,8 +268,8 @@ void EnZog_Init(Actor* thisx, GlobalContext* globalCtx) {
if ((ENZOG_GET_F(&this->actor) != ENZOG_F_2) && (gSaveContext.weekEventReg[88] & 0x10)) {
this->unk_302 = this->unk_300 = 0;
this->unk_2FC = this->unk_2FE = 3;
- this->actor.flags |= 0x2000000;
- this->actor.flags &= ~0x10000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->unk_31C = 2;
this->unk_31E = 0;
@@ -459,9 +459,9 @@ s32 func_80B93EA0(EnZog* this, GlobalContext* globalCtx) {
SkelAnime_Update(&this->skelAnime);
}
- if (func_800EE29C(globalCtx, 0x1D7)) {
- sp3E = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x1D7)]->unk0;
- func_800EDF24(&this->actor, globalCtx, func_800EE200(globalCtx, 0x1D7));
+ if (Cutscene_CheckActorAction(globalCtx, 471)) {
+ sp3E = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 471)]->action;
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 471));
switch (this->unk_306) {
case 2:
@@ -628,7 +628,7 @@ void func_80B9451C(EnZog* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_300 = 2;
this->actionFunc = func_80B94470;
- } else if ((globalCtx->msgCtx.unk1202A == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
+ } else if ((globalCtx->msgCtx.ocarinaMode == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
if ((globalCtx->msgCtx.unk1202E == 7) && (gSaveContext.playerForm == PLAYER_FORM_HUMAN)) {
func_80B93BA8(this, 2);
this->actionFunc = func_80B943C0;
@@ -644,7 +644,7 @@ void func_80B9461C(EnZog* this, GlobalContext* globalCtx) {
if (!func_80B93EA0(this, globalCtx)) {
this->actor.textId = 0x103C;
this->actionFunc = func_80B9451C;
- this->actor.flags |= 0x2000000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
gSaveContext.weekEventReg[91] |= 2;
}
@@ -716,7 +716,7 @@ void func_80B948A8(EnZog* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->unk_300 = 2;
this->actionFunc = func_80B946FC;
- } else if ((globalCtx->msgCtx.unk1202A == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
+ } else if ((globalCtx->msgCtx.ocarinaMode == 3) && (this->actor.xzDistToPlayer < 120.0f)) {
if ((globalCtx->msgCtx.unk1202E == 7) && (gSaveContext.playerForm == PLAYER_FORM_HUMAN)) {
func_80B93BA8(this, 2);
this->actionFunc = func_80B943C0;
@@ -746,7 +746,7 @@ void func_80B94A00(EnZog* this, GlobalContext* globalCtx) {
if (func_80B93BE0(this, globalCtx)) {
this->actionFunc = func_80B948A8;
- this->actor.flags |= 0x2000000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
if (gSaveContext.weekEventReg[29] & 0x20) {
this->actor.textId = 0x1009;
} else {
@@ -882,7 +882,7 @@ void func_80B94E34(EnZog* this, GlobalContext* globalCtx) {
}
if (ABS_ALT(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0x5000) {
- Actor_PickUp(&this->actor, globalCtx, 0, 60.0f, 40.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_NONE, 60.0f, 40.0f);
}
if (this->unk_324 > 0) {
@@ -937,7 +937,7 @@ void func_80B95128(EnZog* this, GlobalContext* globalCtx) {
break;
}
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
gSaveContext.weekEventReg[91] |= 1;
} else {
func_800B8614(&this->actor, globalCtx, 150.0f);
@@ -956,7 +956,7 @@ void EnZog_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_MoveWithGravity(&this->actor);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 5);
- if (func_800EE29C(globalCtx, 0x1D7) && (ENZOG_GET_F(&this->actor) != ENZOG_F_2)) {
+ if (Cutscene_CheckActorAction(globalCtx, 0x1D7) && (ENZOG_GET_F(&this->actor) != ENZOG_F_2)) {
this->actionFunc = func_80B9461C;
this->actor.shape.yOffset = 0.0f;
}
@@ -997,7 +997,7 @@ void EnZog_Update(Actor* thisx, GlobalContext* globalCtx) {
}
}
-void func_80B954C4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+void EnZog_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80B959B8 = { 0.0f, 0.0f, 0.0f };
EnZog* this = THIS;
@@ -1078,7 +1078,7 @@ void EnZog_Draw(Actor* thisx, GlobalContext* globalCtx) {
POLY_OPA_DISP = &gfx[3];
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
- this->skelAnime.dListCount, NULL, func_80B954C4, &this->actor);
+ this->skelAnime.dListCount, NULL, EnZog_PostLimbDraw, &this->actor);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
index d5dc7fda0e..7250daaa84 100644
--- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
+++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.c
@@ -5,8 +5,10 @@
*/
#include "z_en_zoraegg.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
+#include "objects/object_zoraegg/object_zoraegg.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((EnZoraegg*)thisx)
@@ -15,7 +17,27 @@ void EnZoraegg_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnZoraegg_Update(Actor* thisx, GlobalContext* globalCtx);
void EnZoraegg_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+s32 func_80B319A8(GlobalContext* globalCtx);
+void func_80B32084(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32094(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B320E0(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B321D0(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32228(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B322BC(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32390(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B324B0(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32644(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B326F4(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32820(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32928(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32A88(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32B10(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32B3C(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32B70(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32BB8(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32C34(EnZoraegg* this, GlobalContext* globalCtx);
+void func_80B32D08(EnZoraegg* this, GlobalContext* globalCtx);
+
const ActorInit En_Zoraegg_InitVars = {
ACTOR_EN_ZORAEGG,
ACTORCAT_ITEMACTION,
@@ -28,86 +50,843 @@ const ActorInit En_Zoraegg_InitVars = {
(ActorFunc)EnZoraegg_Draw,
};
-#endif
+void func_80B31590(EnZoraegg* this) {
+ this->actor.shape.yOffset = 0.0f;
-extern UNK_TYPE D_060005D4;
-extern UNK_TYPE D_06004D20;
-extern UNK_TYPE D_06004FE4;
-extern UNK_TYPE D_06005098;
-extern UNK_TYPE D_06005250;
+ if (this->actor.home.rot.x == 0) {
+ this->actor.scale.x = 0.4f;
+ } else {
+ this->actor.scale.x = this->actor.home.rot.x * 0.04f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31590.s")
+ if (this->actor.home.rot.z == 0) {
+ this->actor.scale.z = 0.4f;
+ } else {
+ this->actor.scale.z = this->actor.home.rot.z * 0.04f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/EnZoraegg_Init.s")
+ this->actor.shape.rot.z = 0;
+ this->actor.scale.y = 0.4f;
+ this->actor.draw = NULL;
+ this->actor.shape.rot.y = this->actor.shape.rot.z;
+ this->actor.shape.rot.x = this->actor.shape.rot.z;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/EnZoraegg_Destroy.s")
+void EnZoraegg_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZoraegg* this = THIS;
+ u16 sp40[] = { 457, 458, 459, 460, 461, 462, 464 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B319A8.s")
+ Actor_SetScale(&this->actor, 0.006f);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zoraegg_Skel_004C90, &object_zoraegg_Anim_005098,
+ this->jointTable, this->morphTable, 7);
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_005098);
+ ActorShape_Init(&this->actor.shape, 1100.0f, NULL, 0.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B319D0.s")
+ this->actionFunc = func_80B32084;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31A34.s")
+ this->unk_1ED = 255;
+ this->unk_1EC = 0;
+ this->unk_1EA = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31C40.s")
+ this->unk_1E0 = 1.0f;
+ this->unk_1E4 = 0.0f;
+ this->actor.velocity.y = -10.0f;
+ this->actor.terminalVelocity = -10.0f;
+ this->actor.gravity = -5.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31CB4.s")
+ switch (ENZORAEGG_GET_1F(&this->actor)) {
+ case ENZORAEGG_1F_0:
+ if (Flags_GetSwitch(globalCtx, ENZORAEGG_GET_FE00(&this->actor))) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31D14.s")
+ case ENZORAEGG_1F_17:
+ if (func_80B319A8(globalCtx) >= 7) {
+ Actor_MarkForDeath(&this->actor);
+ this->actor.home.rot.z = 1;
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31D64.s")
+ case ENZORAEGG_1F_3:
+ case ENZORAEGG_1F_4:
+ case ENZORAEGG_1F_5:
+ case ENZORAEGG_1F_6:
+ case ENZORAEGG_1F_7:
+ case ENZORAEGG_1F_8:
+ case ENZORAEGG_1F_9:
+ if (gSaveContext.weekEventReg[19] & 0x40) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B31E00.s")
+ case ENZORAEGG_1F_10:
+ case ENZORAEGG_1F_11:
+ case ENZORAEGG_1F_12:
+ case ENZORAEGG_1F_13:
+ case ENZORAEGG_1F_14:
+ case ENZORAEGG_1F_15:
+ case ENZORAEGG_1F_16:
+ if (!(gSaveContext.weekEventReg[19] & 0x40)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32084.s")
+ switch (ENZORAEGG_GET_1F(&this->actor)) {
+ case ENZORAEGG_1F_0:
+ this->actionFunc = func_80B320E0;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.targetMode = 3;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32094.s")
+ case ENZORAEGG_1F_1:
+ this->actionFunc = func_80B322BC;
+ func_80B31590(this);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B320E0.s")
+ case ENZORAEGG_1F_2:
+ this->actionFunc = func_80B32390;
+ func_80B31590(this);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B321D0.s")
+ case ENZORAEGG_1F_3:
+ case ENZORAEGG_1F_4:
+ case ENZORAEGG_1F_5:
+ case ENZORAEGG_1F_6:
+ case ENZORAEGG_1F_7:
+ case ENZORAEGG_1F_8:
+ case ENZORAEGG_1F_9:
+ this->actorActionCmd = sp40[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_3];
+ Animation_PlayOnce(&this->skelAnime, &object_zoraegg_Anim_001E08);
+ this->unk_1EC = 1;
+ this->unk_1EE = 0;
+ this->unk_1EF = 0;
+ this->actionFunc = func_80B32B10;
+ if (((ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_3) >= func_80B319A8(globalCtx)) {
+ this->actionFunc = func_80B32B3C;
+ this->actor.draw = NULL;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32228.s")
+ case ENZORAEGG_1F_10:
+ case ENZORAEGG_1F_11:
+ case ENZORAEGG_1F_12:
+ case ENZORAEGG_1F_13:
+ case ENZORAEGG_1F_14:
+ case ENZORAEGG_1F_15:
+ case ENZORAEGG_1F_16:
+ this->actorActionCmd = sp40[(ENZORAEGG_GET_1F(&this->actor)) - ENZORAEGG_1F_10];
+ this->unk_1EC = 2;
+ this->actionFunc = func_80B324B0;
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4);
+ this->unk_1EE = 0;
+ this->unk_1ED = 0;
+ this->unk_1EA |= 3;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B322BC.s")
+ case ENZORAEGG_1F_17:
+ Actor_SetScale(&this->actor, 0.0006f);
+ this->actionFunc = func_80B32D08;
+ this->actor.world.pos.y -= this->actor.shape.yOffset * this->actor.scale.y;
+ this->actor.shape.rot.x = 0;
+ this->actor.velocity.y = 0.0f;
+ this->actor.terminalVelocity = -10.0f;
+ this->actor.gravity = -1.0f;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32390.s")
+void EnZoraegg_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B324B0.s")
+s32 func_80B319A8(GlobalContext* globalCtx) {
+ return gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 & 7;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32644.s")
+void func_80B319D0(GlobalContext* globalCtx, s32 arg1) {
+ if ((arg1 < 8) && (arg1 >= 0)) {
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 &= ~7;
+ gSaveContext.permanentSceneFlags[globalCtx->sceneNum].unk_14 |= arg1;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B326F4.s")
+void func_80B31A34(EnZoraegg* this) {
+ s32 curFrame;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32820.s")
+ if (this->unk_1EA & 1) {
+ this->unk_1EE = this->unk_1EF = 100;
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32928.s")
+ curFrame = this->skelAnime.curFrame;
+ if (curFrame < 6) {
+ this->unk_1EE = 0;
+ this->unk_1EF = 0;
+ } else if (curFrame < 93) {
+ this->unk_1EE = Math_SinS((curFrame * 0xBC) - 0x468) * 100.0f;
+ if (curFrame >= 89) {
+ this->unk_1EF = Math_SinS((curFrame * 0x1000) - (0x59 * 0x1000)) * 100.0f;
+ } else {
+ this->unk_1EF = 0;
+ }
+ } else {
+ this->unk_1EE = this->unk_1EF = 100;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32A88.s")
+void func_80B31C40(EnZoraegg* this, GlobalContext* globalCtx) {
+ Actor_MoveWithGravity(&this->actor);
+ Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos);
+ this->actor.focus.pos.y += 10.0f;
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32B10.s")
+Actor* func_80B31CB4(GlobalContext* globalCtx) {
+ Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32B3C.s")
+ while (actor != NULL) {
+ if ((actor->id == ACTOR_EN_ZORAEGG) && (ENZORAEGG_GET_1F(actor) == ENZORAEGG_1F_17) &&
+ (actor->home.rot.z == 0)) {
+ actor->home.rot.z = 1;
+ return actor;
+ }
+ actor = actor->next;
+ }
+ return NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32B70.s")
+Actor* func_80B31D14(GlobalContext* globalCtx) {
+ Actor* actor = globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].first;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32BB8.s")
+ while (actor != NULL) {
+ if ((actor->id == ACTOR_EN_ZORAEGG) && (ENZORAEGG_GET_1F(actor) == ENZORAEGG_1F_3)) {
+ return actor;
+ }
+ actor = actor->next;
+ }
+ return NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32C34.s")
+void func_80B31D64(EnZoraegg* this, GlobalContext* globalCtx, s32 arg2, f32 arg3) {
+ Vec3f sp24 = this->actor.world.pos;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32D08.s")
+ sp24.y += arg3;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/EnZoraegg_Update.s")
+ if ((globalCtx->gameplayFrames & arg2) == 0) {
+ EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 0.0f, 10.0f, 0.13f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B32F04.s")
+void func_80B31E00(EnZoraegg* this) {
+ f32 sp20[] = {
+ 1.0f,
+ 1.075f,
+ 1.15f,
+ 1.075f,
+ };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B331C8.s")
+ if (this->unk_1E8 < 112) {
+ if (this->unk_1E8 > 10) {
+ this->unk_1ED = (s32)((112.0f - this->unk_1E8) * 2.5f) & 0xFF;
+ }
+ } else {
+ this->unk_1ED = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B3336C.s")
+ if (this->unk_1E8 < 10) {
+ this->unk_1E0 = sp20[this->unk_1E8 & 3];
+ } else if (this->unk_1E8 < 22) {
+ this->unk_1E0 = (Math_SinS((this->unk_1E8 - 10.0f) * (4096.0f / 3)) * 0.8f) + 1.0f;
+ } else if (this->unk_1E8 < 26) {
+ this->unk_1E0 = (Math_CosS((this->unk_1E8 - 22.0f) * 4096.0f) * 0.8f) + 1.0f;
+ } else if (this->unk_1E8 < 32) {
+ this->unk_1E0 = sp20[(this->unk_1E8 - 1) & 3];
+ } else if (this->unk_1E8 < 47) {
+ this->unk_1E0 = 1.0f;
+ } else if (this->unk_1E8 < 53) {
+ this->unk_1E0 = sp20[(this->unk_1E8 - 2) & 3];
+ } else if (this->unk_1E8 < 74) {
+ this->unk_1E0 = 1.0f - ((this->unk_1E8 - 53.0f) * (1.0f / 105));
+ } else if (this->unk_1E8 < 112) {
+ this->unk_1E0 = (this->unk_1E0 * 0.9f) + 0.15f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B333DC.s")
+ if ((this->unk_1E8 == 111) || (this->unk_1E8 == 32)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_BORN);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B33480.s")
+void func_80B32084(EnZoraegg* this, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/func_80B33818.s")
+void func_80B32094(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (Message_GetState(&globalCtx->msgCtx) == 2) {
+ this->actionFunc = func_80B320E0;
+ }
+ func_80B31C40(this, globalCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zoraegg/EnZoraegg_Draw.s")
+void func_80B320E0(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ Flags_SetSwitch(globalCtx, ENZORAEGG_GET_FE00(&this->actor));
+ Actor_MarkForDeath(&this->actor);
+ } else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80B32094;
+ Message_StartTextbox(globalCtx, 0x24B, &this->actor);
+ } else {
+ Actor_PickUp(&this->actor, globalCtx, GI_MAX, 80.0f, 60.0f);
+ if (this->actor.isTargeted) {
+ func_800B8614(&this->actor, globalCtx, 110.0f);
+ }
+ }
+
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
+ this->actor.targetMode = 3;
+ func_80B31C40(this, globalCtx);
+}
+
+void func_80B321D0(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCurrentIndex() != this->actor.cutscene) {
+ this->actionFunc = func_80B322BC;
+ func_80B319D0(globalCtx, func_80B319A8(globalCtx) + 1);
+ }
+}
+
+void func_80B32228(EnZoraegg* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, this->unk_1DC);
+ this->actionFunc = func_80B321D0;
+ } else {
+ if (this->unk_1E8 > 0) {
+ this->unk_1E8--;
+ } else if (this->unk_1E8 == 0) {
+ ActorCutscene_Stop(player->unk_A86);
+ player->unk_A86 = -1;
+ this->unk_1E8 = -1;
+ }
+
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+}
+
+void func_80B322BC(EnZoraegg* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (this->actor.cutscene != -1) {
+ this->unk_1DC = func_80B31CB4(globalCtx);
+ if (this->unk_1DC != NULL) {
+ this->unk_1E8 = 3;
+ this->actionFunc = func_80B32228;
+ return;
+ }
+ }
+
+ if ((fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) &&
+ (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z))) {
+ func_8012300C(globalCtx, 25);
+ }
+}
+
+void func_80B32390(EnZoraegg* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ Actor* temp_v0 = func_80B31D14(globalCtx);
+
+ if (temp_v0 != NULL) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, temp_v0);
+ gSaveContext.eventInf[3] |= 8;
+ Actor_MarkForDeath(&this->actor);
+ }
+ } else if ((func_80B319A8(globalCtx) >= 7) &&
+ (fabsf(player->actor.world.pos.x - this->actor.world.pos.x) < (100.0f * this->actor.scale.x)) &&
+ (fabsf(player->actor.world.pos.z - this->actor.world.pos.z) < (100.0f * this->actor.scale.z)) &&
+ (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < 30.0f)) {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+}
+
+void func_80B324B0(EnZoraegg* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCmd)) {
+ if (this->unk_1EA & 4) {
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCmd) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd)]->action ==
+ 3)) {
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4);
+ this->unk_1EA &= ~4;
+ }
+ } else {
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCmd) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd)]->action ==
+ 4)) {
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004E04);
+ this->unk_1EA |= 4;
+ }
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd));
+
+ if ((this->unk_1EA & 4) && Animation_OnFrame(&this->skelAnime, this->unk_1E4)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1);
+ this->unk_1E4 = Rand_ZeroFloat(5.0f);
+ }
+ } else if (this->unk_1EA & 4) {
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4);
+ this->unk_1EA &= ~4;
+ }
+}
+
+void func_80B32644(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ Animation_PlayLoop(&this->skelAnime, &object_zoraegg_Anim_004FE4);
+ this->unk_1EE = 0;
+ this->unk_1EA |= 2;
+ }
+
+ if (!Cutscene_CheckActorAction(globalCtx, this->actorActionCmd)) {
+ this->actionFunc = func_80B324B0;
+ } else {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd));
+
+ if (this->unk_1EE > 25) {
+ this->unk_1EE -= 25;
+ } else {
+ this->unk_1EE = 0;
+ }
+ }
+}
+
+void func_80B326F4(EnZoraegg* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCmd) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd)]->action == 3)) {
+ Animation_Change(&this->skelAnime, &object_zoraegg_Anim_004D20, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_zoraegg_Anim_004D20), 2, 5.0f);
+ this->unk_1E8 = 0;
+ this->actionFunc = func_80B32644;
+ gSaveContext.weekEventReg[19] |= 0x40;
+ this->unk_1EC = 2;
+ this->unk_1EE = 100;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_2);
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd));
+
+ if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1);
+ }
+}
+
+void func_80B32820(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ if (this->unk_1E8 >= 2) {
+ this->actionFunc = func_80B326F4;
+ Animation_Change(&this->skelAnime, &object_zoraegg_Anim_005098, 1.0f, 0.0f,
+ Animation_GetLastFrame(&object_zoraegg_Anim_005098), 0, 10.0f);
+ this->unk_1E8 = 0;
+ SkelAnime_Update(&this->skelAnime);
+ return;
+ }
+
+ Animation_PlayOnce(&this->skelAnime, &object_zoraegg_Anim_0005D4);
+ this->unk_1E8 += 1;
+ SkelAnime_Update(&this->skelAnime);
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd));
+
+ if (Animation_OnFrame(&this->skelAnime, 16.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_0);
+ }
+}
+
+void func_80B32928(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (this->unk_1E8 < 112) {
+ this->unk_1E8++;
+ }
+
+ if (SkelAnime_Update(&this->skelAnime)) {
+ Animation_PlayOnce(&this->skelAnime, &object_zoraegg_Anim_0005D4);
+ this->unk_1EA |= 1;
+ this->actionFunc = func_80B32820;
+ this->unk_1E8 = 0;
+ this->actor.velocity.y = 0.0f;
+ return;
+ }
+
+ func_80B31A34(this);
+ func_80B31E00(this);
+
+ if (this->unk_1E8 < 112) {
+ if ((this->unk_1E8 >= 69) && (this->unk_1E8 < 72)) {
+ func_80B31D64(this, globalCtx, 0, 0.0f);
+ func_80B31D64(this, globalCtx, 0, 0.0f);
+ func_80B31D64(this, globalCtx, 0, 0.0f);
+ } else {
+ func_80B31D64(this, globalCtx, 0xD, 0.0f);
+ }
+ }
+
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx,
+ Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd));
+
+ if (Animation_OnFrame(&this->skelAnime, 97.0f) || Animation_OnFrame(&this->skelAnime, 101.0f) ||
+ Animation_OnFrame(&this->skelAnime, 105.0f)) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ZORA_KIDS_SWIM_1);
+ }
+}
+
+void func_80B32A88(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, this->actorActionCmd) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, this->actorActionCmd)]->action == 2)) {
+ this->unk_1E8 = 0;
+ this->actionFunc = func_80B32928;
+ }
+ func_80B31D64(this, globalCtx, 13, 0.0f);
+}
+
+void func_80B32B10(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (gSaveContext.eventInf[3] & 8) {
+ this->actionFunc = func_80B32A88;
+ }
+}
+
+void func_80B32B3C(EnZoraegg* this, GlobalContext* globalCtx) {
+ if (gSaveContext.eventInf[3] & 8) {
+ this->actionFunc = func_80B32A88;
+ this->actor.draw = EnZoraegg_Draw;
+ }
+}
+
+void func_80B32B70(EnZoraegg* this, GlobalContext* globalCtx) {
+ func_80B31C40(this, globalCtx);
+ if (Cutscene_CheckActorAction(globalCtx, 0x1C9)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void func_80B32BB8(EnZoraegg* this, GlobalContext* globalCtx) {
+ func_80B31C40(this, globalCtx);
+ func_80B31D64(this, globalCtx, 13, 0.0f);
+
+ if (this->actor.bgCheckFlags & 0x1) {
+ this->actionFunc = func_80B32B70;
+ }
+
+ if (Cutscene_CheckActorAction(globalCtx, 0x1C9)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void func_80B32C34(EnZoraegg* this, GlobalContext* globalCtx) {
+ WaterBox* sp34;
+ f32 sp30;
+ s32 pad;
+
+ Actor_MoveWithGravity(&this->actor);
+ Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos);
+ this->actor.focus.pos.y += 10.0f;
+ sp30 = this->actor.world.pos.y;
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp30,
+ &sp34)) {
+ if ((this->actor.world.pos.y + 50.0f) < sp30) {
+ this->actionFunc = func_80B32BB8;
+ }
+
+ func_80B31D64(this, globalCtx, 0, -20.0f);
+ func_80B31D64(this, globalCtx, 0, -20.0f);
+ }
+}
+
+void func_80B32D08(EnZoraegg* this, GlobalContext* globalCtx) {
+ WaterBox* sp44;
+ f32 sp40;
+ Vec3f sp34;
+ s32 pad;
+
+ Actor_MoveWithGravity(&this->actor);
+ Math_Vec3f_Copy(&this->actor.focus.pos, &this->actor.world.pos);
+ this->actor.focus.pos.y += 10.0f;
+ sp40 = this->actor.world.pos.y;
+
+ if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp40,
+ &sp44)) {
+ if (this->actor.world.pos.y < sp40) {
+ sp34.x = this->actor.world.pos.x;
+ sp34.y = sp40;
+ sp34.z = this->actor.world.pos.z;
+
+ EffectSsGRipple_Spawn(globalCtx, &sp34, 150, 500, 0);
+ EffectSsGSplash_Spawn(globalCtx, &sp34, NULL, NULL, 0, 200);
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L);
+
+ this->actionFunc = func_80B32C34;
+ this->actor.velocity.y = -1.0f;
+ this->actor.terminalVelocity = -1.0f;
+ this->actor.gravity = -1.0f;
+ }
+ }
+
+ if (this->actor.scale.x < 0.006f) {
+ Actor_SetScale(&this->actor, this->actor.scale.x + 0.0012f);
+ }
+
+ if (this->actor.scale.x > 0.006f) {
+ Actor_SetScale(&this->actor, 0.006f);
+ }
+}
+
+void EnZoraegg_Update(Actor* thisx, GlobalContext* globalCtx) {
+ EnZoraegg* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if (DECR(this->unk_1F4) == 0) {
+ this->unk_1F4 = Rand_S16Offset(60, 60);
+ }
+
+ this->unk_1F2 = this->unk_1F4;
+ if (this->unk_1F2 >= 3) {
+ this->unk_1F2 = 0;
+ }
+}
+
+void func_80B32F04(Actor* thisx, GlobalContext* globalCtx) {
+ f32 sp7C;
+ f32 sp78;
+ f32 sp74;
+ EnZoraegg* this = THIS;
+ s32 pad[3];
+ s16 sp62;
+ s16 sp60;
+ f32 temp_f2;
+ Gfx* gfx;
+ Vec3f sp4C;
+ s32 pad2;
+
+ Matrix_StatePush();
+
+ sp4C = GET_ACTIVE_CAM(globalCtx)->eye;
+
+ sp62 = Math_Vec3f_Yaw(&sp4C, &this->actor.focus.pos);
+ sp60 = -Math_Vec3f_Pitch(&sp4C, &this->actor.focus.pos);
+
+ sp74 = -((15.0f * Math_SinS(sp62)) * Math_CosS(sp60));
+ sp78 = -(15.0f * Math_SinS(sp60));
+ sp7C = -((15.0f * Math_CosS(sp62)) * Math_CosS(sp60));
+
+ Matrix_InsertTranslation(this->actor.world.pos.x + sp74, this->actor.world.pos.y + sp78 + 6.0f,
+ temp_f2 = this->actor.world.pos.z + sp7C, 0);
+
+ sp7C = Math_SinS(globalCtx->gameplayFrames * 0x4000);
+
+ Matrix_Scale(this->actor.scale.x * (((sp7C + 1.0f) * 0.1f) + 9.0f),
+ this->actor.scale.y * (((sp7C + 1.0f) * 0.1f) + 9.0f),
+ this->actor.scale.z * (((sp7C + 1.0f) * 0.1f) + 9.0f), 1);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ gfx = POLY_XLU_DISP;
+ gfx = func_8012C868(gfx);
+
+ gSPSetOtherMode(gfx++, G_SETOTHERMODE_H, 4, 4, 0x00000080);
+ gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
+ gSPDisplayList(gfx++, gameplay_keep_DL_029CB0);
+
+ gDPSetPrimColor(gfx++, 0, 0, 120, 180, 200, (s32)(this->unk_1ED * (20.0f / 51)));
+ gSPMatrix(gfx++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, gameplay_keep_DL_029CF0);
+
+ POLY_XLU_DISP = gfx;
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80B331C8(Actor* thisx, GlobalContext* globalCtx) {
+ EnZoraegg* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePush();
+
+ Matrix_Scale(this->unk_1E0, this->unk_1E0, this->unk_1E0, MTXMODE_APPLY);
+
+ if (this->unk_1ED >= 254) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetRenderMode(POLY_OPA_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2);
+ gSPDisplayList(POLY_OPA_DISP++, object_zoraegg_DL_005250);
+ } else {
+ func_8012C304(POLY_XLU_DISP++);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2);
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_1ED);
+ gSPDisplayList(POLY_XLU_DISP++, object_zoraegg_DL_005250);
+ }
+
+ Matrix_StatePop();
+
+ func_80B32F04(thisx, globalCtx);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+s32 EnZoraegg_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
+ Actor* thisx) {
+ EnZoraegg* this = THIS;
+
+ switch (this->unk_1EC) {
+ case 1:
+ if ((limbIndex != 1) && (limbIndex != 3) && (limbIndex != 4)) {
+ *dList = NULL;
+ }
+ break;
+
+ case 2:
+ if ((limbIndex != 1) && (limbIndex != 3)) {
+ *dList = NULL;
+ }
+ break;
+ }
+ return false;
+}
+
+void func_80B333DC(GlobalContext* globalCtx, Gfx** dList, f32 arg2) {
+ Matrix_StatePush();
+ Matrix_Scale(arg2, arg2, arg2, MTXMODE_APPLY);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, *dList);
+
+ Matrix_StatePop();
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void EnZoraegg_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnZoraegg* this = THIS;
+ f32 temp_f20;
+ f32 temp_f2;
+
+ switch (this->unk_1EC) {
+ case 1:
+ switch (limbIndex) {
+ case 2:
+ temp_f20 = this->unk_1EE * 0.01f;
+ Matrix_StatePush();
+ Matrix_Scale(temp_f20, temp_f20, temp_f20, MTXMODE_APPLY);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, *dList);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ break;
+
+ case 4:
+ Matrix_StatePop();
+ break;
+
+ case 5:
+ case 6:
+ temp_f20 = this->unk_1EF * 0.01f;
+ func_80B333DC(globalCtx, dList, temp_f20);
+ break;
+ }
+ break;
+
+ case 2:
+ switch (limbIndex) {
+ case 2:
+ temp_f20 = (this->unk_1EE * 0.005f) + 0.5f;
+ Matrix_StatePush();
+ Matrix_Scale(1.0f, temp_f20, temp_f20, MTXMODE_APPLY);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, *dList);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ break;
+
+ case 4:
+ temp_f2 = 1.0f / ((this->unk_1EE * 0.005f) + 0.5f);
+ temp_f20 = (this->unk_1EE * 0.0035f) + 0.65f;
+ Matrix_Scale(1.0f, temp_f20 * temp_f2, temp_f2, MTXMODE_APPLY);
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, *dList);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+
+ Matrix_StatePop();
+ break;
+
+ case 5:
+ case 6:
+ temp_f20 = this->unk_1EE * 0.01f;
+ func_80B333DC(globalCtx, dList, temp_f20);
+ break;
+ }
+ break;
+ }
+}
+
+TexturePtr D_80B33950[] = { object_zoraegg_Tex_003430, object_zoraegg_Tex_004430, object_zoraegg_Tex_004830 };
+
+void func_80B33818(Actor* thisx, GlobalContext* globalCtx) {
+ EnZoraegg* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(D_80B33950[this->unk_1F2]));
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnZoraegg_OverrideLimbDraw, EnZoraegg_PostLimbDraw, &this->actor);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void EnZoraegg_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnZoraegg* this = THIS;
+
+ if (this->unk_1ED > 0) {
+ func_80B331C8(thisx, globalCtx);
+ }
+
+ if (this->unk_1ED != 255) {
+ func_80B33818(thisx, globalCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h
index 8c458c46e3..fb65579fa6 100644
--- a/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h
+++ b/src/overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h
@@ -7,9 +7,55 @@ struct EnZoraegg;
typedef void (*EnZoraeggActionFunc)(struct EnZoraegg*, GlobalContext*);
+#define ENZORAEGG_GET_1F(thisx) ((thisx)->params & 0x1F)
+#define ENZORAEGG_GET_FE00(thisx) (((thisx)->params & 0xFE00) >> 9)
+
+enum {
+ /* 0 */ ENZORAEGG_1F_0,
+ /* 1 */ ENZORAEGG_1F_1,
+ /* 2 */ ENZORAEGG_1F_2,
+ /* 3 */ ENZORAEGG_1F_3,
+ /* 4 */ ENZORAEGG_1F_4,
+ /* 5 */ ENZORAEGG_1F_5,
+ /* 6 */ ENZORAEGG_1F_6,
+ /* 7 */ ENZORAEGG_1F_7,
+ /* 8 */ ENZORAEGG_1F_8,
+ /* 9 */ ENZORAEGG_1F_9,
+ /* 10 */ ENZORAEGG_1F_10,
+ /* 11 */ ENZORAEGG_1F_11,
+ /* 12 */ ENZORAEGG_1F_12,
+ /* 13 */ ENZORAEGG_1F_13,
+ /* 14 */ ENZORAEGG_1F_14,
+ /* 15 */ ENZORAEGG_1F_15,
+ /* 16 */ ENZORAEGG_1F_16,
+ /* 17 */ ENZORAEGG_1F_17,
+ /* 18 */ ENZORAEGG_1F_18,
+ /* 19 */ ENZORAEGG_1F_19,
+ /* 20 */ ENZORAEGG_1F_20,
+ /* 21 */ ENZORAEGG_1F_21,
+ /* 22 */ ENZORAEGG_1F_22,
+ /* 23 */ ENZORAEGG_1F_23,
+ /* 24 */ ENZORAEGG_1F_24,
+ /* 25 */ ENZORAEGG_1F_25,
+};
+
typedef struct EnZoraegg {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xB4];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ Vec3s jointTable[7];
+ /* 0x01B2 */ Vec3s morphTable[7];
+ /* 0x01DC */ Actor* unk_1DC;
+ /* 0x01E0 */ f32 unk_1E0;
+ /* 0x01E4 */ f32 unk_1E4;
+ /* 0x01E8 */ s16 unk_1E8;
+ /* 0x01EA */ u16 unk_1EA;
+ /* 0x01EC */ u8 unk_1EC;
+ /* 0x01ED */ u8 unk_1ED;
+ /* 0x01EE */ u8 unk_1EE;
+ /* 0x01EF */ u8 unk_1EF;
+ /* 0x01F0 */ u16 actorActionCmd;
+ /* 0x01F2 */ s16 unk_1F2;
+ /* 0x01F4 */ s16 unk_1F4;
/* 0x01F8 */ EnZoraeggActionFunc actionFunc;
} EnZoraegg; // size = 0x1FC
diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c
index 7135474005..a69223d09c 100644
--- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c
+++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c
@@ -5,8 +5,9 @@
*/
#include "z_en_zos.h"
+#include "objects/object_zos/object_zos.h"
-#define FLAGS 0x02000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_2000000)
#define THIS ((EnZos*)thisx)
@@ -15,7 +16,24 @@ void EnZos_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnZos_Update(Actor* thisx, GlobalContext* globalCtx);
void EnZos_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80BBAE84(EnZos* this, s16 arg1, u8 arg2);
+void func_80BBB2C4(EnZos* this, GlobalContext* globalCtx);
+void func_80BBB354(EnZos* this, GlobalContext* globalCtx);
+void func_80BBB4CC(EnZos* this, GlobalContext* globalCtx);
+void func_80BBB574(EnZos* this, GlobalContext* globalCtx);
+void func_80BBB718(EnZos* this, GlobalContext* globalCtx);
+void func_80BBB8AC(EnZos* this, GlobalContext* globalCtx);
+void func_80BBBB84(EnZos* this, GlobalContext* globalCtx);
+void func_80BBBCBC(EnZos* this, GlobalContext* globalCtx);
+void func_80BBBD5C(EnZos* this, GlobalContext* globalCtx);
+void func_80BBBDE0(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC070(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC14C(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC22C(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC24C(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC298(EnZos* this, GlobalContext* globalCtx);
+void func_80BBC37C(EnZos* this, GlobalContext* globalCtx);
+
const ActorInit En_Zos_InitVars = {
ACTOR_EN_ZOS,
ACTORCAT_NPC,
@@ -28,74 +46,696 @@ const ActorInit En_Zos_InitVars = {
(ActorFunc)EnZos_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BBC6F0 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 60, 40, 0, { 0, 0, 0 } },
};
-#endif
+void EnZos_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnZos* this = THIS;
-extern ColliderCylinderInit D_80BBC6F0;
+ Actor_SetScale(&this->actor, 0.0115f);
+ this->actionFunc = func_80BBBDE0;
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zos_Skel_015238, &object_zos_Anim_00A164, this->jointTable,
+ this->morphTable, 18);
+ Animation_PlayLoop(&this->skelAnime, &object_zos_Anim_00A164);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->unk_2B6 = 0;
+ this->actor.terminalVelocity = -4.0f;
+ this->actor.gravity = -4.0f;
+ func_80BBAE84(this, 0, 2);
-extern UNK_TYPE D_0600A164;
-extern UNK_TYPE D_060136E0;
+ switch (ENZOS_GET_F(&this->actor)) {
+ case ENZOS_F_1:
+ if (!(gSaveContext.weekEventReg[55] & 0x80)) {
+ Actor_MarkForDeath(&this->actor);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Init.s")
+ if (gSaveContext.weekEventReg[78] & 1) {
+ this->actionFunc = func_80BBC24C;
+ } else {
+ this->actionFunc = func_80BBC14C;
+ }
+ func_80BBAE84(this, 0, 2);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Destroy.s")
+ case ENZOS_F_2:
+ this->actionFunc = func_80BBC37C;
+ func_80BBAE84(this, 7, 2);
+ this->unk_2BC = -1;
+ this->unk_2B6 |= 0x40;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAE84.s")
+ default:
+ if (gSaveContext.weekEventReg[55] & 0x80) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ this->actor.flags |= ACTOR_FLAG_10;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAF5C.s")
+void EnZos_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnZos* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBAFFC.s")
+ gSaveContext.weekEventReg[52] &= (u8)~0x10;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB0D4.s")
+void func_80BBAE84(EnZos* this, s16 arg1, u8 arg2) {
+ static AnimationHeader* sAnimations[] = {
+ &object_zos_Anim_00A164, &object_zos_Anim_01621C, &object_zos_Anim_016980, &object_zos_Anim_007C40,
+ &object_zos_Anim_008630, &object_zos_Anim_0090CC, &object_zos_Anim_009830, &object_zos_Anim_005E04,
+ &object_zos_Anim_007334, &object_zos_Anim_0048D4, &object_zos_Anim_001CFC, &object_zos_Anim_005E04,
+ &object_zos_Anim_007334,
+ };
+ f32 phi_f0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB15C.s")
+ if ((arg1 != this->unk_2B8) && (arg1 >= 0) && (arg1 < 13)) {
+ if (arg1 > 10) {
+ phi_f0 = 29.0f;
+ } else {
+ phi_f0 = Animation_GetLastFrame(sAnimations[arg1]);
+ }
+ Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, phi_f0, arg2, -5.0f);
+ this->unk_2B8 = arg1;
+ this->unk_2B6 &= ~0x80;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB2C4.s")
+s32 func_80BBAF5C(EnZos* this, GlobalContext* globalCtx) {
+ if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) &&
+ ((!Actor_IsFacingPlayer(&this->actor, 0x4000) && (this->actor.home.rot.y == this->actor.shape.rot.y)) ||
+ (Actor_IsFacingPlayer(&this->actor, 0x3000) && (this->actor.home.rot.y != this->actor.shape.rot.y))) &&
+ (this->actor.xzDistToPlayer < 100.0f)) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB354.s")
+s32 func_80BBAFFC(EnZos* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ switch ((s16)Rand_ZeroFloat(4.0f)) {
+ case 0:
+ func_80BBAE84(this, 7, 2);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB414.s")
+ case 1:
+ func_80BBAE84(this, 8, 2);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB4CC.s")
+ case 2:
+ func_80BBAE84(this, 11, 2);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB574.s")
+ default:
+ func_80BBAE84(this, 12, 2);
+ break;
+ }
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB718.s")
+void func_80BBB0D4(EnZos* this, GlobalContext* globalCtx) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ if (Rand_ZeroFloat(1.0f) < 0.9f) {
+ func_80BBAE84(this, 0, 2);
+ } else {
+ func_80BBAE84(this, 1, 2);
+ }
+ SkelAnime_Update(&this->skelAnime);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBB8AC.s")
+void func_80BBB15C(EnZos* this, GlobalContext* globalCtx) {
+ s32 textId;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBB84.s")
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (this->unk_2B6 & 8) {
+ textId = 0x1235;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 2;
+ } else if (this->unk_2B6 & 4) {
+ textId = 0x123E;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 2;
+ } else if (gSaveContext.weekEventReg[40] & 0x20) {
+ textId = 0x1236;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 0x80;
+ } else {
+ textId = 0x1231;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 0x80;
+ }
+ } else {
+ this->unk_2B6 &= ~2;
+ if (gSaveContext.weekEventReg[39] & 0x10) {
+ textId = 0x1243;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 0x80;
+ } else {
+ textId = 0x1244;
+ gSaveContext.weekEventReg[39] |= 0x10;
+ func_80BBAE84(this, 4, 0);
+ this->unk_2B6 |= 0x10;
+ }
+ }
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBCBC.s")
+void func_80BBB2C4(EnZos* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ Message_StartTextbox(globalCtx, 0x124F, &this->actor);
+ this->actionFunc = func_80BBB8AC;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBD5C.s")
+void func_80BBB354(EnZos* this, GlobalContext* globalCtx) {
+ s32 item;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBDE0.s")
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.parent = NULL;
+ this->actionFunc = func_80BBB2C4;
+ gSaveContext.weekEventReg[39] |= 0x20;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ } else {
+ if (gSaveContext.weekEventReg[39] & 0x20) {
+ item = GI_RUPEE_PURPLE;
+ } else {
+ item = GI_HEART_PIECE;
+ }
+ Actor_PickUp(&this->actor, globalCtx, item, 10000.0f, 50.0f);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBBFBC.s")
+void func_80BBB414(EnZos* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC070.s")
+ if (Cutscene_CheckActorAction(globalCtx, 501)) {
+ s16 action = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 501)]->action;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC14C.s")
+ if (action != this->unk_2BA) {
+ this->unk_2BA = action;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC22C.s")
+ switch (action) {
+ case 1:
+ func_80BBAE84(this, 1, 0);
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC24C.s")
+ case 2:
+ func_80BBAE84(this, 10, 0);
+ break;
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC298.s")
+void func_80BBB4CC(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBB414(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC37C.s")
+ if ((this->actor.cutscene != -1) && (ActorCutscene_GetCurrentIndex() != this->actor.cutscene)) {
+ if (ActorCutscene_GetCurrentIndex() == 0x7C) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ } else if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ ActorCutscene_Start(this->actor.cutscene, &this->actor);
+ this->actor.cutscene = -1;
+ } else {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Update.s")
+void func_80BBB574(EnZos* this, GlobalContext* globalCtx) {
+ if (!(this->unk_2B6 & 0x10)) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC4E4.s")
+ if (func_80BBAFFC(this, globalCtx)) {
+ if (this->unk_2B6 & 0x20) {
+ this->unk_2B6 &= ~0x20;
+ func_80151938(globalCtx, 0x124C);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/func_80BBC500.s")
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x124B:
+ if (this->unk_2B8 == 9) {
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->unk_2B6 |= 0x20;
+ } else {
+ func_80151938(globalCtx, 0x124C);
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zos/EnZos_Draw.s")
+ case 0x124C:
+ globalCtx->msgCtx.unk11F10 = 0;
+ this->actionFunc = func_80BBB4CC;
+ func_80BBAE84(this, 10, 0);
+ break;
+
+ case 0x124D:
+ this->unk_2B6 &= ~0x10;
+ func_80BBAE84(this, 6, 0);
+ func_80151938(globalCtx, 0x124E);
+ break;
+
+ case 0x124E:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBB354;
+ func_80BBB354(this, globalCtx);
+ break;
+ }
+ }
+}
+
+void func_80BBB718(EnZos* this, GlobalContext* globalCtx) {
+ s32 sp24;
+ Player* player = GET_PLAYER(globalCtx);
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if (Message_GetState(&globalCtx->msgCtx) == 0x10) {
+ sp24 = func_80123810(globalCtx);
+ if (sp24 > 0) {
+ func_801477B4(globalCtx);
+
+ if (sp24 == 25) {
+ player->actor.textId = 0x1232;
+ func_80BBAE84(this, 5, 0);
+ this->unk_2B6 |= 8;
+ gSaveContext.weekEventReg[40] |= 0x20;
+ } else if (gSaveContext.weekEventReg[39] & 8) {
+ player->actor.textId = 0x1241;
+ } else {
+ player->actor.textId = 0x1237;
+ gSaveContext.weekEventReg[39] |= 8;
+ func_80BBAE84(this, 4, 0);
+ this->unk_2B6 |= 4;
+ }
+ this->actionFunc = func_80BBB8AC;
+ } else if (sp24 < 0) {
+ if (gSaveContext.weekEventReg[39] & 8) {
+ func_80151938(globalCtx, 0x1241);
+ } else {
+ func_80151938(globalCtx, 0x1237);
+ gSaveContext.weekEventReg[39] |= 8;
+ func_80BBAE84(this, 4, 0);
+ this->unk_2B6 |= 4;
+ }
+ this->actionFunc = func_80BBB8AC;
+ }
+ }
+}
+
+void func_80BBB8AC(EnZos* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ SkelAnime_Update(&this->skelAnime);
+
+ if (!(this->unk_2B6 & 0x10)) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ if ((this->unk_2B6 & 0x80) && (this->actor.yawTowardsPlayer == this->actor.shape.rot.y)) {
+ func_80BBAE84(this, 3, 0);
+ }
+ }
+
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x1237:
+ player->exchangeItemId = 0;
+
+ case 0x1238:
+ case 0x123A:
+ case 0x123B:
+ case 0x123C:
+ case 0x123E:
+ case 0x123F:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1244:
+ this->unk_2B6 &= ~0x10;
+ func_80BBAE84(this, 6, 0);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1232:
+ case 0x1241:
+ player->exchangeItemId = 0;
+
+ case 0x1239:
+ case 0x1246:
+ func_80BBAE84(this, 6, 0);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1233:
+ func_80BBAE84(this, 5, 0);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1245:
+ case 0x1248:
+ func_80BBAE84(this, 3, 0);
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1231:
+ func_80151938(globalCtx, 0xFF);
+ this->actionFunc = func_80BBB718;
+ break;
+
+ case 0x1243:
+ case 0x1249:
+ func_80BBAE84(this, 2, 0);
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBBDE0;
+ this->unk_2B6 |= 1;
+ break;
+
+ case 0x1234:
+ case 0x123D:
+ case 0x1242:
+ func_80BBAE84(this, 2, 0);
+ Actor_ProcessTalkRequest(&this->actor, &globalCtx->state);
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBBDE0;
+ this->unk_2B6 |= 1;
+ break;
+
+ case 0x1236:
+ func_80BBAE84(this, 2, 0);
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBBDE0;
+ this->unk_2B6 |= 1;
+ break;
+
+ default:
+ if (0) {}
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBBDE0;
+ this->unk_2B6 |= 1;
+ break;
+ }
+ }
+}
+
+void func_80BBBB84(EnZos* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ Message_StartTextbox(globalCtx, 0x1248, &this->actor);
+ this->actionFunc = func_80BBB8AC;
+ func_80BBAE84(this, 6, 0);
+ this->unk_2B6 |= 2;
+ } else if (gSaveContext.weekEventReg[41] & 0x10) {
+ Message_StartTextbox(globalCtx, 0x124A, &this->actor);
+ this->actionFunc = func_80BBB8AC;
+ func_80BBAE84(this, 6, 0);
+ } else {
+ gSaveContext.weekEventReg[41] |= 0x10;
+ Message_StartTextbox(globalCtx, 0x124B, &this->actor);
+ this->actionFunc = func_80BBB574;
+ func_80BBAE84(this, 9, 2);
+ this->unk_2B6 |= 0x10;
+ }
+ } else {
+ func_800B8614(&this->actor, globalCtx, 300.0f);
+ }
+}
+
+void func_80BBBCBC(EnZos* this, GlobalContext* globalCtx) {
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actor.flags &= ~ACTOR_FLAG_10000;
+ func_80BBAE84(this, 5, 0);
+ Message_StartTextbox(globalCtx, 0x124D, &this->actor);
+ this->actionFunc = func_80BBB574;
+ } else {
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+}
+
+void func_80BBBD5C(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBB414(this, globalCtx);
+ if (!Cutscene_CheckActorAction(globalCtx, 0x1F5)) {
+ this->actionFunc = func_80BBBCBC;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, -1);
+ }
+}
+
+void func_80BBBDE0(EnZos* this, GlobalContext* globalCtx) {
+ Actor* thisx = &this->actor;
+ Vec3f sp28;
+
+ if (this->unk_2B6 & 1) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = thisx->shape.rot.y;
+ if (this->actor.home.rot.y == thisx->shape.rot.y) {
+ func_80BBAE84(this, 0, 2);
+ this->unk_2B6 &= ~1;
+ }
+ }
+
+ func_80BBB0D4(this, globalCtx);
+
+ if (globalCtx->msgCtx.ocarinaMode == 0x2A) {
+ globalCtx->msgCtx.ocarinaMode = 4;
+ this->actionFunc = func_80BBBB84;
+ this->actor.flags |= ACTOR_FLAG_10000;
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ return;
+ }
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BBB8AC;
+ func_80BBB15C(this, globalCtx);
+ } else if (Cutscene_CheckActorAction(globalCtx, 0x1F5)) {
+ this->actionFunc = func_80BBBD5C;
+ } else if (func_80BBAF5C(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+
+ if (!Actor_IsFacingPlayer(&this->actor, 0x4000) && (this->actor.xzDistToPlayer < 100.0f)) {
+ gSaveContext.weekEventReg[52] |= 0x10;
+ } else {
+ gSaveContext.weekEventReg[52] &= (u8)~0x10;
+ }
+
+ sp28.x = this->actor.projectedPos.x;
+ sp28.y = this->actor.projectedPos.y;
+ sp28.z = this->actor.projectedPos.z;
+ func_801A1FB4(3, &sp28, 110, 1000.0f);
+}
+
+void func_80BBBFBC(EnZos* this, GlobalContext* globalCtx) {
+ u16 textId;
+
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[79] & 1) {
+ textId = 0x125B;
+ } else if (gSaveContext.weekEventReg[78] & 0x80) {
+ textId = 0x125A;
+ } else {
+ textId = 0x1259;
+ gSaveContext.weekEventReg[78] |= 0x80;
+ }
+ func_80BBAE84(this, 5, 0);
+ } else {
+ textId = 0x1258;
+ func_80BBAE84(this, 6, 0);
+ }
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+}
+
+void func_80BBC070(EnZos* this, GlobalContext* globalCtx) {
+ SkelAnime_Update(&this->skelAnime);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 5:
+ if (func_80147624(globalCtx)) {
+ func_80BBAE84(this, 2, 0);
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BBC14C;
+ this->unk_2B6 |= 1;
+ }
+ break;
+
+ case 2:
+ func_80BBAE84(this, 2, 0);
+ this->actionFunc = func_80BBC14C;
+ this->unk_2B6 |= 1;
+ break;
+ }
+}
+
+void func_80BBC14C(EnZos* this, GlobalContext* globalCtx) {
+ Actor* thisx = &this->actor;
+
+ if (this->unk_2B6 & 1) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = thisx->shape.rot.y;
+ if (this->actor.home.rot.y == this->actor.shape.rot.y) {
+ func_80BBAE84(this, 0, 2);
+ this->unk_2B6 &= ~1;
+ }
+ }
+
+ func_80BBB0D4(this, globalCtx);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BBC070;
+ func_80BBBFBC(this, globalCtx);
+ } else if (func_80BBAF5C(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+}
+
+void func_80BBC22C(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBAFFC(this, globalCtx);
+}
+
+void func_80BBC24C(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBB0D4(this, globalCtx);
+ if (gSaveContext.weekEventReg[79] & 1) {
+ this->actionFunc = func_80BBC22C;
+ func_80BBAE84(this, 7, 2);
+ }
+}
+
+void func_80BBC298(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBAFFC(this, globalCtx);
+
+ if (this->unk_2BC < 799) {
+ this->unk_2BC += 200;
+ } else {
+ this->unk_2BC += 30;
+ }
+
+ if (this->unk_2BC > 999) {
+ this->unk_2BC = 999;
+ }
+
+ if (Cutscene_CheckActorAction(globalCtx, 515)) {
+ if (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 515)]->action == 1) {
+ this->actionFunc = func_80BBC37C;
+ this->unk_2BC = -1;
+ }
+ } else {
+ this->actionFunc = func_80BBC37C;
+ this->unk_2BC = -1;
+ }
+}
+
+void func_80BBC37C(EnZos* this, GlobalContext* globalCtx) {
+ func_80BBAFFC(this, globalCtx);
+ if (Cutscene_CheckActorAction(globalCtx, 515) &&
+ (globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 515)]->action == 3)) {
+ this->actionFunc = func_80BBC298;
+ }
+}
+
+void EnZos_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZos* this = THIS;
+
+ Actor_MoveWithGravity(&this->actor);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 30.0f, 4);
+
+ this->actionFunc(this, globalCtx);
+
+ if (DECR(this->unk_2AE) == 0) {
+ this->unk_2AE = Rand_S16Offset(60, 60);
+ }
+
+ this->unk_2AC = this->unk_2AE;
+ if (this->unk_2AC >= 3) {
+ this->unk_2AC = 0;
+ }
+}
+
+s32 func_80BBC4E4(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ return false;
+}
+
+void func_80BBC500(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ static Vec3f D_80BBC750 = { 0.0f, 0.0f, 0.0f };
+
+ if (limbIndex == 9) {
+ Matrix_MultiplyVector3fByState(&D_80BBC750, &thisx->focus.pos);
+ }
+}
+
+void EnZos_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ static TexturePtr D_80BBC75C[] = {
+ object_zos_Tex_010918,
+ object_zos_Tex_011118,
+ object_zos_Tex_011918,
+ };
+ EnZos* this = THIS;
+ Gfx* gfx;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ if (this->unk_2B6 & 0x40) {
+ POLY_OPA_DISP = Gfx_SetFog(POLY_OPA_DISP, 0, 0, 0, 0, this->unk_2BC, 1000);
+ }
+
+ gfx = POLY_OPA_DISP;
+
+ gSPSegment(&gfx[0], 0x08, Lib_SegmentedToVirtual(D_80BBC75C[this->unk_2AC]));
+
+ Matrix_StatePush();
+ Matrix_RotateY(this->actor.home.rot.y - this->actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, 0.0f, -974.4f, MTXMODE_APPLY);
+
+ gSPMatrix(&gfx[1], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(&gfx[2], object_zos_DL_0136E0);
+ gSPDisplayList(&gfx[3], object_zos_DL_013088);
+
+ POLY_OPA_DISP = &gfx[4];
+
+ Matrix_StatePop();
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ func_80BBC4E4, func_80BBC500, &this->actor);
+
+ if (this->unk_2B6 & 0x40) {
+ POLY_OPA_DISP = func_801660B8(globalCtx, POLY_OPA_DISP);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.h b/src/overlays/actors/ovl_En_Zos/z_en_zos.h
index dbee5eb8cd..991f08d578 100644
--- a/src/overlays/actors/ovl_En_Zos/z_en_zos.h
+++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.h
@@ -7,9 +7,26 @@ struct EnZos;
typedef void (*EnZosActionFunc)(struct EnZos*, GlobalContext*);
+#define ENZOS_GET_F(thisx) ((thisx)->params & 0xF)
+
+enum {
+ /* 1 */ ENZOS_F_1 = 1,
+ /* 2 */ ENZOS_F_2,
+};
+
typedef struct EnZos {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x17C];
+ /* 0x0144 */ Vec3s jointTable[18];
+ /* 0x01B0 */ Vec3s morphTable[18];
+ /* 0x021C */ SkelAnime skelAnime;
+ /* 0x0260 */ ColliderCylinder collider;
+ /* 0x02AC */ s16 unk_2AC;
+ /* 0x02AE */ s16 unk_2AE;
+ /* 0x02B0 */ UNK_TYPE1 unk2B0[6];
+ /* 0x02B6 */ u16 unk_2B6;
+ /* 0x02B8 */ s16 unk_2B8;
+ /* 0x02BA */ s16 unk_2BA;
+ /* 0x02BC */ s16 unk_2BC;
/* 0x02C0 */ EnZosActionFunc actionFunc;
} EnZos; // size = 0x2C4
diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c
index c179517cde..18f5f13e3a 100644
--- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c
+++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c
@@ -5,8 +5,9 @@
*/
#include "z_en_zot.h"
+#include "objects/object_zo/object_zo.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnZot*)thisx)
@@ -30,21 +31,6 @@ void func_80B990A4(EnZot* this, GlobalContext* globalCtx);
void func_80B992C0(EnZot* this, GlobalContext* globalCtx);
void func_80B99384(EnZot* this, GlobalContext* globalCtx);
-extern AnimationHeader D_06002898;
-extern AnimationHeader D_06004248;
-extern UNK_PTR D_060050A0;
-extern UNK_PTR D_060058A0;
-extern UNK_PTR D_060060A0;
-extern FlexSkeletonHeader D_0600D208;
-extern AnimationHeader D_0600DE20;
-extern AnimationHeader D_0600DF54;
-extern AnimationHeader D_0600E400;
-extern AnimationHeader D_0600EDF0;
-extern AnimationHeader D_0600F4E8;
-extern AnimationHeader D_0600FDF0;
-extern AnimationHeader D_06010B18;
-extern AnimationHeader D_06011424;
-
const ActorInit En_Zot_InitVars = {
ACTOR_EN_ZOT,
ACTORCAT_NPC,
@@ -93,15 +79,15 @@ void func_80B965D0(EnZot* this, GlobalContext* globalCtx) {
}
void EnZot_Init(Actor* thisx, GlobalContext* globalCtx2) {
- EnZot* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ EnZot* this = THIS;
s32 i;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80B97100;
- SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600D208, &D_06004248, this->jointTable, this->morphTable, 20);
- Animation_PlayLoop(&this->skelAnime, &D_0600DE20);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, 20);
+ Animation_PlayLoop(&this->skelAnime, &object_zo_Anim_00DE20);
this->unk_2F0 = 0;
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
@@ -168,7 +154,7 @@ void EnZot_Init(Actor* thisx, GlobalContext* globalCtx2) {
break;
case 8:
- this->actor.flags |= 0x2000000;
+ this->actor.flags |= ACTOR_FLAG_2000000;
this->actionFunc = func_80B98CA8;
func_80B96BEC(this, 5, 0);
break;
@@ -249,8 +235,9 @@ void EnZot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void func_80B96BEC(EnZot* this, s16 arg1, u8 arg2) {
static AnimationHeader* sAnimations[] = {
- &D_0600DE20, &D_06002898, &D_0600F4E8, &D_0600E400, &D_0600FDF0,
- &D_06010B18, &D_06011424, &D_0600EDF0, &D_0600DF54, &D_0600DF54,
+ &object_zo_Anim_00DE20, &gZoraWalkAnim, &object_zo_Anim_00F4E8, &object_zo_Anim_00E400,
+ &object_zo_Anim_00FDF0, &object_zo_Anim_010B18, &object_zo_Anim_011424, &object_zo_Anim_00EDF0,
+ &object_zo_Anim_00DF54, &object_zo_Anim_00DF54,
};
if ((arg1 >= 0) && (arg1 < 10)) {
@@ -387,7 +374,7 @@ void func_80B97110(EnZot* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[28] |= 0x40;
}
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B97194(EnZot* this, GlobalContext* globalCtx) {
@@ -453,7 +440,7 @@ void func_80B972E8(EnZot* this, GlobalContext* globalCtx) {
gSaveContext.weekEventReg[29] |= 8;
}
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B973BC(EnZot* this, GlobalContext* globalCtx) {
@@ -497,7 +484,7 @@ void func_80B973BC(EnZot* this, GlobalContext* globalCtx) {
case 0x1279:
func_801477B4(globalCtx);
func_80B965D0(this, globalCtx);
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
this->actor.textId = 0;
this->actionFunc = func_80B97708;
if ((this->actor.cutscene != -1) && !(this->unk_2F2 & 1)) {
@@ -572,7 +559,7 @@ void func_80B97708(EnZot* this, GlobalContext* globalCtx) {
if (phi_v1 != 0) {
gSaveContext.weekEventReg[29] |= 0x10;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
if (phi_v1 == 5) {
if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
this->actor.textId = 0x126E;
@@ -655,7 +642,7 @@ void func_80B9787C(EnZot* this, GlobalContext* globalCtx) {
break;
}
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
}
@@ -724,7 +711,7 @@ void func_80B97BF8(EnZot* this, GlobalContext* globalCtx) {
} else {
textId = 0x128B;
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B97C40(EnZot* this, GlobalContext* globalCtx) {
@@ -739,7 +726,7 @@ void func_80B97C40(EnZot* this, GlobalContext* globalCtx) {
void func_80B97CC8(EnZot* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actionFunc = func_80B97C40;
- func_801518B0(globalCtx, 0x128B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x128B, &this->actor);
} else if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && (this->actor.xzDistToPlayer < 100.0f)) {
func_800B8614(&this->actor, globalCtx, 120.0f);
}
@@ -907,7 +894,7 @@ void func_80B98178(EnZot* this, GlobalContext* globalCtx) {
}
break;
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B98348(EnZot* this, GlobalContext* globalCtx) {
@@ -937,9 +924,9 @@ void func_80B9849C(EnZot* this, GlobalContext* globalCtx) {
func_80B98348(this, globalCtx);
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
if (this->unk_2D4 == 2) {
- func_801518B0(globalCtx, 0x12AD, &this->actor);
+ Message_StartTextbox(globalCtx, 0x12AD, &this->actor);
} else {
- func_801518B0(globalCtx, 0x12B0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x12B0, &this->actor);
}
this->actionFunc = func_80B98728;
} else {
@@ -952,7 +939,7 @@ void func_80B9854C(EnZot* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
this->actionFunc = func_80B9849C;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8500(&this->actor, globalCtx, 1000.0f, 1000.0f, EXCH_ITEM_MINUS1);
} else {
Actor_PickUp(&this->actor, globalCtx, this->unk_2D4, 10000.0f, 50.0f);
@@ -1064,7 +1051,7 @@ void func_80B98728(EnZot* this, GlobalContext* globalCtx) {
default:
func_801477B4(globalCtx);
this->actionFunc = func_80B98998;
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
break;
}
}
@@ -1099,7 +1086,7 @@ void func_80B98A4C(EnZot* this, GlobalContext* globalCtx) {
textId = 0x12B1;
gSaveContext.weekEventReg[39] |= 0x40;
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B98AD0(EnZot* this, GlobalContext* globalCtx) {
@@ -1136,12 +1123,12 @@ void func_80B98AD0(EnZot* this, GlobalContext* globalCtx) {
void func_80B98BF4(EnZot* this, GlobalContext* globalCtx) {
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags &= ~0x10000;
+ this->actor.flags &= ~ACTOR_FLAG_10000;
if (gSaveContext.weekEventReg[41] & 0x20) {
- func_801518B0(globalCtx, 0x12B7, &this->actor);
+ Message_StartTextbox(globalCtx, 0x12B7, &this->actor);
this->actionFunc = func_80B98AD0;
} else {
- func_801518B0(globalCtx, 0x12B9, &this->actor);
+ Message_StartTextbox(globalCtx, 0x12B9, &this->actor);
this->actionFunc = func_80B98AD0;
}
} else {
@@ -1151,10 +1138,10 @@ void func_80B98BF4(EnZot* this, GlobalContext* globalCtx) {
void func_80B98CA8(EnZot* this, GlobalContext* globalCtx) {
if (func_800B8718(&this->actor, &globalCtx->state)) {
- globalCtx->msgCtx.unk1202A = 4;
+ globalCtx->msgCtx.ocarinaMode = 4;
func_8019B544(0xFFFF);
this->actionFunc = func_80B98BF4;
- this->actor.flags |= 0x10000;
+ this->actor.flags |= ACTOR_FLAG_10000;
func_800B8614(&this->actor, globalCtx, 120.0f);
} else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actionFunc = func_80B98AD0;
@@ -1207,7 +1194,7 @@ void func_80B98E10(EnZot* this, GlobalContext* globalCtx) {
textId = 0x12BB;
}
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B98F30(EnZot* this, GlobalContext* globalCtx) {
@@ -1277,7 +1264,7 @@ void func_80B99160(EnZot* this, GlobalContext* globalCtx) {
textId = 0x12C6;
gSaveContext.weekEventReg[40] |= 8;
}
- func_801518B0(globalCtx, textId, &this->actor);
+ Message_StartTextbox(globalCtx, textId, &this->actor);
}
void func_80B991E4(EnZot* this, GlobalContext* globalCtx) {
@@ -1397,10 +1384,10 @@ void EnZot_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
}
void EnZot_Draw(Actor* thisx, GlobalContext* globalCtx) {
- UNK_PTR sp4C[] = {
- &D_060050A0,
- &D_060058A0,
- &D_060060A0,
+ TexturePtr sp4C[] = {
+ gZoraEyeOpenTex,
+ gZoraEyeHalfTex,
+ gZoraEyeClosedTex,
};
EnZot* this = THIS;
diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.c b/src/overlays/actors/ovl_En_Zov/z_en_zov.c
index 278ffa7feb..724f074daf 100644
--- a/src/overlays/actors/ovl_En_Zov/z_en_zov.c
+++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.c
@@ -5,8 +5,10 @@
*/
#include "z_en_zov.h"
+#include "objects/object_zov/object_zov.h"
+#include "overlays/actors/ovl_En_Elf/z_en_elf.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((EnZov*)thisx)
@@ -15,6 +17,7 @@ void EnZov_Destroy(Actor* thisx, GlobalContext* globalCtx);
void EnZov_Update(Actor* thisx, GlobalContext* globalCtx);
void EnZov_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80BD1570(EnZov* this, s16 index, u8 mode);
void func_80BD187C(EnZov* this, GlobalContext* globalCtx);
void func_80BD19FC(EnZov* this, GlobalContext* globalCtx);
void func_80BD1BF0(EnZov* this, GlobalContext* globalCtx);
@@ -23,8 +26,8 @@ void func_80BD1C84(EnZov* this, GlobalContext* globalCtx);
void func_80BD1D94(EnZov* this, GlobalContext* globalCtx);
void func_80BD1DB8(EnZov* this, GlobalContext* globalCtx);
void func_80BD1F1C(EnZov* this, GlobalContext* globalCtx);
+s32 func_80BD1FC8(GlobalContext* globalCtx, EnZov* this);
-#if 0
const ActorInit En_Zov_InitVars = {
ACTOR_EN_ZOV,
ACTORCAT_NPC,
@@ -37,63 +40,594 @@ const ActorInit En_Zov_InitVars = {
(ActorFunc)EnZov_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BD26E0 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 20, 40, 0, { 0, 0, 0 } },
};
-#endif
+static AnimationHeader* D_80BD270C[] = {
+ &object_zov_Anim_00D3EC, &object_zov_Anim_008120, &object_zov_Anim_00B4CC, &object_zov_Anim_00A888,
+ &object_zov_Anim_00C510, &object_zov_Anim_00CAA8, &object_zov_Anim_008120, &object_zov_Anim_00A888,
+ &object_zov_Anim_002B5C, &object_zov_Anim_00418C, &object_zov_Anim_005A6C, &object_zov_Anim_0066A4,
+ &object_zov_Anim_0017D4, &object_zov_Anim_0023F4,
+};
-extern ColliderCylinderInit D_80BD26E0;
+static Vec3f D_80BD2744 = { 400.0f, 600.0f, 0.0f };
-extern UNK_TYPE D_0600D3EC;
+static Vec3f D_80BD2750 = { 400.0f, 600.0f, 0.0f };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/EnZov_Init.s")
+static TexturePtr D_80BD275C[] = { object_zov_Tex_013C38, object_zov_Tex_015138, object_zov_Tex_014138 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/EnZov_Destroy.s")
+static TexturePtr D_80BD2768[] = { object_zov_Tex_0135F8, object_zov_Tex_014538 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD13DC.s")
+static s8 D_80BD2770[] = {
+ 1, 2, 1, 0, 0, 1, 2, 1,
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1440.s")
+void EnZov_Init(Actor* thisx, GlobalContext* globalCtx) {
+ EnZov* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1470.s")
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ Actor_SetScale(&this->actor, 0.01f);
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_zov_Skel_016258, &object_zov_Anim_00D3EC, this->jontTable,
+ this->morphTable, 23);
+ Animation_PlayLoop(&this->skelAnime, &object_zov_Anim_00D3EC);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1570.s")
+ this->unk_320 = 0;
+ this->unk_32C = -1;
+ this->unk_326 = -1;
+ this->unk_328[0] = this->actor.cutscene;
+ this->unk_328[1] = 0x7C;
+ this->unk_322 = 0;
+ this->actionFunc = func_80BD1C84;
+ this->unk_144 = func_80BD1FC8;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD15A4.s")
+ Math_Vec3f_Copy(&this->unk_2FC, &this->actor.world.pos);
+ Math_Vec3f_Copy(&this->unk_308, &this->actor.world.pos);
+ Math_Vec3f_Copy(&this->unk_314, &this->actor.world.pos);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD160C.s")
+ switch (ENZOV_GET_F(&this->actor)) {
+ case ENZOV_F_1:
+ this->actionFunc = func_80BD1F1C;
+ func_80BD1570(this, 9, 0);
+ if (!(gSaveContext.weekEventReg[55] & 0x80)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1764.s")
+ case ENZOV_F_2:
+ this->actionFunc = func_80BD1C38;
+ this->actor.shape.shadowDraw = NULL;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD187C.s")
+ default:
+ this->unk_320 |= 2;
+ if ((gSaveContext.weekEventReg[55] & 0x80) || (gSaveContext.weekEventReg[53] & 0x20)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD19FC.s")
+void EnZov_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnZov* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1AE0.s")
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1BF0.s")
+void func_80BD13DC(EnZov* this) {
+ if (this->unk_32C != -1) {
+ if (ActorCutscene_GetCurrentIndex() == this->unk_328[this->unk_32C]) {
+ ActorCutscene_Stop(this->unk_328[this->unk_32C]);
+ }
+ this->unk_32C = -1;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1C38.s")
+void func_80BD1440(EnZov* this, s16 arg1) {
+ func_80BD13DC(this);
+ this->unk_32C = arg1;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1C84.s")
+void func_80BD1470(EnZov* this, s16 index, u8 mode, f32 transitionRate) {
+ f32 frame;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1D30.s")
+ if (((index != this->unk_322) || mode) && (index >= 0) && (index < ARRAY_COUNT(D_80BD270C))) {
+ switch (index) {
+ case 6:
+ frame = 30.0f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1D94.s")
+ case 7:
+ frame = 57.0f;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1DB8.s")
+ default:
+ frame = 0.0f;
+ break;
+ }
+ Animation_Change(&this->skelAnime, D_80BD270C[index], 1.0f, frame, Animation_GetLastFrame(D_80BD270C[index]),
+ mode, transitionRate);
+ this->unk_322 = index;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1F1C.s")
+void func_80BD1570(EnZov* this, s16 index, u8 mode) {
+ func_80BD1470(this, index, mode, 5.0f);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD1FC8.s")
+s32 func_80BD15A4(EnZov* this, GlobalContext* globalCtx) {
+ if ((this->actor.xzDistToPlayer < 100.0f) && Player_IsFacingActor(&this->actor, 0x3000, globalCtx) &&
+ Actor_IsFacingPlayer(&this->actor, 0x3000)) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/EnZov_Update.s")
+void func_80BD160C(EnZov* this, GlobalContext* globalCtx) {
+ s32 textId = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD2380.s")
+ if (gSaveContext.weekEventReg[53] & 0x20) {
+ this->unk_320 &= ~2;
+ if (gSaveContext.playerForm != PLAYER_FORM_ZORA) {
+ textId = 0x1024;
+ if ((this->unk_322 == 0) || (this->unk_322 == 4)) {
+ func_80BD1570(this, 4, 2);
+ } else {
+ func_80BD1570(this, 6, 2);
+ }
+ } else if (this->unk_320 & 4) {
+ textId = 0x1023;
+ } else {
+ textId = 0x1022;
+ this->unk_320 |= 4;
+ func_80BD1570(this, 3, 2);
+ }
+ } else if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ func_80BD1570(this, 2, 2);
+ this->actionFunc = func_80BD19FC;
+ this->unk_324 = 10;
+ func_80BD1440(this, 0);
+ } else {
+ textId = 0x1020;
+ func_80BD1570(this, 5, 2);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/func_80BD2404.s")
+ this->unk_320 |= 1;
+ if (textId != 0) {
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zov/EnZov_Draw.s")
+void func_80BD1764(EnZov* this) {
+ if (SkelAnime_Update(&this->skelAnime)) {
+ switch (this->unk_322) {
+ case 1:
+ case 6:
+ func_80BD1570(this, 6, 2);
+ break;
+
+ case 3:
+ case 7:
+ func_80BD1570(this, 7, 2);
+ break;
+
+ case 4:
+ func_80BD1570(this, 0, 0);
+ break;
+
+ case 8:
+ func_80BD1570(this, 9, 0);
+ break;
+
+ case 10:
+ func_80BD1570(this, 11, 0);
+ break;
+
+ case 12:
+ func_80BD1570(this, 13, 0);
+ break;
+
+ default:
+ func_80BD1570(this, 0, 0);
+ this->unk_320 &= ~1;
+ break;
+ }
+
+ SkelAnime_Update(&this->skelAnime);
+ }
+}
+
+void func_80BD187C(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 5:
+ if (func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x1022:
+ func_80151938(globalCtx, 0x1023);
+ break;
+
+ case 0x1023:
+ if ((this->unk_322 != 6) && (this->unk_322 != 1)) {
+ func_80BD1570(this, 1, 2);
+ }
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BD1C84;
+ break;
+
+ case 0x1024:
+ if (this->unk_322 != 6) {
+ func_80BD1570(this, 0, 0);
+ }
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BD1C84;
+ break;
+
+ default:
+ this->unk_320 &= ~1;
+ func_80BD1570(this, 0, 0);
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BD1C84;
+ break;
+ }
+ }
+ break;
+
+ case 2:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BD1C84;
+ this->unk_320 &= ~1;
+ func_80BD1570(this, 0, 0);
+ break;
+ }
+}
+
+void func_80BD19FC(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+ if (this->unk_322 == 0) {
+ if (!(this->unk_320 & 2)) {
+ this->unk_320 |= 2;
+ this->unk_2EE = 3;
+ }
+
+ if (this->unk_324 > 0) {
+ this->unk_324--;
+ } else {
+ func_80BD13DC(this);
+ Message_StartTextbox(globalCtx, 0x1021, &this->actor);
+ ((EnElf*)(GET_PLAYER(globalCtx)->tatlActor))->unk_264 |= 4;
+ Actor_ChangeFocus(&this->actor, globalCtx, GET_PLAYER(globalCtx)->tatlActor);
+ this->actionFunc = func_80BD187C;
+ }
+ } else if (Animation_OnFrame(&this->skelAnime, 10.0f)) {
+ this->unk_320 &= ~2;
+ this->unk_2EE = 3;
+ }
+}
+
+s32 func_80BD1AE0(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+
+ if (Cutscene_CheckActorAction(globalCtx, 504)) {
+ s16 action = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 504)]->action;
+
+ if (action != this->unk_326) {
+ this->unk_326 = action;
+ switch (this->unk_326) {
+ case 1:
+ func_80BD1570(this, 0, 0);
+ break;
+
+ case 2:
+ func_80BD1570(this, 8, 2);
+ this->unk_320 |= 0x10;
+ break;
+
+ case 3:
+ func_80BD1470(this, 10, 2, 0.0f);
+ break;
+
+ case 4:
+ func_80BD1570(this, 12, 2);
+ break;
+ }
+ }
+ return true;
+ }
+
+ return false;
+}
+
+void func_80BD1BF0(EnZov* this, GlobalContext* globalCtx) {
+ if (!func_80BD1AE0(this, globalCtx)) {
+ func_80BD1570(this, 0, 0);
+ this->actionFunc = func_80BD1C84;
+ }
+}
+
+void func_80BD1C38(EnZov* this, GlobalContext* globalCtx) {
+ if (func_80BD1AE0(this, globalCtx)) {
+ Cutscene_ActorTranslateAndYaw(&this->actor, globalCtx, Cutscene_GetActorActionIndex(globalCtx, 504));
+ }
+}
+
+void func_80BD1C84(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BD187C;
+ func_80BD160C(this, globalCtx);
+ } else if (func_80BD15A4(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+
+ if (Cutscene_CheckActorAction(globalCtx, 0x1F8)) {
+ this->actionFunc = func_80BD1BF0;
+ func_80BD1BF0(this, globalCtx);
+ }
+}
+
+void func_80BD1D30(EnZov* this, GlobalContext* globalCtx) {
+ u16 textId;
+
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[79] & 1) {
+ textId = 0x1032;
+ } else {
+ textId = 0x1033;
+ }
+ } else {
+ textId = 0x1031;
+ }
+ Message_StartTextbox(globalCtx, textId, &this->actor);
+}
+
+void func_80BD1D94(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+}
+
+void func_80BD1DB8(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+
+ if ((Message_GetState(&globalCtx->msgCtx) == 5) && func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x1033:
+ case 0x1034:
+ case 0x1035:
+ case 0x1036:
+ case 0x1037:
+ case 0x1038:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ case 0x1039:
+ globalCtx->nextEntranceIndex = globalCtx->setupExitList[ENZOV_GET_FE00(&this->actor)];
+ globalCtx->unk_1887F = 5;
+ globalCtx->sceneLoadFlag = 0x14;
+ gSaveContext.weekEventReg[78] |= 1;
+ this->actionFunc = func_80BD1D94;
+ globalCtx->msgCtx.unk11F10 = 0;
+ Audio_QueueSeqCmd(0x101400FF);
+ break;
+
+ default:
+ func_801477B4(globalCtx);
+ this->actionFunc = func_80BD1F1C;
+ break;
+ }
+ }
+}
+
+void func_80BD1F1C(EnZov* this, GlobalContext* globalCtx) {
+ func_80BD1764(this);
+
+ if (this->actor.home.rot.y != this->actor.shape.rot.y) {
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.home.rot.y, 2, 0x1000, 0x200);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+ }
+
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BD1DB8;
+ func_80BD1D30(this, globalCtx);
+ } else if (func_80BD15A4(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 120.0f);
+ }
+}
+
+s32 func_80BD1FC8(GlobalContext* globalCtx, EnZov* this) {
+ s32 ret;
+ s32 pad;
+
+ ret = func_8013A530(globalCtx, &this->actor, 4, &this->actor.focus.pos, &this->actor.shape.rot, 10.0f, 300.0f, -1);
+ ret |= func_8013A530(globalCtx, &this->actor, 5, &this->unk_308, &this->actor.shape.rot, 50.0f, 160.0f, 0x3000);
+ ret |= func_8013A530(globalCtx, &this->actor, 6, &this->unk_314, &this->actor.shape.rot, 50.0f, 160.0f, 0x3000);
+ return ret;
+}
+
+void EnZov_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZov* this = THIS;
+
+ Actor_MoveWithGravity(&this->actor);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 10.0f, 4);
+
+ this->actionFunc(this, globalCtx);
+
+ if (!Cutscene_CheckActorAction(globalCtx, 0x1F8)) {
+ this->unk_320 &= ~0x10;
+ }
+
+ if ((this->unk_320 & 1) && func_80BD15A4(this, globalCtx)) {
+ func_800E9250(globalCtx, &this->actor, &this->unk_2F0, &this->unk_2F6, this->actor.focus.pos);
+ } else {
+ if ((this->unk_320 & 0x10) && (this->unk_322 == 0)) {
+ Math_SmoothStepToS(&this->unk_2F0.x, -0x1B58, 6, 0x1838, 0x64);
+ } else {
+ Math_SmoothStepToS(&this->unk_2F0.x, 0, 6, 0x1838, 0x64);
+ }
+ Math_SmoothStepToS(&this->unk_2F0.y, 0, 6, 0x1838, 0x64);
+ Math_SmoothStepToS(&this->unk_2F6.x, 0, 6, 0x1838, 0x64);
+ Math_SmoothStepToS(&this->unk_2F6.y, 0, 6, 0x1838, 0x64);
+ }
+
+ if (DECR(this->unk_2EE) == 0) {
+ this->unk_2EE = Rand_S16Offset(60, 60);
+ }
+
+ this->unk_2EC = this->unk_2EE;
+ if (this->unk_2EC >= 3) {
+ this->unk_2EC = 0;
+ }
+
+ if ((this->unk_32C != -1) && (ActorCutscene_GetCurrentIndex() != this->unk_328[this->unk_32C])) {
+ if ((this->unk_32C == 0) && (ActorCutscene_GetCurrentIndex() == 0x7C)) {
+ ActorCutscene_Stop(0x7C);
+ ActorCutscene_SetIntentToPlay(this->unk_328[this->unk_32C]);
+ } else if (ActorCutscene_GetCanPlayNext(this->unk_328[this->unk_32C])) {
+ ActorCutscene_Start(this->unk_328[this->unk_32C], &this->actor);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->unk_328[this->unk_32C]);
+ }
+ }
+}
+
+s32 EnZov_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
+ EnZov* this = THIS;
+
+ if (limbIndex == 12) {
+ rot->x += this->unk_2F0.y;
+ if ((this->unk_320 & 0x10) && (this->unk_322 == 0)) {
+ rot->z += this->unk_2F0.x;
+ }
+ }
+
+ if (limbIndex == 11) {
+ rot->x += this->unk_2F6.y;
+ }
+ return false;
+}
+
+void EnZov_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ EnZov* this = THIS;
+
+ if (limbIndex == 12) {
+ Matrix_MultiplyVector3fByState(&D_80BD2744, &this->actor.focus.pos);
+ Math_Vec3f_Copy(&this->unk_2FC, &this->actor.focus.pos);
+ this->unk_2FC.y += 10.0f;
+ }
+
+ if (limbIndex == 18) {
+ Matrix_MultiplyVector3fByState(&D_80BD2750, &this->unk_308);
+ }
+
+ if (limbIndex == 13) {
+ Matrix_MultiplyVector3fByState(&D_80BD2750, &this->unk_314);
+ }
+}
+
+void EnZov_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ EnZov* this = THIS;
+ Gfx* gfx;
+ s32 curFrame;
+ s32 phi_a1;
+ u8 phi_v1;
+
+ if (1) {}
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ phi_a1 = 0;
+ curFrame = this->skelAnime.curFrame;
+ phi_v1 = this->unk_2EC;
+
+ switch (this->unk_322) {
+ case 0:
+ if ((this->unk_2EC == 0) && !(this->unk_320 & 0x10)) {
+ phi_v1 = 1;
+ }
+ break;
+
+ case 5:
+ if (this->unk_2EC == 0) {
+ phi_v1 = 1;
+ }
+ break;
+
+ case 2:
+ if (curFrame < 23) {
+ phi_v1 = 0;
+ } else if (curFrame >= 26) {
+ phi_v1 = 1;
+ } else if (curFrame == 24) {
+ phi_v1 = 0;
+ } else {
+ phi_v1 = 1;
+ }
+ break;
+
+ case 3:
+ case 7:
+ if (curFrame <= 50) {
+ if (curFrame < 43) {
+ phi_v1 = 0;
+ } else {
+ phi_v1 = D_80BD2770[(curFrame - 43) & 3];
+ }
+ }
+ phi_a1 = 1;
+ break;
+
+ case 4:
+ if ((curFrame < 14) || (curFrame >= 24)) {
+ phi_v1 = 1;
+ } else {
+ phi_v1 = D_80BD2770[4 + ((curFrame - 14) & 3)];
+ }
+ phi_a1 = 1;
+ break;
+
+ case 8:
+ phi_v1 = 0;
+ break;
+
+ case 9:
+ phi_v1 = 0;
+ phi_a1 = 1;
+ break;
+ }
+
+ gfx = POLY_OPA_DISP;
+ gSPSegment(&gfx[0], 0x09, Lib_SegmentedToVirtual(D_80BD275C[phi_v1]));
+ gSPSegment(&gfx[1], 0x08, Lib_SegmentedToVirtual(D_80BD2768[phi_a1]));
+ POLY_OPA_DISP = &gfx[2];
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
+ EnZov_OverrideLimbDraw, EnZov_PostLimbDraw, &this->actor);
+}
diff --git a/src/overlays/actors/ovl_En_Zov/z_en_zov.h b/src/overlays/actors/ovl_En_Zov/z_en_zov.h
index 2a46505442..ce1cc9d0f3 100644
--- a/src/overlays/actors/ovl_En_Zov/z_en_zov.h
+++ b/src/overlays/actors/ovl_En_Zov/z_en_zov.h
@@ -6,10 +6,34 @@
struct EnZov;
typedef void (*EnZovActionFunc)(struct EnZov*, GlobalContext*);
+typedef s32 (*EnZovUnkFunc)(GlobalContext*, struct EnZov*);
+
+#define ENZOV_GET_F(thisx) ((thisx)->params & 0xF)
+#define ENZOV_GET_FE00(thisx) (((thisx)->params & 0xFE00) >> 9)
+
+#define ENZOV_F_1 1
+#define ENZOV_F_2 2
typedef struct EnZov {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x1EC];
+ /* 0x0144 */ EnZovUnkFunc unk_144;
+ /* 0x0148 */ Vec3s jontTable[23];
+ /* 0x01D2 */ Vec3s morphTable[23];
+ /* 0x025C */ SkelAnime skelAnime;
+ /* 0x02A0 */ ColliderCylinder collider;
+ /* 0x02EC */ s16 unk_2EC;
+ /* 0x02EE */ s16 unk_2EE;
+ /* 0x02F0 */ Vec3s unk_2F0;
+ /* 0x02F6 */ Vec3s unk_2F6;
+ /* 0x02FC */ Vec3f unk_2FC;
+ /* 0x0308 */ Vec3f unk_308;
+ /* 0x0314 */ Vec3f unk_314;
+ /* 0x0320 */ u16 unk_320;
+ /* 0x0322 */ s16 unk_322;
+ /* 0x0324 */ s16 unk_324;
+ /* 0x0326 */ s16 unk_326;
+ /* 0x0328 */ s16 unk_328[2];
+ /* 0x032C */ s16 unk_32C;
/* 0x0330 */ EnZovActionFunc actionFunc;
} EnZov; // size = 0x334
diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.c b/src/overlays/actors/ovl_En_Zow/z_en_zow.c
index 2147bc5f4b..cf4e03e54d 100644
--- a/src/overlays/actors/ovl_En_Zow/z_en_zow.c
+++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.c
@@ -5,8 +5,9 @@
*/
#include "z_en_zow.h"
+#include "objects/object_zo/object_zo.h"
-#define FLAGS 0x00000019
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10)
#define THIS ((EnZow*)thisx)
@@ -21,7 +22,6 @@ void func_80BDD634(EnZow* this, GlobalContext* globalCtx);
void func_80BDD6BC(EnZow* this, GlobalContext* globalCtx);
void func_80BDD79C(EnZow* this, GlobalContext* globalCtx);
-#if 0
const ActorInit En_Zow_InitVars = {
ACTOR_EN_ZOW,
ACTORCAT_NPC,
@@ -34,72 +34,617 @@ const ActorInit En_Zow_InitVars = {
(ActorFunc)EnZow_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80BDDCF0 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_ENEMY, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_ENEMY,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_1,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 30, 40, 0, { 0, 0, 0 } },
};
-#endif
+Vec3f D_80BDDD1C = { 0.0f, 1.0f, 0.0f };
-extern ColliderCylinderInit D_80BDDCF0;
+Vec3f D_80BDDD28 = { 0.0f, -1.0f, 0.0f };
-extern UNK_TYPE D_06002A50;
-extern UNK_TYPE D_06002C10;
-extern UNK_TYPE D_06004248;
-extern UNK_TYPE D_0600D288;
+void func_80BDC270(EnZowStruct* ptr, Vec3f* arg1, f32 arg2, f32 arg3, u8 arg4) {
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC270.s")
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 == 0) {
+ ptr->unk_00 = 1;
+ ptr->unk_14 = *arg1;
+ ptr->unk_04 = arg2;
+ ptr->unk_08 = arg3;
+ ptr->unk_0F = arg4;
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC2D8.s")
+void func_80BDC2D8(EnZow* this, EnZowStruct* ptr, Vec3f* arg2) {
+ s16 i;
+ f32 temp;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC3C0.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++, ptr++) {
+ if (ptr->unk_00 == 0) {
+ temp = this->actor.world.pos.y + this->actor.depthInWater;
+ if (temp <= arg2->y) {
+ continue;
+ }
+ ptr->unk_00 = 3;
+ ptr->unk_14 = *arg2;
+ ptr->unk_20 = *arg2;
+ ptr->unk_2C = D_80BDDD1C;
+ ptr->unk_04 = ((Rand_ZeroOne() - 0.5f) * 0.02f) + 0.12f;
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC50C.s")
+void func_80BDC3C0(EnZowStruct* ptr, Vec3f* arg1, Vec3f* arg2, f32 arg3) {
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC5C8.s")
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 != 2) {
+ ptr->unk_00 = 2;
+ ptr->unk_14 = *arg1;
+ ptr->unk_20 = D_80BDDD28;
+ ptr->unk_2C = *arg2;
+ ptr->unk_0F = (Rand_ZeroOne() * 100.0f) + 100.0f;
+ ptr->unk_04 = arg3;
+ break;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC6F8.s")
+void func_80BDC50C(EnZowStruct* ptr) {
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC830.s")
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 == 1) {
+ Math_ApproachF(&ptr->unk_04, ptr->unk_08, 0.2f, 0.8f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDC9DC.s")
+ if (ptr->unk_0F > 20) {
+ ptr->unk_0F -= 20;
+ } else {
+ ptr->unk_0F = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDCB84.s")
+ if (ptr->unk_0F == 0) {
+ ptr->unk_00 = 0;
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDCD38.s")
+void func_80BDC5C8(EnZow* this, EnZowStruct* ptr) {
+ f32 temp_f2;
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDCDA8.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++, ptr++) {
+ if (ptr->unk_00 == 3) {
+ ptr->unk_14.x = ((Rand_ZeroOne() * 0.5f) - 0.25f) + ptr->unk_20.x;
+ ptr->unk_14.z = ((Rand_ZeroOne() * 0.5f) - 0.25f) + ptr->unk_20.z;
+ ptr->unk_14.y += ptr->unk_2C.y;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/EnZow_Init.s")
+ temp_f2 = this->actor.world.pos.y + this->actor.depthInWater;
+ if (temp_f2 <= ptr->unk_14.y) {
+ ptr->unk_00 = 0;
+ ptr->unk_14.y = temp_f2;
+ func_80BDC270(ptr, &ptr->unk_14, 0.06f, 0.12f, 200);
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/EnZow_Destroy.s")
+void func_80BDC6F8(EnZow* this, EnZowStruct* ptr) {
+ s16 i;
+ f32 temp_f0_2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD04C.s")
+ for (i = 0; i < ARRAY_COUNT(this->unk_2D0); i++, ptr++) {
+ if (ptr->unk_00 == 2) {
+ ptr->unk_14.x += ptr->unk_2C.x;
+ ptr->unk_14.y += ptr->unk_2C.y;
+ ptr->unk_14.z += ptr->unk_2C.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD154.s")
+ if (ptr->unk_2C.y >= -20.0f) {
+ ptr->unk_2C.y += ptr->unk_20.y;
+ } else {
+ ptr->unk_2C.y = -20.0f;
+ ptr->unk_20.y = 0.0f;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD1E0.s")
+ temp_f0_2 = this->actor.world.pos.y + this->actor.depthInWater;
+ if (ptr->unk_14.y < temp_f0_2) {
+ ptr->unk_00 = 0;
+ ptr->unk_14.y = temp_f0_2;
+ func_80BDC270(ptr, &ptr->unk_14, 0.06f, 0.12f, 200);
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD350.s")
+void func_80BDC830(EnZowStruct* ptr, GlobalContext* globalCtx) {
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD490.s")
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ u8 flag = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD570.s")
+ func_8012C2DC(globalCtx->state.gfxCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD634.s")
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 == 1) {
+ if (!flag) {
+ gDPPipeSync(POLY_XLU_DISP++);
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_00D220);
+ gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0);
+ if (1) {}
+ flag = true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD6BC.s")
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, ptr->unk_0F);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDD79C.s")
+ Matrix_InsertTranslation(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
+ Matrix_Scale(ptr->unk_04, 1.0f, ptr->unk_04, MTXMODE_APPLY);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/EnZow_Update.s")
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_00D288);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDDA7C.s")
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDDAA0.s")
+void func_80BDC9DC(EnZowStruct* ptr, GlobalContext* globalCtx) {
+ s16 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/func_80BDDAE0.s")
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ u8 flag = false;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_En_Zow/EnZow_Draw.s")
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 == 3) {
+ if (!flag) {
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_0029F0);
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 150, 150, 150, 0);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
+ if (1) {}
+ flag = true;
+ }
+
+ Matrix_InsertTranslation(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+ Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_002A50);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80BDCB84(EnZowStruct* ptr, GlobalContext* globalCtx) {
+ s16 i;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+ u8 flag = false;
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ for (i = 0; i < 15; i++, ptr++) {
+ if (ptr->unk_00 == 2) {
+ if (!flag) {
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_002BA0);
+ gDPPipeSync(POLY_XLU_DISP++);
+ gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 0);
+ if (1) {}
+ flag = true;
+ }
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 180, 180, 180, ptr->unk_0F);
+
+ Matrix_InsertTranslation(ptr->unk_14.x, ptr->unk_14.y, ptr->unk_14.z, MTXMODE_NEW);
+ Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
+ Matrix_Scale(ptr->unk_04, ptr->unk_04, 1.0f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_zo_DL_002C10);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80BDCD38(EnZow* this, EnZowStruct* ptr, f32 arg2, f32 arg3, u8 arg4) {
+ static Vec3f D_80BDDD34 = { 0.0f, 0.0f, 0.0f };
+
+ D_80BDDD34.x = this->actor.world.pos.x;
+ D_80BDDD34.y = this->actor.world.pos.y + this->actor.depthInWater;
+ D_80BDDD34.z = this->actor.world.pos.z;
+ func_80BDC270(ptr, &D_80BDDD34, arg2, arg3, arg4);
+}
+
+void func_80BDCDA8(EnZow* this, EnZowStruct* ptr) {
+ Vec3f sp84;
+ Vec3f sp78;
+ f32 temp_f20;
+ f32 temp_f22;
+ s32 i;
+
+ for (i = 0; i < 10; i++) {
+ temp_f20 = (Rand_ZeroOne() * 1.5f) + 0.5f;
+ temp_f22 = Rand_ZeroOne() * 6.28f;
+
+ sp78.y = (Rand_ZeroOne() * 3.0f) + 3.0f;
+ sp78.x = __sinf(temp_f22) * temp_f20;
+ sp78.z = __cosf(temp_f22) * temp_f20;
+
+ sp84 = this->actor.world.pos;
+ sp84.x += sp78.x * 6.0f;
+ sp84.z += sp78.z * 6.0f;
+ sp84.y += this->actor.depthInWater;
+
+ func_80BDC3C0(ptr, &sp84, &sp78, 0.08f);
+ }
+}
+
+void EnZow_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZow* this = THIS;
+
+ ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
+ Actor_SetScale(&this->actor, 0.01f);
+ this->actionFunc = func_80BDD79C;
+ SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gZoraSkel, &gZoraIdleAnim, this->jointTable, this->morphTable, 20);
+ Animation_PlayOnce(&this->skelAnime, &gZoraSurfacingAnim);
+ this->unk_2C8 = 1;
+ Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
+ this->actor.shape.rot.z = 0;
+ this->unk_2CA = 0;
+ this->unk_2CC = 0;
+ this->unk_2CE = 0;
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->actor.textId = 0;
+ this->actor.world.rot.z = this->actor.shape.rot.z;
+ this->actor.flags &= ~ACTOR_FLAG_1;
+}
+
+void EnZow_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ EnZow* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+static AnimationHeader* sAnimations[] = { &object_zo_Anim_004168, &gZoraSurfacingAnim, &gZoraSurfacingAnim };
+
+void func_80BDD04C(EnZow* this, s16 arg1, u8 arg2) {
+ if ((arg1 >= 0) && (arg1 < 3)) {
+ if (arg1 < 2) {
+ Animation_Change(&this->skelAnime, sAnimations[arg1], 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[arg1]),
+ arg2, -5.0f);
+ } else {
+ Animation_Change(&this->skelAnime, sAnimations[arg1], -1.0f, Animation_GetLastFrame(sAnimations[arg1]),
+ 0.0f, arg2, 0.0f);
+ }
+ this->unk_2C8 = arg1;
+ }
+}
+
+s32 func_80BDD154(EnZow* this, GlobalContext* globalCtx) {
+ if (Player_IsFacingActor(&this->actor, 0x3000, globalCtx) && Actor_IsFacingPlayer(&this->actor, 0x3000) &&
+ (this->actor.xzDistToPlayer < 170.0f) && (fabsf(this->actor.playerHeightRel) < 100.0f)) {
+ return true;
+ }
+ return false;
+}
+
+void func_80BDD1E0(EnZow* this, GlobalContext* globalCtx) {
+ u16 phi_a1;
+
+ if (ENZOW_GET_F(&this->actor) == ENZOW_F_1) {
+ if (gSaveContext.weekEventReg[55] & 0x80) {
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[78] & 4) {
+ phi_a1 = 0x12FD;
+ } else {
+ phi_a1 = 0x12FA;
+ gSaveContext.weekEventReg[78] |= 4;
+ }
+ } else if (gSaveContext.weekEventReg[78] & 0x10) {
+ phi_a1 = 0x1301;
+ } else {
+ gSaveContext.weekEventReg[78] |= 0x10;
+ phi_a1 = 0x12FF;
+ }
+ } else if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[78] & 8) {
+ phi_a1 = 0x12F8;
+ } else {
+ phi_a1 = 0x12F3;
+ gSaveContext.weekEventReg[78] |= 8;
+ }
+ } else if (gSaveContext.weekEventReg[78] & 0x10) {
+ phi_a1 = 0x1301;
+ } else {
+ gSaveContext.weekEventReg[78] |= 0x10;
+ phi_a1 = 0x12FF;
+ }
+ } else if (gSaveContext.weekEventReg[55] & 0x80) {
+ if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ phi_a1 = 0x12EC;
+ } else {
+ phi_a1 = 0x12F1;
+ }
+ } else if (gSaveContext.playerForm == PLAYER_FORM_ZORA) {
+ if (gSaveContext.weekEventReg[78] & 2) {
+ phi_a1 = 0x12EB;
+ } else {
+ phi_a1 = 0x12E8;
+ gSaveContext.weekEventReg[78] |= 2;
+ }
+ } else {
+ phi_a1 = 0x12EF;
+ }
+ Message_StartTextbox(globalCtx, phi_a1, &this->actor);
+}
+
+void func_80BDD350(EnZow* this, GlobalContext* globalCtx) {
+ if (this->unk_2CA & 2) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_DIVE_WATER);
+ func_80BDCDA8(this, this->unk_2D0);
+ this->actor.flags &= ~ACTOR_FLAG_1;
+ this->skelAnime.playSpeed = 0.0f;
+ this->actor.velocity.y = -4.0f;
+ }
+
+ if (this->actor.depthInWater > 120.0f) {
+ Math_ApproachF(&this->actor.velocity.y, 0.0f, 0.4f, 0.6f);
+ if (this->actor.velocity.y > -0.1f) {
+ this->actor.velocity.y = 0.0f;
+ this->actionFunc = func_80BDD79C;
+ }
+ }
+
+ if ((this->actor.bgCheckFlags & 1) || (this->actor.depthInWater > 180.0f)) {
+ this->actor.velocity.y = 0.0f;
+ this->actionFunc = func_80BDD79C;
+ }
+
+ if (this->skelAnime.playSpeed <= 0.0f) {
+ if (this->unk_2CE >= 6) {
+ this->unk_2CE -= 5;
+ return;
+ } else {
+ this->unk_2CE = 0;
+ }
+ }
+}
+
+void func_80BDD490(EnZow* this, GlobalContext* globalCtx) {
+ this->actor.velocity.y = 0.0f;
+ if (this->actor.xzDistToPlayer > 440.0f) {
+ this->actionFunc = func_80BDD350;
+ func_80BDD04C(this, 2, 2);
+ } else if (this->unk_2CA & 2) {
+ func_80BDD04C(this, 0, 0);
+ }
+
+ if ((globalCtx->gameplayFrames & 7) == 0) {
+ func_80BDCD38(this, this->unk_2D0, 0.2f, 1.0f, 200);
+ }
+
+ if (this->unk_2CE < 245) {
+ this->unk_2CE += 10;
+ } else {
+ this->unk_2CE = 255;
+ }
+}
+
+void func_80BDD570(EnZow* this, GlobalContext* globalCtx) {
+ func_80BDD490(this, globalCtx);
+
+ switch (Message_GetState(&globalCtx->msgCtx)) {
+ case 5:
+ if (func_80147624(globalCtx)) {
+ switch (globalCtx->msgCtx.unk11F04) {
+ case 0x12E8:
+ case 0x12E9:
+ case 0x12EC:
+ case 0x12ED:
+ case 0x12EF:
+ case 0x12F1:
+ case 0x12F3:
+ case 0x12F4:
+ case 0x12F5:
+ case 0x12F6:
+ case 0x12F8:
+ case 0x12FA:
+ case 0x12FB:
+ case 0x12FD:
+ case 0x12FF:
+ func_80151938(globalCtx, globalCtx->msgCtx.unk11F04 + 1);
+ break;
+
+ default:
+ func_801477B4(globalCtx);
+ break;
+ }
+ }
+ break;
+
+ case 2:
+ this->actionFunc = func_80BDD634;
+ break;
+ }
+}
+
+void func_80BDD634(EnZow* this, GlobalContext* globalCtx) {
+ func_80BDD490(this, globalCtx);
+ if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
+ this->actionFunc = func_80BDD570;
+ func_80BDD1E0(this, globalCtx);
+ } else if (func_80BDD154(this, globalCtx)) {
+ func_800B8614(&this->actor, globalCtx, 180.0f);
+ }
+}
+
+void func_80BDD6BC(EnZow* this, GlobalContext* globalCtx) {
+ if (this->unk_2CE < 245) {
+ this->unk_2CE += 10;
+ } else {
+ this->unk_2CE = 255;
+ }
+
+ if (this->actor.depthInWater < 54.0f) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OUT_OF_WATER);
+ func_80BDCDA8(this, this->unk_2D0);
+ func_80BDD04C(this, 1, 2);
+ this->actor.flags |= ACTOR_FLAG_1;
+ this->actor.velocity.y = 0.0f;
+ this->actionFunc = func_80BDD634;
+ } else if (this->actor.depthInWater < 80.0f) {
+ Math_ApproachF(&this->actor.velocity.y, 2.0f, 0.4f, 0.6f);
+ }
+}
+
+void func_80BDD79C(EnZow* this, GlobalContext* globalCtx) {
+ if (this->actor.xzDistToPlayer < 400.0f) {
+ this->actor.velocity.y = 4.0f;
+ this->actionFunc = func_80BDD6BC;
+ }
+
+ if (this->unk_2CE >= 6) {
+ this->unk_2CE -= 5;
+ } else {
+ this->unk_2CE = 0;
+ }
+
+ if (this->actor.depthInWater > 180.0f) {
+ this->actor.world.pos.y = this->actor.world.pos.y + -180.0f + this->actor.depthInWater;
+ }
+}
+
+void EnZow_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ EnZow* this = THIS;
+ Vec3f sp34;
+
+ Actor_MoveWithGravity(&this->actor);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 30.0f, 15.0f, 30.0f, 5);
+
+ if (this->unk_2CE != 0) {
+ this->unk_2CA &= ~2;
+ if (SkelAnime_Update(&this->skelAnime)) {
+ this->unk_2CA |= 2;
+ }
+ } else {
+ this->unk_2CA |= 2;
+ }
+
+ Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 2, 0x800, 0x100);
+ this->actor.world.rot.y = this->actor.shape.rot.y;
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_2CE != 0) {
+ if ((globalCtx->state.frames & 8) != 0) {
+ sp34 = this->actor.world.pos;
+ sp34.y += ((Rand_ZeroOne() - 0.5f) * 10.0f) + 18.0f;
+ sp34.x += (Rand_ZeroOne() - 0.5f) * 28.0f;
+ sp34.z += (Rand_ZeroOne() - 0.5f) * 28.0f;
+ func_80BDC2D8(this, this->unk_2D0, &sp34);
+ }
+
+ if (DECR(this->unk_2C6) == 0) {
+ this->unk_2C6 = Rand_S16Offset(60, 60);
+ }
+
+ this->unk_2C4 = this->unk_2C6;
+ if (this->unk_2C4 >= 3) {
+ this->unk_2C4 = 0;
+ }
+ }
+
+ this->actor.shape.shadowAlpha = this->unk_2CE;
+ func_80BDC50C(this->unk_2D0);
+ func_80BDC5C8(this, this->unk_2D0);
+ func_80BDC6F8(this, this->unk_2D0);
+}
+
+Gfx* func_80BDDA7C(GraphicsContext* gfxCtx) {
+ Gfx* gfx = GRAPH_ALLOC(gfxCtx, sizeof(Gfx) * 2);
+
+ gSPEndDisplayList(gfx);
+
+ return gfx;
+}
+
+Vec3f D_80BDDD4C = { 400.0f, 0.0f, 0.0f };
+
+void func_80BDDAA0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
+ if (limbIndex == 15) {
+ Matrix_MultiplyVector3fByState(&D_80BDDD4C, &thisx->focus.pos);
+ }
+}
+
+void func_80BDDAE0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
+ func_80BDDAA0(globalCtx, limbIndex, dList, rot, thisx);
+}
+
+void EnZow_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ TexturePtr sp54[] = {
+ gZoraEyeOpenTex,
+ gZoraEyeHalfTex,
+ gZoraEyeClosedTex,
+ };
+ EnZow* this = THIS;
+
+ Matrix_StatePush();
+
+ func_80BDC830(this->unk_2D0, globalCtx);
+ func_80BDC9DC(this->unk_2D0, globalCtx);
+ func_80BDCB84(this->unk_2D0, globalCtx);
+
+ Matrix_StatePop();
+
+ if (this->unk_2CE != 0) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->unk_2CE >= 255) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
+ gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sp54[this->unk_2C4]));
+ gSPSegment(POLY_OPA_DISP++, 0x0C, func_80BDDA7C(globalCtx->state.gfxCtx));
+
+ SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
+ this->skelAnime.dListCount, NULL, func_80BDDAA0, &this->actor);
+ } else {
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sp54[this->unk_2C4]));
+
+ func_800BDAA0(globalCtx, &this->skelAnime, NULL, func_80BDDAE0, &this->actor, this->unk_2CE);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_En_Zow/z_en_zow.h b/src/overlays/actors/ovl_En_Zow/z_en_zow.h
index 976e4e29ba..e169e28160 100644
--- a/src/overlays/actors/ovl_En_Zow/z_en_zow.h
+++ b/src/overlays/actors/ovl_En_Zow/z_en_zow.h
@@ -7,9 +7,35 @@ struct EnZow;
typedef void (*EnZowActionFunc)(struct EnZow*, GlobalContext*);
+#define ENZOW_GET_F(thisx) ((thisx)->params & 0xF)
+
+#define ENZOW_F_1 1
+
+typedef struct {
+ /* 0x00 */ u8 unk_00;
+ /* 0x04 */ f32 unk_04;
+ /* 0x08 */ f32 unk_08;
+ /* 0x0C */ UNK_TYPE1 unk_0C[0x3];
+ /* 0x0F */ u8 unk_0F;
+ /* 0x10 */ UNK_TYPE1 unk_10[0x4];
+ /* 0x14 */ Vec3f unk_14;
+ /* 0x20 */ Vec3f unk_20;
+ /* 0x2C */ Vec3f unk_2C;
+} EnZowStruct; // size = 0x38
+
typedef struct EnZow {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x4D4];
+ /* 0x0144 */ SkelAnime skelAnime;
+ /* 0x0188 */ ColliderCylinder collider;
+ /* 0x01D4 */ Vec3s jointTable[20];
+ /* 0x024C */ Vec3s morphTable[20];
+ /* 0x02C4 */ s16 unk_2C4;
+ /* 0x02C6 */ s16 unk_2C6;
+ /* 0x02C8 */ s16 unk_2C8;
+ /* 0x02CA */ u16 unk_2CA;
+ /* 0x02CC */ s16 unk_2CC;
+ /* 0x02CE */ s16 unk_2CE;
+ /* 0x02D0 */ EnZowStruct unk_2D0[15];
/* 0x0618 */ EnZowActionFunc actionFunc;
} EnZow; // size = 0x61C
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 519d87e7fb..d02bb91da9 100644
--- a/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c
+++ b/src/overlays/actors/ovl_Item_B_Heart/z_item_b_heart.c
@@ -5,6 +5,7 @@
*/
#include "z_item_b_heart.h"
+#include "objects/object_gi_hearts/object_gi_hearts.h"
#define FLAGS 0x00000000
@@ -36,9 +37,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_STOP),
};
-extern Gfx D_06001290[];
-extern Gfx D_06001470[];
-
void ItemBHeart_Init(Actor* thisx, GlobalContext* globalCtx) {
ItemBHeart* this = THIS;
@@ -103,13 +101,13 @@ void ItemBHeart_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (flag || thisx->world.rot.y != 0) {
func_8012C2DC(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06001290);
- gSPDisplayList(POLY_XLU_DISP++, D_06001470);
+ gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001290);
+ gSPDisplayList(POLY_XLU_DISP++, object_gi_hearts_DL_001470);
} else {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06001290);
- gSPDisplayList(POLY_OPA_DISP++, D_06001470);
+ gSPDisplayList(POLY_OPA_DISP++, object_gi_hearts_DL_001290);
+ gSPDisplayList(POLY_OPA_DISP++, object_gi_hearts_DL_001470);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
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 c5c0c16ead..82b29e716a 100644
--- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c
+++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c
@@ -6,7 +6,7 @@
#include "z_item_etcetera.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ItemEtcetera*)thisx)
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 a006270f35..7017dfcec3 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 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((ItemInbox*)thisx)
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 7d0068a52b..18aafc07ad 100644
--- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c
+++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c
@@ -2,11 +2,13 @@
* File: z_mir_ray.c
* Overlay: ovl_Mir_Ray
* Description: Reflectible light ray (unused, somewhat broken)
+ * Note: This actor is unchanged from OoT, and will not work correctly
*/
#include "z_mir_ray.h"
+#include "objects/object_mir_ray/object_mir_ray.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((MirRay*)thisx)
@@ -15,7 +17,30 @@ void MirRay_Destroy(Actor* thisx, GlobalContext* globalCtx);
void MirRay_Update(Actor* thisx, GlobalContext* globalCtx);
void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+s32 MirRay_CheckInFrustum(Vec3f* vecA, Vec3f* vecB, f32 pointx, f32 pointy, f32 pointz, s16 radiusA, s16 radiusB);
+
+typedef struct {
+ /* 0x00 */ Vec3f pos;
+ /* 0x0C */ MtxF mtx;
+ /* 0x4C */ CollisionPoly* reflectionPoly;
+ /* 0x50 */ u8 opacity;
+} MirRayShieldReflection; // size = 0x54
+
+typedef struct {
+ /* 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
+ /* 0x0E */ s16 poolEndRadius; // Radius of beam frustum at the pool end
+ /* 0x10 */ f32 unk_10; // placement of collider center along beam
+ /* 0x14 */ s16 unk_14; // collider radius before scaled
+ /* 0x16 */ s16 lgtPtMaxRad; // light point max radius
+ /* 0x18 */ f32 unk_18; // placement of light point between source and reflection point (pool point for windows,
+ // player for mirrors)
+ /* 0x1C */ Color_RGB8 color;
+ /* 0x1F */ u8 params;
+} MirRayDataEntry; // size = 0x20
+
const ActorInit Mir_Ray_InitVars = {
ACTOR_MIR_RAY,
ACTORCAT_ITEMACTION,
@@ -28,64 +53,669 @@ const ActorInit Mir_Ray_InitVars = {
(ActorFunc)MirRay_Draw,
};
-// static ColliderQuadInit sQuadInit = {
-static ColliderQuadInit D_808E3BF4 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_QUAD, },
- { ELEMTYPE_UNK0, { 0x00200000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, },
+u8 D_808E3BF0 = false;
+
+static ColliderQuadInit sQuadInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_PLAYER,
+ AC_NONE,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_QUAD,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00200000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_808E3C44[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
- { ELEMTYPE_UNK0, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_NONE, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00200000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_NONE,
+ },
{ 0, { { 0, 0, 0 }, 50 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_808E3C68 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_PLAYER, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_JNTSPH, },
- 1, D_808E3C44, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_PLAYER,
+ AC_NONE,
+ OC1_NONE,
+ OC2_NONE,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_808E3DB8[] = {
+// Note: this data is unchanged from OoT and hardcoded for Spirit Temple, so the actor will not work at all without
+// modification.
+
+MirRayDataEntry sMirRayData[] = {
+ {
+ { -0x488, 0x2AE, -0x370 },
+ { -0x398, 0x1E0, -0x379 },
+ 30,
+ 50,
+ 1.0f,
+ 50,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 2,
+ },
+ {
+ { -0x740, 0x444, -0xBE },
+ { -0x6A7, 0x349, -0xBA },
+ 30,
+ 70,
+ 0.88f,
+ 0x36,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 2,
+ },
+ {
+ { 0x557, 0x2E2, -0x35C },
+ { 0x443, 0x1DC, -0x35C },
+ 30,
+ 0x55,
+ 0.0f,
+ 0,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 0,
+ },
+ {
+ { 0x898, 0x44F, -0xDC },
+ { 0x7F8, 0x34B, -0xDC },
+ 30,
+ 60,
+ 0.0f,
+ 0,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 1,
+ },
+ {
+ { -0x230, 0x879, -0x136 },
+ { -0x230, 0x6CF, -0x136 },
+ 30,
+ 70,
+ 0.0f,
+ 0,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 0,
+ },
+ {
+ { 0x3C, 0x70A, -0x442 },
+ { 0x3C, 0x3CD, -0x442 },
+ 30,
+ 70,
+ 0.0f,
+ 0,
+ 150,
+ 0.9f,
+ { 255, 255, 255 },
+ 13,
+ },
+ {
+ { 0x474, 0x1E0, -0x35C },
+ { 0x474, 0x1E0, -0x35C },
+ 30,
+ 30,
+ 1.0f,
+ 10,
+ 100,
+ 0.9f,
+ { 255, 255, 255 },
+ 14,
+ },
+ {
+ { -0x230, 0x6CF, -0x136 },
+ {
+ -0x230,
+ 0x6CF,
+ -0x136,
+ },
+ 30,
+ 30,
+ 0.0f,
+ 0,
+ 100,
+ 0.94f,
+ { 255, 255, 255 },
+ 12,
+ },
+ {
+ { 0x3C, 0x6CF, -0x136 },
+ { 0x3C, 0x6CF, -0x136 },
+ 30,
+ 30,
+ 0.0f,
+ 0,
+ 100,
+ 0.94f,
+ { 255, 255, 255 },
+ 12,
+ },
+ {
+ { -0x496, 0x1C0, 0x4AA },
+ { -0x496, 0x94, 0x4AA },
+ 50,
+ 100,
+ 1.0f,
+ 50,
+ 150,
+ 0.8f,
+ { 255, 255, 255 },
+ 3,
+ },
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 0, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP),
};
+const char D_808E3DD0[] = "反射光 発生失敗";
+
+void MirRay_SetupCollider(MirRay* this) {
+ MirRayDataEntry* dataEntry = &sMirRayData[MIRRAY_LOCATION(&this->actor)];
+ f32 x = (this->poolPt.x - this->sourcePt.x) * dataEntry->unk_10;
+ f32 y = (this->poolPt.y - this->sourcePt.y) * dataEntry->unk_10;
+ f32 z = (this->poolPt.z - this->sourcePt.z) * dataEntry->unk_10;
+
+ this->collider1.elements[0].dim.worldSphere.center.x = this->sourcePt.x + x;
+ this->collider1.elements[0].dim.worldSphere.center.y = this->sourcePt.y + y;
+ this->collider1.elements[0].dim.worldSphere.center.z = this->sourcePt.z + z;
+
+ this->collider1.elements[0].dim.worldSphere.radius = dataEntry->unk_14 * this->collider1.elements->dim.scale;
+}
+
+// Set up a light point between source point and reflection point. Reflection point is the pool point (for windows) or
+// at the player position (for mirrors)
+void MirRay_MakeShieldLight(MirRay* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ MirRayDataEntry* dataEntry = &sMirRayData[MIRRAY_LOCATION(&this->actor)];
+ Vec3f reflectionPt;
+ Vec3s lightPt;
+
+ if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, player->actor.world.pos.x,
+ player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad,
+ this->poolEndRad)) {
+ if (dataEntry->params & 8) {
+ Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt);
+ } else {
+ Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt);
+ }
+
+ lightPt.x = (dataEntry->unk_18 * reflectionPt.x) + this->sourcePt.x;
+ lightPt.y = (dataEntry->unk_18 * reflectionPt.y) + this->sourcePt.y;
+ lightPt.z = (dataEntry->unk_18 * reflectionPt.z) + this->sourcePt.z;
+
+ // Fade up
+ Math_StepToS(&this->lightPointRad, dataEntry->lgtPtMaxRad, 6);
+ Lights_PointNoGlowSetInfo(&this->lightInfo, lightPt.x, lightPt.y, lightPt.z, dataEntry->color.r,
+ dataEntry->color.g, dataEntry->color.b, this->lightPointRad);
+ } else {
+ // Fade down
+ Math_StepToS(&this->lightPointRad, 0, 6);
+ Lights_PointSetColorAndRadius(&this->lightInfo, dataEntry->color.r, dataEntry->color.g, dataEntry->color.b,
+ this->lightPointRad);
+ }
+}
+
+void MirRay_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ MirRay* this = THIS;
+ MirRayDataEntry* dataEntry = &sMirRayData[MIRRAY_LOCATION(&this->actor)];
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
+
+ if (MIRRAY_LOCATION(&this->actor) >= MIRRAY_MAX) {
+ Actor_MarkForDeath(&this->actor);
+ }
+
+ this->sourcePt.x = dataEntry->sourcePoint.x;
+ this->sourcePt.y = dataEntry->sourcePoint.y;
+ this->sourcePt.z = dataEntry->sourcePoint.z;
+ this->sourceEndRad = dataEntry->sourceEndRadius;
+
+ this->poolPt.x = dataEntry->poolPoint.x;
+ this->poolPt.y = dataEntry->poolPoint.y;
+ this->poolPt.z = dataEntry->poolPoint.z;
+ this->poolEndRad = dataEntry->poolEndRadius;
+
+ Lights_PointNoGlowSetInfo(&this->lightInfo, this->sourcePt.x, this->sourcePt.y, this->sourcePt.z, 255, 255, 255,
+ 100);
+ this->lightNode = LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, &this->lightInfo);
+
+ this->shieldCorners[0].x = -536.0f;
+ this->shieldCorners[0].y = -939.0f;
+
+ this->shieldCorners[1].x = -1690.0f;
+ this->shieldCorners[1].y = 0.0f;
+
+ this->shieldCorners[2].x = -536.0f;
+ this->shieldCorners[2].y = 938.0f;
+
+ this->shieldCorners[3].x = 921.0f;
+ this->shieldCorners[3].y = 0.0f;
+
+ this->shieldCorners[4].x = 758.0f;
+ this->shieldCorners[4].y = 800.0f;
+
+ this->shieldCorners[5].x = 758.0f;
+ this->shieldCorners[5].y = -800.0f;
+
+ if (dataEntry->params & 2) {
+ Collider_InitJntSph(globalCtx, &this->collider1);
+ Collider_SetJntSph(globalCtx, &this->collider1, &this->actor, &sJntSphInit, this->collider1Elements);
+ if (!(dataEntry->params & 4)) { // Beams not from mirrors
+ MirRay_SetupCollider(this);
+ }
+ }
+
+ Collider_InitQuad(globalCtx, &this->collider2);
+ Collider_SetQuad(globalCtx, &this->collider2, &this->actor, &sQuadInit);
+
+ if ((MIRRAY_LOCATION(&this->actor) == MIRRAY_SPIRIT_TOPROOM_CEILINGMIRROR) ||
+ (MIRRAY_LOCATION(&this->actor) == MIRRAY_SPIRIT_TOPROOM_COBRA1) ||
+ (MIRRAY_LOCATION(&this->actor) == MIRRAY_SPIRIT_TOPROOM_COBRA2)) {
+ this->actor.room = -1;
+ }
+}
+
+void MirRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ MirRay* this = THIS;
+
+ LightContext_RemoveLight(globalCtx, &globalCtx->lightCtx, this->lightNode);
+
+ if (sMirRayData[MIRRAY_LOCATION(&this->actor)].params & 2) {
+ Collider_DestroyJntSph(globalCtx, &this->collider1);
+ }
+
+ Collider_DestroyQuad(globalCtx, &this->collider2);
+}
+
+void MirRay_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ MirRay* this = THIS;
+ Player* player = GET_PLAYER(globalCtx);
+
+ D_808E3BF0 = false;
+
+ if (!this->unLit) {
+ if (sMirRayData[MIRRAY_LOCATION(&this->actor)].params & 2) {
+ if (sMirRayData[MIRRAY_LOCATION(&this->actor)].params & 4) {
+ MirRay_SetupCollider(this);
+ }
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider1.base);
+ }
+
+ if (this->reflectIntensity > 0.0f) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider2.base);
+ }
+
+ MirRay_MakeShieldLight(this, globalCtx);
+
+ if (this->reflectIntensity > 0.0f) {
+ func_800B8F98(&player->actor, NA_SE_IT_SHIELD_BEAM - SFX_FLAG);
+ }
+ }
+}
+
+void MirRay_SetIntensity(MirRay* this, GlobalContext* globalCtx) {
+ f32 sp4C[3];
+ s32 pad[4];
+ Player* player = GET_PLAYER(globalCtx);
+ MtxF* shieldMtx = &player->shieldMf;
+ f32 temp_f0;
+ f32 temp_f0_2;
+ f32 temp_f2;
+
+ this->reflectIntensity = 0.0f;
+
+ if (MirRay_CheckInFrustum(&this->sourcePt, &this->poolPt, shieldMtx->wx, shieldMtx->wy, shieldMtx->wz,
+ this->sourceEndRad, this->poolEndRad)) {
+ temp_f0 = sqrtf(SQ(shieldMtx->zz) + (SQ(shieldMtx->zx) + SQ(shieldMtx->zy)));
+ if (temp_f0 == 0.0f) {
+ this->reflectRange = 1.0f;
+ } else {
+ this->reflectRange = 1.0f / temp_f0;
+ }
+
+ if (sMirRayData[MIRRAY_LOCATION(&this->actor)].params & 1) {
+ this->reflectIntensity = 1.0f;
+ } else {
+ sp4C[0] = this->poolPt.x - this->sourcePt.x;
+ sp4C[1] = this->poolPt.y - this->sourcePt.y;
+ sp4C[2] = this->poolPt.z - this->sourcePt.z;
+
+ temp_f2 = (-shieldMtx->zx * sp4C[0]) - (shieldMtx->zy * sp4C[1]) - (shieldMtx->zz * sp4C[2]);
+
+ if (temp_f2 < 0.0f) {
+ temp_f0_2 = sqrtf(SQ(sp4C[0]) + SQ(sp4C[1]) + SQ(sp4C[2]));
+ if ((temp_f0 != 0.0f) && (temp_f0_2 != 0.0f)) {
+ this->reflectIntensity = -temp_f2 / (temp_f0 * temp_f0_2);
+ }
+ }
+ }
+ }
+}
+
+// Draws six images, one for each corner of the shield, by finding the intersection of a line segment from the corner
+// perpendicular to the shield with the nearest collision (if any).
+void MirRay_SetupReflectionPolys(MirRay* this, GlobalContext* globalCtx, MirRayShieldReflection* reflection) {
+ s32 i;
+ Player* player = GET_PLAYER(globalCtx);
+ MtxF* shieldMtx = &player->shieldMf;
+ Vec3f posA;
+ Vec3f posB;
+ Vec3f sp70;
+ CollisionPoly* outPoly;
+ f32 sp60[3];
+
+ sp60[0] = -(shieldMtx->zx * this->reflectRange) * this->reflectIntensity * 400.0f;
+ sp60[1] = -(shieldMtx->zy * this->reflectRange) * this->reflectIntensity * 400.0f;
+ sp60[2] = -(shieldMtx->zz * this->reflectRange) * this->reflectIntensity * 400.0f;
+
+ for (i = 0; i < ARRAY_COUNT(this->shieldCorners); i++) {
+ posA.x =
+ (shieldMtx->wx + (this->shieldCorners[i].x * shieldMtx->xx)) + (this->shieldCorners[i].y * (*shieldMtx).yx);
+ posA.y =
+ (shieldMtx->wy + (this->shieldCorners[i].x * shieldMtx->xy)) + (this->shieldCorners[i].y * (*shieldMtx).yy);
+ posA.z =
+ (shieldMtx->wz + (this->shieldCorners[i].x * shieldMtx->xz)) + (this->shieldCorners[i].y * (*shieldMtx).yz);
+
+ posB.x = sp60[0] + posA.x;
+ posB.y = sp60[1] + posA.y;
+ posB.z = sp60[2] + posA.z;
+
+ if (BgCheck_AnyLineTest1(&globalCtx->colCtx, &posA, &posB, &sp70, &outPoly, 1)) {
+ reflection[i].reflectionPoly = outPoly;
+ } else {
+ reflection[i].reflectionPoly = NULL;
+ }
+ }
+}
+
+// Remove reflections that are in the same position and are sufficiently near to the same plane
+void MirRay_RemoveSimilarReflections(MirRayShieldReflection* reflection) {
+ s32 i, j;
+
+ for (i = 0; i < 6; i++) {
+ for (j = i + 1; j < 6; j++) {
+ if ((reflection[i].reflectionPoly != NULL) && (reflection[j].reflectionPoly != NULL)) {
+ if ((ABS(reflection[i].reflectionPoly->normal.x - reflection[j].reflectionPoly->normal.x) < 100) &&
+ (ABS(reflection[i].reflectionPoly->normal.y - reflection[j].reflectionPoly->normal.y) < 100) &&
+ (ABS(reflection[i].reflectionPoly->normal.z - reflection[j].reflectionPoly->normal.z) < 100) &&
+ (reflection[i].reflectionPoly->dist == reflection[j].reflectionPoly->dist)) {
+ reflection[j].reflectionPoly = NULL;
+ }
+ }
+ }
+ }
+}
+
+// Creates the reflected beam's collider (to interact with objects) and places and orients the shield images
+#ifdef NON_MATCHING
+// Beginning block re-ordered
+void MirRay_ReflectedBeam(MirRay* this, GlobalContext* globalCtx, MirRayShieldReflection* reflection) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 i;
+ f32 temp_f0;
+ Vec3f vecB;
+ Vec3f vecD;
+ Vec3f sp118;
+ Vec3f sp10C;
+ Vec3f sp100;
+ Vec3f intersection;
+ f32 spE8[3];
+ f32 normalVec[3];
+ MtxF* shieldMtx = &player->shieldMf;
+ Vec3f vecA;
+ Vec3f vecC;
+
+ spE8[0] = -(shieldMtx->zx * this->reflectRange) * this->reflectIntensity * 400.0f;
+ spE8[1] = -(shieldMtx->zy * this->reflectRange) * this->reflectIntensity * 400.0f;
+ spE8[2] = -(shieldMtx->zz * this->reflectRange) * this->reflectIntensity * 400.0f;
+
+ vecB.x = shieldMtx->wx;
+ vecB.y = shieldMtx->wy;
+ vecB.z = shieldMtx->wz;
+
+ vecD.x = spE8[0] + vecB.x;
+ vecD.y = spE8[1] + vecB.y;
+ vecD.z = spE8[2] + vecB.z;
+
+ vecA.x = vecB.x + (shieldMtx->xx * 300.0f);
+ vecA.y = vecB.y + (shieldMtx->xy * 300.0f);
+ vecA.z = vecB.z + (shieldMtx->xz * 300.0f);
+
+ vecC.x = vecD.x + (shieldMtx->xx * 300.0f);
+ vecC.y = vecD.y + (shieldMtx->xy * 300.0f);
+ vecC.z = vecD.z + (shieldMtx->xz * 300.0f);
+
+ Collider_SetQuadVertices(&this->collider2, &vecA, &vecB, &vecC, &vecD);
+
+ for (i = 0; i < 6; i++) {
+ if (reflection[i].reflectionPoly != NULL) {
+ normalVec[0] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.x);
+ normalVec[1] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.y);
+ normalVec[2] = COLPOLY_GET_NORMAL(reflection[i].reflectionPoly->normal.z);
+
+ if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist,
+ &vecB, &vecD, &sp118, 1)) {
+
+ reflection[i].pos.x = sp118.x;
+ reflection[i].pos.y = sp118.y;
+ reflection[i].pos.z = sp118.z;
+
+ temp_f0 = sqrtf(SQ(sp118.x - vecB.x) + SQ(sp118.y - vecB.y) + SQ(sp118.z - vecB.z));
+
+ if (temp_f0 < (this->reflectIntensity * 600.0f)) {
+ reflection[i].opacity = 200;
+ } else {
+ reflection[i].opacity = (s32)(800.0f - temp_f0);
+ }
+
+ reflection[i].opacity = (s32)(reflection[i].opacity * 1.275f);
+
+ sp10C.x = (shieldMtx->xx * 100.0f) + vecB.x;
+ sp10C.y = (shieldMtx->xy * 100.0f) + vecB.y;
+ sp10C.z = (shieldMtx->xz * 100.0f) + vecB.z;
+
+ sp100.x = (spE8[0] * 4.0f) + sp10C.x;
+ sp100.y = (spE8[1] * 4.0f) + sp10C.y;
+ sp100.z = (spE8[2] * 4.0f) + sp10C.z;
+
+ reflection[i].mtx.xx = reflection[i].mtx.yy = reflection[i].mtx.zz = reflection[i].mtx.ww = 1.0f;
+
+ reflection[i].mtx.xy = reflection[i].mtx.xz = reflection[i].mtx.xw = reflection[i].mtx.yx =
+ reflection[i].mtx.yz = reflection[i].mtx.yw = reflection[i].mtx.zx = reflection[i].mtx.zy =
+ reflection[i].mtx.zw = reflection[i].mtx.wx = reflection[i].mtx.wy = reflection[i].mtx.wz =
+ 0.0f;
+
+ if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist,
+ &sp10C, &sp100, &intersection, 1)) {
+ reflection[i].mtx.xx = intersection.x - sp118.x;
+ reflection[i].mtx.xy = intersection.y - sp118.y;
+ reflection[i].mtx.xz = intersection.z - sp118.z;
+ }
+
+ sp10C.x = (shieldMtx->yx * 100.0f) + vecB.x;
+ sp10C.y = (shieldMtx->yy * 100.0f) + vecB.y;
+ sp10C.z = (shieldMtx->yz * 100.0f) + vecB.z;
+
+ sp100.x = (spE8[0] * 4.0f) + sp10C.x;
+ sp100.y = (spE8[1] * 4.0f) + sp10C.y;
+ sp100.z = (spE8[2] * 4.0f) + sp10C.z;
+
+ if (Math3D_LineSegVsPlane(normalVec[0], normalVec[1], normalVec[2], reflection[i].reflectionPoly->dist,
+ &sp10C, &sp100, &intersection, 1)) {
+ reflection[i].mtx.yx = intersection.x - sp118.x;
+ reflection[i].mtx.yy = intersection.y - sp118.y;
+ reflection[i].mtx.yz = intersection.z - sp118.z;
+ }
+ } else {
+ reflection[i].reflectionPoly = NULL;
+ }
+ }
+ }
+}
+#else
+void MirRay_ReflectedBeam(MirRay* this, GlobalContext* globalCtx, MirRayShieldReflection* reflection);
+#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_ReflectedBeam.s")
#endif
-extern ColliderQuadInit D_808E3BF4;
-extern ColliderJntSphElementInit D_808E3C44[1];
-extern ColliderJntSphInit D_808E3C68;
-extern InitChainEntry D_808E3DB8[];
+void MirRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ MirRay* this = THIS;
+ Player* player = GET_PLAYER(globalCtx);
+ MirRayShieldReflection reflection[6];
+ s32 i;
-extern UNK_TYPE D_060003F8;
+ this->reflectIntensity = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/D_808E3DD0.s")
+ if (!D_808E3BF0 && !this->unLit && func_80124088(globalCtx)) {
+ Matrix_InsertMatrix(&player->shieldMf, MTXMODE_NEW);
+ MirRay_SetIntensity(this, globalCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E2600.s")
+ if (this->reflectIntensity <= 0.0f) {
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E26C8.s")
+ OPEN_DISPS(globalCtx->state.gfxCtx);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_Init.s")
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ Matrix_Scale(1.0f, 1.0f, this->reflectIntensity, MTXMODE_APPLY);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_Destroy.s")
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (u8)(s8)(this->reflectIntensity * 100.0f));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_Update.s")
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_mir_ray_Matanimheader_0003F8));
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E2C68.s")
+ gSPDisplayList(POLY_XLU_DISP++, object_mir_ray_DL_000168);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E2E1C.s")
+ MirRay_SetupReflectionPolys(this, globalCtx, reflection);
+ MirRay_RemoveSimilarReflections(reflection);
+ MirRay_ReflectedBeam(this, globalCtx, reflection);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E2FF8.s")
+ if (reflection[0].reflectionPoly == NULL) {
+ reflection[0].opacity = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E30FC.s")
+ for (i = 1; i < ARRAY_COUNT(reflection); i++) {
+ if (reflection[i].reflectionPoly != NULL) {
+ if (reflection[0].opacity < reflection[i].opacity) {
+ reflection[0].opacity = reflection[i].opacity;
+ }
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/MirRay_Draw.s")
+ for (i = 0; i < ARRAY_COUNT(reflection); i++) {
+ if (reflection[i].reflectionPoly != NULL) {
+ Matrix_InsertTranslation(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_InsertMatrix(&reflection[i].mtx, MTXMODE_APPLY);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Mir_Ray/func_808E3984.s")
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, reflection[0].opacity);
+ gSPDisplayList(POLY_XLU_DISP++, object_mir_ray_DL_0004B0);
+ }
+ }
+
+ D_808E3BF0 = true;
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
+
+// Computes if the Point (pointx, pointy, pointz) lies within the right conical frustum with one end centred at vecA
+// with radius radiusA, the other at vecB with radius radiusB
+s32 MirRay_CheckInFrustum(Vec3f* vecA, Vec3f* vecB, f32 pointx, f32 pointy, f32 pointz, s16 radiusA, s16 radiusB) {
+ f32 coneRadius;
+ f32 closestPtx;
+ f32 closestPty;
+ f32 closestPtz;
+ Vec3f vecdiff;
+ f32 dist;
+ Vec3f sp5C;
+ Vec3f sp50;
+ Vec3f sp44;
+
+ vecdiff.x = vecB->x - vecA->x;
+ vecdiff.y = vecB->y - vecA->y;
+ vecdiff.z = vecB->z - vecA->z;
+ if (1) {}
+
+ dist = SQ(vecdiff.x) + SQ(vecdiff.y) + SQ(vecdiff.z);
+
+ if (dist == 0.0f) {
+ return false;
+ }
+
+ dist =
+ (((pointx - vecA->x) * vecdiff.x) + ((pointy - vecA->y) * vecdiff.y) + ((pointz - vecA->z) * vecdiff.z)) / dist;
+
+ // Closest point on line A-B to Point
+ closestPtx = (vecdiff.x * dist) + vecA->x;
+ closestPty = (vecdiff.y * dist) + vecA->y;
+ closestPtz = (vecdiff.z * dist) + vecA->z;
+
+ // Diameter of the double cone on the perpendicular plane through the closest point
+ coneRadius = ((radiusB - radiusA) * dist) + radiusA;
+
+ // If the Point is within the bounding double cone, check if it is in the frustum by checking whether it is between
+ // the bounding planes
+ if ((SQ(closestPtx - pointx) + SQ(closestPty - pointy) + SQ(closestPtz - pointz)) <= SQ(coneRadius)) {
+ if (1) {}
+
+ // Stores the vector difference again
+ Math_Vec3f_Diff(vecB, vecA, &sp5C);
+
+ sp50.x = pointx - vecA->x;
+ sp50.y = pointy - vecA->y;
+ sp50.z = pointz - vecA->z;
+
+ if (Math3D_Parallel(&sp5C, &sp50) < 0.0f) {
+ return false;
+ }
+
+ sp44.x = pointx - vecB->x;
+ sp44.y = pointy - vecB->y;
+ sp44.z = pointz - vecB->z;
+
+ if (Math3D_Parallel(&sp5C, &sp44) > 0.0f) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+}
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 c03b48c6b8..4d748e3b52 100644
--- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h
+++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.h
@@ -5,9 +5,39 @@
struct MirRay;
+#define MIRRAY_LOCATION(thisx) ((thisx)->params)
+
+// Locations of light beams in sMirRayData
+typedef enum {
+ /* 0 */ MIRRAY_SPIRIT_BOMBCHUIWAROOM_DOWNLIGHT,
+ /* 1 */ MIRRAY_SPIRIT_SUNBLOCKROOM_DOWNLIGHT,
+ /* 2 */ MIRRAY_SPIRIT_SINGLECOBRAROOM_DOWNLIGHT,
+ /* 3 */ MIRRAY_SPIRIT_ARMOSROOM_DOWNLIGHT,
+ /* 4 */ MIRRAY_SPIRIT_TOPROOM_DOWNLIGHT,
+ /* 5 */ MIRRAY_SPIRIT_TOPROOM_CEILINGMIRROR,
+ /* 6 */ MIRRAY_SPIRIT_SINGLECOBRAROOM_COBRA,
+ /* 7 */ MIRRAY_SPIRIT_TOPROOM_COBRA1,
+ /* 8 */ MIRRAY_SPIRIT_TOPROOM_COBRA2,
+ /* 9 */ MIRRAY_GANONSCASTLE_SPIRITTRIAL_DOWNLIGHT,
+ /* 10 */ MIRRAY_MAX,
+} MirRayBeamLocations;
+
typedef struct MirRay {
- /* 0x000 */ Actor actor;
- /* 0x144 */ char unk_144[0x164];
+ /* 0x0000 */ Actor actor;
+ /* 0x0144 */ ColliderJntSph collider1;
+ /* 0x0164 */ ColliderJntSphElement collider1Elements[1];
+ /* 0x01A4 */ ColliderQuad collider2;
+ /* 0x0224 */ f32 reflectIntensity; // Reflection occurs if it is positive, brightness depends on it
+ /* 0x0228 */ Vec3f shieldCorners[6];
+ /* 0x0270 */ f32 reflectRange;
+ /* 0x0274 */ Vec3f sourcePt;
+ /* 0x0280 */ Vec3f poolPt;
+ /* 0x028C */ s16 sourceEndRad;
+ /* 0x028E */ s16 poolEndRad;
+ /* 0x0290 */ s16 lightPointRad;
+ /* 0x0294 */ LightNode* lightNode;
+ /* 0x0298 */ LightInfo lightInfo;
+ /* 0x02A6 */ u8 unLit; // Conditioned on. set in Cobra?
} MirRay; // size = 0x2A8
extern const ActorInit Mir_Ray_InitVars;
diff --git a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c
index d9eb30b4fe..f6e8750cb4 100644
--- a/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c
+++ b/src/overlays/actors/ovl_Mir_Ray2/z_mir_ray2.c
@@ -6,7 +6,7 @@
#include "z_mir_ray2.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((MirRay2*)thisx)
diff --git a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c
index d68880f2d1..1da636c1d2 100644
--- a/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c
+++ b/src/overlays/actors/ovl_Mir_Ray3/z_mir_ray3.c
@@ -6,7 +6,7 @@
#include "z_mir_ray3.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((MirRay3*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
index 8e168cba89..5237d9021b 100644
--- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
+++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.c
@@ -7,7 +7,7 @@
#include "z_obj_aqua.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjAqua*)thisx)
@@ -268,7 +268,7 @@ void ObjAqua_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjAqua* this = THIS;
s32 framesTemp;
s32 pad;
- s16 yaw = func_800DFCDC(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
+ s16 yaw = Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
s32 actionFuncTemp = this->actionFunc == func_80ACBDFC;
OPEN_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h
index 0c8bdc714e..8360ae1e2d 100644
--- a/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h
+++ b/src/overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h
@@ -4,6 +4,7 @@
#include "global.h"
#define AQUA_HOT(thisx) ((thisx)->params & 1)
+#define OBJAQUA_1 1
struct ObjAqua;
diff --git a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
index d4ae2b79f6..2d7db7644c 100644
--- a/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
+++ b/src/overlays/actors/ovl_Obj_Armos/z_obj_armos.c
@@ -6,7 +6,7 @@
#include "z_obj_armos.h"
-#define FLAGS 0x04000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_4000000)
#define THIS ((ObjArmos*)thisx)
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 18ff5d8dc9..d61b3f7719 100644
--- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c
+++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c
@@ -5,8 +5,10 @@
*/
#include "z_obj_bean.h"
+#include "objects/object_mamenoki/object_mamenoki.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00400000
+#define FLAGS (ACTOR_FLAG_400000)
#define THIS ((ObjBean*)thisx)
@@ -14,7 +16,50 @@ void ObjBean_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjBean_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjBean_Update(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80937C10(ObjBean* this);
+void func_80937C24(ObjBean* this);
+void func_80937CA0(ObjBean* this);
+void func_80937CE4(ObjBean* this);
+void func_80937D54(ObjBean* this);
+void func_80937DD8(ObjBean* this);
+void func_80937DEC(ObjBean* this, GlobalContext* globalCtx);
+void func_80937FB0(ObjBean* this);
+void func_80937FC8(ObjBean* this, GlobalContext* globalCtx);
+void func_809381B0(ObjBean* this);
+void func_809381C4(ObjBean* this, GlobalContext* globalCtx);
+void func_80938284(ObjBean* this);
+void func_80938298(ObjBean* this, GlobalContext* globalCtx);
+void func_8093833C(ObjBean* this);
+void func_80938358(ObjBean* this, GlobalContext* globalCtx);
+void func_809383B4(ObjBean* this);
+void func_809383D0(ObjBean* this, GlobalContext* globalCtx);
+void func_80938408(ObjBean* this);
+void func_80938444(ObjBean* this, GlobalContext* globalCtx);
+void func_809384E8(ObjBean* this);
+void func_80938504(ObjBean* this, GlobalContext* globalCtx);
+void func_80938588(ObjBean* this);
+void func_809385A8(ObjBean* this, GlobalContext* globalCtx);
+void func_80938670(ObjBean* this);
+void func_8093868C(ObjBean* this, GlobalContext* globalCtx);
+void func_80938704(ObjBean* this);
+void func_80938728(ObjBean* this, GlobalContext* globalCtx);
+void func_8093876C(ObjBean* this);
+void func_80938780(ObjBean* this, GlobalContext* globalCtx);
+void func_80938804(ObjBean* this);
+void func_80938834(ObjBean* this, GlobalContext* globalCtx);
+void func_80938874(ObjBean* this);
+void func_809388A8(ObjBean* this, GlobalContext* globalCtx);
+void func_8093892C(ObjBean* this);
+void func_80938958(ObjBean* this, GlobalContext* globalCtx);
+void func_809389BC(ObjBean* this, GlobalContext* globalCtx);
+void func_80938A14(ObjBean* this);
+void func_80938A5C(ObjBean* this, GlobalContext* globalCtx);
+void func_80938AA4(ObjBean* this);
+void func_80938AD8(ObjBean* this, GlobalContext* globalCtx);
+void func_80938C1C(Actor* thisx, GlobalContext* globalCtx);
+void func_80938E00(Actor* thisx, GlobalContext* globalCtx);
+void func_80938F50(Actor* thisx, GlobalContext* globalCtx);
+
const ActorInit Obj_Bean_InitVars = {
ACTOR_OBJ_BEAN,
ACTORCAT_BG,
@@ -27,160 +72,895 @@ const ActorInit Obj_Bean_InitVars = {
(ActorFunc)NULL,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80938FA0 = {
- { COLTYPE_NONE, AT_NONE, AC_NONE, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_NONE, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_NONE,
+ OC1_ON | OC1_TYPE_PLAYER,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x00000000, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_NONE,
+ OCELEM_ON,
+ },
{ 64, 30, -31, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80938FCC = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_OTHER, OC1_NONE, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_OTHER,
+ OC1_NONE,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 10, 10, 0, { 0, 0, 0 } },
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8093902C[] = {
+static Vec2f D_80938FF8[4] = {
+ { 3.0f, 0.3f },
+ { 10.0f, 0.5f },
+ { 30.0f, 0.5f },
+ { 3.0f, 0.3f },
+};
+
+void func_80936CF0(ObjBean* this, GlobalContext* globalCtx) {
+ Vec3f sp24;
+ s32 sp20;
+
+ sp24.x = this->dyna.actor.world.pos.x;
+ sp24.y = this->dyna.actor.world.pos.y + 29.999998f;
+ sp24.z = this->dyna.actor.world.pos.z;
+ this->dyna.actor.floorHeight =
+ BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->dyna.actor.floorPoly, &sp20, &this->dyna.actor, &sp24);
+}
+
+s32 func_80936D58(ObjBean* this, GlobalContext* globalCtx) {
+ static Vec3f D_80939018 = { 0.0f, 30.0f, 0.0f };
+ s32 pad;
+ s32 spB8;
+ Vec3f spAC;
+ Vec3f spA0;
+ Vec3f sp94;
+ Vec3f sp88;
+ MtxF sp48;
+
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_InsertXRotation_s(this->dyna.actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->dyna.actor.shape.rot.z, MTXMODE_APPLY);
+ Matrix_MultiplyVector3fByState(&D_80939018, &spAC);
+ Math_Vec3f_Sum(&this->dyna.actor.world.pos, &spAC, &spA0);
+ Math_Vec3f_Diff(&this->dyna.actor.world.pos, &spAC, &sp94);
+
+ if (BgCheck_EntityLineTest2(&globalCtx->colCtx, &spA0, &sp94, &sp88, &this->dyna.actor.floorPoly, 1, 1, 1, 1, &spB8,
+ &this->dyna.actor)) {
+ this->dyna.actor.world.pos.x = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.x) * 1.9f) + sp88.x;
+ this->dyna.actor.world.pos.y = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.y) * 1.9f) + sp88.y;
+ this->dyna.actor.world.pos.z = (COLPOLY_GET_NORMAL(this->dyna.actor.floorPoly->normal.z) * 1.9f) + sp88.z;
+ func_800C0094(this->dyna.actor.floorPoly, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &sp48);
+ Matrix_SetCurrentState(&sp48);
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_CopyCurrentState(&sp48);
+ func_8018219C(&sp48, &this->dyna.actor.shape.rot, 0);
+ return true;
+ }
+ return false;
+}
+
+void func_80936F04(ObjBean* this) {
+ this->unk_1AC = this->unk_1AE = this->unk_1B0 = 0;
+ this->unk_1C8 = 0.0f;
+}
+
+void func_80936F24(ObjBean* this) {
+ this->unk_1AC += 0xB6;
+ this->unk_1AE += 0xFB;
+ this->unk_1B0 += 0x64;
+ Math_StepToF(&this->unk_1C8, 2.0f, 0.1f);
+ this->unk_1CC = (Math_SinS(this->unk_1AC * 3) + Math_SinS(this->unk_1AE * 3)) * this->unk_1C8;
+ this->unk_1D0 = (Math_CosS(this->unk_1AC * 4) + Math_CosS(this->unk_1AE * 4)) * this->unk_1C8;
+ this->dyna.actor.scale.z =
+ ((Math_SinS(this->unk_1B0 * 5) * 0.06f) + (Math_SinS(this->unk_1AE * 8) * 0.01f) + 1.07f) * 0.1f;
+ this->dyna.actor.scale.x = this->dyna.actor.scale.z;
+ this->dyna.actor.scale.y = ((Math_CosS(this->unk_1B0 * 10) * 0.2f) + 1.0f) * 0.1f;
+ this->dyna.actor.shape.rot.y = (this->dyna.actor.home.rot.y + (s32)(Math_SinS(this->unk_1AC * 3) * 1000.0f)) +
+ (s32)(Math_SinS(this->unk_1B0 * 2) * 2100.0f);
+}
+
+void func_80937130(ObjBean* this) {
+ this->unk_1AC = this->unk_1AE = this->unk_1B0 = 0;
+ Actor_SetScale(&this->dyna.actor, 0.0f);
+}
+
+void func_80937160(ObjBean* this) {
+ this->unk_1AC += 0x384;
+ if (this->unk_1AC > 0x5FFF) {
+ this->unk_1AC = 0x5FFF;
+ }
+
+ this->unk_1AE += 0x258;
+ if (this->unk_1AE > 0x4000) {
+ this->unk_1AE = 0x4000;
+ }
+
+ this->dyna.actor.scale.y = Math_SinS(this->unk_1AC) * 0.16970563f;
+ this->dyna.actor.scale.x = this->dyna.actor.scale.z = Math_SinS(this->unk_1AE) * 0.10700001f;
+ Math_StepToF(&this->unk_1CC, 0.0f, 0.1f);
+ Math_StepToF(&this->unk_1D0, 0.0f, 0.1f);
+ Math_ScaledStepToS(&this->dyna.actor.shape.rot.y, this->dyna.actor.home.rot.y, 100);
+}
+
+void func_80937238(ObjBean* this) {
+ this->dyna.actor.world.pos.x = this->unk_1BC.x + this->unk_1CC;
+ this->dyna.actor.world.pos.y = this->unk_1BC.y;
+ this->dyna.actor.world.pos.z = this->unk_1BC.z + this->unk_1D0;
+}
+
+void func_80937268(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1D8 = globalCtx->setupPathList[OBJBEAN_GET_3F00(&this->dyna.actor)].count - 1;
+ this->unk_1DA = 0;
+ this->unk_1DC = 1;
+}
+
+void func_809372A8(ObjBean* this) {
+ Math_Vec3s_ToVec3f(&this->unk_1BC, this->unk_1D4);
+}
+
+void func_809372D0(ObjBean* this) {
+ Actor* actor = &this->dyna.actor;
+ Vec3f sp38;
+ f32 sp34;
+ f32 temp_f2;
+ f32 temp_f12;
+
+ Math_Vec3s_ToVec3f(&sp38, &this->unk_1D4[this->unk_1DC]);
+ Math_Vec3f_Diff(&sp38, &this->unk_1BC, &actor->velocity);
+
+ sp34 = Math3D_Vec3fMagnitude(&actor->velocity);
+ temp_f2 = D_80938FF8[this->unk_1DE].x;
+ temp_f12 = D_80938FF8[this->unk_1DE].y;
+ if (sp34 < (actor->speedXZ * 8.0f)) {
+ temp_f2 = ((temp_f2 - 2.0f) * 0.1f) + 2.0f;
+ temp_f12 *= 0.4f;
+ }
+
+ Math_StepToF(&actor->speedXZ, temp_f2, temp_f12);
+
+ if ((actor->speedXZ + 0.05f) < sp34) {
+ Math_Vec3f_Scale(&actor->velocity, actor->speedXZ / sp34);
+ this->unk_1BC.x += actor->velocity.x;
+ this->unk_1BC.y += actor->velocity.y;
+ this->unk_1BC.z += actor->velocity.z;
+ } else {
+ Math_Vec3f_Copy(&this->unk_1BC, &sp38);
+ this->unk_1DA = this->unk_1DC;
+ if (this->unk_1DA >= this->unk_1D8) {
+ this->unk_1DC = 0;
+ } else {
+ this->unk_1DC++;
+ }
+ actor->speedXZ *= 0.5f;
+ }
+}
+
+s32 func_80937468(ObjBean* this, GlobalContext* globalCtx) {
+ Actor* bgActor = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first;
+
+ while (bgActor != NULL) {
+ if ((bgActor->id == ACTOR_EN_HORSE) &&
+ (Math3D_Vec3fDistSq(&bgActor->world.pos, &this->dyna.actor.world.pos) < SQ(100.0f))) {
+ return true;
+ }
+ bgActor = bgActor->next;
+ }
+
+ return false;
+}
+
+ObjBean* func_809374F8(ObjBean* this, GlobalContext* globalCtx) {
+ Actor* bgActor = globalCtx->actorCtx.actorLists[ACTORCAT_BG].first;
+ s32 params = OBJBEAN_GET_3F80(&this->dyna.actor, 0);
+
+ while (bgActor != NULL) {
+ if (bgActor->id == ACTOR_OBJ_BEAN) {
+ s32 params2 = OBJBEAN_GET_C000(bgActor);
+
+ if (!params2 && (bgActor->room == this->dyna.actor.room) && !OBJBEAN_GET_80(bgActor) &&
+ (params == OBJBEAN_GET_7F(bgActor, 0)) &&
+ (Math3D_Vec3fDistSq(&bgActor->world.pos, &this->dyna.actor.world.pos) < SQ(10.0f))) {
+ break;
+ }
+ }
+ bgActor = bgActor->next;
+ }
+
+ return (ObjBean*)bgActor;
+}
+
+void func_809375C8(ObjBean* this, GlobalContext* globalCtx) {
+ ObjBean* bean = func_809374F8(this, globalCtx);
+
+ if (bean != NULL) {
+ bean->unk_200 = 1;
+ }
+}
+
+void func_809375F4(ObjBean* this, GlobalContext* globalCtx) {
+ static Gfx* D_80939024[] = {
+ gameplay_keep_DL_0527F0,
+ gameplay_keep_DL_0528B0,
+ };
+ Vec3f spC4;
+ Vec3f spB8;
+ f32 temp_f20;
+ s32 temp_s2;
+ s16 temp_s1 = 0;
+ s32 phi_s3;
+ s32 phi_v0;
+ s32 i;
+
+ for (i = 0; i < 36; i++) {
+ temp_s1 += 0x4E20;
+ temp_f20 = Rand_ZeroOne() * 60.0f;
+
+ spC4.x = (Math_SinS(temp_s1) * temp_f20) + this->dyna.actor.world.pos.x;
+ spC4.y = this->dyna.actor.world.pos.y;
+ spC4.z = (Math_CosS(temp_s1) * temp_f20) + this->dyna.actor.world.pos.z;
+
+ spB8.x = Math_SinS(temp_s1) * 3.5f;
+ spB8.y = Rand_ZeroOne() * 13.0f;
+ spB8.z = Math_CosS(temp_s1) * 3.5f;
+
+ spB8.x += this->dyna.actor.world.pos.x - this->dyna.actor.prevPos.x;
+ spB8.y += this->dyna.actor.world.pos.y - this->dyna.actor.prevPos.y;
+ spB8.z += this->dyna.actor.world.pos.z - this->dyna.actor.prevPos.z;
+
+ temp_s2 = (s32)(Rand_ZeroOne() * 180.0f) + 30;
+
+ phi_v0 = 0x40;
+ if (temp_s2 < 0x5A) {
+ phi_s3 = -0x50;
+ if (Rand_ZeroOne() < 0.1f) {
+ phi_v0 = 0x60;
+ } else {
+ phi_v0 = 0x40;
+ }
+ } else {
+ phi_s3 = -100;
+ phi_v0 = 0x40;
+ }
+ EffectSsKakera_Spawn(globalCtx, &spC4, &spB8, &spC4, phi_s3, phi_v0, 40, 3, 0, temp_s2, 0, 0,
+ (temp_s2 >> 3) + 40, -1, 1, D_80939024[i & 1]);
+ }
+}
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 2500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 200, ICHAIN_STOP),
};
-#endif
-
-extern ColliderCylinderInit D_80938FA0;
-extern ColliderCylinderInit D_80938FCC;
-extern InitChainEntry D_8093902C[];
-
-extern UNK_TYPE D_06000090;
-extern UNK_TYPE D_060004BC;
-extern UNK_TYPE D_06002208;
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80936CF0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80936D58.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80936F04.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80936F24.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937130.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937160.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937238.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937268.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809372A8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809372D0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937468.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809374F8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809375C8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809375F4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/ObjBean_Init.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/ObjBean_Destroy.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937B54.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937C10.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937C24.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937C30.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937CA0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937CE4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937D54.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937DD8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937DEC.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937FB0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80937FC8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809381B0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809381C4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938284.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938298.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_8093833C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938358.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809383B4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809383D0.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938408.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938444.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809384E8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938504.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938588.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809385A8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938670.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_8093868C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938704.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938728.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_8093876C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938780.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938804.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938834.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938874.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809388A8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_8093892C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938958.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938998.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_809389BC.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938A14.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938A5C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938AA4.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938AD8.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938C1C.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/ObjBean_Update.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938E00.s")
-
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bean/func_80938F50.s")
+void ObjBean_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjBean* this = THIS;
+ s32 sp2C = OBJBEAN_GET_C000(&this->dyna.actor);
+
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ this->unk_1FE = 0;
+ this->unk_1B8 = 0.1f;
+ DynaPolyActor_Init(&this->dyna, 3);
+ Collider_InitCylinder(globalCtx, &this->collider);
+
+ if ((sp2C == ENOBJBEAN_GET_C000_1) || (sp2C == ENOBJBEAN_GET_C000_2)) {
+ this->dyna.actor.update = func_80938C1C;
+ this->dyna.actor.textId = 0xFD;
+ if (sp2C == ENOBJBEAN_GET_C000_1) {
+ Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit2);
+ Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
+ }
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ func_80937C10(this);
+ if (!func_80936D58(this, globalCtx)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ } else {
+ func_800BC154(globalCtx, &globalCtx->actorCtx, &this->dyna.actor, 7);
+ func_80937DD8(this);
+ }
+ } else {
+ s32 params2 = OBJBEAN_GET_3F00(&this->dyna.actor);
+ Path* path = &globalCtx->setupPathList[params2];
+
+ this->unk_1DE = OBJBEAN_GET_3(&this->dyna.actor);
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.home.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ this->unk_1FE |= 2;
+
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_mamenoki_Colheader_0004BC);
+ Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit1);
+ Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
+
+ this->unk_1D4 = Lib_SegmentedToVirtual(path->points);
+
+ func_80937268(this, globalCtx);
+ func_809372A8(this);
+ func_80937238(this);
+ ActorShape_Init(&this->dyna.actor.shape, 0.0f, ActorShadow_DrawCircle, 8.8f);
+ func_80936CF0(this, globalCtx);
+
+ if (!OBJBEAN_GET_80(&this->dyna.actor) && Flags_GetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 0)) &&
+ !Flags_GetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 1)) && func_800FE9B4(globalCtx)) {
+ Flags_SetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 1));
+ }
+
+ if (OBJBEAN_GET_80(&this->dyna.actor) || Flags_GetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 1))) {
+ func_80938804(this);
+ } else {
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ func_80938704(this);
+ }
+ }
+}
+
+void ObjBean_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBean* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ Collider_DestroyCylinder(globalCtx, &this->collider);
+}
+
+void func_80937B54(ObjBean* this) {
+ Math_StepToS(&this->unk_1EE, this->unk_1F0, this->unk_1F2);
+ Math_StepToS(&this->unk_1F4, this->unk_1F6, this->unk_1F8);
+ this->unk_1FA += this->unk_1F4;
+ this->unk_1FC = 6372.0f - (Math_SinS(this->unk_1FA) * this->unk_1EE);
+ this->dyna.actor.scale.y = Math_SinS(this->unk_1FC) * 0.17434467f;
+ this->dyna.actor.scale.x = this->dyna.actor.scale.z = Math_CosS(this->unk_1FC) * 0.12207746f;
+}
+
+void func_80937C10(ObjBean* this) {
+ this->unk_1E8 = func_80937C24;
+}
+
+void func_80937C24(ObjBean* this) {
+}
+
+void func_80937C30(ObjBean* this) {
+ this->unk_1E8 = func_80937CA0;
+ this->unk_1EC = Rand_S16Offset(12, 40);
+ this->unk_1F0 = Rand_S16Offset(200, 400);
+ this->unk_1F2 = 20;
+ this->unk_1F6 = Rand_S16Offset(100, 800);
+ this->unk_1F8 = 20;
+}
+
+void func_80937CA0(ObjBean* this) {
+ this->unk_1EC--;
+ func_80937B54(this);
+ if (this->unk_1EC < 0) {
+ func_80937CE4(this);
+ }
+}
+
+void func_80937CE4(ObjBean* this) {
+ this->unk_1E8 = func_80937D54;
+ this->unk_1EC = Rand_S16Offset(30, 4);
+ this->unk_1F0 = Rand_S16Offset(2000, 1000);
+ this->unk_1F2 = 200;
+ this->unk_1F6 = Rand_S16Offset(14000, 6000);
+ this->unk_1F8 = 4000;
+}
+
+void func_80937D54(ObjBean* this) {
+ this->unk_1EC--;
+ if (this->unk_1EC == 14) {
+ this->unk_1F0 = Rand_S16Offset(200, 400);
+ this->unk_1F6 = Rand_S16Offset(100, 500);
+ this->unk_1F8 = 2000;
+ }
+
+ func_80937B54(this);
+
+ if (this->unk_1EC < 0) {
+ func_80937C30(this);
+ }
+}
+
+void func_80937DD8(ObjBean* this) {
+ this->actionFunc = func_80937DEC;
+}
+
+void func_80937DEC(ObjBean* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp20 = OBJBEAN_GET_C000(&this->dyna.actor);
+
+ if (sp20 == ENOBJBEAN_GET_C000_1) {
+ s32 pad2;
+
+ if (func_809374F8(this, globalCtx) == NULL) {
+ this->unk_1FF = false;
+ } else {
+ this->unk_1FF = true;
+ }
+ } else {
+ this->unk_1FF = false;
+ }
+
+ if (this->unk_1FF && !Flags_GetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 1)) &&
+ Flags_GetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 0)) && func_800FE9B4(globalCtx)) {
+ Flags_SetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 1));
+ }
+
+ if (this->unk_1FF && Flags_GetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 1))) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+
+ if (sp20 == ENOBJBEAN_GET_C000_2) {
+ this->dyna.actor.draw = func_80938F50;
+ } else {
+ this->dyna.actor.draw = func_80938E00;
+ }
+
+ if (this->unk_1FF && Flags_GetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 0))) {
+ this->unk_1FE |= 5;
+ func_80937C30(this);
+ } else {
+ this->unk_1FE |= 1;
+ func_80937C10(this);
+ }
+
+ if (Flags_GetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 0))) {
+ this->unk_1E4 = 5;
+ } else {
+ this->unk_1E4 = 0;
+ }
+
+ func_80937FB0(this);
+}
+
+void func_80937FB0(ObjBean* this) {
+ this->unk_1E0 = 0;
+ this->actionFunc = func_80937FC8;
+}
+
+void func_80937FC8(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1E8(this);
+
+ if (Actor_ProcessTalkRequest(&this->dyna.actor, &globalCtx->state)) {
+ if (Player_GetExchangeItemId(globalCtx) == EXCH_ITEM_2E) {
+ func_809383B4(this);
+ Flags_SetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 0));
+ }
+
+ if (Flags_GetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 0))) {
+ this->unk_1E4 = 5;
+ } else {
+ s32 pad;
+
+ this->unk_1E4 = 0;
+ }
+ } else if (this->unk_1E4 == 1) {
+ this->unk_1DF = 16;
+ func_809381B0(this);
+ } else if (((this->collider.base.acFlags & AC_HIT) && (this->collider.base.ac != NULL) &&
+ (this->collider.base.ac->id == ACTOR_OBJ_AQUA)) ||
+ ((this->unk_1FF != 0) && (this->unk_1FE & 4) && (this->dyna.actor.xzDistToPlayer < 300.0f) &&
+ func_800FE9B4(globalCtx))) {
+ func_809375C8(this, globalCtx);
+ Flags_SetSwitch(globalCtx, OBJBEAN_GET_3F80(&this->dyna.actor, 1));
+ this->unk_1E4 = 6;
+ func_80938670(this);
+ } else if (this->unk_1FF != 0) {
+ if (this->unk_1FE & 4) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ if (this->dyna.actor.xzDistToPlayer < 150.0f) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+ } else {
+ func_800B85E0(&this->dyna.actor, globalCtx, 28.0f, 0x2E);
+ }
+ }
+}
+
+void func_809381B0(ObjBean* this) {
+ this->actionFunc = func_809381C4;
+}
+
+void func_809381C4(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1E8(this);
+
+ if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
+ if (this->dyna.actor.cutscene >= 0) {
+ func_800B7298(globalCtx, &this->dyna.actor, 1);
+ }
+ this->unk_1E4 = 2;
+ func_80938284(this);
+ } else if (this->unk_1E4 == 4) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ play_sound(NA_SE_SY_ERROR);
+ this->unk_1E4 = 0;
+ func_80937FB0(this);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ }
+}
+
+void func_80938284(ObjBean* this) {
+ this->actionFunc = func_80938298;
+}
+
+void func_80938298(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1E8(this);
+
+ if (this->unk_1E0 >= 3) {
+ this->unk_1E4 = 3;
+ Flags_SetSwitch(globalCtx, OBJBEAN_GET_7F(&this->dyna.actor, 0));
+ this->unk_1E4 = 5;
+ func_8093833C(this);
+ } else if (this->unk_1E4 == 4) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ play_sound(NA_SE_SY_ERROR);
+ this->unk_1E4 = 0;
+ func_80937FB0(this);
+ }
+}
+
+void func_8093833C(ObjBean* this) {
+ this->actionFunc = func_80938358;
+ this->unk_1B2 = 4;
+}
+
+void func_80938358(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1E8(this);
+
+ if (this->unk_1B2 <= 0) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ func_80937FB0(this);
+ }
+}
+
+void func_809383B4(ObjBean* this) {
+ this->unk_1B2 = 60;
+ this->actionFunc = func_809383D0;
+}
+
+void func_809383D0(ObjBean* this, GlobalContext* globalCtx) {
+ if (this->unk_1B2 <= 0) {
+ this->unk_1FE |= 4;
+ func_80938408(this);
+ }
+}
+
+void func_80938408(ObjBean* this) {
+ Actor_SetScale(&this->dyna.actor, 0.01f);
+ this->actionFunc = func_80938444;
+}
+
+void func_80938444(ObjBean* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp20 = Math_StepToF(&this->dyna.actor.scale.y, 0.16672663f, 0.01f) & 1;
+
+ sp20 &= Math_StepToF(&this->dyna.actor.scale.x, 0.03569199f, 0.00113f);
+
+ this->dyna.actor.scale.z = this->dyna.actor.scale.x;
+ if (sp20) {
+ if (this->unk_1B2 <= 0) {
+ func_809384E8(this);
+ }
+ } else {
+ this->unk_1B2 = 1;
+ }
+ func_800B9010(&this->dyna.actor, NA_SE_PL_PLANT_GROW_UP - SFX_FLAG);
+}
+
+void func_809384E8(ObjBean* this) {
+ this->unk_1AC = 0x33E9;
+ this->actionFunc = func_80938504;
+}
+
+void func_80938504(ObjBean* this, GlobalContext* globalCtx) {
+ this->unk_1AC -= 2400;
+ this->dyna.actor.scale.y = Math_SinS(this->unk_1AC) * 0.17434467f;
+ this->dyna.actor.scale.x = this->dyna.actor.scale.z = Math_CosS(this->unk_1AC) * 0.12207746f;
+ if (this->unk_1AC < 6372) {
+ func_80938588(this);
+ }
+}
+
+void func_80938588(ObjBean* this) {
+ this->unk_1AC = 0;
+ this->unk_1AE = 3000;
+ this->actionFunc = func_809385A8;
+}
+
+void func_809385A8(ObjBean* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s16 sp22;
+
+ this->unk_1AC += 16000;
+ this->unk_1AE -= 200;
+ sp22 = 6372.0f - (Math_SinS(this->unk_1AC) * this->unk_1AE);
+ this->dyna.actor.scale.y = Math_SinS(sp22) * 0.17434467f;
+ this->dyna.actor.scale.x = this->dyna.actor.scale.z = Math_CosS(sp22) * 0.12207746f;
+ if (this->unk_1AE < 0) {
+ func_80937C30(this);
+ func_80937FB0(this);
+ }
+}
+
+void func_80938670(ObjBean* this) {
+ this->actionFunc = func_8093868C;
+ this->unk_1B2 = 73;
+}
+
+void func_8093868C(ObjBean* this, GlobalContext* globalCtx) {
+ if (this->unk_1B2 <= 0) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ } else if (this->unk_1B2 <= 20) {
+ this->dyna.actor.scale.x *= 0.89f;
+ this->dyna.actor.scale.y *= 0.89f;
+ this->dyna.actor.scale.z *= 0.89f;
+ this->unk_1B8 *= 0.89f;
+ }
+}
+
+void func_80938704(ObjBean* this) {
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->dyna.actor.draw = NULL;
+ this->actionFunc = func_80938728;
+}
+
+void func_80938728(ObjBean* this, GlobalContext* globalCtx) {
+ if (this->unk_200 != 0) {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ func_8093876C(this);
+ }
+}
+
+void func_8093876C(ObjBean* this) {
+ this->actionFunc = func_80938780;
+}
+
+void func_80938780(ObjBean* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
+ if (this->dyna.actor.cutscene >= 0) {
+ func_800B7298(globalCtx, &this->dyna.actor, 1);
+ }
+ this->unk_1B4 = 36;
+ func_80937130(this);
+ func_80938AA4(this);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ }
+}
+
+void func_80938804(ObjBean* this) {
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10;
+ this->dyna.actor.draw = func_80938E00;
+ this->actionFunc = func_80938834;
+}
+
+void func_80938834(ObjBean* this, GlobalContext* globalCtx) {
+ if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
+ func_80938874(this);
+ }
+ func_80936F24(this);
+}
+
+void func_80938874(ObjBean* this) {
+ this->actionFunc = func_809388A8;
+ this->dyna.actor.draw = func_80938E00;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->dyna.actor.speedXZ = 0.0f;
+}
+
+void func_809388A8(ObjBean* this, GlobalContext* globalCtx) {
+ func_809372D0(this);
+ if (this->unk_1DA == this->unk_1D8) {
+ func_80937268(this, globalCtx);
+ func_809372A8(this);
+ func_8093892C(this);
+ } else if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
+ func_800B9010(&this->dyna.actor, NA_SE_PL_PLANT_MOVE - SFX_FLAG);
+ }
+ func_80936F24(this);
+}
+
+void func_8093892C(ObjBean* this) {
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->dyna.actor.draw = func_80938E00;
+ this->actionFunc = func_80938958;
+}
+
+void func_80938958(ObjBean* this, GlobalContext* globalCtx) {
+ if (!DynaPolyActor_IsInRidingRotatingState(&this->dyna)) {
+ func_80938804(this);
+ }
+ func_80936F24(this);
+}
+
+void func_80938998(ObjBean* this) {
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->dyna.actor.draw = NULL;
+ this->actionFunc = func_809389BC;
+}
+
+void func_809389BC(ObjBean* this, GlobalContext* globalCtx) {
+ if (!DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
+ func_80937268(this, globalCtx);
+ func_809372A8(this);
+ func_80937238(this);
+ func_80938A14(this);
+ }
+}
+
+void func_80938A14(ObjBean* this) {
+ this->dyna.actor.draw = NULL;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->unk_1B2 = 100;
+ func_80937130(this);
+ this->actionFunc = func_80938A5C;
+}
+
+void func_80938A5C(ObjBean* this, GlobalContext* globalCtx) {
+ if (func_80937468(this, globalCtx)) {
+ this->unk_1B2 = 100;
+ } else if (this->unk_1B2 <= 0) {
+ func_80938AA4(this);
+ }
+}
+
+void func_80938AA4(ObjBean* this) {
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ this->dyna.actor.draw = func_80938E00;
+ this->unk_1B2 = 30;
+ this->actionFunc = func_80938AD8;
+}
+
+void func_80938AD8(ObjBean* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp30 = func_80937468(this, globalCtx);
+
+ func_80937160(this);
+ if (this->unk_1B2 == 25) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_PL_PLANT_GROW_BIG);
+ }
+
+ if (sp30 != 0) {
+ func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ } else {
+ func_800C6314(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ }
+
+ if (this->dyna.actor.xzDistToPlayer < 74.0f) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 sp28 = 74.0f - this->dyna.actor.xzDistToPlayer;
+ f32 sin;
+ f32 cos;
+
+ if (sp28 > 8.0f) {
+ sp28 = 8.0f;
+ }
+
+ sin = Math_SinS(this->dyna.actor.yawTowardsPlayer) * sp28;
+ cos = Math_CosS(this->dyna.actor.yawTowardsPlayer) * sp28;
+
+ player->actor.world.pos.x += sin;
+ player->actor.world.pos.z += cos;
+ }
+
+ if ((this->unk_1B2 <= 0) && (sp30 == 0)) {
+ func_80936F04(this);
+ func_80938804(this);
+ }
+}
+
+void func_80938C1C(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBean* this = THIS;
+
+ if (this->unk_1B2 > 0) {
+ this->unk_1B2--;
+ }
+
+ if (this->unk_1DF > 0) {
+ this->unk_1DF--;
+ if (this->unk_1DF == 0) {
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ }
+ }
+
+ this->actionFunc(this, globalCtx);
+}
+
+void ObjBean_Update(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjBean* this = THIS;
+
+ if (this->unk_1B2 > 0) {
+ this->unk_1B2--;
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->unk_1B4 > 0) {
+ this->unk_1B4--;
+ if (this->unk_1B4 == 0) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ }
+ }
+
+ if (this->dyna.actor.draw != NULL) {
+ func_80937238(this);
+ if (this->dyna.actor.xzDistToPlayer < 150.0f) {
+ this->collider.dim.radius = (this->dyna.actor.scale.x * 640.0f) + 0.5f;
+ Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+ func_80936CF0(this, globalCtx);
+ this->dyna.actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ this->dyna.actor.shape.shadowScale = this->dyna.actor.scale.x * 88.0f;
+ if (func_80937468(this, globalCtx)) {
+ func_809375F4(this, globalCtx);
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ func_80938998(this);
+ }
+ } else {
+ this->dyna.actor.shape.shadowDraw = NULL;
+ }
+ Actor_SetFocus(&this->dyna.actor, 6.0f);
+}
+
+void func_80938E00(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBean* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+
+ if (this->unk_1FE & 4) {
+ gSPDisplayList(POLY_OPA_DISP++, object_mamenoki_DL_000090);
+ }
+
+ if (this->unk_1FE & 2) {
+ gSPDisplayList(POLY_OPA_DISP++, object_mamenoki_DL_0002D0);
+ }
+
+ if (this->unk_1FE & 1) {
+ Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
+ this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
+ Matrix_Scale(this->unk_1B8, this->unk_1B8, this->unk_1B8, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_mamenoki_DL_000530);
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80938F50(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBean* this = THIS;
+
+ Gfx_DrawDListXlu(globalCtx, object_mamenoki_DL_002208);
+}
diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
index 5156011ffe..da6e4a22c4 100644
--- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
+++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.h
@@ -6,9 +6,16 @@
struct ObjBean;
typedef void (*ObjBeanActionFunc)(struct ObjBean*, GlobalContext*);
+typedef void (*ObjBeanUnkFunc)(struct ObjBean*);
+#define OBJBEAN_GET_7F(thisx, x) (((thisx)->params + (x)) & 0x7F)
+#define OBJBEAN_GET_80(thisx) (((thisx)->params >> 7) & 1)
+#define OBJBEAN_GET_3F00(thisx) (((thisx)->params >> 8) & 0x3F)
+#define OBJBEAN_GET_3F80(thisx, x) ((((thisx)->params >> 7) + (x)) & 0x7F)
#define OBJBEAN_GET_C000(thisx) (((thisx)->params >> 0xE) & 3)
+#define OBJBEAN_GET_3(thisx) ((thisx)->home.rot.z & 3)
+
enum {
/* 0x00 */ ENOBJBEAN_GET_C000_0,
/* 0x01 */ ENOBJBEAN_GET_C000_1,
@@ -16,13 +23,40 @@ enum {
};
typedef struct ObjBean {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
- /* 0x015C */ ObjBeanActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0x80];
- /* 0x01E0 */ s8 unk_1E0;
- /* 0x01E4 */ s32 unk_1E4;
- /* 0x01E8 */ char unk_1E8[0x1C];
+ /* 0x000 */ DynaPolyActor dyna;
+ /* 0x15C */ ObjBeanActionFunc actionFunc;
+ /* 0x160 */ ColliderCylinder collider;
+ /* 0x1AC */ s16 unk_1AC;
+ /* 0x1AE */ s16 unk_1AE;
+ /* 0x1B0 */ s16 unk_1B0;
+ /* 0x1B2 */ s16 unk_1B2;
+ /* 0x1B4 */ s8 unk_1B4;
+ /* 0x1B8 */ f32 unk_1B8;
+ /* 0x1BC */ Vec3f unk_1BC;
+ /* 0x1C8 */ f32 unk_1C8;
+ /* 0x1CC */ f32 unk_1CC;
+ /* 0x1D0 */ f32 unk_1D0;
+ /* 0x1D4 */ Vec3s* unk_1D4;
+ /* 0x1D8 */ s16 unk_1D8;
+ /* 0x1DA */ s16 unk_1DA;
+ /* 0x1DC */ s16 unk_1DC;
+ /* 0x1DE */ s8 unk_1DE;
+ /* 0x1DF */ s8 unk_1DF;
+ /* 0x1E0 */ s8 unk_1E0;
+ /* 0x1E4 */ s32 unk_1E4;
+ /* 0x1E8 */ ObjBeanUnkFunc unk_1E8;
+ /* 0x1EC */ s16 unk_1EC;
+ /* 0x1EE */ s16 unk_1EE;
+ /* 0x1F0 */ s16 unk_1F0;
+ /* 0x1F2 */ s16 unk_1F2;
+ /* 0x1F4 */ s16 unk_1F4;
+ /* 0x1F6 */ s16 unk_1F6;
+ /* 0x1F8 */ s16 unk_1F8;
+ /* 0x1FA */ s16 unk_1FA;
+ /* 0x1FC */ s16 unk_1FC;
+ /* 0x1FE */ u8 unk_1FE;
+ /* 0x1FF */ u8 unk_1FF;
+ /* 0x200 */ u8 unk_200;
} ObjBean; // size = 0x204
extern const ActorInit Obj_Bean_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c
index 651adf6d22..dd57b99e41 100644
--- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c
+++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_bell.h"
+#include "objects/object_f52_obj/object_f52_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjBell*)thisx)
@@ -111,14 +112,6 @@ static DamageTable sDamageTable = {
/* Powder Keg */ DMG_ENTRY(1, 0xE),
};
-extern CollisionHeader D_06001BA8;
-extern Gfx D_06000570[]; // Bell post
-extern Gfx D_06000698[]; // Bell
-extern Gfx D_060007A8[]; // Bell Base
-extern Gfx D_06000840[]; // Bell Shadow
-extern Gfx D_060008D0[]; // Bell Hook
-extern Gfx D_06000960[]; // Bell Designs
-
s32 func_80A35510(ObjBell* this, s32 arg1) {
Vec3f bumperPos;
Vec3f worldPos;
@@ -233,10 +226,10 @@ void func_80A359B4(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000698);
- gSPDisplayList(POLY_OPA_DISP++, D_060008D0);
- gSPDisplayList(POLY_OPA_DISP++, D_06000960);
- gSPDisplayList(POLY_OPA_DISP++, D_060007A8);
+ gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000698);
+ gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_0008D0);
+ gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000960);
+ gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_0007A8);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -247,7 +240,7 @@ void func_80A35B18(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000570);
+ gSPDisplayList(POLY_OPA_DISP++, object_f52_obj_DL_000570);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -257,7 +250,7 @@ void func_80A35BD4(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06000840);
+ gSPDisplayList(POLY_XLU_DISP++, object_f52_obj_DL_000840);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -265,7 +258,7 @@ void ObjBell_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjBell* this = THIS;
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06001BA8);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_f52_obj_Colheader_001BA8);
Actor_SetScale(&this->dyna.actor, 0.08f);
Collider_InitAndSetSphere(globalCtx, &this->collider1, &this->dyna.actor, &sCylinderInit1);
Collider_InitAndSetSphere(globalCtx, &this->collider2, &this->dyna.actor, &sCylinderInit2);
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 176f961be8..0d937d1c06 100644
--- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c
+++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c
@@ -6,7 +6,7 @@
#include "z_obj_blockstop.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjBlockstop*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c
index 341dc5c56a..880d72b3f0 100644
--- a/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c
+++ b/src/overlays/actors/ovl_Obj_Boat/z_obj_boat.c
@@ -6,7 +6,7 @@
#include "z_obj_boat.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjBoat*)thisx)
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 0b91f6f5ff..8a09c6f01a 100644
--- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c
+++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_bombiwa.h"
+#include "objects/object_bombiwa/object_bombiwa.h"
#define FLAGS 0x00000000
@@ -14,10 +15,15 @@ void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx);
+s32 func_809393B0(Actor* thisx);
+s32 func_80939470(Actor* thisx);
+void func_80939EE0(ObjBombiwa* this);
void func_80939EF4(ObjBombiwa* this, GlobalContext* globalCtx);
+void func_8093A080(ObjBombiwa* this);
void func_8093A1F0(ObjBombiwa* this, GlobalContext* globalCtx);
+void func_8093A418(Actor* thisx, GlobalContext* globalCtx);
+void func_8093A608(Actor* thisx, GlobalContext* globalCtx);
-#if 0
const ActorInit Obj_Bombiwa_InitVars = {
ACTOR_OBJ_BOMBIWA,
ACTORCAT_PROP,
@@ -30,70 +36,495 @@ const ActorInit Obj_Bombiwa_InitVars = {
(ActorFunc)NULL,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_8093A940 = {
- { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x81C37FBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_HARD,
+ AT_NONE,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x81C37FBE, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 55, 70, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_8093A96C = {
- { COLTYPE_HARD, AT_NONE, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x81C37BBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_HARD,
+ AT_NONE,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x81C37BBE, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 75, 130, 0, { 0, 0, 0 } },
};
-// sColChkInfoInit
-static CollisionCheckInfoInit D_8093A9B8 = { 0, 12, 60, MASS_IMMOVABLE };
+typedef struct {
+ /* 0x00 */ ColliderCylinderInit* collider;
+ /* 0x04 */ ActorShadowFunc unk_04;
+ /* 0x08 */ ActorFunc unk_08;
+ /* 0x0C */ s32 (*unk_0C)(Actor*);
+} ObjBombiwaStruct2;
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8093A9C0[] = {
+static ObjBombiwaStruct2 D_8093A998[] = {
+ { &sCylinderInit1, ActorShadow_DrawCircle, func_8093A418, func_809393B0 },
+ { &sCylinderInit2, NULL, func_8093A608, func_80939470 },
+};
+
+static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP),
};
-#endif
+static s16 D_8093A9D0[] = {
+ 17, 14, 10, 8, 7, 5, 3, 2,
+};
-extern ColliderCylinderInit D_8093A940;
-extern ColliderCylinderInit D_8093A96C;
-extern CollisionCheckInfoInit D_8093A9B8;
-extern InitChainEntry D_8093A9C0[];
+static s16 D_8093A9E0[] = {
+ 16, 12, 8, 6, 5, 4, 3, 2,
+};
-extern UNK_TYPE D_060009E0;
-extern UNK_TYPE D_06004560;
-extern UNK_TYPE D_06005990;
+s32 func_809393B0(Actor* thisx) {
+ ObjBombiwa* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_809393B0.s")
+ if (this->collider.base.acFlags & AC_HIT) {
+ Actor* ac = this->collider.base.ac;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939470.s")
+ if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000) {
+ if ((ac != NULL) && (Math3D_Vec3fDistSq(&this->actor.world.pos, &ac->world.pos) < SQ(150.0f))) {
+ return true;
+ }
+ } else if (this->collider.info.acHitInfo->toucher.dmgFlags & 8) {
+ if ((ac != NULL) && (Math3D_Vec3fDistSq(&this->actor.world.pos, &ac->world.pos) < SQ(95.0f))) {
+ return true;
+ }
+ } else if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x500) {
+ return true;
+ }
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093951C.s")
+s32 func_80939470(Actor* thisx) {
+ ObjBombiwa* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939594.s")
+ if (this->collider.base.acFlags & AC_HIT) {
+ Actor* temp_v0 = this->collider.base.ac;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Init.s")
+ if (temp_v0 != NULL) {
+ if (this->collider.info.acHitInfo->toucher.dmgFlags & 0x80000000) {
+ if (Math3D_Vec3fDistSq(&this->actor.world.pos, &temp_v0->world.pos) < SQ(175.0f)) {
+ return true;
+ }
+ } else if ((this->collider.info.acHitInfo->toucher.dmgFlags & 8) &&
+ (Math3D_Vec3fDistSq(&this->actor.world.pos, &temp_v0->world.pos) < SQ(115.0f))) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Destroy.s")
+s32 func_8093951C(ObjBombiwa* this, GlobalContext* globalCtx) {
+ s32 pad;
+ WaterBox* sp30;
+ f32 sp2C;
+ s32 sp28;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939794.s")
+ if (WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &sp2C,
+ &sp30, &sp28) &&
+ (this->actor.world.pos.y < sp2C)) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939994.s")
+void func_80939594(ObjBombiwa* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp28;
+ s32 sp24;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939C50.s")
+ sp28.x = this->actor.world.pos.x;
+ sp28.y = this->actor.world.pos.y + 30.0f;
+ sp28.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939EE0.s")
+ this->actor.floorHeight =
+ BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->actor.floorPoly, &sp24, &this->actor, &sp28);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_80939EF4.s")
+void ObjBombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjBombiwa* this = THIS;
+ s32 sp34 = OBJBOMBIWA_GET_100(&this->actor);
+ s32 pad2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A080.s")
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ Collider_InitCylinder(globalCtx, &this->collider);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A1F0.s")
+ if (Flags_GetSwitch(globalCtx, OBJBOMBIWA_GET_7F(&this->actor))) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/ObjBombiwa_Update.s")
+ Collider_SetCylinder(globalCtx, &this->collider, &this->actor, D_8093A998[sp34].collider);
+ Collider_UpdateCylinder(&this->actor, &this->collider);
+ CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A418.s")
+ if (sp34 == OBJBOMBIWA_100_0) {
+ if (this->actor.shape.rot.y == 0) {
+ this->actor.shape.rot.y = this->actor.world.rot.y = (u32)Rand_Next() >> 0x10;
+ }
+ func_80939594(this, globalCtx);
+ }
+ ActorShape_Init(&this->actor.shape, -200.0f, D_8093A998[sp34].unk_04, 9.8f);
+ this->actor.world.pos.y = this->actor.home.pos.y + 20.0f;
+ this->actor.draw = D_8093A998[sp34].unk_08;
+ if (func_8093951C(this, globalCtx)) {
+ this->unk_203 |= 1;
+ }
+ func_80939EE0(this);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Bombiwa/func_8093A608.s")
+void ObjBombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ Collider_DestroyCylinder(globalCtx, &THIS->collider);
+}
+
+void func_80939794(ObjBombiwa* this, GlobalContext* globalCtx) {
+ Vec3f spB4;
+ Vec3f spA8;
+ s32 phi_v1;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(D_8093A9D0); i++) {
+ spB4.x = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.x;
+ spB4.y = (Rand_ZeroOne() * 5.0f) + this->actor.home.pos.y + 8.0f;
+ spB4.z = ((Rand_ZeroOne() - 0.5f) * 10.0f) + this->actor.home.pos.z;
+
+ spA8.x = (Rand_ZeroOne() - 0.5f) * 15.0f;
+ spA8.y = (Rand_ZeroOne() * 16.0f) + 5.0f;
+ spA8.z = (Rand_ZeroOne() - 0.5f) * 15.0f;
+
+ if (D_8093A9D0[i] > 10) {
+ phi_v1 = 0x25;
+ } else {
+ phi_v1 = 0x21;
+ }
+ EffectSsKakera_Spawn(globalCtx, &spB4, &spA8, &spB4, -400, phi_v1, 10, 2, 0, D_8093A9D0[i], 1, 0, 60, -1,
+ OBJECT_BOMBIWA, object_bombiwa_DL_0009E0);
+ }
+
+ func_800BBFB0(globalCtx, &this->actor.world.pos, 60.0f, 8, 80, 140, 1);
+}
+
+void func_80939994(GlobalContext* globalCtx, Vec3f* arg1) {
+ Vec3f spAC;
+ Vec3f spA0;
+ s16 phi_v0;
+ s16 life;
+ s32 i;
+
+ for (i = 0; i < 16; i++) {
+ spAC.x = (Rand_ZeroOne() - 0.5f) * 80.0f;
+ spAC.y = Rand_ZeroOne() * 120.0f;
+ spAC.z = (Rand_ZeroOne() - 0.5f) * 80.0f;
+
+ spA0.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spAC.x * 0.2f);
+ spA0.y = (Rand_ZeroOne() * 16.0f) + 5.0f;
+ spA0.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spAC.z * 0.2f);
+
+ spAC.x += arg1->x;
+ spAC.y += arg1->y;
+ spAC.z += arg1->z;
+
+ if (i >= 14) {
+ phi_v0 = 33;
+ life = 60;
+ } else if (i >= 12) {
+ phi_v0 = 65;
+ life = 60;
+ } else {
+ life = 40;
+ if (Rand_ZeroOne() < 0.7f) {
+ phi_v0 = 64;
+ } else {
+ phi_v0 = 32;
+ }
+ }
+ EffectSsKakera_Spawn(globalCtx, &spAC, &spA0, &spAC, -450, phi_v0, 15, 0, 0, i, 1, 0, life, -1, OBJECT_BOMBIWA,
+ object_bombiwa_DL_005990);
+ }
+
+ func_800BBFB0(globalCtx, arg1, 120.0f, 3, 80, 140, 1);
+
+ spAC.x = arg1->x;
+ spAC.y = arg1->y + 70.0f;
+ spAC.z = arg1->z;
+
+ func_800BBFB0(globalCtx, &spAC, 120.0f, 3, 80, 140, 1);
+}
+
+void func_80939C50(GlobalContext* globalCtx, Vec3f* arg1) {
+ Vec3f spBC;
+ Vec3f spB0;
+ s32 phi_v0;
+ s32 phi_s0;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(D_8093A9E0); i++) {
+ spBC.x = (Rand_ZeroOne() - 0.5f) * 15.0f;
+ spBC.y = (Rand_ZeroOne() - 0.2f) * 10.0f;
+ spBC.z = (Rand_ZeroOne() - 0.5f) * 15.0f;
+
+ spB0.x = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spBC.x * 0.85f);
+ spB0.y = (Rand_ZeroOne() * 15.0f) + 8.0f;
+ spB0.z = ((Rand_ZeroOne() - 0.5f) * 3.0f) + (spBC.z * 0.85f);
+
+ spBC.x += arg1->x;
+ spBC.y += arg1->y;
+ spBC.z += arg1->z;
+
+ if (i == 0) {
+ phi_v0 = 33;
+ phi_s0 = 60;
+ } else if (i == 1) {
+ phi_v0 = 65;
+ phi_s0 = 60;
+ } else {
+ phi_s0 = 40;
+ if (Rand_ZeroOne() < 0.7f) {
+ phi_v0 = 64;
+ } else {
+ phi_v0 = 32;
+ }
+ }
+ EffectSsKakera_Spawn(globalCtx, &spBC, &spB0, &spBC, -450, phi_v0, 15, 0, 0, D_8093A9E0[i], 1, 0, phi_s0, -1,
+ OBJECT_BOMBIWA, object_bombiwa_DL_005990);
+ }
+
+ func_800BBFB0(globalCtx, arg1, 60.0f, 4, 80, 140, 1);
+}
+
+void func_80939EE0(ObjBombiwa* this) {
+ this->actionFunc = func_80939EF4;
+}
+
+void func_80939EF4(ObjBombiwa* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 params = OBJBOMBIWA_GET_100(&this->actor);
+ ObjBombiwaStruct2* sp28 = &D_8093A998[params];
+
+ if (this->collider.base.acFlags & AC_HIT) {
+ this->unk_202 = 5;
+ }
+
+ if (sp28->unk_0C(&this->actor)) {
+ Flags_SetSwitch(globalCtx, OBJBOMBIWA_GET_7F(&this->actor));
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN);
+ if (OBJBOMBIWA_GET_8000(&this->actor)) {
+ play_sound(NA_SE_SY_CORRECT_CHIME);
+ }
+
+ if (params == OBJBOMBIWA_100_0) {
+ func_80939794(this, globalCtx);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ func_80939994(globalCtx, &this->actor.world.pos);
+ this->actor.flags |= ACTOR_FLAG_10;
+ func_8093A080(this);
+ }
+ } else {
+ this->collider.base.acFlags &= ~AC_HIT;
+
+ if (this->actor.xzDistToPlayer < 1400.0f) {
+ if (this->unk_202 > 0) {
+ this->unk_202--;
+ if (this->unk_202 == 0) {
+ this->collider.base.colType = COLTYPE_HARD;
+ } else {
+ this->collider.base.colType = COLTYPE_NONE;
+ }
+ }
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+ }
+}
+
+void func_8093A080(ObjBombiwa* this) {
+ ObjBombiwaStruct* ptr;
+ s16 phi_s2;
+ s32 i;
+
+ for (i = 0, phi_s2 = 0; i < ARRAY_COUNT(this->unk_190); i++, phi_s2 += 0x4000) {
+ ptr = &this->unk_190[i];
+
+ ptr->unk_00 = (Rand_ZeroOne() * 0.1f) + 0.05f;
+
+ ptr->unk_04.x = (Math_SinS(phi_s2) * 50.0f) + this->actor.world.pos.x;
+ ptr->unk_04.y = ((i + 1) * 31.0f) + this->actor.world.pos.y;
+ ptr->unk_04.z = (Math_CosS(phi_s2) * 50.0f) + this->actor.world.pos.z;
+
+ ptr->unk_10 = i + 3.0f;
+ ptr->unk_14.x = phi_s2;
+ ptr->unk_14.y = (u32)Rand_Next() >> 0x10;
+ ptr->unk_14.z = 0;
+ ptr->unk_1A = 0;
+ }
+
+ this->unk_200 = 0;
+ this->unk_201 = 80;
+ this->actionFunc = func_8093A1F0;
+}
+
+void func_8093A1F0(ObjBombiwa* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 i;
+ Vec3f sp9C;
+ ObjBombiwaStruct* ptr;
+ CollisionPoly* sp94;
+ s32 sp90;
+ f32 temp_f0;
+ s16 phi_s1;
+
+ for (i = 0, phi_s1 = 0; i < ARRAY_COUNT(this->unk_190); i++, phi_s1 += 0x4000) {
+ ptr = &this->unk_190[i];
+
+ if (ptr->unk_1A != 0) {
+ continue;
+ }
+
+ ptr->unk_10 -= 3.0f;
+
+ ptr->unk_04.x += Math_SinS(phi_s1) * 1.5f;
+ ptr->unk_04.y += ptr->unk_10;
+ ptr->unk_04.z += Math_CosS(phi_s1) * 1.5f;
+
+ ptr->unk_14.x += 0x5DC;
+
+ sp9C.x = ptr->unk_04.x;
+ sp9C.y = ptr->unk_04.y + 30.0f;
+ sp9C.z = ptr->unk_04.z;
+
+ temp_f0 = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &sp94, &sp90, &this->actor, &sp9C);
+ if ((temp_f0 <= (BGCHECK_Y_MIN + 10.0f)) || ((ptr->unk_04.y - (200.0f * ptr->unk_00)) < temp_f0)) {
+ this->unk_200++;
+ ptr->unk_1A = 1;
+ func_80939C50(globalCtx, &ptr->unk_04);
+ }
+ }
+
+ this->unk_201--;
+ if ((this->unk_200 >= 4) || (this->unk_201 <= 0)) {
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void ObjBombiwa_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBombiwa* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+}
+
+void func_8093A418(Actor* thisx, GlobalContext* globalCtx) {
+ ObjBombiwa* this = THIS;
+ f32 sp28;
+
+ if ((this->actor.projectedPos.z <= 2200.0f) || ((this->unk_203 & 1) && (this->actor.projectedPos.z < 2300.0f))) {
+ this->actor.shape.shadowAlpha = 160;
+ Gfx_DrawDListOpa(globalCtx, object_bombiwa_DL_0009E0);
+ return;
+ }
+
+ if (this->actor.projectedPos.z < 2300.0f) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ sp28 = (2300.0f - this->actor.projectedPos.z) * 2.55f;
+
+ this->actor.shape.shadowAlpha = sp28 * (32.0f / 51);
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, (s32)sp28);
+ gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_000AF0);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else {
+ this->actor.shape.shadowAlpha = 0;
+ }
+}
+
+void func_8093A608(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad[8];
+ ObjBombiwa* this = THIS;
+ f32 sp38;
+ s32 i;
+ ObjBombiwaStruct* ptr;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (this->actionFunc == func_80939EF4) {
+ if ((this->actor.projectedPos.z <= 2200.0f) ||
+ ((this->unk_203 & 1) && (this->actor.projectedPos.z < 2300.0f))) {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_OPA_DISP++, 0x08, D_801AEFA0);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x9B, 255, 255, 255, 255);
+ gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_004560);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_004688);
+ } else if (this->actor.projectedPos.z < 2300.0f) {
+ sp38 = (2300.0f - this->actor.projectedPos.z) * 2.55f;
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_XLU_DISP++, 0x08, D_801AEF88);
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x9B, 255, 255, 255, (s32)sp38);
+ gSPDisplayList(POLY_XLU_DISP++, object_bombiwa_DL_004560);
+ }
+ } else {
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ for (i = 0; i < ARRAY_COUNT(this->unk_190); i++) {
+ ptr = &this->unk_190[i];
+
+ if (ptr->unk_1A == 0) {
+ Matrix_SetStateRotationAndTranslation(ptr->unk_04.x, ptr->unk_04.y, ptr->unk_04.z, &ptr->unk_14);
+ Matrix_Scale(ptr->unk_00, ptr->unk_00, ptr->unk_00, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_bombiwa_DL_005990);
+ }
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
index 36fafc7e6a..54d4024e99 100644
--- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
+++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.h
@@ -7,9 +7,28 @@ struct ObjBombiwa;
typedef void (*ObjBombiwaActionFunc)(struct ObjBombiwa*, GlobalContext*);
+#define OBJBOMBIWA_GET_7F(thisx) ((thisx)->params & 0x7F)
+#define OBJBOMBIWA_GET_100(thisx) (((thisx)->params >> 8) & 1)
+#define OBJBOMBIWA_GET_8000(thisx) (((thisx)->params >> 0xF) & 1)
+
+#define OBJBOMBIWA_100_0 0
+
+typedef struct {
+ /* 0x00 */ f32 unk_00;
+ /* 0x04 */ Vec3f unk_04;
+ /* 0x10 */ f32 unk_10;
+ /* 0x14 */ Vec3s unk_14;
+ /* 0x1A */ s16 unk_1A;
+} ObjBombiwaStruct; // size = 0x1C
+
typedef struct ObjBombiwa {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0xC0];
+ /* 0x0144 */ ColliderCylinder collider;
+ /* 0x0190 */ ObjBombiwaStruct unk_190[4];
+ /* 0x0200 */ s8 unk_200;
+ /* 0x0201 */ s8 unk_201;
+ /* 0x0202 */ s8 unk_202;
+ /* 0x0203 */ u8 unk_203;
/* 0x0204 */ ObjBombiwaActionFunc actionFunc;
} ObjBombiwa; // size = 0x208
diff --git a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c
index a0d6301f33..b8da1a9f65 100644
--- a/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c
+++ b/src/overlays/actors/ovl_Obj_Boyo/z_obj_boyo.c
@@ -7,8 +7,9 @@
#include "z_obj_boyo.h"
#include "overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
+#include "objects/object_boyo/object_boyo.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjBoyo*)thisx)
@@ -56,9 +57,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern Gfx D_06000300[];
-extern AnimatedMaterial D_06000E88;
-
void ObjBoyo_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjBoyo* this = THIS;
@@ -67,7 +65,7 @@ void ObjBoyo_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->collider);
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
- this->unk_190 = Lib_SegmentedToVirtual(&D_06000E88);
+ this->unk_190 = Lib_SegmentedToVirtual(object_boyo_Matanimheader_000E88);
}
void ObjBoyo_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
@@ -121,8 +119,8 @@ Actor* ObjBoyo_GetCollidedActor(ObjBoyo* this, GlobalContext* globalCtx, s32* nu
}
void ObjBoyo_Update(Actor* thisx, GlobalContext* globalCtx2) {
- ObjBoyo* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ ObjBoyo* this = THIS;
Actor* target;
s32 num;
@@ -182,5 +180,5 @@ void ObjBoyo_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjBoyo* this = THIS;
AnimatedMat_Draw(globalCtx, this->unk_190);
- Gfx_DrawDListOpa(globalCtx, D_06000300);
+ Gfx_DrawDListOpa(globalCtx, object_boyo_DL_000300);
}
diff --git a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
index 2ac00d73f3..465c660c69 100644
--- a/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
+++ b/src/overlays/actors/ovl_Obj_Chan/z_obj_chan.c
@@ -6,7 +6,7 @@
#include "z_obj_chan.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjChan*)thisx)
@@ -23,7 +23,7 @@ const ActorInit Obj_Chan_InitVars = {
ACTOR_OBJ_CHAN,
ACTORCAT_BG,
FLAGS,
- OBJECT_OBJECT_UNSET_CHAN,
+ OBJECT_OBJ_CHAN,
sizeof(ObjChan),
(ActorFunc)ObjChan_Init,
(ActorFunc)ObjChan_Destroy,
diff --git a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c
index c1e74ce532..7de79a2be2 100644
--- a/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c
+++ b/src/overlays/actors/ovl_Obj_Chikuwa/z_obj_chikuwa.c
@@ -6,7 +6,7 @@
#include "z_obj_chikuwa.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjChikuwa*)thisx)
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 4a82c76098..f406340448 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_comb.h"
+#include "objects/object_comb/object_comb.h"
#define FLAGS 0x00000000
@@ -15,11 +16,12 @@ void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_8098DC44(ObjComb* this);
void func_8098DC60(ObjComb* this, GlobalContext* globalCtx);
void func_8098DEA0(ObjComb* this, GlobalContext* globalCtx);
+void func_8098E098(ObjComb* this);
void func_8098E0B8(ObjComb* this, GlobalContext* globalCtx);
-#if 0
const ActorInit Obj_Comb_InitVars = {
ACTOR_OBJ_COMB,
ACTORCAT_PROP,
@@ -32,71 +34,538 @@ const ActorInit Obj_Comb_InitVars = {
(ActorFunc)ObjComb_Draw,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_8098E440[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
- { ELEMTYPE_UNK0, { 0x00000000, 0x00, 0x00 }, { 0x05CBFFBE, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00000000, 0x00, 0x00 },
+ { 0x05CBFFBE, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 0, { { 0, 0, 0 }, 15 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_8098E464 = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_PLAYER, OC2_TYPE_2, COLSHAPE_JNTSPH, },
- 1, D_8098E440, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_PLAYER,
+ OC2_TYPE_2,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_8098E474[] = {
+static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1200, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_STOP),
};
-#endif
+s32 func_8098CE40(ObjComb* this, GlobalContext* globalCtx) {
+ s32 phi_a2 = -1;
+ s32 temp_v0 = (OBJCOMB_GET_1F(&this->actor) << 2) | 0xFF01;
-extern ColliderJntSphElementInit D_8098E440[1];
-extern ColliderJntSphInit D_8098E464;
-extern InitChainEntry D_8098E474[];
+ if ((u8)temp_v0 & 3) {
+ phi_a2 = ((temp_v0 & 0x3FC) >> 2) & 0xFF;
+ }
-extern UNK_TYPE D_06000CB0;
-extern UNK_TYPE D_06001040;
+ return ((phi_a2 < 0) == 1) || !Flags_GetTreasure(globalCtx, phi_a2);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098CE40.s")
+void func_8098CEAC(ObjComb* this, GlobalContext* globalCtx) {
+ Vec3f spDC;
+ Vec3f spD0;
+ Vec3f spC4;
+ s32 i;
+ f32 temp_f20;
+ s16 temp_s2 = 0;
+ s16 temp_f10;
+ s32 phi_s0;
+ s32 phi_v0;
+ s32 phi_s1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098CEAC.s")
+ for (i = 0; i < 31; i++) {
+ temp_s2 += 0x4E20;
+ temp_f20 = Rand_ZeroOne() * 10.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D19C.s")
+ spDC.x = Math_SinS(temp_s2) * temp_f20;
+ spDC.y = (i - 15) * 0.7f;
+ spDC.z = Math_CosS(temp_s2) * temp_f20;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D47C.s")
+ Math_Vec3f_Sum(&spDC, &this->actor.world.pos, &spD0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D6E0.s")
+ spC4.x = (Rand_ZeroOne() - 0.5f) + (spDC.x * 0.5f);
+ spC4.y = (Rand_ZeroOne() - 0.5f) + (spDC.y * 0.6f);
+ spC4.z = (Rand_ZeroOne() - 0.5f) + (spDC.z * 0.5f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D870.s")
+ temp_f10 = (Rand_ZeroOne() * 72.0f) + 25.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D8C8.s")
+ if (temp_f10 < 40) {
+ phi_s0 = -200;
+ phi_s1 = 40;
+ } else if (temp_f10 < 70) {
+ phi_s0 = -280;
+ phi_s1 = 30;
+ } else {
+ phi_s0 = -340;
+ phi_s1 = 20;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098D99C.s")
+ temp_f20 = Rand_ZeroOne();
+ if (temp_f20 < 0.1f) {
+ phi_v0 = 0x60;
+ } else if (temp_f20 < 0.8f) {
+ phi_v0 = 0x40;
+ } else {
+ phi_v0 = 0x20;
+ }
+ EffectSsKakera_Spawn(globalCtx, &spD0, &spC4, &spD0, phi_s0, phi_v0, phi_s1, 4, 0, temp_f10, 0, 0, 60, -1,
+ OBJECT_COMB, object_comb_DL_001040);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DA74.s")
+ spD0.x = this->actor.world.pos.x;
+ spD0.y = this->actor.world.pos.y - 10.0f;
+ spD0.z = this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Init.s")
+ func_800BBFB0(globalCtx, &spD0, 40.0f, 6, 70, 60, 1);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Destroy.s")
+void func_8098D19C(ObjComb* this, GlobalContext* globalCtx) {
+ Vec3f spDC;
+ Vec3f spD0;
+ Vec3f spC4;
+ f32 temp_f20;
+ s16 temp_s2 = 0;
+ s16 temp_f8;
+ s32 phi_s0;
+ s32 phi_v0;
+ s32 phi_s1;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DC44.s")
+ for (i = 0; i < 31; i++) {
+ temp_s2 += 0x4E20;
+ temp_f20 = Rand_ZeroOne() * 10.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DC60.s")
+ spDC.x = Math_SinS(temp_s2) * temp_f20;
+ spDC.y = i * 0.7f;
+ spDC.z = Math_CosS(temp_s2) * temp_f20;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DE58.s")
+ Math_Vec3f_Sum(&spDC, &this->actor.world.pos, &spD0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098DEA0.s")
+ spC4.x = (Rand_ZeroOne() - 0.5f) + (spDC.x * 0.5f);
+ spC4.y = (Rand_ZeroOne() * 0.5f) + (spDC.y * 0.5f);
+ spC4.z = (Rand_ZeroOne() - 0.5f) + (spDC.z * 0.5f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098E098.s")
+ temp_f8 = (Rand_ZeroOne() * 72.0f) + 25.0f;
+ if (temp_f8 < 40) {
+ phi_s0 = -200;
+ phi_s1 = 40;
+ } else if (temp_f8 < 70) {
+ phi_s0 = -280;
+ phi_s1 = 30;
+ } else {
+ phi_s0 = -340;
+ phi_s1 = 20;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/func_8098E0B8.s")
+ temp_f20 = Rand_ZeroOne();
+ if (temp_f20 < 0.1f) {
+ phi_v0 = 0x60;
+ } else if (temp_f20 < 0.8f) {
+ phi_v0 = 0x40;
+ } else {
+ phi_v0 = 0x20;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Update.s")
+ EffectSsKakera_Spawn(globalCtx, &spD0, &spC4, &spD0, phi_s0, phi_v0, phi_s1, 4, 0, temp_f8, 0, 0, 60, -1,
+ OBJECT_COMB, object_comb_DL_001040);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Comb/ObjComb_Draw.s")
+ spD0.x = this->actor.world.pos.x;
+ spD0.y = this->actor.world.pos.y + 20.0f;
+ spD0.z = this->actor.world.pos.z;
+
+ func_800BBFB0(globalCtx, &spD0, 40.0f, 6, 70, 60, 1);
+}
+
+void func_8098D47C(ObjComb* this, GlobalContext* globalCtx) {
+ Vec3f spD4;
+ Vec3f spC8;
+ Vec3f spBC;
+ f32 temp_f20;
+ s16 temp_s1 = 0;
+ s16 temp_f10;
+ s32 phi_s0;
+ s32 phi_v0;
+ s32 i;
+
+ for (i = 0; i < 21; i++) {
+ temp_s1 += 0x4E20;
+ temp_f20 = Rand_ZeroOne() * 10.0f;
+
+ spD4.x = Math_SinS(temp_s1) * temp_f20;
+ spD4.y = i * 0.25f;
+ spD4.z = Math_CosS(temp_s1) * temp_f20;
+
+ Math_Vec3f_Sum(&spD4, &this->actor.world.pos, &spC8);
+
+ spBC.x = (Rand_ZeroOne() - 0.5f) + (spD4.x * 0.5f);
+ spBC.y = Rand_ZeroOne() + (spD4.y * 0.6f) + 6.0f;
+ spBC.z = (Rand_ZeroOne() - 0.5f) + (spD4.z * 0.5f);
+
+ temp_f10 = (Rand_ZeroOne() * 72.0f) + 25.0f;
+ if (temp_f10 < 40) {
+ phi_s0 = -100;
+ } else if (temp_f10 < 70) {
+ phi_s0 = -180;
+ } else {
+ phi_s0 = -240;
+ }
+
+ if (Rand_ZeroOne() < 0.2f) {
+ phi_v0 = 0x40;
+ } else {
+ phi_v0 = 0x20;
+ }
+
+ EffectSsKakera_Spawn(globalCtx, &spC8, &spBC, &spC8, phi_s0, phi_v0, 40, 0, 0, temp_f10, 0, 0, 80, -1,
+ OBJECT_COMB, object_comb_DL_001040);
+ }
+}
+
+void func_8098D6E0(ObjComb* this, GlobalContext* globalCtx) {
+ s32 i;
+ Vec3f sp70;
+ f32 temp_f0;
+ f32 temp_f20;
+ s32 temp;
+
+ sp70.y = this->actor.world.pos.y + this->actor.depthInWater;
+
+ for (temp = 0, i = 0; i < 8; i++, temp += 0x2000) {
+ temp_f0 = Rand_ZeroOne();
+ temp_f20 = ((1.0f - SQ(temp_f0)) * 14.0f) + 4.0f;
+ sp70.x = (Math_SinS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.x;
+ sp70.z = (Math_CosS((s32)(Rand_ZeroOne() * 8000.0f) + temp) * temp_f20) + this->actor.world.pos.z;
+ EffectSsGSplash_Spawn(globalCtx, &sp70, NULL, NULL, 0, 200);
+ }
+
+ sp70.x = this->actor.world.pos.x;
+ sp70.z = this->actor.world.pos.z;
+ EffectSsGSplash_Spawn(globalCtx, &sp70, NULL, NULL, 0, 300);
+}
+
+void func_8098D870(ObjComb* this, GlobalContext* globalCtx) {
+ s32 temp_v0 = func_800A8150(OBJCOMB_GET_3F(&this->actor));
+
+ if (temp_v0 >= 0) {
+ Item_DropCollectible(globalCtx, &this->actor.world.pos, ((OBJCOMB_GET_7F00(&this->actor)) << 8) | temp_v0);
+ }
+}
+
+void func_8098D8C8(ObjComb* this, GlobalContext* globalCtx) {
+ s32 params = OBJCOMB_GET_F(&this->actor);
+ s32 i;
+ s32 phi_s5;
+
+ if (this->actionFunc == func_8098DC60) {
+ phi_s5 = 2;
+ } else {
+ phi_s5 = 1;
+ }
+ this->unk_1B6 = 0;
+
+ for (i = 0; i < params; i++) {
+ if (Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BEE, this->actor.world.pos.x, this->actor.world.pos.y,
+ this->actor.world.pos.z, 0, 0, 0, phi_s5)) {
+ this->unk_1B6 = 1;
+ }
+ }
+}
+
+void func_8098D99C(ObjComb* this, GlobalContext* globalCtx) {
+ s32 params;
+ Actor* temp_v0;
+
+ if (func_8098CE40(this, globalCtx)) {
+ params = (OBJCOMB_GET_1F(&this->actor) << 2) | 0xFF01;
+ temp_v0 = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SW, this->actor.world.pos.x,
+ this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.home.rot.y, 0, params);
+
+ if (temp_v0 != NULL) {
+ temp_v0->parent = &this->actor;
+ if (this->actionFunc == func_8098DC60) {
+ temp_v0->velocity.y = 8.0f;
+ temp_v0->speedXZ = 2.0f;
+ } else {
+ temp_v0->velocity.y = 10.0f;
+ temp_v0->speedXZ = 2.0f;
+ }
+ this->unk_1B6 = 1;
+ play_sound(NA_SE_SY_TRE_BOX_APPEAR);
+ }
+ }
+}
+
+void func_8098DA74(ObjComb* this, GlobalContext* globalCtx) {
+ s32 temp_v0 = OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor);
+
+ if (temp_v0 == 0) {
+ func_8098D870(this, globalCtx);
+ } else if (temp_v0 == 1) {
+ func_8098D8C8(this, globalCtx);
+ } else {
+ func_8098D99C(this, globalCtx);
+ }
+}
+
+void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjComb* this = THIS;
+ s32 sp2C = OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor);
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ Collider_InitJntSph(globalCtx, &this->collider);
+
+ if ((sp2C == 1) && OBJCOMB_GET_10(&this->actor) && (gSaveContext.weekEventReg[83] & 2)) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, &this->colliderElement);
+
+ if ((sp2C == 0) && func_800A81A4(globalCtx, OBJCOMB_GET_3F(&this->actor), OBJCOMB_GET_7F00(&this->actor))) {
+ this->unk_1B7 = 1;
+ this->actor.flags |= ACTOR_FLAG_10;
+ }
+
+ if ((sp2C != 2) || !func_8098CE40(this, globalCtx)) {
+ this->unk_1B8 = -1;
+ }
+ func_8098DC44(this);
+}
+
+void ObjComb_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ Collider_DestroyJntSph(globalCtx, &THIS->collider);
+}
+
+void func_8098DC44(ObjComb* this) {
+ this->unk_1AC = 0x2EE0;
+ this->actionFunc = func_8098DC60;
+}
+
+void func_8098DC60(ObjComb* this, GlobalContext* globalCtx) {
+ s32 temp_a0;
+ s8 temp_v0;
+ u32 temp_v1;
+
+ this->unk_1AA += this->unk_1AC;
+ if (this->unk_1B3) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ }
+
+ this->unk_1A8 -= 0x32;
+ if (this->unk_1A8 < 0) {
+ this->unk_1A8 = 0;
+ }
+
+ if (this->unk_1B3) {
+ if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0182C29C) {
+ func_8098CEAC(this, globalCtx);
+ func_8098DA74(this, globalCtx);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ s32 dmgFlags = this->collider.elements->info.acHitInfo->toucher.dmgFlags;
+
+ if (dmgFlags & 0x13820) {
+ this->unk_1A8 = 0xDAC;
+ this->unk_1AC = 0x36B0;
+ } else {
+ this->unk_1A8 = 0x5DC;
+ this->unk_1AC = 0x2EE0;
+ }
+
+ if ((this->unk_1B2 <= 0) && (dmgFlags & 0x13820)) {
+ if (this->unk_1B5 == 0) {
+ this->unk_1B5 = 1;
+ this->actor.flags |= ACTOR_FLAG_10;
+ }
+ this->unk_1B2 = 20;
+ }
+ }
+ } else {
+ if (this->unk_1B8 >= 0) {
+ if (this->unk_1B8 == 0) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_STALGOLD_ROLL);
+ if (Rand_ZeroOne() < 0.1f) {
+ this->unk_1B8 = Rand_S16Offset(40, 80);
+ } else {
+ this->unk_1B8 = 8;
+ }
+ } else {
+ this->unk_1B8--;
+ }
+ }
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+
+ if (this->actor.update != NULL) {
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+
+ this->actor.shape.rot.x = (s32)(Math_SinS(this->unk_1AA) * this->unk_1A8) + this->actor.home.rot.x;
+}
+
+void func_8098DE58(ObjComb* this) {
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->unk_1B4 = 100;
+ this->actor.terminalVelocity = -20.0f;
+ this->actor.gravity = -1.5f;
+ this->actor.speedXZ = 0.0f;
+ this->actionFunc = func_8098DEA0;
+}
+
+void func_8098DEA0(ObjComb* this, GlobalContext* globalCtx) {
+ this->unk_1B4--;
+ if ((this->actor.bgCheckFlags & 1) || (this->unk_1B4 <= 0)) {
+ func_8098DA74(this, globalCtx);
+ if ((this->actor.bgCheckFlags & 0x20) && (this->actor.depthInWater > 30.0f)) {
+ func_8098D47C(this, globalCtx);
+ } else {
+ func_8098D19C(this, globalCtx);
+ }
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_HONEYCOMB_BROKEN);
+ func_8098E098(this);
+ } else {
+ if (this->actor.bgCheckFlags & 0x40) {
+ func_8098D6E0(this, globalCtx);
+ }
+
+ if (this->actor.bgCheckFlags & 0x20) {
+ this->actor.gravity = -0.5f;
+ this->actor.velocity.y *= 0.8f;
+ this->unk_1AE >>= 1;
+ this->unk_1B0 >>= 1;
+ } else {
+ this->actor.gravity = -1.5f;
+ this->actor.velocity.y *= 0.96f;
+
+ this->unk_1AE += 0x1F4;
+ if (this->unk_1AE > 0x7D0) {
+ this->unk_1AE = 0x7D0;
+ }
+
+ this->unk_1B0 += 0xC8;
+ if (this->unk_1B0 > 0x258) {
+ this->unk_1B0 = 0x258;
+ }
+ func_800B9010(&this->actor, NA_SE_EV_HONEYCOMB_FALL - SFX_FLAG);
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+ this->actor.shape.rot.x += this->unk_1AE;
+ this->actor.shape.rot.y += this->unk_1B0;
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 20.0f, 12.0f, 0.0f, 5);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+}
+
+void func_8098E098(ObjComb* this) {
+ this->actor.draw = NULL;
+ this->unk_1B4 = 20;
+ this->actionFunc = func_8098E0B8;
+}
+
+void func_8098E0B8(ObjComb* this, GlobalContext* globalCtx) {
+ this->unk_1B4--;
+ if (this->unk_1B4 <= 0) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ if ((this->unk_1B4 == 10) && (this->unk_1B6 != 0) && (this->unk_1B5 == 2) && (this->actor.cutscene >= 0)) {
+ if (ActorCutscene_GetCurrentIndex() == this->actor.cutscene) {
+ func_800B7298(globalCtx, &this->actor, 4);
+ }
+ }
+}
+
+void ObjComb_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjComb* this = THIS;
+
+ this->unk_1B3 = (this->collider.base.acFlags & AC_HIT) != 0;
+ if (this->unk_1B3) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ }
+
+ if (this->unk_1B2 > 0) {
+ this->unk_1B2--;
+ if (this->unk_1B2 == 0) {
+ func_8098DE58(this);
+ }
+ }
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->actor.update == NULL) {
+ if ((this->unk_1B5 == 2) && (func_800F2138(this->actor.cutscene) == -1)) {
+ ActorCutscene_Stop(this->actor.cutscene);
+ this->unk_1B5 = 0;
+ }
+ } else {
+ if (this->unk_1B5 != 0) {
+ Actor_SetFocus(&this->actor, 0.0f);
+ if (this->unk_1B5 == 1) {
+ if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
+ if (this->actor.cutscene >= 0) {
+ func_800B7298(globalCtx, &this->actor, 1);
+ }
+
+ if (((OBJCOMB_GET_8000(&this->actor) | OBJCOMB_GET_80(&this->actor)) == 1) &&
+ OBJCOMB_GET_10(&this->actor)) {
+ gSaveContext.weekEventReg[83] |= 2;
+ }
+
+ this->unk_1B5 = 2;
+ } else {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+ }
+ }
+
+ if (this->unk_1B7 != 0) {
+ globalCtx->actorCtx.unk5 |= 8;
+ this->actor.flags |= ACTOR_FLAG_10;
+ }
+ }
+}
+
+void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ ObjComb* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ Matrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y + (118.0f * this->actor.scale.y),
+ this->actor.world.pos.z, MTXMODE_NEW);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_APPLY);
+ Matrix_InsertXRotation_s(this->actor.shape.rot.x, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->actor.shape.rot.z, MTXMODE_APPLY);
+ Matrix_InsertTranslation(0.0f, -(this->actor.scale.y * 118.0f), 0.0f, MTXMODE_APPLY);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_comb_DL_000CB0);
+
+ Collider_UpdateSpheres(0, &this->collider);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
index 303a3ed5e5..fc47df429b 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
@@ -7,10 +7,31 @@ struct ObjComb;
typedef void (*ObjCombActionFunc)(struct ObjComb*, GlobalContext*);
+#define OBJCOMB_GET_F(thisx) ((thisx)->params & 0xF)
+#define OBJCOMB_GET_10(thisx) (((thisx)->params >> 4) & 0x1)
+#define OBJCOMB_GET_1F(thisx) ((thisx)->params & 0x1F)
+#define OBJCOMB_GET_3F(thisx) ((thisx)->params & 0x3F)
+#define OBJCOMB_GET_80(thisx) (((thisx)->params >> 7) & 0x1)
+#define OBJCOMB_GET_7F00(thisx) (((thisx)->params >> 0x8) & 0x7F)
+#define OBJCOMB_GET_8000(thisx) (((thisx)->params >> 0xE) & 2)
+
typedef struct ObjComb {
/* 0x0000 */ Actor actor;
/* 0x0144 */ ObjCombActionFunc actionFunc;
- /* 0x0148 */ char unk_148[0x74];
+ /* 0x0148 */ ColliderJntSph collider;
+ /* 0x0168 */ ColliderJntSphElement colliderElement;
+ /* 0x01A8 */ s16 unk_1A8;
+ /* 0x01AA */ s16 unk_1AA;
+ /* 0x01AC */ s16 unk_1AC;
+ /* 0x01AE */ s16 unk_1AE;
+ /* 0x01B0 */ s16 unk_1B0;
+ /* 0x01B2 */ s8 unk_1B2;
+ /* 0x01B3 */ s8 unk_1B3;
+ /* 0x01B4 */ s8 unk_1B4;
+ /* 0x01B5 */ s8 unk_1B5;
+ /* 0x01B6 */ s8 unk_1B6;
+ /* 0x01B7 */ s8 unk_1B7;
+ /* 0x01B8 */ s8 unk_1B8;
} ObjComb; // size = 0x1BC
extern const ActorInit Obj_Comb_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c
index 91e4e24c7b..aa72f30522 100644
--- a/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c
+++ b/src/overlays/actors/ovl_Obj_Danpeilift/z_obj_danpeilift.c
@@ -6,7 +6,7 @@
#include "z_obj_danpeilift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjDanpeilift*)thisx)
@@ -20,7 +20,7 @@ const ActorInit Obj_Danpeilift_InitVars = {
ACTOR_OBJ_DANPEILIFT,
ACTORCAT_BG,
FLAGS,
- OBJECT_OBJECT_UNSET_DANPEILIFT,
+ OBJECT_OBJ_DANPEILIFT,
sizeof(ObjDanpeilift),
(ActorFunc)ObjDanpeilift_Init,
(ActorFunc)ObjDanpeilift_Destroy,
diff --git a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c
index a51a7e8d2f..2fba4b96aa 100644
--- a/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c
+++ b/src/overlays/actors/ovl_Obj_Demo/z_obj_demo.c
@@ -6,7 +6,7 @@
#include "z_obj_demo.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjDemo*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c
index 1177a68559..bec773c2f9 100644
--- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c
+++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.c
@@ -1,12 +1,13 @@
/*
* File: z_obj_dhouse.c
* Overlay: ovl_Obj_Dhouse
- * Description: Dinner plate Prop
+ * Description: Stone bridge that Keeta sleeps under
*/
#include "z_obj_dhouse.h"
+#include "objects/object_dhouse/object_dhouse.h"
-#define FLAGS 0x00400010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_400000)
#define THIS ((ObjDhouse*)thisx)
@@ -15,7 +16,17 @@ void ObjDhouse_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjDhouse_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjDhouse_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B12E7C(ObjDhouse* this, GlobalContext* globalCtx, ObjDhouseStruct1* ptr, ObjDhouseStruct3* ptr3);
+void func_80B13170(ObjDhouse* this, GlobalContext* globalCtx, ObjDhouseStruct1* ptr, ObjDhouseStruct3* ptr3);
+void func_80B13908(ObjDhouse* this);
+void func_80B1391C(ObjDhouse* this, GlobalContext* globalCtx);
+void func_80B1392C(ObjDhouse* this);
+void func_80B13940(ObjDhouse* this, GlobalContext* globalCtx);
+void func_80B139D8(ObjDhouse* this);
+void func_80B139F4(ObjDhouse* this, GlobalContext* globalCtx);
+void func_80B13C08(Actor* thisx, GlobalContext* globalCtx);
+void func_80B13E40(Actor* thisx, GlobalContext* globalCtx);
+
const ActorInit Obj_Dhouse_InitVars = {
ACTOR_OBJ_DHOUSE,
ACTORCAT_BG,
@@ -28,58 +39,504 @@ const ActorInit Obj_Dhouse_InitVars = {
(ActorFunc)ObjDhouse_Draw,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80B13FB4[] = {
+ObjDhouseStruct3 D_80B13E90[] = {
+ {
+ object_dhouse_DL_006E28,
+ object_dhouse_DL_006CE0,
+ { 84.2f, 30.480001f, 109.68001f },
+ { 3.0f, 21.0f, 11.0f },
+ 5500,
+ 500,
+ -500,
+ 7,
+ },
+ {
+ object_dhouse_DL_0070A8,
+ object_dhouse_DL_006EF8,
+ { 40.8f, -38.72f, 62.12f },
+ { -5.0f, 22.0f, 8.0f },
+ 600,
+ -300,
+ 2000,
+ 4,
+ },
+ {
+ object_dhouse_DL_007348,
+ object_dhouse_DL_007190,
+ { 125.31999f, -34.52f, 62.12f },
+ { 8.0f, 13.0f, 6.0f },
+ -2400,
+ 200,
+ -300,
+ 4,
+ },
+ {
+ object_dhouse_DL_007568,
+ object_dhouse_DL_007438,
+ { 150.56f, -80.520004f, 62.12f },
+ { -4.0f, 7.0f, 3.0f },
+ 100,
+ 50,
+ 850,
+ 8,
+ },
+ {
+ object_dhouse_DL_007780,
+ object_dhouse_DL_007638,
+ { 82.08f, 21.32f, -99.64f },
+ { -7.0f, 34.0f, -1.0f },
+ -2400,
+ -100,
+ 1000,
+ 5,
+ },
+ {
+ object_dhouse_DL_007A00,
+ object_dhouse_DL_007850,
+ { 45.64f, -38.16f, -56.24f },
+ { -1.0f, 20.0f, -16.0f },
+ -2000,
+ 700,
+ 500,
+ 6,
+ },
+ {
+ object_dhouse_DL_007C98,
+ object_dhouse_DL_007AE8,
+ { 140.4f, -60.84f, -56.24f },
+ { 2.0f, 27.0f, -10.0f },
+ -1000,
+ -500,
+ -500,
+ 9,
+ },
+};
+
+Vec3f D_80B13FA8 = { 0.0f, 0.3f, 0.0f };
+
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 8000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 800, ICHAIN_CONTINUE),
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-#endif
+Vec3f D_80B13FC4 = { 160.0f, 0.0f, 240.0f };
-extern InitChainEntry D_80B13FB4[];
+void ObjDhouse_Init(Actor* thisx, GlobalContext* globalCtx) {
+ ObjDhouse* this = THIS;
-extern UNK_TYPE D_06004928;
-extern UNK_TYPE D_06005A78;
-extern UNK_TYPE D_06008040;
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/ObjDhouse_Init.s")
+ DynaPolyActor_Init(&this->dyna, 0);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/ObjDhouse_Destroy.s")
+ if (Flags_GetSwitch(globalCtx, OBJDHOUSE_GET_7F(&this->dyna.actor))) {
+ this->dyna.actor.draw = func_80B13E40;
+ func_80B13908(this);
+ } else {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_dhouse_Colheader_008040);
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
+ func_80B1392C(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B12A50.s")
+void ObjDhouse_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjDhouse* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B12A88.s")
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B12B38.s")
+void func_80B12A50(ObjDhouseStruct1* this, ObjDhouseStruct3* ptr3, Vec3f* arg2) {
+ arg2->x = this->unk_00.x + ptr3->unk_08.x;
+ arg2->y = this->unk_00.y + ptr3->unk_08.y;
+ arg2->z = this->unk_00.z + ptr3->unk_08.z;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B12D78.s")
+void func_80B12A88(Actor* thisx) {
+ ObjDhouse* this = THIS;
+ s32 i;
+ ObjDhouseStruct1* ptr;
+ ObjDhouseStruct3* ptr3;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B12E7C.s")
+ for (i = 0, ptr = &this->unk_160[0], ptr3 = &D_80B13E90[0]; i < ARRAY_COUNT(this->unk_160); i++, ptr3++, ptr++) {
+ Math_Vec3f_Copy(&ptr->unk_00, &this->dyna.actor.world.pos);
+ Math_Vec3f_Copy(&ptr->unk_0C, &ptr3->unk_14);
+ ptr->unk_18 = this->dyna.actor.shape.rot;
+ ptr->unk_1E = 0;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13170.s")
+void func_80B12B38(ObjDhouse* this2, GlobalContext* globalCtx) {
+ ObjDhouse* this = this2;
+ s32 i;
+ f32 temp_f0;
+ CollisionPoly* sp90;
+ s32 phi_s3;
+ Vec3f sp80;
+ s32 sp7C;
+ ObjDhouseStruct1* ptr;
+ ObjDhouseStruct3* ptr3;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13474.s")
+ for (i = 0, ptr = &this->unk_160[0], ptr3 = &D_80B13E90[0]; i < ARRAY_COUNT(this->unk_160); i++, ptr3++, ptr++) {
+ if (ptr->unk_1E >= 0) {
+ if (ptr->unk_1E >= ptr3->unk_26) {
+ ptr->unk_0C.y -= 2.5f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13724.s")
+ Math_Vec3f_Scale(&ptr->unk_0C, 0.96f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13908.s")
+ ptr->unk_00.x += ptr->unk_0C.x;
+ ptr->unk_00.y += ptr->unk_0C.y;
+ ptr->unk_00.z += ptr->unk_0C.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B1391C.s")
+ ptr->unk_18.x += ptr3->unk_20.x;
+ ptr->unk_18.y += ptr3->unk_20.y;
+ ptr->unk_18.z += ptr3->unk_20.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B1392C.s")
+ if (ptr->unk_1E == ptr3->unk_26) {
+ func_80B12E7C(this, globalCtx, ptr, ptr3);
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13940.s")
+ phi_s3 = false;
+ if (ptr->unk_0C.y < 0.0f) {
+ func_80B12A50(ptr, ptr3, &sp80);
+ temp_f0 = BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &sp90, &sp7C, &this->dyna.actor, &sp80);
+ if (((sp80.y - 35.0f) < temp_f0) && (temp_f0 > (BGCHECK_Y_MIN + 1.0f))) {
+ phi_s3 = true;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B139D8.s")
+ if (phi_s3) {
+ ptr->unk_1E = -1;
+ func_80B13170(this, globalCtx, ptr, ptr3);
+ } else if (ptr->unk_1E > 60) {
+ ptr->unk_1E = -1;
+ } else {
+ ptr->unk_1E++;
+ }
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B139F4.s")
+s32 func_80B12D78(ObjDhouse* this) {
+ s32 i;
+ ObjDhouseStruct2* ptr2 = &this->unk_240[0];
+ s32 count = 0;
+ ObjDhouseStruct2* ptr22 = &this->unk_240[1];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/ObjDhouse_Update.s")
+ for (i = 1; i < ARRAY_COUNT(this->unk_240); i++, ptr22++) {
+ if (ptr22->unk_28 < ptr2->unk_28) {
+ ptr2 = ptr22;
+ count = i;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/ObjDhouse_Draw.s")
+ return count;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13C08.s")
+void func_80B12E7C(ObjDhouse* this, GlobalContext* globalCtx, ObjDhouseStruct1* ptr, ObjDhouseStruct3* ptr3) {
+ s32 i;
+ Vec3f spA0;
+ Vec3f sp94;
+ Vec3f sp88;
+ ObjDhouseStruct2* ptr2;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Dhouse/func_80B13E40.s")
+ Matrix_RotateY(this->dyna.actor.shape.rot.y, MTXMODE_NEW);
+ Matrix_MultiplyVector3fXZByCurrentState(&D_80B13FC4, &sp94);
+ sp94.y = 100.0f;
+ func_80B12A50(ptr, ptr3, &spA0);
+
+ for (i = 0; i < 15; i++) {
+ ptr2 = &this->unk_240[func_80B12D78(this)];
+
+ ptr2->unk_00.x = Rand_ZeroOne() - 0.5f;
+ ptr2->unk_00.y = Rand_ZeroOne();
+ ptr2->unk_00.z = Rand_ZeroOne() - 0.5f;
+
+ ptr2->unk_0C.x = ptr2->unk_00.x * 24.0f;
+ ptr2->unk_0C.y = ptr2->unk_00.y * 34.0f;
+ ptr2->unk_0C.z = ptr2->unk_00.z * 24.0f;
+
+ ptr2->unk_00.x = (ptr2->unk_00.x * 140.0f) + spA0.x;
+ ptr2->unk_00.y = ((ptr2->unk_00.y - 0.2f) * 50.0f) + spA0.y;
+ ptr2->unk_00.z = (ptr2->unk_00.z * 140.0f) + spA0.z;
+
+ ptr2->unk_18 = (Rand_ZeroOne() * 0.057f) + 0.003f;
+
+ ptr2->unk_1C.x = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.y = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.z = (u32)Rand_Next() >> 0x10;
+
+ ptr2->unk_22 = ((u32)Rand_Next() >> 0x11) - 0x3FFF;
+ ptr2->unk_24 = ((u32)Rand_Next() >> 0x13) - 0xFFF;
+ ptr2->unk_26 = ((u32)Rand_Next() >> 0x12) - 0x1FFF;
+ ptr2->unk_29 = 0;
+ ptr2->unk_28 = 40;
+
+ if ((i % 2) != 0) {
+ sp88.x = ((Rand_ZeroOne() - 0.5f) * sp94.x) + ptr2->unk_00.x;
+ sp88.y = ((Rand_ZeroOne() - 0.3f) * sp94.y) + ptr2->unk_00.y;
+ sp88.z = ((Rand_ZeroOne() - 0.5f) * sp94.z) + ptr2->unk_00.z;
+
+ func_800B1210(globalCtx, &sp88, &gZeroVec3f, &D_80B13FA8, (s32)(Rand_ZeroOne() * 130.0f) + 20,
+ (s32)(Rand_ZeroOne() * 140.0f) + 60);
+ }
+ }
+}
+
+void func_80B13170(ObjDhouse* this, GlobalContext* globalCtx, ObjDhouseStruct1* ptr, ObjDhouseStruct3* ptr3) {
+ s32 i;
+ Vec3f sp98;
+ Vec3f sp8C;
+ ObjDhouseStruct2* ptr2;
+
+ func_80B12A50(ptr, ptr3, &sp98);
+
+ for (i = 0; i < 11; i++) {
+ ptr2 = &this->unk_240[func_80B12D78(this)];
+
+ ptr2->unk_00.x = Rand_ZeroOne() - 0.5f;
+ ptr2->unk_00.y = Rand_ZeroOne();
+ ptr2->unk_00.z = Rand_ZeroOne() - 0.5f;
+
+ ptr2->unk_0C.x = ptr2->unk_00.x * 23.0f;
+ ptr2->unk_0C.y = (ptr2->unk_00.y * 19.0f) + 5.0f;
+ ptr2->unk_0C.z = ptr2->unk_00.z * 23.0f;
+
+ ptr2->unk_00.x = (ptr2->unk_00.x * 80.0f) + sp98.x;
+ ptr2->unk_00.y = (ptr2->unk_00.y * 23.0f) + sp98.y + 15.0f;
+ ptr2->unk_00.z = (ptr2->unk_00.z * 80.0f) + sp98.z;
+
+ ptr2->unk_1C.x = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.y = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.z = (u32)Rand_Next() >> 0x10;
+
+ ptr2->unk_22 = ((u32)Rand_Next() >> 0x12) - 0x1FFF;
+ ptr2->unk_24 = ((u32)Rand_Next() >> 0x13) - 0xFFF;
+ ptr2->unk_26 = ((u32)Rand_Next() >> 0x12) - 0x1FFF;
+
+ ptr2->unk_28 = 40;
+
+ if (i < 3) {
+ ptr2->unk_18 = (Rand_ZeroOne() * 0.06f) + 0.12f;
+ ptr2->unk_29 = 1;
+ } else {
+ ptr2->unk_18 = (Rand_ZeroOne() * 0.05f) + 0.003f;
+ ptr2->unk_29 = 0;
+ }
+
+ if ((i % 2) != 0) {
+ sp8C.x = ((Rand_ZeroOne() - 0.5f) * 160.0f) + ptr2->unk_00.x;
+ sp8C.y = (Rand_ZeroOne() * 120.0f) + ptr2->unk_00.y;
+ sp8C.z = ((Rand_ZeroOne() - 0.5f) * 160.0f) + ptr2->unk_00.z;
+
+ func_800B1210(globalCtx, &sp8C, &gZeroVec3f, &D_80B13FA8, (s32)(Rand_ZeroOne() * 140.0f) + 20,
+ (s32)(Rand_ZeroOne() * 140.0f) + 40);
+ }
+ }
+}
+
+void func_80B13474(ObjDhouse* this, GlobalContext* globalCtx, Vec3f* arg2) {
+ s32 i;
+ Vec3f sp88;
+ ObjDhouseStruct2* ptr2;
+
+ for (i = 0; i < 5; i++) {
+ ptr2 = &this->unk_240[func_80B12D78(this)];
+
+ ptr2->unk_00.x = Rand_ZeroOne() - 0.5f;
+ ptr2->unk_00.y = Rand_ZeroOne();
+ ptr2->unk_00.z = Rand_ZeroOne() - 0.5f;
+
+ ptr2->unk_0C.x = ptr2->unk_00.x * 18.0f;
+ ptr2->unk_0C.y = ptr2->unk_00.y * 23.0f;
+ ptr2->unk_0C.z = ptr2->unk_00.z * 18.0f;
+
+ ptr2->unk_00.x = (ptr2->unk_00.x * 40.0f) + arg2->x;
+ ptr2->unk_00.y = ((ptr2->unk_00.y - 0.4f) * 20.0f) + arg2->y;
+ ptr2->unk_00.z = (ptr2->unk_00.z * 40.0f) + arg2->z;
+
+ ptr2->unk_1C.x = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.y = (u32)Rand_Next() >> 0x10;
+ ptr2->unk_1C.z = (u32)Rand_Next() >> 0x10;
+
+ ptr2->unk_22 = ((u32)Rand_Next() >> 0x12) - 0x1FFF;
+ ptr2->unk_24 = ((u32)Rand_Next() >> 0x13) - 0xFFF;
+ ptr2->unk_26 = ((u32)Rand_Next() >> 0x12) - 0x1FFF;
+
+ ptr2->unk_28 = 40;
+ ptr2->unk_18 = (Rand_ZeroOne() * 0.07f) + 0.003f;
+ ptr2->unk_29 = 0;
+
+ sp88.x = ((Rand_ZeroOne() * 70.0f) - 35.0f) + ptr2->unk_00.x;
+ sp88.y = (Rand_ZeroOne() * 60.0f) + ptr2->unk_00.y;
+ sp88.z = ((Rand_ZeroOne() * 70.0f) - 35.0f) + ptr2->unk_00.z;
+
+ func_800B1210(globalCtx, &sp88, &gZeroVec3f, &D_80B13FA8, (s32)(Rand_ZeroOne() * 80.0f) + 20,
+ (s32)(Rand_ZeroOne() * 90.0f) + 40);
+ }
+}
+
+void func_80B13724(ObjDhouse* this, GlobalContext* globalCtx) {
+ f32 temp_f0;
+ f32 temp_f20 = this->dyna.actor.home.pos.y - 300.0f;
+ s32 i;
+ CollisionPoly* sp80;
+ ObjDhouseStruct2* ptr2;
+ Vec3f sp70;
+ s32 sp6C;
+
+ for (i = 0, ptr2 = &this->unk_240[0]; i < ARRAY_COUNT(this->unk_240); i++, ptr2++) {
+ if (ptr2->unk_28 > 0) {
+ ptr2->unk_0C.y -= 2.2f;
+
+ Math_Vec3f_Scale(&ptr2->unk_0C, 0.95f);
+
+ ptr2->unk_00.x += ptr2->unk_0C.x;
+ ptr2->unk_00.y += ptr2->unk_0C.y;
+ ptr2->unk_00.z += ptr2->unk_0C.z;
+
+ if (ptr2->unk_00.y < temp_f20) {
+ ptr2->unk_28 = 0;
+ } else {
+ ptr2->unk_1C.x += ptr2->unk_22;
+ ptr2->unk_1C.y += ptr2->unk_24;
+ ptr2->unk_1C.z += ptr2->unk_26;
+ ptr2->unk_28--;
+
+ if (ptr2->unk_29 & 1) {
+ temp_f0 =
+ BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &sp80, &sp6C, &this->dyna.actor, &ptr2->unk_00);
+ if (((ptr2->unk_00.y - 20.0f) < temp_f0) && (temp_f0 > BGCHECK_Y_MIN + 1.0f)) {
+ Math_Vec3f_Copy(&sp70, &ptr2->unk_00);
+ ptr2->unk_28 = 0;
+ func_80B13474(this, globalCtx, &sp70);
+ }
+ }
+ }
+ }
+ }
+}
+
+void func_80B13908(ObjDhouse* this) {
+ this->actionFunc = func_80B1391C;
+}
+
+void func_80B1391C(ObjDhouse* this, GlobalContext* globalCtx) {
+}
+
+void func_80B1392C(ObjDhouse* this) {
+ this->actionFunc = func_80B13940;
+}
+
+void func_80B13940(ObjDhouse* this, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ s32 sp20 = false;
+
+ if (Flags_GetSwitch(globalCtx, OBJDHOUSE_GET_7F(&this->dyna.actor))) {
+ sp20 = true;
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_EXPLSION_LONG);
+ }
+
+ if (sp20) {
+ func_80B12A88(&this->dyna.actor);
+ func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+ this->dyna.actor.draw = func_80B13C08;
+ this->dyna.actor.flags |= ACTOR_FLAG_20;
+ func_80B139D8(this);
+ }
+}
+
+void func_80B139D8(ObjDhouse* this) {
+ this->unk_1370 = 120;
+ this->actionFunc = func_80B139F4;
+}
+
+void func_80B139F4(ObjDhouse* this, GlobalContext* globalCtx) {
+ Camera* camera = GET_ACTIVE_CAM(globalCtx);
+ s16 quake;
+
+ if (this->unk_1370 == 117) {
+ quake = Quake_Add(camera, 3);
+ Quake_SetSpeed(quake, 20000);
+ Quake_SetQuakeValues(quake, 8, 0, 0, 0);
+ Quake_SetCountdown(quake, 17);
+ } else if (this->unk_1370 == 105) {
+ quake = Quake_Add(camera, 3);
+ Quake_SetSpeed(quake, 20000);
+ Quake_SetQuakeValues(quake, 7, 0, 0, 0);
+ Quake_SetCountdown(quake, 20);
+ } else if (this->unk_1370 == 90) {
+ quake = Quake_Add(camera, 3);
+ Quake_SetSpeed(quake, 20000);
+ Quake_SetQuakeValues(quake, 5, 0, 0, 0);
+ Quake_SetCountdown(quake, 62);
+ }
+
+ this->unk_1370--;
+ if (this->unk_1370 <= 0) {
+ this->dyna.actor.draw = func_80B13E40;
+ this->dyna.actor.flags &= ~ACTOR_FLAG_20;
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10;
+ func_80B13908(this);
+ } else {
+ func_80B12B38(this, globalCtx);
+ func_80B13724(this, globalCtx);
+ }
+}
+
+void ObjDhouse_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjDhouse* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+}
+
+void ObjDhouse_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ Gfx_DrawDListOpa(globalCtx, object_dhouse_DL_005A78);
+}
+
+void func_80B13C08(Actor* thisx, GlobalContext* globalCtx) {
+ ObjDhouse* this = THIS;
+ ObjDhouseStruct1* ptr;
+ ObjDhouseStruct2* ptr2;
+ ObjDhouseStruct3* ptr3;
+ s32 i;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dhouse_DL_004928);
+
+ for (i = 0, ptr = &this->unk_160[0], ptr3 = &D_80B13E90[0]; i < ARRAY_COUNT(this->unk_160); i++, ptr3++, ptr++) {
+ if (ptr->unk_1E >= 0) {
+ Matrix_SetStateRotationAndTranslation(ptr->unk_00.x + ptr3->unk_08.x, ptr->unk_00.y + ptr3->unk_08.y,
+ ptr->unk_00.z + ptr3->unk_08.z, &ptr->unk_18);
+ Matrix_InsertTranslation(-ptr3->unk_08.x, -ptr3->unk_08.y, -ptr3->unk_08.z, MTXMODE_APPLY);
+ Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, ptr3->unk_00);
+ gSPDisplayList(POLY_OPA_DISP++, ptr3->unk_04);
+ }
+ }
+
+ for (i = 0, ptr2 = &this->unk_240[0]; i < ARRAY_COUNT(this->unk_240); i++, ptr2++) {
+ if (ptr2->unk_28 > 0) {
+ Matrix_SetStateRotationAndTranslation(ptr2->unk_00.x, ptr2->unk_00.y, ptr2->unk_00.z, &ptr2->unk_1C);
+ Matrix_Scale(ptr2->unk_18, ptr2->unk_18, ptr2->unk_18, MTXMODE_APPLY);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
+ G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_dhouse_DL_0081D8);
+ }
+ }
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
+
+void func_80B13E40(Actor* thisx, GlobalContext* globalCtx) {
+ Gfx_DrawDListOpa(globalCtx, object_dhouse_DL_004928);
+}
diff --git a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h
index 793aabfac1..053928c1c3 100644
--- a/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h
+++ b/src/overlays/actors/ovl_Obj_Dhouse/z_obj_dhouse.h
@@ -7,11 +7,42 @@ struct ObjDhouse;
typedef void (*ObjDhouseActionFunc)(struct ObjDhouse*, GlobalContext*);
+#define OBJDHOUSE_GET_7F(thisx) ((thisx)->params & 0x7F)
+
+typedef struct {
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ Vec3f unk_0C;
+ /* 0x18 */ Vec3s unk_18;
+ /* 0x1E */ s8 unk_1E;
+} ObjDhouseStruct1; // size = 0x20
+
+typedef struct {
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ Vec3f unk_0C;
+ /* 0x18 */ f32 unk_18;
+ /* 0x1C */ Vec3s unk_1C;
+ /* 0x22 */ s16 unk_22;
+ /* 0x24 */ s16 unk_24;
+ /* 0x26 */ s16 unk_26;
+ /* 0x28 */ s8 unk_28;
+ /* 0x29 */ u8 unk_29;
+} ObjDhouseStruct2; // size = 0x2C
+
+typedef struct {
+ /* 0x00 */ Gfx* unk_00;
+ /* 0x04 */ Gfx* unk_04;
+ /* 0x08 */ Vec3f unk_08;
+ /* 0x14 */ Vec3f unk_14;
+ /* 0x20 */ Vec3s unk_20;
+ /* 0x26 */ s8 unk_26;
+} ObjDhouseStruct3; // size = 0x28
+
typedef struct ObjDhouse {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
+ /* 0x0000 */ DynaPolyActor dyna;
/* 0x015C */ ObjDhouseActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0x1214];
+ /* 0x0160 */ ObjDhouseStruct1 unk_160[7];
+ /* 0x0240 */ ObjDhouseStruct2 unk_240[100];
+ /* 0x1370 */ s16 unk_1370;
} ObjDhouse; // size = 0x1374
extern const ActorInit Obj_Dhouse_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c
index fde316a812..03e73043fb 100644
--- a/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c
+++ b/src/overlays/actors/ovl_Obj_Dinner/z_obj_dinner.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_dinner.h"
+#include "objects/object_obj_dinner/object_obj_dinner.h"
-#define FLAGS 0x00000020
+#define FLAGS (ACTOR_FLAG_20)
#define THIS ((ObjDinner*)thisx)
@@ -19,7 +20,7 @@ const ActorInit Obj_Dinner_InitVars = {
ACTOR_OBJ_DINNER,
ACTORCAT_PROP,
FLAGS,
- OBJECT_OBJECT_UNSET_DINNER,
+ OBJECT_OBJ_DINNER,
sizeof(ObjDinner),
(ActorFunc)ObjDinner_Init,
(ActorFunc)ObjDinner_Destroy,
@@ -27,12 +28,10 @@ const ActorInit Obj_Dinner_InitVars = {
(ActorFunc)ObjDinner_Draw,
};
-extern Gfx D_060011E0[];
-
void ObjDinner_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjDinner* this = THIS;
- if (gSaveContext.isNight != true || (CURRENT_DAY == 3 && gSaveContext.weekEventReg[0x16] & 1)) {
+ if (gSaveContext.isNight != true || (CURRENT_DAY == 3 && gSaveContext.weekEventReg[22] & 1)) {
Actor_MarkForDeath(&this->actor);
}
Actor_SetScale(&this->actor, 0.1f);
@@ -49,7 +48,7 @@ void ObjDinner_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060011E0);
+ gSPDisplayList(POLY_OPA_DISP++, object_obj_dinner_DL_0011E0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c
index 77285cdfd3..1d77cc2578 100644
--- a/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c
+++ b/src/overlays/actors/ovl_Obj_Dora/z_obj_dora.c
@@ -6,7 +6,7 @@
#include "z_obj_dora.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjDora*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c
index a75bc0a3b6..dbc9451096 100644
--- a/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c
+++ b/src/overlays/actors/ovl_Obj_Dowsing/z_obj_dowsing.c
@@ -6,7 +6,7 @@
#include "z_obj_dowsing.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjDowsing*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c
index cb6aabaff7..0de07e0135 100644
--- a/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c
+++ b/src/overlays/actors/ovl_Obj_Ending/z_obj_ending.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_ending.h"
+#include "objects/object_ending_obj/object_ending_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjEnding*)thisx)
@@ -26,14 +27,9 @@ const ActorInit Obj_Ending_InitVars = {
(ActorFunc)ObjEnding_Draw,
};
-extern Gfx D_060003D0[];
-extern Gfx D_060031A0[];
-extern Gfx D_06003440[];
-extern AnimatedMaterial D_06001FF8;
-
static ObjEndingModelInfo sModelInfo[] = {
- { { D_06003440, D_060031A0 }, NULL },
- { { NULL, D_060003D0 }, &D_06001FF8 },
+ { { object_ending_obj_DL_003440, object_ending_obj_DL_0031A0 }, NULL },
+ { { NULL, object_ending_obj_DL_0003D0 }, object_ending_obj_Matanimheader_001FF8 },
};
static InitChainEntry sInitChain[] = {
diff --git a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c
index 0d4432ddd5..72f0a8015d 100644
--- a/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c
+++ b/src/overlays/actors/ovl_Obj_Entotu/z_obj_entotu.c
@@ -6,7 +6,7 @@
#include "z_obj_entotu.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjEntotu*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
index ca6ea9f6f0..eb91a93d4c 100644
--- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
+++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c
@@ -7,7 +7,7 @@
#include "z_obj_etcetera.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjEtcetera*)thisx)
@@ -53,8 +53,6 @@ static ColliderCylinderInit sCylinderInit = {
{ 20, 14, 0, { 0, 0, 0 } },
};
-extern ColliderCylinderInit D_80A7C790;
-
static s16 objectIds[] = {
GAMEPLAY_KEEP,
GAMEPLAY_KEEP,
diff --git a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c
index eaa085f49a..00810af230 100644
--- a/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c
+++ b/src/overlays/actors/ovl_Obj_Fireshield/z_obj_fireshield.c
@@ -6,7 +6,7 @@
#include "z_obj_fireshield.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjFireshield*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
index e72dfb836e..16ac7e8e9f 100644
--- a/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
+++ b/src/overlays/actors/ovl_Obj_Flowerpot/z_obj_flowerpot.c
@@ -428,8 +428,11 @@ void ObjFlowerpot_Init(Actor* thisx, GlobalContext* globalCtx) {
D_80A1D400++;
}
-void ObjFlowerpot_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- Collider_DestroyJntSph(globalCtx, &THIS->collider);
+void ObjFlowerpot_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ ObjFlowerpot* this = THIS;
+
+ Collider_DestroyJntSph(globalCtx, &this->collider);
}
void func_80A1C818(ObjFlowerpot* this) {
@@ -444,7 +447,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) {
func_80A1CBF8(this);
this->actor.room = -1;
this->actor.colChkInfo.mass = 180;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
if (func_800A817C(ENOBJFLOWERPOT_GET_3F(&this->actor))) {
func_80A1B914(this, globalCtx);
}
@@ -462,7 +465,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) {
func_80A1BD80(this, globalCtx);
func_80A1B994(this, globalCtx);
Actor_MarkForDeath(&this->actor);
- } else if ((this->collider.elements[0].info.bumperFlags & 2) &&
+ } else if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) &&
(this->collider.elements[0].info.acHitInfo->toucher.dmgFlags & 0x058BFFBC)) {
if (!(this->unk_1EA & 2)) {
func_80A1B914(this, globalCtx);
@@ -474,10 +477,10 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) {
func_80A1B994(this, globalCtx);
Actor_MarkForDeath(&this->actor);
} else {
- if (this->collider.elements[1].info.bumperFlags & 2) {
+ if (this->collider.elements[1].info.bumperFlags & BUMP_HIT) {
if (!(this->unk_1EA & 2)) {
this->unk_1EA |= 2;
- this->collider.elements[1].info.bumperFlags &= ~0x1;
+ this->collider.elements[1].info.bumperFlags &= ~BUMP_ON;
func_80A1C0FC(this, globalCtx);
func_80A1B914(this, globalCtx);
func_80A1B9CC(this, globalCtx);
@@ -490,7 +493,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) {
if (this->actor.bgCheckFlags & 1) {
if (this->actor.colChkInfo.mass == MASS_IMMOVABLE) {
if (DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId) == NULL) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->unk_1EA &= ~0x1;
}
} else if (Math3D_Vec3fDistSq(&this->actor.world.pos, &this->actor.prevPos) < 0.01f) {
@@ -515,7 +518,7 @@ void func_80A1C838(ObjFlowerpot* this, GlobalContext* globalCtx) {
s16 temp_v0_3 = this->actor.yawTowardsPlayer - GET_PLAYER(globalCtx)->actor.world.rot.y;
if (ABS_ALT(temp_v0_3) >= 0x5556) {
- Actor_PickUp(&this->actor, globalCtx, 0, 36.0f, 30.0f);
+ Actor_PickUp(&this->actor, globalCtx, GI_NONE, 36.0f, 30.0f);
}
}
}
diff --git a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c
index 30d0b2f0ab..2ec24e73e6 100644
--- a/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c
+++ b/src/overlays/actors/ovl_Obj_Funen/z_obj_funen.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_funen.h"
+#include "objects/object_funen/object_funen.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjFunen*)thisx)
@@ -19,8 +20,6 @@ const ActorInit Obj_Funen_InitVars = {
(ActorFunc)Actor_Noop, (ActorFunc)Actor_Noop, (ActorFunc)ObjFunen_Draw,
};
-extern Gfx D_060000D0[];
-
f32 D_80A198D0[] = { 0.1f, 0.024390244f };
void ObjFunen_Init(Actor* thisx, GlobalContext* globalCtx) {
@@ -36,7 +35,7 @@ void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
- Matrix_RotateY((s16)(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) - 0x8000), MTXMODE_APPLY);
+ Matrix_RotateY((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - 0x8000), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
@@ -44,6 +43,6 @@ void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, temp, 0x20, 0x20, 1, 0, temp, 0x20, 0x20));
- gSPDisplayList(POLY_XLU_DISP++, D_060000D0);
+ gSPDisplayList(POLY_XLU_DISP++, object_funen_DL_0000D0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
index 060a4e0c03..cf5269fc83 100644
--- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
+++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_ghaka.h"
+#include "objects/object_ghaka/object_ghaka.h"
-#define FLAGS 0x00000029
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_20)
#define THIS ((ObjGhaka*)thisx)
@@ -42,10 +43,6 @@ static InitChainEntry D_80B3C96C[] = {
ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP),
};
-extern Gfx D_06001A20[];
-extern Gfx D_06001980[];
-extern CollisionHeader D_06003CD0;
-
void func_80B3C260(ObjGhaka* this) {
if (gSaveContext.weekEventReg[20] & 0x20) {
this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + 100.0f;
@@ -101,7 +98,7 @@ void func_80B3C4E0(ObjGhaka* this, GlobalContext* globalCtx) {
if (talkState == 5) {
if (func_80147624(globalCtx)) {
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
func_80B3C260(this);
}
@@ -111,16 +108,16 @@ void func_80B3C4E0(ObjGhaka* this, GlobalContext* globalCtx) {
case 0:
func_8019F208();
this->dyna.actor.textId = 0xCF5;
- func_801518B0(globalCtx, this->dyna.actor.textId, &this->dyna.actor);
+ Message_StartTextbox(globalCtx, this->dyna.actor.textId, &this->dyna.actor);
break;
case 1:
func_8019F208();
this->dyna.actor.textId = 0xCF7;
- func_801518B0(globalCtx, this->dyna.actor.textId, &this->dyna.actor);
+ Message_StartTextbox(globalCtx, this->dyna.actor.textId, &this->dyna.actor);
break;
case 2:
func_8019F230();
- globalCtx->msgCtx.unk11F22 = 0x43;
+ globalCtx->msgCtx.msgMode = 0x43;
globalCtx->msgCtx.unk12023 = 4;
func_80B3C260(this);
}
@@ -154,7 +151,7 @@ void ObjGhaka_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, D_80B3C96C);
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
- CollisionHeader_GetVirtual(&D_06003CD0, &colHeader);
+ CollisionHeader_GetVirtual(&object_ghaka_Colheader_003CD0, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
Actor_UpdateBgCheckInfo(globalCtx, &this->dyna.actor, 0.0f, 0.0f, 0.0f, 0x4);
if (this->dyna.actor.floorPoly == 0) {
@@ -185,9 +182,9 @@ void ObjGhaka_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06001A20);
+ gSPDisplayList(POLY_OPA_DISP++, object_ghaka_DL_001A20);
func_8012C2DC(globalCtx->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06001980);
+ gSPDisplayList(POLY_XLU_DISP++, object_ghaka_DL_001980);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c
index 8dc01d386e..ae70ba013e 100644
--- a/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c
+++ b/src/overlays/actors/ovl_Obj_Grass/z_obj_grass.c
@@ -6,7 +6,7 @@
#include "z_obj_grass.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjGrass*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c
index 4d717fabd7..0a703c9655 100644
--- a/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c
+++ b/src/overlays/actors/ovl_Obj_Grass_Carry/z_obj_grass_carry.c
@@ -6,7 +6,7 @@
#include "z_obj_grass_carry.h"
-#define FLAGS 0x00800030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_800000)
#define THIS ((ObjGrassCarry*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c
index 978f2cd139..f347b6a6df 100644
--- a/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c
+++ b/src/overlays/actors/ovl_Obj_Hakaisi/z_obj_hakaisi.c
@@ -6,7 +6,7 @@
#include "z_obj_hakaisi.h"
-#define FLAGS 0x00000029
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_20)
#define THIS ((ObjHakaisi*)thisx)
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 9784e212c5..b887f7a1b3 100644
--- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c
+++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c
@@ -6,7 +6,7 @@
#include "z_obj_hamishi.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjHamishi*)thisx)
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 d7e0d66332..93578ac40b 100644
--- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c
+++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_hana.h"
+#include "objects/object_hana/object_hana.h"
#define FLAGS 0x00000000
@@ -27,8 +28,6 @@ const ActorInit Obj_Hana_InitVars = {
(ActorFunc)ObjHana_Draw,
};
-extern Gfx D_06000500[];
-
static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 900, ICHAIN_CONTINUE),
@@ -49,5 +48,5 @@ void ObjHana_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjHana_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000500);
+ Gfx_DrawDListOpa(globalCtx, object_hana_DL_000500);
}
diff --git a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c
index 2860806317..0caec6ea4f 100644
--- a/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c
+++ b/src/overlays/actors/ovl_Obj_Hariko/z_obj_hariko.c
@@ -6,7 +6,7 @@
#include "z_obj_hariko.h"
-#define FLAGS 0x02000020
+#define FLAGS (ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((ObjHariko*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c
index c11fa4903c..6c37e68b55 100644
--- a/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c
+++ b/src/overlays/actors/ovl_Obj_Hgdoor/z_obj_hgdoor.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_hgdoor.h"
+#include "objects/object_hgdoor/object_hgdoor.h"
-#define FLAGS 0x00100000
+#define FLAGS (ACTOR_FLAG_100000)
#define THIS ((ObjHgdoor*)thisx)
@@ -25,13 +26,6 @@ void func_80BD4460(ObjHgdoor* this);
void func_80BD4478(ObjHgdoor* this, GlobalContext* globalCtx);
s32 func_80BD44D0(ObjHgdoor* this, GlobalContext* globalCtx);
-extern CollisionHeader D_06001D10;
-extern CollisionHeader D_060018C0;
-extern Gfx D_06001AB0[];
-extern Gfx D_06001BA8[];
-extern Gfx D_06001670[];
-extern Gfx D_06001768[];
-
const ActorInit Obj_Hgdoor_InitVars = {
ACTOR_OBJ_HGDOOR,
ACTORCAT_PROP,
@@ -80,9 +74,9 @@ void ObjHgdoor_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
if (OBJHGDOOR_IS_RIGHT_DOOR(&this->dyna.actor)) {
- CollisionHeader_GetVirtual(&D_06001D10, &header);
+ CollisionHeader_GetVirtual(&object_hgdoor_Colheader_001D10, &header);
} else {
- CollisionHeader_GetVirtual(&D_060018C0, &header);
+ CollisionHeader_GetVirtual(&object_hgdoor_Colheader_0018C0, &header);
}
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, header);
this->rotation = 0;
@@ -134,13 +128,13 @@ void func_80BD433C(ObjHgdoor* this) {
}
void func_80BD4358(ObjHgdoor* this, GlobalContext* globalCtx) {
- u32 actionIndex;
+ s32 actionIndex;
- if (func_800EE29C(globalCtx, 0x1E3)) {
- actionIndex = func_800EE200(globalCtx, 0x1E3);
- if (this->unk166 != globalCtx->csCtx.npcActions[actionIndex]->unk0) {
- this->unk166 = globalCtx->csCtx.npcActions[actionIndex]->unk0;
- switch (globalCtx->csCtx.npcActions[actionIndex]->unk0) {
+ if (Cutscene_CheckActorAction(globalCtx, 483)) {
+ actionIndex = Cutscene_GetActorActionIndex(globalCtx, 483);
+ if (this->unk166 != globalCtx->csCtx.actorActions[actionIndex]->action) {
+ this->unk166 = globalCtx->csCtx.actorActions[actionIndex]->action;
+ switch (globalCtx->csCtx.actorActions[actionIndex]->action) {
case 1:
Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_WOOD_DOOR_OPEN_SPEEDY);
if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.parent->id == ACTOR_EN_HG)) {
@@ -203,11 +197,11 @@ void ObjHgdoor_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (OBJHGDOOR_IS_RIGHT_DOOR(thisx)) {
- gSPDisplayList(POLY_OPA_DISP++, D_06001AB0);
- gSPDisplayList(POLY_OPA_DISP++, D_06001BA8);
+ gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001AB0);
+ gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001BA8);
} else {
- gSPDisplayList(POLY_OPA_DISP++, D_06001670);
- gSPDisplayList(POLY_OPA_DISP++, D_06001768);
+ gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001670);
+ gSPDisplayList(POLY_OPA_DISP++, object_hgdoor_DL_001768);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c
index cf84a1bd7e..c06543f07a 100644
--- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c
+++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_hsstump.h"
+#include "objects/object_hsstump/object_hsstump.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjHsStump*)thisx)
@@ -38,9 +39,6 @@ static InitChainEntry sInitChain[] = {
static Vec3f iceSmokeAccel = { 0.0f, 0.0f, 0.0f };
-extern Gfx D_060003B8[];
-extern CollisionHeader D_060011B0;
-
void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjHsStump* this = THIS;
@@ -48,7 +46,7 @@ void ObjHsStump_Init(Actor* thisx, GlobalContext* globalCtx) {
this->isHidden = OBJHSSTUMP_GET_ISHIDDEN(thisx);
this->switchFlag = OBJHSSTUMP_GET_SWITCHFLAG(thisx); // Must be thisx to match
DynaPolyActor_Init(&this->dyna, 1);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_060011B0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hsstump_Colheader_0011B0);
switch (this->isHidden) {
case true:
if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
@@ -146,5 +144,5 @@ void ObjHsStump_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjHsStump_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_060003B8);
+ Gfx_DrawDListOpa(globalCtx, object_hsstump_DL_0003B8);
}
diff --git a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c
index b4004c1809..74e00403c3 100644
--- a/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c
+++ b/src/overlays/actors/ovl_Obj_Hugebombiwa/z_obj_hugebombiwa.c
@@ -7,7 +7,7 @@
#include "z_obj_hugebombiwa.h"
#include "objects/object_bombiwa/object_bombiwa.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjHugebombiwa*)thisx)
@@ -358,8 +358,11 @@ void ObjHugebombiwa_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80A54BF0(this);
}
-void ObjHugebombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx) {
- Collider_DestroyCylinder(globalCtx, &THIS->collider);
+void ObjHugebombiwa_Destroy(Actor* thisx, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
+ ObjHugebombiwa* this = THIS;
+
+ Collider_DestroyCylinder(globalCtx, &this->collider);
}
void func_80A54BF0(ObjHugebombiwa* this) {
@@ -437,7 +440,7 @@ void func_80A54E10(ObjHugebombiwa* this) {
Vec3f sp84;
Matrix_StatePush();
- Matrix_RotateY(this->actor.shape.rot.y, 0);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
for (i = 0, phi_s2 = 0x1000; i < 20; i++, phi_s2 += 0x4000) {
ptr = &this->unk_190[i];
@@ -532,7 +535,7 @@ void func_80A55310(ObjHugebombiwa* this) {
Vec3f sp84;
Matrix_StatePush();
- Matrix_RotateY(this->actor.shape.rot.y, 0);
+ Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
for (i = 0, phi_s2 = 0x1000; i < ARRAY_COUNT(this->unk_190); i++, phi_s2 += 0x4000) {
ptr = &this->unk_190[i];
diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
index ff90f2e3e7..05f6b212da 100644
--- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
+++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_hunsui.h"
+#include "objects/object_hunsui/object_hunsui.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjHunsui*)thisx)
@@ -15,7 +16,36 @@ void ObjHunsui_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjHunsui_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjHunsui_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B9CE64(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D0FC(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D120(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D2BC(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D4D0(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D508(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9D714(ObjHunsui* this, GlobalContext* globalCtx);
+void func_80B9DA60(Actor* thisx, GlobalContext* globalCtx);
+
+AnimatedMaterial* D_80B9DED0;
+AnimatedMaterial* D_80B9DED4;
+
+typedef struct {
+ /* 0x00 */ u8 unk_00;
+ /* 0x01 */ u8 unk_01;
+ /* 0x02 */ u8 unk_02;
+} ObjHansuiBssStruct; // size = 0x3
+
+ObjHansuiBssStruct D_80B9DED8;
+
+typedef struct {
+ /* 0x00 */ u8 unk_00;
+ /* 0x01 */ u8 unk_01;
+} ObjHansuiStruct; // size = 0x2
+
+ObjHansuiStruct D_80B9DC70[] = {
+ { 1, 1 }, { 1, 0 }, { 2, 3 }, { 2, 1 }, { 2, 2 }, { 2, 0 }, { 3, 7 },
+ { 3, 3 }, { 3, 5 }, { 3, 1 }, { 3, 6 }, { 3, 2 }, { 3, 4 }, { 3, 0 },
+};
+
const ActorInit Obj_Hunsui_InitVars = {
ACTOR_OBJ_HUNSUI,
ACTORCAT_BG,
@@ -28,42 +58,622 @@ const ActorInit Obj_Hunsui_InitVars = {
(ActorFunc)ObjHunsui_Draw,
};
-#endif
+static InitChainEntry sInitChain[] = {
+ ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneScale, 400, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneDownward, 400, ICHAIN_STOP),
+};
-extern UNK_TYPE D_06000220;
-extern UNK_TYPE D_06000C74;
-extern UNK_TYPE D_06000EC0;
+s32 func_80B9C450(GlobalContext* globalCtx, s32 arg1, s32 arg2) {
+ s32 sp2C = 1;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9C450.s")
+ if (arg2 < ARRAY_COUNT(D_80B9DC70)) {
+ s32 val = D_80B9DC70[arg2].unk_00;
+ s32 val3 = D_80B9DC70[arg2].unk_01;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9C5E8.s")
+ while (val--) {
+ if ((1 << val) & val3) {
+ if (!Flags_GetSwitch(globalCtx, arg1 + val)) {
+ sp2C = 0;
+ break;
+ }
+ } else if (Flags_GetSwitch(globalCtx, arg1 + val)) {
+ sp2C = 0;
+ break;
+ }
+ }
+ } else {
+ sp2C = 0;
+ switch (arg2) {
+ case 14:
+ if (!Flags_GetSwitch(globalCtx, arg1)) {
+ sp2C = 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/ObjHunsui_Init.s")
+ if (Flags_GetSwitch(globalCtx, arg1 + 1) && Flags_GetSwitch(globalCtx, arg1 + 2) &&
+ Flags_GetSwitch(globalCtx, arg1 + 3)) {
+ sp2C += 2;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/ObjHunsui_Destroy.s")
+ case 15:
+ if (!Flags_GetSwitch(globalCtx, arg1) ||
+ (Flags_GetSwitch(globalCtx, arg1 + 1) && Flags_GetSwitch(globalCtx, arg1 + 2) &&
+ Flags_GetSwitch(globalCtx, arg1 + 3))) {
+ sp2C = 1;
+ }
+ break;
+ }
+ }
+ return sp2C;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/ObjHunsui_Update.s")
+void func_80B9C5E8(ObjHunsui* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ f32 temp_f10;
+ f32 temp_f16;
+ Vec3f sp40;
+ s16 sp3E;
+ f32 sp38;
+ f32 sp34;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9CE64.s")
+ if ((this->dyna.actor.xzDistToPlayer < (45.0f * this->dyna.actor.scale.x * 10.0f)) &&
+ (this->dyna.actor.playerHeightRel < -21.0f)) {
+ if (DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
+ this->unk_172 &= ~8;
+ this->unk_19C = 0.0f;
+ this->unk_1A0 = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D094.s")
+ this->unk_18C++;
+ if (this->unk_18C >= 3) {
+ this->unk_18C = 0;
+ Math_Vec3f_Copy(&sp40, &player->actor.world.pos);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D0FC.s")
+ sp40.x += randPlusMinusPoint5Scaled(10.0f);
+ sp40.z += randPlusMinusPoint5Scaled(10.0f);
+ sp40.y += Rand_ZeroFloat(2.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D120.s")
+ EffectSsGSplash_Spawn(globalCtx, &sp40, NULL, NULL, 2.0f * Rand_ZeroOne(), 1);
+ }
+ } else {
+ this->unk_172 |= 8;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D288.s")
+ this->unk_18C++;
+ if (this->unk_18C >= 3) {
+ Math_Vec3f_Copy(&sp40, &player->actor.world.pos);
+ this->unk_18C = 0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D2BC.s")
+ sp40.x += randPlusMinusPoint5Scaled(10.0f);
+ sp40.z += randPlusMinusPoint5Scaled(10.0f);
+ sp40.y += Rand_ZeroFloat(45.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D334.s")
+ EffectSsGSplash_Spawn(globalCtx, &sp40, NULL, NULL, 1, 1);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D4D0.s")
+ sp3E = BINANG_ROT180(player->actor.world.rot.y - this->dyna.actor.yawTowardsPlayer);
+ player->actor.gravity = 0.0f;
+ player->actor.velocity.y = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D508.s")
+ if ((this->unk_160 != OBJHUNSUI_F000_5) && (this->unk_160 != OBJHUNSUI_F000_6)) {
+ Math_SmoothStepToF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.5f, 4.0f, 1.0f);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9D714.s")
+ if ((sp3E < 0x4000) && (sp3E > -0x4000)) {
+ this->unk_1A4 = BINANG_ROT180(player->actor.world.rot.y);
+ sp34 = this->dyna.actor.xzDistToPlayer / (45.0f * this->dyna.actor.scale.x * 10.0f);
+ if (1) {}
+ sp38 = this->dyna.actor.xzDistToPlayer / (45.0f * this->dyna.actor.scale.x * 10.0f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/ObjHunsui_Draw.s")
+ if (sp38 > 1.0f) {
+ sp38 = sp34;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Hunsui/func_80B9DA60.s")
+ player->linearVelocity *= sp38;
+
+ if ((this->unk_160 == OBJHUNSUI_F000_5) || (this->unk_160 == OBJHUNSUI_F000_6)) {
+ Math_ApproachF(&this->unk_1A0, 4.5f, 2.0f, 1.0f);
+ Math_ApproachF(&this->unk_19C, this->unk_1A0, 2.0f, 0.3f * sp38);
+ } else {
+ Math_ApproachF(&this->unk_1A0, 3.0f, 1.0f, 1.0f);
+ Math_ApproachF(&this->unk_19C, this->unk_1A0, 1.0f, 0.3f * sp38);
+ }
+ } else {
+ this->unk_1A4 = player->actor.world.rot.y;
+ player->linearVelocity *= 0.5f;
+ Math_ApproachF(&this->unk_1A0, 3.0f, 1.0f, 1.0f);
+ Math_ApproachF(&this->unk_19C, this->unk_1A0, 1.0f, 0.1f);
+ }
+ player->unk_B84 = this->unk_1A4;
+ player->unk_B80 = this->unk_19C;
+ }
+ } else {
+ if (this->unk_172 & 8) {
+ player->linearVelocity = this->unk_19C + player->linearVelocity;
+ player->currentYaw = this->unk_1A4;
+ }
+ this->unk_1A0 = 0.0f;
+ this->unk_19C = 0.0f;
+ this->unk_172 &= ~8;
+ }
+}
+
+void ObjHunsui_Init(Actor* thisx, GlobalContext* globalCtx) {
+ ObjHunsui* this = THIS;
+
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ this->unk_160 = OBJHUNSUI_GET_F000(thisx);
+ this->unk_164 = OBJHUNSUI_GET_F80(thisx);
+ this->unk_168 = OBJHUNSUI_GET_7F(thisx);
+ DynaPolyActor_Init(&this->dyna, 1);
+
+ if ((this->unk_160 != OBJHUNSUI_F000_5) && (this->unk_160 != OBJHUNSUI_F000_6)) {
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_hunsui_Colheader_000C74);
+ }
+
+ D_80B9DED0 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_000BF0);
+ D_80B9DED4 = Lib_SegmentedToVirtual(object_hunsui_Matanimheader_001888);
+ SubS_FillCutscenesList(&this->dyna.actor, &this->unk_170, 1);
+ this->unk_18C = 0;
+
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_1:
+ case OBJHUNSUI_F000_2:
+ case OBJHUNSUI_F000_3:
+ case OBJHUNSUI_F000_4:
+ case OBJHUNSUI_F000_5:
+ case OBJHUNSUI_F000_6:
+ this->dyna.actor.uncullZoneScale = 900.0f;
+ this->dyna.actor.uncullZoneDownward = 90.0f;
+ this->dyna.actor.uncullZoneForward = 4000.0f;
+ break;
+ }
+
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_5:
+ if (D_80B9DED8.unk_01 == 0) {
+ D_80B9DED8.unk_01 = 1;
+ this->unk_16C = this->dyna.actor.room;
+ this->unk_16D = this->dyna.actor.world.rot.z;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ this->dyna.actor.room = -1;
+ } else {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ break;
+
+ case OBJHUNSUI_F000_6:
+ if (D_80B9DED8.unk_02 == 0) {
+ D_80B9DED8.unk_02 = 1;
+ this->unk_16C = this->dyna.actor.room;
+ this->unk_16D = this->dyna.actor.world.rot.z;
+ this->dyna.actor.world.rot.z = 0;
+ this->dyna.actor.shape.rot.z = 0;
+ this->dyna.actor.room = -1;
+ } else {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ break;
+ }
+
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_0:
+ if (D_80B9DED8.unk_00 == 0) {
+ D_80B9DED8.unk_00 = 1;
+ this->unk_16C = this->dyna.actor.room;
+ this->unk_16D = this->unk_164;
+ // clang-format off
+ this->dyna.actor.room = -1; this->actionFunc = func_80B9D714;
+ // clang-format on
+ } else {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ break;
+
+ case OBJHUNSUI_F000_2:
+ this->unk_172 |= 1;
+
+ case OBJHUNSUI_F000_1:
+ this->dyna.actor.draw = func_80B9DA60;
+ if ((this->unk_172 & 1) && func_80B9C450(globalCtx, this->unk_168, this->unk_164)) {
+ this->unk_174 = 240.0f;
+ this->unk_172 |= 4;
+ this->unk_184 = 0xFF0;
+ } else {
+ this->unk_174 = -30.0f;
+ this->unk_172 |= 2;
+ this->unk_184 = 0;
+ }
+ this->unk_178 = this->unk_174;
+ this->unk_180 = func_80B9C450(globalCtx, this->unk_168, this->unk_164);
+ this->actionFunc = func_80B9CE64;
+ break;
+
+ case OBJHUNSUI_F000_4:
+ this->unk_172 |= 1;
+
+ case OBJHUNSUI_F000_3:
+ case OBJHUNSUI_F000_5:
+ case OBJHUNSUI_F000_6:
+ this->dyna.actor.draw = func_80B9DA60;
+ if ((this->unk_160 == OBJHUNSUI_F000_5) || (this->unk_160 == OBJHUNSUI_F000_6)) {
+ func_80B9D2BC(this, globalCtx);
+ this->unk_178 = this->unk_174;
+ } else {
+ if ((this->unk_172 & 1) || func_80B9C450(globalCtx, this->unk_168, this->unk_164)) {
+ func_80B9D4D0(this, globalCtx);
+ } else {
+ func_80B9D0FC(this, globalCtx);
+ }
+ this->unk_178 = this->unk_174;
+ }
+ break;
+ }
+}
+
+void ObjHunsui_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjHunsui* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+}
+
+void ObjHunsui_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjHunsui* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if ((this->unk_172 & 0x40) && SubS_StartActorCutscene(&this->dyna.actor, this->unk_17C, -1, 0)) {
+ this->unk_172 &= ~0x40;
+ }
+
+ if (this->unk_1AC > 1024.0f) {
+ this->unk_1AC -= 1024.0f;
+ }
+
+ if (this->unk_1AC <= 0.0f) {
+ this->unk_1AC += 1024.0f;
+ }
+}
+
+void func_80B9CE64(ObjHunsui* this, GlobalContext* globalCtx) {
+ s32 sp2C;
+ f32 sins;
+
+ if (!(this->unk_172 & 2)) {
+ func_80B9C5E8(this, globalCtx);
+ }
+
+ this->unk_18A += 0x71C;
+ Math_SmoothStepToF(&this->unk_190, this->unk_194, 1.0f, 0.2f, 0.01f);
+
+ sp2C = func_80B9C450(globalCtx, this->unk_168, this->unk_164);
+
+ if (!(this->unk_172 & 1)) {
+ if (sp2C != this->unk_180) {
+ this->unk_17C = this->unk_170;
+ this->unk_172 |= 0x40;
+ }
+ }
+
+ if ((this->unk_172 & 1) || (sp2C != 0)) {
+ this->unk_172 &= ~2;
+ if (this->unk_186 == 0) {
+ this->unk_172 |= 0x10;
+ this->unk_174 = 240.0f;
+ if (this->unk_178 == 240.0f) {
+ if (this->unk_188++ > 40) {
+ this->unk_188 = 0;
+ this->unk_186 = 1;
+ this->unk_194 = 0.0f;
+ } else {
+ this->unk_194 = 8.0f;
+ }
+ }
+ } else {
+ this->unk_174 = 30.0f;
+ if (this->unk_178 == 30.0f) {
+ if (this->unk_188++ > 40) {
+ this->unk_188 = 0;
+ this->unk_186 = 0;
+ this->unk_194 = 0.0f;
+ } else {
+ this->unk_194 = 8.0f;
+ }
+ }
+ }
+ } else {
+ this->unk_174 = -30.0f;
+ if (this->unk_178 == -30.0f) {
+ this->unk_172 &= ~0x10;
+ this->unk_172 |= 2;
+ }
+ }
+
+ sins = Math_SinS(this->unk_18A);
+ this->unk_198 = sins * this->unk_190;
+ if (!(this->unk_172 & 0x40)) {
+ Math_SmoothStepToF(&this->unk_178, this->unk_174, 0.6f, 10.5f, 0.05f);
+ }
+
+ this->dyna.actor.world.pos.y = this->unk_198 + (this->dyna.actor.home.pos.y + this->unk_178);
+ this->unk_180 = sp2C;
+}
+
+void func_80B9D094(ObjHunsui* this, GlobalContext* globalCtx) {
+ f32 sins;
+
+ this->unk_18A += 0x71C;
+ Math_SmoothStepToF(&this->unk_190, this->unk_194, 1.0f, 0.2f, 0.01f);
+ sins = Math_SinS(this->unk_18A);
+ this->unk_198 = sins * this->unk_190;
+}
+
+void func_80B9D0FC(ObjHunsui* this, GlobalContext* globalCtx) {
+ this->unk_174 = -30.0f;
+ this->actionFunc = func_80B9D120;
+}
+
+void func_80B9D120(ObjHunsui* this, GlobalContext* globalCtx) {
+ if (((this->unk_160 == OBJHUNSUI_F000_5) || (this->unk_160 == OBJHUNSUI_F000_6)) &&
+ (this->unk_16C != globalCtx->roomCtx.currRoom.num) && (this->unk_16C != globalCtx->roomCtx.prevRoom.num) &&
+ ((this->unk_16D != globalCtx->roomCtx.currRoom.num) && (this->unk_16D != globalCtx->roomCtx.prevRoom.num))) {
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_5:
+ D_80B9DED8.unk_01 = 0;
+ break;
+
+ case OBJHUNSUI_F000_6:
+ D_80B9DED8.unk_02 = 0;
+ break;
+ }
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+
+ func_80B9D094(this, globalCtx);
+ if (!(this->unk_172 & 0x40)) {
+ Math_SmoothStepToF(&this->unk_178, this->unk_174, 0.6f, 10.5f, 0.05f);
+ }
+
+ this->dyna.actor.world.pos.y = this->unk_198 + (this->dyna.actor.home.pos.y + this->unk_178);
+ if (this->unk_178 == this->unk_174) {
+ this->unk_172 &= ~0x10;
+ this->unk_172 |= 2;
+ }
+
+ if (func_80B9C450(globalCtx, this->unk_168, this->unk_164)) {
+ this->unk_17C = this->unk_170;
+ this->unk_172 |= 0x40;
+ func_80B9D4D0(this, globalCtx);
+ }
+}
+
+s32 func_80B9D288(GlobalContext* globalCtx, Actor* thisx, Actor* iter, void* verifyData) {
+ s32 ret = false;
+
+ if (BGDBLUEMOVEBG_GET_F(iter) == BGDBLUEMOVEBG_F_8) {
+ ret = true;
+ }
+ return ret;
+}
+
+void func_80B9D2BC(ObjHunsui* this, GlobalContext* globalCtx) {
+ if ((this->unk_172 & 1) || func_80B9C450(globalCtx, this->unk_168, this->unk_164)) {
+ func_80B9D4D0(this, globalCtx);
+ } else {
+ this->unk_172 |= 2;
+ func_80B9D0FC(this, globalCtx);
+ }
+}
+
+void func_80B9D334(ObjHunsui* this, GlobalContext* globalCtx) {
+ Vec3f sp74;
+ s32 i;
+ s32 phi_s2 = 0;
+ s32 phi_s3;
+
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_5:
+ phi_s2 = 1;
+ break;
+
+ case OBJHUNSUI_F000_6:
+ break;
+ }
+
+ if (this->unk_1B4 != NULL) {
+ phi_s3 = false;
+ for (i = 0; i < 8; i++) {
+ if (this->unk_1B4->unk_300[phi_s2][i] == (phi_s2 + 1)) {
+ phi_s3 = true;
+ Math_Vec3f_Copy(&sp74, &this->unk_1B4->unk_238[phi_s2][i]);
+ this->unk_174 = sp74.y - this->dyna.actor.home.pos.y;
+ if (this->unk_174 > 240.0f) {
+ this->unk_174 = 240.0f;
+ }
+ this->unk_190 = 0.0f;
+ this->unk_198 = 0.0f;
+ this->unk_18A = 0;
+ }
+ }
+
+ if (!phi_s3) {
+ this->unk_174 = 240;
+ }
+ } else {
+ Actor* dblueMovebg = SubS_FindActorCustom(globalCtx, &this->dyna.actor, NULL, ACTORCAT_BG,
+ ACTOR_BG_DBLUE_MOVEBG, NULL, func_80B9D288);
+
+ if (dblueMovebg != NULL) {
+ this->unk_1B4 = (BgDblueMovebg*)dblueMovebg;
+ func_80B9D2BC(this, globalCtx);
+ }
+ }
+}
+
+void func_80B9D4D0(ObjHunsui* this, GlobalContext* globalCtx) {
+ this->unk_172 &= ~2;
+ this->unk_172 |= 0x10;
+ this->unk_174 = 240.0f;
+ this->actionFunc = func_80B9D508;
+}
+
+void func_80B9D508(ObjHunsui* this, GlobalContext* globalCtx) {
+ if (((this->unk_160 == OBJHUNSUI_F000_5) || (this->unk_160 == OBJHUNSUI_F000_6)) &&
+ (this->unk_16C != globalCtx->roomCtx.currRoom.num) && (this->unk_16C != globalCtx->roomCtx.prevRoom.num) &&
+ (this->unk_16D != globalCtx->roomCtx.currRoom.num) && (this->unk_16D != globalCtx->roomCtx.prevRoom.num)) {
+ switch (this->unk_160) {
+ case OBJHUNSUI_F000_5:
+ D_80B9DED8.unk_01 = 0;
+ break;
+
+ case OBJHUNSUI_F000_6:
+ D_80B9DED8.unk_02 = 0;
+ break;
+ }
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+
+ func_80B9C5E8(this, globalCtx);
+ func_80B9D094(this, globalCtx);
+
+ if (((this->unk_160 == OBJHUNSUI_F000_5) || (this->unk_160 == OBJHUNSUI_F000_6)) &&
+ (globalCtx->roomCtx.currRoom.num == 8)) {
+ func_80B9D334(this, globalCtx);
+ }
+
+ if (!(this->unk_172 & 0x40)) {
+ Math_SmoothStepToF(&this->unk_178, this->unk_174, 0.6f, 10.5f, 0.05f);
+ }
+
+ this->dyna.actor.world.pos.y = this->unk_198 + (this->dyna.actor.home.pos.y + this->unk_178);
+
+ if ((this->unk_160 == OBJHUNSUI_F000_6) || (this->unk_160 == OBJHUNSUI_F000_5)) {
+ this->unk_1AC += -10.0f + (1.8f * (this->dyna.actor.world.pos.y - this->dyna.actor.prevPos.y));
+ this->unk_1B0 += -8.0f + (0.9f * (this->dyna.actor.world.pos.y - this->dyna.actor.prevPos.y));
+ }
+
+ if (!(this->unk_172 & 1) && !func_80B9C450(globalCtx, this->unk_168, this->unk_164)) {
+ this->unk_17C = this->unk_170;
+ this->unk_172 |= 0x40;
+ func_80B9D0FC(this, globalCtx);
+ }
+}
+
+void func_80B9D714(ObjHunsui* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ s16 cs;
+ f32 sp28;
+
+ if ((this->unk_16C != globalCtx->roomCtx.currRoom.num) && (this->unk_16C != globalCtx->roomCtx.prevRoom.num) &&
+ (this->unk_16D != globalCtx->roomCtx.currRoom.num) && (this->unk_16D != globalCtx->roomCtx.prevRoom.num)) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ } else {
+ if (Flags_GetSwitch(globalCtx, this->unk_168)) {
+ this->unk_172 &= ~2;
+ this->unk_172 |= 0x10;
+ cs = this->dyna.actor.cutscene;
+
+ if (this->unk_16E == 0) {
+ if ((cs >= 0) && !ActorCutscene_GetCanPlayNext(cs)) {
+ ActorCutscene_SetIntentToPlay(cs);
+ } else if (cs >= 0) {
+ ActorCutscene_StartAndSetUnkLinkFields(cs, &this->dyna.actor);
+ this->unk_16E = -1;
+ } else {
+ this->unk_16E = 40;
+ }
+ } else if (this->unk_16E < 0) {
+ if (func_800F22C4(cs, &this->dyna.actor)) {
+ this->unk_16E = 40;
+ }
+ } else {
+ s32 pad;
+
+ if (Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 800.0f, 0.1f, 8.0f,
+ 1.0f) < 0.5f) {
+ if (DECR(this->unk_16E) == 0) {
+ Flags_UnsetSwitch(globalCtx, this->unk_168);
+ }
+ }
+ this->dyna.actor.velocity.y = this->dyna.actor.world.pos.y - this->dyna.actor.prevPos.y;
+ }
+ } else {
+ Math_StepToF(&this->dyna.actor.velocity.y, -10.0f, 4.0f);
+ this->dyna.actor.world.pos.y += this->dyna.actor.velocity.y;
+ if (this->dyna.actor.world.pos.y < this->dyna.actor.home.pos.y) {
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
+ this->unk_172 &= ~0x10;
+ this->unk_172 |= 2;
+ }
+ }
+ }
+
+ if (!DynaPolyActor_IsInRidingMovingState(&this->dyna)) {
+ if (this->dyna.actor.xzDistToPlayer < 45.0f) {
+ if ((this->dyna.actor.playerHeightRel < -this->dyna.actor.velocity.y) &&
+ (this->dyna.actor.playerHeightRel >= -800.0f)) {
+ sp28 = (45.0f - this->dyna.actor.xzDistToPlayer) * 0.5f;
+ player->actor.world.pos.x += sp28 * Math_SinS(this->dyna.actor.yawTowardsPlayer);
+ player->actor.world.pos.z += sp28 * Math_CosS(this->dyna.actor.yawTowardsPlayer);
+ }
+ }
+ }
+}
+
+void ObjHunsui_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ ObjHunsui* this = THIS;
+
+ if (this->unk_172 & 0x10) {
+ f32 temp_f8 = (this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) / 800.0f;
+
+ func_8019FAD8(&this->dyna.actor.projectedPos, NA_SE_EV_WATER_PILLAR - SFX_FLAG, 1.0f + temp_f8);
+ }
+
+ if (!(this->unk_172 & 2)) {
+ AnimatedMat_Draw(globalCtx, D_80B9DED0);
+ Gfx_DrawDListXlu(globalCtx, object_hunsui_DL_000220);
+ }
+}
+
+void func_80B9DA60(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjHunsui* this = THIS;
+ f32 temp;
+
+ if (this->unk_172 & 0x10) {
+ temp = 1.0f + ((this->unk_178 - 240.0f) / 270.0f);
+ func_8019FAD8(&this->dyna.actor.projectedPos, NA_SE_EV_WATER_PILLAR - SFX_FLAG, 1.0f + temp);
+ }
+
+ if ((this->dyna.actor.flags & ACTOR_FLAG_40) && !(this->unk_172 & 2)) {
+ if ((this->unk_160 == OBJHUNSUI_F000_6) || (this->unk_160 == OBJHUNSUI_F000_5)) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gSPSegment(POLY_XLU_DISP++, 0x08,
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (globalCtx->gameplayFrames % 128) * -9, 0x20,
+ 0x20, 1, 0, (globalCtx->gameplayFrames % 128) * -8, 0x20, 0x20));
+ gSPSegment(POLY_XLU_DISP++, 0x09,
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, (s32)this->unk_1AC, 0x20, 0x20, 1, 0,
+ (s32)this->unk_1B0, 0x20, 0x20));
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ } else {
+ AnimatedMat_DrawXlu(globalCtx, D_80B9DED4);
+ }
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x7F, 255, 255, 255, 127);
+
+ Gfx_DrawDListXlu(globalCtx, object_hunsui_DL_000EC0);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+ }
+}
diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h
index e4bacf8217..cbf1e4f133 100644
--- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h
+++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.h
@@ -2,16 +2,56 @@
#define Z_OBJ_HUNSUI_H
#include "global.h"
+#include "overlays/actors/ovl_Bg_Dblue_Movebg/z_bg_dblue_movebg.h"
struct ObjHunsui;
typedef void (*ObjHunsuiActionFunc)(struct ObjHunsui*, GlobalContext*);
+#define OBJHUNSUI_GET_7F(thisx) ((thisx)->params & 0x7F)
+#define OBJHUNSUI_GET_F80(thisx) (((thisx)->params >> 7) & 0x1F)
+#define OBJHUNSUI_GET_F000(thisx) (((thisx)->params >> 0xC) & 0xF)
+
+enum {
+ /* 0 */ OBJHUNSUI_F000_0,
+ /* 1 */ OBJHUNSUI_F000_1,
+ /* 2 */ OBJHUNSUI_F000_2,
+ /* 3 */ OBJHUNSUI_F000_3,
+ /* 4 */ OBJHUNSUI_F000_4,
+ /* 5 */ OBJHUNSUI_F000_5,
+ /* 6 */ OBJHUNSUI_F000_6,
+};
+
typedef struct ObjHunsui {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
+ /* 0x0000 */ DynaPolyActor dyna;
/* 0x015C */ ObjHunsuiActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0x58];
+ /* 0x0160 */ s16 unk_160;
+ /* 0x0164 */ s32 unk_164;
+ /* 0x0168 */ s32 unk_168;
+ /* 0x016C */ s8 unk_16C;
+ /* 0x016D */ s8 unk_16D;
+ /* 0x016E */ s8 unk_16E;
+ /* 0x0170 */ s16 unk_170;
+ /* 0x0172 */ u16 unk_172;
+ /* 0x0174 */ f32 unk_174;
+ /* 0x0178 */ f32 unk_178;
+ /* 0x017C */ s16 unk_17C;
+ /* 0x0180 */ s32 unk_180;
+ /* 0x0184 */ s16 unk_184;
+ /* 0x0186 */ s16 unk_186;
+ /* 0x0188 */ s16 unk_188;
+ /* 0x018A */ s16 unk_18A;
+ /* 0x018C */ s16 unk_18C;
+ /* 0x0190 */ f32 unk_190;
+ /* 0x0194 */ f32 unk_194;
+ /* 0x0198 */ f32 unk_198;
+ /* 0x019C */ f32 unk_19C;
+ /* 0x01A0 */ f32 unk_1A0;
+ /* 0x01A4 */ s16 unk_1A4;
+ /* 0x0196 */ UNK_TYPE1 unk1A6[0x6];
+ /* 0x01AC */ f32 unk_1AC;
+ /* 0x01B0 */ f32 unk_1B0;
+ /* 0x01B4 */ BgDblueMovebg* unk_1B4;
} ObjHunsui; // size = 0x1B8
extern const ActorInit Obj_Hunsui_InitVars;
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 57092079a5..f122dca410 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c
@@ -5,8 +5,10 @@
*/
#include "z_obj_ice_poly.h"
+#include "overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjIcePoly*)thisx)
@@ -15,11 +17,11 @@ void ObjIcePoly_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjIcePoly_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjIcePoly_Draw(Actor* thisx, GlobalContext* globalCtx);
+void func_80931828(ObjIcePoly* this, GlobalContext* globalCtx);
void func_80931A38(ObjIcePoly* this, GlobalContext* globalCtx);
void func_80931E58(ObjIcePoly* this, GlobalContext* globalCtx);
void func_80931EEC(ObjIcePoly* this, GlobalContext* globalCtx);
-#if 0
const ActorInit Obj_Ice_Poly_InitVars = {
ACTOR_OBJ_ICE_POLY,
ACTORCAT_ITEMACTION,
@@ -32,37 +34,327 @@ const ActorInit Obj_Ice_Poly_InitVars = {
(ActorFunc)ObjIcePoly_Draw,
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_80932320 = {
- { COLTYPE_HARD, AT_ON | AT_TYPE_ENEMY, AC_ON | AC_HARD | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK0, { 0xF7CFFFFF, 0x02, 0x00 }, { 0xF7CFF7FF, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_ON, OCELEM_ON, },
+static ColliderCylinderInit sCylinderInit1 = {
+ {
+ COLTYPE_HARD,
+ AT_ON | AT_TYPE_ENEMY,
+ AC_ON | AC_HARD | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK0,
+ { 0xF7CFFFFF, 0x02, 0x00 },
+ { 0xF7CFF7FF, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NONE,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 50, 105, 0, { 0, 0, 0 } },
};
-// static ColliderCylinderInit sCylinderInit = {
-static ColliderCylinderInit D_8093234C = {
- { COLTYPE_NONE, AT_NONE, AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER, OC1_NONE, OC2_TYPE_2, COLSHAPE_CYLINDER, },
- { ELEMTYPE_UNK5, { 0xF7CFFFFF, 0x00, 0x00 }, { 0x00000800, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_NONE, },
+static ColliderCylinderInit sCylinderInit2 = {
+ {
+ COLTYPE_NONE,
+ AT_NONE,
+ AC_ON | AC_TYPE_PLAYER | AC_TYPE_OTHER,
+ OC1_NONE,
+ OC2_TYPE_2,
+ COLSHAPE_CYLINDER,
+ },
+ {
+ ELEMTYPE_UNK5,
+ { 0xF7CFFFFF, 0x00, 0x00 },
+ { 0x00000800, 0x00, 0x00 },
+ TOUCH_NONE | TOUCH_SFX_NORMAL,
+ BUMP_ON,
+ OCELEM_NONE,
+ },
{ 65, 105, 0, { 0, 0, 0 } },
};
-#endif
+static Color_RGBA8 D_80932378 = { 250, 250, 250, 255 };
+static Color_RGBA8 D_8093237C = { 180, 180, 180, 255 };
-extern ColliderCylinderInit D_80932320;
-extern ColliderCylinderInit D_8093234C;
+void ObjIcePoly_Init(Actor* thisx, GlobalContext* globalCtx) {
+ ObjIcePoly* this = THIS;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/ObjIcePoly_Init.s")
+ this->unk_149 = OBJICEPOLY_GET_FF00(thisx);
+ thisx->params &= 0xFF;
+ thisx->uncullZoneForward = 5600.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/ObjIcePoly_Destroy.s")
+ Actor_SetScale(thisx, thisx->params * 0.01f);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/func_80931828.s")
+ for (i = 0; i < ARRAY_COUNT(this->colliders1); i++) {
+ Collider_InitAndSetCylinder(globalCtx, &this->colliders1[i], thisx, &sCylinderInit1);
+ Collider_InitAndSetCylinder(globalCtx, &this->colliders2[i], thisx, &sCylinderInit2);
+ Collider_UpdateCylinder(thisx, &this->colliders1[i]);
+ Collider_UpdateCylinder(thisx, &this->colliders2[i]);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/func_80931A38.s")
+ this->colliders1[0].dim.radius = thisx->scale.x * 48.0f;
+ this->colliders1[0].dim.height = thisx->scale.y * 58.0f;
+ this->colliders2[0].dim.height = this->colliders1[0].dim.height;
+ this->colliders2[0].dim.radius = this->colliders1[0].dim.radius + 17;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/func_80931E58.s")
+ this->colliders1[1].dim.radius = thisx->scale.x * 23.0f;
+ this->colliders1[1].dim.height = thisx->scale.y * 50.0f;
+ this->colliders2[1].dim.radius = this->colliders1[1].dim.radius;
+ this->colliders2[1].dim.height = this->colliders1[1].dim.height;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/func_80931EEC.s")
+ this->colliders1[1].dim.yShift = this->colliders1[0].dim.height;
+ this->colliders2[1].dim.yShift = this->colliders1[1].dim.yShift;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/ObjIcePoly_Update.s")
+ thisx->colChkInfo.mass = MASS_IMMOVABLE;
+ this->unk_148 = 255;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Ice_Poly/ObjIcePoly_Draw.s")
+ Actor_SetFocus(thisx, thisx->scale.y * 30.0f);
+
+ thisx->shape.rot.x = 0x500;
+ thisx->shape.rot.z = -0x500;
+
+ if (((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(globalCtx, this->unk_149)) ||
+ ((globalCtx->sceneNum == SCENE_KAJIYA) && (gSaveContext.weekEventReg[33] & 0x80))) {
+ Actor_MarkForDeath(thisx);
+ return;
+ }
+
+ this->actionFunc = func_80931A38;
+}
+
+void ObjIcePoly_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjIcePoly* this = THIS;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(this->colliders1); i++) {
+ Collider_DestroyCylinder(globalCtx, &this->colliders1[i]);
+ Collider_DestroyCylinder(globalCtx, &this->colliders2[i]);
+ }
+}
+
+void func_80931828(ObjIcePoly* this, GlobalContext* globalCtx) {
+ static Color_RGBA8 D_80932380 = { 170, 255, 255, 255 };
+ static Color_RGBA8 D_80932384 = { 0, 50, 100, 255 };
+ static Vec3f D_80932388 = { 0.0f, -1.0f, 0.0f };
+ f32 temp;
+ Vec3f spA0;
+ Vec3f sp94;
+ f32 sp90;
+ s32 i;
+ CollisionPoly* sp88;
+
+ spA0.x = this->actor.world.pos.x;
+ spA0.y = (this->colliders1[0].dim.height * 2) + this->actor.world.pos.y;
+ spA0.z = this->actor.world.pos.z;
+
+ sp90 = BgCheck_EntityRaycastFloor1(&globalCtx->colCtx, &sp88, &spA0);
+ if (sp90 < this->actor.world.pos.y) {
+ sp90 = this->actor.world.pos.y;
+ }
+ temp = spA0.y - sp90;
+
+ for (i = 0; i < 30; i++) {
+ sp94.x = randPlusMinusPoint5Scaled(12.0f);
+ sp94.y = Rand_ZeroFloat(15.0f);
+ sp94.z = randPlusMinusPoint5Scaled(12.0f);
+
+ spA0.x = (this->colliders1[0].dim.radius * (sp94.x * (1.0f / 12))) + this->actor.world.pos.x;
+ spA0.z = (this->colliders1[0].dim.radius * (sp94.z * (1.0f / 12))) + this->actor.world.pos.z;
+ spA0.y = Rand_ZeroFloat(temp) + sp90;
+ EffectSsEnIce_Spawn(globalCtx, &spA0, (Rand_ZeroFloat(0.4f) + 0.3f) * this->actor.scale.x, &sp94, &D_80932388,
+ &D_80932380, &D_80932384, 40);
+ }
+}
+
+void func_80931A38(ObjIcePoly* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ Vec3f sp6C;
+ s32 i;
+ s32 pad2;
+ s32 phi_v0;
+ s32 pad3;
+ f32 sp58;
+
+ if (!(player->stateFlags2 & 0x4000) && (this->unk_14A != 0)) {
+ this->unk_14A--;
+ }
+
+ if ((this->colliders1[0].base.atFlags & AT_HIT) || (this->colliders1[1].base.atFlags & AT_HIT)) {
+ this->unk_14A = 40;
+ this->colliders1[0].base.atFlags &= ~AT_HIT;
+ this->colliders1[1].base.atFlags &= ~AT_HIT;
+ }
+
+ if (((this->colliders2[0].base.acFlags & AC_HIT) &&
+ ((this->colliders2[0].base.ac == NULL) ||
+ ((this->colliders2[0].base.ac->id != ACTOR_OBJ_AQUA) &&
+ (this->colliders2[0].info.acHitInfo->toucher.dmgFlags == 0x800)) ||
+ ((this->colliders2[0].base.ac->id == ACTOR_OBJ_AQUA) &&
+ (this->colliders2[0].base.ac->params == OBJAQUA_1)))) ||
+ ((this->colliders2[1].base.acFlags & AC_HIT) &&
+ ((this->colliders2[1].base.ac == NULL) ||
+ ((this->colliders2[1].base.ac->id != ACTOR_OBJ_AQUA) &&
+ (this->colliders2[1].info.acHitInfo->toucher.dmgFlags == 0x800)) ||
+ ((this->colliders2[1].base.ac->id == ACTOR_OBJ_AQUA) &&
+ (this->colliders2[1].base.ac->params == OBJAQUA_1))))) {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ this->unk_14A = 0;
+ this->actionFunc = func_80931E58;
+ this->actor.focus.rot.y = this->actor.yawTowardsPlayer;
+
+ if (globalCtx->sceneNum == SCENE_00KEIKOKU) {
+ Actor* actor = NULL;
+
+ do {
+ actor = SubS_FindActor(globalCtx, actor, ACTORCAT_ITEMACTION, ACTOR_OBJ_ICE_POLY);
+ if (actor != NULL) {
+ if ((&this->actor != actor) && (&this->actor != actor)) {
+ ((ObjIcePoly*)actor)->unk_14A = 0;
+ ((ObjIcePoly*)actor)->actionFunc = func_80931E58;
+ }
+ actor = actor->next;
+ }
+ } while (actor != NULL);
+ }
+ } else if ((this->unk_149 != OBJICEPOLY_FF_FF) && Flags_GetSwitch(globalCtx, this->unk_149)) {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ this->unk_14A = 1;
+ this->actionFunc = func_80931E58;
+ } else {
+ if ((this->actor.parent != NULL) && (this->actor.parent->update != NULL)) {
+ this->actor.parent->freezeTimer = 40;
+ } else {
+ this->actor.parent = NULL;
+ }
+
+ if (this->unk_14A == 0) {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliders1[0].base);
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliders1[1].base);
+ }
+
+ for (i = 0; i < ARRAY_COUNT(this->colliders1); i++) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliders1[i].base);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders1[i].base);
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliders2[i].base);
+ }
+ }
+
+ if (Rand_ZeroOne() < 0.05f) {
+ sp58 = Rand_ZeroOne();
+ if (Rand_ZeroOne() < 0.5f) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ sp6C.x = (phi_v0 * (15.0f + (sp58 * 15.0f)) * this->actor.scale.x) + this->actor.world.pos.x;
+ sp6C.y = (((Rand_ZeroOne() * 90.0f) + 10.0f) * this->actor.scale.y) + this->actor.world.pos.y;
+
+ sp58 = Rand_ZeroOne();
+ if (Rand_ZeroOne() < 0.5f) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ sp6C.z = (phi_v0 * (15.0f + (sp58 * 15.0f)) * this->actor.scale.z) + this->actor.world.pos.z;
+
+ EffectSsKiraKira_SpawnDispersed(globalCtx, &sp6C, &gZeroVec3f, &gZeroVec3f, &D_80932378, &D_8093237C, 2000, 5);
+ }
+}
+
+void func_80931E58(ObjIcePoly* this, GlobalContext* globalCtx) {
+ if (ActorCutscene_GetCanPlayNext(this->actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->actor.cutscene, &this->actor);
+ if (this->unk_14A == 1) {
+ func_80931828(this, globalCtx);
+ Actor_MarkForDeath(&this->actor);
+ } else {
+ this->unk_14A = 40;
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_ICE_MELT);
+ this->actionFunc = func_80931EEC;
+ }
+ } else {
+ ActorCutscene_SetIntentToPlay(this->actor.cutscene);
+ }
+}
+
+void func_80931EEC(ObjIcePoly* this, GlobalContext* globalCtx) {
+ Vec3f spAC;
+ Vec3f spA0;
+ Vec3f sp94;
+ f32 temp_f20;
+ s32 i;
+ s32 phi_v0;
+
+ spAC.x = 0.0f;
+ spAC.y = this->actor.scale.y;
+ spAC.z = 0.0f;
+
+ spA0.x = 0.0f;
+ spA0.y = this->actor.scale.y;
+ spA0.z = 0.0f;
+
+ for (i = 0; i < 2; i++) {
+ temp_f20 = Rand_ZeroOne();
+ if (Rand_ZeroOne() < 0.5f) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ sp94.x = (phi_v0 * (20.0f + (20.0f * temp_f20)) * this->actor.scale.x) + this->actor.world.pos.x;
+ sp94.y = (Rand_ZeroOne() * this->actor.scale.y * 50.0f) + this->actor.world.pos.y;
+
+ temp_f20 = Rand_ZeroOne();
+ if (Rand_ZeroOne() < 0.5f) {
+ phi_v0 = -1;
+ } else {
+ phi_v0 = 1;
+ }
+ sp94.z = (phi_v0 * (20.0f + (20.0f * temp_f20)) * this->actor.scale.x) + this->actor.world.pos.z;
+
+ func_800B0DE0(globalCtx, &sp94, &spA0, &spAC, &D_80932378, &D_8093237C,
+ ((Rand_ZeroOne() * 100.0f) + 350.0f) * this->actor.scale.x, this->actor.scale.x * 20.0f);
+ }
+
+ if (this->unk_14A != 0) {
+ this->unk_14A--;
+ }
+
+ this->actor.scale.y = this->actor.params * 0.01f * (0.5f + (this->unk_14A * 0.0125f));
+ this->unk_148 -= 6;
+
+ if (this->unk_14A == 0) {
+ ActorCutscene_Stop(this->actor.cutscene);
+ if (this->unk_149 != OBJICEPOLY_FF_FF) {
+ Flags_SetSwitch(globalCtx, this->unk_149);
+ }
+ Actor_MarkForDeath(&this->actor);
+ }
+}
+
+void ObjIcePoly_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjIcePoly* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+}
+
+void ObjIcePoly_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjIcePoly* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+ func_800B8118(&this->actor, globalCtx, 0);
+
+ gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPSegment(POLY_XLU_DISP++, 0x08,
+ Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, globalCtx->gameplayFrames % 256, 0x20, 0x10, 1, 0,
+ (globalCtx->gameplayFrames * 2) % 256, 0x40, 0x20));
+ gDPSetEnvColor(POLY_XLU_DISP++, 0, 50, 100, this->unk_148);
+ gSPDisplayList(POLY_XLU_DISP++, gameplay_keep_DL_050D10);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
index 6870eccc90..b34866e3cd 100644
--- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
+++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h
@@ -7,11 +7,18 @@ struct ObjIcePoly;
typedef void (*ObjIcePolyActionFunc)(struct ObjIcePoly*, GlobalContext*);
+#define OBJICEPOLY_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
+
+#define OBJICEPOLY_FF_FF 0xFF
+
typedef struct ObjIcePoly {
/* 0x0000 */ Actor actor;
/* 0x0144 */ ObjIcePolyActionFunc actionFunc;
/* 0x0148 */ u8 unk_148;
- /* 0x0149 */ char unk_149[0x133];
+ /* 0x0149 */ u8 unk_149;
+ /* 0x014A */ s16 unk_14A;
+ /* 0x014C */ ColliderCylinder colliders1[2];
+ /* 0x01E4 */ ColliderCylinder colliders2[2];
} ObjIcePoly; // size = 0x27C
extern const ActorInit Obj_Ice_Poly_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
index 0c4f8f63e1..627338400a 100644
--- a/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
+++ b/src/overlays/actors/ovl_Obj_Iceblock/z_obj_iceblock.c
@@ -7,7 +7,7 @@
#include "z_obj_iceblock.h"
#include "objects/object_ice_block/object_ice_block.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjIceblock*)thisx)
@@ -670,7 +670,7 @@ void func_80A24B74(ObjIceblock* this, GlobalContext* globalCtx) {
s32 pad;
Vec3f sp20;
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
if (1) {}
sp20.x = this->dyna.actor.world.pos.x;
sp20.y = this->unk_244;
@@ -687,7 +687,7 @@ void func_80A24BDC(ObjIceblock* this, GlobalContext* globalCtx, f32 arg2, f32 ar
s16 phi_s0;
s32 phi_s1 = 0;
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
sp88.y = this->unk_244;
temp_f22 = 0x10000 / arg4;
@@ -723,7 +723,7 @@ void func_80A24DD0(ObjIceblock* this, GlobalContext* globalCtx) {
}
this->unk_2A2++;
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
if (this->unk_2A2 >= 0x2E) {
phi_f22 = 1.0f;
} else {
@@ -764,7 +764,7 @@ void func_80A2508C(ObjIceblock* this, GlobalContext* globalCtx) {
f32 temp_f0;
s32 temp_v0;
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
temp_v0 = (s32)(this->dyna.actor.scale.y * 130.0f) - 3;
if (temp_v0 > 0) {
this->unk_2AC += temp_v0;
@@ -934,7 +934,7 @@ void ObjIceblock_Init(Actor* thisx, GlobalContext* globalCtx) {
}
if (D_80A26E7C == NULL) {
- D_80A26E7C = Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_000328);
+ D_80A26E7C = Lib_SegmentedToVirtual(object_ice_block_Matanimheader_000328);
}
if (!(this->unk_1B0 & 8)) {
@@ -1008,7 +1008,7 @@ void func_80A2586C(ObjIceblock* this, GlobalContext* globalCtx) {
func_80A2319C(this, this->dyna.actor.scale.x);
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
func_80A2339C(globalCtx, &this->dyna.actor.world.pos, (this->dyna.actor.scale.x + 0.05f) * 0.6666666f, 1.0f, 3);
}
}
@@ -1028,7 +1028,7 @@ void func_80A25994(ObjIceblock* this, GlobalContext* globalCtx) {
return;
}
- if (this->dyna.actor.flags & 0x40) {
+ if (this->dyna.actor.flags & ACTOR_FLAG_40) {
func_80A2339C(globalCtx, &this->dyna.actor.world.pos, this->dyna.actor.scale.x, 1.2f, 15);
if (OBJICEBLOCK_GET_1(&this->dyna.actor)) {
sp30.x = this->dyna.actor.world.pos.x;
@@ -1180,7 +1180,7 @@ void func_80A25E50(ObjIceblock* this, GlobalContext* globalCtx) {
func_80A2541C(this, globalCtx);
func_80A25CF4(this);
} else {
- func_800B9010(&this->dyna.actor, 0xDF);
+ func_800B9010(&this->dyna.actor, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG);
}
}
@@ -1266,7 +1266,7 @@ void func_80A26144(ObjIceblock* this, GlobalContext* globalCtx) {
func_80A23B88(this);
func_80A25FA0(this);
} else {
- func_800B9010(&this->dyna.actor, 0xDF);
+ func_800B9010(&this->dyna.actor, NA_SE_PL_SLIP_ICE_LEVEL - SFX_FLAG);
}
func_80A24DD0(this, globalCtx);
@@ -1510,7 +1510,7 @@ void func_80A26B64(ObjIceblock* this, GlobalContext* globalCtx) {
void func_80A26B74(ObjIceblock* this, GlobalContext* globalCtx) {
Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0001A0);
if (OBJICEBLOCK_GET_1(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_0009D0));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_ice_block_Matanimheader_0009D0));
Gfx_DrawDListXlu(globalCtx, object_ice_block_DL_0007F0);
}
}
@@ -1539,7 +1539,7 @@ void func_80A26BF8(ObjIceblock* this, GlobalContext* globalCtx) {
}
if (OBJICEBLOCK_GET_1(&this->dyna.actor) && (this->unk_2B4 > 0.0f)) {
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&object_ice_block_Matanimheader_0009D0));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_ice_block_Matanimheader_0009D0));
Matrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 20.0f,
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
Matrix_Scale(this->unk_2B4, this->unk_2B4, this->unk_2B4, MTXMODE_APPLY);
diff --git a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
index 4334659864..53d1d76698 100644
--- a/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
+++ b/src/overlays/actors/ovl_Obj_Jg_Gakki/z_obj_jg_gakki.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_jg_gakki.h"
+#include "objects/object_jg/object_jg.h"
-#define FLAGS 0x00000020
+#define FLAGS (ACTOR_FLAG_20)
#define THIS ((ObjJgGakki*)thisx)
@@ -27,22 +28,19 @@ const ActorInit Obj_Jg_Gakki_InitVars = {
(ActorFunc)ObjJgGakki_Draw,
};
-extern AnimationHeader D_0601B1E8; // gGoronElderDrumAnim
-extern SkeletonHeader D_0601B210; // gGoronElderDrumSkel
-
void ObjJgGakki_Init(Actor* thisx, GlobalContext* globalCtx2) {
GlobalContext* globalCtx = globalCtx2;
ObjJgGakki* this = THIS;
- f32 frameCount = Animation_GetLastFrame(&D_0601B1E8);
+ f32 frameCount = Animation_GetLastFrame(&gGoronElderDrumTakeOutAnim);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
- SkelAnime_Init(globalCtx, &this->skelAnime, &D_0601B210, NULL, NULL, NULL, 0);
+ SkelAnime_Init(globalCtx, &this->skelAnime, &gGoronElderDrumSkel, NULL, NULL, NULL, 0);
if (((globalCtx->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 7)) &&
- (globalCtx->csCtx.unk_12 == 0)) {
- Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, frameCount, frameCount, 2, 0.0f);
+ (globalCtx->csCtx.currentCsIndex == 0)) {
+ Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, frameCount, frameCount, 2, 0.0f);
} else if ((globalCtx->sceneNum == SCENE_17SETUGEN) || (globalCtx->sceneNum == SCENE_10YUKIYAMANOMURA)) {
- Animation_Change(&this->skelAnime, &D_0601B1E8, 1.0f, 0.0f, frameCount, 2, 0.0f);
+ Animation_Change(&this->skelAnime, &gGoronElderDrumTakeOutAnim, 1.0f, 0.0f, frameCount, 2, 0.0f);
} else {
Actor_MarkForDeath(&this->actor);
}
diff --git a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c
index 6c8cb37224..68e7717c1a 100644
--- a/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c
+++ b/src/overlays/actors/ovl_Obj_Jgame_Light/z_obj_jgame_light.c
@@ -6,7 +6,7 @@
#include "z_obj_jgame_light.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjJgameLight*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c
index 6782e15ebe..4f8bc1d3a7 100644
--- a/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c
+++ b/src/overlays/actors/ovl_Obj_Kepn_Koya/z_obj_kepn_koya.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_kepn_koya.h"
+#include "objects/object_kepn_koya/object_kepn_koya.h"
#define FLAGS 0x00000000
@@ -32,16 +33,13 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 900, ICHAIN_STOP),
};
-extern CollisionHeader D_0600805C;
-extern Gfx D_06003478[];
-
void ObjKepnKoya_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjKepnKoya* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_0600805C);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_kepn_koya_Colheader_00805C);
if (this->dyna.bgId == BG_ACTOR_MAX) {
Actor_MarkForDeath(&this->dyna.actor);
}
@@ -57,5 +55,5 @@ void ObjKepnKoya_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjKepnKoya_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06003478);
+ Gfx_DrawDListOpa(globalCtx, object_kepn_koya_DL_003478);
}
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 34d45038ae..979848c3b3 100644
--- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c
+++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c
@@ -8,7 +8,7 @@
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "objects/object_kibako/object_kibako.h"
-#define FLAGS 0x04000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_4000000)
#define THIS ((ObjKibako*)thisx)
@@ -133,8 +133,8 @@ void func_80926394(ObjKibako* this, GlobalContext* globalCtx) {
}
void ObjKibako_Init(Actor* thisx, GlobalContext* globalCtx2) {
- ObjKibako* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ ObjKibako* this = THIS;
s32 whichBankIndex;
whichBankIndex = KIBAKO_BANK_INDEX(thisx);
@@ -271,7 +271,7 @@ void ObjKibako_Idle(ObjKibako* this, GlobalContext* globalCtx) {
if (Actor_HasParent(&this->actor, globalCtx)) {
ObjKibako_SetupHeld(this);
this->actor.room = -1;
- this->actor.colChkInfo.mass = 0x78;
+ this->actor.colChkInfo.mass = 120;
if (func_800A817C(KIBAKO_COLLECTIBLE_ID(&this->actor))) {
ObjKibako_SpawnCollectible(this, globalCtx);
}
@@ -347,7 +347,7 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx) {
} else {
Actor_MoveWithGravity(&this->actor);
ObjKibako_SetupThrown(this);
- this->actor.flags &= ~0x4000000;
+ this->actor.flags &= ~ACTOR_FLAG_4000000;
}
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 18.0f, 15.0f, 0.0f, 0x45);
} else {
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 dd8029eca3..c0e5d8b4b8 100644
--- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c
+++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c
@@ -161,7 +161,7 @@ void ObjKibako2_Init(Actor* thisx, GlobalContext* globalCtx) {
if (func_800A81A4(globalCtx, KIBAKO2_COLLECTIBLE_ID(&this->dyna.actor),
KIBAKO2_COLLECTIBLE_FLAG(&this->dyna.actor))) {
this->unk_1AC = 1;
- this->dyna.actor.flags |= 0x10;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
}
}
if ((contents != CONTENTS_SKULLTULA) || !ObjKibako2_ContainsSkulltula(this, globalCtx)) {
@@ -210,7 +210,7 @@ void ObjKibako2_Idle(ObjKibako2* this, GlobalContext* globalCtx) {
if (ObjKibako2_ShouldBreak(this)) {
ObjKibako2_Break(this, globalCtx);
SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->dyna.actor.world.pos, 20, NA_SE_EV_WOODBOX_BREAK);
- this->dyna.actor.flags |= 0x10;
+ this->dyna.actor.flags |= ACTOR_FLAG_10;
func_800C62BC(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
this->dyna.actor.draw = NULL;
this->actionFunc = ObjKibako2_Kill;
diff --git a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c
index 8d4b2f5825..740439eadb 100644
--- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c
+++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_kinoko.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjKinoko*)thisx)
@@ -15,7 +16,6 @@ void ObjKinoko_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjKinoko_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjKinoko_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
const ActorInit Obj_Kinoko_InitVars = {
ACTOR_OBJ_KINOKO,
ACTORCAT_ITEMACTION,
@@ -28,12 +28,63 @@ const ActorInit Obj_Kinoko_InitVars = {
(ActorFunc)ObjKinoko_Draw,
};
-#endif
+void ObjKinoko_Init(Actor* thisx, GlobalContext* globalCtx) {
+ thisx->world.pos.y += 4.0f;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Init.s")
+void ObjKinoko_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Destroy.s")
+void ObjKinoko_Update(Actor* thisx, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s32 pad;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Update.s")
+ if (player->currentMask != PLAYER_MASK_SCENTS) {
+ thisx->draw = NULL;
+ thisx->hintId = 0xFF;
+ thisx->flags &= ~ACTOR_FLAG_1;
+ } else {
+ thisx->draw = ObjKinoko_Draw;
+ thisx->hintId = 0x64;
+ thisx->flags |= ACTOR_FLAG_1;
+ if (Actor_HasParent(thisx, globalCtx)) {
+ Flags_SetCollectible(globalCtx, OBJ_KINOKO_GET_FLAG(thisx));
+ Actor_MarkForDeath(thisx);
+ return;
+ }
+ Actor_PickUp(thisx, globalCtx, GI_MAX, 20.0f, 10.0f);
+ if (Math_SmoothStepToF(&thisx->speedXZ, 0.0f, 0.04f, 2.0f, 0.5f) < 0.5f) {
+ thisx->scale.x = 0.0f;
+ thisx->speedXZ = 110.0f;
+ thisx->velocity.x = 0.2f;
+ }
+ if (Math_SmoothStepToF(&thisx->scale.x, thisx->velocity.x, 0.04f, 0.004f, 0.001f) <
+ ((thisx->velocity.x == 0.0f) ? 0.0f : 0.05f)) {
+ thisx->velocity.x = 0.0f;
+ }
+ thisx->scale.y = thisx->scale.x;
+ thisx->scale.z = thisx->scale.x;
+ thisx->shape.rot.y = Camera_GetCamDirYaw(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kinoko/ObjKinoko_Draw.s")
+void ObjKinoko_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ Gfx* gfx;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C2DC(globalCtx->state.gfxCtx);
+
+ gfx = POLY_XLU_DISP;
+ gDPSetPrimColor(&gfx[0], 0, 0, 169, 63, 186, (u8)thisx->speedXZ);
+ gDPSetEnvColor(&gfx[1], 110, 44, 200, 100);
+ gDPSetRenderMode(&gfx[2], G_RM_PASS, G_RM_ZB_CLD_SURF2);
+ gSPMatrix(&gfx[3], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(&gfx[4], &gameplay_keep_DL_029D10[2]);
+ Matrix_InsertXRotation_s(-0x4000, 1);
+ gSPMatrix(&gfx[5], Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(&gfx[6], &gameplay_keep_DL_029D10[2]);
+ POLY_XLU_DISP = &gfx[7];
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h
index 9ae26adf9d..9073e3e14c 100644
--- a/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h
+++ b/src/overlays/actors/ovl_Obj_Kinoko/z_obj_kinoko.h
@@ -11,4 +11,6 @@ typedef struct ObjKinoko {
extern const ActorInit Obj_Kinoko_InitVars;
+#define OBJ_KINOKO_GET_FLAG(thisx) ((thisx)->params & 0x7F)
+
#endif // Z_OBJ_KINOKO_H
diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c
index d00746c37e..5080c19e63 100644
--- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c
+++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_kzsaku.h"
+#include "objects/object_kzsaku/object_kzsaku.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjKzsaku*)thisx)
@@ -15,7 +16,13 @@ void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void ObjKzsaku_SetupIdle(ObjKzsaku* this);
+void func_80C08BBC(ObjKzsaku* this);
+void func_80C08C84(ObjKzsaku* this);
+void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx);
+void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx);
+void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx);
+
const ActorInit Obj_Kzsaku_InitVars = {
ACTOR_OBJ_KZSAKU,
ACTORCAT_PROP,
@@ -28,27 +35,96 @@ const ActorInit Obj_Kzsaku_InitVars = {
(ActorFunc)ObjKzsaku_Draw,
};
-#endif
+void ObjKzsaku_Init(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjKzsaku* this = THIS;
+ CollisionHeader* col = NULL;
-extern UNK_TYPE D_06000040;
-extern UNK_TYPE D_06001118;
+ Actor_SetScale(&this->dyna.actor, 1.0f);
+ DynaPolyActor_Init(&this->dyna, 1);
+ CollisionHeader_GetVirtual(&object_kzsaku_Colheader_001118, &col);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Init.s")
+ this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, col);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Destroy.s")
+ this->switchFlag = KZSAKU_GET_SWITCHFLAG(thisx);
+ this->raisedAmount = 0.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B60.s")
+ if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
+ func_80C08C84(this);
+ } else {
+ ObjKzsaku_SetupIdle(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08B7C.s")
+void ObjKzsaku_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjKzsaku* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BBC.s")
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08BD0.s")
+void ObjKzsaku_SetupIdle(ObjKzsaku* this) {
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
+ this->actionFunc = ObjKzsaku_Idle;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08C84.s")
+void ObjKzsaku_Idle(ObjKzsaku* this, GlobalContext* globalCtx) {
+ if (Flags_GetSwitch(globalCtx, this->switchFlag)) {
+ func_80C08BBC(this);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/func_80C08CB0.s")
+void func_80C08BBC(ObjKzsaku* this) {
+ this->actionFunc = ObjKzsaku_Rise;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Update.s")
+void ObjKzsaku_Rise(ObjKzsaku* this, GlobalContext* globalCtx) {
+ if (this->dyna.actor.cutscene != -1) {
+ if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) {
+ ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor);
+ } else {
+ ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene);
+ }
+ }
+ if (this->raisedAmount < 450.0f) {
+ func_800B9010(&this->dyna.actor, NA_SE_EV_METALDOOR_SLIDE - SFX_FLAG);
+ this->raisedAmount += 15.0f;
+ } else {
+ func_80C08C84(this);
+ }
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + this->raisedAmount;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Kzsaku/ObjKzsaku_Draw.s")
+void func_80C08C84(ObjKzsaku* this) {
+ this->timer = 0;
+ this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 450.0f;
+ this->actionFunc = func_80C08CB0;
+}
+
+void func_80C08CB0(ObjKzsaku* this, GlobalContext* globalCtx) {
+ if (this->timer <= 20) {
+ if (this->timer == 20) {
+ if (ActorCutscene_GetCurrentIndex() == this->dyna.actor.cutscene) {
+ ActorCutscene_Stop(this->dyna.actor.cutscene);
+ }
+ this->timer = 21;
+ } else {
+ this->timer++;
+ }
+ }
+}
+
+void ObjKzsaku_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjKzsaku* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+}
+
+void ObjKzsaku_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ func_8012C28C(globalCtx->state.gfxCtx);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, object_kzsaku_DL_000040);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
diff --git a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h
index 32b6346775..8c126412de 100644
--- a/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h
+++ b/src/overlays/actors/ovl_Obj_Kzsaku/z_obj_kzsaku.h
@@ -3,15 +3,18 @@
#include "global.h"
+#define KZSAKU_GET_SWITCHFLAG(thisx) (((thisx)->params & 0x7F00) >> 8)
+
struct ObjKzsaku;
typedef void (*ObjKzsakuActionFunc)(struct ObjKzsaku*, GlobalContext*);
typedef struct ObjKzsaku {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
+ /* 0x0000 */ DynaPolyActor dyna;
/* 0x015C */ ObjKzsakuActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0xC];
+ /* 0x0160 */ f32 raisedAmount;
+ /* 0x0164 */ s32 switchFlag;
+ /* 0x0168 */ s16 timer;
} ObjKzsaku; // size = 0x16C
extern const ActorInit Obj_Kzsaku_InitVars;
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 481cc22f6a..300e299aac 100644
--- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c
+++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c
@@ -6,7 +6,7 @@
#include "z_obj_lift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjLift*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c
index 185361c41b..bd86f2dea9 100644
--- a/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c
+++ b/src/overlays/actors/ovl_Obj_Lightblock/z_obj_lightblock.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_lightblock.h"
+#include "objects/object_lightblock/object_lightblock.h"
#define FLAGS 0x00000000
@@ -72,9 +73,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP),
};
-extern CollisionHeader D_06000B80;
extern Gfx D_801AEF88[];
-extern Gfx D_06000178[];
extern Gfx D_801AEFA0[];
void func_80AF3910(ObjLightblock* this, GlobalContext* globalCtx) {
@@ -96,7 +95,7 @@ void ObjLightblock_Init(Actor* thisx, GlobalContext* globalCtx) {
if (Flags_GetSwitch(globalCtx, LIGHTBLOCK_DESTROYED(&this->dyna.actor))) {
Actor_MarkForDeath(&this->dyna.actor);
} else {
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000B80);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_lightblock_Colheader_000B80);
Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit);
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
this->collider.dim.radius = typeVars->radius;
@@ -195,13 +194,13 @@ void ObjLightblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPSegment(POLY_XLU_DISP++, 0x08, D_801AEF88);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 255, this->alpha);
- gSPDisplayList(POLY_XLU_DISP++, D_06000178);
+ gSPDisplayList(POLY_XLU_DISP++, object_lightblock_DL_000178);
} else {
func_8012C28C(globalCtx->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x08, D_801AEFA0);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0x80, 255, 255, 255, 255);
- gSPDisplayList(POLY_OPA_DISP++, D_06000178);
+ gSPDisplayList(POLY_OPA_DISP++, object_lightblock_DL_000178);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 3d8b8d307d..e9456bac12 100644
--- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c
+++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_lightswitch.h"
+#include "objects/object_lightswitch/object_lightswitch.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjLightswitch*)thisx)
@@ -26,13 +27,6 @@ void ObjLightSwitch_SetupDisabled(ObjLightswitch* this);
void ObjLightSwitch_Disabled(ObjLightswitch* this, GlobalContext* globalCtx);
void ObjLightswitch_Idle(ObjLightswitch* this, GlobalContext* globalCtx);
-extern Gfx D_06000260[];
-extern Gfx D_06000398[];
-extern Gfx D_06000408[];
-extern Gfx D_06000C20[];
-extern Gfx D_06000420[];
-extern Gfx D_06001420[];
-
const ActorInit Obj_Lightswitch_InitVars = {
ACTOR_OBJ_LIGHTSWITCH,
ACTORCAT_SWITCH,
@@ -73,10 +67,10 @@ static ColliderJntSphInit sJntSphInit = {
};
// different face addresses for (sleep -> waking -> awake) of light switch face
-static Gfx* sLightswitchFaceGfx[] = {
- D_06000C20,
- D_06000420,
- D_06001420,
+static TexturePtr sLightswitchFaceGfx[] = {
+ object_lightswitch_Tex_000C20,
+ object_lightswitch_Tex_000420,
+ object_lightswitch_Tex_001420,
};
static Color_RGBA8 sLightswitchEffectPrimColor = { 255, 255, 160, 160 };
@@ -385,7 +379,7 @@ void ObjLightSwitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) {
tempPos.z = this->actor.world.pos.z;
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sLightswitchFaceGfx[this->faceState]));
- gSPDisplayList(POLY_OPA_DISP++, D_06000260);
+ gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000260);
tempRot.x = this->actor.shape.rot.x;
tempRot.y = this->actor.shape.rot.y;
@@ -393,13 +387,13 @@ void ObjLightSwitch_DrawOpa(ObjLightswitch* this, GlobalContext* globalCtx) {
Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000398);
+ gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000398);
tempRot.z = this->actor.shape.rot.z - this->edgeRot;
Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000408);
+ gSPDisplayList(POLY_OPA_DISP++, object_lightswitch_DL_000408);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -421,7 +415,7 @@ void ObjLightSwitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) {
tempPos.z = this->actor.world.pos.z;
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(sLightswitchFaceGfx[this->faceState]));
- gSPDisplayList(POLY_XLU_DISP++, D_06000260);
+ gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000260);
tempRot.x = this->actor.shape.rot.x;
tempRot.y = this->actor.shape.rot.y;
@@ -429,13 +423,13 @@ void ObjLightSwitch_DrawXlu(ObjLightswitch* this, GlobalContext* globalCtx) {
Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06000398);
+ gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000398);
tempRot.z = this->actor.shape.rot.z - this->edgeRot;
Matrix_SetStateRotationAndTranslation(tempPos.x, tempPos.y, tempPos.z, &tempRot);
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06000408);
+ gSPDisplayList(POLY_XLU_DISP++, object_lightswitch_DL_000408);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c
index 57db84b121..d804f6b637 100644
--- a/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c
+++ b/src/overlays/actors/ovl_Obj_Lupygamelift/z_obj_lupygamelift.c
@@ -6,7 +6,7 @@
#include "z_obj_lupygamelift.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjLupygamelift*)thisx)
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 19c0787927..a5aaefd4fd 100644
--- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c
+++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c
@@ -6,7 +6,7 @@
#include "z_obj_makekinsuta.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjMakekinsuta*)thisx)
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 c7f49d683a..1645f84693 100644
--- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c
+++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c
@@ -6,7 +6,7 @@
#include "z_obj_makeoshihiki.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjMakeoshihiki*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c
index 9a614c47d2..6d06195d14 100644
--- a/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c
+++ b/src/overlays/actors/ovl_Obj_Milk_Bin/z_obj_milk_bin.c
@@ -5,6 +5,7 @@
*/
#include "z_obj_milk_bin.h"
+#include "objects/object_obj_milk_bin/object_obj_milk_bin.h"
#define FLAGS 0x00000000
@@ -16,13 +17,12 @@ void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx);
// gMilkBinMilkJarDL
-extern Gfx D_060004B0[];
const ActorInit Obj_Milk_Bin_InitVars = {
ACTOR_OBJ_MILK_BIN,
ACTORCAT_PROP,
FLAGS,
- OBJECT_OBJECT_UNSET_MILK_BIN,
+ OBJECT_OBJ_MILK_BIN,
sizeof(ObjMilkBin),
(ActorFunc)ObjMilkBin_Init,
(ActorFunc)ObjMilkBin_Destroy,
@@ -60,7 +60,7 @@ void ObjMilkBin_Init(Actor* thisx, GlobalContext* globalCtx) {
this->disableDraw = 0;
this->type = thisx->params;
- if ((this->type == OBJ_MILK_BIN_TYPE_2) && !(gSaveContext.weekEventReg[0x34] & 1)) {
+ if ((this->type == OBJ_MILK_BIN_TYPE_2) && !(gSaveContext.weekEventReg[52] & 1)) {
this->disableDraw |= 1;
}
}
@@ -72,18 +72,18 @@ void ObjMilkBin_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjMilkBin_Update(Actor* thisx, GlobalContext* globalCtx2) {
- ObjMilkBin* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ ObjMilkBin* this = THIS;
if (this->type == OBJ_MILK_BIN_TYPE_1) {
- if (gSaveContext.weekEventReg[0x16] & 1) {
+ if (gSaveContext.weekEventReg[22] & 1) {
if (((gSaveContext.day == 2) && (gSaveContext.isNight == 1)) || (gSaveContext.day >= 3)) {
Actor_MarkForDeath(&this->actor);
return;
}
}
} else if (this->type == OBJ_MILK_BIN_TYPE_2) {
- if (gSaveContext.weekEventReg[0x34] & 1) {
+ if (gSaveContext.weekEventReg[52] & 1) {
this->disableDraw &= ~1;
} else {
this->disableDraw |= 1;
@@ -100,6 +100,6 @@ void ObjMilkBin_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjMilkBin* this = THIS;
if (!(this->disableDraw & 1)) {
- Gfx_DrawDListOpa(globalCtx, D_060004B0);
+ Gfx_DrawDListOpa(globalCtx, gMilkBinMilkJarDL);
}
}
diff --git a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
index 6bacc61642..a0fc2eff7f 100644
--- a/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
+++ b/src/overlays/actors/ovl_Obj_Moon_Stone/z_obj_moon_stone.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_moon_stone.h"
+#include "objects/object_gi_reserve00/object_gi_reserve00.h"
-#define FLAGS 0x00100010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_100000)
#define THIS ((ObjMoonStone*)thisx)
@@ -36,10 +37,6 @@ const ActorInit Obj_Moon_Stone_InitVars = {
(ActorFunc)ObjMoonStone_Draw,
};
-extern AnimatedMaterial D_06001C60;
-extern Gfx D_06000D78[];
-extern Gfx D_06000C80[];
-
void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjMoonStone* this = THIS;
@@ -50,7 +47,7 @@ void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.focus.pos.y += 10.0f;
if (this->unk194 == 0) {
this->actor.colChkInfo.health = 0;
- this->actor.flags |= 9;
+ this->actor.flags |= (ACTOR_FLAG_1 | ACTOR_FLAG_8);
func_80C0662C(this);
} else {
if ((gSaveContext.weekEventReg[74] & 0x40) == 0) {
@@ -58,7 +55,7 @@ void ObjMoonStone_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, 1, this->actor.world.pos.x, this->actor.world.pos.y,
this->actor.world.pos.z, 0, 0, 0, -1);
}
- this->actor.flags &= ~1;
+ this->actor.flags &= ~ACTOR_FLAG_1;
func_80C0673C(this);
} else {
Actor_MarkForDeath(&this->actor);
@@ -80,7 +77,7 @@ void func_80C06640(ObjMoonStone* this, GlobalContext* globalCtx) {
sp1A -= player->actor.shape.rot.y;
if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
this->actor.colChkInfo.health = 1;
- func_801518B0(globalCtx, 0x5E3U, &this->actor);
+ Message_StartTextbox(globalCtx, 0x5E3U, &this->actor);
func_80C066F8(this);
} else {
s32 phi_v0 = ABS_ALT(sp1A);
@@ -153,11 +150,11 @@ void ObjMoonStone_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C28C(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);
- AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001C60));
+ AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(object_gi_reserve00_Matanimheader_001C60));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000D78);
+ gSPDisplayList(POLY_OPA_DISP++, object_gi_reserve00_DL_000D78);
Matrix_NormalizeXYZ(&globalCtx->billboardMtxF);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_06000C80);
+ gSPDisplayList(POLY_XLU_DISP++, object_gi_reserve00_DL_000C80);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c
index 04fe449916..16ca763174 100644
--- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c
+++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c
@@ -6,7 +6,7 @@
#include "z_obj_mu_pict.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((ObjMuPict*)thisx)
@@ -137,18 +137,18 @@ void func_80C06DC8(ObjMuPict* this, GlobalContext* globalCtx) {
if (this->unk14A == 0) {
if (this->unk148 == 0) {
this->unk148 = 1;
- func_801518B0(globalCtx, 0x159A, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159A, &this->actor);
this->textId = 0x159A;
} else {
- func_801518B0(globalCtx, 0x159D, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159D, &this->actor);
this->textId = 0x159D;
}
} else if (this->unk148 == 0) {
this->unk148 = 1;
- func_801518B0(globalCtx, 0x15A0, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A0, &this->actor);
this->textId = 0x15A0;
} else {
- func_801518B0(globalCtx, 0x15A3, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A3, &this->actor);
this->textId = 0x15A3;
}
}
@@ -157,31 +157,31 @@ void func_80C06E88(ObjMuPict* this, GlobalContext* globalCtx) {
if (func_80147624(globalCtx)) {
switch (this->textId) {
case 0x159A:
- func_801518B0(globalCtx, 0x159B, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159B, &this->actor);
this->textId = 0x159B;
break;
case 0x159B:
- func_801518B0(globalCtx, 0x159C, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159C, &this->actor);
this->textId = 0x159C;
break;
case 0x159D:
- func_801518B0(globalCtx, 0x159E, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159E, &this->actor);
this->textId = 0x159E;
break;
case 0x159E:
- func_801518B0(globalCtx, 0x159F, &this->actor);
+ Message_StartTextbox(globalCtx, 0x159F, &this->actor);
this->textId = 0x159F;
break;
case 0x15A0:
- func_801518B0(globalCtx, 0x15A1, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A1, &this->actor);
this->textId = 0x15A1;
break;
case 0x15A1:
- func_801518B0(globalCtx, 0x15A2, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A2, &this->actor);
this->textId = 0x15A2;
break;
case 0x15A3:
- func_801518B0(globalCtx, 0x15A4, &this->actor);
+ Message_StartTextbox(globalCtx, 0x15A4, &this->actor);
this->textId = 0x15A4;
break;
}
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 1519f92eba..b243544827 100644
--- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
+++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c
@@ -162,8 +162,8 @@ void ObjMure_SpawnActors0(Actor* thisx, GlobalContext* globalCtx) {
}
}
-void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx) {
- GlobalContext* globalCtx2 = globalCtx;
+void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx2) {
+ GlobalContext* globalCtx = globalCtx2;
Actor* actor = &this->actor;
Vec3f spawnPos;
s32 maxChildren = ObjMure_GetMaxChildSpawns(this);
@@ -172,7 +172,7 @@ void ObjMure_SpawnActors1(ObjMure* this, GlobalContext* globalCtx) {
for (i = 0; i < maxChildren; i++) {
ObjMure_GetSpawnPos(&spawnPos, &actor->world.pos, this->ptn, i);
this->children[i] = Actor_SpawnAsChildAndCutscene(
- &globalCtx->actorCtx, globalCtx, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z,
+ &globalCtx2->actorCtx, globalCtx, sSpawnActorIds[this->type], spawnPos.x, spawnPos.y, spawnPos.z,
actor->world.rot.x, actor->world.rot.y, actor->world.rot.z,
(this->type == OBJMURE_TYPE_BUTTERFLY && i == 0) ? 1 : sSpawnParams[this->type], this->actor.cutscene,
this->actor.unk20, NULL);
@@ -259,7 +259,7 @@ void ObjMure_InitialAction(ObjMure* this, GlobalContext* globalCtx) {
void ObjMure_CulledState(ObjMure* this, GlobalContext* globalCtx) {
if (fabsf(this->actor.projectedPos.z) < sZClip[this->type]) {
this->actionFunc = ObjMure_ActiveState;
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
ObjMure_SpawnActors(this, globalCtx);
}
}
@@ -382,7 +382,7 @@ void ObjMure_ActiveState(ObjMure* this, GlobalContext* globalCtx) {
ObjMure_CheckChildren(this, globalCtx);
if (sZClip[this->type] + 40.0f <= fabsf(this->actor.projectedPos.z)) {
this->actionFunc = ObjMure_CulledState;
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
ObjMure_KillActors(this, globalCtx);
} else if (sTypeGroupBehaviorFunc[this->type] != NULL) {
sTypeGroupBehaviorFunc[this->type](this, globalCtx);
diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c
index d2cd9f7fa9..ba5b62151f 100644
--- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c
+++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c
@@ -6,7 +6,7 @@
#include "z_obj_nozoki.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjNozoki*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c
index 66dbd49fbd..731bc43287 100644
--- a/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c
+++ b/src/overlays/actors/ovl_Obj_Ocarinalift/z_obj_ocarinalift.c
@@ -6,7 +6,7 @@
#include "z_obj_ocarinalift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjOcarinalift*)thisx)
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 523cd7fb99..2d1149715f 100644
--- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
+++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c
@@ -5,8 +5,10 @@
*/
#include "z_obj_oshihiki.h"
+#include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h"
+#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjOshihiki*)thisx)
@@ -15,7 +17,14 @@ void ObjOshihiki_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void ObjOshihiki_OnScene(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_SetupOnActor(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_SetupPush(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_SetupFall(ObjOshihiki* this, GlobalContext* globalCtx);
+void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx);
+
const ActorInit Obj_Oshihiki_InitVars = {
ACTOR_OBJ_OSHIHIKI,
ACTORCAT_PROP,
@@ -28,69 +37,567 @@ const ActorInit Obj_Oshihiki_InitVars = {
(ActorFunc)ObjOshihiki_Draw,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80918898[] = {
+static f32 sScales[] = { 0.1f, 0.2f, 0.4f, 0.1f, 0.2f, 0.4f };
+
+static Color_RGB8 sColors[] = {
+ { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 },
+ { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 },
+ { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 },
+};
+
+static InitChainEntry sInitChain[] = {
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 500, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 500, ICHAIN_STOP),
};
-#endif
+// The vertices and center of the bottom face
+static Vec3f sColCheckPoints[] = {
+ { 29.99f, 1.01f, -29.99f }, { -29.99f, 1.01f, -29.99f }, { -29.99f, 1.01f, 29.99f },
+ { 29.99f, 1.01f, 29.99f }, { 0.0f, 1.01f, 0.0f },
+};
-extern InitChainEntry D_80918898[];
+static Vec2f sFaceVtx[] = {
+ { -30.0f, 0.0f }, { 30.0f, 0.0f }, { -30.0f, 60.0f }, { 30.0f, 60.0f }, { -30.0f, 20.0f }, { 30.0f, 20.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917290.s")
+static Vec2f sFaceDirection[] = {
+ { 1.0f, 1.0f }, { -1.0f, 1.0f }, { 1.0f, -1.0f }, { -1.0f, -1.0f }, { 1.0f, 3.0f }, { -1.0f, 3.0f },
+};
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809172E4.s")
+s8 D_80918940[] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091734C.s")
+void ObjOshihiki_RotateXZ(Vec3f* out, Vec3f* in, f32 sn, f32 cs) {
+ out->x = (in->z * sn) + (in->x * cs);
+ out->y = in->y;
+ out->z = (in->z * cs) - (in->x * sn);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917378.s")
+s32 ObjOshihiki_StrongEnough(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 strength = OBJOSHIHIKI_GET_F(&this->dyna.actor);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917408.s")
+ if (this->cantMove) {
+ return false;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917538.s")
+ if ((strength == OBJOSHIHIKI_F_0) || (strength == OBJOSHIHIKI_F_3)) {
+ return true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917604.s")
+ if (func_80124020() >= 2) {
+ return true;
+ }
+ return false;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091763C.s")
+void ObjOshihiki_ResetFloors(ObjOshihiki* this) {
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091768C.s")
+ for (i = 0; i < ARRAY_COUNT(this->floorBgIds); i++) {
+ this->floorBgIds[i] = BGCHECK_SCENE;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Init.s")
+ObjOshihiki* ObjOshihiki_GetBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) {
+ DynaPolyActor* dyna;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Destroy.s")
+ if ((this->floorBgIds[this->highestFloor] != BGCHECK_SCENE) &&
+ (fabsf(this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) < 0.001f)) {
+ dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]);
+ if ((dyna != NULL) && (dyna->actor.id == ACTOR_OBJ_OSHIHIKI)) {
+ return (ObjOshihiki*)dyna;
+ }
+ }
+ return NULL;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917840.s")
+void ObjOshihiki_UpdateInitPos(ObjOshihiki* this) {
+ if (this->dyna.actor.home.pos.x < this->dyna.actor.world.pos.x) {
+ while ((this->dyna.actor.world.pos.x - this->dyna.actor.home.pos.x) >= 60.0f) {
+ this->dyna.actor.home.pos.x += 60.0f;
+ }
+ } else {
+ while ((this->dyna.actor.home.pos.x - this->dyna.actor.world.pos.x) >= 60.0f) {
+ this->dyna.actor.home.pos.x -= 60.0f;
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809179A0.s")
+ if (this->dyna.actor.home.pos.z < this->dyna.actor.world.pos.z) {
+ while ((this->dyna.actor.world.pos.z - this->dyna.actor.home.pos.z) >= 60.0f) {
+ this->dyna.actor.home.pos.z += 60.0f;
+ }
+ } else {
+ while ((this->dyna.actor.home.pos.z - this->dyna.actor.world.pos.z) >= 60.0f) {
+ this->dyna.actor.home.pos.z -= 60.0f;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917AEC.s")
+s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, GlobalContext* globalCtx) {
+ s16 dynaSwitchFlag;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917B44.s")
+ if (dyna == NULL) {
+ return true;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917B9C.s")
+ if (dyna->actor.id == ACTOR_OBJ_SWITCH) {
+ dynaSwitchFlag = OBJSWITCH_GET_7F00(&dyna->actor);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917C14.s")
+ switch (OBJSWITCH_GET_33(&dyna->actor)) {
+ case OBJSWITCH_NORMAL_BLUE:
+ if ((dynaSwitchFlag == OBJOSHIHIKI_GET_7F00(&this->dyna.actor)) &&
+ Flags_GetSwitch(globalCtx, dynaSwitchFlag)) {
+ return false;
+ }
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917E8C.s")
+ case OBJSWITCH_INVERSE_BLUE:
+ if ((dynaSwitchFlag == OBJOSHIHIKI_GET_7F00(&this->dyna.actor)) &&
+ !Flags_GetSwitch(globalCtx, dynaSwitchFlag)) {
+ return false;
+ }
+ break;
+ }
+ }
+ return true;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917F88.s")
+void ObjOshihiki_SetScale(ObjOshihiki* this, GlobalContext* globalCtx) {
+ Actor_SetScale(&this->dyna.actor, sScales[OBJOSHIHIKI_GET_F(&this->dyna.actor)]);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80917FC0.s")
+void ObjOshihiki_SetTextureStep(ObjOshihiki* this, GlobalContext* globalCtx) {
+ switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) {
+ case OBJOSHIHIKI_F_0:
+ case OBJOSHIHIKI_F_3:
+ this->textureStep = 0;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_809180C8.s")
+ case OBJOSHIHIKI_F_1:
+ case OBJOSHIHIKI_F_4:
+ this->textureStep = 1;
+ break;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918108.s")
+ case OBJOSHIHIKI_F_2:
+ case OBJOSHIHIKI_F_5:
+ this->textureStep = 2;
+ break;
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918314.s")
+void ObjOshihiki_SetColor(ObjOshihiki* this, GlobalContext* globalCtx) {
+ Color_RGB8* src = &sColors[OBJOSHIHIKI_GET_F0(&this->dyna.actor)];
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091834C.s")
+ this->color.r = src->r;
+ this->color.g = src->g;
+ this->color.b = src->b;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_8091851C.s")
+void ObjOshihiki_Init(Actor* thisx, GlobalContext* globalCtx) {
+ ObjOshihiki* this = THIS;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/func_80918574.s")
+ DynaPolyActor_Init(&this->dyna, 1);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Update.s")
+ if ((OBJOSHIHIKI_GET_FF00(&this->dyna.actor) >= OBJOSHIHIKI_FF00_0) &&
+ (OBJOSHIHIKI_GET_FF00(&this->dyna.actor) < OBJOSHIHIKI_FF00_80)) {
+ if (Flags_GetSwitch(globalCtx, OBJOSHIHIKI_GET_7F00(&this->dyna.actor))) {
+ switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) {
+ case OBJOSHIHIKI_F_0:
+ case OBJOSHIHIKI_F_1:
+ case OBJOSHIHIKI_F_2:
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ } else {
+ switch (OBJOSHIHIKI_GET_F(&this->dyna.actor)) {
+ case OBJOSHIHIKI_F_3:
+ case OBJOSHIHIKI_F_4:
+ case OBJOSHIHIKI_F_5:
+ Actor_MarkForDeath(&this->dyna.actor);
+ return;
+ }
+ }
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Oshihiki/ObjOshihiki_Draw.s")
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gameplay_dangeon_keep_Colheader_007498);
+ this->texture = Lib_SegmentedToVirtual(gameplay_dangeon_keep_Matanimheader_01B370);
+ ObjOshihiki_SetScale(this, globalCtx);
+ ObjOshihiki_SetTextureStep(this, globalCtx);
+ Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
+ this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE;
+ ObjOshihiki_SetColor(this, globalCtx);
+ ObjOshihiki_ResetFloors(this);
+ ObjOshihiki_SetupOnActor(this, globalCtx);
+}
+
+void ObjOshihiki_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjOshihiki* this = THIS;
+
+ DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId);
+}
+
+void ObjOshihiki_SetFloors(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f colCheckPoint;
+ Vec3f colCheckOffset;
+ s32 i;
+
+ for (i = 0; i < ARRAY_COUNT(sColCheckPoints); i++) {
+ colCheckOffset.x = sColCheckPoints[i].x * (this->dyna.actor.scale.x * 10.0f);
+ colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f);
+ colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f);
+
+ ObjOshihiki_RotateXZ(&colCheckPoint, &colCheckOffset, this->yawSin, this->yawCos);
+
+ colCheckPoint.x += this->dyna.actor.world.pos.x;
+ colCheckPoint.y += this->dyna.actor.prevPos.y;
+ colCheckPoint.z += this->dyna.actor.world.pos.z;
+
+ this->floorHeights[i] = BgCheck_EntityRaycastFloor6(
+ &globalCtx->colCtx, &this->floorPolys[i], &this->floorBgIds[i], &this->dyna.actor, &colCheckPoint, 0.0f);
+ }
+}
+
+s16 ObjOshihiki_GetHighestFloor(ObjOshihiki* this) {
+ s32 i;
+ s16 highestFloor = 0;
+
+ for (i = 1; i < ARRAY_COUNT(this->floorHeights); i++) {
+ if (this->floorHeights[i] > this->floorHeights[highestFloor]) {
+ highestFloor = i;
+ } else if ((this->floorBgIds[i] == BGCHECK_SCENE) &&
+ ((this->floorHeights[i] - this->floorHeights[highestFloor]) > -0.001f)) {
+ highestFloor = i;
+ }
+ }
+
+ return highestFloor;
+}
+
+void ObjOshihiki_SetGround(ObjOshihiki* this, GlobalContext* globalCtx) {
+ ObjOshihiki_ResetFloors(this);
+ ObjOshihiki_SetFloors(this, globalCtx);
+ this->highestFloor = ObjOshihiki_GetHighestFloor(this);
+ this->dyna.actor.floorHeight = this->floorHeights[this->highestFloor];
+}
+
+s32 ObjOshihiki_CheckFloor(ObjOshihiki* this, GlobalContext* globalCtx) {
+ ObjOshihiki_SetGround(this, globalCtx);
+
+ if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) {
+ this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
+ return true;
+ }
+ return false;
+}
+
+s32 ObjOshihiki_CheckGround(ObjOshihiki* this, GlobalContext* globalCtx) {
+ if (this->dyna.actor.world.pos.y <= BGCHECK_Y_MIN + 10.0f) {
+ Actor_MarkForDeath(&this->dyna.actor);
+ return false;
+ }
+
+ if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= -0.001f) {
+ this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
+ return true;
+ }
+ return false;
+}
+
+s32 ObjOshihiki_CheckWall(GlobalContext* globalCtx, s16 angle, f32 direction, ObjOshihiki* this) {
+ f32 maxDists[2];
+ f32 maxDist;
+ f32 sn;
+ f32 cs;
+ s32 i;
+ Vec3f faceVtx;
+ Vec3f faceVtxNext;
+ Vec3f posResult;
+ Vec3f faceVtxOffset;
+ s32 bgId;
+ CollisionPoly* outPoly;
+
+ sn = Math_SinS(angle);
+ cs = Math_CosS(angle);
+
+ maxDists[0] = ((this->dyna.actor.scale.x * 300.0f) + 60.0f) - 0.5f;
+ if (direction > 0.0f) {
+ maxDists[1] = maxDists[0];
+ } else {
+ maxDists[0] = -maxDists[0];
+ maxDists[1] = -(((this->dyna.actor.scale.x * 300.0f) + 90.0f) - 0.5f);
+ }
+
+ for (i = 0; i < ARRAY_COUNT(sFaceDirection); i++) {
+ maxDist = maxDists[D_80918940[i]];
+
+ faceVtxOffset.x = (sFaceVtx[i].x * this->dyna.actor.scale.x * 10.0f) + sFaceDirection[i].x;
+ faceVtxOffset.y = (sFaceVtx[i].y * this->dyna.actor.scale.y * 10.0f) + sFaceDirection[i].y;
+ faceVtxOffset.z = 0.0f;
+
+ ObjOshihiki_RotateXZ(&faceVtx, &faceVtxOffset, sn, cs);
+
+ faceVtx.x += this->dyna.actor.world.pos.x;
+ faceVtx.y += this->dyna.actor.world.pos.y;
+ faceVtx.z += this->dyna.actor.world.pos.z;
+
+ faceVtxNext.x = (maxDist * sn) + faceVtx.x;
+ faceVtxNext.y = faceVtx.y;
+ faceVtxNext.z = (maxDist * cs) + faceVtx.z;
+
+ if (BgCheck_EntityLineTest3(&globalCtx->colCtx, &faceVtx, &faceVtxNext, &posResult, &outPoly, 1, 0, 0, 1, &bgId,
+ &this->dyna.actor, 0.0f)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjOshihiki* blockUnder = ObjOshihiki_GetBlockUnder(this, globalCtx);
+
+ if ((blockUnder != NULL) && (blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) {
+ if (!ObjOshihiki_CheckWall(globalCtx, blockUnder->dyna.yRotation, blockUnder->direction, this)) {
+ this->blockUnder = blockUnder;
+ }
+ }
+
+ if (this->stateFlags & PUSHBLOCK_MOVE_UNDER) {
+ if (this->blockUnder != NULL) {
+ if (this->blockUnder->stateFlags & PUSHBLOCK_PUSH) {
+ this->underDistX = this->blockUnder->dyna.actor.world.pos.x - this->blockUnder->dyna.actor.prevPos.x;
+ this->underDistZ = this->blockUnder->dyna.actor.world.pos.z - this->blockUnder->dyna.actor.prevPos.z;
+ this->dyna.actor.world.pos.x += this->underDistX;
+ this->dyna.actor.world.pos.z += this->underDistZ;
+ ObjOshihiki_UpdateInitPos(this);
+ return true;
+ }
+
+ if (!(this->blockUnder->stateFlags & PUSHBLOCK_SETUP_PUSH)) {
+ this->blockUnder = NULL;
+ }
+ }
+ }
+ return false;
+}
+
+void ObjOshihiki_SetupOnScene(ObjOshihiki* this, GlobalContext* globalCtx) {
+ this->stateFlags |= PUSHBLOCK_SETUP_ON_SCENE;
+ this->dyna.actor.gravity = 0.0f;
+ this->dyna.actor.velocity.z = 0.0f;
+ this->dyna.actor.velocity.y = 0.0f;
+ this->dyna.actor.velocity.x = 0.0f;
+ this->actionFunc = ObjOshihiki_OnScene;
+}
+
+void ObjOshihiki_OnScene(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+
+ this->stateFlags |= PUSHBLOCK_ON_SCENE;
+
+ if (this->timer <= 0) {
+ if (fabsf(this->dyna.pushForce) > 0.001f) {
+ if (ObjOshihiki_StrongEnough(this, globalCtx)) {
+ if (!ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) {
+ this->direction = this->dyna.pushForce;
+ ObjOshihiki_SetupPush(this, globalCtx);
+ return;
+ }
+ }
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ }
+ } else if (fabsf(this->dyna.pushForce) > 0.001f) {
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ }
+}
+
+void ObjOshihiki_SetupOnActor(ObjOshihiki* this, GlobalContext* globalCtx) {
+ this->stateFlags |= PUSHBLOCK_SETUP_ON_ACTOR;
+ this->dyna.actor.velocity.z = 0.0f;
+ this->dyna.actor.velocity.y = 0.0f;
+ this->dyna.actor.velocity.x = 0.0f;
+ this->dyna.actor.gravity = -1.0f;
+ this->actionFunc = ObjOshihiki_OnActor;
+}
+
+void ObjOshihiki_OnActor(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ DynaPolyActor* dyna;
+ s32 sp20 = false;
+
+ this->stateFlags |= PUSHBLOCK_ON_ACTOR;
+ Actor_MoveWithGravity(&this->dyna.actor);
+
+ if (ObjOshihiki_CheckFloor(this, globalCtx)) {
+ if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) {
+ ObjOshihiki_SetupOnScene(this, globalCtx);
+ } else {
+ dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]);
+ if (dyna != NULL) {
+ DynaPolyActor_SetRidingFallingState(dyna);
+ DynaPolyActor_SetSwitchPressedState(dyna);
+ if ((this->timer <= 0) && (fabsf(this->dyna.pushForce) > 0.001f) &&
+ ObjOshihiki_StrongEnough(this, globalCtx) && ObjOshihiki_NoSwitchPress(this, dyna, globalCtx) &&
+ !ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) {
+ this->direction = this->dyna.pushForce;
+ ObjOshihiki_SetupPush(this, globalCtx);
+ sp20 = true;
+ }
+ } else {
+ ObjOshihiki_SetupOnScene(this, globalCtx);
+ }
+ }
+ } else if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) {
+ ObjOshihiki_SetupFall(this, globalCtx);
+ } else {
+ dyna = DynaPoly_GetActor(&globalCtx->colCtx, this->floorBgIds[this->highestFloor]);
+ if ((dyna != NULL) && (dyna->flags & 1)) {
+ DynaPolyActor_SetRidingFallingState(dyna);
+ DynaPolyActor_SetSwitchPressedState(dyna);
+ this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight;
+ } else {
+ ObjOshihiki_SetupFall(this, globalCtx);
+ }
+ }
+
+ if (!sp20 && (fabsf(this->dyna.pushForce) > 0.001f)) {
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ }
+}
+
+void ObjOshihiki_SetupPush(ObjOshihiki* this, GlobalContext* globalCtx) {
+ this->stateFlags |= PUSHBLOCK_SETUP_PUSH;
+ this->dyna.actor.gravity = 0.0f;
+ this->pushSpeed = 2.0f;
+ this->actionFunc = ObjOshihiki_Push;
+}
+
+void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Player* player = GET_PLAYER(globalCtx);
+ f32 pushDistSigned;
+ s32 stopFlag;
+
+ this->stateFlags |= PUSHBLOCK_PUSH;
+ stopFlag = Math_StepToF(&this->pushDist, 60.0f, this->pushSpeed);
+
+ pushDistSigned = ((this->direction >= 0.0f) ? 1.0f : -1.0f) * this->pushDist;
+ this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + (pushDistSigned * this->yawSin);
+ this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + (pushDistSigned * this->yawCos);
+
+ if (!ObjOshihiki_CheckFloor(this, globalCtx)) {
+ this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
+ this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ this->pushDist = 0.0f;
+ this->pushSpeed = 0.0f;
+ ObjOshihiki_SetupFall(this, globalCtx);
+ } else if (stopFlag) {
+ player = GET_PLAYER(globalCtx);
+
+ if (ObjOshihiki_CheckWall(globalCtx, this->dyna.yRotation, this->dyna.pushForce, this)) {
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
+ }
+
+ this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x;
+ this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z;
+ player->stateFlags2 &= ~0x10;
+ this->dyna.pushForce = 0.0f;
+ this->pushDist = 0.0f;
+ this->pushSpeed = 0.0f;
+ this->timer = 10;
+
+ if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) {
+ ObjOshihiki_SetupOnScene(this, globalCtx);
+ } else {
+ ObjOshihiki_SetupOnActor(this, globalCtx);
+ }
+ }
+
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG);
+}
+
+void ObjOshihiki_SetupFall(ObjOshihiki* this, GlobalContext* globalCtx) {
+ this->stateFlags |= PUSHBLOCK_SETUP_FALL;
+ this->dyna.actor.velocity.z = 0.0f;
+ this->dyna.actor.velocity.y = 0.0f;
+ this->dyna.actor.velocity.x = 0.0f;
+ this->dyna.actor.gravity = -1.0f;
+ ObjOshihiki_SetGround(this, globalCtx);
+ this->actionFunc = ObjOshihiki_Fall;
+}
+
+void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx) {
+ Player* player = GET_PLAYER(globalCtx);
+ s16 temp_t4;
+
+ this->stateFlags |= PUSHBLOCK_FALL;
+
+ if (fabsf(this->dyna.pushForce) > 0.001f) {
+ this->dyna.pushForce = 0.0f;
+ player->stateFlags2 &= ~0x10;
+ }
+
+ Actor_MoveWithGravity(&this->dyna.actor);
+
+ if (ObjOshihiki_CheckGround(this, globalCtx)) {
+ if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) {
+ ObjOshihiki_SetupOnScene(this, globalCtx);
+ } else {
+ ObjOshihiki_SetupOnActor(this, globalCtx);
+ }
+ Actor_PlaySfxAtPos(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND);
+ Actor_PlaySfxAtPos(&this->dyna.actor,
+ SurfaceType_GetSfx(&globalCtx->colCtx, this->floorPolys[this->highestFloor],
+ this->floorBgIds[this->highestFloor]) +
+ SFX_FLAG);
+ }
+}
+
+void ObjOshihiki_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjOshihiki* this = THIS;
+
+ this->stateFlags &=
+ ~(PUSHBLOCK_SETUP_FALL | PUSHBLOCK_FALL | PUSHBLOCK_SETUP_PUSH | PUSHBLOCK_PUSH | PUSHBLOCK_SETUP_ON_ACTOR |
+ PUSHBLOCK_ON_ACTOR | PUSHBLOCK_SETUP_ON_SCENE | PUSHBLOCK_ON_SCENE);
+ this->stateFlags |= PUSHBLOCK_MOVE_UNDER;
+ if (this->timer > 0) {
+ this->timer--;
+ }
+
+ this->dyna.actor.world.rot.y = this->dyna.yRotation;
+ this->yawSin = Math_SinS(this->dyna.actor.world.rot.y);
+ this->yawCos = Math_CosS(this->dyna.actor.world.rot.y);
+
+ if (this->actionFunc != NULL) {
+ this->actionFunc(this, globalCtx);
+ }
+}
+
+void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ s32 pad;
+ ObjOshihiki* this = THIS;
+
+ OPEN_DISPS(globalCtx->state.gfxCtx);
+
+ if (ObjOshihiki_MoveWithBlockUnder(this, globalCtx)) {
+ Matrix_InsertTranslation(this->underDistX * 10.0f, 0.0f, this->underDistZ * 10.0f, MTXMODE_APPLY);
+ }
+
+ this->stateFlags &= ~PUSHBLOCK_MOVE_UNDER;
+ func_8012C28C(globalCtx->state.gfxCtx);
+ AnimatedMat_DrawStep(globalCtx, this->texture, this->textureStep);
+
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0xFF, 0xFF, this->color.r, this->color.g, this->color.b, 255);
+ gSPDisplayList(POLY_OPA_DISP++, gameplay_dangeon_keep_DL_0182A8);
+
+ CLOSE_DISPS(globalCtx->state.gfxCtx);
+}
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 4b265f4bea..e08630132a 100644
--- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h
+++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h
@@ -7,11 +7,57 @@ struct ObjOshihiki;
typedef void (*ObjOshihikiActionFunc)(struct ObjOshihiki*, GlobalContext*);
+#define OBJOSHIHIKI_GET_F(thisx) ((thisx)->params & 0xF)
+#define OBJOSHIHIKI_GET_F0(thisx) (((thisx)->params >> 4) & 0xF)
+#define OBJOSHIHIKI_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F)
+#define OBJOSHIHIKI_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
+
+enum {
+ /* 0 */ OBJOSHIHIKI_F_0,
+ /* 1 */ OBJOSHIHIKI_F_1,
+ /* 2 */ OBJOSHIHIKI_F_2,
+ /* 3 */ OBJOSHIHIKI_F_3,
+ /* 4 */ OBJOSHIHIKI_F_4,
+ /* 5 */ OBJOSHIHIKI_F_5,
+ /* 6 */ OBJOSHIHIKI_F_6,
+ /* 7 */ OBJOSHIHIKI_F_7,
+ /* 8 */ OBJOSHIHIKI_F_8,
+};
+
+#define OBJOSHIHIKI_FF00_0 0
+#define OBJOSHIHIKI_FF00_80 0x80
+
+#define PUSHBLOCK_ON_SCENE (1 << 0)
+#define PUSHBLOCK_SETUP_ON_SCENE (1 << 1)
+#define PUSHBLOCK_ON_ACTOR (1 << 2)
+#define PUSHBLOCK_SETUP_ON_ACTOR (1 << 3)
+#define PUSHBLOCK_PUSH (1 << 4)
+#define PUSHBLOCK_SETUP_PUSH (1 << 5)
+#define PUSHBLOCK_FALL (1 << 6)
+#define PUSHBLOCK_SETUP_FALL (1 << 7)
+#define PUSHBLOCK_MOVE_UNDER (1 << 8)
+
typedef struct ObjOshihiki {
- /* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x18];
+ /* 0x0000 */ DynaPolyActor dyna;
/* 0x015C */ ObjOshihikiActionFunc actionFunc;
- /* 0x0160 */ char unk_160[0x6C];
+ /* 0x0160 */ u16 stateFlags;
+ /* 0x0162 */ s16 timer;
+ /* 0x0164 */ f32 yawSin;
+ /* 0x0168 */ f32 yawCos;
+ /* 0x016C */ f32 pushSpeed;
+ /* 0x0170 */ f32 pushDist;
+ /* 0x0174 */ f32 direction;
+ /* 0x0178 */ s32 floorBgIds[5];
+ /* 0x018C */ CollisionPoly* floorPolys[5];
+ /* 0x01A0 */ f32 floorHeights[5];
+ /* 0x01B4 */ s16 highestFloor;
+ /* 0x01B6 */ u8 cantMove;
+ /* 0x01B8 */ struct ObjOshihiki* blockUnder;
+ /* 0x01BC */ f32 underDistX;
+ /* 0x01C0 */ f32 underDistZ;
+ /* 0x01C4 */ s8 textureStep;
+ /* 0x01C5 */ Color_RGB8 color;
+ /* 0x01C8 */ AnimatedMaterial* texture;
} ObjOshihiki; // size = 0x1CC
extern const ActorInit Obj_Oshihiki_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c
index 1c8f0a132d..0f594f1e15 100644
--- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c
+++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c
@@ -6,7 +6,7 @@
#include "z_obj_purify.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjPurify*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
index b89a0b1c36..d6f35c491e 100644
--- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
+++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c
@@ -6,7 +6,7 @@
#include "z_obj_pzlblock.h"
-#define FLAGS 0x04000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_4000000)
#define THIS ((ObjPzlblock*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c
index 45bb9ffca9..0acdf1bca1 100644
--- a/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c
+++ b/src/overlays/actors/ovl_Obj_Raillift/z_obj_raillift.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_raillift.h"
+#include "objects/object_raillift/object_raillift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjRaillift*)thisx)
@@ -26,12 +27,6 @@ void ObjRaillift_Teleport(ObjRaillift* this, GlobalContext* globalCtx);
void ObjRaillift_Wait(ObjRaillift* this, GlobalContext* globalCtx);
void ObjRaillift_Move(ObjRaillift* this, GlobalContext* globalCtx);
-extern CollisionHeader D_06004FF8;
-extern CollisionHeader D_060048D0;
-extern Gfx D_06004BF0[];
-extern Gfx D_06000208[];
-extern Gfx D_060071B8[];
-
const ActorInit Obj_Raillift_InitVars = {
ACTOR_OBJ_RAILLIFT,
ACTORCAT_BG,
@@ -51,7 +46,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-static CollisionHeader* sColHeaders[] = { &D_06004FF8, &D_060048D0 };
+static CollisionHeader* sColHeaders[] = { &object_raillift_Colheader_004FF8, &object_raillift_Colheader_0048D0 };
void ObjRaillift_UpdatePosition(ObjRaillift* this, s32 idx) {
Math_Vec3s_ToVec3f(&this->dyna.actor.world.pos, &this->points[idx]);
@@ -275,7 +270,7 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) {
Gfx_TwoTexScrollEnvColor(globalCtx->state.gfxCtx, 0, globalCtx->gameplayFrames, 0, 32, 32, 1, 0, 0, 32,
32, 0, 0, 0, 160));
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06004BF0);
+ gSPDisplayList(POLY_OPA_DISP++, object_raillift_DL_004BF0);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -283,12 +278,12 @@ void ObjRaillift_Draw(Actor* thisx, GlobalContext* globalCtx) {
The non-colorful platforms are the ones found in Woodfall Temple
*/
void ObjRaillift_DrawDekuFlowerPlatform(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_06000208);
+ Gfx_DrawDListOpa(globalCtx, object_raillift_DL_000208);
}
/*
The colorful platforms are the ones found in Deku Palace
*/
void ObjRaillift_DrawDekuFlowerPlatformColorful(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListOpa(globalCtx, D_060071B8);
+ Gfx_DrawDListOpa(globalCtx, object_raillift_DL_0071B8);
}
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 d7f15477a7..a1cc93b9fd 100644
--- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c
+++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c
@@ -6,7 +6,7 @@
#include "z_obj_roomtimer.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjRoomtimer*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c
index 61bc5570c6..f6f744d155 100644
--- a/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c
+++ b/src/overlays/actors/ovl_Obj_Shutter/z_obj_shutter.c
@@ -6,7 +6,7 @@
#include "z_obj_shutter.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjShutter*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
index 7bd1dfc1e1..8219bc581d 100644
--- a/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
+++ b/src/overlays/actors/ovl_Obj_Skateblock/z_obj_skateblock.c
@@ -6,7 +6,7 @@
#include "z_obj_skateblock.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjSkateblock*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c
index f928acc0ec..badd4318ea 100644
--- a/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c
+++ b/src/overlays/actors/ovl_Obj_Smork/z_obj_smork.c
@@ -6,7 +6,7 @@
#include "z_obj_smork.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjSmork*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c
index 9eb0ae99f4..632d1b8c6a 100644
--- a/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c
+++ b/src/overlays/actors/ovl_Obj_Snowball/z_obj_snowball.c
@@ -482,7 +482,7 @@ void ObjSnowball_Init(Actor* thisx, GlobalContext* globalCtx) {
if (sp34) {
this->actor.textId = 0x238;
- this->actor.flags |= 1;
+ this->actor.flags |= ACTOR_FLAG_1;
this->actor.targetArrowOffset = 1400.0f / 3.0f;
Actor_SetFocus(&this->actor, 24.0f);
this->actor.targetMode = 3;
@@ -539,9 +539,9 @@ void func_80B04350(ObjSnowball* this, GlobalContext* globalCtx) {
if (flag && (this->unk_211 == 0) &&
(this->collider.elements->info.acHitInfo->toucher.dmgFlags &
(0x80000000 | 0x4000 | 0x800 | 0x400 | 0x100 | 0x8))) {
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
if (this->actor.home.rot.y == 1) {
- this->actor.flags &= ~(8 | 1);
+ this->actor.flags &= ~(ACTOR_FLAG_1 | ACTOR_FLAG_8);
}
if (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x4000) {
@@ -761,11 +761,11 @@ void ObjSnowball_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->actor.home.rot.y == 1) {
if (this->unk_211 != 0) {
if (Actor_TextboxIsClosing(&this->actor, globalCtx)) {
- this->actor.flags &= ~0x10;
+ this->actor.flags &= ~ACTOR_FLAG_10;
this->unk_211 = 0;
}
} else if (Actor_ProcessTalkRequest(&this->actor, &globalCtx->state)) {
- this->actor.flags |= 0x10;
+ this->actor.flags |= ACTOR_FLAG_10;
this->unk_211 = 1;
} else if (this->actor.isTargeted) {
sp24 = true;
diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c
index d21acc8b5a..76111148a9 100644
--- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c
+++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_snowball2.h"
+#include "objects/object_goroiwa/object_goroiwa.h"
-#define FLAGS 0x00800000
+#define FLAGS (ACTOR_FLAG_800000)
#define THIS ((ObjSnowball2*)thisx)
@@ -15,7 +16,16 @@ void ObjSnowball2_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjSnowball2_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjSnowball2_Draw(Actor* thisx, GlobalContext* globalCtx);
-#if 0
+void func_80B38E20(ObjSnowball2* this);
+void func_80B39C78(ObjSnowball2* this);
+void func_80B39C9C(ObjSnowball2* this, GlobalContext* globalCtx);
+void func_80B39F60(ObjSnowball2* this);
+void func_80B39FA8(ObjSnowball2* this, GlobalContext* globalCtx);
+void func_80B3A0D8(ObjSnowball2* this);
+void func_80B3A13C(ObjSnowball2* this, GlobalContext* globalCtx);
+void func_80B3A498(ObjSnowball2* this);
+void func_80B3A500(ObjSnowball2* this, GlobalContext* globalCtx);
+
const ActorInit Obj_Snowball2_InitVars = {
ACTOR_OBJ_SNOWBALL2,
ACTORCAT_PROP,
@@ -28,82 +38,587 @@ const ActorInit Obj_Snowball2_InitVars = {
(ActorFunc)ObjSnowball2_Draw,
};
-// static ColliderJntSphElementInit sJntSphElementsInit[1] = {
-static ColliderJntSphElementInit D_80B3A8E0[1] = {
+static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
- { ELEMTYPE_UNK0, { 0x00400000, 0x00, 0x02 }, { 0x0583FFBE, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_ON, OCELEM_ON, },
+ {
+ ELEMTYPE_UNK0,
+ { 0x00400000, 0x00, 0x02 },
+ { 0x0583FFBE, 0x00, 0x00 },
+ TOUCH_ON | TOUCH_SFX_NONE,
+ BUMP_ON,
+ OCELEM_ON,
+ },
{ 0, { { 0, 0, 0 }, 15 }, 100 },
},
};
-// static ColliderJntSphInit sJntSphInit = {
-static ColliderJntSphInit D_80B3A904 = {
- { COLTYPE_NONE, AT_ON | AT_TYPE_PLAYER, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_2, COLSHAPE_JNTSPH, },
- 1, D_80B3A8E0, // sJntSphElementsInit,
+static ColliderJntSphInit sJntSphInit = {
+ {
+ COLTYPE_NONE,
+ AT_ON | AT_TYPE_PLAYER,
+ AC_ON | AC_TYPE_PLAYER,
+ OC1_ON | OC1_TYPE_ALL,
+ OC2_TYPE_2,
+ COLSHAPE_JNTSPH,
+ },
+ 1,
+ sJntSphElementsInit,
};
-// static InitChainEntry sInitChain[] = {
-static InitChainEntry D_80B3A93C[] = {
- ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE),
- ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE),
- ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE),
- ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE),
- ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE),
- ICHAIN_VEC3F_DIV1000(scale, 25, ICHAIN_STOP),
+Color_RGBA8 D_80B3A914 = { 250, 250, 250, 255 };
+
+Color_RGBA8 D_80B3A918 = { 180, 180, 180, 255 };
+
+Gfx* D_80B3A91C[] = {
+ object_goroiwa_DL_0072F0,
+ object_goroiwa_DL_0077D0,
+ object_goroiwa_DL_007C60,
+ object_goroiwa_DL_007C60,
};
-#endif
+Vec3f D_80B3A92C = { 0.0f, 0.3f, 0.0f };
-extern ColliderJntSphElementInit D_80B3A8E0[1];
-extern ColliderJntSphInit D_80B3A904;
-extern InitChainEntry D_80B3A93C[];
+void func_80B38E20(ObjSnowball2* this) {
+ Matrix_SetStateRotationAndTranslation(this->actor.world.pos.x,
+ this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y),
+ this->actor.world.pos.z, &this->actor.shape.rot);
+ Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
+ Collider_UpdateSpheres(0, &this->collider);
+}
-extern UNK_TYPE D_06008B90;
+void func_80B38E88(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 temp_v0;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B38E20.s")
+ if (this->unk_1AE == 0) {
+ temp_v0 = func_800A8150(ENOBJSNOWBALL2_GET_3F(&this->actor));
+ if (temp_v0 >= 0) {
+ Item_DropCollectible(globalCtx, &this->actor.world.pos,
+ (ENOBJSNOWBALL2_GET_7F00(&this->actor) << 8) | temp_v0);
+ this->unk_1AE = 1;
+ }
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B38E88.s")
+void func_80B38EFC(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 i;
+ Vec3f spA4;
+ Vec3f sp98;
+ Vec3f sp8C;
+ f32 sp88 = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B38EFC.s")
+ for (i = 0; i < 2; i++) {
+ sp8C.x = ((Rand_ZeroOne() * 30.0f) - 15.0f) + this->actor.world.pos.x;
+ sp8C.y = ((Rand_ZeroOne() * 20.0f) - 10.0f) + sp88;
+ sp8C.z = ((Rand_ZeroOne() * 30.0f) - 15.0f) + this->actor.world.pos.z;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39108.s")
+ sp98.x = (Rand_ZeroOne() - 0.5f) * 1.6f;
+ sp98.y = -1.5f;
+ sp98.z = (Rand_ZeroOne() - 0.5f) * 1.6f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39470.s")
+ spA4.x = sp98.x * -0.06f;
+ spA4.y = sp98.y * -0.06f;
+ spA4.z = sp98.z * -0.06f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B395C4.s")
+ func_800B0E48(globalCtx, &sp8C, &sp98, &spA4, &D_80B3A914, &D_80B3A918, (s32)(Rand_ZeroOne() * 40.0f) + 10,
+ (s32)(Rand_ZeroOne() * 30.0f) + 10);
+ }
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B395EC.s")
+void func_80B39108(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 phi_s5;
+ s16 phi_s1;
+ s32 phi_v0;
+ s32 i;
+ u32 temp;
+ s32 temp_s3;
+ Vec3f spDC;
+ Vec3f spD0;
+ f32 temp_f2;
+ f32 spC8 = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
+ f32 temp_f0;
+ f32 temp_f12;
+ f32 temp_f20;
+ f32 temp_f22;
+ f32 temp_f24;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39638.s")
+ for (i = 0, phi_s5 = 0; i < 11; i++, phi_s5 += (0x10000 / 11)) {
+ temp_s3 = (s32)(Rand_ZeroOne() * 5957.0f) + phi_s5;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39834.s")
+ if (((u32)Rand_Next() >> 0x1E) == 0) {
+ phi_s1 = 0x20;
+ } else {
+ phi_s1 = 0x40;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39908.s")
+ if ((i & 3) == 0) {
+ phi_s1 |= 1;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39B28.s")
+ temp_f0 = Rand_ZeroOne();
+ temp_f20 = (1.0f - SQ(temp_f0)) * 12.0f;
+ temp_f22 = Math_SinS(temp_s3);
+ temp_f24 = Math_CosS(temp_s3);
+ temp_f12 = (Rand_ZeroOne() * 1.6f) - 0.8f;
+ temp_f2 = fabsf(temp_f12) * temp_f12;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39B5C.s")
+ spDC.x = temp_f22 * 4.0f;
+ spDC.y = (temp_f2 * 6.0f) + 9.0f;
+ spDC.z = temp_f24 * 4.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/ObjSnowball2_Init.s")
+ spD0.x = (temp_f22 * temp_f20) + this->actor.world.pos.x;
+ spD0.y = (temp_f2 * temp_f20) + spC8;
+ spD0.z = (temp_f24 * temp_f20) + this->actor.world.pos.z;
+ temp = Rand_Next();
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/ObjSnowball2_Destroy.s")
+ if ((i & 3) == 0) {
+ phi_v0 = 1;
+ } else {
+ phi_v0 = 0;
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39C78.s")
+ EffectSsKakera_Spawn(globalCtx, &spD0, &spDC, &spD0, -300, phi_s1, 30, 0, 0, (temp >> 0x1D) + 8, phi_v0, 0, 50,
+ -1, 0xEF, D_80B3A91C[i & 3]);
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39C9C.s")
+ spD0.x += (Rand_ZeroOne() - 0.5f) * 40.0f;
+ spD0.y += (Rand_ZeroOne() - 0.3f) * 45.0f;
+ spD0.z += (Rand_ZeroOne() - 0.5f) * 40.0f;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39F60.s")
+ func_800B0E48(globalCtx, &spD0, &gZeroVec3f, &D_80B3A92C, &D_80B3A914, &D_80B3A918,
+ (s32)(Rand_ZeroOne() * 70.0f) + 10, (s32)(Rand_ZeroOne() * 100.0f) + 10);
+ }
+ spD0.y = (temp_f2 * temp_f20) + spC8;
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B39FA8.s")
+void func_80B39470(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+ Vec3f sp58;
+ s32 phi_s0;
+ s32 i;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B3A0D8.s")
+ sp58.y = this->actor.world.pos.y + this->actor.depthInWater;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B3A13C.s")
+ for (phi_s0 = 0, i = 0; i < 5; i++, phi_s0 += (0x10000 / 5)) {
+ sp58.x = (Math_SinS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.x;
+ sp58.z = (Math_CosS((s32)(Rand_ZeroOne() * 7200.0f) + phi_s0) * 15.0f) + this->actor.world.pos.z;
+ EffectSsGSplash_Spawn(globalCtx, &sp58, NULL, NULL, 0, 200);
+ }
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B3A498.s")
+ sp58.x = this->actor.world.pos.x;
+ sp58.z = this->actor.world.pos.z;
+ EffectSsGSplash_Spawn(globalCtx, &sp58, NULL, NULL, 0, 300);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/func_80B3A500.s")
+void func_80B395C4(GlobalContext* this, Vec3f* arg1) {
+ EffectSsGRipple_Spawn(this, arg1, 200, 700, 0);
+}
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/ObjSnowball2_Update.s")
+void func_80B395EC(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+ Vec3f sp18;
-#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Obj_Snowball2/ObjSnowball2_Draw.s")
+ sp18.x = this->actor.world.pos.x;
+ sp18.y = this->actor.world.pos.y + this->actor.depthInWater;
+ sp18.z = this->actor.world.pos.z;
+ func_80B395C4(globalCtx, &sp18);
+}
+
+void func_80B39638(GlobalContext* globalCtx, Vec3f* arg1) {
+ static s16 D_80B3A938 = 0;
+ f32 temp_f20;
+ f32 temp_f22;
+ f32 temp_f24;
+ Vec3f sp98;
+ Vec3f sp8C;
+ Vec3f sp80;
+ f32 temp_f2;
+ s32 i;
+
+ D_80B3A938 += (s16)((u32)Rand_Next() >> 0x11);
+
+ for (i = 0; i < 2; i++) {
+ D_80B3A938 += 0x8000;
+ temp_f20 = Rand_ZeroOne();
+ temp_f22 = Math_SinS(D_80B3A938) * temp_f20;
+ temp_f24 = Rand_ZeroOne();
+ temp_f2 = Math_CosS(D_80B3A938) * temp_f20;
+
+ sp98.x = arg1->x + (temp_f22 * 5.0f);
+ sp98.y = arg1->y + (temp_f24 * 25.0f);
+ sp98.z = arg1->z + (temp_f2 * 5.0f);
+
+ sp8C.x = temp_f22 * 1.55f;
+ sp8C.y = temp_f24 * -0.7f;
+ sp8C.z = temp_f2 * 1.55f;
+
+ sp80.x = sp8C.x * -0.02f;
+ sp80.y = sp8C.y * -0.025f;
+ sp80.z = sp8C.z * -0.02f;
+
+ EffectSsIceSmoke_Spawn(globalCtx, &sp98, &sp8C, &sp80, (s32)(Rand_ZeroOne() * 30.0f) + 68);
+ }
+}
+
+void func_80B39834(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+ s32 i;
+
+ for (i = 0; i < 3; i++) {
+ EffectSsBubble_Spawn(globalCtx, &this->actor.world.pos, 0.0f, 20.0f, 30.0f, (Rand_ZeroOne() * 0.11f) + 0.03f);
+ }
+}
+
+void func_80B39908(ObjSnowball2* this, GlobalContext* globalCtx) {
+ Vec3f spAC;
+ Vec3f spA0;
+ Vec3f sp94;
+ s32 i;
+
+ if (this->collider.elements[0].info.bumperFlags & BUMP_HIT) {
+ Vec3s* hitPos = &this->collider.elements[0].info.bumper.hitPos;
+
+ for (i = 0; i < 4; i++) {
+ sp94.x = ((Rand_ZeroOne() * 14.0f) - 7.0f) + hitPos->x;
+ sp94.y = ((Rand_ZeroOne() * 14.0f) - 7.0f) + hitPos->y;
+ sp94.z = ((Rand_ZeroOne() * 14.0f) - 7.0f) + hitPos->z;
+
+ spA0.x = (Rand_ZeroOne() - 0.5f) * 1.6f;
+ spA0.y = -0.8f;
+ spA0.z = (Rand_ZeroOne() - 0.5f) * 1.6f;
+
+ spAC.x = spA0.x * -0.06f;
+ spAC.y = spA0.y * -0.06f;
+ spAC.z = spA0.z * -0.06f;
+
+ func_800B0E48(globalCtx, &sp94, &spA0, &spAC, &D_80B3A914, &D_80B3A918, (s32)(Rand_ZeroOne() * 40.0f) + 10,
+ (s32)(Rand_ZeroOne() * 30.0f) + 10);
+ }
+ }
+}
+
+void func_80B39B28(ObjSnowball2* this, GlobalContext* globalCtx) {
+ if ((this->unk_1AE == 0) && (globalCtx->roomCtx.currRoom.num != this->unk_1AF)) {
+ this->unk_1AE = 1;
+ }
+}
+
+void func_80B39B5C(ObjSnowball2* this, GlobalContext* globalCtx) {
+ SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_SMALL_SNOWBALL_BROKEN);
+}
+
+static InitChainEntry sInitChain[] = {
+ ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(terminalVelocity, -20000, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 100, ICHAIN_CONTINUE),
+ ICHAIN_F32(uncullZoneDownward, 100, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 25, ICHAIN_STOP),
+};
+
+void ObjSnowball2_Init(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+
+ Actor_ProcessInitChain(&this->actor, sInitChain);
+ Collider_InitJntSph(globalCtx, &this->collider);
+ this->actor.shape.rot.x = 0;
+ this->actor.shape.rot.z = 0;
+ this->actor.shape.rot.y = (u32)Rand_Next() >> 0x10;
+ ActorShape_Init(&this->actor.shape, 200.0f, NULL, 12.5f);
+ this->actor.shape.shadowAlpha = 130;
+ Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
+ func_80B38E20(this);
+ this->actor.colChkInfo.mass = MASS_IMMOVABLE;
+ this->unk_1AF = this->actor.room;
+ func_80B39C78(this);
+}
+
+void ObjSnowball2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+
+ Collider_DestroyJntSph(globalCtx, &this->collider);
+}
+
+void func_80B39C78(ObjSnowball2* this) {
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->unk_1AD = 0;
+ this->actionFunc = func_80B39C9C;
+}
+
+void func_80B39C9C(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp38 = (this->collider.base.acFlags & AC_HIT) != 0;
+ s32 pad2;
+
+ if (sp38) {
+ this->collider.base.acFlags &= ~AC_HIT;
+ }
+
+ if (Actor_HasParent(&this->actor, globalCtx)) {
+ this->actor.room = -1;
+ this->actor.flags |= ACTOR_FLAG_10;
+ if (func_800A817C(ENOBJSNOWBALL2_GET_3F(&this->actor))) {
+ func_80B38E88(this, globalCtx);
+ }
+ func_80B38EFC(this, globalCtx);
+ func_800B8E58(GET_PLAYER(globalCtx), NA_SE_PL_PULL_UP_SNOWBALL);
+ func_80B39F60(this);
+ } else if ((this->actor.bgCheckFlags & 0x20) &&
+ ((this->actor.shape.yOffset * this->actor.scale.y) < this->actor.depthInWater)) {
+ func_80B3A498(this);
+ } else if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 0x0583FFBC)) {
+ func_80B38E88(this, globalCtx);
+ func_80B39108(this, globalCtx);
+ func_80B39B5C(this, globalCtx);
+ Actor_MarkForDeath(&this->actor);
+ return;
+ } else {
+ if (sp38 && (this->collider.elements->info.acHitInfo->toucher.dmgFlags & 2)) {
+ func_80B39908(this, globalCtx);
+ }
+
+ if (this->unk_1AD == 0) {
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 15.0f, 0.0f, 0x44);
+ if ((this->actor.bgCheckFlags & 1) &&
+ (DynaPoly_GetActor(&globalCtx->colCtx, this->actor.floorBgId) == NULL)) {
+ this->unk_1AD = 1;
+ this->actor.flags &= ~ACTOR_FLAG_10;
+ }
+ }
+
+ if (this->actor.xzDistToPlayer < 800.0f) {
+ CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ if (this->actor.xzDistToPlayer < 150.0f) {
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ if (this->actor.xzDistToPlayer < 100.0f) {
+ if (ABS_ALT(BINANG_SUB(this->actor.yawTowardsPlayer, GET_PLAYER(globalCtx)->actor.world.rot.y)) >=
+ 0x5556) {
+ Actor_PickUp(&this->actor, globalCtx, GI_NONE, 36.0f, 30.0f);
+ }
+ }
+ }
+ }
+ }
+}
+
+void func_80B39F60(ObjSnowball2* this) {
+ this->actor.world.pos.y += (600.0f - this->actor.shape.yOffset) * this->actor.scale.y;
+ this->unk_1AC = 4;
+ this->actor.shape.yOffset = 600.0f;
+ this->actionFunc = func_80B39FA8;
+}
+
+void func_80B39FA8(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 pad;
+ Vec3f sp30;
+ s32 sp2C;
+
+ func_80B39B28(this, globalCtx);
+
+ if (this->unk_1AC > 0) {
+ this->unk_1AC--;
+ func_80B38EFC(this, globalCtx);
+ }
+
+ if (Actor_HasNoParent(&this->actor, globalCtx)) {
+ this->actor.room = globalCtx->roomCtx.currRoom.num;
+ this->actor.speedXZ *= 3.8f;
+ this->actor.velocity.y *= 0.4f;
+ this->actor.gravity = -2.8f;
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 15.0f, 0.0f, 0x45);
+ func_80B3A0D8(this);
+ } else {
+ sp30.x = this->actor.world.pos.x;
+ sp30.y = this->actor.world.pos.y + 20.0f;
+ sp30.z = this->actor.world.pos.z;
+ this->actor.floorHeight =
+ BgCheck_EntityRaycastFloor5(&globalCtx->colCtx, &this->actor.floorPoly, &sp2C, &this->actor, &sp30);
+ }
+}
+
+void func_80B3A0D8(ObjSnowball2* this) {
+ this->unk_1AC = 60;
+ this->actor.colChkInfo.mass = 180;
+ this->unk_1A8 = Rand_S16Offset(-5000, 4000);
+ this->unk_1AA = Rand_S16Offset(-800, 1600);
+ this->actionFunc = func_80B3A13C;
+}
+
+void func_80B3A13C(ObjSnowball2* this, GlobalContext* globalCtx) {
+ s32 pad;
+ s32 sp38 = (this->collider.base.atFlags & AT_HIT) != 0;
+ s32 sp34 = (this->collider.base.ocFlags1 & OC1_HIT) != 0;
+ s32 sp30;
+
+ if (sp38) {
+ this->collider.base.atFlags &= ~AT_HIT;
+ }
+
+ if (sp34) {
+ this->collider.base.ocFlags1 &= ~OC1_HIT;
+ }
+
+ if (this->unk_1AC > 0) {
+ this->unk_1AC--;
+ }
+
+ func_80B39B28(this, globalCtx);
+
+ if ((((this->actor.bgCheckFlags & 9) || sp38) && !(this->actor.bgCheckFlags & 0x20)) || (this->unk_1AC <= 0)) {
+ func_80B38E88(this, globalCtx);
+ func_80B39108(this, globalCtx);
+ func_80B39B5C(this, globalCtx);
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ sp30 = false;
+ if (this->actor.bgCheckFlags & 0x60) {
+ if ((this->actor.bgCheckFlags & 0x40) || (this->actor.speedXZ > 3.0f)) {
+ if (this->actor.depthInWater < (1200.0f * this->actor.scale.y)) {
+ func_80B39470(&this->actor, globalCtx);
+ func_80B395EC(&this->actor, globalCtx);
+ }
+ if (this->actor.bgCheckFlags & 0x40) {
+ Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_BOMB_DROP_WATER);
+ }
+ } else if ((((globalCtx->gameplayFrames % 16) == 0) || (((u32)Rand_Next() >> 0x10) == 0)) &&
+ (this->actor.depthInWater < (1200.0f * this->actor.scale.y))) {
+ func_80B395EC(&this->actor, globalCtx);
+ }
+
+ func_80B39834(&this->actor, globalCtx);
+ this->unk_1A8 >>= 1;
+ this->unk_1AA >>= 1;
+
+ if (sp34) {
+ this->actor.speedXZ *= 0.8f;
+ } else {
+ this->actor.speedXZ *= 0.65f;
+ }
+ this->actor.velocity.y *= 0.27f;
+ this->actor.gravity *= 0.27f;
+ if (this->actor.speedXZ < 0.4f) {
+ sp30 = true;
+ }
+ } else {
+ if (sp34) {
+ this->actor.speedXZ *= 0.8f;
+ } else {
+ this->actor.speedXZ *= 0.96f;
+ }
+ this->actor.velocity.y *= 0.96f;
+ }
+
+ Actor_MoveWithGravity(&this->actor);
+ Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 15.0f, 15.0f, 0.0f, 0x45);
+ this->actor.shape.rot.x += this->unk_1A8;
+ this->actor.shape.rot.y += this->unk_1AA;
+ func_80B38E20(this);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ if (sp30) {
+ func_80B3A498(this);
+ } else {
+ CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+}
+
+void func_80B3A498(ObjSnowball2* this) {
+ this->actor.home.pos.x = this->actor.world.pos.x;
+ this->unk_1AC = 46;
+ this->actor.flags |= ACTOR_FLAG_10;
+ this->actor.home.pos.y = this->actor.world.pos.y + this->actor.depthInWater;
+ this->actor.home.pos.z = this->actor.world.pos.z;
+ this->actor.world.pos.y = this->actor.world.pos.y + (this->actor.shape.yOffset * this->actor.scale.y);
+ this->actor.shape.yOffset = 0.0f;
+ this->actor.speedXZ = 0.0f;
+ this->actionFunc = func_80B3A500;
+}
+
+void func_80B3A500(ObjSnowball2* this, GlobalContext* globalCtx) {
+ f32 phi_f0;
+ s32 pad;
+ f32 temp_f14 = this->actor.home.pos.y - this->actor.world.pos.y;
+ f32 temp_f12 = this->actor.scale.y * 600.0f;
+
+ this->unk_1AC--;
+
+ this->actor.speedXZ *= 0.7f;
+
+ this->unk_1A8 >>= 1;
+ this->unk_1AA >>= 1;
+
+ this->actor.shape.rot.x += this->unk_1A8;
+ this->actor.shape.rot.y += this->unk_1AA;
+
+ if (temp_f14 < -temp_f12) {
+ this->actor.gravity = this->actor.scale.y * -40.0f;
+ phi_f0 = 0.94f;
+ } else if (temp_f12 < temp_f14) {
+ this->actor.gravity = this->actor.scale.y * 24.0f;
+ phi_f0 = 0.8f;
+ } else if (temp_f12 > 0.001f) {
+ this->actor.gravity = (((1.6f * temp_f14) / temp_f12) + -1.0f + 0.6f) * 0.5f * 40.0f * this->actor.scale.y;
+ phi_f0 = (((-0.13999999f * temp_f14) / temp_f12) + 0.94f + 0.8f) * 0.5f;
+ } else {
+ this->actor.gravity = 0.0f;
+ phi_f0 = 1.0f;
+ }
+
+ this->actor.velocity.y *= phi_f0;
+ this->actor.velocity.y += this->actor.gravity;
+ this->actor.world.pos.y += this->actor.velocity.y;
+
+ if (((globalCtx->gameplayFrames % 16) == 0) || (((u32)Rand_Next() >> 0x10) == 0)) {
+ func_80B395C4(globalCtx, &this->actor.home.pos);
+ }
+
+ if (this->unk_1AC <= 0) {
+ Actor_MarkForDeath(&this->actor);
+ return;
+ }
+
+ if (this->unk_1AC < 20) {
+ this->actor.scale.x -= 0.00125f;
+ if (this) {}
+ this->actor.scale.y = this->actor.scale.x;
+ this->actor.scale.z = this->actor.scale.x;
+
+ if ((this->unk_1AC >= 6) && (temp_f14 < temp_f12)) {
+ func_80B39638(globalCtx, &this->actor.home.pos);
+ }
+
+ if (this->unk_1AC == 10) {
+ func_80B38E88(this, globalCtx);
+ }
+
+ func_800B9010(&this->actor, NA_SE_EV_ICE_MELT_LEVEL - SFX_FLAG);
+ } else {
+ func_80B38E20(this);
+ CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
+ }
+}
+
+void ObjSnowball2_Update(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+
+ this->actionFunc(this, globalCtx);
+
+ if (this->actor.projectedPos.z < 460.0f) {
+ if (this->actor.projectedPos.z > 200.0f) {
+ this->actor.shape.shadowAlpha = (460 - (s32)this->actor.projectedPos.z) >> 1;
+ this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ } else if (this->actor.projectedPos.z > -10.0f) {
+ this->actor.shape.shadowAlpha = 130;
+ this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
+ } else {
+ this->actor.shape.shadowDraw = NULL;
+ }
+ } else {
+ this->actor.shape.shadowDraw = NULL;
+ }
+}
+
+void ObjSnowball2_Draw(Actor* thisx, GlobalContext* globalCtx) {
+ ObjSnowball2* this = THIS;
+
+ Gfx_DrawDListOpa(globalCtx, object_goroiwa_DL_008B90);
+}
diff --git a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h
index cbffe01f2a..120358a805 100644
--- a/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h
+++ b/src/overlays/actors/ovl_Obj_Snowball2/z_obj_snowball2.h
@@ -7,11 +7,21 @@ struct ObjSnowball2;
typedef void (*ObjSnowball2ActionFunc)(struct ObjSnowball2*, GlobalContext*);
+#define ENOBJSNOWBALL2_GET_3F(thisx) ((thisx)->params & 0x3F)
+#define ENOBJSNOWBALL2_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F)
+
typedef struct ObjSnowball2 {
/* 0x0000 */ Actor actor;
- /* 0x0144 */ char unk_144[0x60];
+ /* 0x0144 */ ColliderJntSph collider;
+ /* 0x0164 */ ColliderJntSphElement colliderElements[1];
/* 0x01A4 */ ObjSnowball2ActionFunc actionFunc;
- /* 0x01A8 */ char unk_1A8[0xC];
+ /* 0x01A8 */ s16 unk_1A8;
+ /* 0x01AA */ s16 unk_1AA;
+ /* 0x01AC */ s8 unk_1AC;
+ /* 0x01AD */ u8 unk_1AD;
+ /* 0x01AE */ s8 unk_1AE;
+ /* 0x01AF */ s8 unk_1AF;
+ /* 0x01B0 */ UNK_TYPE1 unk1B0[4];
} ObjSnowball2; // size = 0x1B4
extern const ActorInit Obj_Snowball2_InitVars;
diff --git a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c
index 6b59eeb16b..231dd99f34 100644
--- a/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c
+++ b/src/overlays/actors/ovl_Obj_Sound/z_obj_sound.c
@@ -6,7 +6,7 @@
#include "z_obj_sound.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjSound*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c
index 90fa1f42f6..20e2622981 100644
--- a/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c
+++ b/src/overlays/actors/ovl_Obj_Spidertent/z_obj_spidertent.c
@@ -6,7 +6,7 @@
#include "z_obj_spidertent.h"
-#define FLAGS 0x10000000
+#define FLAGS (ACTOR_FLAG_10000000)
#define THIS ((ObjSpidertent*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c
index cf7c484311..9547aa04f7 100644
--- a/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c
+++ b/src/overlays/actors/ovl_Obj_Spinyroll/z_obj_spinyroll.c
@@ -6,7 +6,7 @@
#include "z_obj_spinyroll.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjSpinyroll*)thisx)
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 b8e576e391..4a69fc1ebc 100644
--- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
+++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c
@@ -6,7 +6,7 @@
#include "z_obj_switch.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjSwitch*)thisx)
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 96b5f2bb6a..5d1134f124 100644
--- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h
+++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.h
@@ -7,6 +7,12 @@ struct ObjSwitch;
typedef void (*ObjSwitchActionFunc)(struct ObjSwitch*, GlobalContext*);
+#define OBJSWITCH_GET_33(thisx) ((thisx)->params & 0x33)
+#define OBJSWITCH_GET_7F00(thisx) (((thisx)->params >> 8) & 0x7F)
+
+#define OBJSWITCH_NORMAL_BLUE 0x20
+#define OBJSWITCH_INVERSE_BLUE 0x30
+
typedef struct ObjSwitch {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x18];
diff --git a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c
index 3d94f31b6f..cea97efe91 100644
--- a/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c
+++ b/src/overlays/actors/ovl_Obj_Swprize/z_obj_swprize.c
@@ -6,7 +6,7 @@
#include "z_obj_swprize.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjSwprize*)thisx)
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 d1fb1b23ec..2996ce5ae3 100644
--- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c
+++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c
@@ -7,8 +7,9 @@
#include "z_obj_syokudai.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "overlays/actors/ovl_En_Arrow/z_en_arrow.h"
+#include "objects/object_syokudai/object_syokudai.h"
-#define FLAGS 0x00000410
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_400)
#define THIS ((ObjSyokudai*)thisx)
@@ -17,10 +18,6 @@ void ObjSyokudai_Destroy(Actor* thisx, GlobalContext* globalCtx);
void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx);
void ObjSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx);
-extern Gfx D_060003A0[]; // sObjectSyokudaiTypeSwitchCausesFlameDL
-extern Gfx D_06000870[]; // sObjectSyokudaiTypeNoSwitchDL
-extern Gfx D_06000B90[]; // sObjectSyokudaiTypeFlameCausesSwitchDL
-
const ActorInit Obj_Syokudai_InitVars = {
ACTOR_OBJ_SYOKUDAI,
ACTORCAT_PROP,
@@ -82,7 +79,11 @@ static InitChainEntry sInitChain[] = {
static u8 sColTypes[] = { COLTYPE_METAL, COLTYPE_WOOD, COLTYPE_WOOD };
-static Gfx* sDLists[] = { D_060003A0, D_06000B90, D_06000870 };
+static Gfx* sDLists[] = {
+ gObjectSyokudaiTypeSwitchCausesFlameDL,
+ gObjectSyokudaiTypeFlameCausesSwitchDL,
+ gObjectSyokudaiTypeNoSwitchDL,
+};
static s32 sNumLitTorchesInGroup;
@@ -220,7 +221,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) {
(flameColliderHurtboxActor->id == ACTOR_EN_ARROW)) {
flameColliderHurtboxActor->params = 0;
- ((EnArrow*)flameColliderHurtboxActor)->unk_1C0 = 0x800;
+ ((EnArrow*)flameColliderHurtboxActor)->collider.info.toucher.dmgFlags = 0x800;
}
}
if ((this->snuffTimer > OBJ_SYOKUDAI_SNUFF_NEVER) &&
@@ -312,7 +313,8 @@ void ObjSyokudai_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
Matrix_InsertTranslation(0.0f, OBJ_SYOKUDAI_FLAME_HEIGHT, 0.0f, MTXMODE_APPLY);
- Matrix_RotateY(BINANG_ROT180(func_800DFCDC(GET_ACTIVE_CAM(globalCtx)) - thisx->shape.rot.y), MTXMODE_APPLY);
+ Matrix_RotateY(BINANG_ROT180(Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - thisx->shape.rot.y),
+ MTXMODE_APPLY);
Matrix_Scale(flameScale, flameScale, flameScale, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
diff --git a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c
index d1e1684472..65c9849819 100644
--- a/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c
+++ b/src/overlays/actors/ovl_Obj_Takaraya_Wall/z_obj_takaraya_wall.c
@@ -6,7 +6,7 @@
#include "z_obj_takaraya_wall.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjTakarayaWall*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c
index bf535300b5..0471b6bd70 100644
--- a/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c
+++ b/src/overlays/actors/ovl_Obj_Toge/z_obj_toge.c
@@ -6,7 +6,7 @@
#include "z_obj_toge.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjToge*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c
index 50f879aec9..9ff5b45999 100644
--- a/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c
+++ b/src/overlays/actors/ovl_Obj_Tokei_Step/z_obj_tokei_step.c
@@ -7,7 +7,7 @@
#include "z_obj_tokei_step.h"
#include "objects/object_tokei_step/object_tokei_step.h"
-#define FLAGS 0x00400010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_400000)
#define THIS ((ObjTokeiStep*)thisx)
@@ -193,7 +193,7 @@ void ObjTokeiStep_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
if ((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0)) {
+ (globalCtx->csCtx.currentCsIndex == 0)) {
DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &gClocktowerPanelCol);
ObjTokeiStep_InitSteps(this);
ObjTokeiStep_SetupBeginOpen(this);
@@ -221,9 +221,10 @@ void ObjTokeiStep_SetupBeginOpen(ObjTokeiStep* this) {
void ObjTokeiStep_BeginOpen(ObjTokeiStep* this, GlobalContext* globalCtx) {
CsCmdActorAction* action;
- if (func_800EE29C(globalCtx, 0x86)) {
- action = globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x86)];
- if ((action->startFrame == globalCtx->csCtx.frames) && (action->unk0 != 0)) {
+ if (Cutscene_CheckActorAction(globalCtx, 134)) {
+ action = globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 134)];
+
+ if ((action->startFrame == globalCtx->csCtx.frames) && (action->action != 0)) {
this->dyna.actor.draw = ObjTokeiStep_DrawOpen;
ObjTokeiStep_SetupOpen(this);
}
@@ -250,7 +251,7 @@ void ObjTokeiStep_Open(ObjTokeiStep* this, GlobalContext* globalCtx) {
}
void ObjTokeiStep_SetupDoNothingOpen(ObjTokeiStep* this) {
- this->dyna.actor.flags &= ~0x10;
+ this->dyna.actor.flags &= ~ACTOR_FLAG_10;
this->actionFunc = ObjTokeiStep_DoNothingOpen;
}
diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
index 70a144238d..3ecac575f6 100644
--- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
+++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.c
@@ -1,30 +1,46 @@
/*
* File: z_obj_tokeidai.c
* Overlay: ovl_Obj_Tokeidai
- * Description: Components of the Clock Tower (gears, clock face, counterweight, etc). Also used for wall clocks.
+ * Description: Components of the Clock Tower. Also used for wall clocks. The specific components are:
+ * - ClockFace: The decorated face of the clock that spins every hour.
+ * - MinuteRing: The ring around the clock face that spins every two minutes.
+ * - ExteriorGear: The two gears on the side of the tower that spin every two minutes.
+ * - SunAndMoonPanel: A panel with a sun and moon image that tells whether it is day or night.
+ * - Counterweight: The spinning weight on top of the tower that emits a spotlight at night.
+ * - StaircaseToRooftop: The staircase to tower's rooftop that opens after midnight on the Final Day.
+ * - TerminaFieldWalls: The walls of the Clock Tower visible from Termina Field.
+ * - UnusedWall: A single wall of the Clock Tower, unused in the final game.
*
- * This actor handles most of the functionality related to the Clock Tower and the various
- * wall clocks around Clock Town. Among its responsibilities are making the clocks correctly
- * tell the time by spinning the various pieces and gears and controlling the spotlight that
- * is emitted from the Clock Tower at night.
+ * Sometimes, the ClockFace, MinuteRing, and SunAndMoonPanel are treated as a single clock entity.
+ * This is called Clock if it applies to both the Clock Tower clock and wall clocks, and
+ * TowerClock/WallClock, respectively, if it only applies to one of them.
*
* On the midnight of the Final Day, the Clock Tower opens up, and the various pieces of it
- * are moved around. This actor is responsible for managing all of this movement. Additionally,
- * if the moon crashes into Termina, this actor is responsible for making the pieces of the
- * Clock Tower collapse.
+ * are moved around. This actor is responsible for managing all of this movement, which is handled
+ * via the series of action functions labeled with TowerOpening.
+ *
+ * All components have at least one of these three actions:
+ * - Idle: The "default" action, and for some components the only action.
+ * The component is either completely still, or it's telling the time, depending on the component.
+ * - OpenedIdle: The action for certain Clock Tower components after midnight on the Final Day.
+ * The TowerClock, ExteriorGears, and Counterweight no longer tell time and are moved to a different position.
+ * Called "opened" because it corresponds to when the staircase to the tower's rooftop is opened up.
+ * - Collapse: The action for certain Clock Tower components when the moon crashes into Termina.
+ * This action is responsible for making the component fall during the moon crash cutscene.
*/
#include "z_obj_tokeidai.h"
#include "objects/object_obj_tokeidai/object_obj_tokeidai.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjTokeidai*)thisx)
-#define GET_CURRENT_HOUR(this) ((s32)((this)->currentTime * (24.0f / 0x10000)))
-#define GET_CURRENT_MINUTE(this) ((s32)((this)->currentTime * (360 * 2.0f / 0x10000)) % 30)
-#define GET_CLOCK_FACE_ROTATION(currentHour) ((s16)(currentHour * (0x10000 / 24.0f)))
-#define GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute) ((s16)(currentMinute * (0x10000 * 12.0f / 360)))
+#define GET_CURRENT_CLOCK_HOUR(this) ((s32)((this)->clockTime * (24.0f / 0x10000)))
+#define GET_CURRENT_CLOCK_MINUTE(this) ((s32)((this)->clockTime * (360 * 2.0f / 0x10000)) % 30)
+#define GET_CLOCK_FACE_ROTATION(currentClockHour) ((s16)(currentClockHour * (0x10000 / 24.0f)))
+#define GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute) \
+ ((s16)(currentClockMinute * (0x10000 * 12.0f / 360)))
void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx);
void ObjTokeidai_Destroy(Actor* thisx, GlobalContext* globalCtx);
@@ -33,24 +49,24 @@ void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx);
void ObjTokeidai_DoNothing(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_TowerClock_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx);
-void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx);
+void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_WallClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
-void ObjTokeidai_TowerGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
+void ObjTokeidai_ExteriorGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
-void ObjTokeidai_Walls_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
-void ObjTokeidai_StaircaseIntoTower_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
+void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
+void ObjTokeidai_StaircaseToRooftop_Idle(ObjTokeidai* this, GlobalContext* globalCtx);
void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this);
void ObjTokeidai_Clock_Draw(Actor* thisx, GlobalContext* globalCtx);
void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx);
-void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx);
+void ObjTokeidai_ExteriorGear_Draw(Actor* thisx, GlobalContext* globalCtx);
const ActorInit Obj_Tokeidai_InitVars = {
ACTOR_OBJ_TOKEIDAI,
ACTORCAT_PROP,
FLAGS,
- OBJECT_OBJECT_UNSET_TOKEIDAI,
+ OBJECT_OBJ_TOKEIDAI,
sizeof(ObjTokeidai),
(ActorFunc)ObjTokeidai_Init,
(ActorFunc)ObjTokeidai_Destroy,
@@ -67,56 +83,56 @@ static InitChainEntry sInitChain[] = {
/**
* Returns the angle necessary to show the correct side of
- * the sun and moon disk based on the time of day. The actual
- * angle can differ from the target angle if the disk is in
+ * the sun and moon panel based on the time of day. The actual
+ * angle can differ from the target angle if the panel is in
* the middle of rotating.
*/
-s32 ObjTokeidai_GetTargetSunMoonDiskRotation() {
+s32 ObjTokeidai_GetTargetSunMoonPanelRotation() {
if (gSaveContext.isNight) {
return 0x8000;
}
return 0;
}
-void ObjTokeidai_SetupClockOrGear(ObjTokeidai* this) {
- s32 currentMinute = GET_CURRENT_MINUTE(this);
+void ObjTokeidai_SetupClockOrExteriorGear(ObjTokeidai* this) {
+ s32 currentClockMinute = GET_CURRENT_CLOCK_MINUTE(this);
- this->clockMinute = currentMinute;
- this->outerRingOrGearRotation = GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute);
- this->outerRingOrGearRotationalVelocity = 0x3C;
- this->outerRingOrGearRotationTimer = 0;
+ this->clockMinute = currentClockMinute;
+ this->minuteRingOrExteriorGearRotation = GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute);
+ this->minuteRingOrExteriorGearRotationalVelocity = 0x3C;
+ this->minuteRingOrExteriorGearRotationTimer = 0;
}
void ObjTokeidai_Clock_Init(ObjTokeidai* this) {
- s32 currentHour;
+ s32 currentClockHour;
- ObjTokeidai_SetupClockOrGear(this);
- currentHour = GET_CURRENT_HOUR(this);
- this->clockHour = currentHour;
- this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentHour);
+ ObjTokeidai_SetupClockOrExteriorGear(this);
+ currentClockHour = GET_CURRENT_CLOCK_HOUR(this);
+ this->clockHour = currentClockHour;
+ this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentClockHour);
this->clockFaceRotationalVelocity = 0;
this->clockFaceRotationTimer = 0;
- this->sunMoonDiskRotationalVelocity = 0;
- this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation();
+ this->sunMoonPanelRotationalVelocity = 0;
+ this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation();
}
-void ObjTokeidai_TowerGear_Init(ObjTokeidai* this, GlobalContext* globalCtx) {
- this->actor.draw = ObjTokeidai_TowerGear_Draw;
- this->opaDList = object_obj_tokeidai_DL_00BA78;
- ObjTokeidai_SetupClockOrGear(this);
+void ObjTokeidai_ExteriorGear_Init(ObjTokeidai* this, GlobalContext* globalCtx) {
+ this->actor.draw = ObjTokeidai_ExteriorGear_Draw;
+ this->opaDList = gClockTowerExteriorGearDL;
+ ObjTokeidai_SetupClockOrExteriorGear(this);
if (((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0)) ||
+ (globalCtx->csCtx.currentCsIndex == 0)) ||
((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0))) {
+ (globalCtx->csCtx.currentCsIndex == 0))) {
ObjTokeidai_SetupTowerOpening(this);
} else if ((CURRENT_DAY == 3 && gSaveContext.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) {
- this->actionFunc = ObjTokeidai_TowerGear_OpenedIdle;
+ this->actionFunc = ObjTokeidai_ExteriorGear_OpenedIdle;
this->actor.world.pos.y += this->actor.scale.y * 1900.0f;
this->actor.shape.yOffset = 1500.0f;
gSaveContext.weekEventReg[8] |= 0x40;
} else {
- this->actionFunc = ObjTokeidai_TowerGear_Idle;
+ this->actionFunc = ObjTokeidai_ExteriorGear_Idle;
}
}
@@ -125,19 +141,22 @@ void ObjTokeidai_TowerClock_Init(ObjTokeidai* this, GlobalContext* globalCtx) {
ObjTokeidai_Clock_Init(this);
if (((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0)) ||
+ (globalCtx->csCtx.currentCsIndex == 0)) ||
((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0))) {
+ (globalCtx->csCtx.currentCsIndex == 0))) {
ObjTokeidai_SetupTowerOpening(this);
} else if ((CURRENT_DAY == 3 && gSaveContext.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) {
this->actor.world.pos.y += (this->actor.scale.y * 5191.0f) - 50.0f;
this->actor.world.pos.x += Math_SinS(this->actor.world.rot.y) * this->actor.scale.z * 1791.0f;
this->actor.world.pos.z += -Math_CosS(this->actor.world.rot.y) * this->actor.scale.z * 1791.0f;
+
this->clockFaceZTranslation = -0x140;
this->actor.shape.rot.x = -0x4000;
+
this->actor.home.pos = this->actor.world.pos;
this->actor.home.pos.y -= 1178.0f;
this->actor.home.pos.z += 13.0f;
+
this->actionFunc = ObjTokeidai_TowerClock_OpenedIdle;
} else {
this->actionFunc = ObjTokeidai_TowerClock_Idle;
@@ -148,8 +167,8 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx)
s32 type;
this->actor.draw = ObjTokeidai_Counterweight_Draw;
- this->opaDList = object_obj_tokeidai_DL_00B208;
- this->xluDList = object_obj_tokeidai_DL_00B0C0;
+ this->opaDList = gClockTowerCounterweightDL;
+ this->xluDList = gClockTowerSpotlightDL;
if (gSaveContext.isNight) {
this->spotlightIntensity = 100;
} else {
@@ -157,11 +176,12 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx)
}
if (((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0)) ||
+ (globalCtx->csCtx.currentCsIndex == 0)) ||
((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0))) {
+ (globalCtx->csCtx.currentCsIndex == 0))) {
this->spotlightIntensity = 0;
ObjTokeidai_SetupTowerOpening(this);
+
if (this->actor.child == NULL) {
type = OBJ_TOKEIDAI_TYPE(&this->actor);
if (type == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN ||
@@ -171,6 +191,7 @@ void ObjTokeidai_Counterweight_Init(ObjTokeidai* this, GlobalContext* globalCtx)
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
}
}
+
if (this->actor.child != NULL) {
if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD) {
this->actor.child->home.rot.x = 0x384;
@@ -200,55 +221,65 @@ void ObjTokeidai_Init(Actor* thisx, GlobalContext* globalCtx) {
this->xRotation = 0;
this->yTranslation = 0;
this->clockFaceZTranslation = 0;
- this->currentTime = gSaveContext.time;
+ this->clockTime = gSaveContext.time;
this->actor.home.rot.x = 0;
switch (OBJ_TOKEIDAI_TYPE(&this->actor)) {
- case OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD:
+ case OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD:
Actor_SetScale(&this->actor, 0.15f);
- ObjTokeidai_TowerGear_Init(this, globalCtx);
+ ObjTokeidai_ExteriorGear_Init(this, globalCtx);
break;
- case OBJ_TOKEIDAI_TYPE_TOWER_GEAR_CLOCK_TOWN:
- ObjTokeidai_TowerGear_Init(this, globalCtx);
+
+ case OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_CLOCK_TOWN:
+ ObjTokeidai_ExteriorGear_Init(this, globalCtx);
break;
+
case OBJ_TOKEIDAI_TYPE_UNUSED_WALL:
- this->opaDList = object_obj_tokeidai_DL_00D388;
+ this->opaDList = gClockTowerUnusedTowerWallDL;
break;
+
case OBJ_TOKEIDAI_TYPE_TOWER_WALLS_TERMINA_FIELD:
Actor_SetScale(&this->actor, 1.0f);
- this->opaDList = object_obj_tokeidai_DL_009A08;
- this->actionFunc = ObjTokeidai_Walls_Idle;
+ this->opaDList = gClockTowerTerminaFieldWallsDL;
+ this->actionFunc = ObjTokeidai_TerminaFieldWalls_Idle;
break;
+
case OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD:
Actor_SetScale(&this->actor, 0.15f);
ObjTokeidai_TowerClock_Init(this, globalCtx);
break;
+
case OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN:
ObjTokeidai_TowerClock_Init(this, globalCtx);
break;
+
case OBJ_TOKEIDAI_TYPE_WALL_CLOCK:
Actor_SetScale(&this->actor, 0.02f);
this->actor.draw = ObjTokeidai_Clock_Draw;
ObjTokeidai_Clock_Init(this);
this->actionFunc = ObjTokeidai_WallClock_Idle;
break;
+
case OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK:
Actor_SetScale(&this->actor, 0.01f);
this->actor.draw = ObjTokeidai_Clock_Draw;
ObjTokeidai_Clock_Init(this);
this->actionFunc = ObjTokeidai_WallClock_Idle;
break;
+
case OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD:
Actor_SetScale(&this->actor, 0.15f);
ObjTokeidai_Counterweight_Init(this, globalCtx);
break;
+
case OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN:
ObjTokeidai_Counterweight_Init(this, globalCtx);
break;
- case OBJ_TOKEIDAI_TYPE_STAIRCASE_INTO_TOWER:
- this->opaDList = object_obj_tokeidai_DL_00D8E8;
- this->xluDList = object_obj_tokeidai_DL_00D8E0;
- this->actionFunc = ObjTokeidai_StaircaseIntoTower_Idle;
+
+ case OBJ_TOKEIDAI_TYPE_STAIRCASE_TO_ROOFTOP:
+ this->opaDList = gClockTowerStaircaseToRooftopDL;
+ this->xluDList = gClockTowerEmptyDL;
+ this->actionFunc = ObjTokeidai_StaircaseToRooftop_Idle;
break;
}
}
@@ -257,41 +288,43 @@ void ObjTokeidai_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjTokeidai_RotateOnMinuteChange(ObjTokeidai* this, s32 playSfx) {
- s32 currentMinute = GET_CURRENT_MINUTE(this);
+ s32 currentClockMinute = GET_CURRENT_CLOCK_MINUTE(this);
- if (currentMinute != this->clockMinute) {
- if (this->outerRingOrGearRotationTimer == 8 && playSfx) {
+ if (currentClockMinute != this->clockMinute) {
+ if (this->minuteRingOrExteriorGearRotationTimer == 8 && playSfx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_SECOND_HAND);
}
- if (this->outerRingOrGearRotationTimer > 8) {
+ if (this->minuteRingOrExteriorGearRotationTimer > 8) {
// This actually performs the rotation to the next minute
- // for the outer ring or gear.
- this->outerRingOrGearRotationalVelocity += 0x3C;
- this->outerRingOrGearRotation += this->outerRingOrGearRotationalVelocity;
+ // for the minute ring or exterior gear.
+ this->minuteRingOrExteriorGearRotationalVelocity += 0x3C;
+ this->minuteRingOrExteriorGearRotation += this->minuteRingOrExteriorGearRotationalVelocity;
} else {
- // This makes the outer ring or gear wiggle in place for a bit
+ // This makes the minute ring or exterior gear wiggle in place for a bit
// before rotating to the next position.
- if ((this->outerRingOrGearRotationTimer & 3) == 0) {
- this->outerRingOrGearRotation += 0x5A;
+ if ((this->minuteRingOrExteriorGearRotationTimer & 3) == 0) {
+ this->minuteRingOrExteriorGearRotation += 0x5A;
}
- if ((this->outerRingOrGearRotationTimer & 3) == 1) {
- this->outerRingOrGearRotation -= 0x5A;
+ if ((this->minuteRingOrExteriorGearRotationTimer & 3) == 1) {
+ this->minuteRingOrExteriorGearRotation -= 0x5A;
}
}
- this->outerRingOrGearRotationTimer++;
- if ((currentMinute == 15 && this->outerRingOrGearRotation < 0) ||
- (currentMinute != 15 && this->outerRingOrGearRotation > GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute))) {
- this->outerRingOrGearRotation = GET_OUTER_RING_OR_GEAR_ROTATION(currentMinute);
- this->clockMinute = currentMinute;
- this->outerRingOrGearRotationalVelocity = 0x5A;
- this->outerRingOrGearRotationTimer = 0;
+ this->minuteRingOrExteriorGearRotationTimer++;
+
+ if ((currentClockMinute == 15 && this->minuteRingOrExteriorGearRotation < 0) ||
+ (currentClockMinute != 15 &&
+ this->minuteRingOrExteriorGearRotation > GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute))) {
+ this->minuteRingOrExteriorGearRotation = GET_MINUTE_RING_OR_EXTERIOR_GEAR_ROTATION(currentClockMinute);
+ this->clockMinute = currentClockMinute;
+ this->minuteRingOrExteriorGearRotationalVelocity = 0x5A;
+ this->minuteRingOrExteriorGearRotationTimer = 0;
}
}
}
-void ObjTokeidai_TowerGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) {
+void ObjTokeidai_ExteriorGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) {
if ((this->actor.bgCheckFlags & 1) || this->actor.world.pos.y < 0.0f) {
this->actionFunc = ObjTokeidai_DoNothing;
} else {
@@ -302,9 +335,10 @@ void ObjTokeidai_TowerGear_Collapse(ObjTokeidai* this, GlobalContext* globalCtx)
}
}
-void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x84) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 2) {
- this->actionFunc = ObjTokeidai_TowerGear_Collapse;
+void ObjTokeidai_ExteriorGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 132) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 2) {
+ this->actionFunc = ObjTokeidai_ExteriorGear_Collapse;
this->actor.speedXZ = this->actor.scale.y * 5.0f;
this->actor.velocity.y = 0.0f;
this->actor.terminalVelocity = this->actor.scale.y * -50.0f;
@@ -313,15 +347,15 @@ void ObjTokeidai_TowerGear_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCt
}
/**
- * This is hard to see in the final game. This, used in conjunction
- * with the following function, makes the tower's clock slide off the
- * tower and spin through the air when the moon crashes.
+ * This, used in conjunction with the following function, makes the
+ * tower's clock slide off the tower and spin through the air when the moon crashes.
*/
void ObjTokeidai_TowerClock_Fall(ObjTokeidai* this, GlobalContext* globalCtx) {
this->actor.shape.rot.x += this->fallingClockFaceRotationalVelocity;
if (this->fallingClockFaceRotationalVelocity > 0xA0) {
this->fallingClockFaceRotationalVelocity -= 5;
}
+
this->actor.world.pos.z += 4.0f;
Actor_MoveWithGravity(&this->actor);
if (this->actor.world.pos.y < 0.0f) {
@@ -330,8 +364,8 @@ void ObjTokeidai_TowerClock_Fall(ObjTokeidai* this, GlobalContext* globalCtx) {
}
/**
- * This is hard to see in the final game. This makes the
- * tower's clock slide off as the moon crashes into it.
+ * This makes the tower's clock slide off as the moon crashes into it. It's
+ * the tower clock's equivalent to other components' Collapse functions.
*/
void ObjTokeidai_TowerClock_SlideOff(ObjTokeidai* this, GlobalContext* globalCtx) {
f32 cos;
@@ -370,7 +404,8 @@ void ObjTokeidai_TowerClock_SlideOff(ObjTokeidai* this, GlobalContext* globalCtx
}
void ObjTokeidai_TowerClock_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x84) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 1) {
+ if (Cutscene_CheckActorAction(globalCtx, 132) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 1) {
this->actionFunc = ObjTokeidai_TowerClock_SlideOff;
this->slidingClockFaceAngle = 0;
this->aerialClockFaceSpeed = -0xD;
@@ -387,7 +422,8 @@ void ObjTokeidai_Counterweight_Collapse(ObjTokeidai* this, GlobalContext* global
}
void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x84) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 3) {
+ if (Cutscene_CheckActorAction(globalCtx, 132) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 3) {
this->actionFunc = ObjTokeidai_Counterweight_Collapse;
this->xRotation = 0;
this->actor.velocity.y = 0.0f;
@@ -396,31 +432,28 @@ void ObjTokeidai_Counterweight_OpenedIdle(ObjTokeidai* this, GlobalContext* glob
}
}
-/**
- * This is hard to see in the final game. It makes the walls of
- * the clock tower tip over as the moon crashes into it, but the
- * giant moon mostly obscures it.
- */
-void ObjTokeidai_Walls_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) {
+void ObjTokeidai_TerminaFieldWalls_Collapse(ObjTokeidai* this, GlobalContext* globalCtx) {
if (this->actor.shape.rot.x < 0x4000) {
this->actor.shape.rot.x += 0x28;
}
}
-void ObjTokeidai_Walls_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x84) != 0 && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 1) {
- this->actionFunc = ObjTokeidai_Walls_Collapse;
+void ObjTokeidai_TerminaFieldWalls_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
+ if (Cutscene_CheckActorAction(globalCtx, 132) != 0 &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 1) {
+ this->actionFunc = ObjTokeidai_TerminaFieldWalls_Collapse;
}
}
void ObjTokeidai_TowerOpening_EndCutscene(ObjTokeidai* this, GlobalContext* globalCtx) {
- if (func_800EE29C(globalCtx, 0x84) != 0 && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 5) {
+ if (Cutscene_CheckActorAction(globalCtx, 132) != 0 &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 5) {
gSaveContext.weekEventReg[8] |= 0x40;
if (((globalCtx->sceneNum == SCENE_CLOCKTOWER) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0)) ||
+ (globalCtx->csCtx.currentCsIndex == 0)) ||
((globalCtx->sceneNum == SCENE_00KEIKOKU) && (gSaveContext.sceneSetupIndex == 2) &&
- (globalCtx->csCtx.unk_12 == 0))) {
- func_801A3F54(false);
+ (globalCtx->csCtx.currentCsIndex == 0))) {
+ Audio_SetCutsceneFlag(false);
gSaveContext.cutscene = 0;
gSaveContext.nextCutsceneIndex = 0;
gSaveContext.respawnFlag = 2;
@@ -480,9 +513,11 @@ void ObjTokeidai_TowerOpening_DropCounterweight(ObjTokeidai* this, GlobalContext
case 0:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_0);
break;
+
case 1:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_1);
break;
+
case 2:
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_CLOCK_TOWER_BOUND_2);
break;
@@ -558,14 +593,15 @@ void ObjTokeidai_TowerOpening_RaiseTower(ObjTokeidai* this, GlobalContext* globa
}
void ObjTokeidai_TowerOpening_Start(ObjTokeidai* this, GlobalContext* globalCtx) {
- if ((func_800EE29C(globalCtx, 0x84) && globalCtx->csCtx.npcActions[func_800EE200(globalCtx, 0x84)]->unk0 == 4) ||
+ if ((Cutscene_CheckActorAction(globalCtx, 132) &&
+ globalCtx->csCtx.actorActions[Cutscene_GetActorActionIndex(globalCtx, 132)]->action == 4) ||
(gSaveContext.weekEventReg[8] & 0x40)) {
this->actionFunc = ObjTokeidai_TowerOpening_RaiseTower;
}
}
/**
- * Sets up the sequence where the Clock Tower "transforms" and opens up
+ * Sets up the sequence where the Clock Tower opens up
* on the midnight of the Final Day.
*/
void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this) {
@@ -580,7 +616,7 @@ void ObjTokeidai_SetupTowerOpening(ObjTokeidai* this) {
void ObjTokeidai_DoNothing(ObjTokeidai* this, GlobalContext* globalCtx) {
}
-void ObjTokeidai_StaircaseIntoTower_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
+void ObjTokeidai_StaircaseToRooftop_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
if (((CURRENT_DAY == 3 && gSaveContext.time < CLOCK_TIME(6, 0)) || CURRENT_DAY >= 4) ||
(gSaveContext.weekEventReg[8] & 0x40)) {
this->actor.draw = ObjTokeidai_Draw;
@@ -601,9 +637,9 @@ s32 ObjTokeidai_IsPostFirstCycleFinalHours(ObjTokeidai* this, GlobalContext* glo
}
void ObjTokeidai_RotateOnHourChange(ObjTokeidai* this, GlobalContext* globalCtx) {
- s32 currentHour = GET_CURRENT_HOUR(this);
+ s32 currentClockHour = GET_CURRENT_CLOCK_HOUR(this);
- if (currentHour != this->clockHour) {
+ if (currentClockHour != this->clockHour) {
if (this->clockFaceRotationTimer > 12) {
// This actually performs the rotation to the next hour
// for the clock face.
@@ -621,32 +657,33 @@ void ObjTokeidai_RotateOnHourChange(ObjTokeidai* this, GlobalContext* globalCtx)
}
this->clockFaceRotationTimer++;
- if ((currentHour == 12 && this->clockFaceRotation < 0) ||
- (currentHour != 12 && this->clockFaceRotation > GET_CLOCK_FACE_ROTATION(currentHour))) {
- this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentHour);
- this->clockHour = currentHour;
+
+ if ((currentClockHour == 12 && this->clockFaceRotation < 0) ||
+ (currentClockHour != 12 && this->clockFaceRotation > GET_CLOCK_FACE_ROTATION(currentClockHour))) {
+ this->clockFaceRotation = GET_CLOCK_FACE_ROTATION(currentClockHour);
+ this->clockHour = currentClockHour;
this->clockFaceRotationalVelocity = 0;
this->clockFaceRotationTimer = 0;
}
}
- // If the sun and moon disk doesn't have the target rotation (e.g., the time of day
+ // If the sun and moon panel doesn't have the target rotation (e.g., the time of day
// just changed), rotate it until it matches the target.
- if (this->sunMoonDiskRotation != ObjTokeidai_GetTargetSunMoonDiskRotation()) {
+ if (this->sunMoonPanelRotation != ObjTokeidai_GetTargetSunMoonPanelRotation()) {
if (this->clockHour == 6) {
- this->sunMoonDiskRotationalVelocity += 0x222;
- this->sunMoonDiskRotation += this->sunMoonDiskRotationalVelocity;
- if (this->sunMoonDiskRotation > 0x10000) {
- this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation();
- this->sunMoonDiskRotationalVelocity = 0;
+ this->sunMoonPanelRotationalVelocity += 0x222;
+ this->sunMoonPanelRotation += this->sunMoonPanelRotationalVelocity;
+ if (this->sunMoonPanelRotation > 0x10000) {
+ this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation();
+ this->sunMoonPanelRotationalVelocity = 0;
}
}
if (this->clockHour == 18) {
- this->sunMoonDiskRotationalVelocity += 0x222;
- this->sunMoonDiskRotation += this->sunMoonDiskRotationalVelocity;
- if (this->sunMoonDiskRotation > 0x8000) {
- this->sunMoonDiskRotation = ObjTokeidai_GetTargetSunMoonDiskRotation();
- this->sunMoonDiskRotationalVelocity = 0;
+ this->sunMoonPanelRotationalVelocity += 0x222;
+ this->sunMoonPanelRotation += this->sunMoonPanelRotationalVelocity;
+ if (this->sunMoonPanelRotation > 0x8000) {
+ this->sunMoonPanelRotation = ObjTokeidai_GetTargetSunMoonPanelRotation();
+ this->sunMoonPanelRotationalVelocity = 0;
}
}
}
@@ -662,7 +699,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
if (globalCtx->csCtx.state != 0) {
this->actor.home.rot.x = 1;
- this->currentTime += 3;
+ this->clockTime += 3;
this->actor.draw = ObjTokeidai_Clock_Draw;
} else {
if (!(globalCtx->actorCtx.unk5 & 2) &&
@@ -670,7 +707,7 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
ActorCutscene_GetCurrentIndex() == -1) {
this->actor.draw = NULL;
}
- this->currentTime = gSaveContext.time;
+ this->clockTime = gSaveContext.time;
if (this->actor.home.rot.x != 0) {
ObjTokeidai_Clock_Init(this);
this->actor.home.rot.x = 0;
@@ -684,28 +721,28 @@ void ObjTokeidai_TowerClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
}
void ObjTokeidai_WallClock_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
- this->currentTime = gSaveContext.time;
+ this->clockTime = gSaveContext.time;
ObjTokeidai_RotateOnMinuteChange(this, true);
ObjTokeidai_RotateOnHourChange(this, globalCtx);
}
-void ObjTokeidai_TowerGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
+void ObjTokeidai_ExteriorGear_Idle(ObjTokeidai* this, GlobalContext* globalCtx) {
if (ObjTokeidai_IsPostFirstCycleFinalHours(this, globalCtx)) {
- this->actor.draw = ObjTokeidai_TowerGear_Draw;
+ this->actor.draw = ObjTokeidai_ExteriorGear_Draw;
} else {
if (globalCtx->csCtx.state != 0) {
this->actor.home.rot.x = 1;
- this->currentTime += 3;
- this->actor.draw = ObjTokeidai_TowerGear_Draw;
+ this->clockTime += 3;
+ this->actor.draw = ObjTokeidai_ExteriorGear_Draw;
} else {
if ((globalCtx->actorCtx.unk5 & 2) == 0 &&
- OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD &&
+ OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD &&
ActorCutscene_GetCurrentIndex() == -1) {
this->actor.draw = NULL;
}
- this->currentTime = gSaveContext.time;
+ this->clockTime = gSaveContext.time;
if (this->actor.home.rot.x != 0) {
- ObjTokeidai_SetupClockOrGear(this);
+ ObjTokeidai_SetupClockOrExteriorGear(this);
this->actor.home.rot.x = 0;
}
}
@@ -718,6 +755,7 @@ void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx)
if (ObjTokeidai_IsPostFirstCycleFinalHours(this, globalCtx)) {
this->spotlightIntensity = 0;
+
if (this->actor.child == NULL) {
type = OBJ_TOKEIDAI_TYPE(&this->actor);
if (type == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN ||
@@ -727,6 +765,7 @@ void ObjTokeidai_Counterweight_Idle(ObjTokeidai* this, GlobalContext* globalCtx)
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
}
}
+
if (this->actor.child != NULL) {
if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD) {
this->actor.child->home.rot.x = 0x384;
@@ -751,6 +790,9 @@ void ObjTokeidai_Update(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc(this, globalCtx);
}
+/**
+ * Used for TerminaFieldWalls StaircaseToRooftop, and UnusedWall
+ */
void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjTokeidai* this = THIS;
@@ -761,6 +803,7 @@ void ObjTokeidai_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, this->opaDList);
}
+
if (this->xluDList != NULL) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(globalCtx->state.gfxCtx);
@@ -780,26 +823,30 @@ void ObjTokeidai_Clock_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_InsertTranslation(0.0f, 0.0f, -1791.0f, MTXMODE_APPLY);
Matrix_InsertXRotation_s(-this->xRotation, MTXMODE_APPLY);
Matrix_InsertTranslation(0.0f, 0.0f, 1791.0f, MTXMODE_APPLY);
+
Matrix_StatePush();
- Matrix_InsertZRotation_s(-this->outerRingOrGearRotation, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(-this->minuteRingOrExteriorGearRotation, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00CF28);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerMinuteRingDL);
Matrix_StatePop();
+
Matrix_InsertTranslation(0.0f, 0.0f, this->clockFaceZTranslation, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00BEE8);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerClockCenterAndHandDL);
+
Matrix_InsertZRotation_s(-this->clockFaceRotation * 2, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_WALL_CLOCK ||
OBJ_TOKEIDAI_TYPE(&this->actor) == OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK) {
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00F518);
+ gSPDisplayList(POLY_OPA_DISP++, gWallClockClockFace);
} else {
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00E818);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerClockFace);
}
+
Matrix_InsertTranslation(0.0f, -1112.0f, -19.6f, MTXMODE_APPLY);
- Matrix_RotateY((s16)this->sunMoonDiskRotation, MTXMODE_APPLY);
+ Matrix_RotateY((s16)this->sunMoonPanelRotation, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00C368);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerSunAndMoonPanelDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
@@ -818,11 +865,16 @@ void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
+ // For scrolling the spotlight's mask texture down the length of the light beam.
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, -gameplayFrames, 0, 0x20, 0x20));
+
+ // Draws the counterweight
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C28C(globalCtx->state.gfxCtx);
gSPDisplayList(POLY_OPA_DISP++, this->opaDList);
+
+ // Draws the spotlight
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C2DC(globalCtx->state.gfxCtx);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 255, 255, 235, 180, (s32)(this->spotlightIntensity * 2.55f));
@@ -831,7 +883,7 @@ void ObjTokeidai_Counterweight_Draw(Actor* thisx, GlobalContext* globalCtx) {
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
-void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) {
+void ObjTokeidai_ExteriorGear_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjTokeidai* this = THIS;
OPEN_DISPS(globalCtx->state.gfxCtx);
@@ -842,10 +894,10 @@ void ObjTokeidai_TowerGear_Draw(Actor* thisx, GlobalContext* globalCtx) {
Matrix_InsertXRotation_s(-this->xRotation, MTXMODE_APPLY);
Matrix_RotateY(thisx->shape.rot.y, MTXMODE_APPLY);
Matrix_InsertTranslation(0.0f, 0.0f, 1791.0f, MTXMODE_APPLY);
- Matrix_InsertZRotation_s(this->outerRingOrGearRotation, MTXMODE_APPLY);
+ Matrix_InsertZRotation_s(this->minuteRingOrExteriorGearRotation, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
func_8012C28C(globalCtx->state.gfxCtx);
- gSPDisplayList(POLY_OPA_DISP++, object_obj_tokeidai_DL_00BA78);
+ gSPDisplayList(POLY_OPA_DISP++, gClockTowerExteriorGearDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h
index c5cf8d70cf..48e44614dc 100644
--- a/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h
+++ b/src/overlays/actors/ovl_Obj_Tokeidai/z_obj_tokeidai.h
@@ -6,17 +6,17 @@
#define OBJ_TOKEIDAI_TYPE(thisx) (((thisx)->params & 0xF000) >> 12)
typedef enum {
- /* 0 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_CLOCK_TOWN,
+ /* 0 */ OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_CLOCK_TOWN,
/* 1 */ OBJ_TOKEIDAI_TYPE_UNUSED_WALL,
/* 2 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_CLOCK_TOWN,
/* 3 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_CLOCK_TOWN,
- /* 4 */ OBJ_TOKEIDAI_TYPE_TOWER_GEAR_TERMINA_FIELD,
+ /* 4 */ OBJ_TOKEIDAI_TYPE_EXTERIOR_GEAR_TERMINA_FIELD,
/* 5 */ OBJ_TOKEIDAI_TYPE_TOWER_CLOCK_TERMINA_FIELD,
/* 6 */ OBJ_TOKEIDAI_TYPE_COUNTERWEIGHT_TERMINA_FIELD,
/* 8 */ OBJ_TOKEIDAI_TYPE_TOWER_WALLS_TERMINA_FIELD = 8,
/* 9 */ OBJ_TOKEIDAI_TYPE_WALL_CLOCK,
/* 10 */ OBJ_TOKEIDAI_TYPE_SMALL_WALL_CLOCK,
- /* 11 */ OBJ_TOKEIDAI_TYPE_STAIRCASE_INTO_TOWER,
+ /* 11 */ OBJ_TOKEIDAI_TYPE_STAIRCASE_TO_ROOFTOP,
} ObjTokeidaiType;
struct ObjTokeidai;
@@ -27,9 +27,9 @@ typedef struct ObjTokeidai {
/* 0x000 */ Actor actor;
/* 0x144 */ Gfx* opaDList;
/* 0x148 */ Gfx* xluDList;
- /* 0x14C */ s16 outerRingOrGearRotation;
- /* 0x14E */ s16 outerRingOrGearRotationalVelocity;
- /* 0x150 */ s16 outerRingOrGearRotationTimer;
+ /* 0x14C */ s16 minuteRingOrExteriorGearRotation;
+ /* 0x14E */ s16 minuteRingOrExteriorGearRotationalVelocity;
+ /* 0x150 */ s16 minuteRingOrExteriorGearRotationTimer;
/* 0x152 */ s16 clockFaceRotation;
/* 0x154 */ union {
s16 clockFaceRotationalVelocity;
@@ -44,9 +44,9 @@ typedef struct ObjTokeidai {
s16 counterweightRotationalAcceleration;
s16 aerialClockFaceSpeed;
};
- /* 0x158 */ s32 sunMoonDiskRotation;
+ /* 0x158 */ s32 sunMoonPanelRotation;
/* 0x15C */ union {
- s16 sunMoonDiskRotationalVelocity;
+ s16 sunMoonPanelRotationalVelocity;
s16 fallingClockFaceRotationalVelocity;
};
/* 0x15E */ s16 yTranslation;
@@ -58,7 +58,7 @@ typedef struct ObjTokeidai {
s32 clockHour;
s32 spotlightIntensity;
};
- /* 0x170 */ u16 currentTime;
+ /* 0x170 */ u16 clockTime; // can differ from the actual time, e.g., in cutscenes
/* 0x174 */ ObjTokeidaiActionFunc actionFunc;
} ObjTokeidai; // size = 0x178
diff --git a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c
index 325bd3f3ea..b91cbcf7ea 100644
--- a/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c
+++ b/src/overlays/actors/ovl_Obj_Toudai/z_obj_toudai.c
@@ -6,7 +6,7 @@
#include "z_obj_toudai.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjToudai*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c
index 7b756a10f8..e19edead35 100644
--- a/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c
+++ b/src/overlays/actors/ovl_Obj_Tree/z_obj_tree.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_tree.h"
+#include "objects/object_tree/object_tree.h"
-#define FLAGS 0x02000000
+#define FLAGS (ACTOR_FLAG_2000000)
#define THIS ((ObjTree*)thisx)
@@ -88,10 +89,6 @@ static DamageTable sDamageTable = {
static CollisionCheckInfoInit2 sColchkInfoInit = { 8, 0, 0, 0, MASS_HEAVY };
-extern Gfx D_06000680[];
-extern Gfx D_060007C8[];
-extern CollisionHeader D_06001B2C;
-
void ObjTree_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ObjTree* this = THIS;
@@ -103,7 +100,7 @@ void ObjTree_Init(Actor* thisx, GlobalContext* globalCtx) {
} else {
Actor_SetScale(&this->dyna.actor, 0.1f);
DynaPolyActor_Init(&this->dyna, 1);
- CollisionHeader_GetVirtual(&D_06001B2C, &colHeader);
+ CollisionHeader_GetVirtual(&object_tree_Colheader_001B2C, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader);
}
@@ -190,11 +187,11 @@ void ObjTree_Draw(Actor* thisx, GlobalContext* globalCtx) {
func_8012C28C(globalCtx->state.gfxCtx);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_06000680);
+ gSPDisplayList(POLY_OPA_DISP++, object_tree_DL_000680);
Matrix_InsertRotation(xRot, 0, zRot, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_OPA_DISP++, D_060007C8);
+ gSPDisplayList(POLY_OPA_DISP++, object_tree_DL_0007C8);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
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 e91c3387fb..af00e5c643 100644
--- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c
+++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c
@@ -6,7 +6,7 @@
#include "z_obj_tsubo.h"
-#define FLAGS 0x04800010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_800000 | ACTOR_FLAG_4000000)
#define THIS ((ObjTsubo*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
index ee5222543f..324d13e4b0 100644
--- a/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
+++ b/src/overlays/actors/ovl_Obj_Um/z_obj_um.c
@@ -6,7 +6,7 @@
#include "z_obj_um.h"
-#define FLAGS 0x00000039
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8 | ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjUm*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c
index 2a1f4bf30c..35371b6050 100644
--- a/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c
+++ b/src/overlays/actors/ovl_Obj_Usiyane/z_obj_usiyane.c
@@ -6,7 +6,7 @@
#include "z_obj_usiyane.h"
-#define FLAGS 0x00000020
+#define FLAGS (ACTOR_FLAG_20)
#define THIS ((ObjUsiyane*)thisx)
@@ -20,7 +20,7 @@ const ActorInit Obj_Usiyane_InitVars = {
ACTOR_OBJ_USIYANE,
ACTORCAT_PROP,
FLAGS,
- OBJECT_OBJECT_UNSET_USIYANE,
+ OBJECT_OBJ_USIYANE,
sizeof(ObjUsiyane),
(ActorFunc)ObjUsiyane_Init,
(ActorFunc)ObjUsiyane_Destroy,
diff --git a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c
index ea27c1ad99..8741fc01bc 100644
--- a/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c
+++ b/src/overlays/actors/ovl_Obj_Visiblock/z_obj_visiblock.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_visiblock.h"
+#include "objects/object_visiblock/object_visiblock.h"
-#define FLAGS 0x00000080
+#define FLAGS (ACTOR_FLAG_80)
#define THIS ((ObjVisiblock*)thisx)
@@ -33,15 +34,12 @@ static InitChainEntry sInitChain[] = {
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
};
-extern CollisionHeader D_06000AD0;
-extern Gfx D_06000140[];
-
void ObjVisiblock_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjVisiblock* this = THIS;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
DynaPolyActor_Init(&this->dyna, 0);
- DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &D_06000AD0);
+ DynaPolyActor_LoadMesh(globalCtx, &this->dyna, &object_visiblock_Colheader_000AD0);
}
void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@@ -51,5 +49,5 @@ void ObjVisiblock_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjVisiblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
- Gfx_DrawDListXlu(globalCtx, D_06000140);
+ Gfx_DrawDListXlu(globalCtx, object_visiblock_DL_000140);
}
diff --git a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c
index c830c29d9f..10d87e6bc5 100644
--- a/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c
+++ b/src/overlays/actors/ovl_Obj_Vspinyroll/z_obj_vspinyroll.c
@@ -6,7 +6,7 @@
#include "z_obj_vspinyroll.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjVspinyroll*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
index 1563ea2fa9..37a1412649 100644
--- a/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
+++ b/src/overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.c
@@ -5,8 +5,10 @@
*/
#include "z_obj_warpstone.h"
+#include "objects/object_sek/object_sek.h"
+#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((ObjWarpstone*)thisx)
@@ -20,10 +22,6 @@ s32 ObjWarpstone_BeginOpeningCutscene(ObjWarpstone* this, GlobalContext* globalC
s32 ObjWarpstone_PlayOpeningCutscene(ObjWarpstone* this, GlobalContext* globalCtx);
s32 ObjWarpstone_OpenedIdle(ObjWarpstone* this, GlobalContext* globalCtx);
-extern Gfx D_04023210[]; // gOwlStatueWhiteFlashDL
-extern Gfx D_060001D0[]; // gOwlStatueClosedDL
-extern Gfx D_06003770[]; // gOwlStatueOpenedDL
-
const ActorInit Obj_Warpstone_InitVars = {
ACTOR_OBJ_WARPSTONE,
ACTORCAT_ITEMACTION,
@@ -60,7 +58,7 @@ static InitChainEntry sInitChain[] = {
ICHAIN_U8(targetMode, 1, ICHAIN_STOP),
};
-static Gfx* sOwlStatueDLs[] = { D_060001D0, D_06003770 };
+static Gfx* sOwlStatueDLs[] = { gOwlStatueClosedDL, gOwlStatueOpenedDL };
void ObjWarpstone_SetupAction(ObjWarpstone* this, ObjWarpstoneActionFunc actionFunc) {
this->actionFunc = actionFunc;
@@ -143,7 +141,7 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) {
} else if ((Message_GetState(&globalCtx->msgCtx) == 4) && (func_80147624(globalCtx))) {
if (globalCtx->msgCtx.choiceIndex != 0) {
func_8019F208();
- globalCtx->msgCtx.unk11F22 = 0x4D;
+ globalCtx->msgCtx.msgMode = 0x4D;
globalCtx->msgCtx.unk120D6 = 0;
globalCtx->msgCtx.unk120D4 = 0;
gSaveContext.owlSaveLocation = OBJ_WARPSTONE_GET_ID(this);
@@ -164,8 +162,8 @@ void ObjWarpstone_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void ObjWarpstone_Draw(Actor* thisx, GlobalContext* globalCtx2) {
- ObjWarpstone* this = THIS;
GlobalContext* globalCtx = globalCtx2;
+ ObjWarpstone* this = THIS;
Gfx_DrawDListOpa(globalCtx, sOwlStatueDLs[this->modelIndex]);
if (this->dyna.actor.home.rot.x != 0) {
@@ -183,11 +181,11 @@ void ObjWarpstone_Draw(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetEnvColor(POLY_XLU_DISP++, 100, 200, 0, 255);
Matrix_InsertZRotation_f((((globalCtx->gameplayFrames * 1500) & 0xFFFF) * M_PI) / 0x8000, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_04023210);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
Matrix_StatePop();
Matrix_InsertZRotation_f((~((globalCtx->gameplayFrames * 1200) & 0xFFFF) * M_PI) / 0x8000, MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(POLY_XLU_DISP++, D_04023210);
+ gSPDisplayList(POLY_XLU_DISP++, gOwlStatueWhiteFlashDL);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
}
diff --git a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c
index 02fc51e139..f72645e49c 100644
--- a/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c
+++ b/src/overlays/actors/ovl_Obj_Wind/z_obj_wind.c
@@ -6,7 +6,7 @@
#include "z_obj_wind.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjWind*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c
index 94f73d2a23..225587cdc9 100644
--- a/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c
+++ b/src/overlays/actors/ovl_Obj_Wturn/z_obj_wturn.c
@@ -6,7 +6,7 @@
#include "z_obj_wturn.h"
-#define FLAGS 0x02100010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000)
#define THIS ((ObjWturn*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c
index 3c0fce6314..7e9f6cb29d 100644
--- a/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c
+++ b/src/overlays/actors/ovl_Obj_Y2lift/z_obj_y2lift.c
@@ -6,7 +6,7 @@
#include "z_obj_y2lift.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjY2lift*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c
index c9850690d2..4bfced35c0 100644
--- a/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c
+++ b/src/overlays/actors/ovl_Obj_Y2shutter/z_obj_y2shutter.c
@@ -6,7 +6,7 @@
#include "z_obj_y2shutter.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((ObjY2shutter*)thisx)
diff --git a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c
index 3d34f1bf4b..70bb72454d 100644
--- a/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c
+++ b/src/overlays/actors/ovl_Obj_Yado/z_obj_yado.c
@@ -5,8 +5,9 @@
*/
#include "z_obj_yado.h"
+#include "objects/object_yado_obj/object_yado_obj.h"
-#define FLAGS 0x00000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20)
#define THIS ((ObjYado*)thisx)
@@ -33,15 +34,11 @@ static InitChainEntry sInitChain[] = {
AnimatedMaterial* D_80C16470;
-extern Gfx D_06000320[];
-extern Gfx D_06000430[];
-extern AnimatedMaterial D_060012E8;
-
void ObjYado_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjYado* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
- D_80C16470 = (AnimatedMaterial*)Lib_SegmentedToVirtual(&D_060012E8);
+ D_80C16470 = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_yado_obj_Matanimheader_0012E8);
this->isNight = gSaveContext.isNight;
}
@@ -69,8 +66,8 @@ void ObjYado_Draw(Actor* thisx, GlobalContext* globalCtx) {
}
AnimatedMat_Draw(globalCtx, D_80C16470);
- Gfx_DrawDListOpa(globalCtx, D_06000430);
- Gfx_DrawDListXlu(globalCtx, D_06000320);
+ Gfx_DrawDListOpa(globalCtx, object_yado_obj_DL_000430);
+ Gfx_DrawDListXlu(globalCtx, object_yado_obj_DL_000320);
CLOSE_DISPS(globalCtx->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c
index e79af5a3c8..5668371fbe 100644
--- a/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c
+++ b/src/overlays/actors/ovl_Obj_Yasi/z_obj_yasi.c
@@ -20,7 +20,7 @@ const ActorInit Obj_Yasi_InitVars = {
ACTOR_OBJ_YASI,
ACTORCAT_PROP,
FLAGS,
- OBJECT_OBJECT_UNSET_YASI,
+ OBJECT_OBJ_YASI,
sizeof(ObjYasi),
(ActorFunc)ObjYasi_Init,
(ActorFunc)ObjYasi_Destroy,
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 0c0a722793..324e53fee5 100644
--- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c
+++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c
@@ -7,7 +7,7 @@
#include "z_object_kankyo.h"
#include "objects/gameplay_keep/gameplay_keep.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((ObjectKankyo*)thisx)
@@ -222,7 +222,7 @@ void func_808DC454(ObjectKankyo* this, GlobalContext* globalCtx) {
this->unk_14C[i].unk_08 = globalCtx->view.eye.z + (spC8 * 120.0f);
this->unk_14C[i].unk_0C = (Rand_ZeroOne() - 0.5f) * (2.0f * temp_120);
- temp_f22 = (func_800DFCB4(GET_ACTIVE_CAM(globalCtx)) * 0.004f) + 60.0f;
+ temp_f22 = (Camera_GetCamDirPitch(GET_ACTIVE_CAM(globalCtx)) * 0.004f) + 60.0f;
if (temp_f22 < 20.0f) {
temp_f22 = 20.0f;
}
@@ -273,7 +273,7 @@ void func_808DC454(ObjectKankyo* this, GlobalContext* globalCtx) {
this->unk_14C[i].unk_10 -=
this->unk_14C[i].unk_18 - (spC0 * 3.0f * (globalCtx->envCtx.windSpeed / 100.0f));
- temp_f22 = (-func_800DFCB4(GET_ACTIVE_CAM(globalCtx)) * 0.012f) + 40.0f;
+ temp_f22 = (-Camera_GetCamDirPitch(GET_ACTIVE_CAM(globalCtx)) * 0.012f) + 40.0f;
if (temp_f22 < -40.0f) {
temp_f22 = -40.0f;
}
@@ -349,10 +349,10 @@ void func_808DCBF8(ObjectKankyo* this, GlobalContext* globalCtx) {
if (temp_f0 > 0.01f) {
D_801F4E30 = 155.0f * temp_f0;
- globalCtx->envCtx.unk_EA = 10;
+ globalCtx->envCtx.sandstormState = 10;
} else {
D_801F4E30 = 0;
- globalCtx->envCtx.unk_EA = 10;
+ globalCtx->envCtx.sandstormState = 10;
}
func_808DC454(this, globalCtx);
}
@@ -514,7 +514,7 @@ void func_808DD3C8(Actor* thisx, GlobalContext* globalCtx2) {
f32 temp_f2;
f32 tempf;
- if ((globalCtx->cameraPtrs[MAIN_CAM]->flags2 & 0x100) || ((u8)globalCtx->envCtx.unk_E2 == 0)) {
+ if ((globalCtx->cameraPtrs[CAM_ID_MAIN]->flags2 & 0x100) || ((u8)globalCtx->envCtx.unk_E2 == 0)) {
return;
}
@@ -554,7 +554,7 @@ void func_808DD3C8(Actor* thisx, GlobalContext* globalCtx2) {
gDPSetRenderMode(POLY_XLU_DISP++, G_RM_FOG_SHADE_A, G_RM_ZB_CLD_SURF2);
gSPSetGeometryMode(POLY_XLU_DISP++, G_FOG);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08EBE0));
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust5Tex));
}
Matrix_InsertTranslation(spC4.x, spC4.y, spC4.z, MTXMODE_NEW);
@@ -592,7 +592,7 @@ void func_808DD970(Actor* thisx, GlobalContext* globalCtx2) {
if (globalCtx->sceneNum == SCENE_KYOJINNOMA) {
phi_f26 = 1.0f;
} else {
- tempA = func_800E031C(GET_ACTIVE_CAM(globalCtx));
+ tempA = Camera_GetWaterYPos(GET_ACTIVE_CAM(globalCtx));
if (tempA != BGCHECK_Y_MIN) {
tempA -= globalCtx->view.eye.y;
phi_f26 = tempA / 4000.0f;
@@ -602,7 +602,7 @@ void func_808DD970(Actor* thisx, GlobalContext* globalCtx2) {
phi_f26 = CLAMP_MAX(phi_f26, 1.0f);
- if (!(globalCtx->cameraPtrs[MAIN_CAM]->flags2 & 0x100) || (phi_f26 == 0.0f)) {
+ if (!(globalCtx->cameraPtrs[CAM_ID_MAIN]->flags2 & 0x100) || (phi_f26 == 0.0f)) {
return;
}
}
@@ -629,7 +629,7 @@ void func_808DD970(Actor* thisx, GlobalContext* globalCtx2) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gameplay_keep_Tex_08EBE0));
+ gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gDust5Tex));
gSPClearGeometryMode(POLY_XLU_DISP++, G_LIGHTING);
POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0);
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 4b1e1d8bae..18d28f8c7c 100644
--- a/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c
+++ b/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c
@@ -6,7 +6,7 @@
#include "z_oceff_spot.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffSpot*)thisx)
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 781e506058..1939b1ef02 100644
--- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c
+++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c
@@ -6,7 +6,7 @@
#include "z_oceff_storm.h"
-#define FLAGS 0x02000030
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
#define THIS ((OceffStorm*)thisx)
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 b5dd2f290a..1179f5ba24 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe*)thisx)
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 aee5dd446e..61a1ae5494 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe2.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe2*)thisx)
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 0ef0a25e88..a8745c0152 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe3.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe3*)thisx)
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 b9a89614bc..b985aadadd 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe4/z_oceff_wipe4.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe4.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe4*)thisx)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c
index 8cac4317d2..e39a4aa4c5 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe5/z_oceff_wipe5.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe5.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe5*)thisx)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c
index c14a59e9f4..6bde6902cc 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe6/z_oceff_wipe6.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe6.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe6*)thisx)
diff --git a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c
index f031303435..da295b768d 100644
--- a/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c
+++ b/src/overlays/actors/ovl_Oceff_Wipe7/z_oceff_wipe7.c
@@ -6,7 +6,7 @@
#include "z_oceff_wipe7.h"
-#define FLAGS 0x02000010
+#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_2000000)
#define THIS ((OceffWipe7*)thisx)
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 8072d9f44c..38acb813ee 100644
--- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
+++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
@@ -6,7 +6,7 @@
#include "z_shot_sun.h"
-#define FLAGS 0x00000009
+#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
#define THIS ((ShotSun*)thisx)
diff --git a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c
index 9dcf3ab159..51a2fa6952 100644
--- a/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c
+++ b/src/overlays/actors/ovl_TG_Sw/z_tg_sw.c
@@ -6,7 +6,7 @@
#include "z_tg_sw.h"
-#define FLAGS 0x00000010
+#define FLAGS (ACTOR_FLAG_10)
#define THIS ((TGSw*)thisx)
diff --git a/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h b/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h
index 40c3d693cd..ba2355d232 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h
+++ b/src/overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h
@@ -4,7 +4,10 @@
#include "global.h"
typedef struct {
- char unk_0[UNK_SIZE];
+ /* 0x00 */ Vec3f unk_00;
+ /* 0x0C */ CollisionPoly* unk_0C;
+ /* 0x10 */ f32 unk_10;
+ /* 0x14 */ char unk_14[UNK_SIZE];
} EffectSsSbnInitParams; // size = ?
extern const EffectSsInit Effect_Ss_Sbn_InitVars;
diff --git a/src/overlays/gamestates/ovl_daytelop/z_daytelop.h b/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
index eca743850b..d77a5f334f 100644
--- a/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
+++ b/src/overlays/gamestates/ovl_daytelop/z_daytelop.h
@@ -1,5 +1,5 @@
-#ifndef _Z64_DAYTELOP_H_
-#define _Z64_DAYTELOP_H_
+#ifndef Z64_DAYTELOP_H
+#define Z64_DAYTELOP_H
#include "global.h"
diff --git a/src/overlays/gamestates/ovl_title/z_title.c b/src/overlays/gamestates/ovl_title/z_title.c
index 9b36a7e148..827c273871 100644
--- a/src/overlays/gamestates/ovl_title/z_title.c
+++ b/src/overlays/gamestates/ovl_title/z_title.c
@@ -105,7 +105,8 @@ void Title_Draw(GameState* thisx) {
G_TX_NOLOD, G_TX_NOLOD);
gDPSetTileSize(POLY_OPA_DISP++, 1, this->uls, (this->ult & 0x7F) - idx * 4, 0, 0);
- gSPTextureRectangle(POLY_OPA_DISP++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
+ gSPTextureRectangle(POLY_OPA_DISP++, 97 << 2, y << 2, (97 + 192) << 2, (y + 2) << 2, G_TX_RENDERTILE, 0, 0,
+ 1 << 10, 1 << 10);
}
func_800FC444(this->gameState.gfxCtx, 0, 0, 0, this->coverAlpha, 2);
diff --git a/tools/ZAPD/.gitrepo b/tools/ZAPD/.gitrepo
index ccd6c7d649..475415d994 100644
--- a/tools/ZAPD/.gitrepo
+++ b/tools/ZAPD/.gitrepo
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/zeldaret/ZAPD.git
branch = master
- commit = fd5a7f434171a33b1b3eb2a3e112fdcee6d9262d
- parent = 844c24e39c96b7a3f3a40035058bda6c91ed4bbf
+ commit = 119a6883e6f795815744b9afd6a79084c619ddb6
+ parent = 66a66f61b6368af0ed711803c54a963494329217
method = merge
cmdver = 0.4.3
diff --git a/tools/ZAPD/Jenkinsfile b/tools/ZAPD/Jenkinsfile
index ec9b56ac5a..9c4dde7122 100644
--- a/tools/ZAPD/Jenkinsfile
+++ b/tools/ZAPD/Jenkinsfile
@@ -61,7 +61,7 @@ pipeline {
sh 'cp ../ZAPD.out tools/ZAPD/'
sh 'python3 tools/fixbaserom.py'
sh 'python3 tools/extract_baserom.py'
- sh 'python3 extract_assets.py -t$(nproc)'
+ sh 'python3 extract_assets.py -j $(nproc)'
}
}
}
diff --git a/tools/ZAPD/ZAPD/Declaration.cpp b/tools/ZAPD/ZAPD/Declaration.cpp
index be06b0bea7..34ab953517 100644
--- a/tools/ZAPD/ZAPD/Declaration.cpp
+++ b/tools/ZAPD/ZAPD/Declaration.cpp
@@ -171,7 +171,7 @@ std::string Declaration::GetExternalDeclarationStr() const
std::string Declaration::GetExternStr() const
{
- if (IsStatic() || varType == "")
+ if (IsStatic() || varType == "" || isUnaccounted)
{
return "";
}
diff --git a/tools/ZAPD/ZAPD/Main.cpp b/tools/ZAPD/ZAPD/Main.cpp
index 048338fb70..531edc0946 100644
--- a/tools/ZAPD/ZAPD/Main.cpp
+++ b/tools/ZAPD/ZAPD/Main.cpp
@@ -434,6 +434,10 @@ void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const f
std::string name = outPath.stem().string();
ZTexture tex(nullptr);
+
+ if (name.find("u32") != std::string::npos)
+ tex.dWordAligned = false;
+
tex.FromPNG(pngFilePath.string(), texType);
std::string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg";
diff --git a/tools/ZAPD/ZAPD/WarningHandler.cpp b/tools/ZAPD/ZAPD/WarningHandler.cpp
index 29f8352a71..163b028b54 100644
--- a/tools/ZAPD/ZAPD/WarningHandler.cpp
+++ b/tools/ZAPD/ZAPD/WarningHandler.cpp
@@ -199,8 +199,16 @@ bool WarningHandler::WasElevatedToError(WarningType warnType) {
* Print file/line/function info for debugging
*/
void WarningHandler::FunctionPreamble(const char* filename, int32_t line, const char* function) {
- if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) {
- fprintf(stderr, "%s:%i: in function %s:\n", filename, line, function);
+ bool forcePrint = false;
+
+#ifdef DEVELOPMENT
+ forcePrint = true;
+#endif
+
+ fprintf(stderr, "\n");
+
+ if (forcePrint || Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG) {
+ fprintf(stderr, "%s:%i: in function <%s>:\n", filename, line, function);
}
}
diff --git a/tools/ZAPD/ZAPD/ZAnimation.cpp b/tools/ZAPD/ZAPD/ZAnimation.cpp
index 4d9266b091..74b520b501 100644
--- a/tools/ZAPD/ZAPD/ZAnimation.cpp
+++ b/tools/ZAPD/ZAPD/ZAnimation.cpp
@@ -51,7 +51,7 @@ void ZNormalAnimation::ParseRawData()
{
ZAnimation::ParseRawData();
- const uint8_t* data = parent->GetRawData().data();
+ auto& data = parent->GetRawData();
rotationValuesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 4);
rotationIndicesSeg = BitConverter::ToInt32BE(data, rawDataIndex + 8);
diff --git a/tools/ZAPD/ZAPD/ZArray.cpp b/tools/ZAPD/ZAPD/ZArray.cpp
index ebfb13ee74..b6d9e50e50 100644
--- a/tools/ZAPD/ZAPD/ZArray.cpp
+++ b/tools/ZAPD/ZAPD/ZArray.cpp
@@ -101,11 +101,18 @@ std::string ZArray::GetBodySourceCode() const
const auto& res = resList[i];
output += "\t";
- if (res->GetResourceType() == ZResourceType::Scalar ||
- res->GetResourceType() == ZResourceType::Vertex)
+ switch (res->GetResourceType())
+ {
+ case ZResourceType::Pointer:
+ case ZResourceType::Scalar:
+ case ZResourceType::Vertex:
output += resList.at(i)->GetBodySourceCode();
- else
+ break;
+
+ default:
output += StringHelper::Sprintf("{ %s }", resList.at(i)->GetBodySourceCode().c_str());
+ break;
+ }
if (i < arrayCnt - 1 || res->IsExternalResource())
output += ",\n";
diff --git a/tools/ZAPD/ZAPD/ZCollision.cpp b/tools/ZAPD/ZAPD/ZCollision.cpp
index 1dfa46b1dd..0b04ca5c17 100644
--- a/tools/ZAPD/ZAPD/ZCollision.cpp
+++ b/tools/ZAPD/ZAPD/ZCollision.cpp
@@ -1,5 +1,6 @@
#include "ZCollision.h"
+#include
#include
#include
@@ -76,9 +77,42 @@ void ZCollisionHeader::ParseRawData()
polygonTypes.push_back(
BitConverter::ToUInt64BE(rawData, polyTypeDefSegmentOffset + (i * 8)));
- if (camDataAddress != 0)
- camData = new CameraDataList(parent, name, rawData, camDataSegmentOffset,
- polyTypeDefSegmentOffset, polygonTypes.size());
+ if (camDataAddress != SEGMENTED_NULL)
+ {
+ // Try to guess how many elements the CamDataList array has.
+ // The "guessing algorithm" is basically a "best effort" one and it
+ // is error-prone.
+ // This is based mostly on observation of how CollisionHeader data is
+ // usually ordered. If for some reason the data was in some other funny
+ // order, this would probably break.
+ // The most common ordering is:
+ // - *CamData*
+ // - SurfaceType
+ // - CollisionPoly
+ // - Vertices
+ // - WaterBoxes
+ // - CollisionHeader
+ offset_t upperCameraBoundary = polyTypeDefSegmentOffset;
+ if (upperCameraBoundary == 0)
+ {
+ upperCameraBoundary = polySegmentOffset;
+ }
+ if (upperCameraBoundary == 0)
+ {
+ upperCameraBoundary = vtxSegmentOffset;
+ }
+ if (upperCameraBoundary == 0)
+ {
+ upperCameraBoundary = waterBoxSegmentOffset;
+ }
+ if (upperCameraBoundary == 0)
+ {
+ upperCameraBoundary = rawDataIndex;
+ }
+
+ camData =
+ new CameraDataList(parent, name, rawData, camDataSegmentOffset, upperCameraBoundary);
+ }
for (uint16_t i = 0; i < numWaterBoxes; i++)
waterBoxes.push_back(WaterBoxHeader(
@@ -106,8 +140,7 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix)
parent->AddDeclarationArray(
waterBoxSegmentOffset, DeclarationAlignment::Align4, 16 * waterBoxes.size(), "WaterBox",
- StringHelper::Sprintf("%s_waterBoxes_%06X", auxName.c_str(), waterBoxSegmentOffset),
- waterBoxes.size(), declaration);
+ StringHelper::Sprintf("%sWaterBoxes", auxName.c_str()), waterBoxes.size(), declaration);
}
if (polygons.size() > 0)
@@ -126,8 +159,7 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix)
parent->AddDeclarationArray(
polySegmentOffset, DeclarationAlignment::Align4, polygons.size() * 16, "CollisionPoly",
- StringHelper::Sprintf("%s_polygons_%08X", auxName.c_str(), polySegmentOffset),
- polygons.size(), declaration);
+ StringHelper::Sprintf("%sPolygons", auxName.c_str()), polygons.size(), declaration);
}
declaration.clear();
@@ -141,11 +173,10 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix)
}
if (polyTypeDefAddress != 0)
- parent->AddDeclarationArray(
- polyTypeDefSegmentOffset, DeclarationAlignment::Align4, polygonTypes.size() * 8,
- "SurfaceType",
- StringHelper::Sprintf("%s_surfaceType_%08X", auxName.c_str(), polyTypeDefSegmentOffset),
- polygonTypes.size(), declaration);
+ parent->AddDeclarationArray(polyTypeDefSegmentOffset, DeclarationAlignment::Align4,
+ polygonTypes.size() * 8, "SurfaceType",
+ StringHelper::Sprintf("%sSurfaceType", auxName.c_str()),
+ polygonTypes.size(), declaration);
declaration.clear();
@@ -167,8 +198,7 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix)
parent->AddDeclarationArray(
vtxSegmentOffset, first.GetDeclarationAlignment(),
vertices.size() * first.GetRawDataSize(), first.GetSourceTypeName(),
- StringHelper::Sprintf("%s_vtx_%08X", auxName.c_str(), vtxSegmentOffset),
- vertices.size(), declaration);
+ StringHelper::Sprintf("%sVertices", auxName.c_str()), vertices.size(), declaration);
}
}
@@ -183,11 +213,11 @@ std::string ZCollisionHeader::GetBodySourceCode() const
std::string vtxName;
Globals::Instance->GetSegmentedPtrName(vtxAddress, parent, "Vec3s", vtxName);
- declaration += StringHelper::Sprintf("\t%i,\n\t%s,\n", numVerts, vtxName.c_str());
+ declaration += StringHelper::Sprintf("\t%i, %s,\n", numVerts, vtxName.c_str());
std::string polyName;
Globals::Instance->GetSegmentedPtrName(polyAddress, parent, "CollisionPoly", polyName);
- declaration += StringHelper::Sprintf("\t%i,\n\t%s,\n", numPolygons, polyName.c_str());
+ declaration += StringHelper::Sprintf("\t%i, %s,\n", numPolygons, polyName.c_str());
std::string surfaceName;
Globals::Instance->GetSegmentedPtrName(polyTypeDefAddress, parent, "SurfaceType", surfaceName);
@@ -199,7 +229,7 @@ std::string ZCollisionHeader::GetBodySourceCode() const
std::string waterBoxName;
Globals::Instance->GetSegmentedPtrName(waterBoxAddress, parent, "WaterBox", waterBoxName);
- declaration += StringHelper::Sprintf("\t%i,\n\t%s\n", numWaterBoxes, waterBoxName.c_str());
+ declaration += StringHelper::Sprintf("\t%i, %s\n", numWaterBoxes, waterBoxName.c_str());
return declaration;
}
@@ -226,32 +256,28 @@ size_t ZCollisionHeader::GetRawDataSize() const
PolygonEntry::PolygonEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- const uint8_t* data = rawData.data();
-
- type = BitConverter::ToUInt16BE(data, rawDataIndex + 0);
- vtxA = BitConverter::ToUInt16BE(data, rawDataIndex + 2);
- vtxB = BitConverter::ToUInt16BE(data, rawDataIndex + 4);
- vtxC = BitConverter::ToUInt16BE(data, rawDataIndex + 6);
- a = BitConverter::ToUInt16BE(data, rawDataIndex + 8);
- b = BitConverter::ToUInt16BE(data, rawDataIndex + 10);
- c = BitConverter::ToUInt16BE(data, rawDataIndex + 12);
- d = BitConverter::ToUInt16BE(data, rawDataIndex + 14);
+ type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ vtxA = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ vtxB = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ vtxC = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
+ a = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8);
+ b = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10);
+ c = BitConverter::ToUInt16BE(rawData, rawDataIndex + 12);
+ d = BitConverter::ToUInt16BE(rawData, rawDataIndex + 14);
}
WaterBoxHeader::WaterBoxHeader(const std::vector& rawData, uint32_t rawDataIndex)
{
- const uint8_t* data = rawData.data();
-
- xMin = BitConverter::ToInt16BE(data, rawDataIndex + 0);
- ySurface = BitConverter::ToInt16BE(data, rawDataIndex + 2);
- zMin = BitConverter::ToInt16BE(data, rawDataIndex + 4);
- xLength = BitConverter::ToInt16BE(data, rawDataIndex + 6);
- zLength = BitConverter::ToInt16BE(data, rawDataIndex + 8);
+ xMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
+ ySurface = BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
+ zMin = BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
+ xLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 6);
+ zLength = BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
if (Globals::Instance->game == ZGame::OOT_SW97)
- properties = BitConverter::ToInt16BE(data, rawDataIndex + 10);
+ properties = BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
else
- properties = BitConverter::ToInt32BE(data, rawDataIndex + 12);
+ properties = BitConverter::ToInt32BE(rawData, rawDataIndex + 12);
}
std::string WaterBoxHeader::GetBodySourceCode() const
@@ -261,16 +287,17 @@ std::string WaterBoxHeader::GetBodySourceCode() const
}
CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix,
- const std::vector& rawData, uint32_t rawDataIndex,
- uint32_t polyTypeDefSegmentOffset,
- [[maybe_unused]] uint32_t polygonTypesCnt)
+ const std::vector& rawData, offset_t rawDataIndex,
+ offset_t upperCameraBoundary)
{
std::string declaration;
// Parse CameraDataEntries
- int32_t numElements = (polyTypeDefSegmentOffset - rawDataIndex) / 8;
- uint32_t cameraPosDataSeg = rawDataIndex;
- for (int32_t i = 0; i < numElements; i++)
+ size_t numElements = (upperCameraBoundary - rawDataIndex) / 8;
+ assert(numElements < 10000);
+
+ offset_t cameraPosDataSeg = rawDataIndex;
+ for (size_t i = 0; i < numElements; i++)
{
CameraDataEntry* entry = new CameraDataEntry();
@@ -302,8 +329,7 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix,
{
int32_t index =
((entries[i]->cameraPosDataSeg & 0x00FFFFFF) - cameraPosDataOffset) / 0x6;
- sprintf(camSegLine, "&%s_camPosData_%08X[%i]", prefix.c_str(), cameraPosDataOffset,
- index);
+ sprintf(camSegLine, "&%sCamPosData[%i]", prefix.c_str(), index);
}
else
sprintf(camSegLine, "NULL");
@@ -318,7 +344,7 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix,
parent->AddDeclarationArray(
rawDataIndex, DeclarationAlignment::Align4, entries.size() * 8, "CamData",
- StringHelper::Sprintf("%s_camDataList_%08X", prefix.c_str(), rawDataIndex), entries.size(),
+ StringHelper::Sprintf("%sCamDataList", prefix.c_str(), rawDataIndex), entries.size(),
declaration);
uint32_t numDataTotal = (rawDataIndex - cameraPosDataOffset) / 0x6;
@@ -339,10 +365,9 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix,
int32_t cameraPosDataIndex = GETSEGOFFSET(cameraPosDataSeg);
uint32_t entrySize = numDataTotal * 0x6;
- parent->AddDeclarationArray(
- cameraPosDataIndex, DeclarationAlignment::Align4, entrySize, "Vec3s",
- StringHelper::Sprintf("%s_camPosData_%08X", prefix.c_str(), cameraPosDataIndex),
- numDataTotal, declaration);
+ parent->AddDeclarationArray(cameraPosDataIndex, DeclarationAlignment::Align4, entrySize,
+ "Vec3s", StringHelper::Sprintf("%sCamPosData", prefix.c_str()),
+ numDataTotal, declaration);
}
}
diff --git a/tools/ZAPD/ZAPD/ZCollision.h b/tools/ZAPD/ZAPD/ZCollision.h
index d0325bfb95..222fd25f9a 100644
--- a/tools/ZAPD/ZAPD/ZCollision.h
+++ b/tools/ZAPD/ZAPD/ZCollision.h
@@ -55,8 +55,7 @@ public:
std::vector cameraPositionData;
CameraDataList(ZFile* parent, const std::string& prefix, const std::vector& rawData,
- uint32_t rawDataIndex, uint32_t polyTypeDefSegmentOffset,
- uint32_t polygonTypesCnt);
+ offset_t rawDataIndex, offset_t upperCameraBoundary);
~CameraDataList();
};
diff --git a/tools/ZAPD/ZAPD/ZCutscene.cpp b/tools/ZAPD/ZAPD/ZCutscene.cpp
index ba8fe89638..71bb690c76 100644
--- a/tools/ZAPD/ZAPD/ZCutscene.cpp
+++ b/tools/ZAPD/ZAPD/ZCutscene.cpp
@@ -445,30 +445,26 @@ size_t CutsceneCommand::GetCommandSize()
CutsceneCameraPoint::CutsceneCameraPoint(const std::vector& rawData, uint32_t rawDataIndex)
{
- const uint8_t* data = rawData.data();
+ continueFlag = rawData.at(rawDataIndex + 0);
+ cameraRoll = rawData.at(rawDataIndex + 1);
+ nextPointFrame = BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
+ viewAngle = BitConverter::ToFloatBE(rawData, rawDataIndex + 4);
- continueFlag = data[rawDataIndex + 0];
- cameraRoll = data[rawDataIndex + 1];
- nextPointFrame = BitConverter::ToInt16BE(data, rawDataIndex + 2);
- viewAngle = BitConverter::ToFloatBE(data, rawDataIndex + 4);
+ posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
+ posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
+ posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 12);
- posX = BitConverter::ToInt16BE(data, rawDataIndex + 8);
- posY = BitConverter::ToInt16BE(data, rawDataIndex + 10);
- posZ = BitConverter::ToInt16BE(data, rawDataIndex + 12);
-
- unused = BitConverter::ToInt16BE(data, rawDataIndex + 14);
+ unused = BitConverter::ToInt16BE(rawData, rawDataIndex + 14);
}
CutsceneCommandSetCameraPos::CutsceneCommandSetCameraPos(const std::vector& rawData,
uint32_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
- const uint8_t* data = rawData.data();
-
- base = BitConverter::ToUInt16BE(data, rawDataIndex + 0);
- startFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 2);
- endFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 4);
- unused = BitConverter::ToUInt16BE(data, rawDataIndex + 6);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ unused = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
entries = std::vector();
@@ -711,17 +707,17 @@ size_t CutsceneCommandStopBGM::GetCommandSize()
EnvLightingEntry::EnvLightingEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- setting = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
- unused0 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6);
- unused1 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 8);
- unused2 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 12);
- unused3 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 16);
- unused4 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 20);
- unused5 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 24);
- unused6 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 28);
- unused7 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 32);
+ setting = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
+ unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
+ unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12);
+ unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16);
+ unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20);
+ unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24);
+ unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28);
+ unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32);
}
CutsceneCommandEnvLighting::CutsceneCommandEnvLighting(const std::vector& rawData,
@@ -769,9 +765,9 @@ size_t CutsceneCommandEnvLighting::GetCommandSize()
Unknown9Entry::Unknown9Entry(const std::vector& rawData, uint32_t rawDataIndex)
{
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unk2 = rawData[rawDataIndex + 6];
unk3 = rawData[rawDataIndex + 7];
unk4 = rawData[rawDataIndex + 8];
@@ -824,18 +820,18 @@ size_t CutsceneCommandUnknown9::GetCommandSize()
UnkEntry::UnkEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- unused0 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 0);
- unused1 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 4);
- unused2 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 8);
- unused3 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 12);
- unused4 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 16);
- unused5 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 20);
- unused6 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 24);
- unused7 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 28);
- unused8 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 32);
- unused9 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 36);
- unused10 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 40);
- unused11 = (uint32_t)BitConverter::ToInt32BE(rawData, rawDataIndex + 44);
+ unused0 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0);
+ unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 4);
+ unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
+ unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12);
+ unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16);
+ unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20);
+ unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24);
+ unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28);
+ unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32);
+ unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 36);
+ unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 40);
+ unused11 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 44);
}
CutsceneCommandUnknown::CutsceneCommandUnknown(const std::vector& rawData,
@@ -883,9 +879,9 @@ size_t CutsceneCommandUnknown::GetCommandSize()
DayTimeEntry::DayTimeEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
hour = rawData[rawDataIndex + 6];
minute = rawData[rawDataIndex + 7];
unused = rawData[rawDataIndex + 8];
@@ -934,12 +930,12 @@ size_t CutsceneCommandDayTime::GetCommandSize()
TextboxEntry::TextboxEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
- type = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6);
- textID1 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
- textID2 = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
+ textID1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8);
+ textID2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10);
}
CutsceneCommandTextbox::CutsceneCommandTextbox(const std::vector& rawData,
@@ -994,23 +990,21 @@ size_t CutsceneCommandTextbox::GetCommandSize()
ActorAction::ActorAction(const std::vector& rawData, uint32_t rawDataIndex)
{
- const uint8_t* data = rawData.data();
-
- action = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 4);
- rotX = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 6);
- rotY = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 8);
- rotZ = (uint16_t)BitConverter::ToInt16BE(data, rawDataIndex + 10);
- startPosX = BitConverter::ToInt32BE(data, rawDataIndex + 12);
- startPosY = BitConverter::ToInt32BE(data, rawDataIndex + 16);
- startPosZ = BitConverter::ToInt32BE(data, rawDataIndex + 20);
- endPosX = BitConverter::ToInt32BE(data, rawDataIndex + 24);
- endPosY = BitConverter::ToInt32BE(data, rawDataIndex + 28);
- endPosZ = BitConverter::ToInt32BE(data, rawDataIndex + 32);
- normalX = BitConverter::ToFloatBE(data, rawDataIndex + 36);
- normalY = BitConverter::ToFloatBE(data, rawDataIndex + 40);
- normalZ = BitConverter::ToFloatBE(data, rawDataIndex + 44);
+ action = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
+ rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8);
+ rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10);
+ startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 12);
+ startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 16);
+ startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 20);
+ endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 24);
+ endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 28);
+ endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 32);
+ normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 36);
+ normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 40);
+ normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 44);
}
CutsceneCommandActorAction::CutsceneCommandActorAction(const std::vector& rawData,
@@ -1074,10 +1068,10 @@ CutsceneCommandTerminator::CutsceneCommandTerminator(const std::vector&
{
rawDataIndex += 4;
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
- unknown = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ unknown = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate
}
std::string CutsceneCommandTerminator::GetCName()
@@ -1102,9 +1096,9 @@ size_t CutsceneCommandTerminator::GetCommandSize()
CutsceneCommandEnd::CutsceneCommandEnd(const std::vector& rawData, uint32_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
}
std::string CutsceneCommandEnd::GenerateSourceCode([[maybe_unused]] uint32_t baseAddress)
@@ -1128,22 +1122,20 @@ size_t CutsceneCommandEnd::GetCommandSize()
SpecialActionEntry::SpecialActionEntry(const std::vector& rawData, uint32_t rawDataIndex)
{
- const uint8_t* data = rawData.data();
-
- base = BitConverter::ToUInt16BE(data, rawDataIndex + 0);
- startFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 2);
- endFrame = BitConverter::ToUInt16BE(data, rawDataIndex + 4);
- unused0 = BitConverter::ToUInt16BE(data, rawDataIndex + 6);
- unused1 = BitConverter::ToUInt32BE(data, rawDataIndex + 8);
- unused2 = BitConverter::ToUInt32BE(data, rawDataIndex + 12);
- unused3 = BitConverter::ToUInt32BE(data, rawDataIndex + 16);
- unused4 = BitConverter::ToUInt32BE(data, rawDataIndex + 20);
- unused5 = BitConverter::ToUInt32BE(data, rawDataIndex + 24);
- unused6 = BitConverter::ToUInt32BE(data, rawDataIndex + 28);
- unused7 = BitConverter::ToUInt32BE(data, rawDataIndex + 32);
- unused8 = BitConverter::ToUInt32BE(data, rawDataIndex + 36);
- unused9 = BitConverter::ToUInt32BE(data, rawDataIndex + 40);
- unused10 = BitConverter::ToUInt32BE(data, rawDataIndex + 44);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
+ unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
+ unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
+ unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12);
+ unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 16);
+ unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 20);
+ unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 24);
+ unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 28);
+ unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 32);
+ unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 36);
+ unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 40);
+ unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 44);
}
CutsceneCommandSpecialAction::CutsceneCommandSpecialAction(const std::vector& rawData,
@@ -1194,9 +1186,9 @@ size_t CutsceneCommandSpecialAction::GetCommandSize()
CutsceneCommandNop::CutsceneCommandNop(const std::vector& rawData, uint32_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
- base = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 0);
- startFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
- endFrame = (uint16_t)BitConverter::ToInt16BE(rawData, rawDataIndex + 4);
+ base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
+ startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
+ endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
}
std::string CutsceneCommandNop::GetCName()
@@ -1215,9 +1207,9 @@ CutsceneCommandSceneTransFX::CutsceneCommandSceneTransFX(const std::vectorGetSourceOutputHeader("");
@@ -792,6 +797,8 @@ void ZFile::GenerateSourceHeaderFiles()
formatter.Write(ProcessExterns());
+ formatter.Write("#endif\n");
+
fs::path headerFilename = GetSourceOutputFolderPath() / outName.stem().concat(".h");
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO)
diff --git a/tools/ZAPD/ZAPD/ZFile.h b/tools/ZAPD/ZAPD/ZFile.h
index ac4062d5b1..365c7bbbb5 100644
--- a/tools/ZAPD/ZAPD/ZFile.h
+++ b/tools/ZAPD/ZAPD/ZFile.h
@@ -52,7 +52,7 @@ public:
void ExtractResources();
void BuildSourceFile();
void AddResource(ZResource* res);
- ZResource* FindResource(uint32_t rawDataIndex);
+ ZResource* FindResource(offset_t rawDataIndex);
std::vector GetResourcesOfType(ZResourceType resType);
Declaration* AddDeclaration(offset_t address, DeclarationAlignment alignment, size_t size,
diff --git a/tools/ZAPD/ZAPD/ZLimb.cpp b/tools/ZAPD/ZAPD/ZLimb.cpp
index 330fbaf7ce..034d0850bb 100644
--- a/tools/ZAPD/ZAPD/ZLimb.cpp
+++ b/tools/ZAPD/ZAPD/ZLimb.cpp
@@ -4,12 +4,15 @@
#include "Globals.h"
#include "Utils/BitConverter.h"
+#include "Utils/StringHelper.h"
#include "WarningHandler.h"
+#include "ZSkeleton.h"
REGISTER_ZFILENODE(Limb, ZLimb);
ZLimb::ZLimb(ZFile* nParent) : ZResource(nParent), segmentStruct(nParent)
{
+ RegisterOptionalAttribute("EnumName");
RegisterOptionalAttribute("LimbType");
RegisterOptionalAttribute("Type");
}
@@ -30,6 +33,12 @@ void ZLimb::ParseXML(tinyxml2::XMLElement* reader)
{
ZResource::ParseXML(reader);
+ auto& enumNameXml = registeredAttributes.at("EnumName").value;
+ if (enumNameXml != "")
+ {
+ enumName = enumNameXml;
+ }
+
// Reading from a
std::string limbType = registeredAttributes.at("LimbType").value;
if (limbType == "") // Reading from a
@@ -240,11 +249,24 @@ std::string ZLimb::GetBodySourceCode() const
}
else
{
+ std::string childStr;
+ std::string siblingStr;
+ if (limbsTable != nullptr)
+ {
+ childStr = limbsTable->GetLimbEnumName(childIndex);
+ siblingStr = limbsTable->GetLimbEnumName(siblingIndex);
+ }
+ else
+ {
+ childStr = StringHelper::Sprintf("0x%02X", childIndex);
+ siblingStr = StringHelper::Sprintf("0x%02X", siblingIndex);
+ }
+
if (type != ZLimbType::Curve)
{
entryStr += StringHelper::Sprintf("{ %i, %i, %i }, ", transX, transY, transZ);
}
- entryStr += StringHelper::Sprintf("0x%02X, 0x%02X,\n", childIndex, siblingIndex);
+ entryStr += StringHelper::Sprintf("%s, %s,\n", childStr.c_str(), siblingStr.c_str());
switch (type)
{
@@ -352,6 +374,11 @@ ZLimbType ZLimb::GetTypeByAttributeName(const std::string& attrName)
return ZLimbType::Invalid;
}
+void ZLimb::SetLimbIndex(uint8_t nLimbIndex)
+{
+ limbIndex = nLimbIndex;
+}
+
void ZLimb::DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix,
const std::string& limbSuffix)
{
diff --git a/tools/ZAPD/ZAPD/ZLimb.h b/tools/ZAPD/ZAPD/ZLimb.h
index 53a4143292..ce31e42958 100644
--- a/tools/ZAPD/ZAPD/ZLimb.h
+++ b/tools/ZAPD/ZAPD/ZLimb.h
@@ -18,9 +18,14 @@ enum class ZLimbType
Legacy,
};
+class ZLimbTable;
+
class ZLimb : public ZResource
{
public:
+ std::string enumName;
+ ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete!
+
ZLimbType type = ZLimbType::Standard;
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only
@@ -39,6 +44,8 @@ public:
int16_t transX, transY, transZ;
uint8_t childIndex, siblingIndex;
+ uint8_t limbIndex = 0;
+
ZLimb(ZFile* nParent);
void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nType);
@@ -59,6 +66,8 @@ public:
static const char* GetSourceTypeName(ZLimbType limbType);
static ZLimbType GetTypeByAttributeName(const std::string& attrName);
+ void SetLimbIndex(uint8_t nLimbIndex);
+
protected:
void DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix,
const std::string& limbSuffix);
diff --git a/tools/ZAPD/ZAPD/ZPointer.cpp b/tools/ZAPD/ZAPD/ZPointer.cpp
new file mode 100644
index 0000000000..6e6945cada
--- /dev/null
+++ b/tools/ZAPD/ZAPD/ZPointer.cpp
@@ -0,0 +1,57 @@
+#include "ZPointer.h"
+
+#include "Globals.h"
+#include "Utils/BitConverter.h"
+#include "Utils/StringHelper.h"
+#include "WarningHandler.h"
+#include "ZFile.h"
+
+REGISTER_ZFILENODE(Pointer, ZPointer);
+
+ZPointer::ZPointer(ZFile* nParent) : ZResource(nParent)
+{
+ RegisterRequiredAttribute("Type");
+}
+
+void ZPointer::ParseXML(tinyxml2::XMLElement* reader)
+{
+ ZResource::ParseXML(reader);
+
+ type = registeredAttributes.at("Type").value;
+}
+
+void ZPointer::ParseRawData()
+{
+ auto& rawData = parent->GetRawData();
+
+ ptr = BitConverter::ToUInt32BE(rawData, rawDataIndex);
+}
+
+std::string ZPointer::GetBodySourceCode() const
+{
+ std::string ptrName;
+
+ Globals::Instance->GetSegmentedPtrName(ptr, parent, "", ptrName);
+
+ return ptrName;
+}
+
+bool ZPointer::DoesSupportArray() const
+{
+ return true;
+}
+
+std::string ZPointer::GetSourceTypeName() const
+{
+ return type + "*";
+}
+
+ZResourceType ZPointer::GetResourceType() const
+{
+ return ZResourceType::Pointer;
+}
+
+size_t ZPointer::GetRawDataSize() const
+{
+ return 0x04;
+}
diff --git a/tools/ZAPD/ZAPD/ZPointer.h b/tools/ZAPD/ZAPD/ZPointer.h
new file mode 100644
index 0000000000..8fb5889339
--- /dev/null
+++ b/tools/ZAPD/ZAPD/ZPointer.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "ZResource.h"
+
+class ZPointer : public ZResource
+{
+public:
+ segptr_t ptr = SEGMENTED_NULL;
+ std::string type;
+
+ ZPointer(ZFile* nParent);
+
+ void ParseXML(tinyxml2::XMLElement* reader) override;
+ void ParseRawData() override;
+ std::string GetBodySourceCode() const override;
+
+ bool DoesSupportArray() const override;
+ std::string GetSourceTypeName() const override;
+ ZResourceType GetResourceType() const override;
+
+ size_t GetRawDataSize() const override;
+};
diff --git a/tools/ZAPD/ZAPD/ZResource.h b/tools/ZAPD/ZAPD/ZResource.h
index 4dad398955..c65c3c31b4 100644
--- a/tools/ZAPD/ZAPD/ZResource.h
+++ b/tools/ZAPD/ZAPD/ZResource.h
@@ -38,6 +38,7 @@ enum class ZResourceType
Mtx,
Path,
PlayerAnimationData,
+ Pointer,
Room,
RoomCommand,
Scalar,
diff --git a/tools/ZAPD/ZAPD/ZSkeleton.cpp b/tools/ZAPD/ZAPD/ZSkeleton.cpp
index 4467c96320..ff43331299 100644
--- a/tools/ZAPD/ZAPD/ZSkeleton.cpp
+++ b/tools/ZAPD/ZAPD/ZSkeleton.cpp
@@ -10,10 +10,13 @@
REGISTER_ZFILENODE(Skeleton, ZSkeleton);
REGISTER_ZFILENODE(LimbTable, ZLimbTable);
-ZSkeleton::ZSkeleton(ZFile* nParent) : ZResource(nParent), limbsTable(nParent)
+ZSkeleton::ZSkeleton(ZFile* nParent) : ZResource(nParent)
{
RegisterRequiredAttribute("Type");
RegisterRequiredAttribute("LimbType");
+ RegisterOptionalAttribute("EnumName");
+ RegisterOptionalAttribute("LimbNone");
+ RegisterOptionalAttribute("LimbMax");
}
void ZSkeleton::ParseXML(tinyxml2::XMLElement* reader)
@@ -42,6 +45,41 @@ void ZSkeleton::ParseXML(tinyxml2::XMLElement* reader)
limbTypeXml.c_str()),
"Defaulting to 'Standard'.");
}
+
+ enumName = registeredAttributes.at("EnumName").value;
+ limbNoneName = registeredAttributes.at("LimbNone").value;
+ limbMaxName = registeredAttributes.at("LimbMax").value;
+
+ if (enumName != "")
+ {
+ if (limbNoneName == "" || limbMaxName == "")
+ {
+ HANDLE_ERROR_RESOURCE(WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'EnumName' attribute was used but either 'LimbNone' or "
+ "'LimbMax' attribute is missing",
+ "");
+ }
+ }
+
+ if (limbNoneName != "")
+ {
+ if (limbMaxName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'LimbNone' attribute was used but 'LimbMax' attribute is missing", "");
+ }
+ }
+
+ if (limbMaxName != "")
+ {
+ if (limbNoneName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'LimbMax' attribute was used but 'LimbNone' attribute is missing", "");
+ }
+ }
}
void ZSkeleton::ParseRawData()
@@ -56,12 +94,6 @@ void ZSkeleton::ParseRawData()
{
dListCount = BitConverter::ToUInt8BE(rawData, rawDataIndex + 8);
}
-
- if (limbsArrayAddress != 0 && GETSEGNUM(limbsArrayAddress) == parent->segment)
- {
- uint32_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress);
- limbsTable.ExtractFromBinary(ptr, limbType, limbCount);
- }
}
void ZSkeleton::DeclareReferences(const std::string& prefix)
@@ -72,14 +104,33 @@ void ZSkeleton::DeclareReferences(const std::string& prefix)
ZResource::DeclareReferences(defaultPrefix);
- if (limbsArrayAddress != 0 && GETSEGNUM(limbsArrayAddress) == parent->segment)
+ if (limbsArrayAddress != SEGMENTED_NULL && GETSEGNUM(limbsArrayAddress) == parent->segment)
{
- uint32_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress);
+ offset_t ptr = Seg2Filespace(limbsArrayAddress, parent->baseAddress);
+
if (!parent->HasDeclaration(ptr))
{
- limbsTable.SetName(StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str()));
- limbsTable.DeclareReferences(prefix);
- limbsTable.GetSourceOutputCode(prefix);
+ limbsTable = new ZLimbTable(parent);
+ limbsTable->ExtractFromBinary(ptr, limbType, limbCount);
+ limbsTable->SetName(StringHelper::Sprintf("%sLimbs", defaultPrefix.c_str()));
+ parent->AddResource(limbsTable);
+ }
+ else
+ {
+ limbsTable = static_cast(parent->FindResource(ptr));
+ }
+
+ if (limbsTable->enumName == "")
+ {
+ limbsTable->enumName = enumName;
+ }
+ if (limbsTable->limbNoneName == "")
+ {
+ limbsTable->limbNoneName = limbNoneName;
+ }
+ if (limbsTable->limbMaxName == "")
+ {
+ limbsTable->limbMaxName = limbMaxName;
}
}
}
@@ -89,14 +140,26 @@ std::string ZSkeleton::GetBodySourceCode() const
std::string limbArrayName;
Globals::Instance->GetSegmentedPtrName(limbsArrayAddress, parent, "", limbArrayName);
+ std::string countStr;
+ assert(limbsTable != nullptr);
+ // There are some Skeletons with the wrong limb count on them, so this check is necessary.
+ if (limbsTable->count == limbCount)
+ {
+ countStr = StringHelper::Sprintf("ARRAY_COUNT(%s)", limbArrayName.c_str());
+ }
+ else
+ {
+ countStr = StringHelper::Sprintf("%i", limbCount);
+ }
+
switch (type)
{
case ZSkeletonType::Normal:
case ZSkeletonType::Curve:
- return StringHelper::Sprintf("\n\t%s, %i\n", limbArrayName.c_str(), limbCount);
+ return StringHelper::Sprintf("\n\t%s, %s\n", limbArrayName.c_str(), countStr.c_str());
case ZSkeletonType::Flex:
- return StringHelper::Sprintf("\n\t{ %s, %i }, %i\n", limbArrayName.c_str(), limbCount,
+ return StringHelper::Sprintf("\n\t{ %s, %s }, %i\n", limbArrayName.c_str(), countStr.c_str(),
dListCount);
}
@@ -153,6 +216,9 @@ ZLimbTable::ZLimbTable(ZFile* nParent) : ZResource(nParent)
{
RegisterRequiredAttribute("LimbType");
RegisterRequiredAttribute("Count");
+ RegisterOptionalAttribute("EnumName");
+ RegisterOptionalAttribute("LimbNone");
+ RegisterOptionalAttribute("LimbMax");
}
void ZLimbTable::ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount)
@@ -179,6 +245,40 @@ void ZLimbTable::ParseXML(tinyxml2::XMLElement* reader)
}
count = StringHelper::StrToL(registeredAttributes.at("Count").value);
+
+ enumName = registeredAttributes.at("EnumName").value;
+ limbNoneName = registeredAttributes.at("LimbNone").value;
+ limbMaxName = registeredAttributes.at("LimbMax").value;
+
+ if (enumName != "")
+ {
+ if (limbNoneName == "" || limbMaxName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'EnumName' attribute was used but 'LimbNone'/'LimbMax' attributes is missing", "");
+ }
+ }
+
+ if (limbNoneName != "")
+ {
+ if (limbMaxName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'LimbNone' attribute was used but 'LimbMax' attribute is missing", "");
+ }
+ }
+
+ if (limbMaxName != "")
+ {
+ if (limbNoneName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "'LimbMax' attribute was used but 'LimbNone' attribute is missing", "");
+ }
+ }
}
void ZLimbTable::ParseRawData()
@@ -209,15 +309,28 @@ void ZLimbTable::DeclareReferences(const std::string& prefix)
if (limbAddress != 0 && GETSEGNUM(limbAddress) == parent->segment)
{
uint32_t limbOffset = Seg2Filespace(limbAddress, parent->baseAddress);
+ ZLimb* limb;
+
if (!parent->HasDeclaration(limbOffset))
{
- ZLimb* limb = new ZLimb(parent);
+ limb = new ZLimb(parent);
limb->ExtractFromBinary(limbOffset, limbType);
limb->SetName(limb->GetDefaultName(varPrefix));
limb->DeclareVar(varPrefix, "");
limb->DeclareReferences(varPrefix);
parent->AddResource(limb);
}
+ else
+ {
+ limb = static_cast(parent->FindResource(limbOffset));
+ assert(limb != nullptr);
+ assert(limb->GetResourceType() == ZResourceType::Limb);
+ }
+
+ limb->limbsTable = this;
+ limb->SetLimbIndex(i + 1);
+
+ limbsReferences.push_back(limb);
}
}
}
@@ -246,6 +359,13 @@ std::string ZLimbTable::GetBodySourceCode() const
Globals::Instance->GetSegmentedPtrName(limbsAddresses[i], parent, "", limbName);
body += StringHelper::Sprintf("\t%s,", limbName.c_str());
+ auto& limb = limbsReferences.at(i);
+ std::string limbEnumName = limb->enumName;
+ if (limbEnumName != "")
+ {
+ body += StringHelper::Sprintf(" /* %s */", limbEnumName.c_str());
+ }
+
if (i + 1 < count)
body += "\n";
}
@@ -253,6 +373,46 @@ std::string ZLimbTable::GetBodySourceCode() const
return body;
}
+std::string ZLimbTable::GetSourceOutputHeader([[maybe_unused]] const std::string& prefix)
+{
+ if (limbNoneName == "" || limbMaxName == "" || enumName == "")
+ {
+ // Don't produce a enum of any of those attributes is missing
+ return "";
+ }
+
+ std::string limbEnum = StringHelper::Sprintf("typedef enum %s {\n", enumName.c_str());
+
+ // This assumes there isn't any skeleton with more than 0x100 limbs
+
+ limbEnum += StringHelper::Sprintf(" /* 0x00 */ %s,\n", limbNoneName.c_str());
+
+ size_t i = 0;
+ for (; i < count; i++)
+ {
+ auto& limb = limbsReferences.at(i);
+ std::string limbEnumName = limb->enumName;
+
+ if (limbEnumName == "")
+ {
+ HANDLE_ERROR_RESOURCE(
+ WarningType::MissingAttribute, parent, this, rawDataIndex,
+ "Skeleton's enum attributes were used but at least one limb is missing its "
+ "'LimbName' attribute",
+ StringHelper::Sprintf("When processing limb %02i, named '%s' at offset '0x%X'",
+ i + 1, limb->GetName().c_str(), limb->GetRawDataIndex()));
+ }
+
+ limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s,\n", i + 1, limbEnumName.c_str());
+ }
+
+ limbEnum += StringHelper::Sprintf(" /* 0x%02X */ %s\n", i + 1, limbMaxName.c_str());
+
+ limbEnum += StringHelper::Sprintf("} %s;\n", enumName.c_str());
+
+ return limbEnum;
+}
+
std::string ZLimbTable::GetSourceTypeName() const
{
switch (limbType)
@@ -283,3 +443,28 @@ size_t ZLimbTable::GetRawDataSize() const
{
return 4 * limbsAddresses.size();
}
+
+std::string ZLimbTable::GetLimbEnumName(uint8_t limbIndex) const
+{
+ if (limbIndex == 0xFF)
+ {
+ return "LIMB_DONE";
+ }
+
+ if (limbIndex < count)
+ {
+ std::string limbEnumName = limbsReferences.at(limbIndex)->enumName;
+ if (limbEnumName != "")
+ {
+ return StringHelper::Sprintf("%s - 1", limbEnumName.c_str());
+ }
+ }
+ else
+ {
+ HANDLE_WARNING_RESOURCE(WarningType::InvalidExtractedData, parent, this, rawDataIndex,
+ StringHelper::Sprintf("Limb index '%02i' out of range", limbIndex),
+ "");
+ }
+
+ return StringHelper::Sprintf("0x%02X", limbIndex);
+}
diff --git a/tools/ZAPD/ZAPD/ZSkeleton.h b/tools/ZAPD/ZAPD/ZSkeleton.h
index ed003ceafd..c437a8484c 100644
--- a/tools/ZAPD/ZAPD/ZSkeleton.h
+++ b/tools/ZAPD/ZAPD/ZSkeleton.h
@@ -18,6 +18,17 @@ enum class ZSkeletonType
class ZLimbTable : public ZResource
{
public:
+ ZLimbType limbType = ZLimbType::Standard;
+ size_t count = 0;
+
+ std::vector limbsAddresses;
+ std::vector limbsReferences; // borrowed pointers, do not delete!
+
+ // XML attributes
+ std::string enumName;
+ std::string limbNoneName;
+ std::string limbMaxName;
+
ZLimbTable(ZFile* nParent);
void ExtractFromBinary(uint32_t nRawDataIndex, ZLimbType nLimbType, size_t nCount);
@@ -30,16 +41,14 @@ public:
std::string GetBodySourceCode() const override;
+ std::string GetSourceOutputHeader(const std::string& prefix) override;
+
std::string GetSourceTypeName() const override;
ZResourceType GetResourceType() const override;
size_t GetRawDataSize() const override;
-protected:
- ZLimbType limbType = ZLimbType::Standard;
- size_t count = 0;
-
- std::vector limbsAddresses;
+ std::string GetLimbEnumName(uint8_t limbIndex) const;
};
class ZSkeleton : public ZResource
@@ -47,6 +56,10 @@ class ZSkeleton : public ZResource
public:
ZSkeletonType type = ZSkeletonType::Normal;
ZLimbType limbType = ZLimbType::Standard;
+ std::string enumName;
+ std::string limbNoneName;
+ std::string limbMaxName;
+
segptr_t limbsArrayAddress;
uint8_t limbCount = 0;
uint8_t dListCount = 0; // FLEX SKELETON ONLY
@@ -68,5 +81,5 @@ public:
uint8_t GetLimbCount();
protected:
- ZLimbTable limbsTable;
+ ZLimbTable* limbsTable = nullptr; // borrowed pointer, do not delete!
};
diff --git a/tools/ZAPD/ZAPD/ZTexture.cpp b/tools/ZAPD/ZAPD/ZTexture.cpp
index 7bd31438b4..a9cb539413 100644
--- a/tools/ZAPD/ZAPD/ZTexture.cpp
+++ b/tools/ZAPD/ZAPD/ZTexture.cpp
@@ -16,6 +16,7 @@ ZTexture::ZTexture(ZFile* nParent) : ZResource(nParent)
{
width = 0;
height = 0;
+ dWordAligned = true;
RegisterRequiredAttribute("Width");
RegisterRequiredAttribute("Height");
@@ -105,10 +106,7 @@ void ZTexture::ParseXML(tinyxml2::XMLElement* reader)
void ZTexture::ParseRawData()
{
if (rawDataIndex % 8 != 0)
- {
- HANDLE_WARNING_RESOURCE(WarningType::NotImplemented, parent, this, rawDataIndex,
- "this texture is not 64-bit aligned", "");
- }
+ dWordAligned = false;
switch (format)
{
@@ -352,34 +350,42 @@ void ZTexture::DeclareReferences([[maybe_unused]] const std::string& prefix)
void ZTexture::PrepareRawDataFromFile(const fs::path& pngFilePath)
{
+ textureData.ReadPng(pngFilePath);
+
+ width = textureData.GetWidth();
+ height = textureData.GetHeight();
+
+ textureDataRaw.clear();
+ textureDataRaw.resize(ALIGN8(GetRawDataSize()));
+
switch (format)
{
case TextureType::RGBA16bpp:
- PrepareRawDataRGBA16(pngFilePath);
+ PrepareRawDataRGBA16();
break;
case TextureType::RGBA32bpp:
- PrepareRawDataRGBA32(pngFilePath);
+ PrepareRawDataRGBA32();
break;
case TextureType::Grayscale4bpp:
- PrepareRawDataGrayscale4(pngFilePath);
+ PrepareRawDataGrayscale4();
break;
case TextureType::Grayscale8bpp:
- PrepareRawDataGrayscale8(pngFilePath);
+ PrepareRawDataGrayscale8();
break;
case TextureType::GrayscaleAlpha4bpp:
- PrepareRawDataGrayscaleAlpha4(pngFilePath);
+ PrepareRawDataGrayscaleAlpha4();
break;
case TextureType::GrayscaleAlpha8bpp:
- PrepareRawDataGrayscaleAlpha8(pngFilePath);
+ PrepareRawDataGrayscaleAlpha8();
break;
case TextureType::GrayscaleAlpha16bpp:
- PrepareRawDataGrayscaleAlpha16(pngFilePath);
+ PrepareRawDataGrayscaleAlpha16();
break;
case TextureType::Palette4bpp:
- PrepareRawDataPalette4(pngFilePath);
+ PrepareRawDataPalette4();
break;
case TextureType::Palette8bpp:
- PrepareRawDataPalette8(pngFilePath);
+ PrepareRawDataPalette8();
break;
case TextureType::Error:
HANDLE_ERROR_PROCESS(WarningType::InvalidPNG, "Input PNG file has invalid format type", "");
@@ -387,15 +393,8 @@ void ZTexture::PrepareRawDataFromFile(const fs::path& pngFilePath)
}
}
-void ZTexture::PrepareRawDataRGBA16(const fs::path& rgbaPath)
+void ZTexture::PrepareRawDataRGBA16()
{
- textureData.ReadPng(rgbaPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -417,15 +416,8 @@ void ZTexture::PrepareRawDataRGBA16(const fs::path& rgbaPath)
}
}
-void ZTexture::PrepareRawDataRGBA32(const fs::path& rgbaPath)
+void ZTexture::PrepareRawDataRGBA32()
{
- textureData.ReadPng(rgbaPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -441,15 +433,8 @@ void ZTexture::PrepareRawDataRGBA32(const fs::path& rgbaPath)
}
}
-void ZTexture::PrepareRawDataGrayscale4(const fs::path& grayPath)
+void ZTexture::PrepareRawDataGrayscale4()
{
- textureData.ReadPng(grayPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x += 2)
@@ -463,15 +448,8 @@ void ZTexture::PrepareRawDataGrayscale4(const fs::path& grayPath)
}
}
-void ZTexture::PrepareRawDataGrayscale8(const fs::path& grayPath)
+void ZTexture::PrepareRawDataGrayscale8()
{
- textureData.ReadPng(grayPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -483,15 +461,8 @@ void ZTexture::PrepareRawDataGrayscale8(const fs::path& grayPath)
}
}
-void ZTexture::PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath)
+void ZTexture::PrepareRawDataGrayscaleAlpha4()
{
- textureData.ReadPng(grayAlphaPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x += 2)
@@ -516,15 +487,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath)
}
}
-void ZTexture::PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath)
+void ZTexture::PrepareRawDataGrayscaleAlpha8()
{
- textureData.ReadPng(grayAlphaPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -540,15 +504,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath)
}
}
-void ZTexture::PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath)
+void ZTexture::PrepareRawDataGrayscaleAlpha16()
{
- textureData.ReadPng(grayAlphaPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -565,15 +522,8 @@ void ZTexture::PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath)
}
}
-void ZTexture::PrepareRawDataPalette4(const fs::path& palPath)
+void ZTexture::PrepareRawDataPalette4()
{
- textureData.ReadPng(palPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x += 2)
@@ -588,15 +538,8 @@ void ZTexture::PrepareRawDataPalette4(const fs::path& palPath)
}
}
-void ZTexture::PrepareRawDataPalette8(const fs::path& palPath)
+void ZTexture::PrepareRawDataPalette8()
{
- textureData.ReadPng(palPath);
-
- width = textureData.GetWidth();
- height = textureData.GetHeight();
-
- textureDataRaw.clear();
- textureDataRaw.resize(GetRawDataSize());
for (uint16_t y = 0; y < height; y++)
{
for (uint16_t x = 0; x < width; x++)
@@ -724,7 +667,12 @@ void ZTexture::Save(const fs::path& outFolder)
if (!Directory::Exists(outPath.string()))
Directory::CreateDirectory(outPath.string());
- auto outFileName = outPath / (outName + "." + GetExternalExtension() + ".png");
+ fs::path outFileName;
+
+ if (!dWordAligned)
+ outFileName = outPath / (outName + ".u32" + "." + GetExternalExtension() + ".png");
+ else
+ outFileName = outPath / (outName + +"." + GetExternalExtension() + ".png");
#ifdef TEXTURE_DEBUG
printf("Saving PNG: %s\n", outFileName.c_str());
@@ -745,7 +693,7 @@ Declaration* ZTexture::DeclareVar(const std::string& prefix,
{
std::string auxName = name;
std::string auxOutName = outName;
-
+ std::string incStr;
if (auxName == "")
auxName = GetDefaultName(prefix);
@@ -754,8 +702,12 @@ Declaration* ZTexture::DeclareVar(const std::string& prefix,
auto filepath = Globals::Instance->outputPath / fs::path(auxOutName).stem();
- std::string incStr =
- StringHelper::Sprintf("%s.%s.inc.c", filepath.c_str(), GetExternalExtension().c_str());
+ if (dWordAligned)
+ incStr =
+ StringHelper::Sprintf("%s.%s.inc.c", filepath.c_str(), GetExternalExtension().c_str());
+ else
+ incStr = StringHelper::Sprintf("%s.u32.%s.inc.c", filepath.c_str(),
+ GetExternalExtension().c_str());
if (!Globals::Instance->cfg.texturePool.empty())
{
@@ -765,13 +717,19 @@ Declaration* ZTexture::DeclareVar(const std::string& prefix,
const auto& poolEntry = Globals::Instance->cfg.texturePool.find(hash);
if (poolEntry != Globals::Instance->cfg.texturePool.end())
{
- incStr = StringHelper::Sprintf("%s.%s.inc.c", poolEntry->second.path.c_str(),
- GetExternalExtension().c_str());
+ if (dWordAligned)
+ incStr = StringHelper::Sprintf("%s.%s.inc.c", poolEntry->second.path.c_str(),
+ GetExternalExtension().c_str());
+ else
+ incStr = StringHelper::Sprintf("%s.u32.%s.inc.c", poolEntry->second.path.c_str(),
+ GetExternalExtension().c_str());
}
}
+ size_t texSizeDivisor = (dWordAligned) ? 8 : 4;
- Declaration* decl = parent->AddDeclarationIncludeArray(
- rawDataIndex, incStr, GetRawDataSize(), GetSourceTypeName(), auxName, GetRawDataSize() / 8);
+ Declaration* decl = parent->AddDeclarationIncludeArray(rawDataIndex, incStr, GetRawDataSize(),
+ GetSourceTypeName(), auxName,
+ GetRawDataSize() / texSizeDivisor);
decl->staticConf = staticConf;
return decl;
}
@@ -779,15 +737,17 @@ Declaration* ZTexture::DeclareVar(const std::string& prefix,
std::string ZTexture::GetBodySourceCode() const
{
std::string sourceOutput;
-
- for (size_t i = 0; i < textureDataRaw.size(); i += 8)
+ size_t texSizeInc = (dWordAligned) ? 8 : 4;
+ for (size_t i = 0; i < textureDataRaw.size(); i += texSizeInc)
{
if (i % 32 == 0)
sourceOutput += " ";
-
- sourceOutput +=
- StringHelper::Sprintf("0x%016llX, ", BitConverter::ToUInt64BE(textureDataRaw, i));
-
+ if (dWordAligned)
+ sourceOutput +=
+ StringHelper::Sprintf("0x%016llX, ", BitConverter::ToUInt64BE(textureDataRaw, i));
+ else
+ sourceOutput +=
+ StringHelper::Sprintf("0x%08llX, ", BitConverter::ToUInt32BE(textureDataRaw, i));
if (i % 32 == 24)
sourceOutput += StringHelper::Sprintf(" // 0x%06X \n", rawDataIndex + ((i / 32) * 32));
}
@@ -812,7 +772,7 @@ ZResourceType ZTexture::GetResourceType() const
std::string ZTexture::GetSourceTypeName() const
{
- return "u64";
+ return dWordAligned ? "u64" : "u32";
}
void ZTexture::CalcHash()
diff --git a/tools/ZAPD/ZAPD/ZTexture.h b/tools/ZAPD/ZAPD/ZTexture.h
index ef67c3f6ef..6f2c499359 100644
--- a/tools/ZAPD/ZAPD/ZTexture.h
+++ b/tools/ZAPD/ZAPD/ZTexture.h
@@ -40,20 +40,21 @@ protected:
void PrepareBitmapPalette8();
void PrepareRawDataFromFile(const fs::path& inFolder);
- void PrepareRawDataRGBA16(const fs::path& rgbaPath);
- void PrepareRawDataRGBA32(const fs::path& rgbaPath);
- void PrepareRawDataGrayscale4(const fs::path& grayPath);
- void PrepareRawDataGrayscale8(const fs::path& grayPath);
- void PrepareRawDataGrayscaleAlpha4(const fs::path& grayAlphaPath);
- void PrepareRawDataGrayscaleAlpha8(const fs::path& grayAlphaPath);
- void PrepareRawDataGrayscaleAlpha16(const fs::path& grayAlphaPath);
- void PrepareRawDataPalette4(const fs::path& palPath);
- void PrepareRawDataPalette8(const fs::path& palPath);
+ void PrepareRawDataRGBA16();
+ void PrepareRawDataRGBA32();
+ void PrepareRawDataGrayscale4();
+ void PrepareRawDataGrayscale8();
+ void PrepareRawDataGrayscaleAlpha4();
+ void PrepareRawDataGrayscaleAlpha8();
+ void PrepareRawDataGrayscaleAlpha16();
+ void PrepareRawDataPalette4();
+ void PrepareRawDataPalette8();
public:
ZTexture(ZFile* nParent);
bool isPalette = false;
+ bool dWordAligned = true;
void ExtractFromBinary(uint32_t nRawDataIndex, int32_t nWidth, int32_t nHeight,
TextureType nType, bool nIsPalette);
diff --git a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h b/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h
index e672b97c23..98c46bc790 100644
--- a/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h
+++ b/tools/ZAPD/ZAPDUtils/Utils/BitConverter.h
@@ -1,155 +1,155 @@
#pragma once
+#include
#include
+#include
#include
#include
+#define ALIGN8(val) (((val) + 7) & ~7)
+#define ALIGN16(val) (((val) + 0xF) & ~0xF)
+#define ALIGN64(val) (((val) + 0x3F) & ~0x3F)
+
class BitConverter
{
public:
- static inline int8_t ToInt8BE(const uint8_t* data, int32_t offset)
+ static inline int8_t ToInt8BE(const std::vector& data, size_t offset)
{
- return (uint8_t)data[offset + 0];
+ if (offset + 0 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return (int8_t)data.at(offset + 0);
}
- static inline int8_t ToInt8BE(const std::vector& data, int32_t offset)
+ static inline uint8_t ToUInt8BE(const std::vector& data, size_t offset)
{
- return (uint8_t)data[offset + 0];
+ if (offset + 0 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying an out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return (uint8_t)data.at(offset + 0);
}
- static inline uint8_t ToUInt8BE(const uint8_t* data, int32_t offset)
+ static inline int16_t ToInt16BE(const std::vector& data, size_t offset)
{
- return (uint8_t)data[offset + 0];
+ if (offset + 1 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1);
}
- static inline uint8_t ToUInt8BE(const std::vector& data, int32_t offset)
+ static inline uint16_t ToUInt16BE(const std::vector& data, size_t offset)
{
- return (uint8_t)data[offset + 0];
+ if (offset + 1 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint16_t)data.at(offset + 0) << 8) + (uint16_t)data.at(offset + 1);
}
- static inline int16_t ToInt16BE(const uint8_t* data, int32_t offset)
+ static inline int32_t ToInt32BE(const std::vector& data, size_t offset)
{
- return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
+ if (offset + 3 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) +
+ ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3);
}
- static inline int16_t ToInt16BE(const std::vector& data, int32_t offset)
+ static inline uint32_t ToUInt32BE(const std::vector& data, size_t offset)
{
- return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
+ if (offset + 3 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint32_t)data.at(offset + 0) << 24) + ((uint32_t)data.at(offset + 1) << 16) +
+ ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3);
}
- static inline uint16_t ToUInt16BE(const uint8_t* data, int32_t offset)
+ static inline int64_t ToInt64BE(const std::vector& data, size_t offset)
{
- return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
+ if (offset + 7 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) +
+ ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) +
+ ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) +
+ ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7));
}
- static inline uint16_t ToUInt16BE(const std::vector& data, int32_t offset)
+ static inline uint64_t ToUInt64BE(const std::vector& data, size_t offset)
{
- return ((uint16_t)data[offset + 0] << 8) + (uint16_t)data[offset + 1];
+ if (offset + 7 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
+ return ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) +
+ ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) +
+ ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) +
+ ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7));
}
- static inline int32_t ToInt32BE(const uint8_t* data, int32_t offset)
- {
- return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
- }
-
- static inline int32_t ToInt32BE(const std::vector& data, int32_t offset)
- {
- return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
- }
-
- static inline uint32_t ToUInt32BE(const uint8_t* data, int32_t offset)
- {
- return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
- }
-
- static inline uint32_t ToUInt32BE(const std::vector& data, int32_t offset)
- {
- return ((uint32_t)data[offset + 0] << 24) + ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
- }
-
- static inline int64_t ToInt64BE(const uint8_t* data, int32_t offset)
- {
- return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
- }
-
- static inline int64_t ToInt64BE(const std::vector& data, int32_t offset)
- {
- return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
- }
-
- static inline uint64_t ToUInt64BE(const uint8_t* data, int32_t offset)
- {
- return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
- }
-
- static inline uint64_t ToUInt64BE(const std::vector& data, int32_t offset)
- {
- return ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
- }
-
- static inline float ToFloatBE(const uint8_t* data, int32_t offset)
+ static inline float ToFloatBE(const std::vector& data, size_t offset)
{
+ if (offset + 3 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
float value;
- uint32_t floatData = ((uint32_t)data[offset + 0] << 24) +
- ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
+ uint32_t floatData = ((uint32_t)data.at(offset + 0) << 24) +
+ ((uint32_t)data.at(offset + 1) << 16) +
+ ((uint32_t)data.at(offset + 2) << 8) + (uint32_t)data.at(offset + 3);
static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float");
std::memcpy(&value, &floatData, sizeof(value));
return value;
}
- static inline float ToFloatBE(const std::vector& data, int32_t offset)
- {
- float value;
- uint32_t floatData = ((uint32_t)data[offset + 0] << 24) +
- ((uint32_t)data[offset + 1] << 16) +
- ((uint32_t)data[offset + 2] << 8) + (uint32_t)data[offset + 3];
- static_assert(sizeof(uint32_t) == sizeof(float), "expected 32-bit float");
- std::memcpy(&value, &floatData, sizeof(value));
- return value;
- }
-
- static inline double ToDoubleBE(const uint8_t* data, int32_t offset)
+ static inline double ToDoubleBE(const std::vector& data, size_t offset)
{
+ if (offset + 7 > data.size())
+ {
+ fprintf(stderr, "%s\n", __PRETTY_FUNCTION__);
+ fprintf(stderr, "Error: Trying a out-of-bounds reading from a data buffer\n");
+ fprintf(stderr, "\t Buffer size: 0x%zX\n", data.size());
+ fprintf(stderr, "\t Trying to read at offset: 0x%zX\n", offset);
+ }
double value;
uint64_t floatData =
- ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
- static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double");
- // Checks if the float format on the platform the ZAPD binary is running on supports the
- // same float format as the object file.
- static_assert(std::numeric_limits::is_iec559,
- "expected IEC559 floats on host machine");
- std::memcpy(&value, &floatData, sizeof(value));
- return value;
- }
-
- static inline double ToDoubleBE(const std::vector& data, int32_t offset)
- {
- double value;
- uint64_t floatData =
- ((uint64_t)data[offset + 0] << 56) + ((uint64_t)data[offset + 1] << 48) +
- ((uint64_t)data[offset + 2] << 40) + ((uint64_t)data[offset + 3] << 32) +
- ((uint64_t)data[offset + 4] << 24) + ((uint64_t)data[offset + 5] << 16) +
- ((uint64_t)data[offset + 6] << 8) + ((uint64_t)data[offset + 7]);
+ ((uint64_t)data.at(offset + 0) << 56) + ((uint64_t)data.at(offset + 1) << 48) +
+ ((uint64_t)data.at(offset + 2) << 40) + ((uint64_t)data.at(offset + 3) << 32) +
+ ((uint64_t)data.at(offset + 4) << 24) + ((uint64_t)data.at(offset + 5) << 16) +
+ ((uint64_t)data.at(offset + 6) << 8) + ((uint64_t)data.at(offset + 7));
static_assert(sizeof(uint64_t) == sizeof(double), "expected 64-bit double");
// Checks if the float format on the platform the ZAPD binary is running on supports the
// same float format as the object file.
diff --git a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h b/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h
index 6c9e541190..2289927d86 100644
--- a/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h
+++ b/tools/ZAPD/ZAPDUtils/Utils/StringHelper.h
@@ -106,6 +106,13 @@ public:
return std::all_of(str.begin(), str.end(), ::isdigit);
}
+ static std::string ToUpper(const std::string& str)
+ {
+ std::string buff = str;
+ std::transform(buff.begin(), buff.end(), buff.begin(), ::toupper);
+ return buff;
+ }
+
static bool IEquals(const std::string& a, const std::string& b)
{
return std::equal(a.begin(), a.end(), b.begin(), b.end(),
diff --git a/tools/ZAPD/docs/zapd_extraction_xml_reference.md b/tools/ZAPD/docs/zapd_extraction_xml_reference.md
index 06b95bb575..89ce33a6e1 100644
--- a/tools/ZAPD/docs/zapd_extraction_xml_reference.md
+++ b/tools/ZAPD/docs/zapd_extraction_xml_reference.md
@@ -9,6 +9,7 @@ This document aims to be a small reference of how to create a compatible xml fil
- [Basic XML](#basic-xml)
- [Resources types](#resources-types)
- [File](#file)
+ - [ExternalFile](#externalfile)
- [Texture](#texture)
- [Background](#background)
- [Blob](#blob)
@@ -33,6 +34,7 @@ This document aims to be a small reference of how to create a compatible xml fil
- [Array](#array)
- [Path](#path)
- [PlayerAnimationData](#playeranimationdata)
+ - [Pointer](#pointer)
## Basic XML
@@ -380,6 +382,13 @@ Useful only for the unused `object_human`'s animation data.
- `Name`: Required. Suxffixed by `Skel`.
- `Type`: Required. Valid values: `Normal`, `Flex` and `Curve`.
- `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`.
+ - `EnumName`: Optional. The name of `typedef`'d limb enum.
+ - `LimbNone`: Optional. The name of the limb with index zero in the limb enum.
+ - `LimbMax`: Optional. The name of the max limb index in the limb enum.
+
+ZAPD is able to generate a limb enum by itself only if all the required data is provided. Providing some but not all the required data would trigger an error and the execution will halt.
+
+The required data is providing the `EnumName`, `LimbNone` and `LimbMax` attributes in the `Skeleton` or `LimbTable` node and the `EnumName` attribute in every `Limb` of this skeleton.
※ There are no restrictions in the `Type` and `LimbType` attributes besides the valid values, so any skeleton type can be combined with any limb type.
@@ -398,6 +407,11 @@ Useful only for the unused `object_human`'s animation data.
- `Name`: Required. Suxffixed by `Skel`.
- `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`.
- `Count`: Required. Amount of limbs. Integer.
+ - `EnumName`: Optional. The name of `typedef`'d limb enum.
+ - `LimbNone`: Optional. The name of the limb with index zero in the limb enum.
+ - `LimbMax`: Optional. The name of the max limb index in the limb enum.
+
+See [Skeleton](#skeleton) for info on the limb enum generation.
-------------------------
@@ -413,6 +427,9 @@ Useful only for the unused `object_human`'s animation data.
- `Name`: Required. Suxffixed by `Limb`.
- `LimbType`: Required. Valid values: `Standard`, `LOD`, `Skin`, `Curve` and `Legacy`.
+ - `EnumName`: Optional. The name used for this limb in the limbs enum. It must be either present in every limb or in none.
+
+See [Skeleton](#skeleton) for info on the limb enum generation.
-------------------------
@@ -589,7 +606,7 @@ Vec3s D_04002040[24] = {
The `Array` element is special, because it needs an inner element to work. It will declare an array of its inner element.
-Currently, only [`Scalar`](#scalar), [`Vector`](#vector) and [`Vtx`](#vtx) support being wrapped in an array.
+Currently, only [`Pointer`](#pointer), [`Scalar`](#scalar), [`Vector`](#vector) and [`Vtx`](#vtx) support being wrapped in an array.
- Example:
@@ -637,3 +654,24 @@ Allows the extraction of the specific data of the player animations which are fo
- `FrameCount`: Required. The length of the animation in frames. It must be a positive integer.
-------------------------
+
+### Pointer
+
+Allows the extraction of a variable that contains a pointer
+
+- Example:
+
+```xml
+
+
+
+```
+
+- Attributes:
+
+ - `Name`: Required.
+ - `Type`: Required. The type of the extracted pointer.
+
+※ Can be wrapped in an [`Array`](#array) tag.
+
+-------------------------
diff --git a/tools/ZAPDConfigs/MM/ObjectList_MM.txt b/tools/ZAPDConfigs/MM/ObjectList_MM.txt
index 5d8968d973..c3848574c5 100644
--- a/tools/ZAPDConfigs/MM/ObjectList_MM.txt
+++ b/tools/ZAPDConfigs/MM/ObjectList_MM.txt
@@ -394,7 +394,7 @@ OBJECT_FALL
OBJECT_HANAREYAMA_OBJ
OBJECT_CRACE_OBJECT
OBJECT_DNQ
-OBJECT_OBJECT_UNSET_TOKEIDAI
+OBJECT_OBJ_TOKEIDAI
OBJECT_EG
OBJECT_TRU
OBJECT_TRT
@@ -534,13 +534,13 @@ OBJECT_MASK_KYOJIN
OBJECT_GI_RESERVE_C_01
OBJECT_ZOD
OBJECT_KUMO30
-OBJECT_OBJECT_UNSET_YASI
+OBJECT_OBJ_YASI
OBJECT_MASK_ROMERNY
OBJECT_TANRON1
OBJECT_TANRON2
OBJECT_TANRON3
OBJECT_GI_MAGICMUSHROOM
-OBJECT_OBJECT_UNSET_CHAN
+OBJECT_OBJ_CHAN
OBJECT_GI_MASK10
OBJECT_ZOS
OBJECT_MASK_POSTHAT
@@ -578,7 +578,7 @@ OBJECT_TANRON5
OBJECT_DT
OBJECT_GI_MASK03
OBJECT_CHA
-OBJECT_OBJECT_UNSET_DINNER
+OBJECT_OBJ_DINNER
OBJECT_GI_RESERVE_B_01
OBJECT_LASTDAY
OBJECT_BAI
@@ -597,7 +597,7 @@ OBJECT_GI_SCHEDULE
OBJECT_GI_STONEMASK
OBJECT_ZORABAND
OBJECT_KEPN_KOYA
-OBJECT_OBJECT_UNSET_USIYANE
+OBJECT_OBJ_USIYANE
OBJECT_GI_MASK05
OBJECT_GI_MASK11
OBJECT_GI_MASK20
@@ -607,7 +607,7 @@ OBJECT_MASK_YOFUKASI
OBJECT_MASK_MEOTO
OBJECT_MASK_DANCER
OBJECT_KZSAKU
-OBJECT_OBJECT_UNSET_MILK_BIN
+OBJECT_OBJ_MILK_BIN
OBJECT_RANDOM_OBJ
OBJECT_KUJIYA
OBJECT_KITAN
@@ -625,7 +625,7 @@ OBJECT_SYOTEN
OBJECT_MOONEND
OBJECT_OB
OBJECT_GI_BOTTLE_04
-OBJECT_OBJECT_UNSET_DANPEILIFT
+OBJECT_OBJ_DANPEILIFT
OBJECT_WDOR01
OBJECT_WDOR02
OBJECT_WDOR03
@@ -640,4 +640,4 @@ OBJECT_GI_MASK22
OBJECT_LBFSHOT
OBJECT_FUSEN
OBJECT_ENDING_OBJ
-OBJECT_GI_MASK13
\ No newline at end of file
+OBJECT_GI_MASK13
diff --git a/tools/actorfixer.py b/tools/actorfixer.py
index fc26e60e00..2c18ac2d04 100755
--- a/tools/actorfixer.py
+++ b/tools/actorfixer.py
@@ -213,7 +213,8 @@ animdict = {
"func_800BE2B8": "Actor_SetDropFlagJntSph",
"Actor_TitleCardCreate": "TitleCard_InitBossName",
"func_800B867C": "Actor_TextboxIsClosing",
- "func_800BDC5C": "Actor_ChangeAnimation",
+ "func_800BDC5C": "Actor_ChangeAnimationByInfo",
+ "Actor_ChangeAnimation(": "Actor_ChangeAnimationByInfo(",
"func_80152498": "Message_GetState",
"func_800B8898": "Actor_GetScreenPos",
"Audio_PlayActorSound2": "Actor_PlaySfxAtPos",
@@ -246,6 +247,8 @@ animdict = {
"BgCheck_CreateVertexFromVec3f": "BgCheck_Vec3fToVec3s",
"BgCheck_PolygonGetMinY": "CollisionPoly_GetMinY",
"BgCheck_PolygonGetNormal": "CollisionPoly_GetNormalF",
+ "BcCheck3_BgActorInit": "DynaPolyActor_Init",
+ "BgCheck3_LoadMesh": "DynaPolyActor_LoadMesh",
"func_800C01B8": "CollisionPoly_GetPointDistanceFromPlane",
"BgCheck_CreateTriNormFromPolygon": "CollisionPoly_GetVertices",
"func_800C02C0": "CollisionPoly_GetVerticesByBgId",
@@ -344,7 +347,7 @@ animdict = {
"func_800C9CEC": "SurfaceType_IsHookshotSurface",
"func_800C9D14": "SurfaceType_IsIgnoredByEntities",
"func_800C9D50": "SurfaceType_IsIgnoredByProjectiles",
- "func_800C9D8C": "SurfaceType_IsConveyor",
+ "func_800C9D8C": "SurfaceType_GetConveyorType",
"func_800C9E18": "SurfaceType_GetConveyorSpeed",
"func_800C9E40": "SurfaceType_GetConveyorDirection",
"func_800C9E88": "SurfaceType_IsWallDamage",
@@ -378,6 +381,27 @@ animdict = {
"func_8017F9C0": "Math3D_XZInSphere",
"func_8017FA34": "Math3D_XYInSphere",
"func_8017FAA8": "Math3D_YZInSphere",
+ "func_800DFB14": "Camera_ChangeDataIdx",
+ "func_800DFC68": "Camera_GetInputDirYaw",
+ "func_800DFCB4": "Camera_GetCamDirPitch",
+ "func_800DFCDC": "Camera_GetCamDirYaw",
+ "func_800E0308": "Camera_SetTargetActor",
+ "func_800E031C": "Camera_GetWaterYPos",
+ "func_800E02AC": "Camera_SetToTrackActor",
+ "func_801694DC": "Play_CreateSubCamera",
+ "Play_GetActiveCameraIndex": "Play_GetActiveCamId",
+ "func_80169590": "Play_CameraChangeStatus",
+ "func_80169600": "Play_ClearCamera",
+ "func_80169668": "Play_ClearAllSubCameras",
+ "func_8016981C": "Play_CameraSetAtEyeUp",
+ "func_80169940": "Play_CameraSetFov",
+ "func_80169988": "Play_CameraSetRoll",
+ "func_801699D4": "Play_CopyCamera",
+ "func_80169AC0": "Play_CameraChangeSetting",
+ "func_80169BC4": "Play_CameraGetUID",
+ "func_80169C64": "Play_GetCsCamDataSetting",
+ "func_80169C84": "Play_GetCsCamDataVec3s",
+ "func_8017D2FC": "Math3D_LineSegVsPlane",
"func_8013A7C0": "SubS_FindDoor",
"func_8013E640": "SubS_FindActorCustom",
"func_ActorCategoryIterateById": "SubS_FindActor",
@@ -385,6 +409,36 @@ animdict = {
"func_800A81F0": "EffectBlure_AddVertex",
"func_800A8514": "EffectBlure_AddSpace",
"Effect_GetParams": "Effect_GetByIndex",
+ "func_800F5A8C": "Environment_LerpWeight",
+ "func_801A3F54": "Audio_SetCutsceneFlag",
+ "func_801518B0": "Message_StartTextbox",
+ "func_800EA0D4": "Cutscene_Start",
+ "func_800EA0EC": "Cutscene_End",
+ "func_800EDE34": "Cutscene_ActorTranslate",
+ "func_800EDF24": "Cutscene_ActorTranslateAndYaw",
+ "func_800EDF78": "Cutscene_ActorTranslateAndYawSmooth",
+ "func_800EE0CC": "Cutscene_ActorTranslateXZAndYawSmooth",
+ "func_800EE1D8": "Cutscene_GetSceneSetupIndex",
+ "func_800EE200": "Cutscene_GetActorActionIndex",
+ "func_800EE29C": "Cutscene_CheckActorAction",
+ "func_800EE2F4": "Cutscene_IsPlaying",
+ "func_801343C0": "SkelAnime_DrawTransformFlexOpa",
+ "func_80134148": "SkelAnime_DrawTransformFlexLimbOpa",
+ "func_8013AB00": "SubS_DrawTransformFlex",
+ "func_8013A860": "SubS_DrawTransformFlexLimb",
+ "func_8013BC6C": "SubS_ChangeAnimationByInfoS",
+ "func_8013E1C8": "SubS_ChangeAnimationBySpeedInfo",
+ "func_8013D9C8": "SubS_FillLimbRotTables",
+ "func_80114E90": "Interface_HasEmptyBottle",
+ "func_80114F2C": "Interface_HasItemInBottle",
+ "func_80123C90": "Player_SetEquipmentData",
+ "func_8013E2D4": "SubS_StartActorCutscene",
+ "func_8013E3B8": "SubS_FillCutscenesList",
+ "func_8013AED4": "SubS_UpdateFlags",
+ "func_8013D8DC": "SubS_IsObjectLoaded",
+ "func_8013D924": "SubS_GetObjectIndex",
+ "func_8013D5E8": "SubS_AngleDiffLessEqual",
+ "func_8012F22C": "Inventory_GetSkullTokenCount",
# Structs members
"skelAnime.unk03": "skelAnime.taper",
@@ -403,11 +457,20 @@ animdict = {
"skelAnime.prevFrameRot": "skelAnime.prevRot",
"skelAnime.prevFramePos": "skelAnime.prevTransl",
"skelAnime.unk3E": "skelAnime.baseTransl",
+
"actor.minVelocityY": "actor.terminalVelocity",
- "actor.yDistToWater" : "actor.depthInWater",
+ "actor.yDistToWater": "actor.depthInWater",
"actor.yDistToPlayer": "actor.playerHeightRel",
- "globalCtx->mf_187FC" : "globalCtx->billboardMtxF",
- "globalCtx->projectionMatrix" : "globalCtx->viewProjectionMtxF",
+ "globalCtx->mf_187FC": "globalCtx->billboardMtxF",
+ "globalCtx->projectionMatrix": "globalCtx->viewProjectionMtxF",
+ "csCtx.npcActions": "csCtx.actorActions",
+ "csCtx->npcActions": "csCtx->actorActions",
+ "csCtx.unk_12": "csCtx.currentCsIndex",
+ "globalCtx->envCtx.unk_8C": "globalCtx->envCtx.lightSettings",
+ "globalCtx->envCtx.unk_E5": "globalCtx->envCtx.fillScreen",
+ "globalCtx->envCtx.unk_E6": "globalCtx->envCtx.screenFillColor",
+ "globalCtx->envCtx.unk_C3": "globalCtx->envCtx.lightSettingOverride",
+ "globalCtx->envCtx.unk_DC": "globalCtx->envCtx.lightBlend",
"player->unk_A87": "player->exchangeItemId",
"player->leftHandActor": "player->heldActor",
"player->unk_384": "player->getItemId",
@@ -415,15 +478,24 @@ animdict = {
"player->unk_388": "player->interactRangeActor",
"player->unk_38C": "player->mountSide",
"player->unk_394": "player->csMode",
- "player->unk_A87": "player->exchangeItemId",
"globalCtx->actorCtx.actorList[": "globalCtx->actorCtx.actorLists[",
+ "gSaveContext.unk_3F58": "gSaveContext.sunsSongState",
+ "globalCtx->msgCtx.unk1202A": "globalCtx->msgCtx.ocarinaMode",
+ "globalCtx->msgCtx.unk1202C": "globalCtx->msgCtx.ocarinaAction",
+ "globalCtx->msgCtx.unk11F22": "globalCtx->msgCtx.msgMode",
- # Variables
- "D_0407D590": "gGameplayKeepDrawFlameDL",
- "D_801D15B0": "gZeroVec3f",
- "D_801D15BC": "gZeroVec3s",
- "D_801D1DE0": "gIdentityMtx",
- "D_801D1E20": "gIdentityMtxF",
+ "D_801D15B0" : "gZeroVec3f",
+ "D_801D15BC" : "gZeroVec3s",
+ "D_801D1DE0" : "gIdentityMtx",
+ "D_801D1E20" : "gIdentityMtxF",
+ "D_04020658" : "gameplay_keep_Anim_020658",
+ "D_04022B28" : "gDoorSkel",
+ "D_04023100" : "gDoorCol",
+
+ # Structs
+ "ActorAnimationEntry": "AnimationInfo",
+ "ActorAnimationEntryS": "AnimationInfoS",
+ "struct_80B8E1A8": "AnimationSpeedInfo",
"ICHAIN_F32_DIV1000(minVelocityY,": "ICHAIN_F32_DIV1000(terminalVelocity,",
"ICHAIN_F32(minVelocityY,": "ICHAIN_F32(terminalVelocity,",
@@ -462,20 +534,20 @@ def replace_anim_all(repo):
for filename in files:
if(filename.endswith('.s')):
file = subdir + os.sep + filename
- replace_anim(file)
+ replace_anim(file)
for subdir, dirs, files in os.walk(repo + os.sep + 'data'):
for filename in files:
if(filename.endswith('.s')):
file = subdir + os.sep + filename
replace_anim(file)
-
+
for subdir, dirs, files in os.walk(repo + os.sep + 'docs'):
for filename in files:
if(filename.endswith('.md')):
file = subdir + os.sep + filename
replace_anim(file)
-
+
for subdir, dirs, files in os.walk(repo + os.sep + 'tools' + os.sep + 'sizes'):
for filename in files:
if(filename.endswith('.csv')):
diff --git a/tools/asm-differ/.gitrepo b/tools/asm-differ/.gitrepo
index 241c0ad6b6..48e215c08c 100644
--- a/tools/asm-differ/.gitrepo
+++ b/tools/asm-differ/.gitrepo
@@ -4,9 +4,9 @@
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
- remote = https://github.com/simonlindholm/asm-differ.git
+ remote = https://github.com/simonlindholm/asm-differ
branch = main
- commit = 70c33cc125666495f84f8c7bee60d3158b4b1164
- parent = 62341d8db0c29d1d4f0c360196e428309ac373b6
+ commit = 6f8f80b719359d018a2b734288c977aae6538870
+ parent = 91a6e9f647d2035eba281d286c78f089f70f269f
method = merge
cmdver = 0.4.3
diff --git a/tools/asm-differ/diff.py b/tools/asm-differ/diff.py
index 2ec117a126..9781420bb3 100755
--- a/tools/asm-differ/diff.py
+++ b/tools/asm-differ/diff.py
@@ -1198,6 +1198,9 @@ def parse_elf_data_references(data: bytes) -> List[Tuple[int, int, str]]:
# Skip .text -> .text references
continue
sec_name = sec_names[s.sh_info].decode("latin1")
+ if sec_name == ".mwcats.text":
+ # Skip Metrowerks CATS Utility section
+ continue
sec_base = sections[s.sh_info].sh_offset
for i in range(0, s.sh_size, s.sh_entsize):
if s.sh_type == SHT_REL:
@@ -1330,11 +1333,6 @@ def dump_binary(
(objdump_flags + flags2, project.myimg, None),
)
-DATA_POOL_PLACEHOLDER = "DATA_POOL_PLACEHOLDER-OFFSET_{}"
-DATA_POOL_PLACEHOLDER_PATTERN = re.compile(
- r"DATA_POOL_PLACEHOLDER-OFFSET_([a-zA-z0-9]+)"
-)
-
# Example: "ldr r4, [pc, #56] ; (4c )"
ARM32_LOAD_POOL_PATTERN = r"(ldr\s+r([0-9]|1[0-3]),\s+\[pc,.*;\s*)(\([a-fA-F0-9]+.*\))"
@@ -1357,7 +1355,7 @@ class AsmProcessor:
def _normalize_arch_specific(self, mnemonic: str, row: str) -> str:
return row
-
+
def post_process(self, lines: List["Line"]) -> None:
return
@@ -1460,37 +1458,21 @@ class AsmProcessorARM32(AsmProcessor):
def _normalize_data_pool(self, row: str) -> str:
pool_match = re.search(ARM32_LOAD_POOL_PATTERN, row)
- if pool_match:
- offset = pool_match.group(3).split(" ")[0][1:]
- repl = DATA_POOL_PLACEHOLDER.format(offset)
- return pool_match.group(1) + repl
- return row
+ return pool_match.group(1) if pool_match else row
def post_process(self, lines: List["Line"]) -> None:
lines_by_line_number = {}
for line in lines:
lines_by_line_number[line.line_num] = line
for line in lines:
- reloc_match = re.search(
- DATA_POOL_PLACEHOLDER_PATTERN, line.normalized_original
- )
- if reloc_match is None:
+ if line.data_pool_addr is None:
continue
- # Get value at relocation
- reloc = reloc_match.group(0)
- line_number = re.search(
- DATA_POOL_PLACEHOLDER_PATTERN, reloc).group(1)
- line_original = lines_by_line_number[int(line_number, 16)].original
+ # Add data symbol and its address to the line.
+ line_original = lines_by_line_number[line.data_pool_addr].original
value = line_original.split()[1]
-
- # Replace relocation placeholder with value
- replaced = re.sub(
- DATA_POOL_PLACEHOLDER_PATTERN,
- f"={value} ({line_number})",
- line.normalized_original,
- )
- line.original = replaced
+ addr = "{:x}".format(line.data_pool_addr)
+ line.original = line.normalized_original + f"={value} ({addr})"
class AsmProcessorAArch64(AsmProcessor):
@@ -1795,6 +1777,7 @@ class Line:
scorable_line: str
line_num: Optional[int] = None
branch_target: Optional[int] = None
+ data_pool_addr: Optional[int] = None
source_filename: Optional[str] = None
source_line_num: Optional[int] = None
source_lines: List[str] = field(default_factory=list)
@@ -1856,6 +1839,14 @@ def process(dump: str, config: Config) -> List[Line]:
source_lines.append(row)
continue
+ # If the instructions loads a data pool symbol, extract the address of
+ # the symbol.
+ data_pool_addr = None
+ pool_match = re.search(ARM32_LOAD_POOL_PATTERN, row)
+ if pool_match:
+ offset = pool_match.group(3).split(" ")[0][1:]
+ data_pool_addr = int(offset, 16)
+
m_comment = re.search(arch.re_comment, row)
comment = m_comment[0] if m_comment else None
row = re.sub(arch.re_comment, "", row)
@@ -1946,6 +1937,7 @@ def process(dump: str, config: Config) -> List[Line]:
scorable_line=scorable_line,
line_num=line_num,
branch_target=branch_target,
+ data_pool_addr=data_pool_addr,
source_filename=source_filename,
source_line_num=source_line_num,
source_lines=source_lines,
diff --git a/tools/disasm/files.txt b/tools/disasm/files.txt
index 175365f8e8..fc9f9fc534 100644
--- a/tools/disasm/files.txt
+++ b/tools/disasm/files.txt
@@ -245,7 +245,7 @@
0x80096930 : "__osMemcpy",
# .data section
- 0x800969C0 : "rsp_boot",
+ 0x800969C0 : "rspboot",
0x80096B20 : "idle",
0x80096B40 : "viconfig",
0x80096B50 : "z_std_dma",
@@ -503,7 +503,9 @@
0x801AAAA0 : "z_construct",
# .data section
- 0x801AAAB0 : "rsp",
+ 0x801AAAB0 : "aspMain",
+ 0x801ABAB0 : "gspS2DEX2.fifo",
+ 0x801AD370 : "njpgdspMain",
0x801ADE60 : "",
0x801ADEC0 : "z_en_item00",
0x801AE240 : "z_eff_blure",
@@ -522,6 +524,7 @@
0x801BA200 : "z_collision_check",
0x801BA550 : "z_debug_display",
0x801BB090 : "z_debug_mode",
+ 0x801BB120 : "z_demo",
0x801BB170 : "z_draw",
0x801BC240 : "z_eff_footmark",
0x801BC2A0 : "",
@@ -674,7 +677,11 @@
0x801E1070 : "code_801A7B10",
0x801E1100 : "audio_init_params",
0x801E1110 : "z_game_over",
- 0x801E1180 : "rsp",
+ 0x801E1180 : "audio_tables",
+ 0x801E1E80 : "aspMain",
+ 0x801E2160 : "gspF3DZEX2.NoN.PosLight.fifo",
+ 0x801E3BB0 : "gspS2DEX2.fifo",
+ 0x801E3F40 : "njpgdspMain",
# .bss section
0x801E3FA0 : "code_801E3FA0",
diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt
index 69d387c20f..67f9906094 100644
--- a/tools/disasm/functions.txt
+++ b/tools/disasm/functions.txt
@@ -877,7 +877,7 @@
0x800BD9E0:("func_800BD9E0",),
0x800BDAA0:("func_800BDAA0",),
0x800BDB6C:("func_800BDB6C",),
- 0x800BDC5C:("Actor_ChangeAnimation",),
+ 0x800BDC5C:("Actor_ChangeAnimationByInfo",),
0x800BDCF4:("func_800BDCF4",),
0x800BDFB0:("Actor_Noop",),
0x800BDFC0:("Gfx_DrawDListOpa",),
@@ -1075,7 +1075,7 @@
0x800C9CEC:("SurfaceType_IsHookshotSurface",),
0x800C9D14:("SurfaceType_IsIgnoredByEntities",),
0x800C9D50:("SurfaceType_IsIgnoredByProjectiles",),
- 0x800C9D8C:("SurfaceType_IsConveyor",),
+ 0x800C9D8C:("SurfaceType_GetConveyorType",),
0x800C9DDC:("func_800C9DDC",),
0x800C9E18:("SurfaceType_GetConveyorSpeed",),
0x800C9E40:("SurfaceType_GetConveyorDirection",),
@@ -1272,13 +1272,13 @@
0x800DF86C:("func_800DF86C",),
0x800DF8EC:("func_800DF8EC",),
0x800DFAC8:("func_800DFAC8",),
- 0x800DFB14:("func_800DFB14",),
+ 0x800DFB14:("Camera_ChangeDataIdx",),
0x800DFC1C:("func_800DFC1C",),
0x800DFC40:("func_800DFC40",),
- 0x800DFC68:("func_800DFC68",),
+ 0x800DFC68:("Camera_GetInputDirYaw",),
0x800DFC90:("func_800DFC90",),
- 0x800DFCB4:("func_800DFCB4",),
- 0x800DFCDC:("func_800DFCDC",),
+ 0x800DFCB4:("Camera_GetCamDirPitch",),
+ 0x800DFCDC:("Camera_GetCamDirYaw",),
0x800DFD04:("func_800DFD04",),
0x800DFD78:("func_800DFD78",),
0x800DFEF0:("func_800DFEF0",),
@@ -1294,9 +1294,9 @@
0x800E01DC:("func_800E01DC",),
0x800E0228:("func_800E0228",),
0x800E0238:("func_800E0238",),
- 0x800E02AC:("func_800E02AC",),
- 0x800E0308:("func_800E0308",),
- 0x800E031C:("func_800E031C",),
+ 0x800E02AC:("Camera_SetToTrackActor",),
+ 0x800E0308:("Camera_SetTargetActor",),
+ 0x800E031C:("Camera_GetWaterYPos",),
0x800E0348:("func_800E0348",),
0x800E03A0:("DamageTable_Get",),
0x800E03CC:("DamageTable_Clear",),
@@ -1534,36 +1534,36 @@
0x800E9E94:("func_800E9E94",),
0x800E9F78:("func_800E9F78",),
0x800EA060:("Cutscene_Init",),
- 0x800EA0D4:("func_800EA0D4",),
- 0x800EA0EC:("func_800EA0EC",),
- 0x800EA110:("Cutscene_StepCutscene1",),
- 0x800EA15C:("Cutscene_StepCutscene2",),
- 0x800EA210:("Cutscene_Nop800EA210",),
+ 0x800EA0D4:("Cutscene_Start",),
+ 0x800EA0EC:("Cutscene_End",),
+ 0x800EA110:("Cutscene_Update1",),
+ 0x800EA15C:("Cutscene_Update2",),
+ 0x800EA210:("Cutscene_DoNothing",),
0x800EA220:("func_800EA220",),
0x800EA258:("func_800EA258",),
0x800EA2B8:("func_800EA2B8",),
- 0x800EA324:("func_800EA324",),
- 0x800EABAC:("func_800EABAC",),
- 0x800EAC08:("func_800EAC08",),
- 0x800EAC44:("func_800EAC44",),
- 0x800EAC94:("func_800EAC94",),
- 0x800EAD14:("func_800EAD14",),
+ 0x800EA324:("Cutscene_Command_Misc",),
+ 0x800EABAC:("Cutscene_Command_SetLighting",),
+ 0x800EAC08:("Cutscene_Command_PlaySequence",),
+ 0x800EAC44:("Cutscene_Command_StopSequence",),
+ 0x800EAC94:("Cutscene_Command_FadeSequence",),
+ 0x800EAD14:("Cutscene_Command_PlayAmbienceSequence",),
0x800EAD48:("func_800EAD48",),
0x800EAD7C:("func_800EAD7C",),
0x800EADB0:("func_800EADB0",),
- 0x800EAECC:("func_800EAECC",),
- 0x800EAF20:("func_800EAF20",),
- 0x800EAFE0:("func_800EAFE0",),
- 0x800EB1DC:("func_800EB1DC",),
- 0x800EB364:("func_800EB364",),
- 0x800EB4B4:("func_800EB4B4",),
- 0x800EB6F8:("func_800EB6F8",),
- 0x800EBB68:("func_800EBB68",),
- 0x800EBCD0:("func_800EBCD0",),
- 0x800EBD60:("func_800EBD60",),
- 0x800EC678:("func_800EC678",),
- 0x800EC6D4:("func_800EC6D4",),
- 0x800EC924:("func_800EC924",),
+ 0x800EAECC:("Cutscene_Command_FadeAmbienceSequence",),
+ 0x800EAF20:("Cutscene_Command_Rumble",),
+ 0x800EAFE0:("Cutscene_Command_FadeColorScreen",),
+ 0x800EB1DC:("Cutscene_Command_SetTime",),
+ 0x800EB364:("Cutscene_TerminatorImpl",),
+ 0x800EB4B4:("Cutscene_Command_Terminator",),
+ 0x800EB6F8:("Cutscene_Command_ChooseCreditsScenes",),
+ 0x800EBB68:("Cutscene_Command_MotionBlur",),
+ 0x800EBCD0:("Cutscene_Command_GiveTatlToPlayer",),
+ 0x800EBD60:("Cutscene_Command_TransitionFX",),
+ 0x800EC678:("Cutscene_Command_Camera",),
+ 0x800EC6D4:("Cutscene_CountNormalMasks",),
+ 0x800EC924:("Cutscene_Command_Textbox",),
0x800ECD7C:("func_800ECD7C",),
0x800ECE40:("Cutscene_ProcessCommands",),
0x800ED980:("func_800ED980",),
@@ -1571,17 +1571,17 @@
0x800EDA04:("func_800EDA04",),
0x800EDA84:("func_800EDA84",),
0x800EDBE0:("func_800EDBE0",),
- 0x800EDDB0:("nop_800EDDB0",),
+ 0x800EDDB0:("func_800EDDB0",),
0x800EDDBC:("func_800EDDBC",),
- 0x800EDDCC:("func_800EDDCC",),
- 0x800EDE34:("func_800EDE34",),
- 0x800EDF24:("func_800EDF24",),
- 0x800EDF78:("func_800EDF78",),
- 0x800EE0CC:("func_800EE0CC",),
- 0x800EE1D8:("func_800EE1D8",),
- 0x800EE200:("func_800EE200",),
- 0x800EE29C:("func_800EE29C",),
- 0x800EE2F4:("func_800EE2F4",),
+ 0x800EDDCC:("Cutscene_LoadCutsceneData",),
+ 0x800EDE34:("Cutscene_ActorTranslate",),
+ 0x800EDF24:("Cutscene_ActorTranslateAndYaw",),
+ 0x800EDF78:("Cutscene_ActorTranslateAndYawSmooth",),
+ 0x800EE0CC:("Cutscene_ActorTranslateXZAndYawSmooth",),
+ 0x800EE1D8:("Cutscene_GetSceneSetupIndex",),
+ 0x800EE200:("Cutscene_GetActorActionIndex",),
+ 0x800EE29C:("Cutscene_CheckActorAction",),
+ 0x800EE2F4:("Cutscene_IsPlaying",),
0x800EE320:("GetItem_Draw",),
0x800EE364:("func_800EE364",),
0x800EE400:("func_800EE400",),
@@ -1710,7 +1710,7 @@
0x800F50D4:("func_800F50D4",),
0x800F510C:("Kankyo_Init",),
0x800F5954:("func_800F5954",),
- 0x800F5A8C:("func_800F5A8C",),
+ 0x800F5A8C:("Environment_LerpWeight",),
0x800F5B10:("func_800F5B10",),
0x800F5CD0:("func_800F5CD0",),
0x800F6834:("func_800F6834",),
@@ -1738,7 +1738,7 @@
0x800FAC20:("func_800FAC20",),
0x800FAF74:("func_800FAF74",),
0x800FB010:("func_800FB010",),
- 0x800FB320:("func_800FB320",),
+ 0x800FB320:("Environment_AddLightningBolts",),
0x800FB388:("func_800FB388",),
0x800FB758:("func_800FB758",),
0x800FB9B4:("func_800FB9B4",),
@@ -2119,8 +2119,8 @@
0x80114A9C:("func_80114A9C",),
0x80114B84:("func_80114B84",),
0x80114CA0:("func_80114CA0",),
- 0x80114E90:("func_80114E90",),
- 0x80114F2C:("func_80114F2C",),
+ 0x80114E90:("Interface_HasEmptyBottle",),
+ 0x80114F2C:("Interface_HasItemInBottle",),
0x80114FD0:("func_80114FD0",),
0x80115130:("func_80115130",),
0x801152B8:("func_801152B8",),
@@ -2206,7 +2206,7 @@
0x80123AA4:("func_80123AA4",),
0x80123BD4:("func_80123BD4",),
0x80123C58:("func_80123C58",),
- 0x80123C90:("func_80123C90",),
+ 0x80123C90:("Player_SetEquipmentData",),
0x80123D50:("func_80123D50",),
0x80123DA4:("func_80123DA4",),
0x80123DC0:("func_80123DC0",),
@@ -2302,14 +2302,14 @@
0x8012AA9C:("Quake_Add",),
0x8012AAC0:("Quake_RemoveFromIdx",),
0x8012AB08:("Quake_Calc",),
- 0x8012AE68:("Quake2_Init",),
- 0x8012AEAC:("Quake2_SetCountdown",),
- 0x8012AED4:("Quake2_GetCountdown",),
- 0x8012AEE4:("Quake2_GetType",),
- 0x8012AEF4:("Quake2_SetType",),
- 0x8012AF18:("Quake2_ClearType",),
- 0x8012AF38:("Quake2_GetFloorQuake",),
- 0x8012AF9C:("Quake2_Update",),
+ 0x8012AE68:("Distortion_Init",),
+ 0x8012AEAC:("Distortion_SetCountdown",),
+ 0x8012AED4:("Distortion_GetCountdown",),
+ 0x8012AEE4:("Distortion_GetType",),
+ 0x8012AEF4:("Distortion_SetType",),
+ 0x8012AF18:("Distortion_ClearType",),
+ 0x8012AF38:("Distortion_GetUnderwaterCurrentSpeed",),
+ 0x8012AF9C:("Distortion_Update",),
0x8012BBE8:("Quake_NumActiveQuakes",),
0x8012BC50:("Gfx_SetFog",),
0x8012BD8C:("Gfx_SetFogWithSync",),
@@ -2405,16 +2405,16 @@
0x8012EAA8:("Room_HandleLoadCallbacks",),
0x8012EBA8:("Room_Draw",),
0x8012EBF8:("func_8012EBF8",),
- 0x8012EC80:("func_8012EC80",),
- 0x8012ED34:("func_8012ED34",),
- 0x8012ED78:("func_8012ED78",),
- 0x8012EDE8:("func_8012EDE8",),
- 0x8012EE34:("func_8012EE34",),
- 0x8012EF0C:("func_8012EF0C",),
- 0x8012F0EC:("func_8012F0EC",),
- 0x8012F1BC:("func_8012F1BC",),
- 0x8012F22C:("func_8012F22C",),
- 0x8012F278:("func_8012F278",),
+ 0x8012EC80:("Inventory_GetBtnBItem",),
+ 0x8012ED34:("Inventory_ChangeEquipment",),
+ 0x8012ED78:("Inventory_DeleteEquipment",),
+ 0x8012EDE8:("Inventory_ChangeUpgrade",),
+ 0x8012EE34:("Inventory_IsMapVisible",),
+ 0x8012EF0C:("Inventory_SetMapVisibility",),
+ 0x8012F0EC:("Inventory_SaveDekuPlaygroundHighScore",),
+ 0x8012F1BC:("Inventory_IncrementSkullTokenCount",),
+ 0x8012F22C:("Inventory_GetSkullTokenCount",),
+ 0x8012F278:("Inventory_SaveLotteryCodeGuess",),
0x8012F2E0:("Object_Spawn",),
0x8012F3D0:("Object_InitBank",),
0x8012F4FC:("Object_UpdateBank",),
@@ -2527,8 +2527,8 @@
0x80133B3C:("SkelAnime_DrawOpa",),
0x80133CDC:("SkelAnime_DrawFlexLimbOpa",),
0x80133F28:("SkelAnime_DrawFlexOpa",),
- 0x80134148:("func_80134148",),
- 0x801343C0:("func_801343C0",),
+ 0x80134148:("SkelAnime_DrawTransformFlexLimbOpa",),
+ 0x801343C0:("SkelAnime_DrawTransformFlexOpa",),
0x80134600:("SkelAnime_GetFrameData",),
0x80134724:("Animation_GetLength",),
0x80134748:("Animation_GetLastFrame",),
@@ -2656,11 +2656,11 @@
0x8013A504:("func_8013A504",),
0x8013A530:("func_8013A530",),
0x8013A7C0:("SubS_FindDoor",),
- 0x8013A860:("func_8013A860",),
- 0x8013AB00:("func_8013AB00",),
+ 0x8013A860:("SubS_DrawTransformFlexLimb",),
+ 0x8013AB00:("SubS_DrawTransformFlex",),
0x8013AD6C:("func_8013AD6C",),
0x8013AD9C:("func_8013AD9C",),
- 0x8013AED4:("func_8013AED4",),
+ 0x8013AED4:("SubS_UpdateFlags",),
0x8013AF00:("func_8013AF00",),
0x8013B010:("func_8013B010",),
0x8013B0C8:("func_8013B0C8",),
@@ -2669,7 +2669,7 @@
0x8013B878:("func_8013B878",),
0x8013BB34:("func_8013BB34",),
0x8013BB7C:("SubS_FindNearestActor",),
- 0x8013BC6C:("func_8013BC6C",),
+ 0x8013BC6C:("SubS_ChangeAnimationByInfoS",),
0x8013BD40:("func_8013BD40",),
0x8013BEDC:("func_8013BEDC",),
0x8013C068:("func_8013C068",),
@@ -2681,16 +2681,16 @@
0x8013CF04:("func_8013CF04",),
0x8013D0E0:("func_8013D0E0",),
0x8013D2E0:("func_8013D2E0",),
- 0x8013D5E8:("func_8013D5E8",),
+ 0x8013D5E8:("SubS_AngleDiffLessEqual",),
0x8013D648:("func_8013D648",),
0x8013D68C:("func_8013D68C",),
0x8013D720:("func_8013D720",),
0x8013D768:("func_8013D768",),
0x8013D83C:("func_8013D83C",),
- 0x8013D8DC:("func_8013D8DC",),
- 0x8013D924:("func_8013D924",),
+ 0x8013D8DC:("SubS_IsObjectLoaded",),
+ 0x8013D924:("SubS_GetObjectIndex",),
0x8013D960:("SubS_FindActor",),
- 0x8013D9C8:("func_8013D9C8",),
+ 0x8013D9C8:("SubS_FillLimbRotTables",),
0x8013DB90:("func_8013DB90",),
0x8013DC40:("func_8013DC40",),
0x8013DCCC:("func_8013DCCC",),
@@ -2700,9 +2700,9 @@
0x8013E054:("func_8013E054",),
0x8013E07C:("func_8013E07C",),
0x8013E0A4:("func_8013E0A4",),
- 0x8013E1C8:("func_8013E1C8",),
- 0x8013E2D4:("func_8013E2D4",),
- 0x8013E3B8:("func_8013E3B8",),
+ 0x8013E1C8:("SubS_ChangeAnimationBySpeedInfo",),
+ 0x8013E2D4:("SubS_StartActorCutscene",),
+ 0x8013E3B8:("SubS_FillCutscenesList",),
0x8013E4B0:("func_8013E4B0",),
0x8013E5CC:("func_8013E5CC",),
0x8013E640:("SubS_FindActorCustom",),
@@ -2734,13 +2734,13 @@
0x8013F1D8:("View_WriteScissor",),
0x8013F28C:("View_SyncAndWriteScissor",),
0x8013F2F8:("View_SetScissorForLetterbox",),
- 0x8013F3F8:("View_SetQuakeRotation",),
- 0x8013F420:("View_SetQuakeScale",),
- 0x8013F448:("View_SetQuakeSpeed",),
- 0x8013F45C:("View_InitCameraQuake",),
- 0x8013F4C0:("View_ClearQuake",),
- 0x8013F4F4:("View_SetQuake",),
- 0x8013F54C:("View_StepQuake",),
+ 0x8013F3F8:("View_SetDistortionDirRot",),
+ 0x8013F420:("View_SetDistortionScale",),
+ 0x8013F448:("View_SetDistortionSpeed",),
+ 0x8013F45C:("View_InitDistortion",),
+ 0x8013F4C0:("View_ClearDistortion",),
+ 0x8013F4F4:("View_SetDistortion",),
+ 0x8013F54C:("View_StepDistortion",),
0x8013F6FC:("View_RenderView",),
0x8013F748:("View_RenderToPerspectiveMatrix",),
0x8013FA1C:("View_RenderToOrthographicMatrix",),
@@ -2852,7 +2852,7 @@
0x80150A84:("func_80150A84",),
0x80150D08:("func_80150D08",),
0x801514B0:("func_801514B0",),
- 0x801518B0:("func_801518B0",),
+ 0x801518B0:("Message_StartTextbox",),
0x80151938:("func_80151938",),
0x80151A68:("func_80151A68",),
0x80151BB4:("func_80151BB4",),
@@ -3006,24 +3006,24 @@
0x801692C4:("func_801692C4",),
0x801693D4:("Play_SceneInit",),
0x80169474:("func_80169474",),
- 0x801694DC:("func_801694DC",),
- 0x80169584:("Play_GetActiveCameraIndex",),
- 0x80169590:("func_80169590",),
- 0x80169600:("func_80169600",),
- 0x80169668:("func_80169668",),
+ 0x801694DC:("Play_CreateSubCamera",),
+ 0x80169584:("Play_GetActiveCamId",),
+ 0x80169590:("Play_CameraChangeStatus",),
+ 0x80169600:("Play_ClearCamera",),
+ 0x80169668:("Play_ClearAllSubCameras",),
0x801696D4:("Play_GetCamera",),
0x8016970C:("Play_CameraSetAtEye",),
- 0x8016981C:("func_8016981C",),
- 0x80169940:("func_80169940",),
- 0x80169988:("func_80169988",),
- 0x801699D4:("func_801699D4",),
+ 0x8016981C:("Play_CameraSetAtEyeUp",),
+ 0x80169940:("Play_CameraSetFov",),
+ 0x80169988:("Play_CameraSetRoll",),
+ 0x801699D4:("Play_CopyCamera",),
0x80169A50:("func_80169A50",),
- 0x80169AC0:("func_80169AC0",),
+ 0x80169AC0:("Play_CameraChangeSetting",),
0x80169AFC:("func_80169AFC",),
- 0x80169BC4:("func_80169BC4",),
+ 0x80169BC4:("Play_CameraGetUID",),
0x80169BF8:("func_80169BF8",),
- 0x80169C64:("func_80169C64",),
- 0x80169C84:("func_80169C84",),
+ 0x80169C64:("Play_GetCsCamDataSetting",),
+ 0x80169C84:("Play_GetCsCamDataVec3s",),
0x80169CBC:("convert_scene_number_among_shared_scenes",),
0x80169D40:("func_80169D40",),
0x80169DCC:("func_80169DCC",),
@@ -3320,7 +3320,7 @@
0x8017D020:("Math3D_TriChkLineSegParaZIntersect",),
0x8017D1AC:("func_8017D1AC",),
0x8017D220:("func_8017D220",),
- 0x8017D2FC:("func_8017D2FC",),
+ 0x8017D2FC:("Math3D_LineSegVsPlane",),
0x8017D404:("func_8017D404",),
0x8017D568:("Math3D_TriSetCoords",),
0x8017D618:("Math3D_IsPointInSphere",),
@@ -3555,7 +3555,7 @@
0x8018B4F8:("func_8018B4F8",),
0x8018B520:("func_8018B520",),
0x8018B578:("func_8018B578",),
- 0x8018B5D0:("func_8018B5D0",),
+ 0x8018B5D0:("AudioHeap_AllocDmaMemory",),
0x8018B608:("func_8018B608",),
0x8018B640:("func_8018B640",),
0x8018B69C:("func_8018B69C",),
@@ -3604,7 +3604,7 @@
0x8018EB60:("func_8018EB60",),
0x8018EC4C:("func_8018EC4C",),
0x8018EF88:("func_8018EF88",),
- 0x8018F220:("func_8018F220",),
+ 0x8018F220:("AudioLoad_IsFontLoadComplete",),
0x8018F298:("func_8018F298",),
0x8018F310:("func_8018F310",),
0x8018F388:("func_8018F388",),
@@ -3726,61 +3726,61 @@
0x80194804:("func_80194804",),
0x80194840:("func_80194840",),
0x801948B0:("func_801948B0",),
- 0x80194930:("func_80194930",),
- 0x80194DB0:("func_80194DB0",),
- 0x80194E60:("func_80194E60",),
- 0x80194F20:("func_80194F20",),
- 0x80194F84:("func_80194F84",),
- 0x801954CC:("func_801954CC",),
- 0x80195508:("func_80195508",),
- 0x801955DC:("func_801955DC",),
- 0x801956C0:("func_801956C0",),
- 0x801957B4:("func_801957B4",),
- 0x801958F8:("func_801958F8",),
- 0x80195C40:("func_80195C40",),
- 0x80195C60:("func_80195C60",),
- 0x80195C80:("func_80195C80",),
- 0x80195D84:("func_80195D84",),
- 0x80195DDC:("func_80195DDC",),
- 0x80195DEC:("func_80195DEC",),
- 0x80195E3C:("func_80195E3C",),
- 0x80195EE0:("func_80195EE0",),
- 0x80196040:("func_80196040",),
- 0x8019617C:("func_8019617C",),
- 0x801961BC:("func_801961BC",),
- 0x801961E8:("func_801961E8",),
- 0x80196268:("func_80196268",),
+ 0x80194930:("AudioPlayback_InitNoteSub",),
+ 0x80194DB0:("AudioPlayback_NoteSetResamplingRate",),
+ 0x80194E60:("AudioPlayback_NoteInit",),
+ 0x80194F20:("AudioPlayback_NoteDisable",),
+ 0x80194F84:("AudioPlayback_ProcessNotes",),
+ 0x801954CC:("AudioPlayback_InstrumentGetSound",),
+ 0x80195508:("AudioPlayback_GetInstrumentInner",),
+ 0x801955DC:("AudioPlayback_GetDrum",),
+ 0x801956C0:("AudioPlayback_GetSfx",),
+ 0x801957B4:("AudioPlayback_SetFontInstrument",),
+ 0x801958F8:("AudioPlayback_SeqLayerDecayRelease",),
+ 0x80195C40:("AudioPlayback_SeqLayerNoteDecay",),
+ 0x80195C60:("AudioPlayback_SeqLayerNoteRelease",),
+ 0x80195C80:("AudioPlayback_BuildSyntheticWave",),
+ 0x80195D84:("AudioPlayback_InitSyntheticWave",),
+ 0x80195DDC:("AudioPlayback_InitNoteList",),
+ 0x80195DEC:("AudioPlayback_InitNoteLists",),
+ 0x80195E3C:("AudioPlayback_InitNoteFreeList",),
+ 0x80195EE0:("AudioPlayback_NotePoolClear",),
+ 0x80196040:("AudioPlayback_NotePoolFill",),
+ 0x8019617C:("AudioPlayback_AudioListPushFront",),
+ 0x801961BC:("AudioPlayback_AudioListRemove",),
+ 0x801961E8:("AudioPlayback_FindNodeWithPrioLessThan",),
+ 0x80196268:("AudioPlayback_NoteInitForLayer",),
0x801963E8:("func_801963E8",),
- 0x8019641C:("func_8019641C",),
- 0x80196448:("func_80196448",),
- 0x80196494:("func_80196494",),
- 0x801964F8:("func_801964F8",),
- 0x801965F0:("func_801965F0",),
- 0x801968C4:("func_801968C4",),
- 0x80196A00:("func_80196A00",),
- 0x80196BC8:("func_80196BC8",),
- 0x80196D20:("func_80196D20",),
- 0x80196D7C:("func_80196D7C",),
- 0x80196DB4:("func_80196DB4",),
- 0x80196FEC:("func_80196FEC",),
- 0x80197048:("func_80197048",),
- 0x80197138:("func_80197138",),
- 0x80197164:("func_80197164",),
- 0x80197188:("func_80197188",),
+ 0x8019641C:("AudioPlayback_NoteReleaseAndTakeOwnership",),
+ 0x80196448:("AudioPlayback_AllocNoteFromDisabled",),
+ 0x80196494:("AudioPlayback_AllocNoteFromDecaying",),
+ 0x801964F8:("AudioPlayback_AllocNoteFromActive",),
+ 0x801965F0:("AudioPlayback_AllocNote",),
+ 0x801968C4:("AudioPlayback_NoteInitAll",),
+ 0x80196A00:("AudioEffects_SequenceChannelProcessSound",),
+ 0x80196BC8:("AudioEffects_SequencePlayerProcessSound",),
+ 0x80196D20:("AudioEffects_GetPortamentoFreqScale",),
+ 0x80196D7C:("AudioEffects_GetVibratoPitchChange",),
+ 0x80196DB4:("AudioEffects_GetVibratoFreqScale",),
+ 0x80196FEC:("AudioEffects_NoteVibratoUpdate",),
+ 0x80197048:("AudioEffects_NoteVibratoInit",),
+ 0x80197138:("AudioEffects_NotePortamentoInit",),
+ 0x80197164:("AudioEffects_AdsrInit",),
+ 0x80197188:("AudioEffects_AdsrUpdate",),
0x801974D0:("func_801974D0",),
0x80197538:("func_80197538",),
0x80197714:("func_80197714",),
0x80197880:("func_80197880",),
0x801979D8:("func_801979D8",),
0x80197A54:("func_80197A54",),
- 0x80197AA4:("func_80197AA4",),
+ 0x80197AA4:("AudioSeq_SequenceChannelDisable",),
0x80197B14:("func_80197B14",),
0x80197C0C:("func_80197C0C",),
0x80197C8C:("func_80197C8C",),
0x80197D24:("func_80197D24",),
- 0x80197D4C:("func_80197D4C",),
- 0x80197E08:("func_80197E08",),
- 0x80197E48:("func_80197E48",),
+ 0x80197D4C:("AudioSeq_SequencePlayerDisable",),
+ 0x80197E08:("AudioSeq_AudioListPushBack",),
+ 0x80197E48:("AudioSeq_AudioListPopBack",),
0x80197E88:("func_80197E88",),
0x80197F28:("func_80197F28",),
0x80197F3C:("func_80197F3C",),
@@ -3978,7 +3978,7 @@
0x801A3D98:("func_801A3D98",),
0x801A3E38:("func_801A3E38",),
0x801A3EC0:("func_801A3EC0",),
- 0x801A3F54:("func_801A3F54",),
+ 0x801A3F54:("Audio_SetCutsceneFlag",),
0x801A3F6C:("func_801A3F6C",),
0x801A3FB4:("func_801A3FB4",),
0x801A3FFC:("func_801A3FFC",),
@@ -4912,7 +4912,7 @@
0x80863E48:("EnGirlA_CanBuyBombBag30BombShop",),
0x80863EC8:("EnGirlA_CanBuyBombchus",),
0x80863F94:("EnGirlA_CanBuyBombs",),
- 0x80864034:("EnGirlA_CanBuyBottle",),
+ 0x80864034:("EnGirlA_CanBuyBottleStolen",),
0x8086406C:("EnGirlA_CanBuySword",),
0x808640A4:("EnGirlA_CanBuyShieldMirror",),
0x80864108:("EnGirlA_CanBuyFairy",),
@@ -4960,7 +4960,7 @@
0x808670F0:("func_808670F0",),
0x80867144:("func_80867144",),
0x8086732C:("EnDoor_Update",),
- 0x80867350:("func_80867350",),
+ 0x80867350:("EnDoor_OverrideLimbDraw",),
0x808674B0:("EnDoor_Draw",),
0x80867BD0:("EnBox_SetupAction",),
0x80867BDC:("func_80867BDC",),
@@ -5441,7 +5441,7 @@
0x808925F8:("EnNiw_LandBeforeIdle",),
0x8089262C:("EnNiw_CheckRage",),
0x808927CC:("EnNiw_Update",),
- 0x80892E70:("EnNiw_LimbDraw",),
+ 0x80892E70:("EnNiw_OverrideLimbDraw",),
0x80892FA0:("EnNiw_Draw",),
0x80893008:("EnNiw_SpawnFeather",),
0x808930FC:("EnNiw_UpdateFeather",),
@@ -5642,12 +5642,12 @@
0x808A03E8:("func_808A03E8",),
0x808A0458:("EnBubble_Update",),
0x808A04D4:("EnBubble_Draw",),
- 0x808A08F0:("func_808A08F0",),
+ 0x808A08F0:("DoorShutter_SetupAction",),
0x808A0900:("func_808A0900",),
- 0x808A0974:("func_808A0974",),
+ 0x808A0974:("DoorShutter_SetupDoor",),
0x808A0B10:("DoorShutter_Init",),
0x808A0CD0:("DoorShutter_Destroy",),
- 0x808A0D0C:("func_808A0D0C",),
+ 0x808A0D0C:("DoorShutter_SetupType",),
0x808A0D90:("func_808A0D90",),
0x808A0E28:("func_808A0E28",),
0x808A0F88:("func_808A0F88",),
@@ -5666,7 +5666,7 @@
0x808A1C50:("func_808A1C50",),
0x808A1CC4:("DoorShutter_Update",),
0x808A1D68:("func_808A1D68",),
- 0x808A1E14:("func_808A1E14",),
+ 0x808A1E14:("DoorShutter_Draw",),
0x808A24D0:("EnBoom_SetupAction",),
0x808A24DC:("func_808A24DC",),
0x808A2700:("EnBoom_Init",),
@@ -5688,7 +5688,7 @@
0x808A3A44:("EnMinifrog_Jump",),
0x808A3B04:("EnMinifrog_TurnToPlayer",),
0x808A3B3C:("EnMinifrog_TurnToMissingFrog",),
- 0x808A3B74:("EnMinifrog_SetCamera",),
+ 0x808A3B74:("EnMinifrog_SpawnDust",),
0x808A3DA8:("EnMinifrog_ReturnFrogCutscene",),
0x808A3F88:("EnMinifrog_SpawnGrowAndShrink",),
0x808A4040:("EnMinifrog_Idle",),
@@ -5873,11 +5873,11 @@
0x808AF8F8:("EnBombf_Draw",),
0x808AFCD0:("EnAm_Init",),
0x808AFDF8:("EnAm_Destroy",),
- 0x808AFE38:("func_808AFE38",),
+ 0x808AFE38:("EnAm_SpawnEffects",),
0x808AFF9C:("func_808AFF9C",),
- 0x808B0040:("func_808B0040",),
- 0x808B00D8:("func_808B00D8",),
- 0x808B0124:("func_808B0124",),
+ 0x808B0040:("EnAm_RemoveEnemyTexture",),
+ 0x808B00D8:("EnAm_WakeUp",),
+ 0x808B0124:("EnAm_ApplyEnemyTexture",),
0x808B0208:("func_808B0208",),
0x808B0358:("func_808B0358",),
0x808B03C0:("func_808B03C0",),
@@ -5889,15 +5889,15 @@
0x808B05C8:("func_808B05C8",),
0x808B0640:("func_808B0640",),
0x808B066C:("func_808B066C",),
- 0x808B06D0:("func_808B06D0",),
+ 0x808B06D0:("EnAm_TakeDamage",),
0x808B07A8:("func_808B07A8",),
0x808B0820:("func_808B0820",),
0x808B0894:("func_808B0894",),
0x808B0AD0:("func_808B0AD0",),
0x808B0B4C:("func_808B0B4C",),
- 0x808B0B9C:("func_808B0B9C",),
+ 0x808B0B9C:("EnAm_UpdateDamage",),
0x808B0CC8:("EnAm_Update",),
- 0x808B0EA4:("func_808B0EA4",),
+ 0x808B0EA4:("EnAm_PostLimbDraw",),
0x808B0F98:("EnAm_Draw",),
0x808B1330:("EnDekubaba_Init",),
0x808B1504:("EnDekubaba_Destroy",),
@@ -6066,8 +6066,8 @@
0x808BE6C4:("func_808BE6C4",),
0x808BE73C:("func_808BE73C",),
0x808BEA48:("EnDekunuts_Update",),
- 0x808BEBD0:("func_808BEBD0",),
- 0x808BED30:("func_808BED30",),
+ 0x808BEBD0:("EnDekunuts_OverrideLimbDraw",),
+ 0x808BED30:("EnDekunuts_PostLimbDraw",),
0x808BEE38:("EnDekunuts_Draw",),
0x808BF220:("EnBbfall_Init",),
0x808BF318:("EnBbfall_Destroy",),
@@ -6344,49 +6344,49 @@
0x808D3754:("func_808D3754",),
0x808D3E20:("EnRd_Init",),
0x808D414C:("EnRd_Destroy",),
- 0x808D4190:("func_808D4190",),
- 0x808D41FC:("func_808D41FC",),
- 0x808D4260:("func_808D4260",),
- 0x808D4308:("func_808D4308",),
- 0x808D43AC:("func_808D43AC",),
- 0x808D45D4:("func_808D45D4",),
- 0x808D4660:("func_808D4660",),
- 0x808D47DC:("func_808D47DC",),
- 0x808D4868:("func_808D4868",),
- 0x808D49E4:("func_808D49E4",),
- 0x808D4A90:("func_808D4A90",),
- 0x808D4B20:("func_808D4B20",),
- 0x808D4CA8:("func_808D4CA8",),
- 0x808D4DC4:("func_808D4DC4",),
- 0x808D4E60:("func_808D4E60",),
- 0x808D4FE0:("func_808D4FE0",),
- 0x808D506C:("func_808D506C",),
- 0x808D53C0:("func_808D53C0",),
- 0x808D5440:("func_808D5440",),
- 0x808D5660:("func_808D5660",),
- 0x808D56E4:("func_808D56E4",),
- 0x808D586C:("func_808D586C",),
- 0x808D58CC:("func_808D58CC",),
- 0x808D5C54:("func_808D5C54",),
- 0x808D5CCC:("func_808D5CCC",),
- 0x808D5D88:("func_808D5D88",),
- 0x808D5DF4:("func_808D5DF4",),
- 0x808D5E98:("func_808D5E98",),
- 0x808D5F18:("func_808D5F18",),
- 0x808D6008:("func_808D6008",),
- 0x808D6054:("func_808D6054",),
- 0x808D60B0:("func_808D60B0",),
- 0x808D6130:("func_808D6130",),
- 0x808D616C:("func_808D616C",),
- 0x808D6200:("func_808D6200",),
- 0x808D6310:("func_808D6310",),
- 0x808D6388:("func_808D6388",),
- 0x808D64D0:("func_808D64D0",),
- 0x808D65BC:("func_808D65BC",),
- 0x808D66A0:("func_808D66A0",),
- 0x808D6814:("func_808D6814",),
- 0x808D6A94:("func_808D6A94",),
- 0x808D6B64:("func_808D6B64",),
+ 0x808D4190:("EnRd_UpdateParentForOtherRedeads",),
+ 0x808D41FC:("EnRd_ShouldNotDance",),
+ 0x808D4260:("EnRd_SetupDanceIfConditionsMet",),
+ 0x808D4308:("EnRd_SetupIdle",),
+ 0x808D43AC:("EnRd_Idle",),
+ 0x808D45D4:("EnRd_SetupSquattingDance",),
+ 0x808D4660:("EnRd_SquattingDance",),
+ 0x808D47DC:("EnRd_SetupClappingDance",),
+ 0x808D4868:("EnRd_ClappingDance",),
+ 0x808D49E4:("EnRd_EndClappingOrSquattingDanceWhenPlayerIsClose",),
+ 0x808D4A90:("EnRd_SetupPirouette",),
+ 0x808D4B20:("EnRd_Pirouette",),
+ 0x808D4CA8:("EnRd_EndPirouetteWhenPlayerIsClose",),
+ 0x808D4DC4:("EnRd_SetupRiseFromCoffin",),
+ 0x808D4E60:("EnRd_RiseFromCoffin",),
+ 0x808D4FE0:("EnRd_SetupWalkToPlayer",),
+ 0x808D506C:("EnRd_WalkToPlayer",),
+ 0x808D53C0:("EnRd_SetupWalkToHome",),
+ 0x808D5440:("EnRd_WalkToHome",),
+ 0x808D5660:("EnRd_SetupWalkToParent",),
+ 0x808D56E4:("EnRd_WalkToParent",),
+ 0x808D586C:("EnRd_SetupGrab",),
+ 0x808D58CC:("EnRd_Grab",),
+ 0x808D5C54:("EnRd_SetupAttemptPlayerFreeze",),
+ 0x808D5CCC:("EnRd_AttemptPlayerFreeze",),
+ 0x808D5D88:("EnRd_SetupGrabFail",),
+ 0x808D5DF4:("EnRd_GrabFail",),
+ 0x808D5E98:("EnRd_SetupTurnAwayAndShakeHead",),
+ 0x808D5F18:("EnRd_TurnAwayAndShakeHead",),
+ 0x808D6008:("EnRd_SetupStandUp",),
+ 0x808D6054:("EnRd_StandUp",),
+ 0x808D60B0:("EnRd_SetupCrouch",),
+ 0x808D6130:("EnRd_Crouch",),
+ 0x808D616C:("EnRd_SetupDamage",),
+ 0x808D6200:("EnRd_Damage",),
+ 0x808D6310:("EnRd_SetupDead",),
+ 0x808D6388:("EnRd_Dead",),
+ 0x808D64D0:("EnRd_SetupStunned",),
+ 0x808D65BC:("EnRd_Stunned",),
+ 0x808D66A0:("EnRd_TurnTowardsPlayer",),
+ 0x808D6814:("EnRd_UpdateDamage",),
+ 0x808D6A94:("EnRd_UpdateCollision",),
+ 0x808D6B64:("EnRd_UpdateEffect",),
0x808D6C10:("EnRd_Update",),
0x808D6DA0:("EnRd_OverrideLimbDraw",),
0x808D6DFC:("EnRd_PostLimbDraw",),
@@ -6539,17 +6539,17 @@
0x808E2444:("func_808E2444",),
0x808E24B4:("BgCtowerRot_Update",),
0x808E24D8:("BgCtowerRot_Draw",),
- 0x808E2600:("func_808E2600",),
- 0x808E26C8:("func_808E26C8",),
+ 0x808E2600:("MirRay_SetupCollider",),
+ 0x808E26C8:("MirRay_MakeShieldLight",),
0x808E286C:("MirRay_Init",),
0x808E2B04:("MirRay_Destroy",),
0x808E2B7C:("MirRay_Update",),
- 0x808E2C68:("func_808E2C68",),
- 0x808E2E1C:("func_808E2E1C",),
- 0x808E2FF8:("func_808E2FF8",),
- 0x808E30FC:("func_808E30FC",),
+ 0x808E2C68:("MirRay_SetIntensity",),
+ 0x808E2E1C:("MirRay_SetupReflectionPolys",),
+ 0x808E2FF8:("MirRay_RemoveSimilarReflections",),
+ 0x808E30FC:("MirRay_ReflectedBeam",),
0x808E36A4:("MirRay_Draw",),
- 0x808E3984:("func_808E3984",),
+ 0x808E3984:("MirRay_CheckInFrustum",),
0x808E3EF0:("EnSb_Init",),
0x808E3FF0:("EnSb_Destroy",),
0x808E401C:("EnSb_SpawnBubbles",),
@@ -6864,32 +6864,32 @@
0x8090C884:("EnFishing_OwnerOverrideLimbDraw",),
0x8090C8BC:("EnFishing_OwnerPostLimbDraw",),
0x8090C96C:("EnFishing_DrawOwner",),
- 0x80917290:("func_80917290",),
- 0x809172E4:("func_809172E4",),
- 0x8091734C:("func_8091734C",),
- 0x80917378:("func_80917378",),
- 0x80917408:("func_80917408",),
- 0x80917538:("func_80917538",),
- 0x80917604:("func_80917604",),
- 0x8091763C:("func_8091763C",),
- 0x8091768C:("func_8091768C",),
+ 0x80917290:("ObjOshihiki_RotateXZ",),
+ 0x809172E4:("ObjOshihiki_StrongEnough",),
+ 0x8091734C:("ObjOshihiki_ResetFloors",),
+ 0x80917378:("ObjOshihiki_GetBlockUnder",),
+ 0x80917408:("ObjOshihiki_UpdateInitPos",),
+ 0x80917538:("ObjOshihiki_NoSwitchPress",),
+ 0x80917604:("ObjOshihiki_SetScale",),
+ 0x8091763C:("ObjOshihiki_SetTextureStep",),
+ 0x8091768C:("ObjOshihiki_SetColor",),
0x809176D0:("ObjOshihiki_Init",),
0x8091780C:("ObjOshihiki_Destroy",),
- 0x80917840:("func_80917840",),
- 0x809179A0:("func_809179A0",),
- 0x80917AEC:("func_80917AEC",),
- 0x80917B44:("func_80917B44",),
- 0x80917B9C:("func_80917B9C",),
- 0x80917C14:("func_80917C14",),
- 0x80917E8C:("func_80917E8C",),
- 0x80917F88:("func_80917F88",),
- 0x80917FC0:("func_80917FC0",),
- 0x809180C8:("func_809180C8",),
- 0x80918108:("func_80918108",),
- 0x80918314:("func_80918314",),
- 0x8091834C:("func_8091834C",),
- 0x8091851C:("func_8091851C",),
- 0x80918574:("func_80918574",),
+ 0x80917840:("ObjOshihiki_SetFloors",),
+ 0x809179A0:("ObjOshihiki_GetHighestFloor",),
+ 0x80917AEC:("ObjOshihiki_SetGround",),
+ 0x80917B44:("ObjOshihiki_CheckFloor",),
+ 0x80917B9C:("ObjOshihiki_CheckGround",),
+ 0x80917C14:("ObjOshihiki_CheckWall",),
+ 0x80917E8C:("ObjOshihiki_MoveWithBlockUnder",),
+ 0x80917F88:("ObjOshihiki_SetupOnScene",),
+ 0x80917FC0:("ObjOshihiki_OnScene",),
+ 0x809180C8:("ObjOshihiki_SetupOnActor",),
+ 0x80918108:("ObjOshihiki_OnActor",),
+ 0x80918314:("ObjOshihiki_SetupPush",),
+ 0x8091834C:("ObjOshihiki_Push",),
+ 0x8091851C:("ObjOshihiki_SetupFall",),
+ 0x80918574:("ObjOshihiki_Fall",),
0x80918678:("ObjOshihiki_Update",),
0x80918700:("ObjOshihiki_Draw",),
0x80918B40:("func_80918B40",),
@@ -6912,8 +6912,8 @@
0x8091A5A0:("func_8091A5A0",),
0x8091A7B0:("func_8091A7B0",),
0x8091A8A0:("func_8091A8A0",),
- 0x8091A8C4:("func_8091A8C4",),
- 0x8091A8F4:("func_8091A8F4",),
+ 0x8091A8C4:("EnInsect_XZDistanceSquared",),
+ 0x8091A8F4:("EnInsect_InBottleRange",),
0x8091A9E4:("func_8091A9E4",),
0x8091AA78:("EnInsect_Init",),
0x8091AC4C:("EnInsect_Destroy",),
@@ -7509,8 +7509,8 @@
0x80943BC0:("func_80943BC0",),
0x80943BDC:("func_80943BDC",),
0x80943CA4:("EnDaiku_Update",),
- 0x80943E18:("func_80943E18",),
- 0x80943E60:("func_80943E60",),
+ 0x80943E18:("EnDaiku_OverrideLimbDraw",),
+ 0x80943E60:("EnDaiku_PostLimbDraw",),
0x80943EE4:("EnDaiku_Draw",),
0x809441E0:("EnNwc_Init",),
0x80944310:("EnNwc_Destroy",),
@@ -7625,9 +7625,9 @@
0x809510E4:("EnGm_Init",),
0x80951224:("EnGm_Destroy",),
0x80951264:("EnGm_Update",),
- 0x809513AC:("func_809513AC",),
- 0x809514BC:("func_809514BC",),
- 0x80951594:("func_80951594",),
+ 0x809513AC:("EnGm_OverrideLimbDraw",),
+ 0x809514BC:("EnGm_PostLimbDraw",),
+ 0x80951594:("EnGm_TransformLimbDraw",),
0x80951748:("EnGm_Draw",),
0x80952620:("EnMs_Init",),
0x80952708:("EnMs_Destroy",),
@@ -7929,23 +7929,23 @@
0x80967608:("func_80967608",),
0x809676A4:("EnWeatherTag_Update",),
0x80967784:("EnWeatherTag_Draw",),
- 0x809679D0:("func_809679D0",),
- 0x80967A48:("func_80967A48",),
- 0x80967AB4:("func_80967AB4",),
+ 0x809679D0:("EnAni_DefaultBlink",),
+ 0x80967A48:("EnAni_WaitForEyeClose",),
+ 0x80967AB4:("EnAni_WaitForEyeOpen",),
0x80967B1C:("EnAni_Init",),
0x80967CE0:("EnAni_Destroy",),
- 0x80967D20:("func_80967D20",),
- 0x80967DA0:("func_80967DA0",),
- 0x80967DCC:("func_80967DCC",),
- 0x80967E34:("func_80967E34",),
- 0x80967E90:("func_80967E90",),
- 0x80967F20:("func_80967F20",),
- 0x80967FA4:("func_80967FA4",),
- 0x809680B0:("func_809680B0",),
- 0x80968164:("func_80968164",),
+ 0x80967D20:("EnAni_SetText",),
+ 0x80967DA0:("EnAni_IdleStanding",),
+ 0x80967DCC:("EnAni_Talk",),
+ 0x80967E34:("EnAni_IdleInPain",),
+ 0x80967E90:("EnAni_FallOverInPain",),
+ 0x80967F20:("EnAni_LandOnFoot",),
+ 0x80967FA4:("EnAni_FallToGround",),
+ 0x809680B0:("EnAni_LoseBalance",),
+ 0x80968164:("EnAni_HangInTree",),
0x809682A8:("EnAni_Update",),
- 0x80968504:("func_80968504",),
- 0x8096854C:("func_8096854C",),
+ 0x80968504:("EnAni_OverrideLimbDraw",),
+ 0x8096854C:("EnAni_PostLimbDraw",),
0x8096858C:("EnAni_Draw",),
0x809687B0:("EnJs_Init",),
0x809689D4:("EnJs_Destroy",),
@@ -7992,14 +7992,14 @@
0x8096B260:("EnOkarinaEffect_Update",),
0x8096B310:("EnMag_Init",),
0x8096B5F4:("EnMag_Destroy",),
- 0x8096B604:("func_8096B604",),
+ 0x8096B604:("EnMag_UpdateDisplayEffectColors",),
0x8096B94C:("EnMag_Update",),
- 0x8096C998:("func_8096C998",),
- 0x8096CBB0:("func_8096CBB0",),
- 0x8096CDC8:("func_8096CDC8",),
- 0x8096D230:("func_8096D230",),
- 0x8096D60C:("func_8096D60C",),
- 0x8096D74C:("func_8096D74C",),
+ 0x8096C998:("EnMag_DrawTextureI8",),
+ 0x8096CBB0:("EnMag_DrawTextureIA8",),
+ 0x8096CDC8:("EnMag_DrawEffectTextures",),
+ 0x8096D230:("EnMag_DrawImageRGBA32",),
+ 0x8096D60C:("EnMag_DrawCharTexture",),
+ 0x8096D74C:("EnMag_DrawInner",),
0x8096E868:("EnMag_Draw",),
0x8096EC40:("ElfMsg2_SetupAction",),
0x8096EC4C:("func_8096EC4C",),
@@ -8351,8 +8351,8 @@
0x8098BCA8:("EnDg_Init",),
0x8098BE18:("EnDg_Destroy",),
0x8098BE44:("EnDg_Update",),
- 0x8098BFB8:("func_8098BFB8",),
- 0x8098BFD4:("func_8098BFD4",),
+ 0x8098BFB8:("EnDg_OverrideLimbDraw",),
+ 0x8098BFD4:("EnDg_PostLimbDraw",),
0x8098C06C:("EnDg_Draw",),
0x8098CA20:("func_8098CA20",),
0x8098CAD0:("func_8098CAD0",),
@@ -8478,8 +8478,8 @@
0x80993738:("func_80993738",),
0x8099386C:("func_8099386C",),
0x80993BC0:("EnWf_Update",),
- 0x80993E50:("func_80993E50",),
- 0x80993E94:("func_80993E94",),
+ 0x80993E50:("EnWf_OverrideLimbDraw",),
+ 0x80993E94:("EnWf_PostLimbDraw",),
0x80993F68:("EnWf_Draw",),
0x8099408C:("func_8099408C",),
0x809947B0:("func_809947B0",),
@@ -8615,20 +8615,20 @@
0x8099D7DC:("OceffWipe4_Destroy",),
0x8099D810:("OceffWipe4_Update",),
0x8099D870:("OceffWipe4_Draw",),
- 0x8099E790:("func_8099E790",),
- 0x8099E858:("func_8099E858",),
- 0x8099E96C:("func_8099E96C",),
- 0x8099E9E0:("func_8099E9E0",),
- 0x8099EA60:("func_8099EA60",),
- 0x8099EBD8:("func_8099EBD8",),
- 0x8099EC50:("func_8099EC50",),
- 0x8099ED4C:("func_8099ED4C",),
- 0x8099EE24:("func_8099EE24",),
+ 0x8099E790:("EnZo_SetAnimation",),
+ 0x8099E858:("EnZo_PlayWalkingSound",),
+ 0x8099E96C:("EnZo_Blink",),
+ 0x8099E9E0:("EnZo_UpdateCollider",),
+ 0x8099EA60:("EnZo_LookAtPlayer",),
+ 0x8099EBD8:("EnZo_Walk",),
+ 0x8099EC50:("EnZo_FollowPath",),
+ 0x8099ED4C:("EnZo_TreadWater",),
+ 0x8099EE24:("EnZo_DoNothing",),
0x8099EE34:("EnZo_Init",),
0x8099EF40:("EnZo_Destroy",),
0x8099EF6C:("EnZo_Update",),
- 0x8099EFF4:("func_8099EFF4",),
- 0x8099F15C:("func_8099F15C",),
+ 0x8099EFF4:("EnZo_OverrideLimbDraw",),
+ 0x8099F15C:("EnZo_PostLimbDraw",),
0x8099F268:("EnZo_Draw",),
0x8099F730:("EffectSsIceSmoke_Init",),
0x8099F7F4:("EffectSsIceSmoke_Draw",),
@@ -9033,7 +9033,7 @@
0x809C339C:("EnAob01_Update",),
0x809C33D8:("EnAob01_OverrideLimbDraw",),
0x809C35B4:("EnAob01_PostLimbDraw",),
- 0x809C35F4:("EnAob01_UnkDraw",),
+ 0x809C35F4:("EnAob01_TransformLimbDraw",),
0x809C3608:("EnAob01_Draw",),
0x809C3D80:("EnBoj01_Init",),
0x809C3D90:("EnBoj01_Destroy",),
@@ -9078,7 +9078,7 @@
0x809C5BA0:("func_809C5BA0",),
0x809C5BF4:("func_809C5BF4",),
0x809C5E14:("EnBomBowlMan_Update",),
- 0x809C5F44:("func_809C5F44",),
+ 0x809C5F44:("EnBomBowlMan_OverrideLimbDraw",),
0x809C5FC4:("EnBomBowlMan_Draw",),
0x809C64C0:("func_809C64C0",),
0x809C6578:("EnSyatekiMan_Init",),
@@ -9141,33 +9141,33 @@
0x809CB210:("EnBoj04_Destroy",),
0x809CB220:("EnBoj04_Update",),
0x809CB230:("EnBoj04_Draw",),
- 0x809CB290:("func_809CB290",),
- 0x809CB404:("func_809CB404",),
+ 0x809CB290:("EnCne01_UpdateModel",),
+ 0x809CB404:("EnCne01_TestIsTalking",),
0x809CB4A0:("func_809CB4A0",),
- 0x809CB520:("func_809CB520",),
- 0x809CB5A0:("func_809CB5A0",),
- 0x809CB5D8:("func_809CB5D8",),
- 0x809CB5FC:("func_809CB5FC",),
+ 0x809CB520:("EnCne01_FinishInit",),
+ 0x809CB5A0:("EnCne01_Walk",),
+ 0x809CB5D8:("EnCne01_FaceForward",),
+ 0x809CB5FC:("EnCne01_Talk",),
0x809CB72C:("EnCne01_Init",),
0x809CB86C:("EnCne01_Destroy",),
0x809CB898:("EnCne01_Update",),
- 0x809CB920:("func_809CB920",),
- 0x809CBBC8:("func_809CBBC8",),
- 0x809CBCA0:("func_809CBCA0",),
+ 0x809CB920:("EnCne01_OverrideLimbDraw",),
+ 0x809CBBC8:("EnCne01_PostLimbDraw",),
+ 0x809CBCA0:("EnCne01_TransformLimbDraw",),
0x809CBCB4:("EnCne01_Draw",),
- 0x809CC060:("func_809CC060",),
- 0x809CC1D4:("func_809CC1D4",),
+ 0x809CC060:("EnBba01_UpdateModel",),
+ 0x809CC1D4:("EnBba01_TestIsTalking",),
0x809CC270:("func_809CC270",),
- 0x809CC2F0:("func_809CC2F0",),
- 0x809CC370:("func_809CC370",),
- 0x809CC3A8:("func_809CC3A8",),
- 0x809CC3CC:("func_809CC3CC",),
+ 0x809CC2F0:("EnBba01_FinishInit",),
+ 0x809CC370:("EnBba01_Walk",),
+ 0x809CC3A8:("EnBba01_FaceFoward",),
+ 0x809CC3CC:("EnBba01_Talk",),
0x809CC4FC:("EnBba01_Init",),
0x809CC63C:("EnBba01_Destroy",),
0x809CC668:("EnBba01_Update",),
- 0x809CC6F0:("func_809CC6F0",),
- 0x809CC984:("func_809CC984",),
- 0x809CCA5C:("func_809CCA5C",),
+ 0x809CC6F0:("EnBba01_OverrideLimbDraw",),
+ 0x809CC984:("EnBba01_PostLimbDraw",),
+ 0x809CCA5C:("EnBba01_TransformLimbDraw",),
0x809CCA70:("EnBba01_Draw",),
0x809CCDE0:("func_809CCDE0",),
0x809CCE98:("func_809CCE98",),
@@ -9743,7 +9743,7 @@
0x80A159B0:("EnGo_Update",),
0x80A15B80:("func_80A15B80",),
0x80A15D04:("EnGo_OverrideLimbDraw",),
- 0x80A15E38:("EnGo_UnkDraw",),
+ 0x80A15E38:("EnGo_TransfromLimbDraw",),
0x80A15FEC:("func_80A15FEC",),
0x80A16D40:("func_80A16D40",),
0x80A16D6C:("func_80A16D6C",),
@@ -9787,23 +9787,23 @@
0x80A1A220:("ObjRaillift_Draw",),
0x80A1A330:("ObjRaillift_DrawDekuFlowerPlatform",),
0x80A1A360:("ObjRaillift_DrawDekuFlowerPlatformColorful",),
- 0x80A1A500:("func_80A1A500",),
- 0x80A1A56C:("func_80A1A56C",),
- 0x80A1A750:("func_80A1A750",),
+ 0x80A1A500:("BgNumaHana_SpawnOpenFlowerCollisionChild",),
+ 0x80A1A56C:("BgNumaHana_UpdatePetalPosRots",),
+ 0x80A1A750:("BgNumaHana_UpdateSettleRotation",),
0x80A1A7CC:("BgNumaHana_Init",),
0x80A1A9AC:("BgNumaHana_Destroy",),
- 0x80A1AA14:("func_80A1AA14",),
- 0x80A1AA28:("func_80A1AA28",),
- 0x80A1AA38:("func_80A1AA38",),
- 0x80A1AA4C:("func_80A1AA4C",),
- 0x80A1AAE8:("func_80A1AAE8",),
- 0x80A1AB00:("func_80A1AB00",),
- 0x80A1ABD8:("func_80A1ABD8",),
- 0x80A1ABF0:("func_80A1ABF0",),
- 0x80A1ACCC:("func_80A1ACCC",),
- 0x80A1ACE0:("func_80A1ACE0",),
- 0x80A1AE08:("func_80A1AE08",),
- 0x80A1AE1C:("func_80A1AE1C",),
+ 0x80A1AA14:("BgNumaHana_SetupDoNothing",),
+ 0x80A1AA28:("BgNumaHana_DoNothing",),
+ 0x80A1AA38:("BgNumaHana_SetupClosedIdle",),
+ 0x80A1AA4C:("BgNumaHana_ClosedIdle",),
+ 0x80A1AAE8:("BgNumaHana_SetupUnfoldInnerPetals",),
+ 0x80A1AB00:("BgNumaHana_UnfoldInnerPetals",),
+ 0x80A1ABD8:("BgNumaHana_SetupUnfoldOuterPetals",),
+ 0x80A1ABF0:("BgNumaHana_UnfoldOuterPetals",),
+ 0x80A1ACCC:("BgNumaHana_SetupRaiseFlower",),
+ 0x80A1ACE0:("BgNumaHana_RaiseFlower",),
+ 0x80A1AE08:("BgNumaHana_SetupOpenedIdle",),
+ 0x80A1AE1C:("BgNumaHana_OpenedIdle",),
0x80A1AE6C:("BgNumaHana_Update",),
0x80A1AF68:("BgNumaHana_Draw",),
0x80A1B3D0:("func_80A1B3D0",),
@@ -9892,8 +9892,8 @@
0x80A20858:("func_80A20858",),
0x80A208F8:("func_80A208F8",),
0x80A20A50:("EnSyatekiWf_Update",),
- 0x80A20CF4:("func_80A20CF4",),
- 0x80A20D10:("func_80A20D10",),
+ 0x80A20CF4:("EnSyatekiWf_OverrideLimbDraw",),
+ 0x80A20D10:("EnSyatekiWf_PostLimbDraw",),
0x80A20DA4:("EnSyatekiWf_Draw",),
0x80A21150:("func_80A21150",),
0x80A211F4:("func_80A211F4",),
@@ -10118,9 +10118,9 @@
0x80A2EAAC:("DmSa_Destroy",),
0x80A2EABC:("DmSa_DoNothing",),
0x80A2EACC:("DmSa_Update",),
- 0x80A2EB10:("func_80A2EB10",),
- 0x80A2EB2C:("func_80A2EB2C",),
- 0x80A2EB44:("func_80A2EB44",),
+ 0x80A2EB10:("DmSa_OverrideLimbDraw",),
+ 0x80A2EB2C:("DmSa_PostLimbDraw",),
+ 0x80A2EB44:("DmSa_TransformLimbDraw",),
0x80A2EB58:("func_80A2EB58",),
0x80A2EBB0:("func_80A2EBB0",),
0x80A2EBE8:("DmSa_Draw",),
@@ -10186,8 +10186,8 @@
0x80A32F48:("func_80A32F48",),
0x80A33098:("func_80A33098",),
0x80A331C4:("EnPr_Update",),
- 0x80A3357C:("func_80A3357C",),
- 0x80A335B4:("func_80A335B4",),
+ 0x80A3357C:("EnPr_OverrideLimbDraw",),
+ 0x80A335B4:("EnPr_PostLimbDraw",),
0x80A336C0:("EnPr_Draw",),
0x80A33B00:("func_80A33B00",),
0x80A33BB4:("func_80A33BB4",),
@@ -10920,7 +10920,7 @@
0x80A6CD38:("EnFall_ClockTowerOrTitleScreenMoon_PerformCutsceneActions",),
0x80A6CD74:("EnFall_Moon_PerformDefaultActions",),
0x80A6CECC:("EnFall_MoonsTear_Initialize",),
- 0x80A6CF60:("EnFall_DoNothing",),
+ 0x80A6CF60:("EnFall_MoonsTear_DoNothing",),
0x80A6CF70:("EnFall_MoonsTear_Fall",),
0x80A6D0DC:("EnFall_Update",),
0x80A6D100:("EnFall_FireBall_SetPerVertexAlpha",),
@@ -11249,7 +11249,7 @@
0x80A884E8:("EnTru_Update",),
0x80A885B8:("EnTru_OverrideLimbDraw",),
0x80A88698:("EnTru_PostLimbDraw",),
- 0x80A886D4:("func_80A886D4",),
+ 0x80A886D4:("EnTru_TransformLimbDraw",),
0x80A887E4:("EnTru_Draw",),
0x80A8B770:("EnTrt_ChangeAnim",),
0x80A8B80C:("EnTrt_TestItemSelected",),
@@ -11331,7 +11331,7 @@
0x80A8FA00:("EnTrt_UpdateHeadPosAndRot",),
0x80A8FB34:("EnTrt_OverrideLimbDraw",),
0x80A8FBB4:("EnTrt_PostLimbDraw",),
- 0x80A8FC64:("EnTrt_UnkActorDraw",),
+ 0x80A8FC64:("EnTrt_TransformLimbDraw",),
0x80A8FCE0:("EnTrt_Draw",),
0x80A903B0:("EnTest5_SetupAction",),
0x80A903BC:("EnTest5_Init",),
@@ -11530,7 +11530,7 @@
0x80AA67F8:("func_80AA67F8",),
0x80AA695C:("func_80AA695C",),
0x80AA6A04:("DmChar00_Update",),
- 0x80AA6A6C:("func_80AA6A6C",),
+ 0x80AA6A6C:("DmChar00_OverrideLimbDraw",),
0x80AA6B34:("DmChar00_Draw",),
0x80AA81E0:("DmChar01_Init",),
0x80AA8660:("DmChar01_Destroy",),
@@ -11605,8 +11605,8 @@
0x80AAD450:("func_80AAD450",),
0x80AAD4A8:("func_80AAD4A8",),
0x80AAD78C:("DmChar05_Update",),
- 0x80AAD964:("func_80AAD964",),
- 0x80AAD980:("func_80AAD980",),
+ 0x80AAD964:("DmChar05_OverrideLimbDraw",),
+ 0x80AAD980:("DmChar05_PostLimbDraw",),
0x80AAD998:("func_80AAD998",),
0x80AADA90:("func_80AADA90",),
0x80AADB4C:("func_80AADB4C",),
@@ -11667,24 +11667,24 @@
0x80AB2544:("DmChar09_Update",),
0x80AB25D8:("func_80AB25D8",),
0x80AB261C:("DmChar09_Draw",),
- 0x80AB2790:("ObjTokeidai_GetTargetSunMoonDiskRotation",),
- 0x80AB27B4:("ObjTokeidai_SetupClockOrGear",),
+ 0x80AB2790:("ObjTokeidai_GetTargetSunMoonPanelRotation",),
+ 0x80AB27B4:("ObjTokeidai_SetupClockOrExteriorGear",),
0x80AB2834:("ObjTokeidai_Clock_Init",),
- 0x80AB28C8:("ObjTokeidai_TowerGear_Init",),
+ 0x80AB28C8:("ObjTokeidai_ExteriorGear_Init",),
0x80AB29F8:("ObjTokeidai_TowerClock_Init",),
0x80AB2BBC:("ObjTokeidai_Counterweight_Init",),
0x80AB2DEC:("ObjTokeidai_Init",),
0x80AB3000:("ObjTokeidai_Destroy",),
0x80AB3010:("ObjTokeidai_RotateOnMinuteChange",),
- 0x80AB319C:("ObjTokeidai_TowerGear_Collapse",),
- 0x80AB3240:("ObjTokeidai_TowerGear_OpenedIdle",),
+ 0x80AB319C:("ObjTokeidai_ExteriorGear_Collapse",),
+ 0x80AB3240:("ObjTokeidai_ExteriorGear_OpenedIdle",),
0x80AB32F0:("ObjTokeidai_TowerClock_Fall",),
0x80AB3370:("ObjTokeidai_TowerClock_SlideOff",),
0x80AB34CC:("ObjTokeidai_TowerClock_OpenedIdle",),
0x80AB3544:("ObjTokeidai_Counterweight_Collapse",),
0x80AB3598:("ObjTokeidai_Counterweight_OpenedIdle",),
- 0x80AB363C:("ObjTokeidai_Walls_Collapse",),
- 0x80AB365C:("ObjTokeidai_Walls_Idle",),
+ 0x80AB363C:("ObjTokeidai_TerminaFieldWalls_Collapse",),
+ 0x80AB365C:("ObjTokeidai_TerminaFieldWalls_Idle",),
0x80AB36C4:("ObjTokeidai_TowerTransformation_EndCutscene",),
0x80AB3808:("ObjTokeidai_TowerOpening_FinishOpening",),
0x80AB3880:("ObjTokeidai_TowerOpening_Wait",),
@@ -11694,18 +11694,18 @@
0x80AB3B34:("ObjTokeidai_TowerOpening_Start",),
0x80AB3BB0:("ObjTokeidai_SetupTowerOpening",),
0x80AB3BD8:("ObjTokeidai_DoNothing",),
- 0x80AB3BE8:("ObjTokeidai_StaircaseIntoTower_Idle",),
+ 0x80AB3BE8:("ObjTokeidai_StaircaseToRooftop_Idle",),
0x80AB3C50:("ObjTokeidai_IsPostFirstCycleFinalHours",),
0x80AB3CCC:("ObjTokeidai_RotateOnHourChange",),
0x80AB3ED0:("ObjTokeidai_TowerClock_Idle",),
0x80AB4040:("ObjTokeidai_WallClock_Idle",),
- 0x80AB4080:("ObjTokeidai_TowerGear_Idle",),
+ 0x80AB4080:("ObjTokeidai_ExteriorGear_Idle",),
0x80AB4160:("ObjTokeidai_Counterweight_Idle",),
0x80AB4278:("ObjTokeidai_Update",),
0x80AB429C:("ObjTokeidai_Draw",),
0x80AB4394:("ObjTokeidai_Clock_Draw",),
0x80AB4664:("ObjTokeidai_Counterweight_Draw",),
- 0x80AB4894:("ObjTokeidai_TowerGear_Draw",),
+ 0x80AB4894:("ObjTokeidai_ExteriorGear_Draw",),
0x80AB4D10:("func_80AB4D10",),
0x80AB4E34:("func_80AB4E34",),
0x80AB4E58:("func_80AB4E58",),
@@ -11912,33 +11912,33 @@
0x80AC24A8:("func_80AC24A8",),
0x80AC26F0:("EnBigokuta_Init",),
0x80AC2874:("EnBigokuta_Destroy",),
- 0x80AC28B4:("func_80AC28B4",),
- 0x80AC299C:("func_80AC299C",),
- 0x80AC2A1C:("func_80AC2A1C",),
- 0x80AC2A7C:("func_80AC2A7C",),
+ 0x80AC28B4:("EnBigokuta_SetupCutsceneCamera",),
+ 0x80AC299C:("EnBigokuta_MoveCamera",),
+ 0x80AC2A1C:("EnBigokuta_ResetCamera",),
+ 0x80AC2A7C:("EnBigokuta_ShootPlayer",),
0x80AC2B4C:("func_80AC2B4C",),
- 0x80AC2B98:("func_80AC2B98",),
- 0x80AC2C30:("func_80AC2C30",),
- 0x80AC2C84:("func_80AC2C84",),
- 0x80AC2CE8:("func_80AC2CE8",),
- 0x80AC2DAC:("func_80AC2DAC",),
- 0x80AC2EBC:("func_80AC2EBC",),
- 0x80AC2F20:("func_80AC2F20",),
- 0x80AC2F64:("func_80AC2F64",),
- 0x80AC3054:("func_80AC3054",),
- 0x80AC30EC:("func_80AC30EC",),
- 0x80AC31EC:("func_80AC31EC",),
- 0x80AC33A4:("func_80AC33A4",),
- 0x80AC33C0:("func_80AC33C0",),
- 0x80AC3460:("func_80AC3460",),
- 0x80AC34A8:("func_80AC34A8",),
- 0x80AC35E8:("func_80AC35E8",),
- 0x80AC3650:("func_80AC3650",),
- 0x80AC3930:("func_80AC3930",),
- 0x80AC39A0:("func_80AC39A0",),
+ 0x80AC2B98:("EnBigokuta_IsInWater",),
+ 0x80AC2C30:("EnBigokuta_SpawnRipple",),
+ 0x80AC2C84:("EnBigokuta_SetupIdle",),
+ 0x80AC2CE8:("EnBigokuta_Idle",),
+ 0x80AC2DAC:("EnBigokuta_SetupRise",),
+ 0x80AC2EBC:("EnBigokuta_RiseOutOfWater",),
+ 0x80AC2F20:("EnBigokuta_SetupIdleAboveWater",),
+ 0x80AC2F64:("EnBigokuta_IdleAboveWater",),
+ 0x80AC3054:("EnBigokuta_UpdateOrSetupCam",),
+ 0x80AC30EC:("EnBigokuta_SetupSuckInPlayer",),
+ 0x80AC31EC:("EnBigokuta_SuckInPlayer",),
+ 0x80AC33A4:("EnBigokuta_SetupHoldPlayer",),
+ 0x80AC33C0:("EnBigokuta_HoldPlayer",),
+ 0x80AC3460:("EnBigokuta_SetupDeathCutscene",),
+ 0x80AC34A8:("EnBigokuta_PlayDeathCutscene",),
+ 0x80AC35E8:("EnBigokuta_SetupDeathEffects",),
+ 0x80AC3650:("EnBigokuta_PlayDeathEffects",),
+ 0x80AC3930:("EnBigokuta_IsNearSwampBoat",),
+ 0x80AC39A0:("EnBigokuta_CheckOneHitKill",),
0x80AC3B2C:("EnBigokuta_Update",),
- 0x80AC3D48:("func_80AC3D48",),
- 0x80AC4204:("func_80AC4204",),
+ 0x80AC3D48:("EnBigokuta_OverrideLimbDraw",),
+ 0x80AC4204:("EnBigokuta_PostLimbDraw",),
0x80AC42F8:("EnBigokuta_Draw",),
0x80AC48F0:("BgIcefloe_Init",),
0x80AC4A04:("BgIcefloe_Destroy",),
@@ -12149,12 +12149,12 @@
0x80AD1634:("func_80AD1634",),
0x80AD16A8:("func_80AD16A8",),
0x80AD19A0:("func_80AD19A0",),
- 0x80AD1A4C:("func_80AD1A4C",),
+ 0x80AD1A4C:("EnOsn_Idle",),
0x80AD1A5C:("EnOsn_Init",),
0x80AD1C88:("EnOsn_Destroy",),
0x80AD1CC8:("EnOsn_Update",),
- 0x80AD1DA8:("func_80AD1DA8",),
- 0x80AD1E28:("func_80AD1E28",),
+ 0x80AD1DA8:("EnOsn_OverrideLimbDraw",),
+ 0x80AD1E28:("EnOsn_PostLimbDraw",),
0x80AD1F88:("EnOsn_Draw",),
0x80AD2B70:("BgCtowerGear_Splash",),
0x80AD2E84:("BgCtowerGear_Init",),
@@ -12206,9 +12206,9 @@
0x80AD5150:("EnTrt2_Update",),
0x80AD5234:("func_80AD5234",),
0x80AD5394:("func_80AD5394",),
- 0x80AD54C8:("func_80AD54C8",),
- 0x80AD5584:("func_80AD5584",),
- 0x80AD566C:("func_80AD566C",),
+ 0x80AD54C8:("EnTrt2_OverrideLimbDraw",),
+ 0x80AD5584:("EnTrt2_PostLimbDraw",),
+ 0x80AD566C:("EnTrt2_UnkDraw",),
0x80AD56E8:("func_80AD56E8",),
0x80AD5BB0:("ObjTokeiStep_SetSysMatrix",),
0x80AD5BE8:("ObjTokeiStep_AddQuake",),
@@ -12328,7 +12328,7 @@
0x80ADD400:("EnSellnuts_Update",),
0x80ADD4E0:("func_80ADD4E0",),
0x80ADD7B4:("func_80ADD7B4",),
- 0x80ADD7CC:("func_80ADD7CC",),
+ 0x80ADD7CC:("EnSellnuts_TransformLimbDraw",),
0x80ADD8A4:("EnSellnuts_Draw",),
0x80ADE230:("func_80ADE230",),
0x80ADE5A4:("BgDkjailIvy_Init",),
@@ -12604,8 +12604,8 @@
0x80AEF2D8:("func_80AEF2D8",),
0x80AEF3E8:("EnTk_Update",),
0x80AEF5F4:("func_80AEF5F4",),
- 0x80AEF65C:("func_80AEF65C",),
- 0x80AEF6A4:("func_80AEF6A4",),
+ 0x80AEF65C:("EnTk_OverrideLimbDraw",),
+ 0x80AEF6A4:("EnTk_PostLimbDraw",),
0x80AEF734:("EnTk_Draw",),
0x80AF0060:("BgMarketStep_Init",),
0x80AF0088:("BgMarketStep_Draw",),
@@ -12772,9 +12772,9 @@
0x80AFA7A8:("EnPm_Init",),
0x80AFA8B0:("EnPm_Destroy",),
0x80AFA8F0:("EnPm_Update",),
- 0x80AFAA04:("func_80AFAA04",),
- 0x80AFAA44:("func_80AFAA44",),
- 0x80AFABAC:("func_80AFABAC",),
+ 0x80AFAA04:("EnPm_OverrideLimbDraw",),
+ 0x80AFAA44:("EnPm_PostLimbDraw",),
+ 0x80AFABAC:("EnPm_TransformLimbDraw",),
0x80AFACAC:("EnPm_Draw",),
0x80AFC960:("func_80AFC960",),
0x80AFCA94:("EnGakufu_Init",),
@@ -12819,8 +12819,8 @@
0x80AFEB0C:("EnTalkGibud_Destroy",),
0x80AFEB38:("EnTalkGibud_SetupIdle",),
0x80AFEB7C:("EnTalkGibud_Idle",),
- 0x80AFEC08:("EnTalkGibud_SetupAttemptPlayerStun",),
- 0x80AFEC4C:("EnTalkGibud_AttemptStun",),
+ 0x80AFEC08:("EnTalkGibud_SetupAttemptPlayerFreeze",),
+ 0x80AFEC4C:("EnTalkGibud_AttemptPlayerFreeze",),
0x80AFED08:("EnTalkGibud_SetupWalkToPlayer",),
0x80AFED7C:("EnTalkGibud_WalkToPlayer",),
0x80AFEFD4:("EnTalkGibud_SetupGrab",),
@@ -12857,8 +12857,8 @@
0x80B00760:("EnTalkGibud_MoveToIdealGrabPositionAndRotation",),
0x80B008BC:("EnTalkGibud_PlayAnimation",),
0x80B008FC:("EnTalkGibud_MoveWithGravity",),
- 0x80B0094C:("EnTalkGibud_CheckDamageEffect",),
- 0x80B00B8C:("EnTalkGibud_CheckCollision",),
+ 0x80B0094C:("EnTalkGibud_UpdateDamage",),
+ 0x80B00B8C:("EnTalkGibud_UpdateCollision",),
0x80B00C94:("EnTalkGibud_MoveGrabbedPlayerAwayFromWall",),
0x80B00D9C:("EnTalkGibud_UpdateEffect",),
0x80B00E48:("EnTalkGibud_Update",),
@@ -13330,8 +13330,8 @@
0x80B279F0:("func_80B279F0",),
0x80B27A90:("func_80B27A90",),
0x80B27ACC:("EnKendoJs_Update",),
- 0x80B27B54:("func_80B27B54",),
- 0x80B27B8C:("func_80B27B8C",),
+ 0x80B27B54:("EnKendoJs_OverrideLimbDraw",),
+ 0x80B27B8C:("EnKendoJs_PostLimbDraw",),
0x80B27BA4:("EnKendoJs_Draw",),
0x80B28080:("BgBotihasira_Init",),
0x80B28124:("BgBotihasira_Destroy",),
@@ -13484,9 +13484,9 @@
0x80B32E74:("EnZoraegg_Update",),
0x80B32F04:("func_80B32F04",),
0x80B331C8:("func_80B331C8",),
- 0x80B3336C:("func_80B3336C",),
+ 0x80B3336C:("EnZoraegg_OverrideLimbDraw",),
0x80B333DC:("func_80B333DC",),
- 0x80B33480:("func_80B33480",),
+ 0x80B33480:("EnZoraegg_PostLimbDraw",),
0x80B33818:("func_80B33818",),
0x80B338C0:("EnZoraegg_Draw",),
0x80B33D30:("EnKbt_Init",),
@@ -13527,8 +13527,8 @@
0x80B364F8:("EnGg_Init",),
0x80B36660:("EnGg_Destroy",),
0x80B36670:("EnGg_Update",),
- 0x80B368B0:("func_80B368B0",),
- 0x80B368F0:("func_80B368F0",),
+ 0x80B368B0:("EnGg_OverrideLimbDraw",),
+ 0x80B368F0:("EnGg_PostLimbDraw",),
0x80B36A34:("EnGg_Draw",),
0x80B37080:("EnMaruta_Init",),
0x80B37280:("EnMaruta_Destroy",),
@@ -13633,8 +13633,8 @@
0x80B3D7B8:("EnDnp_Destroy",),
0x80B3D7E4:("EnDnp_Update",),
0x80B3D974:("func_80B3D974",),
- 0x80B3DA88:("func_80B3DA88",),
- 0x80B3DAA0:("func_80B3DAA0",),
+ 0x80B3DA88:("EnDnp_PostLimbDraw",),
+ 0x80B3DAA0:("EnDnp_TransformLimbDraw",),
0x80B3DB98:("EnDnp_Draw",),
0x80B3DFF0:("func_80B3DFF0",),
0x80B3E168:("func_80B3E168",),
@@ -13657,9 +13657,9 @@
0x80B3F318:("EnDai_Init",),
0x80B3F494:("EnDai_Destroy",),
0x80B3F4A4:("EnDai_Update",),
- 0x80B3F598:("func_80B3F598",),
- 0x80B3F614:("func_80B3F614",),
- 0x80B3F6EC:("func_80B3F6EC",),
+ 0x80B3F598:("EnDai_OverrideLimbDraw",),
+ 0x80B3F614:("EnDai_PostLimbDraw",),
+ 0x80B3F6EC:("EnDai_TransformLimbDraw",),
0x80B3F78C:("func_80B3F78C",),
0x80B3F920:("func_80B3F920",),
0x80B3FB84:("EnDai_Draw",),
@@ -14003,9 +14003,9 @@
0x80B526FC:("EnGk_Init",),
0x80B529B8:("EnGk_Destroy",),
0x80B529E4:("EnGk_Update",),
- 0x80B52AD4:("func_80B52AD4",),
- 0x80B52AF0:("func_80B52AF0",),
- 0x80B52D8C:("func_80B52D8C",),
+ 0x80B52AD4:("EnGk_OverrideLimbDraw",),
+ 0x80B52AF0:("EnGk_PostLimbDraw",),
+ 0x80B52D8C:("EnGk_TransformDraw",),
0x80B52F74:("EnGk_Draw",),
0x80B53840:("func_80B53840",),
0x80B539CC:("func_80B539CC",),
@@ -14407,35 +14407,35 @@
0x80B72E88:("EnRailSkb_OverrideLimbDraw",),
0x80B7302C:("EnRailSkb_PostLimbDraw",),
0x80B731EC:("EnRailSkb_Draw",),
- 0x80B73A90:("func_80B73A90",),
- 0x80B73AE4:("func_80B73AE4",),
- 0x80B73B98:("func_80B73B98",),
- 0x80B73C58:("func_80B73C58",),
- 0x80B73DF4:("func_80B73DF4",),
- 0x80B73E3C:("func_80B73E3C",),
- 0x80B73F1C:("func_80B73F1C",),
- 0x80B7406C:("func_80B7406C",),
- 0x80B7408C:("func_80B7408C",),
- 0x80B74134:("func_80B74134",),
- 0x80B741F8:("func_80B741F8",),
- 0x80B742F8:("func_80B742F8",),
- 0x80B74440:("func_80B74440",),
- 0x80B74550:("func_80B74550",),
- 0x80B747C8:("func_80B747C8",),
- 0x80B74840:("func_80B74840",),
- 0x80B749D0:("func_80B749D0",),
- 0x80B74AD8:("func_80B74AD8",),
- 0x80B74B54:("func_80B74B54",),
- 0x80B74BC8:("func_80B74BC8",),
- 0x80B74E5C:("func_80B74E5C",),
- 0x80B750A0:("func_80B750A0",),
- 0x80B7517C:("func_80B7517C",),
- 0x80B751F8:("func_80B751F8",),
+ 0x80B73A90:("EnJg_GetShrineGoronToFocusOn",),
+ 0x80B73AE4:("EnJg_UpdateCollision",),
+ 0x80B73B98:("EnJg_GetWalkingYRotation",),
+ 0x80B73C58:("EnJg_ReachedPoint",),
+ 0x80B73DF4:("EnJg_GetCutsceneForTeachingLullabyIntro",),
+ 0x80B73E3C:("EnJg_SetupGoronShrineCheer",),
+ 0x80B73F1C:("EnJg_SetupTalk",),
+ 0x80B7406C:("EnJg_Idle",),
+ 0x80B7408C:("EnJg_GoronShrineIdle",),
+ 0x80B74134:("EnJg_GoronShrineTalk",),
+ 0x80B741F8:("EnJg_GoronShrineCheer",),
+ 0x80B742F8:("EnJg_AlternateTalkOrWalkInPlace",),
+ 0x80B74440:("EnJg_Walk",),
+ 0x80B74550:("EnJg_Talk",),
+ 0x80B747C8:("EnJg_SetupWalk",),
+ 0x80B74840:("EnJg_Freeze",),
+ 0x80B749D0:("EnJg_FrozenIdle",),
+ 0x80B74AD8:("EnJg_EndFrozenInteraction",),
+ 0x80B74B54:("EnJg_TeachLullabyIntro",),
+ 0x80B74BC8:("EnJg_LullabyIntroCutsceneAction",),
+ 0x80B74E5C:("EnJg_GetNextTextId",),
+ 0x80B750A0:("EnJg_GetStartingConversationTextId",),
+ 0x80B7517C:("EnJg_SpawnBreath",),
+ 0x80B751F8:("EnJg_CheckIfTalkingToPlayerAndHandleFreezeTimer",),
0x80B753A0:("EnJg_Init",),
0x80B75564:("EnJg_Destroy",),
0x80B75590:("EnJg_Update",),
- 0x80B75658:("func_80B75658",),
- 0x80B75708:("func_80B75708",),
+ 0x80B75658:("EnJg_OverrideLimbDraw",),
+ 0x80B75708:("EnJg_PostLimbDraw",),
0x80B757AC:("EnJg_Draw",),
0x80B76030:("func_80B76030",),
0x80B76110:("func_80B76110",),
@@ -14870,7 +14870,7 @@
0x80B95128:("func_80B95128",),
0x80B95240:("func_80B95240",),
0x80B95260:("EnZog_Update",),
- 0x80B954C4:("func_80B954C4",),
+ 0x80B954C4:("EnZog_PostLimbDraw",),
0x80B95598:("func_80B95598",),
0x80B95668:("EnZog_Draw",),
0x80B95E20:("func_80B95E20",),
@@ -15118,56 +15118,56 @@
0x80BA4CB4:("func_80BA4CB4",),
0x80BA4E2C:("EnToto_Update",),
0x80BA4EFC:("EnToto_Draw",),
- 0x80BA5400:("func_80BA5400",),
+ 0x80BA5400:("EnRailgibud_SpawnOtherGibdosAndSetPositionAndRotation",),
0x80BA5620:("EnRailgibud_Init",),
0x80BA577C:("EnRailgibud_Destroy",),
- 0x80BA57A8:("func_80BA57A8",),
- 0x80BA57F8:("func_80BA57F8",),
- 0x80BA59F0:("func_80BA59F0",),
- 0x80BA5A34:("func_80BA5A34",),
- 0x80BA5AF0:("func_80BA5AF0",),
- 0x80BA5B64:("func_80BA5B64",),
- 0x80BA5DBC:("func_80BA5DBC",),
- 0x80BA5E18:("func_80BA5E18",),
- 0x80BA6054:("func_80BA6054",),
- 0x80BA60B0:("func_80BA60B0",),
- 0x80BA6158:("func_80BA6158",),
- 0x80BA61A0:("func_80BA61A0",),
- 0x80BA6284:("func_80BA6284",),
- 0x80BA62D4:("func_80BA62D4",),
- 0x80BA6440:("func_80BA6440",),
- 0x80BA64AC:("func_80BA64AC",),
- 0x80BA6584:("func_80BA6584",),
- 0x80BA6604:("func_80BA6604",),
- 0x80BA6664:("func_80BA6664",),
- 0x80BA66C8:("func_80BA66C8",),
- 0x80BA6800:("func_80BA6800",),
- 0x80BA6974:("func_80BA6974",),
- 0x80BA6B30:("func_80BA6B30",),
- 0x80BA6B9C:("func_80BA6B9C",),
- 0x80BA6D10:("func_80BA6D10",),
- 0x80BA6DAC:("func_80BA6DAC",),
- 0x80BA6DF8:("func_80BA6DF8",),
- 0x80BA7088:("func_80BA7088",),
- 0x80BA71E4:("func_80BA71E4",),
- 0x80BA7234:("func_80BA7234",),
- 0x80BA7388:("func_80BA7388",),
- 0x80BA7434:("func_80BA7434",),
- 0x80BA7578:("func_80BA7578",),
- 0x80BA76C4:("func_80BA76C4",),
+ 0x80BA57A8:("EnRailgibud_SetupWalkInCircles",),
+ 0x80BA57F8:("EnRailgibud_WalkInCircles",),
+ 0x80BA59F0:("EnRailgibud_SetupAttemptPlayerFreeze",),
+ 0x80BA5A34:("EnRailgibud_AttemptPlayerFreeze",),
+ 0x80BA5AF0:("EnRailgibud_SetupWalkToPlayer",),
+ 0x80BA5B64:("EnRailgibud_WalkToPlayer",),
+ 0x80BA5DBC:("EnRailgibud_SetupGrab",),
+ 0x80BA5E18:("EnRailgibud_Grab",),
+ 0x80BA6054:("EnRailgibud_SetupGrabFail",),
+ 0x80BA60B0:("EnRailgibud_GrabFail",),
+ 0x80BA6158:("EnRailgibud_SetupTurnAwayAndShakeHead",),
+ 0x80BA61A0:("EnRailgibud_TurnAwayAndShakeHead",),
+ 0x80BA6284:("EnRailgibud_SetupWalkToHome",),
+ 0x80BA62D4:("EnRailgibud_WalkToHome",),
+ 0x80BA6440:("EnRailgibud_SetupDamage",),
+ 0x80BA64AC:("EnRailgibud_Damage",),
+ 0x80BA6584:("EnRailgibud_SetupStunned",),
+ 0x80BA6604:("EnRailgibud_Stunned",),
+ 0x80BA6664:("EnRailgibud_SetupDead",),
+ 0x80BA66C8:("EnRailgibud_Dead",),
+ 0x80BA6800:("EnRailgibud_SpawnEffectsForSinkingIntoTheGround",),
+ 0x80BA6974:("EnRailgibud_SpawnDust",),
+ 0x80BA6B30:("EnRailgibud_UpdateWalkForwardState",),
+ 0x80BA6B9C:("EnRailgibud_TurnTowardsPlayer",),
+ 0x80BA6D10:("EnRailgibud_PlayerInRangeWithCorrectState",),
+ 0x80BA6DAC:("EnRailgibud_PlayerOutOfRange",),
+ 0x80BA6DF8:("EnRailgibud_UpdateDamage",),
+ 0x80BA7088:("EnRailgibud_MoveToIdealGrabPositionAndRotation",),
+ 0x80BA71E4:("EnRailgibud_MoveWithGravity",),
+ 0x80BA7234:("EnRailgibud_MoveGrabbedPlayerAwayFromWall",),
+ 0x80BA7388:("EnRailgibud_UpdateEffect",),
+ 0x80BA7434:("EnRailgibud_CheckForGibdoMask",),
+ 0x80BA7578:("EnRailgibud_CheckIfTalkingToPlayer",),
+ 0x80BA76C4:("EnRailgibud_UpdateCollision",),
0x80BA77A0:("EnRailgibud_Update",),
- 0x80BA7878:("func_80BA7878",),
- 0x80BA789C:("func_80BA789C",),
- 0x80BA78F8:("func_80BA78F8",),
+ 0x80BA7878:("EnRailgibud_MainGibdo_DeadUpdate",),
+ 0x80BA789C:("EnRailgibud_OverrideLimbDraw",),
+ 0x80BA78F8:("EnRailgibud_PostLimbDraw",),
0x80BA79D4:("EnRailgibud_Draw",),
- 0x80BA7B6C:("func_80BA7B6C",),
- 0x80BA7C78:("func_80BA7C78",),
- 0x80BA7CF0:("func_80BA7CF0",),
- 0x80BA7D04:("func_80BA7D04",),
- 0x80BA7D14:("func_80BA7D14",),
- 0x80BA7D30:("func_80BA7D30",),
- 0x80BA7DC8:("func_80BA7DC8",),
- 0x80BA8050:("func_80BA8050",),
+ 0x80BA7B6C:("EnRailgibud_InitCutsceneGibdo",),
+ 0x80BA7C78:("EnRailgibud_InitActorActionCommand",),
+ 0x80BA7CF0:("EnRailgibud_SetupDoNothing",),
+ 0x80BA7D04:("EnRailgibud_DoNothing",),
+ 0x80BA7D14:("EnRailgibud_SetupSinkIntoGround",),
+ 0x80BA7D30:("EnRailgibud_SinkIntoGround",),
+ 0x80BA7DC8:("EnRailgibud_PerformCutsceneActions",),
+ 0x80BA8050:("EnRailgibud_Cutscene_Update",),
0x80BA8820:("func_80BA8820",),
0x80BA886C:("func_80BA886C",),
0x80BA8C4C:("func_80BA8C4C",),
@@ -15192,9 +15192,9 @@
0x80BA9E6C:("EnBaba_Init",),
0x80BA9F24:("EnBaba_Destroy",),
0x80BA9F50:("EnBaba_Update",),
- 0x80BA9FB0:("func_80BA9FB0",),
- 0x80BAA198:("func_80BAA198",),
- 0x80BAA20C:("func_80BAA20C",),
+ 0x80BA9FB0:("EnBaba_OverrideLimbDraw",),
+ 0x80BAA198:("EnBaba_PostLimbDraw",),
+ 0x80BAA20C:("EnBaba_TransformLimbDraw",),
0x80BAA220:("EnBaba_Draw",),
0x80BAA6D0:("EnSuttari_UpdateCollider",),
0x80BAA848:("EnSuttari_GetActorById",),
@@ -15247,7 +15247,7 @@
0x80BAE108:("EnSuttari_Update",),
0x80BAE250:("EnSuttari_OverrideLimbDraw",),
0x80BAE3C4:("EnSuttari_PostLimbDraw",),
- 0x80BAE524:("EnSuttari_UnkDraw",),
+ 0x80BAE524:("EnSuttari_TransformLimbDraw",),
0x80BAE538:("EnSuttari_Draw",),
0x80BAEF70:("EnZod_Init",),
0x80BAF1C0:("EnZod_Destroy",),
@@ -15326,7 +15326,7 @@
0x80BB3728:("func_80BB3728",),
0x80BB3860:("EnGeg_OverrideLimbDraw",),
0x80BB387C:("EnGeg_PostLimbDraw",),
- 0x80BB39F8:("EnGeg_UnkDraw",),
+ 0x80BB39F8:("EnGeg_TransformLimbDraw",),
0x80BB3BE0:("func_80BB3BE0",),
0x80BB3CB4:("func_80BB3CB4",),
0x80BB3E0C:("EnGeg_Draw",),
@@ -15503,9 +15503,9 @@
0x80BC2388:("EnJa_Init",),
0x80BC2498:("EnJa_Destroy",),
0x80BC24C4:("EnJa_Update",),
- 0x80BC25E0:("func_80BC25E0",),
- 0x80BC2620:("func_80BC2620",),
- 0x80BC2B30:("func_80BC2B30",),
+ 0x80BC25E0:("EnJa_OverrideLimbDraw",),
+ 0x80BC2620:("EnJa_PostLimbDraw",),
+ 0x80BC2B30:("EnJa_TransformDraw",),
0x80BC2CE4:("EnJa_Draw",),
0x80BC2EA4:("func_80BC2EA4",),
0x80BC3154:("func_80BC3154",),
@@ -15641,9 +15641,9 @@
0x80BCC508:("EnScopenuts_Init",),
0x80BCC77C:("EnScopenuts_Destroy",),
0x80BCC7A8:("EnScopenuts_Update",),
- 0x80BCC828:("func_80BCC828",),
- 0x80BCC9CC:("func_80BCC9CC",),
- 0x80BCC9E4:("func_80BCC9E4",),
+ 0x80BCC828:("EnScopenuts_OverrideLimbDraw",),
+ 0x80BCC9CC:("EnScopenuts_PostLimbDraw",),
+ 0x80BCC9E4:("EnScopenuts_TransformLimbDraw",),
0x80BCCAAC:("EnScopenuts_Draw",),
0x80BCD000:("func_80BCD000",),
0x80BCD09C:("func_80BCD09C",),
@@ -15700,14 +15700,14 @@
0x80BD0434:("func_80BD0434",),
0x80BD049C:("func_80BD049C",),
0x80BD04E0:("func_80BD04E0",),
- 0x80BD064C:("func_80BD064C",),
- 0x80BD0660:("func_80BD0660",),
+ 0x80BD064C:("EnHgo_SetupDialogueHandler",),
+ 0x80BD0660:("EnHgo_DefaultDialogueHandler",),
0x80BD06FC:("func_80BD06FC",),
0x80BD0898:("func_80BD0898",),
0x80BD0B8C:("func_80BD0B8C",),
0x80BD0C30:("EnHgo_Update",),
- 0x80BD0CF0:("func_80BD0CF0",),
- 0x80BD0D38:("func_80BD0D38",),
+ 0x80BD0CF0:("EnHgo_OverrideLimbDraw",),
+ 0x80BD0D38:("EnHgo_PostLimbDraw",),
0x80BD0D7C:("EnHgo_Draw",),
0x80BD11E0:("EnZov_Init",),
0x80BD13B0:("EnZov_Destroy",),
@@ -15730,8 +15730,8 @@
0x80BD1F1C:("func_80BD1F1C",),
0x80BD1FC8:("func_80BD1FC8",),
0x80BD20B4:("EnZov_Update",),
- 0x80BD2380:("func_80BD2380",),
- 0x80BD2404:("func_80BD2404",),
+ 0x80BD2380:("EnZov_OverrideLimbDraw",),
+ 0x80BD2404:("EnZov_PostLimbDraw",),
0x80BD24B4:("EnZov_Draw",),
0x80BD2A30:("func_80BD2A30",),
0x80BD2AE0:("func_80BD2AE0",),
@@ -16029,9 +16029,9 @@
0x80BDF75C:("EnAl_Init",),
0x80BDF840:("EnAl_Destroy",),
0x80BDF86C:("EnAl_Update",),
- 0x80BDF914:("func_80BDF914",),
- 0x80BDF950:("func_80BDF950",),
- 0x80BDFA34:("func_80BDFA34",),
+ 0x80BDF914:("EnAl_OverrideLimbDraw",),
+ 0x80BDF950:("EnAl_PostLimbDraw",),
+ 0x80BDFA34:("EnAl_TransformLimbDraw",),
0x80BDFB30:("EnAl_Draw",),
0x80BE04E0:("func_80BE04E0",),
0x80BE0590:("func_80BE0590",),
@@ -16170,14 +16170,14 @@
0x80BE93D8:("EnHeishi_Draw",),
0x80BE9510:("EnDemoheishi_Init",),
0x80BE95C0:("EnDemoheishi_Destroy",),
- 0x80BE95EC:("func_80BE95EC",),
- 0x80BE9678:("func_80BE9678",),
- 0x80BE970C:("func_80BE970C",),
- 0x80BE975C:("func_80BE975C",),
- 0x80BE97F0:("func_80BE97F0",),
- 0x80BE980C:("func_80BE980C",),
+ 0x80BE95EC:("EnDemoheishi_ChangeAnimation",),
+ 0x80BE9678:("EnDemoheishi_SetHeadRotation",),
+ 0x80BE970C:("EnDemoheishi_SetupIdle",),
+ 0x80BE975C:("EnDemoheishi_Idle",),
+ 0x80BE97F0:("EnDemoheishi_SetupTalk",),
+ 0x80BE980C:("EnDemoheishi_Talk",),
0x80BE9864:("EnDemoheishi_Update",),
- 0x80BE9974:("func_80BE9974",),
+ 0x80BE9974:("EnDemoheishi_OverrideLimbDraw",),
0x80BE99CC:("EnDemoheishi_Draw",),
0x80BE9B20:("EnDt_Init",),
0x80BE9C48:("EnDt_Destroy",),
@@ -16274,7 +16274,7 @@
0x80BEFF34:("EnAkindonuts_Update",),
0x80BEFFB4:("EnAkindonuts_OverrideLimbDraw",),
0x80BF0178:("EnAkindonuts_PostLimbDraw",),
- 0x80BF0190:("EnAkindonuts_UnkActorDraw",),
+ 0x80BF0190:("EnAkindonuts_TransformLimbDraw",),
0x80BF0258:("EnAkindonuts_Draw",),
0x80BF0D90:("EffStk_Init",),
0x80BF0DD0:("EffStk_Destroy",),
@@ -16315,9 +16315,9 @@
0x80BF2CC0:("EnIg_Init",),
0x80BF2DC4:("EnIg_Destroy",),
0x80BF2E04:("EnIg_Update",),
- 0x80BF2EDC:("func_80BF2EDC",),
- 0x80BF2EFC:("func_80BF2EFC",),
- 0x80BF302C:("func_80BF302C",),
+ 0x80BF2EDC:("EnIg_OverrideLimbDraw",),
+ 0x80BF2EFC:("EnIg_PostLimbDraw",),
+ 0x80BF302C:("EnIg_UnkDraw",),
0x80BF312C:("EnIg_Draw",),
0x80BF3920:("func_80BF3920",),
0x80BF3C64:("func_80BF3C64",),
@@ -16379,24 +16379,24 @@
0x80BFA100:("EnYb_Init",),
0x80BFA2D0:("EnYb_Destroy",),
0x80BFA2FC:("func_80BFA2FC",),
- 0x80BFA350:("func_80BFA350",),
- 0x80BFA444:("func_80BFA444",),
- 0x80BFA5CC:("func_80BFA5CC",),
- 0x80BFA634:("func_80BFA634",),
- 0x80BFA67C:("func_80BFA67C",),
- 0x80BFA6E0:("func_80BFA6E0",),
- 0x80BFA710:("func_80BFA710",),
- 0x80BFA730:("func_80BFA730",),
- 0x80BFA868:("func_80BFA868",),
- 0x80BFA91C:("func_80BFA91C",),
- 0x80BFA9D4:("func_80BFA9D4",),
- 0x80BFAB4C:("func_80BFAB4C",),
- 0x80BFABF0:("func_80BFABF0",),
- 0x80BFAC88:("func_80BFAC88",),
- 0x80BFAE80:("func_80BFAE80",),
+ 0x80BFA350:("EnYb_ActorShadowFunc",),
+ 0x80BFA444:("EnYb_SetAnimation",),
+ 0x80BFA5CC:("EnYb_CanTalk",),
+ 0x80BFA634:("EnYb_UpdateAnimation",),
+ 0x80BFA67C:("EnYb_FinishTeachingCutscene",),
+ 0x80BFA6E0:("EnYb_ChangeCutscene",),
+ 0x80BFA710:("EnYb_EnableProximityMusic",),
+ 0x80BFA730:("EnYb_Disappear",),
+ 0x80BFA868:("EnYb_SetupLeaving",),
+ 0x80BFA91C:("EnYb_ReceiveMask",),
+ 0x80BFA9D4:("EnYb_Talk",),
+ 0x80BFAB4C:("EnYb_TeachingDanceFinish",),
+ 0x80BFABF0:("EnYb_TeachingDance",),
+ 0x80BFAC88:("EnYb_Idle",),
+ 0x80BFAE80:("EnYb_WaitForMidnight",),
0x80BFAEFC:("EnYb_Update",),
- 0x80BFB074:("func_80BFB074",),
- 0x80BFB0E0:("func_80BFB0E0",),
+ 0x80BFB074:("EnYb_PostLimbDrawOpa",),
+ 0x80BFB0E0:("EnYb_PostLimbDrawXlu",),
0x80BFB14C:("EnYb_Draw",),
0x80BFB480:("EnRz_Init",),
0x80BFB780:("func_80BFB780",),
@@ -16618,10 +16618,10 @@
0x80C08950:("EnNnh_Draw",),
0x80C08A80:("ObjKzsaku_Init",),
0x80C08B2C:("ObjKzsaku_Destroy",),
- 0x80C08B60:("func_80C08B60",),
- 0x80C08B7C:("func_80C08B7C",),
+ 0x80C08B60:("ObjKzsaku_SetupIdle",),
+ 0x80C08B7C:("ObjKzsaku_Idle",),
0x80C08BBC:("func_80C08BBC",),
- 0x80C08BD0:("func_80C08BD0",),
+ 0x80C08BD0:("ObjKzsaku_Rise",),
0x80C08C84:("func_80C08C84",),
0x80C08CB0:("func_80C08CB0",),
0x80C08D20:("ObjKzsaku_Update",),
@@ -16745,7 +16745,7 @@
0x80C102D4:("EnRecepgirl_Talk",),
0x80C104E8:("EnRecepgirl_Update",),
0x80C10558:("EnRecepgirl_OverrideLimbDraw",),
- 0x80C10590:("EnRecepgirl_UnkLimbDraw",),
+ 0x80C10590:("EnRecepgirl_TransformLimbDraw",),
0x80C105EC:("EnRecepgirl_Draw",),
0x80C10770:("EnThiefbird_Init",),
0x80C10958:("EnThiefbird_Destroy",),
@@ -16972,7 +16972,7 @@
0x80C1E048:("DmNb_Init",),
0x80C1E0F8:("DmNb_Destroy",),
0x80C1E108:("DmNb_Update",),
- 0x80C1E168:("DmNb_UnkActorDraw",),
+ 0x80C1E168:("DmNb_TransformLimbDraw",),
0x80C1E17C:("DmNb_Draw",),
0x80C1E290:("func_80C1E290",),
0x80C1E2D4:("func_80C1E2D4",),
@@ -17046,8 +17046,8 @@
0x80C21468:("func_80C21468",),
0x80C215E4:("func_80C215E4",),
0x80C21790:("EnHintSkb_Update",),
- 0x80C21858:("func_80C21858",),
- 0x80C219D4:("func_80C219D4",),
+ 0x80C21858:("EnHintSkb_OverrideLimbDraw",),
+ 0x80C219D4:("EnHintSkb_PostLimbDraw",),
0x80C21B9C:("EnHintSkb_Draw",),
0x80C22350:("func_80C22350",),
0x80C22400:("func_80C22400",),
@@ -17090,7 +17090,7 @@
0x80C23980:("func_80C23980",),
0x80C2399C:("func_80C2399C",),
0x80C239C8:("EnEndingHero5_Update",),
- 0x80C23A30:("func_80C23A30",),
+ 0x80C23A30:("EnEndingHero5_PostLimbDraw",),
0x80C23A7C:("EnEndingHero5_Draw",),
0x80C23C90:("EnEndingHero6_Init",),
0x80C23D50:("EnEndingHero6_Destroy",),
diff --git a/tools/disasm/variables.txt b/tools/disasm/variables.txt
index dd7df18da7..f6f7ba3219 100644
--- a/tools/disasm/variables.txt
+++ b/tools/disasm/variables.txt
@@ -72,7 +72,7 @@
0x80097FA0:("D_80097FA0","UNK_TYPE1","",0x1),
0x80097FA4:("D_80097FA4","UNK_TYPE1","",0x1),
0x80097FA5:("D_80097FA5","UNK_TYPE1","",0x1),
- 0x80097FB0:("D_80097FB0","UNK_TYPE4","",0x4),
+ 0x80097FB0:("__osPfsLastChannel","s32","",0x4),
0x80097FC0:("osViModeNtscLan1","OSViMode","",0x50),
0x80098010:("osViModeMpalLan1","OSViMode","",0x50),
0x80098060:("D_80098060","__OSViContext","[2]",0x60),
@@ -365,9 +365,9 @@
0x8009F8A0:("viRetrace","u16","",0x2),
0x8009F8B0:("dmadata","DmaEntry","[1568]",0x6200),
0x80186028:("D_80186028","s16","[1316]",0xa48),
- 0x801AAAB0:("D_801AAAB0","UNK_TYPE1","",0x1),
- 0x801ABAB0:("D_801ABAB0","UNK_TYPE1","",0x1),
- 0x801AD370:("gJpegUCode","UNK_TYPE1","",0x1),
+ 0x801AAAB0:("aspMainTextStart","UNK_TYPE1","",0x1),
+ 0x801ABAB0:("gspS2DEX2_fifoTextStart","UNK_TYPE1","",0x1),
+ 0x801AD370:("njpgdspMainTextStart","UNK_TYPE1","",0x1),
0x801ADE60:("En_A_Obj_InitVars","ActorInit","",0x20),
0x801ADE80:("enAObjCylinderInit","ColliderCylinderInit","",0x2c),
0x801ADEAC:("enAObjInitVar","ActorInitVar","",0x4),
@@ -907,7 +907,7 @@
0x801BB124:("D_801BB124","UNK_TYPE2","",0x2),
0x801BB128:("D_801BB128","UNK_TYPE2","",0x2),
0x801BB12C:("D_801BB12C","UNK_TYPE1","",0x1),
- 0x801BB130:("D_801BB130","UNK_TYPE1","",0x1),
+ 0x801BB130:("sCutsceneStoredPlayerForm","UNK_TYPE1","",0x1),
0x801BB134:("sCsStateHandlers1","cutscene_update_func","[5]",0x14),
0x801BB148:("sCsStateHandlers2","cutscene_update_func","[5]",0x14),
0x801BB15C:("D_801BB15C","UNK_TYPE2","",0x2),
@@ -917,9 +917,9 @@
0x801BC240:("D_801BC240","Gfx","[9]",0x48),
0x801BC288:("D_801BC288","Gfx","[3]",0x18),
0x801BC2A0:("D_801BC2A0","UNK_TYPE1","",0x1),
- 0x801BC3F0:("D_801BC3F0","UNK_TYPE1","",0x1),
- 0x801BC400:("D_801BC400","UNK_TYPE1","",0x1),
- 0x801BC410:("D_801BC410","s32",[],0x10),
+ 0x801BC3F0:("gEnHyBodyParts","UNK_TYPE1","",0x1),
+ 0x801BC400:("gEnHyBodyPartsIndex","UNK_TYPE1","",0x1),
+ 0x801BC410:("gEnHyShadowSize","s32",[],0x10),
0x801BC420:("sReactionTextIds","u16","[]",0x140A),
0x801BD830:("actorCutscenesGlobalCutscenes","ActorCutscene","[8]",0x80),
0x801BD8B0:("actorCutsceneCurrent","s16","",0x2),
@@ -1386,7 +1386,7 @@
0x801C2078:("gItemSlots","u8","[80]",0x50),
0x801C20C8:("gItemPrices","UNK_TYPE1","",0x1),
0x801C212C:("gScenesPerRegion","SceneIdList","[]",0x252),
- 0x801C2380:("D_801C2380","u16","[]",0x90),
+ 0x801C2380:("sScenesPerTingleMap","u16","[]",0x90),
0x801C2410:("D_801C2410","UNK_TYPE1","",0x1),
0x801C2650:("tatlMessageFiles","RomFile","[2]",0x10),
0x801C2660:("sceneTextureFiles","RomFile","[9]",0x48),
@@ -2249,35 +2249,33 @@
0x801D1E60:("initialgspUcodeText","UNK_PTR","",0x4),
0x801D1E64:("initialgspUcodeData","UNK_PTR","",0x4),
0x801D1E70:("D_801D1E70","UNK_TYPE1","",0x1),
- 0x801D2E80:("D_801D2E80","UNK_TYPE1","",0x1),
- 0x801D2F80:("D_801D2F80","UNK_TYPE1","",0x1),
- 0x801D3070:("D_801D3070","UNK_TYPE1","",0x1),
- 0x801D3700:("D_801D3700","UNK_TYPE1","",0x1),
- 0x801D3D90:("D_801D3D90","UNK_TYPE1","",0x1),
- 0x801D3F90:("D_801D3F90","UNK_TYPE1","",0x1),
- 0x801D4190:("D_801D4190","UNK_TYPE1","",0x1),
- 0x801D4390:("D_801D4390","UNK_TYPE1","",0x1),
- 0x801D4590:("D_801D4590","UNK_TYPE1","",0x1),
+ 0x801D2E80:("gLowPassFilterData","UNK_TYPE1","",0x1),
+ 0x801D2F80:("gHighPassFilterData","UNK_TYPE1","",0x1),
+ 0x801D3070:("gBandStopFilterData","UNK_TYPE1","",0x1),
+ 0x801D3700:("gBandPassFilterData","UNK_TYPE1","",0x1),
+ 0x801D3D90:("gSawtoothWaveSample","UNK_TYPE1","",0x1),
+ 0x801D3F90:("gTriangleWaveSample","UNK_TYPE1","",0x1),
+ 0x801D4190:("gSineWaveSample","UNK_TYPE1","",0x1),
+ 0x801D4390:("gSquareWaveSample","UNK_TYPE1","",0x1),
+ 0x801D4590:("gWhiteNoiseSample","UNK_TYPE1","",0x1),
0x801D4790:("D_801D4790","UNK_TYPE1","",0x1),
- 0x801D4990:("D_801D4990","UNK_TYPE1","",0x1),
- 0x801D4B90:("D_801D4B90","UNK_TYPE1","",0x1),
- 0x801D4D90:("D_801D4D90","UNK_PTR","",0x4),
- 0x801D4D98:("D_801D4D98","UNK_PTR","",0x4),
- 0x801D4DB0:("D_801D4DB0","UNK_PTR","",0x4),
- 0x801D4DB4:("D_801D4DB4","f32","[256]",0x400),
- 0x801D51B4:("D_801D51B4","f32","[256]",0x400),
- 0x801D55B4:("D_801D55B4","f32","[128]",0x200),
- 0x801D57B4:("D_801D57B4","UNK_TYPE1","",0x1),
- 0x801D57C4:("D_801D57C4","UNK_TYPE1","",0x1),
- 0x801D57D4:("D_801D57D4","UNK_TYPE1","",0x1),
- 0x801D57E4:("D_801D57E4","UNK_TYPE4","",0x4),
- 0x801D5804:("D_801D5804","UNK_TYPE4","",0x4),
- 0x801D5824:("D_801D5824","UNK_TYPE2","",0x2),
- 0x801D58A2:("D_801D58A2","UNK_TYPE2","",0x2),
- 0x801D58AA:("D_801D58AA","UNK_TYPE1","",0x1),
- 0x801D5928:("D_801D5928","f32","[128]",0x200),
- 0x801D5B28:("D_801D5B28","f32","[128]",0x200),
- 0x801D5D28:("D_801D5D28","f32","[128]",0x200),
+ 0x801D4990:("gEighthPulseWaveSample","UNK_TYPE1","",0x1),
+ 0x801D4B90:("gQuarterPulseWaveSample","UNK_TYPE1","",0x1),
+ 0x801D4D90:("gWaveSamples","s16*","[9]",0x24),
+ 0x801D4DB4:("gBendPitchOneOctaveFrequencies","f32","[256]",0x400),
+ 0x801D51B4:("gBendPitchTwoSemitonesFrequencies","f32","[256]",0x400),
+ 0x801D55B4:("gPitchFrequencies","f32","[128]",0x200),
+ 0x801D57B4:("gDefaultShortNoteVelocityTable","UNK_TYPE1","",0x1),
+ 0x801D57C4:("gDefaultShortNoteGateTimeTable","UNK_TYPE1","",0x1),
+ 0x801D57D4:("gDefaultEnvelope","UNK_TYPE1","",0x1),
+ 0x801D57E4:("gZeroNoteSub","UNK_TYPE4","",0x4),
+ 0x801D5804:("gDefaultNoteSub","UNK_TYPE4","",0x4),
+ 0x801D5824:("gHeadsetPanQuantization","u16","[64]",0x80),
+ 0x801D58A4:("D_801D58A4","s32","",0x4),
+ 0x801D58A8:("D_801D58A8","s16","[64]",0x80),
+ 0x801D5928:("gHeadsetPanVolume","f32","[128]",0x200),
+ 0x801D5B28:("gStereoPanVolume","f32","[128]",0x200),
+ 0x801D5D28:("gDefaultPanVolume","f32","[128]",0x200),
0x801D5F28:("D_801D5F28","s16","[64]",0x80),
0x801D5FB0:("D_801D5FB0","UNK_TYPE4","",0x4),
0x801D5FB4:("D_801D5FB4","UNK_TYPE4","",0x4),
@@ -2306,122 +2304,116 @@
0x801D6200:("D_801D6200","UNK_TYPE1","",0x1),
0x801D6600:("D_801D6600","UNK_TYPE1","",0x1),
0x801D6608:("D_801D6608","UNK_TYPE1","",0x1),
- 0x801D6610:("D_801D6610","UNK_TYPE1","",0x1),
- 0x801D662C:("D_801D662C","UNK_TYPE1","",0x1),
- 0x801D6648:("D_801D6648","UNK_TYPE1","",0x1),
- 0x801D664C:("D_801D664C","UNK_TYPE1","",0x1),
- 0x801D6650:("D_801D6650","UNK_TYPE1","",0x1),
- 0x801D6654:("D_801D6654","UNK_TYPE4","",0x4),
- 0x801D6658:("D_801D6658","UNK_TYPE1","",0x1),
- 0x801D665C:("D_801D665C","UNK_TYPE1","",0x1),
- 0x801D6660:("D_801D6660","UNK_TYPE1","",0x1),
- 0x801D666C:("D_801D666C","UNK_TYPE1","",0x1),
- 0x801D6680:("D_801D6680","UNK_TYPE1","",0x1),
- 0x801D6684:("D_801D6684","UNK_TYPE1","",0x1),
- 0x801D6694:("D_801D6694","UNK_TYPE4","",0x4),
- 0x801D6698:("D_801D6698","UNK_TYPE1","",0x1),
- 0x801D669E:("D_801D669E","UNK_TYPE1","",0x1),
- 0x801D669F:("D_801D669F","UNK_TYPE1","",0x1),
- 0x801D66A0:("D_801D66A0","UNK_TYPE1","",0x1),
- 0x801D66A4:("D_801D66A4","UNK_TYPE2","",0x2),
- 0x801D66A8:("D_801D66A8","UNK_TYPE1","",0x1),
- 0x801D66AC:("D_801D66AC","UNK_TYPE1","",0x1),
- 0x801D66B0:("D_801D66B0","UNK_TYPE1","",0x1),
- 0x801D66B4:("D_801D66B4","UNK_TYPE1","",0x1),
- 0x801D66B8:("D_801D66B8","UNK_TYPE1","",0x1),
- 0x801D66BC:("D_801D66BC","UNK_TYPE1","",0x1),
- 0x801D66C0:("D_801D66C0","UNK_TYPE1","",0x1),
- 0x801D66C4:("D_801D66C4","f32","",0x4),
- 0x801D66C8:("D_801D66C8","UNK_TYPE1","",0x1),
- 0x801D66CC:("D_801D66CC","UNK_TYPE2","",0x2),
- 0x801D66D0:("D_801D66D0","UNK_TYPE1","",0x1),
- 0x801D66D4:("D_801D66D4","UNK_TYPE1","",0x1),
- 0x801D66D8:("D_801D66D8","UNK_TYPE4","",0x4),
- 0x801D66DC:("D_801D66DC","UNK_TYPE4","",0x4),
- 0x801D66E0:("D_801D66E0","UNK_TYPE1","",0x1),
- 0x801D66E4:("D_801D66E4","UNK_TYPE1","",0x1),
- 0x801D66E8:("D_801D66E8","UNK_TYPE1","",0x1),
- 0x801D66EC:("D_801D66EC","UNK_TYPE1","",0x1),
- 0x801D66F0:("D_801D66F0","UNK_TYPE1","",0x1),
- 0x801D66F4:("D_801D66F4","UNK_TYPE4","",0x4),
- 0x801D66F8:("D_801D66F8","UNK_TYPE4","",0x4),
- 0x801D66FC:("D_801D66FC","UNK_TYPE1","",0x1),
- 0x801D6700:("D_801D6700","UNK_TYPE1","",0x1),
- 0x801D6780:("D_801D6780","UNK_TYPE1","",0x1),
- 0x801D6794:("D_801D6794","UNK_TYPE1","",0x1),
- 0x801D6FB4:("D_801D6FB4","UNK_TYPE1","",0x1),
- 0x801D6FB8:("D_801D6FB8","UNK_TYPE1","",0x1),
- 0x801D6FBC:("D_801D6FBC","UNK_TYPE1","",0x1),
- 0x801D6FC0:("D_801D6FC0","UNK_TYPE1","",0x1),
- 0x801D6FC4:("D_801D6FC4","UNK_TYPE1","",0x1),
- 0x801D6FC8:("D_801D6FC8","UNK_TYPE1","",0x1),
- 0x801D6FCC:("D_801D6FCC","f32","",0x4),
- 0x801D6FD0:("D_801D6FD0","UNK_TYPE1","",0x1),
- 0x801D6FD4:("D_801D6FD4","UNK_TYPE1","",0x1),
- 0x801D6FD8:("D_801D6FD8","UNK_TYPE1","",0x1),
- 0x801D6FDC:("D_801D6FDC","UNK_TYPE1","",0x1),
- 0x801D6FE0:("D_801D6FE0","UNK_TYPE1","",0x1),
+ 0x801D6610:("gChannelsPerBank","UNK_TYPE1","",0x1),
+ 0x801D662C:("gUsedChannelsPerBank","UNK_TYPE1","",0x1),
+ 0x801D6648:("sGiantsMaskFreq","UNK_TYPE1","",0x1),
+ 0x801D664C:("sGiantsMaskReverbAdd","UNK_TYPE1","",0x1),
+ 0x801D6650:("sWaterWheelVolume","UNK_TYPE1","",0x1),
+ 0x801D6654:("gSfxVolume","UNK_TYPE4","",0x4),
+ 0x801D6658:("sSfxTimer","UNK_TYPE1","",0x1),
+ 0x801D665C:("sSfxTimerLerpRange2","UNK_TYPE1","",0x1),
+ 0x801D6660:("sSfxTimerLerpRange1","s8","",0x1),
+ 0x801D6664:("D_801D6664","f32","[2]",0x8),
+ 0x801D666C:("sAudioIncreasingTranspose","UNK_TYPE1","",0x1),
+ 0x801D6680:("sPrevChargeLevel","UNK_TYPE1","",0x1),
+ 0x801D6684:("sChargeLevelsSfxFreq","UNK_TYPE1","",0x1),
+ 0x801D6694:("sCurChargeLevelSfxFreq","UNK_TYPE4","",0x4),
+ 0x801D6698:("sGanonsTowerLevelsVol","u8","[8]",0x8),
+ 0x801D66A0:("sEnterGanonsTowerTimer","UNK_TYPE1","",0x1),
+ 0x801D66A4:("sSfxVolumeDuration","UNK_TYPE2","",0x2),
+ 0x801D66A8:("sAudioFileSelectSetting","UNK_TYPE1","",0x1),
+ 0x801D66AC:("sAudioIsWindowOpen","UNK_TYPE1","",0x1),
+ 0x801D66B0:("sAudioCutsceneFlag","UNK_TYPE1","",0x1),
+ 0x801D66B4:("sSpecReverb","UNK_TYPE1","",0x1),
+ 0x801D66B8:("sAudioEnvReverb","UNK_TYPE1","",0x1),
+ 0x801D66BC:("sAudioCodeReverb","UNK_TYPE1","",0x1),
+ 0x801D66C0:("sPrevSeqMode","UNK_TYPE1","",0x1),
+ 0x801D66C4:("sAudioEnemyDist","f32","",0x4),
+ 0x801D66C8:("sAudioEnemyVol","UNK_TYPE1","",0x1),
+ 0x801D66CC:("sPrevMainBgmSeqId","UNK_TYPE2","",0x2),
+ 0x801D66D0:("sBgmPlayerIOPort7","UNK_TYPE1","",0x1),
+ 0x801D66D4:("sSceneSeqId2","UNK_TYPE1","",0x1),
+ 0x801D66D8:("sNumFramesStill","UNK_TYPE4","",0x4),
+ 0x801D66DC:("sNumFramesMoving","UNK_TYPE4","",0x4),
+ 0x801D66E0:("sAudioBaseFilter","UNK_TYPE1","",0x1),
+ 0x801D66E4:("sAudioExtraFilter","UNK_TYPE1","",0x1),
+ 0x801D66E8:("sAudioBaseFilter2","UNK_TYPE1","",0x1),
+ 0x801D66EC:("sAudioExtraFilter2","UNK_TYPE1","",0x1),
+ 0x801D66F0:("gUnderwaterSfxReverbAdd","UNK_TYPE1","",0x1),
+ 0x801D66F4:("sRiverSoundBgmPos","UNK_TYPE4","",0x4),
+ 0x801D66F8:("sRiverSoundXZDistToPlayer","UNK_TYPE4","",0x4),
+ 0x801D66FC:("sObjSoundMainBgmSeqId","UNK_TYPE1","",0x1),
+ 0x801D6700:("sSeqFlags","UNK_TYPE1","",0x1),
+ 0x801D6780:("sSpecReverbs","UNK_TYPE1","",0x1),
+ 0x801D6794:("sNatureAmbienceData","UNK_TYPE1","",0x1),
+ 0x801D6FB4:("sIsOcarinaInputEnabled","UNK_TYPE1","",0x1),
+ 0x801D6FB8:("sOcarinaInstrumentId","UNK_TYPE1","",0x1),
+ 0x801D6FBC:("sCurOcarinaPitch","UNK_TYPE1","",0x1),
+ 0x801D6FC0:("sPrevOcarinaPitch","UNK_TYPE1","",0x1),
+ 0x801D6FC4:("sCurOcarinaButtonIdx","UNK_TYPE1","",0x1),
+ 0x801D6FC8:("sMusicStaffPrevPitch","UNK_TYPE1","",0x1),
+ 0x801D6FCC:("sCurOcarinaBendFreq","f32","",0x4),
+ 0x801D6FD0:("sDefaultOcarinaVolume","UNK_TYPE1","",0x1),
+ 0x801D6FD4:("sCurOcarinaBendIdx","UNK_TYPE1","",0x1),
+ 0x801D6FD8:("sCurOcarinaVolume","UNK_TYPE1","",0x1),
+ 0x801D6FDC:("sCurOcarinaVibrato","UNK_TYPE1","",0x1),
+ 0x801D6FE0:("sPlaybackState","UNK_TYPE1","",0x1),
0x801D6FE4:("D_801D6FE4","UNK_TYPE1","",0x1),
0x801D6FE8:("D_801D6FE8","UNK_TYPE1","",0x1),
- 0x801D6FEC:("D_801D6FEC","UNK_TYPE4","",0x4),
- 0x801D6FF0:("D_801D6FF0","UNK_TYPE4","",0x4),
- 0x801D6FF4:("D_801D6FF4","UNK_TYPE2","",0x2),
- 0x801D6FF8:("D_801D6FF8","UNK_TYPE2","",0x2),
- 0x801D6FFC:("D_801D6FFC","UNK_TYPE4","",0x4),
- 0x801D7000:("D_801D7000","UNK_TYPE1","",0x1),
- 0x801D7004:("D_801D7004","UNK_TYPE1","",0x1),
- 0x801D7008:("D_801D7008","UNK_TYPE1","",0x1),
- 0x801D700C:("D_801D700C","UNK_TYPE1","",0x1),
- 0x801D7010:("D_801D7010","f32","",0x4),
- 0x801D7014:("D_801D7014","f32","",0x4),
- 0x801D7018:("D_801D7018","UNK_TYPE4","",0x4),
- 0x801D701C:("D_801D701C","UNK_TYPE4","",0x4),
- 0x801D701E:("D_801D701E","UNK_TYPE1","",0x1),
- 0x801D701F:("D_801D701F","UNK_TYPE1","",0x1),
- 0x801D7020:("D_801D7020","UNK_TYPE1","",0x1),
- 0x801D7028:("D_801D7028","UNK_TYPE1","",0x1),
- 0x801D702C:("D_801D702C","UNK_TYPE1","",0x1),
- 0x801D7030:("D_801D7030","UNK_TYPE1","",0x1),
- 0x801D7038:("D_801D7038","UNK_TYPE1","",0x1),
- 0x801D703C:("D_801D703C","UNK_TYPE1","",0x1),
- 0x801D7040:("D_801D7040","UNK_TYPE1","",0x1),
- 0x801D7044:("D_801D7044","UNK_TYPE1","",0x1),
- 0x801D7E04:("D_801D7E04","UNK_TYPE4","",0x4),
- 0x801D7EA4:("D_801D7EA4","UNK_TYPE1","",0x1),
- 0x801D7F44:("D_801D7F44","UNK_TYPE1","",0x1),
- 0x801D84E4:("D_801D84E4","UNK_TYPE1","",0x1),
- 0x801D84F0:("D_801D84F0","UNK_PTR","",0x4),
- 0x801D84F4:("D_801D84F4","UNK_TYPE1","",0x1),
- 0x801D8508:("D_801D8508","UNK_TYPE1","",0x1),
- 0x801D850C:("D_801D850C","UNK_TYPE1","",0x1),
- 0x801D8510:("D_801D8510","UNK_TYPE4","",0x4),
- 0x801D8514:("D_801D8514","UNK_TYPE1","",0x1),
- 0x801D8518:("D_801D8518","UNK_TYPE1","",0x1),
- 0x801D851C:("D_801D851C","UNK_TYPE1","",0x1),
- 0x801D8520:("D_801D8520","UNK_TYPE1","",0x1),
- 0x801D8524:("D_801D8524","UNK_TYPE1","",0x1),
- 0x801D8528:("D_801D8528","UNK_TYPE1","",0x1),
- 0x801D852C:("D_801D852C","UNK_TYPE1","",0x1),
+ 0x801D6FEC:("sOcarinaFlags","UNK_TYPE4","",0x4),
+ 0x801D6FF0:("sPlaybackNoteTimer","UNK_TYPE4","",0x4),
+ 0x801D6FF4:("sPlaybackNotePos","UNK_TYPE2","",0x2),
+ 0x801D6FF8:("sPlaybackStaffPos","UNK_TYPE2","",0x2),
+ 0x801D6FFC:("sPrevOcarinaSongFlags","UNK_TYPE4","",0x4),
+ 0x801D7000:("sPlaybackNoteValue","UNK_TYPE1","",0x1),
+ 0x801D7004:("sNotePlaybackVolume","UNK_TYPE1","",0x1),
+ 0x801D7008:("sNotePlaybackVibrato","UNK_TYPE1","",0x1),
+ 0x801D700C:("sNotePlaybackBend","UNK_TYPE1","",0x1),
+ 0x801D7010:("sNormalizedNotePlaybackTone","f32","",0x4),
+ 0x801D7014:("sNormalizedNotePlaybackVolume","f32","",0x4),
+ 0x801D7018:("sOcarinaPlaybackTaskStart","UNK_TYPE4","",0x4),
+ 0x801D701C:("sOcarinaWallCounter","UNK_TYPE4","",0x4),
+ 0x801D7020:("sCurOcarinaSong","u8","[8]",0x8),
+ 0x801D7028:("sOcarinaSongAppendPos","UNK_TYPE1","",0x1),
+ 0x801D702C:("sOcarinaSongStartingPos","UNK_TYPE1","",0x1),
+ 0x801D7030:("sButtonToNoteMap","UNK_TYPE1","",0x1),
+ 0x801D7038:("sOcaMemoryGameAppendPos","UNK_TYPE1","",0x1),
+ 0x801D703C:("sOcaMemoryGameEndPos","UNK_TYPE1","",0x1),
+ 0x801D7040:("sOcaMemoryGameNumNotes","UNK_TYPE1","",0x1),
+ 0x801D7044:("sOcarinaSongNotes","OcarinaNote","[24][20]",0xF00),
+ 0x801D7F44:("sOoTOcarinaSongNotes","OcarinaNote","[9][20]",0x5A0),
+ 0x801D84E4:("sOoTOcarinaSongsNumNotes","UNK_TYPE1","",0x1),
+ 0x801D84F0:("sPlaybackSong","UNK_PTR","",0x4),
+ 0x801D84F4:("sFrogsSongNotes","u8","[14]",0xE),
+ 0x801D8504:("gFrogsSongPtr","u8*","",0x4),
+ 0x801D8508:("sRecordingState","UNK_TYPE1","",0x1),
+ 0x801D850C:("sRecordSongPos","UNK_TYPE1","",0x1),
+ 0x801D8510:("sOcarinaRecordTaskStart","UNK_TYPE4","",0x4),
+ 0x801D8514:("sRecordOcarinaPitch","UNK_TYPE1","",0x1),
+ 0x801D8518:("sRecordOcarinaVolume","UNK_TYPE1","",0x1),
+ 0x801D851C:("sRecordOcarinaVibrato","UNK_TYPE1","",0x1),
+ 0x801D8520:("sRecordOcarinaBendIdx","UNK_TYPE1","",0x1),
+ 0x801D8524:("sRecordOcarinaButtonIdx","UNK_TYPE1","",0x1),
+ 0x801D8528:("sPlayedOcarinaSongIdxPlusOne","UNK_TYPE1","",0x1),
+ 0x801D852C:("sMusicStaffNumNotesPerTest","UNK_TYPE1","",0x1),
0x801D8530:("D_801D8530","UNK_TYPE1","",0x1),
0x801D8534:("D_801D8534","UNK_TYPE4","",0x4),
- 0x801D8538:("D_801D8538","UNK_TYPE1","",0x1),
- 0x801D853C:("D_801D853C","UNK_TYPE1","",0x1),
- 0x801D853E:("D_801D853E","UNK_TYPE2","",0x2),
- 0x801D8544:("D_801D8544","UNK_TYPE1","",0x1),
- 0x801D889C:("D_801D889C","UNK_PTR","",0x4),
- 0x801D88A0:("D_801D88A0","UNK_PTR","",0x4),
- 0x801D88A4:("D_801D88A4","UNK_PTR","",0x4),
- 0x801D88A8:("D_801D88A8","UNK_TYPE1","",0x1),
- 0x801D88B8:("D_801D88B8","UNK_TYPE1","",0x1),
- 0x801D8A48:("D_801D8A48","UNK_TYPE1","",0x1),
- 0x801D8B20:("D_801D8B20","UNK_TYPE1","",0x1),
- 0x801D8B24:("D_801D8B24","UNK_PTR","",0x4),
- 0x801D8B28:("D_801D8B28","UNK_TYPE2","",0x2),
- 0x801D8B2C:("D_801D8B2C","UNK_TYPE1","",0x1),
+ 0x801D8538:("sIsOcarinaNoteChanged","UNK_TYPE1","",0x1),
+ 0x801D853C:("sScarecrowsLongSongNotes","OcarinaNote","[108]",0x360),
+ 0x801D889C:("gScarecrowLongSongPtr","UNK_PTR","",0x4),
+ 0x801D88A0:("gScarecrowSpawnSongPtr","UNK_PTR","",0x4),
+ 0x801D88A4:("sTerminaWallSongPtr","UNK_PTR","",0x4),
+ 0x801D88A8:("sNoteToButtonMap","UNK_TYPE1","",0x1),
+ 0x801D88B8:("sCustomSequenceScript","UNK_TYPE1","",0x1),
+ 0x801D8A48:("gOcarinaSongButtons","UNK_TYPE1","",0x1),
+ 0x801D8B20:("sScarecrowAfterCreditsState","UNK_TYPE1","",0x1),
+ 0x801D8B24:("sScarecrowAfterCreditsIntrumentId","UNK_PTR","",0x4),
+ 0x801D8B28:("sScarecrowAfterCreditsTimer","UNK_TYPE2","",0x2),
+ 0x801D8B2C:("sRequestCustomSequence","UNK_TYPE1","",0x1),
0x801D8B30:("D_801D8B30","UNK_TYPE1","",0x1),
- 0x801D8BB0:("D_801D8BB0","UNK_TYPE1","",0x1),
- 0x801D8BD0:("D_801D8BD0","UNK_TYPE2","",0x2),
- 0x801D8BD4:("D_801D8BD4","UNK_TYPE4","",0x4),
+ 0x801D8BB0:("sBigBellsVolume","UNK_TYPE1","",0x1),
+ 0x801D8BD0:("sBgmPlayers","UNK_TYPE2","",0x2),
+ 0x801D8BD4:("sSfxOriginalPos","UNK_TYPE4","",0x4),
0x801D8BE0:("D_801D8BE0","UNK_TYPE1","",0x1),
0x801D8E3C:("D_801D8E3C","UNK_TYPE1","",0x1),
0x801D8E40:("D_801D8E40","UNK_TYPE4","",0x4),
@@ -3793,16 +3785,16 @@
0x801E07C4:("jtbl_801E07C4","UNK_PTR","",0x4),
0x801E0948:("jtbl_801E0948","UNK_PTR","",0x4),
0x801E0A08:("jtbl_801E0A08","UNK_PTR","",0x4),
- 0x801E0BD0:("D_801E0BD0","UNK_TYPE1","",0x1),
- 0x801E0BFC:("D_801E0BFC","UNK_TYPE1","",0x1),
- 0x801E0C14:("D_801E0C14","char","[]",0x1),
- 0x801E0C38:("D_801E0C38","char","[]",0x1),
- 0x801E0C64:("D_801E0C64","char","[]",0x1),
- 0x801E0C6C:("D_801E0C6C","char","[]",0x1),
- 0x801E0C74:("D_801E0C74","char","[]",0x1),
- 0x801E0C7C:("D_801E0C7C","char","[]",0x1),
- 0x801E0CA4:("D_801E0CA4","char","[]",0x1),
- 0x801E0CD0:("D_801E0CD0","char","[]",0x1),
+ 0x801E0BD0:("gAudioEnvironmentalSfx","UNK_TYPE1","",0x1),
+ 0x801E0BFC:("sIsOcarinaSongReserved","UNK_TYPE1","",0x1),
+ 0x801E0C14:("sAudioOcarinaUnusedText0","char","[]",0x1),
+ 0x801E0C38:("sAudioOcarinaUnusedText1","char","[]",0x1),
+ 0x801E0C64:("sAudioOcarinaUnusedText2","char","[]",0x1),
+ 0x801E0C6C:("sAudioOcarinaUnusedText3","char","[]",0x1),
+ 0x801E0C74:("sAudioOcarinaUnusedText4","char","[]",0x1),
+ 0x801E0C7C:("sAudioOcarinaUnusedText5","char","[]",0x1),
+ 0x801E0CA4:("sAudioOcarinaUnusedText6","char","[]",0x1),
+ 0x801E0CD0:("sAudioOcarinaUnusedText7","char","[]",0x1),
0x801E0CEC:("D_801E0CEC","f32","",0x4),
0x801E0CF0:("D_801E0CF0","f32","",0x4),
0x801E0CF4:("D_801E0CF4","f32","",0x4),
@@ -3873,15 +3865,15 @@
0x801E1104:("gAudioContextInitSizes","AudioContextInitSizes","",0xC),
0x801E1110:("sGameOverTimer","UNK_TYPE2","",0x2),
0x801E1120:("jtbl_801E1120","UNK_PTR","",0x4),
- 0x801E1180:("D_801E1180","UNK_TYPE2","",0x2),
- 0x801E1420:("D_801E1420","UNK_TYPE1","",0x1),
- 0x801E1630:("D_801E1630","UNK_TYPE2","",0x2),
- 0x801E1E40:("D_801E1E40","UNK_TYPE1","",0x1),
- 0x801E1E80:("D_801E1E80","UNK_TYPE1","",0x1),
- 0x801E2160:("gspF3DEX2_NoN_fifoTextStart","UNK_TYPE1","",0x1),
- 0x801E3790:("gspF3DEX2_NoN_fifoDataStart","UNK_TYPE1","",0x1),
- 0x801E3BB0:("D_801E3BB0","UNK_TYPE1","",0x1),
- 0x801E3F40:("gJpegUCodeData","UNK_TYPE1","",0x1),
+ 0x801E1180:("gSoundFontTable","UNK_TYPE2","",0x2),
+ 0x801E1420:("gSequenceFontTable","UNK_TYPE1","",0x1),
+ 0x801E1630:("gSequenceTable","UNK_TYPE2","",0x2),
+ 0x801E1E40:("gSampleBankTable","UNK_TYPE1","",0x1),
+ 0x801E1E80:("aspMainDataStart","UNK_TYPE1","",0x2E0),
+ 0x801E2160:("gspF3DZEX2_NoN_PosLight_fifoTextStart","UNK_TYPE1","",0x1),
+ 0x801E3790:("gspF3DZEX2_NoN_PosLight_fifoDataStart","UNK_TYPE1","",0x1),
+ 0x801E3BB0:("gspS2DEX2_fifoDataStart","UNK_TYPE1","",0x1),
+ 0x801E3F40:("njpgdspMainDataStart","UNK_TYPE1","",0x1),
0x801E3FA0:("D_801E3FA0","UNK_TYPE1","",0x1),
0x801E3FB0:("sEffectContext","EffectContext","",0x98E0),
0x801ED890:("D_801ED890","UNK_TYPE1","",0x1),
@@ -3986,12 +3978,10 @@
0x801F3F80:("D_801F3F80","UNK_TYPE1","",0x1),
0x801F3F83:("D_801F3F83","UNK_TYPE1","",0x1),
0x801F48C8:("D_801F48C8","UNK_TYPE1","",0x1),
- 0x801F4D40:("D_801F4D40","UNK_TYPE1","",0x1),
- 0x801F4D42:("D_801F4D42","UNK_TYPE2","",0x2),
- 0x801F4D48:("D_801F4D48","UNK_TYPE1","",0x1),
- 0x801F4DC8:("D_801F4DC8","UNK_TYPE1","",0x1),
- 0x801F4DCA:("D_801F4DCA","UNK_TYPE1","",0x1),
- 0x801F4DCC:("D_801F4DCC","UNK_TYPE2","[8]",0x10),
+ 0x801F4D40:("seqId","u16","",0x2),
+ 0x801F4D42:("sCutsceneQuakeIndex","UNK_TYPE2","",0x2),
+ 0x801F4D48:("sCutsceneCameraInfo","UNK_TYPE","",0x80),
+ 0x801F4DC8:("D_801F4DC8","u16","[10]",0x14),
0x801F4DDC:("D_801F4DDC","UNK_TYPE1","",0x1),
0x801F4DE0:("D_801F4DE0","UNK_TYPE1","",0x1),
0x801F4DE2:("D_801F4DE2","UNK_TYPE2","",0x2),
@@ -4075,7 +4065,7 @@
0x801F59F4:("D_801F59F4","UNK_TYPE1","",0x1),
0x801F59F8:("D_801F59F8","UNK_TYPE1","",0x1),
0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90),
- 0x801F5A90:("sQuake2Context","Quake2Context","",0xc),
+ 0x801F5A90:("sDistortionContext","DistortionContext","",0xc),
0x801F5AA0:("sMatAnimStep","s32","",0x4),
0x801F5AA4:("sMatAnimFlags","u32","",0x4),
0x801F5AA8:("sMatAnimAlphaRatio","f32","",0x4),
@@ -4299,87 +4289,83 @@
0x801FD158:("D_801FD158","UNK_TYPE1","",0x1),
0x801FD198:("D_801FD198","UNK_TYPE1","",0x1),
0x801FD1E0:("D_801FD1E0","UNK_TYPE1","",0x1),
- 0x801FD1F0:("D_801FD1F0","UNK_TYPE1","",0x1),
- 0x801FD250:("D_801FD250","UNK_TYPE1","",0x1),
- 0x801FD254:("D_801FD254","UNK_TYPE1","",0x1),
- 0x801FD258:("D_801FD258","UNK_TYPE1","",0x1),
- 0x801FD25C:("D_801FD25C","UNK_TYPE1","",0x1),
- 0x801FD260:("D_801FD260","UNK_TYPE1","",0x1),
- 0x801FD264:("D_801FD264","UNK_TYPE1","",0x1),
- 0x801FD268:("D_801FD268","UNK_TYPE1","",0x1),
- 0x801FD278:("D_801FD278","UNK_TYPE1","",0x1),
- 0x801FD288:("D_801FD288","UNK_TYPE1","",0x1),
- 0x801FD28C:("D_801FD28C","UNK_TYPE1","",0x1),
- 0x801FD28D:("D_801FD28D","UNK_TYPE1","",0x1),
- 0x801FD28E:("D_801FD28E","UNK_TYPE1","",0x1),
- 0x801FD28F:("D_801FD28F","UNK_TYPE1","",0x1),
- 0x801FD290:("D_801FD290","UNK_TYPE1","",0x1),
- 0x801FD291:("D_801FD291","UNK_TYPE1","",0x1),
- 0x801FD294:("D_801FD294","UNK_TYPE1","",0x1),
- 0x801FD298:("D_801FD298","UNK_TYPE1","",0x1),
- 0x801FD29C:("D_801FD29C","UNK_TYPE1","",0x1),
- 0x801FD2A0:("D_801FD2A0","UNK_TYPE1","",0x1),
- 0x801FD2A8:("D_801FD2A8","UNK_TYPE1","",0x1),
+ 0x801FD1F0:("sSfxSettings","UNK_TYPE1","",0x1),
+ 0x801FD250:("sSfxSettingsFlags","UNK_TYPE1","",0x1),
+ 0x801FD254:("sTwoSemitonesLoweredFreq","UNK_TYPE1","",0x1),
+ 0x801FD258:("sSfxIncreasedReverb","UNK_TYPE1","",0x1),
+ 0x801FD25C:("sSfxSyncedVolume","UNK_TYPE1","",0x1),
+ 0x801FD260:("sSfxSyncedVolumeForMetalEffects","UNK_TYPE1","",0x1),
+ 0x801FD264:("sSfxSyncedFreq","UNK_TYPE1","",0x1),
+ 0x801FD268:("sRiverFreqScaleLerp","UNK_TYPE1","",0x1),
+ 0x801FD278:("sWaterfallFreqScaleLerp","UNK_TYPE1","",0x1),
+ 0x801FD288:("sSfxAdjustedFreq","UNK_TYPE1","",0x1),
+ 0x801FD28C:("sSfxCustomReverb","UNK_TYPE1","",0x1),
+ 0x801FD28D:("sRiverSoundMainBgmVol","UNK_TYPE1","",0x1),
+ 0x801FD28E:("sRiverSoundMainBgmCurrentVol","UNK_TYPE1","",0x1),
+ 0x801FD28F:("sRiverSoundMainBgmLower","UNK_TYPE1","",0x1),
+ 0x801FD290:("sRiverSoundMainBgmRestore","UNK_TYPE1","",0x1),
+ 0x801FD291:("sGanonsTowerVol","UNK_TYPE1","",0x1),
+ 0x801FD294:("sSfxVolumeCur","UNK_TYPE1","",0x1),
+ 0x801FD298:("sSfxVolumeTarget","UNK_TYPE1","",0x1),
+ 0x801FD29C:("sSfxVolumeRate","UNK_TYPE1","",0x1),
+ 0x801FD2A0:("sSceneSeqId1","UNK_TYPE1","",0x1),
+ 0x801FD2A8:("sSfxChannelState","UNK_TYPE1","",0x1),
0x801FD3A8:("D_801FD3A8","UNK_TYPE1","",0x1),
0x801FD3A9:("D_801FD3A9","UNK_TYPE1","",0x1),
- 0x801FD3AA:("D_801FD3AA","UNK_TYPE1","",0x1),
- 0x801FD3AB:("D_801FD3AB","UNK_TYPE1","",0x1),
- 0x801FD3AC:("D_801FD3AC","UNK_TYPE1","",0x1),
- 0x801FD3AE:("D_801FD3AE","UNK_TYPE1","",0x1),
- 0x801FD3AF:("D_801FD3AF","UNK_TYPE1","",0x1),
- 0x801FD3B0:("D_801FD3B0","UNK_TYPE1","",0x1),
- 0x801FD3B4:("D_801FD3B4","UNK_TYPE1","",0x1),
- 0x801FD3B7:("D_801FD3B7","UNK_TYPE1","",0x1),
- 0x801FD3B8:("D_801FD3B8","UNK_TYPE1","",0x1),
- 0x801FD3D8:("D_801FD3D8","UNK_TYPE1","",0x1),
- 0x801FD3D9:("D_801FD3D9","UNK_TYPE1","",0x1),
- 0x801FD3DA:("D_801FD3DA","UNK_TYPE1","",0x1),
- 0x801FD3E0:("D_801FD3E0","UNK_TYPE1","",0x1),
- 0x801FD3EC:("D_801FD3EC","UNK_TYPE1","",0x1),
- 0x801FD3F0:("D_801FD3F0","UNK_TYPE1","",0x1),
- 0x801FD3FC:("D_801FD3FC","UNK_TYPE1","",0x1),
- 0x801FD400:("D_801FD400","UNK_TYPE1","",0x1),
- 0x801FD404:("D_801FD404","UNK_TYPE1","",0x1),
- 0x801FD408:("D_801FD408","UNK_TYPE1","",0x1),
- 0x801FD40C:("D_801FD40C","UNK_TYPE1","",0x1),
- 0x801FD410:("D_801FD410","UNK_TYPE1","",0x1),
- 0x801FD420:("D_801FD420","UNK_TYPE1","",0x1),
- 0x801FD42C:("D_801FD42C","UNK_TYPE1","",0x1),
- 0x801FD430:("D_801FD430","UNK_TYPE1","",0x1),
- 0x801FD431:("D_801FD431","UNK_TYPE1","",0x1),
+ 0x801FD3AA:("sRiverSoundBgmTimer","UNK_TYPE1","",0x1),
+ 0x801FD3AB:("sFanfareState","UNK_TYPE1","",0x1),
+ 0x801FD3AC:("sFanfareSeqId","UNK_TYPE1","",0x1),
+ 0x801FD3AE:("sMuteOnlySfxAndNatureSeq","UNK_TYPE1","",0x1),
+ 0x801FD3AF:("sAllPlayersMutedExceptOcaAndSys","UNK_TYPE1","",0x1),
+ 0x801FD3B0:("sAudioPauseState","UNK_TYPE1","",0x1),
+ 0x801FD3B4:("sSpatialSeqIsActive","u8","[4]",0x4),
+ 0x801FD3B8:("sSequenceFilter","UNK_TYPE1","",0x1),
+ 0x801FD3D8:("sIsFinalHoursOrSoaring","UNK_TYPE1","",0x1),
+ 0x801FD3D9:("sObjSoundFanfareSeqId","UNK_TYPE1","",0x1),
+ 0x801FD3DA:("sObjSoundFanfareRequested","UNK_TYPE1","",0x1),
+ 0x801FD3E0:("sObjSoundFanfarePos","UNK_TYPE1","",0x1),
+ 0x801FD3EC:("sObjSoundPlayerIdx","UNK_TYPE1","",0x1),
+ 0x801FD3F0:("sObjSoundPos","UNK_TYPE1","",0x1),
+ 0x801FD3FC:("sObjSoundFlags","UNK_TYPE1","",0x1),
+ 0x801FD400:("sObjSoundMinDist","UNK_TYPE1","",0x1),
+ 0x801FD404:("sObjSoundMaxDist","UNK_TYPE1","",0x1),
+ 0x801FD408:("sObjSoundMaxVol","UNK_TYPE1","",0x1),
+ 0x801FD40C:("sObjSoundMinVol","UNK_TYPE1","",0x1),
+ 0x801FD410:("sSpatialSeqNoFilterPos","UNK_TYPE1","",0x1),
+ 0x801FD420:("sSpatialSeqFilterPos","UNK_TYPE1","",0x1),
+ 0x801FD42C:("sSpatialSeqMaxDist","UNK_TYPE1","",0x1),
+ 0x801FD430:("sSpatialSeqSeqId","UNK_TYPE1","",0x1),
+ 0x801FD431:("sSpatialSeqFlags","UNK_TYPE1","",0x1),
0x801FD432:("D_801FD432","UNK_TYPE1","",0x1),
- 0x801FD433:("D_801FD433","UNK_TYPE1","",0x1),
+ 0x801FD433:("sSpatialSubBgmFadeTimer","UNK_TYPE1","",0x1),
0x801FD434:("D_801FD434","UNK_TYPE1","",0x1),
- 0x801FD435:("D_801FD435","UNK_TYPE1","",0x1),
- 0x801FD436:("D_801FD436","UNK_TYPE1","",0x1),
+ 0x801FD435:("sSpatialSeqPlayerIdx","UNK_TYPE1","",0x1),
+ 0x801FD436:("sSpatialSeqFadeTimer","UNK_TYPE1","",0x1),
0x801FD438:("D_801FD438","UNK_TYPE1","",0x1),
- 0x801FD43A:("D_801FD43A","UNK_TYPE1","",0x1),
- 0x801FD43B:("D_801FD43B","UNK_TYPE1","",0x1),
- 0x801FD43E:("D_801FD43E","UNK_TYPE1","",0x1),
- 0x801FD442:("D_801FD442","UNK_TYPE1","",0x1),
- 0x801FD448:("D_801FD448","UNK_TYPE1","",0x1),
- 0x801FD44C:("D_801FD44C","UNK_TYPE1","",0x1),
- 0x801FD44D:("D_801FD44D","UNK_TYPE1","",0x1),
- 0x801FD450:("D_801FD450","UNK_TYPE1","",0x1),
- 0x801FD454:("D_801FD454","UNK_TYPE1","",0x1),
- 0x801FD458:("D_801FD458","UNK_TYPE1","",0x1),
- 0x801FD45C:("D_801FD45C","UNK_TYPE1","",0x1),
- 0x801FD460:("D_801FD460","UNK_TYPE1","",0x1),
- 0x801FD461:("D_801FD461","UNK_TYPE1","",0x1),
- 0x801FD462:("D_801FD462","UNK_TYPE1","",0x1),
- 0x801FD463:("D_801FD463","UNK_TYPE1","",0x1),
- 0x801FD464:("D_801FD464","UNK_TYPE1","",0x1),
- 0x801FD468:("D_801FD468","UNK_TYPE1","",0x1),
- 0x801FD46C:("D_801FD46C","UNK_TYPE1","",0x1),
- 0x801FD470:("D_801FD470","UNK_TYPE1","",0x1),
- 0x801FD4A0:("D_801FD4A0","UNK_TYPE1","",0x1),
- 0x801FD4D0:("D_801FD4D0","UNK_TYPE1","",0x1),
- 0x801FD500:("D_801FD500","UNK_TYPE1","",0x1),
+ 0x801FD43A:("sPlayingStaff","OcarinaStaff","",0x3),
+ 0x801FD43E:("sPlaybackStaff","OcarinaStaff","",0x3),
+ 0x801FD442:("sRecordingStaff","OcarinaStaff","",0x3),
+ 0x801FD448:("sOcarinaUpdateTaskCurrent","UNK_TYPE1","",0x1),
+ 0x801FD44C:("sOcarinaInputStickRel","OcarinaControlStick","",0x2),
+ 0x801FD450:("sOcarinaInputButtonCur","UNK_TYPE1","",0x1),
+ 0x801FD454:("sOcarinaInputButtonStart","UNK_TYPE1","",0x1),
+ 0x801FD458:("sOcarinaInputButtonPrev","UNK_TYPE1","",0x1),
+ 0x801FD45C:("sOcaInputBtnPress","UNK_TYPE1","",0x1),
+ 0x801FD460:("sOcarinaResetDelay","UNK_TYPE1","",0x1),
+ 0x801FD461:("sOcarinaResetUnused","UNK_TYPE1","",0x1),
+ 0x801FD462:("sOcarinaHasStartedSong","UNK_TYPE1","",0x1),
+ 0x801FD463:("sFirstOcarinaSongIdx","UNK_TYPE1","",0x1),
+ 0x801FD464:("sLastOcarinaSongIdx","UNK_TYPE1","",0x1),
+ 0x801FD468:("sOcarinaAvailSongs","UNK_TYPE1","",0x1),
+ 0x801FD46C:("sOcarinaStaffPlayingPos","UNK_TYPE1","",0x1),
+ 0x801FD470:("sMusicStaffPos","UNK_TYPE1","",0x1),
+ 0x801FD4A0:("sMusicStaffCurHeldLength","UNK_TYPE1","",0x1),
+ 0x801FD4D0:("sMusicStaffExpectedLength","UNK_TYPE1","",0x1),
+ 0x801FD500:("sMusicStaffExpectedPitch","UNK_TYPE1","",0x1),
0x801FD518:("D_801FD518","UNK_TYPE1","",0x1),
- 0x801FD530:("D_801FD530","UNK_TYPE1","",0x1),
- 0x801FD533:("D_801FD533","UNK_TYPE1","",0x1),
- 0x801FD590:("D_801FD590","UNK_TYPE1","",0x1),
- 0x801FD598:("D_801FD598","UNK_TYPE1","",0x1),
+ 0x801FD530:("D_801FD530","u32","[24]",0x60),
+ 0x801FD590:("sRecordingSongNote","UNK_TYPE1","",0x1),
+ 0x801FD598:("sCustomSequencePc","UNK_TYPE1","",0x1),
0x801FD5A0:("D_801FD5A0","UNK_TYPE1","",0x1),
0x801FD5A4:("D_801FD5A4","UNK_TYPE1","",0x1),
0x801FD5B8:("D_801FD5B8","UNK_TYPE1","",0x1),
@@ -4420,131 +4406,7 @@
0x80200BCC:("D_80200BCC","UNK_TYPE1","",0x1),
0x80200BCE:("D_80200BCE","UNK_TYPE1","",0x1),
0x80200BD0:("D_80200BD0","UNK_TYPE1","",0x1),
- 0x80200C70:("D_80200C70","UNK_TYPE1","",0x1),
- 0x80200C71:("D_80200C71","UNK_TYPE1","",0x1),
- 0x80200C76:("D_80200C76","UNK_TYPE1","",0x1),
- 0x80200C78:("D_80200C78","UNK_TYPE1","",0x1),
- 0x80200C7C:("D_80200C7C","UNK_TYPE1","",0x1),
- 0x80200C80:("D_80200C80","UNK_TYPE1","",0x1),
- 0x80200C92:("D_80200C92","UNK_TYPE1","",0x1),
- 0x80200C94:("D_80200C94","UNK_TYPE1","",0x1),
- 0x80200C98:("D_80200C98","UNK_TYPE1","",0x1),
- 0x80200C9A:("D_80200C9A","UNK_TYPE1","",0x1),
- 0x80200C9E:("D_80200C9E","UNK_TYPE1","",0x1),
- 0x80200CA0:("D_80200CA0","UNK_TYPE1","",0x1),
- 0x80200CF0:("D_80200CF0","UNK_TYPE1","",0x1),
- 0x80200D38:("D_80200D38","UNK_TYPE1","",0x1),
- 0x80200D70:("D_80200D70","UNK_TYPE1","",0x1),
- 0x802011F0:("D_802011F0","UNK_TYPE1","",0x1),
- 0x8020178C:("D_8020178C","UNK_TYPE1","",0x1),
- 0x802017B0:("D_802017B0","UNK_TYPE1","",0x1),
- 0x80201D68:("D_80201D68","UNK_TYPE1","",0x1),
- 0x80201D6C:("D_80201D6C","UNK_TYPE1","",0x1),
- 0x802023FC:("D_802023FC","UNK_TYPE1","",0x1),
- 0x80202878:("D_80202878","UNK_TYPE1","",0x1),
- 0x80202880:("D_80202880","UNK_TYPE1","",0x1),
- 0x802028BC:("D_802028BC","UNK_TYPE1","",0x1),
- 0x80202980:("D_80202980","OSMesgQueue","",0x18),
- 0x802029D8:("D_802029D8","UNK_TYPE1","",0x1),
- 0x80202AB0:("D_80202AB0","OSMesgQueue","",0x18),
- 0x80202AC8:("D_80202AC8","OSMesg","[16]",0x40),
- 0x80202B08:("D_80202B08","OSMesgQueue","",0x18),
- 0x80202B20:("D_80202B20","OSMesg","[16]",0x40),
- 0x80202B60:("D_80202B60","OSMesgQueue","",0x18),
- 0x80202B78:("D_80202B78","OSMesg","[64]",0x100),
- 0x80203278:("D_80203278","OSMesgQueue","",0x18),
- 0x80203290:("D_80203290","OSMesg","[1]",0x4),
- 0x80203294:("D_80203294","UNK_TYPE1","",0x1),
- 0x802034C0:("D_802034C0","UNK_TYPE1","",0x1),
- 0x802034C4:("D_802034C4","UNK_TYPE1","",0x1),
- 0x802034C8:("D_802034C8","UNK_TYPE1","",0x1),
- 0x802034D0:("D_802034D0","UNK_TYPE4","",0x4),
- 0x802034D4:("D_802034D4","UNK_TYPE1","",0x1),
- 0x802034D8:("D_802034D8","UNK_TYPE1","",0x1),
- 0x802034DC:("D_802034DC","UNK_TYPE1","",0x1),
- 0x802034E8:("D_802034E8","UNK_TYPE1","",0x1),
- 0x802034F0:("D_802034F0","UNK_TYPE2","",0x2),
- 0x802034F8:("D_802034F8","UNK_TYPE1","",0x1),
- 0x802034FC:("D_802034FC","UNK_TYPE1","",0x1),
- 0x80203500:("D_80203500","UNK_TYPE1","",0x1),
- 0x80203528:("D_80203528","UNK_TYPE4","",0x4),
- 0x8020352C:("D_8020352C","UNK_TYPE1","",0x1),
- 0x8020352E:("D_8020352E","UNK_TYPE1","",0x1),
- 0x80203530:("D_80203530","UNK_TYPE1","",0x1),
- 0x8020360C:("D_8020360C","UNK_TYPE4","",0x4),
- 0x80203618:("D_80203618","UNK_TYPE1","",0x1),
- 0x8020361C:("D_8020361C","UNK_TYPE1","",0x1),
- 0x80203620:("D_80203620","UNK_TYPE1","",0x1),
- 0x80203624:("D_80203624","UNK_TYPE1","",0x1),
- 0x80203628:("D_80203628","UNK_TYPE1","",0x1),
- 0x80203630:("D_80203630","UNK_TYPE1","",0x1),
- 0x80203640:("D_80203640","UNK_TYPE1","",0x1),
- 0x80203650:("D_80203650","UNK_TYPE1","",0x1),
- 0x80203660:("D_80203660","UNK_TYPE1","",0x1),
- 0x80203690:("D_80203690","UNK_TYPE1","",0x1),
- 0x802036A0:("D_802036A0","UNK_TYPE1","",0x1),
- 0x802036B0:("D_802036B0","UNK_TYPE1","",0x1),
- 0x802036C0:("D_802036C0","UNK_TYPE1","",0x1),
- 0x802036C4:("D_802036C4","UNK_TYPE1","",0x1),
- 0x80203794:("D_80203794","UNK_TYPE1","",0x1),
- 0x80203798:("D_80203798","UNK_TYPE1","",0x1),
- 0x802037D0:("D_802037D0","UNK_TYPE1","",0x1),
- 0x802037D4:("D_802037D4","UNK_TYPE1","",0x1),
- 0x802038A4:("D_802038A4","UNK_TYPE1","",0x1),
- 0x802038A8:("D_802038A8","UNK_TYPE1","",0x1),
- 0x802038C2:("D_802038C2","UNK_TYPE1","",0x1),
- 0x802038CE:("D_802038CE","UNK_TYPE1","",0x1),
- 0x802038E0:("D_802038E0","UNK_TYPE1","",0x1),
- 0x802038E4:("D_802038E4","UNK_TYPE1","",0x1),
- 0x80203970:("D_80203970","UNK_TYPE1","",0x1),
- 0x802039B4:("D_802039B4","UNK_TYPE1","",0x1),
- 0x802039B8:("D_802039B8","UNK_TYPE1","",0x1),
- 0x802039D2:("D_802039D2","UNK_TYPE1","",0x1),
- 0x802039DE:("D_802039DE","UNK_TYPE1","",0x1),
- 0x802039F0:("D_802039F0","UNK_TYPE1","",0x1),
- 0x802039FC:("D_802039FC","UNK_TYPE1","",0x1),
- 0x80203B80:("D_80203B80","UNK_TYPE1","",0x1),
- 0x80203B88:("D_80203B88","UNK_TYPE1","",0x1),
- 0x80203B90:("D_80203B90","UNK_TYPE1","",0x1),
- 0x80204590:("D_80204590","UNK_TYPE1","",0x1),
- 0x80204594:("D_80204594","UNK_TYPE1","",0x1),
- 0x80204598:("D_80204598","UNK_TYPE1","",0x1),
- 0x802045A4:("D_802045A4","UNK_TYPE1","",0x1),
- 0x80204FA4:("D_80204FA4","UNK_TYPE1","",0x1),
- 0x80204FA8:("D_80204FA8","UNK_TYPE1","",0x1),
- 0x80204FB4:("D_80204FB4","UNK_TYPE1","",0x1),
- 0x80204FB8:("D_80204FB8","UNK_TYPE1","",0x1),
- 0x80204FC0:("D_80204FC0","UNK_TYPE1","",0x1),
- 0x80204FCC:("D_80204FCC","UNK_TYPE1","",0x1),
- 0x80204FD8:("D_80204FD8","UNK_TYPE1","",0x1),
- 0x80205008:("D_80205008","UNK_TYPE1","",0x1),
- 0x80205038:("D_80205038","UNK_TYPE1","",0x1),
- 0x802050B9:("D_802050B9","UNK_TYPE1","",0x1),
- 0x802050C0:("D_802050C0","UNK_TYPE1","",0x1),
- 0x802050C4:("D_802050C4","UNK_TYPE1","",0x1),
- 0x802050CC:("D_802050CC","UNK_TYPE4","",0x4),
- 0x802050D0:("D_802050D0","UNK_TYPE4","",0x4),
- 0x80205228:("D_80205228","UNK_TYPE1","",0x1),
- 0x8020522B:("D_8020522B","UNK_TYPE1","",0x1),
- 0x80205390:("D_80205390","UNK_TYPE1","",0x1),
- 0x802053C8:("D_802053C8","UNK_TYPE1","",0x1),
- 0x802057B0:("D_802057B0","UNK_TYPE1","",0x1),
- 0x80205830:("D_80205830","UNK_TYPE1","",0x1),
- 0x802084B0:("D_802084B0","UNK_TYPE1","",0x1),
- 0x80208530:("D_80208530","UNK_TYPE1","",0x1),
- 0x80208598:("D_80208598","UNK_TYPE1","",0x1),
- 0x802085A8:("D_802085A8","UNK_TYPE1","",0x1),
- 0x802085B8:("D_802085B8","UNK_TYPE1","",0x1),
- 0x802085C8:("D_802085C8","UNK_TYPE1","",0x1),
- 0x802085D8:("D_802085D8","UNK_TYPE1","",0x1),
- 0x802085F8:("D_802085F8","UNK_TYPE1","",0x1),
- 0x802085FC:("D_802085FC","UNK_TYPE1","",0x1),
- 0x80208604:("D_80208604","UNK_TYPE1","",0x1),
- 0x8020861C:("D_8020861C","UNK_TYPE1","",0x1),
- 0x80208634:("D_80208634","UNK_TYPE1","",0x1),
- 0x8020864C:("D_8020864C","UNK_TYPE1","",0x1),
- 0x80208650:("D_80208650","UNK_TYPE1","",0x1),
- 0x80208654:("D_80208654","UNK_TYPE1","",0x1),
+ 0x80200C70:("gAudioContext","AudioContext","",0x81F8),
0x80208E68:("D_80208E68","UNK_TYPE4","",0x4),
0x80208E6C:("D_80208E6C","UNK_TYPE4","",0x4),
0x80208E70:("D_80208E70","UNK_TYPE4","",0x4),
@@ -5754,13 +5616,11 @@
0x80867784:("D_80867784","UNK_TYPE1","",0x1),
0x8086778C:("D_8086778C","UNK_PTR","",0x4),
0x8086780C:("En_Door_InitVars","UNK_TYPE1","",0x1),
- 0x8086782C:("D_8086782C","UNK_TYPE2","",0x2),
- 0x80867886:("D_80867886","UNK_TYPE1","",0x1),
- 0x8086788A:("D_8086788A","UNK_TYPE2","",0x2),
- 0x80867954:("D_80867954","UNK_TYPE1","",0x1),
- 0x80867964:("D_80867964","UNK_TYPE1","",0x1),
- 0x8086798C:("D_8086798C","UNK_TYPE1","",0x1),
- 0x80867998:("D_80867998","UNK_TYPE1","",0x1),
+ 0x8086782C:("sObjInfo","UNK_TYPE2","",0x126),
+ 0x80867954:("sInitChain","UNK_TYPE1","",0x1),
+ 0x80867964:("sAnimations","AnimationHeader","[10]",0x28),
+ 0x8086798C:("sAnimOpenFrames","u8","[10]",0x10),
+ 0x80867998:("sAnimCloseFrames","u8","[10]",0x10),
0x808679A4:("D_808679A4","UNK_TYPE1","",0x1),
0x80867A20:("D_80867A20","f32","",0x4),
0x80867BC0:("D_80867BC0","UNK_TYPE1","",0x1),
@@ -8997,28 +8857,28 @@
0x8096AD3C:("jtbl_8096AD3C","UNK_PTR","",0x4),
0x8096B290:("En_Okarina_Effect_InitVars","UNK_TYPE1","",0x1),
0x8096B2B0:("D_8096B2B0","f32","",0x4),
- 0x8096E910:("D_8096E910","UNK_TYPE2","",0x2),
- 0x8096E914:("D_8096E914","UNK_TYPE2","",0x2),
- 0x8096E918:("D_8096E918","UNK_TYPE2","",0x2),
- 0x8096E91C:("D_8096E91C","UNK_TYPE2","",0x2),
- 0x8096E920:("D_8096E920","UNK_TYPE2","",0x2),
+ 0x8096E910:("sInputDelayTimer","s16","",0x2),
+ 0x8096E914:("sZeldaEffectColorTimer","s16","",0x2),
+ 0x8096E918:("sZeldaEffectColorTargetIndex","s16","",0x2),
+ 0x8096E91C:("sTextAlphaTargetIndex","s16","",0x2),
+ 0x8096E920:("sTextAlphaTimer","s16","",0x2),
0x8096E924:("En_Mag_InitVars","UNK_TYPE1","",0x1),
- 0x8096E944:("D_8096E944","UNK_TYPE1","",0x1),
- 0x8096E948:("D_8096E948","UNK_TYPE1","",0x1),
- 0x8096E94C:("D_8096E94C","UNK_TYPE1","",0x1),
- 0x8096E950:("D_8096E950","UNK_TYPE1","",0x1),
- 0x8096E954:("D_8096E954","UNK_TYPE1","",0x1),
- 0x8096E958:("D_8096E958","UNK_TYPE2","",0x2),
- 0x8096E95C:("D_8096E95C","UNK_TYPE2","",0x2),
- 0x8096E960:("D_8096E960","UNK_TYPE2","",0x2),
- 0x8096E964:("D_8096E964","UNK_TYPE1","",0x1),
- 0x8096E970:("D_8096E970","UNK_TYPE4","",0x4),
- 0x8096E988:("D_8096E988","UNK_TYPE4","",0x4),
- 0x8096E9A0:("D_8096E9A0","UNK_TYPE4","",0x4),
- 0x8096E9B8:("D_8096E9B8","UNK_TYPE2","",0x2),
- 0x8096E9C4:("D_8096E9C4","UNK_TYPE2","",0x2),
- 0x8096E9D0:("D_8096E9D0","UNK_TYPE2","",0x2),
- 0x8096E9D4:("D_8096E9D4","UNK_TYPE1","",0x1),
+ 0x8096E944:("sDisplayEffectPrimRedTargets","s16","[2]",0x4),
+ 0x8096E948:("sDisplayEffectPrimGreenTargets","s16","[2]",0x4),
+ 0x8096E94C:("sDisplayEffectPrimBlueTargets","s16","[2]",0x4),
+ 0x8096E950:("sDisplayEffectEnvRedTargets","s16","[2]",0x4),
+ 0x8096E954:("sDisplayEffectEnvBlueTargets","s16","[2]",0x4),
+ 0x8096E958:("sAppearEffectPrimGreenTargets","s16","[2]",0x4),
+ 0x8096E95C:("sAppearEffectEnvRedTargets","s16","[2]",0x4),
+ 0x8096E960:("sAppearEffectEnvBlueTargets","s16","[2]",0x4),
+ 0x8096E964:("pressStartFontIndices","u8","[10]",0x1),
+ 0x8096E970:("sAppearEffectMaskTextures","TexturePtr","[6]",0x18),
+ 0x8096E988:("sDisplayEffectMaskTextures","TexturePtr","[6]",0x18),
+ 0x8096E9A0:("sEffectTextures","TexturePtr","[6]",0x18),
+ 0x8096E9B8:("sEffectScrollVelocitySs","s16","[6]",0xC),
+ 0x8096E9C4:("sEffectScrollVelocityTs","s16","[6]",0xC),
+ 0x8096E9D0:("sTextAlpha","s16","",0x2),
+ 0x8096E9D4:("sTextAlphaTargets","s16","[2]",0x4),
0x8096E9E0:("jtbl_8096E9E0","UNK_PTR","",0x4),
0x8096F090:("Elf_Msg2_InitVars","UNK_TYPE1","",0x1),
0x8096F0B0:("D_8096F0B0","UNK_TYPE1","",0x1),
@@ -15819,9 +15679,7 @@
0x80BB821C:("D_80BB821C","f32","",0x4),
0x80BB8450:("D_80BB8450","UNK_TYPE4","",0x4),
0x80BB8454:("D_80BB8454","f32","",0x4),
- 0x80BB8458:("D_80BB8458","UNK_TYPE4","",0x4),
- 0x80BB845C:("D_80BB845C","UNK_TYPE4","",0x4),
- 0x80BB8460:("D_80BB8460","UNK_TYPE4","",0x4),
+ 0x80BB8458:("D_80BB8458","EnTanron2*","[82]",0x148),
0x80BB9720:("D_80BB9720","UNK_TYPE4","",0x4),
0x80BB972C:("D_80BB972C","UNK_TYPE4","",0x4),
0x80BB9730:("En_Tanron3_InitVars","UNK_TYPE1","",0x1),
@@ -16185,9 +16043,7 @@
0x80BDDCF0:("D_80BDDCF0","UNK_TYPE1","",0x1),
0x80BDDD1C:("D_80BDDD1C","UNK_TYPE4","",0x4),
0x80BDDD28:("D_80BDDD28","UNK_TYPE4","",0x4),
- 0x80BDDD34:("D_80BDDD34","f32","",0x4),
- 0x80BDDD38:("D_80BDDD38","f32","",0x4),
- 0x80BDDD3C:("D_80BDDD3C","f32","",0x4),
+ 0x80BDDD34:("D_80BDDD34","Vec3f","",0xC),
0x80BDDD40:("D_80BDDD40","UNK_TYPE1","",0x1),
0x80BDDD4C:("D_80BDDD4C","UNK_TYPE1","",0x1),
0x80BDDD58:("D_80BDDD58","UNK_TYPE4","",0x4),
@@ -16321,10 +16177,10 @@
0x80BE947C:("D_80BE947C","UNK_TYPE1","",0x1),
0x80BE9490:("D_80BE9490","UNK_TYPE1","",0x1),
0x80BE9A30:("En_Demo_heishi_InitVars","UNK_TYPE1","",0x1),
- 0x80BE9A50:("D_80BE9A50","UNK_TYPE1","",0x1),
- 0x80BE9A7C:("D_80BE9A7C","UNK_TYPE1","",0x1),
- 0x80BE9A80:("D_80BE9A80","UNK_TYPE1","",0x1),
- 0x80BE9A94:("D_80BE9A94","UNK_TYPE1","",0x1),
+ 0x80BE9A50:("sCylinderInit","UNK_TYPE1","",0x1),
+ 0x80BE9A7C:("sTextIds","UNK_TYPE1","",0x1),
+ 0x80BE9A80:("sAnimations","UNK_TYPE1","",0x1),
+ 0x80BE9A94:("sAnimModes","UNK_TYPE1","",0x1),
0x80BEB1B0:("En_Dt_InitVars","UNK_TYPE1","",0x1),
0x80BEB1D0:("D_80BEB1D0","UNK_TYPE1","",0x1),
0x80BEB208:("D_80BEB208","UNK_TYPE1","",0x1),
diff --git a/tools/m2ctx.py b/tools/m2ctx.py
index c2e50d59fd..0824899f15 100755
--- a/tools/m2ctx.py
+++ b/tools/m2ctx.py
@@ -40,7 +40,7 @@ def custom_replacements(output):
for x in range(12):
actorList.append(actorListText.replace("first;", f"{actorCats[x]};") + "\n")
if x == 2:
- actorList[x] = actorList[x].replace("Actor*", "Player*")
+ actorList[x] = actorList[x].replace("Actor*", "struct Player*")
elif "ActorListEntry actorLists[ACTORCAT_MAX];" in line:
output[i] = "struct {\n" + "".join(actorList) + "};"
########################################################
diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv
index ea6a1c6b87..8ec9f8ca33 100644
--- a/tools/sizes/code_functions.csv
+++ b/tools/sizes/code_functions.csv
@@ -391,7 +391,7 @@ asm/non_matchings/code/z_actor/func_800BD9A0.s,func_800BD9A0,0x800BD9A0,0x10
asm/non_matchings/code/z_actor/func_800BD9E0.s,func_800BD9E0,0x800BD9E0,0x30
asm/non_matchings/code/z_actor/func_800BDAA0.s,func_800BDAA0,0x800BDAA0,0x33
asm/non_matchings/code/z_actor/func_800BDB6C.s,func_800BDB6C,0x800BDB6C,0x3C
-asm/non_matchings/code/z_actor/Actor_ChangeAnimation.s,Actor_ChangeAnimation,0x800BDC5C,0x26
+asm/non_matchings/code/z_actor/Actor_ChangeAnimationByInfo.s,Actor_ChangeAnimationByInfo,0x800BDC5C,0x26
asm/non_matchings/code/z_actor/func_800BDCF4.s,func_800BDCF4,0x800BDCF4,0xAF
asm/non_matchings/code/z_actor/Actor_Noop.s,Actor_Noop,0x800BDFB0,0x4
asm/non_matchings/code/z_actor/Gfx_DrawDListOpa.s,Gfx_DrawDListOpa,0x800BDFC0,0x1F
@@ -589,7 +589,7 @@ asm/non_matchings/code/z_bgcheck/SurfaceType_GetEcho.s,SurfaceType_GetEcho,0x800
asm/non_matchings/code/z_bgcheck/SurfaceType_IsHookshotSurface.s,SurfaceType_IsHookshotSurface,0x800C9CEC,0xA
asm/non_matchings/code/z_bgcheck/SurfaceType_IsIgnoredByEntities.s,SurfaceType_IsIgnoredByEntities,0x800C9D14,0xF
asm/non_matchings/code/z_bgcheck/SurfaceType_IsIgnoredByProjectiles.s,SurfaceType_IsIgnoredByProjectiles,0x800C9D50,0xF
-asm/non_matchings/code/z_bgcheck/SurfaceType_IsConveyor.s,SurfaceType_IsConveyor,0x800C9D8C,0x14
+asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorType.s,SurfaceType_GetConveyorType,0x800C9D8C,0x14
asm/non_matchings/code/z_bgcheck/func_800C9DDC.s,func_800C9DDC,0x800C9DDC,0xF
asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorSpeed.s,SurfaceType_GetConveyorSpeed,0x800C9E18,0xA
asm/non_matchings/code/z_bgcheck/SurfaceType_GetConveyorDirection.s,SurfaceType_GetConveyorDirection,0x800C9E40,0x12
@@ -786,13 +786,13 @@ asm/non_matchings/code/z_camera/Camera_ChangeMode.s,Camera_ChangeMode,0x800DF840
asm/non_matchings/code/z_camera/func_800DF86C.s,func_800DF86C,0x800DF86C,0x20
asm/non_matchings/code/z_camera/func_800DF8EC.s,func_800DF8EC,0x800DF8EC,0x77
asm/non_matchings/code/z_camera/func_800DFAC8.s,func_800DFAC8,0x800DFAC8,0x13
-asm/non_matchings/code/z_camera/func_800DFB14.s,func_800DFB14,0x800DFB14,0x42
+asm/non_matchings/code/z_camera/Camera_ChangeDataIdx.s,Camera_ChangeDataIdx,0x800DFB14,0x42
asm/non_matchings/code/z_camera/func_800DFC1C.s,func_800DFC1C,0x800DFC1C,0x9
asm/non_matchings/code/z_camera/func_800DFC40.s,func_800DFC40,0x800DFC40,0xA
-asm/non_matchings/code/z_camera/func_800DFC68.s,func_800DFC68,0x800DFC68,0xA
+asm/non_matchings/code/z_camera/Camera_GetInputDirYaw.s,Camera_GetInputDirYaw,0x800DFC68,0xA
asm/non_matchings/code/z_camera/func_800DFC90.s,func_800DFC90,0x800DFC90,0x9
-asm/non_matchings/code/z_camera/func_800DFCB4.s,func_800DFCB4,0x800DFCB4,0xA
-asm/non_matchings/code/z_camera/func_800DFCDC.s,func_800DFCDC,0x800DFCDC,0xA
+asm/non_matchings/code/z_camera/Camera_GetCamDirPitch.s,Camera_GetCamDirPitch,0x800DFCB4,0xA
+asm/non_matchings/code/z_camera/Camera_GetCamDirYaw.s,Camera_GetCamDirYaw,0x800DFCDC,0xA
asm/non_matchings/code/z_camera/func_800DFD04.s,func_800DFD04,0x800DFD04,0x1D
asm/non_matchings/code/z_camera/func_800DFD78.s,func_800DFD78,0x800DFD78,0x5E
asm/non_matchings/code/z_camera/func_800DFEF0.s,func_800DFEF0,0x800DFEF0,0xA
@@ -808,9 +808,9 @@ asm/non_matchings/code/z_camera/func_800E01B8.s,func_800E01B8,0x800E01B8,0x9
asm/non_matchings/code/z_camera/func_800E01DC.s,func_800E01DC,0x800E01DC,0x13
asm/non_matchings/code/z_camera/func_800E0228.s,func_800E0228,0x800E0228,0x4
asm/non_matchings/code/z_camera/func_800E0238.s,func_800E0238,0x800E0238,0x1D
-asm/non_matchings/code/z_camera/func_800E02AC.s,func_800E02AC,0x800E02AC,0x17
-asm/non_matchings/code/z_camera/func_800E0308.s,func_800E0308,0x800E0308,0x5
-asm/non_matchings/code/z_camera/func_800E031C.s,func_800E031C,0x800E031C,0xB
+asm/non_matchings/code/z_camera/Camera_SetToTrackActor.s,Camera_SetToTrackActor,0x800E02AC,0x17
+asm/non_matchings/code/z_camera/Camera_SetTargetActor.s,Camera_SetTargetActor,0x800E0308,0x5
+asm/non_matchings/code/z_camera/Camera_GetWaterYPos.s,Camera_GetWaterYPos,0x800E031C,0xB
asm/non_matchings/code/z_camera/func_800E0348.s,func_800E0348,0x800E0348,0x16
asm/non_matchings/code/z_collision_btltbls/DamageTable_Get.s,DamageTable_Get,0x800E03A0,0xB
asm/non_matchings/code/z_collision_btltbls/DamageTable_Clear.s,DamageTable_Clear,0x800E03CC,0xD
@@ -1048,36 +1048,36 @@ asm/non_matchings/code/z_debug_mode/func_800E9DBC.s,func_800E9DBC,0x800E9DBC,0x3
asm/non_matchings/code/z_debug_mode/func_800E9E94.s,func_800E9E94,0x800E9E94,0x39
asm/non_matchings/code/z_debug_mode/func_800E9F78.s,func_800E9F78,0x800E9F78,0x3A
asm/non_matchings/code/z_demo/Cutscene_Init.s,Cutscene_Init,0x800EA060,0x1D
-asm/non_matchings/code/z_demo/func_800EA0D4.s,func_800EA0D4,0x800EA0D4,0x6
-asm/non_matchings/code/z_demo/func_800EA0EC.s,func_800EA0EC,0x800EA0EC,0x9
-asm/non_matchings/code/z_demo/Cutscene_StepCutscene1.s,Cutscene_StepCutscene1,0x800EA110,0x13
-asm/non_matchings/code/z_demo/Cutscene_StepCutscene2.s,Cutscene_StepCutscene2,0x800EA15C,0x2D
-asm/non_matchings/code/z_demo/Cutscene_Nop800EA210.s,Cutscene_Nop800EA210,0x800EA210,0x4
+asm/non_matchings/code/z_demo/Cutscene_Start.s,Cutscene_Start,0x800EA0D4,0x6
+asm/non_matchings/code/z_demo/Cutscene_End.s,Cutscene_End,0x800EA0EC,0x9
+asm/non_matchings/code/z_demo/Cutscene_Update1.s,Cutscene_Update1,0x800EA110,0x13
+asm/non_matchings/code/z_demo/Cutscene_Update2.s,Cutscene_Update2,0x800EA15C,0x2D
+asm/non_matchings/code/z_demo/Cutscene_DoNothing.s,Cutscene_DoNothing,0x800EA210,0x4
asm/non_matchings/code/z_demo/func_800EA220.s,func_800EA220,0x800EA220,0xE
asm/non_matchings/code/z_demo/func_800EA258.s,func_800EA258,0x800EA258,0x18
asm/non_matchings/code/z_demo/func_800EA2B8.s,func_800EA2B8,0x800EA2B8,0x1B
-asm/non_matchings/code/z_demo/func_800EA324.s,func_800EA324,0x800EA324,0x222
-asm/non_matchings/code/z_demo/func_800EABAC.s,func_800EABAC,0x800EABAC,0x17
-asm/non_matchings/code/z_demo/func_800EAC08.s,func_800EAC08,0x800EAC08,0xF
-asm/non_matchings/code/z_demo/func_800EAC44.s,func_800EAC44,0x800EAC44,0x14
-asm/non_matchings/code/z_demo/func_800EAC94.s,func_800EAC94,0x800EAC94,0x20
-asm/non_matchings/code/z_demo/func_800EAD14.s,func_800EAD14,0x800EAD14,0xD
+asm/non_matchings/code/z_demo/Cutscene_Command_Misc.s,Cutscene_Command_Misc,0x800EA324,0x222
+asm/non_matchings/code/z_demo/Cutscene_Command_SetLighting.s,Cutscene_Command_SetLighting,0x800EABAC,0x17
+asm/non_matchings/code/z_demo/Cutscene_Command_PlaySequence.s,Cutscene_Command_PlaySequence,0x800EAC08,0xF
+asm/non_matchings/code/z_demo/Cutscene_Command_StopSequence.s,Cutscene_Command_StopSequence,0x800EAC44,0x14
+asm/non_matchings/code/z_demo/Cutscene_Command_FadeSequence.s,Cutscene_Command_FadeSequence,0x800EAC94,0x20
+asm/non_matchings/code/z_demo/Cutscene_Command_PlayAmbienceSequence.s,Cutscene_Command_PlayAmbienceSequence,0x800EAD14,0xD
asm/non_matchings/code/z_demo/func_800EAD48.s,func_800EAD48,0x800EAD48,0xD
asm/non_matchings/code/z_demo/func_800EAD7C.s,func_800EAD7C,0x800EAD7C,0xD
asm/non_matchings/code/z_demo/func_800EADB0.s,func_800EADB0,0x800EADB0,0x47
-asm/non_matchings/code/z_demo/func_800EAECC.s,func_800EAECC,0x800EAECC,0x15
-asm/non_matchings/code/z_demo/func_800EAF20.s,func_800EAF20,0x800EAF20,0x30
-asm/non_matchings/code/z_demo/func_800EAFE0.s,func_800EAFE0,0x800EAFE0,0x7F
-asm/non_matchings/code/z_demo/func_800EB1DC.s,func_800EB1DC,0x800EB1DC,0x62
-asm/non_matchings/code/z_demo/func_800EB364.s,func_800EB364,0x800EB364,0x54
-asm/non_matchings/code/z_demo/func_800EB4B4.s,func_800EB4B4,0x800EB4B4,0x91
-asm/non_matchings/code/z_demo/func_800EB6F8.s,func_800EB6F8,0x800EB6F8,0x11C
-asm/non_matchings/code/z_demo/func_800EBB68.s,func_800EBB68,0x800EBB68,0x5A
-asm/non_matchings/code/z_demo/func_800EBCD0.s,func_800EBCD0,0x800EBCD0,0x24
-asm/non_matchings/code/z_demo/func_800EBD60.s,func_800EBD60,0x800EBD60,0x246
-asm/non_matchings/code/z_demo/func_800EC678.s,func_800EC678,0x800EC678,0x17
-asm/non_matchings/code/z_demo/func_800EC6D4.s,func_800EC6D4,0x800EC6D4,0x94
-asm/non_matchings/code/z_demo/func_800EC924.s,func_800EC924,0x800EC924,0x116
+asm/non_matchings/code/z_demo/Cutscene_Command_FadeAmbienceSequence.s,Cutscene_Command_FadeAmbienceSequence,0x800EAECC,0x15
+asm/non_matchings/code/z_demo/Cutscene_Command_Rumble.s,Cutscene_Command_Rumble,0x800EAF20,0x30
+asm/non_matchings/code/z_demo/Cutscene_Command_FadeColorScreen.s,Cutscene_Command_FadeColorScreen,0x800EAFE0,0x7F
+asm/non_matchings/code/z_demo/Cutscene_Command_SetTime.s,Cutscene_Command_SetTime,0x800EB1DC,0x62
+asm/non_matchings/code/z_demo/Cutscene_TerminatorImpl.s,Cutscene_TerminatorImpl,0x800EB364,0x54
+asm/non_matchings/code/z_demo/Cutscene_Command_Terminator.s,Cutscene_Command_Terminator,0x800EB4B4,0x91
+asm/non_matchings/code/z_demo/Cutscene_Command_ChooseCreditsScenes.s,Cutscene_Command_ChooseCreditsScenes,0x800EB6F8,0x11C
+asm/non_matchings/code/z_demo/Cutscene_Command_MotionBlur.s,Cutscene_Command_MotionBlur,0x800EBB68,0x5A
+asm/non_matchings/code/z_demo/Cutscene_Command_GiveTatlToPlayer.s,Cutscene_Command_GiveTatlToPlayer,0x800EBCD0,0x24
+asm/non_matchings/code/z_demo/Cutscene_Command_TransitionFX.s,Cutscene_Command_TransitionFX,0x800EBD60,0x246
+asm/non_matchings/code/z_demo/Cutscene_Command_Camera.s,Cutscene_Command_Camera,0x800EC678,0x17
+asm/non_matchings/code/z_demo/Cutscene_CountNormalMasks.s,Cutscene_CountNormalMasks,0x800EC6D4,0x94
+asm/non_matchings/code/z_demo/Cutscene_Command_Textbox.s,Cutscene_Command_Textbox,0x800EC924,0x116
asm/non_matchings/code/z_demo/func_800ECD7C.s,func_800ECD7C,0x800ECD7C,0x31
asm/non_matchings/code/z_demo/Cutscene_ProcessCommands.s,Cutscene_ProcessCommands,0x800ECE40,0x2D0
asm/non_matchings/code/z_demo/func_800ED980.s,func_800ED980,0x800ED980,0x11
@@ -1085,17 +1085,17 @@ asm/non_matchings/code/z_demo/func_800ED9C4.s,func_800ED9C4,0x800ED9C4,0x10
asm/non_matchings/code/z_demo/func_800EDA04.s,func_800EDA04,0x800EDA04,0x20
asm/non_matchings/code/z_demo/func_800EDA84.s,func_800EDA84,0x800EDA84,0x57
asm/non_matchings/code/z_demo/func_800EDBE0.s,func_800EDBE0,0x800EDBE0,0x74
-asm/non_matchings/code/z_demo/nop_800EDDB0.s,nop_800EDDB0,0x800EDDB0,0x3
+asm/non_matchings/code/z_demo/func_800EDDB0.s,func_800EDDB0,0x800EDDB0,0x3
asm/non_matchings/code/z_demo/func_800EDDBC.s,func_800EDDBC,0x800EDDBC,0x4
-asm/non_matchings/code/z_demo/func_800EDDCC.s,func_800EDDCC,0x800EDDCC,0x1A
-asm/non_matchings/code/z_demo/func_800EDE34.s,func_800EDE34,0x800EDE34,0x3C
-asm/non_matchings/code/z_demo/func_800EDF24.s,func_800EDF24,0x800EDF24,0x15
-asm/non_matchings/code/z_demo/func_800EDF78.s,func_800EDF78,0x800EDF78,0x55
-asm/non_matchings/code/z_demo/func_800EE0CC.s,func_800EE0CC,0x800EE0CC,0x43
-asm/non_matchings/code/z_demo/func_800EE1D8.s,func_800EE1D8,0x800EE1D8,0xA
-asm/non_matchings/code/z_demo/func_800EE200.s,func_800EE200,0x800EE200,0x27
-asm/non_matchings/code/z_demo/func_800EE29C.s,func_800EE29C,0x800EE29C,0x16
-asm/non_matchings/code/z_demo/func_800EE2F4.s,func_800EE2F4,0x800EE2F4,0xB
+asm/non_matchings/code/z_demo/Cutscene_LoadCutsceneData.s,Cutscene_LoadCutsceneData,0x800EDDCC,0x1A
+asm/non_matchings/code/z_demo/Cutscene_ActorTranslate.s,Cutscene_ActorTranslate,0x800EDE34,0x3C
+asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYaw.s,Cutscene_ActorTranslateAndYaw,0x800EDF24,0x15
+asm/non_matchings/code/z_demo/Cutscene_ActorTranslateAndYawSmooth.s,Cutscene_ActorTranslateAndYawSmooth,0x800EDF78,0x55
+asm/non_matchings/code/z_demo/Cutscene_ActorTranslateXZAndYawSmooth.s,Cutscene_ActorTranslateXZAndYawSmooth,0x800EE0CC,0x43
+asm/non_matchings/code/z_demo/Cutscene_GetSceneSetupIndex.s,Cutscene_GetSceneSetupIndex,0x800EE1D8,0xA
+asm/non_matchings/code/z_demo/Cutscene_GetActorActionIndex.s,Cutscene_GetActorActionIndex,0x800EE200,0x27
+asm/non_matchings/code/z_demo/Cutscene_CheckActorAction.s,Cutscene_CheckActorAction,0x800EE29C,0x16
+asm/non_matchings/code/z_demo/Cutscene_IsPlaying.s,Cutscene_IsPlaying,0x800EE2F4,0xB
asm/non_matchings/code/z_draw/GetItem_Draw.s,GetItem_Draw,0x800EE320,0x11
asm/non_matchings/code/z_draw/func_800EE364.s,func_800EE364,0x800EE364,0x27
asm/non_matchings/code/z_draw/func_800EE400.s,func_800EE400,0x800EE400,0x7F
@@ -1224,7 +1224,7 @@ asm/non_matchings/code/z_kankyo/func_800F5090.s,func_800F5090,0x800F5090,0x11
asm/non_matchings/code/z_kankyo/func_800F50D4.s,func_800F50D4,0x800F50D4,0xE
asm/non_matchings/code/z_kankyo/Kankyo_Init.s,Kankyo_Init,0x800F510C,0x212
asm/non_matchings/code/z_kankyo/func_800F5954.s,func_800F5954,0x800F5954,0x4E
-asm/non_matchings/code/z_kankyo/func_800F5A8C.s,func_800F5A8C,0x800F5A8C,0x21
+asm/non_matchings/code/z_kankyo/Environment_LerpWeight.s,Environment_LerpWeight,0x800F5A8C,0x21
asm/non_matchings/code/z_kankyo/func_800F5B10.s,func_800F5B10,0x800F5B10,0x70
asm/non_matchings/code/z_kankyo/func_800F5CD0.s,func_800F5CD0,0x800F5CD0,0x2D9
asm/non_matchings/code/z_kankyo/func_800F6834.s,func_800F6834,0x800F6834,0x46
@@ -1252,7 +1252,7 @@ asm/non_matchings/code/z_kankyo/func_800FAAB4.s,func_800FAAB4,0x800FAAB4,0x5B
asm/non_matchings/code/z_kankyo/func_800FAC20.s,func_800FAC20,0x800FAC20,0xD5
asm/non_matchings/code/z_kankyo/func_800FAF74.s,func_800FAF74,0x800FAF74,0x27
asm/non_matchings/code/z_kankyo/func_800FB010.s,func_800FB010,0x800FB010,0xC4
-asm/non_matchings/code/z_kankyo/func_800FB320.s,func_800FB320,0x800FB320,0x1A
+asm/non_matchings/code/z_kankyo/Environment_AddLightningBolts.s,Environment_AddLightningBolts,0x800FB320,0x1A
asm/non_matchings/code/z_kankyo/func_800FB388.s,func_800FB388,0x800FB388,0xF4
asm/non_matchings/code/z_kankyo/func_800FB758.s,func_800FB758,0x800FB758,0x97
asm/non_matchings/code/z_kankyo/func_800FB9B4.s,func_800FB9B4,0x800FB9B4,0xC2
@@ -1633,8 +1633,8 @@ asm/non_matchings/code/z_parameter/func_801149A0.s,func_801149A0,0x801149A0,0x3F
asm/non_matchings/code/z_parameter/func_80114A9C.s,func_80114A9C,0x80114A9C,0x3A
asm/non_matchings/code/z_parameter/func_80114B84.s,func_80114B84,0x80114B84,0x47
asm/non_matchings/code/z_parameter/func_80114CA0.s,func_80114CA0,0x80114CA0,0x7C
-asm/non_matchings/code/z_parameter/func_80114E90.s,func_80114E90,0x80114E90,0x27
-asm/non_matchings/code/z_parameter/func_80114F2C.s,func_80114F2C,0x80114F2C,0x29
+asm/non_matchings/code/z_parameter/Interface_HasEmptyBottle.s,Interface_HasEmptyBottle,0x80114E90,0x27
+asm/non_matchings/code/z_parameter/Interface_HasItemInBottle.s,Interface_HasItemInBottle,0x80114F2C,0x29
asm/non_matchings/code/z_parameter/func_80114FD0.s,func_80114FD0,0x80114FD0,0x58
asm/non_matchings/code/z_parameter/func_80115130.s,func_80115130,0x80115130,0x62
asm/non_matchings/code/z_parameter/func_801152B8.s,func_801152B8,0x801152B8,0x44
@@ -1720,7 +1720,7 @@ asm/non_matchings/code/z_player_lib/func_801239AC.s,func_801239AC,0x801239AC,0x3
asm/non_matchings/code/z_player_lib/func_80123AA4.s,func_80123AA4,0x80123AA4,0x4C
asm/non_matchings/code/z_player_lib/func_80123BD4.s,func_80123BD4,0x80123BD4,0x21
asm/non_matchings/code/z_player_lib/func_80123C58.s,func_80123C58,0x80123C58,0xE
-asm/non_matchings/code/z_player_lib/func_80123C90.s,func_80123C90,0x80123C90,0x30
+asm/non_matchings/code/z_player_lib/Player_SetEquipmentData.s,Player_SetEquipmentData,0x80123C90,0x30
asm/non_matchings/code/z_player_lib/func_80123D50.s,func_80123D50,0x80123D50,0x15
asm/non_matchings/code/z_player_lib/func_80123DA4.s,func_80123DA4,0x80123DA4,0x7
asm/non_matchings/code/z_player_lib/func_80123DC0.s,func_80123DC0,0x80123DC0,0x34
@@ -1816,14 +1816,14 @@ asm/non_matchings/code/z_quake/Quake_Init.s,Quake_Init,0x8012AA48,0x15
asm/non_matchings/code/z_quake/Quake_Add.s,Quake_Add,0x8012AA9C,0x9
asm/non_matchings/code/z_quake/Quake_RemoveFromIdx.s,Quake_RemoveFromIdx,0x8012AAC0,0x12
asm/non_matchings/code/z_quake/Quake_Calc.s,Quake_Calc,0x8012AB08,0xD8
-asm/non_matchings/code/z_quake/Quake2_Init.s,Quake2_Init,0x8012AE68,0x11
-asm/non_matchings/code/z_quake/Quake2_SetCountdown.s,Quake2_SetCountdown,0x8012AEAC,0xA
-asm/non_matchings/code/z_quake/Quake2_GetCountdown.s,Quake2_GetCountdown,0x8012AED4,0x4
-asm/non_matchings/code/z_quake/Quake2_GetType.s,Quake2_GetType,0x8012AEE4,0x4
-asm/non_matchings/code/z_quake/Quake2_SetType.s,Quake2_SetType,0x8012AEF4,0x9
-asm/non_matchings/code/z_quake/Quake2_ClearType.s,Quake2_ClearType,0x8012AF18,0x8
-asm/non_matchings/code/z_quake/Quake2_GetFloorQuake.s,Quake2_GetFloorQuake,0x8012AF38,0x19
-asm/non_matchings/code/z_quake/Quake2_Update.s,Quake2_Update,0x8012AF9C,0x313
+asm/non_matchings/code/z_quake/Distortion_Init.s,Distortion_Init,0x8012AE68,0x11
+asm/non_matchings/code/z_quake/Distortion_SetCountdown.s,Distortion_SetCountdown,0x8012AEAC,0xA
+asm/non_matchings/code/z_quake/Distortion_GetCountdown.s,Distortion_GetCountdown,0x8012AED4,0x4
+asm/non_matchings/code/z_quake/Distortion_GetType.s,Distortion_GetType,0x8012AEE4,0x4
+asm/non_matchings/code/z_quake/Distortion_SetType.s,Distortion_SetType,0x8012AEF4,0x9
+asm/non_matchings/code/z_quake/Distortion_ClearType.s,Distortion_ClearType,0x8012AF18,0x8
+asm/non_matchings/code/z_quake/Distortion_GetUnderwaterCurrentSpeed.s,Distortion_GetUnderwaterCurrentSpeed,0x8012AF38,0x19
+asm/non_matchings/code/z_quake/Distortion_Update.s,Distortion_Update,0x8012AF9C,0x313
asm/non_matchings/code/z_quake/Quake_NumActiveQuakes.s,Quake_NumActiveQuakes,0x8012BBE8,0x1A
asm/non_matchings/code/z_rcp/Gfx_SetFog.s,Gfx_SetFog,0x8012BC50,0x4F
asm/non_matchings/code/z_rcp/Gfx_SetFogWithSync.s,Gfx_SetFogWithSync,0x8012BD8C,0x5F
@@ -1919,16 +1919,16 @@ asm/non_matchings/code/z_room/Room_StartRoomTransition.s,Room_StartRoomTransitio
asm/non_matchings/code/z_room/Room_HandleLoadCallbacks.s,Room_HandleLoadCallbacks,0x8012EAA8,0x40
asm/non_matchings/code/z_room/Room_Draw.s,Room_Draw,0x8012EBA8,0x14
asm/non_matchings/code/z_room/func_8012EBF8.s,func_8012EBF8,0x8012EBF8,0x22
-asm/non_matchings/code/code_8012EC80/func_8012EC80.s,func_8012EC80,0x8012EC80,0x2D
-asm/non_matchings/code/code_8012EC80/func_8012ED34.s,func_8012ED34,0x8012ED34,0x11
-asm/non_matchings/code/code_8012EC80/func_8012ED78.s,func_8012ED78,0x8012ED78,0x1C
-asm/non_matchings/code/code_8012EC80/func_8012EDE8.s,func_8012EDE8,0x8012EDE8,0x13
-asm/non_matchings/code/code_8012EC80/func_8012EE34.s,func_8012EE34,0x8012EE34,0x36
-asm/non_matchings/code/code_8012EC80/func_8012EF0C.s,func_8012EF0C,0x8012EF0C,0x78
-asm/non_matchings/code/code_8012EC80/func_8012F0EC.s,func_8012F0EC,0x8012F0EC,0x34
-asm/non_matchings/code/code_8012EC80/func_8012F1BC.s,func_8012F1BC,0x8012F1BC,0x1C
-asm/non_matchings/code/code_8012EC80/func_8012F22C.s,func_8012F22C,0x8012F22C,0x13
-asm/non_matchings/code/code_8012EC80/func_8012F278.s,func_8012F278,0x8012F278,0x16
+asm/non_matchings/code/code_8012EC80/Inventory_GetBtnBItem.s,Inventory_GetBtnBItem,0x8012EC80,0x2D
+asm/non_matchings/code/code_8012EC80/Inventory_ChangeEquipment.s,Inventory_ChangeEquipment,0x8012ED34,0x11
+asm/non_matchings/code/code_8012EC80/Inventory_DeleteEquipment.s,Inventory_DeleteEquipment,0x8012ED78,0x1C
+asm/non_matchings/code/code_8012EC80/Inventory_ChangeUpgrade.s,Inventory_ChangeUpgrade,0x8012EDE8,0x13
+asm/non_matchings/code/code_8012EC80/Inventory_IsMapVisible.s,Inventory_IsMapVisible,0x8012EE34,0x36
+asm/non_matchings/code/code_8012EC80/Inventory_SetMapVisibility.s,Inventory_SetMapVisibility,0x8012EF0C,0x78
+asm/non_matchings/code/code_8012EC80/Inventory_SaveDekuPlaygroundHighScore.s,Inventory_SaveDekuPlaygroundHighScore,0x8012F0EC,0x34
+asm/non_matchings/code/code_8012EC80/Inventory_IncrementSkullTokenCount.s,Inventory_IncrementSkullTokenCount,0x8012F1BC,0x1C
+asm/non_matchings/code/code_8012EC80/Inventory_GetSkullTokenCount.s,Inventory_GetSkullTokenCount,0x8012F22C,0x13
+asm/non_matchings/code/code_8012EC80/Inventory_SaveLotteryCodeGuess.s,Inventory_SaveLotteryCodeGuess,0x8012F278,0x16
asm/non_matchings/code/z_scene/Object_Spawn.s,Object_Spawn,0x8012F2E0,0x3C
asm/non_matchings/code/z_scene/Object_InitBank.s,Object_InitBank,0x8012F3D0,0x4B
asm/non_matchings/code/z_scene/Object_UpdateBank.s,Object_UpdateBank,0x8012F4FC,0x43
@@ -2041,8 +2041,8 @@ asm/non_matchings/code/z_skelanime/SkelAnime_DrawLimb.s,SkelAnime_DrawLimb,0x801
asm/non_matchings/code/z_skelanime/SkelAnime_Draw.s,SkelAnime_Draw,0x80133B3C,0x68
asm/non_matchings/code/z_skelanime/SkelAnime_DrawLimbSV.s,SkelAnime_DrawLimbSV,0x80133CDC,0x93
asm/non_matchings/code/z_skelanime/SkelAnime_DrawFlexOpa.s,SkelAnime_DrawFlexOpa,0x80133F28,0x88
-asm/non_matchings/code/z_skelanime/func_80134148.s,func_80134148,0x80134148,0x9E
-asm/non_matchings/code/z_skelanime/func_801343C0.s,func_801343C0,0x801343C0,0x90
+asm/non_matchings/code/z_skelanime/SkelAnime_DrawTransformFlexLimbOpa.s,SkelAnime_DrawTransformFlexLimbOpa,0x80134148,0x9E
+asm/non_matchings/code/z_skelanime/SkelAnime_DrawTransformFlexOpa.s,SkelAnime_DrawTransformFlexOpa,0x801343C0,0x90
asm/non_matchings/code/z_skelanime/SkelAnime_AnimateFrame.s,SkelAnime_AnimateFrame,0x80134600,0x49
asm/non_matchings/code/z_skelanime/SkelAnime_GetTotalFrames.s,SkelAnime_GetTotalFrames,0x80134724,0x9
asm/non_matchings/code/z_skelanime/Animation_GetLastFrame.s,Animation_GetLastFrame,0x80134748,0xB
@@ -2170,11 +2170,11 @@ asm/non_matchings/code/z_snap/func_8013A4C4.s,func_8013A4C4,0x8013A4C4,0x10
asm/non_matchings/code/z_snap/func_8013A504.s,func_8013A504,0x8013A504,0xB
asm/non_matchings/code/z_snap/func_8013A530.s,func_8013A530,0x8013A530,0xA4
asm/non_matchings/code/z_sub_s/SubS_FindDoor.s,SubS_FindDoor,0x8013A7C0,0x28
-asm/non_matchings/code/z_sub_s/func_8013A860.s,func_8013A860,0x8013A860,0xA8
-asm/non_matchings/code/z_sub_s/func_8013AB00.s,func_8013AB00,0x8013AB00,0x9B
+asm/non_matchings/code/z_sub_s/SubS_DrawTransformFlexLimb.s,SubS_DrawTransformFlexLimb,0x8013A860,0xA8
+asm/non_matchings/code/z_sub_s/SubS_DrawTransformFlex.s,SubS_DrawTransformFlex,0x8013AB00,0x9B
asm/non_matchings/code/z_sub_s/func_8013AD6C.s,func_8013AD6C,0x8013AD6C,0xC
asm/non_matchings/code/z_sub_s/func_8013AD9C.s,func_8013AD9C,0x8013AD9C,0x4E
-asm/non_matchings/code/z_sub_s/func_8013AED4.s,func_8013AED4,0x8013AED4,0xB
+asm/non_matchings/code/z_sub_s/SubS_UpdateFlags.s,SubS_UpdateFlags,0x8013AED4,0xB
asm/non_matchings/code/z_sub_s/func_8013AF00.s,func_8013AF00,0x8013AF00,0x44
asm/non_matchings/code/z_sub_s/func_8013B010.s,func_8013B010,0x8013B010,0x2E
asm/non_matchings/code/z_sub_s/func_8013B0C8.s,func_8013B0C8,0x8013B0C8,0xA2
@@ -2183,7 +2183,7 @@ asm/non_matchings/code/z_sub_s/func_8013B6B0.s,func_8013B6B0,0x8013B6B0,0x72
asm/non_matchings/code/z_sub_s/func_8013B878.s,func_8013B878,0x8013B878,0xAF
asm/non_matchings/code/z_sub_s/func_8013BB34.s,func_8013BB34,0x8013BB34,0x12
asm/non_matchings/code/z_sub_s/SubS_FindNearestActor.s,SubS_FindNearestActor,0x8013BB7C,0x3C
-asm/non_matchings/code/z_sub_s/func_8013BC6C.s,func_8013BC6C,0x8013BC6C,0x35
+asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationByInfoS.s,SubS_ChangeAnimationByInfoS,0x8013BC6C,0x35
asm/non_matchings/code/z_sub_s/func_8013BD40.s,func_8013BD40,0x8013BD40,0x67
asm/non_matchings/code/z_sub_s/func_8013BEDC.s,func_8013BEDC,0x8013BEDC,0x63
asm/non_matchings/code/z_sub_s/func_8013C068.s,func_8013C068,0x8013C068,0x16F
@@ -2195,16 +2195,16 @@ asm/non_matchings/code/z_sub_s/func_8013CD64.s,func_8013CD64,0x8013CD64,0x68
asm/non_matchings/code/z_sub_s/func_8013CF04.s,func_8013CF04,0x8013CF04,0x77
asm/non_matchings/code/z_sub_s/func_8013D0E0.s,func_8013D0E0,0x8013D0E0,0x80
asm/non_matchings/code/z_sub_s/func_8013D2E0.s,func_8013D2E0,0x8013D2E0,0xC2
-asm/non_matchings/code/z_sub_s/func_8013D5E8.s,func_8013D5E8,0x8013D5E8,0x18
+asm/non_matchings/code/z_sub_s/SubS_AngleDiffLessEqual.s,SubS_AngleDiffLessEqual,0x8013D5E8,0x18
asm/non_matchings/code/z_sub_s/func_8013D648.s,func_8013D648,0x8013D648,0x11
asm/non_matchings/code/z_sub_s/func_8013D68C.s,func_8013D68C,0x8013D68C,0x25
asm/non_matchings/code/z_sub_s/func_8013D720.s,func_8013D720,0x8013D720,0x12
asm/non_matchings/code/z_sub_s/func_8013D768.s,func_8013D768,0x8013D768,0x35
asm/non_matchings/code/z_sub_s/func_8013D83C.s,func_8013D83C,0x8013D83C,0x28
-asm/non_matchings/code/z_sub_s/func_8013D8DC.s,func_8013D8DC,0x8013D8DC,0x12
-asm/non_matchings/code/z_sub_s/func_8013D924.s,func_8013D924,0x8013D924,0xF
+asm/non_matchings/code/z_sub_s/SubS_IsObjectLoaded.s,SubS_IsObjectLoaded,0x8013D8DC,0x12
+asm/non_matchings/code/z_sub_s/SubS_GetObjectIndex.s,SubS_GetObjectIndex,0x8013D924,0xF
asm/non_matchings/code/z_sub_s/SubS_FindActor.s,SubS_FindActor,0x8013D960,0x1A
-asm/non_matchings/code/z_sub_s/func_8013D9C8.s,func_8013D9C8,0x8013D9C8,0x72
+asm/non_matchings/code/z_sub_s/SubS_FillLimbRotTables.s,SubS_FillLimbRotTables,0x8013D9C8,0x72
asm/non_matchings/code/z_sub_s/func_8013DB90.s,func_8013DB90,0x8013DB90,0x2C
asm/non_matchings/code/z_sub_s/func_8013DC40.s,func_8013DC40,0x8013DC40,0x23
asm/non_matchings/code/z_sub_s/func_8013DCCC.s,func_8013DCCC,0x8013DCCC,0x5
@@ -2214,9 +2214,9 @@ asm/non_matchings/code/z_sub_s/func_8013DF3C.s,func_8013DF3C,0x8013DF3C,0x46
asm/non_matchings/code/z_sub_s/func_8013E054.s,func_8013E054,0x8013E054,0xA
asm/non_matchings/code/z_sub_s/func_8013E07C.s,func_8013E07C,0x8013E07C,0xA
asm/non_matchings/code/z_sub_s/func_8013E0A4.s,func_8013E0A4,0x8013E0A4,0x49
-asm/non_matchings/code/z_sub_s/func_8013E1C8.s,func_8013E1C8,0x8013E1C8,0x43
-asm/non_matchings/code/z_sub_s/func_8013E2D4.s,func_8013E2D4,0x8013E2D4,0x39
-asm/non_matchings/code/z_sub_s/func_8013E3B8.s,func_8013E3B8,0x8013E3B8,0x3E
+asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationBySpeedInfo.s,SubS_ChangeAnimationBySpeedInfo,0x8013E1C8,0x43
+asm/non_matchings/code/z_sub_s/SubS_StartActorCutscene.s,SubS_StartActorCutscene,0x8013E2D4,0x39
+asm/non_matchings/code/z_sub_s/SubS_FillCutscenesList.s,SubS_FillCutscenesList,0x8013E3B8,0x3E
asm/non_matchings/code/z_sub_s/func_8013E4B0.s,func_8013E4B0,0x8013E4B0,0x47
asm/non_matchings/code/z_sub_s/func_8013E5CC.s,func_8013E5CC,0x8013E5CC,0x1D
asm/non_matchings/code/z_sub_s/SubS_FindActorCustom.s,SubS_FindActorCustom,0x8013E640,0x42
@@ -2248,13 +2248,13 @@ asm/non_matchings/code/z_view/View_GetViewport.s,View_GetViewport,0x8013F1B0,0xA
asm/non_matchings/code/z_view/View_WriteScissor.s,View_WriteScissor,0x8013F1D8,0x2D
asm/non_matchings/code/z_view/View_SyncAndWriteScissor.s,View_SyncAndWriteScissor,0x8013F28C,0x1B
asm/non_matchings/code/z_view/View_SetScissorForLetterbox.s,View_SetScissorForLetterbox,0x8013F2F8,0x40
-asm/non_matchings/code/z_view/View_SetQuakeRotation.s,View_SetQuakeRotation,0x8013F3F8,0xA
-asm/non_matchings/code/z_view/View_SetQuakeScale.s,View_SetQuakeScale,0x8013F420,0xA
-asm/non_matchings/code/z_view/View_SetQuakeSpeed.s,View_SetQuakeSpeed,0x8013F448,0x5
-asm/non_matchings/code/z_view/View_InitCameraQuake.s,View_InitCameraQuake,0x8013F45C,0x19
-asm/non_matchings/code/z_view/View_ClearQuake.s,View_ClearQuake,0x8013F4C0,0xD
-asm/non_matchings/code/z_view/View_SetQuake.s,View_SetQuake,0x8013F4F4,0x16
-asm/non_matchings/code/z_view/View_StepQuake.s,View_StepQuake,0x8013F54C,0x6C
+asm/non_matchings/code/z_view/View_SetDistortionDirRot.s,View_SetDistortionDirRot,0x8013F3F8,0xA
+asm/non_matchings/code/z_view/View_SetDistortionScale.s,View_SetDistortionScale,0x8013F420,0xA
+asm/non_matchings/code/z_view/View_SetDistortionSpeed.s,View_SetDistortionSpeed,0x8013F448,0x5
+asm/non_matchings/code/z_view/View_InitDistortion.s,View_InitDistortion,0x8013F45C,0x19
+asm/non_matchings/code/z_view/View_ClearDistortion.s,View_ClearDistortion,0x8013F4C0,0xD
+asm/non_matchings/code/z_view/View_SetDistortion.s,View_SetDistortion,0x8013F4F4,0x16
+asm/non_matchings/code/z_view/View_StepDistortion.s,View_StepDistortion,0x8013F54C,0x6C
asm/non_matchings/code/z_view/View_RenderView.s,View_RenderView,0x8013F6FC,0x13
asm/non_matchings/code/z_view/View_RenderToPerspectiveMatrix.s,View_RenderToPerspectiveMatrix,0x8013F748,0xB5
asm/non_matchings/code/z_view/View_RenderToOrthographicMatrix.s,View_RenderToOrthographicMatrix,0x8013FA1C,0x6B
@@ -2366,7 +2366,7 @@ asm/non_matchings/code/z_message/func_8014D7B4.s,func_8014D7B4,0x8014D7B4,0xCB4
asm/non_matchings/code/z_message/func_80150A84.s,func_80150A84,0x80150A84,0xA1
asm/non_matchings/code/z_message/func_80150D08.s,func_80150D08,0x80150D08,0x1EA
asm/non_matchings/code/z_message/func_801514B0.s,func_801514B0,0x801514B0,0x100
-asm/non_matchings/code/z_message/func_801518B0.s,func_801518B0,0x801518B0,0x22
+asm/non_matchings/code/z_message/Message_StartTextbox.s,Message_StartTextbox,0x801518B0,0x22
asm/non_matchings/code/z_message/func_80151938.s,func_80151938,0x80151938,0x4C
asm/non_matchings/code/z_message/func_80151A68.s,func_80151A68,0x80151A68,0x53
asm/non_matchings/code/z_message/func_80151BB4.s,func_80151BB4,0x80151BB4,0x3A
@@ -2520,24 +2520,24 @@ asm/non_matchings/code/z_play/func_8016927C.s,func_8016927C,0x8016927C,0x12
asm/non_matchings/code/z_play/func_801692C4.s,func_801692C4,0x801692C4,0x44
asm/non_matchings/code/z_play/Play_SceneInit.s,Play_SceneInit,0x801693D4,0x28
asm/non_matchings/code/z_play/func_80169474.s,func_80169474,0x80169474,0x1A
-asm/non_matchings/code/z_play/func_801694DC.s,func_801694DC,0x801694DC,0x2A
-asm/non_matchings/code/z_play/Play_GetActiveCameraIndex.s,Play_GetActiveCameraIndex,0x80169584,0x3
-asm/non_matchings/code/z_play/func_80169590.s,func_80169590,0x80169590,0x1C
-asm/non_matchings/code/z_play/func_80169600.s,func_80169600,0x80169600,0x1A
-asm/non_matchings/code/z_play/func_80169668.s,func_80169668,0x80169668,0x1B
+asm/non_matchings/code/z_play/Play_CreateSubCamera.s,Play_CreateSubCamera,0x801694DC,0x2A
+asm/non_matchings/code/z_play/Play_GetActiveCamId.s,Play_GetActiveCamId,0x80169584,0x3
+asm/non_matchings/code/z_play/Play_CameraChangeStatus.s,Play_CameraChangeStatus,0x80169590,0x1C
+asm/non_matchings/code/z_play/Play_ClearCamera.s,Play_ClearCamera,0x80169600,0x1A
+asm/non_matchings/code/z_play/Play_ClearAllSubCameras.s,Play_ClearAllSubCameras,0x80169668,0x1B
asm/non_matchings/code/z_play/Play_GetCamera.s,Play_GetCamera,0x801696D4,0xE
asm/non_matchings/code/z_play/Play_CameraSetAtEye.s,Play_CameraSetAtEye,0x8016970C,0x44
-asm/non_matchings/code/z_play/func_8016981C.s,func_8016981C,0x8016981C,0x49
-asm/non_matchings/code/z_play/func_80169940.s,func_80169940,0x80169940,0x12
-asm/non_matchings/code/z_play/func_80169988.s,func_80169988,0x80169988,0x13
-asm/non_matchings/code/z_play/func_801699D4.s,func_801699D4,0x801699D4,0x1F
+asm/non_matchings/code/z_play/Play_CameraSetAtEyeUp.s,Play_CameraSetAtEyeUp,0x8016981C,0x49
+asm/non_matchings/code/z_play/Play_CameraSetFov.s,Play_CameraSetFov,0x80169940,0x12
+asm/non_matchings/code/z_play/Play_CameraSetRoll.s,Play_CameraSetRoll,0x80169988,0x13
+asm/non_matchings/code/z_play/Play_CopyCamera.s,Play_CopyCamera,0x801699D4,0x1F
asm/non_matchings/code/z_play/func_80169A50.s,func_80169A50,0x80169A50,0x1C
-asm/non_matchings/code/z_play/func_80169AC0.s,func_80169AC0,0x80169AC0,0xF
+asm/non_matchings/code/z_play/Play_CameraChangeSetting.s,Play_CameraChangeSetting,0x80169AC0,0xF
asm/non_matchings/code/z_play/func_80169AFC.s,func_80169AFC,0x80169AFC,0x32
-asm/non_matchings/code/z_play/func_80169BC4.s,func_80169BC4,0x80169BC4,0xD
+asm/non_matchings/code/z_play/Play_CameraGetUID.s,Play_CameraGetUID,0x80169BC4,0xD
asm/non_matchings/code/z_play/func_80169BF8.s,func_80169BF8,0x80169BF8,0x1B
-asm/non_matchings/code/z_play/func_80169C64.s,func_80169C64,0x80169C64,0x8
-asm/non_matchings/code/z_play/func_80169C84.s,func_80169C84,0x80169C84,0xE
+asm/non_matchings/code/z_play/Play_GetCsCamDataSetting.s,Play_GetCsCamDataSetting,0x80169C64,0x8
+asm/non_matchings/code/z_play/Play_GetCsCamDataVec3s.s,Play_GetCsCamDataVec3s,0x80169C84,0xE
asm/non_matchings/code/z_play/convert_scene_number_among_shared_scenes.s,convert_scene_number_among_shared_scenes,0x80169CBC,0x21
asm/non_matchings/code/z_play/func_80169D40.s,func_80169D40,0x80169D40,0x23
asm/non_matchings/code/z_play/func_80169DCC.s,func_80169DCC,0x80169DCC,0x28
@@ -2834,7 +2834,7 @@ asm/non_matchings/code/sys_math3d/func_8017CFA4.s,func_8017CFA4,0x8017CFA4,0x1F
asm/non_matchings/code/sys_math3d/Math3D_TriChkLineSegParaZIntersect.s,Math3D_TriChkLineSegParaZIntersect,0x8017D020,0x63
asm/non_matchings/code/sys_math3d/func_8017D1AC.s,func_8017D1AC,0x8017D1AC,0x1D
asm/non_matchings/code/sys_math3d/func_8017D220.s,func_8017D220,0x8017D220,0x37
-asm/non_matchings/code/sys_math3d/func_8017D2FC.s,func_8017D2FC,0x8017D2FC,0x42
+asm/non_matchings/code/sys_math3d/Math3D_LineSegVsPlane.s,Math3D_LineSegVsPlane,0x8017D2FC,0x42
asm/non_matchings/code/sys_math3d/func_8017D404.s,func_8017D404,0x8017D404,0x59
asm/non_matchings/code/sys_math3d/Math3D_TriSetCoords.s,Math3D_TriSetCoords,0x8017D568,0x2C
asm/non_matchings/code/sys_math3d/Math3D_IsPointInSphere.s,Math3D_IsPointInSphere,0x8017D618,0x14
@@ -3073,7 +3073,7 @@ asm/non_matchings/code/audio_heap/func_8018B474.s,func_8018B474,0x8018B474,0x21
asm/non_matchings/code/audio_heap/func_8018B4F8.s,func_8018B4F8,0x8018B4F8,0xA
asm/non_matchings/code/audio_heap/func_8018B520.s,func_8018B520,0x8018B520,0x16
asm/non_matchings/code/audio_heap/func_8018B578.s,func_8018B578,0x8018B578,0x16
-asm/non_matchings/code/audio_heap/func_8018B5D0.s,func_8018B5D0,0x8018B5D0,0xE
+asm/non_matchings/code/audio_heap/AudioHeap_AllocDmaMemory.s,AudioHeap_AllocDmaMemory,0x8018B5D0,0xE
asm/non_matchings/code/audio_heap/func_8018B608.s,func_8018B608,0x8018B608,0xE
asm/non_matchings/code/audio_heap/func_8018B640.s,func_8018B640,0x8018B640,0x17
asm/non_matchings/code/audio_heap/func_8018B69C.s,func_8018B69C,0x8018B69C,0x13
@@ -3122,7 +3122,7 @@ asm/non_matchings/code/audio_heap/func_8018E8C8.s,func_8018E8C8,0x8018E8C8,0xA6
asm/non_matchings/code/audio_load/func_8018EB60.s,func_8018EB60,0x8018EB60,0x3B
asm/non_matchings/code/audio_load/func_8018EC4C.s,func_8018EC4C,0x8018EC4C,0xCF
asm/non_matchings/code/audio_load/func_8018EF88.s,func_8018EF88,0x8018EF88,0xA6
-asm/non_matchings/code/audio_load/func_8018F220.s,func_8018F220,0x8018F220,0x1E
+asm/non_matchings/code/audio_load/AudioLoad_IsFontLoadComplete.s,AudioLoad_IsFontLoadComplete,0x8018F220,0x1E
asm/non_matchings/code/audio_load/func_8018F298.s,func_8018F298,0x8018F298,0x1E
asm/non_matchings/code/audio_load/func_8018F310.s,func_8018F310,0x8018F310,0x1E
asm/non_matchings/code/audio_load/func_8018F388.s,func_8018F388,0x8018F388,0xC
@@ -3244,61 +3244,61 @@ asm/non_matchings/code/code_80194710/func_80194790.s,func_80194790,0x80194790,0x
asm/non_matchings/code/code_80194710/func_80194804.s,func_80194804,0x80194804,0xF
asm/non_matchings/code/code_80194710/func_80194840.s,func_80194840,0x80194840,0x1C
asm/non_matchings/code/code_80194710/func_801948B0.s,func_801948B0,0x801948B0,0x20
-asm/non_matchings/code/audio_playback/func_80194930.s,func_80194930,0x80194930,0x120
-asm/non_matchings/code/audio_playback/func_80194DB0.s,func_80194DB0,0x80194DB0,0x2C
-asm/non_matchings/code/audio_playback/func_80194E60.s,func_80194E60,0x80194E60,0x30
-asm/non_matchings/code/audio_playback/func_80194F20.s,func_80194F20,0x80194F20,0x19
-asm/non_matchings/code/audio_playback/func_80194F84.s,func_80194F84,0x80194F84,0x152
-asm/non_matchings/code/audio_playback/func_801954CC.s,func_801954CC,0x801954CC,0xF
-asm/non_matchings/code/audio_playback/func_80195508.s,func_80195508,0x80195508,0x35
-asm/non_matchings/code/audio_playback/func_801955DC.s,func_801955DC,0x801955DC,0x39
-asm/non_matchings/code/audio_playback/func_801956C0.s,func_801956C0,0x801956C0,0x3D
-asm/non_matchings/code/audio_playback/func_801957B4.s,func_801957B4,0x801957B4,0x51
-asm/non_matchings/code/audio_playback/func_801958F8.s,func_801958F8,0x801958F8,0xD2
-asm/non_matchings/code/audio_playback/func_80195C40.s,func_80195C40,0x80195C40,0x8
-asm/non_matchings/code/audio_playback/func_80195C60.s,func_80195C60,0x80195C60,0x8
-asm/non_matchings/code/audio_playback/func_80195C80.s,func_80195C80,0x80195C80,0x41
-asm/non_matchings/code/audio_playback/func_80195D84.s,func_80195D84,0x80195D84,0x16
-asm/non_matchings/code/audio_playback/func_80195DDC.s,func_80195DDC,0x80195DDC,0x4
-asm/non_matchings/code/audio_playback/func_80195DEC.s,func_80195DEC,0x80195DEC,0x14
-asm/non_matchings/code/audio_playback/func_80195E3C.s,func_80195E3C,0x80195E3C,0x29
-asm/non_matchings/code/audio_playback/func_80195EE0.s,func_80195EE0,0x80195EE0,0x58
-asm/non_matchings/code/audio_playback/func_80196040.s,func_80196040,0x80196040,0x4F
-asm/non_matchings/code/audio_playback/func_8019617C.s,func_8019617C,0x8019617C,0x10
-asm/non_matchings/code/audio_playback/func_801961BC.s,func_801961BC,0x801961BC,0xB
-asm/non_matchings/code/audio_playback/func_801961E8.s,func_801961E8,0x801961E8,0x20
-asm/non_matchings/code/audio_playback/func_80196268.s,func_80196268,0x80196268,0x60
+asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteSub.s,AudioPlayback_InitNoteSub,0x80194930,0x120
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteSetResamplingRate.s,AudioPlayback_NoteSetResamplingRate,0x80194DB0,0x2C
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteInit.s,AudioPlayback_NoteInit,0x80194E60,0x30
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteDisable.s,AudioPlayback_NoteDisable,0x80194F20,0x19
+asm/non_matchings/code/audio_playback/AudioPlayback_ProcessNotes.s,AudioPlayback_ProcessNotes,0x80194F84,0x152
+asm/non_matchings/code/audio_playback/AudioPlayback_InstrumentGetSound.s,AudioPlayback_InstrumentGetSound,0x801954CC,0xF
+asm/non_matchings/code/audio_playback/AudioPlayback_GetInstrumentInner.s,AudioPlayback_GetInstrumentInner,0x80195508,0x35
+asm/non_matchings/code/audio_playback/AudioPlayback_GetDrum.s,AudioPlayback_GetDrum,0x801955DC,0x39
+asm/non_matchings/code/audio_playback/AudioPlayback_GetSfx.s,AudioPlayback_GetSfx,0x801956C0,0x3D
+asm/non_matchings/code/audio_playback/AudioPlayback_SetFontInstrument.s,AudioPlayback_SetFontInstrument,0x801957B4,0x51
+asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerDecayRelease.s,AudioPlayback_SeqLayerDecayRelease,0x801958F8,0xD2
+asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerNoteDecay.s,AudioPlayback_SeqLayerNoteDecay,0x80195C40,0x8
+asm/non_matchings/code/audio_playback/AudioPlayback_SeqLayerNoteRelease.s,AudioPlayback_SeqLayerNoteRelease,0x80195C60,0x8
+asm/non_matchings/code/audio_playback/AudioPlayback_BuildSyntheticWave.s,AudioPlayback_BuildSyntheticWave,0x80195C80,0x41
+asm/non_matchings/code/audio_playback/AudioPlayback_InitSyntheticWave.s,AudioPlayback_InitSyntheticWave,0x80195D84,0x16
+asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteList.s,AudioPlayback_InitNoteList,0x80195DDC,0x4
+asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteLists.s,AudioPlayback_InitNoteLists,0x80195DEC,0x14
+asm/non_matchings/code/audio_playback/AudioPlayback_InitNoteFreeList.s,AudioPlayback_InitNoteFreeList,0x80195E3C,0x29
+asm/non_matchings/code/audio_playback/AudioPlayback_NotePoolClear.s,AudioPlayback_NotePoolClear,0x80195EE0,0x58
+asm/non_matchings/code/audio_playback/AudioPlayback_NotePoolFill.s,AudioPlayback_NotePoolFill,0x80196040,0x4F
+asm/non_matchings/code/audio_playback/AudioPlayback_AudioListPushFront.s,AudioPlayback_AudioListPushFront,0x8019617C,0x10
+asm/non_matchings/code/audio_playback/AudioPlayback_AudioListRemove.s,AudioPlayback_AudioListRemove,0x801961BC,0xB
+asm/non_matchings/code/audio_playback/AudioPlayback_FindNodeWithPrioLessThan.s,AudioPlayback_FindNodeWithPrioLessThan,0x801961E8,0x20
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteInitForLayer.s,AudioPlayback_NoteInitForLayer,0x80196268,0x60
asm/non_matchings/code/audio_playback/func_801963E8.s,func_801963E8,0x801963E8,0xD
-asm/non_matchings/code/audio_playback/func_8019641C.s,func_8019641C,0x8019641C,0xB
-asm/non_matchings/code/audio_playback/func_80196448.s,func_80196448,0x80196448,0x13
-asm/non_matchings/code/audio_playback/func_80196494.s,func_80196494,0x80196494,0x19
-asm/non_matchings/code/audio_playback/func_801964F8.s,func_801964F8,0x801964F8,0x3E
-asm/non_matchings/code/audio_playback/func_801965F0.s,func_801965F0,0x801965F0,0xB5
-asm/non_matchings/code/audio_playback/func_801968C4.s,func_801968C4,0x801968C4,0x4F
-asm/non_matchings/code/audio_effects/func_80196A00.s,func_80196A00,0x80196A00,0x72
-asm/non_matchings/code/audio_effects/func_80196BC8.s,func_80196BC8,0x80196BC8,0x56
-asm/non_matchings/code/audio_effects/func_80196D20.s,func_80196D20,0x80196D20,0x17
-asm/non_matchings/code/audio_effects/func_80196D7C.s,func_80196D7C,0x80196D7C,0xE
-asm/non_matchings/code/audio_effects/func_80196DB4.s,func_80196DB4,0x80196DB4,0x8E
-asm/non_matchings/code/audio_effects/func_80196FEC.s,func_80196FEC,0x80196FEC,0x17
-asm/non_matchings/code/audio_effects/func_80197048.s,func_80197048,0x80197048,0x3C
-asm/non_matchings/code/audio_effects/func_80197138.s,func_80197138,0x80197138,0xB
-asm/non_matchings/code/audio_effects/func_80197164.s,func_80197164,0x80197164,0x9
-asm/non_matchings/code/audio_effects/func_80197188.s,func_80197188,0x80197188,0xD2
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteReleaseAndTakeOwnership.s,AudioPlayback_NoteReleaseAndTakeOwnership,0x8019641C,0xB
+asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromDisabled.s,AudioPlayback_AllocNoteFromDisabled,0x80196448,0x13
+asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromDecaying.s,AudioPlayback_AllocNoteFromDecaying,0x80196494,0x19
+asm/non_matchings/code/audio_playback/AudioPlayback_AllocNoteFromActive.s,AudioPlayback_AllocNoteFromActive,0x801964F8,0x3E
+asm/non_matchings/code/audio_playback/AudioPlayback_AllocNote.s,AudioPlayback_AllocNote,0x801965F0,0xB5
+asm/non_matchings/code/audio_playback/AudioPlayback_NoteInitAll.s,AudioPlayback_NoteInitAll,0x801968C4,0x4F
+asm/non_matchings/code/audio_effects/AudioEffects_SequenceChannelProcessSound.s,AudioEffects_SequenceChannelProcessSound,0x80196A00,0x72
+asm/non_matchings/code/audio_effects/AudioEffects_SequencePlayerProcessSound.s,AudioEffects_SequencePlayerProcessSound,0x80196BC8,0x56
+asm/non_matchings/code/audio_effects/AudioEffects_GetPortamentoFreqScale.s,AudioEffects_GetPortamentoFreqScale,0x80196D20,0x17
+asm/non_matchings/code/audio_effects/AudioEffects_GetVibratoPitchChange.s,AudioEffects_GetVibratoPitchChange,0x80196D7C,0xE
+asm/non_matchings/code/audio_effects/AudioEffects_GetVibratoFreqScale.s,AudioEffects_GetVibratoFreqScale,0x80196DB4,0x8E
+asm/non_matchings/code/audio_effects/AudioEffects_NoteVibratoUpdate.s,AudioEffects_NoteVibratoUpdate,0x80196FEC,0x17
+asm/non_matchings/code/audio_effects/AudioEffects_NoteVibratoInit.s,AudioEffects_NoteVibratoInit,0x80197048,0x3C
+asm/non_matchings/code/audio_effects/AudioEffects_NotePortamentoInit.s,AudioEffects_NotePortamentoInit,0x80197138,0xB
+asm/non_matchings/code/audio_effects/AudioEffects_AdsrInit.s,AudioEffects_AdsrInit,0x80197164,0x9
+asm/non_matchings/code/audio_effects/AudioEffects_AdsrUpdate.s,AudioEffects_AdsrUpdate,0x80197188,0xD2
asm/non_matchings/code/audio_seqplayer/func_801974D0.s,func_801974D0,0x801974D0,0x1A
asm/non_matchings/code/audio_seqplayer/func_80197538.s,func_80197538,0x80197538,0x77
asm/non_matchings/code/audio_seqplayer/func_80197714.s,func_80197714,0x80197714,0x5B
asm/non_matchings/code/audio_seqplayer/func_80197880.s,func_80197880,0x80197880,0x56
asm/non_matchings/code/audio_seqplayer/func_801979D8.s,func_801979D8,0x801979D8,0x1F
asm/non_matchings/code/audio_seqplayer/func_80197A54.s,func_80197A54,0x80197A54,0x14
-asm/non_matchings/code/audio_seqplayer/func_80197AA4.s,func_80197AA4,0x80197AA4,0x1C
+asm/non_matchings/code/audio_seqplayer/AudioSeq_SequenceChannelDisable.s,AudioSeq_SequenceChannelDisable,0x80197AA4,0x1C
asm/non_matchings/code/audio_seqplayer/func_80197B14.s,func_80197B14,0x80197B14,0x3E
asm/non_matchings/code/audio_seqplayer/func_80197C0C.s,func_80197C0C,0x80197C0C,0x20
asm/non_matchings/code/audio_seqplayer/func_80197C8C.s,func_80197C8C,0x80197C8C,0x26
asm/non_matchings/code/audio_seqplayer/func_80197D24.s,func_80197D24,0x80197D24,0xA
-asm/non_matchings/code/audio_seqplayer/func_80197D4C.s,func_80197D4C,0x80197D4C,0x2F
-asm/non_matchings/code/audio_seqplayer/func_80197E08.s,func_80197E08,0x80197E08,0x10
-asm/non_matchings/code/audio_seqplayer/func_80197E48.s,func_80197E48,0x80197E48,0x10
+asm/non_matchings/code/audio_seqplayer/AudioSeq_SequencePlayerDisable.s,AudioSeq_SequencePlayerDisable,0x80197D4C,0x2F
+asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPushBack.s,AudioSeq_AudioListPushBack,0x80197E08,0x10
+asm/non_matchings/code/audio_seqplayer/AudioSeq_AudioListPopBack.s,AudioSeq_AudioListPopBack,0x80197E48,0x10
asm/non_matchings/code/audio_seqplayer/func_80197E88.s,func_80197E88,0x80197E88,0x28
asm/non_matchings/code/audio_seqplayer/func_80197F28.s,func_80197F28,0x80197F28,0x5
asm/non_matchings/code/audio_seqplayer/func_80197F3C.s,func_80197F3C,0x80197F3C,0xE
@@ -3496,7 +3496,7 @@ asm/non_matchings/code/code_8019AF00/func_801A3D54.s,func_801A3D54,0x801A3D54,0x
asm/non_matchings/code/code_8019AF00/func_801A3D98.s,func_801A3D98,0x801A3D98,0x28
asm/non_matchings/code/code_8019AF00/func_801A3E38.s,func_801A3E38,0x801A3E38,0x22
asm/non_matchings/code/code_8019AF00/func_801A3EC0.s,func_801A3EC0,0x801A3EC0,0x25
-asm/non_matchings/code/code_8019AF00/func_801A3F54.s,func_801A3F54,0x801A3F54,0x6
+asm/non_matchings/code/code_8019AF00/Audio_SetCutsceneFlag.s,Audio_SetCutsceneFlag,0x801A3F54,0x6
asm/non_matchings/code/code_8019AF00/func_801A3F6C.s,func_801A3F6C,0x801A3F6C,0x12
asm/non_matchings/code/code_8019AF00/func_801A3FB4.s,func_801A3FB4,0x801A3FB4,0x12
asm/non_matchings/code/code_8019AF00/func_801A3FFC.s,func_801A3FFC,0x801A3FFC,0x4
diff --git a/tools/warnings_count/.gitignore b/tools/warnings_count/.gitignore
index 5606ab0ef8..eaf2f58b5c 100644
--- a/tools/warnings_count/.gitignore
+++ b/tools/warnings_count/.gitignore
@@ -2,3 +2,4 @@
warnings_setup_new.txt
warnings_disasm_new.txt
warnings_build_new.txt
+warnings_temp.txt
diff --git a/undefined_syms.txt b/undefined_syms.txt
index 9cca916c00..d0ef176fd1 100644
--- a/undefined_syms.txt
+++ b/undefined_syms.txt
@@ -211,9 +211,6 @@ D_0200B998 = 0x0200B998;
D_04000320 = 0x04000320;
D_040003E0 = 0x040003E0;
-D_040008D0 = 0x040008D0;
-D_04001D00 = 0x04001D00;
-D_040021A8 = 0x040021A8;
D_040032B0 = 0x040032B0;
D_0400CF48 = 0x0400CF48;
D_0400CF58 = 0x0400CF58;
@@ -382,18 +379,9 @@ D_0400E408 = 0x0400E408;
D_0400E410 = 0x0400E410;
D_0400E418 = 0x0400E418;
D_0400E430 = 0x0400E430;
-D_0400EB7C = 0x0400EB7C;
-D_0400ED80 = 0x0400ED80;
-D_0400E710 = 0x0400E710;
-D_04011518 = 0x04011518;
-D_040117A8 = 0x040117A8;
-D_040118D8 = 0x040118D8;
-D_04011BD0 = 0x04011BD0;
-D_040127E8 = 0x040127E8;
D_04012860 = 0x04012860;
D_040128BC = 0x040128BC;
D_04014560 = 0x04014560;
-D_04014570 = 0x04014570;
D_04015DB0 = 0x04015DB0;
D_04015FA0 = 0x04015FA0;
D_04016360 = 0x04016360;
@@ -403,16 +391,11 @@ D_0401A590 = 0x0401A590;
D_0401A620 = 0x0401A620;
D_0401ACF0 = 0x0401ACF0;
D_0401ED00 = 0x0401ED00;
-D_0401F740 = 0x0401F740;
-D_0401F7C0 = 0x0401F7C0;
-D_0401F8C0 = 0x0401F8C0;
-D_0401FA40 = 0x0401FA40;
+D_0401F0F0 = 0x0401F0F0;
D_04020658 = 0x04020658;
D_04020BB8 = 0x04020BB8;
D_04020D00 = 0x04020D00;
D_040221B8 = 0x040221B8;
-D_04022B28 = 0x04022B28;
-D_04023100 = 0x04023100;
D_04023130 = 0x04023130;
D_04023210 = 0x04023210;
D_04023288 = 0x04023288;
@@ -435,13 +418,6 @@ D_04029CB0 = 0x04029CB0;
D_04029CF0 = 0x04029CF0;
D_04029D20 = 0x04029D20;
D_0402AF58 = 0x0402AF58;
-D_0402B494 = 0x0402B494;
-D_0402C818 = 0x0402C818;
-D_0402C890 = 0x0402C890;
-D_0402C908 = 0x0402C908;
-D_0402C980 = 0x0402C980;
-D_0402C9F8 = 0x0402C9F8;
-D_0402CA98 = 0x0402CA98;
D_0402E510 = 0x0402E510;
D_0402E65C = 0x0402E65C;
D_0402F028 = 0x0402F028;
@@ -453,14 +429,6 @@ D_04035710 = 0x04035710;
D_040367B0 = 0x040367B0;
D_040377B0 = 0x040377B0;
D_04037850 = 0x04037850;
-D_040378F0 = 0x040378F0;
-D_04037DF0 = 0x04037DF0;
-D_040382F0 = 0x040382F0;
-D_040387F0 = 0x040387F0;
-D_04038CF0 = 0x04038CF0;
-D_040391F0 = 0x040391F0;
-D_040396F0 = 0x040396F0;
-D_04039BF0 = 0x04039BF0;
D_0403A0F0 = 0x0403A0F0;
D_0403C190 = 0x0403C190;
D_0403F230 = 0x0403F230;
@@ -482,28 +450,15 @@ D_040549A8 = 0x040549A8;
D_04054A90 = 0x04054A90;
D_04054C90 = 0x04054C90;
D_04054F18 = 0x04054F18;
-D_04054F20 = 0x04054F20;
-D_04055628 = 0x04055628;
D_04058BA0 = 0x04058BA0;
D_0405AAB0 = 0x0405AAB0;
D_0405AED0 = 0x0405AED0;
-D_0405B6F0 = 0x0405B6F0;
D_0405BEF0 = 0x0405BEF0;
-D_0405C6F0 = 0x0405C6F0;
D_0405CEF0 = 0x0405CEF0;
D_0405E6F0 = 0x0405E6F0;
D_0405F6F0 = 0x0405F6F0;
-D_0405F7C0 = 0x0405F7C0;
D_0405FFC0 = 0x0405FFC0;
-D_040607C0 = 0x040607C0;
-D_04060FC0 = 0x04060FC0;
D_040617C0 = 0x040617C0;
-D_04061FC0 = 0x04061FC0;
-D_04061FE0 = 0x04061FE0;
-D_04062000 = 0x04062000;
-D_04062020 = 0x04062020;
-D_04062040 = 0x04062040;
-D_04062060 = 0x04062060;
D_040622C0 = 0x040622C0;
D_0406A800 = 0x0406A800;
D_0406AB30 = 0x0406AB30;
@@ -536,13 +491,7 @@ D_04081628 = 0x04081628;
D_04083534 = 0x04083534;
D_04085640 = 0x04085640;
D_0408DBE0 = 0x0408DBE0;
-D_0408DFE0 = 0x0408DFE0;
-D_0408E3E0 = 0x0408E3E0;
-D_0408E7E0 = 0x0408E7E0;
D_0408EBE0 = 0x0408EBE0;
-D_0408EFE0 = 0x0408EFE0;
-D_0408F3E0 = 0x0408F3E0;
-D_0408F7E0 = 0x0408F7E0;
D_04091BE0 = 0x04091BE0;
D_04091CE0 = 0x04091CE0;
D_04091DE0 = 0x04091DE0;
@@ -552,7 +501,6 @@ D_040923E0 = 0x040923E0;
// segment 0x05
-D_05000C40 = 0x05000C40;
D_05001D20 = 0x05001D20;
D_05002FA0 = 0x05002FA0;
D_050061E8 = 0x050061E8;
@@ -560,16 +508,12 @@ D_05006420 = 0x05006420;
D_050066B0 = 0x050066B0;
D_05006760 = 0x05006760;
D_05007498 = 0x05007498;
-D_05007890 = 0x05007890;
D_050078A0 = 0x050078A0;
D_05007938 = 0x05007938;
-D_05007980 = 0x05007980;
D_05007E00 = 0x05007E00;
D_05008018 = 0x05008018;
D_050085F0 = 0x050085F0;
D_050089D0 = 0x050089D0;
-D_05017EA0 = 0x05017EA0;
-D_05018090 = 0x05018090;
D_050182A8 = 0x050182A8;
D_0501B370 = 0x0501B370;
D_0501B508 = 0x0501B508;
@@ -577,8 +521,6 @@ D_0501BEE0 = 0x0501BEE0;
D_0501BFB8 = 0x0501BFB8;
D_0501C058 = 0x0501C058;
D_0501C118 = 0x0501C118;
-D_0501D980 = 0x0501D980;
-D_050219E0 = 0x050219E0;
D_05021EF0 = 0x05021EF0;
D_05023008 = 0x05023008;
D_0502324C = 0x0502324C;
@@ -588,8 +530,6 @@ D_0502324C = 0x0502324C;
// code
D_06001254 = 0x06001254;
-D_06001290 = 0x06001290;
-D_06001470 = 0x06001470;
D_06001C60 = 0x06001C60;
D_06007390 = 0x06007390;
D_06008AA0 = 0x06008AA0;
@@ -608,28 +548,6 @@ D_06011AB8 = 0x06011AB8;
D_06012A80 = 0x06012A80;
D_06013138 = 0x06013138;
-// z_en_hy.c
-D_0600007C = 0x0600007C;
-D_0600066C = 0x0600066C;
-D_0600071C = 0x0600071C;
-D_060008C0 = 0x060008C0;
-D_06000AB0 = 0x06000AB0;
-D_06000FDC = 0x06000FDC;
-D_06001494 = 0x06001494;
-D_06001908 = 0x06001908;
-D_06001EE0 = 0x06001EE0;
-D_06005DC4 = 0x06005DC4;
-D_06005D9C = 0x06005D9C;
-D_0600DED8 = 0x0600DED8;
-D_0600F920 = 0x0600F920;
-D_0600FC1C = 0x0600FC1C;
-D_0600FEE4 = 0x0600FEE4;
-D_06010330 = 0x06010330;
-
-// ovl_Arms_Hook
-
-D_0601D960 = 0x0601D960;
-
// ovl_Bg_Astr_Bombwall
D_06002178 = 0x06002178;
@@ -652,26 +570,6 @@ D_06000C98 = 0x06000C98;
D_060003A0 = 0x060003A0;
D_06000E00 = 0x06000E00;
-// ovl_Bg_Ctower_Gear
-
-D_06010828 = 0x06010828;
-D_06015F30 = 0x06015F30;
-D_060160A0 = 0x060160A0;
-D_06016E70 = 0x06016E70;
-D_06017018 = 0x06017018;
-D_06018118 = 0x06018118;
-D_06018588 = 0x06018588;
-
-// ovl_Bg_Ctower_Rot
-
-D_060129D0 = 0x060129D0;
-D_06012DA0 = 0x06012DA0;
-D_060142E8 = 0x060142E8;
-D_06017220 = 0x06017220;
-D_06017410 = 0x06017410;
-D_060174E0 = 0x060174E0;
-D_06017650 = 0x06017650;
-
// ovl_Bg_Dblue_Balance
D_0600CD10 = 0x0600CD10;
@@ -684,15 +582,6 @@ D_0600D250 = 0x0600D250;
D_060002C8 = 0x060002C8;
D_060005C4 = 0x060005C4;
-// ovl_Bg_Dblue_Movebg
-
-D_06004848 = 0x06004848;
-D_060052B8 = 0x060052B8;
-D_06008778 = 0x06008778;
-D_0600A528 = 0x0600A528;
-D_0600CD10 = 0x0600CD10;
-D_0600CE00 = 0x0600CE00;
-
// ovl_Bg_Dblue_Waterfall
D_06003250 = 0x06003250;
@@ -739,40 +628,18 @@ D_06003E80 = 0x06003E80;
D_06000040 = 0x06000040;
-// ovl_Bg_Fu_Kaiten
-
-D_060005D0 = 0x060005D0;
-D_06002D30 = 0x06002D30;
-
// ovl_Bg_Fu_Mizu
D_06002FC0 = 0x06002FC0;
D_060037D8 = 0x060037D8;
D_060037F8 = 0x060037F8;
-// ovl_Bg_Goron_Oyu
-
-D_06000080 = 0x06000080;
-D_06000158 = 0x06000158;
-D_06000968 = 0x06000968;
-D_06000988 = 0x06000988;
-
// ovl_Bg_Haka_Bombwall
D_06000040 = 0x06000040;
D_06000148 = 0x06000148;
D_06001680 = 0x06001680;
-// ovl_Bg_Haka_Curtain
-
-D_06001410 = 0x06001410;
-D_06001588 = 0x06001588;
-
-// ovl_Bg_Haka_Tomb
-
-D_060007B0 = 0x060007B0;
-D_06000EE8 = 0x06000EE8;
-
// ovl_Bg_Hakugin_Bombwall
D_06009830 = 0x06009830;
@@ -782,15 +649,6 @@ D_06009830 = 0x06009830;
D_0600ACB8 = 0x0600ACB8;
D_0600BF40 = 0x0600BF40;
-// ovl_Bg_Hakugin_Post
-
-D_0600D3B0 = 0x0600D3B0;
-D_0600C1A8 = 0x0600C1A8;
-D_0600C568 = 0x0600C568;
-D_0600CA38 = 0x0600CA38;
-D_0600CEC8 = 0x0600CEC8;
-D_0600D098 = 0x0600D098;
-
// ovl_Bg_Hakugin_Switch
D_06000268 = 0x06000268;
@@ -801,11 +659,6 @@ D_060005C8 = 0x060005C8;
D_060001E0 = 0x060001E0;
D_06000C90 = 0x06000C90;
-// ovl_Bg_Icicle
-
-D_060000D0 = 0x060000D0;
-D_06000294 = 0x06000294;
-
// ovl_Bg_Ikana_Bombwall
D_06000128 = 0x06000128;
@@ -826,35 +679,11 @@ D_06001AD8 = 0x06001AD8;
D_06001E18 = 0x06001E18;
D_06002358 = 0x06002358;
-// ovl_Bg_Ikana_Ray
-
-D_06001100 = 0x06001100;
-D_06001228 = 0x06001228;
-
-// ovl_Bg_Ikana_Rotaryroom
-
-D_06004710 = 0x06004710;
-D_060048A0 = 0x060048A0;
-D_06007360 = 0x06007360;
-D_06007448 = 0x06007448;
-D_06007B68 = 0x06007B68;
-
-// ovl_Bg_Ikana_Shutter
-
-D_06000CE8 = 0x06000CE8;
-D_06000F28 = 0x06000F28;
-
// ovl_Bg_Ikninside
D_0600CC78 = 0x0600CC78;
D_0600DE48 = 0x0600DE48;
-// ovl_Bg_Iknin_Susceil
-
-D_0600C308 = 0x0600C308;
-D_0600C670 = 0x0600C670;
-D_0600CBAC = 0x0600CBAC;
-
// ovl_Bg_Iknv_Doukutu
D_0600DB60 = 0x0600DB60;
@@ -868,42 +697,16 @@ D_06012700 = 0x06012700;
D_06012728 = 0x06012728;
D_06012788 = 0x06012788;
-// ovl_Bg_Iknv_Obj
-
-D_06011880 = 0x06011880;
-D_060119D4 = 0x060119D4;
-D_060129C8 = 0x060129C8;
-D_06012CA4 = 0x06012CA4;
-D_06013058 = 0x06013058;
-
// ovl_Bg_Ingate
D_060006B0 = 0x060006B0;
D_060016DC = 0x060016DC;
-// ovl_Bg_Inibs_Movebg
-
-D_06001C10 = 0x06001C10;
-D_06001DC0 = 0x06001DC0;
-D_06002598 = 0x06002598;
-D_06006140 = 0x06006140;
-D_060062D8 = 0x060062D8;
-D_06006858 = 0x06006858;
-
// ovl_Bg_Keikoku_Saku
D_06001640 = 0x06001640;
D_06002300 = 0x06002300;
-// ovl_Bg_Keikoku_Spr
-
-D_06000100 = 0x06000100;
-D_060001F8 = 0x060001F8;
-D_06000300 = 0x06000300;
-D_060003F8 = 0x060003F8;
-D_06000500 = 0x06000500;
-D_060005F8 = 0x060005F8;
-
// ovl_Bg_Kin2_Bombwall
D_06000128 = 0x06000128;
@@ -911,62 +714,15 @@ D_060002C0 = 0x060002C0;
D_06000360 = 0x06000360;
D_06000490 = 0x06000490;
-// ovl_Bg_Kin2_Fence
-
-D_06000828 = 0x06000828;
-D_06000908 = 0x06000908;
-
// ovl_Bg_Kin2_Picture
D_06000658 = 0x06000658;
D_06000798 = 0x06000798;
-// ovl_Bg_Ladder
-
-D_060000A0 = 0x060000A0;
-D_060001D8 = 0x060001D8;
-D_060002D0 = 0x060002D0;
-D_06000408 = 0x06000408;
-D_06000500 = 0x06000500;
-D_06000638 = 0x06000638;
-D_06000730 = 0x06000730;
-D_06000868 = 0x06000868;
-
// ovl_Bg_Last_Bwall
D_06000098 = 0x06000098;
-// ovl_Bg_Lbfshot
-
-D_06000228 = 0x06000228;
-D_060014D8 = 0x060014D8;
-
-// ovl_Bg_Lotus
-
-D_06000040 = 0x06000040;
-D_06000A20 = 0x06000A20;
-
-// ovl_Bg_Market_Step
-
-D_0601F050 = 0x0601F050;
-D_06018DA0 = 0x06018DA0;
-D_0601EF10 = 0x0601EF10;
-D_06018C60 = 0x06018C60;
-
-// ovl_Bg_Mbar_Chair
-
-D_06000288 = 0x06000288;
-D_060019B4 = 0x060019B4;
-
-// ovl_Bg_Numa_Hana
-
-D_06000870 = 0x06000870;
-D_06009FE0 = 0x06009FE0;
-D_0600A740 = 0x0600A740;
-D_0600AB88 = 0x0600AB88;
-D_0600B928 = 0x0600B928;
-D_0600BE58 = 0x0600BE58;
-
// ovl_Bg_Open_Shutter
D_060003E8 = 0x060003E8;
@@ -993,11 +749,6 @@ D_06002678 = 0x06002678;
D_06000040 = 0x06000040;
-// ovl_Bg_Tobira01
-
-D_06000088 = 0x06000088;
-D_060011C0 = 0x060011C0;
-
// ovl_Bg_Umajump
D_06001220 = 0x06001220;
@@ -1042,35 +793,8 @@ D_06022550 = 0x06022550;
// ovl_Boss_02
-D_06000230 = 0x06000230;
-D_060002E0 = 0x060002E0;
D_060003A0 = 0x060003A0;
D_060041A0 = 0x060041A0;
-D_06008650 = 0x06008650;
-D_06009B10 = 0x06009B10;
-D_06009C78 = 0x06009C78;
-D_0600ECF0 = 0x0600ECF0;
-D_0600EF90 = 0x0600EF90;
-D_0600F310 = 0x0600F310;
-D_0600F690 = 0x0600F690;
-D_0600FA10 = 0x0600FA10;
-D_0600FD90 = 0x0600FD90;
-D_06010110 = 0x06010110;
-D_06010490 = 0x06010490;
-D_06010810 = 0x06010810;
-D_06010B90 = 0x06010B90;
-D_06010F10 = 0x06010F10;
-D_06011290 = 0x06011290;
-D_06011610 = 0x06011610;
-D_06011990 = 0x06011990;
-D_06011D10 = 0x06011D10;
-D_06012090 = 0x06012090;
-D_06012410 = 0x06012410;
-D_06012790 = 0x06012790;
-D_06012B10 = 0x06012B10;
-D_06012E90 = 0x06012E90;
-D_06013210 = 0x06013210;
-D_06013590 = 0x06013590;
// ovl_Boss_03
@@ -1109,7 +833,6 @@ D_06018CF0 = 0x06018CF0;
D_06018DE0 = 0x06018DE0;
D_06019360 = 0x06019360;
D_060193B0 = 0x060193B0;
-D_06019490 = 0x06019490;
// ovl_Boss_07
@@ -1203,10 +926,6 @@ D_06000050 = 0x06000050;
D_06000060 = 0x06000060;
D_060012E8 = 0x060012E8;
-// ovl_Demo_Kankyo
-
-D_06001000 = 0x06001000;
-
// ovl_Demo_Moonend
D_06001214 = 0x06001214;
@@ -1254,29 +973,6 @@ D_060005FC = 0x060005FC;
D_06001804 = 0x06001804;
D_0600A6D0 = 0x0600A6D0;
-// ovl_Dm_Char01
-
-D_06009928 = 0x06009928;
-D_06009D70 = 0x06009D70;
-D_06009E4C = 0x06009E4C;
-D_0600A398 = 0x0600A398;
-D_0600A5C0 = 0x0600A5C0;
-D_0600A8F8 = 0x0600A8F8;
-D_0600AA50 = 0x0600AA50;
-D_0600AF98 = 0x0600AF98;
-D_0600B1A0 = 0x0600B1A0;
-D_0600DE50 = 0x0600DE50;
-D_0600DF18 = 0x0600DF18;
-D_0600F3C0 = 0x0600F3C0;
-D_0600F768 = 0x0600F768;
-D_0600FAE8 = 0x0600FAE8;
-D_0600FE5C = 0x0600FE5C;
-D_0600FE90 = 0x0600FE90;
-D_06010C3C = 0x06010C3C;
-D_06010EF0 = 0x06010EF0;
-D_06010FD8 = 0x06010FD8;
-D_060110B8 = 0x060110B8;
-
// ovl_Dm_Char02
D_0600AD68 = 0x0600AD68;
@@ -1285,39 +981,11 @@ D_0600AD68 = 0x0600AD68;
D_06020550 = 0x06020550;
-// ovl_Dm_Char05
-
-D_060001D0 = 0x060001D0;
-D_060010B0 = 0x060010B0;
-D_060013D0 = 0x060013D0;
-D_06001E70 = 0x06001E70;
-D_060042B0 = 0x060042B0;
-
// ovl_Dm_Char06
D_060013A8 = 0x060013A8;
D_06006868 = 0x06006868;
-// ovl_Dm_Char07
-
-D_06000100 = 0x06000100;
-D_06000240 = 0x06000240;
-D_06000650 = 0x06000650;
-D_06000790 = 0x06000790;
-D_06000B80 = 0x06000B80;
-D_06000CC0 = 0x06000CC0;
-D_060010D0 = 0x060010D0;
-D_06001210 = 0x06001210;
-D_060015E0 = 0x060015E0;
-D_060016B8 = 0x060016B8;
-D_06002BA0 = 0x06002BA0;
-D_06002CD0 = 0x06002CD0;
-D_06006688 = 0x06006688;
-D_060076A0 = 0x060076A0;
-D_06007918 = 0x06007918;
-D_060105F8 = 0x060105F8;
-D_06010D68 = 0x06010D68;
-
// ovl_Dm_Char08
D_06002328 = 0x06002328;
@@ -1335,11 +1003,6 @@ D_06001398 = 0x06001398;
D_06000E70 = 0x06000E70;
D_06012618 = 0x06012618;
-// ovl_Dm_Nb
-
-D_06000990 = 0x06000990;
-D_06008C40 = 0x06008C40;
-
// ovl_Dm_Opstage
D_06000970 = 0x06000970;
@@ -1352,108 +1015,6 @@ D_06003068 = 0x06003068;
D_06003720 = 0x06003720;
D_06003728 = 0x06003728;
-// ovl_Dm_Sa
-
-D_0600CC94 = 0x0600CC94;
-D_06013328 = 0x06013328;
-
-// ovl_Dm_Statue
-
-D_06000520 = 0x06000520;
-D_06001788 = 0x06001788;
-
-// ovl_Dm_Stk
-
-D_0600055C = 0x0600055C;
-D_06001030 = 0x06001030;
-D_0600130C = 0x0600130C;
-D_06001374 = 0x06001374;
-D_06001EDC = 0x06001EDC;
-D_06002774 = 0x06002774;
-D_06002CD8 = 0x06002CD8;
-D_06003068 = 0x06003068;
-D_060035C8 = 0x060035C8;
-D_060039F0 = 0x060039F0;
-D_06004554 = 0x06004554;
-D_06004580 = 0x06004580;
-D_060046B0 = 0x060046B0;
-D_060049C8 = 0x060049C8;
-D_060051C0 = 0x060051C0;
-D_060053C0 = 0x060053C0;
-D_06005870 = 0x06005870;
-D_06005F44 = 0x06005F44;
-D_06006BB0 = 0x06006BB0;
-D_060070DC = 0x060070DC;
-D_06007840 = 0x06007840;
-D_060079F0 = 0x060079F0;
-D_060084C0 = 0x060084C0;
-D_06008658 = 0x06008658;
-D_060087B0 = 0x060087B0;
-D_06008A80 = 0x06008A80;
-D_060090C0 = 0x060090C0;
-D_06009710 = 0x06009710;
-D_06009AC0 = 0x06009AC0;
-D_06009DA0 = 0x06009DA0;
-D_0600A530 = 0x0600A530;
-D_0600A5C0 = 0x0600A5C0;
-D_0600AE30 = 0x0600AE30;
-D_0600AEC0 = 0x0600AEC0;
-D_0600BB2C = 0x0600BB2C;
-D_0600C270 = 0x0600C270;
-D_0600C964 = 0x0600C964;
-D_0600CAD0 = 0x0600CAD0;
-D_0600CBB8 = 0x0600CBB8;
-D_0600D830 = 0x0600D830;
-D_0600E6EC = 0x0600E6EC;
-D_0600EEC0 = 0x0600EEC0;
-D_060101A4 = 0x060101A4;
-D_06010B60 = 0x06010B60;
-D_060110B4 = 0x060110B4;
-D_06011FB0 = 0x06011FB0;
-D_06012A58 = 0x06012A58;
-D_06013328 = 0x06013328;
-D_060141E4 = 0x060141E4;
-D_06014920 = 0x06014920;
-D_06015028 = 0x06015028;
-D_06015C14 = 0x06015C14;
-D_06016508 = 0x06016508;
-D_06016620 = 0x06016620;
-D_06016910 = 0x06016910;
-D_06018ED0 = 0x06018ED0;
-D_0601AA80 = 0x0601AA80;
-D_0601C114 = 0x0601C114;
-D_0601C21C = 0x0601C21C;
-D_0601D008 = 0x0601D008;
-D_0601D07C = 0x0601D07C;
-D_0601D3D0 = 0x0601D3D0;
-D_0601DDE0 = 0x0601DDE0;
-D_0601EF50 = 0x0601EF50;
-D_0601F9E4 = 0x0601F9E4;
-D_06020CAC = 0x06020CAC;
-D_0602200C = 0x0602200C;
-D_0602336C = 0x0602336C;
-D_060259F4 = 0x060259F4;
-D_060266C8 = 0x060266C8;
-D_06026CF4 = 0x06026CF4;
-D_06027CF4 = 0x06027CF4;
-D_06028F28 = 0x06028F28;
-D_06029A04 = 0x06029A04;
-D_0602A2D8 = 0x0602A2D8;
-D_0602AD54 = 0x0602AD54;
-D_0602DC64 = 0x0602DC64;
-D_0602E9A0 = 0x0602E9A0;
-D_0602FA70 = 0x0602FA70;
-D_0603021C = 0x0603021C;
-D_06031210 = 0x06031210;
-D_060322FC = 0x060322FC;
-D_06032AE0 = 0x06032AE0;
-D_0603323C = 0x0603323C;
-D_06034FD8 = 0x06034FD8;
-D_06036964 = 0x06036964;
-D_06037B94 = 0x06037B94;
-D_0603967C = 0x0603967C;
-D_0603A8F8 = 0x0603A8F8;
-
// ovl_Dm_Tsg
D_06002D30 = 0x06002D30;
@@ -1464,21 +1025,6 @@ D_06011458 = 0x06011458;
D_0600DE08 = 0x0600DE08;
D_0600E038 = 0x0600E038;
-// ovl_Door_Spiral
-
-D_06000590 = 0x06000590;
-D_060007A8 = 0x060007A8;
-D_06000EA0 = 0x06000EA0;
-D_060012C0 = 0x060012C0;
-D_060014C8 = 0x060014C8;
-D_06002110 = 0x06002110;
-D_06004448 = 0x06004448;
-D_060051B8 = 0x060051B8;
-D_06006128 = 0x06006128;
-D_06009278 = 0x06009278;
-D_06012B70 = 0x06012B70;
-D_06013EA8 = 0x06013EA8;
-
// ovl_Door_Warp1
D_06003230 = 0x06003230;
@@ -1534,17 +1080,6 @@ D_06000F38 = 0x06000F38;
D_06009E70 = 0x06009E70;
-// ovl_En_Al
-
-D_0600A0D8 = 0x0600A0D8;
-
-// ovl_En_Am
-
-D_06000238 = 0x06000238;
-D_0600033C = 0x0600033C;
-D_06005948 = 0x06005948;
-D_06005B3C = 0x06005B3C;
-
// ovl_En_An
D_06000308 = 0x06000308;
@@ -1582,19 +1117,6 @@ D_06017990 = 0x06017990;
D_0601ABF0 = 0x0601ABF0;
D_0601AD00 = 0x0601AD00;
-// ovl_En_Baba
-
-D_06005EF0 = 0x06005EF0;
-D_06006B10 = 0x06006B10;
-D_060092A0 = 0x060092A0;
-
-// ovl_En_Baisen
-
-D_060008B4 = 0x060008B4;
-D_06008198 = 0x06008198;
-D_060011C0 = 0x060011C0;
-D_06007908 = 0x06007908;
-
// ovl_En_Bal
D_060005FC = 0x060005FC;
@@ -1615,10 +1137,6 @@ D_06000184 = 0x06000184;
D_06000444 = 0x06000444;
D_06001A30 = 0x06001A30;
-// ovl_En_Bba_01
-
-D_06005EF0 = 0x06005EF0;
-
// ovl_En_Bbfall
D_06000184 = 0x06000184;
@@ -1635,13 +1153,6 @@ D_06001398 = 0x06001398;
D_06000074 = 0x06000074;
D_06001E60 = 0x06001E60;
-// ovl_En_Bigokuta
-
-D_06000444 = 0x06000444;
-D_06000A74 = 0x06000A74;
-D_060014B8 = 0x060014B8;
-D_06006BC0 = 0x06006BC0;
-
// ovl_En_Bigpamet
D_06000440 = 0x06000440;
@@ -1654,17 +1165,6 @@ D_06004210 = 0x06004210;
D_06007C70 = 0x06007C70;
D_0600823C = 0x0600823C;
-// ovl_En_Bji_01
-
-D_0600066C = 0x0600066C;
-D_06000AB0 = 0x06000AB0;
-D_06000FDC = 0x06000FDC;
-D_060049F0 = 0x060049F0;
-D_06004E70 = 0x06004E70;
-D_06005270 = 0x06005270;
-D_0600578C = 0x0600578C;
-D_06005B58 = 0x06005B58;
-
// ovl_En_Bjt
D_06002390 = 0x06002390;
@@ -1695,11 +1195,6 @@ D_06000530 = 0x06000530;
D_060064B8 = 0x060064B8;
D_0600F82C = 0x0600F82C;
-// ovl_En_Bom_Bowl_Man
-
-D_060064B8 = 0x060064B8;
-D_0600F82C = 0x0600F82C;
-
// ovl_En_Box
D_0600043C = 0x0600043C;
@@ -1723,86 +1218,11 @@ D_0600C3E0 = 0x0600C3E0;
D_06001000 = 0x06001000;
-// ovl_En_Cha
-
-D_06000710 = 0x06000710;
-D_06000958 = 0x06000958;
-
-// ovl_En_Cne_01
-
-D_060000F0 = 0x060000F0;
-D_06001300 = 0x06001300;
-
-// ovl_En_Cow
-
-D_060001CC = 0x060001CC;
-D_06004010 = 0x06004010;
-D_06004264 = 0x06004264;
-D_06004348 = 0x06004348;
-D_06004C30 = 0x06004C30;
-D_06004E98 = 0x06004E98;
-
// ovl_En_Crow
D_060000F0 = 0x060000F0;
D_060010C0 = 0x060010C0;
-// ovl_En_Dai
-
-D_06000230 = 0x06000230;
-D_060002E8 = 0x060002E8;
-D_0600C538 = 0x0600C538;
-D_060130D0 = 0x060130D0;
-D_060107B0 = 0x060107B0;
-D_06010FB0 = 0x06010FB0;
-D_060117B0 = 0x060117B0;
-D_06010FB0 = 0x06010FB0;
-D_06011FB0 = 0x06011FB0;
-D_060127B0 = 0x060127B0;
-D_060079E4 = 0x060079E4;
-D_06007354 = 0x06007354;
-D_06000CEC = 0x06000CEC;
-D_060069DC = 0x060069DC;
-D_0600563C = 0x0600563C;
-D_06002E58 = 0x06002E58;
-D_06006590 = 0x06006590;
-
-// ovl_En_Daiku
-
-D_06001114 = 0x06001114;
-D_06002FA0 = 0x06002FA0;
-D_06008EC8 = 0x06008EC8;
-D_0600A850 = 0x0600A850;
-D_0600B690 = 0x0600B690;
-D_0600ACD0 = 0x0600ACD0;
-D_0600C92C = 0x0600C92C;
-D_06000C44 = 0x06000C44;
-D_0600C234 = 0x0600C234;
-D_06000600 = 0x06000600;
-D_0600BEAC = 0x0600BEAC;
-D_060070C0 = 0x060070C0;
-D_06006FB0 = 0x06006FB0;
-D_06006E80 = 0x06006E80;
-D_06006D70 = 0x06006D70;
-
-// ovl_En_Daiku2
-
-D_0600ACD0 = 0x0600ACD0;
-D_0600C92C = 0x0600C92C;
-D_06000C44 = 0x06000C44;
-D_0600C234 = 0x0600C234;
-D_06000600 = 0x06000600;
-D_06001114 = 0x06001114;
-D_0600B690 = 0x0600B690;
-D_06001A24 = 0x06001A24;
-D_0600D328 = 0x0600D328;
-D_060009E0 = 0x060009E0;
-D_06002134 = 0x06002134;
-D_06002FA0 = 0x06002FA0;
-D_06009638 = 0x06009638;
-D_0600A390 = 0x0600A390;
-D_0600A850 = 0x0600A850;
-
// ovl_En_Death
D_06000E64 = 0x06000E64;
@@ -1834,211 +1254,18 @@ D_06001828 = 0x06001828;
D_06002A40 = 0x06002A40;
D_06003070 = 0x06003070;
-// ovl_En_Dekunuts
-
-D_06000168 = 0x06000168;
-D_06001E50 = 0x06001E50;
-D_06001F50 = 0x06001F50;
-D_06002468 = 0x06002468;
-D_0600259C = 0x0600259C;
-D_06002A5C = 0x06002A5C;
-D_06002BD4 = 0x06002BD4;
-D_06002DD4 = 0x06002DD4;
-D_06002FA4 = 0x06002FA4;
-D_06003180 = 0x06003180;
-D_0600326C = 0x0600326C;
-D_060033E4 = 0x060033E4;
-D_06003780 = 0x06003780;
-
// ovl_En_Demo_heishi
D_06003BFC = 0x06003BFC;
D_0600D640 = 0x0600D640;
-// ovl_En_Dg
-
-D_060080F0 = 0x060080F0;
-D_060021C8 = 0x060021C8;
-D_06001BD8 = 0x06001BD8;
-D_06000998 = 0x06000998;
-D_06001FB0 = 0x06001FB0;
-D_06001048 = 0x06001048;
-D_06001348 = 0x06001348;
-D_06001560 = 0x06001560;
-D_06001A84 = 0x06001A84;
-D_060017C0 = 0x060017C0;
-
-// ovl_En_Dinofos
-
-D_06000580 = 0x06000580;
-D_06000AF0 = 0x06000AF0;
-D_06001040 = 0x06001040;
-D_060013C0 = 0x060013C0;
-D_060017B8 = 0x060017B8;
-D_06001CCC = 0x06001CCC;
-D_060025B4 = 0x060025B4;
-D_06002E40 = 0x06002E40;
-D_06009570 = 0x06009570;
-D_06009B70 = 0x06009B70;
-D_0600ABD0 = 0x0600ABD0;
-D_0600C974 = 0x0600C974;
-D_0600D21C = 0x0600D21C;
-D_0600D62C = 0x0600D62C;
-D_06008E30 = 0x06008E30;
-D_06009030 = 0x06009030;
-D_06009230 = 0x06009230;
-
-// ovl_En_Dnb
-
-D_06000000 = 0x06000000;
-D_06000020 = 0x06000020;
-D_06004638 = 0x06004638;
-D_06004710 = 0x06004710;
-D_06004D8C = 0x06004D8C;
-
// ovl_En_Dnh
D_06002950 = 0x06002950;
-// ovl_En_Dnk
-
-D_060023B8 = 0x060023B8;
-D_06002468 = 0x06002468;
-D_06002848 = 0x06002848;
-D_06000B70 = 0x06000B70;
-D_06002A08 = 0x06002A08;
-D_0600031C = 0x0600031C;
-D_06000430 = 0x06000430;
-D_06000894 = 0x06000894;
-D_06002B6C = 0x06002B6C;
-D_060006CC = 0x060006CC;
-D_060024CC = 0x060024CC;
-D_060026C4 = 0x060026C4;
-D_06002894 = 0x06002894;
-D_06002B90 = 0x06002B90;
-D_06002F7C = 0x06002F7C;
-D_06003128 = 0x06003128;
-D_060029BC = 0x060029BC;
-D_06002E84 = 0x06002E84;
-D_06000168 = 0x06000168;
-D_0600259C = 0x0600259C;
-D_06002A5C = 0x06002A5C;
-D_06002BD4 = 0x06002BD4;
-D_06002DD4 = 0x06002DD4;
-D_06002FA4 = 0x06002FA4;
-D_06003180 = 0x06003180;
-D_0600326C = 0x0600326C;
-D_060033E4 = 0x060033E4;
-D_06003780 = 0x06003780;
-D_06002950 = 0x06002950;
-D_06001680 = 0x06001680;
-D_06001700 = 0x06001700;
-D_06001780 = 0x06001780;
-
// ovl_En_Dno
-D_06007CA4 = 0x06007CA4;
-D_0600E1F8 = 0x0600E1F8;
D_801C20C0 = 0x801C20C0;
-D_06000470 = 0x06000470;
-D_060008F0 = 0x060008F0;
-D_06000F6C = 0x06000F6C;
-D_06001A50 = 0x06001A50;
-D_06002530 = 0x06002530;
-D_06003320 = 0x06003320;
-D_060036D0 = 0x060036D0;
-D_060041CC = 0x060041CC;
-D_06004DD8 = 0x06004DD8;
-D_06005F98 = 0x06005F98;
-D_06006488 = 0x06006488;
-D_060073E4 = 0x060073E4;
-D_060077A8 = 0x060077A8;
-D_06008324 = 0x06008324;
-D_06008AE4 = 0x06008AE4;
-D_06009100 = 0x06009100;
-D_060051E4 = 0x060051E4;
-D_06005E20 = 0x06005E20;
-D_06006F84 = 0x06006F84;
-
-// ovl_En_Dnp
-
-D_06010D60 = 0x06010D60;
-D_060007D8 = 0x060007D8;
-D_060021DC = 0x060021DC;
-D_060026B8 = 0x060026B8;
-D_06004D08 = 0x06004D08;
-D_060071F4 = 0x060071F4;
-D_06007960 = 0x06007960;
-D_06008588 = 0x06008588;
-D_0600A900 = 0x0600A900;
-D_0600AEB8 = 0x0600AEB8;
-D_0600B754 = 0x0600B754;
-D_0600674C = 0x0600674C;
-D_0600BAD8 = 0x0600BAD8;
-D_06006B74 = 0x06006B74;
-D_06012428 = 0x06012428;
-D_0600B324 = 0x0600B324;
-D_060115B8 = 0x060115B8;
-D_0600923C = 0x0600923C;
-D_06009AA0 = 0x06009AA0;
-D_0600125C = 0x0600125C;
-D_060017F8 = 0x060017F8;
-D_06001C1C = 0x06001C1C;
-D_060057AC = 0x060057AC;
-D_0600625C = 0x0600625C;
-D_060103D0 = 0x060103D0;
-D_060105D0 = 0x060105D0;
-D_060107D0 = 0x060107D0;
-D_060109D0 = 0x060109D0;
-
-// ovl_En_Dnq
-
-D_0600EB48 = 0x0600EB48;
-D_06008328 = 0x06008328;
-D_06007528 = 0x06007528;
-D_060006F0 = 0x060006F0;
-D_06000BF8 = 0x06000BF8;
-D_06002690 = 0x06002690;
-D_06003408 = 0x06003408;
-D_06006984 = 0x06006984;
-D_06005E18 = 0x06005E18;
-D_06005284 = 0x06005284;
-D_06001AEC = 0x06001AEC;
-D_06001100 = 0x06001100;
-D_06004EA0 = 0x06004EA0;
-D_0600F504 = 0x0600F504;
-D_060047B8 = 0x060047B8;
-D_06005A14 = 0x06005A14;
-D_06003DBC = 0x06003DBC;
-
-// ovl_En_Dns
-
-D_06002C48 = 0x06002C48;
-D_06002DD8 = 0x06002DD8;
-D_06003310 = 0x06003310;
-D_060034EC = 0x060034EC;
-D_060008F4 = 0x060008F4;
-D_06000BD8 = 0x06000BD8;
-D_06000D58 = 0x06000D58;
-D_06000FEC = 0x06000FEC;
-D_060002A8 = 0x060002A8;
-D_06000734 = 0x06000734;
-D_060028E8 = 0x060028E8;
-D_06002968 = 0x06002968;
-D_060029E8 = 0x060029E8;
-D_06002968 = 0x06002968;
-
-// ovl_En_Dodongo
-
-D_060013C4 = 0x060013C4;
-D_06001A44 = 0x06001A44;
-D_060028F0 = 0x060028F0;
-D_06003088 = 0x06003088;
-D_06003B14 = 0x06003B14;
-D_060042C4 = 0x060042C4;
-D_06004C20 = 0x06004C20;
-D_06008318 = 0x06008318;
-D_06008B1C = 0x06008B1C;
// ovl_En_Dragon
@@ -2060,11 +1287,6 @@ D_06008170 = 0x06008170;
D_0600112C = 0x0600112C;
D_0600B0CC = 0x0600B0CC;
-// ovl_En_Dy_Extra
-
-D_0600DD40 = 0x0600DD40;
-D_0600DEF0 = 0x0600DEF0;
-
// ovl_En_Egblock
D_06001698 = 0x06001698;
@@ -2083,84 +1305,10 @@ D_060094E4 = 0x060094E4;
D_06009664 = 0x06009664;
D_0600EE4C = 0x0600EE4C;
-// ovl_En_Elfbub
-
-D_06001000 = 0x06001000;
-
-// ovl_En_Encount2
-
-D_06000A00 = 0x06000A00;
-D_06000D78 = 0x06000D78;
-D_06002420 = 0x06002420;
-
// ovl_En_Encount3
D_060009A0 = 0x060009A0;
-// ovl_En_Ending_Hero
-
-D_06000BE0 = 0x06000BE0;
-D_0600B0CC = 0x0600B0CC;
-D_06007350 = 0x06007350;
-D_06007750 = 0x06007750;
-D_06009590 = 0x06009590;
-D_06009F90 = 0x06009F90;
-D_0600A390 = 0x0600A390;
-D_0600A490 = 0x0600A490;
-D_0600A790 = 0x0600A790;
-D_0600AB90 = 0x0600AB90;
-
-// ovl_En_Ending_Hero2
-
-D_060011C0 = 0x060011C0;
-D_06007908 = 0x06007908;
-
-// ovl_En_Ending_Hero3
-
-D_06000E50 = 0x06000E50;
-D_06007150 = 0x06007150;
-
-// ovl_En_Ending_Hero4
-
-D_06002A84 = 0x06002A84;
-D_0600D640 = 0x0600D640;
-
-// ovl_En_Ending_Hero5
-
-D_06002FA0 = 0x06002FA0;
-D_06006D70 = 0x06006D70;
-D_06006E80 = 0x06006E80;
-D_06006FB0 = 0x06006FB0;
-D_060070C0 = 0x060070C0;
-D_0600A390 = 0x0600A390;
-D_0600A850 = 0x0600A850;
-
-// ovl_En_Ending_Hero6
-
-D_0600B0CC = 0x0600B0CC;
-D_06007908 = 0x06007908;
-D_06007150 = 0x06007150;
-D_0600D640 = 0x0600D640;
-D_0600A850 = 0x0600A850;
-D_06000BE0 = 0x06000BE0;
-D_060011C0 = 0x060011C0;
-D_06000E50 = 0x06000E50;
-D_06002A84 = 0x06002A84;
-D_06002FA0 = 0x06002FA0;
-D_060070C0 = 0x060070C0;
-D_06006FB0 = 0x06006FB0;
-D_06006E80 = 0x06006E80;
-D_06006D70 = 0x06006D70;
-D_0600A390_dl = 0x0600A390;
-D_06007350 = 0x06007350;
-D_06009590 = 0x06009590;
-D_06009F90 = 0x06009F90;
-D_0600A790 = 0x0600A790;
-D_0600AB90 = 0x0600AB90;
-D_06007750 = 0x06007750;
-D_0600A390_tex = 0x0600A390;
-D_0600A490 = 0x0600A490;
-
// ovl_En_Estone
D_06010240 = 0x06010240;
@@ -2178,84 +1326,12 @@ D_060000F8 = 0x060000F8;
D_06003D38 = 0x06003D38;
D_06003DC8 = 0x06003DC8;
-// ovl_En_Fg
-
-D_060007BC = 0x060007BC;
-D_060011C0 = 0x060011C0;
-D_06001534 = 0x06001534;
-D_060059A0 = 0x060059A0;
-D_0600B328 = 0x0600B328;
-D_0600B338 = 0x0600B338;
-D_0600B538 = 0x0600B538;
-
-// ovl_En_Firefly
-
-D_0600017C = 0x0600017C;
-D_06001678 = 0x06001678;
-D_060018B8 = 0x060018B8;
-
-// ovl_En_Fish2
-
-D_060006D8 = 0x060006D8;
-D_060007D4 = 0x060007D4;
-D_06000ACC = 0x06000ACC;
-D_06001174 = 0x06001174;
-D_060013AC = 0x060013AC;
-D_06006190 = 0x06006190;
-
// ovl_En_Fishing
+D_0600007C = 0x0600007C;
D_0600CFE0 = 0x0600CFE0;
D_06011058 = 0x06011058;
-// ovl_En_Floormas
-
-D_06000590 = 0x06000590;
-D_06000EA4 = 0x06000EA4;
-D_060019CC = 0x060019CC;
-D_06002158 = 0x06002158;
-D_060039B0 = 0x060039B0;
-D_060041F4 = 0x060041F4;
-D_06008688 = 0x06008688;
-D_06008FB0 = 0x06008FB0;
-D_06009244 = 0x06009244;
-D_06009520 = 0x06009520;
-D_06009DB0 = 0x06009DB0;
-D_0600A054 = 0x0600A054;
-
-// ovl_En_Fsn
-
-D_06005BC0 = 0x06005BC0;
-D_06006D40 = 0x06006D40;
-D_06007140 = 0x06007140;
-D_0600B9D8 = 0x0600B9D8;
-D_0600C26C = 0x0600C26C;
-D_0600C58C = 0x0600C58C;
-D_0600CB3C = 0x0600CB3C;
-D_0600D354 = 0x0600D354;
-D_0600DE34 = 0x0600DE34;
-D_0600E3EC = 0x0600E3EC;
-D_0600F00C = 0x0600F00C;
-D_0600F180 = 0x0600F180;
-D_0600F218 = 0x0600F218;
-D_06012C34 = 0x06012C34;
-D_060131FC = 0x060131FC;
-D_06013320 = 0x06013320;
-D_060138B0 = 0x060138B0;
-D_0601430C = 0x0601430C;
-
-// ovl_En_Fu
-
-D_06001F74 = 0x06001F74;
-D_06002F64 = 0x06002F64;
-D_06004904 = 0x06004904;
-D_06005304 = 0x06005304;
-D_060053E0 = 0x060053E0;
-D_0600B0A0 = 0x0600B0A0;
-D_0600B0E0 = 0x0600B0E0;
-D_0600B2B0 = 0x0600B2B0;
-D_0600BAC4 = 0x0600BAC4;
-
// ovl_En_Fu_Kago
D_060006A0 = 0x060006A0;
@@ -2291,103 +1367,26 @@ D_0600A344 = 0x0600A344;
D_06001EFC = 0x06001EFC;
D_0600A808 = 0x0600A808;
-// ovl_En_Gg
-
-D_0600F578 = 0x0600F578;
-D_0600F6C0 = 0x0600F6C0;
-
// ovl_En_Gg2
D_0600F578 = 0x0600F578;
D_0600F6C0 = 0x0600F6C0;
-// ovl_En_Ginko_Man
+// ovl_En_Goron_Oyu
-D_060008C0 = 0x060008C0;
-D_06000AC4 = 0x06000AC4;
-D_060043F0 = 0x060043F0;
-D_06004A7C = 0x06004A7C;
-D_06004F40 = 0x06004F40;
-D_0600B1D8 = 0x0600B1D8;
-D_0600C240 = 0x0600C240;
-
-// ovl_En_Gk
-
-D_06006680 = 0x06006680;
-D_06006688 = 0x06006688;
-D_0600787C = 0x0600787C;
-D_060079C0 = 0x060079C0;
-
-// ovl_En_Gm
-
-D_06005028 = 0x06005028;
-D_060054A8 = 0x060054A8;
-D_06005CE8 = 0x06005CE8;
-D_06006828 = 0x06006828;
-D_06006C68 = 0x06006C68;
-D_06007528 = 0x06007528;
-D_060078B0 = 0x060078B0;
-D_06008090 = 0x06008090;
-D_0600898C = 0x0600898C;
-D_06009450 = 0x06009450;
-D_06009CDC = 0x06009CDC;
-D_0600A5E0 = 0x0600A5E0;
-D_0600A70C = 0x0600A70C;
-D_0600AD18 = 0x0600AD18;
-D_0600B8B0 = 0x0600B8B0;
-D_0600B990 = 0x0600B990;
-D_0600BA80 = 0x0600BA80;
-D_0600C03C = 0x0600C03C;
-
-// ovl_En_Goroiwa
-
-D_060032E0 = 0x060032E0;
-D_060082D0 = 0x060082D0;
-D_06005C20 = 0x06005C20;
-D_06003B40 = 0x06003B40;
-D_06008B90 = 0x06008B90;
-D_060042B0 = 0x060042B0;
-D_06004960 = 0x06004960;
-D_06004EF0 = 0x06004EF0;
-D_060003B0 = 0x060003B0;
-D_060028E0 = 0x060028E0;
-D_06002D70 = 0x06002D70;
-D_060072F0 = 0x060072F0;
-D_060077D0 = 0x060077D0;
-D_06007C60 = 0x06007C60;
+D_06000988 = 0x06000988;
// ovl_En_Grasshopper
D_06000F9C = 0x06000F9C;
D_06003F00 = 0x06003F00;
-// ovl_En_Gs
-
-D_06000950 = 0x06000950;
-D_060009D0 = 0x060009D0;
-D_06000A60 = 0x06000A60;
-
// ovl_En_Guard_Nuts
D_06002700 = 0x06002700;
D_06002848 = 0x06002848;
D_06002A08 = 0x06002A08;
-// ovl_En_Guruguru
-
-D_06000B04 = 0x06000B04;
-D_0600057C = 0x0600057C;
-D_06005F20 = 0x06005F20;
-D_06006320 = 0x06006320;
-D_06006720 = 0x06006720;
-D_06006920 = 0x06006920;
-D_06006C90 = 0x06006C90;
-
-// ovl_En_Hakurock
-
-D_06011100 = 0x06011100;
-D_06011178 = 0x06011178;
-
// ovl_En_Hata
D_060000C0 = 0x060000C0;
@@ -2399,20 +1398,6 @@ D_06002FD0 = 0x06002FD0;
D_06003BFC = 0x06003BFC;
D_0600D640 = 0x0600D640;
-// ovl_En_Hg
-
-D_06000370 = 0x06000370;
-D_06001138 = 0x06001138;
-D_060015D4 = 0x060015D4;
-D_06001960 = 0x06001960;
-D_0600260C = 0x0600260C;
-D_06005E28 = 0x06005E28;
-D_06008580 = 0x06008580;
-D_06009D44 = 0x06009D44;
-D_0600A164 = 0x0600A164;
-D_0600AE1C = 0x0600AE1C;
-
-
// ovl_En_Hgo
D_0600B644 = 0x0600B644;
@@ -2424,13 +1409,6 @@ D_06012A58 = 0x06012A58;
D_060023B8 = 0x060023B8;
D_060024CC = 0x060024CC;
-// ovl_En_Hint_Skb
-
-D_06002190 = 0x06002190;
-D_06003584 = 0x06003584;
-D_06005EF8 = 0x06005EF8;
-D_0600697C = 0x0600697C;
-
// ovl_En_Horse
D_06008C68 = 0x06008C68;
@@ -2461,15 +1439,6 @@ D_0600A480 = 0x0600A480;
D_060005C0 = 0x060005C0;
D_06006260 = 0x06006260;
-// ovl_En_Ig
-
-D_06008710 = 0x06008710;
-D_060087B8 = 0x060087B8;
-D_060089D8 = 0x060089D8;
-D_06008B00 = 0x06008B00;
-D_0600C538 = 0x0600C538;
-D_060130D0 = 0x060130D0;
-
// ovl_En_Ik
D_06000CE8 = 0x06000CE8;
@@ -2485,105 +1454,6 @@ D_060057F4 = 0x060057F4;
D_06006294 = 0x06006294;
D_060136A0 = 0x060136A0;
-// ovl_En_In
-
-D_060003B4 = 0x060003B4;
-D_06000CB0 = 0x06000CB0;
-D_06001BE0 = 0x06001BE0;
-D_06001C30 = 0x06001C30;
-D_06001D10 = 0x06001D10;
-D_06003520 = 0x06003520;
-D_060035E0 = 0x060035E0;
-D_060043E0 = 0x060043E0;
-D_06004820 = 0x06004820;
-D_06004C20 = 0x06004C20;
-D_06007A70 = 0x06007A70;
-D_06007C48 = 0x06007C48;
-D_06012A78 = 0x06012A78;
-D_06012DF8 = 0x06012DF8;
-D_06013440 = 0x06013440;
-D_06013540 = 0x06013540;
-D_06013670 = 0x06013670;
-D_060137A0 = 0x060137A0;
-D_060138D0 = 0x060138D0;
-D_06013A00 = 0x06013A00;
-D_06013DE0 = 0x06013DE0;
-D_06013F10 = 0x06013F10;
-D_06014040 = 0x06014040;
-D_06014420 = 0x06014420;
-D_060145D8 = 0x060145D8;
-D_06014710 = 0x06014710;
-D_06014860 = 0x06014860;
-D_060149A8 = 0x060149A8;
-D_06014AE0 = 0x06014AE0;
-D_06014C30 = 0x06014C30;
-D_06014EA8 = 0x06014EA8;
-D_06014F8C = 0x06014F8C;
-D_06015918 = 0x06015918;
-D_06015E38 = 0x06015E38;
-D_06016484 = 0x06016484;
-D_06016A60 = 0x06016A60;
-D_060170DC = 0x060170DC;
-D_060177AC = 0x060177AC;
-D_06018240 = 0x06018240;
-D_060187C8 = 0x060187C8;
-D_060198A8 = 0x060198A8;
-D_06019EB4 = 0x06019EB4;
-D_0601A140 = 0x0601A140;
-D_0601B3C4 = 0x0601B3C4;
-D_0601B904 = 0x0601B904;
-D_0601C0B0 = 0x0601C0B0;
-D_0601C528 = 0x0601C528;
-
-// ovl_En_Invadepoh
-
-D_06000080 = 0x06000080;
-D_060003B0 = 0x060003B0;
-D_06000550 = 0x06000550;
-D_06000560 = 0x06000560;
-D_06000608 = 0x06000608;
-D_060006C8 = 0x060006C8;
-D_06000720 = 0x06000720;
-D_06000998 = 0x06000998;
-D_06001560 = 0x06001560;
-D_06001674 = 0x06001674;
-D_06001BD8 = 0x06001BD8;
-D_06001D80 = 0x06001D80;
-D_060021C8 = 0x060021C8;
-D_06002A8C = 0x06002A8C;
-D_06004010 = 0x06004010;
-D_06004264 = 0x06004264;
-D_06004C30 = 0x06004C30;
-D_06004E50 = 0x06004E50;
-D_06004E98 = 0x06004E98;
-D_06007328 = 0x06007328;
-D_060080F0 = 0x060080F0;
-D_06009E58 = 0x06009E58;
-D_0600A174 = 0x0600A174;
-D_0600FFC8 = 0x0600FFC8;
-D_060107C8 = 0x060107C8;
-D_06010FC8 = 0x06010FC8;
-D_060117C8 = 0x060117C8;
-D_06011AD8 = 0x06011AD8;
-D_06011FC8 = 0x06011FC8;
-D_060122D8 = 0x060122D8;
-D_060127C8 = 0x060127C8;
-D_06012AD8 = 0x06012AD8;
-D_06012BC8 = 0x06012BC8;
-D_06012FC8 = 0x06012FC8;
-D_060132D8 = 0x060132D8;
-D_060133C8 = 0x060133C8;
-D_06013928 = 0x06013928;
-D_06013AD8 = 0x06013AD8;
-D_06014088 = 0x06014088;
-D_060142D8 = 0x060142D8;
-D_06014AD8 = 0x06014AD8;
-D_06014ED8 = 0x06014ED8;
-D_060152D8 = 0x060152D8;
-D_060156D8 = 0x060156D8;
-D_06015C28 = 0x06015C28;
-D_06016720 = 0x06016720;
-
// ovl_En_Invadepoh_Demo
D_06000080 = 0x06000080;
@@ -2600,21 +1470,6 @@ D_06012FC8 = 0x06012FC8;
D_06013928 = 0x06013928;
D_06016588 = 0x06016588;
-// ovl_En_Ja
-
-D_0600BA30 = 0x0600BA30;
-D_0600BCC8 = 0x0600BCC8;
-D_0600C240 = 0x0600C240;
-
-// ovl_En_Jc_Mato
-
-D_06000390 = 0x06000390;
-
-// ovl_En_Jg
-
-D_0601ADC0 = 0x0601ADC0;
-D_0601AFF0 = 0x0601AFF0;
-
// ovl_En_Jgame_Tsn
D_06008AB8 = 0x06008AB8;
@@ -2645,65 +1500,16 @@ D_060081F4 = 0x060081F4;
D_060058B8 = 0x060058B8;
D_0600D828 = 0x0600D828;
-// ovl_En_Kakasi
-
-D_06000214 = 0x06000214;
-D_060065B0 = 0x060065B0;
-D_06007444 = 0x06007444;
-D_0600686C = 0x0600686C;
-D_060081A4 = 0x060081A4;
-D_06007B90 = 0x06007B90;
-D_060071EC = 0x060071EC;
-D_06007444 = 0x06007444;
-D_0600686C = 0x0600686C;
-D_060081A4 = 0x060081A4;
-D_06000214 = 0x06000214;
-
// ovl_En_Kanban
D_06000C30 = 0x06000C30;
D_06001630 = 0x06001630;
-// ovl_En_Karebaba
-
-D_060002B8 = 0x060002B8;
-D_060010F0 = 0x060010F0;
-D_06001828 = 0x06001828;
-D_06002A40 = 0x06002A40;
-D_06003070 = 0x06003070;
-
// ovl_En_Kbt
D_06004274 = 0x06004274;
D_0600DEE8 = 0x0600DEE8;
-// ovl_En_Kendo_Js
-
-D_0600016C = 0x0600016C;
-D_060003DC = 0x060003DC;
-D_06000F4C = 0x06000F4C;
-D_06006990 = 0x06006990;
-
-// ovl_En_Kgy
-
-D_06004B98 = 0x06004B98;
-D_0600E8F0 = 0x0600E8F0;
-D_0600EE58 = 0x0600EE58;
-D_0600F180 = 0x0600F180;
-D_0600F6A0 = 0x0600F6A0;
-D_0600F910 = 0x0600F910;
-D_060008FC = 0x060008FC;
-D_0600292C = 0x0600292C;
-D_060042E4 = 0x060042E4;
-D_060101F0 = 0x060101F0;
-D_06001764 = 0x06001764;
-D_06003334 = 0x06003334;
-D_06010B84 = 0x06010B84;
-D_06001EA4 = 0x06001EA4;
-D_06003D88 = 0x06003D88;
-D_04001D00 = 0x04001D00;
-D_040021A8 = 0x040021A8;
-
// ovl_En_Kitan
D_06000CE8 = 0x06000CE8;
@@ -2800,31 +1606,6 @@ D_06000430 = 0x06000430;
D_06002848 = 0x06002848;
D_06002B6C = 0x06002B6C;
-// ovl_En_Ma4
-
-D_060003B0 = 0x060003B0;
-D_06000A20 = 0x06000A20;
-D_06002A8C = 0x06002A8C;
-D_06007328 = 0x06007328;
-D_06007D98 = 0x06007D98;
-D_0600852C = 0x0600852C;
-D_06008F6C = 0x06008F6C;
-D_06009E58 = 0x06009E58;
-D_0600FFC8 = 0x0600FFC8;
-D_060107C8 = 0x060107C8;
-D_06010FC8 = 0x06010FC8;
-D_060117C8 = 0x060117C8;
-D_06011FC8 = 0x06011FC8;
-D_060127C8 = 0x060127C8;
-D_06012BC8 = 0x06012BC8;
-D_06012FC8 = 0x06012FC8;
-D_060133C8 = 0x060133C8;
-D_06013928 = 0x06013928;
-D_06014088 = 0x06014088;
-D_06015B7C = 0x06015B7C;
-D_06018948 = 0x06018948;
-D_0601B76C = 0x0601B76C;
-
// ovl_En_Mag
D_06000000 = 0x06000000;
@@ -2840,67 +1621,6 @@ D_06011E48 = 0x06011E48;
D_06002EC0 = 0x06002EC0;
-// ovl_En_Ma_Yto
-
-D_06000CC0 = 0x06000CC0;
-D_06001FD0 = 0x06001FD0;
-D_060030B4 = 0x060030B4;
-D_06003D54 = 0x06003D54;
-D_06004370 = 0x06004370;
-D_06005314 = 0x06005314;
-D_06005430 = 0x06005430;
-D_060070EC = 0x060070EC;
-D_06007E28 = 0x06007E28;
-D_060093E8 = 0x060093E8;
-D_0600A174 = 0x0600A174;
-D_0600AF7C = 0x0600AF7C;
-D_06011AD8 = 0x06011AD8;
-D_060122D8 = 0x060122D8;
-D_06012AD8 = 0x06012AD8;
-D_060132D8 = 0x060132D8;
-D_06013AD8 = 0x06013AD8;
-D_060142D8 = 0x060142D8;
-D_06014AD8 = 0x06014AD8;
-D_06014ED8 = 0x06014ED8;
-D_060152D8 = 0x060152D8;
-D_060156D8 = 0x060156D8;
-D_06015C28 = 0x06015C28;
-D_06016720 = 0x06016720;
-
-// ovl_En_Ma_Yts
-
-D_060003B0 = 0x060003B0;
-D_06002A8C = 0x06002A8C;
-D_060043A0 = 0x060043A0;
-D_06007328 = 0x06007328;
-D_06007D98 = 0x06007D98;
-D_0600852C = 0x0600852C;
-D_06008F6C = 0x06008F6C;
-D_06009E58 = 0x06009E58;
-D_0600FFC8 = 0x0600FFC8;
-D_060107C8 = 0x060107C8;
-D_06010FC8 = 0x06010FC8;
-D_060117C8 = 0x060117C8;
-D_06011FC8 = 0x06011FC8;
-D_060127C8 = 0x060127C8;
-D_06012BC8 = 0x06012BC8;
-D_06012FC8 = 0x06012FC8;
-D_060133C8 = 0x060133C8;
-D_06013928 = 0x06013928;
-D_06014088 = 0x06014088;
-D_06015B7C = 0x06015B7C;
-D_060180DC = 0x060180DC;
-D_06018948 = 0x06018948;
-D_0601B76C = 0x0601B76C;
-
-// ovl_En_Minifrog
-
-D_060007BC = 0x060007BC;
-D_06001534 = 0x06001534;
-D_060059A0 = 0x060059A0;
-D_06005BA0 = 0x06005BA0;
-D_0600B538 = 0x0600B538;
-
// ovl_En_Mk
D_06001C38 = 0x06001C38;
@@ -2922,16 +1642,6 @@ D_060105DC = 0x060105DC;
D_06019B88 = 0x06019B88;
D_0601D518 = 0x0601D518;
-// ovl_En_Ms
-
-D_060005EC = 0x060005EC;
-D_06003DC0 = 0x06003DC0;
-
-// ovl_En_Muto
-
-D_06000E50 = 0x06000E50;
-D_06007150 = 0x06007150;
-
// ovl_En_Nb
D_06008C40 = 0x06008C40;
@@ -2945,17 +1655,6 @@ D_06001EE8 = 0x06001EE8;
D_06013380 = 0x06013380;
-// ovl_En_Niw
-
-D_060000E8 = 0x060000E8;
-D_060023B0 = 0x060023B0;
-D_06002428 = 0x06002428;
-D_06002530 = 0x06002530;
-
-// ovl_En_Nnh
-
-D_06001510 = 0x06001510;
-
// ovl_En_Nwc
D_060000E8 = 0x060000E8;
@@ -2988,119 +1687,10 @@ D_060192A0 = 0x060192A0;
D_060201BC = 0x060201BC;
D_060202F0 = 0x060202F0;
-// ovl_En_Ossan
-
-D_060028A0 = 0x060028A0;
-D_06005BC0 = 0x06005BC0;
-D_06006498 = 0x06006498;
-D_06006B18 = 0x06006B18;
-D_06006D40 = 0x06006D40;
-D_06006F18 = 0x06006F18;
-D_06007140 = 0x06007140;
-D_06009D34 = 0x06009D34;
-D_0600A460 = 0x0600A460;
-D_0600CB3C = 0x0600CB3C;
-D_0600DE34 = 0x0600DE34;
-D_0600E3EC = 0x0600E3EC;
-D_0600C58C = 0x0600C58C;
-D_0600F00C = 0x0600F00C;
-D_0600B9D8 = 0x0600B9D8;
-D_0600C26C = 0x0600C26C;
-D_0600D354 = 0x0600D354;
-D_06012C34 = 0x06012C34;
-D_060131FC = 0x060131FC;
-D_06013320 = 0x06013320;
-D_060138B0 = 0x060138B0;
-D_0601430C = 0x0601430C;
-
-// ovl_En_Ot
-
-D_06000040 = 0x06000040;
-D_06000078 = 0x06000078;
-D_060004A0 = 0x060004A0;
-D_060005F8 = 0x060005F8;
-D_060008D8 = 0x060008D8;
-D_06004800 = 0x06004800;
-D_06000420 = 0x06000420;
-D_06004B30 = 0x06004B30;
-
-// ovl_En_Owl
-
-D_06001168 = 0x06001168;
-D_06001200 = 0x06001200;
-D_06001ADC = 0x06001ADC;
-D_0600C5F8 = 0x0600C5F8;
-D_0600C6D4 = 0x0600C6D4;
-D_0600CB94 = 0x0600CB94;
-D_0600CDB0 = 0x0600CDB0;
-D_060105C0 = 0x060105C0;
-D_06008EB8 = 0x06008EB8;
-D_060092B8 = 0x060092B8;
-D_060096B8 = 0x060096B8;
-
-// ovl_En_Pamera
-
-
-D_06008448 = 0x06008448;
-D_060005BC = 0x060005BC;
-D_06008AE0 = 0x06008AE0;
-D_06008E38 = 0x06008E38;
-D_0600A844 = 0x0600A844;
-D_0600B0C4 = 0x0600B0C4;
-D_06009870 = 0x06009870;
-D_06009F54 = 0x06009F54;
-D_0600B5B0 = 0x0600B5B0;
-D_0600BCC4 = 0x0600BCC4;
-D_0600D9DC = 0x0600D9DC;
-D_0600E16C = 0x0600E16C;
-D_0600C9F4 = 0x0600C9F4;
-D_0600D0F0 = 0x0600D0F0;
-D_060074E8 = 0x060074E8;
-D_060078E8 = 0x060078E8;
-D_060066E8 = 0x060066E8;
-D_06006AE8 = 0x06006AE8;
-D_06006EE8 = 0x06006EE8;
-D_060072E8 = 0x060072E8;
-D_060073E8 = 0x060073E8;
-
// ovl_En_Paper
D_0600D5A0 = 0x0600D5A0;
-// ovl_En_Pm
-
-D_06008348 = 0x06008348;
-D_060083E0 = 0x060083E0;
-D_060085C8 = 0x060085C8;
-D_060096E8 = 0x060096E8;
-D_06002238 = 0x06002238;
-D_0600A4E0 = 0x0600A4E0;
-D_0600B09C = 0x0600B09C;
-D_0600BA78 = 0x0600BA78;
-D_0600C32C = 0x0600C32C;
-D_060099B4 = 0x060099B4;
-D_06000FC4 = 0x06000FC4;
-D_0600A8D8 = 0x0600A8D8;
-D_0600099C = 0x0600099C;
-D_06001F84 = 0x06001F84;
-D_06000468 = 0x06000468;
-D_0600C640 = 0x0600C640;
-D_06002950 = 0x06002950;
-D_06002750 = 0x06002750;
-
-// ovl_En_Poh
-
-D_060001A8 = 0x060001A8;
-D_060004EC = 0x060004EC;
-D_060006E0 = 0x060006E0;
-D_06000A60 = 0x06000A60;
-D_060011C4 = 0x060011C4;
-D_060015B0 = 0x060015B0;
-D_06002608 = 0x06002608;
-D_06002D28 = 0x06002D28;
-D_06003850 = 0x06003850;
-D_060050D0 = 0x060050D0;
-
// ovl_En_Po_Composer
D_0600188C = 0x0600188C;
@@ -3110,47 +1700,11 @@ D_06006F38 = 0x06006F38;
D_06006FD8 = 0x06006FD8;
D_06009930 = 0x06009930;
-// ovl_En_Po_Fusen
-
-D_06000040 = 0x06000040;
-D_060024F0 = 0x060024F0;
-
-// ovl_En_Po_Sisters
-
-D_06000114 = 0x06000114;
-D_060008C0 = 0x060008C0;
-D_06000A54 = 0x06000A54;
-D_06000D40 = 0x06000D40;
-D_0600119C = 0x0600119C;
-D_060014CC = 0x060014CC;
-D_06001CB0 = 0x06001CB0;
-D_06001DE0 = 0x06001DE0;
-D_060027B0 = 0x060027B0;
-D_06002EB8 = 0x06002EB8;
-D_06002F88 = 0x06002F88;
-D_06003628 = 0x06003628;
-D_06003880 = 0x06003880;
-D_06003DC8 = 0x06003DC8;
-D_06004020 = 0x06004020;
-D_060046E0 = 0x060046E0;
-D_060065C8 = 0x060065C8;
-
// ovl_En_Pp
D_0600A844 = 0x0600A844;
D_06012768 = 0x06012768;
-// ovl_En_Pr
-
-D_060021E8 = 0x060021E8;
-D_060038B8 = 0x060038B8;
-
-// ovl_En_Pr2
-
-D_06003904 = 0x06003904;
-D_06004188 = 0x06004188;
-D_06004340 = 0x06004340;
-
// ovl_En_Prz
D_06004188 = 0x06004188;
@@ -3175,86 +1729,12 @@ D_06002EF8 = 0x06002EF8;
D_060032F8 = 0x060032F8;
D_06003428 = 0x06003428;
-// ovl_En_Railgibud
-
-D_060053E8 = 0x060053E8;
-D_0600ABE0 = 0x0600ABE0;
-D_06010B88 = 0x06010B88;
-D_06006678 = 0x06006678;
-D_06006B08 = 0x06006B08;
-D_06006EEC = 0x06006EEC;
-D_060073A4 = 0x060073A4;
-D_06007BBC = 0x06007BBC;
-D_060081A8 = 0x060081A8;
-D_06009298 = 0x06009298;
-D_06009900 = 0x06009900;
-D_0600A450 = 0x0600A450;
-D_060113EC = 0x060113EC;
-D_0601216C = 0x0601216C;
-D_060118D8 = 0x060118D8;
-D_06011DB8 = 0x06011DB8;
-D_0600A450 = 0x0600A450;
-D_06005DF4 = 0x06005DF4;
-D_060061E4 = 0x060061E4;
-D_06001600 = 0x06001600;
-D_060009C4 = 0x060009C4;
-D_06000F1C = 0x06000F1C;
-
// ovl_En_Rat
D_06000174 = 0x06000174;
D_0600026C = 0x0600026C;
D_06001858 = 0x06001858;
-// ovl_En_Rd
-
-D_060053E8 = 0x060053E8;
-D_06006678 = 0x06006678;
-D_06006B08 = 0x06006B08;
-D_06006EEC = 0x06006EEC;
-D_060073A4 = 0x060073A4;
-D_06007BBC = 0x06007BBC;
-D_060081A8 = 0x060081A8;
-D_06009298 = 0x06009298;
-D_06009900 = 0x06009900;
-D_0600A450 = 0x0600A450;
-D_0600ABE0 = 0x0600ABE0;
-D_06010B88 = 0x06010B88;
-D_060113EC = 0x060113EC;
-D_060118D8 = 0x060118D8;
-D_06011DB8 = 0x06011DB8;
-D_0601216C = 0x0601216C;
-
-// ovl_En_Recepgirl
-
-D_06000968 = 0x06000968;
-D_06001384 = 0x06001384;
-D_06009890 = 0x06009890;
-D_0600A280 = 0x0600A280;
-D_0600AD98 = 0x0600AD98;
-D_0600F8F0 = 0x0600F8F0;
-D_0600FCF0 = 0x0600FCF0;
-D_060100F0 = 0x060100F0;
-D_06011B60 = 0x06011B60;
-
-// ovl_En_Rg
-
-D_060091A8 = 0x060091A8;
-D_06011AC8 = 0x06011AC8;
-D_06014CF0 = 0x06014CF0;
-D_06014D00 = 0x06014D00;
-
-// ovl_En_Rr
-
-D_06000470 = 0x06000470;
-
-// ovl_En_Rsn
-
-D_06005458 = 0x06005458;
-D_0600788C = 0x0600788C;
-D_06009120 = 0x06009120;
-D_06009220 = 0x06009220;
-
// ovl_En_Ru
D_0600C700 = 0x0600C700;
@@ -3265,70 +1745,16 @@ D_06003A20 = 0x06003A20;
D_0600D768 = 0x0600D768;
D_0600D8D8 = 0x0600D8D8;
-// ovl_En_Sb
-
-D_0600004C = 0x0600004C;
-D_060000B4 = 0x060000B4;
-D_06000124 = 0x06000124;
-D_06000194 = 0x06000194;
-D_06002BF0 = 0x06002BF0;
-D_06002C8C = 0x06002C8C;
-
// ovl_En_Scopecrow
D_060000F0 = 0x060000F0;
D_060010C0 = 0x060010C0;
-// ovl_En_Scopenuts
-
-D_06001420 = 0x06001420;
-D_06005488 = 0x06005488;
-D_06008290 = 0x06008290;
-D_0600AC70 = 0x0600AC70;
-
-// ovl_En_Sellnuts
-
-D_06001350 = 0x06001350;
-D_06005488 = 0x06005488;
-D_06008290 = 0x06008290;
-D_0600AC70 = 0x0600AC70;
-D_06000994 = 0x06000994;
-D_060012F4 = 0x060012F4;
-D_06001BC8 = 0x06001BC8;
-D_06001E2C = 0x06001E2C;
-D_06002268 = 0x06002268;
-D_06002670 = 0x06002670;
-D_060029E8 = 0x060029E8;
-D_06002F08 = 0x06002F08;
-D_06003438 = 0x06003438;
-D_060038CC = 0x060038CC;
-D_06003CC0 = 0x06003CC0;
-D_06004700 = 0x06004700;
-D_06004AA0 = 0x06004AA0;
-D_06004E38 = 0x06004E38;
-D_0600577C = 0x0600577C;
-D_06005CA8 = 0x06005CA8;
-D_0600B0B4 = 0x0600B0B4;
-
// ovl_En_Shn
D_0600B738 = 0x0600B738;
D_0600E7D0 = 0x0600E7D0;
-// ovl_En_Skb
-
-D_06001D1C = 0x06001D1C;
-D_06002190 = 0x06002190;
-D_06003584 = 0x06003584;
-D_06005EF8 = 0x06005EF8;
-D_0600697C = 0x0600697C;
-D_06006D90 = 0x06006D90;
-D_060009E4 = 0x060009E4;
-D_060015EC = 0x060015EC;
-D_0600270C = 0x0600270C;
-D_06002AC8 = 0x06002AC8;
-D_060064E0 = 0x060064E0;
-
// ovl_En_Slime
D_060004C0 = 0x060004C0;
@@ -3354,31 +1780,10 @@ D_060058CC = 0x060058CC;
D_06000198 = 0x06000198;
D_06001AA0 = 0x06001AA0;
-// ovl_En_Sob1
-
-D_06008268 = 0x06008268;
-D_0600D208 = 0x0600D208;
-D_0600078C = 0x0600078C;
-D_06011AC8 = 0x06011AC8;
-D_060000FC = 0x060000FC;
-D_06000970 = 0x06000970;
-D_060087BC = 0x060087BC;
-D_060050A0 = 0x060050A0;
-D_060058A0 = 0x060058A0;
-D_060060A0 = 0x060060A0;
-D_06010438 = 0x06010438;
-D_06010C38 = 0x06010C38;
-D_06011038 = 0x06011038;
-
// ovl_En_Ssh
D_06000304 = 0x06000304;
-// ovl_En_Sth
-
-D_060031F8 = 0x060031F8;
-D_06005998 = 0x06005998;
-
// ovl_En_Sth2
D_060031F8 = 0x060031F8;
@@ -3395,36 +1800,6 @@ D_0600D640 = 0x0600D640;
D_06006C18 = 0x06006C18;
D_0600D640 = 0x0600D640;
-// ovl_En_Suttari
-
-D_0600071C = 0x0600071C;
-D_0600AF90 = 0x0600AF90;
-D_0600C240 = 0x0600C240;
-D_06010BDC = 0x06010BDC;
-D_0601139C = 0x0601139C;
-D_06011C38 = 0x06011C38;
-D_06011F84 = 0x06011F84;
-D_060128F4 = 0x060128F4;
-D_06012E84 = 0x06012E84;
-D_06013380 = 0x06013380;
-
-// ovl_En_Sw
-
-D_06003FB0 = 0x06003FB0;
-D_060043D8 = 0x060043D8;
-D_060045C0 = 0x060045C0;
-D_06004658 = 0x06004658;
-D_060046F0 = 0x060046F0;
-D_06004788 = 0x06004788;
-D_06004820 = 0x06004820;
-D_060048B8 = 0x060048B8;
-D_06004950 = 0x06004950;
-D_060049E8 = 0x060049E8;
-D_06005298 = 0x06005298;
-D_06000304 = 0x06000304;
-D_060055A8 = 0x060055A8;
-D_06005B98 = 0x06005B98;
-
// ovl_En_Syateki_Crow
D_060000F0 = 0x060000F0;
@@ -3437,28 +1812,11 @@ D_06002468 = 0x06002468;
D_06002A5C = 0x06002A5C;
D_06003180 = 0x06003180;
-// ovl_En_Syateki_Man
-
-D_06005AC8 = 0x06005AC8;
-D_060062C8 = 0x060062C8;
-D_0600D2F8 = 0x0600D2F8;
-D_0600D9D0 = 0x0600D9D0;
-D_0600DFEC = 0x0600DFEC;
-D_0600E7D0 = 0x0600E7D0;
-D_0600F2D0 = 0x0600F2D0;
-D_0600FB90 = 0x0600FB90;
-D_06010390 = 0x06010390;
-
// ovl_En_Syateki_Okuta
D_060033D0 = 0x060033D0;
D_0600466C = 0x0600466C;
-// ovl_En_Syateki_Wf
-
-D_060095D0 = 0x060095D0;
-D_0600A3CC = 0x0600A3CC;
-
// ovl_En_S_Goro
D_060091A8 = 0x060091A8;
@@ -3485,11 +1843,6 @@ D_060034C8 = 0x060034C8;
D_06004510 = 0x06004510;
D_06004550 = 0x06004550;
-// ovl_En_Tanron3
-
-D_0600DA20 = 0x0600DA20;
-D_0600DAAC = 0x0600DAAC;
-
// ovl_En_Tanron4
D_06000168 = 0x06000168;
@@ -3513,99 +1866,10 @@ D_0600B0A0 = 0x0600B0A0;
D_0600B0E0 = 0x0600B0E0;
D_0600B2B0 = 0x0600B2B0;
-// ovl_En_Thiefbird
-
-D_06000088 = 0x06000088;
-D_06000278 = 0x06000278;
-D_06000604 = 0x06000604;
-D_06003060 = 0x06003060;
-D_060030D8 = 0x060030D8;
-D_060033B0 = 0x060033B0;
-D_06003D58 = 0x06003D58;
-D_060061A0 = 0x060061A0;
-D_060063C4 = 0x060063C4;
-D_06004348 = 0x06004348;
-D_06004B88 = 0x06004B88;
-D_060055E0 = 0x060055E0;
-
-// ovl_En_Tite
-
-D_060004F8 = 0x060004F8;
-D_0600069C = 0x0600069C;
-D_0600083C = 0x0600083C;
-D_06000A14 = 0x06000A14;
-D_06000C70 = 0x06000C70;
-D_060012E4 = 0x060012E4;
-D_06003A20 = 0x06003A20;
-D_06001300 = 0x06001300;
-D_06001700 = 0x06001700;
-D_06001900 = 0x06001900;
-D_06001B00 = 0x06001B00;
-D_06001F00 = 0x06001F00;
-D_06002100 = 0x06002100;
-
-// ovl_En_Tk
-
-D_06001144 = 0x06001144;
-D_06001FA8 = 0x06001FA8;
-D_060020C8 = 0x060020C8;
-D_060030A4 = 0x060030A4;
-D_06003724 = 0x06003724;
-D_06003B10 = 0x06003B10;
-D_06003FB8 = 0x06003FB8;
-D_06004390 = 0x06004390;
-D_06004B90 = 0x06004B90;
-D_06005390 = 0x06005390;
-D_0600B530 = 0x0600B530;
-D_0600B9E8 = 0x0600B9E8;
-
-// ovl_En_Torch2
-
-D_0401C430 = 0x0401C430;
-D_04048DF0 = 0x04048DF0;
-D_04057B10 = 0x04057B10;
-D_04089070 = 0x04089070;
-
-// ovl_En_Toto
-
-D_06000C80 = 0x06000C80;
-D_06001324 = 0x06001324;
-D_060016A4 = 0x060016A4;
-D_06001DF0 = 0x06001DF0;
-D_060022C8 = 0x060022C8;
-D_060028B8 = 0x060028B8;
-D_06002F20 = 0x06002F20;
-D_06003AA8 = 0x06003AA8;
-D_06008AE8 = 0x06008AE8;
-D_0600A068 = 0x0600A068;
-D_0600A468 = 0x0600A468;
-D_0600A978 = 0x0600A978;
-D_0600B3E0 = 0x0600B3E0;
-D_0600B894 = 0x0600B894;
-D_0600BC08 = 0x0600BC08;
-D_0600C880 = 0x0600C880;
-
// ovl_En_Trt
D_0600FEF0 = 0x0600FEF0;
-D_0600FD34 = 0x0600FD34;
-D_0600DE68 = 0x0600DE68;
-D_06002224 = 0x06002224;
-D_06001EF4 = 0x06001EF4;
-D_060030EC = 0x060030EC;
-D_0600D52C = 0x0600D52C;
-D_06002CB0 = 0x06002CB0;
-D_0600EE98 = 0x0600EE98;
-D_06003D78 = 0x06003D78;
D_06000A44 = 0x06000A44;
-D_0600B0B8 = 0x0600B0B8;
-D_0600B8B8 = 0x0600B8B8;
-D_0600C0B8 = 0x0600C0B8;
-
-// ovl_En_Trt2
-
-D_06000A44 = 0x06000A44;
-D_0600FEF0 = 0x0600FEF0;
// ovl_En_Tru
@@ -3649,10 +1913,6 @@ D_06009520 = 0x06009520;
D_06009DB0 = 0x06009DB0;
D_0600A054 = 0x0600A054;
-// ovl_En_Warp_Uzu
-
-D_06000EC0 = 0x06000EC0;
-
// ovl_En_Wdhand
D_060000F4 = 0x060000F4;
@@ -3663,25 +1923,6 @@ D_060014C0 = 0x060014C0;
D_060015B0 = 0x060015B0;
D_06001E20 = 0x06001E20;
-// ovl_En_Wf
-
-D_06000300 = 0x06000300;
-D_060027D8 = 0x060027D8;
-D_060029D8 = 0x060029D8;
-D_06003BC0 = 0x06003BC0;
-D_06004638 = 0x06004638;
-D_06004A90 = 0x06004A90;
-D_06004C44 = 0x06004C44;
-D_060053D0 = 0x060053D0;
-D_06005700 = 0x06005700;
-D_06007AA8 = 0x06007AA8;
-D_060082A8 = 0x060082A8;
-D_060084A8 = 0x060084A8;
-D_060095D0 = 0x060095D0;
-D_06009808 = 0x06009808;
-D_06009A50 = 0x06009A50;
-D_0600A3CC = 0x0600A3CC;
-
// ovl_En_Wiz
D_06001860 = 0x06001860;
@@ -3701,93 +1942,16 @@ D_06005C64 = 0x06005C64;
D_06000700 = 0x06000700;
-// ovl_En_Yb
-
-D_06000200 = 0x06000200;
-D_06005F48 = 0x06005F48;
-
// ovl_En_Zl4
D_06013328 = 0x06013328;
-// ovl_En_Zo
-
-D_0600D208 = 0x0600D208;
-
-// ovl_En_Zob
-
-D_06006998 = 0x06006998;
-D_06010810 = 0x06010810;
-
// ovl_En_Zod
D_06000D94 = 0x06000D94;
D_06007650 = 0x06007650;
D_0600D658 = 0x0600D658;
-// ovl_En_Zoraegg
-
-D_060005D4 = 0x060005D4;
-D_06001E08 = 0x06001E08;
-D_06004C90 = 0x06004C90;
-D_06004D20 = 0x06004D20;
-D_06004E04 = 0x06004E04;
-D_06004FE4 = 0x06004FE4;
-D_06005098 = 0x06005098;
-D_06005250 = 0x06005250;
-
-// ovl_En_Zos
-
-D_0600A164 = 0x0600A164;
-D_06013088 = 0x06013088;
-D_060136E0 = 0x060136E0;
-D_06015238 = 0x06015238;
-
-// ovl_En_Zot
-
-D_06002898 = 0x06002898;
-D_06004248 = 0x06004248;
-D_060050A0 = 0x060050A0;
-D_060058A0 = 0x060058A0;
-D_060060A0 = 0x060060A0;
-D_0600D208 = 0x0600D208;
-D_0600DE20 = 0x0600DE20;
-D_0600DF54 = 0x0600DF54;
-D_0600E400 = 0x0600E400;
-D_0600EDF0 = 0x0600EDF0;
-D_0600F4E8 = 0x0600F4E8;
-D_0600FDF0 = 0x0600FDF0;
-D_06010B18 = 0x06010B18;
-D_06011424 = 0x06011424;
-
-// ovl_En_Zov
-
-D_0600D3EC = 0x0600D3EC;
-D_06016258 = 0x06016258;
-
-// ovl_En_Zow
-
-D_060029F0 = 0x060029F0;
-D_06002A50 = 0x06002A50;
-D_06002BA0 = 0x06002BA0;
-D_06002C10 = 0x06002C10;
-D_06003610 = 0x06003610;
-D_06004248 = 0x06004248;
-D_0600D208 = 0x0600D208;
-D_0600D220 = 0x0600D220;
-D_0600D288 = 0x0600D288;
-
-// ovl_Item_B_Heart
-
-D_06001290 = 0x06001290;
-D_06001470 = 0x06001470;
-
-// ovl_Mir_Ray
-
-D_06000168 = 0x06000168;
-D_060003F8 = 0x060003F8;
-D_060004B0 = 0x060004B0;
-
// ovl_Mir_Ray3
D_06000168 = 0x06000168;
@@ -3800,24 +1964,6 @@ D_0600033C = 0x0600033C;
D_06005948 = 0x06005948;
D_06005CF8 = 0x06005CF8;
-// ovl_Obj_Bean
-
-D_06000090 = 0x06000090;
-D_060002D0 = 0x060002D0;
-D_060004BC = 0x060004BC;
-D_06000530 = 0x06000530;
-D_06002208 = 0x06002208;
-
-// ovl_Obj_Bell
-
-D_06000570 = 0x06000570;
-D_06000698 = 0x06000698;
-D_060007A8 = 0x060007A8;
-D_06000840 = 0x06000840;
-D_060008D0 = 0x060008D0;
-D_06000960 = 0x06000960;
-D_06001BA8 = 0x06001BA8;
-
// ovl_Obj_Bigicicle
D_060009B0 = 0x060009B0;
@@ -3828,19 +1974,6 @@ D_060014F0 = 0x060014F0;
D_06007630 = 0x06007630;
D_06009A88 = 0x06009A88;
-// ovl_Obj_Bombiwa
-
-D_060009E0 = 0x060009E0;
-D_06000AF0 = 0x06000AF0;
-D_06004560 = 0x06004560;
-D_06004688 = 0x06004688;
-D_06005990 = 0x06005990;
-
-// ovl_Obj_Boyo
-
-D_06000300 = 0x06000300;
-D_06000E88 = 0x06000E88;
-
// ovl_Obj_Chan
D_06000A10 = 0x06000A10;
@@ -3853,27 +1986,11 @@ D_06002358 = 0x06002358;
D_06000D10 = 0x06000D10;
D_06000F00 = 0x06000F00;
-// ovl_Obj_Comb
-
-D_06000CB0 = 0x06000CB0;
-D_06001040 = 0x06001040;
-
// ovl_Obj_Danpeilift
D_06000180 = 0x06000180;
D_06000BA0 = 0x06000BA0;
-// ovl_Obj_Dhouse
-
-D_06004928 = 0x06004928;
-D_06005A78 = 0x06005A78;
-D_06008040 = 0x06008040;
-D_060081D8 = 0x060081D8;
-
-// ovl_Obj_Dinner
-
-D_060011E0 = 0x060011E0;
-
// ovl_Obj_Dora
D_06003FD0 = 0x06003FD0;
@@ -3884,28 +2001,11 @@ D_06004160 = 0x06004160;
D_060016A0 = 0x060016A0;
D_06001AA8 = 0x06001AA8;
-// ovl_Obj_Ending
-
-D_060003D0 = 0x060003D0;
-D_06001FF8 = 0x06001FF8;
-D_060031A0 = 0x060031A0;
-D_06003440 = 0x06003440;
-
// ovl_Obj_Entotu
D_06000158 = 0x06000158;
D_06001C00 = 0x06001C00;
-// ovl_Obj_Funen
-
-D_060000D0 = 0x060000D0;
-
-// ovl_Obj_Ghaka
-
-D_06001980 = 0x06001980;
-D_06001A20 = 0x06001A20;
-D_06003CD0 = 0x06003CD0;
-
// ovl_Obj_Hakaisi
D_06001F10 = 0x06001F10;
@@ -3915,100 +2015,35 @@ D_060029C0 = 0x060029C0;
D_06002CC0 = 0x06002CC0;
D_06002FC4 = 0x06002FC4;
-// ovl_Obj_Hana
-
-D_06000500 = 0x06000500;
-
// ovl_Obj_Hariko
D_06000080 = 0x06000080;
D_06000110 = 0x06000110;
-// ovl_Obj_Hgdoor
-
-D_06001670 = 0x06001670;
-D_06001768 = 0x06001768;
-D_060018C0 = 0x060018C0;
-D_06001AB0 = 0x06001AB0;
-D_06001BA8 = 0x06001BA8;
-D_06001D10 = 0x06001D10;
-
-// ovl_Obj_HsStump
-
-D_060003B8 = 0x060003B8;
-D_060011B0 = 0x060011B0;
-
-// ovl_Obj_Hunsui
-
-D_06000220 = 0x06000220;
-D_06000BF0 = 0x06000BF0;
-D_06000C74 = 0x06000C74;
-D_06000EC0 = 0x06000EC0;
-D_06001888 = 0x06001888;
-
// ovl_Obj_Jgame_Light
D_060003A0 = 0x060003A0;
-// ovl_Obj_Jg_Gakki
-
-D_0601B1E8 = 0x0601B1E8;
-D_0601B210 = 0x0601B210;
-
// ovl_Obj_Kendo_Kanban
D_06000180 = 0x06000180;
-// ovl_Obj_Kepn_Koya
-
-D_06003478 = 0x06003478;
-D_0600805C = 0x0600805C;
-
-// ovl_Obj_Kzsaku
-
-D_06000040 = 0x06000040;
-D_06001118 = 0x06001118;
-
// ovl_Obj_Lift
D_06000D10 = 0x06000D10;
D_06000F00 = 0x06000F00;
-// ovl_Obj_Lightblock
-
-D_06000178 = 0x06000178;
-D_06000B80 = 0x06000B80;
-
-// ovl_Obj_Lightswitch
-
-D_06000260 = 0x06000260;
-D_06000398 = 0x06000398;
-D_06000408 = 0x06000408;
-D_06000420 = 0x06000420;
-D_06000C20 = 0x06000C20;
-D_06001420 = 0x06001420;
-
// ovl_Obj_Lupygamelift
D_060048D0 = 0x060048D0;
D_060071B8 = 0x060071B8;
-// ovl_Obj_Milk_Bin
-
-D_060004B0 = 0x060004B0;
-
// ovl_Obj_Mine
D_06000030 = 0x06000030;
D_06002068 = 0x06002068;
D_06002188 = 0x06002188;
-// ovl_Obj_Moon_Stone
-
-D_06000C80 = 0x06000C80;
-D_06000D78 = 0x06000D78;
-D_06001C60 = 0x06001C60;
-
// ovl_Obj_Nozoki
D_060001C0 = 0x060001C0;
@@ -4019,14 +2054,6 @@ D_06001DB0 = 0x06001DB0;
D_06001E40 = 0x06001E40;
D_060048D0 = 0x060048D0;
-// ovl_Obj_Raillift
-
-D_06000208 = 0x06000208;
-D_060048D0 = 0x060048D0;
-D_06004BF0 = 0x06004BF0;
-D_06004FF8 = 0x06004FF8;
-D_060071B8 = 0x060071B8;
-
// ovl_Obj_Shutter
D_060011E0 = 0x060011E0;
@@ -4035,21 +2062,11 @@ D_060011E0 = 0x060011E0;
D_06001C00 = 0x06001C00;
-// ovl_Obj_Snowball2
-
-D_06008B90 = 0x06008B90;
-
// ovl_Obj_Spinyroll
D_06000460 = 0x06000460;
D_06000E68 = 0x06000E68;
-// ovl_Obj_Syokudai
-
-D_060003A0 = 0x060003A0;
-D_06000870 = 0x06000870;
-D_06000B90 = 0x06000B90;
-
// ovl_Obj_Takaraya_Wall
D_06000B70 = 0x06000B70;
@@ -4081,12 +2098,6 @@ D_06003038 = 0x06003038;
D_060023B0 = 0x060023B0;
D_060024E8 = 0x060024E8;
-// ovl_Obj_Tree
-
-D_06000680 = 0x06000680;
-D_060007C8 = 0x060007C8;
-D_06001B2C = 0x06001B2C;
-
// ovl_Obj_Um
D_06007E20 = 0x06007E20;
@@ -4100,11 +2111,6 @@ D_06000098 = 0x06000098;
D_06000838 = 0x06000838;
D_060022AC = 0x060022AC;
-// ovl_Obj_Visiblock
-
-D_06000140 = 0x06000140;
-D_06000AD0 = 0x06000AD0;
-
// ovl_Obj_Vspinyroll
D_06000460 = 0x06000460;
@@ -4115,12 +2121,6 @@ D_06000F80 = 0x06000F80;
D_06001680 = 0x06001680;
D_060019B0 = 0x060019B0;
-// ovl_Obj_Yado
-
-D_06000320 = 0x06000320;
-D_06000430 = 0x06000430;
-D_060012E8 = 0x060012E8;
-
// ovl_Obj_Yasi
D_06000360 = 0x06000360;