commit 06ec56df7f951f88da05f468cdcacecba496145a
parent 9a801cb96d9d3198ce552ae71a06347ee95c1f68
Author: n64 <n64>
Date: Sun, 1 Mar 2020 22:42:25 -0500
Refresh 7
Diffstat:
418 files changed, 8729 insertions(+), 11232 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,3 +1,43 @@
+Refresh #7
+1.) update README.md (#861)
+2.) [eu] fix decompilation bugs in synthesis_process_note (#862)
+3.) Label and document Snufit.inc.c (#863)
+4.) Label and document Snufit.inc.c (#863)
+5.) Match append_bubble_vertex_buffer, append_snowflake_vertex_buffer (#860)
+6.) Compile audio/effects.c with -sopt (#870)
+7.) Match handle_dialog_text_and_pages (#872)
+8.) Remove improperly used LEVEL_SA define. (#875)
+9.) Remove unused EU ASM files (#873)
+10.) Shindou build flag support (#876)
+11.) The Big Function PR (Part 1) (#864)
+12.) "Re-document" file_select and star_select for EU (#877)
+13.) Document paintings.c (#868)
+14.) Minor interaction.c labelling/documentation. (#882)
+15.) Match synthesis_execute, prepare_reverb_ring_buffer, func_eu_802e00d8 (#886)
+16.) The Big Function PR (Part 2) (#874)
+17.) Additional painting documentation (#883)
+18.) Some EU audio labelling (#885)
+19.) Bring synthesis_do_one_audio_update a bit closer to matching (#887)
+20.) Misleading comment, this actually contols Bowser's init action (#889)
+21.) Match synthesis_do_one_audio_update (#890)
+22.) Remove unneeded if(1) in synthesis_do_one_audio_update (#891)
+23.) Match synthesis_resample_and_mix_reverb (#893)
+24.) Set LANG=C (#896)
+25.) Match note_apply_headset_pan_effects (#897)
+26.) Match play_sequence (#898)
+27.) Match sequence_channel_enable (#899)
+28.) Match sequence_player_process_sequence (#900)
+29.) Match (eu) alloc_bank_or_seq (#901)
+30.) Match alloc_bank_or_seq (#903)
+31.) Update README.md (again)
+32.) Documented behaviour/fish.inc.c & blue_fish.inc.c (#894)
+33.) Labelled 4 behavior files, made object_helper functions consistent (#881)
+34.) Add a make target for .copt (#902)
+35.) The Big Function PR (Part 3) (#888)
+36.) The Big Function PR (Part 4) (#906)
+37.) Rename src/audio/memory.c -> heap.c (#907)
+38.) Fix BBH texture (#908)
+
Refresh #6
1.) Make tools work on MinGW (#804)
2.) Document mario_misc (#628)
diff --git a/Makefile b/Makefile
@@ -43,10 +43,21 @@ ifeq ($(VERSION),eu)
GRUCODE_ASFLAGS := --defsym F3D_NEW=1
TARGET := sm64.eu
else
+ifeq ($(VERSION),sh)
+ $(warning Building SH is experimental and is prone to breaking. Try at your own risk.)
+ VERSION_CFLAGS := -DVERSION_SH
+ VERSION_ASFLAGS := --defsym VERSION_SH=1
+ GRUCODE_CFLAGS := -DF3D_NEW
+ GRUCODE_ASFLAGS := --defsym F3D_NEW=1
+ TARGET := sm64.sh
+# TODO: GET RID OF THIS!!! We should mandate assets for Shindou like EU but we dont have the addresses extracted yet so we'll just pretend you have everything extracted for now.
+ NOEXTRACT := 1
+else
$(error unknown version "$(VERSION)")
endif
endif
endif
+endif
# Microcode
@@ -148,8 +159,12 @@ MIPSISET := -mips2 -32
ifeq ($(VERSION),eu)
OPT_FLAGS := -O2
else
+ifeq ($(VERSION),sh)
+ OPT_FLAGS := -O2
+else
OPT_FLAGS := -g
endif
+endif
# File dependencies and variables for specific files
include Makefile.split
@@ -163,11 +178,20 @@ GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c))
ULTRA_S_FILES := $(foreach dir,$(ULTRA_ASM_DIRS),$(wildcard $(dir)/*.s))
GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c
+ifeq ($(VERSION),sh)
+SOUND_BANK_FILES := $(wildcard sound/sound_banks/*.json)
+SOUND_SEQUENCE_FILES := $(wildcard sound/sequences/jp/*.m64) \
+ $(wildcard sound/sequences/*.m64) \
+ $(foreach file,$(wildcard sound/sequences/jp/*.s),$(BUILD_DIR)/$(file:.s=.m64)) \
+ $(foreach file,$(wildcard sound/sequences/*.s),$(BUILD_DIR)/$(file:.s=.m64))
+else
SOUND_BANK_FILES := $(wildcard sound/sound_banks/*.json)
SOUND_SEQUENCE_FILES := $(wildcard sound/sequences/$(VERSION)/*.m64) \
$(wildcard sound/sequences/*.m64) \
$(foreach file,$(wildcard sound/sequences/$(VERSION)/*.s),$(BUILD_DIR)/$(file:.s=.m64)) \
$(foreach file,$(wildcard sound/sequences/*.s),$(BUILD_DIR)/$(file:.s=.m64))
+endif
+
SOUND_SAMPLE_DIRS := $(wildcard sound/samples/*)
SOUND_SAMPLE_AIFFS := $(foreach dir,$(SOUND_SAMPLE_DIRS),$(wildcard $(dir)/*.aiff))
SOUND_SAMPLE_TABLES := $(foreach file,$(SOUND_SAMPLE_AIFFS),$(BUILD_DIR)/$(file:.aiff=.table))
@@ -233,7 +257,7 @@ endif
INCLUDE_CFLAGS := -I include -I $(BUILD_DIR) -I $(BUILD_DIR)/include -I src -I .
# Check code syntax with host compiler
-CC_CHECK := gcc -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
+CC_CHECK := gcc -fsyntax-only -fsigned-char $(CC_CFLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) -std=gnu90 -Wall -Wextra -Wno-format-security -Wno-main -DNON_MATCHING -DAVOID_UB $(VERSION_CFLAGS) $(GRUCODE_CFLAGS)
ASFLAGS := -march=vr4300 -mabi=32 -I include -I $(BUILD_DIR) $(VERSION_ASFLAGS) $(GRUCODE_ASFLAGS)
CFLAGS = -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -Xfullwarn -signed $(OPT_FLAGS) $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(MIPSISET) $(GRUCODE_CFLAGS)
@@ -250,6 +274,9 @@ else
CC_CHECK += -m32
endif
+# Prevent a crash with -sopt
+export LANG := C
+
####################### Other Tools #########################
# N64 tools
@@ -325,11 +352,17 @@ $(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/de/define_courses.inc.c
$(BUILD_DIR)/levels/menu/leveldata.o: $(BUILD_DIR)/text/fr/define_courses.inc.c
else
+ifeq ($(VERSION),sh)
+TEXT_DIRS := text/jp
+$(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/jp/define_text.inc.c
+
+else
TEXT_DIRS := text/$(VERSION)
# non-EU encoded text inserted into segment 0x02
$(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/$(VERSION)/define_text.inc.c
endif
+endif
$(BUILD_DIR)/text/%/define_courses.inc.c: text/define_courses.inc.c text/%/courses.h
$(CPP) $(VERSION_CFLAGS) $< -o $@ -I text/$*/
@@ -422,8 +455,13 @@ $(SOUND_BIN_DIR)/sound_data.ctl: sound/sound_banks/ $(SOUND_BANK_FILES) $(SOUND_
$(SOUND_BIN_DIR)/sound_data.tbl: $(SOUND_BIN_DIR)/sound_data.ctl
@true
+ifeq ($(VERSION),sh)
+$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/jp/ $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH)
+ $(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH))
+else
$(SOUND_BIN_DIR)/sequences.bin: $(SOUND_BANK_FILES) sound/sequences.json sound/sequences/ sound/sequences/$(VERSION)/ $(SOUND_SEQUENCE_FILES) $(ENDIAN_BITWIDTH)
$(PYTHON) tools/assemble_sound.py --sequences $@ $(SOUND_BIN_DIR)/bank_sets sound/sound_banks/ sound/sequences.json $(SOUND_SEQUENCE_FILES) $(VERSION_CFLAGS) $$(cat $(ENDIAN_BITWIDTH))
+endif
$(SOUND_BIN_DIR)/bank_sets: $(SOUND_BIN_DIR)/sequences.bin
@true
@@ -477,6 +515,17 @@ $(BUILD_DIR)/lib/src/sprintf.o: OPT_FLAGS := -O3
$(BUILD_DIR)/src/audio/%.o: OPT_FLAGS := -O2
$(BUILD_DIR)/src/audio/load.o: OPT_FLAGS := -O2
$(BUILD_DIR)/src/audio/external.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0
+else
+
+# The source-to-source optimizer copt is enabled for audio. This makes it use
+# acpp, which needs -Wp,-+ to handle C++-style comments.
+$(BUILD_DIR)/src/audio/effects.o: OPT_FLAGS := -O2 -Wo,-loopunroll,0 -sopt,-inline=sequence_channel_process_sound,-scalaroptimize=1 -Wp,-+
+
+# Add a target for build/eu/src/audio/*.copt to make it easier to see debug
+$(BUILD_DIR)/src/audio/%.acpp: src/audio/%.c
+ $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/acpp $(TARGET_CFLAGS) $(INCLUDE_CFLAGS) $(VERSION_CFLAGS) $(GRUCODE_CFLAGS) -D__sgi -+ $< > $@
+$(BUILD_DIR)/src/audio/%.copt: $(BUILD_DIR)/src/audio/%.acpp
+ $(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/lib/copt -signed -I=$< -CMP=$@ -cp=i -scalaroptimize=1
endif
ifeq ($(NON_MATCHING),0)
diff --git a/Makefile.split b/Makefile.split
@@ -63,7 +63,7 @@ MOLE_DIRS := monty_mole_hole monty_mole smoke ukiki fwoosh
LAKITU_DIRS := lakitu_cameraman toad mips boo_castle
PEACH_DIRS := bird peach yoshi
BOWSER_DIRS := bowser_flame impact_ring yellow_sphere bowser bomb impact_smoke
-MARIO_DIRS := mario bubble walk_smoke burn_smoke stomp_smoke water_waves sparkle water_splash white_particle_small sparkle_animation
+MARIO_DIRS := mario bubble walk_smoke burn_smoke stomp_smoke water_wave sparkle water_splash white_particle_small sparkle_animation
# Actor Files
AMP_CHUCKYA_FILES := $(foreach dir,$(addprefix $(ACTOR_DIR)/,$(AMP_DIRS)),$(patsubst %.png,%.inc.c,$(wildcard $(dir)/*.png)))
diff --git a/README.md b/README.md
@@ -1,14 +1,15 @@
# Super Mario 64
-This repo contains a full decompilation of Super Mario 64 (J) and (U).
+This repo contains a full decompilation of Super Mario 64 (J), (U), and (E).
The source and data have been decompiled but complete naming and documentation
-all of the code and data is still a work in progress. Decompiling the (E) ROM
+all of the code and data is still a work in progress. Decompiling the Shindou ROM
is also an ongoing effort.
It builds the following ROMs:
* sm64.jp.z64 `sha1: 8a20a5c83d6ceb0f0506cfc9fa20d8f438cafe51`
* sm64.us.z64 `sha1: 9bef1128717f958171a4afac3ed78ee2bb4e86ce`
+* sm64.eu.z64 `sha1: 4ac5721683d0e0b6bbb561b58a71740845dceea9`
This repo does not include all assets necessary for compiling the ROMs.
A prior copy of the game is required to extract the required assets.
diff --git a/actors/boo/geo.inc.c b/actors/boo/geo.inc.c
@@ -4,7 +4,7 @@ const GeoLayout boo_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 26214),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, boo_seg5_dl_0500C1B0),
diff --git a/actors/boo_castle/geo.inc.c b/actors/boo_castle/geo.inc.c
@@ -4,7 +4,7 @@ const GeoLayout boo_castle_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 26214),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, boo_castle_seg6_dl_06017CE0),
diff --git a/actors/bowser/geo.inc.c b/actors/bowser/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout bowser_geo_0000D8[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, bowser_seg6_dl_06043698),
- GEO_ASM(0, Geo18_802B798C),
+ GEO_ASM(0, geo_update_body_rot_from_parent),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 118, 67, 105, NULL),
@@ -135,7 +135,7 @@ const GeoLayout bowser_geo_000424[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, NULL),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, bowser_seg6_dl_06043698),
- GEO_ASM(0, Geo18_802B798C),
+ GEO_ASM(0, geo_update_body_rot_from_parent),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 118, 67, 105, NULL),
@@ -251,7 +251,7 @@ const GeoLayout bowser_geo_000770[] = {
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, NULL),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, bowser_seg6_dl_06043698),
- GEO_ASM(0, Geo18_802B798C),
+ GEO_ASM(0, geo_update_body_rot_from_parent),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 118, 67, 105, NULL),
@@ -350,7 +350,7 @@ const GeoLayout bowser_shadow_geo[] = {
const GeoLayout bowser_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
#ifdef VERSION_JP
GEO_SWITCH_CASE(2, geo_switch_anim_state),
#endif
@@ -360,20 +360,20 @@ const GeoLayout bowser_geo[] = {
GEO_OPEN_NODE(),
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_geo_0000D8),
GEO_CLOSE_NODE(),
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_geo_000424),
GEO_CLOSE_NODE(),
#ifndef VERSION_JP
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_shadow_geo),
GEO_CLOSE_NODE(),
#endif
@@ -387,7 +387,7 @@ const GeoLayout bowser_geo[] = {
const GeoLayout bowser2_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
#ifdef VERSION_JP
GEO_SWITCH_CASE(2, geo_switch_anim_state),
@@ -399,20 +399,20 @@ const GeoLayout bowser2_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_geo_0000D8),
GEO_CLOSE_NODE(),
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_geo_000770),
GEO_CLOSE_NODE(),
#ifndef VERSION_JP
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B7D44),
+ GEO_ASM(0, geo_bits_bowser_coloring),
GEO_BRANCH(1, bowser_shadow_geo),
GEO_CLOSE_NODE(),
#endif
diff --git a/actors/bowser_key/geo.inc.c b/actors/bowser_key/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout bowser_key_cutscene_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802BA2B0),
+ GEO_ASM(0, geo_scale_bowser_key),
GEO_SCALE(0x00, 65536),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, bowser_key_dl),
diff --git a/actors/chuckya/geo.inc.c b/actors/chuckya/geo.inc.c
@@ -99,7 +99,7 @@ const GeoLayout chuckya_geo[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, chuckya_seg8_dl_0800A510),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
- GEO_ASM(0, Geo18_802A719C),
+ GEO_ASM(0, geo_update_held_mario_pos),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/group0.c b/actors/group0.c
@@ -16,7 +16,7 @@
#include "stomp_smoke/model.inc.c"
-#include "water_waves/model.inc.c"
+#include "water_wave/model.inc.c"
#include "sparkle/model.inc.c"
diff --git a/actors/group0.h b/actors/group0.h
@@ -283,7 +283,7 @@ extern const Gfx sparkles_animation_seg4_dl_04035348[];
extern const Gfx sparkles_animation_seg4_dl_04035360[];
// stomp_smoke
-extern const GeoLayout spot_on_ground_geo[];
+extern const GeoLayout small_water_splash_geo[];
extern const GeoLayout mario_TODO_geo_0000E0[];
extern const Gfx stomp_smoke_seg4_dl_04025148[];
extern const Gfx stomp_smoke_seg4_dl_04025190[];
@@ -326,15 +326,15 @@ extern const Gfx water_splash_seg4_dl_040326D0[];
extern const Gfx water_splash_seg4_dl_040326E8[];
// water_waves
-extern const GeoLayout water_waves_surface_geo[];
-extern const GeoLayout water_waves_geo[];
-extern const Gfx water_waves_seg4_dl_04027358[];
-extern const Gfx water_waves_seg4_dl_040273A0[];
-extern const Gfx water_waves_seg4_dl_040273D8[];
-extern const Gfx water_waves_seg4_dl_040273F0[];
-extern const Gfx water_waves_seg4_dl_04027408[];
-extern const Gfx water_waves_seg4_dl_04027420[];
-extern const Gfx water_waves_seg4_dl_04027438[];
+extern const GeoLayout idle_water_wave_geo[];
+extern const GeoLayout wave_trail_geo[];
+extern const Gfx water_wave_seg4_dl_04027358[];
+extern const Gfx water_wave_seg4_dl_040273A0[];
+extern const Gfx water_wave_seg4_dl_040273D8[];
+extern const Gfx water_wave_seg4_dl_040273F0[];
+extern const Gfx water_wave_seg4_dl_04027408[];
+extern const Gfx water_wave_seg4_dl_04027420[];
+extern const Gfx water_wave_seg4_dl_04027438[];
// white_particle_small
extern const Gfx white_particle_small_dl_begin[];
diff --git a/actors/group0_geo.c b/actors/group0_geo.c
@@ -11,7 +11,7 @@
#include "walk_smoke/geo.inc.c"
#include "burn_smoke/geo.inc.c"
#include "stomp_smoke/geo.inc.c"
-#include "water_waves/geo.inc.c"
+#include "water_wave/geo.inc.c"
#include "sparkle/geo.inc.c"
#include "water_splash/geo.inc.c"
#include "sparkle_animation/geo.inc.c"
diff --git a/actors/impact_ring/geo.inc.c b/actors/impact_ring/geo.inc.c
@@ -2,7 +2,7 @@
const GeoLayout invisible_bowser_accessory_geo[] = {
GEO_CULLING_RADIUS(10000),
GEO_OPEN_NODE(),
- GEO_ASM(20, Geo18_8029D924),
+ GEO_ASM(20, geo_update_layer_transparency),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT_DECAL, impact_ring_seg6_dl_0601EAC0),
GEO_CLOSE_NODE(),
GEO_END(),
diff --git a/actors/impact_smoke/geo.inc.c b/actors/impact_smoke/geo.inc.c
@@ -2,7 +2,7 @@
const GeoLayout bowser_impact_smoke_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_SWITCH_CASE(5, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, impact_smoke_seg6_dl_06062B38),
diff --git a/actors/king_bobomb/geo.inc.c b/actors/king_bobomb/geo.inc.c
@@ -80,7 +80,7 @@ const GeoLayout king_bobomb_geo[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, king_bobomb_seg5_dl_0500A6C0),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
- GEO_ASM(0, Geo18_802A719C),
+ GEO_ASM(0, geo_update_held_mario_pos),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/klepto/geo.inc.c b/actors/klepto/geo.inc.c
@@ -31,7 +31,7 @@ const GeoLayout klepto_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802A45E4),
+ GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, mario_cap_seg3_dl_03022F48),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
@@ -39,9 +39,9 @@ const GeoLayout klepto_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802A45E4),
+ GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, star_seg3_dl_0302B870),
- GEO_ASM(0, Geo18_802A45E4),
+ GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_ALPHA, 0, 100, 0, 180, 270, 0, star_seg3_dl_0302BA18),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
@@ -49,7 +49,7 @@ const GeoLayout klepto_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802A45E4),
+ GEO_ASM(0, geo_offset_klepto_held_object),
GEO_TRANSLATE_ROTATE_WITH_DL(LAYER_OPAQUE, 0, 100, 0, 180, 270, 0, transparent_star_seg3_dl_0302C620),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/lakitu_enemy/geo.inc.c b/actors/lakitu_enemy/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout enemy_lakitu_geo[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 87, 18, -72, NULL),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, lakitu_enemy_seg5_dl_050134A8),
- GEO_ASM(0, Geo18_8029D890),
+ GEO_ASM(0, geo_update_projectile_pos_from_parent),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/mario/geo.inc.c b/actors/mario/geo.inc.c
@@ -105,7 +105,7 @@ const GeoLayout mario_geo_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -222,7 +222,7 @@ const GeoLayout mario_geo_medium_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_medium_poly_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -389,7 +389,7 @@ const GeoLayout mario_geo_low_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_low_poly_butt), // starts sharing solid color with mario_torso (blue)
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -560,7 +560,7 @@ const GeoLayout mario_vanish_geo_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -677,7 +677,7 @@ const GeoLayout mario_vanish_geo_medium_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_medium_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -844,7 +844,7 @@ const GeoLayout mario_vanish_geo_low_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_low_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -995,7 +995,7 @@ const GeoLayout mario_metal_geo_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_butt), // starts sharing metal texture with the dls below
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -1112,7 +1112,7 @@ const GeoLayout mario_metal_geo_medium_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_medium_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -1259,7 +1259,7 @@ const GeoLayout mario_metal_geo_low_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, mario_metal_low_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -1410,7 +1410,7 @@ const GeoLayout mario_metal_vanish_geo_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -1527,7 +1527,7 @@ const GeoLayout mario_metal_vanish_geo_medium_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_medium_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
@@ -1677,7 +1677,7 @@ const GeoLayout mario_metal_vanish_geo_low_poly_body[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, mario_metal_low_poly_butt),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B1BB0),
+ GEO_ASM(0, geo_move_mario_part_from_parent),
GEO_ASM(0, geo_mario_tilt_torso),
GEO_ROTATION_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
diff --git a/actors/mario_cap/geo.inc.c b/actors/mario_cap/geo.inc.c
@@ -4,7 +4,7 @@ const GeoLayout marios_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_cap_seg3_dl_03022F48),
@@ -21,7 +21,7 @@ const GeoLayout marios_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, mario_cap_seg3_dl_03022FF8),
@@ -38,7 +38,7 @@ const GeoLayout marios_wing_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_NODE_START(),
@@ -62,7 +62,7 @@ const GeoLayout marios_winged_metal_cap_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_NODE_START(),
diff --git a/actors/mist/geo.inc.c b/actors/mist/geo.inc.c
@@ -2,7 +2,7 @@
const GeoLayout mist_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mist_seg3_dl_03000880),
GEO_CLOSE_NODE(),
GEO_END(),
@@ -12,7 +12,7 @@ const GeoLayout mist_geo[] = {
const GeoLayout white_puff_geo[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, mist_seg3_dl_03000920),
GEO_CLOSE_NODE(),
GEO_END(),
diff --git a/actors/moneybag/geo.inc.c b/actors/moneybag/geo.inc.c
@@ -44,7 +44,7 @@ const GeoLayout moneybag_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_BRANCH(1, moneybag_geo_000000),
diff --git a/actors/monty_mole/geo.inc.c b/actors/monty_mole/geo.inc.c
@@ -30,7 +30,7 @@ const GeoLayout monty_mole_geo[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, monty_mole_seg5_dl_050039D0),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 80, 0, 0, monty_mole_seg5_dl_05003F50),
- GEO_ASM(0, Geo18_8029D890),
+ GEO_ASM(0, geo_update_projectile_pos_from_parent),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/peach/geo.inc.c b/actors/peach/geo.inc.c
@@ -140,7 +140,7 @@ const GeoLayout peach_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_BRANCH(1, peach_geo_000098),
diff --git a/actors/snowman/geo.inc.c b/actors/snowman/geo.inc.c
@@ -37,7 +37,7 @@ const GeoLayout mr_blizzard_hidden_geo[] = {
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, snowman_seg5_dl_0500C500),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 68, 0, 0, snowman_seg5_dl_0500CAA8),
- GEO_ASM(0, Geo18_8029D890),
+ GEO_ASM(0, geo_update_projectile_pos_from_parent),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 356, 0, 0, NULL),
diff --git a/actors/snufit/geo.inc.c b/actors/snufit/geo.inc.c
@@ -4,7 +4,7 @@ const GeoLayout snufit_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8030D93C),
+ GEO_ASM(0, geo_snufit_move_mask),
GEO_TRANSLATE_NODE(0x00, 0, 0, 0),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, snufit_seg6_dl_06009748),
@@ -14,7 +14,7 @@ const GeoLayout snufit_geo[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, snufit_seg6_dl_06009B68),
GEO_BILLBOARD(),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8030D9AC),
+ GEO_ASM(0, geo_snufit_scale_body),
GEO_SCALE(0x00, 0),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, snufit_seg6_dl_06009A10),
diff --git a/actors/stomp_smoke/geo.inc.c b/actors/stomp_smoke/geo.inc.c
@@ -1,7 +1,8 @@
// 0x1700009C
-const GeoLayout spot_on_ground_geo[] = {
+const GeoLayout small_water_splash_geo[] = {
GEO_SWITCH_CASE(6, geo_switch_anim_state),
GEO_OPEN_NODE(),
+ // TODO: Rename these display lists
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, stomp_smoke_seg4_dl_040251F8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, stomp_smoke_seg4_dl_04025210),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, stomp_smoke_seg4_dl_04025228),
diff --git a/actors/sushi/geo.inc.c b/actors/sushi/geo.inc.c
@@ -8,7 +8,7 @@ const GeoLayout sushi_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, sushi_seg5_dl_0500A768),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_802B798C),
+ GEO_ASM(0, geo_update_body_rot_from_parent),
GEO_CLOSE_NODE(),
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 201, 0, 0, sushi_seg5_dl_05009DD0),
diff --git a/actors/toad/geo.inc.c b/actors/toad/geo.inc.c
@@ -126,7 +126,7 @@ const GeoLayout toad_geo[] = {
GEO_OPEN_NODE(),
GEO_SCALE(0x00, 16384),
GEO_OPEN_NODE(),
- GEO_ASM(10, Geo18_8029D924),
+ GEO_ASM(10, geo_update_layer_transparency),
GEO_SWITCH_CASE(2, geo_switch_anim_state),
GEO_OPEN_NODE(),
GEO_BRANCH(1, toad_geo_000114),
diff --git a/actors/water_ring/geo.inc.c b/actors/water_ring/geo.inc.c
@@ -4,7 +4,7 @@ const GeoLayout water_ring_geo[] = {
GEO_OPEN_NODE(),
GEO_ANIMATED_PART(LAYER_OPAQUE, 0, 0, 0, NULL),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_ANIMATED_PART(LAYER_TRANSPARENT, 0, 0, 0, water_ring_seg6_dl_06013AC0),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/actors/water_wave/geo.inc.c b/actors/water_wave/geo.inc.c
@@ -0,0 +1,29 @@
+// 0x17000124
+const GeoLayout idle_water_wave_geo[] = {
+ GEO_SWITCH_CASE(6, geo_switch_anim_state),
+ GEO_OPEN_NODE(),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_040273F0),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027408),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027420),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027420),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027408),
+ GEO_CLOSE_NODE(),
+ GEO_END(),
+};
+
+// 0x17000168
+const GeoLayout wave_trail_geo[] = {
+ GEO_SWITCH_CASE(8, geo_switch_anim_state),
+ GEO_OPEN_NODE(),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_040273F0),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027408),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027420),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_wave_seg4_dl_04027438),
+ GEO_CLOSE_NODE(),
+ GEO_END(),
+};
diff --git a/actors/water_wave/model.inc.c b/actors/water_wave/model.inc.c
@@ -0,0 +1,87 @@
+// Water Waves
+
+// 0x04025318
+static const Vtx water_wave_seg4_vertex_04025318[] = {
+ {{{ -64, 0, 64}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xc8}}},
+ {{{ 64, 0, 64}, 0, { 992, 0}, {0xff, 0xff, 0xff, 0xc8}}},
+ {{{ 64, 0, -64}, 0, { 992, 992}, {0xff, 0xff, 0xff, 0xc8}}},
+ {{{ -64, 0, -64}, 0, { 0, 992}, {0xff, 0xff, 0xff, 0xc8}}},
+};
+
+// 0x04025358
+ALIGNED8 static const u8 water_wave_seg4_texture_04025358[] = {
+#include "actors/water_wave/water_wave_0.ia16.inc.c"
+};
+
+// 0x04025B58
+ALIGNED8 static const u8 water_wave_seg4_texture_04025B58[] = {
+#include "actors/water_wave/water_wave_1.ia16.inc.c"
+};
+
+// 0x04026358
+ALIGNED8 static const u8 water_wave_seg4_texture_04026358[] = {
+#include "actors/water_wave/water_wave_2.ia16.inc.c"
+};
+
+// 0x04026B58
+ALIGNED8 static const u8 water_wave_seg4_texture_04026B58[] = {
+#include "actors/water_wave/water_wave_3.ia16.inc.c"
+};
+
+// 0x04027358 - 0x040273A0
+const Gfx water_wave_seg4_dl_04027358[] = {
+ gsSPClearGeometryMode(G_LIGHTING),
+ gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
+ gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
+ gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
+ gsDPLoadSync(),
+ gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
+ gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
+ gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
+ gsSPEndDisplayList(),
+};
+
+// 0x040273A0 - 0x040273D8
+const Gfx water_wave_seg4_dl_040273A0[] = {
+ gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
+ gsDPPipeSync(),
+ gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF),
+ gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
+ gsSPSetGeometryMode(G_LIGHTING),
+ gsSPEndDisplayList(),
+};
+
+// 0x040273D8 - 0x040273F0
+const Gfx water_wave_seg4_dl_040273D8[] = {
+ gsSPDisplayList(water_wave_seg4_dl_04027358),
+ gsSPVertex(water_wave_seg4_vertex_04025318, 4, 0),
+ gsSPBranchList(water_wave_seg4_dl_040273A0),
+};
+
+// 0x040273F0 - 0x04027408
+const Gfx water_wave_seg4_dl_040273F0[] = {
+ gsDPPipeSync(),
+ gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_wave_seg4_texture_04025358),
+ gsSPBranchList(water_wave_seg4_dl_040273D8),
+};
+
+// 0x04027408 - 0x04027420
+const Gfx water_wave_seg4_dl_04027408[] = {
+ gsDPPipeSync(),
+ gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_wave_seg4_texture_04025B58),
+ gsSPBranchList(water_wave_seg4_dl_040273D8),
+};
+
+// 0x04027420 - 0x04027438
+const Gfx water_wave_seg4_dl_04027420[] = {
+ gsDPPipeSync(),
+ gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_wave_seg4_texture_04026358),
+ gsSPBranchList(water_wave_seg4_dl_040273D8),
+};
+
+// 0x04027438 - 0x04027450
+const Gfx water_wave_seg4_dl_04027438[] = {
+ gsDPPipeSync(),
+ gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_wave_seg4_texture_04026B58),
+ gsSPBranchList(water_wave_seg4_dl_040273D8),
+};
diff --git a/actors/water_waves/geo.inc.c b/actors/water_waves/geo.inc.c
@@ -1,29 +0,0 @@
-// 0x17000124
-const GeoLayout water_waves_surface_geo[] = {
- GEO_SWITCH_CASE(6, geo_switch_anim_state),
- GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_040273F0),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027408),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027420),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027420),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027408),
- GEO_CLOSE_NODE(),
- GEO_END(),
-};
-
-// 0x17000168
-const GeoLayout water_waves_geo[] = {
- GEO_SWITCH_CASE(8, geo_switch_anim_state),
- GEO_OPEN_NODE(),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_040273F0),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027408),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027420),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_DISPLAY_LIST(LAYER_TRANSPARENT, water_waves_seg4_dl_04027438),
- GEO_CLOSE_NODE(),
- GEO_END(),
-};
diff --git a/actors/water_waves/model.inc.c b/actors/water_waves/model.inc.c
@@ -1,87 +0,0 @@
-// Water Waves
-
-// 0x04025318
-static const Vtx water_waves_seg4_vertex_04025318[] = {
- {{{ -64, 0, 64}, 0, { 0, 0}, {0xff, 0xff, 0xff, 0xc8}}},
- {{{ 64, 0, 64}, 0, { 992, 0}, {0xff, 0xff, 0xff, 0xc8}}},
- {{{ 64, 0, -64}, 0, { 992, 992}, {0xff, 0xff, 0xff, 0xc8}}},
- {{{ -64, 0, -64}, 0, { 0, 992}, {0xff, 0xff, 0xff, 0xc8}}},
-};
-
-// 0x04025358
-ALIGNED8 static const u8 water_waves_seg4_texture_04025358[] = {
-#include "actors/water_waves/water_waves_0.ia16.inc.c"
-};
-
-// 0x04025B58
-ALIGNED8 static const u8 water_waves_seg4_texture_04025B58[] = {
-#include "actors/water_waves/water_waves_1.ia16.inc.c"
-};
-
-// 0x04026358
-ALIGNED8 static const u8 water_waves_seg4_texture_04026358[] = {
-#include "actors/water_waves/water_waves_2.ia16.inc.c"
-};
-
-// 0x04026B58
-ALIGNED8 static const u8 water_waves_seg4_texture_04026B58[] = {
-#include "actors/water_waves/water_waves_3.ia16.inc.c"
-};
-
-// 0x04027358 - 0x040273A0
-const Gfx water_waves_seg4_dl_04027358[] = {
- gsSPClearGeometryMode(G_LIGHTING),
- gsDPSetCombineMode(G_CC_MODULATEIA, G_CC_MODULATEIA),
- gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
- gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
- gsDPLoadSync(),
- gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)),
- gsDPSetTile(G_IM_FMT_IA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD),
- gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC),
- gsSPEndDisplayList(),
-};
-
-// 0x040273A0 - 0x040273D8
-const Gfx water_waves_seg4_dl_040273A0[] = {
- gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0),
- gsDPPipeSync(),
- gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF),
- gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
- gsSPSetGeometryMode(G_LIGHTING),
- gsSPEndDisplayList(),
-};
-
-// 0x040273D8 - 0x040273F0
-const Gfx water_waves_seg4_dl_040273D8[] = {
- gsSPDisplayList(water_waves_seg4_dl_04027358),
- gsSPVertex(water_waves_seg4_vertex_04025318, 4, 0),
- gsSPBranchList(water_waves_seg4_dl_040273A0),
-};
-
-// 0x040273F0 - 0x04027408
-const Gfx water_waves_seg4_dl_040273F0[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_waves_seg4_texture_04025358),
- gsSPBranchList(water_waves_seg4_dl_040273D8),
-};
-
-// 0x04027408 - 0x04027420
-const Gfx water_waves_seg4_dl_04027408[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_waves_seg4_texture_04025B58),
- gsSPBranchList(water_waves_seg4_dl_040273D8),
-};
-
-// 0x04027420 - 0x04027438
-const Gfx water_waves_seg4_dl_04027420[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_waves_seg4_texture_04026358),
- gsSPBranchList(water_waves_seg4_dl_040273D8),
-};
-
-// 0x04027438 - 0x04027450
-const Gfx water_waves_seg4_dl_04027438[] = {
- gsDPPipeSync(),
- gsDPSetTextureImage(G_IM_FMT_IA, G_IM_SIZ_16b, 1, water_waves_seg4_texture_04026B58),
- gsSPBranchList(water_waves_seg4_dl_040273D8),
-};
diff --git a/asm/entry.s b/asm/entry.s
@@ -8,7 +8,7 @@
.section .text, "ax"
-glabel EntryPoint
+glabel entry_point
lui $t0, %hi(_mainSegmentNoloadStart) # $t0, 0x8034
lui $t1, %lo(_mainSegmentNoloadSizeHi) # lui $t1, 2
addiu $t0, %lo(_mainSegmentNoloadStart) # addiu $t0, $t0, -0x6df0
@@ -19,9 +19,9 @@ glabel EntryPoint
sw $zero, 4($t0)
bnez $t1, .L80246010
addi $t0, $t0, 8
- lui $t2, %hi(Main) # $t2, 0x8024
+ lui $t2, %hi(main_func) # $t2, 0x8024
lui $sp, %hi(gIdleThreadStack) # $sp, 0x8020
- addiu $t2, %lo(Main) # addiu $t2, $t2, 0x6dc4
+ addiu $t2, %lo(main_func) # addiu $t2, $t2, 0x6dc4
jr $t2
addiu $sp, %lo(gIdleThreadStack) # addiu $sp, $sp, 0xa00
nop
diff --git a/asm/non_matchings/alloc_bank_or_seq.s b/asm/non_matchings/alloc_bank_or_seq.s
@@ -1,303 +0,0 @@
-glabel alloc_bank_or_seq
-/* 0D13DC 803163DC 27BDFF88 */ addiu $sp, $sp, -0x78
-/* 0D13E0 803163E0 AFB00020 */ sw $s0, 0x20($sp)
-/* 0D13E4 803163E4 00808025 */ move $s0, $a0
-/* 0D13E8 803163E8 AFBF0024 */ sw $ra, 0x24($sp)
-/* 0D13EC 803163EC AFA5007C */ sw $a1, 0x7c($sp)
-/* 0D13F0 803163F0 14E000CC */ bnez $a3, .L80316724
-/* 0D13F4 803163F4 AFA60080 */ sw $a2, 0x80($sp)
-/* 0D13F8 803163F8 3C0E8022 */ lui $t6, %hi(gSeqLoadedPool) # $t6, 0x8022
-/* 0D13FC 803163FC 25CE1328 */ addiu $t6, %lo(gSeqLoadedPool) # addiu $t6, $t6, 0x1328
-/* 0D1400 80316400 148E0006 */ bne $a0, $t6, .L8031641C
-/* 0D1404 80316404 26030194 */ addiu $v1, $s0, 0x194
-/* 0D1408 80316408 3C0A8022 */ lui $t2, %hi(gSeqLoadStatus) # $t2, 0x8022
-/* 0D140C 8031640C 254A1910 */ addiu $t2, %lo(gSeqLoadStatus) # addiu $t2, $t2, 0x1910
-/* 0D1410 80316410 AFAA005C */ sw $t2, 0x5c($sp)
-/* 0D1414 80316414 10000009 */ b .L8031643C
-/* 0D1418 80316418 A3A0005B */ sb $zero, 0x5b($sp)
-.L8031641C:
-/* 0D141C 8031641C 3C0F8022 */ lui $t7, %hi(gBankLoadedPool) # $t7, 0x8022
-/* 0D1420 80316420 25EF14F8 */ addiu $t7, %lo(gBankLoadedPool) # addiu $t7, $t7, 0x14f8
-/* 0D1424 80316424 160F0005 */ bne $s0, $t7, .L8031643C
-/* 0D1428 80316428 3C0A8022 */ lui $t2, %hi(gBankLoadStatus) # $t2, 0x8022
-/* 0D142C 8031642C 254A18D0 */ addiu $t2, %lo(gBankLoadStatus) # addiu $t2, $t2, 0x18d0
-/* 0D1430 80316430 240C0001 */ li $t4, 1
-/* 0D1434 80316434 A3AC005B */ sb $t4, 0x5b($sp)
-/* 0D1438 80316438 AFAA005C */ sw $t2, 0x5c($sp)
-.L8031643C:
-/* 0D143C 8031643C 8C62001C */ lw $v0, 0x1c($v1)
-/* 0D1440 80316440 240BFFFF */ li $t3, -1
-/* 0D1444 80316444 8FAA005C */ lw $t2, 0x5c($sp)
-/* 0D1448 80316448 15620003 */ bne $t3, $v0, .L80316458
-/* 0D144C 8031644C 93AC005B */ lbu $t4, 0x5b($sp)
-/* 0D1450 80316450 10000003 */ b .L80316460
-/* 0D1454 80316454 00003825 */ move $a3, $zero
-.L80316458:
-/* 0D1458 80316458 004AC021 */ addu $t8, $v0, $t2
-/* 0D145C 8031645C 93070000 */ lbu $a3, ($t8)
-.L80316460:
-/* 0D1460 80316460 8C620028 */ lw $v0, 0x28($v1)
-/* 0D1464 80316464 24090003 */ li $t1, 3
-/* 0D1468 80316468 01274026 */ xor $t0, $t1, $a3
-/* 0D146C 8031646C 15620003 */ bne $t3, $v0, .L8031647C
-/* 0D1470 80316470 2D080001 */ sltiu $t0, $t0, 1
-/* 0D1474 80316474 10000003 */ b .L80316484
-/* 0D1478 80316478 00002825 */ move $a1, $zero
-.L8031647C:
-/* 0D147C 8031647C 004AC821 */ addu $t9, $v0, $t2
-/* 0D1480 80316480 93250000 */ lbu $a1, ($t9)
-.L80316484:
-/* 0D1484 80316484 0008202B */ sltu $a0, $zero, $t0
-/* 0D1488 80316488 10800005 */ beqz $a0, .L803164A0
-/* 0D148C 8031648C 00E03025 */ move $a2, $a3
-/* 0D1490 80316490 01252026 */ xor $a0, $t1, $a1
-/* 0D1494 80316494 2C840001 */ sltiu $a0, $a0, 1
-/* 0D1498 80316498 0004682B */ sltu $t5, $zero, $a0
-/* 0D149C 8031649C 01A02025 */ move $a0, $t5
-.L803164A0:
-/* 0D14A0 803164A0 2CCE0001 */ sltiu $t6, $a2, 1
-/* 0D14A4 803164A4 11C00004 */ beqz $t6, .L803164B8
-/* 0D14A8 803164A8 2CAF0001 */ sltiu $t7, $a1, 1
-/* 0D14AC 803164AC AC600000 */ sw $zero, ($v1)
-/* 0D14B0 803164B0 10000020 */ b .L80316534
-/* 0D14B4 803164B4 24080001 */ li $t0, 1
-.L803164B8:
-/* 0D14B8 803164B8 11E00005 */ beqz $t7, .L803164D0
-/* 0D14BC 803164BC 00A01025 */ move $v0, $a1
-/* 0D14C0 803164C0 24180001 */ li $t8, 1
-/* 0D14C4 803164C4 AC780000 */ sw $t8, ($v1)
-/* 0D14C8 803164C8 1000001A */ b .L80316534
-/* 0D14CC 803164CC 24080001 */ li $t0, 1
-.L803164D0:
-/* 0D14D0 803164D0 10800003 */ beqz $a0, .L803164E0
-/* 0D14D4 803164D4 00000000 */ nop
-/* 0D14D8 803164D8 10000016 */ b .L80316534
-/* 0D14DC 803164DC 24080001 */ li $t0, 1
-.L803164E0:
-/* 0D14E0 803164E0 11000004 */ beqz $t0, .L803164F4
-/* 0D14E4 803164E4 00000000 */ nop
-/* 0D14E8 803164E8 AC600000 */ sw $zero, ($v1)
-/* 0D14EC 803164EC 10000011 */ b .L80316534
-/* 0D14F0 803164F0 24080001 */ li $t0, 1
-.L803164F4:
-/* 0D14F4 803164F4 15220005 */ bne $t1, $v0, .L8031650C
-/* 0D14F8 803164F8 24080001 */ li $t0, 1
-/* 0D14FC 803164FC 240D0001 */ li $t5, 1
-/* 0D1500 80316500 AC6D0000 */ sw $t5, ($v1)
-/* 0D1504 80316504 1000000B */ b .L80316534
-/* 0D1508 80316508 24080001 */ li $t0, 1
-.L8031650C:
-/* 0D150C 8031650C 11060003 */ beq $t0, $a2, .L8031651C
-/* 0D1510 80316510 00000000 */ nop
-/* 0D1514 80316514 10000007 */ b .L80316534
-/* 0D1518 80316518 AC600000 */ sw $zero, ($v1)
-.L8031651C:
-/* 0D151C 8031651C 11020003 */ beq $t0, $v0, .L8031652C
-/* 0D1520 80316520 24180001 */ li $t8, 1
-/* 0D1524 80316524 10000003 */ b .L80316534
-/* 0D1528 80316528 AC780000 */ sw $t8, ($v1)
-.L8031652C:
-/* 0D152C 8031652C 100000B2 */ b .L803167F8
-/* 0D1530 80316530 00001025 */ move $v0, $zero
-.L80316534:
-/* 0D1534 80316534 8C790000 */ lw $t9, ($v1)
-/* 0D1538 80316538 2405000C */ li $a1, 12
-/* 0D153C 8031653C 03250019 */ multu $t9, $a1
-/* 0D1540 80316540 00006812 */ mflo $t5
-/* 0D1544 80316544 006D7021 */ addu $t6, $v1, $t5
-/* 0D1548 80316548 8DC2001C */ lw $v0, 0x1c($t6)
-/* 0D154C 8031654C 11620010 */ beq $t3, $v0, .L80316590
-/* 0D1550 80316550 01427821 */ addu $t7, $t2, $v0
-/* 0D1554 80316554 150C000E */ bne $t0, $t4, .L80316590
-/* 0D1558 80316558 A1E00000 */ sb $zero, ($t7)
-/* 0D155C 8031655C 8C780000 */ lw $t8, ($v1)
-/* 0D1560 80316560 03050019 */ multu $t8, $a1
-/* 0D1564 80316564 0000C812 */ mflo $t9
-/* 0D1568 80316568 00796821 */ addu $t5, $v1, $t9
-/* 0D156C 8031656C 8DA4001C */ lw $a0, 0x1c($t5)
-/* 0D1570 80316570 A3AC005B */ sb $t4, 0x5b($sp)
-/* 0D1574 80316574 AFAA005C */ sw $t2, 0x5c($sp)
-/* 0D1578 80316578 0C0C57A9 */ jal discard_bank
-/* 0D157C 8031657C AFA30030 */ sw $v1, 0x30($sp)
-/* 0D1580 80316580 8FA30030 */ lw $v1, 0x30($sp)
-/* 0D1584 80316584 24080001 */ li $t0, 1
-/* 0D1588 80316588 8FAA005C */ lw $t2, 0x5c($sp)
-/* 0D158C 8031658C 93AC005B */ lbu $t4, 0x5b($sp)
-.L80316590:
-/* 0D1590 80316590 8C640000 */ lw $a0, ($v1)
-/* 0D1594 80316594 24010001 */ li $at, 1
-/* 0D1598 80316598 26050198 */ addiu $a1, $s0, 0x198
-/* 0D159C 8031659C 50800006 */ beql $a0, $zero, .L803165B8
-/* 0D15A0 803165A0 8CAE0000 */ lw $t6, ($a1)
-/* 0D15A4 803165A4 10810032 */ beq $a0, $at, .L80316670
-/* 0D15A8 803165A8 26050198 */ addiu $a1, $s0, 0x198
-/* 0D15AC 803165AC 10000092 */ b .L803167F8
-/* 0D15B0 803165B0 00001025 */ move $v0, $zero
-/* 0D15B4 803165B4 8CAE0000 */ lw $t6, ($a1)
-.L803165B8:
-/* 0D15B8 803165B8 AC6E0014 */ sw $t6, 0x14($v1)
-/* 0D15BC 803165BC 8FAF0088 */ lw $t7, 0x88($sp)
-/* 0D15C0 803165C0 AC6F001C */ sw $t7, 0x1c($v1)
-/* 0D15C4 803165C4 8FB80080 */ lw $t8, 0x80($sp)
-/* 0D15C8 803165C8 AC780018 */ sw $t8, 0x18($v1)
-/* 0D15CC 803165CC 8FAD0080 */ lw $t5, 0x80($sp)
-/* 0D15D0 803165D0 8CB90000 */ lw $t9, ($a1)
-/* 0D15D4 803165D4 032D1021 */ addu $v0, $t9, $t5
-/* 0D15D8 803165D8 ACA20004 */ sw $v0, 4($a1)
-/* 0D15DC 803165DC 8C6E0020 */ lw $t6, 0x20($v1)
-/* 0D15E0 803165E0 01C2082B */ sltu $at, $t6, $v0
-/* 0D15E4 803165E4 5020001D */ beql $at, $zero, .L8031665C
-/* 0D15E8 803165E8 8C640014 */ lw $a0, 0x14($v1)
-/* 0D15EC 803165EC 8C6F0028 */ lw $t7, 0x28($v1)
-/* 0D15F0 803165F0 014FC021 */ addu $t8, $t2, $t7
-/* 0D15F4 803165F4 11800005 */ beqz $t4, .L8031660C
-/* 0D15F8 803165F8 A3000000 */ sb $zero, ($t8)
-/* 0D15FC 803165FC 5188000B */ beql $t4, $t0, .L8031662C
-/* 0D1600 80316600 8C640028 */ lw $a0, 0x28($v1)
-/* 0D1604 80316604 1000000F */ b .L80316644
-/* 0D1608 80316608 2419FFFF */ li $t9, -1
-.L8031660C:
-/* 0D160C 8031660C 8C640028 */ lw $a0, 0x28($v1)
-/* 0D1610 80316610 AFA5002C */ sw $a1, 0x2c($sp)
-/* 0D1614 80316614 0C0C57E5 */ jal discard_sequence
-/* 0D1618 80316618 AFA30030 */ sw $v1, 0x30($sp)
-/* 0D161C 8031661C 8FA30030 */ lw $v1, 0x30($sp)
-/* 0D1620 80316620 10000007 */ b .L80316640
-/* 0D1624 80316624 8FA5002C */ lw $a1, 0x2c($sp)
-/* 0D1628 80316628 8C640028 */ lw $a0, 0x28($v1)
-.L8031662C:
-/* 0D162C 8031662C AFA5002C */ sw $a1, 0x2c($sp)
-/* 0D1630 80316630 0C0C57A9 */ jal discard_bank
-/* 0D1634 80316634 AFA30030 */ sw $v1, 0x30($sp)
-/* 0D1638 80316638 8FA30030 */ lw $v1, 0x30($sp)
-/* 0D163C 8031663C 8FA5002C */ lw $a1, 0x2c($sp)
-.L80316640:
-/* 0D1640 80316640 2419FFFF */ li $t9, -1
-.L80316644:
-/* 0D1644 80316644 AC790028 */ sw $t9, 0x28($v1)
-/* 0D1648 80316648 8CAE0000 */ lw $t6, ($a1)
-/* 0D164C 8031664C 8CAD0008 */ lw $t5, 8($a1)
-/* 0D1650 80316650 01AE7821 */ addu $t7, $t5, $t6
-/* 0D1654 80316654 AC6F0020 */ sw $t7, 0x20($v1)
-/* 0D1658 80316658 8C640014 */ lw $a0, 0x14($v1)
-.L8031665C:
-/* 0D165C 8031665C 8C780000 */ lw $t8, ($v1)
-/* 0D1660 80316660 00801025 */ move $v0, $a0
-/* 0D1664 80316664 3B190001 */ xori $t9, $t8, 1
-/* 0D1668 80316668 10000063 */ b .L803167F8
-/* 0D166C 8031666C AC790000 */ sw $t9, ($v1)
-.L80316670:
-/* 0D1670 80316670 8CAD0008 */ lw $t5, 8($a1)
-/* 0D1674 80316674 8CAE0000 */ lw $t6, ($a1)
-/* 0D1678 80316678 8FB80080 */ lw $t8, 0x80($sp)
-/* 0D167C 8031667C 01AE7821 */ addu $t7, $t5, $t6
-/* 0D1680 80316680 01F8C823 */ subu $t9, $t7, $t8
-/* 0D1684 80316684 2722FFF0 */ addiu $v0, $t9, -0x10
-/* 0D1688 80316688 AC620020 */ sw $v0, 0x20($v1)
-/* 0D168C 8031668C 8FAE0088 */ lw $t6, 0x88($sp)
-/* 0D1690 80316690 AC6E0028 */ sw $t6, 0x28($v1)
-/* 0D1694 80316694 8FAF0080 */ lw $t7, 0x80($sp)
-/* 0D1698 80316698 AC6F0024 */ sw $t7, 0x24($v1)
-/* 0D169C 8031669C 8CB80004 */ lw $t8, 4($a1)
-/* 0D16A0 803166A0 0058082B */ sltu $at, $v0, $t8
-/* 0D16A4 803166A4 1020001B */ beqz $at, .L80316714
-/* 0D16A8 803166A8 00000000 */ nop
-/* 0D16AC 803166AC 8C79001C */ lw $t9, 0x1c($v1)
-/* 0D16B0 803166B0 01596821 */ addu $t5, $t2, $t9
-/* 0D16B4 803166B4 11800005 */ beqz $t4, .L803166CC
-/* 0D16B8 803166B8 A1A00000 */ sb $zero, ($t5)
-/* 0D16BC 803166BC 5188000B */ beql $t4, $t0, .L803166EC
-/* 0D16C0 803166C0 8C64001C */ lw $a0, 0x1c($v1)
-/* 0D16C4 803166C4 1000000F */ b .L80316704
-/* 0D16C8 803166C8 240EFFFF */ li $t6, -1
-.L803166CC:
-/* 0D16CC 803166CC 8C64001C */ lw $a0, 0x1c($v1)
-/* 0D16D0 803166D0 AFA5002C */ sw $a1, 0x2c($sp)
-/* 0D16D4 803166D4 0C0C57E5 */ jal discard_sequence
-/* 0D16D8 803166D8 AFA30030 */ sw $v1, 0x30($sp)
-/* 0D16DC 803166DC 8FA30030 */ lw $v1, 0x30($sp)
-/* 0D16E0 803166E0 10000007 */ b .L80316700
-/* 0D16E4 803166E4 8FA5002C */ lw $a1, 0x2c($sp)
-/* 0D16E8 803166E8 8C64001C */ lw $a0, 0x1c($v1)
-.L803166EC:
-/* 0D16EC 803166EC AFA5002C */ sw $a1, 0x2c($sp)
-/* 0D16F0 803166F0 0C0C57A9 */ jal discard_bank
-/* 0D16F4 803166F4 AFA30030 */ sw $v1, 0x30($sp)
-/* 0D16F8 803166F8 8FA30030 */ lw $v1, 0x30($sp)
-/* 0D16FC 803166FC 8FA5002C */ lw $a1, 0x2c($sp)
-.L80316700:
-/* 0D1700 80316700 240EFFFF */ li $t6, -1
-.L80316704:
-/* 0D1704 80316704 AC6E001C */ sw $t6, 0x1c($v1)
-/* 0D1708 80316708 8CAF0000 */ lw $t7, ($a1)
-/* 0D170C 8031670C ACAF0004 */ sw $t7, 4($a1)
-/* 0D1710 80316710 8C620020 */ lw $v0, 0x20($v1)
-.L80316714:
-/* 0D1714 80316714 1000FFD1 */ b .L8031665C
-/* 0D1718 80316718 00402025 */ move $a0, $v0
-/* 0D171C 8031671C 10000036 */ b .L803167F8
-/* 0D1720 80316720 00001025 */ move $v0, $zero
-.L80316724:
-/* 0D1724 80316724 8FB8007C */ lw $t8, 0x7c($sp)
-/* 0D1728 80316728 8FB90080 */ lw $t9, 0x80($sp)
-/* 0D172C 8031672C 26040004 */ addiu $a0, $s0, 4
-/* 0D1730 80316730 AFA70084 */ sw $a3, 0x84($sp)
-/* 0D1734 80316734 03190019 */ multu $t8, $t9
-/* 0D1738 80316738 00002812 */ mflo $a1
-/* 0D173C 8031673C 0C0C5808 */ jal soundAlloc
-/* 0D1740 80316740 00000000 */ nop
-/* 0D1744 80316744 8E0D0000 */ lw $t5, ($s0)
-/* 0D1748 80316748 2405000C */ li $a1, 12
-/* 0D174C 8031674C 8FA70084 */ lw $a3, 0x84($sp)
-/* 0D1750 80316750 01A50019 */ multu $t5, $a1
-/* 0D1754 80316754 24080001 */ li $t0, 1
-/* 0D1758 80316758 00007012 */ mflo $t6
-/* 0D175C 8031675C 020E7821 */ addu $t7, $s0, $t6
-/* 0D1760 80316760 ADE20014 */ sw $v0, 0x14($t7)
-/* 0D1764 80316764 8E180000 */ lw $t8, ($s0)
-/* 0D1768 80316768 8FAF0088 */ lw $t7, 0x88($sp)
-/* 0D176C 8031676C 03050019 */ multu $t8, $a1
-/* 0D1770 80316770 0000C812 */ mflo $t9
-/* 0D1774 80316774 02191821 */ addu $v1, $s0, $t9
-/* 0D1778 80316778 8C6D0014 */ lw $t5, 0x14($v1)
-/* 0D177C 8031677C 55A00010 */ bnezl $t5, .L803167C0
-/* 0D1780 80316780 AC6F001C */ sw $t7, 0x1c($v1)
-/* 0D1784 80316784 10E8000B */ beq $a3, $t0, .L803167B4
-/* 0D1788 80316788 24010002 */ li $at, 2
-/* 0D178C 8031678C 14E1000B */ bne $a3, $at, .L803167BC
-/* 0D1790 80316790 02002025 */ move $a0, $s0
-/* 0D1794 80316794 8FAE0088 */ lw $t6, 0x88($sp)
-/* 0D1798 80316798 8FA5007C */ lw $a1, 0x7c($sp)
-/* 0D179C 8031679C 8FA60080 */ lw $a2, 0x80($sp)
-/* 0D17A0 803167A0 00003825 */ move $a3, $zero
-/* 0D17A4 803167A4 0C0C58F7 */ jal alloc_bank_or_seq
-/* 0D17A8 803167A8 AFAE0010 */ sw $t6, 0x10($sp)
-/* 0D17AC 803167AC 10000013 */ b .L803167FC
-/* 0D17B0 803167B0 8FBF0024 */ lw $ra, 0x24($sp)
-.L803167B4:
-/* 0D17B4 803167B4 10000010 */ b .L803167F8
-/* 0D17B8 803167B8 00001025 */ move $v0, $zero
-.L803167BC:
-/* 0D17BC 803167BC AC6F001C */ sw $t7, 0x1c($v1)
-.L803167C0:
-/* 0D17C0 803167C0 8E190000 */ lw $t9, ($s0)
-/* 0D17C4 803167C4 8FB80080 */ lw $t8, 0x80($sp)
-/* 0D17C8 803167C8 03250019 */ multu $t9, $a1
-/* 0D17CC 803167CC 00006812 */ mflo $t5
-/* 0D17D0 803167D0 020D7021 */ addu $t6, $s0, $t5
-/* 0D17D4 803167D4 ADD80018 */ sw $t8, 0x18($t6)
-/* 0D17D8 803167D8 8E0F0000 */ lw $t7, ($s0)
-/* 0D17DC 803167DC 25F90001 */ addiu $t9, $t7, 1
-/* 0D17E0 803167E0 0019C080 */ sll $t8, $t9, 2
-/* 0D17E4 803167E4 0319C023 */ subu $t8, $t8, $t9
-/* 0D17E8 803167E8 0018C080 */ sll $t8, $t8, 2
-/* 0D17EC 803167EC 02187021 */ addu $t6, $s0, $t8
-/* 0D17F0 803167F0 AE190000 */ sw $t9, ($s0)
-/* 0D17F4 803167F4 8DC20008 */ lw $v0, 8($t6)
-.L803167F8:
-/* 0D17F8 803167F8 8FBF0024 */ lw $ra, 0x24($sp)
-.L803167FC:
-/* 0D17FC 803167FC 8FB00020 */ lw $s0, 0x20($sp)
-/* 0D1800 80316800 27BD0078 */ addiu $sp, $sp, 0x78
-/* 0D1804 80316804 03E00008 */ jr $ra
-/* 0D1808 80316808 00000000 */ nop
diff --git a/asm/non_matchings/eu/append_bubble_vertex_buffer.s b/asm/non_matchings/eu/append_bubble_vertex_buffer.s
@@ -1,151 +0,0 @@
-.text
-glabel append_bubble_vertex_buffer
-/* 0759E8 802B61E8 27BDFFD0 */ addiu $sp, $sp, -0x30
-/* 0759EC 802B61EC AFBF002C */ sw $ra, 0x2c($sp)
-/* 0759F0 802B61F0 AFB40028 */ sw $s4, 0x28($sp)
-/* 0759F4 802B61F4 AFB1001C */ sw $s1, 0x1c($sp)
-/* 0759F8 802B61F8 AFB00018 */ sw $s0, 0x18($sp)
-/* 0759FC 802B61FC AFA40030 */ sw $a0, 0x30($sp)
-/* 075A00 802B6200 00C08025 */ move $s0, $a2
-/* 075A04 802B6204 00E08825 */ move $s1, $a3
-/* 075A08 802B6208 00A0A025 */ move $s4, $a1
-/* 075A0C 802B620C AFB30024 */ sw $s3, 0x24($sp)
-/* 075A10 802B6210 AFB20020 */ sw $s2, 0x20($sp)
-# Vtx *vertBuf = (Vtx *)alloc_display_list(15 * sizeof(Vtx));
-/* 075A14 802B6214 0C09A781 */ jal alloc_display_list
-/* 075A18 802B6218 240400F0 */ li $a0, 240
-/* 075A1C 802B621C 10400078 */ beqz $v0, .L802B6400
-/* 075A20 802B6220 8FAB0044 */ lw $t3, 0x44($sp)
-/* 075A24 802B6224 3C058033 */ lui $a1, %hi(gEnvFxBuffer) # $a1, 0x8033
-/* 075A28 802B6228 24A5F6B0 */ addiu $a1, %lo(gEnvFxBuffer) # addiu $a1, $a1, -0x950
-/* 075A2C 802B622C 00003025 */ move $a2, $zero
-/* 075A30 802B6230 256C0010 */ addiu $t4, $t3, 0x10
-/* 075A34 802B6234 256D0020 */ addiu $t5, $t3, 0x20
-/* 075A38 802B6238 00403825 */ move $a3, $v0
-/* 075A3C 802B623C 24480020 */ addiu $t0, $v0, 0x20
-/* 075A40 802B6240 24490010 */ addiu $t1, $v0, 0x10
-/* 075A44 802B6244 2413000F */ li $s3, 15
-/* 075A48 802B6248 24120038 */ li $s2, 56
-/* 075A4C 802B624C 241F0003 */ li $ra, 3
-/* 075A50 802B6250 8FAA0040 */ lw $t2, 0x40($sp)
-# for (i = 0; i < 15; i += 3) {
-.L802B6254:
-/* 075A54 802B6254 00DF001A */ div $zero, $a2, $ra
-/* 075A58 802B6258 8D610000 */ lw $at, ($t3)
-/* 075A5C 802B625C 0000C812 */ mflo $t9
-/* 075A60 802B6260 02997021 */ addu $t6, $s4, $t9
-/* 075A64 802B6264 ACE10000 */ sw $at, ($a3)
-/* 075A68 802B6268 8D6F0004 */ lw $t7, 4($t3)
-/* 075A6C 802B626C 01D20019 */ multu $t6, $s2
-/* 075A70 802B6270 0006C100 */ sll $t8, $a2, 4
-/* 075A74 802B6274 ACEF0004 */ sw $t7, 4($a3)
-/* 075A78 802B6278 8D610008 */ lw $at, 8($t3)
-/* 075A7C 802B627C 00582021 */ addu $a0, $v0, $t8
-/* 075A80 802B6280 24E70030 */ addiu $a3, $a3, 0x30
-/* 075A84 802B6284 ACE1FFD8 */ sw $at, -0x28($a3)
-/* 075A88 802B6288 8D6F000C */ lw $t7, 0xc($t3)
-/* 075A8C 802B628C 25080030 */ addiu $t0, $t0, 0x30
-/* 075A90 802B6290 25290030 */ addiu $t1, $t1, 0x30
-/* 075A94 802B6294 ACEFFFDC */ sw $t7, -0x24($a3)
-/* 075A98 802B6298 8CB80000 */ lw $t8, ($a1)
-/* 075A9C 802B629C 00001812 */ mflo $v1
-/* 075AA0 802B62A0 860F0000 */ lh $t7, ($s0)
-/* 075AA4 802B62A4 0303C821 */ addu $t9, $t8, $v1
-/* 075AA8 802B62A8 8F2E0004 */ lw $t6, 4($t9)
-/* 075AAC 802B62AC 17E00002 */ bnez $ra, .L802B62B8
-/* 075AB0 802B62B0 00000000 */ nop
-/* 075AB4 802B62B4 0007000D */ break 7
-.L802B62B8:
-/* 075AB8 802B62B8 2401FFFF */ li $at, -1
-/* 075ABC 802B62BC 17E10004 */ bne $ra, $at, .L802B62D0
-/* 075AC0 802B62C0 3C018000 */ lui $at, 0x8000
-/* 075AC4 802B62C4 14C10002 */ bne $a2, $at, .L802B62D0
-/* 075AC8 802B62C8 00000000 */ nop
-/* 075ACC 802B62CC 0006000D */ break 6
-.L802B62D0:
-/* 075AD0 802B62D0 01EEC021 */ addu $t8, $t7, $t6
-/* 075AD4 802B62D4 A4980000 */ sh $t8, ($a0)
-/* 075AD8 802B62D8 8CAF0000 */ lw $t7, ($a1)
-/* 075ADC 802B62DC 86190002 */ lh $t9, 2($s0)
-/* 075AE0 802B62E0 24C60003 */ addiu $a2, $a2, 3
-/* 075AE4 802B62E4 01E37021 */ addu $t6, $t7, $v1
-/* 075AE8 802B62E8 8DD80008 */ lw $t8, 8($t6)
-/* 075AEC 802B62EC 03387821 */ addu $t7, $t9, $t8
-/* 075AF0 802B62F0 A48F0002 */ sh $t7, 2($a0)
-/* 075AF4 802B62F4 8CB90000 */ lw $t9, ($a1)
-/* 075AF8 802B62F8 860E0004 */ lh $t6, 4($s0)
-/* 075AFC 802B62FC 0323C021 */ addu $t8, $t9, $v1
-/* 075B00 802B6300 8F0F000C */ lw $t7, 0xc($t8)
-/* 075B04 802B6304 01CFC821 */ addu $t9, $t6, $t7
-/* 075B08 802B6308 A4990004 */ sh $t9, 4($a0)
-/* 075B0C 802B630C 8D810000 */ lw $at, ($t4)
-/* 075B10 802B6310 AD21FFD0 */ sw $at, -0x30($t1)
-/* 075B14 802B6314 8D8E0004 */ lw $t6, 4($t4)
-/* 075B18 802B6318 AD2EFFD4 */ sw $t6, -0x2c($t1)
-/* 075B1C 802B631C 8D810008 */ lw $at, 8($t4)
-/* 075B20 802B6320 AD21FFD8 */ sw $at, -0x28($t1)
-/* 075B24 802B6324 8D8E000C */ lw $t6, 0xc($t4)
-/* 075B28 802B6328 AD2EFFDC */ sw $t6, -0x24($t1)
-/* 075B2C 802B632C 8CB90000 */ lw $t9, ($a1)
-/* 075B30 802B6330 862F0000 */ lh $t7, ($s1)
-/* 075B34 802B6334 0323C021 */ addu $t8, $t9, $v1
-/* 075B38 802B6338 8F0E0004 */ lw $t6, 4($t8)
-/* 075B3C 802B633C 01EEC821 */ addu $t9, $t7, $t6
-/* 075B40 802B6340 A4990010 */ sh $t9, 0x10($a0)
-/* 075B44 802B6344 8CAF0000 */ lw $t7, ($a1)
-/* 075B48 802B6348 86380002 */ lh $t8, 2($s1)
-/* 075B4C 802B634C 01E37021 */ addu $t6, $t7, $v1
-/* 075B50 802B6350 8DD90008 */ lw $t9, 8($t6)
-/* 075B54 802B6354 03197821 */ addu $t7, $t8, $t9
-/* 075B58 802B6358 A48F0012 */ sh $t7, 0x12($a0)
-/* 075B5C 802B635C 8CB80000 */ lw $t8, ($a1)
-/* 075B60 802B6360 862E0004 */ lh $t6, 4($s1)
-/* 075B64 802B6364 0303C821 */ addu $t9, $t8, $v1
-/* 075B68 802B6368 8F2F000C */ lw $t7, 0xc($t9)
-/* 075B6C 802B636C 01CFC021 */ addu $t8, $t6, $t7
-/* 075B70 802B6370 A4980014 */ sh $t8, 0x14($a0)
-/* 075B74 802B6374 8DA10000 */ lw $at, ($t5)
-/* 075B78 802B6378 AD01FFD0 */ sw $at, -0x30($t0)
-/* 075B7C 802B637C 8DAE0004 */ lw $t6, 4($t5)
-/* 075B80 802B6380 AD0EFFD4 */ sw $t6, -0x2c($t0)
-/* 075B84 802B6384 8DA10008 */ lw $at, 8($t5)
-/* 075B88 802B6388 AD01FFD8 */ sw $at, -0x28($t0)
-/* 075B8C 802B638C 8DAE000C */ lw $t6, 0xc($t5)
-/* 075B90 802B6390 AD0EFFDC */ sw $t6, -0x24($t0)
-/* 075B94 802B6394 8CB80000 */ lw $t8, ($a1)
-/* 075B98 802B6398 854F0000 */ lh $t7, ($t2)
-/* 075B9C 802B639C 0303C821 */ addu $t9, $t8, $v1
-/* 075BA0 802B63A0 8F2E0004 */ lw $t6, 4($t9)
-/* 075BA4 802B63A4 01EEC021 */ addu $t8, $t7, $t6
-/* 075BA8 802B63A8 A4980020 */ sh $t8, 0x20($a0)
-/* 075BAC 802B63AC 8CAF0000 */ lw $t7, ($a1)
-/* 075BB0 802B63B0 85590002 */ lh $t9, 2($t2)
-/* 075BB4 802B63B4 01E37021 */ addu $t6, $t7, $v1
-/* 075BB8 802B63B8 8DD80008 */ lw $t8, 8($t6)
-/* 075BBC 802B63BC 03387821 */ addu $t7, $t9, $t8
-/* 075BC0 802B63C0 A48F0022 */ sh $t7, 0x22($a0)
-/* 075BC4 802B63C4 8CB90000 */ lw $t9, ($a1)
-/* 075BC8 802B63C8 854E0004 */ lh $t6, 4($t2)
-/* 075BCC 802B63CC 0323C021 */ addu $t8, $t9, $v1
-/* 075BD0 802B63D0 8F0F000C */ lw $t7, 0xc($t8)
-/* 075BD4 802B63D4 01CFC821 */ addu $t9, $t6, $t7
-/* 075BD8 802B63D8 14D3FF9E */ bne $a2, $s3, .L802B6254
-/* 075BDC 802B63DC A4990024 */ sh $t9, 0x24($a0)
-/* 075BE0 802B63E0 8FA30030 */ lw $v1, 0x30($sp)
-# gSPVertex(gfx, VIRTUAL_TO_PHYSICAL(vertBuf), 15, 0);
-/* 075BE4 802B63E4 3C011FFF */ lui $at, (0x1FFFFFFF >> 16) # lui $at, 0x1fff
-/* 075BE8 802B63E8 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff
-/* 075BEC 802B63EC 3C1804E0 */ lui $t8, (0x04E000F0 >> 16) # lui $t8, 0x4e0
-/* 075BF0 802B63F0 371800F0 */ ori $t8, (0x04E000F0 & 0xFFFF) # ori $t8, $t8, 0xf0
-/* 075BF4 802B63F4 00417024 */ and $t6, $v0, $at
-/* 075BF8 802B63F8 AC6E0004 */ sw $t6, 4($v1)
-/* 075BFC 802B63FC AC780000 */ sw $t8, ($v1)
-.L802B6400:
-/* 075C00 802B6400 8FBF002C */ lw $ra, 0x2c($sp)
-/* 075C04 802B6404 8FB00018 */ lw $s0, 0x18($sp)
-/* 075C08 802B6408 8FB1001C */ lw $s1, 0x1c($sp)
-/* 075C0C 802B640C 8FB20020 */ lw $s2, 0x20($sp)
-/* 075C10 802B6410 8FB30024 */ lw $s3, 0x24($sp)
-/* 075C14 802B6414 8FB40028 */ lw $s4, 0x28($sp)
-/* 075C18 802B6418 03E00008 */ jr $ra
-/* 075C1C 802B641C 27BD0030 */ addiu $sp, $sp, 0x30
diff --git a/asm/non_matchings/eu/append_snowflake_vertex_buffer.s b/asm/non_matchings/eu/append_snowflake_vertex_buffer.s
@@ -1,156 +0,0 @@
-.text
-glabel append_snowflake_vertex_buffer
-/* 074188 802B4988 27BDFFD0 */ addiu $sp, $sp, -0x30
-/* 07418C 802B498C AFBF002C */ sw $ra, 0x2c($sp)
-/* 074190 802B4990 AFB40028 */ sw $s4, 0x28($sp)
-/* 074194 802B4994 AFB1001C */ sw $s1, 0x1c($sp)
-/* 074198 802B4998 AFB00018 */ sw $s0, 0x18($sp)
-/* 07419C 802B499C AFA40030 */ sw $a0, 0x30($sp)
-/* 0741A0 802B49A0 00C08025 */ move $s0, $a2
-/* 0741A4 802B49A4 00E08825 */ move $s1, $a3
-/* 0741A8 802B49A8 00A0A025 */ move $s4, $a1
-/* 0741AC 802B49AC AFB30024 */ sw $s3, 0x24($sp)
-/* 0741B0 802B49B0 AFB20020 */ sw $s2, 0x20($sp)
-# Vtx *vertBuf = (Vtx *)alloc_display_list(15 * sizeof(Vtx));
-/* 0741B4 802B49B4 0C09A781 */ jal alloc_display_list
-/* 0741B8 802B49B8 240400F0 */ li $a0, 240
-# if (vertBuf == NULL) return;
-/* 0741BC 802B49BC 1040007B */ beqz $v0, .L802B4BAC
-/* 0741C0 802B49C0 00003025 */ move $a2, $zero
-/* 0741C4 802B49C4 3C128030 */ lui $s2, %hi(gSnowTempVtx + 0x20) # $s2, 0x8030
-/* 0741C8 802B49C8 3C1F8030 */ lui $ra, %hi(gSnowTempVtx + 0x10) # $ra, 0x8030
-/* 0741CC 802B49CC 3C0B8030 */ lui $t3, %hi(gSnowTempVtx) # $t3, 0x8030
-/* 0741D0 802B49D0 3C058033 */ lui $a1, %hi(gEnvFxBuffer) # $a1, 0x8033
-/* 0741D4 802B49D4 24A5F6B0 */ addiu $a1, %lo(gEnvFxBuffer) # addiu $a1, $a1, -0x950
-/* 0741D8 802B49D8 256BDD08 */ addiu $t3, %lo(gSnowTempVtx) # addiu $t3, $t3, -0x22f8
-/* 0741DC 802B49DC 27FFDD18 */ addiu $ra, %lo(gSnowTempVtx + 0x10) # addiu $ra, $ra, -0x22e8
-/* 0741E0 802B49E0 2652DD28 */ addiu $s2, %lo(gSnowTempVtx + 0x20) # addiu $s2, $s2, -0x22d8
-/* 0741E4 802B49E4 00403825 */ move $a3, $v0
-/* 0741E8 802B49E8 24480020 */ addiu $t0, $v0, 0x20
-/* 0741EC 802B49EC 24490010 */ addiu $t1, $v0, 0x10
-/* 0741F0 802B49F0 2413000F */ li $s3, 15
-/* 0741F4 802B49F4 240D0038 */ li $t5, 56
-/* 0741F8 802B49F8 240C0003 */ li $t4, 3
-/* 0741FC 802B49FC 8FAA0040 */ lw $t2, 0x40($sp)
-# for (i = 0; i < 15; i += 3)
-.L802B4A00:
-/* 074200 802B4A00 00CC001A */ div $zero, $a2, $t4
-/* 074204 802B4A04 8D610000 */ lw $at, ($t3)
-/* 074208 802B4A08 0000C812 */ mflo $t9
-/* 07420C 802B4A0C 02997021 */ addu $t6, $s4, $t9
-/* 074210 802B4A10 ACE10000 */ sw $at, ($a3)
-/* 074214 802B4A14 8D6F0004 */ lw $t7, 4($t3)
-/* 074218 802B4A18 01CD0019 */ multu $t6, $t5
-/* 07421C 802B4A1C 0006C100 */ sll $t8, $a2, 4
-/* 074220 802B4A20 ACEF0004 */ sw $t7, 4($a3)
-/* 074224 802B4A24 8D610008 */ lw $at, 8($t3)
-/* 074228 802B4A28 00582021 */ addu $a0, $v0, $t8
-/* 07422C 802B4A2C 24E70030 */ addiu $a3, $a3, 0x30
-/* 074230 802B4A30 ACE1FFD8 */ sw $at, -0x28($a3)
-/* 074234 802B4A34 8D6F000C */ lw $t7, 0xc($t3)
-/* 074238 802B4A38 25080030 */ addiu $t0, $t0, 0x30
-/* 07423C 802B4A3C 25290030 */ addiu $t1, $t1, 0x30
-/* 074240 802B4A40 ACEFFFDC */ sw $t7, -0x24($a3)
-/* 074244 802B4A44 8CB80000 */ lw $t8, ($a1)
-/* 074248 802B4A48 00001812 */ mflo $v1
-/* 07424C 802B4A4C 860F0000 */ lh $t7, ($s0)
-/* 074250 802B4A50 0303C821 */ addu $t9, $t8, $v1
-/* 074254 802B4A54 8F2E0004 */ lw $t6, 4($t9)
-/* 074258 802B4A58 15800002 */ bnez $t4, .L802B4A64
-/* 07425C 802B4A5C 00000000 */ nop
-/* 074260 802B4A60 0007000D */ break 7
-.L802B4A64:
-/* 074264 802B4A64 2401FFFF */ li $at, -1
-/* 074268 802B4A68 15810004 */ bne $t4, $at, .L802B4A7C
-/* 07426C 802B4A6C 3C018000 */ lui $at, 0x8000
-/* 074270 802B4A70 14C10002 */ bne $a2, $at, .L802B4A7C
-/* 074274 802B4A74 00000000 */ nop
-/* 074278 802B4A78 0006000D */ break 6
-.L802B4A7C:
-/* 07427C 802B4A7C 01EEC021 */ addu $t8, $t7, $t6
-/* 074280 802B4A80 A4980000 */ sh $t8, ($a0)
-/* 074284 802B4A84 8CAF0000 */ lw $t7, ($a1)
-/* 074288 802B4A88 86190002 */ lh $t9, 2($s0)
-/* 07428C 802B4A8C 24C60003 */ addiu $a2, $a2, 3
-/* 074290 802B4A90 01E37021 */ addu $t6, $t7, $v1
-/* 074294 802B4A94 8DD80008 */ lw $t8, 8($t6)
-/* 074298 802B4A98 03387821 */ addu $t7, $t9, $t8
-/* 07429C 802B4A9C A48F0002 */ sh $t7, 2($a0)
-/* 0742A0 802B4AA0 8CB90000 */ lw $t9, ($a1)
-/* 0742A4 802B4AA4 860E0004 */ lh $t6, 4($s0)
-/* 0742A8 802B4AA8 0323C021 */ addu $t8, $t9, $v1
-/* 0742AC 802B4AAC 8F0F000C */ lw $t7, 0xc($t8)
-/* 0742B0 802B4AB0 01CFC821 */ addu $t9, $t6, $t7
-/* 0742B4 802B4AB4 A4990004 */ sh $t9, 4($a0)
-/* 0742B8 802B4AB8 8FE10000 */ lw $at, ($ra)
-/* 0742BC 802B4ABC AD21FFD0 */ sw $at, -0x30($t1)
-/* 0742C0 802B4AC0 8FEE0004 */ lw $t6, 4($ra)
-/* 0742C4 802B4AC4 AD2EFFD4 */ sw $t6, -0x2c($t1)
-/* 0742C8 802B4AC8 8FE10008 */ lw $at, 8($ra)
-/* 0742CC 802B4ACC AD21FFD8 */ sw $at, -0x28($t1)
-/* 0742D0 802B4AD0 8FEE000C */ lw $t6, 0xc($ra)
-/* 0742D4 802B4AD4 AD2EFFDC */ sw $t6, -0x24($t1)
-/* 0742D8 802B4AD8 8CB90000 */ lw $t9, ($a1)
-/* 0742DC 802B4ADC 862F0000 */ lh $t7, ($s1)
-/* 0742E0 802B4AE0 0323C021 */ addu $t8, $t9, $v1
-/* 0742E4 802B4AE4 8F0E0004 */ lw $t6, 4($t8)
-/* 0742E8 802B4AE8 01EEC821 */ addu $t9, $t7, $t6
-/* 0742EC 802B4AEC A4990010 */ sh $t9, 0x10($a0)
-/* 0742F0 802B4AF0 8CAF0000 */ lw $t7, ($a1)
-/* 0742F4 802B4AF4 86380002 */ lh $t8, 2($s1)
-/* 0742F8 802B4AF8 01E37021 */ addu $t6, $t7, $v1
-/* 0742FC 802B4AFC 8DD90008 */ lw $t9, 8($t6)
-/* 074300 802B4B00 03197821 */ addu $t7, $t8, $t9
-/* 074304 802B4B04 A48F0012 */ sh $t7, 0x12($a0)
-/* 074308 802B4B08 8CB80000 */ lw $t8, ($a1)
-/* 07430C 802B4B0C 862E0004 */ lh $t6, 4($s1)
-/* 074310 802B4B10 0303C821 */ addu $t9, $t8, $v1
-/* 074314 802B4B14 8F2F000C */ lw $t7, 0xc($t9)
-/* 074318 802B4B18 01CFC021 */ addu $t8, $t6, $t7
-/* 07431C 802B4B1C A4980014 */ sh $t8, 0x14($a0)
-/* 074320 802B4B20 8E410000 */ lw $at, ($s2)
-/* 074324 802B4B24 AD01FFD0 */ sw $at, -0x30($t0)
-/* 074328 802B4B28 8E4E0004 */ lw $t6, 4($s2)
-/* 07432C 802B4B2C AD0EFFD4 */ sw $t6, -0x2c($t0)
-/* 074330 802B4B30 8E410008 */ lw $at, 8($s2)
-/* 074334 802B4B34 AD01FFD8 */ sw $at, -0x28($t0)
-/* 074338 802B4B38 8E4E000C */ lw $t6, 0xc($s2)
-/* 07433C 802B4B3C AD0EFFDC */ sw $t6, -0x24($t0)
-/* 074340 802B4B40 8CB80000 */ lw $t8, ($a1)
-/* 074344 802B4B44 854F0000 */ lh $t7, ($t2)
-/* 074348 802B4B48 0303C821 */ addu $t9, $t8, $v1
-/* 07434C 802B4B4C 8F2E0004 */ lw $t6, 4($t9)
-/* 074350 802B4B50 01EEC021 */ addu $t8, $t7, $t6
-/* 074354 802B4B54 A4980020 */ sh $t8, 0x20($a0)
-/* 074358 802B4B58 8CAF0000 */ lw $t7, ($a1)
-/* 07435C 802B4B5C 85590002 */ lh $t9, 2($t2)
-/* 074360 802B4B60 01E37021 */ addu $t6, $t7, $v1
-/* 074364 802B4B64 8DD80008 */ lw $t8, 8($t6)
-/* 074368 802B4B68 03387821 */ addu $t7, $t9, $t8
-/* 07436C 802B4B6C A48F0022 */ sh $t7, 0x22($a0)
-/* 074370 802B4B70 8CB90000 */ lw $t9, ($a1)
-/* 074374 802B4B74 854E0004 */ lh $t6, 4($t2)
-/* 074378 802B4B78 0323C021 */ addu $t8, $t9, $v1
-/* 07437C 802B4B7C 8F0F000C */ lw $t7, 0xc($t8)
-/* 074380 802B4B80 01CFC821 */ addu $t9, $t6, $t7
-/* 074384 802B4B84 14D3FF9E */ bne $a2, $s3, .L802B4A00
-/* 074388 802B4B88 A4990024 */ sh $t9, 0x24($a0)
-/* 07438C 802B4B8C 8FA30030 */ lw $v1, 0x30($sp)
-# gSPVertex(gfx, VIRTUAL_TO_PHYSICAL(vertBuf), 15, 0);
-/* 074390 802B4B90 3C011FFF */ lui $at, (0x1FFFFFFF >> 16) # lui $at, 0x1fff
-/* 074394 802B4B94 3421FFFF */ ori $at, (0x1FFFFFFF & 0xFFFF) # ori $at, $at, 0xffff
-/* 074398 802B4B98 3C1804E0 */ lui $t8, (0x04E000F0 >> 16) # lui $t8, 0x4e0
-/* 07439C 802B4B9C 371800F0 */ ori $t8, (0x04E000F0 & 0xFFFF) # ori $t8, $t8, 0xf0
-/* 0743A0 802B4BA0 00417024 */ and $t6, $v0, $at
-/* 0743A4 802B4BA4 AC6E0004 */ sw $t6, 4($v1)
-/* 0743A8 802B4BA8 AC780000 */ sw $t8, ($v1)
-.L802B4BAC:
-/* 0743AC 802B4BAC 8FBF002C */ lw $ra, 0x2c($sp)
-/* 0743B0 802B4BB0 8FB00018 */ lw $s0, 0x18($sp)
-/* 0743B4 802B4BB4 8FB1001C */ lw $s1, 0x1c($sp)
-/* 0743B8 802B4BB8 8FB20020 */ lw $s2, 0x20($sp)
-/* 0743BC 802B4BBC 8FB30024 */ lw $s3, 0x24($sp)
-/* 0743C0 802B4BC0 8FB40028 */ lw $s4, 0x28($sp)
-/* 0743C4 802B4BC4 03E00008 */ jr $ra
-/* 0743C8 802B4BC8 27BD0030 */ addiu $sp, $sp, 0x30
-
diff --git a/asm/non_matchings/eu/audio/alloc_bank_or_seq.s b/asm/non_matchings/eu/audio/alloc_bank_or_seq.s
@@ -1,269 +0,0 @@
-glabel alloc_bank_or_seq
-/* 0A1B94 802E2394 27BDFFA8 */ addiu $sp, $sp, -0x58
-/* 0A1B98 802E2398 AFB20020 */ sw $s2, 0x20($sp)
-/* 0A1B9C 802E239C 00C09025 */ move $s2, $a2
-/* 0A1BA0 802E23A0 AFB1001C */ sw $s1, 0x1c($sp)
-/* 0A1BA4 802E23A4 AFB00018 */ sw $s0, 0x18($sp)
-/* 0A1BA8 802E23A8 00A08025 */ move $s0, $a1
-/* 0A1BAC 802E23AC 00808825 */ move $s1, $a0
-/* 0A1BB0 802E23B0 2406000C */ li $a2, 12
-/* 0A1BB4 802E23B4 AFBF0024 */ sw $ra, 0x24($sp)
-/* 0A1BB8 802E23B8 8FA90068 */ lw $t1, 0x68($sp)
-/* 0A1BBC 802E23BC 24080001 */ li $t0, 1
-.L80200850:
-/* 0A1BC0 802E23C0 14E000AD */ bnez $a3, .L80200B08
-/* 0A1BC4 802E23C4 3C0E8022 */ lui $t6, %hi(gSeqLoadedPool) # $t6, 0x8022
-/* 0A1BC8 802E23C8 25CE2670 */ addiu $t6, %lo(gSeqLoadedPool) # addiu $t6, $t6, 0x2670
-/* 0A1BCC 802E23CC 162E0006 */ bne $s1, $t6, .L80200878
-/* 0A1BD0 802E23D0 26300194 */ addiu $s0, $s1, 0x194
-/* 0A1BD4 802E23D4 3C058022 */ lui $a1, %hi(gSeqLoadStatus) # $a1, 0x8022
-/* 0A1BD8 802E23D8 24A52C58 */ addiu $a1, %lo(gSeqLoadStatus) # addiu $a1, $a1, 0x2c58
-/* 0A1BDC 802E23DC AFA5003C */ sw $a1, 0x3c($sp)
-/* 0A1BE0 802E23E0 10000009 */ b .L80200898
-/* 0A1BE4 802E23E4 A3A0003B */ sb $zero, 0x3b($sp)
-.L80200878:
-/* 0A1BE8 802E23E8 3C0F8022 */ lui $t7, %hi(gBankLoadedPool) # $t7, 0x8022
-/* 0A1BEC 802E23EC 25EF2840 */ addiu $t7, %lo(gBankLoadedPool) # addiu $t7, $t7, 0x2840
-/* 0A1BF0 802E23F0 162F0005 */ bne $s1, $t7, .L80200898
-/* 0A1BF4 802E23F4 3C058022 */ lui $a1, %hi(gBankLoadStatus) # $a1, 0x8022
-/* 0A1BF8 802E23F8 24A52C18 */ addiu $a1, %lo(gBankLoadStatus) # addiu $a1, $a1, 0x2c18
-/* 0A1BFC 802E23FC 240A0001 */ li $t2, 1
-/* 0A1C00 802E2400 A3AA003B */ sb $t2, 0x3b($sp)
-/* 0A1C04 802E2404 AFA5003C */ sw $a1, 0x3c($sp)
-.L80200898:
-/* 0A1C08 802E2408 8E02001C */ lw $v0, 0x1c($s0)
-/* 0A1C0C 802E240C 2407FFFF */ li $a3, -1
-/* 0A1C10 802E2410 8FA5003C */ lw $a1, 0x3c($sp)
-/* 0A1C14 802E2414 14E20003 */ bne $a3, $v0, .L802008B4
-/* 0A1C18 802E2418 93AA003B */ lbu $t2, 0x3b($sp)
-/* 0A1C1C 802E241C 10000003 */ b .L802008BC
-/* 0A1C20 802E2420 00001825 */ move $v1, $zero
-.L802008B4:
-/* 0A1C24 802E2424 0045C021 */ addu $t8, $v0, $a1
-/* 0A1C28 802E2428 93030000 */ lbu $v1, ($t8)
-.L802008BC:
-/* 0A1C2C 802E242C 8E020028 */ lw $v0, 0x28($s0)
-/* 0A1C30 802E2430 14E20003 */ bne $a3, $v0, .L802008D0
-/* 0A1C34 802E2434 0045C821 */ addu $t9, $v0, $a1
-/* 0A1C38 802E2438 10000002 */ b .L802008D4
-/* 0A1C3C 802E243C 00002025 */ move $a0, $zero
-.L802008D0:
-/* 0A1C40 802E2440 93240000 */ lbu $a0, ($t9)
-.L802008D4:
-/* 0A1C44 802E2444 14600003 */ bnez $v1, .L802008E4
-/* 0A1C48 802E2448 00601025 */ move $v0, $v1
-/* 0A1C4C 802E244C 1000001D */ b .L80200954
-/* 0A1C50 802E2450 AE000000 */ sw $zero, ($s0)
-.L802008E4:
-/* 0A1C54 802E2454 14800004 */ bnez $a0, .L802008F8
-/* 0A1C58 802E2458 00801825 */ move $v1, $a0
-/* 0A1C5C 802E245C 240B0001 */ li $t3, 1
-/* 0A1C60 802E2460 10000018 */ b .L80200954
-/* 0A1C64 802E2464 AE0B0000 */ sw $t3, ($s0)
-.L802008F8:
-/* 0A1C68 802E2468 24040003 */ li $a0, 3
-/* 0A1C6C 802E246C 14820003 */ bne $a0, $v0, .L8020090C
-/* 0A1C70 802E2470 00000000 */ nop
-/* 0A1C74 802E2474 50830014 */ beql $a0, $v1, .L80200958
-/* 0A1C78 802E2478 8E0E0000 */ lw $t6, ($s0)
-.L8020090C:
-/* 0A1C7C 802E247C 14820003 */ bne $a0, $v0, .L8020091C
-/* 0A1C80 802E2480 00000000 */ nop
-/* 0A1C84 802E2484 1000000F */ b .L80200954
-/* 0A1C88 802E2488 AE000000 */ sw $zero, ($s0)
-.L8020091C:
-/* 0A1C8C 802E248C 14830003 */ bne $a0, $v1, .L8020092C
-/* 0A1C90 802E2490 240C0001 */ li $t4, 1
-/* 0A1C94 802E2494 1000000B */ b .L80200954
-/* 0A1C98 802E2498 AE0C0000 */ sw $t4, ($s0)
-.L8020092C:
-/* 0A1C9C 802E249C 11020003 */ beq $t0, $v0, .L8020093C
-/* 0A1CA0 802E24A0 00000000 */ nop
-/* 0A1CA4 802E24A4 10000007 */ b .L80200954
-/* 0A1CA8 802E24A8 AE000000 */ sw $zero, ($s0)
-.L8020093C:
-/* 0A1CAC 802E24AC 11030003 */ beq $t0, $v1, .L8020094C
-/* 0A1CB0 802E24B0 240D0001 */ li $t5, 1
-/* 0A1CB4 802E24B4 10000003 */ b .L80200954
-/* 0A1CB8 802E24B8 AE0D0000 */ sw $t5, ($s0)
-.L8020094C:
-/* 0A1CBC 802E24BC 10000099 */ b .L80200BB4
-/* 0A1CC0 802E24C0 00001025 */ move $v0, $zero
-.L80200954:
-/* 0A1CC4 802E24C4 8E0E0000 */ lw $t6, ($s0)
-.L80200958:
-/* 0A1CC8 802E24C8 01C60019 */ multu $t6, $a2
-/* 0A1CCC 802E24CC 00007812 */ mflo $t7
-/* 0A1CD0 802E24D0 020FC021 */ addu $t8, $s0, $t7
-/* 0A1CD4 802E24D4 8F02001C */ lw $v0, 0x1c($t8)
-/* 0A1CD8 802E24D8 10E20010 */ beq $a3, $v0, .L802009AC
-/* 0A1CDC 802E24DC 00A2C821 */ addu $t9, $a1, $v0
-/* 0A1CE0 802E24E0 150A000E */ bne $t0, $t2, .L802009AC
-/* 0A1CE4 802E24E4 A3200000 */ sb $zero, ($t9)
-/* 0A1CE8 802E24E8 8E0B0000 */ lw $t3, ($s0)
-/* 0A1CEC 802E24EC 01660019 */ multu $t3, $a2
-/* 0A1CF0 802E24F0 00006012 */ mflo $t4
-/* 0A1CF4 802E24F4 020C6821 */ addu $t5, $s0, $t4
-/* 0A1CF8 802E24F8 8DA4001C */ lw $a0, 0x1c($t5)
-/* 0A1CFC 802E24FC A3AA003B */ sb $t2, 0x3b($sp)
-/* 0A1D00 802E2500 AFA90068 */ sw $t1, 0x68($sp)
-/* 0A1D04 802E2504 0C0B87A3 */ jal discard_bank
-/* 0A1D08 802E2508 AFA5003C */ sw $a1, 0x3c($sp)
-/* 0A1D0C 802E250C 8FA5003C */ lw $a1, 0x3c($sp)
-/* 0A1D10 802E2510 24080001 */ li $t0, 1
-/* 0A1D14 802E2514 8FA90068 */ lw $t1, 0x68($sp)
-/* 0A1D18 802E2518 93AA003B */ lbu $t2, 0x3b($sp)
-.L802009AC:
-/* 0A1D1C 802E251C 8E040000 */ lw $a0, ($s0)
-/* 0A1D20 802E2520 24010001 */ li $at, 1
-/* 0A1D24 802E2524 26230198 */ addiu $v1, $s1, 0x198
-/* 0A1D28 802E2528 50800006 */ beql $a0, $zero, .L802009D4
-/* 0A1D2C 802E252C 8C6E0000 */ lw $t6, ($v1)
-/* 0A1D30 802E2530 1081002B */ beq $a0, $at, .L80200A70
-/* 0A1D34 802E2534 26230198 */ addiu $v1, $s1, 0x198
-/* 0A1D38 802E2538 1000007A */ b .L80200BB4
-/* 0A1D3C 802E253C 00001025 */ move $v0, $zero
-/* 0A1D40 802E2540 8C6E0000 */ lw $t6, ($v1)
-.L802009D4:
-/* 0A1D44 802E2544 AE09001C */ sw $t1, 0x1c($s0)
-/* 0A1D48 802E2548 AE120018 */ sw $s2, 0x18($s0)
-/* 0A1D4C 802E254C AE0E0014 */ sw $t6, 0x14($s0)
-/* 0A1D50 802E2550 8C6F0000 */ lw $t7, ($v1)
-/* 0A1D54 802E2554 01F21021 */ addu $v0, $t7, $s2
-/* 0A1D58 802E2558 AC620004 */ sw $v0, 4($v1)
-/* 0A1D5C 802E255C 8E180020 */ lw $t8, 0x20($s0)
-/* 0A1D60 802E2560 0302082B */ sltu $at, $t8, $v0
-/* 0A1D64 802E2564 50200019 */ beql $at, $zero, .L80200A5C
-/* 0A1D68 802E2568 8E030014 */ lw $v1, 0x14($s0)
-/* 0A1D6C 802E256C 8E190028 */ lw $t9, 0x28($s0)
-/* 0A1D70 802E2570 00B95821 */ addu $t3, $a1, $t9
-/* 0A1D74 802E2574 11400005 */ beqz $t2, .L80200A1C
-/* 0A1D78 802E2578 A1600000 */ sb $zero, ($t3)
-/* 0A1D7C 802E257C 51480009 */ beql $t2, $t0, .L80200A34
-/* 0A1D80 802E2580 8E040028 */ lw $a0, 0x28($s0)
-/* 0A1D84 802E2584 1000000B */ b .L80200A44
-/* 0A1D88 802E2588 240CFFFF */ li $t4, -1
-.L80200A1C:
-/* 0A1D8C 802E258C 8E040028 */ lw $a0, 0x28($s0)
-/* 0A1D90 802E2590 0C0B87DC */ jal discard_sequence
-/* 0A1D94 802E2594 AFA3002C */ sw $v1, 0x2c($sp)
-/* 0A1D98 802E2598 10000005 */ b .L80200A40
-/* 0A1D9C 802E259C 8FA3002C */ lw $v1, 0x2c($sp)
-/* 0A1DA0 802E25A0 8E040028 */ lw $a0, 0x28($s0)
-.L80200A34:
-/* 0A1DA4 802E25A4 0C0B87A3 */ jal discard_bank
-/* 0A1DA8 802E25A8 AFA3002C */ sw $v1, 0x2c($sp)
-/* 0A1DAC 802E25AC 8FA3002C */ lw $v1, 0x2c($sp)
-.L80200A40:
-/* 0A1DB0 802E25B0 240CFFFF */ li $t4, -1
-.L80200A44:
-/* 0A1DB4 802E25B4 AE0C0028 */ sw $t4, 0x28($s0)
-/* 0A1DB8 802E25B8 8C6E0008 */ lw $t6, 8($v1)
-/* 0A1DBC 802E25BC 8C6D0000 */ lw $t5, ($v1)
-/* 0A1DC0 802E25C0 01AE7821 */ addu $t7, $t5, $t6
-/* 0A1DC4 802E25C4 AE0F0020 */ sw $t7, 0x20($s0)
-/* 0A1DC8 802E25C8 8E030014 */ lw $v1, 0x14($s0)
-.L80200A5C:
-/* 0A1DCC 802E25CC 8E180000 */ lw $t8, ($s0)
-/* 0A1DD0 802E25D0 00601025 */ move $v0, $v1
-/* 0A1DD4 802E25D4 3B190001 */ xori $t9, $t8, 1
-/* 0A1DD8 802E25D8 10000052 */ b .L80200BB4
-/* 0A1DDC 802E25DC AE190000 */ sw $t9, ($s0)
-.L80200A70:
-/* 0A1DE0 802E25E0 8C6B0000 */ lw $t3, ($v1)
-/* 0A1DE4 802E25E4 8C6C0008 */ lw $t4, 8($v1)
-/* 0A1DE8 802E25E8 AE090028 */ sw $t1, 0x28($s0)
-/* 0A1DEC 802E25EC AE120024 */ sw $s2, 0x24($s0)
-/* 0A1DF0 802E25F0 016C6821 */ addu $t5, $t3, $t4
-/* 0A1DF4 802E25F4 01B27023 */ subu $t6, $t5, $s2
-/* 0A1DF8 802E25F8 25C2FFF0 */ addiu $v0, $t6, -0x10
-/* 0A1DFC 802E25FC AE020020 */ sw $v0, 0x20($s0)
-/* 0A1E00 802E2600 8C780004 */ lw $t8, 4($v1)
-/* 0A1E04 802E2604 0058082B */ sltu $at, $v0, $t8
-/* 0A1E08 802E2608 10200017 */ beqz $at, .L80200AF8
-/* 0A1E0C 802E260C 00000000 */ nop
-/* 0A1E10 802E2610 8E19001C */ lw $t9, 0x1c($s0)
-/* 0A1E14 802E2614 00B95821 */ addu $t3, $a1, $t9
-/* 0A1E18 802E2618 11400005 */ beqz $t2, .L80200AC0
-/* 0A1E1C 802E261C A1600000 */ sb $zero, ($t3)
-/* 0A1E20 802E2620 51480009 */ beql $t2, $t0, .L80200AD8
-/* 0A1E24 802E2624 8E04001C */ lw $a0, 0x1c($s0)
-/* 0A1E28 802E2628 1000000B */ b .L80200AE8
-/* 0A1E2C 802E262C 240CFFFF */ li $t4, -1
-.L80200AC0:
-/* 0A1E30 802E2630 8E04001C */ lw $a0, 0x1c($s0)
-/* 0A1E34 802E2634 0C0B87DC */ jal discard_sequence
-/* 0A1E38 802E2638 AFA3002C */ sw $v1, 0x2c($sp)
-/* 0A1E3C 802E263C 10000005 */ b .L80200AE4
-/* 0A1E40 802E2640 8FA3002C */ lw $v1, 0x2c($sp)
-/* 0A1E44 802E2644 8E04001C */ lw $a0, 0x1c($s0)
-.L80200AD8:
-/* 0A1E48 802E2648 0C0B87A3 */ jal discard_bank
-/* 0A1E4C 802E264C AFA3002C */ sw $v1, 0x2c($sp)
-/* 0A1E50 802E2650 8FA3002C */ lw $v1, 0x2c($sp)
-.L80200AE4:
-/* 0A1E54 802E2654 240CFFFF */ li $t4, -1
-.L80200AE8:
-/* 0A1E58 802E2658 AE0C001C */ sw $t4, 0x1c($s0)
-/* 0A1E5C 802E265C 8C6D0000 */ lw $t5, ($v1)
-/* 0A1E60 802E2660 AC6D0004 */ sw $t5, 4($v1)
-/* 0A1E64 802E2664 8E020020 */ lw $v0, 0x20($s0)
-.L80200AF8:
-/* 0A1E68 802E2668 1000FFD8 */ b .L80200A5C
-/* 0A1E6C 802E266C 00401825 */ move $v1, $v0
-/* 0A1E70 802E2670 1000002C */ b .L80200BB4
-/* 0A1E74 802E2674 00001025 */ move $v0, $zero
-.L80200B08:
-/* 0A1E78 802E2678 02120019 */ multu $s0, $s2
-/* 0A1E7C 802E267C 26240004 */ addiu $a0, $s1, 4
-/* 0A1E80 802E2680 AFA70064 */ sw $a3, 0x64($sp)
-/* 0A1E84 802E2684 AFA90068 */ sw $t1, 0x68($sp)
-/* 0A1E88 802E2688 00002812 */ mflo $a1
-/* 0A1E8C 802E268C 0C0B87F8 */ jal soundAlloc
-/* 0A1E90 802E2690 00000000 */ nop
-/* 0A1E94 802E2694 8E2E0000 */ lw $t6, ($s1)
-/* 0A1E98 802E2698 2406000C */ li $a2, 12
-/* 0A1E9C 802E269C 8FA70064 */ lw $a3, 0x64($sp)
-/* 0A1EA0 802E26A0 01C60019 */ multu $t6, $a2
-/* 0A1EA4 802E26A4 8FA90068 */ lw $t1, 0x68($sp)
-/* 0A1EA8 802E26A8 24080001 */ li $t0, 1
-/* 0A1EAC 802E26AC 24010002 */ li $at, 2
-/* 0A1EB0 802E26B0 00007812 */ mflo $t7
-/* 0A1EB4 802E26B4 022FC021 */ addu $t8, $s1, $t7
-/* 0A1EB8 802E26B8 14400009 */ bnez $v0, .L80200B70
-/* 0A1EBC 802E26BC AF020014 */ sw $v0, 0x14($t8)
-/* 0A1EC0 802E26C0 10E80005 */ beq $a3, $t0, .L80200B68
-/* 0A1EC4 802E26C4 00000000 */ nop
-/* 0A1EC8 802E26C8 54E10006 */ bnel $a3, $at, .L80200B74
-/* 0A1ECC 802E26CC 8E390000 */ lw $t9, ($s1)
-/* 0A1ED0 802E26D0 1000FF3B */ b .L80200850
-/* 0A1ED4 802E26D4 00003825 */ move $a3, $zero
-.L80200B68:
-/* 0A1ED8 802E26D8 10000012 */ b .L80200BB4
-/* 0A1EDC 802E26DC 00001025 */ move $v0, $zero
-.L80200B70:
-/* 0A1EE0 802E26E0 8E390000 */ lw $t9, ($s1)
-.L80200B74:
-/* 0A1EE4 802E26E4 03260019 */ multu $t9, $a2
-/* 0A1EE8 802E26E8 00005812 */ mflo $t3
-/* 0A1EEC 802E26EC 022B6021 */ addu $t4, $s1, $t3
-/* 0A1EF0 802E26F0 AD89001C */ sw $t1, 0x1c($t4)
-/* 0A1EF4 802E26F4 8E2D0000 */ lw $t5, ($s1)
-/* 0A1EF8 802E26F8 01A60019 */ multu $t5, $a2
-/* 0A1EFC 802E26FC 00007012 */ mflo $t6
-/* 0A1F00 802E2700 022E7821 */ addu $t7, $s1, $t6
-/* 0A1F04 802E2704 ADF20018 */ sw $s2, 0x18($t7)
-/* 0A1F08 802E2708 8E230000 */ lw $v1, ($s1)
-/* 0A1F0C 802E270C 00660019 */ multu $v1, $a2
-/* 0A1F10 802E2710 246B0001 */ addiu $t3, $v1, 1
-/* 0A1F14 802E2714 0000C012 */ mflo $t8
-/* 0A1F18 802E2718 0238C821 */ addu $t9, $s1, $t8
-/* 0A1F1C 802E271C 8F220014 */ lw $v0, 0x14($t9)
-/* 0A1F20 802E2720 AE2B0000 */ sw $t3, ($s1)
-.L80200BB4:
-/* 0A1F24 802E2724 8FBF0024 */ lw $ra, 0x24($sp)
-/* 0A1F28 802E2728 8FB00018 */ lw $s0, 0x18($sp)
-/* 0A1F2C 802E272C 8FB1001C */ lw $s1, 0x1c($sp)
-/* 0A1F30 802E2730 8FB20020 */ lw $s2, 0x20($sp)
-/* 0A1F34 802E2734 03E00008 */ jr $ra
-/* 0A1F38 802E2738 27BD0058 */ addiu $sp, $sp, 0x58
diff --git a/asm/non_matchings/eu/audio/func_eu_802e00d8.s b/asm/non_matchings/eu/audio/func_eu_802e00d8.s
@@ -1,88 +0,0 @@
-glabel func_eu_802e00d8
-/* 09F8D8 802E00D8 27BDFFD0 */ addiu $sp, $sp, -0x30
-/* 09F8DC 802E00DC AFA50034 */ sw $a1, 0x34($sp)
-/* 09F8E0 802E00E0 87B80036 */ lh $t8, 0x36($sp)
-/* 09F8E4 802E00E4 3C088022 */ lui $t0, %hi(gSynthesisReverbs) # $t0, 0x8022
-/* 09F8E8 802E00E8 2508C1B0 */ addiu $t0, %lo(gSynthesisReverbs) # addiu $t0, $t0, -0x3e50
-/* 09F8EC 802E00EC 0018C940 */ sll $t9, $t8, 5
-/* 09F8F0 802E00F0 0338C821 */ addu $t9, $t9, $t8
-/* 09F8F4 802E00F4 0019C8C0 */ sll $t9, $t9, 3
-/* 09F8F8 802E00F8 03281021 */ addu $v0, $t9, $t0
-/* 09F8FC 802E00FC 90490003 */ lbu $t1, 3($v0)
-/* 09F900 802E0100 00067400 */ sll $t6, $a2, 0x10
-/* 09F904 802E0104 000E7C03 */ sra $t7, $t6, 0x10
-/* 09F908 802E0108 00095080 */ sll $t2, $t1, 2
-/* 09F90C 802E010C 01495023 */ subu $t2, $t2, $t1
-/* 09F910 802E0110 000A50C0 */ sll $t2, $t2, 3
-/* 09F914 802E0114 000F3880 */ sll $a3, $t7, 2
-/* 09F918 802E0118 01495021 */ addu $t2, $t2, $t1
-/* 09F91C 802E011C 904C0001 */ lbu $t4, 1($v0)
-/* 09F920 802E0120 000A5080 */ sll $t2, $t2, 2
-/* 09F924 802E0124 00EF3821 */ addu $a3, $a3, $t7
-/* 09F928 802E0128 00073880 */ sll $a3, $a3, 2
-/* 09F92C 802E012C 004A5821 */ addu $t3, $v0, $t2
-/* 09F930 802E0130 AFB00020 */ sw $s0, 0x20($sp)
-/* 09F934 802E0134 01671821 */ addu $v1, $t3, $a3
-/* 09F938 802E0138 00808025 */ move $s0, $a0
-/* 09F93C 802E013C AFBF0024 */ sw $ra, 0x24($sp)
-/* 09F940 802E0140 AFA60038 */ sw $a2, 0x38($sp)
-/* 09F944 802E0144 11800033 */ beqz $t4, .L80200BC4
-/* 09F948 802E0148 24630030 */ addiu $v1, $v1, 0x30
-/* 09F94C 802E014C 904D0004 */ lbu $t5, 4($v0)
-/* 09F950 802E0150 24010001 */ li $at, 1
-/* 09F954 802E0154 3C190800 */ lui $t9, 0x800
-/* 09F958 802E0158 15A10018 */ bne $t5, $at, .L80200B6C
-/* 09F95C 802E015C 3C080740 */ lui $t0, (0x07400280 >> 16) # lui $t0, 0x740
-/* 09F960 802E0160 87AE0036 */ lh $t6, 0x36($sp)
-/* 09F964 802E0164 9466000E */ lhu $a2, 0xe($v1)
-/* 09F968 802E0168 84670010 */ lh $a3, 0x10($v1)
-/* 09F96C 802E016C AFA3002C */ sw $v1, 0x2c($sp)
-/* 09F970 802E0170 24050740 */ li $a1, 1856
-/* 09F974 802E0174 0C0B7E65 */ jal synthesis_save_reverb_ring_buffer
-/* 09F978 802E0178 AFAE0010 */ sw $t6, 0x10($sp)
-/* 09F97C 802E017C 8FA3002C */ lw $v1, 0x2c($sp)
-/* 09F980 802E0180 00408025 */ move $s0, $v0
-/* 09F984 802E0184 00402025 */ move $a0, $v0
-/* 09F988 802E0188 84670012 */ lh $a3, 0x12($v1)
-/* 09F98C 802E018C 87B80036 */ lh $t8, 0x36($sp)
-/* 09F990 802E0190 50E00021 */ beql $a3, $zero, .L80200BC8
-/* 09F994 802E0194 8FBF0024 */ lw $ra, 0x24($sp)
-/* 09F998 802E0198 84650010 */ lh $a1, 0x10($v1)
-/* 09F99C 802E019C AFB80010 */ sw $t8, 0x10($sp)
-/* 09F9A0 802E01A0 00003025 */ move $a2, $zero
-/* 09F9A4 802E01A4 24A50740 */ addiu $a1, $a1, 0x740
-/* 09F9A8 802E01A8 30AFFFFF */ andi $t7, $a1, 0xffff
-/* 09F9AC 802E01AC 0C0B7E65 */ jal synthesis_save_reverb_ring_buffer
-/* 09F9B0 802E01B0 01E02825 */ move $a1, $t7
-/* 09F9B4 802E01B4 10000017 */ b .L80200BC4
-/* 09F9B8 802E01B8 00408025 */ move $s0, $v0
-.L80200B6C:
-/* 09F9BC 802E01BC 02001825 */ move $v1, $s0
-/* 09F9C0 802E01C0 26100008 */ addiu $s0, $s0, 8
-/* 09F9C4 802E01C4 35080280 */ ori $t0, (0x07400280 & 0xFFFF) # ori $t0, $t0, 0x280
-/* 09F9C8 802E01C8 AC680004 */ sw $t0, 4($v1)
-/* 09F9CC 802E01CC AC790000 */ sw $t9, ($v1)
-/* 09F9D0 802E01D0 02002025 */ move $a0, $s0
-/* 09F9D4 802E01D4 3C090600 */ lui $t1, 0x600
-/* 09F9D8 802E01D8 AC890000 */ sw $t1, ($a0)
-/* 09F9DC 802E01DC 904A0003 */ lbu $t2, 3($v0)
-/* 09F9E0 802E01E0 3C018000 */ lui $at, 0x8000
-/* 09F9E4 802E01E4 26100008 */ addiu $s0, $s0, 8
-/* 09F9E8 802E01E8 000A5880 */ sll $t3, $t2, 2
-/* 09F9EC 802E01EC 016A5823 */ subu $t3, $t3, $t2
-/* 09F9F0 802E01F0 000B58C0 */ sll $t3, $t3, 3
-/* 09F9F4 802E01F4 016A5821 */ addu $t3, $t3, $t2
-/* 09F9F8 802E01F8 000B5880 */ sll $t3, $t3, 2
-/* 09F9FC 802E01FC 004B6021 */ addu $t4, $v0, $t3
-/* 09FA00 802E0200 01876821 */ addu $t5, $t4, $a3
-/* 09FA04 802E0204 8DAE0034 */ lw $t6, 0x34($t5)
-/* 09FA08 802E0208 01C17821 */ addu $t7, $t6, $at
-/* 09FA0C 802E020C AC8F0004 */ sw $t7, 4($a0)
-/* 09FA10 802E0210 A0400000 */ sb $zero, ($v0)
-.L80200BC4:
-/* 09FA14 802E0214 8FBF0024 */ lw $ra, 0x24($sp)
-.L80200BC8:
-/* 09FA18 802E0218 02001025 */ move $v0, $s0
-/* 09FA1C 802E021C 8FB00020 */ lw $s0, 0x20($sp)
-/* 09FA20 802E0220 03E00008 */ jr $ra
-/* 09FA24 802E0224 27BD0030 */ addiu $sp, $sp, 0x30
diff --git a/asm/non_matchings/eu/audio/note_apply_headset_pan_effects.s b/asm/non_matchings/eu/audio/note_apply_headset_pan_effects.s
@@ -1,263 +0,0 @@
-glabel note_apply_headset_pan_effects
-/* 0A0F98 802E1798 27BDFFD8 */ addiu $sp, $sp, -0x28
-/* 0A0F9C 802E179C 8FAE003C */ lw $t6, 0x3c($sp)
-/* 0A0FA0 802E17A0 AFB00004 */ sw $s0, 4($sp)
-/* 0A0FA4 802E17A4 24020001 */ li $v0, 1
-/* 0A0FA8 802E17A8 11C20006 */ beq $t6, $v0, .L80202174
-/* 0A0FAC 802E17AC 00C08025 */ move $s0, $a2
-/* 0A0FB0 802E17B0 24010002 */ li $at, 2
-/* 0A0FB4 802E17B4 11C10009 */ beq $t6, $at, .L8020218C
-/* 0A0FB8 802E17B8 240A0600 */ li $t2, 1536
-/* 0A0FBC 802E17BC 100000E8 */ b .L80202510
-/* 0A0FC0 802E17C0 00801025 */ move $v0, $a0
-.L80202174:
-/* 0A0FC4 802E17C4 90A60003 */ lbu $a2, 3($a1)
-/* 0A0FC8 802E17C8 92080002 */ lbu $t0, 2($s0)
-/* 0A0FCC 802E17CC 240A04C0 */ li $t2, 1216
-/* 0A0FD0 802E17D0 A2000003 */ sb $zero, 3($s0)
-/* 0A0FD4 802E17D4 10000008 */ b .L802021A8
-/* 0A0FD8 802E17D8 A2060002 */ sb $a2, 2($s0)
-.L8020218C:
-/* 0A0FDC 802E17DC 90A60004 */ lbu $a2, 4($a1)
-/* 0A0FE0 802E17E0 92080003 */ lbu $t0, 3($s0)
-/* 0A0FE4 802E17E4 A2000002 */ sb $zero, 2($s0)
-/* 0A0FE8 802E17E8 10000003 */ b .L802021A8
-/* 0A0FEC 802E17EC A2060003 */ sb $a2, 3($s0)
-/* 0A0FF0 802E17F0 100000DB */ b .L80202510
-/* 0A0FF4 802E17F4 00801025 */ move $v0, $a0
-.L802021A8:
-/* 0A0FF8 802E17F8 8FAF0038 */ lw $t7, 0x38($sp)
-/* 0A0FFC 802E17FC 30E5FFFF */ andi $a1, $a3, 0xffff
-/* 0A1000 802E1800 3C180A00 */ lui $t8, 0xa00
-/* 0A1004 802E1804 51E200A5 */ beql $t7, $v0, .L8020244C
-/* 0A1008 802E1808 00801825 */ move $v1, $a0
-/* 0A100C 802E180C 15000047 */ bnez $t0, .L802022DC
-/* 0A1010 802E1810 01002825 */ move $a1, $t0
-/* 0A1014 802E1814 00801825 */ move $v1, $a0
-/* 0A1018 802E1818 3C020A00 */ lui $v0, (0x0A000200 >> 16) # lui $v0, 0xa00
-/* 0A101C 802E181C 24840008 */ addiu $a0, $a0, 8
-/* 0A1020 802E1820 24180008 */ li $t8, 8
-/* 0A1024 802E1824 34420200 */ ori $v0, (0x0A000200 & 0xFFFF) # ori $v0, $v0, 0x200
-/* 0A1028 802E1828 AC780004 */ sw $t8, 4($v1)
-/* 0A102C 802E182C 00805825 */ move $t3, $a0
-/* 0A1030 802E1830 3C190200 */ lui $t9, (0x02000008 >> 16) # lui $t9, 0x200
-/* 0A1034 802E1834 AC620000 */ sw $v0, ($v1)
-/* 0A1038 802E1838 37390008 */ ori $t9, (0x02000008 & 0xFFFF) # ori $t9, $t9, 8
-/* 0A103C 802E183C 24840008 */ addiu $a0, $a0, 8
-/* 0A1040 802E1840 AD790000 */ sw $t9, ($t3)
-/* 0A1044 802E1844 240E0008 */ li $t6, 8
-/* 0A1048 802E1848 00806025 */ move $t4, $a0
-/* 0A104C 802E184C AD6E0004 */ sw $t6, 4($t3)
-/* 0A1050 802E1850 24840008 */ addiu $a0, $a0, 8
-/* 0A1054 802E1854 3C0F0010 */ lui $t7, (0x00100010 >> 16) # lui $t7, 0x10
-/* 0A1058 802E1858 35EF0010 */ ori $t7, (0x00100010 & 0xFFFF) # ori $t7, $t7, 0x10
-/* 0A105C 802E185C 00806825 */ move $t5, $a0
-/* 0A1060 802E1860 AD8F0004 */ sw $t7, 4($t4)
-/* 0A1064 802E1864 AD820000 */ sw $v0, ($t4)
-/* 0A1068 802E1868 24190020 */ li $t9, 32
-/* 0A106C 802E186C 3C180800 */ lui $t8, 0x800
-/* 0A1070 802E1870 ADB80000 */ sw $t8, ($t5)
-/* 0A1074 802E1874 ADB90004 */ sw $t9, 4($t5)
-/* 0A1078 802E1878 24840008 */ addiu $a0, $a0, 8
-/* 0A107C 802E187C AFA4000C */ sw $a0, 0xc($sp)
-/* 0A1080 802E1880 8FAF000C */ lw $t7, 0xc($sp)
-/* 0A1084 802E1884 3C0E0600 */ lui $t6, 0x600
-/* 0A1088 802E1888 3C098000 */ lui $t1, (0x80000090 >> 16) # lui $t1, 0x8000
-/* 0A108C 802E188C ADEE0000 */ sw $t6, ($t7)
-/* 0A1090 802E1890 8E18000C */ lw $t8, 0xc($s0)
-/* 0A1094 802E1894 35290090 */ ori $t1, (0x80000090 & 0xFFFF) # ori $t1, $t1, 0x90
-/* 0A1098 802E1898 00E67021 */ addu $t6, $a3, $a2
-/* 0A109C 802E189C 0309C821 */ addu $t9, $t8, $t1
-/* 0A10A0 802E18A0 0007C3C0 */ sll $t8, $a3, 0xf
-/* 0A10A4 802E18A4 01C51823 */ subu $v1, $t6, $a1
-/* 0A10A8 802E18A8 ADF90004 */ sw $t9, 4($t7)
-/* 0A10AC 802E18AC 24790008 */ addiu $t9, $v1, 8
-/* 0A10B0 802E18B0 0319001A */ div $zero, $t8, $t9
-/* 0A10B4 802E18B4 24840008 */ addiu $a0, $a0, 8
-/* 0A10B8 802E18B8 17200002 */ bnez $t9, .L80202274
-/* 0A10BC 802E18BC 00000000 */ nop
-/* 0A10C0 802E18C0 0007000D */ break 7
-.L80202274:
-/* 0A10C4 802E18C4 2401FFFF */ li $at, -1
-/* 0A10C8 802E18C8 17210004 */ bne $t9, $at, .L8020228C
-/* 0A10CC 802E18CC 3C018000 */ lui $at, 0x8000
-/* 0A10D0 802E18D0 17010002 */ bne $t8, $at, .L8020228C
-/* 0A10D4 802E18D4 00000000 */ nop
-/* 0A10D8 802E18D8 0006000D */ break 6
-.L8020228C:
-/* 0A10DC 802E18DC 00005812 */ mflo $t3
-/* 0A10E0 802E18E0 00806025 */ move $t4, $a0
-/* 0A10E4 802E18E4 316FFFFF */ andi $t7, $t3, 0xffff
-/* 0A10E8 802E18E8 3C0E0800 */ lui $t6, (0x08000208 >> 16) # lui $t6, 0x800
-/* 0A10EC 802E18EC 35CE0208 */ ori $t6, (0x08000208 & 0xFFFF) # ori $t6, $t6, 0x208
-/* 0A10F0 802E18F0 24840008 */ addiu $a0, $a0, 8
-/* 0A10F4 802E18F4 3062FFFF */ andi $v0, $v1, 0xffff
-/* 0A10F8 802E18F8 31F8FFFF */ andi $t8, $t7, 0xffff
-/* 0A10FC 802E18FC 3C010500 */ lui $at, 0x500
-/* 0A1100 802E1900 AD820004 */ sw $v0, 4($t4)
-/* 0A1104 802E1904 AD8E0000 */ sw $t6, ($t4)
-/* 0A1108 802E1908 0301C825 */ or $t9, $t8, $at
-/* 0A110C 802E190C 00806825 */ move $t5, $a0
-/* 0A1110 802E1910 01E05825 */ move $t3, $t7
-/* 0A1114 802E1914 ADB90000 */ sw $t9, ($t5)
-/* 0A1118 802E1918 8E0F000C */ lw $t7, 0xc($s0)
-/* 0A111C 802E191C 24840008 */ addiu $a0, $a0, 8
-/* 0A1120 802E1920 01E97021 */ addu $t6, $t7, $t1
-/* 0A1124 802E1924 10000038 */ b .L802023B8
-/* 0A1128 802E1928 ADAE0004 */ sw $t6, 4($t5)
-.L802022DC:
-/* 0A112C 802E192C 14C00014 */ bnez $a2, .L80202330
-/* 0A1130 802E1930 00C01025 */ move $v0, $a2
-/* 0A1134 802E1934 00E5C823 */ subu $t9, $a3, $a1
-/* 0A1138 802E1938 272FFFFC */ addiu $t7, $t9, -4
-/* 0A113C 802E193C 0007C3C0 */ sll $t8, $a3, 0xf
-/* 0A1140 802E1940 030F001A */ div $zero, $t8, $t7
-/* 0A1144 802E1944 00005812 */ mflo $t3
-/* 0A1148 802E1948 316EFFFF */ andi $t6, $t3, 0xffff
-/* 0A114C 802E194C 15E00002 */ bnez $t7, .L80202308
-/* 0A1150 802E1950 00000000 */ nop
-/* 0A1154 802E1954 0007000D */ break 7
-.L80202308:
-/* 0A1158 802E1958 2401FFFF */ li $at, -1
-/* 0A115C 802E195C 15E10004 */ bne $t7, $at, .L80202320
-/* 0A1160 802E1960 3C018000 */ lui $at, 0x8000
-/* 0A1164 802E1964 17010002 */ bne $t8, $at, .L80202320
-/* 0A1168 802E1968 00000000 */ nop
-/* 0A116C 802E196C 0006000D */ break 6
-.L80202320:
-/* 0A1170 802E1970 00E2C821 */ addu $t9, $a3, $v0
-/* 0A1174 802E1974 03251823 */ subu $v1, $t9, $a1
-/* 0A1178 802E1978 10000011 */ b .L80202370
-/* 0A117C 802E197C 01C05825 */ move $t3, $t6
-.L80202330:
-/* 0A1180 802E1980 00E2C021 */ addu $t8, $a3, $v0
-/* 0A1184 802E1984 03051823 */ subu $v1, $t8, $a1
-/* 0A1188 802E1988 00077BC0 */ sll $t7, $a3, 0xf
-/* 0A118C 802E198C 01E3001A */ div $zero, $t7, $v1
-/* 0A1190 802E1990 00005812 */ mflo $t3
-/* 0A1194 802E1994 316EFFFF */ andi $t6, $t3, 0xffff
-/* 0A1198 802E1998 01C05825 */ move $t3, $t6
-/* 0A119C 802E199C 14600002 */ bnez $v1, .L80202358
-/* 0A11A0 802E19A0 00000000 */ nop
-/* 0A11A4 802E19A4 0007000D */ break 7
-.L80202358:
-/* 0A11A8 802E19A8 2401FFFF */ li $at, -1
-/* 0A11AC 802E19AC 14610004 */ bne $v1, $at, .L80202370
-/* 0A11B0 802E19B0 3C018000 */ lui $at, 0x8000
-/* 0A11B4 802E19B4 15E10002 */ bne $t7, $at, .L80202370
-/* 0A11B8 802E19B8 00000000 */ nop
-/* 0A11BC 802E19BC 0006000D */ break 6
-.L80202370:
-/* 0A11C0 802E19C0 00806025 */ move $t4, $a0
-/* 0A11C4 802E19C4 3C190800 */ lui $t9, (0x08000200 >> 16) # lui $t9, 0x800
-/* 0A11C8 802E19C8 37390200 */ ori $t9, (0x08000200 & 0xFFFF) # ori $t9, $t9, 0x200
-/* 0A11CC 802E19CC 24840008 */ addiu $a0, $a0, 8
-/* 0A11D0 802E19D0 3062FFFF */ andi $v0, $v1, 0xffff
-/* 0A11D4 802E19D4 3178FFFF */ andi $t8, $t3, 0xffff
-/* 0A11D8 802E19D8 3C010500 */ lui $at, 0x500
-/* 0A11DC 802E19DC AD820004 */ sw $v0, 4($t4)
-/* 0A11E0 802E19E0 AD990000 */ sw $t9, ($t4)
-/* 0A11E4 802E19E4 03017825 */ or $t7, $t8, $at
-/* 0A11E8 802E19E8 00806825 */ move $t5, $a0
-/* 0A11EC 802E19EC ADAF0000 */ sw $t7, ($t5)
-/* 0A11F0 802E19F0 8E0E000C */ lw $t6, 0xc($s0)
-/* 0A11F4 802E19F4 3C098000 */ lui $t1, %hi(0x80000004) # $t1, 0x8000
-/* 0A11F8 802E19F8 35290090 */ ori $t1, (0x80000090 & 0xFFFF) # ori $t1, $t1, 0x90
-/* 0A11FC 802E19FC 01C9C821 */ addu $t9, $t6, $t1
-/* 0A1200 802E1A00 ADB90004 */ sw $t9, 4($t5)
-/* 0A1204 802E1A04 24840008 */ addiu $a0, $a0, 8
-.L802023B8:
-/* 0A1208 802E1A08 10A0001B */ beqz $a1, .L80202428
-/* 0A120C 802E1A0C 00801825 */ move $v1, $a0
-/* 0A1210 802E1A10 00801825 */ move $v1, $a0
-/* 0A1214 802E1A14 3C180800 */ lui $t8, (0x08000200 >> 16) # lui $t8, 0x800
-/* 0A1218 802E1A18 37180200 */ ori $t8, (0x08000200 & 0xFFFF) # ori $t8, $t8, 0x200
-/* 0A121C 802E1A1C 24840008 */ addiu $a0, $a0, 8
-/* 0A1220 802E1A20 310FFFFF */ andi $t7, $t0, 0xffff
-/* 0A1224 802E1A24 AC6F0004 */ sw $t7, 4($v1)
-/* 0A1228 802E1A28 AC780000 */ sw $t8, ($v1)
-/* 0A122C 802E1A2C 00804825 */ move $t1, $a0
-/* 0A1230 802E1A30 3C0E0400 */ lui $t6, 0x400
-/* 0A1234 802E1A34 AD2E0000 */ sw $t6, ($t1)
-/* 0A1238 802E1A38 8E19000C */ lw $t9, 0xc($s0)
-/* 0A123C 802E1A3C 3C018000 */ lui $at, (0x800000B0 >> 16) # lui $at, 0x8000
-/* 0A1240 802E1A40 342100B0 */ ori $at, (0x800000B0 & 0xFFFF) # ori $at, $at, 0xb0
-/* 0A1244 802E1A44 0321C021 */ addu $t8, $t9, $at
-/* 0A1248 802E1A48 AD380004 */ sw $t8, %lo(0x80000004)($t1)
-/* 0A124C 802E1A4C 24840008 */ addiu $a0, $a0, 8
-/* 0A1250 802E1A50 00805825 */ move $t3, $a0
-/* 0A1254 802E1A54 24B90200 */ addiu $t9, $a1, 0x200
-/* 0A1258 802E1A58 3C0F0A00 */ lui $t7, 0xa00
-/* 0A125C 802E1A5C AD6F0000 */ sw $t7, ($t3)
-/* 0A1260 802E1A60 0019C400 */ sll $t8, $t9, 0x10
-/* 0A1264 802E1A64 03027825 */ or $t7, $t8, $v0
-/* 0A1268 802E1A68 AD6F0004 */ sw $t7, 4($t3)
-/* 0A126C 802E1A6C 24840008 */ addiu $a0, $a0, 8
-/* 0A1270 802E1A70 1000001C */ b .L80202494
-/* 0A1274 802E1A74 30E5FFFF */ andi $a1, $a3, 0xffff
-.L80202428:
-/* 0A1278 802E1A78 3C010200 */ lui $at, 0x200
-/* 0A127C 802E1A7C 0041C825 */ or $t9, $v0, $at
-/* 0A1280 802E1A80 3C0E0A00 */ lui $t6, 0xa00
-/* 0A1284 802E1A84 AC6E0000 */ sw $t6, ($v1)
-/* 0A1288 802E1A88 AC790004 */ sw $t9, 4($v1)
-/* 0A128C 802E1A8C 24840008 */ addiu $a0, $a0, 8
-/* 0A1290 802E1A90 10000014 */ b .L80202494
-/* 0A1294 802E1A94 30E5FFFF */ andi $a1, $a3, 0xffff
-/* 0A1298 802E1A98 00801825 */ move $v1, $a0
-.L8020244C:
-/* 0A129C 802E1A9C 3C020A00 */ lui $v0, %hi(0x0A000004) # $v0, 0xa00
-/* 0A12A0 802E1AA0 24840008 */ addiu $a0, $a0, 8
-/* 0A12A4 802E1AA4 34420200 */ ori $v0, (0x0A000200 & 0xFFFF) # ori $v0, $v0, 0x200
-/* 0A12A8 802E1AA8 00804025 */ move $t0, $a0
-/* 0A12AC 802E1AAC AC620000 */ sw $v0, ($v1)
-/* 0A12B0 802E1AB0 AC650004 */ sw $a1, 4($v1)
-/* 0A12B4 802E1AB4 24CE0200 */ addiu $t6, $a2, 0x200
-/* 0A12B8 802E1AB8 000ECC00 */ sll $t9, $t6, 0x10
-/* 0A12BC 802E1ABC AD180000 */ sw $t8, ($t0)
-/* 0A12C0 802E1AC0 24840008 */ addiu $a0, $a0, 8
-/* 0A12C4 802E1AC4 0325C025 */ or $t8, $t9, $a1
-/* 0A12C8 802E1AC8 00804825 */ move $t1, $a0
-/* 0A12CC 802E1ACC AD180004 */ sw $t8, 4($t0)
-/* 0A12D0 802E1AD0 3C0F0200 */ lui $t7, (0x02000200 >> 16) # lui $t7, 0x200
-/* 0A12D4 802E1AD4 35EF0200 */ ori $t7, (0x02000200 & 0xFFFF) # ori $t7, $t7, 0x200
-/* 0A12D8 802E1AD8 AD2F0000 */ sw $t7, ($t1)
-/* 0A12DC 802E1ADC AD260004 */ sw $a2, %lo(0x80000004)($t1)
-/* 0A12E0 802E1AE0 24840008 */ addiu $a0, $a0, 8
-.L80202494:
-/* 0A12E4 802E1AE4 10C00012 */ beqz $a2, .L802024E0
-/* 0A12E8 802E1AE8 00801025 */ move $v0, $a0
-/* 0A12EC 802E1AEC 3C0E0800 */ lui $t6, 0x800
-/* 0A12F0 802E1AF0 AC4E0000 */ sw $t6, ($v0)
-/* 0A12F4 802E1AF4 24F80200 */ addiu $t8, $a3, 0x200
-/* 0A12F8 802E1AF8 00187C00 */ sll $t7, $t8, 0x10
-/* 0A12FC 802E1AFC 30CEFFFF */ andi $t6, $a2, 0xffff
-/* 0A1300 802E1B00 01EEC825 */ or $t9, $t7, $t6
-/* 0A1304 802E1B04 24840008 */ addiu $a0, $a0, 8
-/* 0A1308 802E1B08 AC590004 */ sw $t9, %lo(0x0A000004)($v0)
-/* 0A130C 802E1B0C 00801825 */ move $v1, $a0
-/* 0A1310 802E1B10 3C180600 */ lui $t8, 0x600
-/* 0A1314 802E1B14 AC780000 */ sw $t8, ($v1)
-/* 0A1318 802E1B18 8E0F000C */ lw $t7, 0xc($s0)
-/* 0A131C 802E1B1C 3C018000 */ lui $at, (0x800000B0 >> 16) # lui $at, 0x8000
-/* 0A1320 802E1B20 342100B0 */ ori $at, (0x800000B0 & 0xFFFF) # ori $at, $at, 0xb0
-/* 0A1324 802E1B24 01E17021 */ addu $t6, $t7, $at
-/* 0A1328 802E1B28 AC6E0004 */ sw $t6, 4($v1)
-/* 0A132C 802E1B2C 24840008 */ addiu $a0, $a0, 8
-.L802024E0:
-/* 0A1330 802E1B30 24860008 */ addiu $a2, $a0, 8
-/* 0A1334 802E1B34 3C190800 */ lui $t9, 0x800
-/* 0A1338 802E1B38 AC990000 */ sw $t9, ($a0)
-/* 0A133C 802E1B3C AC850004 */ sw $a1, 4($a0)
-/* 0A1340 802E1B40 3C180C00 */ lui $t8, (0x0C007FFF >> 16) # lui $t8, 0xc00
-/* 0A1344 802E1B44 314FFFFF */ andi $t7, $t2, 0xffff
-/* 0A1348 802E1B48 3C010200 */ lui $at, 0x200
-/* 0A134C 802E1B4C 01E17025 */ or $t6, $t7, $at
-/* 0A1350 802E1B50 37187FFF */ ori $t8, (0x0C007FFF & 0xFFFF) # ori $t8, $t8, 0x7fff
-/* 0A1354 802E1B54 ACD80000 */ sw $t8, ($a2)
-/* 0A1358 802E1B58 ACCE0004 */ sw $t6, 4($a2)
-/* 0A135C 802E1B5C 24C20008 */ addiu $v0, $a2, 8
-.L80202510:
-/* 0A1360 802E1B60 8FB00004 */ lw $s0, 4($sp)
-/* 0A1364 802E1B64 03E00008 */ jr $ra
-/* 0A1368 802E1B68 27BD0028 */ addiu $sp, $sp, 0x28
diff --git a/asm/non_matchings/eu/audio/prepare_reverb_ring_buffer.s b/asm/non_matchings/eu/audio/prepare_reverb_ring_buffer.s
@@ -1,179 +0,0 @@
-glabel prepare_reverb_ring_buffer
-/* 09EE50 802DF650 00067140 */ sll $t6, $a2, 5
-/* 09EE54 802DF654 01C67021 */ addu $t6, $t6, $a2
-/* 09EE58 802DF658 3C0F8022 */ lui $t7, %hi(gSynthesisReverbs) # $t7, 0x8022
-/* 09EE5C 802DF65C 25EFC1B0 */ addiu $t7, %lo(gSynthesisReverbs) # addiu $t7, $t7, -0x3e50
-/* 09EE60 802DF660 000E70C0 */ sll $t6, $t6, 3
-/* 09EE64 802DF664 01CF3821 */ addu $a3, $t6, $t7
-/* 09EE68 802DF668 90F80004 */ lbu $t8, 4($a3)
-/* 09EE6C 802DF66C 27BDFFC0 */ addiu $sp, $sp, -0x40
-/* 09EE70 802DF670 24010001 */ li $at, 1
-/* 09EE74 802DF674 AFBF0014 */ sw $ra, 0x14($sp)
-/* 09EE78 802DF678 AFA40040 */ sw $a0, 0x40($sp)
-/* 09EE7C 802DF67C 13010062 */ beq $t8, $at, .L802001B8
-/* 09EE80 802DF680 AFA50044 */ sw $a1, 0x44($sp)
-/* 09EE84 802DF684 90F90002 */ lbu $t9, 2($a3)
-/* 09EE88 802DF688 00056080 */ sll $t4, $a1, 2
-/* 09EE8C 802DF68C 01856021 */ addu $t4, $t4, $a1
-/* 09EE90 802DF690 5720005E */ bnezl $t9, .L802001BC
-/* 09EE94 802DF694 90E90004 */ lbu $t1, 4($a3)
-/* 09EE98 802DF698 90E80003 */ lbu $t0, 3($a3)
-/* 09EE9C 802DF69C 000C6080 */ sll $t4, $t4, 2
-/* 09EEA0 802DF6A0 24050280 */ li $a1, 640
-/* 09EEA4 802DF6A4 00084880 */ sll $t1, $t0, 2
-/* 09EEA8 802DF6A8 01284823 */ subu $t1, $t1, $t0
-/* 09EEAC 802DF6AC 000948C0 */ sll $t1, $t1, 3
-/* 09EEB0 802DF6B0 01284821 */ addu $t1, $t1, $t0
-/* 09EEB4 802DF6B4 00094880 */ sll $t1, $t1, 2
-/* 09EEB8 802DF6B8 00E95021 */ addu $t2, $a3, $t1
-/* 09EEBC 802DF6BC 014C3021 */ addu $a2, $t2, $t4
-/* 09EEC0 802DF6C0 24C60030 */ addiu $a2, $a2, 0x30
-/* 09EEC4 802DF6C4 8CC40004 */ lw $a0, 4($a2)
-/* 09EEC8 802DF6C8 AFA70018 */ sw $a3, 0x18($sp)
-/* 09EECC 802DF6CC 0C0BC448 */ jal osInvalDCache
-/* 09EED0 802DF6D0 AFA6003C */ sw $a2, 0x3c($sp)
-/* 09EED4 802DF6D4 8FA6003C */ lw $a2, 0x3c($sp)
-/* 09EED8 802DF6D8 8FA70018 */ lw $a3, 0x18($sp)
-/* 09EEDC 802DF6DC 00002825 */ move $a1, $zero
-/* 09EEE0 802DF6E0 84CD0010 */ lh $t5, 0x10($a2)
-/* 09EEE4 802DF6E4 00002025 */ move $a0, $zero
-/* 09EEE8 802DF6E8 05A10003 */ bgez $t5, .L802000A8
-/* 09EEEC 802DF6EC 000D7043 */ sra $t6, $t5, 1
-/* 09EEF0 802DF6F0 25A10001 */ addiu $at, $t5, 1
-/* 09EEF4 802DF6F4 00017043 */ sra $t6, $at, 1
-.L802000A8:
-/* 09EEF8 802DF6F8 59C00023 */ blezl $t6, .L80200138
-/* 09EEFC 802DF6FC 84CE0012 */ lh $t6, 0x12($a2)
-/* 09EF00 802DF700 00001025 */ move $v0, $zero
-/* 09EF04 802DF704 8CCF0004 */ lw $t7, 4($a2)
-.L802000B8:
-/* 09EF08 802DF708 8CC9000C */ lw $t1, 0xc($a2)
-/* 09EF0C 802DF70C 8CE80018 */ lw $t0, 0x18($a3)
-/* 09EF10 802DF710 00051840 */ sll $v1, $a1, 1
-/* 09EF14 802DF714 01E3C021 */ addu $t8, $t7, $v1
-/* 09EF18 802DF718 87190000 */ lh $t9, ($t8)
-/* 09EF1C 802DF71C 00095840 */ sll $t3, $t1, 1
-/* 09EF20 802DF720 010B5021 */ addu $t2, $t0, $t3
-/* 09EF24 802DF724 01426021 */ addu $t4, $t2, $v0
-/* 09EF28 802DF728 A5990000 */ sh $t9, ($t4)
-/* 09EF2C 802DF72C 8CCD0008 */ lw $t5, 8($a2)
-/* 09EF30 802DF730 8CC9000C */ lw $t1, 0xc($a2)
-/* 09EF34 802DF734 8CF8001C */ lw $t8, 0x1c($a3)
-/* 09EF38 802DF738 01A37021 */ addu $t6, $t5, $v1
-/* 09EF3C 802DF73C 85CF0000 */ lh $t7, ($t6)
-/* 09EF40 802DF740 00094040 */ sll $t0, $t1, 1
-/* 09EF44 802DF744 03085821 */ addu $t3, $t8, $t0
-/* 09EF48 802DF748 01625021 */ addu $t2, $t3, $v0
-/* 09EF4C 802DF74C A54F0000 */ sh $t7, ($t2)
-/* 09EF50 802DF750 84CC0010 */ lh $t4, 0x10($a2)
-/* 09EF54 802DF754 90F90004 */ lbu $t9, 4($a3)
-/* 09EF58 802DF758 24840001 */ addiu $a0, $a0, 1
-/* 09EF5C 802DF75C 24420002 */ addiu $v0, $v0, 2
-/* 09EF60 802DF760 00B92821 */ addu $a1, $a1, $t9
-/* 09EF64 802DF764 05810003 */ bgez $t4, .L80200124
-/* 09EF68 802DF768 000C6843 */ sra $t5, $t4, 1
-/* 09EF6C 802DF76C 25810001 */ addiu $at, $t4, 1
-/* 09EF70 802DF770 00016843 */ sra $t5, $at, 1
-.L80200124:
-/* 09EF74 802DF774 008D082A */ slt $at, $a0, $t5
-/* 09EF78 802DF778 5420FFE3 */ bnezl $at, .L802000B8
-/* 09EF7C 802DF77C 8CCF0004 */ lw $t7, 4($a2)
-/* 09EF80 802DF780 00002025 */ move $a0, $zero
-/* 09EF84 802DF784 84CE0012 */ lh $t6, 0x12($a2)
-.L80200138:
-/* 09EF88 802DF788 05C10003 */ bgez $t6, .L80200148
-/* 09EF8C 802DF78C 000E4843 */ sra $t1, $t6, 1
-/* 09EF90 802DF790 25C10001 */ addiu $at, $t6, 1
-/* 09EF94 802DF794 00014843 */ sra $t1, $at, 1
-.L80200148:
-/* 09EF98 802DF798 5920001C */ blezl $t1, .L802001BC
-/* 09EF9C 802DF79C 90E90004 */ lbu $t1, 4($a3)
-/* 09EFA0 802DF7A0 00001025 */ move $v0, $zero
-/* 09EFA4 802DF7A4 8CD80004 */ lw $t8, 4($a2)
-.L80200158:
-/* 09EFA8 802DF7A8 00051840 */ sll $v1, $a1, 1
-/* 09EFAC 802DF7AC 8CEF0018 */ lw $t7, 0x18($a3)
-/* 09EFB0 802DF7B0 03034021 */ addu $t0, $t8, $v1
-/* 09EFB4 802DF7B4 850B0000 */ lh $t3, ($t0)
-/* 09EFB8 802DF7B8 01E25021 */ addu $t2, $t7, $v0
-/* 09EFBC 802DF7BC 24840001 */ addiu $a0, $a0, 1
-/* 09EFC0 802DF7C0 A54B0000 */ sh $t3, ($t2)
-/* 09EFC4 802DF7C4 8CD90008 */ lw $t9, 8($a2)
-/* 09EFC8 802DF7C8 8CEE001C */ lw $t6, 0x1c($a3)
-/* 09EFCC 802DF7CC 03236021 */ addu $t4, $t9, $v1
-/* 09EFD0 802DF7D0 858D0000 */ lh $t5, ($t4)
-/* 09EFD4 802DF7D4 01C24821 */ addu $t1, $t6, $v0
-/* 09EFD8 802DF7D8 24420002 */ addiu $v0, $v0, 2
-/* 09EFDC 802DF7DC A52D0000 */ sh $t5, ($t1)
-/* 09EFE0 802DF7E0 84C80012 */ lh $t0, 0x12($a2)
-/* 09EFE4 802DF7E4 90F80004 */ lbu $t8, 4($a3)
-/* 09EFE8 802DF7E8 00B82821 */ addu $a1, $a1, $t8
-/* 09EFEC 802DF7EC 05010003 */ bgez $t0, .L802001AC
-/* 09EFF0 802DF7F0 00087843 */ sra $t7, $t0, 1
-/* 09EFF4 802DF7F4 25010001 */ addiu $at, $t0, 1
-/* 09EFF8 802DF7F8 00017843 */ sra $t7, $at, 1
-.L802001AC:
-/* 09EFFC 802DF7FC 008F082A */ slt $at, $a0, $t7
-/* 09F000 802DF800 5420FFE9 */ bnezl $at, .L80200158
-/* 09F004 802DF804 8CD80004 */ lw $t8, 4($a2)
-.L802001B8:
-/* 09F008 802DF808 90E90004 */ lbu $t1, 4($a3)
-.L802001BC:
-/* 09F00C 802DF80C 8FAD0040 */ lw $t5, 0x40($sp)
-/* 09F010 802DF810 90EB0003 */ lbu $t3, 3($a3)
-/* 09F014 802DF814 8FAC0044 */ lw $t4, 0x44($sp)
-/* 09F018 802DF818 01A9001A */ div $zero, $t5, $t1
-/* 09F01C 802DF81C 000B5080 */ sll $t2, $t3, 2
-/* 09F020 802DF820 8CF8000C */ lw $t8, 0xc($a3)
-/* 09F024 802DF824 014B5023 */ subu $t2, $t2, $t3
-/* 09F028 802DF828 8CEF0014 */ lw $t7, 0x14($a3)
-/* 09F02C 802DF82C 000A50C0 */ sll $t2, $t2, 3
-/* 09F030 802DF830 00001012 */ mflo $v0
-/* 09F034 802DF834 014B5021 */ addu $t2, $t2, $t3
-/* 09F038 802DF838 000C7080 */ sll $t6, $t4, 2
-/* 09F03C 802DF83C 000A5080 */ sll $t2, $t2, 2
-/* 09F040 802DF840 01CC7021 */ addu $t6, $t6, $t4
-/* 09F044 802DF844 03024021 */ addu $t0, $t8, $v0
-/* 09F048 802DF848 000E7080 */ sll $t6, $t6, 2
-/* 09F04C 802DF84C 00EAC821 */ addu $t9, $a3, $t2
-/* 09F050 802DF850 010F1823 */ subu $v1, $t0, $t7
-/* 09F054 802DF854 032E3021 */ addu $a2, $t9, $t6
-/* 09F058 802DF858 24C60030 */ addiu $a2, $a2, 0x30
-/* 09F05C 802DF85C 15200002 */ bnez $t1, .L80200218
-/* 09F060 802DF860 00000000 */ nop
-/* 09F064 802DF864 0007000D */ break 7
-.L80200218:
-/* 09F068 802DF868 2401FFFF */ li $at, -1
-/* 09F06C 802DF86C 15210004 */ bne $t1, $at, .L80200230
-/* 09F070 802DF870 3C018000 */ lui $at, 0x8000
-/* 09F074 802DF874 15A10002 */ bne $t5, $at, .L80200230
-/* 09F078 802DF878 00000000 */ nop
-/* 09F07C 802DF87C 0006000D */ break 6
-.L80200230:
-/* 09F080 802DF880 00437023 */ subu $t6, $v0, $v1
-/* 09F084 802DF884 0461000A */ bgez $v1, .L80200260
-/* 09F088 802DF888 00034840 */ sll $t1, $v1, 1
-/* 09F08C 802DF88C 00025840 */ sll $t3, $v0, 1
-/* 09F090 802DF890 A4CB0010 */ sh $t3, 0x10($a2)
-/* 09F094 802DF894 A4C00012 */ sh $zero, 0x12($a2)
-/* 09F098 802DF898 8CEA000C */ lw $t2, 0xc($a3)
-/* 09F09C 802DF89C ACCA000C */ sw $t2, 0xc($a2)
-/* 09F0A0 802DF8A0 8CEC000C */ lw $t4, 0xc($a3)
-/* 09F0A4 802DF8A4 0182C821 */ addu $t9, $t4, $v0
-/* 09F0A8 802DF8A8 10000007 */ b .L80200278
-/* 09F0AC 802DF8AC ACF9000C */ sw $t9, 0xc($a3)
-.L80200260:
-/* 09F0B0 802DF8B0 000E6840 */ sll $t5, $t6, 1
-/* 09F0B4 802DF8B4 A4CD0010 */ sh $t5, 0x10($a2)
-/* 09F0B8 802DF8B8 A4C90012 */ sh $t1, 0x12($a2)
-/* 09F0BC 802DF8BC 8CF8000C */ lw $t8, 0xc($a3)
-/* 09F0C0 802DF8C0 ACD8000C */ sw $t8, 0xc($a2)
-/* 09F0C4 802DF8C4 ACE3000C */ sw $v1, 0xc($a3)
-.L80200278:
-/* 09F0C8 802DF8C8 A4C20000 */ sh $v0, ($a2)
-/* 09F0CC 802DF8CC 8FA80040 */ lw $t0, 0x40($sp)
-/* 09F0D0 802DF8D0 A4C80002 */ sh $t0, 2($a2)
-/* 09F0D4 802DF8D4 8FBF0014 */ lw $ra, 0x14($sp)
-/* 09F0D8 802DF8D8 27BD0040 */ addiu $sp, $sp, 0x40
-/* 09F0DC 802DF8DC 03E00008 */ jr $ra
-/* 09F0E0 802DF8E0 00000000 */ nop
diff --git a/asm/non_matchings/eu/audio/seq_channel_layer_process_script.s b/asm/non_matchings/eu/audio/seq_channel_layer_process_script.s
@@ -516,7 +516,7 @@ glabel L_EU_802E7B6C
/* 0A75E4 802E7DE4 91E40006 */ lbu $a0, 6($t7)
/* 0A75E8 802E7DE8 02584821 */ addu $t1, $s2, $t8
/* 0A75EC 802E7DEC 01289021 */ addu $s2, $t1, $t0
-/* 0A75F0 802E7DF0 0C0B93EE */ jal func_eu_802e4fb8
+/* 0A75F0 802E7DF0 0C0B93EE */ jal get_drum
/* 0A75F4 802E7DF4 324500FF */ andi $a1, $s2, 0xff
/* 0A75F8 802E7DF8 14400005 */ bnez $v0, .L80201E20
/* 0A75FC 802E7DFC 24430004 */ addiu $v1, $v0, 4
@@ -575,7 +575,7 @@ glabel L_EU_802E7B6C
.L80201EC8:
/* 0A76B8 802E7EB8 1080000A */ beqz $a0, .L80201EF4
/* 0A76BC 802E7EBC 3C013F80 */ li $at, 0x3F800000 # 1.000000
-/* 0A76C0 802E7EC0 0C0B9397 */ jal func_eu_802e4e5c
+/* 0A76C0 802E7EC0 0C0B9397 */ jal instrument_get_audio_bank_sound
/* 0A76C4 802E7EC4 00C02825 */ move $a1, $a2
/* 0A76C8 802E7EC8 8E2B0048 */ lw $t3, 0x48($s1)
/* 0A76CC 802E7ECC 004B6826 */ xor $t5, $v0, $t3
@@ -674,7 +674,7 @@ glabel L_EU_802E7F50
.L80202030:
/* 0A7820 802E8020 10800011 */ beqz $a0, .L80202078
/* 0A7824 802E8024 3C038030 */ lui $v1, %hi(gNoteFrequencies)
-/* 0A7828 802E8028 0C0B9397 */ jal func_eu_802e4e5c
+/* 0A7828 802E8028 0C0B9397 */ jal instrument_get_audio_bank_sound
/* 0A782C 802E802C 00000000 */ nop
/* 0A7830 802E8030 8E2C0048 */ lw $t4, 0x48($s1)
/* 0A7834 802E8034 3C038030 */ lui $v1, %hi(gNoteFrequencies) # $v1, 0x8030
diff --git a/asm/non_matchings/eu/audio/sequence_channel_enable.s b/asm/non_matchings/eu/audio/sequence_channel_enable.s
@@ -1,56 +0,0 @@
-glabel sequence_channel_enable
-/* 0A6BE8 802E73E8 27BDFFD8 */ addiu $sp, $sp, -0x28
-/* 0A6BEC 802E73EC 30AE00FF */ andi $t6, $a1, 0xff
-/* 0A6BF0 802E73F0 000E7880 */ sll $t7, $t6, 2
-/* 0A6BF4 802E73F4 AFBF0024 */ sw $ra, 0x24($sp)
-/* 0A6BF8 802E73F8 AFB30020 */ sw $s3, 0x20($sp)
-/* 0A6BFC 802E73FC AFB2001C */ sw $s2, 0x1c($sp)
-/* 0A6C00 802E7400 AFB10018 */ sw $s1, 0x18($sp)
-/* 0A6C04 802E7404 AFB00014 */ sw $s0, 0x14($sp)
-/* 0A6C08 802E7408 AFA5002C */ sw $a1, 0x2c($sp)
-/* 0A6C0C 802E740C 008FC021 */ addu $t8, $a0, $t7
-/* 0A6C10 802E7410 8F120030 */ lw $s2, 0x30($t8)
-/* 0A6C14 802E7414 3C198023 */ lui $t9, %hi(gSequenceChannelNone) # $t9, 0x8023
-/* 0A6C18 802E7418 27398748 */ addiu $t9, %lo(gSequenceChannelNone) # addiu $t9, $t9, -0x78b8
-/* 0A6C1C 802E741C 1659000A */ bne $s2, $t9, .L80201458
-/* 0A6C20 802E7420 00008025 */ move $s0, $zero
-/* 0A6C24 802E7424 3C098022 */ lui $t1, %hi(gSequencePlayers) # $t1, 0x8022
-/* 0A6C28 802E7428 25293D68 */ addiu $t1, %lo(gSequencePlayers) # addiu $t1, $t1, 0x3d68
-/* 0A6C2C 802E742C 10890019 */ beq $a0, $t1, .L802014A4
-/* 0A6C30 802E7430 3C0A8022 */ lui $t2, %hi(gSequencePlayers + 0x148) # $t2, 0x8022
-/* 0A6C34 802E7434 254A3EB0 */ addiu $t2, %lo(gSequencePlayers + 0x148) # addiu $t2, $t2, 0x3eb0
-/* 0A6C38 802E7438 548A0017 */ bnel $a0, $t2, .L802014A8
-/* 0A6C3C 802E743C 8FBF0024 */ lw $ra, 0x24($sp)
-/* 0A6C40 802E7440 10000015 */ b .L802014A8
-/* 0A6C44 802E7444 8FBF0024 */ lw $ra, 0x24($sp)
-.L80201458:
-/* 0A6C48 802E7448 924C0000 */ lbu $t4, ($s2)
-/* 0A6C4C 802E744C A2400078 */ sb $zero, 0x78($s2)
-/* 0A6C50 802E7450 AE460060 */ sw $a2, 0x60($s2)
-/* 0A6C54 802E7454 358E0080 */ ori $t6, $t4, 0x80
-/* 0A6C58 802E7458 A24E0000 */ sb $t6, ($s2)
-/* 0A6C5C 802E745C 31CF00BF */ andi $t7, $t6, 0xbf
-/* 0A6C60 802E7460 A24F0000 */ sb $t7, ($s2)
-/* 0A6C64 802E7464 A640001A */ sh $zero, 0x1a($s2)
-/* 0A6C68 802E7468 02408825 */ move $s1, $s2
-/* 0A6C6C 802E746C 24130004 */ li $s3, 4
-.L80201480:
-/* 0A6C70 802E7470 8E380048 */ lw $t8, 0x48($s1)
-/* 0A6C74 802E7474 02402025 */ move $a0, $s2
-/* 0A6C78 802E7478 53000004 */ beql $t8, $zero, .L8020149C
-/* 0A6C7C 802E747C 26100001 */ addiu $s0, $s0, 1
-/* 0A6C80 802E7480 0C0B9C2D */ jal seq_channel_layer_free
-/* 0A6C84 802E7484 02002825 */ move $a1, $s0
-/* 0A6C88 802E7488 26100001 */ addiu $s0, $s0, 1
-.L8020149C:
-/* 0A6C8C 802E748C 1613FFF8 */ bne $s0, $s3, .L80201480
-/* 0A6C90 802E7490 26310004 */ addiu $s1, $s1, 4
-.L802014A4:
-/* 0A6C94 802E7494 8FBF0024 */ lw $ra, 0x24($sp)
-.L802014A8:
-/* 0A6C98 802E7498 8FB00014 */ lw $s0, 0x14($sp)
-/* 0A6C9C 802E749C 8FB10018 */ lw $s1, 0x18($sp)
-/* 0A6CA0 802E74A0 8FB2001C */ lw $s2, 0x1c($sp)
-/* 0A6CA4 802E74A4 8FB30020 */ lw $s3, 0x20($sp)
-/* 0A6CA8 802E74A8 03E00008 */ jr $ra
-/* 0A6CAC 802E74AC 27BD0028 */ addiu $sp, $sp, 0x28
diff --git a/asm/non_matchings/eu/audio/sequence_player_process_sequence.s b/asm/non_matchings/eu/audio/sequence_player_process_sequence.s
@@ -1,698 +0,0 @@
-.late_rodata
-.late_rodata_alignment 4
-glabel jtbl_EU_80306AD4
- .word L_EU_802E9530
- .word L_EU_802E9520, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9510
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9500
- .word L_EU_802E94D4, L_EU_802E94D4
- .word L_EU_802E94C4, L_EU_802E94B4
- .word L_EU_802E9488, L_EU_802E946C
- .word L_EU_802E9450, L_EU_802E9024
- .word L_EU_802E9424, L_EU_802E9310
- .word L_EU_802E938C, L_EU_802E928C
- .word L_EU_802E928C, L_EU_802E926C
- .word L_EU_802E9268, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9258
- .word L_EU_802E9230, L_EU_802E91E8
- .word L_EU_802E91E8, L_EU_802E91E8
- .word L_EU_802E9190, L_EU_802E9024
- .word L_EU_802E9148, L_EU_802E9110
- .word L_EU_802E9190, L_EU_802E9190
- .word L_EU_802E9190, L_EU_802E90CC
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024
-
-glabel jtbl_EU_80306BB4
- .word L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E95C0
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E95CC
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E95D4
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E95DC
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
- .word L_EU_802E9024, L_EU_802E9024
-
-.text
-glabel sequence_player_process_sequence
-/* 0A85E4 802E8DE4 27BDFFA0 */ addiu $sp, $sp, -0x60
-/* 0A85E8 802E8DE8 AFBF002C */ sw $ra, 0x2c($sp)
-/* 0A85EC 802E8DEC AFB30028 */ sw $s3, 0x28($sp)
-/* 0A85F0 802E8DF0 AFB20024 */ sw $s2, 0x24($sp)
-/* 0A85F4 802E8DF4 AFB10020 */ sw $s1, 0x20($sp)
-/* 0A85F8 802E8DF8 AFB0001C */ sw $s0, 0x1c($sp)
-/* 0A85FC 802E8DFC 8C820000 */ lw $v0, ($a0)
-/* 0A8600 802E8E00 00808825 */ move $s1, $a0
-/* 0A8604 802E8E04 24010001 */ li $at, 1
-/* 0A8608 802E8E08 000277C2 */ srl $t6, $v0, 0x1f
-/* 0A860C 802E8E0C 11C00212 */ beqz $t6, .L080201458
-/* 0A8610 802E8E10 00027900 */ sll $t7, $v0, 4
-/* 0A8614 802E8E14 000FC7C2 */ srl $t8, $t7, 0x1f
-/* 0A8618 802E8E18 17010039 */ bne $t8, $at, .L080200D00
-/* 0A861C 802E8E1C 000268C0 */ sll $t5, $v0, 3
-/* 0A8620 802E8E20 24900108 */ addiu $s0, $a0, 0x108
-/* 0A8624 802E8E24 02002025 */ move $a0, $s0
-/* 0A8628 802E8E28 00002825 */ move $a1, $zero
-/* 0A862C 802E8E2C 0C0BBDE0 */ jal osRecvMesg
-/* 0A8630 802E8E30 00003025 */ move $a2, $zero
-/* 0A8634 802E8E34 2401FFFF */ li $at, -1
-/* 0A8638 802E8E38 50410208 */ beql $v0, $at, .L08020145C
-/* 0A863C 802E8E3C 8FBF002C */ lw $ra, 0x2c($sp)
-/* 0A8640 802E8E40 8E390144 */ lw $t9, 0x144($s1)
-/* 0A8644 802E8E44 3C128023 */ lui $s2, %hi(gCtlEntries) # $s2, 0x8023
-/* 0A8648 802E8E48 265297D8 */ addiu $s2, %lo(gCtlEntries) # addiu $s2, $s2, -0x6828
-/* 0A864C 802E8E4C 57200024 */ bnezl $t9, .L080200CE0
-/* 0A8650 802E8E50 262C0124 */ addiu $t4, $s1, 0x124
-/* 0A8654 802E8E54 92220006 */ lbu $v0, 6($s1)
-/* 0A8658 802E8E58 2413000C */ li $s3, 12
-/* 0A865C 802E8E5C 92280000 */ lbu $t0, ($s1)
-/* 0A8660 802E8E60 00530019 */ multu $v0, $s3
-/* 0A8664 802E8E64 3C0C8023 */ lui $t4, %hi(gAlTbl) # $t4, 0x8023
-/* 0A8668 802E8E68 3109FFF7 */ andi $t1, $t0, 0xfff7
-/* 0A866C 802E8E6C A2290000 */ sb $t1, ($s1)
-/* 0A8670 802E8E70 8E4A0000 */ lw $t2, ($s2)
-/* 0A8674 802E8E74 8D8C97CC */ lw $t4, %lo(gAlTbl)($t4)
-/* 0A8678 802E8E78 000268C0 */ sll $t5, $v0, 3
-/* 0A867C 802E8E7C 018D7021 */ addu $t6, $t4, $t5
-/* 0A8680 802E8E80 8DC50004 */ lw $a1, 4($t6)
-/* 0A8684 802E8E84 00005812 */ mflo $t3
-/* 0A8688 802E8E88 014B8021 */ addu $s0, $t2, $t3
-/* 0A868C 802E8E8C 8E040004 */ lw $a0, 4($s0)
-/* 0A8690 802E8E90 92060001 */ lbu $a2, 1($s0)
-/* 0A8694 802E8E94 92070002 */ lbu $a3, 2($s0)
-/* 0A8698 802E8E98 0C0B8F0E */ jal patch_audio_bank
-/* 0A869C 802E8E9C 2484FFFC */ addiu $a0, $a0, -4
-/* 0A86A0 802E8EA0 92380006 */ lbu $t8, 6($s1)
-/* 0A86A4 802E8EA4 8E4F0000 */ lw $t7, ($s2)
-/* 0A86A8 802E8EA8 3C038022 */ lui $v1, %hi(gBankLoadStatus) # $v1, 0x8022
-/* 0A86AC 802E8EAC 03130019 */ multu $t8, $s3
-/* 0A86B0 802E8EB0 24632C18 */ addiu $v1, %lo(gBankLoadStatus) # addiu $v1, $v1, 0x2c18
-/* 0A86B4 802E8EB4 24040002 */ li $a0, 2
-/* 0A86B8 802E8EB8 0000C812 */ mflo $t9
-/* 0A86BC 802E8EBC 01F98021 */ addu $s0, $t7, $t9
-/* 0A86C0 802E8EC0 8E080004 */ lw $t0, 4($s0)
-/* 0A86C4 802E8EC4 8D09FFFC */ lw $t1, -4($t0)
-/* 0A86C8 802E8EC8 AE090008 */ sw $t1, 8($s0)
-/* 0A86CC 802E8ECC 922A0006 */ lbu $t2, 6($s1)
-/* 0A86D0 802E8ED0 006A5821 */ addu $t3, $v1, $t2
-/* 0A86D4 802E8ED4 100001E0 */ b .L080201458
-/* 0A86D8 802E8ED8 A1640000 */ sb $a0, ($t3)
-/* 0A86DC 802E8EDC 262C0124 */ addiu $t4, $s1, 0x124
-.L080200CE0:
-/* 0A86E0 802E8EE0 AFAC0010 */ sw $t4, 0x10($sp)
-/* 0A86E4 802E8EE4 26240140 */ addiu $a0, $s1, 0x140
-/* 0A86E8 802E8EE8 2625013C */ addiu $a1, $s1, 0x13c
-/* 0A86EC 802E8EEC 26260144 */ addiu $a2, $s1, 0x144
-/* 0A86F0 802E8EF0 0C0B8CEA */ jal audio_dma_partial_copy_async
-/* 0A86F4 802E8EF4 02003825 */ move $a3, $s0
-/* 0A86F8 802E8EF8 100001D8 */ b .L08020145C
-/* 0A86FC 802E8EFC 8FBF002C */ lw $ra, 0x2c($sp)
-.L080200D00:
-/* 0A8700 802E8F00 000D77C2 */ srl $t6, $t5, 0x1f
-/* 0A8704 802E8F04 24010001 */ li $at, 1
-/* 0A8708 802E8F08 15C1000E */ bne $t6, $at, .L080200D44
-/* 0A870C 802E8F0C 262400D4 */ addiu $a0, $s1, 0xd4
-/* 0A8710 802E8F10 00002825 */ move $a1, $zero
-/* 0A8714 802E8F14 0C0BBDE0 */ jal osRecvMesg
-/* 0A8718 802E8F18 00003025 */ move $a2, $zero
-/* 0A871C 802E8F1C 2401FFFF */ li $at, -1
-/* 0A8720 802E8F20 104101CD */ beq $v0, $at, .L080201458
-/* 0A8724 802E8F24 24040002 */ li $a0, 2
-/* 0A8728 802E8F28 92380000 */ lbu $t8, ($s1)
-/* 0A872C 802E8F2C 92390004 */ lbu $t9, 4($s1)
-/* 0A8730 802E8F30 3C018022 */ lui $at, %hi(gSeqLoadStatus)
-/* 0A8734 802E8F34 330FFFEF */ andi $t7, $t8, 0xffef
-/* 0A8738 802E8F38 A22F0000 */ sb $t7, ($s1)
-/* 0A873C 802E8F3C 00390821 */ addu $at, $at, $t9
-/* 0A8740 802E8F40 A0242C58 */ sb $a0, %lo(gSeqLoadStatus)($at)
-.L080200D44:
-/* 0A8744 802E8F44 92280004 */ lbu $t0, 4($s1)
-/* 0A8748 802E8F48 3C098022 */ lui $t1, %hi(gSeqLoadStatus) # $t1, 0x8022
-/* 0A874C 802E8F4C 25292C58 */ addiu $t1, %lo(gSeqLoadStatus) # addiu $t1, $t1, 0x2c58
-/* 0A8750 802E8F50 01091021 */ addu $v0, $t0, $t1
-/* 0A8754 802E8F54 904A0000 */ lbu $t2, ($v0)
-/* 0A8758 802E8F58 24040002 */ li $a0, 2
-/* 0A875C 802E8F5C 294B0002 */ slti $t3, $t2, 2
-/* 0A8760 802E8F60 15600009 */ bnez $t3, .L080200D88
-/* 0A8764 802E8F64 00000000 */ nop
-/* 0A8768 802E8F68 922C0005 */ lbu $t4, 5($s1)
-/* 0A876C 802E8F6C 3C038022 */ lui $v1, %hi(gBankLoadStatus) # $v1, 0x8022
-/* 0A8770 802E8F70 24632C18 */ addiu $v1, %lo(gBankLoadStatus) # addiu $v1, $v1, 0x2c18
-/* 0A8774 802E8F74 006C6821 */ addu $t5, $v1, $t4
-/* 0A8778 802E8F78 91AE0000 */ lbu $t6, ($t5)
-/* 0A877C 802E8F7C 29D80002 */ slti $t8, $t6, 2
-/* 0A8780 802E8F80 53000006 */ beql $t8, $zero, .L080200D9C
-/* 0A8784 802E8F84 A0440000 */ sb $a0, ($v0)
-.L080200D88:
-/* 0A8788 802E8F88 0C0B9D2C */ jal sequence_player_disable
-/* 0A878C 802E8F8C 02202025 */ move $a0, $s1
-/* 0A8790 802E8F90 100001B2 */ b .L08020145C
-/* 0A8794 802E8F94 8FBF002C */ lw $ra, 0x2c($sp)
-/* 0A8798 802E8F98 A0440000 */ sb $a0, ($v0)
-.L080200D9C:
-/* 0A879C 802E8F9C 922F0005 */ lbu $t7, 5($s1)
-/* 0A87A0 802E8FA0 006FC821 */ addu $t9, $v1, $t7
-/* 0A87A4 802E8FA4 A3240000 */ sb $a0, ($t9)
-/* 0A87A8 802E8FA8 8E280000 */ lw $t0, ($s1)
-/* 0A87AC 802E8FAC 00085080 */ sll $t2, $t0, 2
-/* 0A87B0 802E8FB0 05430006 */ bgezl $t2, .L080200DCC
-/* 0A87B4 802E8FB4 962D000A */ lhu $t5, 0xa($s1)
-/* 0A87B8 802E8FB8 922B0003 */ lbu $t3, 3($s1)
-/* 0A87BC 802E8FBC 316C0080 */ andi $t4, $t3, 0x80
-/* 0A87C0 802E8FC0 558001A6 */ bnezl $t4, .L08020145C
-/* 0A87C4 802E8FC4 8FBF002C */ lw $ra, 0x2c($sp)
-/* 0A87C8 802E8FC8 962D000A */ lhu $t5, 0xa($s1)
-.L080200DCC:
-/* 0A87CC 802E8FCC 962E0008 */ lhu $t6, 8($s1)
-/* 0A87D0 802E8FD0 3C038023 */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x8023
-/* 0A87D4 802E8FD4 01AEC021 */ addu $t8, $t5, $t6
-/* 0A87D8 802E8FD8 A638000A */ sh $t8, 0xa($s1)
-/* 0A87DC 802E8FDC 8463980C */ lh $v1, %lo(gTempoInternalToExternal)($v1)
-/* 0A87E0 802E8FE0 3302FFFF */ andi $v0, $t8, 0xffff
-/* 0A87E4 802E8FE4 0043082A */ slt $at, $v0, $v1
-/* 0A87E8 802E8FE8 5420019C */ bnezl $at, .L08020145C
-/* 0A87EC 802E8FEC 8FBF002C */ lw $ra, 0x2c($sp)
-/* 0A87F0 802E8FF0 9624000E */ lhu $a0, 0xe($s1)
-/* 0A87F4 802E8FF4 0043C823 */ subu $t9, $v0, $v1
-/* 0A87F8 802E8FF8 A639000A */ sh $t9, 0xa($s1)
-/* 0A87FC 802E8FFC 28810002 */ slti $at, $a0, 2
-/* 0A8800 802E9000 14200003 */ bnez $at, .L080200E10
-/* 0A8804 802E9004 2488FFFF */ addiu $t0, $a0, -1
-/* 0A8808 802E9008 10000180 */ b .L08020140C
-/* 0A880C 802E900C A628000E */ sh $t0, 0xe($s1)
-.L080200E10:
-/* 0A8810 802E9010 922A0000 */ lbu $t2, ($s1)
-/* 0A8814 802E9014 26300070 */ addiu $s0, $s1, 0x70
-/* 0A8818 802E9018 354B0004 */ ori $t3, $t2, 4
-/* 0A881C 802E901C A22B0000 */ sb $t3, ($s1)
-/* 0A8820 802E9020 8FB30058 */ lw $s3, 0x58($sp)
-glabel L_EU_802E9024
-.L_EU_802E9024:
-/* 0A8824 802E9024 0C0B9DA0 */ jal m64_read_u8
-/* 0A8828 802E9028 02002025 */ move $a0, $s0
-/* 0A882C 802E902C 240100FF */ li $at, 255
-/* 0A8830 802E9030 1441000E */ bne $v0, $at, .L080200E6C
-/* 0A8834 802E9034 305200FF */ andi $s2, $v0, 0xff
-/* 0A8838 802E9038 92040018 */ lbu $a0, 0x18($s0)
-/* 0A883C 802E903C 14800005 */ bnez $a0, .L080200E54
-/* 0A8840 802E9040 2483FFFF */ addiu $v1, $a0, -1
-/* 0A8844 802E9044 0C0B9D2C */ jal sequence_player_disable
-/* 0A8848 802E9048 02202025 */ move $a0, $s1
-/* 0A884C 802E904C 1000016F */ b .L08020140C
-/* 0A8850 802E9050 00000000 */ nop
-.L080200E54:
-/* 0A8854 802E9054 306C00FF */ andi $t4, $v1, 0xff
-/* 0A8858 802E9058 000C6880 */ sll $t5, $t4, 2
-/* 0A885C 802E905C 020D7021 */ addu $t6, $s0, $t5
-/* 0A8860 802E9060 A20C0018 */ sb $t4, 0x18($s0)
-/* 0A8864 802E9064 8DD80004 */ lw $t8, 4($t6)
-/* 0A8868 802E9068 AE180000 */ sw $t8, ($s0)
-.L080200E6C:
-/* 0A886C 802E906C 304300FF */ andi $v1, $v0, 0xff
-/* 0A8870 802E9070 240100FD */ li $at, 253
-/* 0A8874 802E9074 14610005 */ bne $v1, $at, .L080200E8C
-/* 0A8878 802E9078 306200F0 */ andi $v0, $v1, 0xf0
-/* 0A887C 802E907C 0C0B9DB1 */ jal m64_read_compressed_u16
-/* 0A8880 802E9080 02002025 */ move $a0, $s0
-/* 0A8884 802E9084 10000161 */ b .L08020140C
-/* 0A8888 802E9088 A622000E */ sh $v0, 0xe($s1)
-.L080200E8C:
-/* 0A888C 802E908C 240100FE */ li $at, 254
-/* 0A8890 802E9090 14610004 */ bne $v1, $at, .L080200EA4
-/* 0A8894 802E9094 2479FF38 */ addiu $t9, $v1, -0xc8
-/* 0A8898 802E9098 240F0001 */ li $t7, 1
-/* 0A889C 802E909C 1000015B */ b .L08020140C
-/* 0A88A0 802E90A0 A62F000E */ sh $t7, 0xe($s1)
-.L080200EA4:
-/* 0A88A4 802E90A4 286100C0 */ slti $at, $v1, 0xc0
-/* 0A88A8 802E90A8 14200125 */ bnez $at, .L080201340
-/* 0A88AC 802E90AC 2F210038 */ sltiu $at, $t9, 0x38
-/* 0A88B0 802E90B0 1020FFDC */ beqz $at, .L_EU_802E9024
-/* 0A88B4 802E90B4 0019C880 */ sll $t9, $t9, 2
-/* 0A88B8 802E90B8 3C018030 */ lui $at, %hi(jtbl_EU_80306AD4)
-/* 0A88BC 802E90BC 00390821 */ addu $at, $at, $t9
-/* 0A88C0 802E90C0 8C396AD4 */ lw $t9, %lo(jtbl_EU_80306AD4)($at)
-/* 0A88C4 802E90C4 03200008 */ jr $t9
-/* 0A88C8 802E90C8 00000000 */ nop
-glabel L_EU_802E90CC
-/* 0A88CC 802E90CC 0C0B9DA5 */ jal m64_read_s16
-/* 0A88D0 802E90D0 02002025 */ move $a0, $s0
-/* 0A88D4 802E90D4 92090018 */ lbu $t1, 0x18($s0)
-/* 0A88D8 802E90D8 8E080000 */ lw $t0, ($s0)
-/* 0A88DC 802E90DC 3058FFFF */ andi $t8, $v0, 0xffff
-/* 0A88E0 802E90E0 00095080 */ sll $t2, $t1, 2
-/* 0A88E4 802E90E4 020A5821 */ addu $t3, $s0, $t2
-/* 0A88E8 802E90E8 AD680004 */ sw $t0, 4($t3)
-/* 0A88EC 802E90EC 920C0018 */ lbu $t4, 0x18($s0)
-/* 0A88F0 802E90F0 258D0001 */ addiu $t5, $t4, 1
-/* 0A88F4 802E90F4 A20D0018 */ sb $t5, 0x18($s0)
-/* 0A88F8 802E90F8 8E2E0014 */ lw $t6, 0x14($s1)
-/* 0A88FC 802E90FC 01D87821 */ addu $t7, $t6, $t8
-/* 0A8900 802E9100 1000FFC8 */ b .L_EU_802E9024
-/* 0A8904 802E9104 AE0F0000 */ sw $t7, ($s0)
-/* 0A8908 802E9108 1000FFC6 */ b .L_EU_802E9024
-/* 0A890C 802E910C 00000000 */ nop
-glabel L_EU_802E9110
-/* 0A8910 802E9110 0C0B9DA0 */ jal m64_read_u8
-/* 0A8914 802E9114 02002025 */ move $a0, $s0
-/* 0A8918 802E9118 92190018 */ lbu $t9, 0x18($s0)
-/* 0A891C 802E911C 02194821 */ addu $t1, $s0, $t9
-/* 0A8920 802E9120 A1220014 */ sb $v0, 0x14($t1)
-/* 0A8924 802E9124 92080018 */ lbu $t0, 0x18($s0)
-/* 0A8928 802E9128 8E0A0000 */ lw $t2, ($s0)
-/* 0A892C 802E912C 00085880 */ sll $t3, $t0, 2
-/* 0A8930 802E9130 020B6021 */ addu $t4, $s0, $t3
-/* 0A8934 802E9134 AD8A0004 */ sw $t2, 4($t4)
-/* 0A8938 802E9138 920D0018 */ lbu $t5, 0x18($s0)
-/* 0A893C 802E913C 25AE0001 */ addiu $t6, $t5, 1
-/* 0A8940 802E9140 1000FFB8 */ b .L_EU_802E9024
-/* 0A8944 802E9144 A20E0018 */ sb $t6, 0x18($s0)
-glabel L_EU_802E9148
-/* 0A8948 802E9148 92180018 */ lbu $t8, 0x18($s0)
-/* 0A894C 802E914C 02181021 */ addu $v0, $s0, $t8
-/* 0A8950 802E9150 904F0013 */ lbu $t7, 0x13($v0)
-/* 0A8954 802E9154 25F9FFFF */ addiu $t9, $t7, -1
-/* 0A8958 802E9158 A0590013 */ sb $t9, 0x13($v0)
-/* 0A895C 802E915C 92040018 */ lbu $a0, 0x18($s0)
-/* 0A8960 802E9160 02044821 */ addu $t1, $s0, $a0
-/* 0A8964 802E9164 91280013 */ lbu $t0, 0x13($t1)
-/* 0A8968 802E9168 00801825 */ move $v1, $a0
-/* 0A896C 802E916C 00035880 */ sll $t3, $v1, 2
-/* 0A8970 802E9170 11000005 */ beqz $t0, .L080200F88
-/* 0A8974 802E9174 248DFFFF */ addiu $t5, $a0, -1
-/* 0A8978 802E9178 020B5021 */ addu $t2, $s0, $t3
-/* 0A897C 802E917C 8D4C0000 */ lw $t4, ($t2)
-/* 0A8980 802E9180 1000FFA8 */ b .L_EU_802E9024
-/* 0A8984 802E9184 AE0C0000 */ sw $t4, ($s0)
-.L080200F88:
-/* 0A8988 802E9188 1000FFA6 */ b .L_EU_802E9024
-/* 0A898C 802E918C A20D0018 */ sb $t5, 0x18($s0)
-glabel L_EU_802E9190
-/* 0A8990 802E9190 0C0B9DA5 */ jal m64_read_s16
-/* 0A8994 802E9194 02002025 */ move $a0, $s0
-/* 0A8998 802E9198 240100FA */ li $at, 250
-/* 0A899C 802E919C 16410003 */ bne $s2, $at, .L080200FAC
-/* 0A89A0 802E91A0 02401825 */ move $v1, $s2
-/* 0A89A4 802E91A4 1660FF9F */ bnez $s3, .L_EU_802E9024
-/* 0A89A8 802E91A8 00000000 */ nop
-.L080200FAC:
-/* 0A89AC 802E91AC 240100F9 */ li $at, 249
-/* 0A89B0 802E91B0 54610004 */ bnel $v1, $at, .L080200FC4
-/* 0A89B4 802E91B4 240100F5 */ li $at, 245
-/* 0A89B8 802E91B8 0661FF9A */ bgez $s3, .L_EU_802E9024
-/* 0A89BC 802E91BC 00000000 */ nop
-/* 0A89C0 802E91C0 240100F5 */ li $at, 245
-.L080200FC4:
-/* 0A89C4 802E91C4 54610004 */ bnel $v1, $at, .L080200FD8
-/* 0A89C8 802E91C8 8E2E0014 */ lw $t6, 0x14($s1)
-/* 0A89CC 802E91CC 0660FF95 */ bltz $s3, .L_EU_802E9024
-/* 0A89D0 802E91D0 00000000 */ nop
-/* 0A89D4 802E91D4 8E2E0014 */ lw $t6, 0x14($s1)
-.L080200FD8:
-/* 0A89D8 802E91D8 3058FFFF */ andi $t8, $v0, 0xffff
-/* 0A89DC 802E91DC 01D87821 */ addu $t7, $t6, $t8
-/* 0A89E0 802E91E0 1000FF90 */ b .L_EU_802E9024
-/* 0A89E4 802E91E4 AE0F0000 */ sw $t7, ($s0)
-glabel L_EU_802E91E8
-/* 0A89E8 802E91E8 0C0B9DA0 */ jal m64_read_u8
-/* 0A89EC 802E91EC 02002025 */ move $a0, $s0
-/* 0A89F0 802E91F0 240100F3 */ li $at, 243
-/* 0A89F4 802E91F4 16410003 */ bne $s2, $at, .L080201004
-/* 0A89F8 802E91F8 02401825 */ move $v1, $s2
-/* 0A89FC 802E91FC 1660FF89 */ bnez $s3, .L_EU_802E9024
-/* 0A8A00 802E9200 00000000 */ nop
-.L080201004:
-/* 0A8A04 802E9204 240100F2 */ li $at, 242
-/* 0A8A08 802E9208 54610004 */ bnel $v1, $at, .L08020101C
-/* 0A8A0C 802E920C 8E190000 */ lw $t9, ($s0)
-/* 0A8A10 802E9210 0661FF84 */ bgez $s3, .L_EU_802E9024
-/* 0A8A14 802E9214 00000000 */ nop
-/* 0A8A18 802E9218 8E190000 */ lw $t9, ($s0)
-.L08020101C:
-/* 0A8A1C 802E921C 00024E00 */ sll $t1, $v0, 0x18
-/* 0A8A20 802E9220 00094603 */ sra $t0, $t1, 0x18
-/* 0A8A24 802E9224 03285821 */ addu $t3, $t9, $t0
-/* 0A8A28 802E9228 1000FF7E */ b .L_EU_802E9024
-/* 0A8A2C 802E922C AE0B0000 */ sw $t3, ($s0)
-glabel L_EU_802E9230
-/* 0A8A30 802E9230 26240094 */ addiu $a0, $s1, 0x94
-/* 0A8A34 802E9234 0C0B9671 */ jal note_pool_clear
-/* 0A8A38 802E9238 AFA40038 */ sw $a0, 0x38($sp)
-/* 0A8A3C 802E923C 0C0B9DA0 */ jal m64_read_u8
-/* 0A8A40 802E9240 02002025 */ move $a0, $s0
-/* 0A8A44 802E9244 8FA40038 */ lw $a0, 0x38($sp)
-/* 0A8A48 802E9248 0C0B96C9 */ jal note_pool_fill
-/* 0A8A4C 802E924C 00402825 */ move $a1, $v0
-/* 0A8A50 802E9250 1000FF74 */ b .L_EU_802E9024
-/* 0A8A54 802E9254 00000000 */ nop
-glabel L_EU_802E9258
-/* 0A8A58 802E9258 0C0B9671 */ jal note_pool_clear
-/* 0A8A5C 802E925C 26240094 */ addiu $a0, $s1, 0x94
-/* 0A8A60 802E9260 1000FF70 */ b .L_EU_802E9024
-/* 0A8A64 802E9264 00000000 */ nop
-glabel L_EU_802E9268
-/* 0A8A68 802E9268 A620000C */ sh $zero, 0xc($s1)
-glabel L_EU_802E926C
-/* 0A8A6C 802E926C 0C0B9DA0 */ jal m64_read_u8
-/* 0A8A70 802E9270 02002025 */ move $a0, $s0
-/* 0A8A74 802E9274 862A000C */ lh $t2, 0xc($s1)
-/* 0A8A78 802E9278 00026600 */ sll $t4, $v0, 0x18
-/* 0A8A7C 802E927C 000C6E03 */ sra $t5, $t4, 0x18
-/* 0A8A80 802E9280 014D7021 */ addu $t6, $t2, $t5
-/* 0A8A84 802E9284 1000FF67 */ b .L_EU_802E9024
-/* 0A8A88 802E9288 A62E000C */ sh $t6, 0xc($s1)
-glabel L_EU_802E928C
-/* 0A8A8C 802E928C 0C0B9DA0 */ jal m64_read_u8
-/* 0A8A90 802E9290 02002025 */ move $a0, $s0
-/* 0A8A94 802E9294 240100DD */ li $at, 221
-/* 0A8A98 802E9298 16410007 */ bne $s2, $at, .L0802010B8
-/* 0A8A9C 802E929C 3C038023 */ lui $v1, %hi(gTempoInternalToExternal) # $v1, 0x8023
-/* 0A8AA0 802E92A0 305800FF */ andi $t8, $v0, 0xff
-/* 0A8AA4 802E92A4 00187880 */ sll $t7, $t8, 2
-/* 0A8AA8 802E92A8 01F87823 */ subu $t7, $t7, $t8
-/* 0A8AAC 802E92AC 000F7900 */ sll $t7, $t7, 4
-/* 0A8AB0 802E92B0 10000009 */ b .L0802010D8
-/* 0A8AB4 802E92B4 A62F0008 */ sh $t7, 8($s1)
-.L0802010B8:
-/* 0A8AB8 802E92B8 0002CE00 */ sll $t9, $v0, 0x18
-/* 0A8ABC 802E92BC 00194603 */ sra $t0, $t9, 0x18
-/* 0A8AC0 802E92C0 96290008 */ lhu $t1, 8($s1)
-/* 0A8AC4 802E92C4 00085880 */ sll $t3, $t0, 2
-/* 0A8AC8 802E92C8 01685823 */ subu $t3, $t3, $t0
-/* 0A8ACC 802E92CC 000B5900 */ sll $t3, $t3, 4
-/* 0A8AD0 802E92D0 012B6021 */ addu $t4, $t1, $t3
-/* 0A8AD4 802E92D4 A62C0008 */ sh $t4, 8($s1)
-.L0802010D8:
-/* 0A8AD8 802E92D8 8463980C */ lh $v1, %lo(gTempoInternalToExternal)($v1)
-/* 0A8ADC 802E92DC 96220008 */ lhu $v0, 8($s1)
-/* 0A8AE0 802E92E0 240E0001 */ li $t6, 1
-/* 0A8AE4 802E92E4 0062082A */ slt $at, $v1, $v0
-/* 0A8AE8 802E92E8 50200004 */ beql $at, $zero, .L0802010FC
-/* 0A8AEC 802E92EC 00025400 */ sll $t2, $v0, 0x10
-/* 0A8AF0 802E92F0 A6230008 */ sh $v1, 8($s1)
-/* 0A8AF4 802E92F4 3062FFFF */ andi $v0, $v1, 0xffff
-/* 0A8AF8 802E92F8 00025400 */ sll $t2, $v0, 0x10
-.L0802010FC:
-/* 0A8AFC 802E92FC 000A6C03 */ sra $t5, $t2, 0x10
-/* 0A8B00 802E9300 1DA0FF48 */ bgtz $t5, .L_EU_802E9024
-/* 0A8B04 802E9304 00000000 */ nop
-/* 0A8B08 802E9308 1000FF46 */ b .L_EU_802E9024
-/* 0A8B0C 802E930C A62E0008 */ sh $t6, 8($s1)
-glabel L_EU_802E9310
-/* 0A8B10 802E9310 0C0B9DA0 */ jal m64_read_u8
-/* 0A8B14 802E9314 02002025 */ move $a0, $s0
-/* 0A8B18 802E9318 305200FF */ andi $s2, $v0, 0xff
-/* 0A8B1C 802E931C 0C0B9DA5 */ jal m64_read_s16
-/* 0A8B20 802E9320 02002025 */ move $a0, $s0
-/* 0A8B24 802E9324 12400008 */ beqz $s2, .L080201148
-/* 0A8B28 802E9328 02401825 */ move $v1, $s2
-/* 0A8B2C 802E932C 24010001 */ li $at, 1
-/* 0A8B30 802E9330 10610005 */ beq $v1, $at, .L080201148
-/* 0A8B34 802E9334 24010002 */ li $at, 2
-/* 0A8B38 802E9338 1061000A */ beq $v1, $at, .L080201164
-/* 0A8B3C 802E933C 304FFFFF */ andi $t7, $v0, 0xffff
-/* 0A8B40 802E9340 1000FF38 */ b .L_EU_802E9024
-/* 0A8B44 802E9344 00000000 */ nop
-.L080201148:
-/* 0A8B48 802E9348 92380001 */ lbu $t8, 1($s1)
-/* 0A8B4C 802E934C 24010002 */ li $at, 2
-/* 0A8B50 802E9350 1301FF34 */ beq $t8, $at, .L_EU_802E9024
-/* 0A8B54 802E9354 00000000 */ nop
-/* 0A8B58 802E9358 A6220012 */ sh $v0, 0x12($s1)
-/* 0A8B5C 802E935C 1000FF31 */ b .L_EU_802E9024
-/* 0A8B60 802E9360 A2320001 */ sb $s2, 1($s1)
-.L080201164:
-/* 0A8B64 802E9364 448F5000 */ mtc1 $t7, $f10
-/* 0A8B68 802E9368 44802000 */ mtc1 $zero, $f4
-/* 0A8B6C 802E936C C6260018 */ lwc1 $f6, 0x18($s1)
-/* 0A8B70 802E9370 46805420 */ cvt.s.w $f16, $f10
-/* 0A8B74 802E9374 A6220010 */ sh $v0, 0x10($s1)
-/* 0A8B78 802E9378 A2320001 */ sb $s2, 1($s1)
-/* 0A8B7C 802E937C 46062201 */ sub.s $f8, $f4, $f6
-/* 0A8B80 802E9380 46104483 */ div.s $f18, $f8, $f16
-/* 0A8B84 802E9384 1000FF27 */ b .L_EU_802E9024
-/* 0A8B88 802E9388 E632001C */ swc1 $f18, 0x1c($s1)
-glabel L_EU_802E938C
-/* 0A8B8C 802E938C 0C0B9DA0 */ jal m64_read_u8
-/* 0A8B90 802E9390 02002025 */ move $a0, $s0
-/* 0A8B94 802E9394 92230001 */ lbu $v1, 1($s1)
-/* 0A8B98 802E9398 24010001 */ li $at, 1
-/* 0A8B9C 802E939C 5060000B */ beql $v1, $zero, .L0802011CC
-/* 0A8BA0 802E93A0 96230012 */ lhu $v1, 0x12($s1)
-/* 0A8BA4 802E93A4 10610005 */ beq $v1, $at, .L0802011BC
-/* 0A8BA8 802E93A8 24010002 */ li $at, 2
-/* 0A8BAC 802E93AC 1061FF1D */ beq $v1, $at, .L_EU_802E9024
-/* 0A8BB0 802E93B0 00000000 */ nop
-/* 0A8BB4 802E93B4 1000FF1B */ b .L_EU_802E9024
-/* 0A8BB8 802E93B8 00000000 */ nop
-.L0802011BC:
-/* 0A8BBC 802E93BC 44802000 */ mtc1 $zero, $f4
-/* 0A8BC0 802E93C0 A2200001 */ sb $zero, 1($s1)
-/* 0A8BC4 802E93C4 E6240018 */ swc1 $f4, 0x18($s1)
-/* 0A8BC8 802E93C8 96230012 */ lhu $v1, 0x12($s1)
-.L0802011CC:
-/* 0A8BCC 802E93CC 1060000E */ beqz $v1, .L080201208
-/* 0A8BD0 802E93D0 A6230010 */ sh $v1, 0x10($s1)
-/* 0A8BD4 802E93D4 44823000 */ mtc1 $v0, $f6
-/* 0A8BD8 802E93D8 3C0142FE */ li $at, 0x42FE0000 # 127.000000
-/* 0A8BDC 802E93DC 44814000 */ mtc1 $at, $f8
-/* 0A8BE0 802E93E0 468032A0 */ cvt.s.w $f10, $f6
-/* 0A8BE4 802E93E4 3079FFFF */ andi $t9, $v1, 0xffff
-/* 0A8BE8 802E93E8 44993000 */ mtc1 $t9, $f6
-/* 0A8BEC 802E93EC C6320018 */ lwc1 $f18, 0x18($s1)
-/* 0A8BF0 802E93F0 46085403 */ div.s $f16, $f10, $f8
-/* 0A8BF4 802E93F4 468032A0 */ cvt.s.w $f10, $f6
-/* 0A8BF8 802E93F8 46128101 */ sub.s $f4, $f16, $f18
-/* 0A8BFC 802E93FC 460A2203 */ div.s $f8, $f4, $f10
-/* 0A8C00 802E9400 1000FF08 */ b .L_EU_802E9024
-/* 0A8C04 802E9404 E628001C */ swc1 $f8, 0x1c($s1)
-.L080201208:
-/* 0A8C08 802E9408 44828000 */ mtc1 $v0, $f16
-/* 0A8C0C 802E940C 3C0142FE */ li $at, 0x42FE0000 # 127.000000
-/* 0A8C10 802E9410 44813000 */ mtc1 $at, $f6
-/* 0A8C14 802E9414 468084A0 */ cvt.s.w $f18, $f16
-/* 0A8C18 802E9418 46069103 */ div.s $f4, $f18, $f6
-/* 0A8C1C 802E941C 1000FF01 */ b .L_EU_802E9024
-/* 0A8C20 802E9420 E6240018 */ swc1 $f4, 0x18($s1)
-glabel L_EU_802E9424
-/* 0A8C24 802E9424 0C0B9DA0 */ jal m64_read_u8
-/* 0A8C28 802E9428 02002025 */ move $a0, $s0
-/* 0A8C2C 802E942C 00024600 */ sll $t0, $v0, 0x18
-/* 0A8C30 802E9430 00084E03 */ sra $t1, $t0, 0x18
-/* 0A8C34 802E9434 44895000 */ mtc1 $t1, $f10
-/* 0A8C38 802E9438 3C0142FE */ li $at, 0x42FE0000 # 127.000000
-/* 0A8C3C 802E943C 44818000 */ mtc1 $at, $f16
-/* 0A8C40 802E9440 46805220 */ cvt.s.w $f8, $f10
-/* 0A8C44 802E9444 46104483 */ div.s $f18, $f8, $f16
-/* 0A8C48 802E9448 1000FEF6 */ b .L_EU_802E9024
-/* 0A8C4C 802E944C E6320028 */ swc1 $f18, 0x28($s1)
-glabel L_EU_802E9450
-/* 0A8C50 802E9450 0C0B9DA5 */ jal m64_read_s16
-/* 0A8C54 802E9454 02002025 */ move $a0, $s0
-/* 0A8C58 802E9458 02202025 */ move $a0, $s1
-/* 0A8C5C 802E945C 0C0B9C7B */ jal sequence_player_init_channels
-/* 0A8C60 802E9460 3045FFFF */ andi $a1, $v0, 0xffff
-/* 0A8C64 802E9464 1000FEEF */ b .L_EU_802E9024
-/* 0A8C68 802E9468 00000000 */ nop
-glabel L_EU_802E946C
-/* 0A8C6C 802E946C 0C0B9DA5 */ jal m64_read_s16
-/* 0A8C70 802E9470 02002025 */ move $a0, $s0
-/* 0A8C74 802E9474 02202025 */ move $a0, $s1
-/* 0A8C78 802E9478 0C0B9CC6 */ jal sequence_player_disable_channels
-/* 0A8C7C 802E947C 3045FFFF */ andi $a1, $v0, 0xffff
-/* 0A8C80 802E9480 1000FEE8 */ b .L_EU_802E9024
-/* 0A8C84 802E9484 00000000 */ nop
-glabel L_EU_802E9488
-/* 0A8C88 802E9488 0C0B9DA0 */ jal m64_read_u8
-/* 0A8C8C 802E948C 02002025 */ move $a0, $s0
-/* 0A8C90 802E9490 00025E00 */ sll $t3, $v0, 0x18
-/* 0A8C94 802E9494 000B6603 */ sra $t4, $t3, 0x18
-/* 0A8C98 802E9498 448C3000 */ mtc1 $t4, $f6
-/* 0A8C9C 802E949C 3C0142FE */ li $at, 0x42FE0000 # 127.000000
-/* 0A8CA0 802E94A0 44815000 */ mtc1 $at, $f10
-/* 0A8CA4 802E94A4 46803120 */ cvt.s.w $f4, $f6
-/* 0A8CA8 802E94A8 460A2203 */ div.s $f8, $f4, $f10
-/* 0A8CAC 802E94AC 1000FEDD */ b .L_EU_802E9024
-/* 0A8CB0 802E94B0 E6280024 */ swc1 $f8, 0x24($s1)
-glabel L_EU_802E94B4
-/* 0A8CB4 802E94B4 922D0000 */ lbu $t5, ($s1)
-/* 0A8CB8 802E94B8 35AE0020 */ ori $t6, $t5, 0x20
-/* 0A8CBC 802E94BC 1000FED9 */ b .L_EU_802E9024
-/* 0A8CC0 802E94C0 A22E0000 */ sb $t6, ($s1)
-glabel L_EU_802E94C4
-/* 0A8CC4 802E94C4 0C0B9DA0 */ jal m64_read_u8
-/* 0A8CC8 802E94C8 02002025 */ move $a0, $s0
-/* 0A8CCC 802E94CC 1000FED5 */ b .L_EU_802E9024
-/* 0A8CD0 802E94D0 A2220003 */ sb $v0, 3($s1)
-glabel L_EU_802E94D4
-/* 0A8CD4 802E94D4 0C0B9DA5 */ jal m64_read_s16
-/* 0A8CD8 802E94D8 02002025 */ move $a0, $s0
-/* 0A8CDC 802E94DC 8E380014 */ lw $t8, 0x14($s1)
-/* 0A8CE0 802E94E0 304FFFFF */ andi $t7, $v0, 0xffff
-/* 0A8CE4 802E94E4 240100D2 */ li $at, 210
-/* 0A8CE8 802E94E8 16410003 */ bne $s2, $at, .L0802012F8
-/* 0A8CEC 802E94EC 030F1821 */ addu $v1, $t8, $t7
-/* 0A8CF0 802E94F0 1000FECC */ b .L_EU_802E9024
-/* 0A8CF4 802E94F4 AE23008C */ sw $v1, 0x8c($s1)
-.L0802012F8:
-/* 0A8CF8 802E94F8 1000FECA */ b .L_EU_802E9024
-/* 0A8CFC 802E94FC AE230090 */ sw $v1, 0x90($s1)
-glabel L_EU_802E9500
-/* 0A8D00 802E9500 0C0B9DA0 */ jal m64_read_u8
-/* 0A8D04 802E9504 02002025 */ move $a0, $s0
-/* 0A8D08 802E9508 1000FEC6 */ b .L_EU_802E9024
-/* 0A8D0C 802E950C A2220002 */ sb $v0, 2($s1)
-glabel L_EU_802E9510
-/* 0A8D10 802E9510 0C0B9DA0 */ jal m64_read_u8
-/* 0A8D14 802E9514 02002025 */ move $a0, $s0
-/* 0A8D18 802E9518 1000FEC2 */ b .L_EU_802E9024
-/* 0A8D1C 802E951C 00409825 */ move $s3, $v0
-glabel L_EU_802E9520
-/* 0A8D20 802E9520 0C0B9DA0 */ jal m64_read_u8
-/* 0A8D24 802E9524 02002025 */ move $a0, $s0
-/* 0A8D28 802E9528 1000FEBE */ b .L_EU_802E9024
-/* 0A8D2C 802E952C 02629824 */ and $s3, $s3, $v0
-glabel L_EU_802E9530
-/* 0A8D30 802E9530 0C0B9DA0 */ jal m64_read_u8
-/* 0A8D34 802E9534 02002025 */ move $a0, $s0
-/* 0A8D38 802E9538 1000FEBA */ b .L_EU_802E9024
-/* 0A8D3C 802E953C 02629823 */ subu $s3, $s3, $v0
-.L080201340:
-/* 0A8D40 802E9540 28410011 */ slti $at, $v0, 0x11
-/* 0A8D44 802E9544 14200010 */ bnez $at, .L080201388
-/* 0A8D48 802E9548 28410021 */ slti $at, $v0, 0x21
-/* 0A8D4C 802E954C 14200009 */ bnez $at, .L080201374
-/* 0A8D50 802E9550 2459FFC0 */ addiu $t9, $v0, -0x40
-/* 0A8D54 802E9554 2F210061 */ sltiu $at, $t9, 0x61
-/* 0A8D58 802E9558 1020FEB2 */ beqz $at, .L_EU_802E9024
-/* 0A8D5C 802E955C 0019C880 */ sll $t9, $t9, 2
-/* 0A8D60 802E9560 3C018030 */ lui $at, %hi(jtbl_EU_80306BB4)
-/* 0A8D64 802E9564 00390821 */ addu $at, $at, $t9
-/* 0A8D68 802E9568 8C396BB4 */ lw $t9, %lo(jtbl_EU_80306BB4)($at)
-/* 0A8D6C 802E956C 03200008 */ jr $t9
-/* 0A8D70 802E9570 00000000 */ nop
-.L080201374:
-/* 0A8D74 802E9574 24010020 */ li $at, 32
-/* 0A8D78 802E9578 1041FEAA */ beq $v0, $at, .L_EU_802E9024
-/* 0A8D7C 802E957C 00000000 */ nop
-/* 0A8D80 802E9580 1000FEA8 */ b .L_EU_802E9024
-/* 0A8D84 802E9584 00000000 */ nop
-.L080201388:
-/* 0A8D88 802E9588 10400006 */ beqz $v0, .L0802013A4
-/* 0A8D8C 802E958C 3069000F */ andi $t1, $v1, 0xf
-/* 0A8D90 802E9590 24010010 */ li $at, 16
-/* 0A8D94 802E9594 1041FEA3 */ beq $v0, $at, .L_EU_802E9024
-/* 0A8D98 802E9598 00000000 */ nop
-/* 0A8D9C 802E959C 1000FEA1 */ b .L_EU_802E9024
-/* 0A8DA0 802E95A0 00000000 */ nop
-.L0802013A4:
-/* 0A8DA4 802E95A4 00095880 */ sll $t3, $t1, 2
-/* 0A8DA8 802E95A8 022B6021 */ addu $t4, $s1, $t3
-/* 0A8DAC 802E95AC 8D8A0030 */ lw $t2, 0x30($t4)
-/* 0A8DB0 802E95B0 8D530000 */ lw $s3, ($t2)
-/* 0A8DB4 802E95B4 00136840 */ sll $t5, $s3, 1
-/* 0A8DB8 802E95B8 1000FE9A */ b .L_EU_802E9024
-/* 0A8DBC 802E95BC 000D9FC2 */ srl $s3, $t5, 0x1f
-glabel L_EU_802E95C0
-/* 0A8DC0 802E95C0 82380007 */ lb $t8, 7($s1)
-/* 0A8DC4 802E95C4 1000FE97 */ b .L_EU_802E9024
-/* 0A8DC8 802E95C8 02789823 */ subu $s3, $s3, $t8
-glabel L_EU_802E95CC
-/* 0A8DCC 802E95CC 1000FE95 */ b .L_EU_802E9024
-/* 0A8DD0 802E95D0 A2330007 */ sb $s3, 7($s1)
-glabel L_EU_802E95D4
-/* 0A8DD4 802E95D4 1000FE93 */ b .L_EU_802E9024
-/* 0A8DD8 802E95D8 82330007 */ lb $s3, 7($s1)
-glabel L_EU_802E95DC
-/* 0A8DDC 802E95DC 0C0B9DA5 */ jal m64_read_s16
-/* 0A8DE0 802E95E0 02002025 */ move $a0, $s0
-/* 0A8DE4 802E95E4 8E390014 */ lw $t9, 0x14($s1)
-/* 0A8DE8 802E95E8 02402825 */ move $a1, $s2
-/* 0A8DEC 802E95EC 30AF000F */ andi $t7, $a1, 0xf
-/* 0A8DF0 802E95F0 3048FFFF */ andi $t0, $v0, 0xffff
-/* 0A8DF4 802E95F4 01E02825 */ move $a1, $t7
-/* 0A8DF8 802E95F8 02202025 */ move $a0, $s1
-/* 0A8DFC 802E95FC 0C0B9CFA */ jal sequence_channel_enable
-/* 0A8E00 802E9600 03283021 */ addu $a2, $t9, $t0
-/* 0A8E04 802E9604 1000FE87 */ b .L_EU_802E9024
-/* 0A8E08 802E9608 00000000 */ nop
-.L08020140C:
-/* 0A8E0C 802E960C 3C108023 */ lui $s0, %hi(gSequenceChannelNone) # $s0, 0x8023
-/* 0A8E10 802E9610 02201825 */ move $v1, $s1
-/* 0A8E14 802E9614 24110040 */ li $s1, 64
-/* 0A8E18 802E9618 26108748 */ addiu $s0, %lo(gSequenceChannelNone) # addiu $s0, $s0, -0x78b8
-/* 0A8E1C 802E961C 00001025 */ move $v0, $zero
-.L080201420:
-/* 0A8E20 802E9620 8C640030 */ lw $a0, 0x30($v1)
-/* 0A8E24 802E9624 24010001 */ li $at, 1
-/* 0A8E28 802E9628 02044826 */ xor $t1, $s0, $a0
-/* 0A8E2C 802E962C 0009482B */ sltu $t1, $zero, $t1
-/* 0A8E30 802E9630 55210007 */ bnel $t1, $at, .L080201450
-/* 0A8E34 802E9634 24420004 */ addiu $v0, $v0, 4
-/* 0A8E38 802E9638 AFA20034 */ sw $v0, 0x34($sp)
-/* 0A8E3C 802E963C 0C0BA0AE */ jal sequence_channel_process_script
-/* 0A8E40 802E9640 AFA30030 */ sw $v1, 0x30($sp)
-/* 0A8E44 802E9644 8FA20034 */ lw $v0, 0x34($sp)
-/* 0A8E48 802E9648 8FA30030 */ lw $v1, 0x30($sp)
-/* 0A8E4C 802E964C 24420004 */ addiu $v0, $v0, 4
-.L080201450:
-/* 0A8E50 802E9650 1451FFF3 */ bne $v0, $s1, .L080201420
-/* 0A8E54 802E9654 24630004 */ addiu $v1, $v1, 4
-.L080201458:
-/* 0A8E58 802E9658 8FBF002C */ lw $ra, 0x2c($sp)
-.L08020145C:
-/* 0A8E5C 802E965C 8FB0001C */ lw $s0, 0x1c($sp)
-/* 0A8E60 802E9660 8FB10020 */ lw $s1, 0x20($sp)
-/* 0A8E64 802E9664 8FB20024 */ lw $s2, 0x24($sp)
-/* 0A8E68 802E9668 8FB30028 */ lw $s3, 0x28($sp)
-/* 0A8E6C 802E966C 03E00008 */ jr $ra
-/* 0A8E70 802E9670 27BD0060 */ addiu $sp, $sp, 0x60
diff --git a/asm/non_matchings/eu/audio/synthesis_do_one_audio_update.s b/asm/non_matchings/eu/audio/synthesis_do_one_audio_update.s
@@ -1,331 +0,0 @@
-glabel synthesis_do_one_audio_update
-/* 09FA28 802E0228 27BDFF40 */ addiu $sp, $sp, -0xc0
-/* 09FA2C 802E022C 3C0A8022 */ lui $t2, %hi(gNumSynthesisReverbs) # $t2, 0x8022
-/* 09FA30 802E0230 254AC5E3 */ addiu $t2, %lo(gNumSynthesisReverbs) # addiu $t2, $t2, -0x3a1d
-/* 09FA34 802E0234 81480000 */ lb $t0, ($t2)
-/* 09FA38 802E0238 AFBE0040 */ sw $fp, 0x40($sp)
-/* 09FA3C 802E023C AFB40030 */ sw $s4, 0x30($sp)
-/* 09FA40 802E0240 AFB20028 */ sw $s2, 0x28($sp)
-/* 09FA44 802E0244 00C0A025 */ move $s4, $a2
-/* 09FA48 802E0248 00E0F025 */ move $fp, $a3
-/* 09FA4C 802E024C AFBF0044 */ sw $ra, 0x44($sp)
-/* 09FA50 802E0250 AFB7003C */ sw $s7, 0x3c($sp)
-/* 09FA54 802E0254 AFB60038 */ sw $s6, 0x38($sp)
-/* 09FA58 802E0258 AFB50034 */ sw $s5, 0x34($sp)
-/* 09FA5C 802E025C AFB3002C */ sw $s3, 0x2c($sp)
-/* 09FA60 802E0260 AFB10024 */ sw $s1, 0x24($sp)
-/* 09FA64 802E0264 AFB00020 */ sw $s0, 0x20($sp)
-/* 09FA68 802E0268 AFA400C0 */ sw $a0, 0xc0($sp)
-/* 09FA6C 802E026C AFA500C4 */ sw $a1, 0xc4($sp)
-/* 09FA70 802E0270 1500001D */ bnez $t0, .L80200C98
-/* 09FA74 802E0274 00009025 */ move $s2, $zero
-/* 09FA78 802E0278 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
-/* 09FA7C 802E027C 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
-/* 09FA80 802E0280 00008825 */ move $s1, $zero
-/* 09FA84 802E0284 18800016 */ blez $a0, .L80200C90
-/* 09FA88 802E0288 00000000 */ nop
-/* 09FA8C 802E028C 00870019 */ multu $a0, $a3
-/* 09FA90 802E0290 3C0E8022 */ lui $t6, %hi(gNoteSubsEu) # $t6, 0x8022
-/* 09FA94 802E0294 8DCEC5E4 */ lw $t6, %lo(gNoteSubsEu)($t6)
-/* 09FA98 802E0298 27A50084 */ addiu $a1, $sp, 0x84
-/* 09FA9C 802E029C 00007812 */ mflo $t7
-/* 09FAA0 802E02A0 000FC100 */ sll $t8, $t7, 4
-/* 09FAA4 802E02A4 01D81021 */ addu $v0, $t6, $t8
-.L80200C58:
-/* 09FAA8 802E02A8 8C590000 */ lw $t9, ($v0)
-/* 09FAAC 802E02AC 00B26021 */ addu $t4, $a1, $s2
-/* 09FAB0 802E02B0 00195FC2 */ srl $t3, $t9, 0x1f
-/* 09FAB4 802E02B4 51600006 */ beql $t3, $zero, .L80200C80
-/* 09FAB8 802E02B8 26310001 */ addiu $s1, $s1, 1
-/* 09FABC 802E02BC 26520001 */ addiu $s2, $s2, 1
-/* 09FAC0 802E02C0 00126C00 */ sll $t5, $s2, 0x10
-/* 09FAC4 802E02C4 000D9403 */ sra $s2, $t5, 0x10
-/* 09FAC8 802E02C8 A1910000 */ sb $s1, ($t4)
-/* 09FACC 802E02CC 26310001 */ addiu $s1, $s1, 1
-.L80200C80:
-/* 09FAD0 802E02D0 0224082A */ slt $at, $s1, $a0
-/* 09FAD4 802E02D4 1420FFF4 */ bnez $at, .L80200C58
-/* 09FAD8 802E02D8 24420010 */ addiu $v0, $v0, 0x10
-/* 09FADC 802E02DC 00008825 */ move $s1, $zero
-.L80200C90:
-/* 09FAE0 802E02E0 10000049 */ b .L80200DB8
-/* 09FAE4 802E02E4 00009825 */ move $s3, $zero
-.L80200C98:
-/* 09FAE8 802E02E8 19000026 */ blez $t0, .L80200D34
-/* 09FAEC 802E02EC 00009825 */ move $s3, $zero
-/* 09FAF0 802E02F0 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
-/* 09FAF4 802E02F4 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
-/* 09FAF8 802E02F8 27A50084 */ addiu $a1, $sp, 0x84
-.L80200CAC:
-/* 09FAFC 802E02FC 1880001A */ blez $a0, .L80200D18
-/* 09FB00 802E0300 00008825 */ move $s1, $zero
-/* 09FB04 802E0304 009E0019 */ multu $a0, $fp
-/* 09FB08 802E0308 3C098022 */ lui $t1, %hi(gNoteSubsEu) # $t1, 0x8022
-/* 09FB0C 802E030C 8D29C5E4 */ lw $t1, %lo(gNoteSubsEu)($t1)
-/* 09FB10 802E0310 00001812 */ mflo $v1
-/* 09FB14 802E0314 00000000 */ nop
-/* 09FB18 802E0318 00000000 */ nop
-.L80200CCC:
-/* 09FB1C 802E031C 00037100 */ sll $t6, $v1, 4
-/* 09FB20 802E0320 01C91021 */ addu $v0, $t6, $t1
-/* 09FB24 802E0324 8C580000 */ lw $t8, ($v0)
-/* 09FB28 802E0328 0018CFC2 */ srl $t9, $t8, 0x1f
-/* 09FB2C 802E032C 5320000B */ beql $t9, $zero, .L80200D0C
-/* 09FB30 802E0330 26310001 */ addiu $s1, $s1, 1
-/* 09FB34 802E0334 904B0001 */ lbu $t3, 1($v0)
-/* 09FB38 802E0338 00B26821 */ addu $t5, $a1, $s2
-/* 09FB3C 802E033C 000B6142 */ srl $t4, $t3, 5
-/* 09FB40 802E0340 566C0006 */ bnel $s3, $t4, .L80200D0C
-/* 09FB44 802E0344 26310001 */ addiu $s1, $s1, 1
-/* 09FB48 802E0348 26520001 */ addiu $s2, $s2, 1
-/* 09FB4C 802E034C 00127C00 */ sll $t7, $s2, 0x10
-/* 09FB50 802E0350 000F9403 */ sra $s2, $t7, 0x10
-/* 09FB54 802E0354 A1B10000 */ sb $s1, ($t5)
-/* 09FB58 802E0358 26310001 */ addiu $s1, $s1, 1
-.L80200D0C:
-/* 09FB5C 802E035C 0224082A */ slt $at, $s1, $a0
-/* 09FB60 802E0360 1420FFEE */ bnez $at, .L80200CCC
-/* 09FB64 802E0364 24630001 */ addiu $v1, $v1, 1
-.L80200D18:
-/* 09FB68 802E0368 26730001 */ addiu $s3, $s3, 1
-/* 09FB6C 802E036C 0013C400 */ sll $t8, $s3, 0x10
-/* 09FB70 802E0370 00189C03 */ sra $s3, $t8, 0x10
-/* 09FB74 802E0374 0268082A */ slt $at, $s3, $t0
-/* 09FB78 802E0378 1420FFE0 */ bnez $at, .L80200CAC
-/* 09FB7C 802E037C 00000000 */ nop
-/* 09FB80 802E0380 00009825 */ move $s3, $zero
-.L80200D34:
-/* 09FB84 802E0384 3C048023 */ lui $a0, %hi(gMaxSimultaneousNotes) # $a0, 0x8023
-/* 09FB88 802E0388 8C849808 */ lw $a0, %lo(gMaxSimultaneousNotes)($a0)
-/* 09FB8C 802E038C 27A50084 */ addiu $a1, $sp, 0x84
-/* 09FB90 802E0390 00008825 */ move $s1, $zero
-/* 09FB94 802E0394 5880001D */ blezl $a0, .L80200DBC
-/* 09FB98 802E0398 02801025 */ move $v0, $s4
-/* 09FB9C 802E039C 009E0019 */ multu $a0, $fp
-/* 09FBA0 802E03A0 3C098022 */ lui $t1, %hi(gNoteSubsEu) # $t1, 0x8022
-/* 09FBA4 802E03A4 8D29C5E4 */ lw $t1, %lo(gNoteSubsEu)($t1)
-/* 09FBA8 802E03A8 00001812 */ mflo $v1
-/* 09FBAC 802E03AC 00000000 */ nop
-/* 09FBB0 802E03B0 00000000 */ nop
-.L80200D64:
-/* 09FBB4 802E03B4 00035900 */ sll $t3, $v1, 4
-/* 09FBB8 802E03B8 01691021 */ addu $v0, $t3, $t1
-/* 09FBBC 802E03BC 8C4C0000 */ lw $t4, ($v0)
-/* 09FBC0 802E03C0 000C6FC2 */ srl $t5, $t4, 0x1f
-/* 09FBC4 802E03C4 51A0000C */ beql $t5, $zero, .L80200DA8
-/* 09FBC8 802E03C8 26310001 */ addiu $s1, $s1, 1
-/* 09FBCC 802E03CC 904F0001 */ lbu $t7, 1($v0)
-/* 09FBD0 802E03D0 00B2C021 */ addu $t8, $a1, $s2
-/* 09FBD4 802E03D4 000F7142 */ srl $t6, $t7, 5
-/* 09FBD8 802E03D8 01C8082A */ slt $at, $t6, $t0
-/* 09FBDC 802E03DC 54200006 */ bnezl $at, .L80200DA8
-/* 09FBE0 802E03E0 26310001 */ addiu $s1, $s1, 1
-/* 09FBE4 802E03E4 26520001 */ addiu $s2, $s2, 1
-/* 09FBE8 802E03E8 0012CC00 */ sll $t9, $s2, 0x10
-/* 09FBEC 802E03EC 00199403 */ sra $s2, $t9, 0x10
-/* 09FBF0 802E03F0 A3110000 */ sb $s1, ($t8)
-/* 09FBF4 802E03F4 26310001 */ addiu $s1, $s1, 1
-.L80200DA8:
-/* 09FBF8 802E03F8 0224082A */ slt $at, $s1, $a0
-/* 09FBFC 802E03FC 1420FFED */ bnez $at, .L80200D64
-/* 09FC00 802E0400 24630001 */ addiu $v1, $v1, 1
-/* 09FC04 802E0404 00008825 */ move $s1, $zero
-.L80200DB8:
-/* 09FC08 802E0408 02801025 */ move $v0, $s4
-.L80200DBC:
-/* 09FC0C 802E040C 3C0C0200 */ lui $t4, (0x020004C0 >> 16) # lui $t4, 0x200
-/* 09FC10 802E0410 358C04C0 */ ori $t4, (0x020004C0 & 0xFFFF) # ori $t4, $t4, 0x4c0
-/* 09FC14 802E0414 240D0280 */ li $t5, 640
-/* 09FC18 802E0418 AC4D0004 */ sw $t5, 4($v0)
-/* 09FC1C 802E041C AC4C0000 */ sw $t4, ($v0)
-/* 09FC20 802E0420 814F0000 */ lb $t7, ($t2)
-/* 09FC24 802E0424 3C178022 */ lui $s7, %hi(gNotes) # $s7, 0x8022
-/* 09FC28 802E0428 26940008 */ addiu $s4, $s4, 8
-/* 09FC2C 802E042C 19E00053 */ blez $t7, .L80200F2C
-/* 09FC30 802E0430 26F73D60 */ addiu $s7, %lo(gNotes) # addiu $s7, $s7, 0x3d60
-/* 09FC34 802E0434 3C158022 */ lui $s5, %hi(gNoteSubsEu) # $s5, 0x8022
-/* 09FC38 802E0438 26B5C5E4 */ addiu $s5, %lo(gNoteSubsEu) # addiu $s5, $s5, -0x3a1c
-/* 09FC3C 802E043C 241600C0 */ li $s6, 192
-/* 09FC40 802E0440 00137140 */ sll $t6, $s3, 5
-.L80200DF4:
-/* 09FC44 802E0444 01D37021 */ addu $t6, $t6, $s3
-/* 09FC48 802E0448 3C188022 */ lui $t8, %hi(gSynthesisReverbs) # $t8, 0x8022
-/* 09FC4C 802E044C 2718C1B0 */ addiu $t8, %lo(gSynthesisReverbs) # addiu $t8, $t8, -0x3e50
-/* 09FC50 802E0450 000E70C0 */ sll $t6, $t6, 3
-/* 09FC54 802E0454 01D8C821 */ addu $t9, $t6, $t8
-/* 09FC58 802E0458 AFB90060 */ sw $t9, 0x60($sp)
-/* 09FC5C 802E045C 932B0001 */ lbu $t3, 1($t9)
-/* 09FC60 802E0460 3C018022 */ lui $at, %hi(gUseReverb) # $at, 0x8022
-/* 09FC64 802E0464 02802025 */ move $a0, $s4
-/* 09FC68 802E0468 000B6600 */ sll $t4, $t3, 0x18
-/* 09FC6C 802E046C 000C6E03 */ sra $t5, $t4, 0x18
-/* 09FC70 802E0470 11A0000A */ beqz $t5, .L80200E4C
-/* 09FC74 802E0474 A02BC5E2 */ sb $t3, %lo(gUseReverb)($at)
-/* 09FC78 802E0478 00133400 */ sll $a2, $s3, 0x10
-/* 09FC7C 802E047C 001E3C00 */ sll $a3, $fp, 0x10
-/* 09FC80 802E0480 00077403 */ sra $t6, $a3, 0x10
-/* 09FC84 802E0484 00067C03 */ sra $t7, $a2, 0x10
-/* 09FC88 802E0488 01E03025 */ move $a2, $t7
-/* 09FC8C 802E048C 01C03825 */ move $a3, $t6
-/* 09FC90 802E0490 0C0B7F60 */ jal synthesis_resample_and_mix_reverb
-/* 09FC94 802E0494 8FA500C4 */ lw $a1, 0xc4($sp)
-/* 09FC98 802E0498 0040A025 */ move $s4, $v0
-.L80200E4C:
-/* 09FC9C 802E049C 0232082A */ slt $at, $s1, $s2
-/* 09FCA0 802E04A0 10200022 */ beqz $at, .L80200EDC
-/* 09FCA4 802E04A4 27B80084 */ addiu $t8, $sp, 0x84
-/* 09FCA8 802E04A8 02388021 */ addu $s0, $s1, $t8
-.L80200E5C:
-/* 09FCAC 802E04AC 3C198023 */ lui $t9, %hi(gMaxSimultaneousNotes) # $t9, 0x8023
-/* 09FCB0 802E04B0 8F399808 */ lw $t9, %lo(gMaxSimultaneousNotes)($t9)
-/* 09FCB4 802E04B4 92030000 */ lbu $v1, ($s0)
-/* 09FCB8 802E04B8 8EA90000 */ lw $t1, ($s5)
-/* 09FCBC 802E04BC 03D90019 */ multu $fp, $t9
-/* 09FCC0 802E04C0 00035900 */ sll $t3, $v1, 4
-/* 09FCC4 802E04C4 012B6021 */ addu $t4, $t1, $t3
-/* 09FCC8 802E04C8 00001012 */ mflo $v0
-/* 09FCCC 802E04CC 00026900 */ sll $t5, $v0, 4
-/* 09FCD0 802E04D0 018D7821 */ addu $t7, $t4, $t5
-/* 09FCD4 802E04D4 91EE0001 */ lbu $t6, 1($t7)
-/* 09FCD8 802E04D8 000EC142 */ srl $t8, $t6, 5
-/* 09FCDC 802E04DC 56780014 */ bnel $s3, $t8, .L80200EE0
-/* 09FCE0 802E04E0 8FAE0060 */ lw $t6, 0x60($sp)
-/* 09FCE4 802E04E4 00760019 */ multu $v1, $s6
-/* 09FCE8 802E04E8 8EEB0000 */ lw $t3, ($s7)
-/* 09FCEC 802E04EC 8FAF00C4 */ lw $t7, 0xc4($sp)
-/* 09FCF0 802E04F0 00626021 */ addu $t4, $v1, $v0
-/* 09FCF4 802E04F4 000C6900 */ sll $t5, $t4, 4
-/* 09FCF8 802E04F8 01A92821 */ addu $a1, $t5, $t1
-/* 09FCFC 802E04FC 8FA700C0 */ lw $a3, 0xc0($sp)
-/* 09FD00 802E0500 AFB40014 */ sw $s4, 0x14($sp)
-/* 09FD04 802E0504 AFAF0010 */ sw $t7, 0x10($sp)
-/* 09FD08 802E0508 0000C812 */ mflo $t9
-/* 09FD0C 802E050C 032B2021 */ addu $a0, $t9, $t3
-/* 09FD10 802E0510 0C0B81BC */ jal synthesis_process_note
-/* 09FD14 802E0514 24860010 */ addiu $a2, $a0, 0x10
-/* 09FD18 802E0518 26310001 */ addiu $s1, $s1, 1
-/* 09FD1C 802E051C 0232082A */ slt $at, $s1, $s2
-/* 09FD20 802E0520 0040A025 */ move $s4, $v0
-/* 09FD24 802E0524 1420FFE1 */ bnez $at, .L80200E5C
-/* 09FD28 802E0528 26100001 */ addiu $s0, $s0, 1
-.L80200EDC:
-/* 09FD2C 802E052C 8FAE0060 */ lw $t6, 0x60($sp)
-.L80200EE0:
-/* 09FD30 802E0530 00132C00 */ sll $a1, $s3, 0x10
-/* 09FD34 802E0534 0005CC03 */ sra $t9, $a1, 0x10
-/* 09FD38 802E0538 91D80001 */ lbu $t8, 1($t6)
-/* 09FD3C 802E053C 03202825 */ move $a1, $t9
-/* 09FD40 802E0540 02802025 */ move $a0, $s4
-/* 09FD44 802E0544 13000005 */ beqz $t8, .L80200F0C
-/* 09FD48 802E0548 001E3400 */ sll $a2, $fp, 0x10
-/* 09FD4C 802E054C 00065C03 */ sra $t3, $a2, 0x10
-/* 09FD50 802E0550 0C0B8036 */ jal func_eu_802e00d8
-/* 09FD54 802E0554 01603025 */ move $a2, $t3
-/* 09FD58 802E0558 0040A025 */ move $s4, $v0
-.L80200F0C:
-/* 09FD5C 802E055C 3C0F8022 */ lui $t7, %hi(gNumSynthesisReverbs) # $t7, 0x8022
-/* 09FD60 802E0560 81EFC5E3 */ lb $t7, %lo(gNumSynthesisReverbs)($t7)
-/* 09FD64 802E0564 26730001 */ addiu $s3, $s3, 1
-/* 09FD68 802E0568 00136400 */ sll $t4, $s3, 0x10
-/* 09FD6C 802E056C 000C9C03 */ sra $s3, $t4, 0x10
-/* 09FD70 802E0570 026F082A */ slt $at, $s3, $t7
-/* 09FD74 802E0574 5420FFB3 */ bnezl $at, .L80200DF4
-/* 09FD78 802E0578 00137140 */ sll $t6, $s3, 5
-.L80200F2C:
-/* 09FD7C 802E057C 3C158022 */ lui $s5, %hi(gNoteSubsEu) # $s5, 0x8022
-/* 09FD80 802E0580 3C178022 */ lui $s7, %hi(gNotes) # $s7, 0x8022
-/* 09FD84 802E0584 0232082A */ slt $at, $s1, $s2
-/* 09FD88 802E0588 26F73D60 */ addiu $s7, %lo(gNotes) # addiu $s7, $s7, 0x3d60
-/* 09FD8C 802E058C 26B5C5E4 */ addiu $s5, %lo(gNoteSubsEu) # addiu $s5, $s5, -0x3a1c
-/* 09FD90 802E0590 1020002E */ beqz $at, .L80200FFC
-/* 09FD94 802E0594 241600C0 */ li $s6, 192
-/* 09FD98 802E0598 27AE0084 */ addiu $t6, $sp, 0x84
-/* 09FD9C 802E059C 022E8021 */ addu $s0, $s1, $t6
-/* 09FDA0 802E05A0 24130001 */ li $s3, 1
-.L80200F54:
-/* 09FDA4 802E05A4 3C188023 */ lui $t8, %hi(gMaxSimultaneousNotes) # $t8, 0x8023
-/* 09FDA8 802E05A8 8F189808 */ lw $t8, %lo(gMaxSimultaneousNotes)($t8)
-/* 09FDAC 802E05AC 92030000 */ lbu $v1, ($s0)
-/* 09FDB0 802E05B0 8EA90000 */ lw $t1, ($s5)
-/* 09FDB4 802E05B4 03D80019 */ multu $fp, $t8
-/* 09FDB8 802E05B8 0003C900 */ sll $t9, $v1, 4
-/* 09FDBC 802E05BC 01395821 */ addu $t3, $t1, $t9
-/* 09FDC0 802E05C0 3C0F8022 */ lui $t7, %hi(gBankLoadStatus)
-/* 09FDC4 802E05C4 3C011000 */ lui $at, 0x1000
-/* 09FDC8 802E05C8 00001012 */ mflo $v0
-/* 09FDCC 802E05CC 00026100 */ sll $t4, $v0, 4
-/* 09FDD0 802E05D0 016C6821 */ addu $t5, $t3, $t4
-/* 09FDD4 802E05D4 91A40002 */ lbu $a0, 2($t5)
-/* 09FDD8 802E05D8 01E47821 */ addu $t7, $t7, $a0
-/* 09FDDC 802E05DC 91EF2C18 */ lbu $t7, %lo(gBankLoadStatus)($t7)
-/* 09FDE0 802E05E0 29EE0002 */ slti $t6, $t7, 2
-/* 09FDE4 802E05E4 39CE0001 */ xori $t6, $t6, 1
-/* 09FDE8 802E05E8 166E0010 */ bne $s3, $t6, .L80200FDC
-/* 09FDEC 802E05EC 00117A00 */ sll $t7, $s1, 8
-/* 09FDF0 802E05F0 00760019 */ multu $v1, $s6
-/* 09FDF4 802E05F4 8EF90000 */ lw $t9, ($s7)
-/* 09FDF8 802E05F8 8FAD00C4 */ lw $t5, 0xc4($sp)
-/* 09FDFC 802E05FC 00625821 */ addu $t3, $v1, $v0
-/* 09FE00 802E0600 000B6100 */ sll $t4, $t3, 4
-/* 09FE04 802E0604 01892821 */ addu $a1, $t4, $t1
-/* 09FE08 802E0608 8FA700C0 */ lw $a3, 0xc0($sp)
-/* 09FE0C 802E060C AFB40014 */ sw $s4, 0x14($sp)
-/* 09FE10 802E0610 AFAD0010 */ sw $t5, 0x10($sp)
-/* 09FE14 802E0614 0000C012 */ mflo $t8
-/* 09FE18 802E0618 03192021 */ addu $a0, $t8, $t9
-/* 09FE1C 802E061C 0C0B81BC */ jal synthesis_process_note
-/* 09FE20 802E0620 24860010 */ addiu $a2, $a0, 0x10
-/* 09FE24 802E0624 10000005 */ b .L80200FEC
-/* 09FE28 802E0628 0040A025 */ move $s4, $v0
-.L80200FDC:
-/* 09FE2C 802E062C 008F7021 */ addu $t6, $a0, $t7
-/* 09FE30 802E0630 01C1C021 */ addu $t8, $t6, $at
-/* 09FE34 802E0634 3C018023 */ lui $at, %hi(gAudioErrorFlags) # $at, 0x8023
-/* 09FE38 802E0638 AC3898F0 */ sw $t8, %lo(gAudioErrorFlags)($at)
-.L80200FEC:
-/* 09FE3C 802E063C 26310001 */ addiu $s1, $s1, 1
-/* 09FE40 802E0640 0232082A */ slt $at, $s1, $s2
-/* 09FE44 802E0644 1420FFD7 */ bnez $at, .L80200F54
-/* 09FE48 802E0648 26100001 */ addiu $s0, $s0, 1
-.L80200FFC:
-/* 09FE4C 802E064C 3C080800 */ lui $t0, 0x800
-/* 09FE50 802E0650 02802025 */ move $a0, $s4
-/* 09FE54 802E0654 AC880000 */ sw $t0, ($a0)
-/* 09FE58 802E0658 8FA300C4 */ lw $v1, 0xc4($sp)
-/* 09FE5C 802E065C 26940008 */ addiu $s4, $s4, 8
-/* 09FE60 802E0660 02802825 */ move $a1, $s4
-/* 09FE64 802E0664 0003C840 */ sll $t9, $v1, 1
-/* 09FE68 802E0668 332BFFFF */ andi $t3, $t9, 0xffff
-/* 09FE6C 802E066C AC8B0004 */ sw $t3, 4($a0)
-/* 09FE70 802E0670 26940008 */ addiu $s4, $s4, 8
-/* 09FE74 802E0674 3C0D04C0 */ lui $t5, (0x04C00600 >> 16) # lui $t5, 0x4c0
-/* 09FE78 802E0678 35AD0600 */ ori $t5, (0x04C00600 & 0xFFFF) # ori $t5, $t5, 0x600
-/* 09FE7C 802E067C 3C0C0D00 */ lui $t4, 0xd00
-/* 09FE80 802E0680 02803025 */ move $a2, $s4
-/* 09FE84 802E0684 ACAC0000 */ sw $t4, ($a1)
-/* 09FE88 802E0688 ACAD0004 */ sw $t5, 4($a1)
-/* 09FE8C 802E068C 00197840 */ sll $t7, $t9, 1
-/* 09FE90 802E0690 31EEFFFF */ andi $t6, $t7, 0xffff
-/* 09FE94 802E0694 26940008 */ addiu $s4, $s4, 8
-/* 09FE98 802E0698 ACCE0004 */ sw $t6, 4($a2)
-/* 09FE9C 802E069C ACC80000 */ sw $t0, ($a2)
-/* 09FEA0 802E06A0 02803825 */ move $a3, $s4
-/* 09FEA4 802E06A4 3C180600 */ lui $t8, 0x600
-/* 09FEA8 802E06A8 ACF80000 */ sw $t8, ($a3)
-/* 09FEAC 802E06AC 8FB900C0 */ lw $t9, 0xc0($sp)
-/* 09FEB0 802E06B0 3C018000 */ lui $at, 0x8000
-/* 09FEB4 802E06B4 26820008 */ addiu $v0, $s4, 8
-/* 09FEB8 802E06B8 03215821 */ addu $t3, $t9, $at
-/* 09FEBC 802E06BC ACEB0004 */ sw $t3, 4($a3)
-/* 09FEC0 802E06C0 8FBF0044 */ lw $ra, 0x44($sp)
-/* 09FEC4 802E06C4 8FBE0040 */ lw $fp, 0x40($sp)
-/* 09FEC8 802E06C8 8FB7003C */ lw $s7, 0x3c($sp)
-/* 09FECC 802E06CC 8FB60038 */ lw $s6, 0x38($sp)
-/* 09FED0 802E06D0 8FB50034 */ lw $s5, 0x34($sp)
-/* 09FED4 802E06D4 8FB40030 */ lw $s4, 0x30($sp)
-/* 09FED8 802E06D8 8FB3002C */ lw $s3, 0x2c($sp)
-/* 09FEDC 802E06DC 8FB20028 */ lw $s2, 0x28($sp)
-/* 09FEE0 802E06E0 8FB10024 */ lw $s1, 0x24($sp)
-/* 09FEE4 802E06E4 8FB00020 */ lw $s0, 0x20($sp)
-/* 09FEE8 802E06E8 03E00008 */ jr $ra
-/* 09FEEC 802E06EC 27BD00C0 */ addiu $sp, $sp, 0xc0
diff --git a/asm/non_matchings/eu/audio/synthesis_execute.s b/asm/non_matchings/eu/audio/synthesis_execute.s
@@ -1,178 +0,0 @@
-glabel synthesis_execute
-/* 09F2FC 802DFAFC 27BDFFA0 */ addiu $sp, $sp, -0x60
-/* 09F300 802DFB00 AFB60030 */ sw $s6, 0x30($sp)
-/* 09F304 802DFB04 3C168023 */ lui $s6, %hi(gAudioBufferParameters) # $s6, 0x8023
-/* 09F308 802DFB08 26D697E0 */ addiu $s6, %lo(gAudioBufferParameters) # addiu $s6, $s6, -0x6820
-/* 09F30C 802DFB0C AFB40028 */ sw $s4, 0x28($sp)
-/* 09F310 802DFB10 86D4000C */ lh $s4, 0xc($s6)
-/* 09F314 802DFB14 AFB70034 */ sw $s7, 0x34($sp)
-/* 09F318 802DFB18 AFB1001C */ sw $s1, 0x1c($sp)
-/* 09F31C 802DFB1C 00C08825 */ move $s1, $a2
-/* 09F320 802DFB20 00E0B825 */ move $s7, $a3
-/* 09F324 802DFB24 AFBF003C */ sw $ra, 0x3c($sp)
-/* 09F328 802DFB28 AFBE0038 */ sw $fp, 0x38($sp)
-/* 09F32C 802DFB2C AFB5002C */ sw $s5, 0x2c($sp)
-/* 09F330 802DFB30 AFB30024 */ sw $s3, 0x24($sp)
-/* 09F334 802DFB34 AFB20020 */ sw $s2, 0x20($sp)
-/* 09F338 802DFB38 AFB00018 */ sw $s0, 0x18($sp)
-/* 09F33C 802DFB3C AFA40060 */ sw $a0, 0x60($sp)
-/* 09F340 802DFB40 1A800009 */ blez $s4, .L80200518
-/* 09F344 802DFB44 AFA50064 */ sw $a1, 0x64($sp)
-.L802004F8:
-/* 09F348 802DFB48 2690FFFF */ addiu $s0, $s4, -1
-/* 09F34C 802DFB4C 0C0BA59D */ jal process_sequences
-/* 09F350 802DFB50 02002025 */ move $a0, $s0
-/* 09F354 802DFB54 86CE000C */ lh $t6, 0xc($s6)
-/* 09F358 802DFB58 0C0B7E91 */ jal synthesis_load_note_subs_eu
-/* 09F35C 802DFB5C 01D42023 */ subu $a0, $t6, $s4
-/* 09F360 802DFB60 1E00FFF9 */ bgtz $s0, .L802004F8
-/* 09F364 802DFB64 0200A025 */ move $s4, $s0
-.L80200518:
-/* 09F368 802DFB68 8FAF0060 */ lw $t7, 0x60($sp)
-/* 09F36C 802DFB6C 3C190700 */ lui $t9, 0x700
-/* 09F370 802DFB70 0220F025 */ move $fp, $s1
-/* 09F374 802DFB74 25F80008 */ addiu $t8, $t7, 8
-/* 09F378 802DFB78 AFB80048 */ sw $t8, 0x48($sp)
-/* 09F37C 802DFB7C ADE00004 */ sw $zero, 4($t7)
-/* 09F380 802DFB80 ADF90000 */ sw $t9, ($t7)
-/* 09F384 802DFB84 86D4000C */ lh $s4, 0xc($s6)
-/* 09F388 802DFB88 8FB50040 */ lw $s5, 0x40($sp)
-/* 09F38C 802DFB8C 01E01025 */ move $v0, $t7
-/* 09F390 802DFB90 1A800056 */ blez $s4, .L8020069C
-.L80200544:
-/* 09F394 802DFB94 24010001 */ li $at, 1
-/* 09F398 802DFB98 86D2000C */ lh $s2, 0xc($s6)
-/* 09F39C 802DFB9C 1681000B */ bne $s4, $at, .L8020057C
-/* 09F3A0 802DFBA0 00008825 */ move $s1, $zero
-/* 09F3A4 802DFBA4 3C098022 */ lui $t1, %hi(gLeftVolRampings) # $t1, 0x8022
-/* 09F3A8 802DFBA8 3C0B8022 */ lui $t3, %hi(gRightVolRampings) # $t3, 0x8022
-/* 09F3AC 802DFBAC 256BF5E8 */ addiu $t3, %lo(gRightVolRampings) # addiu $t3, $t3, -0xa18
-/* 09F3B0 802DFBB0 2529C5E8 */ addiu $t1, %lo(gLeftVolRampings) # addiu $t1, $t1, -0x3a18
-/* 09F3B4 802DFBB4 00154300 */ sll $t0, $s5, 0xc
-/* 09F3B8 802DFBB8 00155300 */ sll $t2, $s5, 0xc
-/* 09F3BC 802DFBBC 014B2021 */ addu $a0, $t2, $t3
-/* 09F3C0 802DFBC0 01091821 */ addu $v1, $t0, $t1
-/* 09F3C4 802DFBC4 10000026 */ b .L80200610
-/* 09F3C8 802DFBC8 02E09825 */ move $s3, $s7
-.L8020057C:
-/* 09F3CC 802DFBCC 02F4001A */ div $zero, $s7, $s4
-/* 09F3D0 802DFBD0 16800002 */ bnez $s4, .L8020058C
-/* 09F3D4 802DFBD4 00000000 */ nop
-/* 09F3D8 802DFBD8 0007000D */ break 7
-.L8020058C:
-/* 09F3DC 802DFBDC 2401FFFF */ li $at, -1
-/* 09F3E0 802DFBE0 16810004 */ bne $s4, $at, .L802005A4
-/* 09F3E4 802DFBE4 3C018000 */ lui $at, 0x8000
-/* 09F3E8 802DFBE8 16E10002 */ bne $s7, $at, .L802005A4
-/* 09F3EC 802DFBEC 00000000 */ nop
-/* 09F3F0 802DFBF0 0006000D */ break 6
-.L802005A4:
-/* 09F3F4 802DFBF4 86C50010 */ lh $a1, 0x10($s6)
-/* 09F3F8 802DFBF8 00001012 */ mflo $v0
-/* 09F3FC 802DFBFC 24150002 */ li $s5, 2
-/* 09F400 802DFC00 0045082A */ slt $at, $v0, $a1
-/* 09F404 802DFC04 14200006 */ bnez $at, .L802005D0
-/* 09F408 802DFC08 00A09825 */ move $s3, $a1
-/* 09F40C 802DFC0C 3C038022 */ lui $v1, %hi(gLeftVolRampings + 0x2000) # $v1, 0x8022
-/* 09F410 802DFC10 3C048022 */ lui $a0, %hi(gRightVolRampings + 0x2000) # $a0, 0x8022
-/* 09F414 802DFC14 248415E8 */ addiu $a0, %lo(gRightVolRampings + 0x2000) # addiu $a0, $a0, 0x15e8
-/* 09F418 802DFC18 10000011 */ b .L80200610
-/* 09F41C 802DFC1C 2463E5E8 */ addiu $v1, %lo(gLeftVolRampings + 0x2000) # addiu $v1, $v1, -0x1a18
-.L802005D0:
-/* 09F420 802DFC20 86C50012 */ lh $a1, 0x12($s6)
-/* 09F424 802DFC24 3C038022 */ lui $v1, %hi(gLeftVolRampings + 0x1000) # $v1, 0x8022
-/* 09F428 802DFC28 2463D5E8 */ addiu $v1, %lo(gLeftVolRampings + 0x1000) # addiu $v1, $v1, -0x2a18
-/* 09F42C 802DFC2C 00A2082A */ slt $at, $a1, $v0
-/* 09F430 802DFC30 14200008 */ bnez $at, .L80200604
-/* 09F434 802DFC34 24150001 */ li $s5, 1
-/* 09F438 802DFC38 3C038022 */ lui $v1, %hi(gLeftVolRampings) # $v1, 0x8022
-/* 09F43C 802DFC3C 3C048022 */ lui $a0, %hi(gRightVolRampings) # $a0, 0x8022
-/* 09F440 802DFC40 2484F5E8 */ addiu $a0, %lo(gRightVolRampings) # addiu $a0, $a0, -0xa18
-/* 09F444 802DFC44 2463C5E8 */ addiu $v1, %lo(gLeftVolRampings) # addiu $v1, $v1, -0x3a18
-/* 09F448 802DFC48 00A09825 */ move $s3, $a1
-/* 09F44C 802DFC4C 10000004 */ b .L80200610
-/* 09F450 802DFC50 0000A825 */ move $s5, $zero
-.L80200604:
-/* 09F454 802DFC54 3C048022 */ lui $a0, %hi(gRightVolRampings + 0x1000) # $a0, 0x8022
-/* 09F458 802DFC58 248405E8 */ addiu $a0, %lo(gRightVolRampings + 0x1000) # addiu $a0, $a0, 0x5e8
-/* 09F45C 802DFC5C 86D3000E */ lh $s3, 0xe($s6)
-.L80200610:
-/* 09F460 802DFC60 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
-/* 09F464 802DFC64 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
-/* 09F468 802DFC68 3C018022 */ lui $at, %hi(gCurrentLeftVolRamping) # $at, 0x8022
-/* 09F46C 802DFC6C AC2325E8 */ sw $v1, %lo(gCurrentLeftVolRamping)($at)
-/* 09F470 802DFC70 3C018022 */ lui $at, %hi(gCurrentRightVolRamping) # $at, 0x8022
-/* 09F474 802DFC74 18400011 */ blez $v0, .L8020066C
-/* 09F478 802DFC78 AC2425EC */ sw $a0, %lo(gCurrentRightVolRamping)($at)
-/* 09F47C 802DFC7C 3C108022 */ lui $s0, %hi(gSynthesisReverbs) # $s0, 0x8022
-/* 09F480 802DFC80 2610C1B0 */ addiu $s0, %lo(gSynthesisReverbs) # addiu $s0, $s0, -0x3e50
-.L80200634:
-/* 09F484 802DFC84 920C0001 */ lbu $t4, 1($s0)
-/* 09F488 802DFC88 02602025 */ move $a0, $s3
-/* 09F48C 802DFC8C 02542823 */ subu $a1, $s2, $s4
-/* 09F490 802DFC90 51800007 */ beql $t4, $zero, .L80200660
-/* 09F494 802DFC94 26310001 */ addiu $s1, $s1, 1
-/* 09F498 802DFC98 0C0B7D94 */ jal prepare_reverb_ring_buffer
-/* 09F49C 802DFC9C 02203025 */ move $a2, $s1
-/* 09F4A0 802DFCA0 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
-/* 09F4A4 802DFCA4 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
-/* 09F4A8 802DFCA8 86D2000C */ lh $s2, 0xc($s6)
-/* 09F4AC 802DFCAC 26310001 */ addiu $s1, $s1, 1
-.L80200660:
-/* 09F4B0 802DFCB0 0222082A */ slt $at, $s1, $v0
-/* 09F4B4 802DFCB4 1420FFF3 */ bnez $at, .L80200634
-/* 09F4B8 802DFCB8 26100108 */ addiu $s0, $s0, 0x108
-.L8020066C:
-/* 09F4BC 802DFCBC 03C02025 */ move $a0, $fp
-/* 09F4C0 802DFCC0 02602825 */ move $a1, $s3
-/* 09F4C4 802DFCC4 8FA60048 */ lw $a2, 0x48($sp)
-/* 09F4C8 802DFCC8 0C0B808A */ jal synthesis_do_one_audio_update
-/* 09F4CC 802DFCCC 02543823 */ subu $a3, $s2, $s4
-/* 09F4D0 802DFCD0 2694FFFF */ addiu $s4, $s4, -1
-/* 09F4D4 802DFCD4 00136880 */ sll $t5, $s3, 2
-/* 09F4D8 802DFCD8 AFA20048 */ sw $v0, 0x48($sp)
-/* 09F4DC 802DFCDC 02F3B823 */ subu $s7, $s7, $s3
-/* 09F4E0 802DFCE0 1E80FFAC */ bgtz $s4, .L80200544
-/* 09F4E4 802DFCE4 03CDF021 */ addu $fp, $fp, $t5
-/* 09F4E8 802DFCE8 AFB50040 */ sw $s5, 0x40($sp)
-.L8020069C:
-/* 09F4EC 802DFCEC 3C028022 */ lui $v0, %hi(gNumSynthesisReverbs) # $v0, 0x8022
-/* 09F4F0 802DFCF0 8042C5E3 */ lb $v0, %lo(gNumSynthesisReverbs)($v0)
-/* 09F4F4 802DFCF4 3C0E8022 */ lui $t6, %hi(gSynthesisReverbs)
-/* 09F4F8 802DFCF8 25D0C1B0 */ addiu $s0, $t6, %lo(gSynthesisReverbs)
-/* 09F4FC 802DFCFC 1840000E */ blez $v0, .L802006E8
-/* 09F500 802DFD00 00027940 */ sll $t7, $v0, 5
-/* 09F504 802DFD04 01E27821 */ addu $t7, $t7, $v0
-/* 09F508 802DFD08 000F78C0 */ sll $t7, $t7, 3
-/* 09F50C 802DFD0C 01F01821 */ addu $v1, $t7, $s0
-.L802006C0:
-/* 09F510 802DFD10 92020002 */ lbu $v0, 2($s0)
-/* 09F514 802DFD14 10400002 */ beqz $v0, .L802006D0
-/* 09F518 802DFD18 2458FFFF */ addiu $t8, $v0, -1
-/* 09F51C 802DFD1C A2180002 */ sb $t8, 2($s0)
-.L802006D0:
-/* 09F520 802DFD20 92190003 */ lbu $t9, 3($s0)
-/* 09F524 802DFD24 26100108 */ addiu $s0, $s0, 0x108
-/* 09F528 802DFD28 0203082B */ sltu $at, $s0, $v1
-/* 09F52C 802DFD2C 3B280001 */ xori $t0, $t9, 1
-/* 09F530 802DFD30 1420FFF7 */ bnez $at, .L802006C0
-/* 09F534 802DFD34 A208FEFB */ sb $t0, -0x105($s0)
-.L802006E8:
-/* 09F538 802DFD38 8FA20048 */ lw $v0, 0x48($sp)
-/* 09F53C 802DFD3C 8FAA0060 */ lw $t2, 0x60($sp)
-/* 09F540 802DFD40 8FAD0064 */ lw $t5, 0x64($sp)
-/* 09F544 802DFD44 004A5823 */ subu $t3, $v0, $t2
-/* 09F548 802DFD48 000B60C3 */ sra $t4, $t3, 3
-/* 09F54C 802DFD4C ADAC0000 */ sw $t4, ($t5)
-/* 09F550 802DFD50 8FBF003C */ lw $ra, 0x3c($sp)
-/* 09F554 802DFD54 8FBE0038 */ lw $fp, 0x38($sp)
-/* 09F558 802DFD58 8FB70034 */ lw $s7, 0x34($sp)
-/* 09F55C 802DFD5C 8FB60030 */ lw $s6, 0x30($sp)
-/* 09F560 802DFD60 8FB5002C */ lw $s5, 0x2c($sp)
-/* 09F564 802DFD64 8FB40028 */ lw $s4, 0x28($sp)
-/* 09F568 802DFD68 8FB30024 */ lw $s3, 0x24($sp)
-/* 09F56C 802DFD6C 8FB20020 */ lw $s2, 0x20($sp)
-/* 09F570 802DFD70 8FB1001C */ lw $s1, 0x1c($sp)
-/* 09F574 802DFD74 8FB00018 */ lw $s0, 0x18($sp)
-/* 09F578 802DFD78 03E00008 */ jr $ra
-/* 09F57C 802DFD7C 27BD0060 */ addiu $sp, $sp, 0x60
diff --git a/asm/non_matchings/eu/audio/synthesis_resample_and_mix_reverb.s b/asm/non_matchings/eu/audio/synthesis_resample_and_mix_reverb.s
@@ -1,220 +0,0 @@
-glabel synthesis_resample_and_mix_reverb
-/* 09F580 802DFD80 27BDFFA0 */ addiu $sp, $sp, -0x60
-/* 09F584 802DFD84 AFB10020 */ sw $s1, 0x20($sp)
-/* 09F588 802DFD88 00068C00 */ sll $s1, $a2, 0x10
-/* 09F58C 802DFD8C 00117403 */ sra $t6, $s1, 0x10
-/* 09F590 802DFD90 000EC940 */ sll $t9, $t6, 5
-/* 09F594 802DFD94 032EC821 */ addu $t9, $t9, $t6
-/* 09F598 802DFD98 3C0D8022 */ lui $t5, %hi(gSynthesisReverbs) # $t5, 0x8022
-/* 09F59C 802DFD9C 25ADC1B0 */ addiu $t5, %lo(gSynthesisReverbs) # addiu $t5, $t5, -0x3e50
-/* 09F5A0 802DFDA0 0019C8C0 */ sll $t9, $t9, 3
-/* 09F5A4 802DFDA4 01C08825 */ move $s1, $t6
-/* 09F5A8 802DFDA8 032D1821 */ addu $v1, $t9, $t5
-/* 09F5AC 802DFDAC 906E0003 */ lbu $t6, 3($v1)
-/* 09F5B0 802DFDB0 AFA7006C */ sw $a3, 0x6c($sp)
-/* 09F5B4 802DFDB4 00077C00 */ sll $t7, $a3, 0x10
-/* 09F5B8 802DFDB8 000F3C03 */ sra $a3, $t7, 0x10
-/* 09F5BC 802DFDBC 000E7880 */ sll $t7, $t6, 2
-/* 09F5C0 802DFDC0 01EE7823 */ subu $t7, $t7, $t6
-/* 09F5C4 802DFDC4 000F78C0 */ sll $t7, $t7, 3
-/* 09F5C8 802DFDC8 01EE7821 */ addu $t7, $t7, $t6
-/* 09F5CC 802DFDCC AFBF0024 */ sw $ra, 0x24($sp)
-/* 09F5D0 802DFDD0 AFB0001C */ sw $s0, 0x1c($sp)
-/* 09F5D4 802DFDD4 AFA50064 */ sw $a1, 0x64($sp)
-/* 09F5D8 802DFDD8 AFA60068 */ sw $a2, 0x68($sp)
-/* 09F5DC 802DFDDC 3C0D0200 */ lui $t5, (0x02000740 >> 16) # lui $t5, 0x200
-/* 09F5E0 802DFDE0 000F7880 */ sll $t7, $t7, 2
-/* 09F5E4 802DFDE4 35AD0740 */ ori $t5, (0x02000740 & 0xFFFF) # ori $t5, $t5, 0x740
-/* 09F5E8 802DFDE8 240E0280 */ li $t6, 640
-/* 09F5EC 802DFDEC 006FC021 */ addu $t8, $v1, $t7
-/* 09F5F0 802DFDF0 0007C880 */ sll $t9, $a3, 2
-/* 09F5F4 802DFDF4 AC8E0004 */ sw $t6, 4($a0)
-/* 09F5F8 802DFDF8 AC8D0000 */ sw $t5, ($a0)
-/* 09F5FC 802DFDFC 906F0004 */ lbu $t7, 4($v1)
-/* 09F600 802DFE00 0327C821 */ addu $t9, $t9, $a3
-/* 09F604 802DFE04 0019C880 */ sll $t9, $t9, 2
-/* 09F608 802DFE08 03194021 */ addu $t0, $t8, $t9
-/* 09F60C 802DFE0C 24010001 */ li $at, 1
-/* 09F610 802DFE10 25080030 */ addiu $t0, $t0, 0x30
-/* 09F614 802DFE14 15E10033 */ bne $t7, $at, .L80200894
-/* 09F618 802DFE18 24900008 */ addiu $s0, $a0, 8
-/* 09F61C 802DFE1C 9506000E */ lhu $a2, 0xe($t0)
-/* 09F620 802DFE20 85070010 */ lh $a3, 0x10($t0)
-/* 09F624 802DFE24 AFA8005C */ sw $t0, 0x5c($sp)
-/* 09F628 802DFE28 AFA30028 */ sw $v1, 0x28($sp)
-/* 09F62C 802DFE2C AFB10010 */ sw $s1, 0x10($sp)
-/* 09F630 802DFE30 02002025 */ move $a0, $s0
-/* 09F634 802DFE34 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
-/* 09F638 802DFE38 24050740 */ li $a1, 1856
-/* 09F63C 802DFE3C 8FA8005C */ lw $t0, 0x5c($sp)
-/* 09F640 802DFE40 00408025 */ move $s0, $v0
-/* 09F644 802DFE44 8FA30028 */ lw $v1, 0x28($sp)
-/* 09F648 802DFE48 85070012 */ lh $a3, 0x12($t0)
-/* 09F64C 802DFE4C 02002025 */ move $a0, $s0
-/* 09F650 802DFE50 00003025 */ move $a2, $zero
-/* 09F654 802DFE54 50E0000A */ beql $a3, $zero, .L80200830
-/* 09F658 802DFE58 3C0A0800 */ lui $t2, 0x800
-/* 09F65C 802DFE5C 85050010 */ lh $a1, 0x10($t0)
-/* 09F660 802DFE60 AFA30028 */ sw $v1, 0x28($sp)
-/* 09F664 802DFE64 AFB10010 */ sw $s1, 0x10($sp)
-/* 09F668 802DFE68 24A50740 */ addiu $a1, $a1, 0x740
-/* 09F66C 802DFE6C 30B8FFFF */ andi $t8, $a1, 0xffff
-/* 09F670 802DFE70 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
-/* 09F674 802DFE74 03002825 */ move $a1, $t8
-/* 09F678 802DFE78 8FA30028 */ lw $v1, 0x28($sp)
-/* 09F67C 802DFE7C 3C0A0800 */ lui $t2, 0x800
-.L80200830:
-/* 09F680 802DFE80 24500008 */ addiu $s0, $v0, 8
-/* 09F684 802DFE84 24190280 */ li $t9, 640
-/* 09F688 802DFE88 AC590004 */ sw $t9, 4($v0)
-/* 09F68C 802DFE8C AC4A0000 */ sw $t2, ($v0)
-/* 09F690 802DFE90 02002825 */ move $a1, $s0
-/* 09F694 802DFE94 3C0D0C00 */ lui $t5, (0x0C007FFF >> 16) # lui $t5, 0xc00
-/* 09F698 802DFE98 3C0E0740 */ lui $t6, (0x074004C0 >> 16) # lui $t6, 0x740
-/* 09F69C 802DFE9C 35CE04C0 */ ori $t6, (0x074004C0 & 0xFFFF) # ori $t6, $t6, 0x4c0
-/* 09F6A0 802DFEA0 35AD7FFF */ ori $t5, (0x0C007FFF & 0xFFFF) # ori $t5, $t5, 0x7fff
-/* 09F6A4 802DFEA4 ACAD0000 */ sw $t5, ($a1)
-/* 09F6A8 802DFEA8 ACAE0004 */ sw $t6, 4($a1)
-/* 09F6AC 802DFEAC 946F0008 */ lhu $t7, 8($v1)
-/* 09F6B0 802DFEB0 34018000 */ li $at, 32768
-/* 09F6B4 802DFEB4 26100008 */ addiu $s0, $s0, 8
-/* 09F6B8 802DFEB8 01E1C021 */ addu $t8, $t7, $at
-/* 09F6BC 802DFEBC 3319FFFF */ andi $t9, $t8, 0xffff
-/* 09F6C0 802DFEC0 3C010C00 */ lui $at, 0xc00
-/* 09F6C4 802DFEC4 02003025 */ move $a2, $s0
-/* 09F6C8 802DFEC8 3C0E0740 */ lui $t6, (0x07400740 >> 16) # lui $t6, 0x740
-/* 09F6CC 802DFECC 35CE0740 */ ori $t6, (0x07400740 & 0xFFFF) # ori $t6, $t6, 0x740
-/* 09F6D0 802DFED0 03216825 */ or $t5, $t9, $at
-/* 09F6D4 802DFED4 ACCD0000 */ sw $t5, ($a2)
-/* 09F6D8 802DFED8 ACCE0004 */ sw $t6, 4($a2)
-/* 09F6DC 802DFEDC 10000078 */ b .L80200A70
-/* 09F6E0 802DFEE0 26100008 */ addiu $s0, $s0, 8
-.L80200894:
-/* 09F6E4 802DFEE4 8D02000C */ lw $v0, 0xc($t0)
-/* 09F6E8 802DFEE8 850D0010 */ lh $t5, 0x10($t0)
-/* 09F6EC 802DFEEC 2401FFF0 */ li $at, -16
-/* 09F6F0 802DFEF0 304F0007 */ andi $t7, $v0, 7
-/* 09F6F4 802DFEF4 000FC440 */ sll $t8, $t7, 0x11
-/* 09F6F8 802DFEF8 0018CC03 */ sra $t9, $t8, 0x10
-/* 09F6FC 802DFEFC 032D5021 */ addu $t2, $t9, $t5
-/* 09F700 802DFF00 254A000F */ addiu $t2, $t2, 0xf
-/* 09F704 802DFF04 03204825 */ move $t1, $t9
-/* 09F708 802DFF08 314EFFF0 */ andi $t6, $t2, 0xfff0
-/* 09F70C 802DFF0C 000E7C00 */ sll $t7, $t6, 0x10
-/* 09F710 802DFF10 000FC403 */ sra $t8, $t7, 0x10
-/* 09F714 802DFF14 03005025 */ move $t2, $t8
-/* 09F718 802DFF18 A7AA0058 */ sh $t2, 0x58($sp)
-/* 09F71C 802DFF1C A7A9005A */ sh $t1, 0x5a($sp)
-/* 09F720 802DFF20 AFA8005C */ sw $t0, 0x5c($sp)
-/* 09F724 802DFF24 AFA30028 */ sw $v1, 0x28($sp)
-/* 09F728 802DFF28 AFB10010 */ sw $s1, 0x10($sp)
-/* 09F72C 802DFF2C 02002025 */ move $a0, $s0
-/* 09F730 802DFF30 24050020 */ li $a1, 32
-/* 09F734 802DFF34 05210003 */ bgez $t1, .L802008F4
-/* 09F738 802DFF38 0009C843 */ sra $t9, $t1, 1
-/* 09F73C 802DFF3C 25210001 */ addiu $at, $t1, 1
-/* 09F740 802DFF40 0001C843 */ sra $t9, $at, 1
-.L802008F4:
-/* 09F744 802DFF44 00593023 */ subu $a2, $v0, $t9
-/* 09F748 802DFF48 30CDFFFF */ andi $t5, $a2, 0xffff
-/* 09F74C 802DFF4C 01A03025 */ move $a2, $t5
-/* 09F750 802DFF50 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
-/* 09F754 802DFF54 24070140 */ li $a3, 320
-/* 09F758 802DFF58 8FA8005C */ lw $t0, 0x5c($sp)
-/* 09F75C 802DFF5C 00408025 */ move $s0, $v0
-/* 09F760 802DFF60 8FA30028 */ lw $v1, 0x28($sp)
-/* 09F764 802DFF64 850E0012 */ lh $t6, 0x12($t0)
-/* 09F768 802DFF68 87A9005A */ lh $t1, 0x5a($sp)
-/* 09F76C 802DFF6C 87AA0058 */ lh $t2, 0x58($sp)
-/* 09F770 802DFF70 11C0000D */ beqz $t6, .L80200958
-/* 09F774 802DFF74 02002025 */ move $a0, $s0
-/* 09F778 802DFF78 25450020 */ addiu $a1, $t2, 0x20
-/* 09F77C 802DFF7C 30AFFFFF */ andi $t7, $a1, 0xffff
-/* 09F780 802DFF80 24180140 */ li $t8, 320
-/* 09F784 802DFF84 030A3823 */ subu $a3, $t8, $t2
-/* 09F788 802DFF88 01E02825 */ move $a1, $t7
-/* 09F78C 802DFF8C 00003025 */ move $a2, $zero
-/* 09F790 802DFF90 AFB10010 */ sw $s1, 0x10($sp)
-/* 09F794 802DFF94 AFA30028 */ sw $v1, 0x28($sp)
-/* 09F798 802DFF98 0C0B7E39 */ jal synthesis_load_reverb_ring_buffer
-/* 09F79C 802DFF9C A7A9005A */ sh $t1, 0x5a($sp)
-/* 09F7A0 802DFFA0 8FA30028 */ lw $v1, 0x28($sp)
-/* 09F7A4 802DFFA4 87A9005A */ lh $t1, 0x5a($sp)
-.L80200958:
-/* 09F7A8 802DFFA8 25390020 */ addiu $t9, $t1, 0x20
-/* 09F7AC 802DFFAC 3C0A0800 */ lui $t2, 0x800
-/* 09F7B0 802DFFB0 332DFFFF */ andi $t5, $t9, 0xffff
-/* 09F7B4 802DFFB4 01AA7025 */ or $t6, $t5, $t2
-/* 09F7B8 802DFFB8 AC4E0000 */ sw $t6, ($v0)
-/* 09F7BC 802DFFBC 8FA50064 */ lw $a1, 0x64($sp)
-/* 09F7C0 802DFFC0 3C010740 */ lui $at, 0x740
-/* 09F7C4 802DFFC4 3C0B0500 */ lui $t3, 0x500
-/* 09F7C8 802DFFC8 00057840 */ sll $t7, $a1, 1
-/* 09F7CC 802DFFCC 31E5FFFF */ andi $a1, $t7, 0xffff
-/* 09F7D0 802DFFD0 00A1C825 */ or $t9, $a1, $at
-/* 09F7D4 802DFFD4 AC590004 */ sw $t9, 4($v0)
-/* 09F7D8 802DFFD8 90790000 */ lbu $t9, ($v1)
-/* 09F7DC 802DFFDC 946E000A */ lhu $t6, 0xa($v1)
-/* 09F7E0 802DFFE0 24500008 */ addiu $s0, $v0, 8
-/* 09F7E4 802DFFE4 00196C00 */ sll $t5, $t9, 0x10
-/* 09F7E8 802DFFE8 01CB7825 */ or $t7, $t6, $t3
-/* 09F7EC 802DFFEC 01ED7025 */ or $t6, $t7, $t5
-/* 09F7F0 802DFFF0 02003025 */ move $a2, $s0
-/* 09F7F4 802DFFF4 ACCE0000 */ sw $t6, ($a2)
-/* 09F7F8 802DFFF8 8C780020 */ lw $t8, 0x20($v1)
-/* 09F7FC 802DFFFC 3C0C8000 */ lui $t4, 0x8000
-/* 09F800 802E0000 26100008 */ addiu $s0, $s0, 8
-/* 09F804 802E0004 252F0160 */ addiu $t7, $t1, 0x160
-/* 09F808 802E0008 030CC821 */ addu $t9, $t8, $t4
-/* 09F80C 802E000C ACD90004 */ sw $t9, 4($a2)
-/* 09F810 802E0010 31EDFFFF */ andi $t5, $t7, 0xffff
-/* 09F814 802E0014 02003825 */ move $a3, $s0
-/* 09F818 802E0018 3C010880 */ lui $at, 0x880
-/* 09F81C 802E001C 00A1C025 */ or $t8, $a1, $at
-/* 09F820 802E0020 01AA7025 */ or $t6, $t5, $t2
-/* 09F824 802E0024 ACEE0000 */ sw $t6, ($a3)
-/* 09F828 802E0028 ACF80004 */ sw $t8, 4($a3)
-/* 09F82C 802E002C 90780000 */ lbu $t8, ($v1)
-/* 09F830 802E0030 946F000A */ lhu $t7, 0xa($v1)
-/* 09F834 802E0034 26100008 */ addiu $s0, $s0, 8
-/* 09F838 802E0038 0018CC00 */ sll $t9, $t8, 0x10
-/* 09F83C 802E003C 01EB6825 */ or $t5, $t7, $t3
-/* 09F840 802E0040 01B97825 */ or $t7, $t5, $t9
-/* 09F844 802E0044 02004025 */ move $t0, $s0
-/* 09F848 802E0048 AD0F0000 */ sw $t7, ($t0)
-/* 09F84C 802E004C 8C6E0024 */ lw $t6, 0x24($v1)
-/* 09F850 802E0050 26100008 */ addiu $s0, $s0, 8
-/* 09F854 802E0054 02001025 */ move $v0, $s0
-/* 09F858 802E0058 01CCC021 */ addu $t8, $t6, $t4
-/* 09F85C 802E005C AD180004 */ sw $t8, 4($t0)
-/* 09F860 802E0060 26100008 */ addiu $s0, $s0, 8
-/* 09F864 802E0064 240D0280 */ li $t5, 640
-/* 09F868 802E0068 AC4D0004 */ sw $t5, 4($v0)
-/* 09F86C 802E006C AC4A0000 */ sw $t2, ($v0)
-/* 09F870 802E0070 02002025 */ move $a0, $s0
-/* 09F874 802E0074 3C0F0740 */ lui $t7, (0x074004C0 >> 16) # lui $t7, 0x740
-/* 09F878 802E0078 3C190C00 */ lui $t9, (0x0C007FFF >> 16) # lui $t9, 0xc00
-/* 09F87C 802E007C 37397FFF */ ori $t9, (0x0C007FFF & 0xFFFF) # ori $t9, $t9, 0x7fff
-/* 09F880 802E0080 35EF04C0 */ ori $t7, (0x074004C0 & 0xFFFF) # ori $t7, $t7, 0x4c0
-/* 09F884 802E0084 AC8F0004 */ sw $t7, 4($a0)
-/* 09F888 802E0088 AC990000 */ sw $t9, ($a0)
-/* 09F88C 802E008C 946E0008 */ lhu $t6, 8($v1)
-/* 09F890 802E0090 34018000 */ li $at, 32768
-/* 09F894 802E0094 26100008 */ addiu $s0, $s0, 8
-/* 09F898 802E0098 01C1C021 */ addu $t8, $t6, $at
-/* 09F89C 802E009C 02002825 */ move $a1, $s0
-/* 09F8A0 802E00A0 330DFFFF */ andi $t5, $t8, 0xffff
-/* 09F8A4 802E00A4 3C010C00 */ lui $at, 0xc00
-/* 09F8A8 802E00A8 3C0F0740 */ lui $t7, (0x07400740 >> 16) # lui $t7, 0x740
-/* 09F8AC 802E00AC 35EF0740 */ ori $t7, (0x07400740 & 0xFFFF) # ori $t7, $t7, 0x740
-/* 09F8B0 802E00B0 01A1C825 */ or $t9, $t5, $at
-/* 09F8B4 802E00B4 ACB90000 */ sw $t9, ($a1)
-/* 09F8B8 802E00B8 ACAF0004 */ sw $t7, 4($a1)
-/* 09F8BC 802E00BC 26100008 */ addiu $s0, $s0, 8
-.L80200A70:
-/* 09F8C0 802E00C0 8FBF0024 */ lw $ra, 0x24($sp)
-/* 09F8C4 802E00C4 02001025 */ move $v0, $s0
-/* 09F8C8 802E00C8 8FB0001C */ lw $s0, 0x1c($sp)
-/* 09F8CC 802E00CC 8FB10020 */ lw $s1, 0x20($sp)
-/* 09F8D0 802E00D0 03E00008 */ jr $ra
-/* 09F8D4 802E00D4 27BD0060 */ addiu $sp, $sp, 0x60
diff --git a/asm/non_matchings/eu/handle_dialog_text_and_pages.s b/asm/non_matchings/eu/handle_dialog_text_and_pages.s
@@ -1,370 +0,0 @@
-.late_rodata
-.late_rodata_alignment 8
-glabel jtbl_803059A0
-.word L_EU_802AFB00, L_EU_802AFB18, L_EU_802AFB50, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFB88, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFB9C, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AF99C, L_EU_802AF990
-
-glabel jtbl_80305A60
-.word L_EU_802AF9CC, L_EU_802AF9CC, L_EU_802AF9CC, L_EU_802AFBD0
-.word L_EU_802AF9EC, L_EU_802AF9EC, L_EU_802AF9EC, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFA0C, L_EU_802AFA0C, L_EU_802AFA0C, L_EU_802AFA0C
-.word L_EU_802AFA2C, L_EU_802AFA2C, L_EU_802AFA2C, L_EU_802AFA2C
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFA4C, L_EU_802AFA4C, L_EU_802AFA4C, L_EU_802AFBD0
-.word L_EU_802AFA6C, L_EU_802AFA6C, L_EU_802AFA6C, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFA8C, L_EU_802AFA8C, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFAAC, L_EU_802AFAAC, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFBD0, L_EU_802AFAEC, L_EU_802AFBD0
-.word L_EU_802AFBD0, L_EU_802AFACC, L_EU_802AFACC
-
-.text
-glabel handle_dialog_text_and_pages # EU: func_802AF808
-/* 06F008 802AF808 27BDFF90 */ addiu $sp, $sp, -0x70
-/* 06F00C 802AF80C AFB50034 */ sw $s5, 0x34($sp)
-/* 06F010 802AF810 0006AE00 */ sll $s5, $a2, 0x18
-/* 06F014 802AF814 00157603 */ sra $t6, $s5, 0x18
-/* 06F018 802AF818 AFBF0044 */ sw $ra, 0x44($sp)
-/* 06F01C 802AF81C AFBE0040 */ sw $fp, 0x40($sp)
-/* 06F020 802AF820 AFB7003C */ sw $s7, 0x3c($sp)
-/* 06F024 802AF824 AFB60038 */ sw $s6, 0x38($sp)
-/* 06F028 802AF828 AFB40030 */ sw $s4, 0x30($sp)
-/* 06F02C 802AF82C AFB3002C */ sw $s3, 0x2c($sp)
-/* 06F030 802AF830 AFB20028 */ sw $s2, 0x28($sp)
-/* 06F034 802AF834 AFB10024 */ sw $s1, 0x24($sp)
-/* 06F038 802AF838 AFB00020 */ sw $s0, 0x20($sp)
-/* 06F03C 802AF83C AFA40070 */ sw $a0, 0x70($sp)
-/* 06F040 802AF840 AFA60078 */ sw $a2, 0x78($sp)
-/* 06F044 802AF844 00A08825 */ move $s1, $a1
-/* 06F048 802AF848 01C0A825 */ move $s5, $t6
-/* 06F04C 802AF84C 0C09A4BC */ jal segmented_to_virtual
-/* 06F050 802AF850 8CA4000C */ lw $a0, 0xc($a1)
-/* 06F054 802AF854 3C088030 */ lui $t0, %hi(gDialogBoxState) # $t0, 0x8030
-/* 06F058 802AF858 2508D630 */ addiu $t0, %lo(gDialogBoxState) # addiu $t0, $t0, -0x29d0
-/* 06F05C 802AF85C 81180000 */ lb $t8, ($t0)
-/* 06F060 802AF860 240F0001 */ li $t7, 1
-/* 06F064 802AF864 24070002 */ li $a3, 2
-/* 06F068 802AF868 AFA20060 */ sw $v0, 0x60($sp)
-/* 06F06C 802AF86C A3A0005D */ sb $zero, 0x5d($sp)
-/* 06F070 802AF870 A3AF005B */ sb $t7, 0x5b($sp)
-/* 06F074 802AF874 24130001 */ li $s3, 1
-/* 06F078 802AF878 14F80005 */ bne $a3, $t8, .L802AF890
-/* 06F07C 802AF87C 82360004 */ lb $s6, 4($s1)
-/* 06F080 802AF880 0016C840 */ sll $t9, $s6, 1
-/* 06F084 802AF884 27290001 */ addiu $t1, $t9, 1
-/* 06F088 802AF888 10000003 */ b .L802AF898
-/* 06F08C 802AF88C A3A9005E */ sb $t1, 0x5e($sp)
-.L802AF890:
-/* 06F090 802AF890 26CA0001 */ addiu $t2, $s6, 1
-/* 06F094 802AF894 A3AA005E */ sb $t2, 0x5e($sp)
-.L802AF898:
-/* 06F098 802AF898 3C068031 */ lui $a2, %hi(gDisplayListHead) # $a2, 0x8031
-/* 06F09C 802AF89C 24C692A8 */ addiu $a2, %lo(gDisplayListHead) # addiu $a2, $a2, -0x6d58
-/* 06F0A0 802AF8A0 8CC30000 */ lw $v1, ($a2)
-/* 06F0A4 802AF8A4 3C0D0200 */ lui $t5, %hi(dl_ia_text_begin) # $t5, 0x200
-/* 06F0A8 802AF8A8 25AD73B0 */ addiu $t5, %lo(dl_ia_text_begin) # addiu $t5, $t5, 0x73b0
-/* 06F0AC 802AF8AC 246B0008 */ addiu $t3, $v1, 8
-/* 06F0B0 802AF8B0 ACCB0000 */ sw $t3, ($a2)
-/* 06F0B4 802AF8B4 3C0C0600 */ lui $t4, 0x600
-/* 06F0B8 802AF8B8 3C128033 */ lui $s2, %hi(gDialogX) # $s2, 0x8033
-/* 06F0BC 802AF8BC 3C178030 */ lui $s7, %hi(gDialogTextPos) # $s7, 0x8030
-/* 06F0C0 802AF8C0 AC6C0000 */ sw $t4, ($v1)
-/* 06F0C4 802AF8C4 AC6D0004 */ sw $t5, 4($v1)
-/* 06F0C8 802AF8C8 2652F69A */ addiu $s2, %lo(gDialogX) # addiu $s2, $s2, -0x966
-/* 06F0CC 802AF8CC 86F7D64C */ lh $s7, %lo(gDialogTextPos)($s7)
-/* 06F0D0 802AF8D0 A6400000 */ sh $zero, ($s2)
-/* 06F0D4 802AF8D4 240E000E */ li $t6, 14
-/* 06F0D8 802AF8D8 3C018033 */ lui $at, %hi(gDialogY) # $at, 0x8033
-/* 06F0DC 802AF8DC A42EF69C */ sh $t6, %lo(gDialogY)($at)
-/* 06F0E0 802AF8E0 810F0000 */ lb $t7, ($t0)
-/* 06F0E4 802AF8E4 3C1E8033 */ lui $fp, %hi(gDialogY) # $fp, 0x8033
-/* 06F0E8 802AF8E8 27DEF69C */ addiu $fp, %lo(gDialogY) # addiu $fp, $fp, -0x964
-/* 06F0EC 802AF8EC 14EF0005 */ bne $a3, $t7, .L802AF904
-/* 06F0F0 802AF8F0 3C198030 */ lui $t9, %hi(gDialogScrollOffsetY) # $t9, 0x8030
-/* 06F0F4 802AF8F4 87D80000 */ lh $t8, ($fp)
-/* 06F0F8 802AF8F8 8739D63C */ lh $t9, %lo(gDialogScrollOffsetY)($t9)
-/* 06F0FC 802AF8FC 03194823 */ subu $t1, $t8, $t9
-/* 06F100 802AF900 A7C90000 */ sh $t1, ($fp)
-.L802AF904:
-/* 06F104 802AF904 83AA005D */ lb $t2, 0x5d($sp)
-/* 06F108 802AF908 3C1E8033 */ lui $fp, %hi(gDialogY) # $fp, 0x8033
-/* 06F10C 802AF90C 27DEF69C */ addiu $fp, %lo(gDialogY) # addiu $fp, $fp, -0x964
-/* 06F110 802AF910 154000C8 */ bnez $t2, .L802AFC34
-/* 06F114 802AF914 3C148030 */ lui $s4, %hi(gDialogCharWidths) # $s4, 0x8030
-/* 06F118 802AF918 2694D530 */ addiu $s4, %lo(gDialogCharWidths) # addiu $s4, $s4, -0x2ad0
-.L802AF91C:
-/* 06F11C 802AF91C 00132E00 */ sll $a1, $s3, 0x18
-/* 06F120 802AF920 00055E03 */ sra $t3, $a1, 0x18
-/* 06F124 802AF924 01602825 */ move $a1, $t3
-/* 06F128 802AF928 0C0ABBFE */ jal change_and_flash_dialog_text_color_lines # func_802AEFF8
-/* 06F12C 802AF92C 83A40073 */ lb $a0, 0x73($sp)
-/* 06F130 802AF930 8FAC0060 */ lw $t4, 0x60($sp)
-/* 06F134 802AF934 02EC6821 */ addu $t5, $s7, $t4
-/* 06F138 802AF938 91B00000 */ lbu $s0, ($t5)
-/* 06F13C 802AF93C 2A0100A3 */ slti $at, $s0, 0xa3
-/* 06F140 802AF940 1420000A */ bnez $at, .L802AF96C
-/* 06F144 802AF944 02001025 */ move $v0, $s0
-/* 06F148 802AF948 244EFF30 */ addiu $t6, $v0, -0xd0
-/* 06F14C 802AF94C 2DC10030 */ sltiu $at, $t6, 0x30
-/* 06F150 802AF950 1020009F */ beqz $at, .L802AFBD0
-/* 06F154 802AF954 000E7080 */ sll $t6, $t6, 2
-/* 06F158 802AF958 3C018030 */ lui $at, %hi(jtbl_803059A0) # 0x8030
-/* 06F15C 802AF95C 002E0821 */ addu $at, $at, $t6
-/* 06F160 802AF960 8C2E59A0 */ lw $t6, %lo(jtbl_803059A0)($at) # 0x59a0($at)
-/* 06F164 802AF964 01C00008 */ jr $t6
-/* 06F168 802AF968 00000000 */ nop
-.L802AF96C:
-/* 06F16C 802AF96C 244FFFA0 */ addiu $t7, $v0, -0x60
-/* 06F170 802AF970 2DE10043 */ sltiu $at, $t7, 0x43
-/* 06F174 802AF974 10200096 */ beqz $at, .L802AFBD0
-/* 06F178 802AF978 000F7880 */ sll $t7, $t7, 2
-/* 06F17C 802AF97C 3C018030 */ lui $at, %hi(jtbl_80305A60) # 0x8030
-/* 06F180 802AF980 002F0821 */ addu $at, $at, $t7
-/* 06F184 802AF984 8C2F5A60 */ lw $t7, %lo(jtbl_80305A60)($at) # 0x5a60($at)
-/* 06F188 802AF988 01E00008 */ jr $t7
-/* 06F18C 802AF98C 00000000 */ nop
-glabel L_EU_802AF990
-/* 06F190 802AF990 24180002 */ li $t8, 2
-/* 06F194 802AF994 1000009D */ b .L802AFC0C
-/* 06F198 802AF998 A3B8005D */ sb $t8, 0x5d($sp)
-glabel L_EU_802AF99C
-/* 06F19C 802AF99C 26730001 */ addiu $s3, $s3, 1
-/* 06F1A0 802AF9A0 0013CE00 */ sll $t9, $s3, 0x18
-/* 06F1A4 802AF9A4 00199E03 */ sra $s3, $t9, 0x18
-/* 06F1A8 802AF9A8 00132600 */ sll $a0, $s3, 0x18
-/* 06F1AC 802AF9AC 00045603 */ sra $t2, $a0, 0x18
-/* 06F1B0 802AF9B0 01402025 */ move $a0, $t2
-/* 06F1B4 802AF9B4 83A5005E */ lb $a1, 0x5e($sp)
-/* 06F1B8 802AF9B8 27A6005D */ addiu $a2, $sp, 0x5d
-/* 06F1BC 802AF9BC 0C0ABD0B */ jal handle_dialog_scroll_page_state # func_802AF42C
-/* 06F1C0 802AF9C0 27A7005B */ addiu $a3, $sp, 0x5b
-/* 06F1C4 802AF9C4 10000091 */ b .L802AFC0C
-/* 06F1C8 802AF9C8 A6400000 */ sh $zero, ($s2)
-glabel L_EU_802AF9CC
-/* 06F1CC 802AF9CC 00403025 */ move $a2, $v0
-/* 06F1D0 802AF9D0 30CB000F */ andi $t3, $a2, 0xf
-/* 06F1D4 802AF9D4 01603025 */ move $a2, $t3
-/* 06F1D8 802AF9D8 02202025 */ move $a0, $s1
-/* 06F1DC 802AF9DC 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
-/* 06F1E0 802AF9E0 24050024 */ li $a1, 36
-/* 06F1E4 802AF9E4 1000008A */ b .L802AFC10
-/* 06F1E8 802AF9E8 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AF9EC
-/* 06F1EC 802AF9EC 00403025 */ move $a2, $v0
-/* 06F1F0 802AF9F0 30CC000F */ andi $t4, $a2, 0xf
-/* 06F1F4 802AF9F4 01803025 */ move $a2, $t4
-/* 06F1F8 802AF9F8 02202025 */ move $a0, $s1
-/* 06F1FC 802AF9FC 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
-/* 06F200 802AFA00 2405000A */ li $a1, 10
-/* 06F204 802AFA04 10000082 */ b .L802AFC10
-/* 06F208 802AFA08 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFA0C
-/* 06F20C 802AFA0C 00403025 */ move $a2, $v0
-/* 06F210 802AFA10 30CD000F */ andi $t5, $a2, 0xf
-/* 06F214 802AFA14 01A03025 */ move $a2, $t5
-/* 06F218 802AFA18 02202025 */ move $a0, $s1
-/* 06F21C 802AFA1C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
-/* 06F220 802AFA20 24050028 */ li $a1, 40
-/* 06F224 802AFA24 1000007A */ b .L802AFC10
-/* 06F228 802AFA28 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFA2C
-/* 06F22C 802AFA2C 00403025 */ move $a2, $v0
-/* 06F230 802AFA30 30CE000F */ andi $t6, $a2, 0xf
-/* 06F234 802AFA34 01C03025 */ move $a2, $t6
-/* 06F238 802AFA38 02202025 */ move $a0, $s1
-/* 06F23C 802AFA3C 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
-/* 06F240 802AFA40 2405000E */ li $a1, 14
-/* 06F244 802AFA44 10000072 */ b .L802AFC10
-/* 06F248 802AFA48 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFA4C
-/* 06F24C 802AFA4C 00403025 */ move $a2, $v0
-/* 06F250 802AFA50 30CF000F */ andi $t7, $a2, 0xf
-/* 06F254 802AFA54 01E03025 */ move $a2, $t7
-/* 06F258 802AFA58 02202025 */ move $a0, $s1
-/* 06F25C 802AFA5C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
-/* 06F260 802AFA60 24050038 */ li $a1, 56
-/* 06F264 802AFA64 1000006A */ b .L802AFC10
-/* 06F268 802AFA68 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFA6C
-/* 06F26C 802AFA6C 00403025 */ move $a2, $v0
-/* 06F270 802AFA70 30D8000F */ andi $t8, $a2, 0xf
-/* 06F274 802AFA74 03003025 */ move $a2, $t8
-/* 06F278 802AFA78 02202025 */ move $a0, $s1
-/* 06F27C 802AFA7C 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
-/* 06F280 802AFA80 2405001E */ li $a1, 30
-/* 06F284 802AFA84 10000062 */ b .L802AFC10
-/* 06F288 802AFA88 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFA8C
-/* 06F28C 802AFA8C 00403025 */ move $a2, $v0
-/* 06F290 802AFA90 30D9000F */ andi $t9, $a2, 0xf
-/* 06F294 802AFA94 03203025 */ move $a2, $t9
-/* 06F298 802AFA98 02202025 */ move $a0, $s1
-/* 06F29C 802AFA9C 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
-/* 06F2A0 802AFAA0 24050032 */ li $a1, 50
-/* 06F2A4 802AFAA4 1000005A */ b .L802AFC10
-/* 06F2A8 802AFAA8 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFAAC
-/* 06F2AC 802AFAAC 00403025 */ move $a2, $v0
-/* 06F2B0 802AFAB0 30C9000F */ andi $t1, $a2, 0xf
-/* 06F2B4 802AFAB4 01203025 */ move $a2, $t1
-/* 06F2B8 802AFAB8 02202025 */ move $a0, $s1
-/* 06F2BC 802AFABC 0C0ABDD6 */ jal render_dialog_uppercase_diacritic
-/* 06F2C0 802AFAC0 24050018 */ li $a1, 24
-/* 06F2C4 802AFAC4 10000052 */ b .L802AFC10
-/* 06F2C8 802AFAC8 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFACC
-/* 06F2CC 802AFACC 00403025 */ move $a2, $v0
-/* 06F2D0 802AFAD0 30CA000F */ andi $t2, $a2, 0xf
-/* 06F2D4 802AFAD4 01403025 */ move $a2, $t2
-/* 06F2D8 802AFAD8 02202025 */ move $a0, $s1
-/* 06F2DC 802AFADC 0C0ABDB5 */ jal render_dialog_lowercase_diacritic
-/* 06F2E0 802AFAE0 240500EB */ li $a1, 235
-/* 06F2E4 802AFAE4 1000004A */ b .L802AFC10
-/* 06F2E8 802AFAE8 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFAEC
-/* 06F2EC 802AFAEC 864B0000 */ lh $t3, ($s2)
-/* 06F2F0 802AFAF0 928C009E */ lbu $t4, 0x9e($s4)
-/* 06F2F4 802AFAF4 016C6821 */ addu $t5, $t3, $t4
-/* 06F2F8 802AFAF8 10000044 */ b .L802AFC0C
-/* 06F2FC 802AFAFC A64D0000 */ sh $t5, ($s2)
-glabel L_EU_802AFB00
-/* 06F300 802AFB00 928F009E */ lbu $t7, 0x9e($s4)
-/* 06F304 802AFB04 864E0000 */ lh $t6, ($s2)
-/* 06F308 802AFB08 000FC040 */ sll $t8, $t7, 1
-/* 06F30C 802AFB0C 01D8C821 */ addu $t9, $t6, $t8
-/* 06F310 802AFB10 1000003E */ b .L802AFC0C
-/* 06F314 802AFB14 A6590000 */ sh $t9, ($s2)
-glabel L_EU_802AFB18
-/* 06F318 802AFB18 00132E00 */ sll $a1, $s3, 0x18
-/* 06F31C 802AFB1C 00163600 */ sll $a2, $s6, 0x18
-/* 06F320 802AFB20 00065603 */ sra $t2, $a2, 0x18
-/* 06F324 802AFB24 00054E03 */ sra $t1, $a1, 0x18
-/* 06F328 802AFB28 01202825 */ move $a1, $t1
-/* 06F32C 802AFB2C 01403025 */ move $a2, $t2
-/* 06F330 802AFB30 00002025 */ move $a0, $zero
-/* 06F334 802AFB34 83A7005B */ lb $a3, 0x5b($sp)
-/* 06F338 802AFB38 AFB50010 */ sw $s5, 0x10($sp)
-/* 06F33C 802AFB3C 0C0ABD64 */ jal render_multi_text_string_lines
-/* 06F340 802AFB40 AFB10014 */ sw $s1, 0x14($sp)
-/* 06F344 802AFB44 240B0001 */ li $t3, 1
-/* 06F348 802AFB48 10000030 */ b .L802AFC0C
-/* 06F34C 802AFB4C A3AB005B */ sb $t3, 0x5b($sp)
-glabel L_EU_802AFB50
-/* 06F350 802AFB50 00132E00 */ sll $a1, $s3, 0x18
-/* 06F354 802AFB54 00163600 */ sll $a2, $s6, 0x18
-/* 06F358 802AFB58 00066E03 */ sra $t5, $a2, 0x18
-/* 06F35C 802AFB5C 00056603 */ sra $t4, $a1, 0x18
-/* 06F360 802AFB60 01802825 */ move $a1, $t4
-/* 06F364 802AFB64 01A03025 */ move $a2, $t5
-/* 06F368 802AFB68 24040001 */ li $a0, 1
-/* 06F36C 802AFB6C 83A7005B */ lb $a3, 0x5b($sp)
-/* 06F370 802AFB70 AFB50010 */ sw $s5, 0x10($sp)
-/* 06F374 802AFB74 0C0ABD64 */ jal render_multi_text_string_lines
-/* 06F378 802AFB78 AFB10014 */ sw $s1, 0x14($sp)
-/* 06F37C 802AFB7C 240F0001 */ li $t7, 1
-/* 06F380 802AFB80 10000022 */ b .L802AFC0C
-/* 06F384 802AFB84 A3AF005B */ sb $t7, 0x5b($sp)
-glabel L_EU_802AFB88
-/* 06F388 802AFB88 02202025 */ move $a0, $s1
-/* 06F38C 802AFB8C 0C0ABD1E */ jal render_star_count_dialog_text
-/* 06F390 802AFB90 27A5005B */ addiu $a1, $sp, 0x5b
-/* 06F394 802AFB94 1000001E */ b .L802AFC10
-/* 06F398 802AFB98 83A9005D */ lb $t1, 0x5d($sp)
-glabel L_EU_802AFB9C
-/* 06F39C 802AFB9C 87C60000 */ lh $a2, ($fp)
-/* 06F3A0 802AFBA0 02202025 */ move $a0, $s1
-/* 06F3A4 802AFBA4 86450000 */ lh $a1, ($s2)
-/* 06F3A8 802AFBA8 24C60008 */ addiu $a2, $a2, 8
-/* 06F3AC 802AFBAC 00067400 */ sll $t6, $a2, 0x10
-/* 06F3B0 802AFBB0 000E3403 */ sra $a2, $t6, 0x10
-/* 06F3B4 802AFBB4 0C0ABC6E */ jal render_generic_dialog_char_at_pos
-/* 06F3B8 802AFBB8 240700F6 */ li $a3, 246
-/* 06F3BC 802AFBBC 86590000 */ lh $t9, ($s2)
-/* 06F3C0 802AFBC0 928900F6 */ lbu $t1, 0xf6($s4)
-/* 06F3C4 802AFBC4 03295021 */ addu $t2, $t9, $t1
-/* 06F3C8 802AFBC8 10000010 */ b .L802AFC0C
-/* 06F3CC 802AFBCC A64A0000 */ sh $t2, ($s2)
-glabel L_EU_802AFBD0
-.L802AFBD0:
-/* 06F3D0 802AFBD0 0275082A */ slt $at, $s3, $s5
-/* 06F3D4 802AFBD4 14200008 */ bnez $at, .L802AFBF8
-/* 06F3D8 802AFBD8 02B65821 */ addu $t3, $s5, $s6
-/* 06F3DC 802AFBDC 0173082A */ slt $at, $t3, $s3
-/* 06F3E0 802AFBE0 14200005 */ bnez $at, .L802AFBF8
-/* 06F3E4 802AFBE4 02202025 */ move $a0, $s1
-/* 06F3E8 802AFBE8 86450000 */ lh $a1, ($s2)
-/* 06F3EC 802AFBEC 87C60000 */ lh $a2, ($fp)
-/* 06F3F0 802AFBF0 0C0ABC6E */ jal render_generic_dialog_char_at_pos
-/* 06F3F4 802AFBF4 320700FF */ andi $a3, $s0, 0xff
-.L802AFBF8:
-/* 06F3F8 802AFBF8 02906821 */ addu $t5, $s4, $s0
-/* 06F3FC 802AFBFC 91AF0000 */ lbu $t7, ($t5)
-/* 06F400 802AFC00 864C0000 */ lh $t4, ($s2)
-/* 06F404 802AFC04 018F7021 */ addu $t6, $t4, $t7
-/* 06F408 802AFC08 A64E0000 */ sh $t6, ($s2)
-.L802AFC0C:
-/* 06F40C 802AFC0C 83A9005D */ lb $t1, 0x5d($sp)
-.L802AFC10:
-/* 06F410 802AFC10 26F70001 */ addiu $s7, $s7, 1
-/* 06F414 802AFC14 0017C400 */ sll $t8, $s7, 0x10
-/* 06F418 802AFC18 1120FF40 */ beqz $t1, .L802AF91C
-/* 06F41C 802AFC1C 0018BC03 */ sra $s7, $t8, 0x10
-/* 06F420 802AFC20 3C088030 */ lui $t0, %hi(gDialogBoxState) # $t0, 0x8030
-/* 06F424 802AFC24 3C068031 */ lui $a2, %hi(gDisplayListHead) # $a2, 0x8031
-/* 06F428 802AFC28 24C692A8 */ addiu $a2, %lo(gDisplayListHead) # addiu $a2, $a2, -0x6d58
-/* 06F42C 802AFC2C 2508D630 */ addiu $t0, %lo(gDialogBoxState) # addiu $t0, $t0, -0x29d0
-/* 06F430 802AFC30 24070002 */ li $a3, 2
-.L802AFC34:
-/* 06F434 802AFC34 8CC30000 */ lw $v1, ($a2)
-/* 06F438 802AFC38 3C0D0200 */ lui $t5, %hi(dl_ia_text_end) # $t5, 0x200
-/* 06F43C 802AFC3C 25AD7418 */ addiu $t5, %lo(dl_ia_text_end) # addiu $t5, $t5, 0x7418
-/* 06F440 802AFC40 246A0008 */ addiu $t2, $v1, 8
-/* 06F444 802AFC44 ACCA0000 */ sw $t2, ($a2)
-/* 06F448 802AFC48 3C0B0600 */ lui $t3, 0x600
-/* 06F44C 802AFC4C AC6B0000 */ sw $t3, ($v1)
-/* 06F450 802AFC50 AC6D0004 */ sw $t5, 4($v1)
-/* 06F454 802AFC54 810C0000 */ lb $t4, ($t0)
-/* 06F458 802AFC58 24010001 */ li $at, 1
-/* 06F45C 802AFC5C 83AF005D */ lb $t7, 0x5d($sp)
-/* 06F460 802AFC60 55810009 */ bnel $t4, $at, .L802AFC88
-/* 06F464 802AFC64 8FBF0044 */ lw $ra, 0x44($sp)
-/* 06F468 802AFC68 15E70005 */ bne $t7, $a3, .L802AFC80
-/* 06F46C 802AFC6C 3C018030 */ lui $at, %hi(gLastDialogPageStrPos)
-/* 06F470 802AFC70 240EFFFF */ li $t6, -1
-/* 06F474 802AFC74 3C018030 */ lui $at, %hi(gLastDialogPageStrPos) # $at, 0x8030
-/* 06F478 802AFC78 10000002 */ b .L802AFC84
-/* 06F47C 802AFC7C A42ED648 */ sh $t6, %lo(gLastDialogPageStrPos)($at)
-.L802AFC80:
-/* 06F480 802AFC80 A437D648 */ sh $s7, %lo(gLastDialogPageStrPos)($at)
-.L802AFC84:
-/* 06F484 802AFC84 8FBF0044 */ lw $ra, 0x44($sp)
-.L802AFC88:
-/* 06F488 802AFC88 3C018033 */ lui $at, %hi(gLastDialogLineNum) # $at, 0x8033
-/* 06F48C 802AFC8C A033F692 */ sb $s3, %lo(gLastDialogLineNum)($at)
-/* 06F490 802AFC90 8FB3002C */ lw $s3, 0x2c($sp)
-/* 06F494 802AFC94 8FB00020 */ lw $s0, 0x20($sp)
-/* 06F498 802AFC98 8FB10024 */ lw $s1, 0x24($sp)
-/* 06F49C 802AFC9C 8FB20028 */ lw $s2, 0x28($sp)
-/* 06F4A0 802AFCA0 8FB40030 */ lw $s4, 0x30($sp)
-/* 06F4A4 802AFCA4 8FB50034 */ lw $s5, 0x34($sp)
-/* 06F4A8 802AFCA8 8FB60038 */ lw $s6, 0x38($sp)
-/* 06F4AC 802AFCAC 8FB7003C */ lw $s7, 0x3c($sp)
-/* 06F4B0 802AFCB0 8FBE0040 */ lw $fp, 0x40($sp)
-/* 06F4B4 802AFCB4 03E00008 */ jr $ra
-/* 06F4B8 802AFCB8 27BD0070 */ addiu $sp, $sp, 0x70
-
diff --git a/asm/non_matchings/eu/libultra_unk_802aeeb0.s b/asm/non_matchings/eu/libultra_unk_802aeeb0.s
@@ -1,55 +0,0 @@
-
-glabel func_802aeeb0
-/* 0AEEB0 80200000 27BDFFE0 */ addiu $sp, $sp, -0x20
-/* 0AEEB4 80200004 AFBF0014 */ sw $ra, 0x14($sp)
-/* 0AEEB8 80200008 0C0BD400 */ jal __osDisableInt
-/* 0AEEBC 8020000C AFA40020 */ sw $a0, 0x20($sp)
-/* 0AEEC0 80200010 3C0F8030 */ lui $t7, %hi(D_80334914) # $t7, 0x8030
-/* 0AEEC4 80200014 8DEF2EE4 */ lw $t7, %lo(D_80334914)($t7)
-/* 0AEEC8 80200018 8FAE0020 */ lw $t6, 0x20($sp)
-/* 0AEECC 8020001C AFA2001C */ sw $v0, 0x1c($sp)
-/* 0AEED0 80200020 3C188030 */ lui $t8, %hi(D_80334914) # $t8, 0x8030
-/* 0AEED4 80200024 ADEE0004 */ sw $t6, 4($t7)
-/* 0AEED8 80200028 8F182EE4 */ lw $t8, %lo(D_80334914)($t8)
-/* 0AEEDC 8020002C 97190000 */ lhu $t9, ($t8)
-/* 0AEEE0 80200030 37280010 */ ori $t0, $t9, 0x10
-/* 0AEEE4 80200034 A7080000 */ sh $t0, ($t8)
-/* 0AEEE8 80200038 0C0BD408 */ jal __osRestoreInt
-/* 0AEEEC 8020003C 8FA4001C */ lw $a0, 0x1c($sp)
-/* 0AEEF0 80200040 8FBF0014 */ lw $ra, 0x14($sp)
-/* 0AEEF4 80200044 27BD0020 */ addiu $sp, $sp, 0x20
-/* 0AEEF8 80200048 03E00008 */ jr $ra
-/* 0AEEFC 8020004C 00000000 */ nop
-
-glabel func_802aef00
-/* 0AEF00 80200050 3C028030 */ lui $v0, %hi(D_8033489C)
-/* 0AEF04 80200054 03E00008 */ jr $ra
-/* 0AEF08 80200058 8C422EFC */ lw $v0, %lo(D_8033489C)($v0)
-
-glabel func_802aef0c
-/* 0AEF0C 8020005C 00000000 */ nop
-/* 0AEF10 80200060 27BDFFD8 */ addiu $sp, $sp, -0x28
-/* 0AEF14 80200064 AFBF001C */ sw $ra, 0x1c($sp)
-/* 0AEF18 80200068 AFA40028 */ sw $a0, 0x28($sp)
-/* 0AEF1C 8020006C AFA5002C */ sw $a1, 0x2c($sp)
-/* 0AEF20 80200070 AFA60030 */ sw $a2, 0x30($sp)
-/* 0AEF24 80200074 0C0BD400 */ jal __osDisableInt
-/* 0AEF28 80200078 AFB00018 */ sw $s0, 0x18($sp)
-/* 0AEF2C 8020007C 8FAE0028 */ lw $t6, 0x28($sp)
-/* 0AEF30 80200080 3C188033 */ lui $t8, %hi(D_80363830) # $t8, 0x8033
-/* 0AEF34 80200084 8FA8002C */ lw $t0, 0x2c($sp)
-/* 0AEF38 80200088 271836D0 */ addiu $t8, %lo(D_80363830) # addiu $t8, $t8, 0x36d0
-/* 0AEF3C 8020008C 000E78C0 */ sll $t7, $t6, 3
-/* 0AEF40 80200090 01F8C821 */ addu $t9, $t7, $t8
-/* 0AEF44 80200094 AFB90020 */ sw $t9, 0x20($sp)
-/* 0AEF48 80200098 AF280000 */ sw $t0, ($t9)
-/* 0AEF4C 8020009C 8FAA0020 */ lw $t2, 0x20($sp)
-/* 0AEF50 802000A0 8FA90030 */ lw $t1, 0x30($sp)
-/* 0AEF54 802000A4 00408025 */ move $s0, $v0
-/* 0AEF58 802000A8 02002025 */ move $a0, $s0
-/* 0AEF5C 802000AC 0C0BD408 */ jal __osRestoreInt
-/* 0AEF60 802000B0 AD490004 */ sw $t1, 4($t2)
-/* 0AEF64 802000B4 8FBF001C */ lw $ra, 0x1c($sp)
-/* 0AEF68 802000B8 8FB00018 */ lw $s0, 0x18($sp)
-/* 0AEF6C 802000BC 27BD0028 */ addiu $sp, $sp, 0x28
-/* 0AEF70 802000C0 03E00008 */ jr $ra
diff --git a/asm/non_matchings/eu/libultra_unk_802aef80.s b/asm/non_matchings/eu/libultra_unk_802aef80.s
@@ -1,87 +0,0 @@
-glabel func_802aef80
-/* 0AEF80 80200000 27BDFFD8 */ addiu $sp, $sp, -0x28
-/* 0AEF84 80200004 AFBF001C */ sw $ra, 0x1c($sp)
-/* 0AEF88 80200008 AFA40028 */ sw $a0, 0x28($sp)
-/* 0AEF8C 8020000C AFA5002C */ sw $a1, 0x2c($sp)
-/* 0AEF90 80200010 AFA60030 */ sw $a2, 0x30($sp)
-/* 0AEF94 80200014 AFB10018 */ sw $s1, 0x18($sp)
-/* 0AEF98 80200018 0C0BD400 */ jal __osDisableInt
-/* 0AEF9C 8020001C AFB00014 */ sw $s0, 0x14($sp)
-/* 0AEFA0 80200020 8FAE0028 */ lw $t6, 0x28($sp)
-/* 0AEFA4 80200024 00408025 */ move $s0, $v0
-/* 0AEFA8 80200028 8DCF0008 */ lw $t7, 8($t6)
-/* 0AEFAC 8020002C 15E00012 */ bnez $t7, .L80200078
-/* 0AEFB0 80200030 00000000 */ nop
-.L80200034:
-/* 0AEFB4 80200034 8FB80030 */ lw $t8, 0x30($sp)
-/* 0AEFB8 80200038 17000005 */ bnez $t8, .L80200050
-/* 0AEFBC 8020003C 00000000 */ nop
-/* 0AEFC0 80200040 0C0BD408 */ jal __osRestoreInt
-/* 0AEFC4 80200044 02002025 */ move $a0, $s0
-/* 0AEFC8 80200048 10000036 */ b .L80200124
-/* 0AEFCC 8020004C 2402FFFF */ li $v0, -1
-.L80200050:
-/* 0AEFD0 80200050 3C088030 */ lui $t0, %hi(D_803348A0) # $t0, 0x8030
-/* 0AEFD4 80200054 8D082F00 */ lw $t0, %lo(D_803348A0)($t0)
-/* 0AEFD8 80200058 24190008 */ li $t9, 8
-/* 0AEFDC 8020005C A5190010 */ sh $t9, 0x10($t0)
-/* 0AEFE0 80200060 0C0BCFC3 */ jal __osEnqueueAndYield
-/* 0AEFE4 80200064 8FA40028 */ lw $a0, 0x28($sp)
-/* 0AEFE8 80200068 8FA90028 */ lw $t1, 0x28($sp)
-/* 0AEFEC 8020006C 8D2A0008 */ lw $t2, 8($t1)
-/* 0AEFF0 80200070 1140FFF0 */ beqz $t2, .L80200034
-/* 0AEFF4 80200074 00000000 */ nop
-.L80200078:
-/* 0AEFF8 80200078 8FAB002C */ lw $t3, 0x2c($sp)
-/* 0AEFFC 8020007C 11600008 */ beqz $t3, .L802000A0
-/* 0AF000 80200080 00000000 */ nop
-/* 0AF004 80200084 8FAC0028 */ lw $t4, 0x28($sp)
-/* 0AF008 80200088 8D8E000C */ lw $t6, 0xc($t4)
-/* 0AF00C 8020008C 8D8D0014 */ lw $t5, 0x14($t4)
-/* 0AF010 80200090 000E7880 */ sll $t7, $t6, 2
-/* 0AF014 80200094 01AFC021 */ addu $t8, $t5, $t7
-/* 0AF018 80200098 8F190000 */ lw $t9, ($t8)
-/* 0AF01C 8020009C AD790000 */ sw $t9, ($t3)
-.L802000A0:
-/* 0AF020 802000A0 8FA80028 */ lw $t0, 0x28($sp)
-/* 0AF024 802000A4 8D09000C */ lw $t1, 0xc($t0)
-/* 0AF028 802000A8 8D0C0010 */ lw $t4, 0x10($t0)
-/* 0AF02C 802000AC 252A0001 */ addiu $t2, $t1, 1
-/* 0AF030 802000B0 014C001A */ div $zero, $t2, $t4
-/* 0AF034 802000B4 00007010 */ mfhi $t6
-/* 0AF038 802000B8 AD0E000C */ sw $t6, 0xc($t0)
-/* 0AF03C 802000BC 8FAD0028 */ lw $t5, 0x28($sp)
-/* 0AF040 802000C0 15800002 */ bnez $t4, .L802000CC
-/* 0AF044 802000C4 00000000 */ nop
-/* 0AF048 802000C8 0007000D */ break 7
-.L802000CC:
-/* 0AF04C 802000CC 2401FFFF */ li $at, -1
-/* 0AF050 802000D0 15810004 */ bne $t4, $at, .L802000E4
-/* 0AF054 802000D4 3C018000 */ lui $at, 0x8000
-/* 0AF058 802000D8 15410002 */ bne $t2, $at, .L802000E4
-/* 0AF05C 802000DC 00000000 */ nop
-/* 0AF060 802000E0 0006000D */ break 6
-.L802000E4:
-/* 0AF064 802000E4 8DAF0008 */ lw $t7, 8($t5)
-/* 0AF068 802000E8 25F8FFFF */ addiu $t8, $t7, -1
-/* 0AF06C 802000EC ADB80008 */ sw $t8, 8($t5)
-/* 0AF070 802000F0 8FB90028 */ lw $t9, 0x28($sp)
-/* 0AF074 802000F4 8F2B0004 */ lw $t3, 4($t9)
-/* 0AF078 802000F8 8D690000 */ lw $t1, ($t3)
-/* 0AF07C 802000FC 11200006 */ beqz $t1, .L80200118
-/* 0AF080 80200100 00000000 */ nop
-/* 0AF084 80200104 0C0BD015 */ jal __osPopThread
-/* 0AF088 80200108 27240004 */ addiu $a0, $t9, 4
-/* 0AF08C 8020010C 00408825 */ move $s1, $v0
-/* 0AF090 80200110 0C0BBEA0 */ jal osStartThread
-/* 0AF094 80200114 02202025 */ move $a0, $s1
-.L80200118:
-/* 0AF098 80200118 0C0BD408 */ jal __osRestoreInt
-/* 0AF09C 8020011C 02002025 */ move $a0, $s0
-/* 0AF0A0 80200120 00001025 */ move $v0, $zero
-.L80200124:
-/* 0AF0A4 80200124 8FBF001C */ lw $ra, 0x1c($sp)
-/* 0AF0A8 80200128 8FB00014 */ lw $s0, 0x14($sp)
-/* 0AF0AC 8020012C 8FB10018 */ lw $s1, 0x18($sp)
-/* 0AF0B0 80200130 03E00008 */ jr $ra
-/* 0AF0B4 80200134 27BD0028 */ addiu $sp, $sp, 0x28
diff --git a/asm/non_matchings/eu/play_sequence.s b/asm/non_matchings/eu/play_sequence.s
@@ -1,86 +0,0 @@
-glabel play_sequence
-/* 0AB0E8 80200000 27BDFFD0 */ addiu $sp, $sp, -0x30
-/* 0AB0EC 80200004 AFA50034 */ sw $a1, 0x34($sp)
-/* 0AB0F0 80200008 308700FF */ andi $a3, $a0, 0xff
-/* 0AB0F4 8020000C 30AE00FF */ andi $t6, $a1, 0xff
-/* 0AB0F8 80200010 01C02825 */ move $a1, $t6
-/* 0AB0FC 80200014 AFBF0014 */ sw $ra, 0x14($sp)
-/* 0AB100 80200018 AFA40030 */ sw $a0, 0x30($sp)
-/* 0AB104 8020001C AFA60038 */ sw $a2, 0x38($sp)
-/* 0AB108 80200020 14E0000C */ bnez $a3, .L480200054
-/* 0AB10C 80200024 00E04025 */ move $t0, $a3
-/* 0AB110 80200028 31CF007F */ andi $t7, $t6, 0x7f
-/* 0AB114 8020002C 3C018030 */ lui $at, %hi(sPlayer0CurSeqId) # $at, 0x8030
-/* 0AB118 80200030 A02F04CC */ sb $t7, %lo(sPlayer0CurSeqId)($at)
-/* 0AB11C 80200034 240200FF */ li $v0, 255
-/* 0AB120 80200038 3C018030 */ lui $at, %hi(sBackgroundMusicForDynamics) # $at, 0x8030
-/* 0AB124 8020003C A02202E0 */ sb $v0, %lo(sBackgroundMusicForDynamics)($at)
-/* 0AB128 80200040 3C018030 */ lui $at, %hi(sCurrentMusicDynamic) # $at, 0x8030
-/* 0AB12C 80200044 A02202DC */ sb $v0, %lo(sCurrentMusicDynamic)($at)
-/* 0AB130 80200048 3C018030 */ lui $at, %hi(sMusicDynamicDelay) # $at, 0x8030
-/* 0AB134 8020004C 24180002 */ li $t8, 2
-/* 0AB138 80200050 A03804D0 */ sb $t8, %lo(sMusicDynamicDelay)($at)
-.L480200054:
-/* 0AB13C 80200054 3C0A8033 */ lui $t2, %hi(D_80360928) # $t2, 0x8033
-/* 0AB140 80200058 254AFF40 */ addiu $t2, %lo(D_80360928) # addiu $t2, $t2, -0xc0
-/* 0AB144 8020005C 0007CA00 */ sll $t9, $a3, 8
-/* 0AB148 80200060 032A1821 */ addu $v1, $t9, $t2
-/* 0AB14C 80200064 00001025 */ move $v0, $zero
-/* 0AB150 80200068 00A03025 */ move $a2, $a1
-/* 0AB154 8020006C 30A9007F */ andi $t1, $a1, 0x7f
-.L480200070:
-/* 0AB158 80200070 00025900 */ sll $t3, $v0, 4
-/* 0AB15C 80200074 24420001 */ addiu $v0, $v0, 1
-/* 0AB160 80200078 304D00FF */ andi $t5, $v0, 0xff
-/* 0AB164 8020007C 29A10010 */ slti $at, $t5, 0x10
-/* 0AB168 80200080 006B6021 */ addu $t4, $v1, $t3
-/* 0AB16C 80200084 01A01025 */ move $v0, $t5
-/* 0AB170 80200088 1420FFF9 */ bnez $at, .L480200070
-/* 0AB174 8020008C A580000C */ sh $zero, 0xc($t4)
-/* 0AB178 80200090 30E200FF */ andi $v0, $a3, 0xff
-/* 0AB17C 80200094 00027400 */ sll $t6, $v0, 0x10
-/* 0AB180 80200098 30C50080 */ andi $a1, $a2, 0x80
-/* 0AB184 8020009C 00057E00 */ sll $t7, $a1, 0x18
-/* 0AB188 802000A0 3C014600 */ lui $at, 0x4600
-/* 0AB18C 802000A4 01C12025 */ or $a0, $t6, $at
-/* 0AB190 802000A8 000F2E03 */ sra $a1, $t7, 0x18
-/* 0AB194 802000AC 01C01025 */ move $v0, $t6
-/* 0AB198 802000B0 AFAE001C */ sw $t6, 0x1c($sp)
-/* 0AB19C 802000B4 AFA80028 */ sw $t0, 0x28($sp)
-/* 0AB1A0 802000B8 0C0BB7DC */ jal func_802ad770
-/* 0AB1A4 802000BC AFA90020 */ sw $t1, 0x20($sp)
-/* 0AB1A8 802000C0 8FA90020 */ lw $t1, 0x20($sp)
-/* 0AB1AC 802000C4 8FA2001C */ lw $v0, 0x1c($sp)
-/* 0AB1B0 802000C8 3C018200 */ lui $at, 0x8200
-/* 0AB1B4 802000CC 312A00FF */ andi $t2, $t1, 0xff
-/* 0AB1B8 802000D0 000A5A00 */ sll $t3, $t2, 8
-/* 0AB1BC 802000D4 0041C825 */ or $t9, $v0, $at
-/* 0AB1C0 802000D8 032B2025 */ or $a0, $t9, $t3
-/* 0AB1C4 802000DC 0C0BB7D3 */ jal func_802ad74c
-/* 0AB1C8 802000E0 97A5003A */ lhu $a1, 0x3a($sp)
-/* 0AB1CC 802000E4 8FA80028 */ lw $t0, 0x28($sp)
-/* 0AB1D0 802000E8 55000013 */ bnezl $t0, .L480200138
-/* 0AB1D4 802000EC 8FBF0014 */ lw $ra, 0x14($sp)
-/* 0AB1D8 802000F0 0C0BB0F2 */ jal func_803200E4
-/* 0AB1DC 802000F4 00002025 */ move $a0, $zero
-/* 0AB1E0 802000F8 240100FF */ li $at, 255
-/* 0AB1E4 802000FC 5041000E */ beql $v0, $at, .L480200138
-/* 0AB1E8 80200100 8FBF0014 */ lw $ra, 0x14($sp)
-/* 0AB1EC 80200104 44822000 */ mtc1 $v0, $f4
-/* 0AB1F0 80200108 3C014F80 */ li $at, 0x4F800000 # 4294967296.000000
-/* 0AB1F4 8020010C 04410004 */ bgez $v0, .L480200120
-/* 0AB1F8 80200110 468021A0 */ cvt.s.w $f6, $f4
-/* 0AB1FC 80200114 44814000 */ mtc1 $at, $f8
-/* 0AB200 80200118 00000000 */ nop
-/* 0AB204 8020011C 46083180 */ add.s $f6, $f6, $f8
-.L480200120:
-/* 0AB208 80200120 3C0142FE */ li $at, 0x42FE0000 # 127.000000
-/* 0AB20C 80200124 44815000 */ mtc1 $at, $f10
-/* 0AB210 80200128 3C018022 */ lui $at, %hi(gSequencePlayers + 0x28) # $at, 0x8022
-/* 0AB214 8020012C 460A3403 */ div.s $f16, $f6, $f10
-/* 0AB218 80200130 E4303D90 */ swc1 $f16, %lo(gSequencePlayers + 0x28)($at)
-/* 0AB21C 80200134 8FBF0014 */ lw $ra, 0x14($sp)
-.L480200138:
-/* 0AB220 80200138 27BD0030 */ addiu $sp, $sp, 0x30
-/* 0AB224 8020013C 03E00008 */ jr $ra
-/* 0AB228 80200140 00000000 */ nop
diff --git a/asm/non_matchings/eu/player_performed_grab_escape_action.s b/asm/non_matchings/eu/player_performed_grab_escape_action.s
@@ -1,36 +0,0 @@
-glabel player_performed_grab_escape_action
-/* 0D8190 80200000 3C028030 */ lui $v0, %hi(gPlayer1Controller) # $v0, 0x8030
-/* 0D8194 80200004 8C429794 */ lw $v0, %lo(gPlayer1Controller)($v0)
-/* 0D8198 80200008 3C0141F0 */ li $at, 0x41F00000 # 30.000000
-/* 0D819C 8020000C 44812000 */ mtc1 $at, $f4
-/* 0D81A0 80200010 C440000C */ lwc1 $f0, 0xc($v0)
-/* 0D81A4 80200014 00001825 */ move $v1, $zero
-/* 0D81A8 80200018 3C018039 */ lui $at, %hi(sGrabReleaseState) # $at, 0x8039
-/* 0D81AC 8020001C 4604003C */ c.lt.s $f0, $f4
-/* 0D81B0 80200020 3C0E8039 */ lui $t6, %hi(sGrabReleaseState) # $t6, 0x8039
-/* 0D81B4 80200024 45000002 */ bc1f .L81_80200030
-/* 0D81B8 80200028 00000000 */ nop
-/* 0D81BC 8020002C AC209C70 */ sw $zero, %lo(sGrabReleaseState)($at)
-.L81_80200030:
-/* 0D81C0 80200030 8DCE9C70 */ lw $t6, %lo(sGrabReleaseState)($t6)
-/* 0D81C4 80200034 3C014220 */ li $at, 0x42200000 # 40.000000
-/* 0D81C8 80200038 55C0000B */ bnezl $t6, .L81_80200068
-/* 0D81CC 8020003C 94580012 */ lhu $t8, 0x12($v0)
-/* 0D81D0 80200040 44813000 */ mtc1 $at, $f6
-/* 0D81D4 80200044 3C018039 */ lui $at, %hi(sGrabReleaseState) # $at, 0x8039
-/* 0D81D8 80200048 240F0001 */ li $t7, 1
-/* 0D81DC 8020004C 4600303C */ c.lt.s $f6, $f0
-/* 0D81E0 80200050 00000000 */ nop
-/* 0D81E4 80200054 45020004 */ bc1fl .L81_80200068
-/* 0D81E8 80200058 94580012 */ lhu $t8, 0x12($v0)
-/* 0D81EC 8020005C AC2F9C70 */ sw $t7, %lo(sGrabReleaseState)($at)
-/* 0D81F0 80200060 24030001 */ li $v1, 1
-/* 0D81F4 80200064 94580012 */ lhu $t8, 0x12($v0)
-.L81_80200068:
-/* 0D81F8 80200068 33198000 */ andi $t9, $t8, 0x8000
-/* 0D81FC 8020006C 13200002 */ beqz $t9, .L81_80200078
-/* 0D8200 80200070 00000000 */ nop
-/* 0D8204 80200074 24030001 */ li $v1, 1
-.L81_80200078:
-/* 0D8208 80200078 03E00008 */ jr $ra
-/* 0D820C 8020007C 00601025 */ move $v0, $v1
diff --git a/asm/rom_header.s b/asm/rom_header.s
@@ -5,10 +5,12 @@
.byte 0x80, 0x37, 0x12, 0x40 /* PI BSD Domain 1 register */
.word 0x0000000F /* Clockrate setting*/
-.word EntryPoint /* Entrypoint */
+.word entry_point /* Entrypoint */
/* Revision */
-.if VERSION_EU == 1
+.if VERSION_SH == 1
+ .word 0x00001448
+.elseif VERSION_EU == 1
.word 0x00001446
.else /* NTSC-U and NTSC-J 1.0 */
.word 0x00001444
@@ -18,7 +20,11 @@
.word 0x74757C24 /* Checksum 2 */
.word 0x00000000 /* Unknown */
.word 0x00000000 /* Unknown */
+.if VERSION_SH == 1
+.ascii "SUPERMARIO64 " /* Internal ROM name */
+.else
.ascii "SUPER MARIO 64 " /* Internal ROM name */
+.endif
.word 0x00000000 /* Unknown */
.word 0x0000004E /* Cartridge */
.ascii "SM" /* Cartridge ID */
@@ -26,7 +32,7 @@
/* Region */
.if VERSION_US == 1
.ascii "E" /* NTSC-U (North America) */
-.elseif VERSION_JP == 1
+.elseif (VERSION_JP == 1 || VERSION_SH == 1)
.ascii "J" /* NTSC-J (Japan) */
.else
.ascii "P" /* PAL (Europe) */
diff --git a/assets.json b/assets.json
@@ -436,10 +436,10 @@
"actors/water_splash/water_splash_5.rgba16.png": [32,64,4096,{"jp":[1125200,193992],"us":[1132368,193992],"eu":[1004336,193992]}],
"actors/water_splash/water_splash_6.rgba16.png": [32,64,4096,{"jp":[1125200,198088],"us":[1132368,198088],"eu":[1004336,198088]}],
"actors/water_splash/water_splash_7.rgba16.png": [32,64,4096,{"jp":[1125200,202184],"us":[1132368,202184],"eu":[1004336,202184]}],
-"actors/water_waves/water_waves_0.ia16.png": [32,32,2048,{"jp":[1125200,152408],"us":[1132368,152408],"eu":[1004336,152408]}],
-"actors/water_waves/water_waves_1.ia16.png": [32,32,2048,{"jp":[1125200,154456],"us":[1132368,154456],"eu":[1004336,154456]}],
-"actors/water_waves/water_waves_2.ia16.png": [32,32,2048,{"jp":[1125200,156504],"us":[1132368,156504],"eu":[1004336,156504]}],
-"actors/water_waves/water_waves_3.ia16.png": [32,32,2048,{"jp":[1125200,158552],"us":[1132368,158552],"eu":[1004336,158552]}],
+"actors/water_wave/water_wave_0.ia16.png": [32,32,2048,{"jp":[1125200,152408],"us":[1132368,152408],"eu":[1004336,152408]}],
+"actors/water_wave/water_wave_1.ia16.png": [32,32,2048,{"jp":[1125200,154456],"us":[1132368,154456],"eu":[1004336,154456]}],
+"actors/water_wave/water_wave_2.ia16.png": [32,32,2048,{"jp":[1125200,156504],"us":[1132368,156504],"eu":[1004336,156504]}],
+"actors/water_wave/water_wave_3.ia16.png": [32,32,2048,{"jp":[1125200,158552],"us":[1132368,158552],"eu":[1004336,158552]}],
"actors/whirlpool/whirlpool.ia16.png": [32,64,4096,{"jp":[1285392,75848],"us":[1292560,75848],"eu":[1164528,75848]}],
"actors/white_particle/snow_particle.rgba16.png": [16,16,512,{"jp":[2094912,181920],"us":[2102288,181920],"eu":[1974256,181920]}],
"actors/white_particle_small/small_snow_particle.rgba16.png": [16,16,512,{"jp":[1125200,206720],"us":[1132368,206720],"eu":[1004336,206720]}],
@@ -1730,8 +1730,7 @@
"textures/snow/ccm_textures.09000.ia16.png": [32,32,2048,{"jp":[3405536,36864],"us":[3412288,36864],"eu":[3285888,36864]}],
"textures/snow/ccm_textures.09800.ia16.png": [32,32,2048,{"jp":[3405536,38912],"us":[3412288,38912],"eu":[3285888,38912]}],
"textures/spooky/bbh_textures.00000.rgba16.png": [32,32,2048,{"jp":[3298272,0],"us":[3305024,0],"eu":[3178624,0]}],
-"textures/spooky/bbh_textures.00800.rgba16.png": [32,32,2048,{"jp":[3298272,2048],"us":[3305024,2048],"eu":[3178624,2048]}],
-"textures/spooky/bbh_textures.01000.rgba16.png": [32,32,2048,{"jp":[3298272,4096],"us":[3305024,4096],"eu":[3178624,4096]}],
+"textures/spooky/bbh_textures.00800.rgba16.png": [32,64,4096,{"jp":[3298272,2048],"us":[3305024,2048],"eu":[3178624,2048]}],
"textures/spooky/bbh_textures.01800.rgba16.png": [32,64,4096,{"jp":[3298272,6144],"us":[3305024,6144],"eu":[3178624,6144]}],
"textures/spooky/bbh_textures.02800.rgba16.png": [32,64,4096,{"jp":[3298272,10240],"us":[3305024,10240],"eu":[3178624,10240]}],
"textures/spooky/bbh_textures.03800.rgba16.png": [32,64,4096,{"jp":[3298272,14336],"us":[3305024,14336],"eu":[3178624,14336]}],
diff --git a/bin/segment2.c b/bin/segment2.c
@@ -82,7 +82,7 @@ ALIGNED8 static const u8 texture_hud_char_I[] = {
#include "textures/segment2/segment2.02400.rgba16.inc.c"
};
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_J[] = {
#include "textures/segment2/segment2.02600.rgba16.inc.c"
};
@@ -112,7 +112,7 @@ ALIGNED8 static const u8 texture_hud_char_P[] = {
#include "textures/segment2/segment2.03200.rgba16.inc.c"
};
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_Q[] = {
#include "textures/segment2/segment2.03400.rgba16.inc.c"
};
@@ -134,7 +134,7 @@ ALIGNED8 static const u8 texture_hud_char_U[] = {
#include "textures/segment2/segment2.03C00.rgba16.inc.c"
};
-#if defined(VERSION_JP) || defined(VERSION_EU)
+#if defined(VERSION_JP) || defined(VERSION_EU) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_V[] = {
#include "textures/segment2/segment2.03E00.rgba16.inc.c"
};
@@ -144,7 +144,7 @@ ALIGNED8 static const u8 texture_hud_char_W[] = {
#include "textures/segment2/segment2.04000.rgba16.inc.c"
};
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_X[] = {
#include "textures/segment2/segment2.04200.rgba16.inc.c"
};
@@ -154,7 +154,7 @@ ALIGNED8 static const u8 texture_hud_char_Y[] = {
#include "textures/segment2/segment2.04400.rgba16.inc.c"
};
-#if defined(VERSION_JP) || defined(VERSION_EU)
+#if defined(VERSION_JP) || defined(VERSION_EU) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_Z[] = {
#include "textures/segment2/segment2.04600.rgba16.inc.c"
};
@@ -174,7 +174,7 @@ ALIGNED8 static const u8 texture_hud_char_umlaut[] = {
};
#endif
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_exclamation[] = {
#include "textures/segment2/segment2.04C00.rgba16.inc.c"// JP !
};
@@ -212,13 +212,13 @@ ALIGNED8 static const u8 texture_hud_char_star[] = {
#include "textures/segment2/segment2.05C00.rgba16.inc.c"
};
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_decimal_point[] = {
#include "textures/segment2/segment2.05E00.rgba16.inc.c"
};
#endif
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_hud_char_beta_key[] = {
#include "textures/segment2/segment2.06000.rgba16.inc.c"
};
@@ -345,7 +345,7 @@ ALIGNED8 static const u8 texture_credits_char_period[] = {
};
// JP Small Font
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
ALIGNED8 static const u8 texture_font_char_jp_0[] = {
#include "textures/segment2/segment2.07100.ia1.inc.c"
};
@@ -1987,7 +1987,7 @@ const u8 *const main_font_lut[] = {
texture_font_char_us_question, texture_font_char_us_double_quote_open, texture_font_char_us_double_quote_close, texture_font_char_us_tilde,
0x0, texture_font_char_us_coin, texture_font_char_us_star_filled, texture_font_char_us_multiply,
texture_font_char_us_interpunct, texture_font_char_us_star_hollow, 0x0, 0x0,
-#elif defined(VERSION_JP)
+#elif defined(VERSION_JP) || defined(VERSION_SH)
texture_font_char_jp_0, texture_font_char_jp_1, texture_font_char_jp_2, texture_font_char_jp_3,
texture_font_char_jp_4, texture_font_char_jp_5, texture_font_char_jp_6, texture_font_char_jp_7,
texture_font_char_jp_8, texture_font_char_jp_9, texture_font_char_jp_A, texture_font_char_jp_B,
@@ -2078,7 +2078,7 @@ const u8 *const main_hud_camera_lut[] = {
// If you change the language here, the following Makefile rule also needs to
// change, to generate the right version of define_text.inc.c:
// $(BUILD_DIR)/bin/segment2.o: $(BUILD_DIR)/text/$(VERSION)/define_text.inc.c
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#include "text/jp/define_text.inc.c"
#elif defined(VERSION_US)
#include "text/us/define_text.inc.c"
@@ -2773,11 +2773,12 @@ const Gfx dl_paintings_draw_ripples[] = {
gsSPEndDisplayList(),
};
-// 14A60-15BAD: count and triangles?
// 14A60: triangle mesh
// 0x02014A60
-const s16 seg2_triangle_mesh[] = {
- 157,
+const s16 seg2_painting_triangle_mesh[] = {
+ 157, // numVtx
+ // format:
+ // 2D point (x, y), ripple (0 or 1)
614, 583, 0, // 0
614, 614, 0, // 1
562, 614, 0, // 2
@@ -3201,128 +3202,172 @@ const s16 seg2_triangle_mesh[] = {
118, 154, 140, // 261
140, 135, 130, // 262
117, 154, 118, // 263
- 0, // TODO: alignment?
-};
-
-// 0x02015444: TODO
-const s16 seg2_mesh_order[] = {
- 3, 1, 2, 3, 1, 1, 4,
- 1, 2, 4, 5, 6, 2, 3, 5,
- 14, 59, 62, 3, 3, 58, 59, 6,
- 4, 5, 13, 14, 15, 16, 2, 4,
- 13, 2, 6, 7, 6, 0, 6, 7,
- 8, 9, 10, 4, 6, 10, 11, 12,
- 4, 7, 8, 154, 155, 6, 8, 9,
- 77, 154, 163, 194, 6, 0, 9, 72,
- 73, 75, 77, 6, 0, 10, 11, 19,
- 70, 72, 6, 11, 12, 17, 18, 19,
- 20, 4, 13, 16, 17, 18, 6, 14,
- 15, 53, 61, 62, 64, 6, 15, 16,
- 18, 20, 64, 67, 6, 19, 20, 66,
- 67, 69, 70, 8, 21, 22, 27, 31,
- 80, 81, 149, 150, 3, 21, 22, 26,
- 6, 23, 24, 25, 28, 57, 60, 3,
- 24, 25, 26, 6, 22, 24, 26, 27,
- 28, 29, 6, 27, 29, 30, 31, 32,
- 33, 8, 30, 33, 39, 40, 78, 79,
- 146, 147, 6, 34, 35, 37, 44, 63,
- 65, 6, 23, 28, 29, 32, 34, 35,
- 6, 23, 35, 53, 60, 61, 63, 6,
- 38, 39, 40, 41, 42, 43, 6, 32,
- 33, 34, 37, 38, 39, 8, 41, 42,
- 48, 52, 76, 82, 148, 151, 6, 44,
- 46, 65, 66, 68, 69, 6, 45, 46,
- 47, 56, 68, 71, 6, 37, 38, 43,
- 44, 45, 46, 6, 42, 43, 45, 47,
- 48, 49, 6, 36, 48, 49, 50, 51,
- 52, 8, 50, 51, 152, 153, 170, 174,
- 214, 215, 6, 36, 47, 49, 54, 55,
- 56, 6, 54, 55, 74, 169, 178, 196,
- 6, 54, 56, 71, 73, 74, 75, 3,
- 25, 57, 58, 6, 57, 58, 59, 60,
- 61, 62, 6, 53, 63, 64, 65, 66,
- 67, 6, 68, 69, 70, 71, 72, 73,
- 6, 74, 75, 77, 194, 195, 196, 6,
- 79, 82, 125, 137, 146, 148, 6, 78,
- 80, 129, 130, 147, 149, 6, 76, 144,
- 145, 151, 152, 153, 3, 84, 85, 86,
- 1, 85, 4, 85, 86, 91, 95, 6,
- 83, 87, 88, 90, 119, 124, 3, 84,
- 87, 88, 6, 89, 91, 92, 93, 94,
- 95, 6, 84, 86, 87, 89, 90, 91,
- 4, 93, 94, 101, 105, 2, 94, 95,
- 6, 96, 97, 100, 108, 126, 131, 6,
- 83, 89, 90, 92, 96, 97, 6, 83,
- 97, 123, 124, 126, 127, 6, 99, 101,
- 102, 103, 104, 105, 6, 92, 93, 96,
- 99, 100, 101, 4, 98, 103, 104, 110,
- 2, 104, 105, 6, 99, 100, 102, 106,
- 107, 108, 6, 106, 107, 111, 117, 134,
- 138, 6, 106, 108, 131, 132, 134, 135,
- 6, 98, 109, 110, 112, 113, 114, 6,
- 102, 103, 107, 109, 110, 111, 4, 113,
- 114, 221, 223, 2, 98, 114, 6, 115,
- 116, 142, 213, 226, 236, 6, 109, 111,
- 112, 115, 116, 117, 6, 116, 117, 138,
- 140, 141, 142, 3, 88, 118, 119, 6,
- 120, 121, 122, 130, 149, 150, 3, 118,
- 120, 121, 6, 118, 119, 120, 122, 123,
- 124, 6, 125, 128, 129, 133, 146, 147,
- 6, 122, 123, 127, 128, 129, 130, 6,
- 126, 127, 128, 131, 132, 133, 6, 136,
- 137, 139, 145, 148, 151, 6, 125, 132,
- 133, 135, 136, 137, 6, 134, 135, 136,
- 138, 139, 140, 6, 143, 144, 153, 215,
- 246, 252, 6, 139, 140, 141, 143, 144,
- 145, 6, 154, 155, 162, 163, 164, 165,
- 1, 157, 3, 157, 158, 159, 4, 157,
- 159, 160, 161, 6, 158, 159, 160, 167,
- 205, 206, 6, 156, 160, 161, 166, 167,
- 168, 6, 162, 163, 194, 195, 197, 199,
- 6, 162, 164, 166, 168, 199, 202, 4,
- 156, 164, 165, 166, 6, 167, 168, 201,
- 202, 204, 205, 6, 36, 50, 55, 169,
- 170, 171, 6, 170, 171, 172, 173, 174,
- 175, 8, 172, 173, 180, 184, 209, 210,
- 211, 212, 6, 176, 177, 179, 188, 198,
- 200, 6, 169, 171, 175, 176, 177, 178,
- 6, 177, 178, 195, 196, 197, 198, 6,
- 172, 175, 176, 179, 180, 181, 6, 180,
- 181, 182, 183, 184, 185, 8, 182, 183,
- 189, 192, 216, 217, 218, 219, 6, 186,
- 187, 190, 193, 203, 207, 6, 179, 181,
- 185, 186, 187, 188, 6, 187, 188, 200,
- 201, 203, 204, 6, 182, 185, 186, 189,
- 190, 191, 3, 189, 191, 192, 3, 193,
- 207, 208, 6, 197, 198, 199, 200, 201,
- 202, 6, 203, 204, 205, 206, 207, 208,
- 6, 209, 210, 250, 251, 253, 258, 6,
- 210, 211, 217, 219, 247, 258, 6, 209,
- 212, 214, 215, 251, 252, 3, 216, 218,
- 263, 6, 218, 219, 247, 259, 261, 263,
- 6, 220, 221, 222, 223, 224, 225, 6,
- 112, 113, 115, 213, 220, 221, 2, 223,
- 224, 4, 224, 225, 230, 235, 6, 226,
- 227, 236, 245, 248, 249, 6, 213, 220,
- 222, 226, 227, 228, 6, 227, 228, 231,
- 239, 249, 255, 6, 229, 230, 232, 233,
- 234, 235, 6, 222, 225, 228, 229, 230,
- 231, 2, 233, 235, 4, 233, 234, 241,
- 243, 6, 237, 238, 242, 244, 257, 262,
- 6, 229, 231, 232, 237, 238, 239, 6,
- 238, 239, 254, 255, 256, 257, 3, 240,
- 241, 243, 6, 232, 234, 237, 240, 241,
- 242, 3, 244, 260, 262, 6, 141, 142,
- 143, 236, 245, 246, 6, 245, 246, 248,
- 250, 251, 252, 6, 248, 249, 250, 253,
- 254, 255, 6, 247, 253, 254, 256, 258,
- 259, 6, 256, 257, 259, 260, 261, 262,
- 2, 12, 17, 2, 21, 81, 3, 81,
- 121, 150, 4, 30, 31, 78, 80, 4,
- 40, 41, 79, 82, 4, 51, 52, 76,
- 152, 2, 155, 165, 3, 158, 206, 208,
- 2, 156, 161, 4, 173, 174, 212, 214,
- 4, 183, 184, 211, 217, 3, 190, 191,
- 193, 2, 192, 216, 3, 260, 261, 263,
- 3, 240, 242, 244, 1, 243,
+};
+
+/* 0x02015444: seg2_painting_mesh_neighbor_tris
+ * Lists the neighboring triangles for each vertex in the mesh.
+ * Used when applying gouraud shading to the generated ripple mesh
+ *
+ * Format:
+ * num neighbors, neighbor0, neighbor1, ...
+ * The nth entry corresponds to the nth vertex in seg2_painting_triangle_mesh
+ */
+const s16 seg2_painting_mesh_neighbor_tris[] = {
+ 3, 1, 2, 3,
+ 1, 1,
+ 4, 1, 2, 4, 5,
+ 6, 2, 3, 5, 14, 59, 62,
+ 3, 3, 58, 59,
+ 6, 4, 5, 13, 14, 15, 16,
+ 2, 4, 13,
+ 2, 6, 7,
+ 6, 0, 6, 7, 8, 9, 10,
+ 4, 6, 10, 11, 12,
+ 4, 7, 8, 154, 155,
+ 6, 8, 9, 77, 154, 163, 194,
+ 6, 0, 9, 72, 73, 75, 77,
+ 6, 0, 10, 11, 19, 70, 72,
+ 6, 11, 12, 17, 18, 19, 20,
+ 4, 13, 16, 17, 18,
+ 6, 14, 15, 53, 61, 62, 64,
+ 6, 15, 16, 18, 20, 64, 67,
+ 6, 19, 20, 66, 67, 69, 70,
+ 8, 21, 22, 27, 31, 80, 81, 149, 150,
+ 3, 21, 22, 26,
+ 6, 23, 24, 25, 28, 57, 60,
+ 3, 24, 25, 26,
+ 6, 22, 24, 26, 27, 28, 29,
+ 6, 27, 29, 30, 31, 32, 33,
+ 8, 30, 33, 39, 40, 78, 79, 146, 147,
+ 6, 34, 35, 37, 44, 63, 65,
+ 6, 23, 28, 29, 32, 34, 35,
+ 6, 23, 35, 53, 60, 61, 63,
+ 6, 38, 39, 40, 41, 42, 43,
+ 6, 32, 33, 34, 37, 38, 39,
+ 8, 41, 42, 48, 52, 76, 82, 148, 151,
+ 6, 44, 46, 65, 66, 68, 69,
+ 6, 45, 46, 47, 56, 68, 71,
+ 6, 37, 38, 43, 44, 45, 46,
+ 6, 42, 43, 45, 47, 48, 49,
+ 6, 36, 48, 49, 50, 51, 52,
+ 8, 50, 51, 152, 153, 170, 174, 214, 215,
+ 6, 36, 47, 49, 54, 55, 56,
+ 6, 54, 55, 74, 169, 178, 196,
+ 6, 54, 56, 71, 73, 74, 75,
+ 3, 25, 57, 58,
+ 6, 57, 58, 59, 60, 61, 62,
+ 6, 53, 63, 64, 65, 66, 67,
+ 6, 68, 69, 70, 71, 72, 73,
+ 6, 74, 75, 77, 194, 195, 196,
+ 6, 79, 82, 125, 137, 146, 148,
+ 6, 78, 80, 129, 130, 147, 149,
+ 6, 76, 144, 145, 151, 152, 153,
+ 3, 84, 85, 86,
+ 1, 85,
+ 4, 85, 86, 91, 95,
+ 6, 83, 87, 88, 90, 119, 124,
+ 3, 84, 87, 88,
+ 6, 89, 91, 92, 93, 94, 95,
+ 6, 84, 86, 87, 89, 90, 91,
+ 4, 93, 94, 101, 105,
+ 2, 94, 95,
+ 6, 96, 97, 100, 108, 126, 131,
+ 6, 83, 89, 90, 92, 96, 97,
+ 6, 83, 97, 123, 124, 126, 127,
+ 6, 99, 101, 102, 103, 104, 105,
+ 6, 92, 93, 96, 99, 100, 101,
+ 4, 98, 103, 104, 110,
+ 2, 104, 105,
+ 6, 99, 100, 102, 106, 107, 108,
+ 6, 106, 107, 111, 117, 134, 138,
+ 6, 106, 108, 131, 132, 134, 135,
+ 6, 98, 109, 110, 112, 113, 114,
+ 6, 102, 103, 107, 109, 110, 111,
+ 4, 113, 114, 221, 223,
+ 2, 98, 114,
+ 6, 115, 116, 142, 213, 226, 236,
+ 6, 109, 111, 112, 115, 116, 117,
+ 6, 116, 117, 138, 140, 141, 142,
+ 3, 88, 118, 119,
+ 6, 120, 121, 122, 130, 149, 150,
+ 3, 118, 120, 121,
+ 6, 118, 119, 120, 122, 123, 124,
+ 6, 125, 128, 129, 133, 146, 147,
+ 6, 122, 123, 127, 128, 129, 130,
+ 6, 126, 127, 128, 131, 132, 133,
+ 6, 136, 137, 139, 145, 148, 151,
+ 6, 125, 132, 133, 135, 136, 137,
+ 6, 134, 135, 136, 138, 139, 140,
+ 6, 143, 144, 153, 215, 246, 252,
+ 6, 139, 140, 141, 143, 144, 145,
+ 6, 154, 155, 162, 163, 164, 165,
+ 1, 157,
+ 3, 157, 158, 159,
+ 4, 157, 159, 160, 161,
+ 6, 158, 159, 160, 167, 205, 206,
+ 6, 156, 160, 161, 166, 167, 168,
+ 6, 162, 163, 194, 195, 197, 199,
+ 6, 162, 164, 166, 168, 199, 202,
+ 4, 156, 164, 165, 166,
+ 6, 167, 168, 201, 202, 204, 205,
+ 6, 36, 50, 55, 169, 170, 171,
+ 6, 170, 171, 172, 173, 174, 175,
+ 8, 172, 173, 180, 184, 209, 210, 211, 212,
+ 6, 176, 177, 179, 188, 198, 200,
+ 6, 169, 171, 175, 176, 177, 178,
+ 6, 177, 178, 195, 196, 197, 198,
+ 6, 172, 175, 176, 179, 180, 181,
+ 6, 180, 181, 182, 183, 184, 185,
+ 8, 182, 183, 189, 192, 216, 217, 218, 219,
+ 6, 186, 187, 190, 193, 203, 207,
+ 6, 179, 181, 185, 186, 187, 188,
+ 6, 187, 188, 200, 201, 203, 204,
+ 6, 182, 185, 186, 189, 190, 191,
+ 3, 189, 191, 192,
+ 3, 193, 207, 208,
+ 6, 197, 198, 199, 200, 201, 202,
+ 6, 203, 204, 205, 206, 207, 208,
+ 6, 209, 210, 250, 251, 253, 258,
+ 6, 210, 211, 217, 219, 247, 258,
+ 6, 209, 212, 214, 215, 251, 252,
+ 3, 216, 218, 263,
+ 6, 218, 219, 247, 259, 261, 263,
+ 6, 220, 221, 222, 223, 224, 225,
+ 6, 112, 113, 115, 213, 220, 221,
+ 2, 223, 224,
+ 4, 224, 225, 230, 235,
+ 6, 226, 227, 236, 245, 248, 249,
+ 6, 213, 220, 222, 226, 227, 228,
+ 6, 227, 228, 231, 239, 249, 255,
+ 6, 229, 230, 232, 233, 234, 235,
+ 6, 222, 225, 228, 229, 230, 231,
+ 2, 233, 235,
+ 4, 233, 234, 241, 243,
+ 6, 237, 238, 242, 244, 257, 262,
+ 6, 229, 231, 232, 237, 238, 239,
+ 6, 238, 239, 254, 255, 256, 257,
+ 3, 240, 241, 243,
+ 6, 232, 234, 237, 240, 241, 242,
+ 3, 244, 260, 262,
+ 6, 141, 142, 143, 236, 245, 246,
+ 6, 245, 246, 248, 250, 251, 252,
+ 6, 248, 249, 250, 253, 254, 255,
+ 6, 247, 253, 254, 256, 258, 259,
+ 6, 256, 257, 259, 260, 261, 262,
+ 2, 12, 17,
+ 2, 21, 81,
+ 3, 81, 121, 150,
+ 4, 30, 31, 78, 80,
+ 4, 40, 41, 79, 82,
+ 4, 51, 52, 76, 152,
+ 2, 155, 165,
+ 3, 158, 206, 208,
+ 2, 156, 161,
+ 4, 173, 174, 212, 214,
+ 4, 183, 184, 211, 217,
+ 3, 190, 191, 193,
+ 2, 192, 216,
+ 3, 260, 261, 263,
+ 3, 240, 242, 244,
+ 1, 243,
};
diff --git a/bin/spooky.c b/bin/spooky.c
@@ -12,11 +12,6 @@ ALIGNED8 const u8 spooky_09000800[] = {
#include "textures/spooky/bbh_textures.00800.rgba16.inc.c"
};
-// 0x09001000
-ALIGNED8 const u8 spooky_09001000[] = {
-#include "textures/spooky/bbh_textures.01000.rgba16.inc.c"
-};
-
// 0x09001800
ALIGNED8 const u8 spooky_09001800[] = {
#include "textures/spooky/bbh_textures.01800.rgba16.inc.c"
diff --git a/data/behavior_data.c b/data/behavior_data.c
@@ -288,8 +288,8 @@
#define DISABLE_RENDERING() \
BC_B(0x35)
-// Spawns a water splash with the given parameters.
-#define SPAWN_WATER_SPLASH(params) \
+// Spawns a water droplet with the given parameters.
+#define SPAWN_WATER_DROPLET(params) \
BC_B(0x37), \
BC_PTR(params)
@@ -379,7 +379,7 @@ const BehaviorScript bhvPoleGrabbing[] = {
CALL_NATIVE(bhv_pole_init),
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
- CALL_NATIVE(BehClimbDetectLoop),
+ CALL_NATIVE(bhv_pole_base_loop),
END_LOOP(),
};
@@ -778,7 +778,7 @@ const BehaviorScript bhvFadingWarp[] = {
SET_INT(oInteractType, INTERACT_WARP),
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
- CALL_NATIVE(BehFadingWarpLoop),
+ CALL_NATIVE(bhv_fading_warp_loop),
END_LOOP(),
};
@@ -1209,8 +1209,8 @@ const BehaviorScript bhvBreakBoxTriangle[] = {
BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BEGIN_REPEAT(18),
- CALL_NATIVE(obj_rotate_face_angle_using_vel),
- CALL_NATIVE(obj_move_using_fvel_and_gravity),
+ CALL_NATIVE(cur_obj_rotate_face_angle_using_vel),
+ CALL_NATIVE(cur_obj_move_using_fvel_and_gravity),
END_REPEAT(),
DEACTIVATE(),
};
@@ -1251,7 +1251,7 @@ const BehaviorScript bhvGroundSand[] = {
BEGIN(OBJ_LIST_DEFAULT),
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- CALL_NATIVE(bhv_unused_0e40_init),
+ CALL_NATIVE(bhv_ground_sand_init),
DELAY(1),
DEACTIVATE(),
};
@@ -1278,7 +1278,7 @@ const BehaviorScript bhvEndToad[] = {
LOAD_ANIMATIONS(oAnimations, toad_seg6_anims_0600FB58),
ANIMATE(0),
BEGIN_LOOP(),
- CALL_NATIVE(BehEndToadLoop),
+ CALL_NATIVE(bhv_end_toad_loop),
END_LOOP(),
};
@@ -1288,7 +1288,7 @@ const BehaviorScript bhvEndPeach[] = {
LOAD_ANIMATIONS(oAnimations, peach_seg5_anims_0501C41C),
ANIMATE(0),
BEGIN_LOOP(),
- CALL_NATIVE(BehEndPeachLoop),
+ CALL_NATIVE(bhv_end_peach_loop),
END_LOOP(),
};
@@ -1371,7 +1371,7 @@ const BehaviorScript bhvDddMovingPole[] = {
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
CALL_NATIVE(bhv_ddd_moving_pole_loop),
- CALL_NATIVE(BehClimbDetectLoop),
+ CALL_NATIVE(bhv_pole_base_loop),
END_LOOP(),
};
@@ -1971,7 +1971,7 @@ const BehaviorScript bhvTiltingBowserLavaPlatform[] = {
SET_INT(oFaceAngleYaw, 0),
SET_HOME(),
BEGIN_LOOP(),
- CALL_NATIVE(obj_rotate_face_angle_using_vel),
+ CALL_NATIVE(cur_obj_rotate_face_angle_using_vel),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -2082,7 +2082,7 @@ const BehaviorScript bhvBlueFish[] = {
LOAD_ANIMATIONS(oAnimations, blue_fish_seg3_anims_0301C2B0),
ANIMATE(0),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_blue_fish_loop),
+ CALL_NATIVE(bhv_blue_fish_movement_loop),
END_LOOP(),
};
@@ -2503,16 +2503,16 @@ const BehaviorScript bhvLargeFishGroup[] = {
DISABLE_RENDERING(),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_fish_loop),
+ CALL_NATIVE(bhv_large_fish_group_loop),
END_LOOP(),
};
-const BehaviorScript bhvFishGroup2[] = {
+const BehaviorScript bhvFish[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
SET_HOME(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_fish_group_2_loop),
+ CALL_NATIVE(bhv_fish_loop),
END_LOOP(),
};
@@ -2547,7 +2547,7 @@ const BehaviorScript bhvChirpChirpUnused[] = {
DISABLE_RENDERING(),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_bird_chirp_chirp_loop),
+ CALL_NATIVE(bhv_bub_spawner_loop),
END_LOOP(),
};
@@ -2562,7 +2562,7 @@ const BehaviorScript bhvBub[] = {
SET_HOME(),
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_cheep_cheep_loop),
+ CALL_NATIVE(bhv_bub_loop),
END_LOOP(),
};
@@ -2583,7 +2583,7 @@ const BehaviorScript bhvRotatingExclamationMark[] = {
OR_INT(oFlags, (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
SCALE(200),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_rotatin_exclamation_box_loop),
+ CALL_NATIVE(bhv_rotating_exclamation_box_loop),
ADD_INT(oMoveAngleYaw, 0x800),
END_LOOP(),
};
@@ -2771,7 +2771,7 @@ const BehaviorScript bhvWhitePuffSmoke2[] = {
SET_INT(oAnimState, -1),
BEGIN_REPEAT(7),
CALL_NATIVE(bhv_white_puff_2_loop),
- CALL_NATIVE(obj_move_using_fvel_and_gravity),
+ CALL_NATIVE(cur_obj_move_using_fvel_and_gravity),
ADD_INT(oAnimState, 1),
END_REPEAT(),
DEACTIVATE(),
@@ -3151,7 +3151,7 @@ const BehaviorScript bhvTree[] = {
SET_HITBOX(/*Radius*/ 80, /*Height*/ 500),
SET_INT(oIntangibleTimer, 0),
BEGIN_LOOP(),
- CALL_NATIVE(BehClimbDetectLoop),
+ CALL_NATIVE(bhv_pole_base_loop),
END_LOOP(),
};
@@ -3237,6 +3237,7 @@ const BehaviorScript bhvSmallWhomp[] = {
END_LOOP(),
};
+// The large splash Mario makes when he jumps into a pool of water.
const BehaviorScript bhvWaterSplash[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
@@ -3244,9 +3245,9 @@ const BehaviorScript bhvWaterSplash[] = {
SET_INT(oAnimState, -1),
BEGIN_REPEAT(3),
ADD_INT(oAnimState, 1),
- CALL_NATIVE(bhv_water_splash_loop),
+ CALL_NATIVE(bhv_water_splash_spawn_droplets),
DELAY(1),
- CALL_NATIVE(bhv_water_splash_loop),
+ CALL_NATIVE(bhv_water_splash_spawn_droplets),
END_REPEAT(),
BEGIN_REPEAT(5),
ADD_INT(oAnimState, 1),
@@ -3256,16 +3257,18 @@ const BehaviorScript bhvWaterSplash[] = {
DEACTIVATE(),
};
-const BehaviorScript bhvWaterDrops[] = {
+// Droplets of water that spawn as a result of various water splashes.
+const BehaviorScript bhvWaterDroplet[] = {
BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_MOVE_XZ_USING_FVEL | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
BILLBOARD(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_water_drops_loop),
+ CALL_NATIVE(bhv_water_droplet_loop),
END_LOOP(),
};
-const BehaviorScript bhvWaterSurfaceWhiteWave[] = {
+// Small splashes that are seen when a water droplet lands back into the water.
+const BehaviorScript bhvWaterDropletSplash[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
#ifndef VERSION_JP
@@ -3273,7 +3276,7 @@ const BehaviorScript bhvWaterSurfaceWhiteWave[] = {
SET_INT(oFaceAngleYaw, 0),
SET_INT(oFaceAngleRoll, 0),
#endif
- CALL_NATIVE(bhv_water_surface_white_wave_init),
+ CALL_NATIVE(bhv_water_droplet_splash_init),
ADD_FLOAT(oPosY, 5),
SET_INT(oAnimState, -1),
BEGIN_REPEAT(6),
@@ -3282,7 +3285,8 @@ const BehaviorScript bhvWaterSurfaceWhiteWave[] = {
DEACTIVATE(),
};
-const BehaviorScript bhvObjectBubbleRipples[] = {
+// The splash created when an air bubble hits the surface of the water.
+const BehaviorScript bhvBubbleSplash[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
#ifdef VERSION_JP
@@ -3296,14 +3300,15 @@ const BehaviorScript bhvObjectBubbleRipples[] = {
SET_INT(oFaceAngleRoll, 0),
#endif
SET_INT(oAnimState, -1),
- CALL_NATIVE(bhv_object_bubble_ripples_init),
+ CALL_NATIVE(bhv_bubble_splash_init),
BEGIN_REPEAT(6),
ADD_INT(oAnimState, 1),
END_REPEAT(),
DEACTIVATE(),
};
-const BehaviorScript bhvSurfaceWaves[] = {
+// The water wave surrounding Mario when he is idle in a pool of water.
+const BehaviorScript bhvIdleWaterWave[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
#ifdef VERSION_JP
@@ -3319,16 +3324,18 @@ const BehaviorScript bhvSurfaceWaves[] = {
SET_INT(oAnimState, -1),
ADD_INT(oAnimState, 1),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_surface_waves_loop),
+ CALL_NATIVE(bhv_idle_water_wave_loop),
ADD_INT(oAnimState, 1),
BEGIN_REPEAT(6),
- CALL_NATIVE(bhv_surface_waves_loop),
+ CALL_NATIVE(bhv_idle_water_wave_loop),
END_REPEAT(),
- CALL_NATIVE(bhv_surface_waves_loop),
+ CALL_NATIVE(bhv_idle_water_wave_loop),
END_LOOP(),
};
-const BehaviorScript bhvWaterSurfaceWhiteWave2[] = {
+// Water splashes similar to the splashes created by water droplets, but are created by other objects.
+// Unlike water droplet splashes, they are unimportant objects.
+const BehaviorScript bhvObjectWaterSplash[] = {
BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
#ifdef VERSION_JP
@@ -3348,41 +3355,48 @@ const BehaviorScript bhvWaterSurfaceWhiteWave2[] = {
DEACTIVATE(),
};
-const BehaviorScript bhvWavesGenerator[] = {
+// Waves that are generated when running in shallow water.
+const BehaviorScript bhvShallowWaterWave[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
DISABLE_RENDERING(),
BEGIN_REPEAT(5),
- SPAWN_WATER_SPLASH(&D_8032FE18),
+ SPAWN_WATER_DROPLET(&sShallowWaterWaveDropletParams),
END_REPEAT_CONTINUE(),
DELAY(1),
- BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_8),
+ BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_SHALLOW_WATER_WAVE),
DEACTIVATE(),
};
-const BehaviorScript bhvSurfaceWaveShrinking[] = {
+// A small water splash that occurs when jumping in and out of shallow water.
+// Unlike the larger water splash it has no visible model of its own.
+// It has a 1 in 256 chance of spawning the fish particle easter egg.
+const BehaviorScript bhvShallowWaterSplash[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
DISABLE_RENDERING(),
BEGIN_REPEAT(18),
- SPAWN_WATER_SPLASH(&D_8032FDD0),
+ SPAWN_WATER_DROPLET(&sShallowWaterSplashDropletParams),
END_REPEAT_CONTINUE(),
- CALL_NATIVE(bhv_surface_wave_shrinking_init),
+ CALL_NATIVE(bhv_shallow_water_splash_init),
DELAY(1),
- BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_12),
+ BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH),
DEACTIVATE(),
};
-const BehaviorScript bhvWaterType[] = {
+// Waves created by other objects along the water's surface, specifically the koopa shell and Sushi.
+// Unlike Mario's waves, they are unimportant objects.
+const BehaviorScript bhvObjectWaveTrail[] = {
BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- GOTO(bhvWaveTrailOnSurface + 1 + 1 + 2),
+ GOTO(bhvWaveTrail + 1 + 1 + 2), // Wave trail - common
};
-const BehaviorScript bhvWaveTrailOnSurface[] = {
+// The waves created by Mario while he is swimming.
+const BehaviorScript bhvWaveTrail[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
- BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_10),
+ BIT_CLEAR_INT32(oActiveParticleFlags, ACTIVE_PARTICLE_WAVE_TRAIL),
// Wave trail - common:
SET_FLOAT(oFaceAnglePitch, 0),
SET_FLOAT(oFaceAngleYaw, 0),
@@ -3390,41 +3404,47 @@ const BehaviorScript bhvWaveTrailOnSurface[] = {
SET_INT(oAnimState, -1),
BEGIN_REPEAT(8),
ADD_INT(oAnimState, 1),
- CALL_NATIVE(bhv_wave_trail_loop),
+ CALL_NATIVE(bhv_wave_trail_shrink),
DELAY(1),
- CALL_NATIVE(bhv_wave_trail_loop),
+ CALL_NATIVE(bhv_wave_trail_shrink),
END_REPEAT(),
DEACTIVATE(),
};
-const BehaviorScript bhvTinyWhiteWindParticle[] = {
+// Tiny wind particles that provide aesthetics to the strong winds generated by the Snowman and Fwoosh.
+// As they are unimportant objects, they don't have collision with Mario.
+const BehaviorScript bhvTinyStrongWindParticle[] = {
BEGIN(OBJ_LIST_UNIMPORTANT),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BILLBOARD(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_white_wind_particle_loop),
+ CALL_NATIVE(bhv_strong_wind_particle_loop),
END_LOOP(),
};
-const BehaviorScript bhvWindParticle[] = {
+// Strong wind particles generated by the Snowman and Fwoosh that blow Mario back and knock his cap off.
+const BehaviorScript bhvStrongWindParticle[] = {
BEGIN(OBJ_LIST_POLELIKE),
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
BILLBOARD(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_white_wind_particle_loop),
+ CALL_NATIVE(bhv_strong_wind_particle_loop),
END_LOOP(),
};
-const BehaviorScript bhvSnowmanWindBlowing[] = {
+// The handler for the strong wind blown by the Snowman in SL. Triggers dialog and then aims towards Mario.
+const BehaviorScript bhvSLSnowmanWind[] = {
BEGIN(OBJ_LIST_DEFAULT),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
SET_HOME(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_snowman_wind_blowing_loop),
+ CALL_NATIVE(bhv_sl_snowman_wind_loop),
END_LOOP(),
};
-const BehaviorScript bhvWalkingPenguin[] = {
+// The penguin that walks erratically along the ice bridge in front of the Snowman in SL.
+// Blocks strong wind particles, allowing Mario to walk behind it.
+const BehaviorScript bhvSLWalkingPenguin[] = {
BEGIN(OBJ_LIST_SURFACE),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
LOAD_COLLISION_DATA(penguin_seg5_collision_05008B88),
@@ -3434,7 +3454,7 @@ const BehaviorScript bhvWalkingPenguin[] = {
SCALE(600),
SET_HOME(),
BEGIN_LOOP(),
- CALL_NATIVE(bhv_walking_penguin_loop),
+ CALL_NATIVE(bhv_sl_walking_penguin_loop),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -3469,18 +3489,18 @@ const BehaviorScript bhvToadMessage[] = {
SET_HITBOX(/*Radius*/ 80, /*Height*/ 100),
SET_INT(oIntangibleTimer, 0),
CALL_NATIVE(bhv_init_room),
- CALL_NATIVE(bhvToadMessage_init),
+ CALL_NATIVE(bhv_toad_message_init),
BEGIN_LOOP(),
- CALL_NATIVE(bhvToadMessage_loop),
+ CALL_NATIVE(bhv_toad_message_loop),
END_LOOP(),
};
const BehaviorScript bhvUnlockDoorStar[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
- CALL_NATIVE(bhvUnlockDoorStar_init),
+ CALL_NATIVE(bhv_unlock_door_star_init),
BEGIN_LOOP(),
- CALL_NATIVE(bhvUnlockDoorStar_loop),
+ CALL_NATIVE(bhv_unlock_door_star_loop),
END_LOOP(),
};
@@ -3695,7 +3715,7 @@ const BehaviorScript bhvBobombFuseSmoke[] = {
CALL_NATIVE(bhv_bobomb_fuse_smoke_init),
DELAY(1),
BEGIN_LOOP(),
- CALL_NATIVE(BehDustSmokeLoop),
+ CALL_NATIVE(bhv_dust_smoke_loop),
ADD_INT(oAnimState, 1),
END_LOOP(),
};
@@ -3944,7 +3964,7 @@ const BehaviorScript bhvBobombBullyDeathSmoke[] = {
CALL_NATIVE(bhv_bobomb_bully_death_smoke_init),
DELAY(1),
BEGIN_LOOP(),
- CALL_NATIVE(BehDustSmokeLoop),
+ CALL_NATIVE(bhv_dust_smoke_loop),
ADD_INT(oAnimState, 1),
END_LOOP(),
};
@@ -3956,7 +3976,7 @@ const BehaviorScript bhvSmoke[] = {
SET_INT(oAnimState, -1),
DELAY(1),
BEGIN_LOOP(),
- CALL_NATIVE(BehDustSmokeLoop),
+ CALL_NATIVE(bhv_dust_smoke_loop),
ADD_INT(oAnimState, 1),
END_LOOP(),
};
@@ -4634,7 +4654,7 @@ const BehaviorScript bhvLllVolcanoFallingTrap[] = {
LOAD_COLLISION_DATA(lll_seg7_collision_falling_wall),
SET_HOME(),
BEGIN_LOOP(),
- CALL_NATIVE(bhvLllVolcanoFallingTrap_loop),
+ CALL_NATIVE(bhv_volcano_trap_loop),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -5016,7 +5036,7 @@ const BehaviorScript bhvYoshi[] = {
CALL_NATIVE(bhv_yoshi_init),
BEGIN_LOOP(),
SET_INT(oIntangibleTimer, 0),
- CALL_NATIVE(BehYoshiLoop),
+ CALL_NATIVE(bhv_yoshi_loop),
END_LOOP(),
};
@@ -5056,7 +5076,7 @@ const BehaviorScript bhvKoopaFlag[] = {
LOAD_ANIMATIONS(oAnimations, koopa_flag_seg6_anims_06001028),
ANIMATE(0),
BEGIN_LOOP(),
- CALL_NATIVE(BehClimbDetectLoop),
+ CALL_NATIVE(bhv_pole_base_loop),
END_LOOP(),
};
@@ -5422,7 +5442,7 @@ const BehaviorScript bhvTTCTreadmill[] = {
DELAY(1),
BEGIN_LOOP(),
CALL_NATIVE(bhv_ttc_treadmill_update),
- CALL_NATIVE(obj_compute_vel_xz),
+ CALL_NATIVE(cur_obj_compute_vel_xz),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -5759,7 +5779,7 @@ const BehaviorScript bhvSnufit[] = {
SET_OBJ_PHYSICS(/*Wall hitbox radius*/ 30, /*Gravity*/ 0, /*Bounciness*/ -50, /*Drag*/ 0, /*Friction*/ 0, /*Buoyancy*/ 0, /*Unused*/ 0, 0),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
- SET_INT(oSnufitUnkF4, 0),
+ SET_INT(oSnufitRecoil, 0),
CALL_NATIVE(bhv_snufit_loop),
END_LOOP(),
};
@@ -5787,7 +5807,7 @@ const BehaviorScript bhvHorizontalGrindel[] = {
SCALE(90),
CALL_NATIVE(bhv_horizontal_grindel_init),
BEGIN_LOOP(),
- CALL_NATIVE(obj_update_floor_and_walls),
+ CALL_NATIVE(cur_obj_update_floor_and_walls),
CALL_NATIVE(bhv_horizontal_grindel_update),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
@@ -5960,7 +5980,7 @@ const BehaviorScript bhvDDDPole[] = {
SET_FLOAT(oDDDPoleVel, 10),
BEGIN_LOOP(),
CALL_NATIVE(bhv_ddd_pole_update),
- CALL_NATIVE(BehClimbDetectLoop),
+ CALL_NATIVE(bhv_pole_base_loop),
END_LOOP(),
};
diff --git a/diff.py b/diff.py
diff --git a/enhancements/mem_error_screen.patch b/enhancements/mem_error_screen.patch
@@ -37,7 +37,7 @@ index 2fda11d7..8ba0a1c9 100644
+#define TEXT_PJ64 _("If you are using PJ64 1.6, go to:\nOptions > Settings > Rom Settings Tab > Memory Size\nthen select 8 MB from the drop-down box.")
+#define TEXT_PJ64_2 _("If you are using PJ64 2.X, go to:\nOptions > Settings > Config: > Memory Size, select 8 MB")
+
- #ifdef VERSION_JP
+ #if defined(VERSION_JP) || defined(VERSION_SH)
/**
diff --git a/levels/entry.c b/levels/entry.c
@@ -274,10 +274,10 @@ index 00000000..20eeef8f
+
+ addr = segmented_to_virtual(level_script_entry_error_screen);
+
-+ func_80247ED8();
++ rendering_init();
+
+ while (1) {
-+ func_80247FAC();
++ config_gfx_pool();
+ addr = level_script_execute(addr);
+ display_and_vsync();
+ }
diff --git a/extract_assets.py b/extract_assets.py
@@ -20,6 +20,8 @@ def read_local_asset_list(f):
def asset_needs_update(asset, version):
+ if version <= 5 and asset == "textures/spooky/bbh_textures.00800.rgba16.png":
+ return True
if version <= 4 and asset in ["textures/mountain/ttm_textures.01800.rgba16.png", "textures/mountain/ttm_textures.05800.rgba16.png"]:
return True
if version <= 3 and asset == "textures/cave/hmc_textures.01800.rgba16.png":
@@ -57,7 +59,7 @@ def clean_assets(local_asset_file):
def main():
# In case we ever need to change formats of generated files, we keep a
# revision ID in the local asset file.
- new_version = 5
+ new_version = 6
try:
local_asset_file = open(".assets-local.txt")
diff --git a/include/PR/os_pi.h b/include/PR/os_pi.h
@@ -6,7 +6,7 @@
/* Types */
typedef struct {
-#ifndef VERSION_EU
+#if !defined(VERSION_EU) && !defined(VERSION_SH)
u32 errStatus;
#endif
void *dramAddr;
@@ -22,7 +22,7 @@ typedef struct {
u16 blockNum; // 6
s32 sectorNum; // 8
uintptr_t devAddr; // c
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
u32 unk10; //error status added moved to blockinfo
#endif
u32 bmCtlShadow; // 10
@@ -60,7 +60,7 @@ typedef struct {
/*0x08*/ void *dramAddr;
/*0x0C*/ uintptr_t devAddr;
/*0x10*/ size_t size;
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
OSPiHandle *piHandle; // from the official definition
#endif
} OSIoMesg;
diff --git a/include/behavior_data.h b/include/behavior_data.h
@@ -211,7 +211,7 @@ extern const BehaviorScript bhvFish2[];
extern const BehaviorScript bhvFish3[];
extern const BehaviorScript bhvLargeFishGroup[];
extern const BehaviorScript bhvFishCommon[];
-extern const BehaviorScript bhvFishGroup2[];
+extern const BehaviorScript bhvFish[];
extern const BehaviorScript bhvWdwExpressElevator[];
extern const BehaviorScript bhvWdwExpressElevatorPlatform[];
extern const BehaviorScript bhvChirpChirp[];
@@ -285,19 +285,19 @@ extern const BehaviorScript bhvScuttlebugSpawn[];
extern const BehaviorScript bhvWhompKingBoss[];
extern const BehaviorScript bhvSmallWhomp[];
extern const BehaviorScript bhvWaterSplash[];
-extern const BehaviorScript bhvWaterDrops[];
-extern const BehaviorScript bhvWaterSurfaceWhiteWave[];
-extern const BehaviorScript bhvObjectBubbleRipples[];
-extern const BehaviorScript bhvSurfaceWaves[];
-extern const BehaviorScript bhvWaterSurfaceWhiteWave2[];
-extern const BehaviorScript bhvWavesGenerator[];
-extern const BehaviorScript bhvSurfaceWaveShrinking[];
-extern const BehaviorScript bhvWaterType[];
-extern const BehaviorScript bhvWaveTrailOnSurface[];
-extern const BehaviorScript bhvTinyWhiteWindParticle[];
-extern const BehaviorScript bhvWindParticle[];
-extern const BehaviorScript bhvSnowmanWindBlowing[];
-extern const BehaviorScript bhvWalkingPenguin[];
+extern const BehaviorScript bhvWaterDroplet[];
+extern const BehaviorScript bhvWaterDropletSplash[];
+extern const BehaviorScript bhvBubbleSplash[];
+extern const BehaviorScript bhvIdleWaterWave[];
+extern const BehaviorScript bhvObjectWaterSplash[];
+extern const BehaviorScript bhvShallowWaterWave[];
+extern const BehaviorScript bhvShallowWaterSplash[];
+extern const BehaviorScript bhvObjectWaveTrail[];
+extern const BehaviorScript bhvWaveTrail[];
+extern const BehaviorScript bhvTinyStrongWindParticle[];
+extern const BehaviorScript bhvStrongWindParticle[];
+extern const BehaviorScript bhvSLSnowmanWind[];
+extern const BehaviorScript bhvSLWalkingPenguin[];
extern const BehaviorScript bhvYellowBall[];
extern const BehaviorScript bhvMario[];
extern const BehaviorScript bhvToadMessage[];
diff --git a/include/eu_translation.h b/include/eu_translation.h
@@ -0,0 +1,34 @@
+#ifndef EU_TRANSLATION_H
+#define EU_TRANSLATION_H
+
+#include "types.h"
+
+// PAL changes most text to arrays for each language. This define allows these
+// differences to be combined.
+#ifdef VERSION_EU
+ #define LANGUAGE_ARRAY(cmd) cmd[LANGUAGE_FUNCTION]
+#else
+ #define LANGUAGE_ARRAY(cmd) cmd
+#endif
+
+// EU translations are contained in three segment 0x19 compressed data blocks
+extern u8 _translation_en_mio0SegmentRomStart[];
+extern u8 _translation_en_mio0SegmentRomEnd[];
+extern u8 _translation_fr_mio0SegmentRomStart[];
+extern u8 _translation_fr_mio0SegmentRomEnd[];
+extern u8 _translation_de_mio0SegmentRomStart[];
+extern u8 _translation_de_mio0SegmentRomEnd[];
+
+extern void *dialog_table_eu_en[];
+extern void *course_name_table_eu_en[];
+extern void *act_name_table_eu_en[];
+
+extern void *dialog_table_eu_fr[];
+extern void *course_name_table_eu_fr[];
+extern void *act_name_table_eu_fr[];
+
+extern void *dialog_table_eu_de[];
+extern void *course_name_table_eu_de[];
+extern void *act_name_table_eu_de[];
+
+#endif /* EU_TRANSLATION_H */
diff --git a/include/model_ids.h b/include/model_ids.h
@@ -498,10 +498,10 @@
#define MODEL_WHITE_PARTICLE 0xA0 // white_particle_dl
#define MODEL_PEBBLE 0xA1 // pebble_seg3_dl_0301CB00
#define MODEL_LEAVES 0xA2 // leaves_geo
-#define MODEL_WATER_WAVES 0xA3 // water_waves_geo
+#define MODEL_WAVE_TRAIL 0xA3 // wave_trail_geo
#define MODEL_WHITE_PARTICLE_SMALL 0xA4 // white_particle_small_dl
-#define MODEL_SPOT_ON_GROUND 0xA5 // spot_on_ground_geo
-#define MODEL_WATER_WAVES_SURF 0xA6 // water_waves_surface_geo
+#define MODEL_SMALL_WATER_SPLASH 0xA5 // small_water_splash_geo
+#define MODEL_IDLE_WATER_WAVE 0xA6 // idle_water_wave_geo
#define MODEL_WATER_SPLASH 0xA7 // water_splash_geo
#define MODEL_BUBBLE 0xA8 // bubble_geo
// find me
diff --git a/include/object_constants.h b/include/object_constants.h
@@ -106,24 +106,26 @@
OBJ_MOVE_UNDERWATER_ON_GROUND)
/* oActiveParticleFlags */
-#define ACTIVE_PARTICLE_0 0x00000001
-#define ACTIVE_PARTICLE_3 0x00000008
-#define ACTIVE_PARTICLE_4 0x00000010
-#define ACTIVE_PARTICLE_5 0x00000020
-#define ACTIVE_PARTICLE_6 0x00000040
-#define ACTIVE_PARTICLE_7 0x00000080
-#define ACTIVE_PARTICLE_8 0x00000100
-#define ACTIVE_PARTICLE_9 0x00000200
-#define ACTIVE_PARTICLE_10 0x00000400
-#define ACTIVE_PARTICLE_11 0x00000800
-#define ACTIVE_PARTICLE_12 0x00001000
-#define ACTIVE_PARTICLE_13 0x00002000
-#define ACTIVE_PARTICLE_14 0x00004000
-#define ACTIVE_PARTICLE_15 0x00008000
-#define ACTIVE_PARTICLE_16 0x00010000
-#define ACTIVE_PARTICLE_17 0x00020000
-#define ACTIVE_PARTICLE_18 0x00040000
-#define ACTIVE_PARTICLE_19 0x00080000
+#define ACTIVE_PARTICLE_0 (1 << 0) // 0x00000001
+#define ACTIVE_PARTICLE_UNUSED_1 (1 << 1) // 0x00000002
+#define ACTIVE_PARTICLE_UNUSED_2 (1 << 2) // 0x00000004
+#define ACTIVE_PARTICLE_3 (1 << 3) // 0x00000008
+#define ACTIVE_PARTICLE_4 (1 << 4) // 0x00000010
+#define ACTIVE_PARTICLE_5 (1 << 5) // 0x00000020
+#define ACTIVE_PARTICLE_6 (1 << 6) // 0x00000040
+#define ACTIVE_PARTICLE_IDLE_WATER_WAVE (1 << 7) // 0x00000080
+#define ACTIVE_PARTICLE_SHALLOW_WATER_WAVE (1 << 8) // 0x00000100
+#define ACTIVE_PARTICLE_9 (1 << 9) // 0x00000200
+#define ACTIVE_PARTICLE_WAVE_TRAIL (1 << 10) // 0x00000400
+#define ACTIVE_PARTICLE_11 (1 << 11) // 0x00000800
+#define ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH (1 << 12) // 0x00001000
+#define ACTIVE_PARTICLE_13 (1 << 13) // 0x00002000
+#define ACTIVE_PARTICLE_14 (1 << 14) // 0x00004000
+#define ACTIVE_PARTICLE_15 (1 << 15) // 0x00008000
+#define ACTIVE_PARTICLE_16 (1 << 16) // 0x00010000
+#define ACTIVE_PARTICLE_17 (1 << 17) // 0x00020000
+#define ACTIVE_PARTICLE_18 (1 << 18) // 0x00040000
+#define ACTIVE_PARTICLE_19 (1 << 19) // 0x00080000
/* oAction */
#define OBJ_ACT_LAVA_DEATH 100
@@ -197,6 +199,24 @@
#define BOBOMB_BUDDY_HAS_NOT_TALKED 0
#define BOBOMB_BUDDY_HAS_TALKED 2
+/* Fish */
+ /* oAction */
+ #define FISH_ACT_INIT 0
+ #define FISH_ACT_ACTIVE 1
+ #define FISH_ACT_RESPAWN 2
+
+/* Blue_Fish */
+ /* oAction */
+ #define BLUE_FISH_ACT_DIVE 0
+ #define BLUE_FISH_ACT_TURN 1
+ #define BLUE_FISH_ACT_ASCEND 2
+ #define BLUE_FISH_ACT_TURN_BACK 3
+
+ /* oAction: bhv_blue_fish_spawn_loop */
+ #define BLUE_FISH_ACT_SPAWN 0
+ #define BLUE_FISH_ACT_ROOM 1
+ #define BLUE_FISH_ACT_DUPLICATE 2
+
/* Cannon Trap Door */
/* oAction */
#define CANNON_TRAP_DOOR_ACT_CLOSED 0
@@ -733,10 +753,37 @@
#define PYRAMID_WALL_BP_POSITION_MIDDLE 1
#define PYRAMID_WALL_BP_POSITION_LOW 2
-/* Tuxie */
+/* Penguins (general) */
/* Walking sounds */
#define PENGUIN_WALK_BABY 0
#define PENGUIN_WALK_BIG 1
+
+ /* Animations */
+ #define PENGUIN_ANIM_WALK 0
+ #define PENGUIN_ANIM_IDLE 3
+
+/* Racing penguin */
+ /* oAction */
+ #define RACING_PENGUIN_ACT_WAIT_FOR_MARIO 0
+ #define RACING_PENGUIN_ACT_SHOW_INIT_TEXT 1
+ #define RACING_PENGUIN_ACT_PREPARE_FOR_RACE 2
+ #define RACING_PENGUIN_ACT_RACE 3
+ #define RACING_PENGUIN_ACT_FINISH_RACE 4
+ #define RACING_PENGUIN_ACT_SHOW_FINAL_TEXT 5
+
+/* SL walking penguin */
+ /* oAction */
+ #define SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS 0
+ #define SL_WALKING_PENGUIN_ACT_TURNING_BACK 1
+ #define SL_WALKING_PENGUIN_ACT_RETURNING 2
+ #define SL_WALKING_PENGUIN_ACT_TURNING_FORWARDS 3
+
+/* Snowman wind */
+ /* oSubAction */
+ #define SL_SNOWMAN_WIND_ACT_IDLE 0
+ #define SL_SNOWMAN_WIND_ACT_TALKING 1
+ #define SL_SNOWMAN_WIND_ACT_BLOWING 2
+
/* Water bomb */
/* oAction */
@@ -850,21 +897,17 @@
#define BIRD_BP_SPAWNED 0
#define BIRD_BP_SPAWNER 1
-/* Racing penguin */
- /* oAction */
- #define RACING_PENGUIN_ACT_WAIT_FOR_MARIO 0
- #define RACING_PENGUIN_ACT_SHOW_INIT_TEXT 1
- #define RACING_PENGUIN_ACT_PREPARE_FOR_RACE 2
- #define RACING_PENGUIN_ACT_RACE 3
- #define RACING_PENGUIN_ACT_FINISH_RACE 4
- #define RACING_PENGUIN_ACT_SHOW_FINAL_TEXT 5
-
/* Skeeter */
/* oAction */
#define SKEETER_ACT_IDLE 0
#define SKEETER_ACT_LUNGE 1
#define SKEETER_ACT_WALK 2
+/* Snufit */
+ /* oAction */
+ #define SNUFIT_ACT_IDLE 0
+ #define SNUFIT_ACT_SHOOT 1
+
/* Tweester */
/* oAction */
#define TWEESTER_ACT_IDLE 0
diff --git a/include/object_fields.h b/include/object_fields.h
@@ -483,19 +483,19 @@
#define /*0x0F4*/ oFireSpitterScaleVel OBJECT_FIELD_F32(0x1B)
/* Blue Fish */
-#define /*0x0F4*/ oBlueFishUnkF4 OBJECT_FIELD_F32(0x1B)
-#define /*0x0F8*/ oBlueFishUnkF8 OBJECT_FIELD_S32(0x1C)
-#define /*0x100*/ oBlueFishUnk100 OBJECT_FIELD_F32(0x1E)
+#define /*0x0F4*/ oBlueFishRandomVel OBJECT_FIELD_F32(0x1B)
+#define /*0x0F8*/ oBlueFishRandomTime OBJECT_FIELD_S32(0x1C)
+#define /*0x100*/ oBlueFishRandomAngle OBJECT_FIELD_F32(0x1E)
/* Fish Group */
-#define /*0x0F4*/ oFishGroupUnkF4 OBJECT_FIELD_F32(0x1B)
-#define /*0x0F8*/ oFishGroupUnkF8 OBJECT_FIELD_F32(0x1C)
-#define /*0x0FC*/ oFishGroupUnkFC OBJECT_FIELD_F32(0x1D)
-#define /*0x100*/ oFishGroupUnk100 OBJECT_FIELD_S32(0x1E)
-#define /*0x104*/ oFishGroupUnk104 OBJECT_FIELD_F32(0x1F)
-#define /*0x108*/ oFishGroupUnk108 OBJECT_FIELD_F32(0x20)
-#define /*0x10C*/ oFishGroupUnk10C OBJECT_FIELD_F32(0x21)
-#define /*0x110*/ oFishGroupUnk110 OBJECT_FIELD_F32(0x22)
+#define /*0x0F4*/ oFishWaterLevel OBJECT_FIELD_F32(0x1B)
+#define /*0x0F8*/ oFishPosY OBJECT_FIELD_F32(0x1C)
+#define /*0x0FC*/ oFishRandomOffset OBJECT_FIELD_F32(0x1D)
+#define /*0x100*/ oFishRandomSpeed OBJECT_FIELD_S32(0x1E)
+#define /*0x104*/ oFishRespawnDistance OBJECT_FIELD_F32(0x1F)
+#define /*0x108*/ oFishRandomVel OBJECT_FIELD_F32(0x20)
+#define /*0x10C*/ oFishDepthDistance OBJECT_FIELD_F32(0x21)
+#define /*0x110*/ oFishActiveDistance OBJECT_FIELD_F32(0x22)
/* Flame */
#define /*0x0F4*/ oFlameUnkF4 OBJECT_FIELD_F32(0x1B)
@@ -752,11 +752,11 @@
#define /*0x108*/ oSmallPenguinUnk108 OBJECT_FIELD_F32(0x20)
#define /*0x110*/ oSmallPenguinUnk110 OBJECT_FIELD_S32(0x22)
-/* Walking Penguin */
-#define /*0x100*/ oWalkingPenguinUnk100 OBJECT_FIELD_F32(0x1E)
-#define /*0x104*/ oWalkingPenguinUnk104 OBJECT_FIELD_F32(0x1F)
-#define /*0x10C*/ oWalkingPenguinUnk10C OBJECT_FIELD_S32(0x21)
-#define /*0x110*/ oWalkingPenguinUnk110 OBJECT_FIELD_S32(0x22)
+/* SL Walking Penguin */
+#define /*0x100*/ oSLWalkingPenguinWindCollisionXPos OBJECT_FIELD_F32(0x1E)
+#define /*0x104*/ oSLWalkingPenguinWindCollisionZPos OBJECT_FIELD_F32(0x1F)
+#define /*0x10C*/ oSLWalkingPenguinCurStep OBJECT_FIELD_S32(0x21)
+#define /*0x110*/ oSLWalkingPenguinCurStepTimer OBJECT_FIELD_S32(0x22)
/* Piranha Plant */
#define /*0x0F4*/ oPiranhaPlantSleepMusicState OBJECT_FIELD_S32(0x1B)
@@ -884,19 +884,19 @@
#define /*0x0F4*/ oSnowmansHeadUnkF4 OBJECT_FIELD_S32(0x1B)
/* Snowman Wind Blowing */
-#define /*0x0F4*/ oSnowmanWindBlowingUnkF4 OBJECT_FIELD_S32(0x1B)
+#define /*0x0F4*/ oSLSnowmanWindOriginalYaw OBJECT_FIELD_S32(0x1B)
/* Snufit */
-#define /*0x0F4*/ oSnufitUnkF4 OBJECT_FIELD_S32(0x1B)
-#define /*0x0F8*/ oSnufitUnkF8 OBJECT_FIELD_F32(0x1C)
-#define /*0x100*/ oSnufitUnk100 OBJECT_FIELD_S32(0x1E)
-#define /*0x104*/ oSnufitUnk104 OBJECT_FIELD_S32(0x1F)
-#define /*0x108*/ oSnufitUnk108 OBJECT_FIELD_S32(0x20)
-#define /*0x10C*/ oSnufitUnk10C OBJECT_FIELD_S32(0x21)
-#define /*0x1AC*/ oSnufitUnk1AC OBJECT_FIELD_S16(0x49, 0)
-#define /*0x1AE*/ oSnufitUnk1AE OBJECT_FIELD_S16(0x49, + 1)
-#define /*0x1B0*/ oSnufitUnk1B0 OBJECT_FIELD_S16(0x4A, 0)
-#define /*0x1B2*/ oSnufitUnk1B2 OBJECT_FIELD_S16(0x4A, + 1)
+#define /*0x0F4*/ oSnufitRecoil OBJECT_FIELD_S32(0x1B)
+#define /*0x0F8*/ oSnufitScale OBJECT_FIELD_F32(0x1C)
+#define /*0x100*/ oSnufitCircularPeriod OBJECT_FIELD_S32(0x1E)
+#define /*0x104*/ oSnufitBodyScalePeriod OBJECT_FIELD_S32(0x1F)
+#define /*0x108*/ oSnufitBodyBaseScale OBJECT_FIELD_S32(0x20)
+#define /*0x10C*/ oSnufitBullets OBJECT_FIELD_S32(0x21)
+#define /*0x1AC*/ oSnufitXOffset OBJECT_FIELD_S16(0x49, 0)
+#define /*0x1AE*/ oSnufitYOffset OBJECT_FIELD_S16(0x49, + 1)
+#define /*0x1B0*/ oSnufitZOffset OBJECT_FIELD_S16(0x4A, 0)
+#define /*0x1B2*/ oSnufitBodyScale OBJECT_FIELD_S16(0x4A, + 1)
/* Spindel */
#define /*0x0F4*/ oSpindelUnkF4 OBJECT_FIELD_S32(0x1B)
@@ -1118,7 +1118,7 @@
#define /*0x0F8*/ oWaterRingMgrLastRingCollected OBJECT_FIELD_S32(0x1C)
/* Wave Trail */
-#define /*0x0F8*/ oWaveTrailUnkF8 OBJECT_FIELD_F32(0x1C)
+#define /*0x0F8*/ oWaveTrailSize OBJECT_FIELD_F32(0x1C)
/* Whirlpool */
#define /*0x0F4*/ oWhirlpoolInitFacePitch OBJECT_FIELD_S32(0x1B)
@@ -1130,7 +1130,7 @@
#define /*0x0FC*/ oWhitePuffUnkFC OBJECT_FIELD_S32(0x1D)
/* White Wind Particle */
-#define /*0x0F4*/ oWhiteWindParticleUnkF4 OBJECT_FIELD_OBJ(0x1B)
+#define /*0x0F4*/ oStrongWindParticlePenguinObj OBJECT_FIELD_OBJ(0x1B)
/* Whomp */
#define /*0x0F8*/ oWhompUnkF8 OBJECT_FIELD_S32(0x1C)
diff --git a/include/segments.h b/include/segments.h
@@ -22,6 +22,8 @@
#ifdef VERSION_EU
#define SEG_MAIN 0x80241800 // TODO: Investigate why it's different?
+#elif defined(VERSION_SH)
+#define SEG_MAIN 0x80249000
#else
#define SEG_MAIN 0x80246000
#endif
diff --git a/include/sm64.h b/include/sm64.h
@@ -88,26 +88,26 @@
#define WATER_STEP_CANCELLED 3
#define WATER_STEP_HIT_WALL 4
-#define PARTICLE_DUST /* 0x00000001 */ (1 << 0)
-#define PARTICLE_1 /* 0x00000002 */ (1 << 1)
-#define PARTICLE_2 /* 0x00000004 */ (1 << 2)
-#define PARTICLE_SPARKLES /* 0x00000008 */ (1 << 3)
-#define PARTICLE_4 /* 0x00000010 */ (1 << 4)
-#define PARTICLE_5 /* 0x00000020 */ (1 << 5)
-#define PARTICLE_6 /* 0x00000040 */ (1 << 6)
-#define PARTICLE_7 /* 0x00000080 */ (1 << 7)
-#define PARTICLE_8 /* 0x00000100 */ (1 << 8)
-#define PARTICLE_9 /* 0x00000200 */ (1 << 9)
-#define PARTICLE_10 /* 0x00000400 */ (1 << 10)
-#define PARTICLE_11 /* 0x00000800 */ (1 << 11)
-#define PARTICLE_12 /* 0x00001000 */ (1 << 12)
-#define PARTICLE_LEAVES /* 0x00002000 */ (1 << 13)
-#define PARTICLE_14 /* 0x00004000 */ (1 << 14)
-#define PARTICLE_15 /* 0x00008000 */ (1 << 15)
-#define PARTICLE_16 /* 0x00010000 */ (1 << 16)
-#define PARTICLE_17 /* 0x00020000 */ (1 << 17)
-#define PARTICLE_18 /* 0x00040000 */ (1 << 18)
-#define PARTICLE_19 /* 0x00080000 */ (1 << 19)
+#define PARTICLE_DUST /* 0x00000001 */ (1 << 0)
+#define PARTICLE_1 /* 0x00000002 */ (1 << 1)
+#define PARTICLE_2 /* 0x00000004 */ (1 << 2)
+#define PARTICLE_SPARKLES /* 0x00000008 */ (1 << 3)
+#define PARTICLE_4 /* 0x00000010 */ (1 << 4)
+#define PARTICLE_5 /* 0x00000020 */ (1 << 5)
+#define PARTICLE_WATER_SPLASH /* 0x00000040 */ (1 << 6)
+#define PARTICLE_IDLE_WATER_WAVE /* 0x00000080 */ (1 << 7)
+#define PARTICLE_SHALLOW_WATER_WAVE /* 0x00000100 */ (1 << 8)
+#define PARTICLE_9 /* 0x00000200 */ (1 << 9)
+#define PARTICLE_WAVE_TRAIL /* 0x00000400 */ (1 << 10)
+#define PARTICLE_11 /* 0x00000800 */ (1 << 11)
+#define PARTICLE_SHALLOW_WATER_SPLASH /* 0x00001000 */ (1 << 12)
+#define PARTICLE_LEAVES /* 0x00002000 */ (1 << 13)
+#define PARTICLE_14 /* 0x00004000 */ (1 << 14)
+#define PARTICLE_15 /* 0x00008000 */ (1 << 15)
+#define PARTICLE_16 /* 0x00010000 */ (1 << 16)
+#define PARTICLE_17 /* 0x00020000 */ (1 << 17)
+#define PARTICLE_18 /* 0x00040000 */ (1 << 18)
+#define PARTICLE_19 /* 0x00080000 */ (1 << 19)
#define MODEL_STATE_NOISE_ALPHA 0x180
#define MODEL_STATE_METAL 0x200
diff --git a/include/text_strings.h.in b/include/text_strings.h.in
@@ -25,7 +25,7 @@
#define TEXT_PAUSE _("PAUSE") // Pause text, Castle Courses
#define TEXT_HUD_CONGRATULATIONS _("CONGRATULATIONS") // Course Complete Text, Bowser Courses
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
/**
* File Select Text
diff --git a/levels/bbh/areas/1/geo.inc.c b/levels/bbh/areas/1/geo.inc.c
@@ -517,7 +517,7 @@ const GeoLayout geo_bbh_000F00[] = {
GEO_BRANCH(1, geo_bbh_000EB0), // 0x0E000EB0
GEO_CLOSE_NODE(),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bitdw/areas/1/geo.inc.c b/levels/bitdw/areas/1/geo.inc.c
@@ -17,7 +17,7 @@ const GeoLayout geo_bitdw_000618[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, bitdw_seg7_dl_070020C8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bitfs/areas/1/geo.inc.c b/levels/bitfs/areas/1/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout bitfs_geo_0007A0[] = {
GEO_ASM(0x1902, geo_movtex_draw_nocolor),
GEO_ASM(0x1903, geo_movtex_draw_nocolor),
GEO_RENDER_OBJ(),
- GEO_ASM( 12, geo_enfvx_main),
+ GEO_ASM( 12, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bits/areas/1/geo.inc.c b/levels/bits/areas/1/geo.inc.c
@@ -17,7 +17,7 @@ const GeoLayout bits_geo_000718[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_ALPHA, bits_seg7_dl_07002918),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bob/areas/1/geo.inc.c b/levels/bob/areas/1/geo.inc.c
@@ -22,7 +22,7 @@ const GeoLayout bob_geo_000488[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, bob_seg7_dl_0700DD18),
GEO_DISPLAY_LIST(LAYER_OPAQUE, bob_seg7_dl_0700E338),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bowser_1/areas/1/geo.inc.c b/levels/bowser_1/areas/1/geo.inc.c
@@ -17,7 +17,7 @@ const GeoLayout bowser_1_geo_0000D0[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, bowser_1_seg7_dl_07002768),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bowser_2/areas/1/geo.inc.c b/levels/bowser_2/areas/1/geo.inc.c
@@ -17,7 +17,7 @@ const GeoLayout bowser_2_geo_000188[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, bowser_2_seg7_dl_07001930),
GEO_RENDER_OBJ(),
- GEO_ASM(12, geo_enfvx_main),
+ GEO_ASM(12, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/bowser_3/areas/1/geo.inc.c b/levels/bowser_3/areas/1/geo.inc.c
@@ -17,7 +17,7 @@ const GeoLayout bowser_3_geo_000398[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, bowser_3_seg7_dl_070046B0),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_courtyard/areas/1/geo.inc.c b/levels/castle_courtyard/areas/1/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout castle_courtyard_geo_000218[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x2601, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_grounds/areas/1/geo.inc.c b/levels/castle_grounds/areas/1/geo.inc.c
@@ -26,7 +26,7 @@ const GeoLayout castle_grounds_geo_00073C[] = {
GEO_ASM(0x1601, geo_movtex_draw_nocolor),
GEO_ASM(0x1601, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_inside/areas/1/geo.inc.c b/levels/castle_inside/areas/1/geo.inc.c
@@ -48,8 +48,8 @@ const GeoLayout castle_geo_000FD0[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07032FC0),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07033158),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(256, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(0, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -61,8 +61,8 @@ const GeoLayout castle_geo_001000[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07034D88),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07035178),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07035288),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(258, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(2, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -77,8 +77,8 @@ const GeoLayout castle_geo_001038[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07037DE8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, dl_castle_aquarium_light),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07038350),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(259, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(3, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -91,8 +91,8 @@ const GeoLayout castle_geo_001088[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_0703A808),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070234C0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07023520),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(257, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(1, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -172,8 +172,8 @@ const GeoLayout castle_geo_001200[] = {
GEO_ASM( 0, geo_exec_inside_castle_light),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07032FC0),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07033158),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(256, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(256, geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -191,8 +191,8 @@ const GeoLayout castle_geo_001260[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07034D88),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07035178),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07035288),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(258, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(258, geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -213,8 +213,8 @@ const GeoLayout castle_geo_0012C8[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07037DE8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, dl_castle_aquarium_light),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07038350),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(259, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(3, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -233,8 +233,8 @@ const GeoLayout castle_geo_001348[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_0703A808),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070234C0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07023520),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(257, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(1, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -292,7 +292,7 @@ const GeoLayout castle_geo_001400[] = {
GEO_BRANCH(1, castle_geo_0013B8), // 0x0E0013B8
GEO_CLOSE_NODE(),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_inside/areas/2/geo.inc.c b/levels/castle_inside/areas/2/geo.inc.c
@@ -14,9 +14,9 @@ const GeoLayout castle_geo_001578[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07043028),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07043B48),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07043CD8),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(264, Geo18_802D5B98),
- GEO_ASM(266, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(8, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(10, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -28,8 +28,8 @@ const GeoLayout castle_geo_0015B8[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704A0E8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_0704A2E0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704AA98),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(268, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(12, 1), geo_painting_draw),
GEO_ASM( 0, geo_render_mirror_mario),
GEO_CLOSE_NODE(),
GEO_RETURN(),
@@ -40,9 +40,9 @@ const GeoLayout castle_geo_0015F8[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704C7D8),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(265, Geo18_802D5B98),
- GEO_ASM(269, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(9, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(13, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -55,8 +55,8 @@ const GeoLayout castle_geo_001628[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07051678),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_070519C8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07051B60),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(267, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(11, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -80,9 +80,9 @@ const GeoLayout castle_geo_001690[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07043028),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07043B48),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07043CD8),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(264, Geo18_802D5B98),
- GEO_ASM(266, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(8, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(10, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -97,10 +97,10 @@ const GeoLayout castle_geo_0016D8[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704A0E8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_0704A2E0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704AA98),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(264, Geo18_802D5B98),
- GEO_ASM(266, Geo18_802D5B98),
- GEO_ASM(268, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(8, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(10, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(12, 1), geo_painting_draw),
GEO_ASM( 0, geo_render_mirror_mario),
GEO_CLOSE_NODE(),
GEO_RETURN(),
@@ -114,11 +114,11 @@ const GeoLayout castle_geo_001740[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07043B48),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07043CD8),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_0704C7D8),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(264, Geo18_802D5B98),
- GEO_ASM(265, Geo18_802D5B98),
- GEO_ASM(266, Geo18_802D5B98),
- GEO_ASM(269, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(8, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(9, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(10, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(13, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -134,10 +134,10 @@ const GeoLayout castle_geo_001798[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07051678),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_070519C8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07051B60),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(264, Geo18_802D5B98),
- GEO_ASM(266, Geo18_802D5B98),
- GEO_ASM(267, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(8, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(10, 1), geo_painting_draw),
+ GEO_ASM(PAINTING_ID(11, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -153,8 +153,8 @@ const GeoLayout castle_geo_001800[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070558D0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070572A0),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07057F00),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(267, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(11, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -191,7 +191,7 @@ const GeoLayout castle_geo_001858[] = {
GEO_BRANCH(1, castle_geo_001800), // 0x0E001800
GEO_CLOSE_NODE(),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_inside/areas/3/geo.inc.c b/levels/castle_inside/areas/3/geo.inc.c
@@ -15,9 +15,9 @@ const GeoLayout castle_geo_001980[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070616E8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07061C20),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 260, Geo18_802D5B98),
- GEO_ASM( 261, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM( PAINTING_ID(4, 1), geo_painting_draw),
+ GEO_ASM( PAINTING_ID(5, 1), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0600, geo_movtex_draw_water_regions),
GEO_CLOSE_NODE(),
@@ -30,8 +30,8 @@ const GeoLayout castle_geo_0019C8[] = {
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07064B78),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07064D58),
- GEO_ASM(0, Geo18_802D5D0C),
- GEO_ASM(262, Geo18_802D5B98),
+ GEO_ASM(0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(6, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -54,8 +54,8 @@ const GeoLayout castle_geo_001A30[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07068850),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(263, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(7, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -69,9 +69,9 @@ const GeoLayout castle_geo_001A58[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_0705E450),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_070616E8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07061C20),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 260, Geo18_802D5B98),
- GEO_ASM( 261, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM( PAINTING_ID(4, 1), geo_painting_draw),
+ GEO_ASM( PAINTING_ID(5, 1), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0600, geo_movtex_draw_water_regions),
GEO_CLOSE_NODE(),
@@ -86,8 +86,8 @@ const GeoLayout castle_geo_001AB8[] = {
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_0705E2A0),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_0705E450),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07068850),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM(263, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(7, 1), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -117,9 +117,9 @@ const GeoLayout castle_geo_001B48[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07066CE0),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07066E90),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07066FA0),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 260, Geo18_802D5B98),
- GEO_ASM( 261, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM( PAINTING_ID(4, 1), geo_painting_draw),
+ GEO_ASM( PAINTING_ID(5, 1), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0600, geo_movtex_draw_water_regions),
GEO_ASM(0x0612, geo_movtex_draw_water_regions),
@@ -135,10 +135,10 @@ const GeoLayout castle_geo_001BB0[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, inside_castle_seg7_dl_07061C20),
GEO_DISPLAY_LIST(LAYER_OPAQUE, inside_castle_seg7_dl_07064B78),
GEO_DISPLAY_LIST(LAYER_ALPHA, inside_castle_seg7_dl_07064D58),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 260, Geo18_802D5B98),
- GEO_ASM( 261, Geo18_802D5B98),
- GEO_ASM( 262, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM( PAINTING_ID(4, 1), geo_painting_draw),
+ GEO_ASM( PAINTING_ID(5, 1), geo_painting_draw),
+ GEO_ASM( PAINTING_ID(6, 1), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0600, geo_movtex_draw_water_regions),
GEO_CLOSE_NODE(),
@@ -176,7 +176,7 @@ const GeoLayout castle_geo_001C10[] = {
GEO_BRANCH(1, castle_geo_001BB0), // 0x0E001BB0
GEO_CLOSE_NODE(),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/castle_inside/painting.inc.c b/levels/castle_inside/painting.inc.c
@@ -98,8 +98,10 @@ static const Gfx inside_castle_seg7_painting_dl_07021AC0[] = {
};
// 0x07021AE0 - 0x07021FFA
-static const PaintingData inside_castle_seg7_painting_points_07021AE0[] = {
- 85,
+static const PaintingData inside_castle_seg7_painting_texture_map_bottom_07021AE0[] = {
+ 85, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
49, 2016, 889,
53, 2016, 685,
55, 1843, 787,
@@ -186,8 +188,9 @@ static const PaintingData inside_castle_seg7_painting_points_07021AE0[] = {
150, 649, 0,
153, -32, 0,
-// inside_castle_seg7_painting_triangles_07021CE0:
- 132,
+ 132, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
13, 8, 5,
0, 1, 2,
3, 0, 4,
@@ -324,8 +327,10 @@ static const PaintingData inside_castle_seg7_painting_points_07021AE0[] = {
// 0x07021FFC - 0x07022516
-static const PaintingData inside_castle_seg7_painting_points_07021FFC[] = {
- 85,
+static const PaintingData inside_castle_seg7_painting_texture_map_top_07021FFC[] = {
+ 85, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
0, 2016, 72,
1, 2016, 0,
2, 1843, 0,
@@ -412,8 +417,9 @@ static const PaintingData inside_castle_seg7_painting_points_07021FFC[] = {
152, -32, 685,
153, -32, 992,
-// inside_castle_seg7_painting_triangles_070221FC:
- 132,
+ 132, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
10, 7, 13,
0, 1, 2,
3, 0, 2,
@@ -550,9 +556,9 @@ static const PaintingData inside_castle_seg7_painting_points_07021FFC[] = {
// 0x07022518
-static const PaintingData *const inside_castle_seg7_painting_data_07022518[] = {
- inside_castle_seg7_painting_points_07021AE0,
- inside_castle_seg7_painting_points_07021FFC,
+static const PaintingData *const inside_castle_seg7_painting_texture_maps_07022518[] = {
+ inside_castle_seg7_painting_texture_map_bottom_07021AE0,
+ inside_castle_seg7_painting_texture_map_top_07021FFC,
};
UNUSED static const u64 castle_inside_unused_0 = 0x0;
@@ -619,8 +625,10 @@ static const Gfx inside_castle_seg7_painting_dl_07022640[] = {
};
// 0x07022660 - 0x07023042
-static const PaintingData inside_castle_seg7_painting_points_07022660[] = {
- 157,
+static const PaintingData inside_castle_seg7_painting_env_map_texture_map_07022660[] = {
+ 157, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
0, 6100, -4832,
1, 6100, -5142,
2, 5582, -5142,
@@ -780,7 +788,9 @@ static const PaintingData inside_castle_seg7_painting_points_07022660[] = {
156, 0, 990,
// inside_castle_seg7_painting_triangles_07022A10:
- 264,
+ 264, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
8, 12, 13,
0, 1, 2,
3, 0, 2,
@@ -1049,8 +1059,8 @@ static const PaintingData inside_castle_seg7_painting_points_07022660[] = {
// 0x07023044 - 0x07023048
-static const PaintingData *const inside_castle_seg7_painting_data_07023044[] = {
- inside_castle_seg7_painting_points_07022660,
+static const PaintingData *const inside_castle_seg7_painting_env_map_texture_maps_07023044[] = {
+ inside_castle_seg7_painting_env_map_texture_map_07022660,
};
UNUSED static const u64 castle_inside_unused_1 = 0x0;
@@ -1345,335 +1355,377 @@ static const u8 *const inside_castle_seg7_painting_textures_07023618[] = {
// 0x07023620 - 0x07023698
struct Painting bob_painting = {
/* id */ 0x0000,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 90.0f,
/* Position */ -5222.4f, 409.6f, -153.6f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023050,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235C0,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023050,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235C0,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023698 - 0x07023710
struct Painting ccm_painting = {
/* id */ 0x0001,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ -2611.2f, -307.2f, -4352.0f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070230B0,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235C8,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070230B0,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235C8,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023710 - 0x07023788
struct Painting wf_painting = {
/* id */ 0x0002,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ -51.2f, -204.8f, -4505.6f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023110,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235D0,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023110,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235D0,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023788 - 0x07023800
struct Painting jrb_painting = {
/* id */ 0x0003,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 270.0f,
/* Position */ 4300.8f, 409.6f, -537.6f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023170,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235D8,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023170,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235D8,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023800 - 0x07023878
struct Painting lll_painting = {
/* id */ 0x0004,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ -1689.6f, -1126.4f, -3942.4f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070231D0,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235E0,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070231D0,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235E0,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023878 - 0x070238F0
struct Painting ssl_painting = {
/* id */ 0x0005,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 180.0f,
/* Position */ -2611.2f, -1177.6f, -1075.2f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023230,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235E8,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023230,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235E8,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x070238F0 - 0x07023968
struct Painting hmc_painting = {
/* id */ 0x000E,
- /* Face Count */ 0x01,
- /* Ripple Shape */ RIPPLE_SHAPE_CONCENTRIC,
+ /* Image Count */ 0x01,
+ /* Texture Type */ PAINTING_ENV_MAP,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 270.0f, 0.0f,
/* Position */ 2099.2f, -1484.8f, -2278.4f,
+ /* curr passive entry */
/* Ripple Magnitude */ 0.0f, 10.0f, 30.0f,
- 1.0f, 1.0f, 0.98f,
- 0.0f, 0.05f, 0.05f,
- 0.0f, 15.0f, 15.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023580,
- inside_castle_seg7_painting_data_07023044,
- inside_castle_seg7_painting_textures_070235F0,
- 32, 32,
- inside_castle_seg7_painting_dl_07022640,
- RIPPLE_TRIGGER_CONTINUOUS, 0xFF, 0x00, 0x00, 0x00,
- 768.0f,
+ /* Ripple Decay */ 1.0f, 1.0f, 0.98f,
+ /* Ripple Rate */ 0.0f, 0.05f, 0.05f,
+ /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023580,
+ /* Texture Maps */ inside_castle_seg7_painting_env_map_texture_maps_07023044,
+ /* Textures */ inside_castle_seg7_painting_textures_070235F0,
+ /* Texture w, h */ 32, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07022640,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 768.0f,
};
// 0x07023968 - 0x070239E0
struct Painting ddd_painting = {
/* id */ 0x0007,
- /* Face Count */ 0x01,
- /* Ripple Shape */ RIPPLE_SHAPE_CONCENTRIC,
+ /* Image Count */ 0x01,
+ /* Texture Type */ PAINTING_ENV_MAP,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 270.0f,
/* Position */ 3456.0f, -1075.2f, 1587.2f,
- /* Ripple Magnitude */ 0.0f, 10.0f, 30.0f,
- 1.0f, 1.0f, 0.98f,
- 0.0f, 0.05f, 0.05f,
- 0.0f, 15.0f, 15.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070235B8,
- inside_castle_seg7_painting_data_07023044,
- inside_castle_seg7_painting_textures_070235F4,
- 32, 32,
- inside_castle_seg7_painting_dl_07022640,
- RIPPLE_TRIGGER_CONTINUOUS, 0xB4, 0x00, 0x00, 0x00,
- 819.2f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 10.0f, 30.0f,
+ /* Ripple Decay */ 1.0f, 1.0f, 0.98f,
+ /* Ripple Rate */ 0.0f, 0.05f, 0.05f,
+ /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070235B8,
+ /* Texture Maps */ inside_castle_seg7_painting_env_map_texture_maps_07023044,
+ /* Textures */ inside_castle_seg7_painting_textures_070235F4,
+ /* Texture w, h */ 32, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07022640,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS,
+ /* Alpha */ 0xB4,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 819.2f,
};
// 0x070239E0 - 0x07023A58
struct Painting wdw_painting = {
/* id */ 0x0008,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ -966.656f, 1305.6f, -143.36f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023290,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_070235F8,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 614.0f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023290,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_070235F8,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 614.0f,
};
// 0x07023A58 - 0x07023AD0
struct Painting thi_tiny_painting = {
/* id */ 0x0009,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 180.0f,
/* Position */ -4598.7842f, 1354.752f, 3005.44f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070232F0,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_07023600,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 393.216f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070232F0,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_07023600,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 393.216f,
};
// 0x07023AD0 - 0x07023B48
struct Painting ttm_painting = {
/* id */ 0x000A,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 180.0f,
/* Position */ -546.816f, 1356.8f, 3813.376f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023350,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_07023608,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 256.0f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023350,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_07023608,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 256.0f,
};
// 0x07023B48 - 0x07023BC0
struct Painting ttc_painting = {
/* id */ 0x000B,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 180.0f,
/* Position */ 0.0f, 2713.6f, 7232.5122f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070233B0,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_07023610,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 409.6f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070233B0,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_07023610,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 409.6f,
};
// 0x07023BC0 - 0x07023C38
struct Painting sl_painting = {
/* id */ 0x000C,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ 3179.52f, 1408.0f, -271.36f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_07023410,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_07023618,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 716.8f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_07023410,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_07023618,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 716.8f,
};
// 0x07023C38 - 0x07023CB0
struct Painting thi_huge_painting = {
/* id */ 0x000D,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 0.0f,
/* Position */ -5614.5918f, 1510.4f, -3292.16f,
- /* Ripple Magnitude */ 0.0f, 40.0f, 160.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.12f, 0.07f,
- 0.0f, 80.0f, 60.0f,
- 0.0f,
- 0.0f, 0.0f,
- inside_castle_seg7_painting_dl_070232F0,
- inside_castle_seg7_painting_data_07022518,
- inside_castle_seg7_painting_textures_07023600,
- 64, 32,
- inside_castle_seg7_painting_dl_07021AC0,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 1638.4f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 40.0f, 160.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.12f, 0.07f,
+ /* Ripple Dispersion */ 0.0f, 80.0f, 60.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ inside_castle_seg7_painting_dl_070232F0,
+ /* Texture Maps */ inside_castle_seg7_painting_texture_maps_07022518,
+ /* Textures */ inside_castle_seg7_painting_textures_07023600,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ inside_castle_seg7_painting_dl_07021AC0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 1638.4f,
};
diff --git a/levels/ccm/areas/1/geo.inc.c b/levels/ccm/areas/1/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout ccm_geo_00051C[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0501, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 1, geo_enfvx_main),
+ GEO_ASM( 1, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ccm/areas/2/geo.inc.c b/levels/ccm/areas/2/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout ccm_geo_0005E8[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, ccm_seg7_dl_0701FE60),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, ccm_seg7_dl_070207F0),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/cotmc/areas/1/geo.inc.c b/levels/cotmc/areas/1/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout cotmc_geo_0001A0[] = {
GEO_ASM(0x2801, geo_movtex_draw_nocolor),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, cotmc_seg7_dl_0700A4B8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ddd/areas/1/geo.inc.c b/levels/ddd/areas/1/geo.inc.c
@@ -22,7 +22,7 @@ const GeoLayout ddd_geo_0004C0[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x2301, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 13, geo_enfvx_main),
+ GEO_ASM( 13, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ddd/areas/2/geo.inc.c b/levels/ddd/areas/2/geo.inc.c
@@ -24,7 +24,7 @@ const GeoLayout ddd_geo_000570[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x2302, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 14, geo_enfvx_main),
+ GEO_ASM( 14, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/hmc/areas/1/geo.inc.c b/levels/hmc/areas/1/geo.inc.c
@@ -83,8 +83,8 @@ const GeoLayout hmc_geo_000748[] = {
GEO_NODE_START(),
GEO_OPEN_NODE(),
GEO_DISPLAY_LIST(LAYER_OPAQUE, hmc_seg7_dl_07020FD0),
- GEO_ASM(0, Geo18_802D5D0C),
- GEO_ASM(0, Geo18_802D5B98),
+ GEO_ASM(0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(0, 0), geo_painting_draw),
GEO_CLOSE_NODE(),
GEO_RETURN(),
};
@@ -246,8 +246,8 @@ const GeoLayout hmc_geo_000A88[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, hmc_seg7_dl_0701F818),
GEO_DISPLAY_LIST(LAYER_OPAQUE, hmc_seg7_dl_0701FD58),
GEO_DISPLAY_LIST(LAYER_OPAQUE, hmc_seg7_dl_07020FD0),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 0, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM( PAINTING_ID(0, 0), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x0701, geo_movtex_draw_water_regions),
GEO_CLOSE_NODE(),
@@ -326,7 +326,7 @@ const GeoLayout hmc_geo_000B90[] = {
GEO_BRANCH(1, hmc_geo_000B48), // 0x0E000B48
GEO_CLOSE_NODE(),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/hmc/areas/1/painting.inc.c b/levels/hmc/areas/1/painting.inc.c
@@ -61,8 +61,10 @@ static const Gfx hmc_seg7_painting_dl_070242D0[] = {
};
// 0x070242F0 - 0x07024CD2
-static const PaintingData hmc_seg7_pool_points_070242F0[] = {
- 157,
+static const PaintingData hmc_seg7_pool_texture_map_070242F0[] = {
+ 157, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
0, 6100, -4832,
1, 6100, -5142,
2, 5582, -5142,
@@ -221,8 +223,9 @@ static const PaintingData hmc_seg7_pool_points_070242F0[] = {
155, 0, 70,
156, 0, 990,
-// hmc_seg7_triangles_070246A0:
- 264,
+ 264, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
8, 12, 13,
0, 1, 2,
3, 0, 2,
@@ -490,8 +493,8 @@ static const PaintingData hmc_seg7_pool_points_070242F0[] = {
};
// 0x07024CD4
-static const PaintingData *const hmc_seg7_painting_data_07024CD4[] = {
- hmc_seg7_pool_points_070242F0,
+static const PaintingData *const hmc_seg7_painting_texture_maps_07024CD4[] = {
+ hmc_seg7_pool_texture_map_070242F0,
};
UNUSED static const u64 hmc_unused_0 = 0;
@@ -520,23 +523,26 @@ const u8 *const hmc_seg7_painting_textures_07025518[] = {
// 0x0702551C (PaintingData)
struct Painting cotmc_painting = {
/* id */ 0x000E,
- /* Face Count */ 0x01,
- /* Ripple Shape */ RIPPLE_SHAPE_CONCENTRIC,
+ /* Image Count */ 0x01,
+ /* Texture Type */ PAINTING_ENV_MAP,
/* Floor Status */ 0x00, 0x00 , 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 270.0f, 0.0f,
/* Position */ 2989.055908f, -4485.120117f, 5135.359863f,
- /* Ripple Magnitude */ 0.0f, 10.0f, 30.0f,
- 1.0f, 1.0f, 0.98f,
- 0.0f, 0.05f, 0.05f,
- 0.0f, 15.0f, 15.0f,
- 0.0f,
- 0.0f, 0.0f,
- hmc_seg7_painting_dl_070254E0,
- hmc_seg7_painting_data_07024CD4,
- hmc_seg7_painting_textures_07025518,
- 32, 32,
- hmc_seg7_painting_dl_070242D0,
- RIPPLE_TRIGGER_CONTINUOUS, 0xFF, 0x00, 0x00, 0x00,
- 723.968018f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 10.0f, 30.0f,
+ /* Ripple Decay */ 1.0f, 1.0f, 0.98f,
+ /* Ripple Rate */ 0.0f, 0.05f, 0.05f,
+ /* Ripple Dispersion */ 0.0f, 15.0f, 15.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ hmc_seg7_painting_dl_070254E0,
+ /* Texture Maps */ hmc_seg7_painting_texture_maps_07024CD4,
+ /* Textures */ hmc_seg7_painting_textures_07025518,
+ /* Texture w, h */ 32, 32,
+ /* Ripple DList */ hmc_seg7_painting_dl_070242D0,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_CONTINUOUS,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 723.968018f,
};
diff --git a/levels/jrb/areas/1/geo.inc.c b/levels/jrb/areas/1/geo.inc.c
@@ -26,7 +26,7 @@ const GeoLayout jrb_geo_000A18[] = {
GEO_ASM(0x1201, geo_movtex_draw_water_regions),
GEO_ASM(0x1205, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 14, geo_enfvx_main),
+ GEO_ASM( 14, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/jrb/areas/2/geo.inc.c b/levels/jrb/areas/2/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout jrb_geo_000AFC[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1202, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 2, geo_enfvx_main),
+ GEO_ASM( 2, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/jrb/wooden_ship/geo.inc.c b/levels/jrb/wooden_ship/geo.inc.c
@@ -11,7 +11,7 @@ const GeoLayout jrb_geo_000978[] = {
const GeoLayout jrb_geo_000990[] = {
GEO_CULLING_RADIUS(5000),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, jrb_seg7_dl_070090B0),
GEO_CLOSE_NODE(),
GEO_END(),
@@ -30,7 +30,7 @@ const GeoLayout jrb_geo_0009B0[] = {
const GeoLayout jrb_geo_0009C8[] = {
GEO_CULLING_RADIUS(5000),
GEO_OPEN_NODE(),
- GEO_ASM(0, Geo18_8029D924),
+ GEO_ASM(0, geo_update_layer_transparency),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, jrb_seg7_dl_07009B30),
GEO_CLOSE_NODE(),
GEO_END(),
diff --git a/levels/lll/areas/1/geo.inc.c b/levels/lll/areas/1/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout lll_geo_000E00[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x2201, geo_movtex_draw_nocolor),
GEO_RENDER_OBJ(),
- GEO_ASM( 12, geo_enfvx_main),
+ GEO_ASM( 12, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/lll/areas/2/geo.inc.c b/levels/lll/areas/2/geo.inc.c
@@ -24,7 +24,7 @@ const GeoLayout lll_geo_000EC0[] = {
GEO_ASM(0x2202, geo_movtex_draw_nocolor),
GEO_ASM(0x2202, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/pss/areas/1/geo.inc.c b/levels/pss/areas/1/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout pss_geo_000100[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, pss_seg7_dl_0700E2B0),
GEO_DISPLAY_LIST(LAYER_OPAQUE_DECAL, pss_seg7_dl_0700E3E8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/rr/areas/1/geo.inc.c b/levels/rr/areas/1/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout rr_geo_0009D0[] = {
GEO_ASM(0, geo_exec_flying_carpet_timer_update),
GEO_DISPLAY_LIST(LAYER_ALPHA, dl_cruiser_metal_holes),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/sa/areas/1/geo.inc.c b/levels/sa/areas/1/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout sa_geo_000170[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, sa_seg7_dl_07002DE8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, sa_seg7_dl_07002FD0),
GEO_RENDER_OBJ(),
- GEO_ASM(2, geo_enfvx_main),
+ GEO_ASM(2, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/scripts.c b/levels/scripts.c
@@ -67,10 +67,10 @@ const LevelScript level_main_scripts_entry[] = {
LOAD_MODEL_FROM_GEO(MODEL_SMOKE, smoke_geo),
LOAD_MODEL_FROM_GEO(MODEL_SPARKLES, sparkles_geo),
LOAD_MODEL_FROM_GEO(MODEL_BUBBLE, bubble_geo),
- LOAD_MODEL_FROM_GEO(MODEL_SPOT_ON_GROUND, spot_on_ground_geo),
- LOAD_MODEL_FROM_GEO(MODEL_WATER_WAVES_SURF, water_waves_surface_geo),
+ LOAD_MODEL_FROM_GEO(MODEL_SMALL_WATER_SPLASH, small_water_splash_geo),
+ LOAD_MODEL_FROM_GEO(MODEL_IDLE_WATER_WAVE, idle_water_wave_geo),
LOAD_MODEL_FROM_GEO(MODEL_WATER_SPLASH, water_splash_geo),
- LOAD_MODEL_FROM_GEO(MODEL_WATER_WAVES, water_waves_geo),
+ LOAD_MODEL_FROM_GEO(MODEL_WAVE_TRAIL, wave_trail_geo),
LOAD_MODEL_FROM_GEO(MODEL_YELLOW_COIN, yellow_coin_geo),
LOAD_MODEL_FROM_GEO(MODEL_STAR, star_geo),
LOAD_MODEL_FROM_GEO(MODEL_TRANSPARENT_STAR, transparent_star_geo),
diff --git a/levels/sl/areas/1/geo.inc.c b/levels/sl/areas/1/geo.inc.c
@@ -25,7 +25,7 @@ const GeoLayout sl_geo_0003A8[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1001, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 1, geo_enfvx_main),
+ GEO_ASM( 1, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/sl/areas/2/geo.inc.c b/levels/sl/areas/2/geo.inc.c
@@ -20,7 +20,7 @@ const GeoLayout sl_geo_000484[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, sl_seg7_dl_0700C9E8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, sl_seg7_dl_0700CB58),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/sl/script.c b/levels/sl/script.c
@@ -29,8 +29,8 @@ static const LevelScript script_func_local_2[] = {
};
static const LevelScript script_func_local_3[] = {
- OBJECT(/*model*/ MODEL_PENGUIN, /*pos*/ 1715, 3328, 518, /*angle*/ 0, -51, 0, /*behParam*/ 0x00000000, /*beh*/ bhvWalkingPenguin),
- OBJECT(/*model*/ MODEL_NONE, /*pos*/ 700, 3428, 700, /*angle*/ 0, 30, 0, /*behParam*/ 0x00000000, /*beh*/ bhvSnowmanWindBlowing),
+ OBJECT(/*model*/ MODEL_PENGUIN, /*pos*/ 1715, 3328, 518, /*angle*/ 0, -51, 0, /*behParam*/ 0x00000000, /*beh*/ bhvSLWalkingPenguin),
+ OBJECT(/*model*/ MODEL_NONE, /*pos*/ 700, 3428, 700, /*angle*/ 0, 30, 0, /*behParam*/ 0x00000000, /*beh*/ bhvSLSnowmanWind),
OBJECT(/*model*/ MODEL_NONE, /*pos*/ 480, 2300, 1370, /*angle*/ 0, 0, 0, /*behParam*/ 0x00000000, /*beh*/ bhvIgloo),
OBJECT(/*model*/ MODEL_BIG_CHILL_BULLY, /*pos*/ 315, 1331, -4852, /*angle*/ 0, 0, 0, /*behParam*/ 0x01000000, /*beh*/ bhvBigChillBully),
OBJECT(/*model*/ MODEL_MR_BLIZZARD_HIDDEN, /*pos*/ 2954, 970, 750, /*angle*/ 0, 0, 0, /*behParam*/ 0x00020000, /*beh*/ bhvMrBlizzard),
diff --git a/levels/ssl/areas/1/geo.inc.c b/levels/ssl/areas/1/geo.inc.c
@@ -27,7 +27,7 @@ const GeoLayout ssl_geo_000648[] = {
GEO_ASM(0x0802, geo_movtex_draw_colored),
GEO_ASM(0x0803, geo_movtex_draw_colored),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ssl/areas/2/geo.inc.c b/levels/ssl/areas/2/geo.inc.c
@@ -24,7 +24,7 @@ const GeoLayout ssl_geo_0007CC[] = {
GEO_ASM(0x802, geo_movtex_draw_nocolor),
GEO_ASM(0x803, geo_movtex_draw_nocolor),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ssl/areas/3/geo.inc.c b/levels/ssl/areas/3/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout ssl_geo_00088C[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, ssl_seg7_dl_07021A08),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, ssl_seg7_dl_07021DE8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/thi/areas/1/geo.inc.c b/levels/thi/areas/1/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout thi_geo_000608[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1301, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/thi/areas/2/geo.inc.c b/levels/thi/areas/2/geo.inc.c
@@ -28,7 +28,7 @@ const GeoLayout thi_geo_0006D4[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1302, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/thi/areas/3/geo.inc.c b/levels/thi/areas/3/geo.inc.c
@@ -20,7 +20,7 @@ const GeoLayout thi_geo_00079C[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, thi_seg7_dl_07009D50),
GEO_DISPLAY_LIST(LAYER_ALPHA, thi_seg7_dl_07009F58),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/totwc/areas/1/geo.inc.c b/levels/totwc/areas/1/geo.inc.c
@@ -19,7 +19,7 @@ const GeoLayout totwc_geo_000188[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, totwc_seg7_dl_07007048),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, totwc_seg7_dl_070078B8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ttc/areas/1/geo.inc.c b/levels/ttc/areas/1/geo.inc.c
@@ -22,7 +22,7 @@ const GeoLayout ttc_geo_0003B8[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, ttc_seg7_dl_0700B1D8),
GEO_DISPLAY_LIST(LAYER_ALPHA, ttc_seg7_dl_0700E878),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ttm/areas/1/geo.inc.c b/levels/ttm/areas/1/geo.inc.c
@@ -18,8 +18,8 @@ const GeoLayout ttm_geo_000A70[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0700A120),
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0700A2E0),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, Geo18_802D5D0C),
- GEO_ASM( 512, Geo18_802D5B98),
+ GEO_ASM( 0, geo_painting_update),
+ GEO_ASM(PAINTING_ID(0, 2), geo_painting_draw),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x3601, geo_movtex_draw_nocolor),
GEO_ASM(0x3602, geo_movtex_draw_nocolor),
@@ -27,7 +27,7 @@ const GeoLayout ttm_geo_000A70[] = {
GEO_ASM(0x3604, geo_movtex_draw_nocolor),
GEO_ASM(0x3605, geo_movtex_draw_nocolor),
GEO_ASM(0x3601, geo_movtex_draw_water_regions),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ttm/areas/1/painting.inc.c b/levels/ttm/areas/1/painting.inc.c
@@ -62,8 +62,10 @@ static const Gfx ttm_seg7_painting_dl_07012430[] = {
};
// 0x07012450 - 0x0701296A
-static const PaintingData ttm_seg7_painting_points_07012450[] = {
- 85,
+static const PaintingData ttm_seg7_painting_texture_map_bottom_07012450[] = {
+ 85, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
49, 2016, 889,
53, 2016, 685,
55, 1843, 787,
@@ -150,8 +152,9 @@ static const PaintingData ttm_seg7_painting_points_07012450[] = {
150, 649, 0,
153, -32, 0,
-// ttm_seg7_painting_triangles_07012650:
- 132,
+ 132, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
13, 8, 5,
0, 1, 2,
3, 0, 4,
@@ -288,8 +291,10 @@ static const PaintingData ttm_seg7_painting_points_07012450[] = {
// 0x0701296C - 0x07012E84
-static const PaintingData ttm_seg7_painting_points_0701296C[] = {
- 85,
+static const PaintingData ttm_seg7_painting_top_0701296C[] = {
+ 85, // num mappings
+ // Format:
+ // mesh vtx ID, texture X, texture Y
0, 2016, 72,
1, 2016, 0,
2, 1843, 0,
@@ -376,8 +381,9 @@ static const PaintingData ttm_seg7_painting_points_0701296C[] = {
152, -32, 685,
153, -32, 992,
-// ttm_seg7_painting_triangles_07012B6C:
- 132,
+ 132, // num groups
+ // Grouped by 5 + one remainder group,
+ // = 15 vertices per group + a few extra triangles
10, 7, 13,
0, 1, 2,
3, 0, 2,
@@ -514,9 +520,9 @@ static const PaintingData ttm_seg7_painting_points_0701296C[] = {
// 0x07012E88
-static const PaintingData *const ttm_seg7_painting_data_07012E88[] = {
- ttm_seg7_painting_points_07012450,
- ttm_seg7_painting_points_0701296C,
+static const PaintingData *const ttm_seg7_painting_texture_maps_07012E88[] = {
+ ttm_seg7_painting_texture_map_bottom_07012450,
+ ttm_seg7_painting_top_0701296C,
};
UNUSED static const u64 ttm_unused_0 = 0x0;
@@ -546,23 +552,26 @@ static const u8 *const ttm_seg7_painting_textures_07012EF8[] = {
// 0x07012F00 (PaintingData)
struct Painting ttm_slide_painting = {
/* id */ 0x0000,
- /* Face Count */ 0x02,
- /* Ripple Shape */ RIPPLE_SHAPE_WAVE,
+ /* Image Count */ 0x02,
+ /* Texture Type */ PAINTING_IMAGE,
/* Floor Status */ 0x00, 0x00, 0x00 /* which of the painting's nearby special floors Mario's on */,
/* Ripple Status */ 0x00,
/* Rotation */ 0.0f, 90.0f,
/* Position */ 3072.0f, 921.6f, -819.2f,
- /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
- 1.0f, 0.9608f, 0.9524f,
- 0.0f, 0.24f, 0.14f,
- 0.0f, 40.0f, 30.0f,
- 0.0f,
- 0.0f, 0.0f,
- ttm_seg7_painting_dl_07012E98,
- ttm_seg7_painting_data_07012E88,
- ttm_seg7_painting_textures_07012EF8,
- 64, 32,
- ttm_seg7_painting_dl_07012430,
- RIPPLE_TRIGGER_PROXIMITY, 0xFF, 0x00, 0x00, 0x00,
- 460.8f,
+ /* curr passive entry */
+ /* Ripple Magnitude */ 0.0f, 20.0f, 80.0f,
+ /* Ripple Decay */ 1.0f, 0.9608f, 0.9524f,
+ /* Ripple Rate */ 0.0f, 0.24f, 0.14f,
+ /* Ripple Dispersion */ 0.0f, 40.0f, 30.0f,
+ /* Curr Ripple Timer */ 0.0f,
+ /* Curr Ripple x, y */ 0.0f, 0.0f,
+ /* Normal DList */ ttm_seg7_painting_dl_07012E98,
+ /* Texture Maps */ ttm_seg7_painting_texture_maps_07012E88,
+ /* Textures */ ttm_seg7_painting_textures_07012EF8,
+ /* Texture w, h */ 64, 32,
+ /* Ripple DList */ ttm_seg7_painting_dl_07012430,
+ /* Ripple Trigger */ RIPPLE_TRIGGER_PROXIMITY,
+ /* Alpha */ 0xFF,
+ /* Mario Below */ 0x00, 0x00, 0x00, /* Whether or not Mario is below the painting */
+ /* Size */ 460.8f,
};
diff --git a/levels/ttm/areas/2/geo.inc.c b/levels/ttm/areas/2/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout ttm_geo_000B5C[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0701D798),
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0701DBB8),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ttm/areas/3/geo.inc.c b/levels/ttm/areas/3/geo.inc.c
@@ -19,7 +19,7 @@ const GeoLayout ttm_geo_000BEC[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_07024C78),
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_07025F48),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/ttm/areas/4/geo.inc.c b/levels/ttm/areas/4/geo.inc.c
@@ -18,7 +18,7 @@ const GeoLayout ttm_geo_000C84[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0702A1B8),
GEO_DISPLAY_LIST(LAYER_OPAQUE, ttm_seg7_dl_0702A8A0),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/vcutm/areas/1/geo.inc.c b/levels/vcutm/areas/1/geo.inc.c
@@ -20,7 +20,7 @@ const GeoLayout vcutm_geo_000208[] = {
GEO_DISPLAY_LIST(LAYER_OPAQUE, vcutm_seg7_dl_070093E8),
GEO_DISPLAY_LIST(LAYER_ALPHA, vcutm_seg7_dl_070080D0),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/wdw/areas/1/geo.inc.c b/levels/wdw/areas/1/geo.inc.c
@@ -23,7 +23,7 @@ const GeoLayout wdw_geo_000658[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1101, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/wdw/areas/2/geo.inc.c b/levels/wdw/areas/2/geo.inc.c
@@ -21,7 +21,7 @@ const GeoLayout wdw_geo_000724[] = {
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x1102, geo_movtex_draw_water_regions),
GEO_RENDER_OBJ(),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/wf/areas/1/geo.inc.c b/levels/wf/areas/1/geo.inc.c
@@ -22,7 +22,7 @@ const GeoLayout wf_geo_000BF8[] = {
GEO_RENDER_OBJ(),
GEO_ASM( 0, geo_movtex_pause_control),
GEO_ASM(0x2401, geo_movtex_draw_water_regions),
- GEO_ASM( 0, geo_enfvx_main),
+ GEO_ASM( 0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/levels/wmotr/areas/1/geo.inc.c b/levels/wmotr/areas/1/geo.inc.c
@@ -19,7 +19,7 @@ const GeoLayout wmotr_geo_0001F0[] = {
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, wmotr_seg7_dl_0700EFD8),
GEO_DISPLAY_LIST(LAYER_TRANSPARENT, wmotr_seg7_dl_07010608),
GEO_RENDER_OBJ(),
- GEO_ASM(0, geo_enfvx_main),
+ GEO_ASM(0, geo_envfx_main),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
GEO_CLOSE_NODE(),
diff --git a/lib/asm/__osExceptionPreamble.s b/lib/asm/__osExceptionPreamble.s
@@ -4,6 +4,9 @@
.include "macros.inc"
+.ifdef VERSION_SH
+.set VERSION_EU, 1 # HACK, someone fix this file, its poorly diff'd!
+.endif
.section .text, "ax"
diff --git a/lib/src/D_802F4380.c b/lib/src/D_802F4380.c
@@ -2,7 +2,7 @@
#include "hardware.h"
#include "new_func.h"
#include "macros.h"
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
u32 D_802F4380() {
u32 sp3c;
u32 sp38;
diff --git a/lib/src/osCreatePiManager.c b/lib/src/osCreatePiManager.c
@@ -3,7 +3,7 @@
#define OS_PI_MGR_MESG_BUFF_SIZE 1
OSMgrArgs piMgrArgs = { 0 };
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
OSPiHandle *D_80302DFC = NULL;
#endif
OSThread piMgrThread;
diff --git a/lib/src/osInitialize.c b/lib/src/osInitialize.c
@@ -11,7 +11,7 @@ typedef struct {
u32 instr03;
} exceptionPreamble;
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
extern u32 EU_D_802f4330(u32, void (*));
extern void D_802F4380();
@@ -20,7 +20,7 @@ u32 D_80365CD0; // maybe initialized?
u64 osClockRate = 62500000;
u32 D_80334808 = 0;
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
u32 EU_D_80336C40;
u32 EU_D_80336C44;
@@ -41,7 +41,7 @@ void osInitialize(void) {
u32 sp34;
u32 sp30 = 0;
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
UNUSED u32 eu_sp34;
UNUSED u32 eu_sp30;
#endif
@@ -73,7 +73,7 @@ void osInitialize(void) {
if (osResetType == RESET_TYPE_COLD_RESET) {
bzero(osAppNmiBuffer, sizeof(osAppNmiBuffer));
}
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
eu_sp30 = HW_REG(PI_STATUS_REG, u32);
while (eu_sp30 & PI_STATUS_ERROR) {
eu_sp30 = HW_REG(PI_STATUS_REG, u32);
diff --git a/rename_sym.sh b/rename_sym.sh
@@ -10,4 +10,4 @@ fi
#echo "Replace $1 with $2?"
#read
-grep -rl "$1" text/**/*.{c,h} assets/**/*.c enhancements/**/*.{c,h,s} lib/**/*.{c,h,s} asm/**/*.s bin/**/*.c data/*.c levels/**/*.c actors/**/*.c src/**/*.{c,h} include/**/*.{h,in} undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g"
+grep -rl "$1" text/**/*.{c,h} assets/**/*.c enhancements/*.patch lib/**/*.{c,h,s} asm/**/*.s bin/**/*.c data/*.c levels/**/*.c actors/**/*.c src/**/*.{c,h} include/**/*.{h,in} undefined_syms.txt | xargs sed -i "s/\b$1\b/$2/g"
diff --git a/sm64.ld b/sm64.ld
@@ -141,14 +141,14 @@ SECTIONS
BUILD_DIR/src/game/obj_behaviors.o(.text);
BUILD_DIR/src/game/obj_behaviors_2.o(.text);
BUILD_DIR/src/audio/synthesis.o(.text);
- BUILD_DIR/src/audio/memory.o(.text);
+ BUILD_DIR/src/audio/heap.o(.text);
BUILD_DIR/src/audio/load.o(.text);
BUILD_DIR/src/audio/playback.o(.text);
BUILD_DIR/src/audio/effects.o(.text);
BUILD_DIR/src/audio/seqplayer.o(.text);
BUILD_DIR/src/audio/external.o(.text);
BUILD_DIR/src/audio/port_eu.o(.text);
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
BUILD_DIR/libultra.a:string.o(.text);
BUILD_DIR/libultra.a:_Printf.o(.text);
BUILD_DIR/libultra.a:llmuldiv.o(.text);
@@ -521,7 +521,7 @@ SECTIONS
BUILD_DIR/src/game*.o(.rodata*);
#endif
BUILD_DIR/src/audio/synthesis.o(.rodata*);
- BUILD_DIR/src/audio/memory.o(.rodata*);
+ BUILD_DIR/src/audio/heap.o(.rodata*);
BUILD_DIR/src/audio/load.o(.rodata*);
BUILD_DIR/src/audio/playback.o(.rodata*);
BUILD_DIR/src/audio/effects.o(.rodata*);
@@ -874,7 +874,7 @@ SECTIONS
BUILD_DIR/src/audio/globals_start.o(.bss*);
BUILD_DIR/src/audio/synthesis.o(.bss*);
- BUILD_DIR/src/audio/memory.o(.bss*);
+ BUILD_DIR/src/audio/heap.o(.bss*);
BUILD_DIR/src/audio/load.o(.bss*);
BUILD_DIR/src/audio/data.o(.bss*);
BUILD_DIR/src/audio/globals_end.o(.bss*);
diff --git a/sm64.sh.sha1 b/sm64.sh.sha1
@@ -0,0 +1 @@
+3f319ae697533a255a1003d09202379d78d5a2e0 build/sh/sm64.sh.z64
diff --git a/src/audio/data.c b/src/audio/data.c
@@ -4,10 +4,10 @@
#include "data.h"
#include "effects.h"
-extern struct OSMesgQueue *OSMesgQueue0;
-extern struct OSMesgQueue *OSMesgQueue1;
-extern struct OSMesgQueue *OSMesgQueue2;
-extern struct OSMesgQueue *OSMesgQueue3;
+extern struct OSMesgQueue OSMesgQueue0;
+extern struct OSMesgQueue OSMesgQueue1;
+extern struct OSMesgQueue OSMesgQueue2;
+extern struct OSMesgQueue OSMesgQueue3;
#ifdef VERSION_EU
struct ReverbSettingsEU sReverbSettings[] = {
@@ -182,7 +182,7 @@ struct AdsrEnvelope gDefaultEnvelope[] = {
#ifdef VERSION_EU
struct NoteSubEu gZeroNoteSub = { 0 };
-struct NoteSubEu gDefaultNoteSub = { 1, 1 };
+struct NoteSubEu gDefaultNoteSub = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { NULL } };
s16 sSawtoothWaves[256] = {
0, 1023, 2047, 3071, 4095, 5119, 6143, 7167, 8191, 9215, 10239,
diff --git a/src/audio/effects.c b/src/audio/effects.c
@@ -13,47 +13,68 @@
#endif
#ifdef VERSION_EU
-void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 arg1) {
- f32 weight;
+static void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 recalculateVolume) {
+ f32 channelVolume;
s32 i;
- if (seqChannel->unk1.as_bitfields.unk0b40 || arg1) {
- weight = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->unkEu2C;
+ if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
+ channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->appliedFadeVolume;
if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
- weight = seqChannel->seqPlayer->muteVolumeScale * weight;
+ channelVolume = seqChannel->seqPlayer->muteVolumeScale * channelVolume;
}
- seqChannel->panChannelWeight = weight;
+ seqChannel->appliedVolume = channelVolume;
}
- if (seqChannel->unk1.as_bitfields.unk0b20) {
- seqChannel->pan = seqChannel->unk9 * seqChannel->unkA;
+ if (seqChannel->changes.as_bitfields.pan) {
+ seqChannel->pan = seqChannel->newPan * seqChannel->panChannelWeight;
}
for (i = 0; i < 4; ++i) {
struct SequenceChannelLayer *layer = seqChannel->layers[i];
- if (layer && layer->enabled && layer->note) {
- if (layer->unkEu0b4) {
+ if (layer != NULL && layer->enabled && layer->note != NULL) {
+ if (layer->notePropertiesNeedInit) {
layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
- layer->noteVelocity = layer->velocitySquare * seqChannel->panChannelWeight;
- layer->notePan = (seqChannel->pan + layer->euUnk5 * (0x80 - seqChannel->unkA)) >> 7;
- layer->unkEu0b4 = 0;
+ layer->noteVelocity = layer->velocitySquare * seqChannel->appliedVolume;
+ layer->notePan = (seqChannel->pan + layer->pan * (0x80 - seqChannel->panChannelWeight)) >> 7;
+ layer->notePropertiesNeedInit = FALSE;
} else {
- if (seqChannel->unk1.as_bitfields.unk0b80) {
+ if (seqChannel->changes.as_bitfields.freqScale) {
layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
}
- if (seqChannel->unk1.as_bitfields.unk0b40 || arg1) {
- layer->noteVelocity = layer->velocitySquare * seqChannel->panChannelWeight;
+ if (seqChannel->changes.as_bitfields.volume || recalculateVolume) {
+ layer->noteVelocity = layer->velocitySquare * seqChannel->appliedVolume;
}
- if (seqChannel->unk1.as_bitfields.unk0b20) {
- layer->notePan = (seqChannel->pan + layer->euUnk5 * (0x80 - seqChannel->unkA)) >> 7;
+ if (seqChannel->changes.as_bitfields.pan) {
+ layer->notePan = (seqChannel->pan + layer->pan * (0x80 - seqChannel->panChannelWeight)) >> 7;
}
}
}
}
- seqChannel->unk1.as_u8 = 0;
+ seqChannel->changes.as_u8 = 0;
}
#else
-void func_80319E70(void) {
+static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) {
+ f32 channelVolume;
+ f32 panLayerWeight;
+ f32 panFromChannel;
+ s32 i;
+
+ channelVolume = seqChannel->volume * seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume;
+ if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
+ channelVolume *= seqChannel->seqPlayer->muteVolumeScale;
+ }
+
+ panFromChannel = seqChannel->pan * seqChannel->panChannelWeight;
+ panLayerWeight = US_FLOAT(1.0) - seqChannel->panChannelWeight;
+
+ for (i = 0; i < 4; i++) {
+ struct SequenceChannelLayer *layer = seqChannel->layers[i];
+ if (layer != NULL && layer->enabled && layer->note != NULL) {
+ layer->noteFreqScale = layer->freqScale * seqChannel->freqScale;
+ layer->noteVelocity = layer->velocitySquare * channelVolume;
+ layer->notePan = (layer->pan * panLayerWeight) + panFromChannel;
+ }
+ }
}
#endif
@@ -63,7 +84,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
if (seqPlayer->fadeTimer != 0) {
seqPlayer->fadeVolume += seqPlayer->fadeVelocity;
#ifdef VERSION_EU
- seqPlayer->unk_eu = TRUE;
+ seqPlayer->recalculateVolume = TRUE;
#endif
if (seqPlayer->fadeVolume > US_FLOAT2(1)) {
@@ -98,8 +119,8 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
}
#ifdef VERSION_EU
- if (seqPlayer->unk_eu) {
- seqPlayer->unkEu2C = seqPlayer->fadeVolume * seqPlayer->unkEu28;
+ if (seqPlayer->recalculateVolume) {
+ seqPlayer->appliedFadeVolume = seqPlayer->fadeVolume * seqPlayer->fadeVolumeScale;
}
#endif
@@ -108,37 +129,15 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) {
if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE
&& seqPlayer->channels[i]->enabled == TRUE) {
#ifdef VERSION_EU
- sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->unk_eu);
+ sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->recalculateVolume);
#else
- f32 channelVolume;
- f32 panLayerWeight;
- f32 panFromChannel;
- s32 layerIndex;
- struct SequenceChannel *seqChannel = seqPlayer->channels[i];
-
- channelVolume =
- seqChannel->seqPlayer->fadeVolume * (seqChannel->volume * seqChannel->volumeScale);
- if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) {
- channelVolume *= seqChannel->seqPlayer->muteVolumeScale;
- }
-
- panFromChannel = seqChannel->panChannelWeight * seqChannel->pan;
- panLayerWeight = US_FLOAT(1.0) - seqChannel->panChannelWeight;
-
- for (layerIndex = 0; layerIndex < 4; layerIndex++) {
- struct SequenceChannelLayer *seqLayer = seqChannel->layers[layerIndex];
- if (seqLayer != NULL && seqLayer->enabled && seqLayer->note != NULL) {
- seqLayer->noteFreqScale = seqChannel->freqScale * seqLayer->freqScale;
- seqLayer->noteVelocity = seqLayer->velocitySquare * channelVolume;
- seqLayer->notePan = (seqLayer->pan * panLayerWeight) + panFromChannel;
- }
- }
+ sequence_channel_process_sound(seqPlayer->channels[i]);
#endif
}
}
#ifdef VERSION_EU
- seqPlayer->unk_eu = FALSE;
+ seqPlayer->recalculateVolume = FALSE;
#endif
}
@@ -224,18 +223,10 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) {
}
vib->extentChangeTimer--;
-#ifdef VERSION_EU
- } else if ((s32) vib->extent != (*vib).seqChannel->vibratoExtentTarget) {
+ } else if (vib->seqChannel->vibratoExtentTarget != (s32) vib->extent) {
if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) {
vib->extent = (s32) vib->seqChannel->vibratoExtentTarget;
}
-#else
- } else if ((s32) vib->extent != vib->seqChannel->vibratoExtentTarget) {
- vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay;
- if (vib->extentChangeTimer == 0) {
- vib->extent = (s32) vib->seqChannel->vibratoExtentTarget;
- }
-#endif
}
if (vib->rateChangeTimer) {
@@ -246,18 +237,10 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) {
}
vib->rateChangeTimer--;
-#ifdef VERSION_EU
- } else if ((s32) vib->rate != (*vib).seqChannel->vibratoRateTarget) {
+ } else if (vib->seqChannel->vibratoRateTarget != (s32) vib->rate) {
if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0) {
vib->rate = (s32) vib->seqChannel->vibratoRateTarget;
}
-#else
- } else if ((s32) vib->rate != vib->seqChannel->vibratoRateTarget) {
- vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay;
- if (vib->rateChangeTimer == 0) {
- vib->rate = (s32) vib->seqChannel->vibratoRateTarget;
- }
-#endif
}
if (vib->extent == 0) {
@@ -339,15 +322,13 @@ void note_vibrato_init(struct Note *note) {
vib->seqChannel = note->parentLayer->seqChannel;
seqChannel = vib->seqChannel;
- vib->extentChangeTimer = seqChannel->vibratoExtentChangeDelay;
- if (vib->extentChangeTimer == 0) {
+ if ((vib->extentChangeTimer = seqChannel->vibratoExtentChangeDelay) == 0) {
vib->extent = seqChannel->vibratoExtentTarget;
} else {
vib->extent = seqChannel->vibratoExtentStart;
}
- vib->rateChangeTimer = seqChannel->vibratoRateChangeDelay;
- if (vib->rateChangeTimer == 0) {
+ if ((vib->rateChangeTimer = seqChannel->vibratoRateChangeDelay) == 0) {
vib->rate = seqChannel->vibratoRateTarget;
} else {
vib->rate = seqChannel->vibratoRateStart;
@@ -396,11 +377,7 @@ s32 adsr_update(struct AdsrState *adsr) {
#endif
if (action & ADSR_ACTION_HANG) {
adsr->state = ADSR_STATE_HANG;
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
}
// fallthrough
}
@@ -446,11 +423,7 @@ s32 adsr_update(struct AdsrState *adsr) {
break;
}
if (adsr->state != ADSR_STATE_FADE) {
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
}
// fallthrough
@@ -467,11 +440,7 @@ s32 adsr_update(struct AdsrState *adsr) {
// fallthrough
case ADSR_STATE_HANG:
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
case ADSR_STATE_DECAY:
case ADSR_STATE_RELEASE: {
@@ -490,11 +459,7 @@ s32 adsr_update(struct AdsrState *adsr) {
#endif
adsr->state = ADSR_STATE_SUSTAIN;
}
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
}
#ifdef VERSION_EU
@@ -508,11 +473,7 @@ s32 adsr_update(struct AdsrState *adsr) {
adsr->state = ADSR_STATE_DISABLED;
}
#endif
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
}
case ADSR_STATE_SUSTAIN:
@@ -520,17 +481,9 @@ s32 adsr_update(struct AdsrState *adsr) {
if (adsr->delay == 0) {
adsr->state = ADSR_STATE_RELEASE;
}
-#ifdef VERSION_EU
break;
-#else
- goto CONT;
-#endif
}
-#ifndef VERSION_EU
-CONT:
-#endif
-
if ((action & ADSR_ACTION_DECAY)) {
adsr->state = ADSR_STATE_DECAY;
adsr->action = action & ~ADSR_ACTION_DECAY;
diff --git a/src/audio/external.c b/src/audio/external.c
@@ -1,6 +1,6 @@
#include <ultra64.h>
#include "sm64.h"
-#include "memory.h"
+#include "heap.h"
#include "load.h"
#include "data.h"
#include "seqplayer.h"
@@ -753,10 +753,8 @@ void func_8031D838(s32 player, FadeT fadeInTime, u8 targetVolume) {
#ifdef VERSION_EU
extern void func_802ad7a0(void);
-void maybe_tick_game_sound(void)
-{
- if (sGameLoopTicked != 0)
- {
+void maybe_tick_game_sound(void) {
+ if (sGameLoopTicked != 0) {
update_game_sound();
sGameLoopTicked = 0;
}
@@ -764,6 +762,7 @@ void maybe_tick_game_sound(void)
}
void func_eu_802e9bec(s32 player, s32 channel, s32 arg2) {
+ // EU verson of unused_803209D8
// chan->stopSomething2 = arg2?
func_802ad770(0x08000000 | (player & 0xff) << 16 | (channel & 0xff) << 8, (s8) arg2);
}
@@ -1607,12 +1606,6 @@ void update_game_sound(void) {
#undef ARG2_VAL1
#undef ARG2_VAL2
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-// Just regalloc differences
-void play_sequence(u8 player, u8 seqId, u16 fadeTimer);
-GLOBAL_ASM("asm/non_matchings/eu/play_sequence.s")
-#else
-
void play_sequence(u8 player, u8 seqId, u16 fadeTimer) {
u8 temp_ret;
u8 i;
@@ -1629,13 +1622,13 @@ void play_sequence(u8 player, u8 seqId, u16 fadeTimer) {
}
#ifdef VERSION_EU
- func_802ad770(0x46000000 | (player & 0xff) << 16, seqId & 0x80);
- func_802ad74c(0x82000000 | (player & 0xff) << 16 | ((seqId & 0x7f) & 0xff) << 8, fadeTimer);
+ func_802ad770(0x46000000 | ((u8)(u32)player) << 16, seqId & 0x80);
+ func_802ad74c(0x82000000 | ((u8)(u32)player) << 16 | ((u8)(seqId & 0x7f)) << 8, fadeTimer);
if (player == 0) {
temp_ret = func_803200E4(0);
if (temp_ret != 0xff) {
- gSequencePlayers[0].unkEu28 = (f32) temp_ret / US_FLOAT(127.0);
+ gSequencePlayers[0].fadeVolumeScale = (f32) temp_ret / US_FLOAT(127.0);
}
}
#else
@@ -1653,7 +1646,6 @@ void play_sequence(u8 player, u8 seqId, u16 fadeTimer) {
}
#endif
}
-#endif
void sequence_player_fade_out(u8 player, u16 fadeTimer) {
#ifdef VERSION_EU
@@ -2440,7 +2432,7 @@ void sound_reset(u8 presetId) {
sGameLoopTicked = 0;
disable_all_sequence_players();
sound_init();
-#if defined(VERSION_JP) || defined(VERSION_US)
+#if defined(VERSION_JP) || defined(VERSION_US) || defined(VERSION_SH)
audio_reset_session(&gAudioSessionPresets[presetId]);
#else
audio_reset_session_eu(presetId);
diff --git a/src/audio/heap.c b/src/audio/heap.c
@@ -0,0 +1,939 @@
+#include <ultra64.h>
+#include <macros.h>
+
+#include "heap.h"
+#include "data.h"
+#include "load.h"
+#include "synthesis.h"
+#include "seqplayer.h"
+#include "effects.h"
+
+#define ALIGN16(val) (((val) + 0xF) & ~0xF)
+
+struct PoolSplit {
+ u32 wantSeq;
+ u32 wantBank;
+ u32 wantUnused;
+ u32 wantCustom;
+}; // size = 0x10
+
+struct PoolSplit2 {
+ u32 wantPersistent;
+ u32 wantTemporary;
+}; // size = 0x8
+
+#ifndef VERSION_EU
+s16 gVolume;
+s8 gReverbDownsampleRate;
+u8 sReverbDownsampleRateLog; // never read
+#endif
+
+struct SoundAllocPool gAudioSessionPool;
+struct SoundAllocPool gAudioInitPool;
+struct SoundAllocPool gNotesAndBuffersPool;
+u8 sAudioHeapPad[0x20]; // probably two unused pools
+struct SoundAllocPool gSeqAndBankPool;
+struct SoundAllocPool gPersistentCommonPool;
+struct SoundAllocPool gTemporaryCommonPool;
+
+struct SoundMultiPool gSeqLoadedPool;
+struct SoundMultiPool gBankLoadedPool;
+struct SoundMultiPool gUnusedLoadedPool;
+
+struct PoolSplit sSessionPoolSplit;
+struct PoolSplit2 sSeqAndBankPoolSplit;
+struct PoolSplit sPersistentCommonPoolSplit;
+struct PoolSplit sTemporaryCommonPoolSplit;
+
+u8 gBankLoadStatus[0x40];
+u8 gSeqLoadStatus[0x100];
+
+#ifdef VERSION_EU
+volatile u8 gAudioResetStatus;
+u8 gAudioResetPresetIdToLoad;
+s32 gAudioResetFadeOutFramesLeft;
+#endif
+
+u8 gAudioUnusedBuffer[0x1000];
+
+extern s32 gMaxAudioCmds;
+
+#ifdef VERSION_EU
+/**
+ * Assuming 'k' in [9, 24],
+ * Computes a newton's method step for f(x) = x^k - d
+ */
+f64 root_newton_step(f64 x, s32 k, f64 d)
+{
+ f64 deg2 = x * x;
+ f64 deg4 = deg2 * deg2;
+ f64 deg8 = deg4 * deg4;
+ s32 degree = k - 9;
+ f64 fx;
+
+ f64 deriv = deg8;
+ if (degree & 1) {
+ deriv *= x;
+ }
+ if (degree & 2) {
+ deriv *= deg2;
+ }
+ if (degree & 4) {
+ deriv *= deg4;
+ }
+ if (degree & 8) {
+ deriv *= deg8;
+ }
+ fx = deriv * x - d;
+ deriv = k * deriv;
+ return x - fx / deriv;
+}
+
+/**
+ * Assuming 'k' in [9, 24],
+ * Computes d ^ (1/k)
+ *
+ * @return the root, or 1.0 if d is 0
+ */
+f64 kth_root(f64 d, s32 k) {
+ f64 root = 1.5;
+ f64 next;
+ f64 diff;
+ s32 i;
+ if (d == 0.0) {
+ root = 1.0;
+ } else {
+ for (i = 0; i < 64; i++) {
+ if (1) {
+ }
+ next = root_newton_step(root, k, d);
+ diff = next - root;
+
+ if (diff < 0) {
+ diff = -diff;
+ }
+
+ if (diff < 1e-07) {
+ root = next;
+ break;
+ } else {
+ root = next;
+ }
+ }
+ }
+
+ return root;
+}
+#endif
+
+#ifdef VERSION_EU
+void build_vol_rampings_table(s32 UNUSED unused, s32 len) {
+ s32 i;
+ s32 step;
+ s32 d;
+ s32 k = len / 8;
+
+ for (step = 0, i = 0; i < 0x400; step += 32, i++) {
+ d = step;
+ if (step == 0) {
+ d = 1;
+ }
+
+ gLeftVolRampings[0][i] = kth_root( d, k - 1);
+ gRightVolRampings[0][i] = kth_root(1.0 / d, k - 1) * 65536.0;
+ gLeftVolRampings[1][i] = kth_root( d, k);
+ gRightVolRampings[1][i] = kth_root(1.0 / d, k) * 65536.0;
+ gLeftVolRampings[2][i] = kth_root( d, k + 1);
+ gRightVolRampings[2][i] = kth_root(1.0 / d, k + 1) * 65536.0;
+ }
+}
+#endif
+
+void reset_bank_and_seq_load_status(void) {
+ s32 i;
+
+ for (i = 0; i < 64; i++) {
+ gBankLoadStatus[i] = SOUND_LOAD_STATUS_NOT_LOADED;
+ }
+
+ for (i = 0; i < 256; i++) {
+ gSeqLoadStatus[i] = SOUND_LOAD_STATUS_NOT_LOADED;
+ }
+}
+
+void discard_bank(s32 bankId) {
+ s32 i;
+
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ struct Note *note = &gNotes[i];
+
+#ifdef VERSION_EU
+ if (note->noteSubEu.bankId == bankId) {
+#else
+ if (note->bankId == bankId) {
+#endif
+ if (note->priority >= NOTE_PRIORITY_MIN) {
+ note->parentLayer->enabled = FALSE;
+ note->parentLayer->finished = TRUE;
+ }
+ note_disable(note);
+ audio_list_remove(¬e->listItem);
+ audio_list_push_back(&gNoteFreeLists.disabled, ¬e->listItem);
+ }
+ }
+}
+
+void discard_sequence(s32 seqId) {
+ s32 i;
+
+ for (i = 0; i < SEQUENCE_PLAYERS; i++) {
+ if (gSequencePlayers[i].enabled && gSequencePlayers[i].seqId == seqId) {
+#ifdef VERSION_EU
+ sequence_player_disable(&gSequencePlayers[i]);
+#else
+ sequence_player_disable(gSequencePlayers + i);
+#endif
+ }
+ }
+}
+
+void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
+#ifdef VERSION_EU
+ u8 *start;
+ u8 *pos;
+ u32 alignedSize = ALIGN16(size);
+
+ start = pool->cur;
+ if (start + alignedSize <= pool->start + pool->size) {
+ pool->cur += alignedSize;
+ for (pos = start; pos < pool->cur; pos++) {
+ *pos = 0;
+ }
+ } else {
+ return NULL;
+ }
+ return start;
+#else
+ u8 *start;
+ s32 last;
+ s32 i;
+
+ if ((pool->cur + ALIGN16(size) <= pool->size + pool->start)) {
+ start = pool->cur;
+ pool->cur += ALIGN16(size);
+ last = pool->cur - start - 1;
+ for (i = 0; i <= last; i++) {
+ start[i] = 0;
+ }
+ } else {
+ return NULL;
+ }
+ return start;
+#endif
+}
+
+void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size) {
+ pool->cur = pool->start = (u8 *) ALIGN16((uintptr_t) memAddr);
+ pool->size = size;
+ pool->unused = 0;
+}
+
+void persistent_pool_clear(struct PersistentPool *persistent) {
+ persistent->pool.unused = 0;
+ persistent->pool.cur = persistent->pool.start;
+ persistent->numEntries = 0;
+}
+
+void temporary_pool_clear(struct TemporaryPool *temporary) {
+ temporary->pool.unused = 0;
+ temporary->pool.cur = temporary->pool.start;
+ temporary->nextSide = 0;
+ temporary->entries[0].ptr = temporary->pool.start;
+#ifdef VERSION_EU
+ temporary->entries[1].ptr = temporary->pool.start + temporary->pool.size;
+#else
+ temporary->entries[1].ptr = temporary->pool.size + temporary->pool.start;
+#endif
+ temporary->entries[0].id = -1;
+ temporary->entries[1].id = -1;
+}
+
+void unused_803160F8(struct SoundAllocPool *pool) {
+ pool->unused = 0;
+ pool->cur = pool->start;
+}
+
+void sound_init_main_pools(s32 sizeForAudioInitPool) {
+ sound_alloc_pool_init(&gAudioInitPool, gAudioHeap, sizeForAudioInitPool);
+ sound_alloc_pool_init(&gAudioSessionPool, gAudioHeap + sizeForAudioInitPool, gAudioHeapSize - sizeForAudioInitPool);
+}
+
+void session_pools_init(struct PoolSplit *a) {
+ gAudioSessionPool.cur = gAudioSessionPool.start;
+ sound_alloc_pool_init(&gNotesAndBuffersPool, soundAlloc(&gAudioSessionPool, a->wantSeq), a->wantSeq);
+ sound_alloc_pool_init(&gSeqAndBankPool, soundAlloc(&gAudioSessionPool, a->wantCustom), a->wantCustom);
+}
+
+void seq_and_bank_pool_init(struct PoolSplit2 *a) {
+ gSeqAndBankPool.cur = gSeqAndBankPool.start;
+ sound_alloc_pool_init(&gPersistentCommonPool, soundAlloc(&gSeqAndBankPool, a->wantPersistent), a->wantPersistent);
+ sound_alloc_pool_init(&gTemporaryCommonPool, soundAlloc(&gSeqAndBankPool, a->wantTemporary), a->wantTemporary);
+}
+
+void persistent_pools_init(struct PoolSplit *a) {
+ gPersistentCommonPool.cur = gPersistentCommonPool.start;
+ sound_alloc_pool_init(&gSeqLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantSeq), a->wantSeq);
+ sound_alloc_pool_init(&gBankLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantBank), a->wantBank);
+ sound_alloc_pool_init(&gUnusedLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantUnused),
+ a->wantUnused);
+ persistent_pool_clear(&gSeqLoadedPool.persistent);
+ persistent_pool_clear(&gBankLoadedPool.persistent);
+ persistent_pool_clear(&gUnusedLoadedPool.persistent);
+}
+
+void temporary_pools_init(struct PoolSplit *a) {
+ gTemporaryCommonPool.cur = gTemporaryCommonPool.start;
+ sound_alloc_pool_init(&gSeqLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantSeq), a->wantSeq);
+ sound_alloc_pool_init(&gBankLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantBank), a->wantBank);
+ sound_alloc_pool_init(&gUnusedLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantUnused),
+ a->wantUnused);
+ temporary_pool_clear(&gSeqLoadedPool.temporary);
+ temporary_pool_clear(&gBankLoadedPool.temporary);
+ temporary_pool_clear(&gUnusedLoadedPool.temporary);
+}
+
+#ifndef VERSION_EU
+static void unused_803163D4() {
+}
+#endif
+
+void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id) {
+ // arg3 = 0, 1 or 2?
+
+ struct TemporaryPool *tp; // sp30
+ struct PersistentPool *persistent = &arg0->persistent;
+ struct SoundAllocPool *pool;
+ void *ret;
+#ifndef VERSION_EU
+ u16 UNUSED _firstVal;
+ u16 UNUSED _secondVal;
+#else
+ u16 firstVal;
+ u16 secondVal;
+#endif
+ u32 nullID = -1;
+ u8 *table;
+ u8 isSound;
+#ifndef VERSION_EU
+ u16 firstVal;
+ u16 secondVal;
+ u32 bothDiscardable;
+ u32 leftDiscardable, rightDiscardable;
+ u32 leftNotLoaded, rightNotLoaded;
+ u32 leftAvail, rightAvail;
+#endif
+
+ if (arg3 == 0) {
+ tp = &arg0->temporary;
+ if (arg0 == &gSeqLoadedPool) {
+ table = gSeqLoadStatus;
+ isSound = FALSE;
+ } else if (arg0 == &gBankLoadedPool) {
+ table = gBankLoadStatus;
+ isSound = TRUE;
+ }
+
+ firstVal = (tp->entries[0].id == (s8)nullID ? SOUND_LOAD_STATUS_NOT_LOADED : table[tp->entries[0].id]); // a3, a2
+ secondVal = (tp->entries[1].id == (s8)nullID ? SOUND_LOAD_STATUS_NOT_LOADED : table[tp->entries[1].id]); // a1
+
+#ifndef VERSION_EU
+ leftNotLoaded = (firstVal == SOUND_LOAD_STATUS_NOT_LOADED);
+ leftDiscardable = (firstVal == SOUND_LOAD_STATUS_DISCARDABLE); // t0
+ leftAvail = (firstVal != SOUND_LOAD_STATUS_IN_PROGRESS);
+ rightNotLoaded = (secondVal == SOUND_LOAD_STATUS_NOT_LOADED);
+ rightDiscardable = (secondVal == SOUND_LOAD_STATUS_DISCARDABLE);
+ rightAvail = (secondVal != SOUND_LOAD_STATUS_IN_PROGRESS);
+ bothDiscardable = (leftDiscardable && rightDiscardable); // a0
+
+ if (leftNotLoaded) {
+ tp->nextSide = 0;
+ } else if (rightNotLoaded) {
+ tp->nextSide = 1;
+ } else if (bothDiscardable) {
+ // Use the opposite side from last time.
+ } else if (firstVal == SOUND_LOAD_STATUS_DISCARDABLE) { //??!
+ tp->nextSide = 0;
+ } else if (rightDiscardable) {
+ tp->nextSide = 1;
+ } else if (leftAvail) {
+ tp->nextSide = 0;
+ } else if (rightAvail) {
+ tp->nextSide = 1;
+ } else {
+ // Both left and right sides are being loaded into.
+ return NULL;
+ }
+#else
+ if (firstVal == SOUND_LOAD_STATUS_NOT_LOADED) {
+ tp->nextSide = 0;
+ } else if (secondVal == SOUND_LOAD_STATUS_NOT_LOADED) {
+ tp->nextSide = 1;
+ } else if ((firstVal == SOUND_LOAD_STATUS_DISCARDABLE) && (secondVal == SOUND_LOAD_STATUS_DISCARDABLE)) {
+ // Use the opposite side from last time.
+ } else if (firstVal == SOUND_LOAD_STATUS_DISCARDABLE) {
+ tp->nextSide = 0;
+ } else if (secondVal == SOUND_LOAD_STATUS_DISCARDABLE) {
+ tp->nextSide = 1;
+ } else if (firstVal != SOUND_LOAD_STATUS_IN_PROGRESS) {
+ tp->nextSide = 0;
+ } else if (secondVal != SOUND_LOAD_STATUS_IN_PROGRESS) {
+ tp->nextSide = 1;
+ } else {
+ // Both left and right sides are being loaded into.
+ return NULL;
+ }
+#endif
+
+ pool = &arg0->temporary.pool; // a1
+ if (tp->entries[tp->nextSide].id != (s8)nullID) {
+ table[tp->entries[tp->nextSide].id] = SOUND_LOAD_STATUS_NOT_LOADED;
+ if (isSound == TRUE) {
+ discard_bank(tp->entries[tp->nextSide].id);
+ }
+ }
+
+ switch (tp->nextSide) {
+ case 0:
+ tp->entries[0].ptr = pool->start;
+ tp->entries[0].id = id;
+ tp->entries[0].size = size;
+
+ pool->cur = pool->start + size;
+
+ if (tp->entries[1].ptr < pool->cur) {
+ // Throw out the entry on the other side if it doesn't fit.
+ // (possible @bug: what if it's currently being loaded?)
+ table[tp->entries[1].id] = SOUND_LOAD_STATUS_NOT_LOADED;
+
+ switch (isSound) {
+ case FALSE:
+ discard_sequence(tp->entries[1].id);
+ break;
+ case TRUE:
+ discard_bank(tp->entries[1].id);
+ break;
+ }
+
+ tp->entries[1].id = (s32)nullID;
+#ifdef VERSION_EU
+ tp->entries[1].ptr = pool->start + pool->size;
+#else
+ tp->entries[1].ptr = pool->size + pool->start;
+#endif
+ }
+
+ ret = tp->entries[0].ptr;
+ break;
+
+ case 1:
+#ifdef VERSION_EU
+ tp->entries[1].ptr = pool->start + pool->size - size - 0x10;
+#else
+ tp->entries[1].ptr = pool->size + pool->start - size - 0x10;
+#endif
+ tp->entries[1].id = id;
+ tp->entries[1].size = size;
+
+ if (tp->entries[1].ptr < pool->cur) {
+ table[tp->entries[0].id] = SOUND_LOAD_STATUS_NOT_LOADED;
+
+ switch (isSound) {
+ case FALSE:
+ discard_sequence(tp->entries[0].id);
+ break;
+ case TRUE:
+ discard_bank(tp->entries[0].id);
+ break;
+ }
+
+ tp->entries[0].id = (s32)nullID;
+ pool->cur = pool->start;
+ }
+
+ ret = tp->entries[1].ptr;
+ break;
+
+ default:
+ return NULL;
+ }
+
+ // Switch sides for next time in case both entries are
+ // SOUND_LOAD_STATUS_DISCARDABLE.
+ tp->nextSide ^= 1;
+
+ return ret;
+ }
+
+#ifdef VERSION_EU
+ ret = soundAlloc(&arg0->persistent.pool, arg1 * size);
+ arg0->persistent.entries[arg0->persistent.numEntries].ptr = ret;
+
+ if (ret == NULL)
+#else
+ persistent->entries[persistent->numEntries].ptr = soundAlloc(&persistent->pool, arg1 * size);
+
+ if (persistent->entries[persistent->numEntries].ptr == NULL)
+#endif
+ {
+ switch (arg3) {
+ case 2:
+#ifdef VERSION_EU
+ return alloc_bank_or_seq(arg0, arg1, size, 0, id);
+#else
+ // Prevent tail call optimization.
+ ret = alloc_bank_or_seq(arg0, arg1, size, 0, id);
+ return ret;
+#endif
+ case 1:
+ return NULL;
+ }
+ }
+
+ // TODO: why is this guaranteed to write <= 32 entries...?
+ // Because the buffer is small enough that more don't fit?
+ persistent->entries[persistent->numEntries].id = id;
+ persistent->entries[persistent->numEntries].size = size;
+#ifdef VERSION_EU
+ return persistent->entries[persistent->numEntries++].ptr;
+#else
+ persistent->numEntries++; return persistent->entries[persistent->numEntries - 1].ptr;
+#endif
+}
+
+void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id) {
+ u32 i;
+ UNUSED void *ret;
+ struct TemporaryPool *temporary = &arg0->temporary;
+
+ if (arg1 == 0) {
+ // Try not to overwrite sound that we have just accessed, by setting nextSide appropriately.
+ if (temporary->entries[0].id == id) {
+ temporary->nextSide = 1;
+ return temporary->entries[0].ptr;
+ } else if (temporary->entries[1].id == id) {
+ temporary->nextSide = 0;
+ return temporary->entries[1].ptr;
+ }
+ return NULL;
+ } else {
+ struct PersistentPool *persistent = &arg0->persistent;
+ for (i = 0; i < persistent->numEntries; i++) {
+ if (id == persistent->entries[i].id) {
+ return persistent->entries[i].ptr;
+ }
+ }
+
+ if (arg1 == 2) {
+#ifdef VERSION_EU
+ return get_bank_or_seq(arg0, 0, id);
+#else
+ // Prevent tail call optimization by using a temporary.
+ // (Did they compile with -Wo,-notail?)
+ ret = get_bank_or_seq(arg0, 0, id);
+ return ret;
+#endif
+ }
+ return NULL;
+ }
+}
+
+#ifdef VERSION_EU
+void func_eu_802e27e4_unused(f32 arg0, f32 arg1, u16 *arg2) {
+ s32 i;
+ f32 tmp[16];
+
+ tmp[0] = (f32) (arg1 * 262159.0f);
+ tmp[8] = (f32) (arg0 * 262159.0f);
+ tmp[1] = (f32) ((arg1 * arg0) * 262159.0f);
+ tmp[9] = (f32) (((arg0 * arg0) + arg1) * 262159.0f);
+
+ for (i = 2; i < 8; i++) {
+ //! @bug they probably meant to store the value to tmp[i] and tmp[8 + i]
+ arg2[i] = arg1 * tmp[i - 2] + arg0 * tmp[i - 1];
+ arg2[8 + i] = arg1 * tmp[6 + i] + arg0 * tmp[7 + i];
+ }
+
+ for (i = 0; i < 16; i++) {
+ arg2[i] = tmp[i];
+ }
+
+ for (i = 0; i < 8; i++) {
+ }
+
+ for (i = 8; i < 16; i += 4) {
+ }
+}
+#endif
+
+#ifdef VERSION_EU
+void decrease_reverb_gain(void) {
+ s32 i;
+ for (i = 0; i < gNumSynthesisReverbs; i++) {
+ gSynthesisReverbs[i].reverbGain -= gSynthesisReverbs[i].reverbGain / 8;
+ }
+}
+#else
+void decrease_reverb_gain(void) {
+ gSynthesisReverb.reverbGain -= gSynthesisReverb.reverbGain / 4;
+}
+#endif
+
+#ifdef VERSION_EU
+s32 audio_shut_down_and_reset_step(void) {
+ s32 i;
+ s32 j;
+ switch (gAudioResetStatus) {
+ case 5:
+ for (i = 0; i < SEQUENCE_PLAYERS; i++) {
+ sequence_player_disable(&gSequencePlayers[i]);
+ }
+ gAudioResetFadeOutFramesLeft = 4;
+ gAudioResetStatus--;
+ break;
+ case 4:
+ if (gAudioResetFadeOutFramesLeft != 0) {
+ gAudioResetFadeOutFramesLeft--;
+ decrease_reverb_gain();
+ } else {
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ if (gNotes[i].noteSubEu.enabled && gNotes[i].adsr.state != ADSR_STATE_DISABLED) {
+ gNotes[i].adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv;
+ gNotes[i].adsr.action |= ADSR_ACTION_RELEASE;
+ }
+ }
+ gAudioResetFadeOutFramesLeft = 16;
+ gAudioResetStatus--;
+ }
+ break;
+ case 3:
+ if (gAudioResetFadeOutFramesLeft != 0) {
+ gAudioResetFadeOutFramesLeft--;
+ decrease_reverb_gain();
+ } else {
+ for (i = 0; i < NUMAIBUFFERS; i++) {
+ for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) {
+ gAiBuffers[i][j] = 0;
+ }
+ }
+ gAudioResetFadeOutFramesLeft = 4;
+ gAudioResetStatus--;
+ }
+ break;
+ case 2:
+ if (gAudioResetFadeOutFramesLeft != 0) {
+ gAudioResetFadeOutFramesLeft--;
+ } else {
+ gAudioResetStatus--;
+ }
+ break;
+ case 1:
+ audio_reset_session();
+ gAudioResetStatus = 0;
+ }
+ if (gAudioResetStatus < 3) {
+ return 0;
+ }
+ return 1;
+}
+#else
+/**
+ * Waits until a specified number of audio frames have been created
+ */
+void wait_for_audio_frames(s32 frames) {
+ gAudioFrameCount = 0;
+ // Sound thread will update gAudioFrameCount
+ while (gAudioFrameCount < frames) {
+ // spin
+ }
+}
+#endif
+
+#ifndef VERSION_EU
+void audio_reset_session(struct AudioSessionSettings *preset) {
+#else
+void audio_reset_session(void) {
+ struct AudioSessionSettingsEU *preset = &gAudioSessionPresets[gAudioResetPresetIdToLoad];
+ struct ReverbSettingsEU *reverbSettings;
+#endif
+ s16 *mem;
+#ifndef VERSION_EU
+ s8 updatesPerFrame;
+ s32 reverbWindowSize;
+ s32 k;
+#endif
+ s32 i;
+ s32 j;
+ s32 persistentMem;
+ s32 temporaryMem;
+ s32 totalMem;
+ s32 wantMisc;
+#ifndef VERSION_EU
+ s32 frames;
+ s32 remainingDmas;
+#endif
+#ifdef VERSION_EU
+ struct SynthesisReverb *reverb;
+#endif
+
+#ifndef VERSION_EU
+ if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
+ decrease_reverb_gain();
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ if (gNotes[i].enabled && gNotes[i].adsr.state != ADSR_STATE_DISABLED) {
+ gNotes[i].adsr.fadeOutVel = 0x8000 / gAudioUpdatesPerFrame;
+ gNotes[i].adsr.action |= ADSR_ACTION_RELEASE;
+ }
+ }
+
+ // Wait for all notes to stop playing
+ frames = 0;
+ for (;;) {
+ wait_for_audio_frames(1);
+ frames++;
+ if (frames > 4 * 60) {
+ // Break after 4 seconds
+ break;
+ }
+
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ if (gNotes[i].enabled)
+ break;
+ }
+
+ if (i == gMaxSimultaneousNotes) {
+ // All zero, break early
+ break;
+ }
+ }
+
+ // Wait for the reverb to finish as well
+ decrease_reverb_gain();
+ wait_for_audio_frames(3);
+
+ // The audio interface is double buffered; thus, we have to take the
+ // load lock for 2 frames for the buffers to free up before we can
+ // repurpose memory. Make that 3 frames, just in case.
+ gAudioLoadLock = AUDIO_LOCK_LOADING;
+ wait_for_audio_frames(3);
+
+ remainingDmas = gCurrAudioFrameDmaCount;
+ while (remainingDmas > 0) {
+ for (i = 0; i < gCurrAudioFrameDmaCount; i++) {
+ if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0)
+ remainingDmas--;
+ }
+ }
+ gCurrAudioFrameDmaCount = 0;
+
+ for (j = 0; j < NUMAIBUFFERS; j++) {
+ for (k = 0; k < (s32) (AIBUFFER_LEN / sizeof(s16)); k++) {
+ gAiBuffers[j][k] = 0;
+ }
+ }
+ }
+#endif
+
+ gSampleDmaNumListItems = 0;
+#ifdef VERSION_EU
+ gAudioBufferParameters.frequency = preset->frequency;
+ gAudioBufferParameters.aiFrequency = osAiSetFrequency(gAudioBufferParameters.frequency);
+ gAudioBufferParameters.samplesPerFrameTarget = ALIGN16(gAudioBufferParameters.frequency / gRefreshRate);
+ gAudioBufferParameters.minAiBufferLength = gAudioBufferParameters.samplesPerFrameTarget - 0x10;
+ gAudioBufferParameters.maxAiBufferLength = gAudioBufferParameters.samplesPerFrameTarget + 0x10;
+ gAudioBufferParameters.updatesPerFrame = (gAudioBufferParameters.samplesPerFrameTarget + 0x10) / 160 + 1;
+ gAudioBufferParameters.samplesPerUpdate = (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & 0xfff8;
+ gAudioBufferParameters.samplesPerUpdateMax = gAudioBufferParameters.samplesPerUpdate + 8;
+ gAudioBufferParameters.samplesPerUpdateMin = gAudioBufferParameters.samplesPerUpdate - 8;
+ gAudioBufferParameters.resampleRate = 32000.0f / FLOAT_CAST(gAudioBufferParameters.frequency);
+ gAudioBufferParameters.unkUpdatesPerFrameScaled = (3.0f / 1280.0f) / gAudioBufferParameters.updatesPerFrame;
+ gAudioBufferParameters.updatesPerFrameInv = 1.0f / gAudioBufferParameters.updatesPerFrame;
+
+ gMaxSimultaneousNotes = preset->maxSimultaneousNotes;
+ gVolume = preset->volume;
+ gTempoInternalToExternal = (u32) (gAudioBufferParameters.updatesPerFrame * 2880000.0f / gTatumsPerBeat / D_EU_802298D0);
+
+ gAudioBufferParameters.presetUnk4 = preset->unk1;
+ gAudioBufferParameters.samplesPerFrameTarget *= gAudioBufferParameters.presetUnk4;
+ gAudioBufferParameters.maxAiBufferLength *= gAudioBufferParameters.presetUnk4;
+ gAudioBufferParameters.minAiBufferLength *= gAudioBufferParameters.presetUnk4;
+ gAudioBufferParameters.updatesPerFrame *= gAudioBufferParameters.presetUnk4;
+
+ gMaxAudioCmds = gMaxSimultaneousNotes * 0x10 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x300;
+#else
+ reverbWindowSize = preset->reverbWindowSize;
+ gAiFrequency = osAiSetFrequency(preset->frequency);
+ gMaxSimultaneousNotes = preset->maxSimultaneousNotes;
+ gSamplesPerFrameTarget = ALIGN16(gAiFrequency / 60);
+ gReverbDownsampleRate = preset->reverbDownsampleRate;
+
+ switch (gReverbDownsampleRate) {
+ case 1:
+ sReverbDownsampleRateLog = 0;
+ break;
+ case 2:
+ sReverbDownsampleRateLog = 1;
+ break;
+ case 4:
+ sReverbDownsampleRateLog = 2;
+ break;
+ case 8:
+ sReverbDownsampleRateLog = 3;
+ break;
+ case 16:
+ sReverbDownsampleRateLog = 4;
+ break;
+ default:
+ sReverbDownsampleRateLog = 0;
+ }
+
+ gReverbDownsampleRate = preset->reverbDownsampleRate;
+ gVolume = preset->volume;
+ gMinAiBufferLength = gSamplesPerFrameTarget - 0x10;
+ updatesPerFrame = gSamplesPerFrameTarget / 160 + 1;
+ gAudioUpdatesPerFrame = gSamplesPerFrameTarget / 160 + 1;
+
+ // Compute conversion ratio from the internal unit tatums/tick to the
+ // external beats/minute (JP) or tatums/minute (US). In practice this is
+ // 300 on JP and 14360 on US.
+#ifdef VERSION_JP
+ gTempoInternalToExternal = updatesPerFrame * 3600 / gTatumsPerBeat;
+#else
+ gTempoInternalToExternal = (u32)(updatesPerFrame * 2880000.0f / gTatumsPerBeat / 16.713f);
+#endif
+ gMaxAudioCmds = gMaxSimultaneousNotes * 20 * updatesPerFrame + 320;
+#endif
+
+#ifdef VERSION_EU
+ persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem + preset->persistentBankMem);
+ temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem + preset->temporaryBankMem);
+#else
+ persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem + preset->persistentSeqMem);
+ temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem + preset->temporarySeqMem);
+#endif
+ totalMem = persistentMem + temporaryMem;
+ wantMisc = gAudioSessionPool.size - totalMem - 0x100;
+ sSessionPoolSplit.wantSeq = wantMisc;
+ sSessionPoolSplit.wantCustom = totalMem;
+ session_pools_init(&sSessionPoolSplit);
+ sSeqAndBankPoolSplit.wantPersistent = persistentMem;
+ sSeqAndBankPoolSplit.wantTemporary = temporaryMem;
+ seq_and_bank_pool_init(&sSeqAndBankPoolSplit);
+ sPersistentCommonPoolSplit.wantSeq = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem);
+ sPersistentCommonPoolSplit.wantBank = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem);
+ sPersistentCommonPoolSplit.wantUnused = 0;
+ persistent_pools_init(&sPersistentCommonPoolSplit);
+ sTemporaryCommonPoolSplit.wantSeq = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem);
+ sTemporaryCommonPoolSplit.wantBank = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem);
+ sTemporaryCommonPoolSplit.wantUnused = 0;
+ temporary_pools_init(&sTemporaryCommonPoolSplit);
+ reset_bank_and_seq_load_status();
+
+#ifndef VERSION_EU
+ for (j = 0; j < 2; j++) {
+ gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64));
+ }
+#endif
+
+ gNotes = soundAlloc(&gNotesAndBuffersPool, gMaxSimultaneousNotes * sizeof(struct Note));
+ note_init_all();
+ init_note_free_list();
+
+#ifdef VERSION_EU
+ gNoteSubsEu = soundAlloc(&gNotesAndBuffersPool, (gAudioBufferParameters.updatesPerFrame * gMaxSimultaneousNotes) * sizeof(struct NoteSubEu));
+
+ for (j = 0; j != 2; j++) {
+ gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64));
+ }
+
+ for (j = 0; j < 4; j++) {
+ gSynthesisReverbs[j].useReverb = 0;
+ }
+ gNumSynthesisReverbs = preset->numReverbs;
+ for (j = 0; j < gNumSynthesisReverbs; j++) {
+ reverb = &gSynthesisReverbs[j];
+ reverbSettings = &preset->reverbSettings[j];
+ reverb->windowSize = reverbSettings->windowSize * 64;
+ reverb->downsampleRate = reverbSettings->downsampleRate;
+ reverb->reverbGain = reverbSettings->gain;
+ reverb->useReverb = 8;
+ reverb->ringBuffer.left = soundAlloc(&gNotesAndBuffersPool, reverb->windowSize * 2);
+ reverb->ringBuffer.right = soundAlloc(&gNotesAndBuffersPool, reverb->windowSize * 2);
+ reverb->nextRingBufferPos = 0;
+ reverb->unkC = 0;
+ reverb->curFrame = 0;
+ reverb->bufSizePerChannel = reverb->windowSize;
+ reverb->framesLeftToIgnore = 2;
+ if (reverb->downsampleRate != 1) {
+ reverb->resampleFlags = A_INIT;
+ reverb->resampleRate = 0x8000 / reverb->downsampleRate;
+ reverb->resampleStateLeft = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ reverb->resampleStateRight = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ reverb->unk24 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ reverb->unk28 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ for (i = 0; i < gAudioBufferParameters.updatesPerFrame; i++) {
+ mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
+ reverb->items[0][i].toDownsampleLeft = mem;
+ reverb->items[0][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
+ mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
+ reverb->items[1][i].toDownsampleLeft = mem;
+ reverb->items[1][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
+ }
+ }
+ }
+
+#else
+ if (reverbWindowSize == 0) {
+ gSynthesisReverb.useReverb = 0;
+ } else {
+ gSynthesisReverb.useReverb = 8;
+ gSynthesisReverb.ringBuffer.left = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2);
+ gSynthesisReverb.ringBuffer.right = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2);
+ gSynthesisReverb.nextRingBufferPos = 0;
+ gSynthesisReverb.unkC = 0;
+ gSynthesisReverb.curFrame = 0;
+ gSynthesisReverb.bufSizePerChannel = reverbWindowSize;
+ gSynthesisReverb.reverbGain = preset->reverbGain;
+ gSynthesisReverb.framesLeftToIgnore = 2;
+ if (gReverbDownsampleRate != 1) {
+ gSynthesisReverb.resampleFlags = A_INIT;
+ gSynthesisReverb.resampleRate = 0x8000 / gReverbDownsampleRate;
+ gSynthesisReverb.resampleStateLeft = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ gSynthesisReverb.resampleStateRight = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ gSynthesisReverb.unk24 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ gSynthesisReverb.unk28 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
+ for (i = 0; i < gAudioUpdatesPerFrame; i++) {
+ mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
+ gSynthesisReverb.items[0][i].toDownsampleLeft = mem;
+ gSynthesisReverb.items[0][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
+ mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
+ gSynthesisReverb.items[1][i].toDownsampleLeft = mem;
+ gSynthesisReverb.items[1][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
+ }
+ }
+ }
+#endif
+
+ init_sample_dma_buffers(gMaxSimultaneousNotes);
+
+#ifdef VERSION_EU
+ build_vol_rampings_table(0, gAudioBufferParameters.samplesPerUpdate);
+#endif
+
+ osWritebackDCacheAll();
+
+#ifndef VERSION_EU
+ if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
+ gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
+ }
+#endif
+}
diff --git a/src/audio/heap.h b/src/audio/heap.h
@@ -0,0 +1,72 @@
+#ifndef AUDIO_HEAP_H
+#define AUDIO_HEAP_H
+
+#include "internal.h"
+
+#define SOUND_LOAD_STATUS_NOT_LOADED 0
+#define SOUND_LOAD_STATUS_IN_PROGRESS 1
+#define SOUND_LOAD_STATUS_COMPLETE 2
+#define SOUND_LOAD_STATUS_DISCARDABLE 3
+
+#define IS_BANK_LOAD_COMPLETE(bankId) (gBankLoadStatus[bankId] >= SOUND_LOAD_STATUS_COMPLETE)
+#define IS_SEQ_LOAD_COMPLETE(seqId) (gSeqLoadStatus[seqId] >= SOUND_LOAD_STATUS_COMPLETE)
+
+struct SoundAllocPool
+{
+ u8 *start;
+ u8 *cur;
+ u32 size;
+ s32 unused; // set to 0, never read
+}; // size = 0x10
+
+struct SeqOrBankEntry {
+ u8 *ptr;
+ u32 size;
+ s32 id; // seqId or bankId
+}; // size = 0xC
+
+struct PersistentPool
+{
+ /*0x00*/ u32 numEntries;
+ /*0x04*/ struct SoundAllocPool pool;
+ /*0x14*/ struct SeqOrBankEntry entries[32];
+}; // size = 0x194
+
+struct TemporaryPool
+{
+ /*0x00*/ u32 nextSide;
+ /*0x04*/ struct SoundAllocPool pool;
+ /*0x14*/ struct SeqOrBankEntry entries[2];
+}; // size = 0x2C
+
+struct SoundMultiPool
+{
+ /*0x000*/ struct PersistentPool persistent;
+ /*0x194*/ struct TemporaryPool temporary;
+ /* */ u32 pad2[4];
+}; // size = 0x1D0
+
+extern u8 gAudioHeap[];
+extern s16 gVolume;
+extern s8 gReverbDownsampleRate;
+extern struct SoundAllocPool gAudioInitPool;
+extern struct SoundAllocPool gNotesAndBuffersPool;
+extern struct SoundMultiPool gSeqLoadedPool;
+extern struct SoundMultiPool gBankLoadedPool;
+extern u8 gBankLoadStatus[64];
+extern u8 gSeqLoadStatus[256];
+extern volatile u8 gAudioResetStatus;
+extern u8 gAudioResetPresetIdToLoad;
+
+void *soundAlloc(struct SoundAllocPool *pool, u32 size);
+void sound_init_main_pools(s32 sizeForAudioInitPool);
+void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id);
+void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 arg2);
+#ifdef VERSION_EU
+s32 audio_shut_down_and_reset_step(void);
+void audio_reset_session(void);
+#else
+void audio_reset_session(struct AudioSessionSettings *preset);
+#endif
+
+#endif /* AUDIO_HEAP_H */
diff --git a/src/audio/internal.h b/src/audio/internal.h
@@ -215,7 +215,7 @@ struct SequencePlayer
/*0x000, 0x000*/ u8 seqDmaInProgress : 1;
/*0x000, 0x000*/ u8 bankDmaInProgress : 1;
#ifdef VERSION_EU
- /* 0x000*/ u8 unk_eu : 1;
+ /* 0x000*/ u8 recalculateVolume : 1;
#endif
#ifndef VERSION_EU
/*0x001 */ s8 seqVariation;
@@ -251,8 +251,8 @@ struct SequencePlayer
/*0x020, 0x020*/ f32 volume; // set to 0.0f
/*0x024, 0x024*/ f32 muteVolumeScale; // set to 0.5f
#ifdef VERSION_EU
- /* , 0x028*/ f32 unkEu28;
- /* , 0x02C*/ f32 unkEu2C;
+ /* , 0x028*/ f32 fadeVolumeScale;
+ /* , 0x02C*/ f32 appliedFadeVolume;
#else
/* */ u8 pad2[4];
#endif
@@ -340,12 +340,12 @@ struct SequenceChannel
#ifdef VERSION_EU
/* , 0x01*/ union {
struct {
- u8 unk0b80 : 1;
- u8 unk0b40 : 1;
- u8 unk0b20 : 1;
+ u8 freqScale : 1;
+ u8 volume : 1;
+ u8 pan : 1;
} as_bitfields;
u8 as_u8;
- } unk1;
+ } changes;
#endif
/*0x01, 0x02*/ u8 noteAllocPolicy;
/*0x02, 0x03*/ u8 muteBehavior;
@@ -354,9 +354,9 @@ struct SequenceChannel
/*0x05, 0x06*/ u8 bankId;
#ifdef VERSION_EU
/* , 0x07*/ u8 reverbIndex;
- /* , 0x08*/ u8 unk8;
- /* , 0x09*/ u8 unk9;
- /* , 0x0A*/ u8 unkA;
+ /* , 0x08*/ u8 bookOffset;
+ /* , 0x09*/ u8 newPan;
+ /* , 0x0A*/ u8 panChannelWeight; // proportion of pan that comes from the channel (0..128)
#else
/*0x06, */ u8 updatesPerFrameUnused;
#endif
@@ -374,11 +374,12 @@ struct SequenceChannel
/*0x1C, 0x20*/ f32 volumeScale;
/*0x20, 0x24*/ f32 volume;
#ifndef VERSION_EU
- /*0x24, 0x28*/ f32 pan;
+ /*0x24, */ f32 pan;
+ /*0x28, */ f32 panChannelWeight; // proportion of pan that comes from the channel (0..1)
#else
- /*0x24, 0x28*/ s32 pan;
+ /* , 0x28*/ s32 pan;
+ /* , 0x2C*/ f32 appliedVolume;
#endif
- /*0x28, 0x2C*/ f32 panChannelWeight; // proportion of pan that comes from the channel (0..1)
/*0x2C, 0x30*/ f32 freqScale;
/*0x30, 0x34*/ u8 (*dynTable)[][2];
/*0x34, ????*/ struct Note *noteUnused; // never read
@@ -401,16 +402,16 @@ struct SequenceChannelLayer // Maybe SequenceTrack?
/*0x00, 0x00*/ u8 stopSomething : 1; // ?
/*0x00, 0x00*/ u8 continuousNotes : 1; // keep the same note for consecutive notes with the same sound
#ifdef VERSION_EU
- /* , 0x00*/ u8 unkEu0b8 : 1;
- /* , 0x00*/ u8 unkEu0b4 : 1;
- /* , 0x00*/ u8 unkEu0b2 : 1;
- /* , 0x01*/ u8 euUnk1; // euInstOrWave?
+ /* , 0x00*/ u8 unusedEu0b8 : 1;
+ /* , 0x00*/ u8 notePropertiesNeedInit : 1;
+ /* , 0x00*/ u8 ignoreDrumPan : 1;
+ /* , 0x01*/ u8 instOrWave;
#endif
/*0x01, 0x02*/ u8 status;
/*0x02, 0x03*/ u8 noteDuration; // set to 0x80
/*0x03, 0x04*/ u8 portamentoTargetNote;
#ifdef VERSION_EU
- /* , 0x05*/ u8 euUnk5; // contains US/JP pan * 128.0f
+ /* , 0x05*/ u8 pan; // 0..128
/* , 0x06*/ u8 notePan;
#endif
/*0x04, 0x08*/ struct Portamento portamento;
@@ -422,7 +423,7 @@ struct SequenceChannelLayer // Maybe SequenceTrack?
/*0x20, 0x24*/ f32 freqScale;
/*0x24, 0x28*/ f32 velocitySquare;
#ifndef VERSION_EU
- /*0x28*/ f32 pan;
+ /*0x28, */ f32 pan; // 0..1
#endif
/*0x2C, 0x2C*/ f32 noteVelocity;
#ifndef VERSION_EU
@@ -452,7 +453,7 @@ struct NoteSynthesisState
/*0x01*/ u8 sampleDmaIndex;
/*0x02*/ u8 prevHeadsetPanRight;
/*0x03*/ u8 prevHeadsetPanLeft;
- /* */ u16 samplePosFrac; //?
+ /*0x04*/ u16 samplePosFrac;
/*0x08*/ s32 samplePosInt;
/*0x0C*/ struct NoteSynthesisBuffers *synthesisBuffers;
/*0x10*/ s16 curVolLeft;
@@ -485,8 +486,8 @@ struct NoteSubEu
/*0x00*/ u8 stereoStrongLeft : 1;
/*0x00*/ u8 stereoHeadsetEffects : 1;
/*0x00*/ u8 usesHeadsetPanEffects : 1;
- /*0x01*/ u8 unk1b567 : 3;
- /*0x01*/ u8 unk1b234 : 3;
+ /*0x01*/ u8 reverbIndex : 3;
+ /*0x01*/ u8 bookOffset : 3;
/*0x01*/ u8 isSyntheticWave : 1;
/*0x01*/ u8 hasTwoAdpcmParts : 1;
/*0x02*/ u8 bankId;
@@ -506,7 +507,9 @@ struct Note
/* U/J, EU */
/*0xA4, 0x00*/ struct AudioListItem listItem;
/* 0x10*/ struct NoteSynthesisState synthesisState;
+#ifdef TARGET_N64
u8 pad0[12];
+#endif
/*0x04, 0x30*/ u8 priority;
/* 0x31*/ u8 waveId;
/* 0x32*/ u8 sampleCountIndex;
@@ -643,20 +646,40 @@ struct AudioBufferParametersEU {
struct EuAudioCmd {
union {
+#if IS_BIG_ENDIAN
struct {
u8 op;
u8 arg1;
u8 arg2;
u8 arg3;
} s;
+#else
+ struct {
+ u8 arg3;
+ u8 arg2;
+ u8 arg1;
+ u8 op;
+ } s;
+#endif
s32 first;
} u;
union {
s32 as_s32;
u32 as_u32;
f32 as_f32;
+#if IS_BIG_ENDIAN
u8 as_u8;
s8 as_s8;
+#else
+ struct {
+ u8 pad0[3];
+ u8 as_u8;
+ };
+ struct {
+ u8 pad1[3];
+ s8 as_s8;
+ };
+#endif
} u2;
};
diff --git a/src/audio/load.c b/src/audio/load.c
@@ -2,7 +2,7 @@
#include <macros.h>
#include "load.h"
-#include "memory.h"
+#include "heap.h"
#include "data.h"
#include "seqplayer.h"
@@ -19,8 +19,7 @@ struct SharedDma {
}; // size = 0x10
// EU only
-void func_802ada64(void);
-s32 func_eu_802E2AA0(void);
+void port_eu_init(void);
struct Note *gNotes;
@@ -425,27 +424,27 @@ void patch_sound(UNUSED struct AudioBankSound *sound, UNUSED u8 *memBase, UNUSED
}
#ifndef VERSION_EU
-#define PATCH_SOUND(_sound, mem, offset) \
-{ \
- struct AudioBankSound *sound = _sound; \
- struct AudioBankSample *sample; \
- void *patched; \
- if ((*sound).sample != (void *) 0) \
- { \
- patched = (void *)(((unsigned int)(*sound).sample) + ((unsigned int)((unsigned char *) mem))); \
- (*sound).sample = patched; \
- sample = (*sound).sample; \
- if ((*sample).loaded == 0) \
- { \
- patched = (void *)(((unsigned int)(*sample).sampleAddr) + ((unsigned int) offset)); \
- (*sample).sampleAddr = patched; \
- patched = (void *)(((unsigned int)(*sample).loop) + ((unsigned int)((unsigned char *) mem))); \
- (*sample).loop = patched; \
- patched = (void *)(((unsigned int)(*sample).book) + ((unsigned int)((unsigned char *) mem))); \
- (*sample).book = patched; \
- (*sample).loaded = 1; \
- } \
- } \
+#define PATCH_SOUND(_sound, mem, offset) \
+{ \
+ struct AudioBankSound *sound = _sound; \
+ struct AudioBankSample *sample; \
+ void *patched; \
+ if ((*sound).sample != (void *) 0) \
+ { \
+ patched = (void *)(((uintptr_t)(*sound).sample) + ((uintptr_t)((u8 *) mem))); \
+ (*sound).sample = patched; \
+ sample = (*sound).sample; \
+ if ((*sample).loaded == 0) \
+ { \
+ patched = (void *)(((uintptr_t)(*sample).sampleAddr) + ((uintptr_t) offset)); \
+ (*sample).sampleAddr = patched; \
+ patched = (void *)(((uintptr_t)(*sample).loop) + ((uintptr_t)((u8 *) mem))); \
+ (*sample).loop = patched; \
+ patched = (void *)(((uintptr_t)(*sample).book) + ((uintptr_t)((u8 *) mem))); \
+ (*sample).book = patched; \
+ (*sample).loaded = 1; \
+ } \
+ } \
}
#endif
@@ -469,7 +468,7 @@ void patch_audio_bank(struct AudioBank *mem, u8 *offset, u32 numInstruments, u32
drums = mem->drums;
#ifndef VERSION_EU
if (drums != NULL && numDrums > 0) {
- mem->drums = (void *)((unsigned int) drums + (unsigned int) mem);
+ mem->drums = (void *)((uintptr_t) drums + (uintptr_t) mem);
if (numDrums > 0) //! unneeded when -sopt is enabled
for (i = 0; i < numDrums; i++) {
#else
@@ -923,7 +922,7 @@ void audio_init() {
D_EU_802298D0 = 20.03042f;
gRefreshRate = 50;
- func_802ada64();
+ port_eu_init();
if (k) {
}
#endif
@@ -958,7 +957,7 @@ void audio_init() {
#ifdef VERSION_EU
gAudioResetPresetIdToLoad = 0;
gAudioResetStatus = 1;
- func_eu_802E2AA0();
+ audio_shut_down_and_reset_step();
#else
audio_reset_session(&gAudioSessionPresets[0]);
#endif
diff --git a/src/audio/memory.c b/src/audio/memory.c
@@ -1,899 +0,0 @@
-#include <ultra64.h>
-#include <macros.h>
-
-#include "memory.h"
-#include "data.h"
-#include "load.h"
-#include "synthesis.h"
-#include "seqplayer.h"
-#include "effects.h"
-
-#define ALIGN16(val) (((val) + 0xF) & ~0xF)
-
-struct PoolSplit {
- u32 wantSeq;
- u32 wantBank;
- u32 wantUnused;
- u32 wantCustom;
-}; // size = 0x10
-
-struct PoolSplit2 {
- u32 wantPersistent;
- u32 wantTemporary;
-}; // size = 0x8
-
-#ifndef VERSION_EU
-s16 gVolume;
-s8 gReverbDownsampleRate;
-u8 sReverbDownsampleRateLog; // never read
-#endif
-
-struct SoundAllocPool gAudioSessionPool;
-struct SoundAllocPool gAudioInitPool;
-struct SoundAllocPool gNotesAndBuffersPool;
-u8 sAudioMemoryPad[0x20]; // probably two unused pools
-struct SoundAllocPool gSeqAndBankPool;
-struct SoundAllocPool gPersistentCommonPool;
-struct SoundAllocPool gTemporaryCommonPool;
-
-struct SoundMultiPool gSeqLoadedPool;
-struct SoundMultiPool gBankLoadedPool;
-struct SoundMultiPool gUnusedLoadedPool;
-
-struct PoolSplit sSessionPoolSplit;
-struct PoolSplit2 sSeqAndBankPoolSplit;
-struct PoolSplit sPersistentCommonPoolSplit;
-struct PoolSplit sTemporaryCommonPoolSplit;
-
-u8 gBankLoadStatus[0x40];
-u8 gSeqLoadStatus[0x100];
-
-#ifdef VERSION_EU
-volatile u8 gAudioResetStatus;
-u8 gAudioResetPresetIdToLoad;
-s32 gAudioResetFadeOutFramesLeft;
-#endif
-
-u8 gAudioUnusedBuffer[0x1000];
-
-extern s32 gMaxAudioCmds;
-
-#ifdef VERSION_EU
-/**
- * Assuming 'k' in [9, 24],
- * Computes a newton's method step for f(x) = x^k - d
- */
-f64 root_newton_step(f64 x, s32 k, f64 d)
-{
- f64 deg2 = x * x;
- f64 deg4 = deg2 * deg2;
- f64 deg8 = deg4 * deg4;
- s32 degree = k - 9;
- f64 fx;
-
- f64 deriv = deg8;
- if (degree & 1) {
- deriv *= x;
- }
- if (degree & 2) {
- deriv *= deg2;
- }
- if (degree & 4) {
- deriv *= deg4;
- }
- if (degree & 8) {
- deriv *= deg8;
- }
- fx = deriv * x - d;
- deriv = k * deriv;
- return x - fx / deriv;
-}
-
-/**
- * Assuming 'k' in [9, 24],
- * Computes d ^ (1/k)
- *
- * @return the root, or 1.0 if d is 0
- */
-f64 kth_root(f64 d, s32 k)
-{
- f64 root = 1.5;
- f64 next;
- f64 diff;
- s32 i;
- if (d == 0.0) {
- root = 1.0;
- } else {
- for (i = 0; i < 64; i++) {
- if (1) {
- }
- next = root_newton_step(root, k, d);
- diff = next - root;
-
- if (diff < 0) {
- diff = -diff;
- }
-
- if (diff < 1e-07) {
- root = next;
- break;
- } else {
- root = next;
- }
- }
- }
-
- return root;
-}
-#endif
-
-#ifdef VERSION_EU
-void func_eu_802e1cd0(s32 UNUSED unused, s32 len) {
- s32 i;
- s32 step;
- s32 d;
- s32 k = len / 8;
-
- for (step = 0, i = 0; i < 0x400; step += 32, i++) {
- d = step;
- if (step == 0) {
- d = 1;
- }
-
- gLeftVolRampings[0][i] = kth_root( d, k - 1);
- gRightVolRampings[0][i] = kth_root(1.0 / d, k - 1) * 65536.0;
- gLeftVolRampings[1][i] = kth_root( d, k);
- gRightVolRampings[1][i] = kth_root(1.0 / d, k) * 65536.0;
- gLeftVolRampings[2][i] = kth_root( d, k + 1);
- gRightVolRampings[2][i] = kth_root(1.0 / d, k + 1) * 65536.0;
- }
-}
-#endif
-
-void reset_bank_and_seq_load_status(void) {
- s32 i;
-
- for (i = 0; i < 64; i++) {
- gBankLoadStatus[i] = SOUND_LOAD_STATUS_NOT_LOADED;
- }
-
- for (i = 0; i < 256; i++) {
- gSeqLoadStatus[i] = SOUND_LOAD_STATUS_NOT_LOADED;
- }
-}
-
-void discard_bank(s32 bankId) {
- s32 i;
-
- for (i = 0; i < gMaxSimultaneousNotes; i++) {
- struct Note *note = &gNotes[i];
-
-#ifdef VERSION_EU
- if (note->noteSubEu.bankId == bankId) {
-#else
- if (note->bankId == bankId) {
-#endif
- if (note->priority >= NOTE_PRIORITY_MIN) {
- note->parentLayer->enabled = FALSE;
- note->parentLayer->finished = TRUE;
- }
- note_disable(note);
- audio_list_remove(¬e->listItem);
- audio_list_push_back(&gNoteFreeLists.disabled, ¬e->listItem);
- }
- }
-}
-
-void discard_sequence(s32 seqId) {
- s32 i;
-
- for (i = 0; i < SEQUENCE_PLAYERS; i++) {
- if (gSequencePlayers[i].enabled && gSequencePlayers[i].seqId == seqId) {
-#ifdef VERSION_EU
- sequence_player_disable(&gSequencePlayers[i]);
-#else
- sequence_player_disable(gSequencePlayers + i);
-#endif
- }
- }
-}
-
-void *soundAlloc(struct SoundAllocPool *pool, u32 size) {
-#ifdef VERSION_EU
- u8 *start;
- u8 *pos;
- u32 alignedSize = ALIGN16(size);
-
- start = pool->cur;
- if (start + alignedSize <= pool->start + pool->size) {
- pool->cur += alignedSize;
- for (pos = start; pos < pool->cur; pos++) {
- *pos = 0;
- }
- } else {
- return NULL;
- }
- return start;
-#else
- u8 *start;
- s32 last;
- s32 i;
-
- if ((pool->cur + ALIGN16(size) <= pool->size + pool->start)) {
- start = pool->cur;
- pool->cur += ALIGN16(size);
- last = pool->cur - start - 1;
- for (i = 0; i <= last; i++) {
- start[i] = 0;
- }
- } else {
- return NULL;
- }
- return start;
-#endif
-}
-
-void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size) {
- pool->cur = pool->start = (u8 *) ALIGN16((uintptr_t) memAddr);
- pool->size = size;
- pool->unused = 0;
-}
-
-void persistent_pool_clear(struct PersistentPool *persistent) {
- persistent->pool.unused = 0;
- persistent->pool.cur = persistent->pool.start;
- persistent->numEntries = 0;
-}
-
-void temporary_pool_clear(struct TemporaryPool *temporary) {
- temporary->pool.unused = 0;
- temporary->pool.cur = temporary->pool.start;
- temporary->nextSide = 0;
- temporary->entries[0].ptr = temporary->pool.start;
-#ifdef VERSION_EU
- temporary->entries[1].ptr = temporary->pool.start + temporary->pool.size;
-#else
- temporary->entries[1].ptr = temporary->pool.size + temporary->pool.start;
-#endif
- temporary->entries[0].id = -1;
- temporary->entries[1].id = -1;
-}
-
-void unused_803160F8(struct SoundAllocPool *pool) {
- pool->unused = 0;
- pool->cur = pool->start;
-}
-
-void sound_init_main_pools(s32 sizeForAudioInitPool) {
- sound_alloc_pool_init(&gAudioInitPool, gAudioHeap, sizeForAudioInitPool);
- sound_alloc_pool_init(&gAudioSessionPool, gAudioHeap + sizeForAudioInitPool, gAudioHeapSize - sizeForAudioInitPool);
-}
-
-void session_pools_init(struct PoolSplit *a) {
- gAudioSessionPool.cur = gAudioSessionPool.start;
- sound_alloc_pool_init(&gNotesAndBuffersPool, soundAlloc(&gAudioSessionPool, a->wantSeq), a->wantSeq);
- sound_alloc_pool_init(&gSeqAndBankPool, soundAlloc(&gAudioSessionPool, a->wantCustom), a->wantCustom);
-}
-
-void seq_and_bank_pool_init(struct PoolSplit2 *a) {
- gSeqAndBankPool.cur = gSeqAndBankPool.start;
- sound_alloc_pool_init(&gPersistentCommonPool, soundAlloc(&gSeqAndBankPool, a->wantPersistent), a->wantPersistent);
- sound_alloc_pool_init(&gTemporaryCommonPool, soundAlloc(&gSeqAndBankPool, a->wantTemporary), a->wantTemporary);
-}
-
-void persistent_pools_init(struct PoolSplit *a) {
- gPersistentCommonPool.cur = gPersistentCommonPool.start;
- sound_alloc_pool_init(&gSeqLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantSeq), a->wantSeq);
- sound_alloc_pool_init(&gBankLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantBank), a->wantBank);
- sound_alloc_pool_init(&gUnusedLoadedPool.persistent.pool, soundAlloc(&gPersistentCommonPool, a->wantUnused),
- a->wantUnused);
- persistent_pool_clear(&gSeqLoadedPool.persistent);
- persistent_pool_clear(&gBankLoadedPool.persistent);
- persistent_pool_clear(&gUnusedLoadedPool.persistent);
-}
-
-void temporary_pools_init(struct PoolSplit *a) {
- gTemporaryCommonPool.cur = gTemporaryCommonPool.start;
- sound_alloc_pool_init(&gSeqLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantSeq), a->wantSeq);
- sound_alloc_pool_init(&gBankLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantBank), a->wantBank);
- sound_alloc_pool_init(&gUnusedLoadedPool.temporary.pool, soundAlloc(&gTemporaryCommonPool, a->wantUnused),
- a->wantUnused);
- temporary_pool_clear(&gSeqLoadedPool.temporary);
- temporary_pool_clear(&gBankLoadedPool.temporary);
- temporary_pool_clear(&gUnusedLoadedPool.temporary);
-}
-
-#ifndef VERSION_EU
-static void unused_803163D4() {
-}
-#endif
-
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-GLOBAL_ASM("asm/non_matchings/eu/audio/alloc_bank_or_seq.s")
-#else
-
-#ifdef NON_MATCHING
-void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id) {
- // arg3 = 0, 1 or 2?
-
- u8 *table; // sp5C
- u8 isSound; // sp5B
- struct SoundAllocPool *pool;
- void *ret;
- u32 firstVal;
- u32 secondVal;
- u32 bothDiscardable;
- u32 leftDiscardable, rightDiscardable;
- u32 leftNotLoaded, rightNotLoaded;
- u32 leftAvail, rightAvail;
- UNUSED s32 temp;
- struct TemporaryPool *v1; // sp30
- struct PersistentPool *persistent = &arg0->persistent;
-
- if (arg3 == 0) {
- v1 = &arg0->temporary;
- if (arg0 == &gSeqLoadedPool) {
- table = gSeqLoadStatus;
- isSound = FALSE;
- } else if (arg0 == &gBankLoadedPool) {
- table = gBankLoadStatus;
- isSound = TRUE;
- }
-
- firstVal = (v1->entries[0].id == -1 ? SOUND_LOAD_STATUS_NOT_LOADED
- : table[v1->entries[0].id]); // a3, a2
- secondVal =
- (v1->entries[1].id == -1 ? SOUND_LOAD_STATUS_NOT_LOADED : table[v1->entries[1].id]); // a1
- leftNotLoaded = (firstVal == SOUND_LOAD_STATUS_NOT_LOADED);
- leftDiscardable = (firstVal == SOUND_LOAD_STATUS_DISCARDABLE); // t0
- leftAvail = (firstVal != SOUND_LOAD_STATUS_IN_PROGRESS);
- rightNotLoaded = (secondVal == SOUND_LOAD_STATUS_NOT_LOADED);
- rightDiscardable = (secondVal == SOUND_LOAD_STATUS_DISCARDABLE);
- rightAvail = (secondVal != SOUND_LOAD_STATUS_IN_PROGRESS);
- bothDiscardable = (leftDiscardable && rightDiscardable); // a0
-
- if (leftNotLoaded) {
- v1->nextSide = 0;
- } else if (rightNotLoaded) {
- v1->nextSide = 1;
- } else if (bothDiscardable) {
- // Use the opposite side from last time.
- } else if (leftDiscardable) {
- v1->nextSide = 0;
- } else if (rightDiscardable) {
- v1->nextSide = 1;
- } else if (leftAvail) {
- v1->nextSide = 0;
- } else if (rightAvail) {
- v1->nextSide = 1;
- } else {
- // Both left and right sides are being loaded into.
- return NULL;
- }
-
- if (v1->entries[v1->nextSide].id != -1) {
- table[v1->entries[v1->nextSide].id] = SOUND_LOAD_STATUS_NOT_LOADED;
- if (isSound == TRUE) {
- discard_bank(v1->entries[v1->nextSide].id);
- }
- }
-
- pool = &arg0->temporary.pool; // a1
- switch (v1->nextSide) {
- case 0:
- v1->entries[0].ptr = pool->start;
- v1->entries[0].id = id;
- v1->entries[0].size = size;
-
- pool->cur = pool->start + size;
-
- if (v1->entries[1].ptr < pool->cur) {
- // Throw out the entry on the other side if it doesn't fit.
- // (possible @bug: what if it's currently being loaded?)
- table[v1->entries[1].id] = SOUND_LOAD_STATUS_NOT_LOADED;
-
- switch (isSound) {
- case FALSE:
- discard_sequence(v1->entries[1].id);
- break;
- case TRUE:
- discard_bank(v1->entries[1].id);
- break;
- }
-
- v1->entries[1].id = -1;
- v1->entries[1].ptr = pool->size + pool->start;
- }
-
- ret = v1->entries[0].ptr;
- break;
-
- case 1:
- v1->entries[1].ptr = pool->size + pool->start - size - 0x10;
- v1->entries[1].id = id;
- v1->entries[1].size = size;
-
- if (v1->entries[1].ptr < pool->cur) {
- table[v1->entries[0].id] = SOUND_LOAD_STATUS_NOT_LOADED;
-
- switch (isSound) {
- case FALSE:
- discard_sequence(v1->entries[0].id);
- break;
- case TRUE:
- discard_bank(v1->entries[0].id);
- break;
- }
-
- v1->entries[0].id = -1;
- pool->cur = pool->start;
- }
-
- ret = v1->entries[1].ptr;
- break;
-
- default:
- return NULL;
- }
-
- // Switch sides for next time in case both entries are
- // SOUND_LOAD_STATUS_DISCARDABLE.
- v1->nextSide ^= 1;
-
- return ret;
- }
-
- persistent->entries[persistent->numEntries].ptr = soundAlloc(&persistent->pool, arg1 * size);
-
- if (persistent->entries[persistent->numEntries].ptr == NULL) {
- switch (arg3) {
- case 2:
- // Prevent tail call optimization.
- ret = alloc_bank_or_seq(arg0, arg1, size, 0, id);
- return ret;
- case 1:
- return NULL;
- }
- }
-
- // TODO: why is this guaranteed to write <= 32 entries...?
- // Because the buffer is small enough that more don't fit?
- persistent->entries[persistent->numEntries].id = id;
- persistent->entries[persistent->numEntries].size = size;
- persistent->numEntries++;
- return persistent->entries[persistent->numEntries - 1].ptr;
-}
-
-#else
-GLOBAL_ASM("asm/non_matchings/alloc_bank_or_seq.s")
-#endif
-#endif
-
-void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id) {
- u32 i;
- UNUSED void *ret;
- struct TemporaryPool *temporary = &arg0->temporary;
-
- if (arg1 == 0) {
- // Try not to overwrite sound that we have just accessed, by setting nextSide appropriately.
- if (temporary->entries[0].id == id) {
- temporary->nextSide = 1;
- return temporary->entries[0].ptr;
- } else if (temporary->entries[1].id == id) {
- temporary->nextSide = 0;
- return temporary->entries[1].ptr;
- }
- return NULL;
- } else {
- struct PersistentPool *persistent = &arg0->persistent;
- for (i = 0; i < persistent->numEntries; i++) {
- if (id == persistent->entries[i].id) {
- return persistent->entries[i].ptr;
- }
- }
-
- if (arg1 == 2) {
-#ifdef VERSION_EU
- return get_bank_or_seq(arg0, 0, id);
-#else
- // Prevent tail call optimization by using a temporary.
- // (Did they compile with -Wo,-notail?)
- ret = get_bank_or_seq(arg0, 0, id);
- return ret;
-#endif
- }
- return NULL;
- }
-}
-
-#ifdef VERSION_EU
-void func_eu_802e27e4_unused(f32 arg0, f32 arg1, u16 *arg2) {
- s32 i;
- f32 tmp[16];
-
- tmp[0] = (f32) (arg1 * 262159.0f);
- tmp[8] = (f32) (arg0 * 262159.0f);
- tmp[1] = (f32) ((arg1 * arg0) * 262159.0f);
- tmp[9] = (f32) (((arg0 * arg0) + arg1) * 262159.0f);
-
- for (i = 2; i < 8; i++) {
- //! @bug they probably meant to store the value to tmp[i] and tmp[8 + i]
- arg2[i] = arg1 * tmp[i - 2] + arg0 * tmp[i - 1];
- arg2[8 + i] = arg1 * tmp[6 + i] + arg0 * tmp[7 + i];
- }
-
- for (i = 0; i < 16; i++) {
- arg2[i] = tmp[i];
- }
-
- for (i = 0; i < 8; i++) {
- }
-
- for (i = 8; i < 16; i += 4) {
- }
-}
-#endif
-
-#ifdef VERSION_EU
-void decrease_reverb_gain(void) {
- s32 i;
- for (i = 0; i < gNumSynthesisReverbs; i++) {
- gSynthesisReverbs[i].reverbGain -= gSynthesisReverbs[i].reverbGain / 8;
- }
-}
-#else
-void decrease_reverb_gain(void) {
- gSynthesisReverb.reverbGain -= gSynthesisReverb.reverbGain / 4;
-}
-#endif
-
-#ifdef VERSION_EU
-s32 func_eu_802E2AA0(void) {
- s32 i;
- s32 j;
- switch (gAudioResetStatus) {
- case 5:
- for (i = 0; i < SEQUENCE_PLAYERS; i++) {
- sequence_player_disable(&gSequencePlayers[i]);
- }
- gAudioResetFadeOutFramesLeft = 4;
- gAudioResetStatus--;
- break;
- case 4:
- if (gAudioResetFadeOutFramesLeft != 0) {
- gAudioResetFadeOutFramesLeft--;
- decrease_reverb_gain();
- } else {
- for (i = 0; i < gMaxSimultaneousNotes; i++) {
- if (gNotes[i].noteSubEu.enabled && gNotes[i].adsr.state != ADSR_STATE_DISABLED) {
- gNotes[i].adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv;
- gNotes[i].adsr.action |= ADSR_ACTION_RELEASE;
- }
- }
- gAudioResetFadeOutFramesLeft = 16;
- gAudioResetStatus--;
- }
- break;
- case 3:
- if (gAudioResetFadeOutFramesLeft != 0) {
- gAudioResetFadeOutFramesLeft--;
- decrease_reverb_gain();
- } else {
- for (i = 0; i < NUMAIBUFFERS; i++) {
- for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) {
- gAiBuffers[i][j] = 0;
- }
- }
- gAudioResetFadeOutFramesLeft = 4;
- gAudioResetStatus--;
- }
- break;
- case 2:
- if (gAudioResetFadeOutFramesLeft != 0) {
- gAudioResetFadeOutFramesLeft--;
- } else {
- gAudioResetStatus--;
- }
- break;
- case 1:
- audio_reset_session();
- gAudioResetStatus = 0;
- }
- if (gAudioResetStatus < 3) {
- return 0;
- }
- return 1;
-}
-#else
-/**
- * Waits until a specified number of audio frames have been created
- */
-void wait_for_audio_frames(s32 frames) {
- gAudioFrameCount = 0;
- // Sound thread will update gAudioFrameCount
- while (gAudioFrameCount < frames) {
- // spin
- }
-}
-#endif
-
-#ifndef VERSION_EU
-void audio_reset_session(struct AudioSessionSettings *preset) {
-#else
-void audio_reset_session(void) {
- // TODO: verify compilation again and try to match better
- struct AudioSessionSettingsEU *preset = &gAudioSessionPresets[gAudioResetPresetIdToLoad];
- struct ReverbSettingsEU *reverbSettings;
-#endif
- s16 *mem;
-#ifndef VERSION_EU
- s8 updatesPerFrame;
- s32 reverbWindowSize;
- s32 k;
-#endif
- s32 i;
- s32 j;
- s32 persistentMem;
- s32 temporaryMem;
- s32 totalMem;
- s32 wantMisc;
-#ifndef VERSION_EU
- s32 frames;
- s32 remainingDmas;
-#endif
-#ifdef VERSION_EU
- struct SynthesisReverb *reverb;
-#endif
-
-#ifndef VERSION_EU
- if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
- decrease_reverb_gain();
- for (i = 0; i < gMaxSimultaneousNotes; i++) {
- if (gNotes[i].enabled && gNotes[i].adsr.state != ADSR_STATE_DISABLED) {
- gNotes[i].adsr.fadeOutVel = 0x8000 / gAudioUpdatesPerFrame;
- gNotes[i].adsr.action |= ADSR_ACTION_RELEASE;
- }
- }
-
- // Wait for all notes to stop playing
- frames = 0;
- for (;;) {
- wait_for_audio_frames(1);
- frames++;
- if (frames > 4 * 60) {
- // Break after 4 seconds
- break;
- }
-
- for (i = 0; i < gMaxSimultaneousNotes; i++) {
- if (gNotes[i].enabled)
- break;
- }
-
- if (i == gMaxSimultaneousNotes) {
- // All zero, break early
- break;
- }
- }
-
- // Wait for the reverb to finish as well
- decrease_reverb_gain();
- wait_for_audio_frames(3);
-
- // The audio interface is double buffered; thus, we have to take the
- // load lock for 2 frames for the buffers to free up before we can
- // repurpose memory. Make that 3 frames, just in case.
- gAudioLoadLock = AUDIO_LOCK_LOADING;
- wait_for_audio_frames(3);
-
- remainingDmas = gCurrAudioFrameDmaCount;
- while (remainingDmas > 0) {
- for (i = 0; i < gCurrAudioFrameDmaCount; i++) {
- if (osRecvMesg(&gCurrAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0)
- remainingDmas--;
- }
- }
- gCurrAudioFrameDmaCount = 0;
-
- for (j = 0; j < NUMAIBUFFERS; j++) {
- for (k = 0; k < (s32) (AIBUFFER_LEN / sizeof(s16)); k++) {
- gAiBuffers[j][k] = 0;
- }
- }
- }
-#endif
-
- gSampleDmaNumListItems = 0;
-#ifdef VERSION_EU
- gAudioBufferParameters.frequency = preset->frequency;
- gAudioBufferParameters.aiFrequency = osAiSetFrequency(gAudioBufferParameters.frequency);
- gAudioBufferParameters.samplesPerFrameTarget = ALIGN16(gAudioBufferParameters.frequency / gRefreshRate);
- gAudioBufferParameters.minAiBufferLength = gAudioBufferParameters.samplesPerFrameTarget - 0x10;
- gAudioBufferParameters.maxAiBufferLength = gAudioBufferParameters.samplesPerFrameTarget + 0x10;
- gAudioBufferParameters.updatesPerFrame = (gAudioBufferParameters.samplesPerFrameTarget + 0x10) / 160 + 1;
- gAudioBufferParameters.samplesPerUpdate = (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & 0xfff8;
- gAudioBufferParameters.samplesPerUpdateMax = gAudioBufferParameters.samplesPerUpdate + 8;
- gAudioBufferParameters.samplesPerUpdateMin = gAudioBufferParameters.samplesPerUpdate - 8;
- gAudioBufferParameters.resampleRate = 32000.0f / FLOAT_CAST(gAudioBufferParameters.frequency);
- gAudioBufferParameters.unkUpdatesPerFrameScaled = (3.0f / 1280.0f) / gAudioBufferParameters.updatesPerFrame;
- gAudioBufferParameters.updatesPerFrameInv = 1.0f / gAudioBufferParameters.updatesPerFrame;
-
- gMaxSimultaneousNotes = preset->maxSimultaneousNotes;
- gVolume = preset->volume;
- gTempoInternalToExternal = (u32) (gAudioBufferParameters.updatesPerFrame * 2880000.0f / gTatumsPerBeat / D_EU_802298D0);
-
- gAudioBufferParameters.presetUnk4 = preset->unk1;
- gAudioBufferParameters.samplesPerFrameTarget *= gAudioBufferParameters.presetUnk4;
- gAudioBufferParameters.maxAiBufferLength *= gAudioBufferParameters.presetUnk4;
- gAudioBufferParameters.minAiBufferLength *= gAudioBufferParameters.presetUnk4;
- gAudioBufferParameters.updatesPerFrame *= gAudioBufferParameters.presetUnk4;
-
- gMaxAudioCmds = gMaxSimultaneousNotes * 0x10 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x300;
-#else
- reverbWindowSize = preset->reverbWindowSize;
- gAiFrequency = osAiSetFrequency(preset->frequency);
- gMaxSimultaneousNotes = preset->maxSimultaneousNotes;
- gSamplesPerFrameTarget = ALIGN16(gAiFrequency / 60);
- gReverbDownsampleRate = preset->reverbDownsampleRate;
-
- switch (gReverbDownsampleRate) {
- case 1:
- sReverbDownsampleRateLog = 0;
- break;
- case 2:
- sReverbDownsampleRateLog = 1;
- break;
- case 4:
- sReverbDownsampleRateLog = 2;
- break;
- case 8:
- sReverbDownsampleRateLog = 3;
- break;
- case 16:
- sReverbDownsampleRateLog = 4;
- break;
- default:
- sReverbDownsampleRateLog = 0;
- }
-
- gReverbDownsampleRate = preset->reverbDownsampleRate;
- gVolume = preset->volume;
- gMinAiBufferLength = gSamplesPerFrameTarget - 0x10;
- updatesPerFrame = gSamplesPerFrameTarget / 160 + 1;
- gAudioUpdatesPerFrame = gSamplesPerFrameTarget / 160 + 1;
-
- // Compute conversion ratio from the internal unit tatums/tick to the
- // external beats/minute (JP) or tatums/minute (US). In practice this is
- // 300 on JP and 14360 on US.
-#ifdef VERSION_JP
- gTempoInternalToExternal = updatesPerFrame * 3600 / gTatumsPerBeat;
-#else
- gTempoInternalToExternal = (u32)(updatesPerFrame * 2880000.0f / gTatumsPerBeat / 16.713f);
-#endif
- gMaxAudioCmds = gMaxSimultaneousNotes * 20 * updatesPerFrame + 320;
-#endif
-
-#ifdef VERSION_EU
- persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem + preset->persistentBankMem);
- temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem + preset->temporaryBankMem);
-#else
- persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem + preset->persistentSeqMem);
- temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem + preset->temporarySeqMem);
-#endif
- totalMem = persistentMem + temporaryMem;
- wantMisc = gAudioSessionPool.size - totalMem - 0x100;
- sSessionPoolSplit.wantSeq = wantMisc;
- sSessionPoolSplit.wantCustom = totalMem;
- session_pools_init(&sSessionPoolSplit);
- sSeqAndBankPoolSplit.wantPersistent = persistentMem;
- sSeqAndBankPoolSplit.wantTemporary = temporaryMem;
- seq_and_bank_pool_init(&sSeqAndBankPoolSplit);
- sPersistentCommonPoolSplit.wantSeq = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem);
- sPersistentCommonPoolSplit.wantBank = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem);
- sPersistentCommonPoolSplit.wantUnused = 0;
- persistent_pools_init(&sPersistentCommonPoolSplit);
- sTemporaryCommonPoolSplit.wantSeq = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem);
- sTemporaryCommonPoolSplit.wantBank = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem);
- sTemporaryCommonPoolSplit.wantUnused = 0;
- temporary_pools_init(&sTemporaryCommonPoolSplit);
- reset_bank_and_seq_load_status();
-
-#ifndef VERSION_EU
- for (j = 0; j < 2; j++) {
- gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64));
- }
-#endif
-
- gNotes = soundAlloc(&gNotesAndBuffersPool, gMaxSimultaneousNotes * sizeof(struct Note));
- note_init_all();
- init_note_free_list();
-
-#ifdef VERSION_EU
- gNoteSubsEu = soundAlloc(&gNotesAndBuffersPool, (gAudioBufferParameters.updatesPerFrame * gMaxSimultaneousNotes) * sizeof(struct NoteSubEu));
-
- for (j = 0; j != 2; j++) {
- gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64));
- }
-
- for (j = 0; j < 4; j++) {
- gSynthesisReverbs[j].useReverb = 0;
- }
- gNumSynthesisReverbs = preset->numReverbs;
- for (j = 0; j < gNumSynthesisReverbs; j++) {
- reverb = &gSynthesisReverbs[j];
- reverbSettings = &preset->reverbSettings[j];
- reverb->windowSize = reverbSettings->windowSize * 64;
- reverb->downsampleRate = reverbSettings->downsampleRate;
- reverb->reverbGain = reverbSettings->gain;
- reverb->useReverb = 8;
- reverb->ringBuffer.left = soundAlloc(&gNotesAndBuffersPool, reverb->windowSize * 2);
- reverb->ringBuffer.right = soundAlloc(&gNotesAndBuffersPool, reverb->windowSize * 2);
- reverb->nextRingBufferPos = 0;
- reverb->unkC = 0;
- reverb->curFrame = 0;
- reverb->bufSizePerChannel = reverb->windowSize;
- reverb->framesLeftToIgnore = 2;
- if (reverb->downsampleRate != 1) {
- reverb->resampleFlags = A_INIT;
- reverb->resampleRate = 0x8000 / reverb->downsampleRate;
- reverb->resampleStateLeft = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- reverb->resampleStateRight = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- reverb->unk24 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- reverb->unk28 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- for (i = 0; i < gAudioBufferParameters.updatesPerFrame; i++) {
- mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
- reverb->items[0][i].toDownsampleLeft = mem;
- reverb->items[0][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
- mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
- reverb->items[1][i].toDownsampleLeft = mem;
- reverb->items[1][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
- }
- }
- }
-
-#else
- if (reverbWindowSize == 0) {
- gSynthesisReverb.useReverb = 0;
- } else {
- gSynthesisReverb.useReverb = 8;
- gSynthesisReverb.ringBuffer.left = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2);
- gSynthesisReverb.ringBuffer.right = soundAlloc(&gNotesAndBuffersPool, reverbWindowSize * 2);
- gSynthesisReverb.nextRingBufferPos = 0;
- gSynthesisReverb.unkC = 0;
- gSynthesisReverb.curFrame = 0;
- gSynthesisReverb.bufSizePerChannel = reverbWindowSize;
- gSynthesisReverb.reverbGain = preset->reverbGain;
- gSynthesisReverb.framesLeftToIgnore = 2;
- if (gReverbDownsampleRate != 1) {
- gSynthesisReverb.resampleFlags = A_INIT;
- gSynthesisReverb.resampleRate = 0x8000 / gReverbDownsampleRate;
- gSynthesisReverb.resampleStateLeft = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- gSynthesisReverb.resampleStateRight = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- gSynthesisReverb.unk24 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- gSynthesisReverb.unk28 = soundAlloc(&gNotesAndBuffersPool, 16 * sizeof(s16));
- for (i = 0; i < gAudioUpdatesPerFrame; i++) {
- mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
- gSynthesisReverb.items[0][i].toDownsampleLeft = mem;
- gSynthesisReverb.items[0][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
- mem = soundAlloc(&gNotesAndBuffersPool, DEFAULT_LEN_2CH);
- gSynthesisReverb.items[1][i].toDownsampleLeft = mem;
- gSynthesisReverb.items[1][i].toDownsampleRight = mem + DEFAULT_LEN_1CH / sizeof(s16);
- }
- }
- }
-#endif
-
- init_sample_dma_buffers(gMaxSimultaneousNotes);
-
-#ifdef VERSION_EU
- func_eu_802e1cd0(0, gAudioBufferParameters.samplesPerUpdate);
-#endif
-
- osWritebackDCacheAll();
-
-#ifndef VERSION_EU
- if (gAudioLoadLock != AUDIO_LOCK_UNINITIALIZED) {
- gAudioLoadLock = AUDIO_LOCK_NOT_LOADING;
- }
-#endif
-}
diff --git a/src/audio/memory.h b/src/audio/memory.h
@@ -1,71 +0,0 @@
-#ifndef AUDIO_MEMORY_H
-#define AUDIO_MEMORY_H
-
-#include "internal.h"
-
-#define SOUND_LOAD_STATUS_NOT_LOADED 0
-#define SOUND_LOAD_STATUS_IN_PROGRESS 1
-#define SOUND_LOAD_STATUS_COMPLETE 2
-#define SOUND_LOAD_STATUS_DISCARDABLE 3
-
-#define IS_BANK_LOAD_COMPLETE(bankId) (gBankLoadStatus[bankId] >= SOUND_LOAD_STATUS_COMPLETE)
-#define IS_SEQ_LOAD_COMPLETE(seqId) (gSeqLoadStatus[seqId] >= SOUND_LOAD_STATUS_COMPLETE)
-
-struct SoundAllocPool
-{
- u8 *start;
- u8 *cur;
- u32 size;
- s32 unused; // set to 0, never read
-}; // size = 0x10
-
-struct SeqOrBankEntry {
- u8 *ptr;
- u32 size;
- s32 id; // seqId or bankId
-}; // size = 0xC
-
-struct PersistentPool
-{
- /*0x00*/ u32 numEntries;
- /*0x04*/ struct SoundAllocPool pool;
- /*0x14*/ struct SeqOrBankEntry entries[32];
-}; // size = 0x194
-
-struct TemporaryPool
-{
- /*0x00*/ u32 nextSide;
- /*0x04*/ struct SoundAllocPool pool;
- /*0x14*/ struct SeqOrBankEntry entries[2];
-}; // size = 0x2C
-
-struct SoundMultiPool
-{
- /*0x000*/ struct PersistentPool persistent;
- /*0x194*/ struct TemporaryPool temporary;
- /* */ u32 pad2[4];
-}; // size = 0x1D0
-
-extern u8 gAudioHeap[];
-extern s16 gVolume;
-extern s8 gReverbDownsampleRate;
-extern struct SoundAllocPool gAudioInitPool;
-extern struct SoundAllocPool gNotesAndBuffersPool;
-extern struct SoundMultiPool gSeqLoadedPool;
-extern struct SoundMultiPool gBankLoadedPool;
-extern u8 gBankLoadStatus[64];
-extern u8 gSeqLoadStatus[256];
-extern volatile u8 gAudioResetStatus;
-extern u8 gAudioResetPresetIdToLoad;
-
-void *soundAlloc(struct SoundAllocPool *pool, u32 size);
-void sound_init_main_pools(s32 sizeForAudioInitPool);
-void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id);
-void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 arg2);
-#ifdef VERSION_EU
-void audio_reset_session(void);
-#else
-void audio_reset_session(struct AudioSessionSettings *preset);
-#endif
-
-#endif /* AUDIO_MEMORY_H */
diff --git a/src/audio/playback.c b/src/audio/playback.c
@@ -1,7 +1,7 @@
#include <ultra64.h>
#include <macros.h>
-#include "memory.h"
+#include "heap.h"
#include "data.h"
#include "load.h"
#include "seqplayer.h"
@@ -102,7 +102,7 @@ void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput) {
note->noteSubEu.resamplingRateFixedPoint = (s32) (resamplingRate * 32768.0f);
}
-struct AudioBankSound *func_eu_802e4e5c(struct Instrument *instrument, s32 semitone) {
+struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instrument, s32 semitone) {
struct AudioBankSound *sound;
if (semitone < instrument->normalRangeLo) {
sound = &instrument->lowNotesSound;
@@ -114,7 +114,7 @@ struct AudioBankSound *func_eu_802e4e5c(struct Instrument *instrument, s32 semit
return sound;
}
-struct Instrument *func_eu_802e4e98(s32 bankId, s32 instId) {
+struct Instrument *get_instrument_inner(s32 bankId, s32 instId) {
struct Instrument *inst;
if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) {
@@ -146,7 +146,7 @@ struct Instrument *func_eu_802e4e98(s32 bankId, s32 instId) {
return NULL;
}
-struct Drum *func_eu_802e4fb8(s32 bankId, s32 drumId) {
+struct Drum *get_drum(s32 bankId, s32 drumId) {
struct Drum *drum;
if (drumId >= gCtlEntries[bankId].numDrums) {
gAudioErrorFlags = ((bankId << 8) + drumId) + 0x4000000;
@@ -223,7 +223,7 @@ void process_notes(void) {
u8 reverb;
UNUSED u8 pad3;
u8 pan;
- u8 unk;
+ u8 bookOffset;
#endif
struct NoteAttributes *attributes;
#ifndef VERSION_EU
@@ -321,13 +321,13 @@ void process_notes(void) {
reverb = attributes->reverb;
if (1) {
}
- unk = noteSubEu->unk1b234;
+ bookOffset = noteSubEu->bookOffset;
} else {
frequency = playbackState->parentLayer->noteFreqScale;
velocity = playbackState->parentLayer->noteVelocity;
pan = playbackState->parentLayer->notePan;
reverb = playbackState->parentLayer->seqChannel->reverb;
- unk = playbackState->parentLayer->seqChannel->unk8 & 0x7; // bitfield?
+ bookOffset = playbackState->parentLayer->seqChannel->bookOffset & 0x7;
}
frequency *= playbackState->vibratoFreqScale * playbackState->portamentoFreqScale;
@@ -335,7 +335,7 @@ void process_notes(void) {
velocity = velocity * scale * scale;
note_set_resampling_rate(note, frequency);
note_set_vel_pan_reverb(note, velocity, pan, reverb);
- noteSubEu->unk1b234 = unk;
+ noteSubEu->bookOffset = bookOffset;
skip:;
}
#else
@@ -589,7 +589,7 @@ void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLaye
#ifdef VERSION_EU
s32 sampleCountIndex;
s32 waveSampleCountIndex;
- s32 waveId = seqLayer->euUnk1;
+ s32 waveId = seqLayer->instOrWave;
if (waveId == 0xff) {
waveId = seqLayer->seqChannel->instOrWave;
}
@@ -799,14 +799,14 @@ void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLaye
note->prevParentLayer = NO_LAYER;
note->parentLayer = seqLayer;
note->priority = seqLayer->seqChannel->notePriority;
- seqLayer->unkEu0b4 = TRUE;
+ seqLayer->notePropertiesNeedInit = TRUE;
seqLayer->status = SOUND_LOAD_STATUS_DISCARDABLE; // "loaded"
seqLayer->note = note;
seqLayer->seqChannel->noteUnused = note;
seqLayer->seqChannel->layerUnused = seqLayer;
seqLayer->noteVelocity = 0.0f;
note_init(note);
- instId = seqLayer->euUnk1;
+ instId = seqLayer->instOrWave;
if (instId == 0xff) {
instId = seqLayer->seqChannel->instOrWave;
}
@@ -823,7 +823,7 @@ void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLaye
}
sub->bankId = seqLayer->seqChannel->bankId;
sub->stereoHeadsetEffects = seqLayer->seqChannel->stereoHeadsetEffects;
- sub->unk1b567 = seqLayer->seqChannel->reverbIndex & 3;
+ sub->reverbIndex = seqLayer->seqChannel->reverbIndex & 3;
}
#else
s32 note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer) {
diff --git a/src/audio/playback.h b/src/audio/playback.h
@@ -29,8 +29,9 @@ void reclaim_notes(void);
void note_init_all(void);
#ifdef VERSION_EU
-struct AudioBankSound *func_eu_802e4e5c(struct Instrument *instrument, s32 semitone);
-struct Drum *func_eu_802e4fb8(s32 bankId, s32 drumId);
+struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instrument, s32 semitone);
+struct Instrument *get_instrument_inner(s32 bankId, s32 instId);
+struct Drum *get_drum(s32 bankId, s32 drumId);
void note_init_volume(struct Note *note);
void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverb);
void note_set_frequency(struct Note *note, f32 frequency);
diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c
@@ -29,9 +29,9 @@ extern struct EuAudioCmd sAudioCmd[0x100];
void func_8031D690(s32 player, FadeT fadeInTime);
void sequence_player_fade_out_internal(s32 player, FadeT fadeOutTime);
-void func_802ad668(void);
+void port_eu_init_queues(void);
void decrease_sample_dma_ttls(void);
-s32 func_eu_802E2AA0(void);
+s32 audio_shut_down_and_reset_step(void);
void func_802ad7ec(u32);
struct SPTask *create_next_audio_frame_task(void) {
@@ -76,7 +76,7 @@ struct SPTask *create_next_audio_frame_task(void) {
}
if (gAudioResetStatus != 0) {
- if (func_eu_802E2AA0() == 0) {
+ if (audio_shut_down_and_reset_step() == 0) {
if (gAudioResetStatus == 0) {
osSendMesg(OSMesgQueues[3], (OSMesg) (s32) gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK);
}
@@ -164,14 +164,14 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) {
case 0xf1:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = TRUE;
- gSequencePlayers[i].unk_eu = TRUE;
+ gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
case 0xf2:
for (i = 0; i < 4; i++) {
gSequencePlayers[i].muted = FALSE;
- gSequencePlayers[i].unk_eu = TRUE;
+ gSequencePlayers[i].recalculateVolume = TRUE;
}
break;
}
@@ -207,7 +207,7 @@ void func_8031D690(s32 player, FadeT fadeInTime) {
}
}
-void func_802ad668(void) {
+void port_eu_init_queues(void) {
D_EU_80302010 = 0;
D_EU_80302014 = 0;
osCreateMesgQueue(OSMesgQueues[0], &OSMesg0, 1);
@@ -262,8 +262,8 @@ void func_802ad7ec(u32 arg0) {
else if ((cmd->u.s.op & 0x40) != 0) {
switch (cmd->u.s.op) {
case 0x41:
- seqPlayer->unkEu28 = cmd->u2.as_f32;
- seqPlayer->unk_eu = TRUE;
+ seqPlayer->fadeVolumeScale = cmd->u2.as_f32;
+ seqPlayer->recalculateVolume = TRUE;
break;
case 0x47:
@@ -286,19 +286,19 @@ void func_802ad7ec(u32 arg0) {
switch (cmd->u.s.op) {
case 1:
chan->volumeScale = cmd->u2.as_f32;
- chan->unk1.as_bitfields.unk0b40 = TRUE;
+ chan->changes.as_bitfields.volume = TRUE;
break;
case 2:
chan->volume = cmd->u2.as_f32;
- chan->unk1.as_bitfields.unk0b40 = TRUE;
+ chan->changes.as_bitfields.volume = TRUE;
break;
case 3:
- chan->unk9 = cmd->u2.as_s8;
- chan->unk1.as_bitfields.unk0b20 = TRUE;
+ chan->newPan = cmd->u2.as_s8;
+ chan->changes.as_bitfields.pan = TRUE;
break;
case 4:
chan->freqScale = cmd->u2.as_f32;
- chan->unk1.as_bitfields.unk0b80 = TRUE;
+ chan->changes.as_bitfields.freqScale = TRUE;
break;
case 5:
chan->reverb = cmd->u2.as_s8;
@@ -319,8 +319,8 @@ void func_802ad7ec(u32 arg0) {
}
}
-void func_802ada64(void) {
- func_802ad668();
+void port_eu_init(void) {
+ port_eu_init_queues();
}
#endif
diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c
@@ -1,7 +1,7 @@
#include <ultra64.h>
#include <macros.h>
-#include "memory.h"
+#include "heap.h"
#include "data.h"
#include "load.h"
#include "seqplayer.h"
@@ -33,11 +33,11 @@ void sequence_channel_init(struct SequenceChannel *seqChannel) {
seqChannel->transposition = 0;
seqChannel->largeNotes = FALSE;
#ifdef VERSION_EU
- seqChannel->unk8 = 0;
- seqChannel->unk1.as_u8 = 0xff;
+ seqChannel->bookOffset = 0;
+ seqChannel->changes.as_u8 = 0xff;
seqChannel->scriptState.depth = 0;
- seqChannel->unk9 = 0x40;
- seqChannel->unkA = 0x80;
+ seqChannel->newPan = 0x40;
+ seqChannel->panChannelWeight = 0x80;
seqChannel->noteUnused = NULL;
seqChannel->reverbIndex = 0;
#else
@@ -105,14 +105,14 @@ s32 seq_channel_set_layer(struct SequenceChannel *seqChannel, s32 layerIndex) {
layer->continuousNotes = FALSE;
layer->finished = FALSE;
#ifdef VERSION_EU
- layer->unkEu0b2 = FALSE;
+ layer->ignoreDrumPan = FALSE;
#endif
layer->portamento.mode = 0;
layer->scriptState.depth = 0;
layer->status = SOUND_LOAD_STATUS_NOT_LOADED;
layer->noteDuration = 0x80;
#ifdef VERSION_EU
- layer->euUnk5 = 0x40;
+ layer->pan = 0x40;
#endif
layer->transposition = 0;
layer->delay = 0;
@@ -123,7 +123,7 @@ s32 seq_channel_set_layer(struct SequenceChannel *seqChannel, s32 layerIndex) {
#ifdef VERSION_EU
layer->freqScale = 1.0f;
layer->velocitySquare = 0.0f;
- layer->euUnk1 = 0xff;
+ layer->instOrWave = 0xff;
#else
layer->velocitySquare = 0.0f;
layer->pan = 0.5f;
@@ -244,18 +244,18 @@ void sequence_player_disable_channels(struct SequencePlayer *seqPlayer, u16 chan
}
}
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-GLOBAL_ASM("asm/non_matchings/eu/audio/sequence_channel_enable.s")
-#else
void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex, void *arg2) {
struct SequenceChannel *seqChannel = seqPlayer->channels[channelIndex];
s32 i;
#ifdef VERSION_EU
if (IS_SEQUENCE_CHANNEL_VALID(seqChannel) == FALSE) {
- // not matching exactly, but this is the logic at least (stubbed printfs?)
- if (seqPlayer == &gSequencePlayers[0]) {
- } else if (seqPlayer == &gSequencePlayers[1]) {
+ struct SequencePlayer *bgMusic = &gSequencePlayers[0];
+ struct SequencePlayer *miscMusic = &gSequencePlayers[1];
+
+ if (seqPlayer == bgMusic) {
+ } else if (seqPlayer == miscMusic) {
+ } else {
}
} else {
#else
@@ -273,7 +273,6 @@ void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex,
}
}
}
-#endif
void sequence_player_disable(struct SequencePlayer *seqPlayer) {
sequence_player_disable_channels(seqPlayer, 0xffff);
@@ -464,7 +463,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
seqPlayer = seqChannel->seqPlayer;
#ifdef VERSION_EU
- layer->unkEu0b4 = TRUE;
+ layer->notePropertiesNeedInit = TRUE;
#endif
for (;;) {
@@ -553,7 +552,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
layer->velocitySquare = (f32)(temp_a0_5 * temp_a0_5);
} else {
#ifdef VERSION_EU
- layer->euUnk5 = temp_a0_5;
+ layer->pan = temp_a0_5;
#else
layer->pan = (f32) temp_a0_5 / US_FLOAT(128.0);
#endif
@@ -624,9 +623,9 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
if (instId >= 0x7f) {
#ifdef VERSION_EU
if (instId == 0x7f) {
- layer->euUnk1 = 0;
+ layer->instOrWave = 0;
} else {
- layer->euUnk1 = instId;
+ layer->instOrWave = instId;
layer->instrument = NULL;
}
if (instId != 0xff) {
@@ -639,11 +638,11 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
#ifdef VERSION_EU
instId = get_instrument(seqChannel, instId, &layer->instrument, &layer->adsr);
- layer->euUnk1 = instId;
+ layer->instOrWave = instId;
if (instId == 0) {
- layer->euUnk1 = 0xff;
+ layer->instOrWave = 0xff;
}
- //layer->euUnk1 = instId == 0 ? 0xff : instId;
+ //layer->instOrWave = instId == 0 ? 0xff : instId;
break;
#else
bankId = seqChannel->bankId; // maybe a temp, to match get_instrument
@@ -732,7 +731,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
break;
case 0xcc:
- layer->unkEu0b2 = TRUE;
+ layer->ignoreDrumPan = TRUE;
break;
#endif
@@ -869,9 +868,9 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
layer->stopSomething = TRUE;
} else {
#ifdef VERSION_EU
- if ((layer->euUnk1 == 0xff ? seqChannel->instOrWave : layer->euUnk1) == 0) {
+ if ((layer->instOrWave == 0xff ? seqChannel->instOrWave : layer->instOrWave) == 0) {
drumIndex = cmdSemitone + seqChannel->transposition + layer->transposition;
- drum = func_eu_802e4fb8(seqChannel->bankId, drumIndex);
+ drum = get_drum(seqChannel->bankId, drumIndex);
#else
if (seqChannel->instOrWave == 0) { // drum
drumIndex = cmdSemitone + seqChannel->transposition + layer->transposition;
@@ -893,8 +892,8 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
layer->adsr.envelope = drum->envelope;
layer->adsr.releaseRate = drum->releaseRate;
#ifdef VERSION_EU
- if (!layer->unkEu0b2) {
- layer->euUnk5 = drum->pan;
+ if (!layer->ignoreDrumPan) {
+ layer->pan = drum->pan;
}
#else
layer->pan = FLOAT_CAST(drum->pan) / US_FLOAT(128.0);
@@ -912,7 +911,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
layer->stopSomething = TRUE;
} else {
#ifdef VERSION_EU
- if (layer->euUnk1 == 0xff) {
+ if (layer->instOrWave == 0xff) {
instrument = seqChannel->instrument;
} else {
instrument = layer->instrument;
@@ -931,7 +930,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
}
if (instrument != NULL) {
#ifdef VERSION_EU
- sound = func_eu_802e4e5c(instrument, usedSemitone);
+ sound = instrument_get_audio_bank_sound(instrument, usedSemitone);
#else
if (usedSemitone < instrument->normalRangeLo) {
sound = &instrument->lowNotesSound;
@@ -990,7 +989,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) {
}
} else if (instrument != NULL) {
#ifdef VERSION_EU
- sound = func_eu_802e4e5c(instrument, semitone);
+ sound = instrument_get_audio_bank_sound(instrument, semitone);
#else
if (semitone < instrument->normalRangeLo) {
sound = &instrument->lowNotesSound;
@@ -1055,14 +1054,12 @@ GLOBAL_ASM("asm/non_matchings/seq_channel_layer_process_script_jp.s")
GLOBAL_ASM("asm/non_matchings/seq_channel_layer_process_script_us.s")
#endif
-struct Instrument *func_eu_802e4e98(s32 bankId, s32 instId);
-
u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrument **instOut,
struct AdsrSettings *adsr)
{
struct Instrument *inst;
#ifdef VERSION_EU
- inst = func_eu_802e4e98(seqChannel->bankId, instId);
+ inst = get_instrument_inner(seqChannel->bankId, instId);
if (inst == NULL)
{
*instOut = NULL;
@@ -1362,21 +1359,21 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
case 0xdf: // chan_setvol
sequence_channel_set_volume(seqChannel, m64_read_u8(state));
#ifdef VERSION_EU
- seqChannel->unk1.as_bitfields.unk0b40 = TRUE;
+ seqChannel->changes.as_bitfields.volume = TRUE;
#endif
break;
case 0xe0: // chan_setvolscale
seqChannel->volumeScale = FLOAT_CAST(m64_read_u8(state)) / US_FLOAT(128.0);
#ifdef VERSION_EU
- seqChannel->unk1.as_bitfields.unk0b40 = TRUE;
+ seqChannel->changes.as_bitfields.volume = TRUE;
#endif
break;
case 0xde: // chan_freqscale; pitch bend using raw frequency multiplier N/2^15 (N is u16)
sp5A = m64_read_s16(state);
#ifdef VERSION_EU
- seqChannel->unk1.as_bitfields.unk0b80 = TRUE;
+ seqChannel->changes.as_bitfields.freqScale = TRUE;
#endif
seqChannel->freqScale = FLOAT_CAST(sp5A) / US_FLOAT(32768.0);
break;
@@ -1386,14 +1383,14 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
temp = m64_read_u8(state) + 127;
seqChannel->freqScale = gPitchBendFrequencyScale[temp];
#ifdef VERSION_EU
- seqChannel->unk1.as_bitfields.unk0b80 = TRUE;
+ seqChannel->changes.as_bitfields.freqScale = TRUE;
#endif
break;
case 0xdd: // chan_setpan
#ifdef VERSION_EU
- seqChannel->unk9 = m64_read_u8(state);
- seqChannel->unk1.as_bitfields.unk0b20 = TRUE;
+ seqChannel->newPan = m64_read_u8(state);
+ seqChannel->changes.as_bitfields.pan = TRUE;
#else
seqChannel->pan = FLOAT_CAST(m64_read_u8(state)) / US_FLOAT(128.0);
#endif
@@ -1401,8 +1398,8 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
case 0xdc: // chan_setpanmix; set proportion of pan to come from channel (0..128)
#ifdef VERSION_EU
- seqChannel->unkA = m64_read_u8(state);
- seqChannel->unk1.as_bitfields.unk0b20 = TRUE;
+ seqChannel->panChannelWeight = m64_read_u8(state);
+ seqChannel->changes.as_bitfields.pan = TRUE;
#else
seqChannel->panChannelWeight = FLOAT_CAST(m64_read_u8(state)) / US_FLOAT(128.0);
#endif
@@ -1544,7 +1541,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
#ifdef VERSION_EU
case 0xe6:
- seqChannel->unk8 = m64_read_u8(state);
+ seqChannel->bookOffset = m64_read_u8(state);
break;
case 0xe7:
@@ -1554,11 +1551,11 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
seqChannel->noteAllocPolicy = *arr++;
seqChannel->notePriority = *arr++;
seqChannel->transposition = (s8) *arr++;
- seqChannel->unk9 = *arr++;
- seqChannel->unkA = *arr++;
+ seqChannel->newPan = *arr++;
+ seqChannel->panChannelWeight = *arr++;
seqChannel->reverb = *arr++;
seqChannel->reverbIndex = *arr++; // reverb index?
- seqChannel->unk1.as_bitfields.unk0b20 = TRUE;
+ seqChannel->changes.as_bitfields.pan = TRUE;
break;
case 0xe8:
@@ -1566,11 +1563,11 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) {
seqChannel->noteAllocPolicy = m64_read_u8(state);
seqChannel->notePriority = m64_read_u8(state);
seqChannel->transposition = (s8) m64_read_u8(state);
- seqChannel->unk9 = m64_read_u8(state);
- seqChannel->unkA = m64_read_u8(state);
+ seqChannel->newPan = m64_read_u8(state);
+ seqChannel->panChannelWeight = m64_read_u8(state);
seqChannel->reverb = m64_read_u8(state);
seqChannel->reverbIndex = m64_read_u8(state);
- seqChannel->unk1.as_bitfields.unk0b20 = TRUE;
+ seqChannel->changes.as_bitfields.pan = TRUE;
break;
case 0xec:
@@ -1689,14 +1686,10 @@ GLOBAL_ASM("asm/non_matchings/sequence_channel_process_script_jp.s")
GLOBAL_ASM("asm/non_matchings/sequence_channel_process_script_us.s")
#endif
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-GLOBAL_ASM("asm/non_matchings/eu/audio/sequence_player_process_sequence.s")
-#else
void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
u8 cmd;
u8 loBits;
u8 temp;
- s8 tempSigned;
s32 value;
s32 i;
u16 u16v;
@@ -1758,6 +1751,10 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
if (osRecvMesg(&seqPlayer->seqDmaMesgQueue, NULL, 0) == -1) {
return;
}
+#ifndef AVOID_UB
+ if (temp) {
+ }
+#endif
#else
if (seqPlayer->seqDmaMesg == NULL) {
return;
@@ -1791,10 +1788,14 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
state = &seqPlayer->scriptState;
if (seqPlayer->delay > 1) {
+#ifndef AVOID_UB
+ if (temp) {
+ }
+#endif
seqPlayer->delay--;
} else {
#ifdef VERSION_EU
- seqPlayer->unk_eu = 1;
+ seqPlayer->recalculateVolume = 1;
#endif
for (;;) {
cmd = m64_read_u8(state);
@@ -1804,7 +1805,11 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
sequence_player_disable(seqPlayer);
break;
}
+#ifdef VERSION_EU
+ state->pc = state->stack[--state->depth];
+#else
state->depth--, state->pc = state->stack[state->depth];
+#endif
}
if (cmd == 0xfd) // seq_delay
@@ -1873,14 +1878,14 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
case 0xf4:
case 0xf3:
case 0xf2:
- tempSigned = m64_read_u8(state);
+ temp = m64_read_u8(state);
if (cmd == 0xf3 && value != 0) {
break;
}
if (cmd == 0xf2 && value >= 0) {
break;
}
- state->pc += tempSigned;
+ state->pc += (s8)temp;
break;
#endif
@@ -1942,7 +1947,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
case SEQUENCE_PLAYER_STATE_2:
seqPlayer->fadeTimer = u16v;
seqPlayer->state = temp;
- seqPlayer->fadeVelocity = (0.0f - seqPlayer->fadeVolume) / (s32) u16v;
+ seqPlayer->fadeVelocity = (0.0f - seqPlayer->fadeVolume) / (s32) (u16v & 0xFFFFu);
break;
}
break;
@@ -1988,16 +1993,16 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
break;
case 0xda: // seq_changevol
- tempSigned = m64_read_u8(state);
+ temp = m64_read_u8(state);
seqPlayer->fadeVolume =
- seqPlayer->fadeVolume + (f32) tempSigned / US_FLOAT(127.0);
+ seqPlayer->fadeVolume + (f32) (s8)temp / US_FLOAT(127.0);
break;
#endif
#ifdef VERSION_EU
case 0xd9:
- tempSigned = m64_read_u8(state);
- seqPlayer->unkEu28 = tempSigned / 127.0f;
+ temp = m64_read_u8(state);
+ seqPlayer->fadeVolumeScale = (s8)temp / 127.0f;
break;
#endif
@@ -2012,8 +2017,8 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
break;
case 0xd5: // seq_setmutescale
- tempSigned = m64_read_u8(state);
- seqPlayer->muteVolumeScale = (f32) tempSigned / US_FLOAT(127.0);
+ temp = m64_read_u8(state);
+ seqPlayer->muteVolumeScale = (f32) (s8)temp / US_FLOAT(127.0);
break;
case 0xd4: // seq_mute
@@ -2125,7 +2130,6 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
#endif
}
}
-#endif
// This runs 240 times per second.
void process_sequences(UNUSED s32 iterationsRemaining) {
@@ -2172,7 +2176,7 @@ void init_sequence_player(u32 player) {
seqPlayer->shortNoteDurationTable = gDefaultShortNoteDurationTable;
seqPlayer->fadeVolume = 1.0f;
#ifdef VERSION_EU
- seqPlayer->unkEu28 = 1.0f;
+ seqPlayer->fadeVolumeScale = 1.0f;
#endif
seqPlayer->fadeVelocity = 0.0f;
seqPlayer->volume = 0.0f;
diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c
@@ -2,7 +2,7 @@
#include <macros.h>
#include "synthesis.h"
-#include "memory.h"
+#include "heap.h"
#include "data.h"
#include "load.h"
#include "seqplayer.h"
@@ -81,19 +81,16 @@ u8 sAudioSynthesisPad[0x20];
#endif
#if defined(VERSION_EU)
-#ifndef NON_MATCHING
-GLOBAL_ASM("asm/non_matchings/eu/audio/prepare_reverb_ring_buffer.s")
-#else
// Equivalent functionality as the US/JP version,
// just that the reverb structure is chosen from an array with index
void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) {
- struct SynthesisReverb *reverb = &gSynthesisReverbs[reverbIndex];
struct ReverbRingBufferItem *item;
+ struct SynthesisReverb *reverb = &gSynthesisReverbs[reverbIndex];
s32 srcPos;
s32 dstPos;
s32 nSamples;
- //s32 numSamplesAfterDownsampling;
s32 excessiveSamples;
+ s32 UNUSED pad[3];
if (reverb->downsampleRate != 1) {
if (reverb->framesLeftToIgnore == 0) {
// Now that the RSP has finished, downsample the samples produced two frames ago by skipping
@@ -105,9 +102,9 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex)
for (srcPos = 0, dstPos = 0; dstPos < item->lengths[0] / 2;
srcPos += reverb->downsampleRate, dstPos++) {
- reverb->ringBuffer.left[dstPos + item->startPos] =
+ reverb->ringBuffer.left[item->startPos + dstPos] =
item->toDownsampleLeft[srcPos];
- reverb->ringBuffer.right[dstPos + item->startPos] =
+ reverb->ringBuffer.right[item->startPos + dstPos] =
item->toDownsampleRight[srcPos];
}
for (dstPos = 0; dstPos < item->lengths[1] / 2; srcPos += reverb->downsampleRate, dstPos++) {
@@ -117,11 +114,9 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex)
}
}
- //numSamplesAfterDownsampling =
- nSamples = chunkLen / reverb->downsampleRate;
- excessiveSamples =
- (nSamples + reverb->nextRingBufferPos) - reverb->bufSizePerChannel;
item = &reverb->items[reverb->curFrame][updateIndex];
+ nSamples = chunkLen / reverb->downsampleRate;
+ excessiveSamples = (nSamples + reverb->nextRingBufferPos) - reverb->bufSizePerChannel;
if (excessiveSamples < 0) {
// There is space in the ring buffer before it wraps around
item->lengths[0] = nSamples * 2;
@@ -130,7 +125,6 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex)
reverb->nextRingBufferPos += nSamples;
} else {
// Ring buffer wrapped around
- //nSamples = numSamplesAfterDownsampling - excessiveSamples;
item->lengths[0] = (nSamples - excessiveSamples) * 2;
item->lengths[1] = excessiveSamples * 2;
item->startPos = reverb->nextRingBufferPos;
@@ -140,7 +134,6 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex)
item->numSamplesAfterDownsampling = nSamples;
item->chunkLen = chunkLen;
}
-#endif
#else
void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) {
struct ReverbRingBufferItem *item;
@@ -261,50 +254,33 @@ s32 get_volume_ramping(u16 sourceVol, u16 targetVol, s32 arg2) {
#endif
#ifdef VERSION_EU
-#ifndef NON_MATCHING
-GLOBAL_ASM("asm/non_matchings/eu/audio/synthesis_execute.s")
-#else
+//TODO: (Scrub C) pointless mask and whitespace
u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, u16 *aiBuf, s32 bufLen) {
- s32 nextVolRampTable;
- s32 temp;
- s32 i;
- s32 remaining;
+ s32 i, j;
f32 *leftVolRamp;
f32 *rightVolRamp;
- s32 chunkLen;
- s32 j;
u32 *aiBufPtr;
u64 *cmd = cmdBuf;
+ s32 chunkLen;
+ s32 nextVolRampTable;
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
process_sequences(i - 1);
synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - i);
}
aSegment(cmd++, 0, 0);
- remaining = bufLen;
aiBufPtr = (u32 *) aiBuf;
for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) {
if (i == 1) {
- leftVolRamp = gLeftVolRampings[nextVolRampTable];
- rightVolRamp = gRightVolRampings[nextVolRampTable];
- chunkLen = remaining;
+ // self-assignment has no affect when added here, could possibly simplify a macro definition
+ chunkLen = bufLen; nextVolRampTable = nextVolRampTable; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF];
} else {
- temp = remaining / i;
- if (temp >= gAudioBufferParameters.samplesPerUpdateMax) {
- leftVolRamp = gLeftVolRampings[2];
- rightVolRamp = gRightVolRampings[2];
- chunkLen = gAudioBufferParameters.samplesPerUpdateMax;
- nextVolRampTable = 2;
- } else if (temp <= gAudioBufferParameters.samplesPerUpdateMin) {
- leftVolRamp = gLeftVolRampings[0];
- rightVolRamp = gRightVolRampings[0];
- chunkLen = gAudioBufferParameters.samplesPerUpdateMin;
- nextVolRampTable = 0;
+ if (bufLen / i >= gAudioBufferParameters.samplesPerUpdateMax) {
+ chunkLen = gAudioBufferParameters.samplesPerUpdateMax; nextVolRampTable = 2; leftVolRamp = gLeftVolRampings[2]; rightVolRamp = gRightVolRampings[2];
+ } else if (bufLen / i <= gAudioBufferParameters.samplesPerUpdateMin) {
+ chunkLen = gAudioBufferParameters.samplesPerUpdateMin; nextVolRampTable = 0; leftVolRamp = gLeftVolRampings[0]; rightVolRamp = gRightVolRampings[0];
} else {
- leftVolRamp = gLeftVolRampings[1];
- rightVolRamp = gRightVolRampings[1];
- chunkLen = gAudioBufferParameters.samplesPerUpdate;
- nextVolRampTable = 1;
+ chunkLen = gAudioBufferParameters.samplesPerUpdate; nextVolRampTable = 1; leftVolRamp = gLeftVolRampings[1]; rightVolRamp = gRightVolRampings[1];
}
}
gCurrentLeftVolRamping = leftVolRamp;
@@ -315,19 +291,19 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, u16 *aiBuf, s32 bufLen) {
}
}
cmd = synthesis_do_one_audio_update((u16 *) aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i);
- remaining -= chunkLen;
+ bufLen -= chunkLen;
aiBufPtr += chunkLen;
}
- for (i = 0; i < gNumSynthesisReverbs; i++) {
- if (gSynthesisReverbs[i].framesLeftToIgnore != 0) {
- gSynthesisReverbs[i].framesLeftToIgnore--;
+
+ for (j = 0; j < gNumSynthesisReverbs; j++) {
+ if (gSynthesisReverbs[j].framesLeftToIgnore != 0) {
+ gSynthesisReverbs[j].framesLeftToIgnore--;
}
- gSynthesisReverbs[i].curFrame ^= 1;
+ gSynthesisReverbs[j].curFrame ^= 1;
}
*writtenCmds = cmd - cmdBuf;
return cmd;
}
-#endif
#else
// bufLen will be divisible by 16
u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, u16 *aiBuf, s32 bufLen) {
@@ -372,171 +348,153 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, u16 *aiBuf, s32 bufLen) {
#ifdef VERSION_EU
-#ifndef NON_MATCHING
-GLOBAL_ASM("asm/non_matchings/eu/audio/synthesis_resample_and_mix_reverb.s")
-u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex);
-#else
u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) {
- struct ReverbRingBufferItem *item; // sp5C
+ struct ReverbRingBufferItem *item;
s16 temp_t9; // sp5a
s16 sp58; // sp58
- struct SynthesisReverb *reverb;
- reverb = &gSynthesisReverbs[reverbIndex];
- item = &reverb->items[reverb->curFrame][updateIndex];
+ item = &gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex];
aClearBuffer(cmd++, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH);
- if (reverb->downsampleRate == 1) {
+ if (gSynthesisReverbs[reverbIndex].downsampleRate == 1) {
cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengths[0], reverbIndex);
if (item->lengths[1] != 0) {
cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengths[0], 0, item->lengths[1], reverbIndex);
}
aSetBuffer(cmd++, 0, 0, 0, DEFAULT_LEN_2CH);
aMix(cmd++, 0, 0x7fff, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH);
- aMix(cmd++, 0, 0x8000 + reverb->reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
+ aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
} else {
- temp_t9 = (item->startPos & 7) * 2;
- sp58 = ALIGN(temp_t9 + item->lengths[0], 4);
+ temp_t9 = (item->startPos % 8u) * 2;
+ sp58 = ALIGN(item->lengths[0] + (sp58=temp_t9), 4);
+
cmd = synthesis_load_reverb_ring_buffer(cmd, 0x20, (item->startPos - temp_t9 / 2), DEFAULT_LEN_1CH, reverbIndex);
if (item->lengths[1] != 0) {
cmd = synthesis_load_reverb_ring_buffer(cmd, 0x20 + sp58, 0, DEFAULT_LEN_1CH - sp58, reverbIndex);
}
aSetBuffer(cmd++, 0, temp_t9 + DMEM_ADDR_ADPCM_RESAMPLED, DMEM_ADDR_WET_LEFT_CH, bufLen * 2);
- aResample(cmd++, reverb->resampleFlags, reverb->resampleRate, VIRTUAL_TO_PHYSICAL2(reverb->resampleStateLeft));
+ aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateLeft));
aSetBuffer(cmd++, 0, temp_t9 + DMEM_ADDR_ADPCM_RESAMPLED2, DMEM_ADDR_WET_RIGHT_CH, bufLen * 2);
- aResample(cmd++, reverb->resampleFlags, reverb->resampleRate, VIRTUAL_TO_PHYSICAL2(reverb->resampleStateRight));
+ aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateRight));
aSetBuffer(cmd++, 0, 0, 0, DEFAULT_LEN_2CH);
aMix(cmd++, 0, 0x7fff, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH);
- aMix(cmd++, 0, 0x8000 + reverb->reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
+ aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH);
}
return cmd;
}
-#endif
-#ifndef NON_MATCHING
-GLOBAL_ASM("asm/non_matchings/eu/audio/func_eu_802e00d8.s")
-u64 *func_eu_802e00d8(u64 *cmd, s16 reverbIndex, s16 updateIndex);
-#else
-u64 *func_eu_802e00d8(u64 *cmd, s16 reverbIndex, s16 updateIndex) {
- struct SynthesisReverb *reverb;
+u64 *synthesis_save_reverb_samples(u64 *cmdBuf, s16 reverbIndex, s16 updateIndex) {
struct ReverbRingBufferItem *item;
+ struct SynthesisReverb *reverb;
+ u64 *cmd = cmdBuf;
reverb = &gSynthesisReverbs[reverbIndex];
item = &reverb->items[reverb->curFrame][updateIndex];
if (reverb->useReverb != 0) {
+ if (1) {
+ }
if (reverb->downsampleRate == 1) {
- cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengths[0], reverbIndex);
+ // Put the oldest samples in the ring buffer into the wet channels
+ cmd = cmdBuf = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengths[0], reverbIndex);
if (item->lengths[1] != 0) {
+ // Ring buffer wrapped
cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengths[0], 0, item->lengths[1], reverbIndex);
+ cmdBuf = cmd;
}
} else {
- aSetBuffer(cmd++, 0, 0, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH);
- aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(reverb->items[reverb->curFrame][updateIndex].toDownsampleLeft));
+ // Downsampling is done later by CPU when RSP is done, therefore we need to have double
+ // buffering. Left and right buffers are adjacent in memory.
+ aSetBuffer(cmdBuf++, 0, 0, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH);
+ aSaveBuffer(cmdBuf++, VIRTUAL_TO_PHYSICAL2(reverb->items[reverb->curFrame][updateIndex].toDownsampleLeft));
reverb->resampleFlags = 0;
}
}
- return cmd;
+ return cmdBuf;
}
#endif
-#endif
#ifdef VERSION_EU
-#ifndef NON_MATCHING
-GLOBAL_ASM("asm/non_matchings/eu/audio/synthesis_do_one_audio_update.s")
-#else
u64 *synthesis_do_one_audio_update(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
- u8 sp84[60];
- struct SynthesisReverb *sp60;
- s32 temp_lo;
- s32 temp_lo_2;
- u8 temp_v1;
- u8 temp_v1_2;
- struct NoteSubEu *temp_t5;
- struct NoteSubEu *temp_v0;
- s32 phi_s1;
- s16 phi_s2;
- s16 phi_s3;
- s32 phi_s1_2;
- s32 phi_v1_2;
- s32 phi_s1_3;
- s16 phi_s3_2;
- s32 phi_s1_4;
- u8 *phi_s0_2;
- s32 bufLen2;
+ struct NoteSubEu *noteSubEu;
+ u8 noteIndices[56];
+ s32 temp;
+ s32 i;
+ s16 j;
+ s16 notePos = 0;
if (gNumSynthesisReverbs == 0) {
- phi_s2 = 0;
- for (phi_s1 = 0; phi_s1 < gMaxSimultaneousNotes; phi_s1++) {
- if (gNoteSubsEu[gMaxSimultaneousNotes * updateIndex + phi_s1].enabled) {
- sp84[phi_s2++] = phi_s1;
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ temp = updateIndex;
+ if (gNoteSubsEu[gMaxSimultaneousNotes * temp + i].enabled) {
+ noteIndices[notePos++] = i;
}
}
} else {
- phi_s2 = 0;
- for (phi_s3 = 0; phi_s3 < gNumSynthesisReverbs; phi_s3++) {
- for (phi_s1_2 = 0; phi_s1_2 < gMaxSimultaneousNotes; phi_s1_2++) {
- temp_v0 = &gNoteSubsEu[gMaxSimultaneousNotes * updateIndex + phi_s1_2];
- if (temp_v0->enabled) {
- if (phi_s3 == temp_v0->unk1b567) {
- sp84[phi_s2++] = phi_s1_2;
- }
+ for (j = 0; j < gNumSynthesisReverbs; j++) {
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ temp = updateIndex;
+ noteSubEu = &gNoteSubsEu[gMaxSimultaneousNotes * temp + i];
+ if (noteSubEu->enabled && j == noteSubEu->reverbIndex) {
+ noteIndices[notePos++] = i;
}
}
}
- phi_v1_2 = gMaxSimultaneousNotes * updateIndex;
- for (phi_s1_3 = 0; phi_s1_3 < gMaxSimultaneousNotes; phi_s1_3++) {
- if (gNoteSubsEu[phi_v1_2].enabled) {
- if (temp_v0->unk1b567 >= gNumSynthesisReverbs) {
- sp84[phi_s2++] = phi_s1_3;
- }
+
+ for (i = 0; i < gMaxSimultaneousNotes; i++) {
+ temp = updateIndex;
+ noteSubEu = &gNoteSubsEu[gMaxSimultaneousNotes * temp + i];
+ if (noteSubEu->enabled && noteSubEu->reverbIndex >= gNumSynthesisReverbs) {
+ noteIndices[notePos++] = i;
}
- phi_v1_2++;
}
}
aClearBuffer(cmd++, DMEM_ADDR_LEFT_CH, DEFAULT_LEN_2CH);
- phi_s1_4 = 0;
- for (phi_s3_2 = 0; phi_s3_2 < gNumSynthesisReverbs; phi_s3_2++) {
- sp60 = &gSynthesisReverbs[phi_s3_2];
- gUseReverb = sp60->useReverb;
+ i = 0;
+ for (j = 0; j < gNumSynthesisReverbs; j++) {
+ gUseReverb = gSynthesisReverbs[j].useReverb;
if (gUseReverb != 0) {
- cmd = synthesis_resample_and_mix_reverb(cmd, bufLen, phi_s3_2, (s16) updateIndex);
+ cmd = synthesis_resample_and_mix_reverb(cmd, bufLen, j, updateIndex);
}
- for (; phi_s1_4 < phi_s2; phi_s1_4++) {
- temp_v1 = sp84[phi_s1_4];
- temp_lo = updateIndex * gMaxSimultaneousNotes;
- if (phi_s3_2 == gNoteSubsEu[temp_v1 + temp_lo].unk1b567) {
- cmd = synthesis_process_note(&gNotes[temp_v1], &gNoteSubsEu[temp_v1 + temp_lo], &gNotes[temp_v1].synthesisState, aiBuf, bufLen, cmd);
+ for (; i < notePos; i++) {
+ temp = updateIndex;
+ temp *= gMaxSimultaneousNotes;
+ if (j == gNoteSubsEu[temp + noteIndices[i]].reverbIndex) {
+ cmd = synthesis_process_note(&gNotes[noteIndices[i]],
+ &gNoteSubsEu[temp + noteIndices[i]],
+ &gNotes[noteIndices[i]].synthesisState,
+ aiBuf, bufLen, cmd);
+ continue;
} else {
break;
}
}
- if (sp60->useReverb != 0) {
- cmd = func_eu_802e00d8(cmd, phi_s3_2, (s16) updateIndex);
+ if (gSynthesisReverbs[j].useReverb != 0) {
+ cmd = synthesis_save_reverb_samples(cmd, j, updateIndex);
}
}
- phi_s0_2 = &sp84[phi_s1_4];
- for (; phi_s1_4 < phi_s2; phi_s1_4++) {
- temp_v1_2 = *phi_s0_2;
- temp_lo_2 = updateIndex * gMaxSimultaneousNotes;
- temp_t5 = &gNoteSubsEu[temp_v1_2 + temp_lo_2];
- if (IS_BANK_LOAD_COMPLETE(temp_t5->bankId) == TRUE) {
- cmd = synthesis_process_note(&gNotes[temp_v1_2], &gNoteSubsEu[temp_v1_2 + temp_lo_2], &gNotes[temp_v1_2].synthesisState, aiBuf, bufLen, cmd);
+ for (; i < notePos; i++) {
+ temp = updateIndex;
+ temp *= gMaxSimultaneousNotes;
+ if (IS_BANK_LOAD_COMPLETE(gNoteSubsEu[temp + noteIndices[i]].bankId) == TRUE) {
+ cmd = synthesis_process_note(&gNotes[noteIndices[i]],
+ &gNoteSubsEu[temp + noteIndices[i]],
+ &gNotes[noteIndices[i]].synthesisState,
+ aiBuf, bufLen, cmd);
} else {
- gAudioErrorFlags = (temp_t5->bankId + (phi_s1_4 << 8)) + 0x10000000;
+ gAudioErrorFlags = (gNoteSubsEu[temp + noteIndices[i]].bankId + (i << 8)) + 0x10000000;
}
- phi_s0_2++;
}
- bufLen2 = bufLen * 2;
- aSetBuffer(cmd++, 0, 0, DMEM_ADDR_TEMP, bufLen2);
+
+ temp = bufLen * 2;
+ aSetBuffer(cmd++, 0, 0, DMEM_ADDR_TEMP, temp);
aInterleave(cmd++, DMEM_ADDR_LEFT_CH, DMEM_ADDR_RIGHT_CH);
- aSetBuffer(cmd++, 0, 0, DMEM_ADDR_TEMP, bufLen2 * 2);
+ aSetBuffer(cmd++, 0, 0, DMEM_ADDR_TEMP, temp * 2);
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(aiBuf));
return cmd;
}
-#endif
#else
u64 *synthesis_do_one_audio_update(u16 *aiBuf, s32 bufLen, u64 *cmd, u32 updateIndex) {
UNUSED s32 pad1[1];
@@ -738,8 +696,8 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
if (noteSubEu->isSyntheticWave) {
noteSamplesDmemAddrBeforeResampling =
DMEM_ADDR_UNCOMPRESSED_NOTE + synthesisState->samplePosInt * 2;
- synthesisState->samplePosInt += (samplesLenFixedPoint >> 10);
- cmd = load_wave_samples(cmd, noteSubEu, synthesisState, samplesLenFixedPoint >> 10);
+ synthesisState->samplePosInt += (samplesLenFixedPoint >> 0x10);
+ cmd = load_wave_samples(cmd, noteSubEu, synthesisState, samplesLenFixedPoint >> 0x10);
}
#else
if (note->sound == NULL) {
@@ -798,11 +756,15 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
u32 nEntries; // v1
curLoadedBook = audioBookSample->book->book;
nEntries = audioBookSample->book->order * audioBookSample->book->npredictors;
+#ifdef VERSION_EU
+ aLoadADPCM(cmd++, nEntries * 16, VIRTUAL_TO_PHYSICAL2(curLoadedBook + noteSubEu->bookOffset));
+#else
aLoadADPCM(cmd++, nEntries * 16, VIRTUAL_TO_PHYSICAL2(curLoadedBook));
+#endif
}
#ifdef VERSION_EU
- if (noteSubEu->unk1b234) {
+ if (noteSubEu->bookOffset) {
curLoadedBook = (s16 *) &euUnknownData_80301950; // what's this? never read
}
#endif
@@ -952,8 +914,8 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
(samplesLenAdjusted - nAdpcmSamplesProcessed) * 2);
#ifdef VERSION_EU
noteSubEu->finished = 1;
- noteSubEu->finished = 1;
- noteSubEu->enabled = 0;
+ note->noteSubEu.finished = 1;
+ note->noteSubEu.enabled = 0;
#else
note->samplePosInt = 0;
note->finished = 1;
@@ -1049,6 +1011,9 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
flags = A_INIT;
noteSubEu->needsInit = FALSE;
}
+
+ cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint,
+ noteSamplesDmemAddrBeforeResampling, flags);
#else
if (note->needsInit == TRUE) {
flags = A_INIT;
@@ -1075,8 +1040,6 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
}
#ifdef VERSION_EU
- cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint,
- noteSamplesDmemAddrBeforeResampling, flags);
cmd = process_envelope(cmd, noteSubEu, synthesisState, bufLen, 0, s0);
#else
cmd = process_envelope(cmd, note, bufLen, 0, s0, flags);
@@ -1105,7 +1068,7 @@ u64 *synthesis_process_notes(u16 *aiBuf, s32 bufLen, u64 *cmd) {
return cmd;
}
-#elif defined(VERSION_JP)
+#elif defined(VERSION_JP) || defined(VERSION_SH) // todo: extract this nonmatching if applicable.
GLOBAL_ASM("asm/non_matchings/synthesis_process_notes_jp.s")
#elif defined(VERSION_US)
GLOBAL_ASM("asm/non_matchings/synthesis_process_notes_us.s")
@@ -1335,41 +1298,44 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat
return cmd;
}
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-GLOBAL_ASM("asm/non_matchings/eu/audio/note_apply_headset_pan_effects.s")
-#else
#ifdef VERSION_EU
u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight) {
#else
u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 flags, s32 leftRight) {
#endif
u16 dest;
- u16 prevPanShift;
- u16 panShift;
u16 pitch; // t2
#ifndef VERSION_EU
+ u16 prevPanShift;
+ u16 panShift;
UNUSED s32 padding[11];
+#else
+ u8 prevPanShift;
+ u8 panShift;
+ UNUSED u8 unkDebug;
#endif
switch (leftRight) {
case 1:
dest = DMEM_ADDR_LEFT_CH;
- note->prevHeadsetPanLeft = 0;
#ifndef VERSION_EU
+ note->prevHeadsetPanLeft = 0;
panShift = note->headsetPanRight;
#else
panShift = noteSubEu->headsetPanRight;
+ note->prevHeadsetPanLeft = 0;
#endif
prevPanShift = note->prevHeadsetPanRight;
note->prevHeadsetPanRight = panShift;
break;
case 2:
dest = DMEM_ADDR_RIGHT_CH;
- note->prevHeadsetPanRight = 0;
#ifndef VERSION_EU
+ note->prevHeadsetPanRight = 0;
panShift = note->headsetPanLeft;
#else
panShift = noteSubEu->headsetPanLeft;
+ note->prevHeadsetPanRight = 0;
#endif
prevPanShift = note->prevHeadsetPanLeft;
@@ -1392,13 +1358,23 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32
aSetBuffer(cmd++, 0, 0, DMEM_ADDR_TEMP, 32);
aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panResampleState));
+#ifdef VERSION_EU
+ pitch = (bufLen << 0xf) / (bufLen + panShift - prevPanShift + 8);
+ if (pitch) {
+ }
+#else
pitch = (bufLen << 0xf) / (panShift + bufLen - prevPanShift + 8);
+#endif
aSetBuffer(cmd++, 0, DMEM_ADDR_NOTE_PAN_TEMP + 8, DMEM_ADDR_TEMP,
panShift + bufLen - prevPanShift);
aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panResampleState));
} else {
pitch = (panShift == 0) ? (bufLen << 0xf) / (bufLen - prevPanShift - 4)
: (bufLen << 0xf) / (bufLen + panShift - prevPanShift);
+#if defined(VERSION_EU) && !defined(AVOID_UB)
+ if (unkDebug) { // UB
+ }
+#endif
aSetBuffer(cmd++, 0, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_TEMP,
panShift + bufLen - prevPanShift);
aResample(cmd++, 0, pitch, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panResampleState));
@@ -1430,7 +1406,6 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32
return cmd;
}
-#endif
#if !defined(VERSION_EU)
// Moved to playback.c in EU
diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c
@@ -92,7 +92,7 @@ static void Unknown80383E44(void) // ?
}
static s32 beh_cmd_hide(void) {
- obj_hide();
+ cur_obj_hide();
gBehCommand++;
return BEH_CONTINUE;
}
@@ -122,7 +122,7 @@ static s32 beh_cmd_spawn_child(void) {
struct Object *child = spawn_object_at_origin(gCurrentObject, 0, model, behavior);
- copy_object_pos_and_angle(child, gCurrentObject);
+ obj_copy_pos_and_angle(child, gCurrentObject);
gBehCommand += 3;
return BEH_CONTINUE;
@@ -134,7 +134,7 @@ static s32 beh_cmd_spawn_obj(void) {
struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, behavior);
- copy_object_pos_and_angle(object, gCurrentObject);
+ obj_copy_pos_and_angle(object, gCurrentObject);
gCurrentObject->prevObj = object;
@@ -149,7 +149,7 @@ static s32 beh_cmd_spawn_child_with_param(void) {
struct Object *child = spawn_object_at_origin(gCurrentObject, 0, model, behavior);
- copy_object_pos_and_angle(child, gCurrentObject);
+ obj_copy_pos_and_angle(child, gCurrentObject);
child->oBehParams2ndByte = behParam;
@@ -562,13 +562,13 @@ static s32 Behavior24(void) {
}
static s32 beh_cmd_begin(void) {
- if (obj_has_behavior(bhvHauntedChair)) {
+ if (cur_obj_has_behavior(bhvHauntedChair)) {
bhv_init_room();
}
- if (obj_has_behavior(bhvMadPiano)) {
+ if (cur_obj_has_behavior(bhvMadPiano)) {
bhv_init_room();
}
- if (obj_has_behavior(bhvMessagePanel)) {
+ if (cur_obj_has_behavior(bhvMessagePanel)) {
gCurrentObject->oCollisionDistance = 150.0f;
}
gBehCommand++;
@@ -622,7 +622,7 @@ static s32 beh_cmd_scale(void) {
UNUSED u8 sp1f = (u8)((gBehCommand[0] >> 16) & 0xFF);
s16 sp1c = gBehCommand[0] & 0xFFFF;
- obj_scale((f32) sp1c / 100.0f);
+ cur_obj_scale((f32) sp1c / 100.0f);
gBehCommand++;
return BEH_CONTINUE;
@@ -658,9 +658,10 @@ static s32 beh_cmd_bit_clear_int32(void) {
return BEH_CONTINUE;
}
-static s32 beh_cmd_spawn_water_splash(void) {
- struct WaterSplashParams *arg0 = (struct WaterSplashParams *) gBehCommand[1];
- spawn_water_splash(gCurrentObject, arg0);
+static s32 beh_cmd_spawn_water_droplet(void) {
+ struct WaterDropletParams *dropletParams = (struct WaterDropletParams *) gBehCommand[1];
+ spawn_water_droplet(gCurrentObject, dropletParams);
+
gBehCommand += 2;
return BEH_CONTINUE;
}
@@ -738,7 +739,7 @@ static BehCommandProc BehaviorJumpTable[] = {
beh_cmd_tex_anim_rate,
beh_cmd_disable_rendering,
Behavior36,
- beh_cmd_spawn_water_splash,
+ beh_cmd_spawn_water_droplet,
};
void cur_object_exec_behavior(void) {
@@ -757,7 +758,7 @@ void cur_object_exec_behavior(void) {
}
if (flagsLo & OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO) {
- gCurrentObject->oAngleToMario = angle_to_object(gCurrentObject, gMarioObject);
+ gCurrentObject->oAngleToMario = obj_angle_to_object(gCurrentObject, gMarioObject);
}
if (gCurrentObject->oAction != gCurrentObject->oPrevAction) {
@@ -786,7 +787,7 @@ void cur_object_exec_behavior(void) {
flagsLo = (s16) gCurrentObject->oFlags;
if (flagsLo & OBJ_FLAG_0010) {
- obj_set_facing_to_move_angles(gCurrentObject);
+ obj_set_face_angle_to_move_angle(gCurrentObject);
}
if (flagsLo & OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW) {
@@ -794,19 +795,19 @@ void cur_object_exec_behavior(void) {
}
if (flagsLo & OBJ_FLAG_MOVE_XZ_USING_FVEL) {
- obj_move_xz_using_fvel_and_yaw();
+ cur_obj_move_xz_using_fvel_and_yaw();
}
if (flagsLo & OBJ_FLAG_MOVE_Y_WITH_TERMINAL_VEL) {
- obj_move_y_with_terminal_vel();
+ cur_obj_move_y_with_terminal_vel();
}
if (flagsLo & OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT) {
- build_object_transform_relative_to_parent(gCurrentObject);
+ obj_build_transform_relative_to_parent(gCurrentObject);
}
if (flagsLo & OBJ_FLAG_0800) {
- func_802A2270(gCurrentObject);
+ obj_set_throw_matrix_from_transform(gCurrentObject);
}
if (flagsLo & OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE) {
@@ -814,7 +815,7 @@ void cur_object_exec_behavior(void) {
}
if (gCurrentObject->oRoom != -1) {
- obj_enable_rendering_if_mario_in_room();
+ cur_obj_enable_rendering_if_mario_in_room();
} else if ((flagsLo & OBJ_FLAG_COMPUTE_DIST_TO_MARIO) && gCurrentObject->collisionData == NULL) {
if (!(flagsLo & OBJ_FLAG_ACTIVE_FROM_AFAR)) {
if (distanceFromMario > gCurrentObject->oDrawingDistance) {
diff --git a/src/engine/level_script.c b/src/engine/level_script.c
@@ -295,7 +295,7 @@ static void level_cmd_load_mario_head(void) {
}
static void level_cmd_load_mio0_texture(void) {
- func_80278304(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8));
+ load_segment_decompress_heap(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8));
sCurrentCmd = CMD_NEXT;
}
@@ -310,7 +310,7 @@ static void level_cmd_init_level(void) {
static void level_cmd_clear_level(void) {
clear_objects();
- func_8027A7C4();
+ clear_area_graph_nodes();
clear_areas();
main_pool_pop_state();
@@ -630,8 +630,8 @@ static void level_cmd_load_area(void) {
sCurrentCmd = CMD_NEXT;
}
-static void level_cmd_2A(void) {
- func_8027A998();
+static void level_cmd_unload_area(void) {
+ unload_area();
sCurrentCmd = CMD_NEXT;
}
@@ -649,7 +649,7 @@ static void level_cmd_set_mario_start_pos(void) {
}
static void level_cmd_2C(void) {
- func_8027AA88();
+ unload_mario_area();
sCurrentCmd = CMD_NEXT;
}
@@ -692,7 +692,7 @@ static void level_cmd_set_menu_music(void) {
}
static void level_cmd_38(void) {
- func_802491FC(CMD_GET(s16, 2));
+ fadeout_music(CMD_GET(s16, 2));
sCurrentCmd = CMD_NEXT;
}
@@ -781,7 +781,7 @@ static void (*LevelScriptJumpTable[])(void) = {
/*27*/ level_cmd_create_painting_warp_node,
/*28*/ level_cmd_create_instant_warp,
/*29*/ level_cmd_load_area,
- /*2A*/ level_cmd_2A,
+ /*2A*/ level_cmd_unload_area,
/*2B*/ level_cmd_set_mario_start_pos,
/*2C*/ level_cmd_2C,
/*2D*/ level_cmd_2D,
diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c
@@ -623,10 +623,10 @@ void transform_object_vertices(s16 **data, s16 *vertexData) {
if (gCurrentObject->header.gfx.throwMatrix == NULL) {
gCurrentObject->header.gfx.throwMatrix = objectTransform;
- build_object_transform_from_pos_and_angle(gCurrentObject, O_POS_INDEX, O_FACE_ANGLE_INDEX);
+ obj_build_transform_from_pos_and_angle(gCurrentObject, O_POS_INDEX, O_FACE_ANGLE_INDEX);
}
- apply_object_scale_to_matrix(gCurrentObject, m, *objectTransform);
+ obj_apply_scale_to_matrix(gCurrentObject, m, *objectTransform);
// Go through all vertices, rotating and translating them to transform the object.
while (numVertices--) {
diff --git a/src/game/area.c b/src/game/area.c
@@ -76,7 +76,7 @@ const char *gNoControllerMsg[] = {
};
#endif
-void func_8027A220(Vp *a, Vp *b, u8 c, u8 d, u8 e) {
+void override_viewport_and_clip(Vp *a, Vp *b, u8 c, u8 d, u8 e) {
u16 sp6 = ((c >> 3) << 11) | ((d >> 3) << 6) | ((e >> 3) << 1) | 1;
gFBSetColor = (sp6 << 16) | sp6;
@@ -138,13 +138,13 @@ struct ObjectWarpNode *area_get_warp_node(u8 id) {
return node;
}
-struct ObjectWarpNode *func_8027A478(struct Object *o) {
+struct ObjectWarpNode *area_get_warp_node_from_params(struct Object *o) {
u8 sp1F = (o->oBehParams & 0x00FF0000) >> 16;
return area_get_warp_node(sp1F);
}
-void func_8027A4C4(void) {
+void load_obj_warp_nodes(void) {
struct ObjectWarpNode *sp24;
struct Object *sp20 = (struct Object *) gObjParentGraphNode.children;
@@ -152,7 +152,7 @@ void func_8027A4C4(void) {
struct Object *sp1C = sp20;
if (sp1C->activeFlags && get_mario_spawn_type(sp1C) != 0) {
- sp24 = func_8027A478(sp1C);
+ sp24 = area_get_warp_node_from_params(sp1C);
if (sp24 != NULL) {
sp24->object = sp1C;
}
@@ -192,7 +192,7 @@ void clear_areas(void) {
}
}
-void func_8027A7C4(void) {
+void clear_area_graph_nodes(void) {
s32 i;
if (gCurrentArea != NULL) {
@@ -223,12 +223,12 @@ void load_area(s32 index) {
spawn_objects_from_info(0, gCurrentArea->objectSpawnInfos);
}
- func_8027A4C4();
+ load_obj_warp_nodes();
geo_call_global_function_nodes(gCurrentArea->unk04, GEO_CONTEXT_AREA_LOAD);
}
}
-void func_8027A998(void) {
+void unload_area(void) {
if (gCurrentArea != NULL) {
unload_objects_from_area(0, gCurrentArea->index);
geo_call_global_function_nodes(gCurrentArea->unk04, GEO_CONTEXT_AREA_UNLOAD);
@@ -249,13 +249,13 @@ void load_mario_area(void) {
}
}
-void func_8027AA88(void) {
+void unload_mario_area(void) {
if (gCurrentArea != NULL && (gCurrentArea->flags & 0x01)) {
unload_objects_from_area(0, gMarioSpawnInfo->activeAreaIndex);
gCurrentArea->flags &= ~0x01;
if (gCurrentArea->flags == 0) {
- func_8027A998();
+ unload_area();
}
}
}
@@ -264,7 +264,7 @@ void change_area(s32 index) {
s32 areaFlags = gCurrentArea->flags;
if (gCurrAreaIndex != index) {
- func_8027A998();
+ unload_area();
load_area(index);
gCurrentArea->flags = areaFlags;
diff --git a/src/game/area.h b/src/game/area.h
@@ -134,16 +134,16 @@ extern s16 gCurrSaveFileNum;
extern s16 gCurrLevelNum;
-void func_8027A220(Vp *a, Vp *b, u8 c, u8 d, u8 e);
+void override_viewport_and_clip(Vp *a, Vp *b, u8 c, u8 d, u8 e);
void print_intro_text(void);
u32 get_mario_spawn_type(struct Object *o);
struct ObjectWarpNode *area_get_warp_node(u8 id);
void clear_areas(void);
-void func_8027A7C4(void);
+void clear_area_graph_nodes(void);
void load_area(s32 index);
-void func_8027A998(void);
+void unload_area(void);
void load_mario_area(void);
-void func_8027AA88(void);
+void unload_mario_area(void);
void change_area(s32 index);
void area_update_objects(void);
void play_transition(s16 transType, s16 time, u8 red, u8 green, u8 blue);
diff --git a/src/game/behavior_actions.c b/src/game/behavior_actions.c
@@ -74,13 +74,6 @@ struct Struct802C0DF0 {
const BehaviorScript *behavior;
};
-struct Struct8032FE4C {
- s32 unk0;
- s32 unk1;
- f32 unk2;
- f32 unk3;
-};
-
struct Struct8032F754 {
s32 unk0;
Vec3f unk1;
@@ -93,7 +86,7 @@ struct Struct8032FCE8 {
void *unk2;
};
-extern void BehClimbDetectLoop();
+extern void bhv_pole_base_loop();
extern s16 gDebugInfo[][8];
extern s8 gDoorAdjacentRooms[][2];
extern u8 inside_castle_seg7_collision_ddd_warp_2[];
@@ -107,7 +100,7 @@ extern struct Animation *blue_fish_seg3_anims_0301C2B0[];
extern struct Animation *cyan_fish_seg6_anims_0600E264[];
extern struct Animation *blue_fish_seg3_anims_0301C2B0[];
-void func_802A8D18(f32, f32, s32);
+void common_anchor_mario_behavior(f32, f32, s32);
s32 mario_moving_fast_enough_to_make_piranha_plant_bite(void);
void obj_set_secondary_camera_focus(void);
@@ -141,7 +134,7 @@ s16 D_8032F0CC[] = { 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046,
struct SpawnParticlesInfo D_8032F270 = { 2, 20, MODEL_MIST, 0, 40, 5, 30, 20, 252, 30, 330.0f, 10.0f };
// generate_wind_puffs/dust (something like that)
-void func_802AA618(s32 sp18, s32 sp1C, f32 sp20) {
+void spawn_mist_particles_variable(s32 sp18, s32 sp1C, f32 sp20) {
D_8032F270.sizeBase = sp20;
D_8032F270.sizeRange = sp20 / 20.0;
D_8032F270.offsetY = sp1C;
@@ -152,7 +145,7 @@ void func_802AA618(s32 sp18, s32 sp1C, f32 sp20) {
} else {
D_8032F270.count = 4;
}
- obj_spawn_particles(&D_8032F270);
+ cur_obj_spawn_particles(&D_8032F270);
}
#include "behaviors/sparkle_spawn_star.inc.c"
@@ -187,16 +180,16 @@ void func_802AA618(s32 sp18, s32 sp1C, f32 sp20) {
#include "behaviors/breakable_box.inc.c"
// not sure what this is doing here. not in a behavior file.
-Gfx *Geo18_802B1BB0(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
+Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
Mat4 sp20;
struct Object *sp1C;
if (run == TRUE) {
sp1C = (struct Object *) gCurGraphNodeObject;
if (sp1C == gMarioObject && sp1C->prevObj != NULL) {
- func_8029D704(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
- func_8029D558(sp20, sp1C->prevObj);
- func_8029EA0C(sp1C->prevObj);
+ create_transformation_from_matrices(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
+ obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
+ obj_set_gfx_pos_from_pos(sp1C->prevObj);
}
}
return NULL;
@@ -211,7 +204,7 @@ Gfx *Geo18_802B1BB0(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
// not in behavior file
// n is the number of objects to spawn, r if the rate of change of phase (frequency?)
-void func_802B2328(s32 n, s32 a1, s32 a2, s32 r) {
+void spawn_sparkle_particles(s32 n, s32 a1, s32 a2, s32 r) {
s32 i;
s16 separation = 0x10000 / n; // Evenly spread around a circle
for (i = 0; i < n; i++) {
@@ -232,6 +225,15 @@ void func_802B2328(s32 n, s32 a1, s32 a2, s32 r) {
#include "behaviors/bullet_bill.inc.c"
#include "behaviors/bowser.inc.c"
#include "behaviors/blue_fish.inc.c"
+
+// Not in behavior file, duplicate of vec3f_copy except without bad return.
+// Used in a few behavior files.
+void vec3f_copy_2(Vec3f dest, Vec3f src) {
+ dest[0] = src[0];
+ dest[1] = src[1];
+ dest[2] = src[2];
+}
+
#include "behaviors/checkerboard_platform.inc.c"
#include "behaviors/ddd_warp.inc.c"
#include "behaviors/water_pillar.inc.c"
@@ -252,6 +254,18 @@ void func_802B2328(s32 n, s32 a1, s32 a2, s32 r) {
#include "behaviors/tox_box.inc.c"
#include "behaviors/piranha_plant.inc.c"
#include "behaviors/bowser_puzzle_piece.inc.c"
+
+s32 set_obj_anim_with_accel_and_sound(s16 a0, s16 a1, s32 a2) {
+ f32 sp1C;
+ if ((sp1C = o->header.gfx.unk38.animAccel / (f32) 0x10000) == 0)
+ sp1C = 1.0f;
+ if (cur_obj_check_anim_frame_in_range(a0, sp1C) || cur_obj_check_anim_frame_in_range(a1, sp1C)) {
+ cur_obj_play_sound_2(a2);
+ return 1;
+ }
+ return 0;
+}
+
#include "behaviors/tuxie.inc.c"
#include "behaviors/fish.inc.c"
#include "behaviors/express_elevator.inc.c"
@@ -280,7 +294,7 @@ void func_802B2328(s32 n, s32 a1, s32 a2, s32 r) {
#include "behaviors/sparkle_spawn.inc.c"
#include "behaviors/scuttlebug.inc.c" // :scuttleeyes:
#include "behaviors/whomp.inc.c"
-#include "behaviors/water_splash.inc.c"
-#include "behaviors/wind_particle.inc.c"
-#include "behaviors/snowman_wind.inc.c"
-#include "behaviors/walking_penguin.inc.c"
+#include "behaviors/water_splashes_and_waves.inc.c"
+#include "behaviors/strong_wind_particle.inc.c"
+#include "behaviors/sl_snowman_wind.inc.c"
+#include "behaviors/sl_walking_penguin.inc.c"
diff --git a/src/game/behavior_actions.h b/src/game/behavior_actions.h
@@ -1,20 +1,21 @@
#ifndef _BEHAVIOR_ACTIONS_H
#define _BEHAVIOR_ACTIONS_H
-extern void func_802AA618(s32,s32,f32);
+extern void spawn_mist_particles_variable(s32,s32,f32);
extern void bhv_spawn_star_no_level_exit(u32);
extern void bhv_star_door_loop_2();
extern void spawn_triangle_break_particles(s16,s16,f32,s16);
-extern void func_802ADA94(void);
-extern void func_802ADBBC(u32);
-extern void func_802ADC20(s16,s16);
-extern s32 func_802B0C54(f32,f32);
-extern s32 func_802B2894(f32*,f32*,f32,f32);
-void func_802B8F7C(Vec3f dest,Vec3f src);
-extern void func_802BCFC4(f32,f32,s16,s16);
+
+extern void spawn_mist_from_global(void);
+extern void clear_particle_flags(u32);
+extern void spawn_wind_particles(s16,s16);
+extern s32 check_if_moving_over_floor(f32,f32);
+extern s32 arc_to_goal_pos(f32*,f32*,f32,f32);
+void vec3f_copy_2(Vec3f dest,Vec3f src);
+extern void tox_box_move(f32,f32,s16,s16);
extern void play_penguin_walking_sound(s32);
-extern s32 func_802C5A64(s32*);
-extern void func_802C76E0(s32, f32, f32, f32, f32);
+extern s32 update_angle_from_move_flags(s32*);
+extern void cur_obj_spawn_strong_wind_particles(s32, f32, f32, f32, f32);
void bhv_cap_switch_loop(void);
void bhv_tiny_star_particles_init(void);
@@ -29,7 +30,7 @@ void bhv_mr_i_particle_loop(void);
void bhv_piranha_particle_loop(void);
void bhv_giant_pole_loop(void);
void bhv_pole_init(void);
-void BehClimbDetectLoop(void);
+void bhv_pole_base_loop(void);
void bhv_thi_huge_island_top_loop(void);
void bhv_thi_tiny_island_top_loop(void);
void bhv_king_bobomb_loop(void);
@@ -58,7 +59,7 @@ void bhv_kickable_board_loop(void);
void bhv_tower_door_loop(void);
void bhv_wf_rotating_wooden_platform_loop(void);
void bhv_koopa_shell_underwater_loop(void);
-void BehFadingWarpLoop(void);
+void bhv_fading_warp_loop(void);
void bhv_warp_loop(void);
void bhv_white_puff_exploding_loop(void);
void bhv_spawned_star_init(void);
@@ -85,7 +86,7 @@ void bhv_water_mist_loop(void);
void bhv_water_mist_spawn_loop(void);
void bhv_water_mist_2_loop(void);
void bhv_pound_white_puffs_init(void);
-void bhv_unused_0e40_init(void);
+void bhv_ground_sand_init(void);
void bhv_ground_snow_init(void);
void bhv_wind_loop(void);
void bhv_unused_particle_spawn_loop(void);
@@ -161,7 +162,7 @@ void bhv_flame_moving_forward_growing_loop(void);
void bhv_flame_bowser_init(void);
void bhv_flame_bowser_loop(void);
void bhv_flame_large_burning_out_init(void);
-void bhv_blue_fish_loop(void);
+void bhv_blue_fish_movement_loop(void);
void bhv_tank_fish_group_loop(void);
void bhv_checkerboard_elevator_group_init(void);
void bhv_checkerboard_platform_init(void);
@@ -194,13 +195,13 @@ void bhv_lll_bowser_puzzle_piece_loop(void);
void bhv_lll_bowser_puzzle_loop(void);
void bhv_tuxies_mother_loop(void);
void bhv_small_penguin_loop(void);
+void bhv_large_fish_group_loop(void);
void bhv_fish_loop(void);
-void bhv_fish_group_2_loop(void);
void bhv_wdw_express_elevator_loop(void);
-void bhv_bird_chirp_chirp_loop(void);
-void bhv_cheep_cheep_loop(void);
+void bhv_bub_spawner_loop(void);
+void bhv_bub_loop(void);
void bhv_exclamation_box_loop(void);
-void bhv_rotatin_exclamation_box_loop(void);
+void bhv_rotating_exclamation_box_loop(void);
void bhv_sound_spawner_init(void);
void bhv_bowsers_sub_loop(void);
void bhv_sushi_shark_loop(void);
@@ -241,16 +242,16 @@ void bhv_sparkle_spawn_loop(void);
void bhv_scuttlebug_loop(void);
void bhv_scuttlebug_spawn_loop(void);
void bhv_whomp_loop(void);
-void bhv_water_splash_loop(void);
-void bhv_water_drops_loop(void);
-void bhv_water_surface_white_wave_init(void);
-void bhv_object_bubble_ripples_init(void);
-void bhv_surface_waves_loop(void);
-void bhv_surface_wave_shrinking_init(void);
-void bhv_wave_trail_loop(void);
-void bhv_white_wind_particle_loop(void);
-void bhv_snowman_wind_blowing_loop(void);
-void bhv_walking_penguin_loop(void);
+void bhv_water_splash_spawn_droplets(void);
+void bhv_water_droplet_loop(void);
+void bhv_water_droplet_splash_init(void);
+void bhv_bubble_splash_init(void);
+void bhv_idle_water_wave_loop(void);
+void bhv_shallow_water_splash_init(void);
+void bhv_wave_trail_shrink(void);
+void bhv_strong_wind_particle_loop(void);
+void bhv_sl_snowman_wind_loop(void);
+void bhv_sl_walking_penguin_loop(void);
void bhv_menu_button_init(void);
void bhv_menu_button_loop(void);
void bhv_menu_button_manager_init(void);
@@ -544,32 +545,32 @@ void bhv_intro_peach_loop(void);
void bhv_end_birds_1_loop(void);
void bhv_end_birds_2_loop(void);
void bhv_intro_scene_loop(void);
-void BehDustSmokeLoop(void);
-void BehYoshiLoop(void);
-void bhvLllVolcanoFallingTrap_loop(void);
+void bhv_dust_smoke_loop(void);
+void bhv_yoshi_loop(void);
+void bhv_volcano_trap_loop(void);
-extern Gfx *Geo18_802B1BB0(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
+extern Gfx *geo_move_mario_part_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
// Bowser
-extern Gfx *Geo18_802B7D44(s32 a0, struct GraphNode *node, UNUSED s32 a2);
-extern Gfx *Geo18_802B798C(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
+extern Gfx *geo_bits_bowser_coloring(s32 a0, struct GraphNode *node, UNUSED s32 a2);
+extern Gfx *geo_update_body_rot_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
extern Gfx *geo_switch_bowser_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *mtx);
// Tuxie
extern Gfx *geo_switch_tuxie_mother_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *mtx);
// Cap switch
-extern Gfx *Geo18_802A719C(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
+extern Gfx *geo_update_held_mario_pos(s32 run, UNUSED struct GraphNode *node, Mat4 mtx);
// Snufit
-extern Gfx *Geo18_8030D93C(s32 arg0, struct GraphNode *node, UNUSED void *arg2);
-extern Gfx *Geo18_8030D9AC(s32 arg0, struct GraphNode *node, UNUSED void *arg2);
+extern Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
+extern Gfx *geo_snufit_scale_body(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c);
// Bowser key cutscene
-extern Gfx *Geo18_802BA2B0(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]);
+extern Gfx *geo_scale_bowser_key(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]);
// Water splash
-extern struct WaterSplashParams D_8032FDD0;
-extern struct WaterSplashParams D_8032FE18;
+extern struct WaterDropletParams sShallowWaterSplashDropletParams;
+extern struct WaterDropletParams sShallowWaterWaveDropletParams;
#endif // _BEHAVIOR_ACTIONS_H
diff --git a/src/game/behaviors/amp.inc.c b/src/game/behaviors/amp.inc.c
@@ -31,7 +31,7 @@ void bhv_homing_amp_init(void) {
// Homing amps start at 1/10th their normal size.
// They grow when they "appear" to Mario.
- obj_scale(0.1f);
+ cur_obj_scale(0.1f);
// Hide the amp (until Mario gets near).
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
@@ -44,7 +44,7 @@ static void check_amp_attack(void) {
// Strange placement for this call. The hitbox is never cleared.
// For perspective, this code is run every frame of bhv_circling_amp_loop
// and every frame of a homing amp's HOMING_AMP_ACT_CHASE action.
- set_object_hitbox(o, &sAmpHitbox);
+ obj_set_hitbox(o, &sAmpHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
// Unnecessary if statement, maybe caused by a macro for
@@ -77,11 +77,11 @@ static void homing_amp_appear_loop(void) {
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, targetYaw, 0x1000);
// For 30 frames, make the amp "appear" by increasing its size by 0.03 each frame,
- // except for the first frame (when oTimer == 0) because the expression in obj_scale
+ // except for the first frame (when oTimer == 0) because the expression in cur_obj_scale
// evaluates to 0.1, which is the same as it was before. After 30 frames, it ends at
// a scale factor of 0.97. The amp remains at 97% of its real height for 60 more frames.
if (o->oTimer < 30) {
- obj_scale(0.1 + 0.9 * (f32)(o->oTimer / 30.0f));
+ cur_obj_scale(0.1 + 0.9 * (f32)(o->oTimer / 30.0f));
} else {
o->oAnimState = 1;
}
@@ -89,7 +89,7 @@ static void homing_amp_appear_loop(void) {
// Once the timer becomes greater than 90, i.e. 91 frames have passed,
// reset the amp's size and start chasing Mario.
if (o->oTimer >= 91) {
- obj_scale(1.0f);
+ cur_obj_scale(1.0f);
o->oAction = HOMING_AMP_ACT_CHASE;
o->oAmpYPhase = 0;
}
@@ -181,7 +181,7 @@ static void amp_attack_cooldown_loop(void) {
o->header.gfx.unk38.animFrame += 2;
o->oForwardVel = 0;
- obj_become_intangible();
+ cur_obj_become_intangible();
if (o->oTimer >= 31) {
o->oAnimState = 0;
@@ -189,7 +189,7 @@ static void amp_attack_cooldown_loop(void) {
if (o->oTimer >= 91) {
o->oAnimState = 1;
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = HOMING_AMP_ACT_CHASE;
}
}
@@ -213,7 +213,7 @@ void bhv_homing_amp_loop(void) {
case HOMING_AMP_ACT_CHASE:
homing_amp_chase_loop();
- PlaySound(SOUND_AIR_AMP_BUZZ);
+ cur_obj_play_sound_1(SOUND_AIR_AMP_BUZZ);
break;
case HOMING_AMP_ACT_GIVE_UP:
@@ -292,7 +292,7 @@ static void fixed_circling_amp_idle_loop(void) {
// Oscillate
o->oAmpYPhase++;
- // Where there is a PlaySound call in the main circling amp update function,
+ // Where there is a cur_obj_play_sound_1 call in the main circling amp update function,
// there is nothing here. Fixed amps are the only amps that never play
// the "amp buzzing" sound.
}
@@ -318,7 +318,7 @@ static void circling_amp_idle_loop(void) {
// Oscillate
o->oAmpYPhase++;
- PlaySound(SOUND_AIR_AMP_BUZZ);
+ cur_obj_play_sound_1(SOUND_AIR_AMP_BUZZ);
}
/**
diff --git a/src/game/behaviors/animated_floor_switch.inc.c b/src/game/behaviors/animated_floor_switch.inc.c
@@ -32,7 +32,7 @@ struct Struct80331A54 D_80331A54[][5] = {
s16 D_80331ACC[] = { 250, 200, 200 };
void bhv_animates_on_floor_switch_press_init(void) {
- o->parentObj = obj_nearest_object_with_behavior(bhvFloorSwitchAnimatesObject);
+ o->parentObj = cur_obj_nearest_object_with_behavior(bhvFloorSwitchAnimatesObject);
}
void bhv_animates_on_floor_switch_press_loop(void) {
@@ -53,9 +53,9 @@ void bhv_animates_on_floor_switch_press_loop(void) {
if (o->oFloorSwitchPressAnimationUnkF4 != 0) {
if (o->oFloorSwitchPressAnimationUnkF4 < 60) {
- PlaySound(SOUND_GENERAL2_SWITCH_TICK_SLOW);
+ cur_obj_play_sound_1(SOUND_GENERAL2_SWITCH_TICK_SLOW);
} else {
- PlaySound(SOUND_GENERAL2_SWITCH_TICK_FAST);
+ cur_obj_play_sound_1(SOUND_GENERAL2_SWITCH_TICK_FAST);
}
if (--o->oFloorSwitchPressAnimationUnkF4 == 0) {
@@ -73,5 +73,5 @@ void bhv_animates_on_floor_switch_press_loop(void) {
o->collisionData = segmented_to_virtual(
D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].unk00);
- obj_set_model(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].unk04);
+ cur_obj_set_model(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].unk04);
}
diff --git a/src/game/behaviors/bbh_haunted_bookshelf.inc.c b/src/game/behaviors/bbh_haunted_bookshelf.inc.c
@@ -32,11 +32,11 @@ void bhv_haunted_bookshelf_loop(void) {
case HAUNTED_BOOKSHELF_ACT_RECEDE:
// Move the bookshelf and play the sound
o->oPosX += 5.0f;
- PlaySound(SOUND_ENV_ELEVATOR4_2);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4_2);
// Delete the object after 102 frames
if (o->oTimer > 101) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
break;
diff --git a/src/game/behaviors/bbh_merry_go_round.inc.c b/src/game/behaviors/bbh_merry_go_round.inc.c
@@ -33,10 +33,10 @@ static void handle_merry_go_round_music(void) {
}
// All floors in the merry-go-round's enclosure have surface type 0x1A.
- // The obj_is_mario_on_platform check is redundant since the merry-go-round
+ // The cur_obj_is_mario_on_platform check is redundant since the merry-go-round
// has surface type 0x1A, so Mario cannot be on the merry-go-round
// without being on a floor with surface type 0x1A (SURFACE_MGR_MUSIC).
- if (obj_is_mario_on_platform() || marioFloorType == SURFACE_MGR_MUSIC) {
+ if (cur_obj_is_mario_on_platform() || marioFloorType == SURFACE_MGR_MUSIC) {
// If Mario is in the merry-go-round's enclosure, play only the merry-go-round music.
play_secondary_music(SEQ_EVENT_MERRY_GO_ROUND, 0, 78, 50);
gMarioOnMerryGoRound = TRUE;
@@ -57,7 +57,7 @@ static void handle_merry_go_round_music(void) {
func_80321080(300); // Switch to BBH music? FIXME: Audio needs labelling
o->oMerryGoRoundMusicShouldPlay = FALSE;
} else {
- PlaySound(SOUND_ENV_MERRY_GO_ROUND_CREAKING);
+ cur_obj_play_sound_1(SOUND_ENV_MERRY_GO_ROUND_CREAKING);
}
}
}
diff --git a/src/game/behaviors/beta_boo_key.inc.c b/src/game/behaviors/beta_boo_key.inc.c
@@ -25,7 +25,7 @@ void bhv_alpha_boo_key_loop(void) {
o->oFaceAngleRoll += 0x200;
o->oFaceAngleYaw += 0x200;
- if (are_objects_collided(o, gMarioObject)) {
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
// This line makes the object inside the key's parent boo drop.
// Was this intended to make the boo die when the key is collected?
// Boos don't read from oBooDeathStatus, they only set it to let the
@@ -38,7 +38,7 @@ void bhv_alpha_boo_key_loop(void) {
o->parentObj->oBooDeathStatus = BOO_DEATH_STATUS_DYING;
// Delete the object and spawn sparkles
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles);
}
}
@@ -51,8 +51,8 @@ void bhv_alpha_boo_key_loop(void) {
*/
static void beta_boo_key_dropped_loop(void) {
// Apply standard physics to the key
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
// Slowly increase the Y offset to make the model aligned correctly.
// This is spread out over 13 frames so that it's not noticable.
@@ -82,9 +82,9 @@ static void beta_boo_key_dropped_loop(void) {
// If the key hits the floor or 90 frames have elapsed since it was dropped,
// become tangible and handle collision.
if (o->oTimer > 90 || o->oMoveFlags & OBJ_MOVE_LANDED) {
- obj_become_tangible();
+ cur_obj_become_tangible();
- if (are_objects_collided(o, gMarioObject)) {
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
// This interaction status is 0x01, the first interaction status flag.
// It was only used for Hoot in the final game, but it seems it could've
// done something else or held some special meaning in beta.
@@ -97,7 +97,7 @@ static void beta_boo_key_dropped_loop(void) {
o->parentObj->oInteractStatus = INT_STATUS_HOOT_GRABBED_BY_MARIO;
// Delete the object and spawn sparkles
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles);
}
}
@@ -113,7 +113,7 @@ static void beta_boo_key_drop(void) {
// Update the key to be inside the boo
struct Object *parent = o->parentObj;
- copy_object_pos(o, parent);
+ obj_copy_pos(o, parent);
// This if statement to only run this code on the first frame
// is redundant, since it instantly sets the action to BETA_BOO_KEY_ACT_DROPPED
@@ -147,7 +147,7 @@ static void beta_boo_key_drop(void) {
static void beta_boo_key_inside_boo_loop(void) {
// Update the key to be inside the boo at all times
struct Object *parent = o->parentObj;
- copy_object_pos(o, parent);
+ obj_copy_pos(o, parent);
// Use a Y offset of 40 to make the key model aligned correctly.
// (Why didn't they use oGraphYOffset?)
@@ -170,5 +170,5 @@ static void (*sBetaBooKeyActions[])(void) = { beta_boo_key_inside_boo_loop, beta
* Update function for bhvBetaBooKey.
*/
void bhv_beta_boo_key_loop(void) {
- obj_call_action_function(sBetaBooKeyActions);
+ cur_obj_call_action_function(sBetaBooKeyActions);
}
diff --git a/src/game/behaviors/beta_bowser_anchor.inc.c b/src/game/behaviors/beta_bowser_anchor.inc.c
@@ -14,10 +14,10 @@
void bhv_beta_bowser_anchor_loop(void) {
// Set the object's position to be 30 units above Mario's feet,
// and 300 units in front of him.
- obj_set_pos_relative(gMarioObject, 0, 30.0f, 300.0f);
+ cur_obj_set_pos_relative(gMarioObject, 0, 30.0f, 300.0f);
o->hitboxRadius = gDebugInfo[4][0] + 100;
o->hitboxHeight = gDebugInfo[4][1] + 300;
- attack_collided_non_mario_object(o);
+ obj_attack_collided_from_other_object(o);
}
diff --git a/src/game/behaviors/beta_chest.inc.c b/src/game/behaviors/beta_chest.inc.c
@@ -12,7 +12,7 @@
*/
void bhv_beta_chest_bottom_init(void) {
// Set the object's model
- obj_set_model(MODEL_TREASURE_CHEST_BASE);
+ cur_obj_set_model(MODEL_TREASURE_CHEST_BASE);
// ??? Pointless code?
// Maybe chests were originally intended to have random yaws.
@@ -33,7 +33,7 @@ void bhv_beta_chest_bottom_init(void) {
* with radius 200 units and height 200 units.
*/
void bhv_beta_chest_bottom_loop(void) {
- obj_push_mario_away_from_cylinder(200.0f, 200.0f);
+ cur_obj_push_mario_away_from_cylinder(200.0f, 200.0f);
}
/**
diff --git a/src/game/behaviors/beta_holdable_object.inc.c b/src/game/behaviors/beta_holdable_object.inc.c
@@ -21,9 +21,9 @@ void bhv_beta_holdable_object_init(void) {
*/
static void beta_holdable_object_drop(void) {
// Re-enable rendering
- obj_enable_rendering();
+ cur_obj_enable_rendering();
- obj_get_dropped();
+ cur_obj_get_dropped();
o->oHeldState = HELD_FREE;
@@ -35,10 +35,10 @@ static void beta_holdable_object_drop(void) {
* Throw the object.
*/
static void beta_holdable_object_throw(void) {
- // obj_enable_rendering_2 just calls obj_enable_rendering and does
+ // cur_obj_enable_rendering_2 just calls cur_obj_enable_rendering and does
// nothing else; it's useless here. Maybe it originally did more?
- obj_enable_rendering_2();
- obj_enable_rendering();
+ cur_obj_enable_rendering_2();
+ cur_obj_enable_rendering();
o->oHeldState = HELD_FREE;
@@ -64,7 +64,7 @@ void bhv_beta_holdable_object_loop(void) {
case HELD_HELD:
// Disable rendering to hide the object while it's held
- obj_disable_rendering();
+ cur_obj_disable_rendering();
break;
case HELD_THROWN:
diff --git a/src/game/behaviors/beta_trampoline.inc.c b/src/game/behaviors/beta_trampoline.inc.c
@@ -20,8 +20,8 @@ void bhv_beta_trampoline_spring_loop(void) {
f32 yDisplacement;
// Update to be 75 units under the trampoline top
- copy_object_pos_and_angle(o, o->parentObj);
- copy_object_graph_y_offset(o, o->parentObj);
+ obj_copy_pos_and_angle(o, o->parentObj);
+ obj_copy_graph_y_offset(o, o->parentObj);
o->oPosY -= 75.0f;
// If the trampoline top is above its original position,
@@ -42,7 +42,7 @@ void bhv_beta_trampoline_spring_loop(void) {
}
// Scale the spring
- scale_object_xyz(o, 1.0f, yScale, 1.0f);
+ obj_scale_xyz(o, 1.0f, yScale, 1.0f);
}
/**
@@ -53,7 +53,7 @@ void bhv_beta_trampoline_spring_loop(void) {
* do anything.
*/
void bhv_beta_trampoline_top_loop(void) {
- obj_set_model(MODEL_TRAMPOLINE);
+ cur_obj_set_model(MODEL_TRAMPOLINE);
// When initialized, spawn the rest of the trampoline
if (o->oTimer == 0) {
@@ -83,5 +83,5 @@ void bhv_beta_trampoline_top_loop(void) {
// that the trampoline is currently in use. This potential
// trampoline infrastructure is found in mario_step.c. See
// that file for more details.
- nop_80254E50();
+ stub_mario_step_2();
}
diff --git a/src/game/behaviors/bird.inc.c b/src/game/behaviors/bird.inc.c
@@ -21,7 +21,7 @@ static void bird_act_inactive(void) {
if (o->oBehParams2ndByte != BIRD_BP_SPAWNED) {
s32 i;
- PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
+ cur_obj_play_sound_2(SOUND_GENERAL_BIRDS_FLY_AWAY);
for (i = 0; i < 6; i++) {
spawn_object(o, MODEL_BIRDS, bhvBird);
@@ -42,7 +42,7 @@ static void bird_act_inactive(void) {
o->oBirdSpeed = 40.0f;
- obj_unhide();
+ cur_obj_unhide();
}
}
@@ -63,12 +63,12 @@ static void bird_act_fly(void) {
// is itself. In other words, when a group of birds has its spawner bird
// fly past Y=8000, they will all despawn simultaneously. Otherwise, fly.
if (o->parentObj->oPosY > 8000.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
// If the bird is a spawner bird, fly towards its home; otherwise,
// fly towards the bird's spawner bird.
if (o->oBehParams2ndByte != BIRD_BP_SPAWNED) {
- distance = obj_lateral_dist_to_home();
+ distance = cur_obj_lateral_dist_to_home();
// The spawner bird will start with its downwards (positive) pitch
// and will continuously decrease its pitch (i.e. make itself face more upwards)
@@ -76,13 +76,13 @@ static void bird_act_fly(void) {
// This is done by making its target pitch the arctangent of its distance
// to its home and its position - 10,000 (which is always negative).
o->oBirdTargetPitch = atan2s(distance, o->oPosY - 10000.0f);
- o->oBirdTargetYaw = obj_angle_to_home();
+ o->oBirdTargetYaw = cur_obj_angle_to_home();
} else {
distance = lateral_dist_between_objects(o, o->parentObj);
// The bird's target pitch will face directly to its spawner bird.
o->oBirdTargetPitch = atan2s(distance, o->oPosY - o->parentObj->oPosY);
- o->oBirdTargetYaw = angle_to_object(o, o->parentObj);
+ o->oBirdTargetYaw = obj_angle_to_object(o, o->parentObj);
// The bird goes faster the farther it is from its spawner bird so it can catch up.
o->oBirdSpeed = 0.04f * dist_between_objects(o, o->parentObj) + 20.0f;
@@ -90,7 +90,7 @@ static void bird_act_fly(void) {
// Approach to match the bird's target yaw and pitch.
obj_move_pitch_approach(o->oBirdTargetPitch, 140);
- obj_rotate_yaw_toward(o->oBirdTargetYaw, 800);
+ cur_obj_rotate_yaw_toward(o->oBirdTargetYaw, 800);
obj_roll_to_match_yaw_turn(o->oBirdTargetYaw, 0x3000, 600);
}
@@ -100,7 +100,7 @@ static void bird_act_fly(void) {
// a constant added to its Y position every frame since
// its Y velocity is reset every frame by
// obj_compute_vel_from_move_pitch.
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
/**
diff --git a/src/game/behaviors/blue_coin.inc.c b/src/game/behaviors/blue_coin.inc.c
@@ -13,11 +13,11 @@ void bhv_hidden_blue_coin_loop(void) {
switch (o->oAction) {
case HIDDEN_BLUE_COIN_ACT_INACTIVE:
// Become invisible and intangible
- obj_disable_rendering();
- obj_become_intangible();
+ cur_obj_disable_rendering();
+ cur_obj_become_intangible();
// Set action to HIDDEN_BLUE_COIN_ACT_WAITING after the blue coin switch is found.
- o->oHiddenBlueCoinSwitch = obj_nearest_object_with_behavior(bhvBlueCoinSwitch);
+ o->oHiddenBlueCoinSwitch = cur_obj_nearest_object_with_behavior(bhvBlueCoinSwitch);
if (o->oHiddenBlueCoinSwitch != NULL) {
o->oAction++;
@@ -35,19 +35,19 @@ void bhv_hidden_blue_coin_loop(void) {
break;
case HIDDEN_BLUE_COIN_ACT_ACTIVE:
// Become tangible
- obj_enable_rendering();
- obj_become_tangible();
+ cur_obj_enable_rendering();
+ cur_obj_become_tangible();
// Delete the coin once collected
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
// After 200 frames of waiting and 20 2-frame blinks (for 240 frames total),
// delete the object.
- if (obj_wait_then_blink(200, 20)) {
- mark_object_for_deletion(o);
+ if (cur_obj_wait_then_blink(200, 20)) {
+ obj_mark_for_deletion(o);
}
break;
@@ -61,7 +61,7 @@ void bhv_hidden_blue_coin_loop(void) {
*/
void bhv_blue_coin_switch_loop(void) {
// The switch's model is 1/3 size.
- obj_scale(3.0f);
+ cur_obj_scale(3.0f);
switch (o->oAction) {
case BLUE_COIN_SWITCH_ACT_IDLE:
@@ -77,7 +77,7 @@ void bhv_blue_coin_switch_loop(void) {
// Set gravity to 0 so it doesn't accelerate when receding.
o->oGravity = 0.0f;
- PlaySound2(SOUND_GENERAL_SWITCH_DOOR_OPEN);
+ cur_obj_play_sound_2(SOUND_GENERAL_SWITCH_DOOR_OPEN);
}
}
@@ -90,7 +90,7 @@ void bhv_blue_coin_switch_loop(void) {
// This is probably an off-by-one error, since the switch is 100 units tall
// and recedes at 20 units/frame, which means it will fully recede after 5 frames.
if (o->oTimer > 5) {
- obj_hide();
+ cur_obj_hide();
// Set to BLUE_COIN_SWITCH_ACT_TICKING
o->oAction++;
@@ -98,13 +98,13 @@ void bhv_blue_coin_switch_loop(void) {
o->oPosY = gMarioObject->oPosY - 40.0f;
// Spawn particles. There's a function that calls this same function
- // with the same arguments, func_802A3004, why didn't they just call that?
- func_802AA618(0, 0, 46.0f);
+ // with the same arguments, spawn_mist_particles, why didn't they just call that?
+ spawn_mist_particles_variable(0, 0, 46.0f);
} else {
// Have collision while receding
load_object_collision_model();
// Recede
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
break;
@@ -118,8 +118,8 @@ void bhv_blue_coin_switch_loop(void) {
// Delete the switch (which stops the sound) after the last coin is collected,
// or after the coins unload after the 240-frame timer expires.
- if (obj_nearest_object_with_behavior(bhvHiddenBlueCoin) == NULL || o->oTimer > 240) {
- mark_object_for_deletion(o);
+ if (cur_obj_nearest_object_with_behavior(bhvHiddenBlueCoin) == NULL || o->oTimer > 240) {
+ obj_mark_for_deletion(o);
}
break;
diff --git a/src/game/behaviors/blue_fish.inc.c b/src/game/behaviors/blue_fish.inc.c
@@ -1,76 +1,127 @@
-// blue_fish.c.inc
+/**
+ * @file blue_fish.inc.c
+ * Implements behaviour and spawning for bhvBlueFish located in the castle aquarium outside of SA.
+ */
-void bhv_blue_fish_loop(void) {
- f32 sp24;
+/**
+ * Determines fish movement.
+ */
+void bhv_blue_fish_movement_loop(void) {
+ f32 randomSwitch;
switch (o->oAction) {
- case 0:
- func_8029ED98(0, 1.0f);
+ // Initial dive phase after spawning
+ case BLUE_FISH_ACT_DIVE:
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
+
+ // Assigns random values to variables that help determine natural motion.
if (o->oTimer == 0) {
- o->oBlueFishUnk100 = RandomSign() << 11;
- o->oBlueFishUnkF4 = RandomFloat() * 2;
- o->oBlueFishUnkF8 = (s32)(RandomFloat() * 30) & 0xFE;
- sp24 = RandomFloat() * 5;
- if (sp24 < 2.0f)
+ o->oBlueFishRandomAngle = RandomSign() << 11;
+ o->oBlueFishRandomVel = RandomFloat() * 2;
+ o->oBlueFishRandomTime = (s32)(RandomFloat() * 30) & 0xFE;
+
+ // Adjusts pitch velocity or sets to zero dependant on outcome of randomSwitch.
+ randomSwitch = RandomFloat() * 5;
+ if (randomSwitch < 2.0f) {
o->oAngleVelPitch = random_f32_around_zero(128);
- else
+ } else {
o->oAngleVelPitch = 0;
+ }
}
- o->oForwardVel = o->oBlueFishUnkF4 + 3.0f;
- if (o->oTimer >= o->oBlueFishUnkF8 + 60)
+
+ // Set forward velocity and progress oAction to BLUE_FISH_ACT_TURN.
+ o->oForwardVel = o->oBlueFishRandomVel + 3.0f;
+ if (o->oTimer >= o->oBlueFishRandomTime + 60) {
o->oAction++;
- if (o->oTimer < (o->oBlueFishUnkF8 + 60) / 2)
+ }
+
+ // Set pitch velocity
+ if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
o->oFaceAnglePitch += o->oAngleVelPitch;
- else
+ } else {
o->oFaceAnglePitch -= o->oAngleVelPitch;
+ }
+
+ // Calculate new Y velocity
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
break;
- case 1:
- func_8029ED98(0, 2.0f);
- o->oMoveAngleYaw = (s32)(o->oBlueFishUnk100 + o->oMoveAngleYaw);
- if (o->oTimer == 15)
+ // Animates and adjusts fish yaw angle.
+ case BLUE_FISH_ACT_TURN:
+ cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
+ o->oMoveAngleYaw = (s32)(o->oBlueFishRandomAngle + o->oMoveAngleYaw);
+ if (o->oTimer == 15) {
o->oAction++;
- break;
- case 2:
- func_8029ED98(0, 1.0f);
- if (o->oTimer >= o->oBlueFishUnkF8 + 60)
+ }
+ break;
+ // Animates and adjusts pitch to an upward direction.
+ case BLUE_FISH_ACT_ASCEND:
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
+
+ // Progresses oAction to BLUE_FISH_ACT_TURN_BACK after elapsed time.
+ if (o->oTimer >= o->oBlueFishRandomTime + 60) {
o->oAction++;
- if (o->oTimer < (o->oBlueFishUnkF8 + 60) / 2)
+ }
+
+ // Adjusts pitch angle. Direction relies on time not passed.
+ if (o->oTimer < (o->oBlueFishRandomTime + 60) / 2) {
o->oFaceAnglePitch -= o->oAngleVelPitch;
- else
+ } else {
o->oFaceAnglePitch += o->oAngleVelPitch;
- break;
- case 3:
- func_8029ED98(0, 2.0f);
- o->oMoveAngleYaw = (s32)(o->oBlueFishUnk100 + o->oMoveAngleYaw);
- if (o->oTimer == 15)
- o->oAction = 0;
+ }
+ break;
+ // Animates and turns fish around
+ case BLUE_FISH_ACT_TURN_BACK:
+ cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
+ o->oMoveAngleYaw = (s32)(o->oBlueFishRandomAngle + o->oMoveAngleYaw);
+
+ // Sets the fish back to the BLUE_FISH_ACT_DIVE phase.
+ if (o->oTimer == 15) {
+ o->oAction = BLUE_FISH_ACT_DIVE;
+ }
break;
}
+
+ // Calculates Y velocity and calls physics engine.
o->oVelY = -sins(o->oFaceAnglePitch) * o->oForwardVel;
- obj_move_using_fvel_and_gravity();
- if (o->parentObj->oAction == 2)
- mark_object_for_deletion(o);
+ cur_obj_move_using_fvel_and_gravity();
+
+ // Deletes object if the parent has oAction set to BLUE_FISH_ACT_DUPLICATE.
+ if (o->parentObj->oAction == BLUE_FISH_ACT_DUPLICATE) {
+ obj_mark_for_deletion(o);
+ }
}
+/**
+ * Spawns fifteen fish if Mario resides in room fifteen or seven.
+ * They move at random within 200.0f
+ */
void bhv_tank_fish_group_loop(void) {
struct Object *fish;
s32 i;
switch (o->oAction) {
- case 0:
+ case BLUE_FISH_ACT_SPAWN:
if (gMarioCurrentRoom == 15 || gMarioCurrentRoom == 7) {
+
+ // spawns fifteen fish and moves them within 200.0f
for (i = 0; i < 15; i++) {
fish = spawn_object_relative(0, 300, 0, -200, o, MODEL_FISH, bhvBlueFish);
- translate_object_xyz_random(fish, 200.0f);
+ obj_translate_xyz_random(fish, 200.0f);
}
+
+ // Proceed to BLUE_FISH_ACT_ROOM phase.
o->oAction++;
}
break;
- case 1:
- if (gMarioCurrentRoom != 15 && gMarioCurrentRoom != 7)
+
+ // Sets next oAction phase if Mario is not in rooms fifteen and seven.
+ case BLUE_FISH_ACT_ROOM:
+ if (gMarioCurrentRoom != 15 && gMarioCurrentRoom != 7) {
o->oAction++;
+ }
break;
- case 2:
- o->oAction = 0;
+
+ // Sets oAction to the BLUE_FISH_ACT_SPAWN phase.
+ case BLUE_FISH_ACT_DUPLICATE:
+ o->oAction = BLUE_FISH_ACT_SPAWN;
break;
}
}
diff --git a/src/game/behaviors/bobomb.inc.c b/src/game/behaviors/bobomb.inc.c
@@ -19,7 +19,7 @@ void bhv_bobomb_init(void) {
o->oInteractionSubtype = INT_SUBTYPE_KICKABLE;
}
-void func_802E5B7C(void) {
+void bobomb_spawn_coin(void) {
if (((o->oBehParams >> 8) & 0x1) == 0) {
obj_spawn_yellow_coins(o, 1);
o->oBehParams = 0x100;
@@ -27,22 +27,23 @@ void func_802E5B7C(void) {
}
}
-void BobombExplodeLoop(void) {
+void bobomb_act_explode(void) {
struct Object *explosion;
if (o->oTimer < 5)
- obj_scale(1.0 + (f32) o->oTimer / 5.0);
+ cur_obj_scale(1.0 + (f32) o->oTimer / 5.0);
else {
explosion = spawn_object(o, MODEL_EXPLOSION, bhvExplosion);
explosion->oGraphYOffset += 100.0f;
- func_802E5B7C();
+ bobomb_spawn_coin();
create_respawner(MODEL_BLACK_BOBOMB, bhvBobomb, 3000);
o->activeFlags = 0;
}
}
-void CheckBobombInteractions(void) {
- set_object_hitbox(o, &sBobombHitbox);
+
+void bobomb_check_interactions(void) {
+ obj_set_hitbox(o, &sBobombHitbox);
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) /* bit 15 */
{
if ((o->oInteractStatus & INTERACT_GRABBABLE) != 0) /* bit 1 */
@@ -59,11 +60,11 @@ void CheckBobombInteractions(void) {
o->oInteractStatus = 0;
}
- if (attack_collided_non_mario_object(o) == 1)
+ if (obj_attack_collided_from_other_object(o) == 1)
o->oAction = BOBOMB_ACT_EXPLODE;
}
-void BobombPatrolLoop(void) {
+void bobomb_act_patrol(void) {
UNUSED s8 filler[4];
UNUSED s16 sp22;
s16 collisionFlags;
@@ -80,7 +81,7 @@ void BobombPatrolLoop(void) {
obj_check_floor_death(collisionFlags, sObjFloor);
}
-void BobombChaseMarioLoop(void) {
+void bobomb_act_chase_mario(void) {
UNUSED u8 filler[4];
s16 sp1a, collisionFlags;
@@ -90,35 +91,35 @@ void BobombChaseMarioLoop(void) {
collisionFlags = object_step();
if (sp1a == 5 || sp1a == 16)
- PlaySound2(SOUND_OBJ_BOBOMB_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BOBOMB_WALK);
obj_turn_toward_object(o, gMarioObject, 16, 0x800);
obj_check_floor_death(collisionFlags, sObjFloor);
}
-void BobombLaunchedLoop(void) {
+void bobomb_act_launched(void) {
s16 collisionFlags = 0;
collisionFlags = object_step();
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) == OBJ_COL_FLAG_GROUNDED)
o->oAction = BOBOMB_ACT_EXPLODE; /* bit 0 */
}
-void GenericBobombFreeLoop(void) {
+void generic_bobomb_free_loop(void) {
switch (o->oAction) {
case BOBOMB_ACT_PATROL:
- BobombPatrolLoop();
+ bobomb_act_patrol();
break;
case BOBOMB_ACT_LAUNCHED:
- BobombLaunchedLoop();
+ bobomb_act_launched();
break;
case BOBOMB_ACT_CHASE_MARIO:
- BobombChaseMarioLoop();
+ bobomb_act_chase_mario();
break;
case BOBOMB_ACT_EXPLODE:
- BobombExplodeLoop();
+ bobomb_act_explode();
break;
case BOBOMB_ACT_LAVA_DEATH:
@@ -132,20 +133,20 @@ void GenericBobombFreeLoop(void) {
break;
}
- CheckBobombInteractions();
+ bobomb_check_interactions();
if (o->oBobombFuseTimer >= 151)
o->oAction = 3;
}
-void StationaryBobombFreeLoop(void) {
+void stationary_bobomb_free_loop(void) {
switch (o->oAction) {
case BOBOMB_ACT_LAUNCHED:
- BobombLaunchedLoop();
+ bobomb_act_launched();
break;
case BOBOMB_ACT_EXPLODE:
- BobombExplodeLoop();
+ bobomb_act_explode();
break;
case BOBOMB_ACT_LAVA_DEATH:
@@ -159,28 +160,28 @@ void StationaryBobombFreeLoop(void) {
break;
}
- CheckBobombInteractions();
+ bobomb_check_interactions();
if (o->oBobombFuseTimer >= 151)
o->oAction = 3;
}
-void BobombFreeLoop(void) {
+void bobomb_free_loop(void) {
if (o->oBehParams2ndByte == BOBOMB_BP_STYPE_GENERIC)
- GenericBobombFreeLoop();
+ generic_bobomb_free_loop();
else
- StationaryBobombFreeLoop();
+ stationary_bobomb_free_loop();
}
-void BobombHeldLoop(void) {
+void bobomb_held_loop(void) {
o->header.gfx.node.flags |= 0x10; /* bit 4 */
- SetObjAnimation(1);
- obj_set_pos_relative(gMarioObject, 0, 60.0f, 100.0);
+ cur_obj_init_animation(1);
+ cur_obj_set_pos_relative(gMarioObject, 0, 60.0f, 100.0);
o->oBobombFuseLit = 1;
if (o->oBobombFuseTimer >= 151) {
//! Although the Bob-omb's action is set to explode when the fuse timer expires,
- // BobombExplodeLoop() will not execute until the bob-omb's held state changes.
+ // bobomb_act_explode() will not execute until the bob-omb's held state changes.
// This allows the Bob-omb to be regrabbed indefinitely.
gMarioObject->oInteractStatus |= INTERACT_DAMAGE; /* bit 3 */
@@ -188,18 +189,18 @@ void BobombHeldLoop(void) {
}
}
-void BobombDroppedLoop(void) {
- obj_get_dropped();
+void bobomb_dropped_loop(void) {
+ cur_obj_get_dropped();
o->header.gfx.node.flags &= ~0x10; /* bit 4 = 0 */
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oHeldState = 0;
o->oAction = BOBOMB_ACT_PATROL;
}
-void BobombThrownLoop(void) {
- obj_enable_rendering_2();
+void bobomb_thrown_loop(void) {
+ cur_obj_enable_rendering_2();
o->header.gfx.node.flags &= ~0x10; /* bit 4 = 0 */
o->oHeldState = 0;
@@ -211,7 +212,7 @@ void BobombThrownLoop(void) {
// sp18 = blinkTimer
-void ObjRandomBlink(s32 *blinkTimer) {
+void curr_obj_random_blink(s32 *blinkTimer) {
if (*blinkTimer == 0) {
if ((s16)(RandomFloat() * 100.0f) == 0) {
o->oAnimState = 1;
@@ -235,23 +236,23 @@ void bhv_bobomb_loop(void) {
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 4000) != 0) {
switch (o->oHeldState) {
case HELD_FREE:
- BobombFreeLoop();
+ bobomb_free_loop();
break;
case HELD_HELD:
- BobombHeldLoop();
+ bobomb_held_loop();
break;
case HELD_THROWN:
- BobombThrownLoop();
+ bobomb_thrown_loop();
break;
case HELD_DROPPED:
- BobombDroppedLoop();
+ bobomb_dropped_loop();
break;
}
- ObjRandomBlink(&o->oBobombBlinkTimer);
+ curr_obj_random_blink(&o->oBobombBlinkTimer);
if (o->oBobombFuseLit == 1) {
if (o->oBobombFuseTimer >= 121)
@@ -263,7 +264,7 @@ void bhv_bobomb_loop(void) {
== 0) /* oBobombFuseTimer % 2 or oBobombFuseTimer % 8 */
spawn_object(o, MODEL_SMOKE, bhvBobombFuseSmoke);
- PlaySound(SOUND_AIR_BOBOMB_LIT_FUSE);
+ cur_obj_play_sound_1(SOUND_AIR_BOBOMB_LIT_FUSE);
o->oBobombFuseTimer++;
}
@@ -274,7 +275,7 @@ void bhv_bobomb_fuse_smoke_init(void) {
o->oPosX += (s32)(RandomFloat() * 80.0f) - 40;
o->oPosY += (s32)(RandomFloat() * 80.0f) + 60;
o->oPosZ += (s32)(RandomFloat() * 80.0f) - 40;
- obj_scale(1.2f);
+ cur_obj_scale(1.2f);
}
void bhv_bobomb_buddy_init(void) {
@@ -284,7 +285,7 @@ void bhv_bobomb_buddy_init(void) {
o->oInteractionSubtype = INT_SUBTYPE_NPC;
}
-void BobombBuddyIdleLoop(void) {
+void bobomb_buddy_act_idle(void) {
UNUSED u8 filler[4];
s16 sp1a = o->header.gfx.unk38.animFrame;
UNUSED s16 collisionFlags = 0;
@@ -296,7 +297,7 @@ void BobombBuddyIdleLoop(void) {
collisionFlags = object_step();
if ((sp1a == 5) || (sp1a == 16))
- PlaySound2(SOUND_OBJ_BOBOMB_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BOBOMB_WALK);
if (o->oDistanceToMario < 1000.0f)
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x140);
@@ -313,7 +314,7 @@ void BobombBuddyIdleLoop(void) {
* dialogSecondText is called after Bob-omb Buddy has the cannon(s) ready and
* then tells Mario that is "Ready for blastoff".
*/
-void BobombBuddyCannonLoop(s16 dialogFirstText, s16 dialogSecondText) {
+void bobomb_buddy_cannon_dialog(s16 dialogFirstText, s16 dialogSecondText) {
struct Object *cannonClosed;
s16 buddyText, cutscene;
@@ -322,7 +323,7 @@ void BobombBuddyCannonLoop(s16 dialogFirstText, s16 dialogSecondText) {
buddyText = cutscene_object_with_dialog(CUTSCENE_DIALOG, o, dialogFirstText);
if (buddyText != 0) {
save_file_set_cannon_unlocked();
- cannonClosed = obj_nearest_object_with_behavior(bhvCannonClosed);
+ cannonClosed = cur_obj_nearest_object_with_behavior(bhvCannonClosed);
if (cannonClosed != 0)
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_OPENING;
else
@@ -331,7 +332,7 @@ void BobombBuddyCannonLoop(s16 dialogFirstText, s16 dialogSecondText) {
break;
case BOBOMB_BUDDY_CANNON_OPENING:
- cannonClosed = obj_nearest_object_with_behavior(bhvCannonClosed);
+ cannonClosed = cur_obj_nearest_object_with_behavior(bhvCannonClosed);
cutscene = cutscene_object(CUTSCENE_PREPARE_CANNON, cannonClosed);
if (cutscene == -1)
o->oBobombBuddyCannonStatus = BOBOMB_BUDDY_CANNON_OPENED;
@@ -355,7 +356,7 @@ void BobombBuddyCannonLoop(s16 dialogFirstText, s16 dialogSecondText) {
}
}
-void BobombBuddyTalkLoop(void) {
+void bobomb_buddy_act_talk(void) {
if (set_mario_npc_dialog(1) == 2) {
o->activeFlags |= 0x20; /* bit 5 */
@@ -374,38 +375,38 @@ void BobombBuddyTalkLoop(void) {
case BOBOMB_BUDDY_ROLE_CANNON:
if (gCurrCourseNum == COURSE_BOB)
- BobombBuddyCannonLoop(DIALOG_004, DIALOG_105);
+ bobomb_buddy_cannon_dialog(DIALOG_004, DIALOG_105);
else
- BobombBuddyCannonLoop(DIALOG_047, DIALOG_106);
+ bobomb_buddy_cannon_dialog(DIALOG_047, DIALOG_106);
break;
}
}
}
-void BobombBuddyTurnToTalkLoop(void) {
+void bobomb_buddy_act_turn_to_talk(void) {
s16 sp1e = o->header.gfx.unk38.animFrame;
if ((sp1e == 5) || (sp1e == 16))
- PlaySound2(SOUND_OBJ_BOBOMB_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BOBOMB_WALK);
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x1000);
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario)
o->oAction = BOBOMB_BUDDY_ACT_TALK;
- PlaySound2(SOUND_ACTION_READ_SIGN);
+ cur_obj_play_sound_2(SOUND_ACTION_READ_SIGN);
}
-void BobombBuddyActionLoop(void) {
+void bobomb_buddy_actions(void) {
switch (o->oAction) {
case BOBOMB_BUDDY_ACT_IDLE:
- BobombBuddyIdleLoop();
+ bobomb_buddy_act_idle();
break;
case BOBOMB_BUDDY_ACT_TURN_TO_TALK:
- BobombBuddyTurnToTalkLoop();
+ bobomb_buddy_act_turn_to_talk();
break;
case BOBOMB_BUDDY_ACT_TALK:
- BobombBuddyTalkLoop();
+ bobomb_buddy_act_talk();
break;
}
@@ -413,9 +414,9 @@ void BobombBuddyActionLoop(void) {
}
void bhv_bobomb_buddy_loop(void) {
- BobombBuddyActionLoop();
+ bobomb_buddy_actions();
- ObjRandomBlink(&o->oBobombBuddyBlinkTimer);
+ curr_obj_random_blink(&o->oBobombBuddyBlinkTimer);
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/bomp.inc.c b/src/game/behaviors/bomp.inc.c
@@ -24,7 +24,7 @@ void bhv_small_bomp_loop(void) {
if (o->oTimer == 15.0) {
o->oAction = BOMP_ACT_EXTEND;
o->oForwardVel = 40.0f;
- PlaySound2(SOUND_OBJ_UNKNOWN2);
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
}
break;
@@ -38,7 +38,7 @@ void bhv_small_bomp_loop(void) {
o->oAction = BOMP_ACT_RETRACT;
o->oForwardVel = 10.0f;
o->oMoveAngleYaw -= 0x8000;
- PlaySound2(SOUND_OBJ_UNKNOWN2);
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
}
break;
@@ -80,7 +80,7 @@ void bhv_large_bomp_loop(void) {
if (o->oTimer == 15.0) {
o->oAction = BOMP_ACT_EXTEND;
o->oForwardVel = 10.0f;
- PlaySound2(SOUND_OBJ_UNKNOWN2);
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
}
break;
@@ -94,7 +94,7 @@ void bhv_large_bomp_loop(void) {
o->oAction = BOMP_ACT_RETRACT;
o->oForwardVel = 10.0f;
o->oMoveAngleYaw -= 0x8000;
- PlaySound2(SOUND_OBJ_UNKNOWN2);
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN2);
}
break;
diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c
@@ -30,7 +30,7 @@ void bhv_boo_init(void) {
}
static s32 boo_should_be_stopped(void) {
- if (obj_has_behavior(bhvMerryGoRoundBigBoo) || obj_has_behavior(bhvMerryGoRoundBoo)) {
+ if (cur_obj_has_behavior(bhvMerryGoRoundBigBoo) || cur_obj_has_behavior(bhvMerryGoRoundBoo)) {
if (gMarioOnMerryGoRound == FALSE) {
return TRUE;
} else {
@@ -54,13 +54,13 @@ static s32 boo_should_be_stopped(void) {
static s32 boo_should_be_active(void) {
f32 activationRadius;
- if (obj_has_behavior(bhvBalconyBigBoo)) {
+ if (cur_obj_has_behavior(bhvBalconyBigBoo)) {
activationRadius = 5000.0f;
} else {
activationRadius = 1500.0f;
}
- if (obj_has_behavior(bhvMerryGoRoundBigBoo) || obj_has_behavior(bhvMerryGoRoundBoo)) {
+ if (cur_obj_has_behavior(bhvMerryGoRoundBigBoo) || cur_obj_has_behavior(bhvMerryGoRoundBoo)) {
if (gMarioOnMerryGoRound == TRUE) {
return TRUE;
} else {
@@ -87,7 +87,7 @@ void bhv_courtyard_boo_triplet_init(void) {
struct Object *boo;
if (gHudDisplay.stars < 12) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
for (i = 0; i < 3; i++) {
boo = spawn_object_relative(
@@ -125,7 +125,7 @@ static void boo_approach_target_opacity_and_update_scale(void) {
}
scale = (o->oOpacity/255.0f * 0.4 + 0.6) * o->oBooBaseScale;
- scale_object(o, scale); // why no obj_scale? was obj_scale written later?
+ obj_scale(o, scale); // why no cur_obj_scale? was cur_obj_scale written later?
}
static void boo_oscillate(s32 ignoreOpacity) {
@@ -156,7 +156,7 @@ static s32 boo_vanish_or_appear(void) {
) {
if (o->oOpacity == 40) {
o->oBooTargetOpacity = 255;
- PlaySound2(SOUND_OBJ_BOO_LAUGH_LONG);
+ cur_obj_play_sound_2(SOUND_OBJ_BOO_LAUGH_LONG);
}
if (o->oOpacity > 180) {
@@ -170,7 +170,7 @@ static s32 boo_vanish_or_appear(void) {
}
static void boo_set_move_yaw_for_during_hit(s32 hurt) {
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oFlags &= ~OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW;
o->oBooMoveYawBeforeHit = (f32) o->oMoveAngleYaw;
@@ -225,7 +225,7 @@ static s32 boo_update_after_bounced_on(f32 a0) {
if (o->oTimer < 32) {
boo_move_during_hit(FALSE, D_8032F0CC[o->oTimer]/5000.0f * a0);
} else {
- obj_become_tangible();
+ cur_obj_become_tangible();
boo_reset_after_hit();
o->oAction = 1;
return TRUE;
@@ -247,7 +247,7 @@ static s32 big_boo_update_during_nonlethal_hit(f32 a0) {
} else if (o->oTimer < 48) {
big_boo_shake_after_hit();
} else {
- obj_become_tangible();
+ cur_obj_become_tangible();
boo_reset_after_hit();
o->oAction = 1;
@@ -274,14 +274,14 @@ static s32 boo_update_during_death(void) {
}
if (o->oTimer > 30 || o->oMoveFlags & 0x200) {
- func_802A3004();
+ spawn_mist_particles();
o->oBooDeathStatus = BOO_DEATH_STATUS_DEAD;
if (o->oBooParentBigBoo != NULL) {
parentBigBoo = o->oBooParentBigBoo;
#ifndef VERSION_JP
- if (!obj_has_behavior(bhvBoo)) {
+ if (!cur_obj_has_behavior(bhvBoo)) {
parentBigBoo->oBigBooNumMinionBoosKilled++;
}
#else
@@ -313,15 +313,15 @@ static s32 boo_get_attack_status(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
if ((o->oInteractStatus & INT_STATUS_WAS_ATTACKED) && obj_has_attack_type(ATTACK_FROM_ABOVE) == FALSE) {
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oInteractStatus = 0;
- PlaySound2(SOUND_OBJ_BOO_LAUGH_SHORT);
+ cur_obj_play_sound_2(SOUND_OBJ_BOO_LAUGH_SHORT);
attackStatus = BOO_ATTACKED;
} else {
- PlaySound2(SOUND_OBJ_BOO_BOUNCE_TOP);
+ cur_obj_play_sound_2(SOUND_OBJ_BOO_BOUNCE_TOP);
o->oInteractStatus = 0;
@@ -340,23 +340,23 @@ static void boo_chase_mario(f32 a0, s16 a1, f32 a2) {
if (boo_vanish_or_appear()) {
o->oInteractType = 0x8000;
- if (obj_lateral_dist_from_mario_to_home() > 1500.0f) {
- sp1A = obj_angle_to_home();
+ if (cur_obj_lateral_dist_from_mario_to_home() > 1500.0f) {
+ sp1A = cur_obj_angle_to_home();
} else {
sp1A = o->oAngleToMario;
}
- obj_rotate_yaw_toward(sp1A, a1);
+ cur_obj_rotate_yaw_toward(sp1A, a1);
o->oVelY = 0.0f;
if (mario_is_in_air_action() == 0) {
sp1C = o->oPosY - gMarioObject->oPosY;
if (a0 < sp1C && sp1C < 500.0f) {
- o->oVelY = func_802A0BF4(o->oPosY, gMarioObject->oPosY + 50.0f, 10.f, 2.0f);
+ o->oVelY = increment_velocity_toward_range(o->oPosY, gMarioObject->oPosY + 50.0f, 10.f, 2.0f);
}
}
- func_8029F684(10.0f - o->oBooNegatedAggressiveness, a2);
+ cur_obj_set_vel_from_mario_vel(10.0f - o->oBooNegatedAggressiveness, a2);
if (o->oForwardVel != 0.0f) {
boo_oscillate(FALSE);
@@ -370,18 +370,18 @@ static void boo_chase_mario(f32 a0, s16 a1, f32 a2) {
}
}
-static void ActionBoo0(void) {
+static void boo_act_0(void) {
o->activeFlags |= ACTIVE_FLAG_MOVE_THROUGH_GRATE;
if (o->oBehParams2ndByte == 2) {
o->oRoom = 10;
}
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oMoveAngleYaw = o->oBooInitialMoveYaw;
boo_stop();
- o->oBooParentBigBoo = obj_nearest_object_with_behavior(bhvGhostHuntBigBoo);
+ o->oBooParentBigBoo = cur_obj_nearest_object_with_behavior(bhvGhostHuntBigBoo);
o->oBooBaseScale = 1.0f;
o->oBooTargetOpacity = 0xFF;
@@ -396,7 +396,7 @@ static void ActionBoo0(void) {
}
}
-static void ActionBoo5(void) {
+static void boo_act_5(void) {
if (o->oTimer < 30) {
o->oVelY = 0.0f;
o->oForwardVel = 13.0f;
@@ -408,7 +408,7 @@ static void ActionBoo5(void) {
}
}
-static void ActionBoo1(void) {
+static void boo_act_1(void) {
s32 attackStatus;
if (o->oTimer == 0) {
@@ -436,37 +436,37 @@ static void ActionBoo1(void) {
}
}
-static void ActionBoo2(void) {
+static void boo_act_2(void) {
if (boo_update_after_bounced_on(20.0f)) {
o->oAction = 1;
}
}
-static void ActionBoo3(void) {
+static void boo_act_3(void) {
if (boo_update_during_death()) {
if (o->oBehParams2ndByte != 0) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->oAction = 4;
- obj_disable();
+ cur_obj_disable();
}
}
}
// Called when a Go on a Ghost Hunt boo dies
-static void ActionBoo4(void) {
+static void boo_act_4(void) {
s32 dialogID;
// If there are no remaining "minion" boos, show the dialog of the Big Boo
- if (obj_nearest_object_with_behavior(bhvGhostHuntBoo) == NULL) {
+ if (cur_obj_nearest_object_with_behavior(bhvGhostHuntBoo) == NULL) {
dialogID = DIALOG_108;
} else {
dialogID = DIALOG_107;
}
- if (obj_update_dialog(2, 2, dialogID, 0)) {
+ if (cur_obj_update_dialog(2, 2, dialogID, 0)) {
create_sound_spawner(SOUND_OBJ_DYING_ENEMY1);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (dialogID == DIALOG_108) { // If the Big Boo should spawn, play the jingle
play_puzzle_jingle();
@@ -475,23 +475,23 @@ static void ActionBoo4(void) {
}
static void (*sBooActions[])(void) = {
- ActionBoo0,
- ActionBoo1,
- ActionBoo2,
- ActionBoo3,
- ActionBoo4,
- ActionBoo5
+ boo_act_0,
+ boo_act_1,
+ boo_act_2,
+ boo_act_3,
+ boo_act_4,
+ boo_act_5
};
void bhv_boo_loop(void) {
//PARTIAL_UPDATE
- obj_update_floor_and_walls();
- obj_call_action_function(sBooActions);
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sBooActions);
+ cur_obj_move_standard(78);
boo_approach_target_opacity_and_update_scale();
- if (object_has_behavior(o->parentObj, bhvMerryGoRoundBooManager)) {
+ if (obj_has_behavior(o->parentObj, bhvMerryGoRoundBooManager)) {
if (o->activeFlags == 0) {
o->parentObj->oMerryGoRoundBooManagerNumBoosKilled++;
}
@@ -500,8 +500,8 @@ void bhv_boo_loop(void) {
o->oInteractStatus = 0;
}
-static void ActionBooGivingStar0(void) {
- if (obj_has_behavior(bhvBalconyBigBoo)) {
+static void big_boo_act_0(void) {
+ if (cur_obj_has_behavior(bhvBalconyBigBoo)) {
obj_set_secondary_camera_focus();
// number of killed boos set > 5 so that boo always loads
// redundant? this is also done in behavior_data.s
@@ -517,25 +517,25 @@ static void ActionBooGivingStar0(void) {
#endif
o->oAction = 1;
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oMoveAngleYaw = o->oBooInitialMoveYaw;
- obj_unhide();
+ cur_obj_unhide();
o->oBooTargetOpacity = 0xFF;
o->oBooBaseScale = 3.0f;
o->oHealth = 3;
- obj_scale(3.0f);
- obj_become_tangible();
+ cur_obj_scale(3.0f);
+ cur_obj_become_tangible();
} else {
- obj_hide();
- obj_become_intangible();
+ cur_obj_hide();
+ cur_obj_become_intangible();
boo_stop();
}
}
-static void ActionBooGivingStar1(void) {
+static void big_boo_act_1(void) {
s32 attackStatus;
s16 sp22;
f32 sp1C;
@@ -553,7 +553,7 @@ static void ActionBooGivingStar1(void) {
attackStatus = boo_get_attack_status();
// redundant; this check is in boo_should_be_stopped
- if (obj_has_behavior(bhvMerryGoRoundBigBoo)) {
+ if (cur_obj_has_behavior(bhvMerryGoRoundBigBoo)) {
if (gMarioOnMerryGoRound == FALSE) {
o->oAction = 0;
}
@@ -574,44 +574,44 @@ static void ActionBooGivingStar1(void) {
}
}
-static void ActionBooGivingStar2(void) {
+static void big_boo_act_2(void) {
if (boo_update_after_bounced_on(20.0f)) {
o->oAction = 1;
}
}
static void big_boo_spawn_ghost_hunt_star(void) {
- create_star(980.0f, 1100.0f, 250.0f);
+ spawn_default_star(980.0f, 1100.0f, 250.0f);
}
static void big_boo_spawn_balcony_star(void) {
- create_star(700.0f, 3200.0f, 1900.0f);
+ spawn_default_star(700.0f, 3200.0f, 1900.0f);
}
static void big_boo_spawn_merry_go_round_star(void) {
struct Object *merryGoRound;
- create_star(-1600.0f, -2100.0f, 205.0f);
+ spawn_default_star(-1600.0f, -2100.0f, 205.0f);
- merryGoRound = obj_nearest_object_with_behavior(bhvMerryGoRound);
+ merryGoRound = cur_obj_nearest_object_with_behavior(bhvMerryGoRound);
if (merryGoRound != NULL) {
merryGoRound->oMerryGoRoundStopped = TRUE;
}
}
-static void ActionBooGivingStar3(void) {
+static void big_boo_act_3(void) {
if (o->oTimer == 0) {
o->oHealth--;
}
if (o->oHealth == 0) {
if (boo_update_during_death()) {
- obj_disable();
+ cur_obj_disable();
o->oAction = 4;
- set_object_angle(o, 0, 0, 0);
+ obj_set_angle(o, 0, 0, 0);
if (o->oBehParams2ndByte == 0) {
big_boo_spawn_ghost_hunt_star();
@@ -623,7 +623,7 @@ static void ActionBooGivingStar3(void) {
}
} else {
if (o->oTimer == 0) {
- func_802A3004();
+ spawn_mist_particles();
o->oBooBaseScale -= 0.5;
}
@@ -633,65 +633,65 @@ static void ActionBooGivingStar3(void) {
}
}
-static void ActionBooGivingStar4(void) {
+static void big_boo_act_4(void) {
#ifndef VERSION_JP
boo_stop();
#endif
if (o->oBehParams2ndByte == 0) {
- set_object_pos(o, 973, 0, 626);
+ obj_set_pos(o, 973, 0, 626);
if (o->oTimer > 60 && o->oDistanceToMario < 600.0f) {
- set_object_pos(o, 973, 0, 717);
+ obj_set_pos(o, 973, 0, 717);
spawn_object_relative(0, 0, 0, 0, o, MODEL_BBH_STAIRCASE_STEP, bhvBooBossSpawnedBridge);
spawn_object_relative(1, 0, 0, -200, o, MODEL_BBH_STAIRCASE_STEP, bhvBooBossSpawnedBridge);
spawn_object_relative(2, 0, 0, 200, o, MODEL_BBH_STAIRCASE_STEP, bhvBooBossSpawnedBridge);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
} else {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
static void (*sBooGivingStarActions[])(void) = {
- ActionBooGivingStar0,
- ActionBooGivingStar1,
- ActionBooGivingStar2,
- ActionBooGivingStar3,
- ActionBooGivingStar4
+ big_boo_act_0,
+ big_boo_act_1,
+ big_boo_act_2,
+ big_boo_act_3,
+ big_boo_act_4
};
void bhv_big_boo_loop(void) {
//PARTIAL_UPDATE
- set_object_hitbox(o, &sBooGivingStarHitbox);
+ obj_set_hitbox(o, &sBooGivingStarHitbox);
o->oGraphYOffset = o->oBooBaseScale * 60.0f;
- obj_update_floor_and_walls();
- obj_call_action_function(sBooGivingStarActions);
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sBooGivingStarActions);
+ cur_obj_move_standard(78);
boo_approach_target_opacity_and_update_scale();
o->oInteractStatus = 0;
}
-static void ActionBooWithCage0(void) {
+static void boo_with_cage_act_0(void) {
o->oBooParentBigBoo = NULL;
o->oBooTargetOpacity = 0xFF;
o->oBooBaseScale = 2.0f;
- obj_scale(2.0f);
- obj_become_tangible();
+ cur_obj_scale(2.0f);
+ cur_obj_become_tangible();
if (boo_should_be_active()) {
o->oAction = 1;
}
}
-static void ActionBooWithCage1(void) {
+static void boo_with_cage_act_1(void) {
s32 attackStatus;
boo_chase_mario(100.0f, 512, 0.5f);
@@ -711,15 +711,15 @@ static void ActionBooWithCage1(void) {
}
}
-static void ActionBooWithCage2(void) {
+static void boo_with_cage_act_2(void) {
if (boo_update_after_bounced_on(20.0f)) {
o->oAction = 1;
}
}
-static void ActionBooWithCage3(void) {
+static void boo_with_cage_act_3(void) {
if (boo_update_during_death()) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
@@ -727,7 +727,7 @@ void bhv_boo_with_cage_init(void) {
struct Object* cage;
if (gHudDisplay.stars < 12) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage);
cage->oBehParams = o->oBehParams;
@@ -735,20 +735,20 @@ void bhv_boo_with_cage_init(void) {
}
static void (*sBooWithCageActions[])(void) = {
- ActionBooWithCage0,
- ActionBooWithCage1,
- ActionBooWithCage2,
- ActionBooWithCage3
+ boo_with_cage_act_0,
+ boo_with_cage_act_1,
+ boo_with_cage_act_2,
+ boo_with_cage_act_3
};
void bhv_boo_with_cage_loop(void)
{
//PARTIAL_UPDATE
- obj_update_floor_and_walls();
- obj_call_action_function(sBooWithCageActions);
- obj_move_standard(78);
-
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sBooWithCageActions);
+ cur_obj_move_standard(78);
+
boo_approach_target_opacity_and_update_scale();
o->oInteractStatus = 0;
}
@@ -770,7 +770,7 @@ void bhv_merry_go_round_boo_manager_loop(void) {
if (o->oMerryGoRoundBooManagerNumBoosKilled > 4) {
struct Object *boo = spawn_object(o, MODEL_BOO, bhvMerryGoRoundBigBoo);
- copy_object_behavior_params(boo, o);
+ obj_copy_behavior_params(boo, o);
o->oAction = 2;
@@ -799,7 +799,7 @@ void obj_set_secondary_camera_focus(void) {
}
void bhv_animated_texture_loop(void) {
- func_802A3470();
+ cur_obj_set_pos_to_home_with_debug();
}
void bhv_boo_in_castle_loop(void) {
@@ -808,38 +808,38 @@ void bhv_boo_in_castle_loop(void) {
o->oBooBaseScale = 2.0f;
if (o->oAction == 0) {
- obj_hide();
+ cur_obj_hide();
if (gHudDisplay.stars < 12) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
if (gMarioCurrentRoom == 1) {
o->oAction++;
}
} else if (o->oAction == 1) {
- obj_unhide();
+ cur_obj_unhide();
o->oOpacity = 180;
if (o->oTimer == 0) {
- obj_scale(o->oBooBaseScale);
+ cur_obj_scale(o->oBooBaseScale);
}
if (o->oDistanceToMario < 1000.0f) {
o->oAction++;
- PlaySound2(SOUND_OBJ_BOO_LAUGH_LONG);
+ cur_obj_play_sound_2(SOUND_OBJ_BOO_LAUGH_LONG);
}
o->oForwardVel = 0.0f;
targetAngle = o->oAngleToMario;
} else {
- obj_forward_vel_approach_upward(32.0f, 1.0f);
+ cur_obj_forward_vel_approach_upward(32.0f, 1.0f);
o->oHomeX = -1000.0f;
o->oHomeZ = -9000.0f;
- targetAngle = obj_angle_to_home();
+ targetAngle = cur_obj_angle_to_home();
if (o->oPosZ < -5000.0f) {
if (o->oOpacity > 0) {
@@ -856,11 +856,11 @@ void bhv_boo_in_castle_loop(void) {
o->oVelY = 0.0f;
- targetAngle = obj_angle_to_home();
+ targetAngle = cur_obj_angle_to_home();
- obj_rotate_yaw_toward(targetAngle, 0x5A8);
+ cur_obj_rotate_yaw_toward(targetAngle, 0x5A8);
boo_oscillate(TRUE);
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
void bhv_boo_boss_spawned_bridge_loop(void) {
@@ -885,7 +885,7 @@ void bhv_boo_boss_spawned_bridge_loop(void) {
// fallthrough
case 1:
o->oPosY += 8.0f;
- PlaySound(SOUND_ENV_ELEVATOR2);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR2);
if (o->oPosY > targetY) {
o->oPosY = targetY;
@@ -895,10 +895,10 @@ void bhv_boo_boss_spawned_bridge_loop(void) {
break;
case 2:
if (o->oTimer == 0) {
- PlaySound2(SOUND_GENERAL_UNKNOWN4_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN4_LOWPRIO);
}
- if (func_802A362C(o->oTimer)) {
+ if (cur_obj_move_up_and_down(o->oTimer)) {
o->oAction++;
}
diff --git a/src/game/behaviors/boo_cage.inc.c b/src/game/behaviors/boo_cage.inc.c
@@ -27,16 +27,16 @@ static struct ObjectHitbox sBooCageHitbox = {
void bhv_boo_cage_loop(void) {
UNUSED s32 unused;
- set_object_hitbox(o, &sBooCageHitbox);
+ obj_set_hitbox(o, &sBooCageHitbox);
switch (o->oAction) {
case BOO_CAGE_ACT_IN_BOO:
// Don't let Mario enter BBH until the boo is killed
- obj_become_intangible();
+ cur_obj_become_intangible();
// Useless scale. This is also found in the code for BOO_CAGE_ACT_ON_GROUND.
// Was the boo cage originally meant to have been shrunk and grow while falling?
- obj_scale(1.0f);
+ cur_obj_scale(1.0f);
// If the cage's parent boo is killed, set the action to BOO_CAGE_ACT_FALLING,
// give the cage an initial Y velocity of 60 units/frame, and play the puzzle jingle.
@@ -46,7 +46,7 @@ void bhv_boo_cage_loop(void) {
o->oVelY = 60.0f;
play_puzzle_jingle();
} else {
- copy_object_pos_and_angle(o, o->parentObj);
+ obj_copy_pos_and_angle(o, o->parentObj);
}
break;
@@ -57,15 +57,15 @@ void bhv_boo_cage_loop(void) {
o->oFaceAngleRoll = 0;
// Apply standard physics to the cage.
- obj_update_floor_and_walls();
- obj_move_standard(-78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(-78);
// Spawn sparkles while the cage falls.
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
// When the cage lands/bounces, play a landing/bouncing sound.
if (o->oMoveFlags & OBJ_MOVE_LANDED) {
- PlaySound2(SOUND_GENERAL_SOFT_LANDING);
+ cur_obj_play_sound_2(SOUND_GENERAL_SOFT_LANDING);
}
// Once the cage stops bouncing and settles on the ground,
@@ -80,13 +80,13 @@ void bhv_boo_cage_loop(void) {
break;
case BOO_CAGE_ACT_ON_GROUND:
// Allow Mario to enter the cage once it's still on the ground.
- obj_become_tangible();
+ cur_obj_become_tangible();
// The other useless scale
- obj_scale(1.0f);
+ cur_obj_scale(1.0f);
// Set the action to BOO_CAGE_ACT_MARIO_JUMPING_IN when Mario jumps in.
- if (are_objects_collided(o, gMarioObject)) {
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
o->oAction++;
}
diff --git a/src/game/behaviors/boulder.inc.c b/src/game/behaviors/boulder.inc.c
@@ -10,13 +10,13 @@ void bhv_big_boulder_init(void) {
o->oBuoyancy = 2.0f;
}
-void func_802F05DC(void) {
+void boulder_act_1(void) {
s16 sp1E;
sp1E = object_step_without_floor_orient();
if ((sp1E & 0x09) == 0x01 && o->oVelY > 10.0f) {
- PlaySound2(SOUND_GENERAL_GRINDEL_ROLL);
- func_802A3004();
+ cur_obj_play_sound_2(SOUND_GENERAL_GRINDEL_ROLL);
+ spawn_mist_particles();
}
if (o->oForwardVel > 70.0)
@@ -27,7 +27,7 @@ void func_802F05DC(void) {
}
void bhv_big_boulder_loop(void) {
- obj_scale(1.5f);
+ cur_obj_scale(1.5f);
o->oGraphYOffset = 270.0f;
switch (o->oAction) {
case 0:
@@ -36,13 +36,13 @@ void bhv_big_boulder_loop(void) {
break;
case 1:
- func_802F05DC();
- func_802EFB84(1.5f);
- PlaySound(SOUND_ENV_UNKNOWN2);
+ boulder_act_1();
+ adjust_rolling_face_pitch(1.5f);
+ cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
break;
}
- func_802EFB2C();
+ set_rolling_sphere_hitbox();
}
void bhv_big_boulder_generator_loop(void) {
diff --git a/src/game/behaviors/bouncing_fireball.inc.c b/src/game/behaviors/bouncing_fireball.inc.c
@@ -2,7 +2,7 @@
void bhv_bouncing_fireball_flame_loop(void) {
o->activeFlags |= 0x400;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case 0:
if (o->oTimer == 0) {
@@ -18,12 +18,12 @@ void bhv_bouncing_fireball_flame_loop(void) {
o->oForwardVel = 30.0f;
}
if (o->oMoveFlags & (0x40 | 0x10 | 0x2) && o->oTimer > 100)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
break;
}
if (o->oTimer > 300)
- mark_object_for_deletion(o);
- obj_move_standard(78);
+ obj_mark_for_deletion(o);
+ cur_obj_move_standard(78);
o->oInteractStatus = 0;
}
@@ -38,9 +38,9 @@ void bhv_bouncing_fireball_loop(void) {
case 1:
sp2C = spawn_object(o, MODEL_RED_FLAME, bhvBouncingFireballFlame);
sp28 = (10 - o->oTimer) * 0.5;
- scale_object_xyz(sp2C, sp28, sp28, sp28);
+ obj_scale_xyz(sp2C, sp28, sp28, sp28);
if (o->oTimer == 0)
- make_object_tangible(sp2C);
+ obj_become_tangible(sp2C);
if (o->oTimer > 10)
o->oAction++;
break;
diff --git a/src/game/behaviors/bowling_ball.inc.c b/src/game/behaviors/bowling_ball.inc.c
@@ -32,14 +32,14 @@ void bhv_bowling_ball_init(void) {
o->oBuoyancy = 2.0f;
}
-void func_802EDA14(void) {
- set_object_hitbox(o, &sBowlingBallHitbox);
+void bowling_ball_set_hitbox(void) {
+ obj_set_hitbox(o, &sBowlingBallHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED)
o->oInteractStatus = 0;
}
-void func_802EDA6C(void) {
+void bowling_ball_set_waypoints(void) {
switch (o->oBehParams2ndByte) {
case BBALL_BP_STYPE_BOB_UPPER:
o->oPathedWaypointsS16 = segmented_to_virtual(bob_seg7_metal_ball_path0);
@@ -67,11 +67,11 @@ void bhv_bowling_ball_roll_loop(void) {
s16 collisionFlags;
s32 sp18;
- func_802EDA6C();
+ bowling_ball_set_waypoints();
collisionFlags = object_step();
//! Uninitialzed parameter, but the parameter is unused in the called function
- sp18 = obj_follow_path(sp18);
+ sp18 = cur_obj_follow_path(sp18);
o->oBowlingBallTargetYaw = o->oPathedTargetYaw;
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oBowlingBallTargetYaw, 0x400);
@@ -79,28 +79,28 @@ void bhv_bowling_ball_roll_loop(void) {
o->oForwardVel = 70.0;
}
- func_802EDA14();
+ bowling_ball_set_hitbox();
if (sp18 == -1) {
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 7000)) {
- func_802A3004();
- func_802AA618(0, 0, 92.0f);
+ spawn_mist_particles();
+ spawn_mist_particles_variable(0, 0, 92.0f);
}
o->activeFlags = 0;
}
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && (o->oVelY > 5.0f))
- PlaySound2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
}
void bhv_bowling_ball_initializeLoop(void) {
s32 sp1c;
- func_802EDA6C();
+ bowling_ball_set_waypoints();
//! Uninitialzed parameter, but the parameter is unused in the called function
- sp1c = obj_follow_path(sp1c);
+ sp1c = cur_obj_follow_path(sp1c);
o->oMoveAngleYaw = o->oPathedTargetYaw;
@@ -123,7 +123,7 @@ void bhv_bowling_ball_initializeLoop(void) {
case BBALL_BP_STYPE_THI_SMALL:
o->oForwardVel = 10.0f;
- obj_scale(0.3f);
+ cur_obj_scale(0.3f);
o->oGraphYOffset = 39.0f;
break;
}
@@ -221,9 +221,9 @@ void bhv_bob_pit_bowling_ball_loop(void) {
if ((sp1c->normalX == 0) && (sp1c->normalZ == 0))
o->oForwardVel = 28.0f;
- func_802EDA14();
+ bowling_ball_set_hitbox();
set_camera_shake_from_point(SHAKE_POS_BOWLING_BALL, o->oPosX, o->oPosY, o->oPosZ);
- PlaySound(SOUND_ENV_UNKNOWN2);
+ cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
set_object_visibility(o, 3000);
}
@@ -240,19 +240,19 @@ void bhv_free_bowling_ball_init(void) {
void bhv_free_bowling_ball_roll_loop(void) {
s16 collisionFlags = object_step();
- func_802EDA14();
+ bowling_ball_set_hitbox();
if (o->oForwardVel > 10.0f) {
set_camera_shake_from_point(SHAKE_POS_BOWLING_BALL, o->oPosX, o->oPosY, o->oPosZ);
- PlaySound(SOUND_ENV_UNKNOWN2);
+ cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
}
if ((collisionFlags & OBJ_COL_FLAG_GROUNDED) && !(collisionFlags & OBJ_COL_FLAGS_LANDED))
- PlaySound2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1_LOWPRIO);
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000)) {
o->header.gfx.node.flags |= 0x10; /* bit 4 */
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oPosX = o->oHomeX;
o->oPosY = o->oHomeY;
@@ -270,7 +270,7 @@ void bhv_free_bowling_ball_loop(void) {
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 3000)) {
o->oAction = FREE_BBALL_ACT_ROLL;
o->header.gfx.node.flags &= ~0x10; /* bit 4 */
- obj_become_tangible();
+ cur_obj_become_tangible();
}
break;
diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c
@@ -1,33 +1,33 @@
// bowser.c.inc
-void ActionBowserTailAnchor0(void) {
+void bowser_tail_anchor_act_0(void) {
struct Object *bowser = o->parentObj;
- obj_become_tangible();
- obj_scale(1.0f);
+ cur_obj_become_tangible();
+ cur_obj_scale(1.0f);
if (bowser->oAction == 19)
bowser->oIntangibleTimer = -1;
- else if (are_objects_collided(o, gMarioObject)) {
+ else if (obj_check_if_collided_with_object(o, gMarioObject)) {
bowser->oIntangibleTimer = 0;
o->oAction = 2;
} else
bowser->oIntangibleTimer = -1;
}
-void ActionBowserTailAnchor1(void) {
+void bowser_tail_anchor_act_1(void) {
if (o->oTimer > 30)
o->oAction = 0;
}
-void ActionBowserTailAnchor2(void) {
+void bowser_tail_anchor_act_2(void) {
if (o->parentObj->oAction == 19) {
o->parentObj->oIntangibleTimer = -1;
o->oAction = 0;
}
- obj_become_intangible();
+ cur_obj_become_intangible();
}
-void (*sBowserTailAnchorActions[])(void) = { ActionBowserTailAnchor0, ActionBowserTailAnchor1,
- ActionBowserTailAnchor2 };
+void (*sBowserTailAnchorActions[])(void) = { bowser_tail_anchor_act_0, bowser_tail_anchor_act_1,
+ bowser_tail_anchor_act_2 };
s8 D_8032F4FC[] = { 7, 8, 9, 12, 13, 14, 15, 4, 3, 16, 17, 19, 3, 3, 3, 3 };
s16 D_8032F50C[] = { 60, 0 };
s16 D_8032F510[] = { 50, 0 };
@@ -38,7 +38,7 @@ s16 D_8032F520[][3] = { { 1, 10, 40 }, { 0, 0, 74 }, { -1, -10, 114 }, { 1
{ -1, 80, 184 }, { 1, 160, 186 }, { -1, -160, 186 }, { 1, 0, 0 }, };
void bhv_bowser_tail_anchor_loop(void) {
- obj_call_action_function(sBowserTailAnchorActions);
+ cur_obj_call_action_function(sBowserTailAnchorActions);
o->oParentRelativePosX = 90.0f;
if (o->parentObj->oAction == 4)
o->parentObj->oIntangibleTimer = -1;
@@ -58,7 +58,7 @@ void bhv_bowser_flame_spawn_loop(void) {
if (bowser->header.gfx.unk38.curAnim->unk08 == sp30)
sp30 = 0;
if (sp30 > 45 && sp30 < 85) {
- PlaySound(SOUND_AIR_BOWSER_SPIT_FIRE);
+ cur_obj_play_sound_1(SOUND_AIR_BOWSER_SPIT_FIRE);
sp2C = sp1C[5 * sp30];
sp28 = sp1C[5 * sp30 + 2];
o->oPosX = bowser->oPosX + (sp28 * sp20 + sp2C * sp24);
@@ -73,7 +73,7 @@ void bhv_bowser_flame_spawn_loop(void) {
}
void bhv_bowser_body_anchor_loop(void) {
- copy_object_pos_and_angle(o, o->parentObj);
+ obj_copy_pos_and_angle(o, o->parentObj);
if (o->parentObj->oAction == 4) {
#ifndef VERSION_JP
if (o->parentObj->oSubAction == 11)
@@ -86,16 +86,16 @@ void bhv_bowser_body_anchor_loop(void) {
} else {
o->oInteractType = 8;
if (o->parentObj->oOpacity < 100)
- obj_become_intangible();
+ cur_obj_become_intangible();
else
- obj_become_tangible();
+ cur_obj_become_tangible();
}
if (o->parentObj->oHeldState != HELD_FREE)
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oInteractStatus = 0;
}
-s32 func_802B38B4(void) {
+s32 bowser_spawn_shockwave(void) {
struct Object *wave;
if (o->oBehParams2ndByte == 2) {
wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave);
@@ -105,13 +105,13 @@ s32 func_802B38B4(void) {
return 0;
}
-void func_802B392C(s32 *a) {
+void bowser_bounce(s32 *a) {
if (o->oMoveFlags & 1) {
a[0]++;
if (a[0] < 4) {
- obj_start_cam_event(o, CAM_EVENT_BOWSER_THROW_BOUNCE);
- func_802AA618(0, 0, 60.0f);
- PlaySound2(SOUND_OBJ_BOWSER_WALK);
+ cur_obj_start_cam_event(o, CAM_EVENT_BOWSER_THROW_BOUNCE);
+ spawn_mist_particles_variable(0, 0, 60.0f);
+ cur_obj_play_sound_2(SOUND_OBJ_BOWSER_WALK);
}
}
}
@@ -120,36 +120,36 @@ void func_802B392C(s32 *a) {
#define BITFS (o->oBehParams2ndByte == 1)
#define BITS (o->oBehParams2ndByte == 2)
-s32 func_802B39B8(void) {
- set_obj_animation_and_sound_state(15);
- if (obj_check_anim_frame(21))
+s32 bowser_set_anim_look_up_and_walk(void) {
+ cur_obj_init_animation_with_sound(15);
+ if (cur_obj_check_anim_frame(21))
o->oForwardVel = 3.0f;
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
return 1;
else
return 0;
}
-s32 func_802B3A30(void) {
+s32 bowser_set_anim_slow_gait(void) {
o->oForwardVel = 3.0f;
- set_obj_animation_and_sound_state(13);
- if (func_8029F788())
+ cur_obj_init_animation_with_sound(13);
+ if (cur_obj_check_if_near_animation_end())
return 1;
else
return 0;
}
-s32 func_802B3A98(void) {
- set_obj_animation_and_sound_state(14);
- if (obj_check_anim_frame(20))
+s32 bowser_set_anim_look_down(void) {
+ cur_obj_init_animation_with_sound(14);
+ if (cur_obj_check_anim_frame(20))
o->oForwardVel = 0.0f;
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
return 1;
else
return 0;
}
-void func_802B3B0C(void) {
+void bowser_initialize_action(void) {
if (o->oBowserUnk88 == 0)
o->oAction = 5;
else if (o->oBowserUnk88 == 1)
@@ -160,28 +160,28 @@ void func_802B3B0C(void) {
o->oAction = 0;
}
-void ActionBowser5() // not much
+void bowser_act_text_wait() // not much
{
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(12);
- func_802B3B0C();
+ cur_obj_init_animation_with_sound(12);
+ bowser_initialize_action();
}
-void ActionBowser6(void) {
+void bowser_act_intro_walk(void) {
if (o->oSubAction == 0) {
- if (func_802B39B8())
+ if (bowser_set_anim_look_up_and_walk())
o->oSubAction++;
} else if (o->oSubAction == 1) {
- if (func_802B3A30())
+ if (bowser_set_anim_slow_gait())
o->oSubAction++;
- } else if (func_802B3A98()) {
+ } else if (bowser_set_anim_look_down()) {
if (o->oBowserUnk88 == 1)
o->oBowserUnk88 = 0;
- func_802B3B0C();
+ bowser_initialize_action();
}
}
-static void Unknown802B3CCC(void) // unused
+static void bowser_debug_actions(void) // unused
{
if (gDebugInfo[5][1] != 0) {
o->oAction = D_8032F4FC[gDebugInfo[5][2] & 0xf];
@@ -189,7 +189,7 @@ static void Unknown802B3CCC(void) // unused
}
}
-void func_802B3D24(void) {
+void bowser_bitdw_act_controller(void) {
f32 rand = RandomFloat();
if (o->oBowserUnk110 == 0) {
if (o->oBowserUnkF4 & 2) {
@@ -220,7 +220,7 @@ void func_802B3D24(void) {
}
}
-void func_802B3E44(void) {
+void bowser_bitfs_act_controller(void) {
f32 rand = RandomFloat();
if (o->oBowserUnk110 == 0) {
if (o->oBowserUnkF4 & 2) {
@@ -246,7 +246,7 @@ void func_802B3E44(void) {
}
}
-void func_802B3FDC(void) {
+void bowser_general_bits_act_controller(void) {
f32 rand = RandomFloat();
if (o->oBowserUnkF4 & 2) {
if (o->oDistanceToMario < 1000.0f) {
@@ -264,17 +264,17 @@ void func_802B3FDC(void) {
o->oAction = 14;
}
-void func_802B4124(void) {
+void bowser_set_act_jump(void) {
o->oAction = 13;
}
-void func_802B4144(void) {
+void bowser_bits_act_controller(void) {
switch (o->oBowserUnk110) {
case 0:
if (o->oBowserUnk106 == 0)
- func_802B3FDC();
+ bowser_general_bits_act_controller();
else
- func_802B4124();
+ bowser_set_act_jump();
o->oBowserUnk110 = 1;
break;
case 1:
@@ -285,7 +285,7 @@ void func_802B4144(void) {
}
#ifndef VERSION_JP
-void func_u_802B4AF4(void) {
+void bowser_reset_fallen_off_stage(void) {
if (o->oVelY < 0 && o->oPosY < (o->oHomeY - 300.0f)) {
o->oPosX = o->oPosZ = 0;
o->oPosY = o->oHomeY + 2000.0f;
@@ -295,38 +295,38 @@ void func_u_802B4AF4(void) {
}
#endif
-void ActionBowser18() // unused?
+void bowser_act_unused_slow_walk() // unused?
{
- if (func_802A4AB0(12))
+ if (cur_obj_init_animation_and_check_if_near_end(12))
o->oAction = 0;
}
-void ActionBowser0() // only lasts one frame
+void bowser_act_default() // only lasts one frame
{
o->oBowserEyesShut = 0;
- set_obj_animation_and_sound_state(12);
+ cur_obj_init_animation_with_sound(12);
// stop him still
o->oAngleVelYaw = 0;
o->oForwardVel = 0.0f;
o->oVelY = 0.0f;
if (BITDW)
- func_802B3D24();
+ bowser_bitdw_act_controller();
else if (BITFS)
- func_802B3E44();
+ bowser_bitfs_act_controller();
else
- func_802B4144();
+ bowser_bits_act_controller();
// Action 14 commonly follows
}
-void ActionBowser15(void) {
+void bowser_act_breath_fire(void) {
o->oForwardVel = 0.0f;
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_BOWSER_INHALING);
- if (func_802A4AB0(6))
+ cur_obj_play_sound_2(SOUND_OBJ_BOWSER_INHALING);
+ if (cur_obj_init_animation_and_check_if_near_end(6))
o->oAction = 0;
}
-void ActionBowser14() // turn towards Mario
+void bowser_act_walk_to_mario() // turn towards Mario
{
UNUSED s32 facing; // is Bowser facing Mario?
s16 turnSpeed;
@@ -339,13 +339,13 @@ void ActionBowser14() // turn towards Mario
turnSpeed = 0x300;
else
turnSpeed = 0x200;
- facing = obj_rotate_yaw_toward(o->oAngleToMario, turnSpeed);
+ facing = cur_obj_rotate_yaw_toward(o->oAngleToMario, turnSpeed);
if (o->oSubAction == 0) {
o->oBowserUnkF8 = 0;
- if (func_802B39B8())
+ if (bowser_set_anim_look_up_and_walk())
o->oSubAction++;
} else if (o->oSubAction == 1) {
- if (func_802B3A30()) {
+ if (bowser_set_anim_slow_gait()) {
o->oBowserUnkF8++;
if (o->oBowserUnkF4 & 0x20000) {
if (o->oBowserUnkF8 > 4)
@@ -353,18 +353,18 @@ void ActionBowser14() // turn towards Mario
} else if (angleFromMario < 0x2000)
o->oSubAction++;
}
- } else if (func_802B3A98())
+ } else if (bowser_set_anim_look_down())
o->oAction = 0;
}
-void ActionBowser16(void) {
+void bowser_act_teleport(void) {
switch (o->oSubAction) {
case 0:
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oBowserUnk1AC = 0;
o->oBowserUnkF8 = 30;
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ2_BOWSER_TELEPORT);
+ cur_obj_play_sound_2(SOUND_OBJ2_BOWSER_TELEPORT);
if (o->oOpacity == 0) {
o->oSubAction++;
o->oMoveAngleYaw = o->oAngleToMario;
@@ -381,7 +381,7 @@ void ActionBowser16(void) {
if (o->oDistanceToMario > 500.0f) {
o->oSubAction = 2;
o->oMoveAngleYaw = o->oAngleToMario; // large change in angle?
- PlaySound2(SOUND_OBJ2_BOWSER_TELEPORT);
+ cur_obj_play_sound_2(SOUND_OBJ2_BOWSER_TELEPORT);
}
break;
case 2:
@@ -389,29 +389,29 @@ void ActionBowser16(void) {
o->oBowserUnk1AC = 0xFF;
if (o->oOpacity == 0xFF)
o->oAction = 0;
- obj_become_tangible();
+ cur_obj_become_tangible();
break;
}
}
-void ActionBowser8(void) // only in sky
+void bowser_act_spit_fire_into_sky(void) // only in sky
{
s32 frame;
- set_obj_animation_and_sound_state(11);
+ cur_obj_init_animation_with_sound(11);
frame = o->header.gfx.unk38.animFrame;
if (frame > 24 && frame < 36) {
- PlaySound(SOUND_AIR_BOWSER_SPIT_FIRE);
+ cur_obj_play_sound_1(SOUND_AIR_BOWSER_SPIT_FIRE);
if (frame == 35)
spawn_object_relative(1, 0, 0x190, 0x64, o, MODEL_RED_FLAME, bhvBlueBowserFlame);
else
spawn_object_relative(0, 0, 0x190, 0x64, o, MODEL_RED_FLAME, bhvBlueBowserFlame);
}
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oAction = 0;
o->oBowserUnkF4 |= 0x20000;
}
-void ActionBowser12(void) {
+void bowser_act_hit_mine(void) {
if (o->oTimer == 0) {
o->oForwardVel = -400.0f;
o->oVelY = 100.0f;
@@ -419,21 +419,21 @@ void ActionBowser12(void) {
o->oBowserEyesShut = 1;
}
if (o->oSubAction == 0) {
- set_obj_animation_and_sound_state(25);
+ cur_obj_init_animation_with_sound(25);
o->oSubAction++;
o->oBowserUnkF8 = 0;
} else if (o->oSubAction == 1) {
- set_obj_animation_and_sound_state(25);
- func_8029F728();
- func_802B392C(&o->oBowserUnkF8);
+ cur_obj_init_animation_with_sound(25);
+ cur_obj_extend_animation_if_at_end();
+ bowser_bounce(&o->oBowserUnkF8);
if ((o->oBowserUnkF8 > 2)) {
- set_obj_animation_and_sound_state(26);
+ cur_obj_init_animation_with_sound(26);
o->oVelY = 0.0f;
o->oForwardVel = 0.0f;
o->oSubAction++;
}
} else if (o->oSubAction == 2) {
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
if (o->oHealth == 1)
o->oAction = 3;
else
@@ -444,22 +444,22 @@ void ActionBowser12(void) {
}
}
-s32 func_802B4A44(void) {
- set_obj_animation_and_sound_state(9);
- if (obj_check_anim_frame(11))
+s32 bowser_set_anim_in_air(void) {
+ cur_obj_init_animation_with_sound(9);
+ if (cur_obj_check_anim_frame(11))
return 1;
else
return 0;
}
-s32 func_802B4A94(void) {
+s32 bowser_land(void) {
if (o->oMoveFlags & 1) {
o->oForwardVel = 0;
o->oVelY = 0;
- func_802AA618(0, 0, 60.0f);
- set_obj_animation_and_sound_state(8);
+ spawn_mist_particles_variable(0, 0, 60.0f);
+ cur_obj_init_animation_with_sound(8);
o->header.gfx.unk38.animFrame = 0;
- obj_start_cam_event(o, CAM_EVENT_BOWSER_JUMP);
+ cur_obj_start_cam_event(o, CAM_EVENT_BOWSER_JUMP);
if (BITDW) {
if (o->oDistanceToMario < 850.0f)
gMarioObject->oInteractStatus |= INTERACT_GRABBABLE;
@@ -471,112 +471,102 @@ s32 func_802B4A94(void) {
return 0;
}
-void func_802B4BA4(void) {
+void bowser_short_second_hop(void) {
if (BITS && o->oBowserUnkF4 & 0x10000)
if (o->oBowserDistToCentre > 1000.0f)
o->oForwardVel = 60.0f;
}
-void ActionBowser13(void) {
+void bowser_act_jump(void) {
UNUSED s32 unused;
if (o->oSubAction == 0) {
- if (func_802B4A44()) {
+ if (bowser_set_anim_in_air()) {
if (BITS && o->oBowserUnkF4 & 0x10000)
o->oVelY = 70.0f;
else
o->oVelY = 80.0f;
o->oBowserUnkF8 = 0;
- func_802B4BA4();
+ bowser_short_second_hop();
o->oSubAction++;
}
} else if (o->oSubAction == 1) {
#ifndef VERSION_JP
if (o->oBehParams2ndByte == 2 && o->oBowserUnkF4 & 0x10000)
- func_u_802B4AF4();
- if (func_802B4A94()) {
- o->oBowserUnkF4 &= 0xfffeffff;
- o->oForwardVel = 0.0f;
- o->oSubAction++;
- func_802B38B4();
- if (BITFS)
- o->oAction = 19;
- } else {
- }
-#else
- if (func_802B4A94()) {
- o->oBowserUnkF4 &= 0xfffeffff;
+ bowser_reset_fallen_off_stage();
+#endif
+ if (bowser_land()) {
+ o->oBowserUnkF4 &= ~0x10000;
o->oForwardVel = 0.0f;
o->oSubAction++;
- func_802B38B4();
+ bowser_spawn_shockwave();
if (BITFS)
o->oAction = 19;
} else {
}
-#endif
- } else if (func_8029F788())
+ } else if (cur_obj_check_if_near_animation_end())
o->oAction = 0;
}
-void ActionBowser17(void) {
+void bowser_act_jump_towards_mario(void) {
f32 sp1C = D_8032F50C[0];
f32 sp18 = D_8032F510[0];
if (o->oSubAction == 0) {
- if (func_802B4A44()) {
+ if (bowser_set_anim_in_air()) {
o->oVelY = sp1C;
o->oForwardVel = sp18;
o->oBowserUnkF8 = 0;
o->oSubAction++;
}
} else if (o->oSubAction == 1) {
- if (func_802B4A94())
+ if (bowser_land())
o->oSubAction++;
- } else if (func_8029F788())
+ } else if (cur_obj_check_if_near_animation_end())
o->oAction = 0;
}
-void ActionBowser10(void) {
+void bowser_act_hit_edge(void) {
o->oForwardVel = 0.0f;
if (o->oTimer == 0)
o->oBowserUnkF8 = 0;
switch (o->oSubAction) {
case 0:
- set_obj_animation_and_sound_state(23);
- if (func_8029F788())
+ cur_obj_init_animation_with_sound(23);
+ if (cur_obj_check_if_near_animation_end())
o->oBowserUnkF8++;
if (o->oBowserUnkF8 > 0)
o->oSubAction++;
break;
case 1:
- set_obj_animation_and_sound_state(24);
- if (func_8029F788())
+ cur_obj_init_animation_with_sound(24);
+ if (cur_obj_check_if_near_animation_end())
o->oAction = 11;
break;
}
}
-void ActionBowser9(void) {
+void bowser_act_spit_fire_onto_floor(void) {
if (gHudDisplay.wedges < 4)
o->oBowserUnk108 = 3;
else
o->oBowserUnk108 = RandomFloat() * 3.0f + 1.0f;
- set_obj_animation_and_sound_state(22);
- if (obj_check_anim_frame(5))
+ cur_obj_init_animation_with_sound(22);
+ if (cur_obj_check_anim_frame(5))
obj_spit_fire(0, 200, 180, 7.0f, MODEL_RED_FLAME, 30.0f, 10.0f, 0x1000);
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oSubAction++;
if (o->oSubAction >= o->oBowserUnk108)
o->oAction = 0;
}
-s32 func_802B5108(s32 a0, s16 a1) {
+s32 bowser_turn_on_timer(s32 a0, s16 a1) {
if (o->oSubAction == 0) {
- if (func_802A4AB0(15))
+ if (cur_obj_init_animation_and_check_if_near_end(15))
o->oSubAction++;
} else if (o->oSubAction == 1) {
- if (func_802A4AB0(14))
+ if (cur_obj_init_animation_and_check_if_near_end(14))
o->oSubAction++;
} else
- set_obj_animation_and_sound_state(12);
+ cur_obj_init_animation_with_sound(12);
o->oForwardVel = 0.0f;
o->oMoveAngleYaw += a1;
if (o->oTimer >= a0)
@@ -585,24 +575,24 @@ s32 func_802B5108(s32 a0, s16 a1) {
return 0;
}
-void ActionBowser11(void) {
- if (func_802B5108(63, 0x200))
+void bowser_act_turn_from_edge(void) {
+ if (bowser_turn_on_timer(63, 0x200))
o->oAction = 0;
}
-void ActionBowser7(void) {
+void bowser_act_charge_mario(void) {
s32 sp34;
if (o->oTimer == 0)
o->oForwardVel = 0.0f;
switch (o->oSubAction) {
case 0:
o->oBowserUnkF8 = 0;
- if (func_802A4AB0(18))
+ if (cur_obj_init_animation_and_check_if_near_end(18))
o->oSubAction = 1;
break;
case 1:
o->oForwardVel = 50.0f;
- if (func_802A4AB0(0x13) != 0) {
+ if (cur_obj_init_animation_and_check_if_near_end(0x13) != 0) {
o->oBowserUnkF8++;
if (o->oBowserUnkF8 >= 6)
o->oSubAction = 3;
@@ -610,22 +600,22 @@ void ActionBowser7(void) {
if (abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) > 0x2000)
o->oSubAction = 3;
}
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
break;
case 3:
o->oBowserUnkF8 = 0;
- set_obj_animation_and_sound_state(21);
+ cur_obj_init_animation_with_sound(21);
spawn_object_relative_with_scale(0, 100, -50, 0, 3.0f, o, MODEL_SMOKE, bhvWhitePuffSmoke2);
spawn_object_relative_with_scale(0, -100, -50, 0, 3.0f, o, MODEL_SMOKE,
bhvWhitePuffSmoke2);
if (approach_f32_signed(&o->oForwardVel, 0, -1.0f))
o->oSubAction = 2;
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
break;
case 2:
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(20);
- if (func_8029F788()) {
+ cur_obj_init_animation_with_sound(20);
+ if (cur_obj_check_if_near_animation_end()) {
if (BITS)
sp34 = 10;
else
@@ -634,17 +624,17 @@ void ActionBowser7(void) {
o->oAction = 0;
o->oBowserUnkF8++;
}
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
break;
}
if (o->oMoveFlags & 0x400)
o->oAction = 10;
}
-s32 func_802B5588(void) {
+s32 bowser_check_hit_mine(void) {
struct Object *mine;
f32 sp18;
- mine = obj_find_nearest_object_with_behavior(bhvBowserBomb, &sp18);
+ mine = cur_obj_find_nearest_object_with_behavior(bhvBowserBomb, &sp18);
if (mine != NULL && sp18 < 800.0f) {
mine->oInteractStatus |= INTERACT_MR_BLIZZARD;
return 1;
@@ -652,21 +642,21 @@ s32 func_802B5588(void) {
return 0;
}
-void ActionBowser1(void) // unused?
+void bowser_act_thrown_dropped(void)
{
UNUSED s32 unused;
if (o->oTimer < 2)
o->oBowserUnkF8 = 0;
if (o->oSubAction == 0) {
- set_obj_animation_and_sound_state(2);
- func_802B392C(&o->oBowserUnkF8);
+ cur_obj_init_animation_with_sound(2);
+ bowser_bounce(&o->oBowserUnkF8);
if (o->oMoveFlags & 2) {
o->oForwardVel = 0.0f;
o->oSubAction++;
}
- } else if (func_802A4AB0(0))
+ } else if (cur_obj_init_animation_and_check_if_near_end(0))
o->oAction = 0;
- if (func_802B5588()) {
+ if (bowser_check_hit_mine()) {
o->oHealth--;
if (o->oHealth <= 0)
o->oAction = 4;
@@ -675,7 +665,7 @@ void ActionBowser1(void) // unused?
}
}
-void func_802B5738(void) {
+void bowser_set_goal_invisible(void) {
o->oBowserUnk1AC = 0;
if (o->oOpacity == 0) {
o->oForwardVel = 0.0f;
@@ -684,11 +674,11 @@ void func_802B5738(void) {
}
}
-void ActionBowser2(void) {
+void bowser_act_jump_onto_stage(void) {
s32 sp2C;
UNUSED s32 unused;
- s8 *sp24 = (s8 *) o->oFloor;
- if (sp24 != NULL && sp24[4] & 1)
+ struct Surface *sp24 = o->oFloor;
+ if (sp24 != NULL && sp24->flags & 1)
sp2C = 1;
else
sp2C = 0;
@@ -703,18 +693,18 @@ void ActionBowser2(void) {
o->oFaceAngleRoll += 0x800;
if (!(o->oFaceAnglePitch & 0xFFFF))
o->oSubAction++;
- func_802B5738();
+ bowser_set_goal_invisible();
break;
case 1:
- set_obj_animation_and_sound_state(9);
- if (obj_check_anim_frame(11)) {
+ cur_obj_init_animation_with_sound(9);
+ if (cur_obj_check_anim_frame(11)) {
o->oMoveAngleYaw = o->oBowserAngleToCentre;
o->oVelY = 150.0f;
o->oBowserUnk1AC = 0xFF;
o->oBowserUnkF8 = 0;
o->oSubAction++;
} else
- func_802B5738();
+ bowser_set_goal_invisible();
break;
case 2:
if (o->oPosY > o->oHomeY) {
@@ -723,22 +713,22 @@ void ActionBowser2(void) {
if (absf(o->oFloorHeight - o->oHomeY) < 100.0f)
approach_f32_signed(&o->oForwardVel, 0, -5.0f);
else
- obj_forward_vel_approach_upward(150.0f, 2.0f);
+ cur_obj_forward_vel_approach_upward(150.0f, 2.0f);
} else
- obj_forward_vel_approach_upward(150.0f, 2.0f);
+ cur_obj_forward_vel_approach_upward(150.0f, 2.0f);
}
- if (func_802B4A94()) {
+ if (bowser_land()) {
o->oDragStrength = 10.0f;
o->oSubAction++;
if (sp2C == 0)
- func_802B38B4();
+ bowser_spawn_shockwave();
else if (BITS)
o->oAction = 13;
if (BITFS)
o->oAction = 19;
}
#ifndef VERSION_JP
- func_u_802B4AF4();
+ bowser_reset_fallen_off_stage();
#else
if (o->oVelY < 0.0f && o->oPosY < o->oHomeY - 300.0f) {
o->oPosZ = 0.0f, o->oPosX = o->oPosZ;
@@ -748,35 +738,35 @@ void ActionBowser2(void) {
#endif
break;
case 3:
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = 0;
o->oBowserUnkF4 &= ~0x10000;
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
}
break;
}
print_debug_bottom_up("sp %d", o->oForwardVel);
}
-void ActionBowser3(void) {
- if (item_in_array(o->oTimer, D_8032F514))
- PlaySound2(SOUND_OBJ_BOWSER_WALK);
- if (func_802A4AB0(10))
+void bowser_act_dance(void) {
+ if (is_item_in_array(o->oTimer, D_8032F514))
+ cur_obj_play_sound_2(SOUND_OBJ_BOWSER_WALK);
+ if (cur_obj_init_animation_and_check_if_near_end(10))
o->oAction = 0;
}
-void func_802B5C78(void) {
+void bowser_spawn_grand_star_key(void) {
if (BITS)
gSecondCameraFocus = spawn_object(o, MODEL_STAR, bhvGrandStar);
else {
gSecondCameraFocus = spawn_object(o, MODEL_BOWSER_KEY, bhvBowserKey);
- PlaySound2(SOUND_GENERAL2_BOWSER_KEY);
+ cur_obj_play_sound_2(SOUND_GENERAL2_BOWSER_KEY);
}
gSecondCameraFocus->oAngleVelYaw = o->oAngleVelYaw;
}
-void func_802B5D18(void) {
- set_obj_animation_and_sound_state(16);
+void bowser_fly_back_dead(void) {
+ cur_obj_init_animation_with_sound(16);
if (BITS)
o->oForwardVel = -400.0f;
else
@@ -787,29 +777,29 @@ void func_802B5D18(void) {
o->oSubAction++;
}
-void func_802B5DD8(void) {
+void bowser_dead_bounce(void) {
o->oBowserEyesShut = 1;
- func_802B392C(&o->oBowserUnkF8);
+ bowser_bounce(&o->oBowserUnkF8);
if (o->oMoveFlags & 1)
- PlaySound2(SOUND_OBJ_BOWSER_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BOWSER_WALK);
if (o->oMoveFlags & 2) {
o->oForwardVel = 0.0f;
o->oSubAction++;
}
}
-s32 func_802B5E7C(void) {
+s32 bowser_dead_wait_for_mario(void) {
s32 ret = 0;
- obj_become_intangible();
- if (func_802A4AB0(17) && o->oDistanceToMario < 700.0f
+ cur_obj_become_intangible();
+ if (cur_obj_init_animation_and_check_if_near_end(17) && o->oDistanceToMario < 700.0f
&& abs_angle_diff(gMarioObject->oMoveAngleYaw, o->oAngleToMario) > 0x6000)
ret = 1;
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
o->oBowserUnkF8 = 0;
return ret;
}
-s32 func_802B5F20(void) {
+s32 bowser_dead_twirl_into_trophy(void) {
s32 ret = 0;
if (o->header.gfx.scale[0] < 0.8)
o->oAngleVelYaw += 0x80;
@@ -829,37 +819,37 @@ s32 func_802B5F20(void) {
return ret;
}
-void func_802B60B8(void) {
- obj_scale(0);
+void bowser_dead_hide(void) {
+ cur_obj_scale(0);
o->oForwardVel = 0;
o->oVelY = 0;
o->oGravity = 0;
}
-s32 func_802B6120(void) {
+s32 bowser_dead_not_bits_end(void) {
s32 ret = 0;
if (o->oBowserUnkF8 < 2) {
if (o->oBowserUnkF8 == 0) {
func_8031FFB4(0, 60, 40);
o->oBowserUnkF8++;
}
- if (obj_update_dialog(2, 18, sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) {
+ if (cur_obj_update_dialog(2, 18, sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) {
o->oBowserUnkF8++;
- PlaySound2(SOUND_GENERAL2_BOWSER_EXPLODE);
+ cur_obj_play_sound_2(SOUND_GENERAL2_BOWSER_EXPLODE);
sequence_player_unlower(0, 60);
sequence_player_fade_out(0, 1);
}
- } else if (func_802B5F20()) {
- func_802B60B8();
+ } else if (bowser_dead_twirl_into_trophy()) {
+ bowser_dead_hide();
spawn_triangle_break_particles(20, 116, 1.0f, 0);
- func_802B5C78();
+ bowser_spawn_grand_star_key();
set_mario_npc_dialog(0);
ret = 1;
}
return ret;
}
-s32 func_802B6254(void) {
+s32 bowser_dead_bits_end(void) {
UNUSED s32 unused;
s32 ret = 0;
s32 dialogID;
@@ -872,32 +862,32 @@ s32 func_802B6254(void) {
func_8031FFB4(0, 60, 40);
o->oBowserUnkF8++;
}
- if (obj_update_dialog(2, 18, dialogID, 0)) {
- obj_set_model(MODEL_BOWSER2);
+ if (cur_obj_update_dialog(2, 18, dialogID, 0)) {
+ cur_obj_set_model(MODEL_BOWSER2);
sequence_player_unlower(0, 60);
sequence_player_fade_out(0, 1);
- func_802B5C78();
+ bowser_spawn_grand_star_key();
o->oBowserUnkF8++;
}
} else if (o->oOpacity > 4)
o->oOpacity -= 4;
else {
- func_802B60B8();
+ bowser_dead_hide();
ret = 1;
}
return ret;
}
-void ActionBowser4(void) {
+void bowser_act_dead(void) {
switch (o->oSubAction) {
case 0:
- func_802B5D18();
+ bowser_fly_back_dead();
break;
case 1:
- func_802B5DD8();
+ bowser_dead_bounce();
break;
case 2:
- if (func_802B5E7C()) {
+ if (bowser_dead_wait_for_mario()) {
o->oBowserUnkF8 = 0;
if (BITS)
o->oSubAction = 10;
@@ -908,13 +898,13 @@ void ActionBowser4(void) {
}
break;
case 3:
- if (func_802B6120())
+ if (bowser_dead_not_bits_end())
o->oSubAction++;
break;
case 4:
break;
case 10:
- if (func_802B6254())
+ if (bowser_dead_bits_end())
o->oSubAction++;
break;
case 11:
@@ -922,15 +912,15 @@ void ActionBowser4(void) {
}
}
-void func_802B64E8(struct Object *bowser, s16 a1) {
+void bowser_tilt_platform(struct Object *platform, s16 a1) {
s16 angle;
angle = o->oBowserAngleToCentre + 0x8000;
- bowser->oAngleVelPitch = coss(angle) * a1;
- bowser->oAngleVelRoll = -sins(angle) * a1;
+ platform->oAngleVelPitch = coss(angle) * a1;
+ platform->oAngleVelRoll = -sins(angle) * a1;
}
-void ActionBowser19(void) {
- struct Object *platform = obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform);
+void bowser_act_ride_tilting_platform(void) {
+ struct Object *platform = cur_obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform);
UNUSED s16 sp2A = o->oBowserAngleToCentre + 0x8000;
s16 sp28;
UNUSED s32 unused;
@@ -948,7 +938,7 @@ void ActionBowser19(void) {
sp28 = (D_8032F520[i][2] - o->oTimer - 1) * sp28;
else
sp28 = (o->oTimer - D_8032F520[i - 1][2]) * sp28;
- func_802B64E8(platform, sp28);
+ bowser_tilt_platform(platform, sp28);
if (sp28 != 0)
play_sound(SOUND_ENV_UNKNOWN4, platform->header.gfx.cameraToObject);
sp1C = 0;
@@ -964,10 +954,10 @@ void ActionBowser19(void) {
platform->oFaceAngleRoll = 0;
}
}
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
}
-s32 func_802B67C4(void) // bowser off stage?
+s32 bowser_check_fallen_off_stage(void) // bowser off stage?
{
if (o->oAction != 2 && o->oAction != 19) {
if (o->oPosY < o->oHomeY - 1000.0f)
@@ -982,11 +972,11 @@ s32 func_802B67C4(void) // bowser off stage?
return 0;
}
-void (*sBowserActions[])(void) = { ActionBowser0, ActionBowser1, ActionBowser2, ActionBowser3,
- ActionBowser4, ActionBowser5, ActionBowser6, ActionBowser7,
- ActionBowser8, ActionBowser9, ActionBowser10, ActionBowser11,
- ActionBowser12, ActionBowser13, ActionBowser14, ActionBowser15,
- ActionBowser16, ActionBowser17, ActionBowser18, ActionBowser19 };
+void (*sBowserActions[])(void) = { bowser_act_default, bowser_act_thrown_dropped, bowser_act_jump_onto_stage, bowser_act_dance,
+ bowser_act_dead, bowser_act_text_wait, bowser_act_intro_walk, bowser_act_charge_mario,
+ bowser_act_spit_fire_into_sky, bowser_act_spit_fire_onto_floor, bowser_act_hit_edge, bowser_act_turn_from_edge,
+ bowser_act_hit_mine, bowser_act_jump, bowser_act_walk_to_mario, bowser_act_breath_fire,
+ bowser_act_teleport, bowser_act_jump_towards_mario, bowser_act_unused_slow_walk, bowser_act_ride_tilting_platform };
struct SoundState D_8032F5B8[] = { { 0, 0, 0, NO_SOUND },
{ 0, 0, 0, NO_SOUND },
{ 0, 0, 0, NO_SOUND },
@@ -1038,17 +1028,17 @@ struct Struct8032F698 D_8032F698[] = { { NULL, 0, 0, 0, 0 },
{ bowser_3_seg7_collision_07004FB4, 800, -1000, -31744, 0 },
{ bowser_3_seg7_collision_07005038, -800, -1000, 31744, 0 } };
-void func_802B688C(void) {
+void bowser_free_update(void) {
struct Surface *floor;
struct Object *platform;
UNUSED f32 floorHeight;
if ((platform = o->platform) != NULL)
apply_platform_displacement(0, platform);
o->oBowserUnk10E = 0;
- obj_update_floor_and_walls();
- obj_call_action_function(sBowserActions);
- obj_move_standard(-78);
- if (func_802B67C4())
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sBowserActions);
+ cur_obj_move_standard(-78);
+ if (bowser_check_fallen_off_stage())
o->oAction = 2; // bowser go home?
floorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor);
if ((floor != NULL) && (floor->object != 0))
@@ -1058,18 +1048,18 @@ void func_802B688C(void) {
exec_anim_sound_state(D_8032F5B8);
}
-void func_802B697C(void) {
+void bowser_held_update(void) {
o->oBowserUnkF4 &= ~0x20000;
- obj_become_intangible();
+ cur_obj_become_intangible();
switch (o->oBowserUnk10E) {
case 0:
- PlaySound2(SOUND_OBJ_BOWSER_TAIL_PICKUP);
- func_8029FA5C(3, 1);
+ cur_obj_play_sound_2(SOUND_OBJ_BOWSER_TAIL_PICKUP);
+ cur_obj_unrender_and_reset_state(3, 1);
o->oBowserUnk10E++;
break;
case 1:
- if (func_8029F788()) {
- set_obj_animation_and_sound_state(2);
+ if (cur_obj_check_if_near_animation_end()) {
+ cur_obj_init_animation_with_sound(2);
o->oBowserUnk10E++;
}
break;
@@ -1082,10 +1072,10 @@ void func_802B697C(void) {
o->oMoveAngleYaw = gMarioObject->oMoveAngleYaw;
}
-void func_802B6AC0(void) {
+void bowser_thrown_dropped_update(void) {
f32 sp1C;
o->oBowserUnk10E = 0;
- obj_get_thrown_or_placed(1.0f, 1.0f, 1);
+ cur_obj_get_thrown_or_placed(1.0f, 1.0f, 1);
sp1C = o->oBowserHeldAngleVelYaw / 3000.0 * 70.0f;
if (sp1C < 0.0f)
sp1C = -sp1C;
@@ -1093,7 +1083,7 @@ void func_802B6AC0(void) {
sp1C *= 2.5; // > 90 => get bigger?
o->oForwardVel = coss(o->oBowserHeldAnglePitch) * sp1C;
o->oVelY = -sins(o->oBowserHeldAnglePitch) * sp1C;
- obj_become_intangible();
+ cur_obj_become_intangible();
o->prevObj->oAction = 1; // not sure what prevObj is
o->prevObj->oTimer = 0;
o->prevObj->oSubAction = 0;
@@ -1120,19 +1110,19 @@ void bhv_bowser_loop(void) {
o->oBowserUnkF4 |= 8;
switch (o->oHeldState) {
case HELD_FREE:
- func_802B688C();
+ bowser_free_update();
break;
case HELD_HELD:
- func_802B697C();
+ bowser_held_update();
break;
case HELD_THROWN:
- func_802B6AC0();
+ bowser_thrown_dropped_update();
break;
case HELD_DROPPED:
- func_802B6AC0();
+ bowser_thrown_dropped_update();
break;
}
- obj_align_gfx_with_floor();
+ cur_obj_align_gfx_with_floor();
if (o->oAction != 4)
if (o->oBowserUnk1AC != o->oOpacity) {
if (o->oBowserUnk1AC > o->oOpacity) {
@@ -1161,7 +1151,7 @@ void bhv_bowser_init(void) {
o->oBehParams2ndByte = level;
o->oBowserUnk1B2 = D_8032F690[level];
o->oHealth = D_8032F694[level];
- obj_start_cam_event(o, CAM_EVENT_BOWSER_INIT);
+ cur_obj_start_cam_event(o, CAM_EVENT_BOWSER_INIT);
o->oAction = 5;
o->oBowserUnk1AE = 0;
o->oBowserEyesShut = 0;
@@ -1171,22 +1161,22 @@ void bhv_bowser_init(void) {
#undef BITFS
#undef BITS
-Gfx *Geo18_802B798C(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
+Gfx *geo_update_body_rot_from_parent(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
Mat4 sp20;
struct Object *sp1C;
if (run == TRUE) {
sp1C = (struct Object *) gCurGraphNodeObject;
if (sp1C->prevObj != NULL) {
- func_8029D704(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
- func_8029D558(sp20, sp1C->prevObj);
- func_8029EA0C(sp1C->prevObj);
+ create_transformation_from_matrices(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
+ obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
+ obj_set_gfx_pos_from_pos(sp1C->prevObj);
}
}
return NULL;
}
-void func_802B70C8(struct Object *a0, struct GraphNodeSwitchCase *switchCase) {
+void bowser_open_eye_switch(struct Object *a0, struct GraphNodeSwitchCase *switchCase) {
s32 sp1C;
s16 sp1A;
sp1A = abs_angle_diff(a0->oMoveAngleYaw, a0->oAngleToMario);
@@ -1257,7 +1247,7 @@ Gfx *geo_switch_bowser_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *mtx) {
obj = gCurGraphNodeHeldObject->objNode;
switch (sp36 = obj->oBowserEyesShut) {
case 0: // eyes open, handle eye looking direction
- func_802B70C8(obj, switchCase);
+ bowser_open_eye_switch(obj, switchCase);
break;
case 1: // eyes closed, blinking
switchCase->selectedCase = 2;
@@ -1268,7 +1258,7 @@ Gfx *geo_switch_bowser_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *mtx) {
return NULL;
}
-Gfx *Geo18_802B7D44(s32 a0, struct GraphNode *node, UNUSED s32 a2) {
+Gfx *geo_bits_bowser_coloring(s32 a0, struct GraphNode *node, UNUSED s32 a2) {
Gfx *sp2C = NULL;
Gfx *sp28;
struct Object *sp24;
@@ -1293,14 +1283,14 @@ Gfx *Geo18_802B7D44(s32 a0, struct GraphNode *node, UNUSED s32 a2) {
return sp2C;
}
-void ActionFallingBowserPlatform0(void) {
- o->oPlatformUnkF8 = obj_nearest_object_with_behavior(bhvBowser);
- set_object_collision_data(o, D_8032F698[o->oBehParams2ndByte].unk0);
+void falling_bowser_plat_act_0(void) {
+ o->oPlatformUnkF8 = cur_obj_nearest_object_with_behavior(bhvBowser);
+ obj_set_collision_data(o, D_8032F698[o->oBehParams2ndByte].unk0);
if (o->oPlatformUnkF8 != 0)
o->oAction = 1;
}
-void ActionFallingBowserPlatform1(void) {
+void falling_bowser_plat_act_1(void) {
UNUSED s32 unused;
struct Object *sp0 = o->oPlatformUnkF8;
if (sp0->platform == o)
@@ -1317,13 +1307,13 @@ void ActionFallingBowserPlatform1(void) {
}
}
-void ActionFallingBowserPlatform2(void) {
+void falling_bowser_plat_act_2(void) {
Vec3f sp24;
s16 sp22;
f32 sp1C;
UNUSED struct Object *sp18 = o->oPlatformUnkF8;
if (o->oTimer == 0 || o->oTimer == 22)
- PlaySound2(SOUND_GENERAL_BOWSER_PLATFORM_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOWSER_PLATFORM_2);
if (o->oTimer < 22) {
set_environmental_camera_shake(SHAKE_ENV_FALLING_BITS_PLAT);
o->oVelY = 8.0f;
@@ -1333,24 +1323,24 @@ void ActionFallingBowserPlatform2(void) {
if ((o->oTimer & 1) == 0 && o->oTimer < 14) {
sp22 = D_8032F698[o->oBehParams2ndByte].unk3 + (gDebugInfo[4][1] << 8);
sp1C = -(o->oTimer / 2) * 290 + 1740;
- func_802B8F7C(sp24, &o->oPosX);
+ vec3f_copy_2(sp24, &o->oPosX);
o->oPosX = D_8032F698[o->oBehParams2ndByte].unk1 + sins(sp22 + 5296) * sp1C;
o->oPosZ = D_8032F698[o->oBehParams2ndByte].unk2 + coss(sp22 + 5296) * sp1C;
o->oPosY = 307.0f;
- func_802AA618(4, 0, 100.0f);
+ spawn_mist_particles_variable(4, 0, 100.0f);
o->oPosX = D_8032F698[o->oBehParams2ndByte].unk1 + sins(sp22 - 5296) * sp1C;
o->oPosZ = D_8032F698[o->oBehParams2ndByte].unk2 + coss(sp22 - 5296) * sp1C;
- func_802AA618(4, 0, 100);
- func_802B8F7C(&o->oPosX, sp24);
+ spawn_mist_particles_variable(4, 0, 100);
+ vec3f_copy_2(&o->oPosX, sp24);
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oTimer > 300)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void (*sFallingBowserPlatformActions[])(void) = { ActionFallingBowserPlatform0,
- ActionFallingBowserPlatform1,
- ActionFallingBowserPlatform2 };
+void (*sFallingBowserPlatformActions[])(void) = { falling_bowser_plat_act_0,
+ falling_bowser_plat_act_1,
+ falling_bowser_plat_act_2 };
struct ObjectHitbox sGrowingBowserFlameHitbox = {
/* interactType: */ INTERACT_FLAME,
@@ -1379,17 +1369,17 @@ struct ObjectHitbox sBowserFlameHitbox = {
f32 D_8032F748[] = { -8.0f, -6.0f, -3.0f };
void bhv_falling_bowser_platform_loop(void) {
- obj_call_action_function(sFallingBowserPlatformActions);
+ cur_obj_call_action_function(sFallingBowserPlatformActions);
}
-void func_802B7A58(void) {
- mark_object_for_deletion(o);
+void bowser_flame_despawn(void) {
+ obj_mark_for_deletion(o);
spawn_object_with_scale(o, MODEL_NONE, bhvBlackSmokeUpward, 1.0f);
if (RandomFloat() < 0.1)
spawn_object(o, MODEL_YELLOW_COIN, bhvTemporaryYellowCoin);
}
-s32 func_802B7ADC(s32 a0) {
+s32 bowser_flame_should_despawn(s32 a0) {
if (a0 < o->oTimer)
return 1;
if (o->oFloorType == 1)
@@ -1419,7 +1409,7 @@ void bhv_flame_large_burning_out_init(void) {
o->oFlameUnkF4 = 7.0f;
}
-void func_802B7CFC(void) {
+void bowser_flame_move(void) {
s32 sp4;
sp4 = ((o->oFlameUnkF8 + gGlobalTimer) & 0x3F) << 10;
o->oPosX += sins(o->oMoveAngleYaw) * sins(sp4) * 4.0f;
@@ -1427,16 +1417,16 @@ void func_802B7CFC(void) {
}
void bhv_flame_bowser_loop(void) {
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
if (o->oVelY < -4.0f)
o->oVelY = -4.0f;
if (o->oAction == 0) {
- obj_become_intangible();
- func_802B7CFC();
+ cur_obj_become_intangible();
+ bowser_flame_move();
if (o->oMoveFlags & 1) {
o->oAction++;
- if (obj_has_behavior(bhvFlameLargeBurningOut))
+ if (cur_obj_has_behavior(bhvFlameLargeBurningOut))
o->oFlameUnkF4 = 8.0f;
else
o->oFlameUnkF4 = RandomFloat() * 2 + 6.0f;
@@ -1445,21 +1435,21 @@ void bhv_flame_bowser_loop(void) {
o->oGravity = 0;
}
} else {
- obj_become_tangible();
+ cur_obj_become_tangible();
if (o->oTimer > o->oFlameUnkF4 * 10 + 5.0f) {
o->oFlameUnkF4 -= 0.15;
if (o->oFlameUnkF4 <= 0)
- func_802B7A58();
+ bowser_flame_despawn();
}
}
- obj_scale(o->oFlameUnkF4);
+ cur_obj_scale(o->oFlameUnkF4);
o->oGraphYOffset = o->header.gfx.scale[1] * 14.0f;
- set_object_hitbox(o, &sBowserFlameHitbox);
+ obj_set_hitbox(o, &sBowserFlameHitbox);
}
void bhv_flame_moving_forward_growing_init(void) {
o->oForwardVel = 30.0f;
- translate_object_xz_random(o, 80.0f);
+ obj_translate_xz_random(o, 80.0f);
o->oAnimState = (s32)(RandomFloat() * 10.0f);
o->oFlameUnkF4 = 3.0f;
}
@@ -1467,19 +1457,19 @@ void bhv_flame_moving_forward_growing_init(void) {
void bhv_flame_moving_forward_growing_loop(void) {
UNUSED s32 unused;
UNUSED struct Object *sp18;
- set_object_hitbox(o, &sGrowingBowserFlameHitbox);
+ obj_set_hitbox(o, &sGrowingBowserFlameHitbox);
o->oFlameUnkF4 = o->oFlameUnkF4 + 0.5;
- obj_scale(o->oFlameUnkF4);
+ cur_obj_scale(o->oFlameUnkF4);
if (o->oMoveAnglePitch > 0x800)
o->oMoveAnglePitch -= 0x200;
- func_802A2A38();
- obj_update_floor_height();
+ cur_obj_set_pos_via_transform();
+ cur_obj_update_floor_height();
if (o->oFlameUnkF4 > 30.0f)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oPosY < o->oFloorHeight) {
o->oPosY = o->oFloorHeight;
sp18 = spawn_object(o, MODEL_RED_FLAME, bhvFlameBowser);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
@@ -1497,11 +1487,11 @@ void bhv_flame_floating_landing_init(void) {
void bhv_flame_floating_landing_loop(void) {
UNUSED s32 unused;
- obj_update_floor_and_walls();
- obj_move_standard(0x4e);
- func_802B7CFC();
- if (func_802B7ADC(900))
- mark_object_for_deletion(o);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(0x4e);
+ bowser_flame_move();
+ if (bowser_flame_should_despawn(900))
+ obj_mark_for_deletion(o);
if (o->oVelY < D_8032F748[o->oBehParams2ndByte])
o->oVelY = D_8032F748[o->oBehParams2ndByte];
if (o->oMoveFlags & 1) {
@@ -1509,13 +1499,13 @@ void bhv_flame_floating_landing_loop(void) {
spawn_object(o, MODEL_RED_FLAME, bhvFlameLargeBurningOut);
else
spawn_object(o, MODEL_NONE, bhvBlueFlamesGroup); //? wonder if they meant MODEL_BLUE_FLAME?
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
o->oGraphYOffset = o->header.gfx.scale[1] * 14.0f;
}
void bhv_blue_bowser_flame_init(void) {
- translate_object_xz_random(o, 80.0f);
+ obj_translate_xz_random(o, 80.0f);
o->oAnimState = (s32)(RandomFloat() * 10.0f);
o->oVelY = 7.0f;
o->oForwardVel = 35.0f;
@@ -1527,12 +1517,12 @@ void bhv_blue_bowser_flame_init(void) {
void bhv_blue_bowser_flame_loop(void) {
s32 i;
- set_object_hitbox(o, &sGrowingBowserFlameHitbox);
+ obj_set_hitbox(o, &sGrowingBowserFlameHitbox);
if (o->oFlameUnkF4 < 16.0f)
o->oFlameUnkF4 = o->oFlameUnkF4 + 0.5;
- obj_scale(o->oFlameUnkF4);
- obj_update_floor_and_walls();
- obj_move_standard(0x4e);
+ cur_obj_scale(o->oFlameUnkF4);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(0x4e);
if (o->oTimer > 0x14) {
if (o->oBehParams2ndByte == 0)
for (i = 0; i < 3; i++)
@@ -1544,7 +1534,7 @@ void bhv_blue_bowser_flame_loop(void) {
spawn_object_relative_with_scale(2, 0, 0, 0, 8.0f, o, MODEL_BLUE_FLAME,
bhvFlameFloatingLanding);
}
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
@@ -1559,27 +1549,27 @@ void bhv_flame_bouncing_init(void) {
void bhv_flame_bouncing_loop(void) {
struct Object *sp1C;
if (o->oTimer == 0)
- o->oFlameUnk100 = obj_nearest_object_with_behavior(bhvBowser);
+ o->oFlameUnk100 = cur_obj_nearest_object_with_behavior(bhvBowser);
sp1C = o->oFlameUnk100;
o->oForwardVel = 15.0f;
o->oBounce = -1.0f;
- obj_scale(o->oFlameUnkF4);
- set_object_hitbox(o, &sGrowingBowserFlameHitbox);
- obj_update_floor_and_walls();
- obj_move_standard(78);
- if (func_802B7ADC(300))
- mark_object_for_deletion(o);
+ cur_obj_scale(o->oFlameUnkF4);
+ obj_set_hitbox(o, &sGrowingBowserFlameHitbox);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
+ if (bowser_flame_should_despawn(300))
+ obj_mark_for_deletion(o);
if (sp1C != NULL)
if (sp1C->oHeldState == 0)
if (lateral_dist_between_objects(o, sp1C) < 300.0f)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_blue_flames_group_loop(void) {
struct Object *flame;
s32 i;
if (o->oTimer == 0) {
- o->oMoveAngleYaw = angle_to_object(o, gMarioObject);
+ o->oMoveAngleYaw = obj_angle_to_object(o, gMarioObject);
o->oBlueFlameUnkF8 = 5.0f;
}
if (o->oTimer < 16) {
@@ -1592,5 +1582,5 @@ void bhv_blue_flames_group_loop(void) {
o->oBlueFlameUnkF8 -= 0.5;
}
} else
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/bowser_bomb.inc.c b/src/game/behaviors/bowser_bomb.inc.c
@@ -1,7 +1,7 @@
// bowser_bomb.c.inc
void bhv_bowser_bomb_loop(void) {
- if (are_objects_collided(o, gMarioObject) == 1) {
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
o->oInteractStatus &= ~INT_STATUS_INTERACTED; /* bit 15 */
spawn_object(o, MODEL_EXPLOSION, bhvExplosion);
o->activeFlags = 0;
@@ -21,7 +21,7 @@ void bhv_bowser_bomb_loop(void) {
void bhv_bowser_bomb_explosion_loop(void) {
struct Object *mineSmoke;
- obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0);
+ cur_obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0);
if ((o->oTimer % 4 == 0) && (o->oTimer < 20)) {
mineSmoke = spawn_object(o, MODEL_BOWSER_SMOKE, bhvBowserBombSmoke);
mineSmoke->oPosX += RandomFloat() * 600.0f - 400.0f;
@@ -36,7 +36,7 @@ void bhv_bowser_bomb_explosion_loop(void) {
}
void bhv_bowser_bomb_smoke_loop(void) {
- obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0);
+ cur_obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0);
if (o->oTimer % 2 == 0)
o->oAnimState++;
diff --git a/src/game/behaviors/bowser_key.inc.c b/src/game/behaviors/bowser_key.inc.c
@@ -13,7 +13,7 @@ struct ObjectHitbox sBowserKeyHitbox = {
};
void bhv_bowser_key_loop(void) {
- obj_scale(0.5f);
+ cur_obj_scale(0.5f);
if (o->oAngleVelYaw > 0x400)
o->oAngleVelYaw -= 0x100;
o->oFaceAngleYaw += o->oAngleVelYaw;
@@ -22,20 +22,20 @@ void bhv_bowser_key_loop(void) {
if (o->oAction == 0) {
if (o->oTimer == 0)
o->oVelY = 70.0f;
- func_802B2328(3, 200, 80, -60);
+ spawn_sparkle_particles(3, 200, 80, -60);
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
if (o->oMoveFlags & OBJ_MOVE_ON_GROUND)
o->oAction++;
else if (o->oMoveFlags & OBJ_MOVE_LANDED)
#ifndef VERSION_JP
- PlaySound2(SOUND_GENERAL_UNKNOWN3_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN3_2);
#else
- PlaySound2(SOUND_GENERAL_UNKNOWN3_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN3_LOWPRIO);
#endif
} else {
- set_object_hitbox(o, &sBowserKeyHitbox);
+ obj_set_hitbox(o, &sBowserKeyHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
mark_obj_for_deletion(o);
o->oInteractStatus = 0;
diff --git a/src/game/behaviors/bowser_key_cutscene.inc.c b/src/game/behaviors/bowser_key_cutscene.inc.c
@@ -1,6 +1,6 @@
// bowser_key_cutscene.inc.c
-Gfx *Geo18_802BA2B0(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
+Gfx *geo_scale_bowser_key(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
struct Object *sp4;
if (run == TRUE) {
sp4 = (struct Object *) gCurGraphNodeObject;
@@ -12,7 +12,7 @@ Gfx *Geo18_802BA2B0(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
void bhv_bowser_key_unlock_door_loop(void) {
s32 animTimer;
animTimer = o->header.gfx.unk38.animFrame;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
if (animTimer < 38)
o->oBowserKeyScale = 0.0f;
else if (animTimer < 49)
@@ -26,12 +26,12 @@ void bhv_bowser_key_unlock_door_loop(void) {
else
o->oBowserKeyScale = 1.0f;
if (o->oTimer > 150)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_bowser_key_course_exit_loop(void) {
s32 animTimer = o->header.gfx.unk38.animFrame;
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (animTimer < 38)
o->oBowserKeyScale = 0.2f;
else if (animTimer < 52)
@@ -43,5 +43,5 @@ void bhv_bowser_key_course_exit_loop(void) {
else
o->oBowserKeyScale = 0.2f;
if (o->oTimer > 138)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/bowser_puzzle_piece.inc.c b/src/game/behaviors/bowser_puzzle_piece.inc.c
@@ -170,7 +170,7 @@ void bhv_lll_bowser_puzzle_piece_update(void) {
// If we should advance to the next action...
if (o->oBowserPuzzlePieceContinuePerformingAction == 0) {
// Start doing the next action.
- obj_change_action(*nextAction);
+ cur_obj_change_action(*nextAction);
// Advance the pointer to the next action.
nextAction++;
@@ -200,7 +200,7 @@ void bhv_lll_bowser_puzzle_piece_move(f32 xOffset, f32 zOffset, s32 duration, UN
} else {
// On frame 20, play the shifting sound.
if (o->oTimer == 20)
- PlaySound2(SOUND_OBJ2_BOWSER_PUZZLE_PIECE_MOVE);
+ cur_obj_play_sound_2(SOUND_OBJ2_BOWSER_PUZZLE_PIECE_MOVE);
// For the number of frames specified by duration, move the piece.
if (o->oTimer < duration + 20) {
@@ -208,7 +208,7 @@ void bhv_lll_bowser_puzzle_piece_move(f32 xOffset, f32 zOffset, s32 duration, UN
o->oBowserPuzzlePieceOffsetZ += zOffset;
} else {
// This doesn't actually accomplish anything since
- // obj_change_action is going to be called before the
+ // cur_obj_change_action is going to be called before the
// next action is performed anyway.
o->oAction = 2;
@@ -255,7 +255,7 @@ void (*sBowserPuzzlePieceActions[])(void) = {
void bhv_lll_bowser_puzzle_piece_loop(void) {
bhv_lll_bowser_puzzle_piece_update();
- obj_call_action_function(sBowserPuzzlePieceActions);
+ cur_obj_call_action_function(sBowserPuzzlePieceActions);
o->oPosX = o->oBowserPuzzlePieceOffsetX + o->oHomeX;
o->oPosY = o->oBowserPuzzlePieceOffsetY + o->oHomeY;
diff --git a/src/game/behaviors/break_particles.inc.c b/src/game/behaviors/break_particles.inc.c
@@ -19,6 +19,6 @@ void spawn_triangle_break_particles(s16 numTris, s16 triModel, f32 triSize, s16
triangle->oAngleVelPitch = 0x80 * (s32)(RandomFloat() + 50.0f);
triangle->oForwardVel = 30.0f;
}
- scale_object(triangle, triSize);
+ obj_scale(triangle, triSize);
}
}
diff --git a/src/game/behaviors/breakable_box.inc.c b/src/game/behaviors/breakable_box.inc.c
@@ -1,12 +1,12 @@
// breakable_box.c.inc
void bhv_breakable_box_loop(void) {
- set_object_hitbox(o, &sBreakableBoxHitbox);
- obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
+ obj_set_hitbox(o, &sBreakableBoxHitbox);
+ cur_obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
if (o->oTimer == 0)
- func_802B0E74();
- if (obj_was_attacked_or_ground_pounded() != 0) {
- func_802A3C98(46.0f, 1);
+ breakable_box_init();
+ if (cur_obj_was_attacked_or_ground_pounded() != 0) {
+ obj_explode_and_spawn_coins(46.0f, 1);
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
}
}
diff --git a/src/game/behaviors/breakable_box_small.inc.c b/src/game/behaviors/breakable_box_small.inc.c
@@ -16,33 +16,33 @@ void bhv_breakable_box_small_init(void) {
o->oGravity = 2.5f;
o->oFriction = 0.99f;
o->oBuoyancy = 1.4f;
- obj_scale(0.4f);
- set_object_hitbox(o, &sBreakableBoxSmallHitbox);
+ cur_obj_scale(0.4f);
+ obj_set_hitbox(o, &sBreakableBoxSmallHitbox);
o->oAnimState = 1;
o->activeFlags |= 0x200;
}
-void func_802F4CE8(void) {
+void small_breakable_box_spawn_dust(void) {
struct Object *sp24 = spawn_object(o, MODEL_SMOKE, bhvSmoke);
sp24->oPosX += (s32)(RandomFloat() * 80.0f) - 40;
sp24->oPosZ += (s32)(RandomFloat() * 80.0f) - 40;
}
-void func_802F4DB4(void) {
+void small_breakable_box_act_move(void) {
s16 sp1E = object_step();
- attack_collided_non_mario_object(o);
+ obj_attack_collided_from_other_object(o);
if (sp1E == 1)
- PlaySound2(SOUND_GENERAL_BOX_LANDING_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOX_LANDING_2);
if (sp1E & 1) {
if (o->oForwardVel > 20.0f) {
- PlaySound2(SOUND_ENV_SLIDING);
- func_802F4CE8();
+ cur_obj_play_sound_2(SOUND_ENV_SLIDING);
+ small_breakable_box_spawn_dust();
}
}
if (sp1E & 2) {
- func_802A3004();
+ spawn_mist_particles();
spawn_triangle_break_particles(20, 138, 0.7f, 3);
obj_spawn_yellow_coins(o, 3);
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
@@ -73,7 +73,7 @@ void breakable_box_small_released_loop(void) {
void breakable_box_small_idle_loop(void) {
switch (o->oAction) {
case 0:
- func_802F4DB4();
+ small_breakable_box_act_move();
break;
case 100:
@@ -91,9 +91,9 @@ void breakable_box_small_idle_loop(void) {
}
void breakable_box_small_get_dropped(void) {
- obj_become_tangible();
- obj_enable_rendering();
- obj_get_dropped();
+ cur_obj_become_tangible();
+ cur_obj_enable_rendering();
+ cur_obj_get_dropped();
o->header.gfx.node.flags &= ~0x10;
o->oHeldState = 0;
o->oBreakableBoxSmallReleased = 1;
@@ -101,9 +101,9 @@ void breakable_box_small_get_dropped(void) {
}
void breakable_box_small_get_thrown(void) {
- obj_become_tangible();
- obj_enable_rendering_2();
- obj_enable_rendering();
+ cur_obj_become_tangible();
+ cur_obj_enable_rendering_2();
+ cur_obj_enable_rendering();
o->header.gfx.node.flags &= ~0x10;
o->oHeldState = 0;
o->oFlags &= ~0x08;
@@ -121,8 +121,8 @@ void bhv_breakable_box_small_loop(void) {
break;
case 1:
- obj_disable_rendering();
- obj_become_intangible();
+ cur_obj_disable_rendering();
+ cur_obj_become_intangible();
break;
case 2:
diff --git a/src/game/behaviors/breakable_wall.inc.c b/src/game/behaviors/breakable_wall.inc.c
@@ -2,15 +2,15 @@
void bhv_wf_breakable_wall_loop(void) {
if (gMarioStates->action == ACT_SHOT_FROM_CANNON) {
- obj_become_tangible();
- if (are_objects_collided(o, gMarioObject)) {
- if (obj_has_behavior(bhvWfBreakableWallRight))
+ cur_obj_become_tangible();
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
+ if (cur_obj_has_behavior(bhvWfBreakableWallRight))
play_puzzle_jingle();
create_sound_spawner(SOUND_GENERAL_WALL_EXPLOSION);
o->oInteractType = 8;
o->oDamageOrCoinValue = 1;
- func_802A3C98(80.0f, 0);
+ obj_explode_and_spawn_coins(80.0f, 0);
}
} else
- obj_become_intangible();
+ cur_obj_become_intangible();
}
diff --git a/src/game/behaviors/bub.inc.c b/src/game/behaviors/bub.inc.c
@@ -5,7 +5,7 @@
// to do nothing, which indicates this behavior set is incomplete.
// TODO: Rename these. These have nothing to do with birds.
-void ActionBirdChirpChirp0(void) {
+void bub_spawner_act_0(void) {
s32 i;
s32 sp18 = o->oBirdChirpChirpUnkF4;
if (o->oDistanceToMario < 1500.0f) {
@@ -15,27 +15,27 @@ void ActionBirdChirpChirp0(void) {
}
}
-void ActionBirdChirpChirp1(void) {
+void bub_spawner_act_1(void) {
if (gMarioObject->oPosY - o->oPosY > 2000.0f)
o->oAction = 2;
}
-void ActionBirdChirpChirp2(void) {
+void bub_spawner_act_2(void) {
o->oAction = 3;
}
-void ActionBirdChirpChirp3(void) {
+void bub_spawner_act_3(void) {
o->oAction = 0;
}
-void (*sBirdChirpChirpActions[])(void) = { ActionBirdChirpChirp0, ActionBirdChirpChirp1,
- ActionBirdChirpChirp2, ActionBirdChirpChirp3 };
+void (*sBirdChirpChirpActions[])(void) = { bub_spawner_act_0, bub_spawner_act_1,
+ bub_spawner_act_2, bub_spawner_act_3 };
-void bhv_bird_chirp_chirp_loop(void) {
- obj_call_action_function(sBirdChirpChirpActions);
+void bhv_bub_spawner_loop(void) {
+ cur_obj_call_action_function(sBirdChirpChirpActions);
}
-void func_802C0240(s32 a0) {
+void bub_move_vertically(s32 a0) {
f32 sp1C = o->parentObj->oPosY;
if (sp1C - 100.0f - o->oCheepCheepUnk104 < o->oPosY
&& o->oPosY < sp1C + 1000.0f + o->oCheepCheepUnk104)
@@ -44,13 +44,13 @@ void func_802C0240(s32 a0) {
}
}
-void ActionCheepCheep0(void) {
+void bub_act_0(void) {
o->oCheepCheepUnkFC = RandomFloat() * 100.0f;
o->oCheepCheepUnk104 = RandomFloat() * 300.0f;
o->oAction = 1;
}
-void ActionCheepCheep1(void) {
+void bub_act_1(void) {
f32 dy;
if (o->oTimer == 0) {
o->oForwardVel = RandomFloat() * 2 + 2;
@@ -61,17 +61,17 @@ void ActionCheepCheep1(void) {
if (dy < 0.0f)
dy = 0.0f - dy;
if (dy < 500.0f)
- func_802C0240(1);
+ bub_move_vertically(1);
else
- func_802C0240(4);
+ bub_move_vertically(4);
} else {
o->oPosY = o->oCheepCheepUnkF4 - 50.0f;
if (dy > 300.0f)
o->oPosY = o->oPosY - 1.0f;
}
- if (800.0f < obj_lateral_dist_from_mario_to_home())
- o->oAngleToMario = obj_angle_to_home();
- obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
+ if (800.0f < cur_obj_lateral_dist_from_mario_to_home())
+ o->oAngleToMario = cur_obj_angle_to_home();
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
if (o->oDistanceToMario < 200.0f)
if (o->oCheepCheepUnk108 < 0.5)
o->oAction = 2;
@@ -79,7 +79,7 @@ void ActionCheepCheep1(void) {
o->oAction = 2;
}
-void ActionCheepCheep2(void) {
+void bub_act_2(void) {
f32 dy;
if (o->oTimer < 20) {
if (o->oInteractStatus & INT_STATUS_INTERACTED)
@@ -87,7 +87,7 @@ void ActionCheepCheep2(void) {
} else
o->oInteractStatus = 0;
if (o->oTimer == 0)
- PlaySound2(SOUND_GENERAL_MOVING_WATER);
+ cur_obj_play_sound_2(SOUND_GENERAL_MOVING_WATER);
if (o->oForwardVel == 0.0f)
o->oForwardVel = 6.0f;
dy = o->oPosY - gMarioObject->oPosY;
@@ -95,30 +95,30 @@ void ActionCheepCheep2(void) {
if (dy < 0.0f)
dy = 0.0f - dy;
if (dy < 500.0f)
- func_802C0240(2);
+ bub_move_vertically(2);
else
- func_802C0240(4);
+ bub_move_vertically(4);
} else {
o->oPosY = o->oCheepCheepUnkF4 - 50.0f;
if (dy > 300.0f)
o->oPosY -= 1.0f;
}
- if (obj_lateral_dist_from_mario_to_home() > 800.0f)
- o->oAngleToMario = obj_angle_to_home();
- obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x400);
+ if (cur_obj_lateral_dist_from_mario_to_home() > 800.0f)
+ o->oAngleToMario = cur_obj_angle_to_home();
+ cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x400);
if (o->oTimer > 200 && o->oDistanceToMario > 600.0f)
o->oAction = 1;
}
-void (*sCheepCheepActions[])(void) = { ActionCheepCheep0, ActionCheepCheep1, ActionCheepCheep2 };
+void (*sCheepCheepActions[])(void) = { bub_act_0, bub_act_1, bub_act_2 };
-void bhv_cheep_cheep_loop(void) {
+void bhv_bub_loop(void) {
o->oCheepCheepUnkF4 = find_water_level(o->oPosX, o->oPosZ);
o->oCheepCheepUnkF8 = gMarioObject->oPosY + o->oCheepCheepUnkFC;
o->oWallHitboxRadius = 30.0f;
- obj_update_floor_and_walls();
- obj_call_action_function(sCheepCheepActions);
- obj_move_using_fvel_and_gravity();
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sCheepCheepActions);
+ cur_obj_move_using_fvel_and_gravity();
if (o->parentObj->oAction == 2)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/bubba.inc.c b/src/game/behaviors/bubba.inc.c
@@ -15,7 +15,7 @@ static struct ObjectHitbox sBubbaHitbox = {
void bubba_act_0(void) {
f32 sp24;
- sp24 = obj_lateral_dist_to_home();
+ sp24 = cur_obj_lateral_dist_to_home();
treat_far_home_as_mario(2000.0f);
o->oAnimState = 0;
@@ -34,7 +34,7 @@ void bubba_act_0(void) {
}
if ((o->oBubbaUnkFC = o->oMoveFlags & 0x00000200) != 0) {
- o->oBubbaUnk1AE = obj_reflect_move_angle_off_wall();
+ o->oBubbaUnk1AE = cur_obj_reflect_move_angle_off_wall();
} else if (o->oTimer > 30 && o->oDistanceToMario < 2000.0f) {
o->oAction = 1;
} else if (o->oBubbaUnkF8 != 0) {
@@ -55,7 +55,7 @@ void bubba_act_1(void) {
o->oAction = 0;
} else if (o->oBubbaUnk100 != 0) {
if (--o->oBubbaUnk100 == 0) {
- PlaySound2(SOUND_OBJ_BUBBA_CHOMP);
+ cur_obj_play_sound_2(SOUND_OBJ_BUBBA_CHOMP);
o->oAction = 0;
} else if (o->oBubbaUnk100 < 15) {
o->oAnimState = 1;
@@ -71,7 +71,7 @@ void bubba_act_1(void) {
o->oBubbaUnk1AE = o->oAngleToMario;
o->oBubbaUnk1AC = o->oBubbaUnk104;
- obj_rotate_yaw_toward(o->oBubbaUnk1AE, 400);
+ cur_obj_rotate_yaw_toward(o->oBubbaUnk1AE, 400);
obj_move_pitch_approach(o->oBubbaUnk1AC, 400);
}
} else {
@@ -119,7 +119,7 @@ void bhv_bubba_loop(void) {
o->hurtboxRadius = 150.0f;
}
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case 0:
@@ -134,7 +134,7 @@ void bhv_bubba_loop(void) {
if (o->oMoveFlags & 0x00000008) {
sp38 = spawn_object(o, MODEL_WATER_SPLASH, bhvWaterSplash);
if (sp38 != NULL) {
- scale_object(sp38, 3.0f);
+ obj_scale(sp38, 3.0f);
}
o->oBubbaUnk108 = o->oVelY;
@@ -163,7 +163,7 @@ void bhv_bubba_loop(void) {
obj_face_pitch_approach(o->oMoveAnglePitch, 400);
obj_check_attacks(&sBubbaHitbox, o->oAction);
- obj_move_standard(78);
+ cur_obj_move_standard(78);
o->oFloorHeight += 150.0f;
if (o->oPosY < o->oFloorHeight) {
diff --git a/src/game/behaviors/bubble.inc.c b/src/game/behaviors/bubble.inc.c
@@ -7,16 +7,16 @@ void bhv_object_bubble_init(void) {
}
void bhv_object_bubble_loop(void) {
- struct Object *bubbleRipples;
+ struct Object *bubbleSplash;
f32 waterY = find_water_level(o->oPosX, o->oPosZ);
f32 bubbleY = o->oPosY;
if (bubbleY > waterY) {
if (gFreeObjectList.next) {
- bubbleRipples = spawn_object_at_origin(o, 0, MODEL_SPOT_ON_GROUND, bhvObjectBubbleRipples);
- bubbleRipples->oPosX = o->oPosX;
- bubbleRipples->oPosY = bubbleY + 5.0f;
- bubbleRipples->oPosZ = o->oPosZ;
+ bubbleSplash = spawn_object_at_origin(o, 0, MODEL_SMALL_WATER_SPLASH, bhvBubbleSplash);
+ bubbleSplash->oPosX = o->oPosX;
+ bubbleSplash->oPosY = bubbleY + 5.0f;
+ bubbleSplash->oPosZ = o->oPosZ;
}
o->activeFlags = 0;
diff --git a/src/game/behaviors/bullet_bill.inc.c b/src/game/behaviors/bullet_bill.inc.c
@@ -2,31 +2,31 @@
// bullet bill smoke
void bhv_white_puff_smoke_init(void) {
- obj_scale(RandomFloat() * 2 + 2.0);
+ cur_obj_scale(RandomFloat() * 2 + 2.0);
}
void bhv_bullet_bill_init(void) {
o->oBulletBillUnkF8 = o->oMoveAngleYaw;
}
-void ActionBulletBill0(void) {
- obj_become_tangible();
+void bullet_bill_act_0(void) {
+ cur_obj_become_tangible();
o->oForwardVel = 0.0f;
o->oMoveAngleYaw = o->oBulletBillUnkF8;
o->oFaceAnglePitch = 0;
o->oFaceAngleRoll = 0;
o->oMoveFlags = 0;
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oAction = 1;
}
-void ActionBulletBill1(void) {
+void bullet_bill_act_1(void) {
s16 sp1E = abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw);
if (sp1E < 0x2000 && 400.0f < o->oDistanceToMario && o->oDistanceToMario < 1500.0f)
o->oAction = 2;
}
-void ActionBulletBill2(void) {
+void bullet_bill_act_2(void) {
if (o->oTimer < 40)
o->oForwardVel = 3.0f;
else if (o->oTimer < 50) {
@@ -36,30 +36,30 @@ void ActionBulletBill2(void) {
o->oForwardVel = -3.0f;
} else {
if (o->oTimer > 70)
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
spawn_object(o, MODEL_SMOKE, bhvWhitePuffSmoke);
o->oForwardVel = 30.0f;
if (o->oDistanceToMario > 300.0f)
- obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
if (o->oTimer == 50) {
- PlaySound2(SOUND_OBJ_POUNDING_CANNON);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_OBJ_POUNDING_CANNON);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
}
if (o->oTimer > 150 || o->oMoveFlags & 0x200) {
o->oAction = 3;
- func_802A3004();
+ spawn_mist_particles();
}
}
}
-void ActionBulletBill3(void) {
+void bullet_bill_act_3(void) {
o->oAction = 0;
}
-void ActionBulletBill4(void) {
+void bullet_bill_act_4(void) {
if (o->oTimer == 0) {
o->oForwardVel = -30.0f;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
o->oFaceAnglePitch += 0x1000;
o->oFaceAngleRoll += 0x1000;
@@ -68,11 +68,11 @@ void ActionBulletBill4(void) {
o->oAction = 0;
}
-void (*sBulletBillActions[])(void) = { ActionBulletBill0, ActionBulletBill1, ActionBulletBill2,
- ActionBulletBill3, ActionBulletBill4 };
+void (*sBulletBillActions[])(void) = { bullet_bill_act_0, bullet_bill_act_1, bullet_bill_act_2,
+ bullet_bill_act_3, bullet_bill_act_4 };
void bhv_bullet_bill_loop(void) {
- obj_call_action_function(sBulletBillActions);
- if (obj_check_interacted())
+ cur_obj_call_action_function(sBulletBillActions);
+ if (cur_obj_check_interacted())
o->oAction = 4;
}
diff --git a/src/game/behaviors/bully.inc.c b/src/game/behaviors/bully.inc.c
@@ -25,7 +25,7 @@ static struct ObjectHitbox sBigBullyHitbox = {
};
void bhv_small_bully_init(void) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oHomeX = o->oPosX;
o->oHomeZ = o->oPosZ;
@@ -34,11 +34,11 @@ void bhv_small_bully_init(void) {
o->oFriction = 0.91;
o->oBuoyancy = 1.3;
- set_object_hitbox(o, &sSmallBullyHitbox);
+ obj_set_hitbox(o, &sSmallBullyHitbox);
}
void bhv_big_bully_init(void) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oHomeX = o->oPosX;
o->oHomeY = o->oPosY;
@@ -48,25 +48,25 @@ void bhv_big_bully_init(void) {
o->oFriction = 0.93;
o->oBuoyancy = 1.3;
- set_object_hitbox(o, &sBigBullyHitbox);
+ obj_set_hitbox(o, &sBigBullyHitbox);
}
-void BullyCheckMarioCollision(void) {
+void bully_check_mario_collision(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
- PlaySound2(SOUND_OBJ2_BULLY_ATTACKED);
+ cur_obj_play_sound_2(SOUND_OBJ2_BULLY_ATTACKED);
else
- PlaySound2(SOUND_OBJ2_LARGE_BULLY_ATTACKED);
+ cur_obj_play_sound_2(SOUND_OBJ2_LARGE_BULLY_ATTACKED);
o->oInteractStatus &= ~INT_STATUS_INTERACTED;
o->oAction = BULLY_ACT_KNOCKBACK;
o->oFlags &= ~0x8; /* bit 3 */
- SetObjAnimation(3);
+ cur_obj_init_animation(3);
o->oBullyMarioCollisionAngle = o->oMoveAngleYaw;
}
}
-void BullyChaseMarioLoop(void) {
+void bully_act_chase_mario(void) {
f32 homeX = o->oHomeX;
f32 posY = o->oPosY;
f32 homeZ = o->oHomeZ;
@@ -86,11 +86,11 @@ void BullyChaseMarioLoop(void) {
if (!is_point_within_radius_of_mario(homeX, posY, homeZ, 1000)) {
o->oAction = BULLY_ACT_PATROL;
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
}
}
-void BullyKnockbackLoop(void) {
+void bully_act_knockback(void) {
if (o->oForwardVel < 10.0 && (s32) o->oVelY == 0) {
o->oForwardVel = 1.0;
o->oBullyKBTimerAndMinionKOCounter++;
@@ -103,11 +103,11 @@ void BullyKnockbackLoop(void) {
if (o->oBullyKBTimerAndMinionKOCounter == 18) {
o->oAction = BULLY_ACT_CHASE_MARIO;
o->oBullyKBTimerAndMinionKOCounter = 0;
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
}
}
-void BullyBackUpLoop(void) {
+void bully_act_back_up(void) {
if (o->oTimer == 0) {
o->oFlags &= ~0x8; /* bit 3 */
o->oMoveAngleYaw += 0x8000;
@@ -115,7 +115,7 @@ void BullyBackUpLoop(void) {
o->oForwardVel = 5.0;
- //! BullyBackUpCheck() happens after this function, and has the potential to reset
+ //! bully_backup_check() happens after this function, and has the potential to reset
// the bully's action to BULLY_ACT_BACK_UP. Because the back up action is only
// set to end when the timer EQUALS 15, if this happens on that frame, the bully
// will be stuck in BULLY_ACT_BACK_UP forever until Mario hits it or its death
@@ -129,7 +129,7 @@ void BullyBackUpLoop(void) {
}
}
-void BullyBackUpCheck(s16 collisionFlags) {
+void bully_backup_check(s16 collisionFlags) {
if (!(collisionFlags & 0x8) && o->oAction != BULLY_ACT_KNOCKBACK) /* bit 3 */
{
o->oPosX = o->oBullyPrevX;
@@ -138,15 +138,15 @@ void BullyBackUpCheck(s16 collisionFlags) {
}
}
-void PlayBullyStompingSound(void) {
+void bully_play_stomping_sound(void) {
s16 sp26 = o->header.gfx.unk38.animFrame;
switch (o->oAction) {
case BULLY_ACT_PATROL:
if (sp26 == 0 || sp26 == 12) {
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
- PlaySound2(SOUND_OBJ_BULLY_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BULLY_WALK);
else
- PlaySound2(SOUND_OBJ_BULLY_WALKING);
+ cur_obj_play_sound_2(SOUND_OBJ_BULLY_WALKING);
}
break;
@@ -154,19 +154,19 @@ void PlayBullyStompingSound(void) {
case BULLY_ACT_BACK_UP:
if (sp26 == 0 || sp26 == 5) {
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL)
- PlaySound2(SOUND_OBJ_BULLY_WALK);
+ cur_obj_play_sound_2(SOUND_OBJ_BULLY_WALK);
else
- PlaySound2(SOUND_OBJ_BULLY_WALKING);
+ cur_obj_play_sound_2(SOUND_OBJ_BULLY_WALKING);
}
break;
}
}
-void BullyStep(void) {
+void bully_step(void) {
s16 collisionFlags = 0;
collisionFlags = object_step();
- BullyBackUpCheck(collisionFlags);
- PlayBullyStompingSound();
+ bully_backup_check(collisionFlags);
+ bully_play_stomping_sound();
obj_check_floor_death(collisionFlags, sObjFloor);
if (o->oBullySubtype & BULLY_STYPE_CHILL) {
@@ -175,14 +175,14 @@ void BullyStep(void) {
}
}
-void BullySpawnCoin(void) {
+void bully_spawn_coin(void) {
struct Object *coin = spawn_object(o, MODEL_YELLOW_COIN, bhvMovingYellowCoin);
#ifdef VERSION_JP //TODO: maybe move this ifdef logic to the header?
- PlaySound2(SOUND_GENERAL_COIN_SPURT);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT);
#elif VERSION_EU
- PlaySound2(SOUND_GENERAL_COIN_SPURT_EU);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT_EU);
#else
- PlaySound2(SOUND_GENERAL_COIN_SPURT_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT_2);
#endif
coin->oForwardVel = 10.0f;
coin->oVelY = 100.0f;
@@ -190,19 +190,19 @@ void BullySpawnCoin(void) {
coin->oMoveAngleYaw = (f32)(o->oBullyMarioCollisionAngle + 0x8000) + RandomFloat() * 1024.0f;
}
-void BullyLavaDeath(void) {
+void bully_act_level_death(void) {
if (obj_lava_death() == 1) {
if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL) {
if (o->oBullySubtype == BULLY_STYPE_MINION)
o->parentObj->oBullyKBTimerAndMinionKOCounter++;
- BullySpawnCoin();
+ bully_spawn_coin();
} else {
- func_802A3004();
+ spawn_mist_particles();
if (o->oBullySubtype == BULLY_STYPE_CHILL)
- create_star(130.0f, 1600.0f, -4335.0f);
+ spawn_default_star(130.0f, 1600.0f, -4335.0f);
else {
- create_star(0, 950.0f, -6800.0f);
+ spawn_default_star(0, 950.0f, -6800.0f);
spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvLllTumblingBridge, 0, 154, -5631, 0, 0,
0);
}
@@ -219,7 +219,7 @@ void bhv_bully_loop(void) {
// death action by colliding with it. Since the bully hitbox is tall enough to collide
// with Mario even when it is under a lava floor, this can get the bully stuck OOB
// if there is nothing under the lava floor.
- BullyCheckMarioCollision();
+ bully_check_mario_collision();
switch (o->oAction) {
case BULLY_ACT_PATROL:
@@ -227,29 +227,29 @@ void bhv_bully_loop(void) {
if (obj_return_home_if_safe(o, o->oHomeX, o->oPosY, o->oHomeZ, 800) == 1) {
o->oAction = BULLY_ACT_CHASE_MARIO;
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
}
- BullyStep();
+ bully_step();
break;
case BULLY_ACT_CHASE_MARIO:
- BullyChaseMarioLoop();
- BullyStep();
+ bully_act_chase_mario();
+ bully_step();
break;
case BULLY_ACT_KNOCKBACK:
- BullyKnockbackLoop();
- BullyStep();
+ bully_act_knockback();
+ bully_step();
break;
case BULLY_ACT_BACK_UP:
- BullyBackUpLoop();
- BullyStep();
+ bully_act_back_up();
+ bully_step();
break;
case BULLY_ACT_LAVA_DEATH:
- BullyLavaDeath();
+ bully_act_level_death();
break;
case BULLY_ACT_DEATH_PLANE_DEATH:
@@ -265,7 +265,7 @@ void bhv_bully_loop(void) {
// sp40 = arg2
// sp44 = arg3
-void BigBullySpawnMinion(s32 arg0, s32 arg1, s32 arg2, s16 arg3) {
+void big_bully_spawn_minion(s32 arg0, s32 arg1, s32 arg2, s16 arg3) {
struct Object *bully =
spawn_object_abs_with_rot(o, 0, MODEL_BULLY, bhvSmallBully, arg0, arg1, arg2, 0, arg3, 00);
bully->oBullySubtype = BULLY_STYPE_MINION;
@@ -273,21 +273,21 @@ void BigBullySpawnMinion(s32 arg0, s32 arg1, s32 arg2, s16 arg3) {
}
void bhv_big_bully_with_minions_init(void) {
- BigBullySpawnMinion(4454, 307, -5426, 0);
- BigBullySpawnMinion(3840, 307, -6041, 0);
- BigBullySpawnMinion(3226, 307, -5426, 0);
+ big_bully_spawn_minion(4454, 307, -5426, 0);
+ big_bully_spawn_minion(3840, 307, -6041, 0);
+ big_bully_spawn_minion(3226, 307, -5426, 0);
o->header.gfx.node.flags |= 0x10; /* bit 4 */
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oAction = BULLY_ACT_INACTIVE;
}
-void BigBullyWithMinionsLavaDeath(void) {
+void big_bully_spawn_star(void) {
if (obj_lava_death() == 1) {
- func_802A3004();
- create_star(3700.0f, 600.0f, -5500.0f);
+ spawn_mist_particles();
+ spawn_default_star(3700.0f, 600.0f, -5500.0f);
}
}
@@ -302,7 +302,7 @@ void bhv_big_bully_with_minions_loop(void) {
o->oBullyPrevY = o->oPosY;
o->oBullyPrevZ = o->oPosZ;
- BullyCheckMarioCollision();
+ bully_check_mario_collision();
switch (o->oAction) {
case BULLY_ACT_PATROL:
@@ -310,25 +310,25 @@ void bhv_big_bully_with_minions_loop(void) {
if (obj_return_home_if_safe(o, o->oHomeX, o->oPosY, o->oHomeZ, 1000) == 1) {
o->oAction = BULLY_ACT_CHASE_MARIO;
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
}
- BullyStep();
+ bully_step();
break;
case BULLY_ACT_CHASE_MARIO:
- BullyChaseMarioLoop();
- BullyStep();
+ bully_act_chase_mario();
+ bully_step();
break;
case BULLY_ACT_KNOCKBACK:
- BullyKnockbackLoop();
- BullyStep();
+ bully_act_knockback();
+ bully_step();
break;
case BULLY_ACT_BACK_UP:
- BullyBackUpLoop();
- BullyStep();
+ bully_act_back_up();
+ bully_step();
break;
case BULLY_ACT_INACTIVE:
@@ -350,17 +350,17 @@ void bhv_big_bully_with_minions_loop(void) {
o->oAction = BULLY_ACT_PATROL;
if (collisionFlags == 1) {
- PlaySound2(SOUND_OBJ_THWOMP);
+ cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
- func_802A3004();
+ spawn_mist_particles();
}
o->header.gfx.node.flags &= ~0x10; /* bit 4 */
- obj_become_tangible();
+ cur_obj_become_tangible();
break;
case BULLY_ACT_LAVA_DEATH:
- BigBullyWithMinionsLavaDeath();
+ big_bully_spawn_star();
break;
case BULLY_ACT_DEATH_PLANE_DEATH:
diff --git a/src/game/behaviors/butterfly.inc.c b/src/game/behaviors/butterfly.inc.c
@@ -1,7 +1,7 @@
// butterfly.c.inc
void bhv_butterfly_init(void) {
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
o->oButterflyYPhase = RandomFloat() * 100.0f;
o->header.gfx.unk38.animFrame = RandomFloat() * 7.0f;
@@ -12,7 +12,7 @@ void bhv_butterfly_init(void) {
// sp28 = speed
-void ButterflyStep(s32 speed) {
+void butterfly_step(s32 speed) {
struct FloorGeometry *sp24;
s16 yaw = o->oMoveAngleYaw;
s16 pitch = o->oMoveAnglePitch;
@@ -41,7 +41,7 @@ void ButterflyStep(s32 speed) {
o->oButterflyYPhase = 0;
}
-void CalculateButterflyAngle(void) {
+void butterfly_calculate_angle(void) {
gMarioObject->oPosX += 5 * o->oButterflyYPhase / 4;
gMarioObject->oPosZ += 5 * o->oButterflyYPhase / 4;
obj_turn_toward_object(o, gMarioObject, 16, 0x300);
@@ -53,25 +53,25 @@ void CalculateButterflyAngle(void) {
gMarioObject->oPosY -= (5 * o->oButterflyYPhase + 0x100) / 4;
}
-void ButterflyRestingLoop(void) {
+void butterfly_act_rest(void) {
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1000)) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oAction = BUTTERFLY_ACT_FOLLOW_MARIO;
o->oMoveAngleYaw = gMarioObject->header.gfx.angle[1];
}
}
-void ButterflyFollowMarioLoop(void) {
- CalculateButterflyAngle();
+void butterfly_act_follow_mario(void) {
+ butterfly_calculate_angle();
- ButterflyStep(7);
+ butterfly_step(7);
if (!is_point_within_radius_of_mario(o->oHomeX, o->oHomeY, o->oHomeZ, 1200))
o->oAction = BUTTERFLY_ACT_RETURN_HOME;
}
-void ButterflyReturnHomeLoop(void) {
+void butterfly_act_return_home(void) {
f32 homeDistX = o->oHomeX - o->oPosX;
f32 homeDistY = o->oHomeY - o->oPosY;
f32 homeDistZ = o->oHomeZ - o->oPosZ;
@@ -81,10 +81,10 @@ void ButterflyReturnHomeLoop(void) {
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, hAngleToHome, 0x800);
o->oMoveAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, vAngleToHome, 0x50);
- ButterflyStep(7);
+ butterfly_step(7);
if (homeDistX * homeDistX + homeDistY * homeDistY + homeDistZ * homeDistZ < 144.0f) {
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
o->oAction = BUTTERFLY_ACT_RESTING;
o->oPosX = o->oHomeX;
@@ -96,15 +96,15 @@ void ButterflyReturnHomeLoop(void) {
void bhv_butterfly_loop(void) {
switch (o->oAction) {
case BUTTERFLY_ACT_RESTING:
- ButterflyRestingLoop();
+ butterfly_act_rest();
break;
case BUTTERFLY_ACT_FOLLOW_MARIO:
- ButterflyFollowMarioLoop();
+ butterfly_act_follow_mario();
break;
case BUTTERFLY_ACT_RETURN_HOME:
- ButterflyReturnHomeLoop();
+ butterfly_act_return_home();
break;
}
diff --git a/src/game/behaviors/camera_lakitu.inc.c b/src/game/behaviors/camera_lakitu.inc.c
@@ -14,7 +14,7 @@ void bhv_camera_lakitu_init(void) {
if (o->oBehParams2ndByte != CAMERA_LAKITU_BP_FOLLOW_CAMERA) {
// Despawn unless this is the very beginning of the game
if (gShouldNotPlayCastleMusic != TRUE) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
} else {
spawn_object_relative_with_scale(CLOUD_BP_LAKITU_CLOUD, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud);
@@ -64,7 +64,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
s16 targetMovePitch;
s16 targetMoveYaw;
- PlaySound(SOUND_AIR_LAKITU_FLY);
+ cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY);
// Face toward mario
o->oFaceAnglePitch = obj_turn_pitch_toward_mario(120.0f, 0);
@@ -74,7 +74,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
if (o->oCameraLakituFinishedDialog) {
approach_f32_ptr(&o->oCameraLakituSpeed, 60.0f, 3.0f);
if (o->oDistanceToMario > 6000.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
targetMovePitch = -0x3000;
@@ -115,7 +115,7 @@ static void camera_lakitu_intro_act_show_dialog(void) {
}
}
}
- } else if (obj_update_dialog_with_cutscene(2, DIALOG_UNK2_FLAG_0, CUTSCENE_DIALOG, DIALOG_034) != 0) {
+ } else if (cur_obj_update_dialog_with_cutscene(2, DIALOG_UNK2_FLAG_0, CUTSCENE_DIALOG, DIALOG_034) != 0) {
o->oCameraLakituFinishedDialog = TRUE;
}
}
@@ -124,11 +124,11 @@ static void camera_lakitu_intro_act_show_dialog(void) {
obj_move_pitch_approach(targetMovePitch, o->oCameraLakituPitchVel);
o->oCameraLakituYawVel = approach_s16_symmetric(o->oCameraLakituYawVel, 0x7D0, 0x64);
- obj_rotate_yaw_toward(targetMoveYaw, o->oCameraLakituYawVel);
+ cur_obj_rotate_yaw_toward(targetMoveYaw, o->oCameraLakituYawVel);
// vel y is explicitly computed, so gravity doesn't apply
obj_compute_vel_from_move_pitch(o->oCameraLakituSpeed);
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
/**
@@ -153,9 +153,9 @@ void bhv_camera_lakitu_update(void) {
} else {
f32 val0C = (f32) 0x875C3D / 0x800 - gLakituState.curPos[0];
if (gLakituState.curPos[0] < 1700.0f || val0C < 0.0f) {
- obj_hide();
+ cur_obj_hide();
} else {
- obj_unhide();
+ cur_obj_unhide();
o->oPosX = gLakituState.curPos[0];
o->oPosY = gLakituState.curPos[1];
@@ -164,8 +164,8 @@ void bhv_camera_lakitu_update(void) {
o->oHomeX = gLakituState.curFocus[0];
o->oHomeZ = gLakituState.curFocus[2];
- o->oFaceAngleYaw = -obj_angle_to_home();
- o->oFaceAnglePitch = atan2s(obj_lateral_dist_to_home(),
+ o->oFaceAngleYaw = -cur_obj_angle_to_home();
+ o->oFaceAnglePitch = atan2s(cur_obj_lateral_dist_to_home(),
o->oPosY - gLakituState.curFocus[1]);
o->oPosX = (f32) 0x875C3D / 0x800 + val0C;
diff --git a/src/game/behaviors/cannon.inc.c b/src/game/behaviors/cannon.inc.c
@@ -4,7 +4,7 @@ void bhv_cannon_base_unused_loop(void) {
o->oPosY += o->oVelY;
}
-void ActionOpenedCannon0(void) {
+void opened_cannon_act_0(void) {
if (o->oTimer == 0) {
o->oInteractStatus = 0;
o->oPosX = o->oHomeX;
@@ -14,12 +14,12 @@ void ActionOpenedCannon0(void) {
o->oMoveAngleYaw = (s16)(o->oBehParams2ndByte << 8);
o->oCannonUnkF4 = 0;
o->oCannonUnk10C = 0;
- obj_enable_rendering();
- obj_become_tangible();
+ cur_obj_enable_rendering();
+ cur_obj_become_tangible();
}
if (o->oDistanceToMario < 500.0f) {
- obj_become_tangible();
- obj_enable_rendering();
+ cur_obj_become_tangible();
+ cur_obj_enable_rendering();
if (o->oInteractStatus & INT_STATUS_INTERACTED
&& (!(o->oInteractStatus
& INT_STATUS_TOUCHED_BOB_OMB))) // bob-omb explodes when it gets into a cannon
@@ -30,15 +30,15 @@ void ActionOpenedCannon0(void) {
} else
o->oInteractStatus = 0;
} else {
- obj_become_intangible();
- obj_disable_rendering();
+ cur_obj_become_intangible();
+ cur_obj_disable_rendering();
o->oCannonUnk10C = 0;
}
}
-void ActionOpenedCannon4(void) {
+void opened_cannon_act_4(void) {
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_CANNON1);
+ cur_obj_play_sound_2(SOUND_OBJ_CANNON1);
o->oPosY += 5.0f;
o->oPosX += (f32)((o->oTimer / 2 & 1) - 0.5) * 2;
o->oPosZ += (f32)((o->oTimer / 2 & 1) - 0.5) * 2;
@@ -49,9 +49,9 @@ void ActionOpenedCannon4(void) {
}
}
-void ActionOpenedCannon6(void) {
+void opened_cannon_act_6(void) {
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_CANNON2);
+ cur_obj_play_sound_2(SOUND_OBJ_CANNON2);
if (o->oTimer < 4) {
o->oPosX += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f;
o->oPosZ += (f32)((o->oTimer / 2 & 1) - 0.5) * 4.0f;
@@ -71,9 +71,9 @@ void ActionOpenedCannon6(void) {
}
}
-void ActionOpenedCannon5(void) {
+void opened_cannon_act_5(void) {
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_CANNON3);
+ cur_obj_play_sound_2(SOUND_OBJ_CANNON3);
if (o->oTimer < 4) {
} else {
if (o->oTimer < 20) {
@@ -85,34 +85,34 @@ void ActionOpenedCannon5(void) {
}
}
-void ActionOpenedCannon1(void) {
+void opened_cannon_act_1(void) {
UNUSED s32 unused;
- obj_become_intangible();
- obj_disable_rendering();
+ cur_obj_become_intangible();
+ cur_obj_disable_rendering();
o->oCannonUnk10C = 0;
gMarioShotFromCannon = 1;
}
-void ActionOpenedCannon2(void) {
+void opened_cannon_act_2(void) {
o->oAction = 3;
}
-void ActionOpenedCannon3(void) {
+void opened_cannon_act_3(void) {
UNUSED s32 unused;
if (o->oTimer > 3)
o->oAction = 0;
}
-void (*sOpenedCannonActions[])(void) = { ActionOpenedCannon0, ActionOpenedCannon1, ActionOpenedCannon2,
- ActionOpenedCannon3, ActionOpenedCannon4, ActionOpenedCannon5,
- ActionOpenedCannon6 };
+void (*sOpenedCannonActions[])(void) = { opened_cannon_act_0, opened_cannon_act_1, opened_cannon_act_2,
+ opened_cannon_act_3, opened_cannon_act_4, opened_cannon_act_5,
+ opened_cannon_act_6 };
u8 unused0EA1FC[] = { 2, 0, 0, 0, 0, 0, 0, 0, 63, 128, 0, 0, 2, 0, 0, 0, 65, 32, 0, 0,
63, 128, 0, 0, 2, 0, 0, 0, 65, 160, 0, 0, 63, 128, 0, 0, 2, 0, 0, 0,
65, 160, 0, 0, 63, 128, 0, 0, 8, 0, 0, 0, 65, 32, 0, 0, 63, 128, 0, 0 };
void bhv_cannon_base_loop(void) {
- obj_call_action_function(sOpenedCannonActions);
+ cur_obj_call_action_function(sOpenedCannonActions);
if (o->oCannonUnkF8)
o->oCannonUnkF8++;
o->oInteractStatus = 0;
@@ -121,10 +121,10 @@ void bhv_cannon_base_loop(void) {
void bhv_cannon_barrel_loop(void) {
struct Object *parent = o->parentObj;
if (parent->header.gfx.node.flags & GRAPH_RENDER_ACTIVE) {
- obj_enable_rendering();
- copy_object_pos(o, o->parentObj);
+ cur_obj_enable_rendering();
+ obj_copy_pos(o, o->parentObj);
o->oMoveAngleYaw = o->parentObj->oMoveAngleYaw;
o->oFaceAnglePitch = o->parentObj->oMoveAnglePitch;
} else
- obj_disable_rendering();
+ cur_obj_disable_rendering();
}
diff --git a/src/game/behaviors/cannon_door.inc.c b/src/game/behaviors/cannon_door.inc.c
@@ -16,9 +16,9 @@ void bhv_cannon_closed_init(void) {
}
}
-void CannonTrapDoorOpeningLoop(void) {
+void cannon_door_act_opening(void) {
if (o->oTimer == 0)
- PlaySound2(SOUND_GENERAL_CANNON_UP);
+ cur_obj_play_sound_2(SOUND_GENERAL_CANNON_UP);
if (o->oTimer < 30) {
o->oVelY = -0.5f;
@@ -55,7 +55,7 @@ void bhv_cannon_closed_loop(void) {
break;
case CANNON_TRAP_DOOR_ACT_OPENING:
- CannonTrapDoorOpeningLoop();
+ cannon_door_act_opening();
break;
}
}
diff --git a/src/game/behaviors/cap.inc.c b/src/game/behaviors/cap.inc.c
@@ -12,8 +12,8 @@ static struct ObjectHitbox sCapHitbox = {
/* hurtboxHeight: */ 90,
};
-s32 func_802F0904(void) {
- set_object_hitbox(o, &sCapHitbox);
+s32 cap_set_hitbox(void) {
+ obj_set_hitbox(o, &sCapHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
o->activeFlags = 0;
o->oInteractStatus = 0;
@@ -23,13 +23,13 @@ s32 func_802F0904(void) {
return 0;
}
-void func_802F0978(void) {
+void cap_despawn(void) {
if (o->oTimer > 300) {
obj_flicker_and_disappear(o, 300);
}
}
-void func_802F09C0(void) {
+void cap_check_quicksand(void) {
if (sObjFloor == NULL)
return;
@@ -74,7 +74,7 @@ void func_802F09C0(void) {
}
}
-void func_802F0B68(void) {
+void cap_sink_quicksand(void) {
switch (o->oAction) {
case 10:
if (o->oTimer < 10) {
@@ -106,7 +106,7 @@ void func_802F0B68(void) {
break;
}
- func_802F09C0();
+ cap_check_quicksand();
}
void bhv_wing_cap_init(void) {
@@ -116,7 +116,7 @@ void bhv_wing_cap_init(void) {
o->oOpacity = 255;
}
-void func_802F0D70(void) {
+void cap_scale_vertically(void) {
o->oCapUnkF8 += 0x2000;
o->header.gfx.scale[1] = coss(o->oCapUnkF8) * 0.3 + 0.7;
if (o->oCapUnkF8 == 0x10000) {
@@ -125,13 +125,13 @@ void func_802F0D70(void) {
}
}
-void func_802F0E0C(void) {
+void wing_vanish_cap_act_0(void) {
s16 sp1E;
o->oFaceAngleYaw += o->oForwardVel * 128.0f;
sp1E = object_step();
if (sp1E & 0x01) {
- func_802F09C0();
+ cap_check_quicksand();
if (o->oVelY != 0.0f) {
o->oCapUnkF4 = 1;
o->oVelY = 0.0f;
@@ -139,26 +139,26 @@ void func_802F0E0C(void) {
}
if (o->oCapUnkF4 == 1)
- func_802F0D70();
+ cap_scale_vertically();
}
void bhv_wing_vanish_cap_loop(void) {
switch (o->oAction) {
case 0:
- func_802F0E0C();
+ wing_vanish_cap_act_0();
break;
default:
object_step();
- func_802F0B68();
+ cap_sink_quicksand();
break;
}
if (o->oTimer > 20)
- obj_become_tangible();
+ cur_obj_become_tangible();
- func_802F0978();
- func_802F0904();
+ cap_despawn();
+ cap_set_hitbox();
}
void bhv_metal_cap_init(void) {
@@ -168,32 +168,32 @@ void bhv_metal_cap_init(void) {
o->oOpacity = 0xFF;
}
-void func_802F0FE0(void) {
+void metal_cap_act_0(void) {
s16 sp1E;
o->oFaceAngleYaw += o->oForwardVel * 128.0f;
sp1E = object_step();
if (sp1E & 0x01)
- func_802F09C0();
+ cap_check_quicksand();
}
void bhv_metal_cap_loop(void) {
switch (o->oAction) {
case 0:
- func_802F0FE0();
+ metal_cap_act_0();
break;
default:
object_step();
- func_802F0B68();
+ cap_sink_quicksand();
break;
}
if (o->oTimer > 20)
- obj_become_tangible();
+ cur_obj_become_tangible();
- func_802F0904();
- func_802F0978();
+ cap_set_hitbox();
+ cap_despawn();
}
void bhv_normal_cap_init(void) {
@@ -205,7 +205,7 @@ void bhv_normal_cap_init(void) {
save_file_set_cap_pos(o->oPosX, o->oPosY, o->oPosZ);
}
-void func_802F1190(void) {
+void normal_cap_set_save_flags(void) {
save_file_clear_flags(SAVE_FLAG_CAP_ON_GROUND);
switch (gCurrCourseNum) {
@@ -227,14 +227,14 @@ void func_802F1190(void) {
}
}
-void func_802F1234(void) {
+void normal_cap_act_0(void) {
s16 sp1E;
o->oFaceAngleYaw += o->oForwardVel * 128.0f;
o->oFaceAnglePitch += o->oForwardVel * 80.0f;
sp1E = object_step();
if (sp1E & 0x01) {
- func_802F09C0();
+ cap_check_quicksand();
if (o->oVelY != 0.0f) {
o->oCapUnkF4 = 1;
@@ -244,18 +244,18 @@ void func_802F1234(void) {
}
if (o->oCapUnkF4 == 1)
- func_802F0D70();
+ cap_scale_vertically();
}
void bhv_normal_cap_loop(void) {
switch (o->oAction) {
case 0:
- func_802F1234();
+ normal_cap_act_0();
break;
default:
object_step();
- func_802F0B68();
+ cap_sink_quicksand();
break;
}
@@ -263,9 +263,9 @@ void bhv_normal_cap_loop(void) {
save_file_set_cap_pos(o->oPosX, o->oPosY, o->oPosZ);
if (o->activeFlags == 0)
- func_802F1190();
+ normal_cap_set_save_flags();
- if (func_802F0904() == 1)
+ if (cap_set_hitbox() == 1)
save_file_clear_flags(SAVE_FLAG_CAP_ON_GROUND);
}
diff --git a/src/game/behaviors/capswitch.inc.c b/src/game/behaviors/capswitch.inc.c
@@ -1,8 +1,8 @@
// capswitch.c.inc
-void ActionActivateCapSwitch0(void) {
+void cap_switch_act_0(void) {
o->oAnimState = o->oBehParams2ndByte;
- obj_scale(0.5f);
+ cur_obj_scale(0.5f);
o->oPosY += 71.0f;
spawn_object_relative_with_scale(0, 0, -71, 0, 0.5f, o, MODEL_CAP_SWITCH_BASE, bhvCapSwitchBase);
if (gCurrLevelNum != LEVEL_UNKNOWN_32) {
@@ -15,51 +15,36 @@ void ActionActivateCapSwitch0(void) {
o->oAction = 1;
}
-void ActionActivateCapSwitch1(void) {
- if (obj_is_mario_on_platform()) {
+void cap_switch_act_1(void) {
+ if (cur_obj_is_mario_on_platform()) {
save_file_set_flags(D_8032F0C0[o->oBehParams2ndByte]);
o->oAction = 2;
- PlaySound2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);
+ cur_obj_play_sound_2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);
}
}
-void ActionActivateCapSwitch2(void) {
+void cap_switch_act_2(void) {
s32 sp1C;
if (o->oTimer < 5) {
- func_802A3398(2, 4, 0.5f, 0.1f);
+ cur_obj_scale_over_time(2, 4, 0.5f, 0.1f);
if (o->oTimer == 4) {
- ShakeScreen(SHAKE_POS_SMALL);
- func_802A3004();
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ spawn_mist_particles();
spawn_triangle_break_particles(60, 139, 0.3f, o->oBehParams2ndByte);
}
} else {
- sp1C = obj_update_dialog_with_cutscene(1, 0x0C, CUTSCENE_CAP_SWITCH_PRESS, 0);
+ sp1C = cur_obj_update_dialog_with_cutscene(1, 0x0C, CUTSCENE_CAP_SWITCH_PRESS, 0);
if (sp1C)
o->oAction = 3;
}
}
-void ActionActivateCapSwitch3() {
+void cap_switch_act_3() {
} // dead function
-void (*sCapSwitchActions[])(void) = { ActionActivateCapSwitch0, ActionActivateCapSwitch1,
- ActionActivateCapSwitch2, ActionActivateCapSwitch3 };
+void (*sCapSwitchActions[])(void) = { cap_switch_act_0, cap_switch_act_1,
+ cap_switch_act_2, cap_switch_act_3 };
void bhv_cap_switch_loop(void) {
- obj_call_action_function(sCapSwitchActions);
-}
-
-Gfx *Geo18_802A719C(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
- Mat4 sp20;
- struct Object *sp1C;
-
- if (run == TRUE) {
- sp1C = (struct Object *) gCurGraphNodeObject;
- if (sp1C->prevObj != NULL) {
- func_8029D704(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
- func_8029D558(sp20, sp1C->prevObj);
- func_8029EA0C(sp1C->prevObj);
- }
- }
- return NULL;
+ cur_obj_call_action_function(sCapSwitchActions);
}
diff --git a/src/game/behaviors/castle_floor_trap.inc.c b/src/game/behaviors/castle_floor_trap.inc.c
@@ -26,7 +26,7 @@ void bhv_castle_floor_trap_open_detect(void) {
void bhv_castle_floor_trap_open(void) {
if (o->oTimer == 0)
- PlaySound2(SOUND_GENERAL_CASTLE_TRAP_OPEN);
+ cur_obj_play_sound_2(SOUND_GENERAL_CASTLE_TRAP_OPEN);
o->oAngleVelRoll -= 0x100;
o->oFaceAngleRoll += o->oAngleVelRoll;
if (o->oFaceAngleRoll < -0x4000) {
diff --git a/src/game/behaviors/celebration_star.inc.c b/src/game/behaviors/celebration_star.inc.c
@@ -11,24 +11,24 @@ void bhv_celebration_star_init(void) {
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_BOWSER_KEY];
o->oFaceAnglePitch = 0;
o->oFaceAngleRoll = 49152;
- obj_scale(0.1f);
+ cur_obj_scale(0.1f);
o->oCelebStarUnkF4 = 1;
} else {
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
o->oFaceAnglePitch = 0;
o->oFaceAngleRoll = 0;
- obj_scale(0.4f);
+ cur_obj_scale(0.4f);
o->oCelebStarUnkF4 = 0;
}
#else
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
- obj_scale(0.4f);
+ cur_obj_scale(0.4f);
o->oFaceAnglePitch = 0;
o->oFaceAngleRoll = 0;
#endif
}
-void CelebrationStarSpinAroundMarioLoop(void) {
+void celeb_star_act_spin_around_mario(void) {
o->oPosX = o->oHomeX + sins(o->oMoveAngleYaw) * (f32)(o->oCelebStarDiameterOfRotation / 2);
o->oPosZ = o->oHomeZ + coss(o->oMoveAngleYaw) * (f32)(o->oCelebStarDiameterOfRotation / 2);
o->oPosY += 5.0f;
@@ -44,17 +44,17 @@ void CelebrationStarSpinAroundMarioLoop(void) {
o->oCelebStarDiameterOfRotation -= 20;
}
-void CelebrationStarFaceCameraLoop(void) {
+void celeb_star_act_face_camera(void) {
if (o->oTimer < 10) {
#if BUGFIX_STAR_BOWSER_KEY
if (o->oCelebStarUnkF4 == 0) {
- obj_scale((f32) o->oTimer / 10.0);
+ cur_obj_scale((f32) o->oTimer / 10.0);
} else {
- obj_scale((f32) o->oTimer / 30.0);
+ cur_obj_scale((f32) o->oTimer / 30.0);
}
#else
- obj_scale((f32) o->oTimer / 10.0);
+ cur_obj_scale((f32) o->oTimer / 10.0);
#endif
o->oFaceAngleYaw += 0x1000;
} else {
@@ -68,11 +68,11 @@ void CelebrationStarFaceCameraLoop(void) {
void bhv_celebration_star_loop(void) {
switch (o->oAction) {
case CELEB_STAR_ACT_SPIN_AROUND_MARIO:
- CelebrationStarSpinAroundMarioLoop();
+ celeb_star_act_spin_around_mario();
break;
case CELEB_STAR_ACT_FACE_CAMERA:
- CelebrationStarFaceCameraLoop();
+ celeb_star_act_face_camera();
break;
}
}
@@ -85,6 +85,6 @@ void bhv_celebration_star_sparkle_loop(void) {
}
void bhv_star_key_collection_puff_spawner_loop(void) {
- func_802AA618(0, 10, 30.0f);
+ spawn_mist_particles_variable(0, 10, 30.0f);
o->activeFlags = 0;
}
diff --git a/src/game/behaviors/chain_chomp.inc.c b/src/game/behaviors/chain_chomp.inc.c
@@ -31,7 +31,7 @@ void bhv_chain_chomp_chain_part_update(void) {
struct ChainSegment *segment;
if (o->parentObj->oAction == CHAIN_CHOMP_ACT_UNLOAD_CHAIN) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else if (o->oBehParams2ndByte != CHAIN_CHOMP_CHAIN_PART_BP_PIVOT) {
segment = &o->parentObj->oChainChompSegments[o->oBehParams2ndByte];
@@ -41,8 +41,8 @@ void bhv_chain_chomp_chain_part_update(void) {
o->oPosZ = o->parentObj->parentObj->oPosZ + segment->posZ;
;
} else if (o->parentObj->oChainChompReleaseStatus != CHAIN_CHOMP_NOT_RELEASED) {
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
}
}
@@ -65,7 +65,7 @@ static void chain_chomp_act_uninitialized(void) {
chain_segment_init(&segments[i]);
}
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
// Spawn the pivot and set to parent
if ((o->parentObj =
@@ -78,7 +78,7 @@ static void chain_chomp_act_uninitialized(void) {
}
o->oAction = CHAIN_CHOMP_ACT_MOVE;
- obj_unhide();
+ cur_obj_unhide();
}
}
}
@@ -174,15 +174,15 @@ static void chain_chomp_sub_act_turn(void) {
obj_move_pitch_approach(0, 0x100);
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
if (abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x800) {
if (o->oTimer > 30) {
- if (obj_check_anim_frame(0)) {
- func_8029F6F0();
+ if (cur_obj_check_anim_frame(0)) {
+ cur_obj_reverse_animation();
if (o->oTimer > 40) {
// Increase the maximum distance from the pivot and enter
// the lunging sub-action.
- PlaySound2(SOUND_GENERAL_CHAIN_CHOMP2);
+ cur_obj_play_sound_2(SOUND_GENERAL_CHAIN_CHOMP2);
o->oSubAction = CHAIN_CHOMP_SUB_ACT_LUNGE;
o->oChainChompMaxDistFromPivotPerChainPart = 900.0f / 5;
@@ -199,12 +199,12 @@ static void chain_chomp_sub_act_turn(void) {
o->oForwardVel = 0.0f;
}
} else {
- PlaySound2(SOUND_GENERAL_CHAIN_CHOMP1);
+ cur_obj_play_sound_2(SOUND_GENERAL_CHAIN_CHOMP1);
o->oForwardVel = 10.0f;
o->oVelY = 20.0f;
}
} else {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x190);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x190);
o->oTimer = 0;
}
}
@@ -231,7 +231,7 @@ static void chain_chomp_sub_act_lunge(void) {
;
} else {
// Turn toward pivot
- obj_rotate_yaw_toward(atan2s(o->oChainChompSegments[0].posZ, o->oChainChompSegments[0].posX),
+ cur_obj_rotate_yaw_toward(atan2s(o->oChainChompSegments[0].posZ, o->oChainChompSegments[0].posX),
0x1000);
if (o->oChainChompUnk104 != 0.0f) {
@@ -247,7 +247,7 @@ static void chain_chomp_sub_act_lunge(void) {
}
if (o->oTimer < 30) {
- func_8029F6F0();
+ cur_obj_reverse_animation();
}
}
@@ -278,7 +278,7 @@ static void chain_chomp_released_lunge_around(void) {
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
// Before first bounce, turn toward mario and wait 2 seconds
if (o->oChainChompNumLunges == 0) {
- if (obj_rotate_yaw_toward(o->oAngleToMario, 0x320)) {
+ if (cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x320)) {
if (o->oTimer > 60) {
o->oChainChompNumLunges += 1;
// enable wall collision
@@ -289,7 +289,7 @@ static void chain_chomp_released_lunge_around(void) {
}
} else {
if (++o->oChainChompNumLunges <= 5) {
- PlaySound2(SOUND_GENERAL_CHAIN_CHOMP1);
+ cur_obj_play_sound_2(SOUND_GENERAL_CHAIN_CHOMP1);
o->oMoveAngleYaw = o->oAngleToMario + RandomSign() * 0x2000;
o->oForwardVel = 30.0f;
o->oVelY = 50.0f;
@@ -297,8 +297,8 @@ static void chain_chomp_released_lunge_around(void) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_BREAK_GATE;
o->oHomeX = 1450.0f;
o->oHomeZ = 562.0f;
- o->oMoveAngleYaw = obj_angle_to_home();
- o->oForwardVel = obj_lateral_dist_to_home() / 8;
+ o->oMoveAngleYaw = cur_obj_angle_to_home();
+ o->oForwardVel = cur_obj_lateral_dist_to_home() / 8;
o->oVelY = 50.0f;
}
}
@@ -318,15 +318,15 @@ static void chain_chomp_released_break_gate(void) {
// in a softlock
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
o->oChainChompHitGate = TRUE;
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
o->oForwardVel *= 0.4f;
}
} else if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_JUMP_AWAY;
o->oHomeX = 3288.0f;
o->oHomeZ = -1770.0f;
- o->oMoveAngleYaw = obj_angle_to_home();
- o->oForwardVel = obj_lateral_dist_to_home() / 50.0f;
+ o->oMoveAngleYaw = cur_obj_angle_to_home();
+ o->oForwardVel = cur_obj_lateral_dist_to_home() / 50.0f;
o->oVelY = 120.0f;
}
}
@@ -363,7 +363,7 @@ static void chain_chomp_act_move(void) {
o->oAction = CHAIN_CHOMP_ACT_UNLOAD_CHAIN;
o->oForwardVel = o->oVelY = 0.0f;
} else {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oChainChompReleaseStatus) {
case CHAIN_CHOMP_NOT_RELEASED:
@@ -393,7 +393,7 @@ static void chain_chomp_act_move(void) {
break;
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
// Segment 0 connects the pivot to the chain chomp itself
o->oChainChompSegments[0].posX = o->oPosX - o->parentObj->oPosX;
@@ -454,13 +454,13 @@ static void chain_chomp_act_move(void) {
* themselves when they see that the chain chomp is in this action.
*/
static void chain_chomp_act_unload_chain(void) {
- obj_hide();
+ cur_obj_hide();
mem_pool_free(gObjectMemoryPool, o->oChainChompSegments);
o->oAction = CHAIN_CHOMP_ACT_UNINITIALIZED;
if (o->oChainChompReleaseStatus != CHAIN_CHOMP_NOT_RELEASED) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
@@ -487,13 +487,13 @@ void bhv_chain_chomp_update(void) {
void bhv_wooden_post_update(void) {
// When ground pounded by mario, drop by -45 + -20
if (!o->oWoodenPostMarioPounding) {
- if ((o->oWoodenPostMarioPounding = obj_is_mario_ground_pounding_platform())) {
- PlaySound2(SOUND_GENERAL_POUND_WOOD_POST);
+ if ((o->oWoodenPostMarioPounding = cur_obj_is_mario_ground_pounding_platform())) {
+ cur_obj_play_sound_2(SOUND_GENERAL_POUND_WOOD_POST);
o->oWoodenPostSpeedY = -70.0f;
}
} else if (approach_f32_ptr(&o->oWoodenPostSpeedY, 0.0f, 25.0f)) {
// Stay still until mario is done ground pounding
- o->oWoodenPostMarioPounding = obj_is_mario_ground_pounding_platform();
+ o->oWoodenPostMarioPounding = cur_obj_is_mario_ground_pounding_platform();
} else if ((o->oWoodenPostOffsetY += o->oWoodenPostSpeedY) < -190.0f) {
// Once pounded, if this is the chain chomp's post, release the chain
// chomp
@@ -516,7 +516,7 @@ void bhv_wooden_post_update(void) {
// coins
o->oWoodenPostTotalMarioAngle += (s16)(o->oAngleToMario - o->oWoodenPostPrevAngleToMario);
if (absi(o->oWoodenPostTotalMarioAngle) > 0x30000 && o->oTimer < 200) {
- spawn_object_loot_yellow_coins(o, 5, 20.0f);
+ obj_spawn_loot_yellow_coins(o, 5, 20.0f);
set_object_respawn_info_bits(o, 1);
}
}
@@ -529,7 +529,7 @@ void bhv_wooden_post_update(void) {
* Init function for chain chomp gate.
*/
void bhv_chain_chomp_gate_init(void) {
- o->parentObj = obj_nearest_object_with_behavior(bhvChainChomp);
+ o->parentObj = cur_obj_nearest_object_with_behavior(bhvChainChomp);
}
/**
@@ -537,10 +537,10 @@ void bhv_chain_chomp_gate_init(void) {
*/
void bhv_chain_chomp_gate_update(void) {
if (o->parentObj->oChainChompHitGate) {
- func_802A3034(SOUND_GENERAL_WALL_EXPLOSION);
+ spawn_mist_particles_with_sound(SOUND_GENERAL_WALL_EXPLOSION);
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
- func_802AA618(0, 0x7F, 200.0f);
+ spawn_mist_particles_variable(0, 0x7F, 200.0f);
spawn_triangle_break_particles(30, 0x8A, 3.0f, 4);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
diff --git a/src/game/behaviors/checkerboard_platform.inc.c b/src/game/behaviors/checkerboard_platform.inc.c
@@ -3,12 +3,6 @@
struct Struct8032F754 D_8032F754[] = { { 145, { 0.7f, 1.5f, 0.7f }, 7.0f },
{ 235, { 1.2f, 2.0f, 1.2f }, 11.6f } };
-void func_802B8F7C(Vec3f dest, Vec3f src) {
- dest[0] = src[0];
- dest[1] = src[1];
- dest[2] = src[2];
-}
-
void bhv_checkerboard_elevator_group_init(void) {
s32 sp3C;
s32 sp38;
@@ -28,11 +22,11 @@ void bhv_checkerboard_elevator_group_init(void) {
sp2C = spawn_object_relative(i, 0, i * sp3C, sp38, o, MODEL_CHECKERBOARD_PLATFORM,
bhvCheckerboardPlatformSub);
sp2C->oCheckerBoardPlatformUnk1AC = D_8032F754[sp34].unk2;
- func_802B8F7C(sp2C->header.gfx.scale, D_8032F754[sp34].unk1);
+ vec3f_copy_2(sp2C->header.gfx.scale, D_8032F754[sp34].unk1);
}
}
-void func_802B9120(UNUSED s32 unused, f32 vel, s32 a2) {
+void checkerboard_plat_act_move_y(UNUSED s32 unused, f32 vel, s32 a2) {
o->oMoveAnglePitch = 0;
o->oAngleVelPitch = 0;
o->oForwardVel = 0.0f;
@@ -41,7 +35,7 @@ void func_802B9120(UNUSED s32 unused, f32 vel, s32 a2) {
o->oAction++;
}
-void func_802B91A0(s32 a0, s16 a1) {
+void checkerboard_plat_act_rotate(s32 a0, s16 a1) {
o->oVelY = 0.0f;
o->oAngleVelPitch = a1;
if (o->oTimer + 1 == 0x8000 / absi(a1))
@@ -57,7 +51,7 @@ void bhv_checkerboard_platform_loop(void) {
f32 sp24 = o->oCheckerBoardPlatformUnk1AC;
o->oCheckerBoardPlatformUnkF8 = 0;
if (o->oDistanceToMario < 1000.0f)
- PlaySound(SOUND_ENV_ELEVATOR4);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4);
switch (o->oAction) {
case 0:
if (o->oBehParams2ndByte == 0)
@@ -66,16 +60,16 @@ void bhv_checkerboard_platform_loop(void) {
o->oAction = 3;
break;
case 1:
- func_802B9120(2, 10.0f, o->oCheckerBoardPlatformUnkFC);
+ checkerboard_plat_act_move_y(2, 10.0f, o->oCheckerBoardPlatformUnkFC);
break;
case 2:
- func_802B91A0(3, 512);
+ checkerboard_plat_act_rotate(3, 512);
break;
case 3:
- func_802B9120(4, -10.0f, o->oCheckerBoardPlatformUnkFC);
+ checkerboard_plat_act_move_y(4, -10.0f, o->oCheckerBoardPlatformUnkFC);
break;
case 4:
- func_802B91A0(1, -512);
+ checkerboard_plat_act_rotate(1, -512);
break;
}
o->oMoveAnglePitch += absi(o->oAngleVelPitch);
@@ -88,8 +82,8 @@ void bhv_checkerboard_platform_loop(void) {
if (o->oCheckerBoardPlatformUnkF8 == 1) {
o->oAngleVelPitch = 0;
o->oFaceAnglePitch &= ~0x7FFF;
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
} else
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
load_object_collision_model();
}
diff --git a/src/game/behaviors/chuckya.inc.c b/src/game/behaviors/chuckya.inc.c
@@ -1,11 +1,11 @@
// chuckya.c.inc
-void func_802A8D18(f32 sp28, f32 sp2C, s32 sp30) {
+void common_anchor_mario_behavior(f32 sp28, f32 sp2C, s32 sp30) {
switch (o->parentObj->oChuckyaUnk88) {
case 0:
break;
case 1:
- func_802A2008(gMarioObject, o);
+ obj_set_gfx_pos_at_obj_pos(gMarioObject, o);
break;
case 2:
gMarioObject->oInteractStatus |= (sp30 + INT_STATUS_MARIO_UNK2);
@@ -23,30 +23,30 @@ void func_802A8D18(f32 sp28, f32 sp2C, s32 sp30) {
}
o->oMoveAngleYaw = o->parentObj->oMoveAngleYaw;
if (!o->parentObj->activeFlags)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_chuckya_anchor_mario_loop(void) {
- func_802A8D18(40.0f, 40.0f, 64);
+ common_anchor_mario_behavior(40.0f, 40.0f, 64);
}
-s32 Unknown802A8EC8(s32 sp20, f32 sp24, f32 sp28, s32 sp2C) {
+s32 unknown_chuckya_function(s32 sp20, f32 sp24, f32 sp28, s32 sp2C) {
s32 sp1C = 0;
if (o->oChuckyaUnkF8 != 4) {
- if (sp24 < obj_lateral_dist_from_mario_to_home()) {
- if (obj_lateral_dist_to_home() < 200.0f)
+ if (sp24 < cur_obj_lateral_dist_from_mario_to_home()) {
+ if (cur_obj_lateral_dist_to_home() < 200.0f)
sp1C = 0;
else {
sp1C = 1;
- o->oAngleToMario = obj_angle_to_home();
+ o->oAngleToMario = cur_obj_angle_to_home();
}
} else if (o->oDistanceToMario > sp28) {
if (gGlobalTimer % (s16) sp2C == 0)
- o->oAngleToMario = angle_to_object(o, gMarioObject);
+ o->oAngleToMario = obj_angle_to_object(o, gMarioObject);
sp1C = 2;
} else
sp1C = 3;
- if (sp20 && func_802C5A64(&o->oAngleToMario)) {
+ if (sp20 && update_angle_from_move_flags(&o->oAngleToMario)) {
sp1C = 4;
o->oChuckyaUnkF8 = 4;
}
@@ -55,7 +55,7 @@ s32 Unknown802A8EC8(s32 sp20, f32 sp24, f32 sp28, s32 sp2C) {
return sp1C;
}
-s32 func_802A9050(f32 *arr, f32 spC, f32 sp10) {
+s32 approach_forward_vel(f32 *arr, f32 spC, f32 sp10) {
s32 sp4 = 0;
if (arr[0] > spC) {
arr[0] -= sp10;
@@ -70,18 +70,18 @@ s32 func_802A9050(f32 *arr, f32 spC, f32 sp10) {
return sp4;
}
-void ActionChuckya0(void) {
+void chuckya_act_0(void) {
s32 sp3C;
UNUSED u8 pad[16];
s32 sp28;
if (o->oTimer == 0)
o->oChuckyaUnkFC = 0;
- o->oAngleToMario = angle_to_object(o, gMarioObject);
+ o->oAngleToMario = obj_angle_to_object(o, gMarioObject);
switch (sp28 = o->oSubAction) {
case 0:
o->oForwardVel = 0;
- if (obj_lateral_dist_from_mario_to_home() < 2000.0f) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ if (cur_obj_lateral_dist_from_mario_to_home() < 2000.0f) {
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
if (o->oChuckyaUnkFC > 40
|| abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < 0x1000)
o->oSubAction = 1;
@@ -89,26 +89,26 @@ void ActionChuckya0(void) {
o->oSubAction = 3;
break;
case 1:
- func_802A9050(&o->oForwardVel, 30.0f, 4.0f);
+ approach_forward_vel(&o->oForwardVel, 30.0f, 4.0f);
if (abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) > 0x4000)
o->oSubAction = 2;
- if (obj_lateral_dist_from_mario_to_home() > 2000.0f)
+ if (cur_obj_lateral_dist_from_mario_to_home() > 2000.0f)
o->oSubAction = 3;
break;
case 2:
- func_802A9050(&o->oForwardVel, 0, 4.0f);
+ approach_forward_vel(&o->oForwardVel, 0, 4.0f);
if (o->oChuckyaUnkFC > 48)
o->oSubAction = 0;
break;
case 3:
- if (obj_lateral_dist_to_home() < 500.0f)
+ if (cur_obj_lateral_dist_to_home() < 500.0f)
o->oForwardVel = 0;
else {
- func_802A9050(&o->oForwardVel, 10.0f, 4.0f);
- o->oAngleToMario = obj_angle_to_home();
- obj_rotate_yaw_toward(o->oAngleToMario, 0x800);
+ approach_forward_vel(&o->oForwardVel, 10.0f, 4.0f);
+ o->oAngleToMario = cur_obj_angle_to_home();
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x800);
}
- if (obj_lateral_dist_from_mario_to_home() < 1900.0f)
+ if (cur_obj_lateral_dist_from_mario_to_home() < 1900.0f)
o->oSubAction = 0;
break;
}
@@ -116,16 +116,16 @@ void ActionChuckya0(void) {
o->oChuckyaUnkFC = 0;
else
o->oChuckyaUnkFC++;
- set_obj_animation_and_sound_state(4);
+ cur_obj_init_animation_with_sound(4);
if (o->oForwardVel > 1.0f)
- PlaySound(SOUND_AIR_CHUCKYA_MOVE);
+ cur_obj_play_sound_1(SOUND_AIR_CHUCKYA_MOVE);
print_debug_bottom_up("fg %d", sp3C);
print_debug_bottom_up("sp %d", o->oForwardVel);
}
-void ActionChuckya1(void) {
+void chuckya_act_1(void) {
if (o->oSubAction == 0) {
- if (func_802A4AB0(0))
+ if (cur_obj_init_animation_and_check_if_near_end(0))
o->oSubAction++;
o->oChuckyaUnkFC = RandomFloat() * 30.0f + 10.0f;
o->oChuckyaUnk100 = 0;
@@ -139,18 +139,18 @@ void ActionChuckya1(void) {
o->oAction = 3;
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
} else {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
o->oMoveAngleYaw += INT_STATUS_GRABBED_MARIO;
if (o->oChuckyaUnkFC-- < 0)
- if (func_802B0C54(50.0f, 150.0f) || o->oChuckyaUnkFC < -16) {
+ if (check_if_moving_over_floor(50.0f, 150.0f) || o->oChuckyaUnkFC < -16) {
o->oSubAction++;
;
}
}
} else {
- set_obj_animation_and_sound_state(3);
- if (obj_check_anim_frame(18)) {
- PlaySound2(SOUND_OBJ_UNKNOWN4);
+ cur_obj_init_animation_with_sound(3);
+ if (cur_obj_check_anim_frame(18)) {
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN4);
o->oChuckyaUnk88 = 2;
o->oAction = 3;
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
@@ -159,50 +159,50 @@ void ActionChuckya1(void) {
}
}
-void ActionChuckya3(void) {
+void chuckya_act_3(void) {
o->oForwardVel = 0;
o->oVelY = 0;
- set_obj_animation_and_sound_state(4);
+ cur_obj_init_animation_with_sound(4);
if (o->oTimer > 100)
o->oAction = 0;
}
-void ActionChuckya2(void) {
+void chuckya_act_2(void) {
if (o->oMoveFlags & (0x200 | 0x40 | 0x20 | 0x10 | 0x8 | 0x1)) {
- mark_object_for_deletion(o);
- spawn_object_loot_yellow_coins(o, 5, 20.0f);
- func_802A3034(SOUND_OBJ_CHUCKYA_DEATH);
+ obj_mark_for_deletion(o);
+ obj_spawn_loot_yellow_coins(o, 5, 20.0f);
+ spawn_mist_particles_with_sound(SOUND_OBJ_CHUCKYA_DEATH);
}
}
-void (*sChuckyaActions[])(void) = { ActionChuckya0, ActionChuckya1, ActionChuckya2, ActionChuckya3 };
+void (*sChuckyaActions[])(void) = { chuckya_act_0, chuckya_act_1, chuckya_act_2, chuckya_act_3 };
-void func_802A97B8(void) {
- obj_update_floor_and_walls();
- obj_call_action_function(sChuckyaActions);
- obj_move_standard(-30);
+void chuckya_move(void) {
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sChuckyaActions);
+ cur_obj_move_standard(-30);
if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) {
o->oAction = 1;
o->oChuckyaUnk88 = 1;
- PlaySound2(SOUND_OBJ_UNKNOWN3);
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN3);
}
}
void bhv_chuckya_loop(void) {
f32 sp2C = 20.0f;
f32 sp28 = 50.0f;
- obj_scale(2.0f);
+ cur_obj_scale(2.0f);
o->oInteractionSubtype |= INT_SUBTYPE_GRABS_MARIO;
switch (o->oHeldState) {
case HELD_FREE:
- func_802A97B8();
+ chuckya_move();
break;
case HELD_HELD:
- func_8029FA5C(2, 0);
+ cur_obj_unrender_and_reset_state(2, 0);
break;
case HELD_THROWN:
case HELD_DROPPED:
- obj_get_thrown_or_placed(sp2C, sp28, 2);
+ cur_obj_get_thrown_or_placed(sp2C, sp28, 2);
break;
}
o->oInteractStatus = 0;
diff --git a/src/game/behaviors/clam.inc.c b/src/game/behaviors/clam.inc.c
@@ -14,18 +14,18 @@ struct ObjectHitbox sClamShellHitbox = {
void clam_act_0(void) {
if (func_802F92EC(0, 25)) {
- PlaySound2(SOUND_GENERAL_CLAM_SHELL3);
- func_802ADA94();
- obj_become_tangible();
+ cur_obj_play_sound_2(SOUND_GENERAL_CLAM_SHELL3);
+ spawn_mist_from_global();
+ cur_obj_become_tangible();
o->oClamUnkF4 = 10;
o->oTimer = 0;
} else if (o->oTimer > 150 && o->oDistanceToMario < 500.0f) {
- PlaySound2(SOUND_GENERAL_CLAM_SHELL2);
+ cur_obj_play_sound_2(SOUND_GENERAL_CLAM_SHELL2);
o->oAction = 1;
} else if (o->oClamUnkF4 != 0) {
o->oClamUnkF4 -= 1;
- obj_shake_y(3.0f);
+ cur_obj_shake_y(3.0f);
}
}
@@ -43,8 +43,8 @@ void clam_act_1(void) {
spawn_object_relative(0, val04, 30, val02, o, MODEL_BUBBLE, bhvBubbleMaybe);
}
- } else if (obj_check_anim_frame(30)) {
- obj_become_intangible();
+ } else if (cur_obj_check_anim_frame(30)) {
+ cur_obj_become_intangible();
}
}
diff --git a/src/game/behaviors/clock_arm.inc.c b/src/game/behaviors/clock_arm.inc.c
@@ -22,7 +22,7 @@ void bhv_rotating_clock_arm_loop(void) {
|| marioSurface->type == SURFACE_TTC_PAINTING_2
|| marioSurface->type == SURFACE_TTC_PAINTING_3)) {
// And this is the minute hand...
- if (obj_has_behavior(bhvClockMinuteHand)) {
+ if (cur_obj_has_behavior(bhvClockMinuteHand)) {
// Set Tick Tick Clock's speed based on the angle of the hand.
// The angle actually counting down from 0xFFFF to 0 so
// 11 o'clock is a small value and 1 o'clock is a large value.
@@ -46,5 +46,5 @@ void bhv_rotating_clock_arm_loop(void) {
// Only rotate the hands until Mario enters the painting.
if (o->oAction < 2)
- obj_rotate_face_angle_using_vel();
+ cur_obj_rotate_face_angle_using_vel();
}
diff --git a/src/game/behaviors/cloud.inc.c b/src/game/behaviors/cloud.inc.c
@@ -34,7 +34,7 @@ static void cloud_act_spawn_parts(void) {
// Spawn fwoosh's face
spawn_object_relative(5, 0, 0, 0, o, MODEL_FWOOSH, bhvCloudPart);
- obj_scale(3.0f);
+ cur_obj_scale(3.0f);
o->oCloudCenterX = o->oPosX;
o->oCloudCenterY = o->oPosY;
@@ -48,7 +48,7 @@ static void cloud_act_spawn_parts(void) {
*/
static void cloud_act_fwoosh_hidden(void) {
if (o->oDistanceToMario < 2000.0f) {
- obj_unhide();
+ cur_obj_unhide();
o->oAction = CLOUD_ACT_SPAWN_PARTS;
}
}
@@ -69,10 +69,10 @@ static void cloud_fwoosh_update(void) {
o->oCloudBlowing = o->oTimer = 0;
} else if (o->oCloudGrowSpeed < -0.1f) {
// Start blowing once we start shrinking faster than -0.1
- PlaySound(SOUND_AIR_BLOW_WIND);
- func_802C76E0(12, 3.0f, 0.0f, -50.0f, 120.0f);
+ cur_obj_play_sound_1(SOUND_AIR_BLOW_WIND);
+ cur_obj_spawn_strong_wind_particles(12, 3.0f, 0.0f, -50.0f, 120.0f);
} else {
- PlaySound(SOUND_ENV_WIND1);
+ cur_obj_play_sound_1(SOUND_ENV_WIND1);
}
} else {
// Return to normal size
@@ -94,7 +94,7 @@ static void cloud_fwoosh_update(void) {
o->oCloudCenterY = o->oHomeY;
}
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
}
}
@@ -141,11 +141,11 @@ static void cloud_act_main(void) {
*/
static void cloud_act_unload(void) {
if (o->oBehParams2ndByte != CLOUD_BP_FWOOSH) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->oAction = CLOUD_ACT_FWOOSH_HIDDEN;
- obj_hide();
- obj_set_pos_to_home();
+ cur_obj_hide();
+ cur_obj_set_pos_to_home();
}
}
@@ -174,7 +174,7 @@ void bhv_cloud_update(void) {
*/
void bhv_cloud_part_update(void) {
if (o->parentObj->oAction == CLOUD_ACT_UNLOAD) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
f32 size = 2.0f / 3.0f * o->parentObj->header.gfx.scale[0];
s16 angleFromCenter = o->parentObj->oFaceAngleYaw + 0x10000 / 5 * o->oBehParams2ndByte;
@@ -185,7 +185,7 @@ void bhv_cloud_part_update(void) {
f32 cloudRadius;
- obj_scale(size);
+ cur_obj_scale(size);
// Cap fwoosh's face size
if (o->oBehParams2ndByte == 5 && size > 2.0f) {
diff --git a/src/game/behaviors/coffin.inc.c b/src/game/behaviors/coffin.inc.c
@@ -76,14 +76,14 @@ void coffin_act_idle(void) {
// If the coffin landed...
if (obj_face_pitch_approach(0, -o->oAngleVelPitch)) {
- PlaySound2(SOUND_GENERAL_ELEVATOR_MOVE_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_ELEVATOR_MOVE_2);
// This bit changes the coffin's position,
// spawns dust there, then resets the position.
obj_perform_position_op(POS_OP_SAVE_POSITION);
o->oMoveAngleYaw = o->oFaceAngleYaw - 0x4000;
obj_set_dist_from_home(200.0f);
- func_802ADA94();
+ spawn_mist_from_global();
obj_perform_position_op(POS_OP_RESTORE_POSITION);
}
@@ -105,7 +105,7 @@ void coffin_act_idle(void) {
&& (o->oDistanceToMario > 100.0f || gMarioState->action == ACT_SQUISHED)) {
if (gMarioObject->oPosY - o->oPosY < 200.0f && absf(distForwards) < 140.0f) {
if (distSideways < 150.0f && distSideways > -450.0f) {
- PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_BUTTON_PRESS_2_LOWPRIO);
o->oAction = COFFIN_ACT_STAND_UP;
}
}
@@ -131,7 +131,7 @@ void coffin_act_stand_up(void) {
o->oFaceAngleRoll = 0;
} else if (o->oTimer > 30) {
if (gGlobalTimer % 4 == 0) {
- PlaySound2(SOUND_GENERAL_ELEVATOR_MOVE_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_ELEVATOR_MOVE_2);
}
// Shake the coffin while its standing
o->oFaceAngleRoll = 400 * (gGlobalTimer % 2) - 200;
@@ -148,7 +148,7 @@ void coffin_act_stand_up(void) {
void bhv_coffin_loop(void) {
// Gotta save those 6 object slots
if (o->parentObj->oAction == COFFIN_SPAWNER_ACT_COFFINS_UNLOADED) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
// Scale the coffin vertically? Must have thought it was too short?
o->header.gfx.scale[1] = 1.1f;
diff --git a/src/game/behaviors/coin.inc.c b/src/game/behaviors/coin.inc.c
@@ -18,7 +18,7 @@ s16 D_8032F2A4[][2] = { { 0, -150 }, { 0, -50 }, { 0, 50 }, { 0, 150 },
s32 bhv_coin_sparkles_init(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED && !(o->oInteractStatus & INTERACT_TEXT)) {
spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
return 1;
}
o->oInteractStatus = 0;
@@ -26,14 +26,14 @@ s32 bhv_coin_sparkles_init(void) {
}
void bhv_yellow_coin_init(void) {
- obj_set_behavior(bhvYellowCoin);
- set_object_hitbox(o, &sYellowCoinHitbox);
+ cur_obj_set_behavior(bhvYellowCoin);
+ obj_set_hitbox(o, &sYellowCoinHitbox);
bhv_init_room();
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (500.0f < absf(o->oPosY - o->oFloorHeight))
- obj_set_model(MODEL_YELLOW_COIN_NO_SHADOW);
+ cur_obj_set_model(MODEL_YELLOW_COIN_NO_SHADOW);
if (o->oFloorHeight < -10000.0f)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_yellow_coin_loop(void) {
@@ -43,8 +43,8 @@ void bhv_yellow_coin_loop(void) {
void bhv_temp_coin_loop(void) {
o->oAnimState++;
- if (obj_wait_then_blink(200, 20))
- mark_object_for_deletion(o);
+ if (cur_obj_wait_then_blink(200, 20))
+ obj_mark_for_deletion(o);
bhv_coin_sparkles_init();
}
@@ -52,17 +52,17 @@ void bhv_coin_init(void) {
o->oVelY = RandomFloat() * 10.0f + 30 + o->oCoinUnk110;
o->oForwardVel = RandomFloat() * 10.0f;
o->oMoveAngleYaw = RandomU16();
- obj_set_behavior(bhvYellowCoin);
- set_object_hitbox(o, &sYellowCoinHitbox);
- obj_become_intangible();
+ cur_obj_set_behavior(bhvYellowCoin);
+ obj_set_hitbox(o, &sYellowCoinHitbox);
+ cur_obj_become_intangible();
}
void bhv_coin_loop(void) {
struct Surface *sp1C;
s16 sp1A;
- obj_update_floor_and_walls();
- obj_if_hit_wall_bounce_away();
- obj_move_standard(-62);
+ cur_obj_update_floor_and_walls();
+ cur_obj_if_hit_wall_bounce_away();
+ cur_obj_move_standard(-62);
if ((sp1C = o->oFloor) != NULL) {
if (o->oMoveFlags & OBJ_MOVE_ON_GROUND)
o->oSubAction = 1;
@@ -70,70 +70,70 @@ void bhv_coin_loop(void) {
o->oBounce = 0;
if (sp1C->normal.y < 0.9) {
sp1A = atan2s(sp1C->normal.z, sp1C->normal.x);
- obj_rotate_yaw_toward(sp1A, 0x400);
+ cur_obj_rotate_yaw_toward(sp1A, 0x400);
}
}
}
if (o->oTimer == 0)
#ifdef VERSION_US
- PlaySound2(SOUND_GENERAL_COIN_SPURT_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT_2);
#elif VERSION_EU
- PlaySound2(SOUND_GENERAL_COIN_SPURT_EU);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT_EU);
#else
- PlaySound2(SOUND_GENERAL_COIN_SPURT);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT);
#endif
if (o->oVelY < 0)
- obj_become_tangible();
+ cur_obj_become_tangible();
if (o->oMoveFlags & OBJ_MOVE_LANDED) {
#ifndef VERSION_JP
if (o->oMoveFlags & (OBJ_MOVE_ABOVE_DEATH_BARRIER | OBJ_MOVE_ABOVE_LAVA))
#else
if (o->oMoveFlags & OBJ_MOVE_ABOVE_LAVA)
#endif
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
#ifndef VERSION_JP
if (o->oMoveFlags & OBJ_MOVE_13) {
if (o->oCoinUnk1B0 < 5)
- PlaySound2(0x30364081);
+ cur_obj_play_sound_2(0x30364081);
o->oCoinUnk1B0++;
}
#else
if (o->oMoveFlags & OBJ_MOVE_13)
- PlaySound2(SOUND_GENERAL_COIN_DROP);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_DROP);
#endif
- if (obj_wait_then_blink(400, 20))
- mark_object_for_deletion(o);
+ if (cur_obj_wait_then_blink(400, 20))
+ obj_mark_for_deletion(o);
bhv_coin_sparkles_init();
}
void bhv_coin_formation_spawn_loop(void) {
if (o->oTimer == 0) {
- obj_set_behavior(bhvYellowCoin);
- set_object_hitbox(o, &sYellowCoinHitbox);
+ cur_obj_set_behavior(bhvYellowCoin);
+ obj_set_hitbox(o, &sYellowCoinHitbox);
bhv_init_room();
if (o->oCoinUnkF8) {
o->oPosY += 300.0f;
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (o->oPosY < o->oFloorHeight || o->oFloorHeight < -10000.0f)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
else
o->oPosY = o->oFloorHeight;
} else {
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (absf(o->oPosY - o->oFloorHeight) > 250.0f)
- obj_set_model(MODEL_YELLOW_COIN_NO_SHADOW);
+ cur_obj_set_model(MODEL_YELLOW_COIN_NO_SHADOW);
}
} else {
if (bhv_coin_sparkles_init())
- o->parentObj->oCoinUnkF4 |= func_802A377C(o->oBehParams2ndByte);
+ o->parentObj->oCoinUnkF4 |= bit_shift_left(o->oBehParams2ndByte);
o->oAnimState++;
}
if (o->parentObj->oAction == 2)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void func_802AB364(s32 sp50, s32 sp54) {
+void spawn_coin_in_formation(s32 sp50, s32 sp54) {
struct Object *sp4C;
Vec3i sp40;
s32 sp3C = 1;
@@ -187,7 +187,7 @@ void bhv_coin_formation_loop(void) {
if (o->oDistanceToMario < 2000.0f) {
for (bitIndex = 0; bitIndex < 8; bitIndex++) {
if (!(o->oCoinUnkF4 & (1 << bitIndex)))
- func_802AB364(bitIndex, o->oBehParams2ndByte);
+ spawn_coin_in_formation(bitIndex, o->oBehParams2ndByte);
}
o->oAction++;
}
@@ -205,34 +205,34 @@ void bhv_coin_formation_loop(void) {
set_object_respawn_info_bits(o, o->oCoinUnkF4 & 0xFF);
}
-void ActionCoinInsideBoo1(void) {
- obj_update_floor_and_walls();
- obj_if_hit_wall_bounce_away();
+void coin_inside_boo_act_1(void) {
+ cur_obj_update_floor_and_walls();
+ cur_obj_if_hit_wall_bounce_away();
if (o->oMoveFlags & OBJ_MOVE_13)
- PlaySound2(SOUND_GENERAL_COIN_DROP);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_DROP);
if (o->oTimer > 90 || (o->oMoveFlags & OBJ_MOVE_LANDED)) {
- set_object_hitbox(o, &sYellowCoinHitbox);
- obj_become_tangible();
- obj_set_behavior(bhvYellowCoin);
+ obj_set_hitbox(o, &sYellowCoinHitbox);
+ cur_obj_become_tangible();
+ cur_obj_set_behavior(bhvYellowCoin);
}
- obj_move_standard(-30);
+ cur_obj_move_standard(-30);
bhv_coin_sparkles_init();
- if (obj_has_model(MODEL_BLUE_COIN))
+ if (cur_obj_has_model(MODEL_BLUE_COIN))
o->oDamageOrCoinValue = 5;
- if (obj_wait_then_blink(400, 20))
- mark_object_for_deletion(o);
+ if (cur_obj_wait_then_blink(400, 20))
+ obj_mark_for_deletion(o);
}
-void ActionCoinInsideBoo0(void) {
+void coin_inside_boo_act_0(void) {
s16 sp26;
f32 sp20;
struct Object *parent = o->parentObj;
- obj_become_intangible();
+ cur_obj_become_intangible();
if (o->oTimer == 0 && gCurrLevelNum == LEVEL_BBH) {
- obj_set_model(MODEL_BLUE_COIN);
- obj_scale(0.7);
+ cur_obj_set_model(MODEL_BLUE_COIN);
+ cur_obj_scale(0.7);
}
- copy_object_pos(o, parent);
+ obj_copy_pos(o, parent);
if (parent->oBooDeathStatus == BOO_DEATH_STATUS_DYING) {
o->oAction = 1;
sp26 = gMarioObject->oMoveAngleYaw;
@@ -243,14 +243,14 @@ void ActionCoinInsideBoo0(void) {
}
}
-void (*sCoinInsideBooActions[])(void) = { ActionCoinInsideBoo0, ActionCoinInsideBoo1 };
+void (*sCoinInsideBooActions[])(void) = { coin_inside_boo_act_0, coin_inside_boo_act_1 };
void bhv_coin_inside_boo_loop(void) {
- obj_call_action_function(sCoinInsideBooActions);
+ cur_obj_call_action_function(sCoinInsideBooActions);
}
void bhv_coin_sparkles_loop(void) {
- obj_scale(0.6f);
+ cur_obj_scale(0.6f);
}
void bhv_golden_coin_sparkles_loop(void) {
diff --git a/src/game/behaviors/collide_particles.inc.c b/src/game/behaviors/collide_particles.inc.c
@@ -11,15 +11,15 @@ void bhv_punch_tiny_triangle_loop(void) {
if (o->oTimer == 0) {
sp1E = o->oMoveAngleYaw;
o->oCollisionParticleUnkF4 = 1.28f;
- obj_set_pos_relative(gMarioObject, 0.0f, 60.0f, 100.0f);
- o->oMoveAngleYaw = sp1E; // does obj_set_pos_relative modify currentObject?
+ cur_obj_set_pos_relative(gMarioObject, 0.0f, 60.0f, 100.0f);
+ o->oMoveAngleYaw = sp1E;
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
o->oAnimState = 5;
- obj_scale(o->oCollisionParticleUnkF4);
+ cur_obj_scale(o->oCollisionParticleUnkF4);
o->oCollisionParticleUnkF4 -= 0.2f;
if (gDebugInfo[4][0] + 6 < o->oTimer)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_punch_tiny_triangle_init(void) {
@@ -39,12 +39,12 @@ void bhv_wall_tiny_star_particle_loop(void) {
if (o->oTimer == 0) {
sp1E = o->oMoveAngleYaw;
o->oCollisionParticleUnkF4 = 0.28f;
- obj_set_pos_relative(gMarioObject, 0.0f, 30.0f, 110.0f);
+ cur_obj_set_pos_relative(gMarioObject, 0.0f, 30.0f, 110.0f);
o->oMoveAngleYaw = sp1E;
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
o->oAnimState = 4;
- obj_scale(o->oCollisionParticleUnkF4);
+ cur_obj_scale(o->oCollisionParticleUnkF4);
o->oCollisionParticleUnkF4 -= 0.015f;
}
@@ -67,9 +67,9 @@ void bhv_pound_tiny_star_particle_loop(void) {
o->oPosY -= 20.0f;
o->oVelY = 14.0f;
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
o->oAnimState = 4;
- obj_scale(o->oCollisionParticleUnkF4);
+ cur_obj_scale(o->oCollisionParticleUnkF4);
o->oCollisionParticleUnkF4 -= 0.015f;
}
diff --git a/src/game/behaviors/controllable_platform.inc.c b/src/game/behaviors/controllable_platform.inc.c
@@ -2,7 +2,7 @@
static s8 D_80331694 = 0;
-void func_802F3BD8(void) {
+void controllable_platform_act_1(void) {
o->oParentRelativePosY -= 4.0f;
if (o->oParentRelativePosY < 41.0f) {
o->oParentRelativePosY = 41.0f;
@@ -10,7 +10,7 @@ void func_802F3BD8(void) {
}
}
-void func_802F3C50(void) {
+void controllable_platform_act_2(void) {
if (o->oBehParams2ndByte == D_80331694)
return;
@@ -30,16 +30,16 @@ void bhv_controllable_platform_sub_loop(void) {
if (gMarioObject->platform == o) {
D_80331694 = o->oBehParams2ndByte;
o->oAction = 1;
- PlaySound2(SOUND_GENERAL_MOVING_PLATFORM_SWITCH);
+ cur_obj_play_sound_2(SOUND_GENERAL_MOVING_PLATFORM_SWITCH);
}
break;
case 1:
- func_802F3BD8();
+ controllable_platform_act_1();
break;
case 2:
- func_802F3C50();
+ controllable_platform_act_2();
break;
}
@@ -70,22 +70,22 @@ void bhv_controllable_platform_init(void) {
o->oControllablePlatformUnkFC = o->oPosY;
}
-void func_802F3F80(s8 sp1B) {
+void controllable_platform_hit_wall(s8 sp1B) {
o->oControllablePlatformUnkF8 = sp1B;
o->oTimer = 0;
D_80331694 = 5;
- PlaySound2(SOUND_GENERAL_QUIET_POUND1);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1);
}
-void func_802F3FD8(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp28) {
+void controllable_platform_check_walls(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp28) {
if (sp1C[1] == 1 || (sp1C[0] == 1 && sp1C[2] == 1))
- func_802F3F80(sp1B);
+ controllable_platform_hit_wall(sp1B);
else {
if (sp1C[0] == 1) {
if (((sp1B == 1 || sp1B == 2) && (s32) sp20[2] != 0)
|| ((sp1B == 3 || sp1B == 4) && (s32) sp20[0] != 0)) {
- func_802F3F80(sp1B);
+ controllable_platform_hit_wall(sp1B);
} else {
o->oPosX += sp20[0];
o->oPosZ += sp20[2];
@@ -95,7 +95,7 @@ void func_802F3FD8(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp2
if (sp1C[2] == 1) {
if (((sp1B == 1 || sp1B == 2) && (s32) sp28[2] != 0)
|| ((sp1B == 3 || sp1B == 4) && (s32) sp28[0] != 0)) {
- func_802F3F80(sp1B);
+ controllable_platform_hit_wall(sp1B);
} else {
o->oPosX += sp28[0];
o->oPosZ += sp28[2];
@@ -110,7 +110,7 @@ void func_802F3FD8(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED Vec3f sp24, Vec3f sp2
}
}
-void func_802F4230(void) {
+void controllable_platform_shake_on_wall_hit(void) {
if (o->oControllablePlatformUnkF8 == 1 || o->oControllablePlatformUnkF8 == 2) {
o->oFaceAnglePitch = sins(o->oTimer * 0x1000) * 182.04444 * 10.0;
o->oPosY = o->oControllablePlatformUnkFC + sins(o->oTimer * 0x2000) * 20.0f;
@@ -127,12 +127,12 @@ void func_802F4230(void) {
}
}
-void func_802F43EC(void) {
+void controllable_platform_tilt_from_mario(void) {
s16 sp1E = gMarioObject->header.gfx.pos[0] - o->oPosX;
s16 sp1C = gMarioObject->header.gfx.pos[2] - o->oPosZ;
if (gMarioObject->platform == o
- || gMarioObject->platform == obj_nearest_object_with_behavior(bhvControllablePlatformSub)) {
+ || gMarioObject->platform == cur_obj_nearest_object_with_behavior(bhvControllablePlatformSub)) {
o->oFaceAnglePitch = sp1C * 4;
o->oFaceAngleRoll = -sp1E * 4;
if (D_80331694 == 6) {
@@ -170,7 +170,7 @@ void bhv_controllable_platform_loop(void) {
sp54[0] = obj_find_wall_displacement(sp48, o->oPosX + 250.0, o->oPosY, o->oPosZ + 300.0, 50.0f);
sp54[1] = obj_find_wall_displacement(sp3C, o->oPosX, o->oPosY, o->oPosZ + 300.0, 50.0f);
sp54[2] = obj_find_wall_displacement(sp30, o->oPosX - 250.0, o->oPosY, o->oPosZ + 300.0, 50.0f);
- func_802F3FD8(2, sp54, sp48, sp3C, sp30);
+ controllable_platform_check_walls(2, sp54, sp48, sp3C, sp30);
break;
case 2:
@@ -178,7 +178,7 @@ void bhv_controllable_platform_loop(void) {
sp54[0] = obj_find_wall_displacement(sp48, o->oPosX + 250.0, o->oPosY, o->oPosZ - 300.0, 50.0f);
sp54[1] = obj_find_wall_displacement(sp3C, o->oPosX, o->oPosY, o->oPosZ - 300.0, 50.0f);
sp54[2] = obj_find_wall_displacement(sp30, o->oPosX - 250.0, o->oPosY, o->oPosZ - 300.0, 50.0f);
- func_802F3FD8(1, sp54, sp48, sp3C, sp30);
+ controllable_platform_check_walls(1, sp54, sp48, sp3C, sp30);
break;
case 3:
@@ -186,7 +186,7 @@ void bhv_controllable_platform_loop(void) {
sp54[0] = obj_find_wall_displacement(sp48, o->oPosX + 300.0, o->oPosY, o->oPosZ + 250.0, 50.0f);
sp54[1] = obj_find_wall_displacement(sp3C, o->oPosX + 300.0, o->oPosY, o->oPosZ, 50.0f);
sp54[2] = obj_find_wall_displacement(sp30, o->oPosX + 300.0, o->oPosY, o->oPosZ - 250.0, 50.0f);
- func_802F3FD8(4, sp54, sp48, sp3C, sp30);
+ controllable_platform_check_walls(4, sp54, sp48, sp3C, sp30);
break;
case 4:
@@ -194,11 +194,11 @@ void bhv_controllable_platform_loop(void) {
sp54[0] = obj_find_wall_displacement(sp48, o->oPosX - 300.0, o->oPosY, o->oPosZ + 250.0, 50.0f);
sp54[1] = obj_find_wall_displacement(sp3C, o->oPosX - 300.0, o->oPosY, o->oPosZ, 50.0f);
sp54[2] = obj_find_wall_displacement(sp30, o->oPosX - 300.0, o->oPosY, o->oPosZ - 250.0, 50.0f);
- func_802F3FD8(3, sp54, sp48, sp3C, sp30);
+ controllable_platform_check_walls(3, sp54, sp48, sp3C, sp30);
break;
case 5:
- func_802F4230();
+ controllable_platform_shake_on_wall_hit();
return;
break;
@@ -209,9 +209,9 @@ void bhv_controllable_platform_loop(void) {
break;
}
- func_802F43EC();
+ controllable_platform_tilt_from_mario();
o->oPosX += o->oVelX;
o->oPosZ += o->oVelZ;
if (D_80331694 != 0 && D_80331694 != 6)
- PlaySound(SOUND_ENV_ELEVATOR2);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR2);
}
diff --git a/src/game/behaviors/corkbox.inc.c b/src/game/behaviors/corkbox.inc.c
@@ -4,11 +4,11 @@
void bhv_bobomb_bully_death_smoke_init(void) {
o->oPosY -= 300.0f;
- obj_scale(10.0f);
+ cur_obj_scale(10.0f);
}
void bhv_bobomb_explosion_bubble_init(void) {
- scale_object_xyz(o, 2.0f, 2.0f, 1.0f);
+ obj_scale_xyz(o, 2.0f, 2.0f, 1.0f);
o->oBobombExpBubGfxExpRateX = (s32)(RandomFloat() * 2048.0f) + 0x800;
o->oBobombExpBubGfxExpRateY = (s32)(RandomFloat() * 2048.0f) + 0x800;
@@ -28,7 +28,7 @@ void bhv_bobomb_explosion_bubble_loop(void) {
if (o->oPosY > waterY) {
o->activeFlags = 0;
o->oPosY += 5.0f;
- spawn_object(o, MODEL_SPOT_ON_GROUND, bhvWaterSurfaceWhiteWave2);
+ spawn_object(o, MODEL_SMALL_WATER_SPLASH, bhvObjectWaterSplash);
}
if (o->oTimer >= 61)
diff --git a/src/game/behaviors/cruiser.inc.c b/src/game/behaviors/cruiser.inc.c
@@ -15,7 +15,7 @@ void bhv_rr_cruiser_wing_loop(void) {
}
#ifndef VERSION_JP
if (o->oTimer == 64) {
- PlaySound2(SOUND_GENERAL_BOAT_ROCK);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOAT_ROCK);
o->oTimer = 0;
}
#endif
diff --git a/src/game/behaviors/ddd_pole.inc.c b/src/game/behaviors/ddd_pole.inc.c
@@ -1,7 +1,7 @@
void bhv_ddd_pole_init(void) {
if (!(save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR))) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->hitboxDownOffset = 100.0f;
o->oDDDPoleMaxOffset = 100.0f * o->oBehParams2ndByte;
diff --git a/src/game/behaviors/ddd_sub.inc.c b/src/game/behaviors/ddd_sub.inc.c
@@ -2,5 +2,5 @@
void bhv_bowsers_sub_loop(void) {
if (save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR))
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/ddd_warp.inc.c b/src/game/behaviors/ddd_warp.inc.c
@@ -1,7 +1,7 @@
// ddd_warp.c.inc
void bhv_ddd_warp_loop(void) {
- if (dddStatus & BOWSERS_SUB_BEATEN)
+ if (gDddPaintingStatus & BOWSERS_SUB_BEATEN)
o->collisionData = segmented_to_virtual(inside_castle_seg7_collision_ddd_warp_2);
else
o->collisionData = segmented_to_virtual(inside_castle_seg7_collision_ddd_warp);
diff --git a/src/game/behaviors/decorative_pendulum.inc.c b/src/game/behaviors/decorative_pendulum.inc.c
@@ -27,5 +27,5 @@ void bhv_decorative_pendulum_loop(void) {
* actually one sound played twice in rapid succession.
*/
if (o->oAngleVelRoll == 0x10 || o->oAngleVelRoll == -0x10)
- PlaySound2(SOUND_GENERAL_BIG_CLOCK);
+ cur_obj_play_sound_2(SOUND_GENERAL_BIG_CLOCK);
}
diff --git a/src/game/behaviors/donut_platform.inc.c b/src/game/behaviors/donut_platform.inc.c
@@ -47,25 +47,25 @@ void bhv_donut_platform_update(void) {
& ((1 << o->oBehParams2ndByte) ^ 0xFFFFFFFF);
if (o->oDistanceToMario > 2500.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
- func_802A3C98(150.0f, 1);
+ obj_explode_and_spawn_coins(150.0f, 1);
create_sound_spawner(SOUND_GENERAL_DONUT_PLATFORM_EXPLOSION);
}
} else {
if (o->oGravity == 0.0f) {
if (gMarioObject->platform == o) {
- obj_shake_y(4.0f);
+ cur_obj_shake_y(4.0f);
if (o->oTimer > 15) {
o->oGravity = -0.1f;
}
} else {
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oTimer = 0;
}
} else {
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
}
load_object_collision_model();
diff --git a/src/game/behaviors/door.inc.c b/src/game/behaviors/door.inc.c
@@ -12,13 +12,13 @@ s32 D_8032F328[] = { SOUND_GENERAL_OPEN_WOOD_DOOR, SOUND_GENERAL_OPEN_IRON_DOOR
s32 D_8032F330[] = { SOUND_GENERAL_CLOSE_WOOD_DOOR, SOUND_GENERAL_CLOSE_IRON_DOOR };
-void func_802AC070(s32 sp18) {
- set_obj_animation_and_sound_state(sp18);
- if (func_8029F788())
+void door_animation_and_reset(s32 sp18) {
+ cur_obj_init_animation_with_sound(sp18);
+ if (cur_obj_check_if_near_animation_end())
o->oAction = 0;
}
-void func_802AC0B8(void) {
+void set_door_camera_event(void) {
if (segmented_to_virtual(bhvDoor) == o->behavior)
gPlayerCameraState->cameraEvent = CAM_EVENT_DOOR;
else
@@ -26,53 +26,53 @@ void func_802AC0B8(void) {
gPlayerCameraState->usedObj = o;
}
-void func_802AC130(void) {
- s32 sp1C = obj_has_model(MODEL_HMC_METAL_DOOR);
+void play_door_open_noise(void) {
+ s32 sp1C = cur_obj_has_model(MODEL_HMC_METAL_DOOR);
if (o->oTimer == 0) {
- PlaySound2(D_8032F328[sp1C]);
+ cur_obj_play_sound_2(D_8032F328[sp1C]);
gTimeStopState |= TIME_STOP_MARIO_OPENED_DOOR;
}
if (o->oTimer == 70) {
- PlaySound2(D_8032F330[sp1C]);
+ cur_obj_play_sound_2(D_8032F330[sp1C]);
}
}
-void func_802AC1CC(void) {
- s32 sp1C = obj_has_model(MODEL_HMC_METAL_DOOR);
+void play_warp_door_open_noise(void) {
+ s32 sp1C = cur_obj_has_model(MODEL_HMC_METAL_DOOR);
if (o->oTimer == 30)
- PlaySound2(D_8032F330[sp1C]);
+ cur_obj_play_sound_2(D_8032F330[sp1C]);
}
void bhv_door_loop(void) {
s32 sp1C = 0;
while (D_8032F300[sp1C].flag != (u32)~0) {
- if (obj_clear_interact_status_flag(D_8032F300[sp1C].flag)) {
- func_802AC0B8();
- obj_change_action(D_8032F300[sp1C].action);
+ if (cur_obj_clear_interact_status_flag(D_8032F300[sp1C].flag)) {
+ set_door_camera_event();
+ cur_obj_change_action(D_8032F300[sp1C].action);
}
sp1C++;
}
switch (o->oAction) {
case 0:
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
break;
case 1:
- func_802AC070(1);
- func_802AC130();
+ door_animation_and_reset(1);
+ play_door_open_noise();
break;
case 2:
- func_802AC070(2);
- func_802AC130();
+ door_animation_and_reset(2);
+ play_door_open_noise();
break;
case 3:
- func_802AC070(3);
- func_802AC1CC();
+ door_animation_and_reset(3);
+ play_warp_door_open_noise();
break;
case 4:
- func_802AC070(4);
- func_802AC1CC();
+ door_animation_and_reset(4);
+ play_warp_door_open_noise();
break;
}
if (o->oAction == 0)
diff --git a/src/game/behaviors/dorrie.inc.c b/src/game/behaviors/dorrie.inc.c
@@ -23,10 +23,10 @@ void dorrie_act_move(void) {
startYaw = o->oMoveAngleYaw;
o->oDorrieNeckAngle = -0x26F4;
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (o->oDorrieForwardDistToMario < 320.0f && o->oDorrieGroundPounded) {
- PlaySound2(SOUND_OBJ_DORRIE);
+ cur_obj_play_sound_2(SOUND_OBJ_DORRIE);
o->collisionData = segmented_to_virtual(dorrie_seg6_collision_0600FBB8);
o->oAction = DORRIE_ACT_LOWER_HEAD;
o->oForwardVel = 0.0f;
@@ -62,7 +62,7 @@ void dorrie_begin_head_raise(s32 liftingMario) {
void dorrie_act_lower_head(void) {
if (func_802F92EC(2, 35)) {
- func_8029F6F0();
+ cur_obj_reverse_animation();
#ifdef VERSION_JP
if (o->oTimer > 150) {
@@ -94,17 +94,17 @@ void dorrie_act_lower_head(void) {
void dorrie_act_raise_head(void) {
o->collisionData = segmented_to_virtual(dorrie_seg6_collision_0600F644);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = DORRIE_ACT_MOVE;
} else if (o->oDorrieLiftingMario && o->header.gfx.unk38.animFrame < 74) {
if (set_mario_npc_dialog(2) == 2) {
o->oDorrieHeadRaiseSpeed += 0x1CC;
- if (obj_check_anim_frame(73)) {
+ if (cur_obj_check_anim_frame(73)) {
set_mario_npc_dialog(0);
}
dorrie_raise_head();
} else {
- func_8029F6F0();
+ cur_obj_reverse_animation();
}
}
}
@@ -119,10 +119,10 @@ void bhv_dorrie_update(void) {
o->oDorrieForwardDistToMario = o->oDistanceToMario * coss(o->oAngleToMario - o->oMoveAngleYaw);
obj_perform_position_op(0);
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
- o->oDorrieAngleToHome = obj_angle_to_home();
- o->oDorrieDistToHome = obj_lateral_dist_to_home();
+ o->oDorrieAngleToHome = cur_obj_angle_to_home();
+ o->oDorrieDistToHome = cur_obj_lateral_dist_to_home();
// Shift dorrie's bounds to account for her neck
boundsShift =
@@ -133,7 +133,7 @@ void bhv_dorrie_update(void) {
o->oPosZ = o->oHomeZ - o->oDorrieDistToHome * coss(o->oDorrieAngleToHome);
}
- o->oDorrieGroundPounded = obj_is_mario_ground_pounding_platform();
+ o->oDorrieGroundPounded = cur_obj_is_mario_ground_pounding_platform();
if (gMarioObject->platform == o) {
maxOffsetY = -17.0f;
diff --git a/src/game/behaviors/drawbridge.inc.c b/src/game/behaviors/drawbridge.inc.c
@@ -36,7 +36,7 @@ void bhv_lll_drawbridge_loop(void) {
// the game at regular intervals can leave the drawbridge raised indefinitely.
if (o->oTimer >= 51 && (globalTimer % 8) == 0) {
o->oAction = LLL_DRAWBRIDGE_ACT_LOWER;
- PlaySound2(SOUND_GENERAL_BOAT_TILT1);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOAT_TILT1);
}
}
@@ -47,7 +47,7 @@ void bhv_lll_drawbridge_loop(void) {
// the game at regular intervals can leave the drawbridge lowered indefinitely.
if (o->oTimer >= 51 && (globalTimer % 8) == 0) {
o->oAction = LLL_DRAWBRIDGE_ACT_RAISE;
- PlaySound2(SOUND_GENERAL_BOAT_TILT2);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOAT_TILT2);
}
}
}
diff --git a/src/game/behaviors/elevator.inc.c b/src/game/behaviors/elevator.inc.c
@@ -1,11 +1,11 @@
// elevator.c.inc
-void func_802AD01C(void) {
- PlaySound2(SOUND_GENERAL_QUIET_POUND1);
- ShakeScreen(SHAKE_POS_SMALL);
+void elevator_starting_shake(void) {
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND1);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
}
-void ActionElevator0(void) {
+void elevator_act_0(void) {
o->oVelY = 0;
if (o->oElevatorUnk100 == 2) {
if (gMarioObject->platform == o) {
@@ -25,10 +25,10 @@ void ActionElevator0(void) {
}
}
-void ActionElevator1(void) {
- PlaySound(SOUND_ENV_ELEVATOR1);
- if (o->oTimer == 0 && obj_is_mario_on_platform())
- func_802AD01C();
+void elevator_act_1(void) {
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR1);
+ if (o->oTimer == 0 && cur_obj_is_mario_on_platform())
+ elevator_starting_shake();
approach_f32_signed(&o->oVelY, 10.0f, 2.0f);
o->oPosY += o->oVelY;
if (o->oPosY > o->oElevatorUnkF8) {
@@ -42,11 +42,11 @@ void ActionElevator1(void) {
}
}
-void ActionElevator2() // Pretty similar code to action 1
+void elevator_act_2() // Pretty similar code to action 1
{
- PlaySound(SOUND_ENV_ELEVATOR1);
- if (o->oTimer == 0 && obj_is_mario_on_platform())
- func_802AD01C();
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR1);
+ if (o->oTimer == 0 && cur_obj_is_mario_on_platform())
+ elevator_starting_shake();
approach_f32_signed(&o->oVelY, -10.0f, -2.0f);
o->oPosY += o->oVelY;
if (o->oPosY < o->oElevatorUnkF4) {
@@ -62,24 +62,24 @@ void ActionElevator2() // Pretty similar code to action 1
}
}
-void ActionElevator4() {
+void elevator_act_4() {
o->oVelY = 0;
if (o->oTimer == 0) {
- ShakeScreen(SHAKE_POS_SMALL);
- PlaySound2(SOUND_GENERAL_METAL_POUND);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_GENERAL_METAL_POUND);
}
- if (!mario_is_in_air_action() && !obj_is_mario_on_platform())
+ if (!mario_is_in_air_action() && !cur_obj_is_mario_on_platform())
o->oAction = 1;
}
-void ActionElevator3() // nearly identical to action 2
+void elevator_act_3() // nearly identical to action 2
{
o->oVelY = 0;
if (o->oTimer == 0) {
- ShakeScreen(SHAKE_POS_SMALL);
- PlaySound2(SOUND_GENERAL_METAL_POUND);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_GENERAL_METAL_POUND);
}
- if (!mario_is_in_air_action() && !obj_is_mario_on_platform())
+ if (!mario_is_in_air_action() && !cur_obj_is_mario_on_platform())
o->oAction = 0;
}
@@ -89,7 +89,7 @@ void bhv_elevator_init(void) {
o->oElevatorUnkF4 = D_8032F38C[o->oBehParams2ndByte * 3];
o->oElevatorUnkF8 = o->oHomeY;
o->oElevatorUnkFC = (o->oElevatorUnkF4 + o->oElevatorUnkF8) / 2;
- o->oElevatorUnk100 = obj_has_behavior(bhvRrElevatorPlatform);
+ o->oElevatorUnk100 = cur_obj_has_behavior(bhvRrElevatorPlatform);
} else {
o->oElevatorUnkF4 = D_8032F38C[o->oBehParams2ndByte * 3];
o->oElevatorUnkF8 = D_8032F38C[o->oBehParams2ndByte * 3 + 1];
@@ -98,8 +98,8 @@ void bhv_elevator_init(void) {
}
}
-void (*sElevatorActions[])(void) = { ActionElevator0, ActionElevator1, ActionElevator2, ActionElevator3,
- ActionElevator4 };
+void (*sElevatorActions[])(void) = { elevator_act_0, elevator_act_1, elevator_act_2, elevator_act_3,
+ elevator_act_4 };
struct SpawnParticlesInfo D_8032F3CC = { 3, 20, MODEL_MIST, 20, 10, 5, 0, 0, 0, 30, 30.0f, 1.5f };
@@ -111,5 +111,5 @@ struct SpawnParticlesInfo D_8032F3FC = { 0, 5, MODEL_WHITE_PARTICLE_DL, 0,
2.0f, 2.0f };
void bhv_elevator_loop(void) {
- obj_call_action_function(sElevatorActions);
+ cur_obj_call_action_function(sElevatorActions);
}
diff --git a/src/game/behaviors/end_birds_1.inc.c b/src/game/behaviors/end_birds_1.inc.c
@@ -6,7 +6,7 @@ void bhv_end_birds_1_loop(void) {
switch (gCurrentObject->oAction) {
case 0:
- obj_scale(0.7f);
+ cur_obj_scale(0.7f);
gCurrentObject->oIntroLakituUnk110 = -554.f;
gCurrentObject->oIntroLakituUnk10C = 3044.f;
gCurrentObject->oIntroLakituUnk108 = -1314.f;
@@ -19,11 +19,11 @@ void bhv_end_birds_1_loop(void) {
if (gCurrentObject->oTimer < 100)
obj_rotate_towards_point(gCurrentObject, sp34, 0, 0, 0x20, 0x20);
if ((gCurrentObject->oEndBirdUnk104 == 0.f) && (gCurrentObject->oTimer == 0))
- PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
+ cur_obj_play_sound_2(SOUND_GENERAL_BIRDS_FLY_AWAY);
if (gCutsceneTimer == 0)
- mark_object_for_deletion(gCurrentObject);
+ obj_mark_for_deletion(gCurrentObject);
break;
}
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
}
diff --git a/src/game/behaviors/end_birds_2.inc.c b/src/game/behaviors/end_birds_2.inc.c
@@ -11,7 +11,7 @@ void bhv_end_birds_2_loop(void) {
switch (gCurrentObject->oAction) {
case 0:
- obj_scale(0.7f);
+ cur_obj_scale(0.7f);
gCurrentObject->oAction += 1;
break;
case 1:
@@ -23,9 +23,9 @@ void bhv_end_birds_2_loop(void) {
obj_rotate_towards_point(gCurrentObject, sp3C, 0, 0, 8, 8);
if ((gCurrentObject->oEndBirdUnk104 == 0.f) && (gCurrentObject->oTimer == 0))
- PlaySound2(SOUND_GENERAL_BIRDS_FLY_AWAY);
+ cur_obj_play_sound_2(SOUND_GENERAL_BIRDS_FLY_AWAY);
break;
}
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
}
diff --git a/src/game/behaviors/enemy_lakitu.inc.c b/src/game/behaviors/enemy_lakitu.inc.c
@@ -27,7 +27,7 @@ static void enemy_lakitu_act_uninitialized(void) {
if (o->oDistanceToMario < 2000.0f) {
spawn_object_relative_with_scale(CLOUD_BP_LAKITU_CLOUD, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud);
- obj_unhide();
+ cur_obj_unhide();
o->oAction = ENEMY_LAKITU_ACT_MAIN;
}
}
@@ -85,7 +85,7 @@ static void enemy_lakitu_update_speed_and_angle(void) {
// Change move angle toward mario faster when farther from mario
turnSpeed = (s16)(distToMario * 2);
clamp_s16(&turnSpeed, 0xC8, 0xFA0);
- obj_rotate_yaw_toward(o->oAngleToMario, turnSpeed);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, turnSpeed);
}
/**
@@ -93,7 +93,7 @@ static void enemy_lakitu_update_speed_and_angle(void) {
* hold it, then enter the hold spiny sub-action.
*/
static void enemy_lakitu_sub_act_no_spiny(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (o->oEnemyLakituSpinyCooldown != 0) {
o->oEnemyLakituSpinyCooldown -= 1;
@@ -103,8 +103,7 @@ static void enemy_lakitu_sub_act_no_spiny(void) {
if (spiny != NULL) {
o->prevObj = spiny;
spiny->oAction = SPINY_ACT_HELD_BY_LAKITU;
-
- func_8029EE20(spiny, spiny_egg_seg5_anims_050157E4, 0);
+ obj_init_animation_with_sound(spiny, spiny_egg_seg5_anims_050157E4, 0);
o->oEnemyLakituNumSpinies += 1;
o->oSubAction = ENEMY_LAKITU_SUB_ACT_HOLD_SPINY;
@@ -137,11 +136,11 @@ static void enemy_lakitu_sub_act_hold_spiny(void) {
*/
static void enemy_lakitu_sub_act_throw_spiny(void) {
if (func_802F92EC(2, 2)) {
- PlaySound2(SOUND_OBJ_EVIL_LAKITU_THROW);
+ cur_obj_play_sound_2(SOUND_OBJ_EVIL_LAKITU_THROW);
o->prevObj = NULL;
}
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oSubAction = ENEMY_LAKITU_SUB_ACT_NO_SPINY;
o->oEnemyLakituSpinyCooldown = random_linear_offset(100, 100);
}
@@ -151,13 +150,13 @@ static void enemy_lakitu_sub_act_throw_spiny(void) {
* Main update function.
*/
static void enemy_lakitu_act_main(void) {
- PlaySound(SOUND_AIR_LAKITU_FLY);
+ cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY);
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
enemy_lakitu_update_speed_and_angle();
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
}
obj_update_blinking(&o->oEnemyLakituBlinkTimer, 20, 40, 4);
@@ -174,7 +173,7 @@ static void enemy_lakitu_act_main(void) {
break;
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
// Die and drop held spiny when attacked by mario
if (obj_check_attacks(&sEnemyLakituHitbox, o->oAction)) {
diff --git a/src/game/behaviors/exclamation_box.inc.c b/src/game/behaviors/exclamation_box.inc.c
@@ -30,12 +30,12 @@ struct Struct802C0DF0 sExclamationBoxContents[] = { { 0, 0, 0, MODEL_MARIOS_WING
{ 14, 0, 5, MODEL_STAR, bhvSpawnedStar },
{ 99, 0, 0, 0, NULL } };
-void bhv_rotatin_exclamation_box_loop(void) {
+void bhv_rotating_exclamation_box_loop(void) {
if (o->parentObj->oAction != 1)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void ActionExclamationBox0(void) {
+void exclamation_box_act_0(void) {
if (o->oBehParams2ndByte < 3) {
o->oAnimState = o->oBehParams2ndByte;
if ((save_file_get_flags() & D_8032F0C0[o->oBehParams2ndByte])
@@ -49,30 +49,30 @@ void ActionExclamationBox0(void) {
}
}
-void ActionExclamationBox1(void) {
- obj_become_intangible();
+void exclamation_box_act_1(void) {
+ cur_obj_become_intangible();
if (o->oTimer == 0) {
spawn_object(o, MODEL_EXCLAMATION_POINT, bhvRotatingExclamationMark);
- obj_set_model(MODEL_EXCLAMATION_BOX_OUTLINE);
+ cur_obj_set_model(MODEL_EXCLAMATION_BOX_OUTLINE);
}
if ((save_file_get_flags() & D_8032F0C0[o->oBehParams2ndByte])
|| ((o->oBehParams >> 24) & 0xFF) != 0) {
o->oAction = 2;
- obj_set_model(MODEL_EXCLAMATION_BOX);
+ cur_obj_set_model(MODEL_EXCLAMATION_BOX);
}
}
-void ActionExclamationBox2(void) {
- set_object_hitbox(o, &sExclamationBoxHitbox);
+void exclamation_box_act_2(void) {
+ obj_set_hitbox(o, &sExclamationBoxHitbox);
if (o->oTimer == 0) {
- obj_unhide();
- obj_become_tangible();
+ cur_obj_unhide();
+ cur_obj_become_tangible();
o->oInteractStatus = 0;
o->oPosY = o->oHomeY;
o->oGraphYOffset = 0.0f;
}
- if (obj_was_attacked_or_ground_pounded()) {
- obj_become_intangible();
+ if (cur_obj_was_attacked_or_ground_pounded()) {
+ cur_obj_become_intangible();
o->oExclamationBoxUnkFC = 0x4000;
o->oVelY = 30.0f;
o->oGravity = -8.0f;
@@ -82,9 +82,9 @@ void ActionExclamationBox2(void) {
load_object_collision_model();
}
-void ActionExclamationBox3(void) {
+void exclamation_box_act_3(void) {
UNUSED s32 unused;
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oVelY < 0.0f) {
o->oVelY = 0.0f;
o->oGravity = 0.0f;
@@ -100,7 +100,7 @@ void ActionExclamationBox3(void) {
o->oAction = 4;
}
-void func_802C0DF0(struct Struct802C0DF0 *a0, u8 a1) {
+void exclamation_box_spawn_contents(struct Struct802C0DF0 *a0, u8 a1) {
struct Object *sp1C = NULL;
while (a0->unk0 != 99) {
@@ -118,28 +118,28 @@ void func_802C0DF0(struct Struct802C0DF0 *a0, u8 a1) {
}
}
-void ActionExclamationBox4(void) {
- func_802C0DF0(sExclamationBoxContents, o->oBehParams2ndByte);
- func_802AA618(0, 0, 46.0f);
+void exclamation_box_act_4(void) {
+ exclamation_box_spawn_contents(sExclamationBoxContents, o->oBehParams2ndByte);
+ spawn_mist_particles_variable(0, 0, 46.0f);
spawn_triangle_break_particles(20, 139, 0.3f, o->oAnimState);
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
if (o->oBehParams2ndByte < 3) {
o->oAction = 5;
- obj_hide();
+ cur_obj_hide();
} else
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void ActionExclamationBox5(void) {
+void exclamation_box_act_5(void) {
if (o->oTimer > 300)
o->oAction = 2;
}
-void (*sExclamationBoxActions[])(void) = { ActionExclamationBox0, ActionExclamationBox1,
- ActionExclamationBox2, ActionExclamationBox3,
- ActionExclamationBox4, ActionExclamationBox5 };
+void (*sExclamationBoxActions[])(void) = { exclamation_box_act_0, exclamation_box_act_1,
+ exclamation_box_act_2, exclamation_box_act_3,
+ exclamation_box_act_4, exclamation_box_act_5 };
void bhv_exclamation_box_loop(void) {
- obj_scale(2.0f);
- obj_call_action_function(sExclamationBoxActions);
+ cur_obj_scale(2.0f);
+ cur_obj_call_action_function(sExclamationBoxActions);
}
diff --git a/src/game/behaviors/explosion.inc.c b/src/game/behaviors/explosion.inc.c
@@ -22,5 +22,5 @@ void bhv_explosion_loop(void) {
o->oOpacity -= 14;
- obj_scale((f32) o->oTimer / 9.0f + 1.0);
+ cur_obj_scale((f32) o->oTimer / 9.0f + 1.0);
}
diff --git a/src/game/behaviors/express_elevator.inc.c b/src/game/behaviors/express_elevator.inc.c
@@ -3,12 +3,12 @@
void bhv_wdw_express_elevator_loop(void) {
o->oVelY = 0.0f;
if (o->oAction == 0) {
- if (obj_is_mario_on_platform())
+ if (cur_obj_is_mario_on_platform())
o->oAction++;
} else if (o->oAction == 1) {
o->oVelY = -20.0f;
o->oPosY += o->oVelY;
- PlaySound(SOUND_ENV_ELEVATOR4);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4);
if (o->oTimer > 132)
o->oAction++;
} else if (o->oAction == 2) {
@@ -17,11 +17,11 @@ void bhv_wdw_express_elevator_loop(void) {
} else if (o->oAction == 3) {
o->oVelY = 10.0f;
o->oPosY += o->oVelY;
- PlaySound(SOUND_ENV_ELEVATOR4);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR4);
if (o->oPosY >= o->oHomeY) {
o->oPosY = o->oHomeY;
o->oAction++;
}
- } else if (!obj_is_mario_on_platform())
+ } else if (!cur_obj_is_mario_on_platform())
o->oAction = 0;
}
diff --git a/src/game/behaviors/eyerok.inc.c b/src/game/behaviors/eyerok.inc.c
@@ -34,7 +34,7 @@ static void eyerok_boss_act_sleep(void) {
eyerok_spawn_hand(-1, MODEL_EYEROK_LEFT_HAND, bhvEyerokHand);
eyerok_spawn_hand(1, MODEL_EYEROK_RIGHT_HAND, bhvEyerokHand);
} else if (o->oDistanceToMario < 500.0f) {
- PlaySound2(SOUND_OBJ_EYEROK_EXPLODE);
+ cur_obj_play_sound_2(SOUND_OBJ_EYEROK_EXPLODE);
o->oAction = EYEROK_BOSS_ACT_WAKE_UP;
}
}
@@ -63,7 +63,7 @@ static void eyerok_boss_act_wake_up(void) {
}
static void eyerok_boss_act_show_intro_text(void) {
- if (obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_117)) {
+ if (cur_obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_117)) {
o->oAction = EYEROK_BOSS_ACT_FIGHT;
}
}
@@ -117,14 +117,14 @@ static void eyerok_boss_act_fight(void) {
static void eyerok_boss_act_die(void) {
if (o->oTimer == 60) {
- if (obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_118)) {
- create_star(0.0f, -900.0f, -3700.0f);
+ if (cur_obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_118)) {
+ spawn_default_star(0.0f, -900.0f, -3700.0f);
} else {
o->oTimer -= 1;
}
} else if (o->oTimer > 120) {
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
@@ -150,7 +150,7 @@ void bhv_eyerok_boss_loop(void) {
static s32 eyerok_hand_check_attacked(void) {
if (o->oEyerokReceivedAttack != 0 && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x3000) {
- PlaySound2(SOUND_OBJ2_EYEROK_SOUND_SHORT);
+ cur_obj_play_sound_2(SOUND_OBJ2_EYEROK_SOUND_SHORT);
if (--o->oHealth >= 2) {
o->oAction = EYEROK_HAND_ACT_ATTACKED;
@@ -174,15 +174,15 @@ static s32 eyerok_hand_check_attacked(void) {
}
static void func_8030DBA8(void) {
- PlaySound2(SOUND_OBJ_POUNDING_LOUD);
+ cur_obj_play_sound_2(SOUND_OBJ_POUNDING_LOUD);
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
- func_802ADA94();
+ spawn_mist_from_global();
}
static void eyerok_hand_act_sleep(void) {
if (o->parentObj->oAction != EYEROK_BOSS_ACT_SLEEP
&& ++o->oEyerokHandWakeUpTimer > -3 * o->oBehParams2ndByte) {
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->parentObj->oEyerokBossNumHands += 1;
o->oAction = EYEROK_HAND_ACT_IDLE;
o->collisionData = segmented_to_virtual(&ssl_seg7_collision_07028274);
@@ -200,13 +200,13 @@ static void eyerok_hand_act_sleep(void) {
o->collisionData = segmented_to_virtual(&ssl_seg7_collision_07028370);
}
- func_8029F6F0();
+ cur_obj_reverse_animation();
o->oPosX = o->oHomeX + 724.0f * o->oBehParams2ndByte;
}
}
static void eyerok_hand_act_idle(void) {
- set_obj_animation_and_sound_state(2);
+ cur_obj_init_animation_with_sound(2);
if (o->parentObj->oAction == EYEROK_BOSS_ACT_FIGHT) {
if (o->parentObj->oEyerokBossUnk104 != 0) {
@@ -267,14 +267,14 @@ static void eyerok_hand_act_open(void) {
static void eyerok_hand_act_show_eye(void) {
UNUSED s16 val06;
- set_obj_animation_and_sound_state(5);
+ cur_obj_init_animation_with_sound(5);
func_802F9378(0, 0, SOUND_OBJ_EYEROK_SHOW_EYE);
if (!eyerok_hand_check_attacked()) {
if (o->parentObj->oEyerokBossActiveHand == 0) {
if (o->oAnimState < 3) {
o->oAnimState += 1;
- } else if (func_8029F788()) {
+ } else if (cur_obj_check_if_near_animation_end()) {
val06 = (s16)(o->oAngleToMario - o->oFaceAngleYaw) * o->oBehParams2ndByte;
o->oAction = EYEROK_HAND_ACT_CLOSE;
}
@@ -342,19 +342,19 @@ static void eyerok_hand_act_become_active(void) {
static void eyerok_hand_act_die(void) {
if (func_802F92B0(1)) {
o->parentObj->oEyerokBossUnk1AC = 0;
- func_802A3C98(150.0f, 1);
+ obj_explode_and_spawn_coins(150.0f, 1);
create_sound_spawner(SOUND_OBJ2_EYEROK_SOUND_LONG);
}
if (o->oMoveFlags & 0x00000003) {
- PlaySound2(SOUND_OBJ_POUNDING_LOUD);
+ cur_obj_play_sound_2(SOUND_OBJ_POUNDING_LOUD);
o->oForwardVel = 0.0f;
}
}
static void eyerok_hand_act_retreat(void) {
- f32 distToHome = obj_lateral_dist_to_home();
- s16 angleToHome = obj_angle_to_home();
+ f32 distToHome = cur_obj_lateral_dist_to_home();
+ s16 angleToHome = cur_obj_angle_to_home();
if ((distToHome -= 40.0f) < 0.0f) {
distToHome = 0.0f;
@@ -386,7 +386,7 @@ static void eyerok_hand_act_target_mario(void) {
} else {
obj_forward_vel_approach(50.0f, 5.0f);
approach_f32_ptr(&o->oPosY, o->oHomeY + 300.0f, 20.0f);
- obj_rotate_yaw_toward(o->oAngleToMario, 4000);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 4000);
}
}
@@ -493,7 +493,7 @@ void bhv_eyerok_hand_loop(void) {
if (o->oAction == EYEROK_HAND_ACT_SLEEP) {
eyerok_hand_act_sleep();
} else {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case EYEROK_HAND_ACT_IDLE:
@@ -544,7 +544,7 @@ void bhv_eyerok_hand_loop(void) {
}
o->oEyerokReceivedAttack = obj_check_attacks(&sEyerokHitbox, o->oAction);
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
load_object_collision_model();
diff --git a/src/game/behaviors/falling_pillar.inc.c b/src/game/behaviors/falling_pillar.inc.c
@@ -74,7 +74,7 @@ void bhv_falling_pillar_loop(void) {
o->oAction = FALLING_PILLAR_ACT_TURNING;
// Play the detaching sound.
- PlaySound2(SOUND_GENERAL_POUND_ROCK);
+ cur_obj_play_sound_2(SOUND_GENERAL_POUND_ROCK);
}
break;
@@ -106,7 +106,7 @@ void bhv_falling_pillar_loop(void) {
// Make the camera shake and spawn dust clouds.
set_camera_shake_from_point(SHAKE_POS_MEDIUM, o->oPosX, o->oPosY, o->oPosZ);
- func_802AA618(0, 0, 92.0f);
+ spawn_mist_particles_variable(0, 0, 92.0f);
// Go invisible.
o->activeFlags = 0;
@@ -136,7 +136,7 @@ void bhv_falling_pillar_hitbox_loop(void) {
o->oPosZ = sins(pitch) * coss(yaw) * yOffset + z;
// Give these a hitbox so they can collide with Mario.
- set_object_hitbox(o, &sFallingPillarHitbox);
+ obj_set_hitbox(o, &sFallingPillarHitbox);
// When the pillar goes inactive, the hitboxes also go inactive.
if (o->parentObj->activeFlags == 0)
diff --git a/src/game/behaviors/falling_rising_platform.inc.c b/src/game/behaviors/falling_rising_platform.inc.c
@@ -14,7 +14,7 @@ void bhv_bitfs_sinking_platform_loop(void) {
// TODO: Named incorrectly. fix
void bhv_ddd_moving_pole_loop(void) {
- copy_object_pos_and_angle(o, o->parentObj);
+ obj_copy_pos_and_angle(o, o->parentObj);
}
void bhv_bitfs_sinking_cage_platform_loop(void) {
diff --git a/src/game/behaviors/fire_piranha_plant.inc.c b/src/game/behaviors/fire_piranha_plant.inc.c
@@ -32,7 +32,7 @@ s32 sNumKilledFirePiranhaPlants;
void bhv_fire_piranha_plant_init(void) {
o->oFirePiranhaPlantNeutralScale = D_80331B5C[(u16)(o->oBehParams >> 16)];
- set_object_hitbox(o, &sFirePiranhaPlantHitbox);
+ obj_set_hitbox(o, &sFirePiranhaPlantHitbox);
if ((u16)(o->oBehParams >> 16) != 0) {
o->oFlags |= 0x00004000;
@@ -52,21 +52,21 @@ static void fire_piranha_plant_act_hide(void) {
o->oMoveAngleYaw += (s32) o->oFirePiranhaPlantDeathSpinVel;
approach_f32_ptr(&o->oFirePiranhaPlantDeathSpinVel, 0.0f, 200.0f);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
if (--o->oFirePiranhaPlantDeathSpinTimer == 0) {
- PlaySound2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
+ cur_obj_play_sound_2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
}
}
} else if (approach_f32_ptr(&o->oFirePiranhaPlantScale, 0.0f,
0.04f * o->oFirePiranhaPlantNeutralScale)) {
- obj_become_intangible();
+ cur_obj_become_intangible();
if (o->oFirePiranhaPlantActive) {
sNumActiveFirePiranhaPlants -= 1;
o->oFirePiranhaPlantActive = FALSE;
if ((u16)(o->oBehParams >> 16) != 0 && o->oHealth == 0) {
if (++sNumKilledFirePiranhaPlants == 5) {
- create_star(-6300.0f, -1850.0f, -6300.0f);
+ spawn_default_star(-6300.0f, -1850.0f, -6300.0f);
}
obj_die_if_health_non_positive();
@@ -74,20 +74,20 @@ static void fire_piranha_plant_act_hide(void) {
}
} else if (sNumActiveFirePiranhaPlants < 2 && o->oTimer > 100 && o->oDistanceToMario > 100.0f
&& o->oDistanceToMario < 800.0f) {
- PlaySound2(SOUND_OBJ_PIRANHA_PLANT_APPEAR);
+ cur_obj_play_sound_2(SOUND_OBJ_PIRANHA_PLANT_APPEAR);
o->oFirePiranhaPlantActive = TRUE;
sNumActiveFirePiranhaPlants += 1;
- obj_unhide();
+ cur_obj_unhide();
o->oAction = FIRE_PIRANHA_PLANT_ACT_GROW;
o->oMoveAngleYaw = o->oAngleToMario;
} else {
- obj_hide();
+ cur_obj_hide();
}
}
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
}
static void fire_piranha_plant_act_grow(void) {
@@ -96,15 +96,15 @@ static void fire_piranha_plant_act_grow(void) {
if (approach_f32_ptr(&o->oFirePiranhaPlantScale, o->oFirePiranhaPlantNeutralScale,
0.04f * o->oFirePiranhaPlantNeutralScale)) {
if (o->oTimer > 80) {
- PlaySound2(SOUND_OBJ_PIRANHA_PLANT_SHRINK);
+ cur_obj_play_sound_2(SOUND_OBJ_PIRANHA_PLANT_SHRINK);
o->oAction = FIRE_PIRANHA_PLANT_ACT_HIDE;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
} else if (o->oTimer < 50) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
} else { // TODO: Check if we can put these conditionals on same line
if (obj_is_rendering_enabled()) {
- if (obj_check_anim_frame(56)) {
- PlaySound2(SOUND_OBJ_FLAME_BLOWN);
+ if (cur_obj_check_anim_frame(56)) {
+ cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN);
obj_spit_fire(0, (s32)(30.0f * o->oFirePiranhaPlantNeutralScale),
(s32)(140.0f * o->oFirePiranhaPlantNeutralScale),
2.5f * o->oFirePiranhaPlantNeutralScale, MODEL_RED_FLAME_SHADOW,
@@ -113,12 +113,12 @@ static void fire_piranha_plant_act_grow(void) {
}
}
} else if (o->oFirePiranhaPlantScale > o->oFirePiranhaPlantNeutralScale / 2) {
- obj_become_tangible();
+ cur_obj_become_tangible();
}
}
void bhv_fire_piranha_plant_update(void) {
- obj_scale(o->oFirePiranhaPlantScale);
+ cur_obj_scale(o->oFirePiranhaPlantScale);
switch (o->oAction) {
case FIRE_PIRANHA_PLANT_ACT_HIDE:
@@ -135,13 +135,13 @@ void bhv_fire_piranha_plant_update(void) {
sNumActiveFirePiranhaPlants -= 1;
}
} else {
- set_obj_animation_and_sound_state(2);
+ cur_obj_init_animation_with_sound(2);
}
o->oAction = FIRE_PIRANHA_PLANT_ACT_HIDE;
o->oFirePiranhaPlantDeathSpinTimer = 10;
o->oFirePiranhaPlantDeathSpinVel = 8000.0f;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
}
diff --git a/src/game/behaviors/fire_spitter.inc.c b/src/game/behaviors/fire_spitter.inc.c
@@ -20,16 +20,16 @@ static void fire_spitter_act_spit_fire(void) {
if (scaleStatus < 0) {
o->oAction = FIRE_SPITTER_ACT_IDLE;
} else {
- PlaySound2(SOUND_OBJ_FLAME_BLOWN);
+ cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN);
obj_spit_fire(0, 0, 0, 5.0f, MODEL_RED_FLAME_SHADOW, 20.0f, 15.0f, 0x1000);
}
}
}
void bhv_fire_spitter_update(void) {
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
o->oGraphYOffset = 40.0f;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case FIRE_SPITTER_ACT_IDLE:
@@ -40,5 +40,5 @@ void bhv_fire_spitter_update(void) {
break;
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
diff --git a/src/game/behaviors/fish.inc.c b/src/game/behaviors/fish.inc.c
@@ -1,163 +1,280 @@
-// fish.c.inc
+/**
+ * @file fish.inc.c
+ * Implements behaviour and spawning for fish located in the Secret Aquarium and other levels.
+ */
-void ActionFish0(void) {
+/**
+ * Spawns fish with settings chosen by the field o->oBehParams2ndByte.
+ * These settings are animations, colour, and spawn quantity.
+ * Fish spawning restricted to within a set distance from Mario.
+ */
+void fish_act_spawn(void) {
s32 i;
- s32 sp38;
+ s32 schoolQuantity;
s16 model;
- f32 sp30;
- struct Animation **sp2C;
- struct Object *sp28;
+ f32 minDistToMario;
+ struct Animation **fishAnimation;
+ struct Object *fishObject;
switch (o->oBehParams2ndByte) {
+
+ // Blue fish with a quanitiy of twenty.
case 0:
- model = MODEL_FISH; sp38 = 20; sp30 = 1500.0f; sp2C = blue_fish_seg3_anims_0301C2B0;
+ model = MODEL_FISH; schoolQuantity = 20; minDistToMario = 1500.0f; fishAnimation = blue_fish_seg3_anims_0301C2B0;
break;
+
+ // Blue fish with a quanitiy of five.
case 1:
- model = MODEL_FISH; sp38 = 5; sp30 = 1500.0f; sp2C = blue_fish_seg3_anims_0301C2B0;
+ model = MODEL_FISH; schoolQuantity = 5; minDistToMario = 1500.0f; fishAnimation = blue_fish_seg3_anims_0301C2B0;
break;
+
+ // Cyan fish with a quanitiy of twenty.
case 2:
- model = MODEL_CYAN_FISH; sp38 = 20; sp30 = 1500.0f; sp2C = cyan_fish_seg6_anims_0600E264;
+ model = MODEL_CYAN_FISH; schoolQuantity = 20; minDistToMario = 1500.0f; fishAnimation = cyan_fish_seg6_anims_0600E264;
break;
+
+ // Cyan fish with a quanitiy of five.
case 3:
- model = MODEL_CYAN_FISH; sp38 = 5; sp30 = 1500.0f; sp2C = cyan_fish_seg6_anims_0600E264;
+ model = MODEL_CYAN_FISH; schoolQuantity = 5; minDistToMario = 1500.0f; fishAnimation = cyan_fish_seg6_anims_0600E264;
break;
}
- if (o->oDistanceToMario < sp30 || gCurrLevelNum == LEVEL_SA) {
- for (i = 0; i < sp38; i++) {
- sp28 = spawn_object(o, model, bhvFishGroup2);
- sp28->oBehParams2ndByte = o->oBehParams2ndByte;
- func_8029EE20(sp28, sp2C, 0);
- translate_object_xyz_random(sp28, 700.0f);
+ /**
+ * Spawn and animate the schoolQuantity of fish if Mario enters render distance
+ * If the current level is Secret Aquarium, ignore this requirement.
+ * Fish moves at random with a max-range of 700.0f.
+ */
+ if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) {
+ for (i = 0; i < schoolQuantity; i++) {
+ fishObject = spawn_object(o, model, bhvFish);
+ fishObject->oBehParams2ndByte = o->oBehParams2ndByte;
+ obj_init_animation_with_sound(fishObject, fishAnimation, 0);
+ obj_translate_xyz_random(fishObject, 700.0f);
}
- o->oAction = 1;
+ o->oAction = FISH_ACT_ACTIVE;
}
}
-void ActionFish1(void) {
- if (gCurrLevelNum != LEVEL_SA)
- if (gMarioObject->oPosY - o->oPosY > 2000.0f)
- o->oAction = 2;
+/**
+ * If the current level is not Secret Aquarium and the distance from Mario's
+ * Y coordinate is greater than 2000.0f then spawn another fish.
+ */
+void fish_act_respawn(void) {
+ if (gCurrLevelNum != LEVEL_SA) {
+ if (gMarioObject->oPosY - o->oPosY > 2000.0f) {
+ o->oAction = FISH_ACT_RESPAWN;
+ }
+ }
}
-void ActionFish2(void) {
- o->oAction = 0;
+/**
+ * Sets the next call of sFishActions to spawn a new fish.
+ */
+void fish_act_init(void) {
+ o->oAction = FISH_ACT_INIT;
}
-void (*sFishActions[])(void) = { ActionFish0, ActionFish1, ActionFish2 };
+/**
+ * An array of action methods chosen one at a time by bhv_fish_loop
+ */
+void (*sFishActions[])(void) = {
+ fish_act_spawn, fish_act_respawn, fish_act_init
+};
-void bhv_fish_loop(void) {
- obj_call_action_function(sFishActions);
+void bhv_large_fish_group_loop(void) {
+ cur_obj_call_action_function(sFishActions);
}
-void func_802BF59C(s32 a0) {
- f32 sp1C = o->parentObj->oPosY;
+/**
+ * Adjusts the Y coordinate of fish depending on circumstances
+ * such as proximity to other fish.
+ */
+void fish_regroup(s32 speed) {
+ // Store parentY for calculating when the fish should move towards oFishPosY.
+ f32 parentY = o->parentObj->oPosY;
+
+ // Sets speed of fish in SA to a leisurely speed of 10 when close to other fish.
if (gCurrLevelNum == LEVEL_SA) {
- if (500.0f < absf(o->oPosY - o->oFishGroupUnkF8))
- a0 = 10;
- o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishGroupUnkF8, a0);
- } else if (sp1C - 100.0f - o->oFishGroupUnk10C < o->oPosY
- && o->oPosY < sp1C + 1000.0f + o->oFishGroupUnk10C)
- o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishGroupUnkF8, a0);
+ if (500.0f < absf(o->oPosY - o->oFishPosY)) {
+ speed = 10;
+ }
+ // Applies movement to fish.
+ o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishPosY, speed);
+ /**
+ * Brings fish Y coordinate towards another fish if they are too far apart.
+ */
+ } else if (parentY - 100.0f - o->oFishDepthDistance < o->oPosY
+ && o->oPosY < parentY + 1000.0f + o->oFishDepthDistance) {
+ o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishPosY, speed);
+ }
}
-
-void ActionFishGroup1(void) {
- f32 sp1C = o->oPosY - gMarioObject->oPosY;
- if (o->oTimer < 10)
- func_8029ED98(0, 2.0f);
- else
- func_8029ED98(0, 1.0f);
+/**
+ * Moves fish forward at a random velocity and sets a random rotation.
+ */
+void fish_group_act_rotation(void) {
+ f32 fishY = o->oPosY - gMarioObject->oPosY;
+
+ // Alters speed of animation for natural movement.
+ if (o->oTimer < 10) {
+ cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
+ } else {
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
+ }
+
+ /**
+ * Assigns oForwardVel, oFishRandomOffset, & oFishRespawnDistance to a random floats.
+ * Determines fish movement.
+ */
if (o->oTimer == 0) {
o->oForwardVel = RandomFloat() * 2 + 3.0f;
- if (gCurrLevelNum == LEVEL_SA)
- o->oFishGroupUnkFC = RandomFloat() * 700.0f;
- else
- o->oFishGroupUnkFC = RandomFloat() * 100.0f;
- o->oFishGroupUnk104 = RandomFloat() * 500 + 200.0f;
- }
- o->oFishGroupUnkF8 = gMarioObject->oPosY + o->oFishGroupUnkFC;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
- if (o->oPosY < o->oFishGroupUnkF4 - 50.0f) {
- if (sp1C < 0.0f)
- sp1C = 0.0f - sp1C;
- if (sp1C < 500.0f)
- func_802BF59C(2);
- else
- func_802BF59C(4);
+ if (gCurrLevelNum == LEVEL_SA) {
+ o->oFishRandomOffset = RandomFloat() * 700.0f;
+ } else {
+ o->oFishRandomOffset = RandomFloat() * 100.0f;
+ }
+ o->oFishRespawnDistance = RandomFloat() * 500 + 200.0f;
+ }
+
+ // Interact with Mario through rotating towards him.
+ o->oFishPosY = gMarioObject->oPosY + o->oFishRandomOffset;
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+
+ // If fish groups are too close, call fish_regroup()
+ if (o->oPosY < o->oFishWaterLevel - 50.0f) {
+ if (fishY < 0.0f) {
+ fishY = 0.0f - fishY;
+ }
+ if (fishY < 500.0f) {
+ fish_regroup(2);
+ } else {
+ fish_regroup(4);
+ }
} else {
- o->oPosY = o->oFishGroupUnkF4 - 50.0f;
- if (sp1C > 300.0f)
+ o->oPosY = o->oFishWaterLevel - 50.0f;
+ if (fishY > 300.0f) {
o->oPosY = o->oPosY - 1.0f;
+ }
+ }
+
+ /**
+ * Delete current fish and create a new one if distance to Mario is
+ * smaller than his distance to oFishRespawnDistance + 150.0f.
+ */
+ if (o->oDistanceToMario < o->oFishRespawnDistance + 150.0f) {
+ o->oAction = FISH_ACT_RESPAWN;
}
- if (o->oDistanceToMario < o->oFishGroupUnk104 + 150.0f)
- o->oAction = 2;
}
-void ActionFishGroup2(void) {
- f32 sp1C = o->oPosY - gMarioObject->oPosY;
- s32 sp18;
- o->oFishGroupUnkF8 = gMarioObject->oPosY + o->oFishGroupUnkFC;
+/**
+ * Interactively maneuver fish in relation to its distance from other fish and Mario.
+ */
+void fish_group_act_move(void) {
+ f32 fishY = o->oPosY - gMarioObject->oPosY;
+ // Marked unused, but has arithmetic performed on it in a useless manner.
+ UNUSED s32 distance;
+ o->oFishPosY = gMarioObject->oPosY + o->oFishRandomOffset;
+ /**
+ * Set fish variables to random floats when timer reaches zero and plays sound effect.
+ * This allows fish to move in seemingly natural patterns.
+ */
if (o->oTimer == 0) {
- o->oFishGroupUnk110 = RandomFloat() * 300.0f;
- o->oFishGroupUnk100 = RandomFloat() * 1024.0f + 1024.0f;
- o->oFishGroupUnk108 = RandomFloat() * 4.0f + 8.0f + 5.0f;
- if (o->oDistanceToMario < 600.0f)
- sp18 = 1;
- else
- sp18 = (s32)(1.0 / (o->oDistanceToMario / 600.0));
- sp18 *= 127;
- PlaySound2(SOUND_GENERAL_MOVING_WATER);
- }
- if (o->oTimer < LEVEL_SA)
- func_8029ED98(0, 4.0f);
- else
- func_8029ED98(0, 1.0f);
- if (o->oForwardVel < o->oFishGroupUnk108)
+ o->oFishActiveDistance = RandomFloat() * 300.0f;
+ o->oFishRandomSpeed = RandomFloat() * 1024.0f + 1024.0f;
+ o->oFishRandomVel = RandomFloat() * 4.0f + 8.0f + 5.0f;
+ if (o->oDistanceToMario < 600.0f) {
+ distance = 1;
+ } else {
+ distance = (s32)(1.0 / (o->oDistanceToMario / 600.0));
+ }
+ distance *= 127;
+ cur_obj_play_sound_2(SOUND_GENERAL_MOVING_WATER);
+ }
+ // Enable fish animation in a natural manner.
+ if (o->oTimer < 20) {
+ cur_obj_init_animation_with_accel_and_sound(0, 4.0f);
+ } else {
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
+ }
+ // Set randomized forward velocity so fish have differing velocities
+ if (o->oForwardVel < o->oFishRandomVel) {
o->oForwardVel = o->oForwardVel + 0.5;
- o->oFishGroupUnkF8 = gMarioObject->oPosY + o->oFishGroupUnkFC;
- obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, o->oFishGroupUnk100);
- if (o->oPosY < o->oFishGroupUnkF4 - 50.0f) {
- if (sp1C < 0.0f)
- sp1C = 0.0f - sp1C;
- if (sp1C < 500.0f)
- func_802BF59C(2);
- else
- func_802BF59C(4);
+ }
+ o->oFishPosY = gMarioObject->oPosY + o->oFishRandomOffset;
+ // Rotate fish away from Mario.
+ cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, o->oFishRandomSpeed);
+ // If fish groups are too close, call fish_regroup()
+ if (o->oPosY < o->oFishWaterLevel - 50.0f) {
+ if (fishY < 0.0f) {
+ fishY = 0.0f - fishY;
+ }
+ if (fishY < 500.0f) {
+ fish_regroup(2);
+ } else {
+ fish_regroup(4);
+ }
} else {
- o->oPosY = o->oFishGroupUnkF4 - 50.0f;
- if (sp1C > 300.0f)
+ o->oPosY = o->oFishWaterLevel - 50.0f;
+ if (fishY > 300.0f) {
o->oPosY -= 1.0f;
+ }
+ }
+ // If distance to Mario is too great, then set fish to active.
+ if (o->oDistanceToMario > o->oFishActiveDistance + 500.0f) {
+ o->oAction = FISH_ACT_ACTIVE;
}
- if (o->oDistanceToMario > o->oFishGroupUnk110 + 500.0f)
- o->oAction = 1;
}
-
-void ActionFishGroup0(void) {
- func_8029ED98(0, 1.0f);
+/**
+ * Animate fish and alter scaling at random for a magnifying effect from the water.
+ */
+void fish_group_act_animate(void) {
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
o->header.gfx.unk38.animFrame = (s16)(RandomFloat() * 28.0f);
- o->oFishGroupUnk10C = RandomFloat() * 300.0f;
- obj_scale(RandomFloat() * 0.4 + 0.8);
- o->oAction = 1;
+ o->oFishDepthDistance = RandomFloat() * 300.0f;
+ cur_obj_scale(RandomFloat() * 0.4 + 0.8);
+ o->oAction = FISH_ACT_ACTIVE;
}
-void (*sFishGroupActions[])(void) = { ActionFishGroup0, ActionFishGroup1, ActionFishGroup2 };
+void (*sFishGroupActions[])(void) = {
+ fish_group_act_animate, fish_group_act_rotation, fish_group_act_move
+};
-void bhv_fish_group_2_loop(void) // TODO rename
+/**
+ * Main loop for fish
+ */
+void bhv_fish_loop(void)
{
UNUSED s32 unused[4];
- obj_scale(1.0f);
- o->oFishGroupUnkF4 = find_water_level(o->oPosX, o->oPosZ);
- if (gCurrLevelNum == LEVEL_SA)
- o->oFishGroupUnkF4 = 0.0f;
+ cur_obj_scale(1.0f);
+
+ /**
+ * Tracks water level to delete fish outside of bounds.
+ * In SA oFishWaterLevel is set to zero because fish cannot exit the water.
+ * This prevents accidental deletion.
+ */
+ o->oFishWaterLevel = find_water_level(o->oPosX, o->oPosZ);
+ if (gCurrLevelNum == LEVEL_SA) {
+ o->oFishWaterLevel = 0.0f;
+ }
+ // Apply hitbox and resolve wall collisions
o->oWallHitboxRadius = 30.0f;
- obj_resolve_wall_collisions();
+ cur_obj_resolve_wall_collisions();
+
+ // Delete fish below the water depth bounds of -10000.0f.
if (gCurrLevelNum != LEVEL_UNKNOWN_32) {
- if (o->oFishGroupUnkF4 < -10000.0f) {
- mark_object_for_deletion(o);
+ if (o->oFishWaterLevel < -10000.0f) {
+ obj_mark_for_deletion(o);
return;
}
- } else
- o->oFishGroupUnkF4 = 1000.0f;
- obj_call_action_function(sFishGroupActions);
- obj_move_using_fvel_and_gravity();
- if (o->parentObj->oAction == 2)
- mark_object_for_deletion(o);
+
+ // Unreachable code, perhaps for debugging or testing.
+ } else {
+ o->oFishWaterLevel = 1000.0f;
+ }
+
+ // Call fish action methods and apply physics engine.
+ cur_obj_call_action_function(sFishGroupActions);
+ cur_obj_move_using_fvel_and_gravity();
+
+ // If the parent object has action set to two, then delete the fish object.
+ if (o->parentObj->oAction == FISH_ACT_RESPAWN) {
+ obj_mark_for_deletion(o);
+ }
}
diff --git a/src/game/behaviors/fishing_boo.inc.c b/src/game/behaviors/fishing_boo.inc.c
@@ -31,7 +31,7 @@ void bhv_beta_moving_flames_spawn_loop(void) {
}
void bhv_beta_moving_flames_loop(void) {
- obj_scale(5.0f);
+ cur_obj_scale(5.0f);
o->oForwardVel = sins(o->oMovingFlameTimer) * 70.0f;
o->oMovingFlameTimer += 0x800;
}
diff --git a/src/game/behaviors/flame.inc.c b/src/game/behaviors/flame.inc.c
@@ -5,7 +5,7 @@ void bhv_small_piranha_flame_loop(void) {
if ((u16)(o->oBehParams >> 16) == 0) {
if (o->oTimer > 0) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
sp2C = RandomFloat() - 0.5f;
o->header.gfx.scale[1] = o->header.gfx.scale[2] * (1.0f + 0.7f * sp2C);
@@ -14,13 +14,13 @@ void bhv_small_piranha_flame_loop(void) {
o->oAnimState = RandomU16();
}
} else {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (approach_f32_ptr(&o->oSmallPiranhaFlameUnkF4, o->oSmallPiranhaFlameUnkF8, 0.6f)) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
}
obj_compute_vel_from_move_pitch(o->oSmallPiranhaFlameUnkF4);
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
spawn_object_with_scale(o, o->oSmallPiranhaFlameUnkFC, bhvSmallPiranhaFlame,
0.4f * o->header.gfx.scale[0]);
@@ -43,11 +43,11 @@ void bhv_small_piranha_flame_loop(void) {
}
void bhv_fly_guy_flame_loop(void) {
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (approach_f32_ptr(&o->header.gfx.scale[0], 0.0f, 0.6f)) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
}
diff --git a/src/game/behaviors/flame_mario.inc.c b/src/game/behaviors/flame_mario.inc.c
@@ -17,7 +17,7 @@ void bhv_black_smoke_bowser_loop(void) {
void bhv_black_smoke_mario_loop(void) {
if (o->oTimer == 0) {
- obj_set_pos_relative(gMarioObject, 0, 0, -30.0f);
+ cur_obj_set_pos_relative(gMarioObject, 0, 0, -30.0f);
o->oForwardVel = RandomFloat() * 2 + 0.5;
o->oMoveAngleYaw = (gMarioObject->oMoveAngleYaw + 0x7000) + RandomFloat() * 8192.0f;
o->oVelY = 8;
@@ -27,15 +27,15 @@ void bhv_black_smoke_mario_loop(void) {
}
void bhv_flame_mario_loop(void) {
- obj_scale(2.0f);
+ cur_obj_scale(2.0f);
if (o->oTimer != 0)
if (o->oTimer & 1)
spawn_object(o, MODEL_BURN_SMOKE, bhvBlackSmokeMario);
gMarioObject->prevObj = o; // weird?
- set_object_parent_relative_pos(o, 40, -120, 0);
+ obj_set_parent_relative_pos(o, 40, -120, 0);
if (!(gMarioObject->oMarioParticleFlags & 0x800)) {
o->parentObj->oActiveParticleFlags &= ~0x800;
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
gMarioObject->prevObj = NULL;
}
}
diff --git a/src/game/behaviors/flamethrower.inc.c b/src/game/behaviors/flamethrower.inc.c
@@ -5,7 +5,7 @@ void bhv_flamethrower_flame_loop(void) {
s32 sp18;
if (o->oTimer == 0) {
o->oAnimState = (s32)(RandomFloat() * 10.0f);
- translate_object_xyz_random(o, 10.0f);
+ obj_translate_xyz_random(o, 10.0f);
}
if (o->oBehParams2ndByte == 2)
size = o->oTimer * (o->oForwardVel - 6.0f) / 100.0 + 2.0;
@@ -15,7 +15,7 @@ void bhv_flamethrower_flame_loop(void) {
o->hitboxHeight = 200.0f;
o->hitboxDownOffset = 150.0f;
o->oVelY = -28.0f;
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (o->oPosY - 25.0f * size < o->oFloorHeight) {
o->oVelY = 0;
o->oPosY = o->oFloorHeight + 25.0f * size;
@@ -23,13 +23,13 @@ void bhv_flamethrower_flame_loop(void) {
sp18 = o->parentObj->oFlameThowerFlameUnk110 / 1.2;
} else
sp18 = o->parentObj->oFlameThowerFlameUnk110;
- obj_scale(size);
+ cur_obj_scale(size);
if (o->oBehParams2ndByte == 4)
o->oPosY += o->oForwardVel; // weird?
else
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oTimer > sp18)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oInteractStatus = 0;
}
@@ -60,7 +60,7 @@ void bhv_flamethrower_loop(void) {
o->oFlameThowerUnk110 = sp34;
flame = spawn_object_relative(o->oBehParams2ndByte, 0, 0, 0, o, model, bhvFlamethrowerFlame);
flame->oForwardVel = flameVel;
- PlaySound(SOUND_AIR_BLOW_FIRE);
+ cur_obj_play_sound_1(SOUND_AIR_BLOW_FIRE);
} else if (o->oTimer > 60)
o->oAction = 0;
}
diff --git a/src/game/behaviors/floating_platform.inc.c b/src/game/behaviors/floating_platform.inc.c
@@ -1,6 +1,6 @@
// floating_platform.c.inc
-f32 func_802F54F8(void) {
+f32 floating_platform_find_home_y(void) {
struct Surface *sp24;
f32 sp20;
f32 sp1C;
@@ -16,7 +16,7 @@ f32 func_802F54F8(void) {
}
}
-void func_802F55CC(void) {
+void floating_platform_act_0(void) {
s16 sp6 = (gMarioObject->header.gfx.pos[0] - o->oPosX) * coss(-1*o->oMoveAngleYaw)
+ (gMarioObject->header.gfx.pos[2] - o->oPosZ) * sins(-1*o->oMoveAngleYaw);
s16 sp4 = (gMarioObject->header.gfx.pos[2] - o->oPosZ) * coss(-1*o->oMoveAngleYaw)
@@ -48,7 +48,7 @@ void func_802F55CC(void) {
}
void bhv_floating_platform_loop(void) {
- o->oHomeY = func_802F54F8();
+ o->oHomeY = floating_platform_find_home_y();
if (o->oFloatingPlatformUnkF4 == 0)
o->oAction = 0;
else
@@ -56,7 +56,7 @@ void bhv_floating_platform_loop(void) {
switch (o->oAction) {
case 0:
- func_802F55CC();
+ floating_platform_act_0();
break;
case 1:
diff --git a/src/game/behaviors/fly_guy.inc.c b/src/game/behaviors/fly_guy.inc.c
@@ -34,7 +34,7 @@ static void fly_guy_act_idle(void) {
if (o->oDistanceToMario >= 25000.0f || o->oDistanceToMario < 2000.0f) {
// Turn toward home or Mario
obj_face_yaw_approach(o->oAngleToMario, 0x300);
- if (obj_rotate_yaw_toward(o->oAngleToMario, 0x300)) {
+ if (cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x300)) {
o->oAction = FLY_GUY_ACT_APPROACH_MARIO;
}
} else {
@@ -62,7 +62,7 @@ static void fly_guy_act_approach_mario(void) {
// Turn toward home or Mario
obj_face_yaw_approach(o->oAngleToMario, 0x400);
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
// If facing toward mario and we are either near mario laterally or
// far above him
@@ -97,7 +97,7 @@ static void fly_guy_act_lunge(void) {
o->oVelY += o->oFlyGuyLungeYDecel;
- obj_rotate_yaw_toward(o->oFaceAngleYaw, 0x800);
+ cur_obj_rotate_yaw_toward(o->oFaceAngleYaw, 0x800);
obj_face_pitch_approach(o->oFlyGuyLungeTargetPitch, 0x400);
// Range [-0x1000, 0x2000]
@@ -149,7 +149,7 @@ static void fly_guy_act_shoot_fire(void) {
} else {
// We have reached below scale 1.2 in the shrinking portion
s16 fireMovePitch = obj_turn_pitch_toward_mario(0.0f, 0);
- PlaySound2(SOUND_OBJ_FLAME_BLOWN);
+ cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN);
clamp_s16(&fireMovePitch, 0x800, 0x3000);
obj_spit_fire(
@@ -179,12 +179,12 @@ void bhv_fly_guy_update(void) {
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
o->oDeathSound = SOUND_OBJ_KOOPA_FLYGUY_DEATH;
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
treat_far_home_as_mario(2000.0f);
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
} else if (o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) {
o->oVelY = 6.0f;
}
@@ -208,7 +208,7 @@ void bhv_fly_guy_update(void) {
break;
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
obj_check_attacks(&sFlyGuyHitbox, o->oAction);
}
}
diff --git a/src/game/behaviors/flying_bookend_switch.inc.c b/src/game/behaviors/flying_bookend_switch.inc.c
@@ -37,11 +37,11 @@ struct ObjectHitbox sBookSwitchHitbox = {
void flying_bookend_act_0(void) {
if (obj_is_near_to_and_facing_mario(400.0f, 0x3000)) {
- PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
+ cur_obj_play_sound_2(SOUND_OBJ_DEFAULT_DEATH);
o->oAction = 1;
o->oBookendUnkF4 = o->oFaceAnglePitch + 0x7FFF;
o->oBookendUnkF8 = o->oFaceAngleRoll - 0x7FFF;
- obj_set_model(MODEL_BOOKEND_PART);
+ cur_obj_set_model(MODEL_BOOKEND_PART);
}
}
@@ -64,24 +64,24 @@ void flying_bookend_act_1(void) {
}
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
void flying_bookend_act_2(void) {
- set_obj_animation_and_sound_state(1);
- obj_update_floor_and_walls();
+ cur_obj_init_animation_with_sound(1);
+ cur_obj_update_floor_and_walls();
if (o->oForwardVel == 0.0f) {
obj_turn_pitch_toward_mario(120.0f, 1000);
o->oFaceAnglePitch = o->oMoveAnglePitch + 0x7FFF;
- obj_rotate_yaw_toward(o->oAngleToMario, 1000);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 1000);
if (o->oTimer > 30) {
obj_compute_vel_from_move_pitch(50.0f);
}
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
void flying_bookend_act_3(void) {
@@ -94,13 +94,13 @@ void flying_bookend_act_3(void) {
}
obj_forward_vel_approach(50.0f, 2.0f);
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
void bhv_flying_bookend_loop(void) {
if (!(o->activeFlags & 0x0008)) {
o->oDeathSound = SOUND_OBJ_POUNDING1;
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
switch (o->oAction) {
case 0:
@@ -135,7 +135,7 @@ void bhv_bookend_spawn_loop(void) {
sp1C = spawn_object(o, MODEL_BOOKEND, bhvFlyingBookend);
if (sp1C != NULL) {
sp1C->oAction = 3;
- PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
+ cur_obj_play_sound_2(SOUND_OBJ_DEFAULT_DEATH);
}
o->oTimer = 0;
}
@@ -177,7 +177,7 @@ void bookshelf_manager_act_2(void) {
} else {
if (o->oBookSwitchManagerUnkF4 >= 3) {
if (o->oTimer > 100) {
- o->parentObj = obj_nearest_object_with_behavior(bhvHauntedBookshelf);
+ o->parentObj = cur_obj_nearest_object_with_behavior(bhvHauntedBookshelf);
o->parentObj->oAction = 1;
o->oPosX = o->parentObj->oPosX;
o->oAction = 3;
@@ -204,7 +204,7 @@ void bookshelf_manager_act_3(void) {
void bookshelf_manager_act_4(void) {
if (o->oBookSwitchManagerUnkF4 >= 3) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->oAction = 0;
}
@@ -240,19 +240,19 @@ void bhv_book_switch_loop(void) {
o->header.gfx.scale[1] = 0.9f;
if (o->parentObj->oAction == 4) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
sp3C = obj_check_attacks(&sBookSwitchHitbox, o->oAction);
if (o->parentObj->oBookSwitchManagerUnkF8 != 0 || o->oAction == 1) {
if (o->oDistanceToMario < 100.0f) {
- obj_become_tangible();
+ cur_obj_become_tangible();
} else {
- obj_become_intangible();
+ cur_obj_become_intangible();
}
o->oAction = 1;
if (o->oBookSwitchUnkF4 == 0.0f) {
- PlaySound2(SOUND_OBJ_DEFAULT_DEATH);
+ cur_obj_play_sound_2(SOUND_OBJ_DEFAULT_DEATH);
}
if (approach_f32_ptr(&o->oBookSwitchUnkF4, 50.0f, 20.0f)) {
@@ -265,7 +265,7 @@ void bhv_book_switch_loop(void) {
o->oTimer = 0;
}
} else {
- obj_become_intangible();
+ cur_obj_become_intangible();
if (approach_f32_ptr(&o->oBookSwitchUnkF4, 0.0f, 20.0f)) {
if (o->oAction != 0) {
if (o->parentObj->oBookSwitchManagerUnkF4 == o->oBehParams2ndByte) {
@@ -298,6 +298,6 @@ void bhv_book_switch_loop(void) {
o->oPosX += o->parentObj->oForwardVel;
o->oPosZ = o->oHomeZ - o->oBookSwitchUnkF4;
- obj_push_mario_away_from_cylinder(70.0f, 70.0f);
+ cur_obj_push_mario_away_from_cylinder(70.0f, 70.0f);
}
}
diff --git a/src/game/behaviors/goomba.inc.c b/src/game/behaviors/goomba.inc.c
@@ -115,7 +115,7 @@ void bhv_goomba_init(void) {
o->oGoombaScale = sGoombaProperties[o->oGoombaSize].scale;
o->oDeathSound = sGoombaProperties[o->oGoombaSize].deathSound;
- set_object_hitbox(o, &sGoombaHitbox);
+ obj_set_hitbox(o, &sGoombaHitbox);
o->oDrawingDistance = sGoombaProperties[o->oGoombaSize].drawDistance;
o->oDamageOrCoinValue = sGoombaProperties[o->oGoombaSize].damage;
@@ -127,7 +127,7 @@ void bhv_goomba_init(void) {
* Enter the jump action and set initial y velocity.
*/
static void goomba_begin_jump(void) {
- PlaySound2(SOUND_OBJ_GOOMBA_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ_GOOMBA_ALERT);
o->oAction = GOOMBA_ACT_JUMP;
o->oForwardVel = 0.0f;
o->oVelY = 50.0f / 3.0f * o->oGoombaScale;
@@ -209,7 +209,7 @@ static void goomba_act_walk(void) {
}
}
- obj_rotate_yaw_toward(o->oGoombaTargetYaw, 0x200);
+ cur_obj_rotate_yaw_toward(o->oGoombaTargetYaw, 0x200);
}
}
@@ -247,7 +247,7 @@ static void goomba_act_jump(void) {
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
o->oAction = GOOMBA_ACT_WALK;
} else {
- obj_rotate_yaw_toward(o->oGoombaTargetYaw, 0x800);
+ cur_obj_rotate_yaw_toward(o->oGoombaTargetYaw, 0x800);
}
}
@@ -274,18 +274,18 @@ void bhv_goomba_update(void) {
// unload
if (o->parentObj != o) {
if (o->parentObj->oAction == GOOMBA_TRIPLET_SPAWNER_ACT_UNLOADED) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
- obj_scale(o->oGoombaScale);
+ cur_obj_scale(o->oGoombaScale);
obj_update_blinking(&o->oGoombaBlinkTimer, 30, 50, 5);
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if ((animSpeed = o->oForwardVel / o->oGoombaScale * 0.4f) < 1.0f) {
animSpeed = 1.0f;
}
- func_8029ED98(0, animSpeed);
+ cur_obj_init_animation_with_accel_and_sound(0, animSpeed);
switch (o->oAction) {
case GOOMBA_ACT_WALK:
@@ -310,7 +310,7 @@ void bhv_goomba_update(void) {
mark_goomba_as_dead();
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
} else {
o->oAnimState = TRUE;
}
diff --git a/src/game/behaviors/grand_star.inc.c b/src/game/behaviors/grand_star.inc.c
@@ -1,6 +1,6 @@
// grand_star.c.inc
-s32 func_802B2894(Vec3f a0, Vec3f a1, f32 yVel, f32 gravity) {
+s32 arc_to_goal_pos(Vec3f a0, Vec3f a1, f32 yVel, f32 gravity) {
f32 dx = a0[0] - a1[0];
f32 dz = a0[2] - a1[2];
f32 planarDist = sqrtf(dx * dx + dz * dz);
@@ -13,7 +13,7 @@ s32 func_802B2894(Vec3f a0, Vec3f a1, f32 yVel, f32 gravity) {
return time;
}
-void func_802B29B0(void) {
+void grand_star_zero_velocity(void) {
o->oGravity = 0.0f;
o->oVelY = 0.0f;
o->oForwardVel = 0.0f;
@@ -25,48 +25,48 @@ void bhv_grand_star_loop(void) {
sp28[0] = sp28[1] = sp28[2] = 0.0f;
if (o->oAction == 0) {
if (o->oTimer == 0) {
- set_object_angle(o, 0, 0, 0);
+ obj_set_angle(o, 0, 0, 0);
o->oAngleVelYaw = 0x400;
- PlaySound2(SOUND_GENERAL2_STAR_APPEARS);
+ cur_obj_play_sound_2(SOUND_GENERAL2_STAR_APPEARS);
}
if (o->oTimer > 70)
o->oAction++;
- func_802B2328(3, 200, 80, -60);
+ spawn_sparkle_particles(3, 200, 80, -60);
} else if (o->oAction == 1) {
if (o->oTimer == 0) {
- PlaySound2(SOUND_GENERAL_GRAND_STAR);
+ cur_obj_play_sound_2(SOUND_GENERAL_GRAND_STAR);
cutscene_object(CUTSCENE_STAR_SPAWN, o);
- o->oGrandStarUnk108 = func_802B2894(sp28, &o->oPosX, 80.0f, -2.0f);
+ o->oGrandStarUnk108 = arc_to_goal_pos(sp28, &o->oPosX, 80.0f, -2.0f);
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oSubAction == 0) {
if (o->oPosY < o->oHomeY) {
o->oPosY = o->oHomeY;
o->oVelY = 60.0f;
o->oForwardVel = 0.0f;
o->oSubAction++;
- PlaySound2(SOUND_GENERAL_GRAND_STAR_JUMP);
+ cur_obj_play_sound_2(SOUND_GENERAL_GRAND_STAR_JUMP);
}
} else if (o->oVelY < 0.0f && o->oPosY < o->oHomeY + 200.0f) {
o->oPosY = o->oHomeY + 200.0f;
- func_802B29B0();
+ grand_star_zero_velocity();
gObjCutsceneDone = 1;
set_mario_npc_dialog(0);
o->oAction++;
o->oInteractStatus = 0;
- PlaySound2(SOUND_GENERAL_GRAND_STAR_JUMP);
+ cur_obj_play_sound_2(SOUND_GENERAL_GRAND_STAR_JUMP);
}
- func_802B2328(3, 200, 80, -60);
+ spawn_sparkle_particles(3, 200, 80, -60);
} else {
- obj_become_tangible();
+ cur_obj_become_tangible();
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oInteractStatus = 0;
}
}
if (o->oAngleVelYaw > 0x400)
o->oAngleVelYaw -= 0x100;
o->oFaceAngleYaw += o->oAngleVelYaw;
- obj_scale(2.0f);
+ cur_obj_scale(2.0f);
o->oGraphYOffset = 110.0f;
}
diff --git a/src/game/behaviors/grill_door.inc.c b/src/game/behaviors/grill_door.inc.c
@@ -26,14 +26,14 @@ void bhv_openable_grill_loop(void) {
sp3C = spawn_object_relative(-1, D_8032FCE8[sp38].unk0, 0, 0, o, D_8032FCE8[sp38].unk1,
bhvOpenableCageDoor);
sp3C->oMoveAngleYaw += 0x8000;
- set_object_collision_data(sp3C, D_8032FCE8[sp38].unk2);
+ obj_set_collision_data(sp3C, D_8032FCE8[sp38].unk2);
sp3C = spawn_object_relative(1, -D_8032FCE8[sp38].unk0, 0, 0, o, D_8032FCE8[sp38].unk1,
bhvOpenableCageDoor);
- set_object_collision_data(sp3C, D_8032FCE8[sp38].unk2);
+ obj_set_collision_data(sp3C, D_8032FCE8[sp38].unk2);
o->oAction++;
break;
case 1:
- if ((o->oOpenableGrillUnkF4 = obj_nearest_object_with_behavior(bhvFloorSwitchGrills))
+ if ((o->oOpenableGrillUnkF4 = cur_obj_nearest_object_with_behavior(bhvFloorSwitchGrills))
!= NULL)
o->oAction++;
break;
@@ -41,7 +41,7 @@ void bhv_openable_grill_loop(void) {
sp3C = o->oOpenableGrillUnkF4;
if (sp3C->oAction == 2) {
o->oOpenableGrillUnk88 = 2;
- PlaySound2(SOUND_GENERAL_CAGE_OPEN);
+ cur_obj_play_sound_2(SOUND_GENERAL_CAGE_OPEN);
o->oAction++;
if (o->oBehParams2ndByte != 0)
play_puzzle_jingle();
diff --git a/src/game/behaviors/ground_particles.inc.c b/src/game/behaviors/ground_particles.inc.c
@@ -1,33 +1,33 @@
// ground_particles.c.inc
void bhv_pound_white_puffs_init(void) {
- func_802ADBBC(0x8000);
- func_802ADA94();
+ clear_particle_flags(0x8000);
+ spawn_mist_from_global();
}
-void func_802ADA94(void) {
- obj_spawn_particles(&D_8032F3CC);
+void spawn_mist_from_global(void) {
+ cur_obj_spawn_particles(&D_8032F3CC);
}
-void bhv_unused_0e40_init(void) {
- func_802ADBBC(0x4000);
- obj_spawn_particles(&D_8032F3E0);
+void bhv_ground_sand_init(void) {
+ clear_particle_flags(0x4000);
+ cur_obj_spawn_particles(&D_8032F3E0);
}
-void Unknown802ADAF4(void) {
+void spawn_smoke_with_velocity(void) {
struct Object *smoke = spawn_object_with_scale(o, MODEL_SMOKE, bhvWhitePuffSmoke2, 1.0f);
smoke->oForwardVel = D_8032F3F4[0];
smoke->oVelY = D_8032F3F4[1];
smoke->oGravity = D_8032F3F4[2];
- translate_object_xyz_random(smoke, D_8032F3F4[3]);
+ obj_translate_xyz_random(smoke, D_8032F3F4[3]);
}
// TODO Fix name
-void func_802ADBBC(u32 flags) {
+void clear_particle_flags(u32 flags) {
o->parentObj->oActiveParticleFlags &= flags ^ -1; // Clear the flags given (could just be ~flags)
}
void bhv_ground_snow_init(void) {
- func_802ADBBC(1 << 16);
- obj_spawn_particles(&D_8032F3FC);
+ clear_particle_flags(1 << 16);
+ cur_obj_spawn_particles(&D_8032F3FC);
}
diff --git a/src/game/behaviors/haunted_chair.inc.c b/src/game/behaviors/haunted_chair.inc.c
@@ -16,7 +16,7 @@ void bhv_haunted_chair_init(void) {
struct Object *val04;
f32 val00;
- val04 = obj_find_nearest_object_with_behavior(bhvMadPiano, &val00);
+ val04 = cur_obj_find_nearest_object_with_behavior(bhvMadPiano, &val00);
if (val04 != NULL && val00 < 300.0f) {
o->parentObj = val04;
} else {
@@ -31,7 +31,7 @@ void haunted_chair_act_0(void) {
if (o->parentObj != o) {
if (o->oHauntedChairUnk104 == 0) {
if (lateral_dist_between_objects(o, o->parentObj) < 250.0f) {
- val0E = angle_to_object(o, o->parentObj) - o->oFaceAngleYaw + 0x2000;
+ val0E = obj_angle_to_object(o, o->parentObj) - o->oFaceAngleYaw + 0x2000;
if (val0E & 0x4000) {
o->oHauntedChairUnk100 = &o->oFaceAngleRoll;
if (val0E > 0) {
@@ -66,7 +66,7 @@ void haunted_chair_act_0(void) {
} else {
if ((o->oTimer & 0x8) != 0) {
if (o->oFaceAnglePitch < 0) {
- PlaySound2(SOUND_GENERAL_HAUNTED_CHAIR_MOVE);
+ cur_obj_play_sound_2(SOUND_GENERAL_HAUNTED_CHAIR_MOVE);
val08 = 4.0f;
} else {
val08 = -4.0f;
@@ -89,11 +89,11 @@ void haunted_chair_act_0(void) {
}
}
- obj_push_mario_away_from_cylinder(80.0f, 120.0f);
+ cur_obj_push_mario_away_from_cylinder(80.0f, 120.0f);
}
void haunted_chair_act_1(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oTimer < 70) {
if (o->oTimer < 50) {
@@ -108,13 +108,13 @@ void haunted_chair_act_1(void) {
} else {
if (o->oHauntedChairUnkF4 != 0) {
if (--o->oHauntedChairUnkF4 == 0) {
- PlaySound2(SOUND_GENERAL_HAUNTED_CHAIR);
+ cur_obj_play_sound_2(SOUND_GENERAL_HAUNTED_CHAIR);
o->oMoveAnglePitch = obj_turn_pitch_toward_mario(120.0f, 0);
o->oMoveAngleYaw = o->oAngleToMario;
obj_compute_vel_from_move_pitch(50.0f);
} else if (o->oHauntedChairUnkF4 > 20) {
if (gGlobalTimer % 4 == 0) {
- PlaySound2(SOUND_GENERAL_SWISH_AIR_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_AIR_2);
}
o->oFaceAngleYaw += 0x2710;
}
@@ -124,7 +124,7 @@ void haunted_chair_act_1(void) {
}
obj_check_attacks(&sHauntedChairHitbox, o->oAction);
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
void bhv_haunted_chair_loop(void) {
diff --git a/src/game/behaviors/heave_ho.inc.c b/src/game/behaviors/heave_ho.inc.c
@@ -14,7 +14,7 @@ void bhv_heave_ho_throw_mario_loop(void) {
case 1:
break;
case 2:
- PlaySound2(SOUND_OBJ_HEAVEHO_TOSSED);
+ cur_obj_play_sound_2(SOUND_OBJ_HEAVEHO_TOSSED);
gMarioObject->oInteractStatus |= INT_STATUS_MARIO_UNK2;
gMarioStates->forwardVel = -45.0f;
gMarioStates->vel[1] = 95.0f;
@@ -23,28 +23,28 @@ void bhv_heave_ho_throw_mario_loop(void) {
}
}
-void ActionHeaveHo1(void) {
+void heave_ho_act_1(void) {
s32 sp1C = 0;
o->oForwardVel = 0.0f;
- func_8029F6F0();
+ cur_obj_reverse_animation();
while (1) {
if (D_8032F460[sp1C][0] == -1) {
o->oAction = 2;
break;
}
if (o->oTimer < D_8032F460[sp1C][0]) {
- func_8029ED98(2, D_8032F460[sp1C][1]);
+ cur_obj_init_animation_with_accel_and_sound(2, D_8032F460[sp1C][1]);
break;
}
sp1C++;
}
}
-void ActionHeaveHo2(void) {
+void heave_ho_act_2(void) {
UNUSED s32 unused;
s16 angleVel;
- if (1000.0f < obj_lateral_dist_from_mario_to_home())
- o->oAngleToMario = obj_angle_to_home();
+ if (1000.0f < cur_obj_lateral_dist_from_mario_to_home())
+ o->oAngleToMario = cur_obj_angle_to_home();
if (o->oTimer > 150) {
o->oHeaveHoUnkF4 = (302 - o->oTimer) / 152.0f;
if (o->oHeaveHoUnkF4 < 0.1) {
@@ -53,48 +53,48 @@ void ActionHeaveHo2(void) {
}
} else
o->oHeaveHoUnkF4 = 1.0f;
- func_8029ED98(0, o->oHeaveHoUnkF4);
+ cur_obj_init_animation_with_accel_and_sound(0, o->oHeaveHoUnkF4);
o->oForwardVel = o->oHeaveHoUnkF4 * 10.0f;
angleVel = o->oHeaveHoUnkF4 * 0x400;
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, angleVel);
}
-void ActionHeaveHo3(void) {
+void heave_ho_act_3(void) {
o->oForwardVel = 0.0f;
if (o->oTimer == 0)
o->oHeaveHoUnk88 = 2;
if (o->oTimer == 1) {
- func_8029ED98(1, 1.0f);
+ cur_obj_init_animation_with_accel_and_sound(1, 1.0f);
o->numCollidedObjs = 20;
}
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oAction = 1;
}
-void ActionHeaveHo0(void) {
- obj_set_pos_to_home();
+void heave_ho_act_0(void) {
+ cur_obj_set_pos_to_home();
if (find_water_level(o->oPosX, o->oPosZ) < o->oPosY && o->oDistanceToMario < 4000.0f) {
- obj_become_tangible();
- obj_unhide();
+ cur_obj_become_tangible();
+ cur_obj_unhide();
o->oAction = 1;
} else {
- obj_become_intangible();
- obj_hide();
+ cur_obj_become_intangible();
+ cur_obj_hide();
}
}
-void (*sHeaveHoActions[])(void) = { ActionHeaveHo0, ActionHeaveHo1, ActionHeaveHo2, ActionHeaveHo3 };
+void (*sHeaveHoActions[])(void) = { heave_ho_act_0, heave_ho_act_1, heave_ho_act_2, heave_ho_act_3 };
-void func_802B18B4(void) {
- obj_update_floor_and_walls();
- obj_call_action_function(sHeaveHoActions);
- obj_move_standard(-78);
+void heave_ho_move(void) {
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sHeaveHoActions);
+ cur_obj_move_standard(-78);
if (o->oMoveFlags & (0x40 | 0x20 | 0x10 | 0x8))
o->oGraphYOffset = -15.0f;
else
o->oGraphYOffset = 0.0f;
if (o->oForwardVel > 3.0f)
- PlaySound(SOUND_AIR_HEAVEHO_MOVE);
+ cur_obj_play_sound_1(SOUND_AIR_HEAVEHO_MOVE);
if (o->oAction != 0 && o->oMoveFlags & (0x40 | 0x20 | 0x10 | 0x8))
o->oAction = 0;
if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) {
@@ -105,19 +105,19 @@ void func_802B18B4(void) {
}
void bhv_heave_ho_loop(void) {
- obj_scale(2.0f);
+ cur_obj_scale(2.0f);
switch (o->oHeldState) {
case HELD_FREE:
- func_802B18B4();
+ heave_ho_move();
break;
case HELD_HELD:
- func_8029FA5C(0, 0);
+ cur_obj_unrender_and_reset_state(0, 0);
break;
case HELD_THROWN:
- obj_get_dropped();
+ cur_obj_get_dropped();
break;
case HELD_DROPPED:
- obj_get_dropped();
+ cur_obj_get_dropped();
break;
}
o->oInteractStatus = 0;
diff --git a/src/game/behaviors/hidden_star.inc.c b/src/game/behaviors/hidden_star.inc.c
@@ -24,8 +24,8 @@ void bhv_hidden_star_loop(void) {
case 1:
if (o->oTimer > 2) {
- func_802F1B84(o->oPosX, o->oPosY, o->oPosZ);
- func_802A3004();
+ spawn_red_coin_cutscene_star(o->oPosX, o->oPosY, o->oPosZ);
+ spawn_mist_particles();
o->activeFlags = 0;
}
break;
@@ -35,8 +35,8 @@ void bhv_hidden_star_loop(void) {
/* TODO: this is likely not a checkpoint but a Secret */
void bhv_hidden_star_trigger_loop(void) {
struct Object *hiddenStar;
- if (are_objects_collided(o, gMarioObject) == 1) {
- hiddenStar = obj_nearest_object_with_behavior(bhvHiddenStar);
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
+ hiddenStar = cur_obj_nearest_object_with_behavior(bhvHiddenStar);
if (hiddenStar != NULL) {
hiddenStar->oHiddenStarTriggerCounter++;
if (hiddenStar->oHiddenStarTriggerCounter != 5) {
@@ -66,8 +66,8 @@ void bhv_bowser_course_red_coin_star_loop(void) {
case 1:
if (o->oTimer > 2) {
- func_802F1BD4(o->oPosX, o->oPosY, o->oPosZ);
- func_802A3004();
+ spawn_no_exit_star(o->oPosX, o->oPosY, o->oPosZ);
+ spawn_mist_particles();
o->activeFlags = 0;
}
break;
diff --git a/src/game/behaviors/hoot.inc.c b/src/game/behaviors/hoot.inc.c
@@ -1,20 +1,20 @@
// hoot.c.inc
void bhv_hoot_init(void) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oHomeX = o->oPosX + 800.0f;
o->oHomeY = o->oPosY - 150.0f;
o->oHomeZ = o->oPosZ + 300.0f;
o->header.gfx.node.flags |= 0x10; /* bit 4 */
- obj_become_intangible();
+ cur_obj_become_intangible();
}
// sp28 = arg0
// sp2c = arg1
-f32 HootFindNextFloor(struct FloorGeometry **arg0, f32 arg1) {
+f32 hoot_find_next_floor(struct FloorGeometry **arg0, f32 arg1) {
f32 sp24 = arg1 * sins(o->oMoveAngleYaw) + o->oPosX;
UNUSED f32 sp20 = o->oPosY;
f32 sp1c = arg1 * coss(o->oMoveAngleYaw) + o->oPosZ;
@@ -23,19 +23,19 @@ f32 HootFindNextFloor(struct FloorGeometry **arg0, f32 arg1) {
return floorY;
}
-void HootFloorBounce(void) {
+void hoot_floor_bounce(void) {
struct FloorGeometry *sp1c;
f32 floorY;
- floorY = HootFindNextFloor(&sp1c, 375.0f);
+ floorY = hoot_find_next_floor(&sp1c, 375.0f);
if (floorY + 75.0f > o->oPosY)
o->oMoveAnglePitch -= 3640.8888;
- floorY = HootFindNextFloor(&sp1c, 200.0f);
+ floorY = hoot_find_next_floor(&sp1c, 200.0f);
if (floorY + 125.0f > o->oPosY)
o->oMoveAnglePitch -= 7281.7776;
- floorY = HootFindNextFloor(&sp1c, 0);
+ floorY = hoot_find_next_floor(&sp1c, 0);
if (floorY + 125.0f > o->oPosY)
o->oPosY = floorY + 125.0f;
if (o->oMoveAnglePitch < -21845.3328)
@@ -45,7 +45,7 @@ void HootFloorBounce(void) {
// sp30 = fastOscY
// sp34 = speed
-void HootFreeStep(s16 fastOscY, s32 speed) {
+void hoot_free_step(s16 fastOscY, s32 speed) {
struct FloorGeometry *sp2c;
s16 yaw = o->oMoveAngleYaw;
s16 pitch = o->oMoveAnglePitch;
@@ -73,10 +73,10 @@ void HootFreeStep(s16 fastOscY, s32 speed) {
}
if (sp26 == 0)
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
}
-void PlayerSetHootYaw(void) {
+void hoot_player_set_yaw(void) {
s16 stickX = gPlayer3Controller->rawStickX;
s16 stickY = gPlayer3Controller->rawStickY;
UNUSED s16 pitch = o->oMoveAnglePitch;
@@ -92,7 +92,7 @@ void PlayerSetHootYaw(void) {
// sp2c = xPrev
// sp30 = zPrev
-void HootCarryStep(s32 speed, UNUSED f32 xPrev, UNUSED f32 zPrev) {
+void hoot_carry_step(s32 speed, UNUSED f32 xPrev, UNUSED f32 zPrev) {
s16 yaw = o->oMoveAngleYaw;
s16 pitch = o->oMoveAnglePitch;
s16 sp22 = o->header.gfx.unk38.animFrame;
@@ -108,14 +108,14 @@ void HootCarryStep(s32 speed, UNUSED f32 xPrev, UNUSED f32 zPrev) {
o->oPosZ += o->oVelZ;
if (sp22 == 0)
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
}
// sp48 = xPrev
// sp4c = yPrev
// sp50 = zPrev
-void HootSurfaceCollision(f32 xPrev, UNUSED f32 yPrev, f32 zPrev) {
+void hoot_surface_collision(f32 xPrev, UNUSED f32 yPrev, f32 zPrev) {
struct FloorGeometry *sp44;
struct WallCollisionData hitbox;
f32 floorY;
@@ -151,7 +151,7 @@ void HootSurfaceCollision(f32 xPrev, UNUSED f32 yPrev, f32 zPrev) {
// sp28 = xPrev
// sp2c = zPrev
-void HootAscentLoop(f32 xPrev, f32 zPrev) {
+void hoot_act_ascent(f32 xPrev, f32 zPrev) {
f32 negX = 0 - o->oPosX;
f32 negZ = 0 - o->oPosZ;
s16 angleToOrigin = atan2s(negZ, negX);
@@ -160,28 +160,28 @@ void HootAscentLoop(f32 xPrev, f32 zPrev) {
o->oMoveAnglePitch = 0xCE38;
if (o->oTimer >= 29) {
- PlaySound(SOUND_ENV_WIND2);
+ cur_obj_play_sound_1(SOUND_ENV_WIND2);
o->header.gfx.unk38.animFrame = 1;
}
if (o->oPosY > 6500.0f)
o->oAction = HOOT_ACT_CARRY;
- HootCarryStep(60, xPrev, zPrev);
+ hoot_carry_step(60, xPrev, zPrev);
}
-void HootActionLoop(void) {
+void hoot_action_loop(void) {
f32 xPrev = o->oPosX;
f32 yPrev = o->oPosY;
f32 zPrev = o->oPosZ;
switch (o->oAction) {
case HOOT_ACT_ASCENT:
- HootAscentLoop(xPrev, zPrev);
+ hoot_act_ascent(xPrev, zPrev);
break;
case HOOT_ACT_CARRY:
- PlayerSetHootYaw();
+ hoot_player_set_yaw();
o->oMoveAnglePitch = 0x71C;
@@ -195,25 +195,25 @@ void HootActionLoop(void) {
}
}
- HootCarryStep(20, xPrev, zPrev);
+ hoot_carry_step(20, xPrev, zPrev);
break;
case HOOT_ACT_TIRED:
- PlayerSetHootYaw();
+ hoot_player_set_yaw();
o->oMoveAnglePitch = 0;
- HootCarryStep(20, xPrev, zPrev);
+ hoot_carry_step(20, xPrev, zPrev);
if (o->oTimer >= 61)
gMarioObject->oInteractStatus |= INT_STATUS_MARIO_UNK7; /* bit 7 */
break;
}
- HootSurfaceCollision(xPrev, yPrev, zPrev);
+ hoot_surface_collision(xPrev, yPrev, zPrev);
}
-void HootTurnToHome(void) {
+void hoot_turn_to_home(void) {
f32 homeDistX = o->oHomeX - o->oPosX;
f32 homeDistY = o->oHomeY - o->oPosY;
f32 homeDistZ = o->oHomeZ - o->oPosZ;
@@ -224,17 +224,16 @@ void HootTurnToHome(void) {
o->oMoveAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, vAngleToHome, 0x140);
}
-void HootAwakeLoop(void) {
+void hoot_awake_loop(void) {
if (o->oInteractStatus == INTERACT_HOOT) {
- HootActionLoop();
-
- SetObjAnimation(1);
+ hoot_action_loop();
+ cur_obj_init_animation(1);
} else {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
- HootTurnToHome();
- HootFloorBounce();
- HootFreeStep(0, 10);
+ hoot_turn_to_home();
+ hoot_floor_bounce();
+ hoot_free_step(0, 10);
o->oAction = 0;
o->oTimer = 0;
@@ -253,19 +252,19 @@ void bhv_hoot_loop(void) {
break;
case HOOT_AVAIL_WANTS_TO_TALK:
- HootAwakeLoop();
+ hoot_awake_loop();
if (set_mario_npc_dialog(2) == 2 && cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_044)) {
set_mario_npc_dialog(0);
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oHootAvailability = HOOT_AVAIL_READY_TO_FLY;
}
break;
case HOOT_AVAIL_READY_TO_FLY:
- HootAwakeLoop();
+ hoot_awake_loop();
break;
}
}
diff --git a/src/game/behaviors/horizontal_grindel.inc.c b/src/game/behaviors/horizontal_grindel.inc.c
@@ -6,22 +6,22 @@ void bhv_horizontal_grindel_init(void) {
void bhv_horizontal_grindel_update(void) {
if (o->oMoveFlags & 0x00000003) {
if (!o->oHorizontalGrindelOnGround) {
- PlaySound2(SOUND_OBJ_THWOMP);
+ cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
o->oHorizontalGrindelOnGround = TRUE;
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
- o->oHorizontalGrindelDistToHome = obj_lateral_dist_to_home();
+ o->oHorizontalGrindelDistToHome = cur_obj_lateral_dist_to_home();
o->oForwardVel = 0.0f;
o->oTimer = 0;
}
- if (obj_rotate_yaw_toward(o->oHorizontalGrindelTargetYaw, 0x400)) {
+ if (cur_obj_rotate_yaw_toward(o->oHorizontalGrindelTargetYaw, 0x400)) {
if (o->oTimer > 60) {
if (o->oHorizontalGrindelDistToHome > 300.0f) {
o->oHorizontalGrindelTargetYaw += 0x8000;
o->oHorizontalGrindelDistToHome = 0.0f;
} else {
- PlaySound2(SOUND_OBJ_KING_BOBOMB_JUMP);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB_JUMP);
o->oForwardVel = 11.0f;
o->oVelY = 70.0f;
o->oGravity = -4.0f;
@@ -39,5 +39,5 @@ void bhv_horizontal_grindel_update(void) {
}
o->oFaceAngleYaw = o->oMoveAngleYaw + 0x4000;
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
diff --git a/src/game/behaviors/intro_lakitu.inc.c b/src/game/behaviors/intro_lakitu.inc.c
@@ -63,7 +63,7 @@ void bhv_intro_lakitu_loop(void) {
switch (gCurrentObject->oAction) {
case 0:
- obj_disable_rendering();
+ cur_obj_disable_rendering();
gCurrentObject->oIntroLakituSplineSegment = 0.f;
gCurrentObject->oIntroLakituSplineSegmentProgress = 0.f;
gCurrentObject->oIntroLakituCloud =
@@ -75,14 +75,14 @@ void bhv_intro_lakitu_loop(void) {
break;
case 1:
- obj_enable_rendering();
+ cur_obj_enable_rendering();
if ((gCutsceneTimer > 350) && (gCutsceneTimer < 458)) {
gCurrentObject->oPosX = gCamera->pos[0];
gCurrentObject->oPosY = gCamera->pos[1] + 500.f;
gCurrentObject->oPosZ = gCamera->pos[2];
}
if (gCutsceneTimer > 52)
- PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
+ cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
if (intro_lakitu_set_pos_and_focus(gCurrentObject, gIntroLakituStartToPipeOffsetFromCamera,
gIntroLakituStartToPipeFocus) == 1)
@@ -91,10 +91,10 @@ void bhv_intro_lakitu_loop(void) {
switch (gCurrentObject->oTimer) {
#ifdef VERSION_US
case 534:
- PlaySound2(SOUND_ACTION_FLYING_FAST);
+ cur_obj_play_sound_2(SOUND_ACTION_FLYING_FAST);
break;
case 581:
- PlaySound2(SOUND_ACTION_INTRO_UNK45E);
+ cur_obj_play_sound_2(SOUND_ACTION_INTRO_UNK45E);
break;
#endif
case 73:
@@ -112,9 +112,9 @@ void bhv_intro_lakitu_loop(void) {
}
#ifdef VERSION_EU
if (gCurrentObject->oTimer == 446)
- PlaySound2(SOUND_ACTION_FLYING_FAST);
+ cur_obj_play_sound_2(SOUND_ACTION_FLYING_FAST);
if (gCurrentObject->oTimer == 485)
- PlaySound2(SOUND_ACTION_INTRO_UNK45E);
+ cur_obj_play_sound_2(SOUND_ACTION_INTRO_UNK45E);
#endif
break;
case 2:
@@ -132,11 +132,11 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oFaceAngleYaw = gCurrentObject->oMoveAngleYaw + 0x4000;
gCurrentObject->oMoveAnglePitch = 0x800;
}
- PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
+ cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
break;
case 3:
- PlaySound(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
+ cur_obj_play_sound_1(SOUND_AIR_LAKITU_FLY_HIGHPRIO);
vec3f_set(sp58, -1128.f, 560.f, 4664.f);
gCurrentObject->oMoveAngleYaw += 0x200;
gCurrentObject->oIntroLakituUnk100 =
@@ -158,7 +158,7 @@ void bhv_intro_lakitu_loop(void) {
if (gCurrentObject->oTimer == 31) {
gCurrentObject->oPosY -= 158.f;
// Spawn white ground particles
- func_802ADA94();
+ spawn_mist_from_global();
gCurrentObject->oPosY += 158.f;
}
#ifdef VERSION_EU
@@ -168,16 +168,16 @@ void bhv_intro_lakitu_loop(void) {
#endif
if (gCurrentObject->oTimer == TIMER) {
- mark_object_for_deletion(gCurrentObject);
- mark_object_for_deletion(gCurrentObject->oIntroLakituCloud);
+ obj_mark_for_deletion(gCurrentObject);
+ obj_mark_for_deletion(gCurrentObject->oIntroLakituCloud);
}
#ifndef VERSION_JP
if (gCurrentObject->oTimer == 14)
- PlaySound2(SOUND_ACTION_INTRO_UNK45F);
+ cur_obj_play_sound_2(SOUND_ACTION_INTRO_UNK45F);
#endif
break;
case 100:
- obj_enable_rendering();
+ cur_obj_enable_rendering();
vec3f_set(sp64, -100.f, 100.f, 300.f);
offset_rotated(sp4C, gCamera->pos, sp64, sMarioCamState->faceAngle);
vec3f_to_object_pos(gCurrentObject, sp4C);
@@ -204,7 +204,7 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oMoveAnglePitch = 0xE00;
}
gCurrentObject->oFaceAnglePitch = 0;
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
break;
case 102:
@@ -219,7 +219,7 @@ void bhv_intro_lakitu_loop(void) {
gCurrentObject->oMoveAnglePitch =
camera_approach_s16_symmetric(gCurrentObject->oMoveAnglePitch, -0x2000, 0x5A);
gCurrentObject->oFaceAnglePitch = 0;
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
break;
}
}
diff --git a/src/game/behaviors/intro_peach.inc.c b/src/game/behaviors/intro_peach.inc.c
@@ -47,7 +47,7 @@ void bhv_intro_peach_loop(void) {
intro_peach_set_pos_and_opacity(gCurrentObject, 0.f, 8.f);
if (gCurrentObject->oTimer > 60)
- mark_object_for_deletion(gCurrentObject);
+ obj_mark_for_deletion(gCurrentObject);
break;
}
}
diff --git a/src/game/behaviors/intro_scene.inc.c b/src/game/behaviors/intro_scene.inc.c
@@ -1,6 +1,6 @@
// intro_scene.inc.c
-void func_8029B964(struct Object *parent, s16 xOffset, s16 yOffset, s16 zOffset, s16 pitchOffset,
+void spawn_child_obj_relative(struct Object *parent, s16 xOffset, s16 yOffset, s16 zOffset, s16 pitchOffset,
s16 yawOffset, s16 rollOffset, s16 forwardVel,
s32 model, const BehaviorScript *behavior) {
struct Object *sp1C = spawn_object(parent, model, behavior);
@@ -37,37 +37,37 @@ void bhv_intro_scene_loop(void) {
sp34 = spawn_object(gCurrentObject, MODEL_PEACH, bhvBeginningPeach);
break;
case 7:
- func_8029B964(gCurrentObject, 0, 205, 500, 0x1000, 0x6000, -0x1E00, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 0, 205, 500, 0x1000, 0x6000, -0x1E00, 25, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, 0, 205, 800, 0x1800, 0x6000, -0x1400, 35, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 0, 205, 800, 0x1800, 0x6000, -0x1400, 35, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, -100, 300, 500, 0x800, 0x6000, 0, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -100, 300, 500, 0x800, 0x6000, 0, 25, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, 100, -200, 800, 0, 0x4000, 0x1400, 45, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 100, -200, 800, 0, 0x4000, 0x1400, 45, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, -80, 300, 350, 0x1800, 0x5000, 0xA00, 35, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -80, 300, 350, 0x1800, 0x5000, 0xA00, 35, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, -300, 300, 500, 0x800, 0x6000, 0x2800, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -300, 300, 500, 0x800, 0x6000, 0x2800, 25, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, -400, -200, 800, 0, 0x4000, -0x1400, 45, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -400, -200, 800, 0, 0x4000, -0x1400, 45, MODEL_BIRDS,
bhvEndBirds1);
break;
case 9:
- func_8029B964(gCurrentObject, 50, 205, 500, 0x1000, 0x6000, 0, 35, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 50, 205, 500, 0x1000, 0x6000, 0, 35, MODEL_BIRDS,
bhvEndBirds1);
- func_8029B964(gCurrentObject, 0, 285, 800, 0x1800, 0x6000, 0, 35, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 0, 285, 800, 0x1800, 0x6000, 0, 35, MODEL_BIRDS,
bhvEndBirds1);
break;
case 8:
- func_8029B964(gCurrentObject, -100, -100, -700, 0, 0, -0xF00, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -100, -100, -700, 0, 0, -0xF00, 25, MODEL_BIRDS,
bhvEndBirds2);
- func_8029B964(gCurrentObject, -250, 255, -200, 0, 0, -0x1400, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -250, 255, -200, 0, 0, -0x1400, 25, MODEL_BIRDS,
bhvEndBirds2);
- func_8029B964(gCurrentObject, -100, 155, -600, 0, 0, -0x500, 35, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, -100, 155, -600, 0, 0, -0x500, 35, MODEL_BIRDS,
bhvEndBirds2);
- func_8029B964(gCurrentObject, 250, 200, -1200, 0, 0, -0x700, 25, MODEL_BIRDS,
+ spawn_child_obj_relative(gCurrentObject, 250, 200, -1200, 0, 0, -0x700, 25, MODEL_BIRDS,
bhvEndBirds2);
- func_8029B964(gCurrentObject, -250, 255, -700, 0, 0, 0, 25, MODEL_BIRDS, bhvEndBirds2);
+ spawn_child_obj_relative(gCurrentObject, -250, 255, -700, 0, 0, 0, 25, MODEL_BIRDS, bhvEndBirds2);
break;
}
diff --git a/src/game/behaviors/jrb_ship.inc.c b/src/game/behaviors/jrb_ship.inc.c
@@ -17,20 +17,20 @@ void bhv_sunken_ship_part_loop(void) {
o->oOpacity = 140;
else
o->oOpacity = o->oDistanceToMario * 140.0f / 10000.0;
- obj_disable_rendering();
+ cur_obj_disable_rendering();
}
void bhv_ship_part_3_loop(void) {
s16 sp1E = o->oFaceAnglePitch;
s16 sp1C = o->oFaceAngleRoll;
- func_802A3470();
+ cur_obj_set_pos_to_home_with_debug();
o->oShipPart3UnkF4 += 0x100;
o->oFaceAnglePitch = sins(o->oShipPart3UnkF4) * 1024.0f;
o->oFaceAngleRoll = sins(o->oShipPart3UnkF8) * 1024.0f;
o->oAngleVelPitch = o->oFaceAnglePitch - sp1E;
o->oAngleVelRoll = o->oFaceAngleRoll - sp1C;
if (gMarioObject->oPosY > 1000.0f)
- PlaySound(SOUND_ENV_BOAT_ROCKING1);
+ cur_obj_play_sound_1(SOUND_ENV_BOAT_ROCKING1);
}
void bhv_jrb_sliding_box_loop(void) {
@@ -44,7 +44,7 @@ void bhv_jrb_sliding_box_loop(void) {
Vec3f sp20;
s16 sp1E;
if (o->oJrbSlidingBoxUnkF4 == NULL) {
- sp3C = obj_nearest_object_with_behavior(bhvInSunkenShip3);
+ sp3C = cur_obj_nearest_object_with_behavior(bhvInSunkenShip3);
if (sp3C != NULL) // NULL check only for assignment, not for dereference?
o->oJrbSlidingBoxUnkF4 = sp3C;
o->oParentRelativePosX = o->oPosX - sp3C->oPosX;
@@ -80,12 +80,12 @@ void bhv_jrb_sliding_box_loop(void) {
o->oParentRelativePosZ += o->oJrbSlidingBoxUnkFC;
if (gMarioObject->oPosY > 1000.0f)
if (absf(o->oJrbSlidingBoxUnkFC) > 3.0f)
- PlaySound(SOUND_AIR_ROUGH_SLIDE);
- set_object_hitbox(o, &sSkullSlidingBoxHitbox);
+ cur_obj_play_sound_1(SOUND_AIR_ROUGH_SLIDE);
+ obj_set_hitbox(o, &sSkullSlidingBoxHitbox);
if (!(o->oJrbSlidingBoxUnkF8 & 0x7FFF))
- obj_become_tangible();
- if (are_objects_collided(o, gMarioObject)) {
+ cur_obj_become_tangible();
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
o->oInteractStatus = 0;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
}
diff --git a/src/game/behaviors/jumping_box.inc.c b/src/game/behaviors/jumping_box.inc.c
@@ -12,7 +12,7 @@ struct ObjectHitbox sJumpingBoxHitbox = {
/* hurtboxHeight: */ 250,
};
-void ActionJumpingBox0(void) {
+void jumping_box_act_0(void) {
if (o->oSubAction == 0) {
if (o->oJumpingBoxUnkF8-- < 0)
o->oSubAction++;
@@ -26,45 +26,45 @@ void ActionJumpingBox0(void) {
}
}
-void ActionJumpingBox1(void) {
+void jumping_box_act_1(void) {
if (o->oMoveFlags & (0x200 | 0x40 | 0x20 | 0x10 | 0x8 | 0x1)) {
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
}
}
-void (*sJumpingBoxActions[])(void) = { ActionJumpingBox0, ActionJumpingBox1 };
+void (*sJumpingBoxActions[])(void) = { jumping_box_act_0, jumping_box_act_1 };
-void func_802B1F84(void) {
- obj_set_model(MODEL_BREAKABLE_BOX);
- obj_scale(0.5f);
- set_object_hitbox(o, &sJumpingBoxHitbox);
- obj_update_floor_and_walls();
- obj_move_standard(78);
- obj_call_action_function(sJumpingBoxActions);
+void jumping_box_free_update(void) {
+ cur_obj_set_model(MODEL_BREAKABLE_BOX);
+ cur_obj_scale(0.5f);
+ obj_set_hitbox(o, &sJumpingBoxHitbox);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
+ cur_obj_call_action_function(sJumpingBoxActions);
}
void bhv_jumping_box_loop(void) {
switch (o->oHeldState) {
case HELD_FREE:
- func_802B1F84();
+ jumping_box_free_update();
break;
case HELD_HELD:
- copy_object_pos(o, gMarioObject);
- obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
- func_8029FA5C(-1, 0);
+ obj_copy_pos(o, gMarioObject);
+ cur_obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
+ cur_obj_unrender_and_reset_state(-1, 0);
break;
case HELD_THROWN:
- obj_get_thrown_or_placed(40.0f, 20.0f, 1);
+ cur_obj_get_thrown_or_placed(40.0f, 20.0f, 1);
break;
case HELD_DROPPED:
- obj_get_dropped();
+ cur_obj_get_dropped();
o->oAction = 1;
break;
}
if (o->oInteractStatus & INTERACT_HIT_FROM_BELOW) {
create_sound_spawner(SOUND_GENERAL_BREAK_BOX);
- func_802A3C98(46.0f, 1);
+ obj_explode_and_spawn_coins(46.0f, 1);
}
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/kickable_board.inc.c b/src/game/behaviors/kickable_board.inc.c
@@ -1,7 +1,7 @@
// kickable_board.c.inc
-s32 func_802A9A0C(UNUSED s32 sp18) {
- if (are_objects_collided(o, gMarioObject)) {
+s32 check_mario_attacking(UNUSED s32 sp18) {
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
if (abs_angle_diff(o->oMoveAngleYaw, gMarioObject->oMoveAngleYaw) > 0x6000) {
if (gMarioStates->action == ACT_SLIDE_KICK)
return 1;
@@ -20,7 +20,7 @@ s32 func_802A9A0C(UNUSED s32 sp18) {
return 0;
}
-void func_802A9B54(void) {
+void init_kickable_board_rock(void) {
o->oKickableBoardF8 = 1600;
o->oKickableBoardF4 = 0;
}
@@ -30,8 +30,8 @@ void bhv_kickable_board_loop(void) {
switch (o->oAction) {
case 0:
o->oFaceAnglePitch = 0;
- if (func_802A9A0C(0)) {
- func_802A9B54();
+ if (check_mario_attacking(0)) {
+ init_kickable_board_rock();
o->oAction++;
}
load_object_collision_model();
@@ -40,10 +40,10 @@ void bhv_kickable_board_loop(void) {
o->oFaceAnglePitch = 0;
load_object_collision_model();
o->oFaceAnglePitch = -sins(o->oKickableBoardF4) * o->oKickableBoardF8;
- if (o->oTimer > 30 && (sp24 = func_802A9A0C(0))) {
+ if (o->oTimer > 30 && (sp24 = check_mario_attacking(0))) {
if (gMarioObject->oPosY > o->oPosY + 160.0f && sp24 == 2) {
o->oAction++;
- PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_BUTTON_PRESS_2);
} else
o->oTimer = 0;
}
@@ -52,22 +52,22 @@ void bhv_kickable_board_loop(void) {
if (o->oKickableBoardF8 < 0)
o->oAction = 0;
} else
- func_802A9B54();
+ init_kickable_board_rock();
if (!(o->oKickableBoardF4 & 0x7FFF))
- PlaySound2(SOUND_GENERAL_BUTTON_PRESS_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_BUTTON_PRESS_2);
o->oKickableBoardF4 += 0x400;
break;
case 2:
- obj_become_intangible();
- obj_set_model(MODEL_WF_KICKABLE_BOARD_FELLED);
+ cur_obj_become_intangible();
+ cur_obj_set_model(MODEL_WF_KICKABLE_BOARD_FELLED);
o->oAngleVelPitch -= 0x80;
o->oFaceAnglePitch += o->oAngleVelPitch;
if (o->oFaceAnglePitch < -0x4000) {
o->oFaceAnglePitch = -0x4000;
o->oAngleVelPitch = 0;
o->oAction++;
- ShakeScreen(SHAKE_POS_SMALL);
- PlaySound2(SOUND_GENERAL_UNKNOWN4);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN4);
}
load_object_collision_model();
break;
diff --git a/src/game/behaviors/king_bobomb.inc.c b/src/game/behaviors/king_bobomb.inc.c
@@ -1,84 +1,100 @@
// king_bobomb.c.inc
+// Copy of geo_update_projectile_pos_from_parent
+Gfx *geo_update_held_mario_pos(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) {
+ Mat4 sp20;
+ struct Object *sp1C;
+
+ if (run == TRUE) {
+ sp1C = (struct Object *) gCurGraphNodeObject;
+ if (sp1C->prevObj != NULL) {
+ create_transformation_from_matrices(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
+ obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
+ obj_set_gfx_pos_from_pos(sp1C->prevObj);
+ }
+ }
+ return NULL;
+}
+
void bhv_bobomb_anchor_mario_loop(void) {
- func_802A8D18(50.0f, 50.0f, 64);
+ common_anchor_mario_behavior(50.0f, 50.0f, 64);
}
-void ActionKingBobomb0(void) {
+void king_bobomb_act_0(void) {
#ifndef VERSION_JP
o->oForwardVel = 0;
o->oVelY = 0;
#endif
if (o->oSubAction == 0) {
- obj_become_intangible();
+ cur_obj_become_intangible();
gSecondCameraFocus = o;
- set_obj_animation_and_sound_state(5);
- obj_set_pos_to_home();
+ cur_obj_init_animation_with_sound(5);
+ cur_obj_set_pos_to_home();
o->oHealth = 3;
- if (obj_is_mario_in_range_and_ready_to_speak(500.0f, 100.0f)) {
+ if (cur_obj_can_mario_activate_textbox_2(500.0f, 100.0f)) {
o->oSubAction++;
func_8031FFB4(0, 60, 40);
}
- } else if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_017)) {
+ } else if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_017)) {
o->oAction = 2;
o->oFlags |= OBJ_FLAG_HOLDABLE;
}
}
-int func_802A6AF8(f32 arg0) {
+int mario_is_far_below_object(f32 arg0) {
if (arg0 < o->oPosY - gMarioObject->oPosY)
return 1;
else
return 0;
}
-void ActionKingBobomb2(void) {
- obj_become_tangible();
+void king_bobomb_act_2(void) {
+ cur_obj_become_tangible();
if (o->oPosY - o->oHomeY < -100.0f) { // Thrown off hill
o->oAction = 5;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
if (o->oKingBobombUnk100 == 0) {
- if (obj_check_anim_frame(15))
- ShakeScreen(SHAKE_POS_SMALL);
- if (func_802A4AB0(4))
+ if (cur_obj_check_anim_frame(15))
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ if (cur_obj_init_animation_and_check_if_near_end(4))
o->oKingBobombUnk100++;
} else {
if (o->oKingBobombUnk100 == 1) {
- func_802A4A70(11, 7);
+ cur_obj_init_animation_and_anim_frame(11, 7);
o->oKingBobombUnk100 = 2;
} else
- set_obj_animation_and_sound_state(11);
+ cur_obj_init_animation_with_sound(11);
if (o->oKingBobombUnk108 == 0) {
o->oForwardVel = 3.0f;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x100);
} else {
o->oForwardVel = 0.0f;
o->oKingBobombUnk108--;
}
}
- if (obj_check_grabbed_mario())
+ if (cur_obj_check_grabbed_mario())
o->oAction = 3;
- if (func_802A6AF8(1200.0f)) {
+ if (mario_is_far_below_object(1200.0f)) {
o->oAction = 0;
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
}
-void ActionKingBobomb3(void) {
+void king_bobomb_act_3(void) {
if (o->oSubAction == 0) {
o->oForwardVel = 0;
o->oKingBobombUnk104 = 0;
o->oKingBobombUnkFC = 0;
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_UNKNOWN3);
- if (func_802A4AB0(0)) {
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN3);
+ if (cur_obj_init_animation_and_check_if_near_end(0)) {
o->oSubAction++;
- func_802A4A70(1, 0);
+ cur_obj_init_animation_and_anim_frame(1, 0);
}
} else {
if (o->oSubAction == 1) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
o->oKingBobombUnkFC += player_performed_grab_escape_action();
print_debug_bottom_up("%d", o->oKingBobombUnkFC);
if (o->oKingBobombUnkFC > 10) {
@@ -88,18 +104,18 @@ void ActionKingBobomb3(void) {
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
} else {
o->oForwardVel = 3.0f;
- if (o->oKingBobombUnk104 > 20 && obj_rotate_yaw_toward(0, 0x400)) {
+ if (o->oKingBobombUnk104 > 20 && cur_obj_rotate_yaw_toward(0, 0x400)) {
o->oSubAction++;
- func_802A4A70(9, 22);
+ cur_obj_init_animation_and_anim_frame(9, 22);
}
}
o->oKingBobombUnk104++;
} else {
- set_obj_animation_and_sound_state(9);
- if (obj_check_anim_frame(31)) {
+ cur_obj_init_animation_with_sound(9);
+ if (cur_obj_check_anim_frame(31)) {
o->oKingBobombUnk88 = 2;
- PlaySound2(SOUND_OBJ_UNKNOWN4);
- } else if (func_8029F788()) {
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN4);
+ } else if (cur_obj_check_if_near_animation_end()) {
o->oAction = 1;
o->oInteractStatus &= ~(INT_STATUS_GRABBED_MARIO);
}
@@ -107,31 +123,31 @@ void ActionKingBobomb3(void) {
}
}
-void ActionKingBobomb1(void) {
+void king_bobomb_act_1(void) {
o->oForwardVel = 0;
o->oVelY = 0;
- set_obj_animation_and_sound_state(11);
+ cur_obj_init_animation_with_sound(11);
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 512);
if (o->oDistanceToMario < 2500.0f)
o->oAction = 2;
- if (func_802A6AF8(1200.0f)) {
+ if (mario_is_far_below_object(1200.0f)) {
o->oAction = 0;
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
}
-void ActionKingBobomb6(void) {
+void king_bobomb_act_6(void) {
if (o->oSubAction == 0) {
if (o->oTimer == 0) {
o->oKingBobombUnk104 = 0;
- PlaySound2(SOUND_OBJ_KING_BOBOMB);
- PlaySound2(SOUND_OBJ2_KING_BOBOMB_DAMAGE);
- ShakeScreen(SHAKE_POS_SMALL);
- func_802AA618(0, 0, 100.0f);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB);
+ cur_obj_play_sound_2(SOUND_OBJ2_KING_BOBOMB_DAMAGE);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ spawn_mist_particles_variable(0, 0, 100.0f);
o->oInteractType = 8;
- obj_become_tangible();
+ cur_obj_become_tangible();
}
- if (func_802A4AB0(2))
+ if (cur_obj_init_animation_and_check_if_near_end(2))
o->oKingBobombUnk104++;
if (o->oKingBobombUnk104 > 3) {
o->oSubAction++;
@@ -139,50 +155,50 @@ void ActionKingBobomb6(void) {
}
} else {
if (o->oSubAction == 1) {
- if (func_802A4AB0(10)) {
+ if (cur_obj_init_animation_and_check_if_near_end(10)) {
o->oSubAction++;
o->oInteractType = 2;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
} else {
- set_obj_animation_and_sound_state(11);
- if (obj_rotate_yaw_toward(o->oAngleToMario, 0x800) == 1)
+ cur_obj_init_animation_with_sound(11);
+ if (cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x800) == 1)
o->oAction = 2;
}
}
}
-void ActionKingBobomb7(void) {
- set_obj_animation_and_sound_state(2);
- if (obj_update_dialog_with_cutscene(2, 2, CUTSCENE_DIALOG, DIALOG_116)) {
+void king_bobomb_act_7(void) {
+ cur_obj_init_animation_with_sound(2);
+ if (cur_obj_update_dialog_with_cutscene(2, 2, CUTSCENE_DIALOG, DIALOG_116)) {
create_sound_spawner(SOUND_OBJ_KING_WHOMP_DEATH);
- obj_hide();
- obj_become_intangible();
- func_802AA618(0, 0, 200.0f);
+ cur_obj_hide();
+ cur_obj_become_intangible();
+ spawn_mist_particles_variable(0, 0, 200.0f);
spawn_triangle_break_particles(20, 138, 3.0f, 4);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
#ifndef VERSION_JP
- obj_spawn_star_at_y_offset(2000.0f, 4500.0f, -4500.0f, 200.0f);
+ cur_obj_spawn_star_at_y_offset(2000.0f, 4500.0f, -4500.0f, 200.0f);
#else
o->oPosY += 100.0f;
- create_star(2000.0f, 4500.0f, -4500.0f);
+ spawn_default_star(2000.0f, 4500.0f, -4500.0f);
#endif
o->oAction = 8;
}
}
-void ActionKingBobomb8(void) {
+void king_bobomb_act_8(void) {
if (o->oTimer == 60)
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
-void ActionKingBobomb4() { // bobomb been thrown
+void king_bobomb_act_4() { // bobomb been thrown
if (o->oPosY - o->oHomeY > -100.0f) { // not thrown off hill
if (o->oMoveFlags & 1) {
o->oHealth--;
o->oForwardVel = 0;
o->oVelY = 0;
- PlaySound2(SOUND_OBJ_KING_BOBOMB);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB);
if (o->oHealth)
o->oAction = 6;
else
@@ -195,66 +211,66 @@ void ActionKingBobomb4() { // bobomb been thrown
o->oVelY = 0;
o->oSubAction++;
} else if (o->oMoveFlags & 1)
- PlaySound2(SOUND_OBJ_KING_BOBOMB);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB);
} else {
- if (func_802A4AB0(10))
+ if (cur_obj_init_animation_and_check_if_near_end(10))
o->oAction = 5; // Go back to top of hill
o->oSubAction++;
}
}
}
-void ActionKingBobomb5() { // bobomb returns home
+void king_bobomb_act_5() { // bobomb returns home
switch (o->oSubAction) {
case 0:
if (o->oTimer == 0)
- PlaySound2(SOUND_OBJ_KING_BOBOMB_JUMP);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB_JUMP);
o->oKingBobombUnkF8 = 1;
- func_802A4AEC(8);
- o->oMoveAngleYaw = obj_angle_to_home();
+ cur_obj_init_animation_and_extend_if_at_end(8);
+ o->oMoveAngleYaw = cur_obj_angle_to_home();
if (o->oPosY < o->oHomeY)
o->oVelY = 100.0f;
else {
- func_802B2894(&o->oHomeX, &o->oPosX, 100.0f, -4.0f);
+ arc_to_goal_pos(&o->oHomeX, &o->oPosX, 100.0f, -4.0f);
o->oSubAction++;
}
break;
case 1:
- func_802A4AEC(8);
+ cur_obj_init_animation_and_extend_if_at_end(8);
if (o->oVelY < 0 && o->oPosY < o->oHomeY) {
o->oPosY = o->oHomeY;
o->oVelY = 0;
o->oForwardVel = 0;
o->oGravity = -4.0f;
o->oKingBobombUnkF8 = 0;
- set_obj_animation_and_sound_state(7);
- PlaySound2(SOUND_OBJ_KING_BOBOMB);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_init_animation_with_sound(7);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_BOBOMB);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
o->oSubAction++;
}
break;
case 2:
- if (func_802A4AB0(7))
+ if (cur_obj_init_animation_and_check_if_near_end(7))
o->oSubAction++;
break;
case 3:
- if (func_802A6AF8(1200.0f)) {
+ if (mario_is_far_below_object(1200.0f)) {
o->oAction = 0;
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
- if (obj_is_mario_in_range_and_ready_to_speak(500.0f, 100.0f))
+ if (cur_obj_can_mario_activate_textbox_2(500.0f, 100.0f))
o->oSubAction++;
break;
case 4:
- if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_128))
+ if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_128))
o->oAction = 2;
break;
}
}
void (*sKingBobombActions[])(void) = {
- ActionKingBobomb0, ActionKingBobomb1, ActionKingBobomb2, ActionKingBobomb3, ActionKingBobomb4,
- ActionKingBobomb5, ActionKingBobomb6, ActionKingBobomb7, ActionKingBobomb8,
+ king_bobomb_act_0, king_bobomb_act_1, king_bobomb_act_2, king_bobomb_act_3, king_bobomb_act_4,
+ king_bobomb_act_5, king_bobomb_act_6, king_bobomb_act_7, king_bobomb_act_8,
};
struct SoundState sKingBobombSoundStates[] = {
{ 0, 0, 0, NO_SOUND },
@@ -271,18 +287,18 @@ struct SoundState sKingBobombSoundStates[] = {
{ 1, 1, 15, SOUND_OBJ_POUNDING1_HIGHPRIO },
};
-void func_802A7748(void) {
- obj_update_floor_and_walls();
+void king_bobomb_move(void) {
+ cur_obj_update_floor_and_walls();
if (o->oKingBobombUnkF8 == 0)
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
else
- obj_move_using_fvel_and_gravity();
- obj_call_action_function(sKingBobombActions);
+ cur_obj_move_using_fvel_and_gravity();
+ cur_obj_call_action_function(sKingBobombActions);
exec_anim_sound_state(sKingBobombSoundStates);
if (o->oDistanceToMario < 5000.0f)
- obj_enable_rendering();
+ cur_obj_enable_rendering();
else
- obj_disable_rendering();
+ cur_obj_disable_rendering();
}
void bhv_king_bobomb_loop(void) {
@@ -292,15 +308,15 @@ void bhv_king_bobomb_loop(void) {
o->oInteractionSubtype |= INT_SUBTYPE_GRABS_MARIO;
switch (o->oHeldState) {
case HELD_FREE:
- func_802A7748();
+ king_bobomb_move();
break;
case HELD_HELD:
- func_8029FA5C(6, 1);
+ cur_obj_unrender_and_reset_state(6, 1);
break;
case HELD_THROWN:
case HELD_DROPPED:
- obj_get_thrown_or_placed(sp34, sp30, 4);
- obj_become_intangible();
+ cur_obj_get_thrown_or_placed(sp34, sp30, 4);
+ cur_obj_become_intangible();
o->oPosY += 20.0f;
break;
}
diff --git a/src/game/behaviors/klepto.inc.c b/src/game/behaviors/klepto.inc.c
@@ -30,12 +30,12 @@ static s32 func_8030F158(void) {
func_802F932C(5);
} else if (o->oSoundStateID == 5) {
if (func_802F932C(0)) {
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
o->header.gfx.unk38.animFrame = 9;
}
} else {
- if (obj_check_anim_frame(9)) {
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
+ if (cur_obj_check_anim_frame(9)) {
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
}
return TRUE;
}
@@ -49,9 +49,9 @@ static void func_8030F218(void) {
o->oKleptoUnk1AE = 0;
} else {
if (o->oSoundStateID == 0) {
- if (obj_check_anim_frame(9)) {
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
- set_obj_animation_and_sound_state(6);
+ if (cur_obj_check_anim_frame(9)) {
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
+ cur_obj_init_animation_with_sound(6);
}
} else if (--o->oKleptoUnk1AE == 0) {
o->oKleptoUnk1AE = -random_linear_offset(60, 60);
@@ -121,7 +121,7 @@ static void klepto_change_target(void) {
o->oHomeY = sKleptoTargetPositions[o->oKleptoTargetNumber][1] + o->oKleptoUnkF8;
o->oHomeZ = sKleptoTargetPositions[o->oKleptoTargetNumber][2];
- o->oKleptoUnkFC = obj_lateral_dist_to_home() / 2;
+ o->oKleptoUnkFC = cur_obj_lateral_dist_to_home() / 2;
}
static void klepto_circle_target(f32 radius, f32 targetSpeed) {
@@ -190,14 +190,14 @@ static void klepto_act_wait_for_mario(void) {
static void klepto_act_turn_toward_mario(void) {
klepto_target_mario();
- if (func_8030F158() && func_8029F828() && o->oKleptoDistanceToTarget > 800.0f
+ if (func_8030F158() && cur_obj_check_if_at_animation_end() && o->oKleptoDistanceToTarget > 800.0f
&& abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x800 && o->oKleptoUnk1B0 < 0x400) {
- PlaySound2(SOUND_OBJ_KLEPTO1);
+ cur_obj_play_sound_2(SOUND_OBJ_KLEPTO1);
o->oAction = KLEPTO_ACT_DIVE_AT_MARIO;
o->oMoveAngleYaw = o->oFaceAngleYaw;
o->oFlags |= 0x00000008;
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
}
klepto_circle_target(1000.0f, 40.0f);
@@ -207,8 +207,8 @@ static void klepto_act_turn_toward_mario(void) {
static void klepto_act_dive_at_mario(void) {
approach_f32_ptr(&o->oKleptoSpeed, 60.0f, 10.0f);
if (o->oSoundStateID == 2) {
- if (obj_check_anim_frame(11)) {
- PlaySound2(SOUND_GENERAL_SWISH_WATER);
+ if (cur_obj_check_anim_frame(11)) {
+ cur_obj_play_sound_2(SOUND_GENERAL_SWISH_WATER);
}
if (func_802F932C(0)) {
@@ -224,7 +224,7 @@ static void klepto_act_dive_at_mario(void) {
if (o->oSoundStateID == 3) {
func_802F932C(4);
} else if (o->oVelY > 0.0f && dy > 200.0f) {
- set_obj_animation_and_sound_state(2);
+ cur_obj_init_animation_with_sound(2);
}
o->oKleptoUnk1B0 = -0x3000;
@@ -254,13 +254,13 @@ static void klepto_act_dive_at_mario(void) {
}
static void klepto_act_struck_by_mario(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
obj_face_pitch_approach(0, 800);
obj_face_yaw_approach(o->oMoveAngleYaw + 0x8000, 800);
obj_face_roll_approach(0, 800);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = KLEPTO_ACT_RETREAT;
o->oGravity = 0.0f;
@@ -274,7 +274,7 @@ static void klepto_act_struck_by_mario(void) {
}
static void klepto_act_retreat(void) {
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
approach_f32_ptr(&o->oKleptoSpeed, 40.0f, 10.0f);
obj_move_pitch_approach(o->oKleptoUnk1B0, 1000);
@@ -288,7 +288,7 @@ static void klepto_act_retreat(void) {
o->oHomeY = 1500.0f;
o->oKleptoUnk1AE = -100;
o->oFlags |= 0x00000008;
- obj_become_tangible();
+ cur_obj_become_tangible();
}
}
}
@@ -302,7 +302,7 @@ static void klepto_act_reset_position(void) {
o->oHomeY = o->oKleptoDistanceToTarget = 9999.0f;
if (o->oPosY > 5000.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
klepto_approach_target(20.0f);
}
@@ -321,11 +321,11 @@ void obj_set_speed_to_zero(void) {
void bhv_klepto_update(void) {
UNUSED s32 unused;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
- o->oKleptoDistanceToTarget = obj_lateral_dist_to_home();
+ o->oKleptoDistanceToTarget = cur_obj_lateral_dist_to_home();
o->oKleptoUnk1B0 = obj_get_pitch_to_home(o->oKleptoDistanceToTarget);
- o->oKleptoYawToTarget = obj_angle_to_home();
+ o->oKleptoYawToTarget = cur_obj_angle_to_home();
if (o->oAction == KLEPTO_ACT_STRUCK_BY_MARIO) {
klepto_act_struck_by_mario();
@@ -357,13 +357,13 @@ void bhv_klepto_update(void) {
}
if (obj_handle_attacks(&sKleptoHitbox, o->oAction, sKleptoAttackHandlers)) {
- PlaySound2(SOUND_OBJ_KLEPTO2);
+ cur_obj_play_sound_2(SOUND_OBJ_KLEPTO2);
if (o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_CAP) {
save_file_clear_flags(SAVE_FLAG_CAP_ON_KLEPTO);
spawn_object(o, MODEL_MARIOS_CAP, bhvNormalCap);
} else if (o->oAnimState == KLEPTO_ANIM_STATE_HOLDING_STAR) {
- create_star(-5550.0f, 300.0f, -930.0f);
+ spawn_default_star(-5550.0f, 300.0f, -930.0f);
}
o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_NOTHING;
@@ -372,16 +372,16 @@ void bhv_klepto_update(void) {
o->oMoveAngleYaw = o->oAngleToMario + 0x8000;
o->oFlags &= ~0x00000008;
- obj_become_intangible();
+ cur_obj_become_intangible();
} else if (gMarioStates[0].action == ACT_SLEEPING
|| (gMarioStates[0].action
& (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE))) {
- obj_become_intangible();
+ cur_obj_become_intangible();
} else {
- obj_become_tangible();
+ cur_obj_become_tangible();
}
}
obj_roll_to_match_yaw_turn(o->oKleptoYawToTarget, 0x3000, 600);
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
diff --git a/src/game/behaviors/koopa.inc.c b/src/game/behaviors/koopa.inc.c
@@ -74,13 +74,13 @@ void bhv_koopa_init(void) {
o->oKoopaMovementType = KOOPA_BP_NORMAL;
o->oKoopaAgility = 1.6f / 3.0f;
o->oDrawingDistance = 1500.0f;
- obj_scale(0.8f);
+ cur_obj_scale(0.8f);
o->oGravity = -6.4f / 3.0f;
} else if (o->oKoopaMovementType >= KOOPA_BP_KOOPA_THE_QUICK_BASE) {
// Koopa the Quick. Race index is 0 for BoB and 1 for THI
o->oKoopaTheQuickRaceIndex = o->oKoopaMovementType - KOOPA_BP_KOOPA_THE_QUICK_BASE;
o->oKoopaAgility = 4.0f;
- obj_scale(3.0f);
+ cur_obj_scale(3.0f);
} else {
o->oKoopaAgility = 1.0f;
}
@@ -142,12 +142,12 @@ static void koopa_walk_start(void) {
* Walk until oKoopaCountdown hits zero, then increment sub-action.
*/
static void koopa_walk(void) {
- set_obj_animation_and_sound_state(9);
+ cur_obj_init_animation_with_sound(9);
koopa_play_footstep_sound(2, 17);
if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
- } else if (func_8029F788()) {
+ } else if (cur_obj_check_if_near_animation_end()) {
o->oSubAction += 1;
}
}
@@ -176,7 +176,7 @@ static void koopa_shelled_act_walk(void) {
}
o->oKoopaTurningAwayFromWall = obj_bounce_off_walls_edges_objects(&o->oKoopaTargetYaw);
- obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x200);
+ cur_obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x200);
}
switch (o->oSubAction) {
@@ -199,7 +199,7 @@ static void koopa_shelled_act_walk(void) {
* away.
*/
static void koopa_shelled_act_run_from_mario(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
koopa_play_footstep_sound(0, 11);
// If far from home, run toward it
@@ -213,7 +213,7 @@ static void koopa_shelled_act_run_from_mario(void) {
o->oAction = KOOPA_SHELLED_ACT_STOPPED;
}
} else {
- obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x400);
obj_forward_vel_approach(17.0f, 1.0f);
}
}
@@ -238,14 +238,14 @@ static void koopa_dive_update_speed(f32 decel) {
static void koopa_shelled_act_lying(void) {
if (o->oForwardVel != 0.0f) {
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
}
func_802F927C(5);
koopa_dive_update_speed(0.3f);
} else if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
} else if (func_802F92B0(6)) {
o->oAction = KOOPA_SHELLED_ACT_STOPPED;
}
@@ -257,7 +257,7 @@ static void koopa_shelled_act_lying(void) {
*/
void shelled_koopa_attack_handler(s32 attackType) {
if (o->header.gfx.scale[0] > 0.8f) {
- PlaySound2(SOUND_OBJ_KOOPA_DAMAGE);
+ cur_obj_play_sound_2(SOUND_OBJ_KOOPA_DAMAGE);
o->oKoopaMovementType = KOOPA_BP_UNSHELLED;
o->oAction = KOOPA_UNSHELLED_ACT_LYING;
@@ -265,16 +265,16 @@ void shelled_koopa_attack_handler(s32 attackType) {
// If attacked from the side, get knocked away from mario
if (attackType != ATTACK_FROM_ABOVE && attackType != ATTACK_GROUND_POUND_OR_TWIRL) {
- o->oMoveAngleYaw = angle_to_object(gMarioObject, o);
+ o->oMoveAngleYaw = obj_angle_to_object(gMarioObject, o);
}
- obj_set_model(MODEL_KOOPA_WITHOUT_SHELL);
+ cur_obj_set_model(MODEL_KOOPA_WITHOUT_SHELL);
spawn_object(o, MODEL_KOOPA_SHELL, bhvKoopaShell);
//! Because bob-ombs/corkboxes come after koopa in processing order,
// they can interact with the koopa on the same frame that this
// happens. This causes the koopa to die immediately.
- obj_become_intangible();
+ cur_obj_become_intangible();
} else {
// Die if tiny koopa
obj_die_if_health_non_positive();
@@ -285,7 +285,7 @@ void shelled_koopa_attack_handler(s32 attackType) {
* Update function for both regular and tiny shelled koopa.
*/
static void koopa_shelled_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_update_blinking(&o->oKoopaBlinkTimer, 20, 50, 4);
switch (o->oAction) {
@@ -317,7 +317,7 @@ static void koopa_shelled_update(void) {
}
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
/**
@@ -330,7 +330,7 @@ static void koopa_unshelled_act_run(void) {
f32 distToShell = 99999.0f;
struct Object *shell;
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
koopa_play_footstep_sound(0, 6);
if (o->oKoopaTurningAwayFromWall) {
@@ -342,10 +342,10 @@ static void koopa_unshelled_act_run(void) {
}
// If shell exists, then turn toward shell
- shell = obj_find_nearest_object_with_behavior(bhvKoopaShell, &distToShell);
+ shell = cur_obj_find_nearest_object_with_behavior(bhvKoopaShell, &distToShell);
if (shell != NULL) {
//! This overrides turning toward home
- o->oKoopaTargetYaw = angle_to_object(o, shell);
+ o->oKoopaTargetYaw = obj_angle_to_object(o, shell);
} else if (!(o->oKoopaTurningAwayFromWall =
obj_bounce_off_walls_edges_objects(&o->oKoopaTargetYaw))) {
// Otherwise run around randomly
@@ -362,10 +362,10 @@ static void koopa_unshelled_act_run(void) {
|| (shell != NULL
&& abs_angle_diff(o->oKoopaTargetYaw, o->oAngleToMario + 0x8000) < 0x2000)) {
// then turn toward the shell
- obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x600);
+ cur_obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x600);
} else {
// otherwise continue running from mario
- obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x600);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, 0x600);
}
}
@@ -389,11 +389,11 @@ static void koopa_unshelled_act_dive(void) {
f32 distToShell;
if (o->oTimer > 10) {
- obj_become_tangible();
+ cur_obj_become_tangible();
}
if (o->oTimer > 10) {
- shell = obj_find_nearest_object_with_behavior(bhvKoopaShell, &distToShell);
+ shell = cur_obj_find_nearest_object_with_behavior(bhvKoopaShell, &distToShell);
// If we got the shell and mario didn't, put on the shell
//! The shell comes after koopa in processing order, and the shell is
@@ -409,8 +409,8 @@ static void koopa_unshelled_act_dive(void) {
o->oAction = KOOPA_SHELLED_ACT_LYING;
o->oForwardVel *= 0.5f;
- obj_set_model(MODEL_KOOPA_WITH_SHELL);
- mark_object_for_deletion(shell);
+ cur_obj_set_model(MODEL_KOOPA_WITH_SHELL);
+ obj_mark_for_deletion(shell);
goto end;
}
}
@@ -425,7 +425,7 @@ static void koopa_unshelled_act_dive(void) {
koopa_dive_update_speed(0.5f);
} else if (o->oKoopaCountdown != 0) {
o->oKoopaCountdown -= 1;
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
} else if (func_802F92B0(6)) {
o->oAction = KOOPA_UNSHELLED_ACT_RUN;
}
@@ -444,7 +444,7 @@ static void koopa_unshelled_act_unused3(void) {
* Update function for koopa after losing his shell.
*/
static void koopa_unshelled_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_update_blinking(&o->oKoopaBlinkTimer, 10, 15, 3);
switch (o->oAction) {
@@ -461,7 +461,7 @@ static void koopa_unshelled_update(void) {
}
obj_handle_attacks(&sKoopaHitbox, o->oAction, sKoopaUnshelledAttackHandlers);
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
/**
@@ -470,7 +470,7 @@ static void koopa_unshelled_update(void) {
*/
s32 obj_begin_race(s32 noTimer) {
if (o->oTimer == 50) {
- PlaySound2(SOUND_GENERAL_RACE_GUN_SHOT);
+ cur_obj_play_sound_2(SOUND_GENERAL_RACE_GUN_SHOT);
if (!noTimer) {
play_music(0, SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE), 0);
@@ -499,14 +499,14 @@ static void koopa_the_quick_act_wait_before_race(void) {
if (o->oKoopaTheQuickInitTextboxCooldown != 0) {
o->oKoopaTheQuickInitTextboxCooldown -= 1;
- } else if (obj_is_mario_in_range_and_ready_to_speak(400.0f, 400.0f)) {
+ } else if (cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) {
//! The next action doesn't execute until next frame, giving mario one
// frame where he can jump, and thus no longer be ready to speak.
// (On J, he has two frames and doing this enables time stop - see
- // obj_update_dialog_with_cutscene for that glitch)
+ // cur_obj_update_dialog_with_cutscene for that glitch)
o->oAction = KOOPA_THE_QUICK_ACT_SHOW_INIT_TEXT;
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(7);
+ cur_obj_init_animation_with_sound(7);
}
}
@@ -524,7 +524,7 @@ static void koopa_the_quick_act_show_init_text(void) {
o->oAction = KOOPA_THE_QUICK_ACT_RACE;
o->oForwardVel = 0.0f;
- o->parentObj = obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint);
+ o->parentObj = cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint);
o->oPathedStartWaypoint = o->oPathedPrevWaypoint =
segmented_to_virtual(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].path);
@@ -547,7 +547,7 @@ static s32 koopa_the_quick_detect_bowling_ball(void) {
s16 angleToBall;
f32 ballSpeedInKoopaRunDir;
- ball = obj_find_nearest_object_with_behavior(bhvBowlingBall, &distToBall);
+ ball = cur_obj_find_nearest_object_with_behavior(bhvBowlingBall, &distToBall);
if (ball != NULL) {
angleToBall = obj_turn_toward_object(o, ball, O_MOVE_ANGLE_YAW_INDEX, 0);
ballSpeedInKoopaRunDir = ball->oForwardVel * coss(ball->oMoveAngleYaw - o->oMoveAngleYaw);
@@ -584,7 +584,7 @@ static s32 koopa_the_quick_detect_bowling_ball(void) {
static void koopa_the_quick_animate_footsteps(void) {
//! With high negative speed (using the bowling ball deceleration), we can
// index out of the animation's bounds
- func_8029ED98(9, o->oForwardVel * 0.09f);
+ cur_obj_init_animation_with_accel_and_sound(9, o->oForwardVel * 0.09f);
koopa_play_footstep_sound(2, 17);
}
@@ -598,13 +598,13 @@ static void koopa_the_quick_act_race(void) {
if (obj_begin_race(FALSE)) {
// Hitbox is slightly larger while racing
- obj_push_mario_away_from_cylinder(180.0f, 300.0f);
+ cur_obj_push_mario_away_from_cylinder(180.0f, 300.0f);
- if (obj_follow_path(0) == PATH_REACHED_END) {
+ if (cur_obj_follow_path(0) == PATH_REACHED_END) {
o->oAction = KOOPA_THE_QUICK_ACT_DECELERATE;
} else {
downhillSteepness = 1.0f + sins((s16)(f32) o->oPathedTargetPitch);
- obj_rotate_yaw_toward(o->oPathedTargetYaw, (s32)(o->oKoopaAgility * 150.0f));
+ cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, (s32)(o->oKoopaAgility * 150.0f));
switch (o->oSubAction) {
case KOOPA_THE_QUICK_SUB_ACT_START_RUN:
@@ -654,7 +654,7 @@ static void koopa_the_quick_act_race(void) {
o->oSubAction = 2;
o->oMoveFlags = 0;
- set_obj_animation_and_sound_state(12);
+ cur_obj_init_animation_with_sound(12);
}
break;
@@ -678,9 +678,9 @@ static void koopa_the_quick_act_race(void) {
*/
static void koopa_the_quick_act_decelerate(void) {
obj_forward_vel_approach(3.0f, 1.0f);
- func_8029ED98(9, 0.99f);
+ cur_obj_init_animation_with_accel_and_sound(9, 0.99f);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = KOOPA_THE_QUICK_ACT_STOP;
o->oForwardVel = 3.0f;
}
@@ -705,10 +705,10 @@ static void koopa_the_quick_act_stop(void) {
* the star.
*/
static void koopa_the_quick_act_after_race(void) {
- set_obj_animation_and_sound_state(7);
+ cur_obj_init_animation_with_sound(7);
if (o->parentObj->oKoopaRaceEndpointUnk100 == 0) {
- if (obj_is_mario_in_range_and_ready_to_speak(400.0f, 400.0f)) {
+ if (cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) {
stop_background_music(SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE));
// Determine which text to display
@@ -731,13 +731,13 @@ static void koopa_the_quick_act_after_race(void) {
o->oFlags &= ~OBJ_FLAG_ACTIVE_FROM_AFAR;
}
} else if (o->parentObj->oKoopaRaceEndpointUnk100 > 0) {
- s32 dialogResponse = obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointUnk100);
+ s32 dialogResponse = cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointUnk100);
if (dialogResponse != 0) {
o->parentObj->oKoopaRaceEndpointUnk100 = -1;
o->oTimer = 0;
}
} else if (o->parentObj->oKoopaRaceEndpointRaceStatus != 0) {
- create_star(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].starPos[0],
+ spawn_default_star(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].starPos[0],
sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].starPos[1],
sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].starPos[2]);
@@ -749,7 +749,7 @@ static void koopa_the_quick_act_after_race(void) {
* Update function for koopa the quick.
*/
static void koopa_the_quick_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_update_blinking(&o->oKoopaBlinkTimer, 10, 15, 3);
switch (o->oAction) {
@@ -780,8 +780,8 @@ static void koopa_the_quick_update(void) {
}
}
- obj_push_mario_away_from_cylinder(140.0f, 300.0f);
- obj_move_standard(-78);
+ cur_obj_push_mario_away_from_cylinder(140.0f, 300.0f);
+ cur_obj_move_standard(-78);
}
/**
diff --git a/src/game/behaviors/koopa_shell.inc.c b/src/game/behaviors/koopa_shell.inc.c
@@ -12,14 +12,14 @@ struct ObjectHitbox sKoopaShellHitbox = {
/* hurtboxHeight: */ 50,
};
-void func_802BCA8C(void) {
+void koopa_shell_spawn_water_drop(void) {
UNUSED s32 unused;
struct Object *drop;
- spawn_object(o, MODEL_WATER_WAVES, bhvWaterType);
+ spawn_object(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail);
if (gMarioStates->forwardVel > 10.0f) {
- drop = spawn_object_with_scale(o, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDrops, 1.5f);
+ drop = spawn_object_with_scale(o, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDroplet, 1.5f);
drop->oVelY = RandomFloat() * 30.0f;
- translate_object_xz_random(drop, 110.0f);
+ obj_translate_xz_random(drop, 110.0f);
}
}
@@ -29,15 +29,15 @@ void bhv_koopa_shell_flame_loop(void) {
o->oVelY = RandomFloat() * 30.0f;
o->oGravity = -4.0f;
o->oAnimState = RandomFloat() * 10.0f;
- translate_object_xz_random(o, 110.0f);
+ obj_translate_xz_random(o, 110.0f);
o->oKoopaShellFlameUnkF8 = 4.0f;
}
- obj_update_floor_height();
- obj_move_using_fvel_and_gravity();
+ cur_obj_update_floor_height();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oFloorHeight > o->oPosY || o->oTimer > 10)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oKoopaShellFlameUnkF8 += -0.3;
- obj_scale(o->oKoopaShellFlameUnkF8);
+ cur_obj_scale(o->oKoopaShellFlameUnkF8);
}
void bhv_koopa_shell_flame_spawn(void) {
@@ -46,41 +46,41 @@ void bhv_koopa_shell_flame_spawn(void) {
spawn_object(o, MODEL_RED_FLAME, bhvKoopaShellFlame);
}
-void func_802BCCD4(f32 a) {
+void koopa_shell_spawn_sparkles(f32 a) {
struct Object *sp1C = spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
sp1C->oPosY += a;
}
void bhv_koopa_shell_loop(void) {
struct Surface *sp34;
- set_object_hitbox(o, &sKoopaShellHitbox);
- obj_scale(1.0f);
+ obj_set_hitbox(o, &sKoopaShellHitbox);
+ cur_obj_scale(1.0f);
switch (o->oAction) {
case 0:
- obj_update_floor_and_walls();
- obj_if_hit_wall_bounce_away();
+ cur_obj_update_floor_and_walls();
+ cur_obj_if_hit_wall_bounce_away();
if (o->oInteractStatus & INT_STATUS_INTERACTED)
o->oAction++;
o->oFaceAngleYaw += 0x1000;
- obj_move_standard(-20);
- func_802BCCD4(10.0f);
+ cur_obj_move_standard(-20);
+ koopa_shell_spawn_sparkles(10.0f);
break;
case 1:
- copy_object_pos(o, gMarioObject);
- sp34 = obj_update_floor_height_and_get_floor();
+ obj_copy_pos(o, gMarioObject);
+ sp34 = cur_obj_update_floor_height_and_get_floor();
if (absf(find_water_level(o->oPosX, o->oPosZ) - o->oPosY) < 10.0f)
- func_802BCA8C();
+ koopa_shell_spawn_water_drop();
else if (5.0f > absf(o->oPosY - o->oFloorHeight)) {
if (sp34 != NULL && sp34->type == 1)
bhv_koopa_shell_flame_spawn();
else
- func_802BCCD4(10.0f);
+ koopa_shell_spawn_sparkles(10.0f);
} else
- func_802BCCD4(10.0f);
+ koopa_shell_spawn_sparkles(10.0f);
o->oFaceAngleYaw = gMarioObject->oMoveAngleYaw;
if (o->oInteractStatus & INT_STATUS_STOP_RIDING) {
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
o->oAction = 0;
}
break;
diff --git a/src/game/behaviors/koopa_shell_underwater.inc.c b/src/game/behaviors/koopa_shell_underwater.inc.c
@@ -12,27 +12,27 @@ struct ObjectHitbox sKoopaShellUnderwaterHitbox = {
/* hurtboxHeight: */ 0,
};
-void func_802AA0D4(void) {
- set_object_hitbox(o, &sKoopaShellUnderwaterHitbox);
+void set_koopa_shell_underwater_hitbox(void) {
+ obj_set_hitbox(o, &sKoopaShellUnderwaterHitbox);
}
void bhv_koopa_shell_underwater_loop(void) {
switch (o->oHeldState) {
case HELD_FREE:
- func_802AA0D4();
+ set_koopa_shell_underwater_hitbox();
break;
case HELD_HELD:
- func_8029FA5C(-1, 0);
+ cur_obj_unrender_and_reset_state(-1, 0);
break;
case HELD_THROWN:
case HELD_DROPPED:
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
break;
}
if (o->oInteractStatus & INT_STATUS_STOP_RIDING) {
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
}
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/lll_floating_wood_piece.inc.c b/src/game/behaviors/lll_floating_wood_piece.inc.c
@@ -6,7 +6,7 @@ void bhv_lll_wood_piece_loop(void) {
o->oPosY += sins(o->oLllWoodPieceUnkF4) * 3.0f;
o->oLllWoodPieceUnkF4 += 0x400;
if (o->parentObj->oAction == 2)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_lll_floating_wood_bridge_loop(void) {
diff --git a/src/game/behaviors/lll_hexagonal_ring.inc.c b/src/game/behaviors/lll_hexagonal_ring.inc.c
@@ -1,5 +1,19 @@
// lll_hexagonal_ring.c.inc
+void hexagonal_ring_spawn_flames(void) {
+ struct Object *sp1C;
+ f32 size;
+ sp1C = spawn_object(o, MODEL_RED_FLAME, bhvVolcanoFlames);
+ sp1C->oPosY += 550.0f;
+ sp1C->oMoveAngleYaw = RandomU16() << 0x10 >> 0x10;
+ sp1C->oForwardVel = RandomFloat() * 40.0f + 20.0f;
+ sp1C->oVelY = RandomFloat() * 50.0f + 10.0f;
+ size = RandomFloat() * 6.0 + 3.0;
+ obj_scale_xyz(sp1C, size, size, size);
+ if (RandomFloat() < 0.1)
+ cur_obj_play_sound_2(SOUND_GENERAL_VOLCANO_EXPLOSION);
+}
+
void bhv_lll_rotating_hexagonal_ring_loop(void) {
UNUSED s32 unused;
o->oCollisionDistance = 4000.0f;
@@ -21,7 +35,7 @@ void bhv_lll_rotating_hexagonal_ring_loop(void) {
if (o->oTimer > 128)
o->oAction++;
o->oAngleVelYaw = 0;
- func_802BBFDC();
+ hexagonal_ring_spawn_flames();
break;
case 3:
o->oAngleVelYaw = sins(o->oTimer << 7) * 256.0f;
diff --git a/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c b/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c
@@ -7,12 +7,12 @@ s16 D_8032F894[] = { 4, 0, 0, 0, 1, 475, 900, 30, 1, 30, 0, -30, 2,
s16 *D_8032F8C8[] = { D_8032F860, D_8032F894 };
-s32 func_802BB414(s16 *a0, s32 a1) {
+s32 lll_octagonal_mesh_move(s16 *a0, s32 a1) {
switch (a0[a1]) {
case 4:
o->oMoveAngleYaw = a0[a1 + 2];
o->oForwardVel = a0[a1 + 3] / 100.0f;
- if (obj_is_mario_on_platform()) {
+ if (cur_obj_is_mario_on_platform()) {
a1 += 4;
o->oTimer = 0;
}
@@ -40,8 +40,8 @@ s32 func_802BB414(s16 *a0, s32 a1) {
return a1;
}
-s32 func_802BB680(s32 *a0, f32 *a1, s32 a2, s32 a3) {
- if (obj_is_mario_on_platform()) {
+s32 lll_octagonal_mesh_find_y_offset(s32 *a0, f32 *a1, s32 a2, s32 a3) {
+ if (cur_obj_is_mario_on_platform()) {
if (a0[0] < 0x4000)
a0[0] += a2;
else
@@ -65,10 +65,10 @@ void bhv_lll_moving_octagonal_mesh_platform_loop(void) {
o->oAction++;
} else
o->oHorizontalMovementUnkF8 =
- func_802BB414(D_8032F8C8[o->oBehParams2ndByte], o->oHorizontalMovementUnkF8);
+ lll_octagonal_mesh_move(D_8032F8C8[o->oBehParams2ndByte], o->oHorizontalMovementUnkF8);
print_debug_top_down_objectinfo("number %d\n", o->oHorizontalMovementUnkF8);
- obj_move_using_fvel_and_gravity();
- if (func_802BB680(&o->oHorizontalMovementUnk104, &o->oHorizontalMovementUnk108, 0x400, -80)) {
+ cur_obj_move_using_fvel_and_gravity();
+ if (lll_octagonal_mesh_find_y_offset(&o->oHorizontalMovementUnk104, &o->oHorizontalMovementUnk108, 0x400, -80)) {
o->oHorizontalMovementUnkF4 += 0x800;
o->oHorizontalMovementUnk100 -= sins(o->oHorizontalMovementUnkF4) * 2;
}
diff --git a/src/game/behaviors/lll_rotating_hex_flame.inc.c b/src/game/behaviors/lll_rotating_hex_flame.inc.c
@@ -4,13 +4,13 @@ void bhv_lll_rotating_hex_flame_loop(void) {
f32 sp24 = o->oLllRotatingHexFlameUnkF4;
f32 sp20 = o->oLllRotatingHexFlameUnkF8;
f32 sp1C = o->oLllRotatingHexFlameUnkFC;
- obj_set_pos_relative(o->parentObj, sp24, sp20, sp1C);
+ cur_obj_set_pos_relative(o->parentObj, sp24, sp20, sp1C);
o->oPosY = o->parentObj->oPosY + 100.0f;
if (o->parentObj->oAction == 3)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void func_802BB9F0(s16 a0) {
+void fire_bar_spawn_flames(s16 a0) {
struct Object *sp2C;
UNUSED s32 unused;
s32 i;
@@ -23,41 +23,41 @@ void func_802BB9F0(s16 a0) {
sp2C->oLllRotatingHexFlameUnkF4 += sp1C;
sp2C->oLllRotatingHexFlameUnkF8 = o->oPosY - 200.0f;
sp2C->oLllRotatingHexFlameUnkFC += sp18;
- scale_object_xyz(sp2C, 6.0f, 6.0f, 6.0f);
+ obj_scale_xyz(sp2C, 6.0f, 6.0f, 6.0f);
sp1C += sins(a0) * 150.0f;
sp18 += coss(a0) * 150.0f;
}
}
-void ActionRotatingCwFireBars0(void) {
+void fire_bar_act_0(void) {
if (o->oDistanceToMario < 3000.0f)
o->oAction = 1;
}
-void ActionRotatingCwFireBars1(void) {
- func_802BB9F0(0);
- func_802BB9F0(-0x8000);
+void fire_bar_act_1(void) {
+ fire_bar_spawn_flames(0);
+ fire_bar_spawn_flames(-0x8000);
o->oAngleVelYaw = 0;
o->oMoveAngleYaw = 0;
o->oAction = 2;
}
-void ActionRotatingCwFireBars2(void) {
+void fire_bar_act_2(void) {
o->oAngleVelYaw = -0x100;
o->oMoveAngleYaw += o->oAngleVelYaw;
if (o->oDistanceToMario > 3200.0f)
o->oAction = 3;
}
-void ActionRotatingCwFireBars3(void) {
+void fire_bar_act_3(void) {
o->oAction = 0;
}
-void (*sRotatingCwFireBarsActions[])(void) = { ActionRotatingCwFireBars0, ActionRotatingCwFireBars1,
- ActionRotatingCwFireBars2, ActionRotatingCwFireBars3 };
+void (*sRotatingCwFireBarsActions[])(void) = { fire_bar_act_0, fire_bar_act_1,
+ fire_bar_act_2, fire_bar_act_3 };
void bhv_lll_rotating_block_fire_bars_loop(void) {
- obj_call_action_function(sRotatingCwFireBarsActions);
+ cur_obj_call_action_function(sRotatingCwFireBarsActions);
if (o->oBehParams2ndByte == 0)
load_object_collision_model();
}
diff --git a/src/game/behaviors/lll_sinking_rectangle.inc.c b/src/game/behaviors/lll_sinking_rectangle.inc.c
@@ -1,6 +1,6 @@
// lll_sinking_rectangle.c.inc
-void func_802BC390(f32 a0, s32 a1) {
+void sinking_rectangular_plat_actions(f32 a0, s32 a1) {
switch (o->oAction) {
case 0:
o->oAction++;
@@ -19,7 +19,7 @@ void bhv_lll_sinking_rectangular_platform_loop(void) {
f32 sp1C = 0.4f;
s32 sp18 = 0x100;
if (o->oMoveAngleYaw != 0)
- func_802BC390(sp1C, sp18);
+ sinking_rectangular_plat_actions(sp1C, sp18);
else {
o->oFaceAnglePitch = sins(o->oLllWoodPieceUnkF4) * 512.0f;
o->oLllWoodPieceUnkF4 += 0x100;
@@ -29,5 +29,5 @@ void bhv_lll_sinking_rectangular_platform_loop(void) {
void bhv_lll_sinking_square_platforms_loop(void) {
f32 sp1C = 0.5f;
s32 sp18 = 0x100;
- func_802BC390(sp1C, sp18);
+ sinking_rectangular_plat_actions(sp1C, sp18);
}
diff --git a/src/game/behaviors/lll_sinking_rock_block.inc.c b/src/game/behaviors/lll_sinking_rock_block.inc.c
@@ -1,7 +1,7 @@
// lll_sinking_rock_block.c.inc
void bhv_lll_sinking_rock_block_loop(void) {
- func_802BB680(&o->oSinkWhenSteppedOnUnk104, &o->oSinkWhenSteppedOnUnk108, 124, -110);
+ lll_octagonal_mesh_find_y_offset(&o->oSinkWhenSteppedOnUnk104, &o->oSinkWhenSteppedOnUnk108, 124, -110);
o->oGraphYOffset = 0.0f;
o->oPosY = o->oHomeY + o->oSinkWhenSteppedOnUnk108;
}
diff --git a/src/game/behaviors/lll_volcano_flames.inc.c b/src/game/behaviors/lll_volcano_flames.inc.c
@@ -1,25 +1,11 @@
// lll_volcano_flames.c.inc
void bhv_volcano_flames_loop(void) {
- obj_update_floor_height();
- obj_compute_vel_xz();
+ cur_obj_update_floor_height();
+ cur_obj_compute_vel_xz();
o->oPosX += o->oVelX;
o->oPosZ += o->oVelZ;
- obj_move_y(-4.0f, -0.7f, 2.0f);
+ cur_obj_move_y(-4.0f, -0.7f, 2.0f);
if (o->oMoveFlags & 0x33)
- mark_object_for_deletion(o);
-}
-
-void func_802BBFDC(void) {
- struct Object *sp1C;
- f32 size;
- sp1C = spawn_object(o, MODEL_RED_FLAME, bhvVolcanoFlames);
- sp1C->oPosY += 550.0f;
- sp1C->oMoveAngleYaw = RandomU16() << 0x10 >> 0x10;
- sp1C->oForwardVel = RandomFloat() * 40.0f + 20.0f;
- sp1C->oVelY = RandomFloat() * 50.0f + 10.0f;
- size = RandomFloat() * 6.0 + 3.0;
- scale_object_xyz(sp1C, size, size, size);
- if (RandomFloat() < 0.1)
- PlaySound2(SOUND_GENERAL_VOLCANO_EXPLOSION);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/mad_piano.inc.c b/src/game/behaviors/mad_piano.inc.c
@@ -12,35 +12,35 @@ static struct ObjectHitbox sMadPianoHitbox = {
};
static void mad_piano_act_wait(void) {
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
if (o->oDistanceToMario < 500.0f) {
if (o->oTimer > 20) {
if (gMarioStates[0].forwardVel > 10.0f) {
o->oAction = MAD_PIANO_ACT_ATTACK;
- obj_become_tangible();
+ cur_obj_become_tangible();
}
}
} else {
o->oTimer = 0;
}
- obj_push_mario_away_from_cylinder(280.0f, 150.0f);
+ cur_obj_push_mario_away_from_cylinder(280.0f, 150.0f);
}
static void mad_piano_act_attack(void) {
- obj_update_floor_and_walls();
- set_obj_animation_and_sound_state(1);
+ cur_obj_update_floor_and_walls();
+ cur_obj_init_animation_with_sound(1);
func_802F9378(0, 0, SOUND_OBJ_MAD_PIANO_CHOMPING);
if (o->oDistanceToMario < 500.0f) {
o->oTimer = 0;
}
- if (o->oTimer > 80 && func_8029F788()) {
+ if (o->oTimer > 80 && cur_obj_check_if_near_animation_end()) {
o->oAction = MAD_PIANO_ACT_WAIT;
o->oForwardVel = 0.0f;
- obj_become_intangible();
+ cur_obj_become_intangible();
} else {
f32 dx = o->oPosX - o->oHomeX;
f32 dz = o->oPosZ - o->oHomeZ;
@@ -52,12 +52,12 @@ static void mad_piano_act_attack(void) {
o->oPosZ = o->oHomeZ + dz * distToHome;
}
- obj_rotate_yaw_toward(o->oAngleToMario, 400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 400);
o->oForwardVel = 5.0f;
}
obj_check_attacks(&sMadPianoHitbox, o->oAction);
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
void bhv_mad_piano_update(void) {
diff --git a/src/game/behaviors/manta_ray.inc.c b/src/game/behaviors/manta_ray.inc.c
@@ -22,17 +22,17 @@ void bhv_manta_ray_init(void) {
struct Object *sp1C;
sp1C = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager);
o->parentObj = sp1C;
- set_object_hitbox(o, &sMantaRayHitbox);
- obj_scale(2.5f);
+ obj_set_hitbox(o, &sMantaRayHitbox);
+ cur_obj_scale(2.5f);
}
-void func_802F5E20(void) {
+void manta_ray_move(void) {
s16 sp1E;
s32 sp18;
sp1E = o->header.gfx.unk38.animFrame;
gCurrentObject->oPathedWaypointsS16 = &D_803316A8;
- sp18 = obj_follow_path(sp18);
+ sp18 = cur_obj_follow_path(sp18);
o->oMantaUnkF8 = o->oPathedTargetYaw;
o->oMantaUnkF4 = o->oPathedTargetPitch;
o->oForwardVel = 10.0f;
@@ -48,12 +48,12 @@ void func_802F5E20(void) {
o->oMoveAngleRoll = 0x4000 / 3;
}
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
if (sp1E == 0)
- PlaySound2(SOUND_GENERAL_MOVING_WATER);
+ cur_obj_play_sound_2(SOUND_GENERAL_MOVING_WATER);
}
-void func_802F5FD8(void) {
+void manta_ray_act_spawn_ring(void) {
struct Object *sp1C = o->parentObj;
struct Object *sp18;
@@ -78,17 +78,17 @@ void func_802F5FD8(void) {
void bhv_manta_ray_loop(void) {
switch (o->oAction) {
case 0:
- func_802F5E20();
- func_802F5FD8();
+ manta_ray_move();
+ manta_ray_act_spawn_ring();
if (o->oMantaUnk1AC == 5) {
- func_802A3004();
- create_star(-3180.0f, -3600.0f, 120.0f);
+ spawn_mist_particles();
+ spawn_default_star(-3180.0f, -3600.0f, 120.0f);
o->oAction = 1;
}
break;
case 1:
- func_802F5E20();
+ manta_ray_move();
break;
}
diff --git a/src/game/behaviors/metal_box.inc.c b/src/game/behaviors/metal_box.inc.c
@@ -12,7 +12,7 @@ struct ObjectHitbox sMetalBoxHitbox = {
/* hurtboxHeight: */ 300,
};
-s32 func_802B0C54(f32 a0, f32 a1) {
+s32 check_if_moving_over_floor(f32 a0, f32 a1) {
struct Surface *sp24;
f32 sp20 = o->oPosX + sins(o->oMoveAngleYaw) * a1;
f32 floorHeight;
@@ -27,17 +27,17 @@ s32 func_802B0C54(f32 a0, f32 a1) {
void bhv_pushable_loop(void) {
UNUSED s16 unused;
s16 sp1C;
- set_object_hitbox(o, &sMetalBoxHitbox);
+ obj_set_hitbox(o, &sMetalBoxHitbox);
o->oForwardVel = 0.0f;
- if (are_objects_collided(o, gMarioObject) && gMarioStates->flags & 0x80000000) {
- sp1C = angle_to_object(o, gMarioObject);
+ if (obj_check_if_collided_with_object(o, gMarioObject) && gMarioStates->flags & 0x80000000) {
+ sp1C = obj_angle_to_object(o, gMarioObject);
if (abs_angle_diff(sp1C, gMarioObject->oMoveAngleYaw) > 0x4000) {
o->oMoveAngleYaw = (s16)((gMarioObject->oMoveAngleYaw + 0x2000) & 0xc000);
- if (func_802B0C54(8.0f, 150.0f)) {
+ if (check_if_moving_over_floor(8.0f, 150.0f)) {
o->oForwardVel = 4.0f;
- PlaySound(SOUND_ENV_METAL_BOX_PUSH);
+ cur_obj_play_sound_1(SOUND_ENV_METAL_BOX_PUSH);
}
}
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
diff --git a/src/game/behaviors/mips.inc.c b/src/game/behaviors/mips.inc.c
@@ -40,7 +40,7 @@ void bhv_mips_init(void) {
o->oFriction = 0.89f;
o->oBuoyancy = 1.2f;
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
}
/**
@@ -99,7 +99,7 @@ void bhv_mips_act_wait_for_nearby_mario(void) {
o->oAction = MIPS_ACT_WAIT_FOR_ANIMATION_DONE;
} else {
// Resume path following.
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
o->oAction = MIPS_ACT_FOLLOW_PATH;
}
}
@@ -120,7 +120,7 @@ void bhv_mips_act_follow_path(void) {
// Set start waypoint and follow the path from there.
o->oPathedStartWaypoint = waypoint;
- followStatus = obj_follow_path(followStatus);
+ followStatus = cur_obj_follow_path(followStatus);
// Update velocity and angle and do movement.
#ifndef VERSION_JP
@@ -133,16 +133,16 @@ void bhv_mips_act_follow_path(void) {
// If we are at the end of the path, do idle animation and wait for Mario.
if (followStatus == PATH_REACHED_END) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oAction = MIPS_ACT_WAIT_FOR_NEARBY_MARIO;
}
// Play sounds during walk animation.
- if (func_8029F788() == 1 && (collisionFlags & OBJ_COL_FLAG_UNDERWATER)) {
- PlaySound2(SOUND_OBJ_MIPS_RABBIT_WATER);
- spawn_object(o, MODEL_NONE, bhvSurfaceWaveShrinking);
- } else if (func_8029F788() == 1) {
- PlaySound2(SOUND_OBJ_MIPS_RABBIT);
+ if (cur_obj_check_if_near_animation_end() == 1 && (collisionFlags & OBJ_COL_FLAG_UNDERWATER)) {
+ cur_obj_play_sound_2(SOUND_OBJ_MIPS_RABBIT_WATER);
+ spawn_object(o, MODEL_NONE, bhvShallowWaterSplash);
+ } else if (cur_obj_check_if_near_animation_end() == 1) {
+ cur_obj_play_sound_2(SOUND_OBJ_MIPS_RABBIT);
}
}
@@ -150,8 +150,8 @@ void bhv_mips_act_follow_path(void) {
* Seems to wait until the current animation is done, then go idle.
*/
void bhv_mips_act_wait_for_animation_done(void) {
- if (func_8029F788() == 1) {
- SetObjAnimation(0);
+ if (cur_obj_check_if_near_animation_end() == 1) {
+ cur_obj_init_animation(0);
o->oAction = MIPS_ACT_IDLE;
}
}
@@ -176,7 +176,7 @@ void bhv_mips_act_fall_down(void) {
o->oMoveAngleYaw = o->oFaceAngleYaw;
if (collisionFlags & OBJ_COL_FLAG_UNDERWATER)
- spawn_object(o, MODEL_NONE, bhvSurfaceWaveShrinking);
+ spawn_object(o, MODEL_NONE, bhvShallowWaterSplash);
}
}
@@ -230,9 +230,9 @@ void bhv_mips_held(void) {
s16 dialogID;
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
- SetObjAnimation(4); // Held animation.
- obj_set_pos_relative(gMarioObject, 0, 60.0f, 100.0f);
- obj_become_intangible();
+ cur_obj_init_animation(4); // Held animation.
+ cur_obj_set_pos_relative(gMarioObject, 0, 60.0f, 100.0f);
+ cur_obj_become_intangible();
// If MIPS hasn't spawned his star yet...
if (o->oMipsStarStatus == MIPS_STAR_STATUS_HAVENT_SPAWNED_STAR) {
@@ -258,11 +258,11 @@ void bhv_mips_held(void) {
* Handles MIPS being dropped by Mario.
*/
void bhv_mips_dropped(void) {
- obj_get_dropped();
+ cur_obj_get_dropped();
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oHeldState = HELD_FREE;
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oForwardVel = 3.0f;
o->oAction = MIPS_ACT_IDLE;
}
@@ -271,12 +271,12 @@ void bhv_mips_dropped(void) {
* Handles MIPS being thrown by Mario.
*/
void bhv_mips_thrown(void) {
- obj_enable_rendering_2();
+ cur_obj_enable_rendering_2();
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
o->oHeldState = HELD_FREE;
o->oFlags &= ~OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW;
- SetObjAnimation(2);
- obj_become_tangible();
+ cur_obj_init_animation(2);
+ cur_obj_become_tangible();
o->oForwardVel = 25.0f;
o->oVelY = 20.0f;
o->oAction = MIPS_ACT_FALL_DOWN;
diff --git a/src/game/behaviors/moat_grill.inc.c b/src/game/behaviors/moat_grill.inc.c
@@ -2,7 +2,7 @@
void bhv_moat_grills_loop(void) {
if (save_file_get_flags() & SAVE_FLAG_MOAT_DRAINED)
- obj_set_model(MODEL_NONE);
+ cur_obj_set_model(MODEL_NONE);
else
load_object_collision_model();
}
diff --git a/src/game/behaviors/moneybag.inc.c b/src/game/behaviors/moneybag.inc.c
@@ -28,12 +28,12 @@ void bhv_moneybag_init(void) {
o->oGravity = 3.0f;
o->oFriction = 1.0f;
o->oBuoyancy = 2.0f;
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oOpacity = 0;
}
-void MoneybagCheckMarioCollision(void) {
- set_object_hitbox(o, &sMoneybagHitbox);
+void moneybag_check_mario_collision(void) {
+ obj_set_hitbox(o, &sMoneybagHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED) /* bit 15 */
{
@@ -54,25 +54,25 @@ void MoneybagCheckMarioCollision(void) {
// sp20 = collisionFlags
-void MoneybagJump(s8 collisionFlags) {
+void moneybag_jump(s8 collisionFlags) {
s16 animFrame = o->header.gfx.unk38.animFrame;
switch (o->oMoneybagJumpState) {
case MONEYBAG_JUMP_PREPARE:
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
if (animFrame == 5) {
o->oForwardVel = 20.0f;
o->oVelY = 40.0f;
}
- if (func_8029F788() == 1) {
+ if (cur_obj_check_if_near_animation_end() == 1) {
o->oMoneybagJumpState = MONEYBAG_JUMP_JUMP;
- PlaySound2(SOUND_GENERAL_BOING2_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_BOING2_LOWPRIO);
}
break;
case MONEYBAG_JUMP_JUMP:
- SetObjAnimation(2);
+ cur_obj_init_animation(2);
if ((collisionFlags & 1) == 1) /* bit 0 */
{
@@ -83,14 +83,14 @@ void MoneybagJump(s8 collisionFlags) {
break;
case MONEYBAG_JUMP_JUMP_AND_BOUNCE:
- SetObjAnimation(3);
+ cur_obj_init_animation(3);
- if (func_8029F788() == 1)
+ if (cur_obj_check_if_near_animation_end() == 1)
o->oMoneybagJumpState = MONEYBAG_JUMP_LANDING;
break;
case MONEYBAG_JUMP_WALK_AROUND:
- SetObjAnimation(4);
+ cur_obj_init_animation(4);
o->oForwardVel = 10.0f;
if (o->oTimer >= 61) {
@@ -101,13 +101,13 @@ void MoneybagJump(s8 collisionFlags) {
break;
case MONEYBAG_JUMP_WALK_HOME:
- SetObjAnimation(4);
+ cur_obj_init_animation(4);
o->oForwardVel = 5.0f;
break;
}
}
-void MoneybagMoveAroundLoop(void) {
+void moneybag_act_move_around(void) {
s16 collisionFlags;
obj_return_and_displace_home(o, o->oHomeX, o->oHomeY, o->oHomeZ, 200);
@@ -123,15 +123,15 @@ void MoneybagMoveAroundLoop(void) {
o->oMoneybagJumpState = MONEYBAG_JUMP_PREPARE;
}
- MoneybagJump(collisionFlags);
- MoneybagCheckMarioCollision();
+ moneybag_jump(collisionFlags);
+ moneybag_check_mario_collision();
if (!is_point_within_radius_of_mario(o->oHomeX, o->oHomeY, o->oHomeZ, 800)
&& ((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED))
o->oAction = MONEYBAG_ACT_RETURN_HOME;
}
-void MoneybagReturnHomeLoop(void) {
+void moneybag_act_return_home(void) {
s16 collisionFlags;
f32 sp28 = o->oHomeX - o->oPosX;
f32 sp24 = o->oHomeZ - o->oPosZ;
@@ -143,15 +143,15 @@ void MoneybagReturnHomeLoop(void) {
&& (o->oMoneybagJumpState == MONEYBAG_JUMP_LANDING))
o->oMoneybagJumpState = MONEYBAG_JUMP_WALK_HOME;
- MoneybagJump(collisionFlags);
- MoneybagCheckMarioCollision();
+ moneybag_jump(collisionFlags);
+ moneybag_check_mario_collision();
if (is_point_close_to_object(o, o->oHomeX, o->oHomeY, o->oHomeZ, 100)) {
spawn_object(o, MODEL_YELLOW_COIN, bhvMoneybagHidden);
#ifndef VERSION_JP
- PlaySound2(SOUND_GENERAL_VANISH_SFX);
+ cur_obj_play_sound_2(SOUND_GENERAL_VANISH_SFX);
#endif
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oAction = MONEYBAG_ACT_DISAPPEAR;
o->oMoneybagJumpState = MONEYBAG_JUMP_LANDING;
}
@@ -162,7 +162,7 @@ void MoneybagReturnHomeLoop(void) {
}
}
-void MoneybagDisappearLoop(void) {
+void moneybag_act_disappear(void) {
o->oOpacity -= 6;
if (o->oOpacity < 0) {
o->oOpacity = 0;
@@ -170,11 +170,11 @@ void MoneybagDisappearLoop(void) {
}
}
-void MoneybagDeathLoop(void) {
+void moneybag_act_death(void) {
if (o->oTimer == 1) {
obj_spawn_yellow_coins(o, 5);
create_sound_spawner(SOUND_GENERAL_SPLATTERING);
- func_802A3004();
+ spawn_mist_particles();
o->activeFlags = 0;
}
}
@@ -192,34 +192,34 @@ void bhv_moneybag_loop(void) {
break;
case MONEYBAG_ACT_MOVE_AROUND:
- MoneybagMoveAroundLoop();
+ moneybag_act_move_around();
if (o->oTimer >= 31)
- obj_become_tangible();
+ cur_obj_become_tangible();
break;
case MONEYBAG_ACT_RETURN_HOME:
- MoneybagReturnHomeLoop();
+ moneybag_act_return_home();
break;
case MONEYBAG_ACT_DISAPPEAR:
- MoneybagDisappearLoop();
+ moneybag_act_disappear();
break;
case MONEYBAG_ACT_DEATH:
- MoneybagDeathLoop();
+ moneybag_act_death();
break;
}
}
void bhv_moneybag_hidden_loop(void) {
- set_object_hitbox(o, &sMoneybagHiddenHitbox);
+ obj_set_hitbox(o, &sMoneybagHiddenHitbox);
switch (o->oAction) {
case FAKE_MONEYBAG_COIN_ACT_IDLE:
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 400)) {
spawn_object(o, MODEL_MONEYBAG, bhvMoneybag);
#ifndef VERSION_JP
- PlaySound2(SOUND_GENERAL_VANISH_SFX);
+ cur_obj_play_sound_2(SOUND_GENERAL_VANISH_SFX);
#endif
o->oAction = FAKE_MONEYBAG_COIN_ACT_TRANSFORM;
}
diff --git a/src/game/behaviors/monty_mole.inc.c b/src/game/behaviors/monty_mole.inc.c
@@ -186,7 +186,7 @@ void monty_mole_spawn_dirt_particles(s8 offsetY, s8 velYBase) {
#if defined(VERSION_JP) || defined(VERSION_US)
sMontyMoleRiseFromGroundParticles.offsetY = offsetY;
sMontyMoleRiseFromGroundParticles.velYBase = velYBase;
- obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
+ cur_obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
#else
s8 tempVelYBase = velYBase;
s8 tempOffsetY = offsetY;
@@ -194,7 +194,7 @@ void monty_mole_spawn_dirt_particles(s8 offsetY, s8 velYBase) {
do {
sMontyMoleRiseFromGroundParticles.offsetY = tempOffsetY;
sMontyMoleRiseFromGroundParticles.velYBase = tempVelYBase;
- obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
+ cur_obj_spawn_particles(&sMontyMoleRiseFromGroundParticles);
} while (0);
#endif
}
@@ -223,7 +223,7 @@ static void monty_mole_act_select_hole(void) {
// Select a hole to pop out of
if ((o->oMontyMoleCurrentHole = monty_mole_select_available_hole(minDistToMario)) != NULL) {
- PlaySound2(SOUND_OBJ2_MONTY_MOLE_APPEAR);
+ cur_obj_play_sound_2(SOUND_OBJ2_MONTY_MOLE_APPEAR);
// Mark hole as unavailable
o->oMontyMoleCurrentHole->oMontyMoleHoleCooldown = -1;
@@ -248,8 +248,8 @@ static void monty_mole_act_select_hole(void) {
monty_mole_spawn_dirt_particles(0, 20);
}
- obj_unhide();
- obj_become_tangible();
+ cur_obj_unhide();
+ cur_obj_become_tangible();
}
}
@@ -257,13 +257,13 @@ static void monty_mole_act_select_hole(void) {
* Move upward until high enough, then enter the spawn rock action.
*/
static void monty_mole_act_rise_from_hole(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (o->oMontyMoleHeightRelativeToFloor >= 49.0f) {
o->oPosY = o->oFloorHeight + 50.0f;
o->oVelY = 0.0f;
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = MONTY_MOLE_ACT_SPAWN_ROCK;
}
}
@@ -305,11 +305,11 @@ static void monty_mole_act_begin_jump_into_hole(void) {
*/
static void monty_mole_act_throw_rock(void) {
if (func_802F92EC(8, 10)) {
- PlaySound2(SOUND_OBJ_MONTY_MOLE_ATTACK);
+ cur_obj_play_sound_2(SOUND_OBJ_MONTY_MOLE_ATTACK);
o->prevObj = NULL;
}
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = MONTY_MOLE_ACT_BEGIN_JUMP_INTO_HOLE;
}
}
@@ -344,17 +344,17 @@ static void monty_mole_hide_in_hole(void) {
// action. If no hole is available (e.g. because mario is too far away),
// the game will crash because of the line above that accesses
// oMontyMoleCurrentHole.
- obj_become_intangible();
+ cur_obj_become_intangible();
}
/**
* Wait to land on the floor, then hide.
*/
static void monty_mole_act_hide(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
- obj_hide();
+ cur_obj_hide();
monty_mole_hide_in_hole();
} else {
approach_f32_ptr(&o->oVelY, -4.0f, 0.5f);
@@ -367,7 +367,7 @@ static void monty_mole_act_hide(void) {
*/
static void monty_mole_act_jump_out_of_hole(void) {
if (o->oVelY > 0.0f) {
- set_obj_animation_and_sound_state(9);
+ cur_obj_init_animation_with_sound(9);
} else {
func_802F927C(4);
@@ -386,7 +386,7 @@ void bhv_monty_mole_update(void) {
// PARTIAL_UPDATE
o->oDeathSound = SOUND_OBJ_DYING_ENEMY1;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
o->oMontyMoleHeightRelativeToFloor = o->oPosY - o->oFloorHeight;
@@ -452,7 +452,7 @@ void bhv_monty_mole_update(void) {
o->prevObj = NULL;
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
/**
@@ -486,14 +486,14 @@ static void monty_mole_rock_act_held(void) {
* Move, then despawn after hitting the ground or water.
*/
static void monty_mole_rock_act_move(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_ENTERED_WATER)) {
- obj_spawn_particles(&sMontyMoleRockBreakParticles);
- mark_object_for_deletion(o);
+ cur_obj_spawn_particles(&sMontyMoleRockBreakParticles);
+ obj_mark_for_deletion(o);
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
/**
diff --git a/src/game/behaviors/moving_coin.inc.c b/src/game/behaviors/moving_coin.inc.c
@@ -26,28 +26,28 @@ static struct ObjectHitbox sMovingBlueCoinHitbox = {
/* hurtboxHeight: */ 0,
};
-s32 CoinStep(s16 *collisionFlagsPtr) {
+s32 coin_step(s16 *collisionFlagsPtr) {
*collisionFlagsPtr = object_step();
obj_check_floor_death(*collisionFlagsPtr, sObjFloor);
if ((*collisionFlagsPtr & 0x1) != 0 && (*collisionFlagsPtr & 0x8) == 0) /* bit 0, bit 3 */
{
- PlaySound2(SOUND_GENERAL_COIN_DROP);
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_DROP);
return 1;
}
return 0;
}
-void MovingCoinFlickerLoop(void) {
+void moving_coin_flicker(void) {
s16 collisionFlags;
- CoinStep(&collisionFlags);
+ coin_step(&collisionFlags);
obj_flicker_and_disappear(o, 0);
}
-void CoinCollected(void) {
+void coin_collected(void) {
spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles);
o->activeFlags = 0;
}
@@ -57,26 +57,26 @@ void bhv_moving_yellow_coin_init(void) {
o->oFriction = 1.0f;
o->oBuoyancy = 1.5f;
- set_object_hitbox(o, &sMovingYellowCoinHitbox);
+ obj_set_hitbox(o, &sMovingYellowCoinHitbox);
}
void bhv_moving_yellow_coin_loop(void) {
s16 collisionFlags;
switch (o->oAction) {
case MOV_YCOIN_ACT_IDLE:
- CoinStep(&collisionFlags);
+ coin_step(&collisionFlags);
if (o->oTimer < 10)
- obj_become_intangible();
+ cur_obj_become_intangible();
else
- obj_become_tangible();
+ cur_obj_become_tangible();
if (o->oTimer >= 301)
o->oAction = 1;
break;
case MOV_YCOIN_ACT_BLINKING:
- MovingCoinFlickerLoop();
+ moving_coin_flicker();
break;
case MOV_YCOIN_ACT_LAVA_DEATH:
@@ -90,7 +90,7 @@ void bhv_moving_yellow_coin_loop(void) {
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) /* bit 15 */
{
- CoinCollected();
+ coin_collected();
o->oInteractStatus = 0;
}
}
@@ -100,7 +100,7 @@ void bhv_moving_blue_coin_init(void) {
o->oFriction = 1.0f;
o->oBuoyancy = 1.5f;
- set_object_hitbox(o, &sMovingBlueCoinHitbox);
+ obj_set_hitbox(o, &sMovingBlueCoinHitbox);
}
void bhv_moving_blue_coin_loop(void) {
@@ -122,7 +122,7 @@ void bhv_moving_blue_coin_loop(void) {
{
o->oForwardVel += 25.0f;
if ((collisionFlags & 0x8) == 0)
- PlaySound2(SOUND_GENERAL_COIN_DROP); /* bit 3 */
+ cur_obj_play_sound_2(SOUND_GENERAL_COIN_DROP); /* bit 3 */
} else
o->oForwardVel *= 0.98;
@@ -135,7 +135,7 @@ void bhv_moving_blue_coin_loop(void) {
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) /* bit 15 */
{
- CoinCollected();
+ coin_collected();
o->oInteractStatus = 0;
}
}
@@ -145,16 +145,16 @@ void bhv_blue_coin_sliding_jumping_init(void) {
o->oFriction = 0.98;
o->oBuoyancy = 1.5;
- set_object_hitbox(o, &sMovingBlueCoinHitbox);
+ obj_set_hitbox(o, &sMovingBlueCoinHitbox);
}
-void func_802E540C(void) {
+void blue_coin_sliding_away_from_mario(void) {
s16 collisionFlags;
o->oForwardVel = 15.0;
o->oMoveAngleYaw = o->oAngleToMario + 0x8000;
- if (CoinStep(&collisionFlags) != 0)
+ if (coin_step(&collisionFlags) != 0)
o->oVelY += 18.0f;
if ((collisionFlags & 0x2) != 0)
o->oAction = 3; /* bit 1 */
@@ -163,10 +163,10 @@ void func_802E540C(void) {
o->oAction = 2;
}
-void func_802E54DC(void) {
+void blue_coin_sliding_slow_down(void) {
s16 collisionFlags;
- CoinStep(&collisionFlags);
+ coin_step(&collisionFlags);
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 500) == 1)
o->oAction = 1;
@@ -187,22 +187,22 @@ void bhv_blue_coin_sliding_loop(void) {
break;
case 1:
- func_802E540C();
+ blue_coin_sliding_away_from_mario();
break;
case 2:
- func_802E54DC();
+ blue_coin_sliding_slow_down();
set_object_visibility(o, 3000);
break;
case 3:
- CoinStep(&collisionFlags);
+ coin_step(&collisionFlags);
if (o->oTimer >= 61)
o->oAction = 4;
break;
case 4:
- MovingCoinFlickerLoop();
+ moving_coin_flicker();
break;
case 100:
@@ -216,7 +216,7 @@ void bhv_blue_coin_sliding_loop(void) {
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) /* bit 15 */
{
- CoinCollected();
+ coin_collected();
o->oInteractStatus = 0;
}
}
@@ -227,41 +227,41 @@ void bhv_blue_coin_jumping_loop(void) {
switch (o->oAction) {
case 0:
if (o->oTimer == 0) {
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oVelY = 50.0;
}
object_step();
if (o->oTimer == 15) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = 1;
}
break;
case 1:
- func_802E540C();
+ blue_coin_sliding_away_from_mario();
break;
case 2:
- func_802E54DC();
+ blue_coin_sliding_slow_down();
set_object_visibility(o, 3000);
break;
case 3:
- CoinStep(&collisionFlags);
+ coin_step(&collisionFlags);
if (o->oTimer >= 61)
o->oAction = 4;
break;
case 4:
- MovingCoinFlickerLoop();
+ moving_coin_flicker();
break;
}
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) /* bit 15 */
{
- CoinCollected();
+ coin_collected();
o->oInteractStatus = 0;
}
}
diff --git a/src/game/behaviors/mr_blizzard.inc.c b/src/game/behaviors/mr_blizzard.inc.c
@@ -48,7 +48,7 @@ void func_80306ED4(s8 count, s8 offsetY, s8 forwardVelBase, s8 velYBase, s8 size
D_80331A00.forwardVelBase = forwardVelBase;
D_80331A00.velYBase = velYBase;
D_80331A00.sizeBase = sizeBase;
- obj_spawn_particles(&D_80331A00);
+ cur_obj_spawn_particles(&D_80331A00);
#else
s8 tempSizeBase = sizeBase;
s8 tempVelYBase = velYBase;
@@ -62,7 +62,7 @@ void func_80306ED4(s8 count, s8 offsetY, s8 forwardVelBase, s8 velYBase, s8 size
D_80331A00.forwardVelBase = tempForwardVelBase;
D_80331A00.velYBase = tempVelYBase;
D_80331A00.sizeBase = tempSizeBase;
- obj_spawn_particles(&D_80331A00);
+ cur_obj_spawn_particles(&D_80331A00);
} while (0);
#endif
}
@@ -88,9 +88,9 @@ static void func_8030702C(void) {
if (o->oMrBlizzardUnkF8 == NULL && func_802F92EC(0, 5)) {
o->oMrBlizzardUnkF8 = spawn_object_relative(0, -70, (s32)(o->oMrBlizzardUnk10C + 153.0f), 0, o,
MODEL_WHITE_PARTICLE, bhvMrBlizzardSnowball);
- } else if (obj_check_anim_frame(10)) {
+ } else if (cur_obj_check_anim_frame(10)) {
o->prevObj = o->oMrBlizzardUnkF8;
- } else if (func_8029F788()) {
+ } else if (cur_obj_check_if_near_animation_end()) {
if (o->oMrBlizzardUnk10C < 0.0f) {
o->oAction = 1;
} else {
@@ -101,16 +101,16 @@ static void func_8030702C(void) {
static void func_80307144(void) {
if (o->oDistanceToMario < 1000.0f) {
- PlaySound2(SOUND_OBJ_SNOW_SAND2);
+ cur_obj_play_sound_2(SOUND_OBJ_SNOW_SAND2);
o->oAction = 2;
o->oMoveAngleYaw = o->oAngleToMario;
o->oMrBlizzardUnkFC = 42.0f;
func_80306ED4(8, -10, 15, 20, 10);
- obj_unhide();
- obj_become_tangible();
+ cur_obj_unhide();
+ cur_obj_become_tangible();
} else {
- obj_hide();
+ cur_obj_hide();
}
}
@@ -136,7 +136,7 @@ static void func_80307370(void) {
f32 val00;
if (o->oMoveFlags & 0x00000003) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x600);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x600);
val06 = o->oAngleToMario - o->oMoveAngleYaw;
if (val06 != 0) {
@@ -165,7 +165,7 @@ static void func_80307370(void) {
if (absi(o->oFaceAngleRoll) > 0x3000) {
o->oAction = 6;
o->prevObj = o->oMrBlizzardUnkF8 = NULL;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
} else if (o->oDistanceToMario > 1500.0f) {
o->oAction = 5;
@@ -182,7 +182,7 @@ static void func_80307650(void) {
if (clamp_f32(&o->oMrBlizzardUnk104, -0x4000, 0x4000)) {
if (o->oMrBlizzardUnk108 != 0.0f) {
- PlaySound2(SOUND_OBJ_SNOW_SAND1);
+ cur_obj_play_sound_2(SOUND_OBJ_SNOW_SAND1);
if (o->oAnimState) {
save_file_clear_flags(SAVE_FLAG_CAP_ON_MR_BLIZZARD);
@@ -210,19 +210,19 @@ static void func_80307650(void) {
if (o->oTimer >= 30) {
if (o->oTimer == 30) {
- PlaySound2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
+ cur_obj_play_sound_2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
}
if (o->oMrBlizzardUnkF4 != 0.0f) {
if ((o->oMrBlizzardUnkF4 -= 0.03f) <= 0.0f) {
o->oMrBlizzardUnkF4 = 0.0f;
if (!(o->oBehParams & 0x0000FF00)) {
- spawn_object_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
+ obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
set_object_respawn_info_bits(o, 1);
}
}
} else if (o->oDistanceToMario > 1000.0f) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
o->oAction = 0;
o->oMrBlizzardUnkF4 = 1.0f;
@@ -235,9 +235,9 @@ static void func_80307650(void) {
static void func_80307990(void) {
if (func_802F92EC(1, 7)) {
- PlaySound2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
o->prevObj = o->oMrBlizzardUnkF8 = NULL;
- } else if (func_8029F788()) {
+ } else if (cur_obj_check_if_near_animation_end()) {
o->oAction = 0;
}
}
@@ -253,16 +253,16 @@ static void func_80307A0C(void) {
if (approach_f32_ptr(&o->oMrBlizzardUnk10C, -200.0f, 4.0f)) {
o->oAction = 0;
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
}
}
static void func_80307AD4(void) {
if (o->oMrBlizzardUnk100 != 0) {
- obj_rotate_yaw_toward(o->oMrBlizzardUnk1AC, 3400);
+ cur_obj_rotate_yaw_toward(o->oMrBlizzardUnk1AC, 3400);
if (--o->oMrBlizzardUnk100 == 0) {
- PlaySound2(SOUND_OBJ_MR_BLIZZARD_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ_MR_BLIZZARD_ALERT);
if (o->oMrBlizzardUnk110 > 700) {
o->oMrBlizzardUnk1AC += 0x8000;
@@ -276,9 +276,9 @@ static void func_80307AD4(void) {
}
}
} else if (o->oMoveFlags & 0x00000003) {
- PlaySound2(SOUND_OBJ_SNOW_SAND1);
+ cur_obj_play_sound_2(SOUND_OBJ_SNOW_SAND1);
if (o->oMrBlizzardUnk110 != 0) {
- o->oMrBlizzardUnk110 = (s32) obj_lateral_dist_to_home();
+ o->oMrBlizzardUnk110 = (s32) cur_obj_lateral_dist_to_home();
} else {
o->oMrBlizzardUnk110 = 700;
}
@@ -289,7 +289,7 @@ static void func_80307AD4(void) {
}
void bhv_mr_blizzard_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case 0:
@@ -322,13 +322,13 @@ void bhv_mr_blizzard_update(void) {
o->oGraphYOffset = o->oMrBlizzardUnk10C + absf(20.0f * sins(o->oFaceAngleRoll))
- 40.0f * (1.0f - o->oMrBlizzardUnkF4);
- obj_scale(o->oMrBlizzardUnkF4);
- obj_move_standard(78);
+ cur_obj_scale(o->oMrBlizzardUnkF4);
+ cur_obj_move_standard(78);
obj_check_attacks(&sMrBlizzardHitbox, o->oAction);
}
static void func_80307E24(void) {
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->parentObj->prevObj == o) {
o->oAction = 1;
o->oParentRelativePosX = 190.0f;
@@ -357,16 +357,16 @@ static void func_80307EB0(void) {
}
static void func_80307FD4(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_check_attacks(&sMrBlizzardSnowballHitbox, -1);
if (o->oAction == -1 || o->oMoveFlags & 0x0000000B) {
func_80306ED4(6, 0, 5, 10, 3);
create_sound_spawner(SOUND_GENERAL_MOVING_IN_SAND);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
void bhv_mr_blizzard_snowball(void) {
diff --git a/src/game/behaviors/mr_i.inc.c b/src/game/behaviors/mr_i.inc.c
@@ -8,51 +8,51 @@ void bhv_piranha_particle_loop(void) {
o->oForwardVel = 20.0f + 20.0f * RandomFloat();
o->oMoveAngleYaw = RandomU16();
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
-void ActionMrIParticle0(void) {
- obj_scale(3.0f);
+void mr_i_piranha_particle_act_0(void) {
+ cur_obj_scale(3.0f);
o->oForwardVel = 20.0f;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (0x8000 & o->oInteractStatus)
o->oAction = 1;
else if ((o->oTimer >= 101) || (0x200 & o->oMoveFlags) || (8 & (s16) o->activeFlags)) {
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
}
}
-void ActionMrIParticle1(void) {
+void mr_i_piranha_particle_act_1(void) {
s32 i;
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
for (i = 0; i < 10; i++)
spawn_object(o, MODEL_PURPLE_MARBLE, bhvPurpleParticle);
}
-void (*sMrIParticleActions[])(void) = { ActionMrIParticle0, ActionMrIParticle1 };
+void (*sMrIParticleActions[])(void) = { mr_i_piranha_particle_act_0, mr_i_piranha_particle_act_1 };
void bhv_mr_i_particle_loop(void) {
- obj_call_action_function(sMrIParticleActions);
+ cur_obj_call_action_function(sMrIParticleActions);
}
-void func_802A525C(void) {
+void spawn_mr_i_particle(void) {
struct Object *particle;
f32 sp18 = o->header.gfx.scale[1];
particle = spawn_object(o, MODEL_PURPLE_MARBLE, bhvMrIParticle);
particle->oPosY += 50.0f * sp18;
particle->oPosX += sins(o->oMoveAngleYaw) * 90.0f * sp18;
particle->oPosZ += coss(o->oMoveAngleYaw) * 90.0f * sp18;
- PlaySound2(SOUND_OBJ_MRI_SHOOT);
+ cur_obj_play_sound_2(SOUND_OBJ_MRI_SHOOT);
}
void bhv_mr_i_body_loop(void) {
- copy_object_pos_and_angle(o, o->parentObj);
+ obj_copy_pos_and_angle(o, o->parentObj);
if (!(8 & o->activeFlags)) {
- copy_object_scale(o, o->parentObj);
- set_object_parent_relative_pos(o, 0, 0, o->header.gfx.scale[1] * 100.0f);
- build_object_transform_from_pos_and_angle(o, 44, 15);
- translate_object_local(o, 6, 44);
+ obj_copy_scale(o, o->parentObj);
+ obj_set_parent_relative_pos(o, 0, 0, o->header.gfx.scale[1] * 100.0f);
+ obj_build_transform_from_pos_and_angle(o, 44, 15);
+ obj_translate_local(o, 6, 44);
o->oFaceAnglePitch = o->oMoveAnglePitch;
o->oGraphYOffset = o->header.gfx.scale[1] * 100.f;
}
@@ -64,10 +64,10 @@ void bhv_mr_i_body_loop(void) {
o->parentObj->oMrIUnk110 = 0;
}
if (!o->parentObj->activeFlags)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void ActionMrI3(void) {
+void mr_i_act_3(void) {
s16 sp36;
s16 sp34;
f32 sp30;
@@ -88,41 +88,41 @@ void ActionMrI3(void) {
sp36 = o->oMoveAngleYaw;
o->oMoveAngleYaw += sp34 * coss(0x4000 * sp2C);
if (sp36 < 0 && o->oMoveAngleYaw >= 0)
- PlaySound2(SOUND_OBJ2_MRI_SPINNING);
+ cur_obj_play_sound_2(SOUND_OBJ2_MRI_SPINNING);
o->oMoveAnglePitch = (1.0 - coss(0x4000 * sp2C)) * -0x4000;
- obj_shake_y(4.0f);
+ cur_obj_shake_y(4.0f);
} else if (o->oTimer < 96) {
if (o->oTimer == 64)
- PlaySound2(SOUND_OBJ_MRI_DEATH);
+ cur_obj_play_sound_2(SOUND_OBJ_MRI_DEATH);
sp30 = (f32)(o->oTimer - 63) / 32;
o->oMoveAngleYaw += sp34 * coss(0x4000 * sp2C);
o->oMoveAnglePitch = (1.0 - coss(0x4000 * sp2C)) * -0x4000;
- obj_shake_y((s32)((1.0f - sp30) * 4)); // trucating the f32?
+ cur_obj_shake_y((s32)((1.0f - sp30) * 4)); // trucating the f32?
sp20 = coss(0x4000 * sp30) * 0.4 + 0.6;
- obj_scale(sp20 * sp1C);
+ cur_obj_scale(sp20 * sp1C);
} else if (o->oTimer < 104) {
// do nothing
} else if (o->oTimer < 168) {
if (o->oTimer == 104) {
- obj_become_intangible();
- func_802A3004();
+ cur_obj_become_intangible();
+ spawn_mist_particles();
o->oMrISize = sp1C * 0.6;
if (o->oBehParams2ndByte) {
o->oPosY += 100.0f;
- create_star(1370, 2000.0f, -320.0f);
- mark_object_for_deletion(o);
+ spawn_default_star(1370, 2000.0f, -320.0f);
+ obj_mark_for_deletion(o);
} else
- obj_spawn_loot_blue_coin();
+ cur_obj_spawn_loot_blue_coin();
}
o->oMrISize -= 0.2 * sp1C;
if (o->oMrISize < 0)
o->oMrISize = 0;
- obj_scale(o->oMrISize);
+ cur_obj_scale(o->oMrISize);
} else
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void ActionMrI2() {
+void mr_i_act_2() {
s16 sp1E;
s16 sp1C;
sp1E = o->oMoveAngleYaw;
@@ -167,7 +167,7 @@ void ActionMrI2() {
if (o->oMrIUnk104 == o->oMrIUnk108)
o->oMrIUnk110 = 1;
if (o->oMrIUnk104 == o->oMrIUnk108 + 20) {
- func_802A525C();
+ spawn_mr_i_particle();
o->oMrIUnk104 = 0;
o->oMrIUnk108 = (s32)(RandomFloat() * 50.0f + 50.0f);
}
@@ -180,15 +180,15 @@ void ActionMrI2() {
o->oAction = 1;
}
-void ActionMrI1(void) {
+void mr_i_act_1(void) {
s16 sp1E;
s16 sp1C;
s16 sp1A;
- sp1E = angle_to_object(o, gMarioObject);
+ sp1E = obj_angle_to_object(o, gMarioObject);
sp1C = abs_angle_diff(o->oMoveAngleYaw, sp1E);
sp1A = abs_angle_diff(o->oMoveAngleYaw, gMarioObject->oFaceAngleYaw);
if (o->oTimer == 0) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oMoveAnglePitch = 0;
o->oMrIUnk104 = 30;
o->oMrIUnk108 = RandomFloat() * 20.0f;
@@ -211,26 +211,26 @@ void ActionMrI1(void) {
if (o->oMrIUnk108 + 80 < o->oMrIUnk104) {
o->oMrIUnk104 = 0;
o->oMrIUnk108 = RandomFloat() * 80.0f;
- func_802A525C();
+ spawn_mr_i_particle();
}
}
-void ActionMrI0(void) {
+void mr_i_act_0(void) {
#ifndef VERSION_JP
- set_object_angle(o, 0, 0, 0);
+ obj_set_angle(o, 0, 0, 0);
#else
o->oMoveAnglePitch = 0;
o->oMoveAngleYaw = 0;
o->oMoveAngleRoll = 0;
#endif
- obj_scale(o->oBehParams2ndByte + 1);
+ cur_obj_scale(o->oBehParams2ndByte + 1);
if (o->oTimer == 0)
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
if (o->oDistanceToMario < 1500.0f)
o->oAction = 1;
}
-void (*sMrIActions[])(void) = { ActionMrI0, ActionMrI1, ActionMrI2, ActionMrI3 };
+void (*sMrIActions[])(void) = { mr_i_act_0, mr_i_act_1, mr_i_act_2, mr_i_act_3 };
struct ObjectHitbox sMrIHitbox = {
/* interactType: */ INTERACT_DAMAGE,
@@ -245,8 +245,8 @@ struct ObjectHitbox sMrIHitbox = {
};
void bhv_mr_i_loop(void) {
- set_object_hitbox(o, &sMrIHitbox);
- obj_call_action_function(sMrIActions);
+ obj_set_hitbox(o, &sMrIHitbox);
+ cur_obj_call_action_function(sMrIActions);
if (o->oAction != 3)
if (o->oDistanceToMario > 3000.0f || o->activeFlags & 8)
o->oAction = 0;
diff --git a/src/game/behaviors/mushroom_1up.inc.c b/src/game/behaviors/mushroom_1up.inc.c
@@ -3,7 +3,7 @@
void bhv_1up_interact(void) {
UNUSED s32 sp1C;
- if (are_objects_collided(o, gMarioObject) == 1) {
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
play_sound(SOUND_GENERAL_COLLECT_1UP, gDefaultSoundArgs);
gMarioState->numLives++;
o->activeFlags = 0;
@@ -28,7 +28,7 @@ void bhv_1up_init(void) {
}
}
-void func_802F2D40(void) {
+void one_up_loop_in_air(void) {
if (o->oTimer < 5) {
o->oVelY = 40.0f;
} else {
@@ -39,7 +39,7 @@ void func_802F2D40(void) {
}
}
-void func_802F2E18(void) {
+void pole_1up_move_towards_mario(void) {
f32 sp34 = gMarioObject->header.gfx.pos[0] - o->oPosX;
f32 sp30 = gMarioObject->header.gfx.pos[1] + 120.0f - o->oPosY;
f32 sp2C = gMarioObject->header.gfx.pos[2] - o->oPosZ;
@@ -52,7 +52,7 @@ void func_802F2E18(void) {
bhv_1up_interact();
}
-void func_802F2F8C(s16 sp1A) {
+void one_up_move_away_from_mario(s16 sp1A) {
o->oForwardVel = 8.0f;
o->oMoveAngleYaw = o->oAngleToMario + 0x8000;
bhv_1up_interact();
@@ -74,10 +74,10 @@ void bhv_1up_walking_loop(void) {
if (o->oTimer == 0)
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
- func_802F2D40();
+ one_up_loop_in_air();
if (o->oTimer == 37) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = 1;
o->oForwardVel = 2.0f;
}
@@ -111,10 +111,10 @@ void bhv_1up_running_away_loop(void) {
if (o->oTimer == 0)
play_sound(SOUND_GENERAL2_1UP_APPEAR, gDefaultSoundArgs);
- func_802F2D40();
+ one_up_loop_in_air();
if (o->oTimer == 37) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = 1;
o->oForwardVel = 8.0f;
}
@@ -122,7 +122,7 @@ void bhv_1up_running_away_loop(void) {
case 1:
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
- func_802F2F8C(sp26);
+ one_up_move_away_from_mario(sp26);
break;
case 2:
@@ -134,7 +134,7 @@ void bhv_1up_running_away_loop(void) {
set_object_visibility(o, 3000);
}
-void func_802F3328(void) {
+void sliding_1up_move(void) {
s16 sp1E;
sp1E = object_step();
@@ -161,7 +161,7 @@ void bhv_1up_sliding_loop(void) {
break;
case 1:
- func_802F3328();
+ sliding_1up_move();
break;
case 2:
@@ -192,7 +192,7 @@ void bhv_1up_jump_on_approach_loop(void) {
case 1:
sp26 = object_step();
- func_802F2F8C(sp26);
+ one_up_move_away_from_mario(sp26);
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
break;
@@ -221,7 +221,7 @@ void bhv_1up_hidden_loop(void) {
case 1:
sp26 = object_step();
- func_802F2F8C(sp26);
+ one_up_move_away_from_mario(sp26);
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
break;
@@ -236,10 +236,10 @@ void bhv_1up_hidden_loop(void) {
if (o->oTimer >= 18)
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
- func_802F2D40();
+ one_up_loop_in_air();
if (o->oTimer == 37) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = 1;
o->oForwardVel = 8.0f;
}
@@ -249,8 +249,8 @@ void bhv_1up_hidden_loop(void) {
void bhv_1up_hidden_trigger_loop(void) {
struct Object *sp1C;
- if (are_objects_collided(o, gMarioObject) == 1) {
- sp1C = obj_nearest_object_with_behavior(bhvHidden1up);
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
+ sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1up);
if (sp1C != NULL)
sp1C->o1UpHiddenUnkF4++;
@@ -272,7 +272,7 @@ void bhv_1up_hidden_in_pole_loop(void) {
break;
case 1:
- func_802F2E18();
+ pole_1up_move_towards_mario();
sp26 = object_step();
break;
@@ -281,10 +281,10 @@ void bhv_1up_hidden_in_pole_loop(void) {
if (o->oTimer >= 18)
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
- func_802F2D40();
+ one_up_loop_in_air();
if (o->oTimer == 37) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oAction = 1;
o->oForwardVel = 10.0f;
}
@@ -295,8 +295,8 @@ void bhv_1up_hidden_in_pole_loop(void) {
void bhv_1up_hidden_in_pole_trigger_loop(void) {
struct Object *sp1C;
- if (are_objects_collided(o, gMarioObject) == 1) {
- sp1C = obj_nearest_object_with_behavior(bhvHidden1upInPole);
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
+ sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1upInPole);
if (sp1C != NULL) {
sp1C->o1UpHiddenUnkF4++;
;
diff --git a/src/game/behaviors/piranha_bubbles.inc.c b/src/game/behaviors/piranha_bubbles.inc.c
@@ -16,7 +16,7 @@ void bhv_piranha_plant_waking_bubbles_loop(void) {
o->oForwardVel = RandomFloat() * 10.0f + 5.0f;
o->oMoveAngleYaw = RandomU16();
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
/**
@@ -37,11 +37,11 @@ void bhv_piranha_plant_bubble_loop(void) {
f32 doneShrinkingFrame; // the first frame after shrinking is done
f32 beginGrowingFrame; // the frame just before growing begins
- obj_set_pos_relative(parent, 0, 72.0f, 180.0f);
+ cur_obj_set_pos_relative(parent, 0, 72.0f, 180.0f);
switch (o->oAction) {
case PIRANHA_PLANT_BUBBLE_ACT_IDLE:
- obj_disable_rendering();
+ cur_obj_disable_rendering();
scale = 0;
if (parent->oAction == PIRANHA_PLANT_ACT_SLEEPING) {
@@ -51,7 +51,7 @@ void bhv_piranha_plant_bubble_loop(void) {
case PIRANHA_PLANT_BUBBLE_ACT_GROW_SHRINK_LOOP:
if (parent->oDistanceToMario < parent->oDrawingDistance) {
- obj_enable_rendering();
+ cur_obj_enable_rendering();
if (parent->oAction == PIRANHA_PLANT_ACT_SLEEPING) {
/**
@@ -84,12 +84,12 @@ void bhv_piranha_plant_bubble_loop(void) {
o->oAction++; // move to PIRANHA_PLANT_BUBBLE_ACT_BURST
}
} else {
- obj_disable_rendering();
+ cur_obj_disable_rendering();
}
break;
case PIRANHA_PLANT_BUBBLE_ACT_BURST:
- obj_disable_rendering();
+ cur_obj_disable_rendering();
scale = 0;
// Spawn 15 small bubbles to make it look like this bubble burst.
@@ -101,5 +101,5 @@ void bhv_piranha_plant_bubble_loop(void) {
scale = 1.0f; // this has no effect; it is set to 0 in the idle state
break;
}
- obj_scale(scale);
+ cur_obj_scale(scale);
}
diff --git a/src/game/behaviors/piranha_plant.inc.c b/src/game/behaviors/piranha_plant.inc.c
@@ -10,8 +10,8 @@
* directly to the sleeping state.
*/
void piranha_plant_act_idle(void) {
- obj_become_intangible();
- set_obj_animation_and_sound_state(8);
+ cur_obj_become_intangible();
+ cur_obj_init_animation_with_sound(8);
#if BUGFIX_PIRANHA_PLANT_STATE_RESET
/**
@@ -19,7 +19,7 @@ void piranha_plant_act_idle(void) {
* with a scale below 1, which would cause it to appear shrunken. See
* documentation for, and calls to, piranha_plant_reset_when_far().
*/
- obj_scale(1);
+ cur_obj_scale(1);
#endif
if (o->oDistanceToMario < 1200.0f) {
@@ -41,7 +41,7 @@ s32 piranha_plant_check_interactions(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
func_80321080(50);
if (o->oInteractStatus & INT_STATUS_WAS_ATTACKED) {
- PlaySound2(SOUND_OBJ2_PIRANHA_PLANT_DYING);
+ cur_obj_play_sound_2(SOUND_OBJ2_PIRANHA_PLANT_DYING);
// Spawn 20 intangible purple particles that quickly dissipate.
for (i = 0; i < 20; i++) {
@@ -67,13 +67,13 @@ s32 piranha_plant_check_interactions(void) {
* to piranha_plant_check_interactions().
*/
void piranha_plant_act_sleeping(void) {
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oInteractType = INTERACT_BOUNCE_TOP;
- set_obj_animation_and_sound_state(8);
+ cur_obj_init_animation_with_sound(8);
- obj_set_hitbox_radius_and_height(250.0f, 200.0f);
- obj_set_hurtbox_radius_and_height(150.0f, 100.0f);
+ cur_obj_set_hitbox_radius_and_height(250.0f, 200.0f);
+ cur_obj_set_hurtbox_radius_and_height(150.0f, 100.0f);
#if BUGFIX_PIRANHA_PLANT_SLEEP_DAMAGE
/**
@@ -150,10 +150,10 @@ void piranha_plant_reset_when_far(void) {
* state.
*/
void piranha_plant_attacked(void) {
- obj_become_intangible();
- set_obj_animation_and_sound_state(2);
+ cur_obj_become_intangible();
+ cur_obj_init_animation_with_sound(2);
o->oInteractStatus = 0;
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oAction = PIRANHA_PLANT_ACT_SHRINK_AND_DIE;
#if BUGFIX_PIRANHA_PLANT_STATE_RESET
piranha_plant_reset_when_far(); // see this function's comment
@@ -166,7 +166,7 @@ void piranha_plant_attacked(void) {
*/
void piranha_plant_act_shrink_and_die(void) {
if (o->oTimer == 0) {
- PlaySound2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
+ cur_obj_play_sound_2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
o->oPiranhaPlantScale = 1.0f;
}
@@ -181,11 +181,11 @@ void piranha_plant_act_shrink_and_die(void) {
o->oPiranhaPlantScale = o->oPiranhaPlantScale - 0.04;
} else {
o->oPiranhaPlantScale = 0.0f;
- obj_spawn_loot_blue_coin();
+ cur_obj_spawn_loot_blue_coin();
o->oAction = PIRANHA_PLANT_ACT_WAIT_TO_RESPAWN;
}
- obj_scale(o->oPiranhaPlantScale);
+ cur_obj_scale(o->oPiranhaPlantScale);
#if BUGFIX_PIRANHA_PLANT_STATE_RESET
piranha_plant_reset_when_far(); // see this function's comment
@@ -206,7 +206,7 @@ void piranha_plant_act_wait_to_respawn(void) {
* grown, set it to the idle state.
*/
void piranha_plant_act_respawn(void) {
- set_obj_animation_and_sound_state(8);
+ cur_obj_init_animation_with_sound(8);
if (o->oTimer == 0) {
o->oPiranhaPlantScale = 0.3f;
}
@@ -224,7 +224,7 @@ void piranha_plant_act_respawn(void) {
o->oPiranhaPlantScale = 1.0f;
o->oAction = PIRANHA_PLANT_ACT_IDLE;
}
- obj_scale(o->oPiranhaPlantScale);
+ cur_obj_scale(o->oPiranhaPlantScale);
}
/**
@@ -242,25 +242,25 @@ static s8 sPiranhaPlantBiteSoundFrames[] = { 12, 28, 50, 64, -1 };
void piranha_plant_act_biting(void) {
s32 frame = o->header.gfx.unk38.animFrame;
- obj_become_tangible();
+ cur_obj_become_tangible();
o->oInteractType = INTERACT_DAMAGE;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
- obj_set_hitbox_radius_and_height(150.0f, 100.0f);
- obj_set_hurtbox_radius_and_height(150.0f, 100.0f);
+ cur_obj_set_hitbox_radius_and_height(150.0f, 100.0f);
+ cur_obj_set_hurtbox_radius_and_height(150.0f, 100.0f);
// Play a bite sound effect on certain frames.
- if (item_in_array(frame, sPiranhaPlantBiteSoundFrames)) {
- PlaySound2(SOUND_OBJ2_PIRANHA_PLANT_BITE);
+ if (is_item_in_array(frame, sPiranhaPlantBiteSoundFrames)) {
+ cur_obj_play_sound_2(SOUND_OBJ2_PIRANHA_PLANT_BITE);
}
// Move to face the player.
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x400);
if (o->oDistanceToMario > 500.0f)
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oAction = PIRANHA_PLANT_ACT_STOPPED_BITING;
// If the player is wearing the Metal Cap and interacts with the Piranha
@@ -290,10 +290,10 @@ s32 mario_moving_fast_enough_to_make_piranha_plant_bite(void) {
* Plant start biting again. Otherwise, make it go back to sleep.
*/
void piranha_plant_act_stopped_biting(void) {
- obj_become_intangible();
- set_obj_animation_and_sound_state(6);
+ cur_obj_become_intangible();
+ cur_obj_init_animation_with_sound(6);
- if (func_8029F788())
+ if (cur_obj_check_if_near_animation_end())
o->oAction = PIRANHA_PLANT_ACT_SLEEPING;
/**
@@ -327,14 +327,14 @@ void (*TablePiranhaPlantActions[])(void) = {
* Main loop for bhvPiranhaPlant.
*/
void bhv_piranha_plant_loop(void) {
- obj_call_action_function(TablePiranhaPlantActions);
+ cur_obj_call_action_function(TablePiranhaPlantActions);
// In WF, hide all Piranha Plants once high enough up.
if (gCurrLevelNum == LEVEL_WF) {
if (gMarioObject->oPosY > 3400.0f)
- obj_hide();
+ cur_obj_hide();
else
- obj_unhide();
+ cur_obj_unhide();
}
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/platform_on_track.inc.c b/src/game/behaviors/platform_on_track.inc.c
@@ -40,7 +40,7 @@ static void platform_on_track_reset(void) {
static void platform_on_track_mario_not_on_platform(void) {
if (!((u16)(o->oBehParams >> 16) & PLATFORM_ON_TRACK_BP_DONT_DISAPPEAR)) {
// Once oTimer reaches 150, blink 40 times
- if (obj_wait_then_blink(150, 40)) {
+ if (cur_obj_wait_then_blink(150, 40)) {
platform_on_track_reset();
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
}
@@ -129,9 +129,9 @@ static void platform_on_track_act_move_along_track(void) {
s16 initialAngle;
if (!o->oPlatformOnTrackIsNotSkiLift) {
- PlaySound(SOUND_ENV_ELEVATOR3);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR3);
} else if (!o->oPlatformOnTrackIsNotHMC) {
- PlaySound(SOUND_ENV_ELEVATOR1);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR1);
}
// Fall after reaching the last waypoint if desired
@@ -143,7 +143,7 @@ static void platform_on_track_act_move_along_track(void) {
if (o->oPlatformOnTrackPrevWaypointFlags != 0 && !o->oPlatformOnTrackIsNotSkiLift) {
if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END
|| o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_PLATFORM_ON_TRACK_PAUSE) {
- PlaySound2(SOUND_GENERAL_UNKNOWN4_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN4_LOWPRIO);
o->oForwardVel = 0.0f;
if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END) {
@@ -228,7 +228,7 @@ static void platform_on_track_act_pause_briefly(void) {
* and eventually blinking and disappearing.
*/
static void platform_on_track_act_fall(void) {
- obj_move_using_vel_and_gravity();
+ cur_obj_move_using_vel_and_gravity();
if (gMarioObject->platform != o) {
platform_on_track_mario_not_on_platform();
@@ -306,6 +306,6 @@ void bhv_track_ball_update(void) {
s16 relativeIndex =
(s16) o->oBehParams2ndByte - (s16) o->parentObj->oPlatformOnTrackBaseBallIndex - 1;
if (relativeIndex < 1 || relativeIndex > 5) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
diff --git a/src/game/behaviors/pokey.inc.c b/src/game/behaviors/pokey.inc.c
@@ -47,9 +47,9 @@ void bhv_pokey_body_part_update(void) {
if (obj_update_standard_actions(3.0f)) {
if (o->parentObj->oAction == POKEY_ACT_UNLOAD_PARTS) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_update_blinking(&o->oPokeyBodyPartBlinkTimer, 30, 60, 4);
// If the body part above us is dead, then decrease body part index
@@ -78,7 +78,7 @@ void bhv_pokey_body_part_update(void) {
else if (o->parentObj->oPokeyBottomBodyPartSize < 1.0f
&& o->oBehParams2ndByte + 1 == o->parentObj->oPokeyNumAliveBodyParts) {
approach_f32_ptr(&o->parentObj->oPokeyBottomBodyPartSize, 1.0f, 0.1f);
- obj_scale(o->parentObj->oPokeyBottomBodyPartSize * 3.0f);
+ cur_obj_scale(o->parentObj->oPokeyBottomBodyPartSize * 3.0f);
}
//! Pausing causes jumps in offset angle
@@ -120,7 +120,7 @@ void bhv_pokey_body_part_update(void) {
o->parentObj->oPokeyAliveBodyPartFlags =
o->parentObj->oPokeyAliveBodyPartFlags & ((1 << o->oBehParams2ndByte) ^ ~0);
} else if (o->parentObj->oPokeyHeadWasKilled) {
- obj_become_intangible();
+ cur_obj_become_intangible();
if (--o->oPokeyBodyPartDeathDelayAfterHeadKilled < 0) {
o->parentObj->oPokeyNumAliveBodyParts -= 1;
@@ -133,7 +133,7 @@ void bhv_pokey_body_part_update(void) {
o->oPokeyBodyPartDeathDelayAfterHeadKilled = (o->oBehParams2ndByte << 2) + 20;
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
} else {
o->oAnimState = 1;
@@ -160,7 +160,7 @@ static void pokey_act_uninitialized(void) {
bodyPart = spawn_object_relative(i, 0, -i * 120 + 480, 0, o, partModel, bhvPokeyBodyPart);
if (bodyPart != NULL) {
- scale_object(bodyPart, 3.0f);
+ obj_scale(bodyPart, 3.0f);
}
partModel = MODEL_POKEY_BODY_PART;
@@ -184,13 +184,13 @@ static void pokey_act_wander(void) {
struct Object *bodyPart;
if (o->oPokeyNumAliveBodyParts == 0) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else if (o->oDistanceToMario > 2500.0f) {
o->oAction = POKEY_ACT_UNLOAD_PARTS;
o->oForwardVel = 0.0f;
} else {
treat_far_home_as_mario(1000.0f);
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oPokeyHeadWasKilled) {
o->oForwardVel = 0.0f;
@@ -213,7 +213,7 @@ static void pokey_act_wander(void) {
o->oPokeyNumAliveBodyParts += 1;
o->oPokeyBottomBodyPartSize = 0.0f;
- scale_object(bodyPart, 0.0f);
+ obj_scale(bodyPart, 0.0f);
}
o->oTimer = 0;
@@ -266,11 +266,11 @@ static void pokey_act_wander(void) {
}
}
- obj_rotate_yaw_toward(o->oPokeyTargetYaw, 0x200);
+ cur_obj_rotate_yaw_toward(o->oPokeyTargetYaw, 0x200);
}
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
}
@@ -281,7 +281,7 @@ static void pokey_act_wander(void) {
*/
static void pokey_act_unload_parts(void) {
o->oAction = POKEY_ACT_UNINITIALIZED;
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
}
/**
diff --git a/src/game/behaviors/pole.inc.c b/src/game/behaviors/pole.inc.c
@@ -21,7 +21,7 @@ void bhv_pole_init(void) {
}
/**
- * Main loop for bhvGiantPole. It is equivalent to BehClimbDetectLoop() except
+ * Main loop for bhvGiantPole. It is equivalent to bhv_pole_base_loop() except
* for the fact that it spawns a yellow sphere at the top of the pole on the
* first frame.
*/
@@ -31,5 +31,5 @@ void bhv_giant_pole_loop(void) {
topBall = spawn_object(o, MODEL_YELLOW_SPHERE, bhvYellowBall);
topBall->oPosY += o->hitboxHeight + 50.0f;
}
- BehClimbDetectLoop();
+ bhv_pole_base_loop();
}
diff --git a/src/game/behaviors/pole_base.inc.c b/src/game/behaviors/pole_base.inc.c
@@ -1,9 +1,9 @@
// pole_base.inc.c
-void BehClimbDetectLoop(void) {
+void bhv_pole_base_loop(void) {
if (o->oPosY - 10.0f < gMarioObject->oPosY
&& gMarioObject->oPosY < o->oPosY + o->hitboxHeight + 30.0f)
if (o->oTimer > 10)
if (!(gMarioStates->action & MARIO_PUNCHING))
- obj_push_mario_away(70.0f);
+ cur_obj_push_mario_away(70.0f);
}
diff --git a/src/game/behaviors/purple_switch.inc.c b/src/game/behaviors/purple_switch.inc.c
@@ -14,8 +14,8 @@ void bhv_purple_switch_loop(void) {
* switch's middle section, transition to the pressed state.
*/
case PURPLE_SWITCH_IDLE:
- obj_set_model(MODEL_PURPLE_SWITCH);
- obj_scale(1.5f);
+ cur_obj_set_model(MODEL_PURPLE_SWITCH);
+ cur_obj_scale(1.5f);
if (gMarioObject->platform == o && !(gMarioStates->action & MARIO_UNKNOWN_13)) {
if (lateral_dist_between_objects(o, gMarioObject) < 127.5) {
o->oAction = PURPLE_SWITCH_PRESSED;
@@ -27,11 +27,11 @@ void bhv_purple_switch_loop(void) {
* Immediately transition to the ticking state.
*/
case PURPLE_SWITCH_PRESSED:
- func_802A3398(2, 3, 1.5f, 0.2f);
+ cur_obj_scale_over_time(2, 3, 1.5f, 0.2f);
if (o->oTimer == 3) {
- PlaySound2(SOUND_GENERAL2_PURPLE_SWITCH);
+ cur_obj_play_sound_2(SOUND_GENERAL2_PURPLE_SWITCH);
o->oAction = PURPLE_SWITCH_TICKING;
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
}
break;
/**
@@ -59,7 +59,7 @@ void bhv_purple_switch_loop(void) {
* idle state.
*/
case PURPLE_SWITCH_UNPRESSED:
- func_802A3398(2, 3, 0.2f, 1.5f);
+ cur_obj_scale_over_time(2, 3, 0.2f, 1.5f);
if (o->oTimer == 3) {
o->oAction = PURPLE_SWITCH_IDLE;
}
@@ -70,7 +70,7 @@ void bhv_purple_switch_loop(void) {
* unpressed state.
*/
case PURPLE_SWITCH_WAIT_FOR_MARIO_TO_GET_OFF:
- if (!obj_is_mario_on_platform()) {
+ if (!cur_obj_is_mario_on_platform()) {
o->oAction = PURPLE_SWITCH_UNPRESSED;
}
break;
diff --git a/src/game/behaviors/pyramid_elevator.inc.c b/src/game/behaviors/pyramid_elevator.inc.c
@@ -74,8 +74,8 @@ void bhv_pyramid_elevator_loop(void) {
void bhv_pyramid_elevator_trajectory_marker_ball_loop(void) {
struct Object *elevator;
- obj_scale(0.15f);
- elevator = obj_nearest_object_with_behavior(bhvPyramidElevator);
+ cur_obj_scale(0.15f);
+ elevator = cur_obj_nearest_object_with_behavior(bhvPyramidElevator);
if (elevator != NULL) {
if (elevator->oAction != PYRAMID_ELEVATOR_IDLE) {
diff --git a/src/game/behaviors/pyramid_top.inc.c b/src/game/behaviors/pyramid_top.inc.c
@@ -72,7 +72,7 @@ void bhv_pyramid_top_explode(void) {
struct Object *pyramidFragment;
s16 i;
- func_802AA618(0, 0, 690);
+ spawn_mist_particles_variable(0, 0, 690);
// Generate 30 pyramid fragments with random properties.
for (i = 0; i < 30; i++) {
@@ -101,7 +101,7 @@ void bhv_pyramid_top_loop(void) {
case PYRAMID_TOP_ACT_SPINNING:
if (o->oTimer == 0) {
- PlaySound2(SOUND_GENERAL2_PYRAMID_TOP_SPIN);
+ cur_obj_play_sound_2(SOUND_GENERAL2_PYRAMID_TOP_SPIN);
}
bhv_pyramid_top_spinning();
@@ -124,7 +124,7 @@ void bhv_pyramid_top_fragment_init(void) {
o->oFriction = 0.999f;
o->oBuoyancy = 2.0f;
o->oAnimState = 3;
- obj_scale(o->oPyramidTopFragmentsScale);
+ cur_obj_scale(o->oPyramidTopFragmentsScale);
}
/**
@@ -146,8 +146,8 @@ void bhv_pyramid_top_fragment_loop(void) {
* top's total count of touched detectors, and deactivate the detector.
*/
void bhv_pyramid_pillar_touch_detector_loop(void) {
- obj_become_tangible();
- if (are_objects_collided(o, gMarioObject) == 1) {
+ cur_obj_become_tangible();
+ if (obj_check_if_collided_with_object(o, gMarioObject) == 1) {
// Increase the pyramid top's count of pillars touched.
o->parentObj->oPyramidTopPillarsTouched++;
o->activeFlags = 0;
diff --git a/src/game/behaviors/racing_penguin.inc.c b/src/game/behaviors/racing_penguin.inc.c
@@ -11,7 +11,7 @@ static struct RacingPenguinData sRacingPenguinData[] = {
void bhv_racing_penguin_init(void) {
if (gMarioState->numStars == 120) {
- obj_scale(8.0f);
+ cur_obj_scale(8.0f);
o->header.gfx.scale[1] = 5.0f;
o->oBehParams2ndByte = 1;
}
@@ -19,7 +19,7 @@ void bhv_racing_penguin_init(void) {
static void racing_penguin_act_wait_for_mario(void) {
if (o->oTimer > o->oRacingPenguinInitTextCooldown && o->oPosY - gMarioObject->oPosY <= 0.0f
- && obj_is_mario_in_range_and_ready_to_speak(400.0f, 400.0f)) {
+ && cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) {
o->oAction = RACING_PENGUIN_ACT_SHOW_INIT_TEXT;
}
}
@@ -30,10 +30,10 @@ static void racing_penguin_act_show_init_text(void) {
response = obj_update_race_proposition_dialog(sRacingPenguinData[o->oBehParams2ndByte].text);
if (response == 1) {
- child = obj_nearest_object_with_behavior(bhvPenguinRaceFinishLine);
+ child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceFinishLine);
child->parentObj = o;
- child = obj_nearest_object_with_behavior(bhvPenguinRaceShortcutCheck);
+ child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceShortcutCheck);
child->parentObj = o;
o->oPathedStartWaypoint = o->oPathedPrevWaypoint =
@@ -55,21 +55,21 @@ static void racing_penguin_act_prepare_for_race(void) {
o->oForwardVel = 20.0f;
}
- obj_rotate_yaw_toward(0x4000, 2500);
+ cur_obj_rotate_yaw_toward(0x4000, 2500);
}
static void racing_penguin_act_race(void) {
f32 targetSpeed;
f32 minSpeed;
- if (obj_follow_path(0) == PATH_REACHED_END) {
+ if (cur_obj_follow_path(0) == PATH_REACHED_END) {
o->oRacingPenguinReachedBottom = TRUE;
o->oAction = RACING_PENGUIN_ACT_FINISH_RACE;
} else {
targetSpeed = o->oPosY - gMarioObject->oPosY;
minSpeed = 70.0f;
- PlaySound(SOUND_AIR_ROUGH_SLIDE);
+ cur_obj_play_sound_1(SOUND_AIR_ROUGH_SLIDE);
if (targetSpeed < 100.0f || (o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) >= 35) {
if ((o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) >= 35) {
@@ -85,10 +85,10 @@ static void racing_penguin_act_race(void) {
clamp_f32(&targetSpeed, minSpeed, 150.0f);
obj_forward_vel_approach(targetSpeed, 0.4f);
- set_obj_animation_and_sound_state(1);
- obj_rotate_yaw_toward(o->oPathedTargetYaw, (s32)(15.0f * o->oForwardVel));
+ cur_obj_init_animation_with_sound(1);
+ cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, (s32)(15.0f * o->oForwardVel));
- if (func_8029F828() && (o->oMoveFlags & 0x00000003)) {
+ if (cur_obj_check_if_at_animation_end() && (o->oMoveFlags & 0x00000003)) {
spawn_object_relative_with_scale(0, 0, -100, 0, 4.0f, o, MODEL_SMOKE, bhvWhitePuffSmoke2);
}
}
@@ -105,7 +105,7 @@ static void racing_penguin_act_race(void) {
static void racing_penguin_act_finish_race(void) {
if (o->oForwardVel != 0.0f) {
if (o->oTimer > 5 && (o->oMoveFlags & 0x00000200)) {
- PlaySound2(SOUND_OBJ_POUNDING_LOUD);
+ cur_obj_play_sound_2(SOUND_OBJ_POUNDING_LOUD);
set_camera_shake_from_point(SHAKE_POS_SMALL, o->oPosX, o->oPosY, o->oPosZ);
o->oForwardVel = 0.0f;
}
@@ -118,11 +118,11 @@ static void racing_penguin_act_show_final_text(void) {
s32 textResult;
if (o->oRacingPenguinFinalTextbox == 0) {
- if (obj_rotate_yaw_toward(0, 200)) {
- set_obj_animation_and_sound_state(3);
+ if (cur_obj_rotate_yaw_toward(0, 200)) {
+ cur_obj_init_animation_with_sound(3);
o->oForwardVel = 0.0f;
- if (obj_is_mario_in_range_and_ready_to_speak(400.0f, 400.0f)) {
+ if (cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) {
if (o->oRacingPenguinMarioWon) {
if (o->oRacingPenguinMarioCheated) {
o->oRacingPenguinFinalTextbox = DIALOG_132;
@@ -135,7 +135,7 @@ static void racing_penguin_act_show_final_text(void) {
}
}
} else {
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
#ifndef VERSION_JP
play_penguin_walking_sound(1);
@@ -144,22 +144,22 @@ static void racing_penguin_act_show_final_text(void) {
o->oForwardVel = 4.0f;
}
} else if (o->oRacingPenguinFinalTextbox > 0) {
- if ((textResult = obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox)) != 0) {
+ if ((textResult = cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox)) != 0) {
o->oRacingPenguinFinalTextbox = -1;
o->oTimer = 0;
}
} else if (o->oRacingPenguinMarioWon) {
#ifdef VERSION_JP
- create_star(-7339.0f, -5700.0f, -6774.0f);
+ spawn_default_star(-7339.0f, -5700.0f, -6774.0f);
#else
- obj_spawn_star_at_y_offset(-7339.0f, -5700.0f, -6774.0f, 200.0f);
+ cur_obj_spawn_star_at_y_offset(-7339.0f, -5700.0f, -6774.0f, 200.0f);
#endif
o->oRacingPenguinMarioWon = FALSE;
}
}
void bhv_racing_penguin_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case RACING_PENGUIN_ACT_WAIT_FOR_MARIO:
@@ -182,9 +182,9 @@ void bhv_racing_penguin_update(void) {
break;
}
- obj_move_standard(78);
- obj_align_gfx_with_floor();
- obj_push_mario_away_from_cylinder(sRacingPenguinData[o->oBehParams2ndByte].radius,
+ cur_obj_move_standard(78);
+ cur_obj_align_gfx_with_floor();
+ cur_obj_push_mario_away_from_cylinder(sRacingPenguinData[o->oBehParams2ndByte].radius,
sRacingPenguinData[o->oBehParams2ndByte].height);
}
diff --git a/src/game/behaviors/recovery_heart.inc.c b/src/game/behaviors/recovery_heart.inc.c
@@ -12,10 +12,10 @@ struct ObjectHitbox sRecoveryHeartHitbox = {
};
void bhv_recovery_heart_loop(void) {
- set_object_hitbox(o, &sRecoveryHeartHitbox);
- if (are_objects_collided(o, gMarioObject)) {
+ obj_set_hitbox(o, &sRecoveryHeartHitbox);
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
if (o->oSpinningHeartPlayedSound == 0) {
- PlaySound2(SOUND_GENERAL_HEART_SPIN);
+ cur_obj_play_sound_2(SOUND_GENERAL_HEART_SPIN);
o->oSpinningHeartPlayedSound += 1;
}
diff --git a/src/game/behaviors/red_coin.inc.c b/src/game/behaviors/red_coin.inc.c
@@ -30,11 +30,11 @@ void bhv_red_coin_init(void) {
struct Object *hiddenRedCoinStar;
// Set the red coins to have a parent of the closest red coin star.
- hiddenRedCoinStar = obj_nearest_object_with_behavior(bhvHiddenRedCoinStar);
+ hiddenRedCoinStar = cur_obj_nearest_object_with_behavior(bhvHiddenRedCoinStar);
if (hiddenRedCoinStar != NULL)
o->parentObj = hiddenRedCoinStar;
else {
- hiddenRedCoinStar = obj_nearest_object_with_behavior(bhvBowserCourseRedCoinStar);
+ hiddenRedCoinStar = cur_obj_nearest_object_with_behavior(bhvBowserCourseRedCoinStar);
if (hiddenRedCoinStar != NULL) {
o->parentObj = hiddenRedCoinStar;
} else {
@@ -42,7 +42,7 @@ void bhv_red_coin_init(void) {
}
}
- set_object_hitbox(o, &sRedCoinHitbox);
+ obj_set_hitbox(o, &sRedCoinHitbox);
}
/**
@@ -74,7 +74,7 @@ void bhv_red_coin_loop(void) {
#endif
}
- CoinCollected();
+ coin_collected();
// Despawn the coin.
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/rolling_log.inc.c b/src/game/behaviors/rolling_log.inc.c
@@ -18,7 +18,7 @@ void bhv_ttm_rolling_log_init(void) {
o->oAngleVelPitch = 0;
}
-void func_802F238C(void) {
+void rolling_log_roll_log(void) {
f32 sp24;
if (gMarioObject->platform == o) {
@@ -63,7 +63,7 @@ void bhv_rolling_log_loop(void) {
f32 prevX = o->oPosX;
f32 prevZ = o->oPosZ;
- func_802F238C();
+ rolling_log_roll_log();
o->oForwardVel = o->oAngleVelPitch / 0x40;
o->oVelX = o->oForwardVel * sins(o->oMoveAngleYaw);
@@ -82,11 +82,11 @@ void bhv_rolling_log_loop(void) {
o->oFaceAnglePitch += o->oAngleVelPitch;
if (absf_2(o->oFaceAnglePitch & 0x1FFF) < 528.0f && o->oAngleVelPitch != 0) {
- PlaySound2(SOUND_GENERAL_UNKNOWN1_2);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN1_2);
}
}
-void func_802F2820(void) {
+void volcano_act_1(void) {
o->oRollingLogUnkF4 += 4.0f;
o->oAngleVelPitch += o->oRollingLogUnkF4;
o->oFaceAnglePitch -= o->oAngleVelPitch;
@@ -96,12 +96,12 @@ void func_802F2820(void) {
o->oAngleVelPitch = 0;
o->oRollingLogUnkF4 = 0;
o->oAction = 2;
- PlaySound2(SOUND_GENERAL_BIG_POUND);
+ cur_obj_play_sound_2(SOUND_GENERAL_BIG_POUND);
set_camera_shake_from_point(SHAKE_POS_LARGE, o->oPosX, o->oPosY, o->oPosZ);
}
}
-void func_802F2924(void) {
+void volcano_act_3(void) {
o->oAngleVelPitch = 0x90;
o->oFaceAnglePitch += o->oAngleVelPitch;
if (o->oFaceAnglePitch > 0)
@@ -111,17 +111,17 @@ void func_802F2924(void) {
o->oAction = 0;
}
-void bhvLllVolcanoFallingTrap_loop(void) {
+void bhv_volcano_trap_loop(void) {
switch (o->oAction) {
case 0:
if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1000)) {
o->oAction = 1;
- PlaySound2(SOUND_GENERAL_QUIET_POUND2);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_POUND2);
}
break;
case 1:
- func_802F2820();
+ volcano_act_1();
break;
case 2:
@@ -129,13 +129,13 @@ void bhvLllVolcanoFallingTrap_loop(void) {
o->oPosY = o->oHomeY + sins(o->oTimer * 0x1000) * 10.0f;
}
if (o->oTimer == 50) {
- PlaySound2(SOUND_GENERAL_UNK45);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNK45);
o->oAction = 3;
}
break;
case 3:
- func_802F2924();
+ volcano_act_3();
break;
}
}
diff --git a/src/game/behaviors/rotating_platform.inc.c b/src/game/behaviors/rotating_platform.inc.c
@@ -19,17 +19,17 @@ void bhv_wf_rotating_wooden_platform_loop(void) {
o->oAngleVelYaw = 0x100;
if (o->oTimer > 126)
o->oAction = 0;
- PlaySound(SOUND_ENV_ELEVATOR2);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR2);
}
- obj_rotate_face_angle_using_vel();
+ cur_obj_rotate_face_angle_using_vel();
}
void bhv_rotating_platform_loop(void) {
s8 sp1F = o->oBehParams >> 24;
if (o->oTimer == 0) {
- set_object_collision_data(o, sWFRotatingPlatformData[o->oBehParams2ndByte].collisionData);
+ obj_set_collision_data(o, sWFRotatingPlatformData[o->oBehParams2ndByte].collisionData);
o->oCollisionDistance = sWFRotatingPlatformData[o->oBehParams2ndByte].collisionDistance;
- obj_scale(sWFRotatingPlatformData[o->oBehParams2ndByte].scale * 0.01f);
+ cur_obj_scale(sWFRotatingPlatformData[o->oBehParams2ndByte].scale * 0.01f);
}
o->oAngleVelYaw = sp1F << 4;
o->oFaceAngleYaw += o->oAngleVelYaw;
diff --git a/src/game/behaviors/scuttlebug.inc.c b/src/game/behaviors/scuttlebug.inc.c
@@ -12,7 +12,7 @@ struct ObjectHitbox sScuttlebugHitbox = {
/* hurtboxHeight: */ 60,
};
-s32 func_802C5A64(s32 *a0) {
+s32 update_angle_from_move_flags(s32 *a0) {
if (o->oMoveFlags & 0x200) {
*a0 = o->oWallAngle;
return 1;
@@ -26,9 +26,9 @@ s32 func_802C5A64(s32 *a0) {
void bhv_scuttlebug_loop(void) {
UNUSED s32 unused;
f32 sp18;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oSubAction != 0
- && obj_set_hitbox_and_die_if_attacked(&sScuttlebugHitbox, SOUND_OBJ_DYING_ENEMY1,
+ && cur_obj_set_hitbox_and_die_if_attacked(&sScuttlebugHitbox, SOUND_OBJ_DYING_ENEMY1,
o->oScuttlebugUnkF4))
o->oSubAction = 3;
if (o->oSubAction != 1)
@@ -36,7 +36,7 @@ void bhv_scuttlebug_loop(void) {
switch (o->oSubAction) {
case 0:
if (o->oMoveFlags & 1)
- PlaySound2(SOUND_OBJ_GOOMBA_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ_GOOMBA_ALERT);
if (o->oMoveFlags & 3) {
o->oHomeX = o->oPosX;
o->oHomeY = o->oPosY;
@@ -46,16 +46,16 @@ void bhv_scuttlebug_loop(void) {
break;
case 1:
o->oForwardVel = 5.0f;
- if (obj_lateral_dist_from_mario_to_home() > 1000.0f)
- o->oAngleToMario = obj_angle_to_home();
+ if (cur_obj_lateral_dist_from_mario_to_home() > 1000.0f)
+ o->oAngleToMario = cur_obj_angle_to_home();
else {
if (o->oScuttlebugUnkF8 == 0) {
o->oScuttlebugUnkFC = 0;
- o->oAngleToMario = angle_to_object(o, gMarioObject);
+ o->oAngleToMario = obj_angle_to_object(o, gMarioObject);
if (abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x800) {
o->oScuttlebugUnkF8 = 1;
o->oVelY = 20.0f;
- PlaySound2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
}
} else if (o->oScuttlebugUnkF8 == 1) {
o->oForwardVel = 15.0f;
@@ -64,23 +64,23 @@ void bhv_scuttlebug_loop(void) {
o->oScuttlebugUnkF8 = 0;
}
}
- if (func_802C5A64(&o->oAngleToMario))
+ if (update_angle_from_move_flags(&o->oAngleToMario))
o->oSubAction = 2;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
break;
case 2:
o->oForwardVel = 5.0f;
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario)
o->oSubAction = 1;
if (o->oPosY - o->oHomeY < -200.0f)
- mark_object_for_deletion(o);
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ obj_mark_for_deletion(o);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
break;
case 3:
o->oFlags &= ~8;
o->oForwardVel = -10.0f;
o->oVelY = 30.0f;
- PlaySound2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
o->oSubAction++;
break;
case 4:
@@ -104,23 +104,23 @@ void bhv_scuttlebug_loop(void) {
sp18 = 1.0f;
else
sp18 = 3.0f;
- func_8029ED98(0, sp18);
+ cur_obj_init_animation_with_accel_and_sound(0, sp18);
if (o->oMoveFlags & 3)
- func_802BE2E8(1, 23, SOUND_OBJ2_SCUTTLEBUG_WALK);
+ set_obj_anim_with_accel_and_sound(1, 23, SOUND_OBJ2_SCUTTLEBUG_WALK);
if (o->parentObj != o) {
if (obj_is_hidden(o))
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->activeFlags == 0)
o->parentObj->oScuttlebugSpawnerUnk88 = 1;
}
- obj_move_standard(-50);
+ cur_obj_move_standard(-50);
}
void bhv_scuttlebug_spawn_loop(void) {
struct Object *scuttlebug;
if (o->oAction == 0) {
if (o->oTimer > 30 && 500.0f < o->oDistanceToMario && o->oDistanceToMario < 1500.0f) {
- PlaySound2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
+ cur_obj_play_sound_2(SOUND_OBJ2_SCUTTLEBUG_ALERT);
scuttlebug = spawn_object(o, MODEL_SCUTTLEBUG, bhvScuttlebug);
scuttlebug->oScuttlebugUnkF4 = o->oScuttlebugSpawnerUnkF4;
scuttlebug->oForwardVel = 30.0f;
diff --git a/src/game/behaviors/seesaw_platform.inc.c b/src/game/behaviors/seesaw_platform.inc.c
@@ -33,7 +33,7 @@ void bhv_seesaw_platform_update(void) {
o->oFaceAnglePitch += (s32) o->oSeesawPlatformPitchVel;
if (absf(o->oSeesawPlatformPitchVel) > 10.0f) {
- PlaySound(SOUND_ENV_BOAT_ROCKING1);
+ cur_obj_play_sound_1(SOUND_ENV_BOAT_ROCKING1);
}
if (gMarioObject->platform == o) {
diff --git a/src/game/behaviors/shock_wave.inc.c b/src/game/behaviors/shock_wave.inc.c
@@ -6,13 +6,13 @@ void bhv_bowser_shock_wave_loop(void) {
f32 sp2C, sp28, sp24, sp20;
s16 sp1E = 70;
o->oBowserShockWaveUnkF4 = o->oTimer * 10;
- obj_scale(o->oBowserShockWaveUnkF4);
+ cur_obj_scale(o->oBowserShockWaveUnkF4);
if (gGlobalTimer % 3)
o->oOpacity -= 1;
if (o->oTimer > sp1E)
o->oOpacity -= 5;
if (o->oOpacity <= 0)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oTimer < sp1E && mario_is_in_air_action() == 0) {
sp2C = o->oBowserShockWaveUnkF4 * D_8032F420[0];
sp28 = o->oBowserShockWaveUnkF4 * D_8032F420[1];
diff --git a/src/game/behaviors/skeeter.inc.c b/src/game/behaviors/skeeter.inc.c
@@ -27,20 +27,20 @@ static void skeeter_spawn_waves(void) {
for (i = 0; i < 4; i++) {
spawn_object_relative_with_scale(0, D_80331C38[i].unk00, 0, D_80331C38[i].unk02, 0.8f, o,
- MODEL_WATER_WAVES_SURF, bhvSkeeterWave);
+ MODEL_IDLE_WATER_WAVE, bhvSkeeterWave);
}
}
static void skeeter_act_idle(void) {
if (o->oMoveFlags & 0x00000003) {
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
o->oForwardVel = 0.0f;
- if (o->oTimer > o->oSkeeterWaitTime && func_8029F788()) {
+ if (o->oTimer > o->oSkeeterWaitTime && cur_obj_check_if_near_animation_end()) {
o->oAction = SKEETER_ACT_WALK;
}
} else {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (o->oMoveFlags & 0x00000010) {
skeeter_spawn_waves();
@@ -49,8 +49,8 @@ static void skeeter_act_idle(void) {
5, 50, 200)) {
if (o->oSkeeterWaitTime != 0) {
o->oSkeeterWaitTime -= 1;
- } else if (func_8029F788()) {
- PlaySound2(SOUND_OBJ_WALKING_WATER);
+ } else if (cur_obj_check_if_near_animation_end()) {
+ cur_obj_play_sound_2(SOUND_OBJ_WALKING_WATER);
o->oAction = SKEETER_ACT_LUNGE;
o->oForwardVel = 80.0f;
o->oSkeeterUnk1AC = 0;
@@ -65,15 +65,15 @@ static void skeeter_act_lunge(void) {
o->oAction = SKEETER_ACT_IDLE;
} else {
skeeter_spawn_waves();
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
if (o->oMoveFlags & 0x00000200) {
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
o->oForwardVel *= 0.3f;
o->oFlags &= ~0x00000008;
}
- if (obj_forward_vel_approach(0.0f, 0.8f) && func_8029F828()) {
+ if (obj_forward_vel_approach(0.0f, 0.8f) && cur_obj_check_if_at_animation_end()) {
o->oMoveAngleYaw = o->oFaceAngleYaw;
if (o->oDistanceToMario >= 25000.0f) {
@@ -98,7 +98,7 @@ static void skeeter_act_walk(void) {
obj_forward_vel_approach(o->oSkeeterUnkFC, 0.4f);
sp24 = 0.12f * o->oForwardVel;
- func_8029ED98(2, sp24);
+ cur_obj_init_animation_with_accel_and_sound(2, sp24);
func_802F9378(3, 13, SOUND_OBJ_SKEETER_WALK);
if (o->oSkeeterUnkF8 != 0) {
@@ -117,7 +117,7 @@ static void skeeter_act_walk(void) {
o->oSkeeterUnkFC = 10.0f;
if (o->oSkeeterWaitTime != 0) {
o->oSkeeterWaitTime -= 1;
- } else if (func_8029F788() != 0) {
+ } else if (cur_obj_check_if_near_animation_end() != 0) {
if (RandomU16() & 0x0003) {
o->oSkeeterTargetAngle = obj_random_fixed_turn(0x2000);
o->oSkeeterWaitTime = random_linear_offset(100, 100);
@@ -130,7 +130,7 @@ static void skeeter_act_walk(void) {
}
}
- obj_rotate_yaw_toward(o->oSkeeterTargetAngle, 0x400);
+ cur_obj_rotate_yaw_toward(o->oSkeeterTargetAngle, 0x400);
}
}
@@ -138,7 +138,7 @@ void bhv_skeeter_update(void) {
o->oDeathSound = SOUND_OBJ_SNUFIT_SKEETER_DEATH;
treat_far_home_as_mario(1000.0f);
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case SKEETER_ACT_IDLE:
@@ -153,14 +153,14 @@ void bhv_skeeter_update(void) {
}
obj_check_attacks(&sSkeeterHitbox, o->oAction);
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
void bhv_skeeter_wave_update(void) {
if (approach_f32_ptr(&o->header.gfx.scale[0], 0.0f, 0.3f)) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
o->oAnimState = gGlobalTimer / 6;
}
diff --git a/src/game/behaviors/sl_snowman_wind.inc.c b/src/game/behaviors/sl_snowman_wind.inc.c
@@ -0,0 +1,45 @@
+// sl_snowman_wind.c.inc
+
+void bhv_sl_snowman_wind_loop(void) {
+ UNUSED s32 unusedVar = 0;
+ s16 marioAngleFromWindSource;
+ Vec3f tempPos;
+
+ if (o->oTimer == 0)
+ o->oSLSnowmanWindOriginalYaw = o->oMoveAngleYaw;
+
+ // Waiting for Mario to approach.
+ if (o->oSubAction == SL_SNOWMAN_WIND_ACT_IDLE) {
+ o->oDistanceToMario = 0;
+
+ // Check if Mario is within 1000 units of the center of the bridge, and ready to speak.
+ vec3f_copy_2(tempPos, &o->oPosX);
+ obj_set_pos(o, 1100, 3328, 1164); // Position is in the middle of the ice bridge
+ if (cur_obj_can_mario_activate_textbox(1000.0f, 30.0f, 0x7FFF))
+ o->oSubAction++;
+ vec3f_copy_2(&o->oPosX, tempPos);
+
+ // Mario has come close, begin dialog.
+ } else if (o->oSubAction == SL_SNOWMAN_WIND_ACT_TALKING) {
+ if (cur_obj_update_dialog(2, 2, DIALOG_153, 0))
+ o->oSubAction++;
+
+ // Blowing, spawn wind particles (SL_SNOWMAN_WIND_ACT_BLOWING)
+ } else if (o->oDistanceToMario < 1500.0f && absf(gMarioObject->oPosY - o->oHomeY) < 500.0f) {
+ // Point towards Mario, but only within 0x1500 angle units of the original angle.
+ if ((marioAngleFromWindSource = o->oAngleToMario - o->oSLSnowmanWindOriginalYaw) > 0) {
+ if (marioAngleFromWindSource < 0x1500)
+ o->oMoveAngleYaw = o->oAngleToMario;
+ else
+ o->oMoveAngleYaw = o->oSLSnowmanWindOriginalYaw + 0x1500;
+ } else {
+ if (marioAngleFromWindSource > -0x1500)
+ o->oMoveAngleYaw = o->oAngleToMario;
+ else
+ o->oMoveAngleYaw = o->oSLSnowmanWindOriginalYaw - 0x1500;
+ }
+ // Spawn wind and play wind sound
+ cur_obj_spawn_strong_wind_particles(12, 3.0f, 0, 0, 0);
+ cur_obj_play_sound_1(SOUND_AIR_BLOW_WIND);
+ }
+}
diff --git a/src/game/behaviors/sl_walking_penguin.inc.c b/src/game/behaviors/sl_walking_penguin.inc.c
@@ -0,0 +1,115 @@
+// sl_walking_penguin.c.inc
+
+struct SLWalkingPenguinStep {
+ s32 stepLength;
+ s32 anim;
+ f32 speed;
+ f32 animSpeed;
+};
+
+// The penguin follows a preset list of movements while walking forward.
+struct SLWalkingPenguinStep sSLWalkingPenguinErraticSteps[] = {
+ { 60, PENGUIN_ANIM_WALK, 6.0f, 1.0f }, // Walk forwards for 2 seconds
+ { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second
+ { 30, PENGUIN_ANIM_WALK, 12.0f, 2.0f }, // Walk forwards quickly for 1 second
+ { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second
+ { 30, PENGUIN_ANIM_WALK, -6.0f, 1.0f }, // Walk backwards for 1 second
+ { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second
+ { -1, 0, 0.0f, 0.0f } }; // Repeat
+
+
+static s32 sl_walking_penguin_turn(void) {
+ // Stay still and use walking animation for the turn.
+ o->oForwardVel = 0.0f;
+ cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 1.0f);
+
+ // Turn around.
+ o->oAngleVelYaw = 0x400;
+ o->oMoveAngleYaw += o->oAngleVelYaw;
+
+ if (o->oTimer == 31)
+ return TRUE; // Finished turning
+ else
+ return FALSE;
+}
+
+void bhv_sl_walking_penguin_loop(void) {
+ f32 adjustedXPos, adjustedZPos;
+ f32 perpendicularOffset = 100.0f;
+
+ o->oAngleVelYaw = 0;
+ cur_obj_update_floor_and_walls();
+
+ switch (o->oAction) {
+ // Walk erratically across the ice bridge using preset steps.
+ case SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS:
+ if (o->oTimer == 0) {
+ // Initiate variables
+ o->oSLWalkingPenguinCurStep = 0;
+ o->oSLWalkingPenguinCurStepTimer = 0;
+ }
+
+ if (o->oSLWalkingPenguinCurStepTimer < sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].stepLength)
+ o->oSLWalkingPenguinCurStepTimer++;
+ else {
+ // Move to next step
+ o->oSLWalkingPenguinCurStepTimer = 0;
+ o->oSLWalkingPenguinCurStep++;
+ if (sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].stepLength < 0)
+ // Reached the end of the list, go back to the start
+ o->oSLWalkingPenguinCurStep = 0;
+ }
+
+ if (o->oPosX < 300.0f)
+ o->oAction++; // If reached the end of the bridge, turn around and head back.
+ else {
+ // Move and animate the penguin
+ o->oForwardVel = sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].speed;
+
+ cur_obj_init_animation_with_accel_and_sound(
+ sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].anim,
+ sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].animSpeed
+ );
+ }
+ break;
+
+ // At the end, turn around and prepare to head back across the bridge.
+ case SL_WALKING_PENGUIN_ACT_TURNING_BACK:
+ if (sl_walking_penguin_turn())
+ o->oAction++; // Finished turning
+ break;
+
+ // Walk back across the bridge at a constant speed.
+ case SL_WALKING_PENGUIN_ACT_RETURNING:
+ // Move and animate the penguin
+ o->oForwardVel = 12.0f;
+ cur_obj_init_animation_with_accel_and_sound(PENGUIN_ANIM_WALK, 2.0f);
+
+ if (o->oPosX > 1700.0f)
+ o->oAction++; // If reached the start of the bridge, turn around.
+ break;
+
+ // At the start, turn around and prepare to walk erratically across the bridge.
+ case SL_WALKING_PENGUIN_ACT_TURNING_FORWARDS:
+ if (sl_walking_penguin_turn())
+ o->oAction = SL_WALKING_PENGUIN_ACT_MOVING_FORWARDS; // Finished turning
+ break;
+ }
+
+ cur_obj_move_standard(-78);
+ if (!cur_obj_hide_if_mario_far_away_y(1000.0f))
+ play_penguin_walking_sound(PENGUIN_WALK_BIG);
+
+ // Adjust the position to get a point better lined up with the visual model, for stopping the wind.
+ // The new point is 60 units behind the penguin and 100 units perpedicularly, away from the snowman.
+
+ adjustedXPos = o->oPosX + sins(0xDBB0) * 60.0f; // 0xDBB0 = -51 degrees, the angle the penguin is facing
+ adjustedZPos = o->oPosZ + coss(0xDBB0) * 60.0f;
+ adjustedXPos += perpendicularOffset * sins(0x1BB0); // 0x1BB0 = 39 degrees, perpendicular to the penguin
+ adjustedZPos += perpendicularOffset * coss(0x1BB0);
+ o->oSLWalkingPenguinWindCollisionXPos = adjustedXPos;
+ o->oSLWalkingPenguinWindCollisionZPos = adjustedZPos;
+
+ print_debug_bottom_up("x %d", o->oPosX);
+ print_debug_bottom_up("z %d", o->oPosZ);
+}
diff --git a/src/game/behaviors/snow_mound.inc.c b/src/game/behaviors/snow_mound.inc.c
@@ -8,7 +8,7 @@ void bhv_sliding_snow_mound_loop(void) {
if (o->oTimer >= 118)
o->oAction = 1;
- PlaySound(SOUND_ENV_SINK_QUICKSAND);
+ cur_obj_play_sound_1(SOUND_ENV_SINK_QUICKSAND);
break;
case 1:
diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c
@@ -27,22 +27,22 @@ void bhv_snowmans_bottom_init(void) {
o->oForwardVel = 0;
o->oSnowmansBottomUnkF4 = 0.4f;
- sp34 = obj_nearest_object_with_behavior(bhvSnowmansHead);
+ sp34 = cur_obj_nearest_object_with_behavior(bhvSnowmansHead);
if (sp34 != NULL) {
o->parentObj = sp34;
}
spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvSnowmansBodyCheckpoint, -402, 461, -2898, 0, 0, 0);
}
-void func_802EFB2C(void) {
- set_object_hitbox(o, &sRollingSphereHitbox);
+void set_rolling_sphere_hitbox(void) {
+ obj_set_hitbox(o, &sRollingSphereHitbox);
if ((o->oInteractStatus & INT_STATUS_INTERACTED) != 0) {
o->oInteractStatus = 0;
}
}
-void func_802EFB84(f32 f12) {
+void adjust_rolling_face_pitch(f32 f12) {
o->oFaceAnglePitch += (s16)(o->oForwardVel * (100.0f / f12));
o->oSnowmansBottomUnkF4 += o->oForwardVel * 1e-4;
@@ -50,14 +50,14 @@ void func_802EFB84(f32 f12) {
o->oSnowmansBottomUnkF4 = 1.0f;
}
-void func_802EFC44(void) {
+void snowmans_bottom_act_1(void) {
UNUSED s16 sp26;
s32 sp20;
UNUSED s16 sp1E;
o->oPathedStartWaypoint = segmented_to_virtual(&ccm_seg7_trajectory_snowman);
sp26 = object_step_without_floor_orient();
- sp20 = obj_follow_path(sp20);
+ sp20 = cur_obj_follow_path(sp20);
o->oSnowmansBottomUnkF8 = o->oPathedTargetYaw;
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oSnowmansBottomUnkF8, 0x400);
@@ -75,7 +75,7 @@ void func_802EFC44(void) {
}
}
-void func_802EFDA0(void) {
+void snowmans_bottom_act_2(void) {
UNUSED s16 sp26;
sp26 = object_step_without_floor_orient();
@@ -84,7 +84,7 @@ void func_802EFDA0(void) {
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oSnowmansBottomUnkF8, 0x400);
if (is_point_close_to_object(o, -4230.0f, -1344.0f, 1813.0f, 300)) {
- func_802AA618(0, 0, 70.0f);
+ spawn_mist_particles_variable(0, 0, 70.0f);
o->oMoveAngleYaw = atan2s(1813.0f - o->oPosZ, -4230.0f - o->oPosX);
o->oVelY = 80.0f;
o->oForwardVel = 15.0f;
@@ -92,7 +92,7 @@ void func_802EFDA0(void) {
o->parentObj->oAction = 2;
o->parentObj->oVelY = 100.0f;
- PlaySound2(SOUND_OBJ_SNOWMAN_BOUNCE);
+ cur_obj_play_sound_2(SOUND_OBJ_SNOWMAN_BOUNCE);
}
if (o->oTimer == 200) {
@@ -101,17 +101,17 @@ void func_802EFDA0(void) {
}
}
-void func_802EFF58(void) {
+void snowmans_bottom_act_3(void) {
UNUSED s16 sp1E;
sp1E = object_step_without_floor_orient();
if ((sp1E & 0x09) == 0x09) {
o->oAction = 4;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
if ((sp1E & 0x01) != 0) {
- func_802AA618(0, 0, 70.0f);
+ spawn_mist_particles_variable(0, 0, 70.0f);
o->oPosX = -4230.0f;
o->oPosZ = 1813.0f;
o->oForwardVel = 0.0f;
@@ -135,29 +135,29 @@ void bhv_snowmans_bottom_loop(void) {
break;
case 1:
- func_802EFC44();
- func_802EFB84(o->oSnowmansBottomUnkF4);
- PlaySound(SOUND_ENV_UNKNOWN2);
+ snowmans_bottom_act_1();
+ adjust_rolling_face_pitch(o->oSnowmansBottomUnkF4);
+ cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
break;
case 2:
- func_802EFDA0();
- func_802EFB84(o->oSnowmansBottomUnkF4);
- PlaySound(SOUND_ENV_UNKNOWN2);
+ snowmans_bottom_act_2();
+ adjust_rolling_face_pitch(o->oSnowmansBottomUnkF4);
+ cur_obj_play_sound_1(SOUND_ENV_UNKNOWN2);
break;
case 3:
- func_802EFF58();
+ snowmans_bottom_act_3();
break;
case 4:
- obj_push_mario_away_from_cylinder(210.0f, 550);
+ cur_obj_push_mario_away_from_cylinder(210.0f, 550);
break;
}
- func_802EFB2C();
+ set_rolling_sphere_hitbox();
set_object_visibility(o, 8000);
- obj_scale(o->oSnowmansBottomUnkF4);
+ cur_obj_scale(o->oSnowmansBottomUnkF4);
o->oGraphYOffset = o->oSnowmansBottomUnkF4 * 180.0f;
}
@@ -168,7 +168,7 @@ void bhv_snowmans_head_init(void) {
sp37 = save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1);
sp36 = (o->oBehParams >> 24) & 0xFF;
- obj_scale(0.7f);
+ cur_obj_scale(0.7f);
o->oGravity = 5.0f;
o->oFriction = 0.999f;
@@ -208,21 +208,21 @@ void bhv_snowmans_head_loop(void) {
if (o->oPosY < -994.0f) {
o->oPosY = -994.0f;
o->oAction = 4;
- PlaySound2(SOUND_OBJ_SNOWMAN_EXPLODE);
+ cur_obj_play_sound_2(SOUND_OBJ_SNOWMAN_EXPLODE);
play_puzzle_jingle();
}
break;
case 4:
if (trigger_obj_dialog_when_facing(&o->oSnowmansHeadUnkF4, DIALOG_111, 700.0f, 2)) {
- func_802A3004();
- create_star(-4700.0f, -1024.0f, 1890.0f);
+ spawn_mist_particles();
+ spawn_default_star(-4700.0f, -1024.0f, 1890.0f);
o->oAction = 1;
}
break;
}
- obj_push_mario_away_from_cylinder(180.0f, 150.0f);
+ cur_obj_push_mario_away_from_cylinder(180.0f, 150.0f);
}
void bhv_snowmans_body_checkpoint_loop(void) {
diff --git a/src/game/behaviors/snowman_wind.inc.c b/src/game/behaviors/snowman_wind.inc.c
@@ -1,35 +0,0 @@
-// snowman_wind.c.inc
-
-void bhv_snowman_wind_blowing_loop(void) {
- UNUSED s32 sp34;
- s16 sp32;
- Vec3f pos;
- sp34 = 0;
- if (o->oTimer == 0)
- o->oSnowmanWindBlowingUnkF4 = o->oMoveAngleYaw;
- if (o->oSubAction == 0) {
- o->oDistanceToMario = 0;
- func_802B8F7C(pos, &o->oPosX);
- set_object_pos(o, 1100, 3328, 1164);
- if (func_802A3FF8(1000.0f, 30.0f, 0x7FFF))
- o->oSubAction++;
- func_802B8F7C(&o->oPosX, pos);
- } else if (o->oSubAction == 1) {
- if (obj_update_dialog(2, 2, DIALOG_153, 0))
- o->oSubAction++;
- } else if (o->oDistanceToMario < 1500.0f && absf(gMarioObject->oPosY - o->oHomeY) < 500.0f) {
- if ((sp32 = o->oAngleToMario - o->oSnowmanWindBlowingUnkF4) > 0) {
- if (sp32 < 0x1500)
- o->oMoveAngleYaw = o->oAngleToMario;
- else
- o->oMoveAngleYaw = o->oSnowmanWindBlowingUnkF4 + 0x1500;
- } else {
- if (sp32 >= -0x14ff)
- o->oMoveAngleYaw = o->oAngleToMario;
- else
- o->oMoveAngleYaw = o->oSnowmanWindBlowingUnkF4 - 0x1500;
- }
- func_802C76E0(12, 3.0f, 0, 0, 0);
- PlaySound(SOUND_AIR_BLOW_WIND);
- }
-}
diff --git a/src/game/behaviors/snufit.inc.c b/src/game/behaviors/snufit.inc.c
@@ -1,4 +1,9 @@
-// snufit.inc.c
+/**
+ * Behavior file for bhvSnufit and bhvSnufitBalls.
+ * Snufits are present in HMC and CotMC, and are the fly guy
+ * like enemies that shoot bullets. The balls are the little pellets
+ * the snufit shoots at Mario.
+ */
struct ObjectHitbox sSnufitHitbox = {
/* interactType: */ INTERACT_HIT_FROM_BELOW,
@@ -24,71 +29,100 @@ struct ObjectHitbox sSnufitBulletHitbox = {
/* hurtboxHeight: */ 50,
};
-Gfx *Geo18_8030D93C(s32 arg0, struct GraphNode *node, UNUSED void *arg2) {
- struct Object *sp4;
- struct GraphNodeTranslationRotation *sp0;
-
- if (arg0 == 1) {
- sp4 = (struct Object *) gCurGraphNodeObject;
- sp0 = (struct GraphNodeTranslationRotation *) node->next;
-
- sp0->translation[0] = sp4->oSnufitUnk1AC;
- sp0->translation[1] = sp4->oSnufitUnk1AE;
- sp0->translation[2] = sp4->oSnufitUnk1B0;
+/**
+ * This geo function shifts snufit's mask when it shrinks down,
+ * since the parts move independently.
+ */
+Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
+ struct Object *obj;
+ struct GraphNodeTranslationRotation *transNode;
+
+ if (callContext == GEO_CONTEXT_RENDER) {
+ obj = (struct Object *) gCurGraphNodeObject;
+ transNode = (struct GraphNodeTranslationRotation *) node->next;
+
+ transNode->translation[0] = obj->oSnufitXOffset;
+ transNode->translation[1] = obj->oSnufitYOffset;
+ transNode->translation[2] = obj->oSnufitZOffset;
}
return NULL;
}
-Gfx *Geo18_8030D9AC(s32 arg0, struct GraphNode *node, UNUSED void *arg2) {
- struct Object *sp4;
- struct GraphNodeScale *sp0;
+/**
+ * This function scales the body of snufit, which needs done seperately from its mask.
+ */
+Gfx *geo_snufit_scale_body(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) {
+ struct Object *obj;
+ struct GraphNodeScale *scaleNode;
- if (arg0 == 1) {
- sp4 = (struct Object *) gCurGraphNodeObject;
- sp0 = (struct GraphNodeScale *) node->next;
+ if (callContext == GEO_CONTEXT_RENDER) {
+ obj = (struct Object *) gCurGraphNodeObject;
+ scaleNode = (struct GraphNodeScale *) node->next;
- sp0->scale = sp4->oSnufitUnk1B2 / 1000.0f;
+ scaleNode->scale = obj->oSnufitBodyScale / 1000.0f;
}
return NULL;
}
-void snufit_act_0(void) {
- s32 sp1C;
-
- sp1C = (s32)(o->oDistanceToMario / 10.0f);
- if (o->oTimer > sp1C && o->oDistanceToMario < 800.0f) {
- o->oSnufitUnk104 = approach_s16_symmetric(o->oSnufitUnk104, 0, 1500);
- o->oSnufitUnk108 = approach_s16_symmetric(o->oSnufitUnk108, 600, 15);
-
- if ((s16) o->oSnufitUnk104 == 0 && o->oSnufitUnk108 == 600) {
- o->oAction = 1;
- o->oSnufitUnk10C = 0;
+/**
+ * Snufit's idle action. It rotates in a circle until Mario is near,
+ * then prepares to shoot after a period.
+ */
+void snufit_act_idle(void) {
+ s32 marioDist;
+
+ // This line would could cause a crash in certain PU situations,
+ // if the game would not have already crashed.
+ marioDist = (s32)(o->oDistanceToMario / 10.0f);
+ if (o->oTimer > marioDist && o->oDistanceToMario < 800.0f) {
+
+ // Controls an alternating scaling factor in a cos.
+ o->oSnufitBodyScalePeriod
+ = approach_s16_symmetric(o->oSnufitBodyScalePeriod, 0, 1500);
+ o->oSnufitBodyBaseScale
+ = approach_s16_symmetric(o->oSnufitBodyBaseScale, 600, 15);
+
+ if ((s16) o->oSnufitBodyScalePeriod == 0 && o->oSnufitBodyBaseScale == 600) {
+ o->oAction = SNUFIT_ACT_SHOOT;
+ o->oSnufitBullets = 0;
}
} else {
- o->oSnufitUnk100 += 400;
+ o->oSnufitCircularPeriod += 400;
}
}
-void snufit_act_1(void) {
- o->oSnufitUnk104 = approach_s16_symmetric(o->oSnufitUnk104, -0x8000, 3000);
- o->oSnufitUnk108 = approach_s16_symmetric(o->oSnufitUnk108, 0xA7, 20);
-
- if ((u16) o->oSnufitUnk104 == 0x8000 && o->oSnufitUnk108 == 0xA7) {
- o->oAction = 0;
- } else if (o->oSnufitUnk10C < 3 && o->oTimer >= 3) {
- o->oSnufitUnk10C += 1;
- PlaySound2(SOUND_OBJ_SNUFIT_SHOOT);
+/**
+ * Controls the literal shooting action, spawning three bhvSnufitBalls.
+ */
+void snufit_act_shoot(void) {
+ o->oSnufitBodyScalePeriod
+ = approach_s16_symmetric(o->oSnufitBodyScalePeriod, -0x8000, 3000);
+ o->oSnufitBodyBaseScale
+ = approach_s16_symmetric(o->oSnufitBodyBaseScale, 167, 20);
+
+ if ((u16) o->oSnufitBodyScalePeriod == 0x8000 && o->oSnufitBodyBaseScale == 167) {
+ o->oAction = SNUFIT_ACT_IDLE;
+ } else if (o->oSnufitBullets < 3 && o->oTimer >= 3) {
+ o->oSnufitBullets += 1;
+ cur_obj_play_sound_2(SOUND_OBJ_SNUFIT_SHOOT);
spawn_object_relative(0, 0, -20, 40, o, MODEL_BOWLING_BALL, bhvSnufitBalls);
- o->oSnufitUnkF4 = -30;
+ o->oSnufitRecoil = -30;
o->oTimer = 0;
}
}
+/**
+ * Primary loop behavior for snufit. Controls some generic movement
+ * and the action brain of the object.
+ */
void bhv_snufit_loop(void) {
- if (!(o->activeFlags & 0x0008)) {
+ // Only update if Mario is in the current room.
+ if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
o->oDeathSound = SOUND_OBJ_SNUFIT_SKEETER_DEATH;
+
+ // Face Mario if he is within range.
if (o->oDistanceToMario < 800.0f) {
obj_turn_pitch_toward_mario(120.0f, 2000);
@@ -98,7 +132,7 @@ void bhv_snufit_loop(void) {
o->oMoveAnglePitch = -0x2000;
}
- obj_rotate_yaw_toward(o->oAngleToMario, 2000);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 2000);
} else {
obj_move_pitch_approach(0, 0x200);
o->oMoveAngleYaw += 200;
@@ -107,57 +141,75 @@ void bhv_snufit_loop(void) {
o->oFaceAnglePitch = o->oMoveAnglePitch;
switch (o->oAction) {
- case 0:
- snufit_act_0();
+ case SNUFIT_ACT_IDLE:
+ snufit_act_idle();
break;
- case 1:
- snufit_act_1();
+ case SNUFIT_ACT_SHOOT:
+ snufit_act_shoot();
break;
}
- o->oPosX = o->oHomeX + 100.0f * coss(o->oSnufitUnk100);
+ // Snufit orbits in a circular motion depending on an internal timer
+ // and vertically off the global timer. The vertical position can be
+ // manipulated using pauses since it uses the global timer.
+ o->oPosX = o->oHomeX + 100.0f * coss(o->oSnufitCircularPeriod);
o->oPosY = o->oHomeY + 8.0f * coss(4000 * gGlobalTimer);
- o->oPosZ = o->oHomeZ + 100.0f * sins(o->oSnufitUnk100);
+ o->oPosZ = o->oHomeZ + 100.0f * sins(o->oSnufitCircularPeriod);
- o->oSnufitUnk1AE = -0x20;
- o->oSnufitUnk1B0 = o->oSnufitUnkF4 + 180;
- o->oSnufitUnk1B2 = (s16)(o->oSnufitUnk108 + 666 + o->oSnufitUnk108 * coss(o->oSnufitUnk104));
+ o->oSnufitYOffset = -0x20;
+ o->oSnufitZOffset = o->oSnufitRecoil + 180;
+ o->oSnufitBodyScale
+ = (s16)(o->oSnufitBodyBaseScale + 666
+ + o->oSnufitBodyBaseScale * coss(o->oSnufitBodyScalePeriod));
- if (o->oSnufitUnk1B2 > 1000) {
- o->oSnufitUnkF8 = (o->oSnufitUnk1B2 - 1000) / 1000.0f + 1.0f;
- o->oSnufitUnk1B2 = 1000;
+ if (o->oSnufitBodyScale > 1000) {
+ o->oSnufitScale = (o->oSnufitBodyScale - 1000) / 1000.0f + 1.0f;
+ o->oSnufitBodyScale = 1000;
} else {
- o->oSnufitUnkF8 = 1.0f;
+ o->oSnufitScale = 1.0f;
}
- obj_scale(o->oSnufitUnkF8);
+ cur_obj_scale(o->oSnufitScale);
obj_check_attacks(&sSnufitHitbox, o->oAction);
}
}
+/**
+ * Snufit bullets live to run into stuff and die when they do.
+ */
void bhv_snufit_balls_loop(void) {
- if ((o->activeFlags & 0x0008) || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) {
- mark_object_for_deletion(o);
+ // If far from Mario or in a different room, despawn.
+ if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)
+ || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) {
+ obj_mark_for_deletion(o);
}
+ // Gravity =/= 0 after it has hit Mario while metal.
if (o->oGravity == 0.0f) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
obj_compute_vel_from_move_pitch(40.0f);
if (obj_check_attacks(&sSnufitBulletHitbox, 1)) {
+ // We hit Mario while he is metal!
+ // Bounce off, and fall until the first check is true.
o->oMoveAngleYaw += 0x8000;
o->oForwardVel *= 0.05f;
o->oVelY = 30.0f;
o->oGravity = -4.0f;
- obj_become_intangible();
- } else if (o->oAction == 1 || (o->oMoveFlags & 0x00000203)) {
+ cur_obj_become_intangible();
+ } else if (o->oAction == 1
+ || (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_HIT_WALL))) {
+ // The Snufit shot Mario and has fulfilled its lonely existance.
+ //! The above check could theoretically be avoided by finding a geometric
+ //! situation that does not trigger those flags (Water?). If found,
+ //! this would be a route to hang the game via too many snufit bullets.
o->oDeathSound = -1;
obj_die_if_health_non_positive();
}
- obj_move_standard(78);
+ cur_obj_move_standard(78);
} else {
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
}
diff --git a/src/game/behaviors/sound_birds.inc.c b/src/game/behaviors/sound_birds.inc.c
@@ -6,15 +6,15 @@ void bhv_birds_sound_loop(void) {
switch (o->oBehParams2ndByte) {
case 0:
- PlaySound(SOUND_OBJ2_BIRD_CHIRP1);
+ cur_obj_play_sound_1(SOUND_OBJ2_BIRD_CHIRP1);
break;
case 1:
- PlaySound(SOUND_GENERAL2_BIRD_CHIRP2);
+ cur_obj_play_sound_1(SOUND_GENERAL2_BIRD_CHIRP2);
break;
case 2:
- PlaySound(SOUND_OBJ_BIRD_CHIRP3);
+ cur_obj_play_sound_1(SOUND_OBJ_BIRD_CHIRP3);
break;
}
}
diff --git a/src/game/behaviors/sound_sand.inc.c b/src/game/behaviors/sound_sand.inc.c
@@ -4,5 +4,5 @@ void bhv_sand_sound_loop(void) {
if (gCamera->mode == CAMERA_MODE_BEHIND_MARIO)
return;
- PlaySound(SOUND_ENV_MOVINGSAND);
+ cur_obj_play_sound_1(SOUND_ENV_MOVINGSAND);
}
diff --git a/src/game/behaviors/sound_volcano.inc.c b/src/game/behaviors/sound_volcano.inc.c
@@ -1,5 +1,5 @@
// sound_volcano.inc.c
void bhv_volcano_sound_loop(void) {
- PlaySound(SOUND_ENV_DRONING1);
+ cur_obj_play_sound_1(SOUND_ENV_DRONING1);
}
diff --git a/src/game/behaviors/sound_waterfall.inc.c b/src/game/behaviors/sound_waterfall.inc.c
@@ -1,5 +1,5 @@
// sound_waterfall.inc.c
void bhv_waterfall_sound_loop(void) {
- PlaySound(SOUND_ENV_WATERFALL2);
+ cur_obj_play_sound_1(SOUND_ENV_WATERFALL2);
}
diff --git a/src/game/behaviors/sparkle_spawn.inc.c b/src/game/behaviors/sparkle_spawn.inc.c
@@ -8,10 +8,10 @@
void bhv_sparkle_spawn_loop(void) {
struct Object *sparkle = try_to_spawn_object(0, 1.0f, o, MODEL_SPARKLES_ANIMATION, bhvSparkle);
if (sparkle != NULL) {
- translate_object_xyz_random(sparkle, 90.0f);
- scale_object_random(sparkle, 1.0f, 0.0f);
+ obj_translate_xyz_random(sparkle, 90.0f);
+ obj_scale_random(sparkle, 1.0f, 0.0f);
}
if (o->oTimer > 1) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
diff --git a/src/game/behaviors/sparkle_spawn_star.inc.c b/src/game/behaviors/sparkle_spawn_star.inc.c
@@ -17,20 +17,20 @@ void bhv_spawned_star_init(void) {
if (!(o->oInteractionSubtype & INT_SUBTYPE_NO_EXIT))
o->oBehParams = o->parentObj->oBehParams;
sp24 = (o->oBehParams >> 24) & 0xFF;
- if (func_802A377C(sp24) & save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1))
- obj_set_model(MODEL_TRANSPARENT_STAR);
- PlaySound2(SOUND_GENERAL2_STAR_APPEARS);
+ if (bit_shift_left(sp24) & save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1))
+ cur_obj_set_model(MODEL_TRANSPARENT_STAR);
+ cur_obj_play_sound_2(SOUND_GENERAL2_STAR_APPEARS);
}
-void func_802AA788(void) {
- set_object_hitbox(o, &sSparkleSpawnStarHitbox);
+void set_sparkle_spawn_star_hitbox(void) {
+ obj_set_hitbox(o, &sSparkleSpawnStarHitbox);
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
mark_obj_for_deletion(o);
o->oInteractStatus = 0;
}
}
-void func_802AA7EC(void) {
+void set_home_to_mario(void) {
f32 sp1C;
f32 sp18;
o->oHomeX = gMarioObject->oPosX;
@@ -43,12 +43,12 @@ void func_802AA7EC(void) {
o->oForwardVel = sqrtf(sp1C * sp1C + sp18 * sp18) / 23.0f;
}
-void func_802AA8E4(void) {
+void set_y_home_to_pos(void) {
o->oForwardVel = 0;
o->oHomeY = o->oPosY;
}
-void func_802AA918(void) {
+void slow_star_rotation(void) {
if (o->oAngleVelYaw > 0x400)
o->oAngleVelYaw -= 0x40;
}
@@ -61,15 +61,15 @@ void bhv_spawned_star_loop(void) {
o->activeFlags |= 0x20;
o->oAngleVelYaw = 0x800;
if (o->oBehParams2ndByte == 0)
- func_802AA7EC();
+ set_home_to_mario();
else
- func_802AA8E4();
- o->oMoveAngleYaw = obj_angle_to_home();
+ set_y_home_to_pos();
+ o->oMoveAngleYaw = cur_obj_angle_to_home();
o->oVelY = 50.0f;
o->oGravity = -4.0f;
- func_802A3004();
+ spawn_mist_particles();
}
- PlaySound(SOUND_ENV_STAR);
+ cur_obj_play_sound_1(SOUND_ENV_STAR);
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
if (o->oVelY < 0 && o->oPosY < o->oHomeY) {
o->oAction++;
@@ -102,10 +102,10 @@ void bhv_spawned_star_loop(void) {
o->oAction++;
}
} else {
- func_802AA788();
- func_802AA918();
+ set_sparkle_spawn_star_hitbox();
+ slow_star_rotation();
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
o->oFaceAngleYaw += o->oAngleVelYaw;
o->oInteractStatus = 0;
}
@@ -114,5 +114,5 @@ void bhv_spawn_star_no_level_exit(u32 sp20) {
struct Object *sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit);
sp1C->oBehParams = sp20 << 24;
sp1C->oInteractionSubtype = INT_SUBTYPE_NO_EXIT;
- set_object_angle(sp1C, 0, 0, 0);
+ obj_set_angle(sp1C, 0, 0, 0);
}
diff --git a/src/game/behaviors/spawn_star.inc.c b/src/game/behaviors/spawn_star.inc.c
@@ -1,4 +1,4 @@
-// spawn_star.c.inc
+// spawn_default_star.c.inc
static struct ObjectHitbox sCollectStarHitbox = {
/* interactType: */ INTERACT_STAR_OR_KEY,
@@ -24,7 +24,7 @@ void bhv_collect_star_init(void) {
o->header.gfx.sharedChild = gLoadedGraphNodes[MODEL_STAR];
}
- set_object_hitbox(o, &sCollectStarHitbox);
+ obj_set_hitbox(o, &sCollectStarHitbox);
}
void bhv_collect_star_loop(void) {
@@ -49,7 +49,7 @@ void bhv_star_spawn_init(void) {
set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_MARIO_AND_DOORS);
o->activeFlags |= 0x20;
- obj_become_intangible();
+ cur_obj_become_intangible();
}
void bhv_star_spawn_loop(void) {
@@ -66,7 +66,7 @@ void bhv_star_spawn_loop(void) {
o->oPosY = o->oStarSpawnUnkFC + sins((o->oTimer * 0x8000) / 30) * 400.0f;
o->oFaceAngleYaw += 0x1000;
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
- PlaySound(SOUND_ENV_STAR);
+ cur_obj_play_sound_1(SOUND_ENV_STAR);
if (o->oTimer == 30) {
o->oAction = 2;
o->oForwardVel = 0;
@@ -83,11 +83,11 @@ void bhv_star_spawn_loop(void) {
spawn_object(o, MODEL_NONE, bhvSparkleSpawn);
obj_move_xyz_using_fvel_and_yaw(o);
o->oFaceAngleYaw = o->oFaceAngleYaw - o->oTimer * 0x10 + 0x1000;
- PlaySound(SOUND_ENV_STAR);
+ cur_obj_play_sound_1(SOUND_ENV_STAR);
if (o->oPosY < o->oHomeY) {
- PlaySound2(SOUND_GENERAL_STAR_APPEARS);
- obj_become_tangible();
+ cur_obj_play_sound_2(SOUND_GENERAL_STAR_APPEARS);
+ cur_obj_become_tangible();
o->oPosY = o->oHomeY;
o->oAction = 3;
}
@@ -109,7 +109,7 @@ void bhv_star_spawn_loop(void) {
}
}
-struct Object *func_802F1A50(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) {
+struct Object *spawn_star(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) {
sp30 = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStarSpawnCoordinates, o->oPosX, o->oPosY,
o->oPosZ, 0, 0, 0);
sp30->oBehParams = o->oBehParams;
@@ -121,21 +121,21 @@ struct Object *func_802F1A50(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C)
return sp30;
}
-void create_star(f32 sp20, f32 sp24, f32 sp28) {
+void spawn_default_star(f32 sp20, f32 sp24, f32 sp28) {
struct Object *sp1C;
- sp1C = func_802F1A50(sp1C, sp20, sp24, sp28);
+ sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 0;
}
-void func_802F1B84(f32 sp20, f32 sp24, f32 sp28) {
+void spawn_red_coin_cutscene_star(f32 sp20, f32 sp24, f32 sp28) {
struct Object *sp1C;
- sp1C = func_802F1A50(sp1C, sp20, sp24, sp28);
+ sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 1;
}
-void func_802F1BD4(f32 sp20, f32 sp24, f32 sp28) {
+void spawn_no_exit_star(f32 sp20, f32 sp24, f32 sp28) {
struct Object *sp1C;
- sp1C = func_802F1A50(sp1C, sp20, sp24, sp28);
+ sp1C = spawn_star(sp1C, sp20, sp24, sp28);
sp1C->oBehParams2ndByte = 1;
sp1C->oInteractionSubtype |= INT_SUBTYPE_NO_EXIT;
}
@@ -168,8 +168,8 @@ void bhv_hidden_red_coin_star_loop(void) {
case 1:
if (o->oTimer > 2) {
- func_802F1B84(o->oPosX, o->oPosY, o->oPosZ);
- func_802A3004();
+ spawn_red_coin_cutscene_star(o->oPosX, o->oPosY, o->oPosZ);
+ spawn_mist_particles();
o->activeFlags = 0;
}
break;
diff --git a/src/game/behaviors/spawn_star_exit.inc.c b/src/game/behaviors/spawn_star_exit.inc.c
@@ -5,7 +5,7 @@ void bhv_ccm_touched_star_spawn_loop(void) {
o->oPosY += 100.0f;
o->oPosX = 2780.0f;
o->oPosZ = 4666.0f;
- create_star(2500.0f, -4350.0f, 5750.0f);
- mark_object_for_deletion(o);
+ spawn_default_star(2500.0f, -4350.0f, 5750.0f);
+ obj_mark_for_deletion(o);
}
}
diff --git a/src/game/behaviors/spindel.inc.c b/src/game/behaviors/spindel.inc.c
@@ -64,7 +64,7 @@ void bhv_spindel_loop(void) {
o->oMoveAnglePitch += o->oAngleVelPitch;
if (absf_2(o->oMoveAnglePitch & 0x1fff) < 800.0f && o->oAngleVelPitch != 0) {
- PlaySound2(SOUND_GENERAL2_SPINDEL_ROLL);
+ cur_obj_play_sound_2(SOUND_GENERAL2_SPINDEL_ROLL);
}
sp1C = sins(o->oMoveAnglePitch * 4) * 23.0;
diff --git a/src/game/behaviors/spindrift.inc.c b/src/game/behaviors/spindrift.inc.c
@@ -14,17 +14,17 @@ struct ObjectHitbox sSpindriftHitbox = {
void bhv_spindrift_loop(void) {
o->activeFlags |= 0x400;
- if (obj_set_hitbox_and_die_if_attacked(&sSpindriftHitbox, SOUND_OBJ_DYING_ENEMY1, 0))
- obj_change_action(1);
- obj_update_floor_and_walls();
+ if (cur_obj_set_hitbox_and_die_if_attacked(&sSpindriftHitbox, SOUND_OBJ_DYING_ENEMY1, 0))
+ cur_obj_change_action(1);
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case 0:
- func_802A9050(&o->oForwardVel, 4.0f, 1.0f);
- if (obj_lateral_dist_from_mario_to_home() > 1000.0f)
- o->oAngleToMario = obj_angle_to_home();
+ approach_forward_vel(&o->oForwardVel, 4.0f, 1.0f);
+ if (cur_obj_lateral_dist_from_mario_to_home() > 1000.0f)
+ o->oAngleToMario = cur_obj_angle_to_home();
else if (o->oDistanceToMario > 300.0f)
- o->oAngleToMario = angle_to_object(o, gMarioObject);
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ o->oAngleToMario = obj_angle_to_object(o, gMarioObject);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
break;
case 1:
o->oFlags &= ~8;
@@ -36,5 +36,5 @@ void bhv_spindrift_loop(void) {
}
break;
}
- obj_move_standard(-60);
+ cur_obj_move_standard(-60);
}
diff --git a/src/game/behaviors/spiny.inc.c b/src/game/behaviors/spiny.inc.c
@@ -47,7 +47,7 @@ static s32 spiny_check_active(void) {
// It can also be used on a bob-omb respawner to change its model
// to a butterfly or fish.
o->parentObj->oEnemyLakituNumSpinies -= 1;
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
return FALSE;
}
}
@@ -60,10 +60,10 @@ static s32 spiny_check_active(void) {
*/
static void spiny_act_walk(void) {
if (spiny_check_active()) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
o->oGraphYOffset = -17.0f;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
if (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) {
// After touching the ground for the first time, stop. From now on,
@@ -92,15 +92,15 @@ static void spiny_act_walk(void) {
}
}
- obj_rotate_yaw_toward(o->oSpinyTargetYaw, 0x80);
+ cur_obj_rotate_yaw_toward(o->oSpinyTargetYaw, 0x80);
}
} else if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
// Bounce off walls while falling
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
if (obj_handle_attacks(&sSpinyHitbox, SPINY_ACT_ATTACKED_MARIO, sSpinyWalkAttackHandlers)) {
// When attacked by mario, lessen the knockback
@@ -124,7 +124,7 @@ static void spiny_act_walk(void) {
*/
static void spiny_act_held_by_lakitu(void) {
o->oGraphYOffset = 15.0f;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
o->oParentRelativePosX = -50.0f;
o->oParentRelativePosY = 35.0f;
@@ -148,26 +148,26 @@ static void spiny_act_held_by_lakitu(void) {
*/
static void spiny_act_thrown_by_lakitu(void) {
if (spiny_check_active()) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
o->oGraphYOffset = 15.0f;
o->oFaceAnglePitch -= 0x2000;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
if (o->oMoveFlags & OBJ_MOVE_LANDED) {
- PlaySound2(SOUND_OBJ_SPINY_UNK59);
- obj_set_model(MODEL_SPINY);
- func_8029EE20(o, spiny_seg5_anims_05016EAC, 0);
+ cur_obj_play_sound_2(SOUND_OBJ_SPINY_UNK59);
+ cur_obj_set_model(MODEL_SPINY);
+ obj_init_animation_with_sound(o, spiny_seg5_anims_05016EAC, 0);
o->oGraphYOffset = -17.0f;
o->oFaceAnglePitch = 0;
o->oAction = SPINY_ACT_WALK;
} else if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- o->oMoveAngleYaw = obj_reflect_move_angle_off_wall();
+ o->oMoveAngleYaw = cur_obj_reflect_move_angle_off_wall();
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
if (obj_check_attacks(&sSpinyHitbox, o->oAction)) {
if (o->parentObj != o) {
diff --git a/src/game/behaviors/square_platform_cycle.inc.c b/src/game/behaviors/square_platform_cycle.inc.c
@@ -1,6 +1,6 @@
// square_platform_cycle.c.inc
-s32 func_802B02FC(u16 yaw, s32 a) {
+s32 square_plat_set_yaw_until_timer(u16 yaw, s32 a) {
o->oMoveAngleYaw = yaw;
if (a < o->oTimer)
return 1;
@@ -15,24 +15,24 @@ void bhv_squarish_path_moving_loop(void) {
o->oAction = (o->oBehParams2ndByte & 3) + 1;
break;
case 1:
- if (func_802B02FC(0, 60))
+ if (square_plat_set_yaw_until_timer(0, 60))
o->oAction++;
break;
case 2:
- if (func_802B02FC(0x4000, 60))
+ if (square_plat_set_yaw_until_timer(0x4000, 60))
o->oAction++;
break;
case 3:
- if (func_802B02FC(0x8000, 60))
+ if (square_plat_set_yaw_until_timer(0x8000, 60))
o->oAction++;
break;
case 4:
- if (func_802B02FC(0xc000, 60))
+ if (square_plat_set_yaw_until_timer(0xc000, 60))
o->oAction = 1;
break;
default:
break;
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
load_object_collision_model();
}
diff --git a/src/game/behaviors/star_door.inc.c b/src/game/behaviors/star_door.inc.c
@@ -1,6 +1,6 @@
// star_door.c.inc
-void func_802A4DB0(void) {
+void star_door_update_pos(void) {
o->oVelX = (o->oUnkBC) * coss(o->oMoveAngleYaw);
o->oVelZ = (o->oUnkBC) * -sins(o->oMoveAngleYaw);
o->oPosX += o->oVelX;
@@ -10,10 +10,10 @@ void func_802A4DB0(void) {
void bhv_star_door_loop(void) {
UNUSED u8 pad[4];
struct Object *sp18;
- sp18 = obj_nearest_object_with_behavior(bhvStarDoor);
+ sp18 = cur_obj_nearest_object_with_behavior(bhvStarDoor);
switch (o->oAction) {
case 0:
- obj_become_tangible();
+ cur_obj_become_tangible();
if (0x30000 & o->oInteractStatus)
o->oAction = 1;
if (sp18 != NULL && sp18->oAction != 0)
@@ -21,10 +21,10 @@ void bhv_star_door_loop(void) {
break;
case 1:
if (o->oTimer == 0 && (s16)(o->oMoveAngleYaw) >= 0)
- PlaySound2(SOUND_GENERAL_STAR_DOOR_OPEN);
- obj_become_intangible();
+ cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_OPEN);
+ cur_obj_become_intangible();
o->oUnkBC = -8.0f;
- func_802A4DB0();
+ star_door_update_pos();
if (o->oTimer >= 16)
o->oAction++;
break;
@@ -34,9 +34,9 @@ void bhv_star_door_loop(void) {
break;
case 3:
if (o->oTimer == 0 && (s16)(o->oMoveAngleYaw) >= 0)
- PlaySound2(SOUND_GENERAL_STAR_DOOR_CLOSE);
+ cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_CLOSE);
o->oUnkBC = 8.0f;
- func_802A4DB0();
+ star_door_update_pos();
if (o->oTimer >= 16)
o->oAction++;
break;
diff --git a/src/game/behaviors/static_checkered_platform.inc.c b/src/game/behaviors/static_checkered_platform.inc.c
@@ -2,7 +2,7 @@
void bhv_static_checkered_platform_loop(void) {
if (gDebugInfo[5][0] == 1) {
- set_object_angle(o, 0, 0, 0);
+ obj_set_angle(o, 0, 0, 0);
o->oAngleVelPitch = 0;
o->oAngleVelYaw = 0;
o->oAngleVelRoll = 0;
diff --git a/src/game/behaviors/strong_wind_particle.inc.c b/src/game/behaviors/strong_wind_particle.inc.c
@@ -0,0 +1,65 @@
+// strong_wind_particle.c.inc
+
+struct ObjectHitbox sStrongWindParticleHitbox = {
+ /* interactType: */ INTERACT_STRONG_WIND,
+ /* downOffset: */ 0,
+ /* damageOrCoinValue: */ 0,
+ /* health: */ 0,
+ /* numLootCoins: */ 0,
+ /* radius: */ 20,
+ /* height: */ 70,
+ /* hurtboxRadius: */ 20,
+ /* hurtboxHeight: */ 70,
+};
+
+void bhv_strong_wind_particle_loop(void) {
+ struct Object *penguinObj;
+ f32 distanceFromPenguin;
+ f32 penguinXDist, penguinZDist;
+
+ obj_set_hitbox(o, &sStrongWindParticleHitbox);
+
+ if (o->oTimer == 0) {
+ o->oStrongWindParticlePenguinObj = cur_obj_nearest_object_with_behavior(bhvSLWalkingPenguin);
+ obj_translate_xyz_random(o, 100.0f);
+
+ o->oForwardVel = coss(o->oMoveAnglePitch) * 100.0f;
+ o->oVelY = sins(o->oMoveAnglePitch) * -100.0f;
+
+ o->oMoveAngleYaw += random_f32_around_zero(o->oBehParams2ndByte * 500); // Wind spread
+ o->oOpacity = 100;
+ }
+
+ cur_obj_move_using_fvel_and_gravity();
+ if (o->oTimer > 15) // Deactivate after 15 frames
+ obj_mark_for_deletion(o);
+
+ // If collided with the SL walking penguin, deactivate.
+ penguinObj = o->oStrongWindParticlePenguinObj;
+ if (penguinObj != NULL) {
+ penguinXDist = penguinObj->oSLWalkingPenguinWindCollisionXPos - o->oPosX;
+ penguinZDist = penguinObj->oSLWalkingPenguinWindCollisionZPos - o->oPosZ;
+ distanceFromPenguin = sqrtf(penguinXDist * penguinXDist + penguinZDist * penguinZDist);
+ if (distanceFromPenguin < 300.0f) {
+ obj_mark_for_deletion(o);
+ cur_obj_become_intangible();
+ }
+ }
+}
+
+// Spawn particles that blow Mario away and knock his cap off from the current object.
+// Used for the Snowman in SL and Fwoosh.
+void cur_obj_spawn_strong_wind_particles(s32 windSpread, f32 scale, f32 relPosX, f32 relPosY, f32 relPosZ) {
+ // Alternate between tiny particles and regular particles each frame.
+ if ((gGlobalTimer & 1) != 0) {
+ // Because the tiny particles are unimportant objects, invisible wind particles are spawned to provide collision.
+ // There was absolutely no reason to make the smaller particles unimportant, though...
+ spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, 0.5f, o, MODEL_WHITE_PARTICLE_DL, bhvTinyStrongWindParticle);
+ spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, bhvStrongWindParticle);
+ } else
+ spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_MIST, bhvStrongWindParticle);
+ // There is also no need to spawn additional invisible wind particles here.
+ // If the devs were worried about object overload when making small particles unimportant, why spawn these?
+ // It isn't to ensure collision, as even 1 particle every 2 frames is enough to ensure this reliably.
+ spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, bhvStrongWindParticle);
+}
diff --git a/src/game/behaviors/sushi.inc.c b/src/game/behaviors/sushi.inc.c
@@ -12,8 +12,8 @@ void bhv_sushi_shark_loop(void) {
o->oSushiSharkUnkF4 += 0x80;
if (gMarioObject->oPosY - sp1C > -500.0f)
if (o->oPosY - sp1C > -200.0f)
- spawn_object_with_scale(o, MODEL_WATER_WAVES, bhvWaterType, 4.0f);
+ spawn_object_with_scale(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail, 4.0f);
if ((o->oTimer & 0xF) == 0)
- PlaySound2(SOUND_OBJ_SUSHI_SHARK_WATER_SOUND);
+ cur_obj_play_sound_2(SOUND_OBJ_SUSHI_SHARK_WATER_SOUND);
o->oInteractStatus = 0;
}
diff --git a/src/game/behaviors/switch_hidden_objects.inc.c b/src/game/behaviors/switch_hidden_objects.inc.c
@@ -12,7 +12,7 @@ struct ObjectHitbox sBreakableBoxHitbox = {
/* hurtboxHeight: */ 200,
};
-void func_802B0E74(void) {
+void breakable_box_init(void) {
o->oHiddenObjectUnkF4 = NULL;
o->oAnimState = 1;
switch (o->oBehParams2ndByte) {
@@ -26,42 +26,42 @@ void func_802B0E74(void) {
o->oNumLootCoins = 5;
break;
case 3:
- obj_scale(1.5f);
+ cur_obj_scale(1.5f);
break;
}
}
-void func_802B0F54(void) {
+void hidden_breakable_box_actions(void) {
struct Object *sp1C;
- set_object_hitbox(o, &sBreakableBoxHitbox);
- obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
+ obj_set_hitbox(o, &sBreakableBoxHitbox);
+ cur_obj_set_model(MODEL_BREAKABLE_BOX_SMALL);
if (o->oAction == 0) {
- obj_disable_rendering();
- obj_become_intangible();
+ cur_obj_disable_rendering();
+ cur_obj_become_intangible();
if (o->oTimer == 0)
- func_802B0E74();
+ breakable_box_init();
if (o->oHiddenObjectUnkF4 == NULL)
- o->oHiddenObjectUnkF4 = obj_nearest_object_with_behavior(bhvFloorSwitchHiddenObjects);
+ o->oHiddenObjectUnkF4 = cur_obj_nearest_object_with_behavior(bhvFloorSwitchHiddenObjects);
if ((sp1C = o->oHiddenObjectUnkF4) != NULL)
if (sp1C->oAction == 2) {
o->oAction++;
- obj_enable_rendering();
- obj_unhide();
+ cur_obj_enable_rendering();
+ cur_obj_unhide();
}
} else if (o->oAction == 1) {
- obj_become_tangible();
- if (obj_wait_then_blink(360, 20))
+ cur_obj_become_tangible();
+ if (cur_obj_wait_then_blink(360, 20))
o->oAction = 0;
- if (obj_was_attacked_or_ground_pounded()) {
- func_802A3004();
+ if (cur_obj_was_attacked_or_ground_pounded()) {
+ spawn_mist_particles();
spawn_triangle_break_particles(30, 138, 3.0f, 4);
o->oAction++;
- PlaySound2(SOUND_GENERAL_BREAK_BOX);
+ cur_obj_play_sound_2(SOUND_GENERAL_BREAK_BOX);
}
load_object_collision_model();
} else {
- obj_become_intangible();
- obj_disable_rendering();
+ cur_obj_become_intangible();
+ cur_obj_disable_rendering();
o->oInteractStatus = 0;
if ((sp1C = o->oHiddenObjectUnkF4) != NULL)
if (sp1C->oAction == 0)
@@ -69,23 +69,23 @@ void func_802B0F54(void) {
}
}
-void func_802B1138(void) {
+void hidden_unbreakable_box_actions(void) {
struct Object *sp1C;
- set_object_collision_data(o, wdw_seg7_collision_07018528);
+ obj_set_collision_data(o, wdw_seg7_collision_07018528);
if (o->oAction == 0) {
- obj_disable_rendering();
- obj_become_intangible();
+ cur_obj_disable_rendering();
+ cur_obj_become_intangible();
if (o->oHiddenObjectUnkF4 == NULL)
- o->oHiddenObjectUnkF4 = obj_nearest_object_with_behavior(bhvFloorSwitchHiddenObjects);
+ o->oHiddenObjectUnkF4 = cur_obj_nearest_object_with_behavior(bhvFloorSwitchHiddenObjects);
if ((sp1C = o->oHiddenObjectUnkF4) != NULL)
if (sp1C->oAction == 2) {
o->oAction++;
- obj_enable_rendering();
- obj_unhide();
+ cur_obj_enable_rendering();
+ cur_obj_unhide();
}
} else {
- obj_become_tangible();
- if (obj_wait_then_blink(360, 20))
+ cur_obj_become_tangible();
+ if (cur_obj_wait_then_blink(360, 20))
o->oAction = 0;
load_object_collision_model();
}
@@ -93,7 +93,7 @@ void func_802B1138(void) {
void bhv_hidden_object_loop(void) {
if (o->oBehParams2ndByte == 0)
- func_802B0F54(); // Confused, that function has code depending on the action
+ hidden_breakable_box_actions(); // Confused, that function has code depending on the action
else
- func_802B1138();
+ hidden_unbreakable_box_actions();
}
diff --git a/src/game/behaviors/swoop.inc.c b/src/game/behaviors/swoop.inc.c
@@ -24,11 +24,11 @@ static struct ObjectHitbox sSwoopHitbox = {
* toward him and enter the move action.
*/
static void swoop_act_idle(void) {
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
if (approach_f32_ptr(&o->header.gfx.scale[0], 1.0f, 0.05f) && o->oDistanceToMario < 1500.0f) {
- if (obj_rotate_yaw_toward(o->oAngleToMario, 800)) {
- PlaySound2(SOUND_OBJ2_SWOOP);
+ if (cur_obj_rotate_yaw_toward(o->oAngleToMario, 800)) {
+ cur_obj_play_sound_2(SOUND_OBJ2_SWOOP);
o->oAction = SWOOP_ACT_MOVE;
o->oVelY = -12.0f;
}
@@ -42,9 +42,9 @@ static void swoop_act_idle(void) {
* him. Return to home once mario is far away.
*/
static void swoop_act_move(void) {
- func_8029ED98(0, 2.0f);
- if (func_8029F788()) {
- PlaySound2(SOUND_OBJ_UNKNOWN6);
+ cur_obj_init_animation_with_accel_and_sound(0, 2.0f);
+ if (cur_obj_check_if_near_animation_end()) {
+ cur_obj_play_sound_2(SOUND_OBJ_UNKNOWN6);
}
if (o->oForwardVel == 0.0f) {
@@ -53,10 +53,10 @@ static void swoop_act_move(void) {
o->oForwardVel = 10.0f;
o->oVelY = -10.0f;
}
- } else if (obj_mario_far_away()) {
+ } else if (cur_obj_mario_far_away()) {
// If mario far away, reset
o->oAction = SWOOP_ACT_IDLE;
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->header.gfx.scale[0] = o->oForwardVel = o->oVelY = 0.0f;
o->oFaceAngleRoll = 0;
} else {
@@ -75,7 +75,7 @@ static void swoop_act_move(void) {
}
} else if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
// Bounce off a wall and don't bounce again for 30 frames.
- o->oSwoopTargetYaw = obj_reflect_move_angle_off_wall();
+ o->oSwoopTargetYaw = cur_obj_reflect_move_angle_off_wall();
o->oSwoopBonkCountdown = 30;
}
@@ -86,7 +86,7 @@ static void swoop_act_move(void) {
obj_move_pitch_approach(o->oSwoopTargetPitch, 140);
// Jitter yaw a bit
- obj_rotate_yaw_toward(o->oSwoopTargetYaw + (s32)(3000 * coss(4000 * gGlobalTimer)), 1200);
+ cur_obj_rotate_yaw_toward(o->oSwoopTargetYaw + (s32)(3000 * coss(4000 * gGlobalTimer)), 1200);
obj_roll_to_match_yaw_turn(o->oSwoopTargetYaw, 0x3000, 500);
// Jitter roll a bit
@@ -103,7 +103,7 @@ void bhv_swoop_update(void) {
if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
o->oDeathSound = SOUND_OBJ_SWOOP_DEATH;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case SWOOP_ACT_IDLE:
@@ -114,8 +114,8 @@ void bhv_swoop_update(void) {
break;
}
- obj_scale(o->header.gfx.scale[0]);
- obj_move_standard(78);
+ cur_obj_scale(o->header.gfx.scale[0]);
+ cur_obj_move_standard(78);
obj_check_attacks(&sSwoopHitbox, o->oAction);
}
diff --git a/src/game/behaviors/thi_top.inc.c b/src/game/behaviors/thi_top.inc.c
@@ -10,7 +10,7 @@ void bhv_thi_huge_island_top_loop(void) {
if (gTHIWaterDrained & 1) {
if (o->oTimer == 0)
gEnvironmentRegions[18] = 3000;
- obj_hide();
+ cur_obj_hide();
} else
load_object_collision_model();
}
@@ -21,15 +21,15 @@ void bhv_thi_tiny_island_top_loop(void) {
if (o->oDistanceToMario < 500.0f)
if (gMarioStates->action == ACT_GROUND_POUND_LAND) {
o->oAction++;
- obj_spawn_particles(&D_8032F134);
+ cur_obj_spawn_particles(&D_8032F134);
spawn_triangle_break_particles(20, 138, 0.3f, 3);
- PlaySound2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);
- obj_hide();
+ cur_obj_play_sound_2(SOUND_GENERAL_ACTIVATE_CAP_SWITCH);
+ cur_obj_hide();
}
} else {
if (o->oTimer < 50) {
gEnvironmentRegions[18]--;
- PlaySound(SOUND_ENV_WATER_DRAIN);
+ cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN);
} else {
gTHIWaterDrained |= 1;
play_puzzle_jingle();
@@ -39,6 +39,6 @@ void bhv_thi_tiny_island_top_loop(void) {
} else {
if (o->oTimer == 0)
gEnvironmentRegions[18] = 700;
- obj_hide();
+ cur_obj_hide();
}
}
diff --git a/src/game/behaviors/thwomp.inc.c b/src/game/behaviors/thwomp.inc.c
@@ -1,13 +1,13 @@
// thwomp.c.inc
-void ActionGrindelThwomp4(void) {
+void grindel_thwomp_act_4(void) {
if (o->oTimer == 0)
o->oThwompUnkF4 = RandomFloat() * 10.0f + 20.0f;
if (o->oTimer > o->oThwompUnkF4)
o->oAction = 0;
}
-void ActionGrindelThwomp2(void) {
+void grindel_thwomp_act_2(void) {
o->oVelY += -4.0f;
o->oPosY += o->oVelY;
if (o->oPosY < o->oHomeY) {
@@ -17,24 +17,24 @@ void ActionGrindelThwomp2(void) {
}
}
-void ActionGrindelThwomp3(void) {
+void grindel_thwomp_act_3(void) {
if (o->oTimer == 0)
if (o->oDistanceToMario < 1500.0f) {
- ShakeScreen(SHAKE_POS_SMALL);
- PlaySound2(SOUND_OBJ_THWOMP);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_OBJ_THWOMP);
}
if (o->oTimer > 9)
o->oAction = 4;
}
-void ActionGrindelThwomp1(void) {
+void grindel_thwomp_act_1(void) {
if (o->oTimer == 0)
o->oThwompUnkF4 = RandomFloat() * 30.0f + 10.0f;
if (o->oTimer > o->oThwompUnkF4)
o->oAction = 2;
}
-void ActionGrindelThwomp0(void) {
+void grindel_thwomp_act_0(void) {
if (o->oBehParams2ndByte + 40 < o->oTimer) {
o->oAction = 1;
o->oPosY += 5.0f;
@@ -42,10 +42,10 @@ void ActionGrindelThwomp0(void) {
o->oPosY += 10.0f;
}
-void (*sGrindelThwompActions[])(void) = { ActionGrindelThwomp0, ActionGrindelThwomp1,
- ActionGrindelThwomp2, ActionGrindelThwomp3,
- ActionGrindelThwomp4 };
+void (*sGrindelThwompActions[])(void) = { grindel_thwomp_act_0, grindel_thwomp_act_1,
+ grindel_thwomp_act_2, grindel_thwomp_act_3,
+ grindel_thwomp_act_4 };
void bhv_grindel_thwomp_loop(void) {
- obj_call_action_function(sGrindelThwompActions);
+ cur_obj_call_action_function(sGrindelThwompActions);
}
diff --git a/src/game/behaviors/tower_door.inc.c b/src/game/behaviors/tower_door.inc.c
@@ -3,8 +3,8 @@
void bhv_tower_door_loop(void) {
if (o->oTimer == 0)
o->oMoveAngleYaw -= 0x4000;
- if (func_802A9A0C(0)) {
- func_802A3C98(80.0f, 0);
+ if (check_mario_attacking(0)) {
+ obj_explode_and_spawn_coins(80.0f, 0);
create_sound_spawner(SOUND_GENERAL_WALL_EXPLOSION);
}
}
diff --git a/src/game/behaviors/tower_platform.inc.c b/src/game/behaviors/tower_platform.inc.c
@@ -2,7 +2,7 @@
void bhv_wf_solid_tower_platform_loop(void) {
if (o->parentObj->oAction == 3)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_wf_elevator_tower_platform_loop(void) {
@@ -12,7 +12,7 @@ void bhv_wf_elevator_tower_platform_loop(void) {
o->oAction++;
break;
case 1:
- PlaySound(SOUND_ENV_ELEVATOR1);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR1);
if (o->oTimer > 140)
o->oAction++;
else
@@ -23,7 +23,7 @@ void bhv_wf_elevator_tower_platform_loop(void) {
o->oAction++;
break;
case 3:
- PlaySound(SOUND_ENV_ELEVATOR1);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR1);
if (o->oTimer > 140)
o->oAction = 0;
else
@@ -31,7 +31,7 @@ void bhv_wf_elevator_tower_platform_loop(void) {
break;
}
if (o->parentObj->oAction == 3)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_wf_sliding_tower_platform_loop(void) {
@@ -48,14 +48,14 @@ void bhv_wf_sliding_tower_platform_loop(void) {
o->oForwardVel = o->oPlatformUnk10C;
break;
}
- obj_compute_vel_xz();
+ cur_obj_compute_vel_xz();
o->oPosX += o->oVelX;
o->oPosZ += o->oVelZ;
if (o->parentObj->oAction == 3)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void func_802AF9A4(s16 a, const BehaviorScript *beh) {
+void spawn_and_init_wf_platforms(s16 a, const BehaviorScript *beh) {
s16 yaw;
struct Object *platform = spawn_object(o, a, beh);
yaw = o->oPlatformSpawnerUnkF4 * o->oPlatformSpawnerUnkFC + o->oPlatformSpawnerUnkF8;
@@ -68,7 +68,7 @@ void func_802AF9A4(s16 a, const BehaviorScript *beh) {
o->oPlatformSpawnerUnkF4++;
}
-void func_802AFAFC(void) {
+void spawn_wf_platform_group(void) {
UNUSED s32 unused = 8;
o->oPlatformSpawnerUnkF4 = 0;
o->oPlatformSpawnerUnkF8 = 0;
@@ -76,14 +76,14 @@ void func_802AFAFC(void) {
o->oPlatformSpawnerUnk100 = 704.0f;
o->oPlatformSpawnerUnk104 = 380.0f;
o->oPlatformSpawnerUnk108 = 3.0f;
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
- func_802AF9A4(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR, bhvWfElevatorTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSlidingTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM, bhvWfSolidTowerPlatform);
+ spawn_and_init_wf_platforms(MODEL_WF_TOWER_SQUARE_PLATORM_ELEVATOR, bhvWfElevatorTowerPlatform);
}
void bhv_tower_platform_group_loop(void) {
@@ -95,7 +95,7 @@ void bhv_tower_platform_group_loop(void) {
o->oAction++;
break;
case 1:
- func_802AFAFC();
+ spawn_wf_platform_group();
o->oAction++;
break;
case 2:
diff --git a/src/game/behaviors/tox_box.inc.c b/src/game/behaviors/tox_box.inc.c
@@ -8,12 +8,12 @@ s8 D_8032F948[] = { 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 5, 1, 5, 1, 5, 1, 5,
1, 5, 1, 7, 1, 2, 6, 1, 6, 1, 5, 1, 2, 4, 1, 7, 1, -1 };
s8 *D_8032F96C[] = { D_8032F8F0, D_8032F924, D_8032F948 };
-void func_802BCF78(void) {
+void tox_box_shake_screen(void) {
if (o->oDistanceToMario < 3000.0f)
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
}
-void func_802BCFC4(f32 a0, f32 a1, s16 a2, s16 a3) // 0x18 0x1c 0x22 0x26
+void tox_box_move(f32 a0, f32 a1, s16 a2, s16 a3) // 0x18 0x1c 0x22 0x26
{
o->oPosY = 99.41124 * sins((f32)(o->oTimer + 1) / 8 * 0x8000) + o->oHomeY + 3.0f;
o->oForwardVel = a0;
@@ -22,58 +22,58 @@ void func_802BCFC4(f32 a0, f32 a1, s16 a2, s16 a3) // 0x18 0x1c 0x22 0x26
if ((s16) o->oFaceAnglePitch < 0)
a3 = -a3;
o->oFaceAngleRoll += a3;
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
if (o->oTimer == 7) {
- o->oAction = func_802A32E0();
+ o->oAction = cur_obj_progress_direction_table();
#ifndef VERSION_JP
- PlaySound2(SOUND_GENERAL_UNK46);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNK46);
#else
- PlaySound2(SOUND_GENERAL_UNK46_LOWPRIO);
+ cur_obj_play_sound_2(SOUND_GENERAL_UNK46_LOWPRIO);
#endif
}
}
-void ActionToxBox4(void) {
- func_802BCFC4(64.0f, 0.0f, 0x800, 0);
+void tox_box_act_4(void) {
+ tox_box_move(64.0f, 0.0f, 0x800, 0);
}
-void ActionToxBox5(void) {
- func_802BCFC4(-64.0f, 0.0f, -0x800, 0);
+void tox_box_act_5(void) {
+ tox_box_move(-64.0f, 0.0f, -0x800, 0);
}
-void ActionToxBox6(void) {
- func_802BCFC4(0.0f, -64.0f, 0, 0x800);
+void tox_box_act_6(void) {
+ tox_box_move(0.0f, -64.0f, 0, 0x800);
}
-void ActionToxBox7(void) {
- func_802BCFC4(0.0f, 64.0f, 0, -0x800);
+void tox_box_act_7(void) {
+ tox_box_move(0.0f, 64.0f, 0, -0x800);
}
-void ActionToxBox1(void) {
+void tox_box_act_1(void) {
o->oForwardVel = 0.0f;
if (o->oTimer == 0)
- func_802BCF78();
+ tox_box_shake_screen();
o->oPosY = o->oHomeY + 3.0f;
if (o->oTimer == 20)
- o->oAction = func_802A32E0();
+ o->oAction = cur_obj_progress_direction_table();
}
-void ActionToxBox2(void) {
+void tox_box_act_2(void) {
if (o->oTimer == 20)
- o->oAction = func_802A32E0();
+ o->oAction = cur_obj_progress_direction_table();
}
-void ActionToxBox3(void) {
+void tox_box_act_3(void) {
if (o->oTimer == 20)
- o->oAction = func_802A32E0();
+ o->oAction = cur_obj_progress_direction_table();
}
-void ActionToxBox0(void) {
+void tox_box_act_0(void) {
s8 *sp1C = D_8032F96C[o->oBehParams2ndByte];
- o->oAction = func_802A32A4(sp1C);
+ o->oAction = cur_obj_set_direction_table(sp1C);
}
-void (*sToxBoxActions[])(void) = { ActionToxBox0, ActionToxBox1, ActionToxBox2, ActionToxBox3,
- ActionToxBox4, ActionToxBox5, ActionToxBox6, ActionToxBox7 };
+void (*sToxBoxActions[])(void) = { tox_box_act_0, tox_box_act_1, tox_box_act_2, tox_box_act_3,
+ tox_box_act_4, tox_box_act_5, tox_box_act_6, tox_box_act_7 };
void bhv_tox_box_loop(void) {
- obj_call_action_function(sToxBoxActions);
+ cur_obj_call_action_function(sToxBoxActions);
load_object_collision_model();
}
diff --git a/src/game/behaviors/treasure_chest.inc.c b/src/game/behaviors/treasure_chest.inc.c
@@ -59,7 +59,7 @@ void bhv_treasure_chest_top_loop(void) {
void bhv_treasure_chest_bottom_init(void) {
spawn_object_relative(0, 0, 102, -77, o, MODEL_TREASURE_CHEST_LID, bhvTreasureChestTop);
- set_object_hitbox(o, &sTreasureChestBottomHitbox);
+ obj_set_hitbox(o, &sTreasureChestBottomHitbox);
}
void bhv_treasure_chest_bottom_loop(void) {
@@ -76,7 +76,7 @@ void bhv_treasure_chest_bottom_loop(void) {
o->parentObj->oTreasureChestUnkF4 = 1;
o->parentObj->oTreasureChestUnkF8 = 1;
o->oAction = 2;
- obj_become_tangible();
+ cur_obj_become_tangible();
play_sound(SOUND_MENU_CAMERA_BUZZ, gDefaultSoundArgs);
}
}
@@ -90,18 +90,18 @@ void bhv_treasure_chest_bottom_loop(void) {
break;
case 2:
- obj_become_intangible();
+ cur_obj_become_intangible();
if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 500)) {
o->parentObj->oTreasureChestUnkF8 = 0;
o->oAction = 0;
}
}
- obj_push_mario_away_from_cylinder(150.0f, 150.0f);
+ cur_obj_push_mario_away_from_cylinder(150.0f, 150.0f);
o->oInteractStatus = 0;
}
-void func_802F6E8C(s8 sp3B, s32 sp3C, s32 sp40, s32 sp44, s16 sp4A) {
+void spawn_treasure_chest(s8 sp3B, s32 sp3C, s32 sp40, s32 sp44, s16 sp4A) {
struct Object *sp34;
sp34 = spawn_object_abs_with_rot(o, 0, MODEL_TREASURE_CHEST_BASE, bhvTreasureChestBottom, sp3C,
sp40, sp44, 0, sp4A, 0);
@@ -109,10 +109,10 @@ void func_802F6E8C(s8 sp3B, s32 sp3C, s32 sp40, s32 sp44, s16 sp4A) {
}
void bhv_treasure_chest_ship_init(void) {
- func_802F6E8C(1, 400, -350, -2700, 0);
- func_802F6E8C(2, 650, -350, -940, -0x6001);
- func_802F6E8C(3, -550, -350, -770, 0x5FFF);
- func_802F6E8C(4, 100, -350, -1700, 0);
+ spawn_treasure_chest(1, 400, -350, -2700, 0);
+ spawn_treasure_chest(2, 650, -350, -940, -0x6001);
+ spawn_treasure_chest(3, -550, -350, -770, 0x5FFF);
+ spawn_treasure_chest(4, 100, -350, -1700, 0);
o->oTreasureChestUnkF4 = 1;
o->oTreasureChestUnkFC = 0;
}
@@ -142,10 +142,10 @@ void bhv_treasure_chest_ship_loop(void) {
}
void bhv_treasure_chest_jrb_init(void) {
- func_802F6E8C(1, -1700, -2812, -1150, 0x7FFF);
- func_802F6E8C(2, -1150, -2812, -1550, 0x7FFF);
- func_802F6E8C(3, -2400, -2812, -1800, 0x7FFF);
- func_802F6E8C(4, -1800, -2812, -2100, 0x7FFF);
+ spawn_treasure_chest(1, -1700, -2812, -1150, 0x7FFF);
+ spawn_treasure_chest(2, -1150, -2812, -1550, 0x7FFF);
+ spawn_treasure_chest(3, -2400, -2812, -1800, 0x7FFF);
+ spawn_treasure_chest(4, -1800, -2812, -2100, 0x7FFF);
o->oTreasureChestUnkF4 = 1;
o->oTreasureChestUnkFC = 1;
}
@@ -161,8 +161,8 @@ void bhv_treasure_chest_jrb_loop(void) {
case 1:
if (o->oTimer == 60) {
- func_802A3004();
- create_star(-1800.0f, -2500.0f, -1700.0f);
+ spawn_mist_particles();
+ spawn_default_star(-1800.0f, -2500.0f, -1700.0f);
o->oAction = 2;
}
break;
@@ -173,10 +173,10 @@ void bhv_treasure_chest_jrb_loop(void) {
}
void bhv_treasure_chest_init(void) {
- func_802F6E8C(1, -4500, -5119, 1300, -0x6001);
- func_802F6E8C(2, -1800, -5119, 1050, 0x1FFF);
- func_802F6E8C(3, -4500, -5119, -1100, 9102);
- func_802F6E8C(4, -2400, -4607, 125, 16019);
+ spawn_treasure_chest(1, -4500, -5119, 1300, -0x6001);
+ spawn_treasure_chest(2, -1800, -5119, 1050, 0x1FFF);
+ spawn_treasure_chest(3, -4500, -5119, -1100, 9102);
+ spawn_treasure_chest(4, -2400, -4607, 125, 16019);
o->oTreasureChestUnkF4 = 1;
o->oTreasureChestUnkFC = 0;
@@ -193,8 +193,8 @@ void bhv_treasure_chest_loop(void) {
case 1:
if (o->oTimer == 60) {
- func_802A3004();
- create_star(-1900.0f, -4000.0f, -1400.0f);
+ spawn_mist_particles();
+ spawn_default_star(-1900.0f, -4000.0f, -1400.0f);
o->oAction = 2;
}
break;
diff --git a/src/game/behaviors/tree_particles.inc.c b/src/game/behaviors/tree_particles.inc.c
@@ -1,7 +1,7 @@
// tree_particles.c.inc
void bhv_tree_snow_or_leaf_loop(void) {
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (o->oTimer == 0) {
o->oAngleVelPitch = (RandomFloat() - 0.5) * 0x1000;
o->oAngleVelRoll = (RandomFloat() - 0.5) * 0x1000;
@@ -9,13 +9,13 @@ void bhv_tree_snow_or_leaf_loop(void) {
o->oTreeSnowOrLeafUnkFC = RandomFloat() * 0x400 + 0x600;
}
if (o->oPosY < o->oFloorHeight)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oFloorHeight < -11000.0f)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oTimer > 100)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (gPrevFrameObjectCount > 212)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oFaceAnglePitch += o->oAngleVelPitch;
o->oFaceAngleRoll += o->oAngleVelRoll;
o->oVelY += -3.0f;
@@ -46,7 +46,7 @@ void bhv_snow_leaf_particle_spawn_init(void) {
if (RandomFloat() < 0.5) {
obj = spawn_object(o, MODEL_WHITE_PARTICLE_DL, bhvTreeSnow);
scale = RandomFloat();
- scale_object_xyz(obj, scale, scale, scale);
+ obj_scale_xyz(obj, scale, scale, scale);
obj->oMoveAngleYaw = RandomU16();
obj->oForwardVel = RandomFloat() * 5.0f;
obj->oVelY = RandomFloat() * 15.0f;
@@ -55,7 +55,7 @@ void bhv_snow_leaf_particle_spawn_init(void) {
if (RandomFloat() < 0.3) {
obj = spawn_object(o, MODEL_LEAVES, bhvTreeLeaf);
scale = RandomFloat() * 3.0f;
- scale_object_xyz(obj, scale, scale, scale);
+ obj_scale_xyz(obj, scale, scale, scale);
obj->oMoveAngleYaw = RandomU16();
obj->oForwardVel = RandomFloat() * 5.0f + 5.0f;
obj->oVelY = RandomFloat() * 15.0f;
diff --git a/src/game/behaviors/triplet_butterfly.inc.c b/src/game/behaviors/triplet_butterfly.inc.c
@@ -49,17 +49,17 @@ static void triplet_butterfly_act_init(void) {
o->oMoveAngleYaw = (s32)(o->oTripletButterflyBaseYaw + random_linear_offset(0, 0x5555));
o->oTripletButterflySpeed = random_linear_offset(15, 15);
- obj_unhide();
+ cur_obj_unhide();
}
}
static void triplet_butterfly_act_wander(void) {
if (o->oDistanceToMario > 1500.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
approach_f32_ptr(&o->oTripletButterflySpeed, 8.0f, 0.5f);
if (o->oTimer < 60) {
- o->oTripletButterflyTargetYaw = obj_angle_to_home();
+ o->oTripletButterflyTargetYaw = cur_obj_angle_to_home();
} else {
o->oTripletButterflyTargetYaw = (s32) o->oTripletButterflyBaseYaw;
@@ -81,7 +81,7 @@ static void triplet_butterfly_act_wander(void) {
}
obj_move_pitch_approach(o->oTripletButterflyTargetPitch, 400);
- obj_rotate_yaw_toward(o->oTripletButterflyTargetYaw, random_linear_offset(400, 800));
+ cur_obj_rotate_yaw_toward(o->oTripletButterflyTargetYaw, random_linear_offset(400, 800));
}
}
@@ -90,7 +90,7 @@ static void triplet_butterfly_act_activate(void) {
if (o->oTripletButterflyModel == 0) {
spawn_object_relative_with_scale(0, 0, -40, 0, 1.5f, o, MODEL_SMOKE, bhvWhitePuffSmoke2);
o->oTripletButterflyModel = sTripletButterflyActivationData[o->oTripletButterflyType].model;
- obj_set_model(o->oTripletButterflyModel);
+ cur_obj_set_model(o->oTripletButterflyModel);
obj_set_billboard(o);
o->oTripletButterflyScale = 0.0f;
o->oHomeY = o->oPosY;
@@ -99,7 +99,7 @@ static void triplet_butterfly_act_activate(void) {
if (o->oTripletButterflyType != TRIPLET_BUTTERFLY_TYPE_EXPLODES) {
spawn_object(o, o->oTripletButterflyModel,
sTripletButterflyActivationData[o->oTripletButterflyType].behavior);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->oAction = TRIPLET_BUTTERFLY_ACT_EXPLODE;
o->oWallHitboxRadius = 100.0f;
@@ -123,7 +123,7 @@ static void triplet_butterfly_act_explode(void) {
if (o->oAction == -1 || (o->oMoveFlags & 0x00000200) || o->oTimer >= 158) {
o->oPosY += o->oGraphYOffset;
spawn_object(o, MODEL_EXPLOSION, bhvExplosion);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
if (o->oTimer > 120) {
scaleIncrease = 0.04f * coss(o->oTripletButterflyScalePhase);
@@ -138,13 +138,13 @@ static void triplet_butterfly_act_explode(void) {
}
approach_f32_ptr(&o->oTripletButterflySpeed, 20.0f, 1.0f);
- obj_rotate_yaw_toward(o->oAngleToMario, 800);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 800);
obj_turn_pitch_toward_mario(-100.0f, 800);
}
}
void bhv_triplet_butterfly_update(void) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case TRIPLET_BUTTERFLY_ACT_INIT:
@@ -161,7 +161,7 @@ void bhv_triplet_butterfly_update(void) {
break;
}
- obj_scale(o->oTripletButterflyScale);
+ cur_obj_scale(o->oTripletButterflyScale);
obj_compute_vel_from_move_pitch(o->oTripletButterflySpeed);
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
diff --git a/src/game/behaviors/ttc_elevator.inc.c b/src/game/behaviors/ttc_elevator.inc.c
@@ -43,7 +43,7 @@ void bhv_ttc_elevator_update(void) {
}
// This is basically equivalent to posY += velY
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
// Flip directions if the elevator tries to run away
if (clamp_f32(&o->oPosY, o->oHomeY, o->oTTCElevatorPeakY)) {
diff --git a/src/game/behaviors/ttc_pendulum.inc.c b/src/game/behaviors/ttc_pendulum.inc.c
@@ -36,7 +36,7 @@ void bhv_ttc_pendulum_update(void) {
// Play sound
if (o->oTTCPendulumSoundTimer != 0) {
if (--o->oTTCPendulumSoundTimer == 0) {
- PlaySound2(SOUND_GENERAL_PENDULUM_SWING);
+ cur_obj_play_sound_2(SOUND_GENERAL_PENDULUM_SWING);
}
}
diff --git a/src/game/behaviors/ttc_pit_block.inc.c b/src/game/behaviors/ttc_pit_block.inc.c
@@ -53,7 +53,7 @@ void bhv_ttc_pit_block_init(void) {
void bhv_ttc_pit_block_update(void) {
if (o->oTimer > o->oTTCPitBlockWaitTime) {
// Forward vel and gravity are zero, so this just does posY += velY
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (clamp_f32(&o->oPosY, o->oHomeY, o->oTTCPitBlockPeakY)) {
o->oTTCPitBlockDir = o->oTTCPitBlockDir ^ 0x1;
diff --git a/src/game/behaviors/ttc_rotating_solid.inc.c b/src/game/behaviors/ttc_rotating_solid.inc.c
@@ -43,7 +43,7 @@ void bhv_ttc_rotating_solid_update(void) {
if (o->oTTCRotatingSolidSoundTimer != 0) {
// 3. Play a sound after 6 frames
if (--o->oTTCRotatingSolidSoundTimer == 0) {
- PlaySound2(SOUND_GENERAL2_ROTATING_BLOCK_ALERT);
+ cur_obj_play_sound_2(SOUND_GENERAL2_ROTATING_BLOCK_ALERT);
}
} else if (o->oTTCRotatingSolidVelY > 0.0f && o->oPosY >= o->oHomeY) {
// 4. Rotate
@@ -55,7 +55,7 @@ void bhv_ttc_rotating_solid_update(void) {
o->oAngleVelRoll = o->oFaceAngleRoll - startRoll;
if (o->oAngleVelRoll == 0) {
- PlaySound2(SOUND_GENERAL2_ROTATING_BLOCK_CLICK);
+ cur_obj_play_sound_2(SOUND_GENERAL2_ROTATING_BLOCK_CLICK);
o->oTTCRotatingSolidNumTurns =
(o->oTTCRotatingSolidNumTurns + 1) % o->oTTCRotatingSolidNumSides;
diff --git a/src/game/behaviors/ttc_treadmill.inc.c b/src/game/behaviors/ttc_treadmill.inc.c
@@ -36,13 +36,13 @@ void bhv_ttc_treadmill_init(void) {
}
/**
- * Update function for bhvTTCTreadmill. It calls obj_compute_vel_xz afterward.
+ * Update function for bhvTTCTreadmill. It calls cur_obj_compute_vel_xz afterward.
*/
void bhv_ttc_treadmill_update(void) {
if (sMasterTreadmill == o || sMasterTreadmill == NULL) {
sMasterTreadmill = o;
- PlaySound(SOUND_ENV_ELEVATOR2);
+ cur_obj_play_sound_1(SOUND_ENV_ELEVATOR2);
if (gTTCSpeedSetting == TTC_SPEED_RANDOM) {
// Stay still for 5 frames, then accelerate toward the target speed
diff --git a/src/game/behaviors/tumbling_bridge.inc.c b/src/game/behaviors/tumbling_bridge.inc.c
@@ -21,10 +21,10 @@ void bhv_tumbling_bridge_platform_loop(void) {
}
break;
case 1:
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (o->oTimer > 5) {
o->oAction++;
- PlaySound2(SOUND_GENERAL_PLATFORM);
+ cur_obj_play_sound_2(SOUND_GENERAL_PLATFORM);
}
break;
case 2:
@@ -33,8 +33,8 @@ void bhv_tumbling_bridge_platform_loop(void) {
if (o->oAngleVelRoll > -0x400 && o->oAngleVelRoll < 0x400)
o->oAngleVelRoll += o->oTumblingBridgeUnkF4; // acceleration?
o->oGravity = -3.0f;
- obj_rotate_face_angle_using_vel();
- obj_move_using_fvel_and_gravity();
+ cur_obj_rotate_face_angle_using_vel();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oPosY < o->oFloorHeight - 300.0f)
o->oAction++;
break;
@@ -42,10 +42,10 @@ void bhv_tumbling_bridge_platform_loop(void) {
break;
}
if (o->parentObj->oAction == 3)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void ActionTumblingBridge1(void) {
+void tumbling_bridge_act_1(void) {
struct Object *platformObj;
s32 i;
s32 bridgeID = o->oBehParams2ndByte;
@@ -65,7 +65,7 @@ void ActionTumblingBridge1(void) {
relativePlatformZ = sTumblingBridgeParams[bridgeID].bridgeRelativeStartingXorZ
+ sTumblingBridgeParams[bridgeID].platformWidth * i;
- if (obj_has_behavior(bhvLllTumblingBridge)) {
+ if (cur_obj_has_behavior(bhvLllTumblingBridge)) {
if (i % 3 == 0)
relativePlatformY -= 150;
relativeInitialPlatformY = 450;
@@ -75,38 +75,38 @@ void ActionTumblingBridge1(void) {
0, relativePlatformX, relativePlatformY + relativeInitialPlatformY, relativePlatformZ, o,
sTumblingBridgeParams[bridgeID].model, bhvTumblingBridgePlatform);
- set_object_collision_data(platformObj, sTumblingBridgeParams[bridgeID].segAddr);
+ obj_set_collision_data(platformObj, sTumblingBridgeParams[bridgeID].segAddr);
}
o->oAction = 2;
}
-void ActionTumblingBridge2(void) {
- obj_hide();
- if (obj_has_behavior(bhvLllTumblingBridge))
- obj_unhide();
+void tumbling_bridge_act_2(void) {
+ cur_obj_hide();
+ if (cur_obj_has_behavior(bhvLllTumblingBridge))
+ cur_obj_unhide();
else if (o->oDistanceToMario > 1200.0f) {
o->oAction = 3;
- obj_unhide();
+ cur_obj_unhide();
}
}
-void ActionTumblingBridge3(void) {
- obj_unhide();
+void tumbling_bridge_act_3(void) {
+ cur_obj_unhide();
o->oAction = 0;
}
-void ActionTumblingBridge0(void) {
- if (obj_has_behavior(bhvLllTumblingBridge) || o->oDistanceToMario < 1000.0f)
+void tumbling_bridge_act_0(void) {
+ if (cur_obj_has_behavior(bhvLllTumblingBridge) || o->oDistanceToMario < 1000.0f)
o->oAction = 1;
}
-void (*sTumblingBridgeActions[])(void) = { ActionTumblingBridge0, ActionTumblingBridge1,
- ActionTumblingBridge2, ActionTumblingBridge3 };
+void (*sTumblingBridgeActions[])(void) = { tumbling_bridge_act_0, tumbling_bridge_act_1,
+ tumbling_bridge_act_2, tumbling_bridge_act_3 };
s16 D_8032F38C[] = { -51, 0, 0, -461, 0, 0, -512, 0, 0, -2611, 0,
0, -2360, 0, 0, 214, 0, 0, -50, 1945, 1, 0 };
void bhv_tumbling_bridge_loop(void) {
- obj_call_action_function(sTumblingBridgeActions);
+ cur_obj_call_action_function(sTumblingBridgeActions);
}
diff --git a/src/game/behaviors/tuxie.inc.c b/src/game/behaviors/tuxie.inc.c
@@ -1,16 +1,5 @@
// tuxie.c.inc
-s32 func_802BE2E8(s16 a0, s16 a1, s32 a2) {
- f32 sp1C;
- if ((sp1C = o->header.gfx.unk38.animAccel / (f32) 0x10000) == 0)
- sp1C = 1.0f;
- if (obj_check_anim_frame_in_range(a0, sp1C) || obj_check_anim_frame_in_range(a1, sp1C)) {
- PlaySound2(a2);
- return 1;
- }
- return 0;
-}
-
void play_penguin_walking_sound(s32 walk) {
s32 sound;
if (o->oSoundStateID == 0) {
@@ -18,31 +7,31 @@ void play_penguin_walking_sound(s32 walk) {
sound = SOUND_OBJ_BABY_PENGUIN_WALK;
else // PENGUIN_WALK_BIG
sound = SOUND_OBJ_BIG_PENGUIN_WALK;
- func_802BE2E8(1, 11, sound);
+ set_obj_anim_with_accel_and_sound(1, 11, sound);
}
}
-void ActionTuxiesMother2(void) {
+void tuxies_mother_act_2(void) {
f32 sp24;
UNUSED s32 unused;
- struct Object *sp1C = obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp24);
+ struct Object *sp1C = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp24);
- if (obj_find_nearby_held_actor(bhvUnused20E0, 1000.0f) != NULL) {
+ if (cur_obj_find_nearby_held_actor(bhvUnused20E0, 1000.0f) != NULL) {
if (o->oSubAction == 0) {
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
o->oForwardVel = 10.0f;
- if (800.0f < obj_lateral_dist_from_mario_to_home())
+ if (800.0f < cur_obj_lateral_dist_from_mario_to_home())
o->oSubAction = 1;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
} else {
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(3);
- if (obj_lateral_dist_from_mario_to_home() < 700.0f)
+ cur_obj_init_animation_with_sound(3);
+ if (cur_obj_lateral_dist_from_mario_to_home() < 700.0f)
o->oSubAction = 0;
}
} else {
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
}
if (sp1C != NULL && sp24 < 300.0f && sp1C->oHeldState != HELD_FREE) {
o->oAction = 1;
@@ -51,21 +40,21 @@ void ActionTuxiesMother2(void) {
}
}
-void ActionTuxiesMother1(void) {
+void tuxies_mother_act_1(void) {
s32 sp2C;
s32 sp28;
s32 dialogID;
switch (o->oSubAction) {
case 0:
- set_obj_animation_and_sound_state(3);
- if (!obj_is_mario_on_platform()) {
+ cur_obj_init_animation_with_sound(3);
+ if (!cur_obj_is_mario_on_platform()) {
sp2C = (o->oBehParams >> 0x10) & 0xFF;
sp28 = (o->prevObj->oBehParams >> 0x10) & 0xFF;
if (sp2C == sp28)
dialogID = DIALOG_058;
else
dialogID = DIALOG_059;
- if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, dialogID)) {
+ if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, dialogID)) {
if (dialogID == DIALOG_058)
o->oSubAction = 1;
else
@@ -73,7 +62,7 @@ void ActionTuxiesMother1(void) {
o->prevObj->oInteractionSubtype |= INT_SUBTYPE_DROP_IMMEDIATELY;
}
} else
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
break;
case 1:
if (o->prevObj->oHeldState == HELD_FREE) {
@@ -86,11 +75,11 @@ void ActionTuxiesMother1(void) {
// which has no effect as o->prevObj->oUnknownUnk88 is always 0
// or 1, which is not affected by the bitwise AND.
o->prevObj->OBJECT_FIELD_S32(o->oInteractionSubtype) &= ~INT_SUBTYPE_DROP_IMMEDIATELY;
- set_object_behavior(o->prevObj, bhvUnused20E0);
+ obj_set_behavior(o->prevObj, bhvUnused20E0);
#ifndef VERSION_JP
- obj_spawn_star_at_y_offset(3167.0f, -4300.0f, 5108.0f, 200.0f);
+ cur_obj_spawn_star_at_y_offset(3167.0f, -4300.0f, 5108.0f, 200.0f);
#else
- create_star(3500.0f, -4300.0f, 4650.0f);
+ spawn_default_star(3500.0f, -4300.0f, 4650.0f);
#endif
o->oAction = 2;
}
@@ -99,21 +88,21 @@ void ActionTuxiesMother1(void) {
if (o->prevObj->oHeldState == HELD_FREE) {
//! Same bug as above
o->prevObj->OBJECT_FIELD_S32(o->oInteractionSubtype) &= ~INT_SUBTYPE_DROP_IMMEDIATELY;
- set_object_behavior(o->prevObj, bhvPenguinBaby);
+ obj_set_behavior(o->prevObj, bhvPenguinBaby);
o->oAction = 2;
}
break;
}
}
-void ActionTuxiesMother0(void) {
+void tuxies_mother_act_0(void) {
s32 sp2C;
f32 sp28;
struct Object *sp24;
sp2C = 0;
- sp24 = obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp28);
- obj_scale(4.0f);
- set_obj_animation_and_sound_state(3);
+ sp24 = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp28);
+ cur_obj_scale(4.0f);
+ cur_obj_init_animation_with_sound(3);
if (sp28 < 500.0f)
sp2C = 1;
if (sp24 != NULL && sp28 < 300.0f && sp24->oHeldState != HELD_FREE) {
@@ -123,12 +112,12 @@ void ActionTuxiesMother0(void) {
} else {
switch (o->oSubAction) {
case 0:
- if (obj_is_mario_in_range_and_ready_to_speak(300.0f, 100.0f))
+ if (cur_obj_can_mario_activate_textbox_2(300.0f, 100.0f))
if (sp2C == 0)
o->oSubAction++;
break;
case 1:
- if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_057))
+ if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_057))
o->oSubAction++;
break;
case 2:
@@ -137,86 +126,86 @@ void ActionTuxiesMother0(void) {
break;
}
}
- if (obj_check_anim_frame(1))
- PlaySound2(SOUND_OBJ_BIG_PENGUIN_YELL);
+ if (cur_obj_check_anim_frame(1))
+ cur_obj_play_sound_2(SOUND_OBJ_BIG_PENGUIN_YELL);
}
-void (*sTuxiesMotherActions[])(void) = { ActionTuxiesMother0, ActionTuxiesMother1,
- ActionTuxiesMother2 };
+void (*sTuxiesMotherActions[])(void) = { tuxies_mother_act_0, tuxies_mother_act_1,
+ tuxies_mother_act_2 };
void bhv_tuxies_mother_loop(void) {
o->activeFlags |= 0x400;
- obj_update_floor_and_walls();
- obj_call_action_function(sTuxiesMotherActions);
- obj_move_standard(-78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sTuxiesMotherActions);
+ cur_obj_move_standard(-78);
play_penguin_walking_sound(PENGUIN_WALK_BIG);
o->oInteractStatus = 0;
}
-void func_802BEA58(void) {
+void small_penguin_dive_with_mario(void) {
if (mario_is_dive_sliding()) {
o->oSmallPenguinUnk100 = o->oAction;
o->oAction = 3;
}
}
-void ActionSmallPenguin2(void) {
+void small_penguin_act_2(void) {
s32 sp1C = 0;
if (o->oTimer == 0)
- if (obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f)
+ if (cur_obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f)
sp1C = 1;
- set_obj_animation_and_sound_state(0);
+ cur_obj_init_animation_with_sound(0);
o->oForwardVel = o->oSmallPenguinUnk104 + 3.0f;
- obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, o->oSmallPenguinUnk110 + 0x600);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario + 0x8000, o->oSmallPenguinUnk110 + 0x600);
if (o->oDistanceToMario > o->oSmallPenguinUnk108 + 500.0f)
o->oAction = 0;
- func_802BEA58();
+ small_penguin_dive_with_mario();
if (sp1C)
o->oAction = 5;
}
-void ActionSmallPenguin1(void) {
- set_obj_animation_and_sound_state(0);
+void small_penguin_act_1(void) {
+ cur_obj_init_animation_with_sound(0);
o->oForwardVel = o->oSmallPenguinUnk104 + 3.0f;
- obj_rotate_yaw_toward(o->oAngleToMario, o->oSmallPenguinUnk110 + 0x600);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, o->oSmallPenguinUnk110 + 0x600);
if (o->oDistanceToMario < o->oSmallPenguinUnk108 + 300.0f)
o->oAction = 0;
if (o->oDistanceToMario > 1100.0f)
o->oAction = 0;
- func_802BEA58();
+ small_penguin_dive_with_mario();
}
-void ActionSmallPenguin3(void) {
+void small_penguin_act_3(void) {
if (o->oTimer > 5) {
if (o->oTimer == 6)
- PlaySound2(SOUND_OBJ_BABY_PENGUIN_DIVE);
- set_obj_animation_and_sound_state(1);
+ cur_obj_play_sound_2(SOUND_OBJ_BABY_PENGUIN_DIVE);
+ cur_obj_init_animation_with_sound(1);
if (o->oTimer > 25)
if (!mario_is_dive_sliding())
o->oAction = 4;
}
}
-void ActionSmallPenguin4(void) {
+void small_penguin_act_4(void) {
if (o->oTimer > 20) {
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(2);
+ cur_obj_init_animation_with_sound(2);
if (o->oTimer > 40)
o->oAction = o->oSmallPenguinUnk100;
}
}
-void ActionSmallPenguin0(void) {
+void small_penguin_act_0(void) {
s32 sp1C;
sp1C = 0;
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
if (o->oTimer == 0) {
o->oSmallPenguinUnk110 = (s32)(RandomFloat() * 0x400);
o->oSmallPenguinUnk108 = RandomFloat() * 100.0f;
o->oSmallPenguinUnk104 = RandomFloat();
o->oForwardVel = 0.0f;
- if (obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f)
+ if (cur_obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f)
sp1C = 1;
}
if (o->oDistanceToMario < 1000.0f && o->oSmallPenguinUnk108 + 600.0f < o->oDistanceToMario)
@@ -225,56 +214,56 @@ void ActionSmallPenguin0(void) {
o->oAction = 2;
if (sp1C)
o->oAction = 5;
- if (obj_mario_far_away())
- obj_set_pos_to_home();
+ if (cur_obj_mario_far_away())
+ cur_obj_set_pos_to_home();
}
-void ActionSmallPenguin5(void) {
+void small_penguin_act_5(void) {
f32 sp24;
s16 sp22;
- struct Object *sp1C = obj_nearest_object_with_behavior(bhvTuxiesMother);
+ struct Object *sp1C = cur_obj_nearest_object_with_behavior(bhvTuxiesMother);
if (sp1C != NULL) {
if (o->oDistanceToMario < 1000.0f)
o->oForwardVel = 2.0f;
else
o->oForwardVel = 0.0f;
sp24 = dist_between_objects(o, sp1C);
- sp22 = angle_to_object(o, sp1C);
+ sp22 = obj_angle_to_object(o, sp1C);
if (sp24 > 200.0f)
- obj_rotate_yaw_toward(sp22, 0x400);
+ cur_obj_rotate_yaw_toward(sp22, 0x400);
else
- obj_rotate_yaw_toward(sp22 + 0x8000, 0x400);
- set_obj_animation_and_sound_state(0);
+ cur_obj_rotate_yaw_toward(sp22 + 0x8000, 0x400);
+ cur_obj_init_animation_with_sound(0);
}
- func_802BEA58();
+ small_penguin_dive_with_mario();
}
void (*sSmallPenguinActions[])(void) = {
- ActionSmallPenguin0, ActionSmallPenguin1, ActionSmallPenguin2,
- ActionSmallPenguin3, ActionSmallPenguin4, ActionSmallPenguin5
+ small_penguin_act_0, small_penguin_act_1, small_penguin_act_2,
+ small_penguin_act_3, small_penguin_act_4, small_penguin_act_5
};
-void func_802BF048(void) {
+void small_penguin_free_actions(void) {
if (o->oSmallPenguinUnk88 != 0) {
o->oAction = 5;
o->oSmallPenguinUnk88 = 0;
}
- obj_update_floor_and_walls();
- obj_call_action_function(sSmallPenguinActions);
- obj_move_standard(-78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sSmallPenguinActions);
+ cur_obj_move_standard(-78);
play_penguin_walking_sound(PENGUIN_WALK_BABY);
}
void bhv_small_penguin_loop(void) {
switch (o->oHeldState) {
case HELD_FREE:
- func_802BF048();
+ small_penguin_free_actions();
break;
case HELD_HELD:
- func_8029FA5C(0, 0);
- if (obj_has_behavior(bhvPenguinBaby))
- set_object_behavior(o, bhvSmallPenguin);
- copy_object_pos(o, gMarioObject);
+ cur_obj_unrender_and_reset_state(0, 0);
+ if (cur_obj_has_behavior(bhvPenguinBaby))
+ obj_set_behavior(o, bhvSmallPenguin);
+ obj_copy_pos(o, gMarioObject);
if (gGlobalTimer % 30 == 0)
#ifndef VERSION_JP
play_sound(SOUND_OBJ2_BABY_PENGUIN_YELL, gMarioObject->header.gfx.cameraToObject);
@@ -283,10 +272,10 @@ void bhv_small_penguin_loop(void) {
#endif
break;
case HELD_THROWN:
- obj_get_thrown_or_placed(0, 0, 0);
+ cur_obj_get_thrown_or_placed(0, 0, 0);
break;
case HELD_DROPPED:
- obj_get_dropped();
+ cur_obj_get_dropped();
break;
}
}
diff --git a/src/game/behaviors/tweester.inc.c b/src/game/behaviors/tweester.inc.c
@@ -44,9 +44,9 @@ void tweester_scale_and_move(f32 preScale) {
*/
void tweester_act_idle(void) {
if (o->oSubAction == TWEESTER_SUB_ACT_WAIT) {
- obj_become_tangible();
- obj_set_pos_to_home();
- obj_scale(0);
+ cur_obj_become_tangible();
+ cur_obj_set_pos_to_home();
+ cur_obj_scale(0);
// Hard to have any idea of this purpose, only set here.
o->oTweesterUnused = 0;
@@ -57,7 +57,7 @@ void tweester_act_idle(void) {
o->oTimer = 0;
} else {
- PlaySound(SOUND_ENV_WIND1);
+ cur_obj_play_sound_1(SOUND_ENV_WIND1);
tweester_scale_and_move(o->oTimer / 60.0f);
if (o->oTimer > 59)
o->oAction = TWEESTER_ACT_CHASE;
@@ -71,34 +71,34 @@ void tweester_act_idle(void) {
void tweester_act_chase(void) {
f32 activationRadius = o->oBehParams2ndByte * 100;
- o->oAngleToHome = obj_angle_to_home();
- PlaySound(SOUND_ENV_WIND1);
+ o->oAngleToHome = cur_obj_angle_to_home();
+ cur_obj_play_sound_1(SOUND_ENV_WIND1);
- if (obj_lateral_dist_from_mario_to_home() < activationRadius
+ if (cur_obj_lateral_dist_from_mario_to_home() < activationRadius
&& o->oSubAction == TWEESTER_SUB_ACT_CHASE) {
o->oForwardVel = 20.0f;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
print_debug_top_down_objectinfo("off ", 0);
if (gMarioStates->action == ACT_TWIRLING)
o->oSubAction++;
} else {
o->oForwardVel = 20.0f;
- obj_rotate_yaw_toward(o->oAngleToHome, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToHome, 0x200);
- if (obj_lateral_dist_to_home() < 200.0f)
+ if (cur_obj_lateral_dist_to_home() < 200.0f)
o->oAction = TWEESTER_ACT_HIDE;
}
if (o->oDistanceToMario > 3000.0f)
o->oAction = TWEESTER_ACT_HIDE;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL)
o->oMoveAngleYaw = o->oWallAngle;
- obj_move_standard(60);
+ cur_obj_move_standard(60);
tweester_scale_and_move(1.0f);
spawn_object(o, MODEL_SAND_DUST, bhvTweesterSandParticle);
}
@@ -113,8 +113,8 @@ void tweester_act_hide(void) {
if (shrinkTimer >= 0.0f)
tweester_scale_and_move(shrinkTimer / 60.0f);
else {
- obj_become_intangible();
- if (obj_lateral_dist_from_mario_to_home() > 2500.0f)
+ cur_obj_become_intangible();
+ if (cur_obj_lateral_dist_from_mario_to_home() > 2500.0f)
o->oAction = TWEESTER_ACT_IDLE;
if (o->oTimer > 360)
o->oAction = TWEESTER_ACT_IDLE;
@@ -129,8 +129,8 @@ void (*sTweesterActions[])(void) = { tweester_act_idle, tweester_act_chase, twee
* Loads the hitbox and calls its relevant action.
*/
void bhv_tweester_loop(void) {
- set_object_hitbox(o, &sTweesterHitbox);
- obj_call_action_function(sTweesterActions);
+ obj_set_hitbox(o, &sTweesterHitbox);
+ cur_obj_call_action_function(sTweesterActions);
o->oInteractStatus = 0;
}
@@ -143,14 +143,14 @@ void bhv_tweester_sand_particle_loop(void) {
o->oForwardVel += 15.0f;
o->oPosY += 22.0f;
- obj_scale(RandomFloat() + 1.0);
+ cur_obj_scale(RandomFloat() + 1.0);
if (o->oTimer == 0) {
- translate_object_xz_random(o, 100.0f);
+ obj_translate_xz_random(o, 100.0f);
o->oFaceAnglePitch = RandomU16();
o->oFaceAngleYaw = RandomU16();
}
if (o->oTimer > 15)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/ukiki.inc.c b/src/game/behaviors/ukiki.inc.c
@@ -13,8 +13,8 @@
*/
void handle_hat_ukiki_reset(void) {
if (o->oBehParams2ndByte == UKIKI_HAT) {
- if (obj_mario_far_away()) {
- obj_set_pos_to_home_and_stop();
+ if (cur_obj_mario_far_away()) {
+ cur_obj_set_pos_to_home_and_stop();
o->oAction = UKIKI_ACT_IDLE;
} else if (o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) {
o->oAction = UKIKI_ACT_WAIT_TO_RESPAWN;
@@ -37,9 +37,9 @@ s32 is_hat_ukiki_and_mario_has_hat(void) {
}
/**
- * Unused copy of Geo18_8029D890. Perhaps a copy paste mistake.
+ * Unused copy of geo_update_projectile_pos_from_parent. Perhaps a copy paste mistake.
*/
-Gfx *unused_Geo18_8029D890(s32 run,UNUSED struct GraphNode *node, Mat4 mtx) {
+Gfx *geo_update_projectile_pos_from_parent_copy(s32 run,UNUSED struct GraphNode *node, Mat4 mtx) {
Mat4 mtx2;
struct Object* obj;
@@ -48,9 +48,9 @@ Gfx *unused_Geo18_8029D890(s32 run,UNUSED struct GraphNode *node, Mat4 mtx) {
obj = (struct Object*)gCurGraphNodeObject;
if (obj->prevObj != NULL) {
- func_8029D704(mtx2, mtx, gCurGraphNodeCamera->matrixPtr);
- func_8029D558(mtx2, obj->prevObj);
- func_8029EA0C(obj->prevObj);
+ create_transformation_from_matrices(mtx2, mtx, gCurGraphNodeCamera->matrixPtr);
+ obj_update_pos_from_parent_transformation(mtx2, obj->prevObj);
+ obj_set_gfx_pos_from_pos(obj->prevObj);
}
}
@@ -76,17 +76,17 @@ void idle_ukiki_taunt(void) {
// Switch goes from 1-4.
switch(o->oSubAction) {
case UKIKI_SUB_ACT_TAUNT_ITCH:
- set_obj_animation_and_sound_state(UKIKI_ANIM_ITCH);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_ITCH);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oSubAction = UKIKI_SUB_ACT_TAUNT_NONE;
}
break;
case UKIKI_SUB_ACT_TAUNT_SCREECH:
- set_obj_animation_and_sound_state(UKIKI_ANIM_SCREECH);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_SCREECH);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oUkikiTauntCounter++;
}
@@ -96,9 +96,9 @@ void idle_ukiki_taunt(void) {
break;
case UKIKI_SUB_ACT_TAUNT_JUMP_CLAP:
- set_obj_animation_and_sound_state(UKIKI_ANIM_JUMP_CLAP);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_JUMP_CLAP);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oUkikiTauntCounter++;
}
@@ -108,9 +108,9 @@ void idle_ukiki_taunt(void) {
break;
case UKIKI_SUB_ACT_TAUNT_HANDSTAND:
- set_obj_animation_and_sound_state(UKIKI_ANIM_HANDSTAND);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_HANDSTAND);
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oSubAction = UKIKI_SUB_ACT_TAUNT_NONE;
}
break;
@@ -144,16 +144,16 @@ void ukiki_act_idle(void) {
if (o->oUkikiTextState == UKIKI_TEXT_STOLE_HAT) {
o->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + 0x8000;
- if (func_802B0C54(50.0f, 150.0f)) {
+ if (check_if_moving_over_floor(50.0f, 150.0f)) {
o->oAction = UKIKI_ACT_JUMP;
} else {
o->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + 0x4000;
- if (func_802B0C54(50.0f, 150.0f)) {
+ if (check_if_moving_over_floor(50.0f, 150.0f)) {
o->oAction = UKIKI_ACT_JUMP;
} else {
o->oMoveAngleYaw = gMarioObject->oMoveAngleYaw - 0x4000;
- if (func_802B0C54(50.0f, 150.0f)) {
+ if (check_if_moving_over_floor(50.0f, 150.0f)) {
o->oAction = UKIKI_ACT_JUMP;
}
}
@@ -176,8 +176,8 @@ void ukiki_act_idle(void) {
void ukiki_act_return_home(void) {
UNUSED s32 unused;
- set_obj_animation_and_sound_state(UKIKI_ANIM_RUN);
- o->oMoveAngleYaw = obj_angle_to_home();
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
+ o->oMoveAngleYaw = cur_obj_angle_to_home();
o->oForwardVel = 10.0f;
// If ukiki somehow walked home, go back to the idle action.
@@ -193,8 +193,8 @@ void ukiki_act_return_home(void) {
void ukiki_act_wait_to_respawn(void) {
idle_ukiki_taunt();
- if (obj_mario_far_away()) {
- obj_set_pos_to_home_and_stop();
+ if (cur_obj_mario_far_away()) {
+ cur_obj_set_pos_to_home_and_stop();
o->oAction = UKIKI_ACT_IDLE;
}
}
@@ -209,7 +209,7 @@ void ukiki_act_unused_turn(void) {
idle_ukiki_taunt();
if (o->oSubAction == UKIKI_SUB_ACT_TAUNT_JUMP_CLAP) {
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
}
}
@@ -224,9 +224,9 @@ void ukiki_act_turn_to_mario(void) {
o->oForwardVel = RandomFloat() * 3.0f + 2.0f;
}
- set_obj_animation_and_sound_state(UKIKI_ANIM_TURN);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_TURN);
- facingMario = obj_rotate_yaw_toward(o->oAngleToMario, 0x800);
+ facingMario = cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x800);
if (facingMario) {
o->oAction = UKIKI_ACT_IDLE;
@@ -257,12 +257,12 @@ void ukiki_act_run(void) {
o->oUkikiChaseFleeRange = RandomFloat() * 100.0f + 350.0f;
}
- set_obj_animation_and_sound_state(UKIKI_ANIM_RUN);
- obj_rotate_yaw_toward(goalYaw, 0x800);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
+ cur_obj_rotate_yaw_toward(goalYaw, 0x800);
//! @bug (Ukikispeedia) This function sets forward speed to 0.9 * Mario's
//! forward speed, which means ukiki can move at hyperspeed rates.
- func_8029F684(20.0f, 0.9f);
+ cur_obj_set_vel_from_mario_vel(20.0f, 0.9f);
if (fleeMario) {
if (o->oDistanceToMario > o->oUkikiChaseFleeRange) {
@@ -275,11 +275,11 @@ void ukiki_act_run(void) {
if (fleeMario) {
if (o->oDistanceToMario < 200.0f) {
if((o->oMoveFlags & OBJ_MOVE_HIT_WALL) &&
- obj_is_mario_moving_fast_or_in_air(10)) {
+ is_mario_moving_fast_or_in_air(10)) {
o->oAction = UKIKI_ACT_JUMP;
o->oMoveAngleYaw = o->oWallAngle;
} else if((o->oMoveFlags & OBJ_MOVE_HIT_EDGE)) {
- if (obj_is_mario_moving_fast_or_in_air(10)) {
+ if (is_mario_moving_fast_or_in_air(10)) {
o->oAction = UKIKI_ACT_JUMP;
o->oMoveAngleYaw += 0x8000;
}
@@ -294,21 +294,21 @@ void ukiki_act_run(void) {
*/
void ukiki_act_jump(void) {
o->oForwardVel = 10.0f;
- obj_become_intangible();
+ cur_obj_become_intangible();
if (o->oSubAction == 0) {
if (o->oTimer == 0) {
- func_8029FA1C(RandomFloat() * 10.0f + 45.0f, UKIKI_ANIM_JUMP);
+ cur_obj_set_y_vel_and_animation(RandomFloat() * 10.0f + 45.0f, UKIKI_ANIM_JUMP);
} else if (o->oMoveFlags & OBJ_MOVE_MASK_NOT_AIR) {
o->oSubAction++;
o->oVelY = 0.0f;
}
} else {
o->oForwardVel = 0.0f;
- set_obj_animation_and_sound_state(UKIKI_ANIM_LAND);
- obj_become_tangible();
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_LAND);
+ cur_obj_become_tangible();
- if (func_8029F788()) {
+ if (cur_obj_check_if_near_animation_end()) {
o->oAction = UKIKI_ACT_RUN;
}
}
@@ -342,28 +342,28 @@ void ukiki_act_go_to_cage(void) {
struct Object* obj;
f32 latDistToCage = 0.0f;
s16 yawToCage = 0;
- obj = obj_nearest_object_with_behavior(bhvUkikiCageChild);
+ obj = cur_obj_nearest_object_with_behavior(bhvUkikiCageChild);
// Ultimately is checking the cage, as it points to the parent
// of a dummy child object of the cage.
if (obj != NULL) {
latDistToCage = lateral_dist_between_objects(o, obj->parentObj);
- yawToCage = angle_to_object(o, obj->parentObj);
+ yawToCage = obj_angle_to_object(o, obj->parentObj);
}
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oFlags |= OBJ_FLAG_ACTIVE_FROM_AFAR;
// Switch goes from 0-7 in order.
switch(o->oSubAction) {
case UKIKI_SUB_ACT_CAGE_RUN_TO_CAGE:
- set_obj_animation_and_sound_state(UKIKI_ANIM_RUN);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
o->oPathedWaypointsS16 = sCageUkikiPath;
- if (obj_follow_path(0) != PATH_REACHED_END) {
+ if (cur_obj_follow_path(0) != PATH_REACHED_END) {
o->oForwardVel = 10.0f;
- obj_rotate_yaw_toward(o->oPathedTargetYaw, 0x400);
+ cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, 0x400);
o->oPosY = o->oFloorHeight;
} else {
o->oForwardVel = 0.0f;
@@ -372,34 +372,34 @@ void ukiki_act_go_to_cage(void) {
break;
case UKIKI_SUB_ACT_CAGE_WAIT_FOR_MARIO:
- set_obj_animation_and_sound_state(UKIKI_ANIM_JUMP_CLAP);
- obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_JUMP_CLAP);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400);
- if (func_802A3FF8(200.0f, 30.0f, 0x7FFF)) {
+ if (cur_obj_can_mario_activate_textbox(200.0f, 30.0f, 0x7FFF)) {
o->oSubAction++; // fallthrough
} else {
break;
}
case UKIKI_SUB_ACT_CAGE_TALK_TO_MARIO:
- set_obj_animation_and_sound_state(UKIKI_ANIM_HANDSTAND);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_HANDSTAND);
- if (obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, DIALOG_080)) {
+ if (cur_obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, DIALOG_080)) {
o->oSubAction++;
}
break;
case UKIKI_SUB_ACT_CAGE_TURN_TO_CAGE:
- set_obj_animation_and_sound_state(UKIKI_ANIM_RUN);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN);
- if (obj_rotate_yaw_toward(yawToCage, 0x400)) {
+ if (cur_obj_rotate_yaw_toward(yawToCage, 0x400)) {
o->oForwardVel = 10.0f;
o->oSubAction++;
}
break;
case UKIKI_SUB_ACT_CAGE_JUMP_TO_CAGE:
- func_8029FA1C(55.0f, UKIKI_ANIM_JUMP);
+ cur_obj_set_y_vel_and_animation(55.0f, UKIKI_ANIM_JUMP);
o->oForwardVel = 36.0f;
o->oSubAction++;
break;
@@ -411,7 +411,7 @@ void ukiki_act_go_to_cage(void) {
if (o->oMoveFlags & OBJ_MOVE_LANDED) {
play_puzzle_jingle();
- set_obj_animation_and_sound_state(UKIKI_ANIM_JUMP_CLAP);
+ cur_obj_init_animation_with_sound(UKIKI_ANIM_JUMP_CLAP);
o->oSubAction++;
o->oUkikiCageSpinTimer = 32;
obj->parentObj->oUkikiCageNextAction = UKIKI_CAGE_ACT_SPIN;
@@ -431,7 +431,7 @@ void ukiki_act_go_to_cage(void) {
case UKIKI_SUB_ACT_CAGE_DESPAWN:
if (o->oPosY < -1300.0f) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
break;
}
@@ -479,8 +479,8 @@ void (*sUkikiActions[])(void) = {
void ukiki_free_loop(void) {
s32 steepSlopeAngleDegrees;
- obj_update_floor_and_walls();
- obj_call_action_function(sUkikiActions);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sUkikiActions);
if (o->oAction == UKIKI_ACT_GO_TO_CAGE || o->oAction == UKIKI_ACT_RETURN_HOME) {
steepSlopeAngleDegrees = -88;
@@ -488,7 +488,7 @@ void ukiki_free_loop(void) {
steepSlopeAngleDegrees = -20;
}
- obj_move_standard(steepSlopeAngleDegrees);
+ cur_obj_move_standard(steepSlopeAngleDegrees);
handle_hat_ukiki_reset();
if(!(o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER)) {
@@ -568,7 +568,7 @@ void hat_ukiki_held_loop(void) {
break;
case UKIKI_TEXT_STEAL_HAT:
- if (obj_update_dialog(2, 2, DIALOG_100, 0)) {
+ if (cur_obj_update_dialog(2, 2, DIALOG_100, 0)) {
o->oInteractionSubtype |= INT_SUBTYPE_DROP_IMMEDIATELY;
o->oUkikiTextState = UKIKI_TEXT_STOLE_HAT;
}
@@ -578,7 +578,7 @@ void hat_ukiki_held_loop(void) {
break;
case UKIKI_TEXT_HAS_HAT:
- if (obj_update_dialog(2, 18, DIALOG_101, 0)) {
+ if (cur_obj_update_dialog(2, 18, DIALOG_101, 0)) {
mario_retrieve_cap();
set_mario_npc_dialog(0);
o->oUkikiHasHat &= ~UKIKI_HAT_ON;
@@ -618,8 +618,8 @@ void bhv_ukiki_loop(void) {
break;
case HELD_HELD:
- func_8029FA5C(UKIKI_ANIM_HELD, 0);
- copy_object_pos(o, gMarioObject);
+ cur_obj_unrender_and_reset_state(UKIKI_ANIM_HELD, 0);
+ obj_copy_pos(o, gMarioObject);
if (o->oBehParams2ndByte == UKIKI_HAT) {
hat_ukiki_held_loop();
@@ -630,7 +630,7 @@ void bhv_ukiki_loop(void) {
case HELD_THROWN:
case HELD_DROPPED:
- obj_get_dropped();
+ cur_obj_get_dropped();
break;
}
diff --git a/src/game/behaviors/ukiki_cage.inc.c b/src/game/behaviors/ukiki_cage.inc.c
@@ -19,14 +19,14 @@ void bhv_ukiki_cage_star_loop(void) {
case UKIKI_CAGE_STAR_ACT_IN_CAGE:
// Initialization to see if the star is collected (blue) or not (yellow).
if (o->oTimer == 0) {
- if (func_802A377C(1)
+ if (bit_shift_left(1)
& save_file_get_star_flags(gCurrSaveFileNum - 1, gCurrCourseNum - 1)) {
- obj_set_model(MODEL_TRANSPARENT_STAR);
+ cur_obj_set_model(MODEL_TRANSPARENT_STAR);
}
}
- copy_object_pos(o, o->parentObj);
- copy_object_behavior_params(o, o->parentObj);
+ obj_copy_pos(o, o->parentObj);
+ obj_copy_behavior_params(o, o->parentObj);
// When they cage hides itself, spawn particles and the star.
if (o->parentObj->oAction == UKIKI_CAGE_ACT_HIDE) {
@@ -34,10 +34,10 @@ void bhv_ukiki_cage_star_loop(void) {
}
break;
case UKIKI_CAGE_STAR_ACT_SPAWN_STAR:
- mark_object_for_deletion(o);
- func_802A3004();
+ obj_mark_for_deletion(o);
+ spawn_mist_particles();
spawn_triangle_break_particles(20, 138, 0.7, 3);
- create_star(2500.0f, -1200.0f, 1300.0f);
+ spawn_default_star(2500.0f, -1200.0f, 1300.0f);
break;
}
@@ -73,8 +73,8 @@ void ukiki_cage_act_spin(void) {
*/
void ukiki_cage_act_fall(void) {
//! (PARTIAL_UPDATE)
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
if (o->oMoveFlags & (OBJ_MOVE_LANDED | OBJ_MOVE_ENTERED_WATER)) {
o->oAction = UKIKI_CAGE_ACT_HIDE;
}
@@ -87,7 +87,7 @@ void ukiki_cage_act_fall(void) {
* hiding the object?
*/
void ukiki_cage_act_hide(void) {
- obj_hide();
+ cur_obj_hide();
}
/**
@@ -102,5 +102,5 @@ void (*sUkikiCageActions[])(void) = {
* Main behavior loop for the cage. Only calls the relevant action.
*/
void bhv_ukiki_cage_loop(void) {
- obj_call_action_function(sUkikiCageActions);
+ cur_obj_call_action_function(sUkikiCageActions);
}
diff --git a/src/game/behaviors/unagi.inc.c b/src/game/behaviors/unagi.inc.c
@@ -44,42 +44,42 @@ void unagi_act_0(void) {
void unagi_act_1_4(s32 arg0) {
if (o->oSoundStateID == 3) {
- if (obj_check_anim_frame(30)) {
+ if (cur_obj_check_anim_frame(30)) {
o->oForwardVel = 40.0f;
}
} else {
- if (func_8029F828()) {
+ if (cur_obj_check_if_at_animation_end()) {
if (o->oAction != arg0 && (o->oPathedPrevWaypointFlags & 0xFF) >= 7) {
- set_obj_animation_and_sound_state(3);
+ cur_obj_init_animation_with_sound(3);
} else {
- set_obj_animation_and_sound_state(2);
+ cur_obj_init_animation_with_sound(2);
}
}
}
- if (obj_check_anim_frame(6)) {
- PlaySound2(SOUND_GENERAL_MOVING_WATER);
+ if (cur_obj_check_anim_frame(6)) {
+ cur_obj_play_sound_2(SOUND_GENERAL_MOVING_WATER);
}
- if (obj_follow_path(0) == -1) {
+ if (cur_obj_follow_path(0) == -1) {
o->oAction = arg0;
}
o->oMoveAnglePitch = o->oFaceAnglePitch =
approach_s16_symmetric(o->oMoveAnglePitch, o->oPathedTargetPitch, 50);
- obj_rotate_yaw_toward(o->oPathedTargetYaw, 120);
+ cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, 120);
obj_roll_to_match_yaw_turn(o->oPathedTargetYaw, 0x2000, 100);
obj_forward_vel_approach(10.0f, 0.2f);
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
}
void unagi_act_2(void) {
o->oPathedPrevWaypoint = o->oPathedStartWaypoint;
o->oPathedPrevWaypointFlags = 0;
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oMoveAnglePitch = o->oFaceAnglePitch = 0;
o->oMoveAngleYaw = o->oFaceAngleYaw = o->oUnagiUnk1B0;
@@ -94,17 +94,17 @@ void unagi_act_2(void) {
void unagi_act_3(void) {
if (o->oUnagiUnkF4 < 0.0f) {
- set_obj_animation_and_sound_state(6);
+ cur_obj_init_animation_with_sound(6);
if ((o->oUnagiUnkF4 += 10.0f) > 0.0f) {
o->oUnagiUnkF4 = 0.0f;
}
} else {
if (o->oUnagiUnkF4 == 0.0f) {
- set_obj_animation_and_sound_state(6);
+ cur_obj_init_animation_with_sound(6);
if (o->oTimer > 60 && o->oUnagiUnk1AC < 1000.0f) {
- PlaySound2(SOUND_OBJ_EEL_2);
+ cur_obj_play_sound_2(SOUND_OBJ_EEL_2);
o->oUnagiUnkF8 = o->oUnagiUnk110 = 30.0f;
} else {
o->oUnagiUnk110 = 0.0f;
@@ -114,15 +114,15 @@ void unagi_act_3(void) {
o->oUnagiUnk110 = 0.0f;
}
} else if (o->oUnagiUnk110 == 0.0f) {
- set_obj_animation_and_sound_state(0);
- if (func_8029F828()) {
+ cur_obj_init_animation_with_sound(0);
+ if (cur_obj_check_if_at_animation_end()) {
if (o->oUnagiUnk1AC < 1000.0f) {
o->oAction = 4;
o->oForwardVel = o->oUnagiUnkF8;
- set_obj_animation_and_sound_state(1);
+ cur_obj_init_animation_with_sound(1);
} else {
o->oUnagiUnk110 = -50.0f;
- set_obj_animation_and_sound_state(4);
+ cur_obj_init_animation_with_sound(4);
}
}
}
@@ -176,7 +176,7 @@ void bhv_unagi_subobject_loop(void) {
f32 val04;
if (o->parentObj->oUnagiUnk1B2 == 0) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
val04 = 300.0f * o->oBehParams2ndByte;
@@ -190,7 +190,7 @@ void bhv_unagi_subobject_loop(void) {
if (o->oBehParams2ndByte == -4) {
if (o->parentObj->oAnimState != 0 && o->oDistanceToMario < 150.0f) {
o->oBehParams = o->parentObj->oBehParams;
- create_star(6833.0f, -3654.0f, 2230.0f);
+ spawn_default_star(6833.0f, -3654.0f, 2230.0f);
o->parentObj->oAnimState = 0;
}
} else {
diff --git a/src/game/behaviors/unused_particle_spawn.inc.c b/src/game/behaviors/unused_particle_spawn.inc.c
@@ -7,15 +7,15 @@
void bhv_unused_particle_spawn_loop(void) {
s32 i;
- obj_update_floor_and_walls();
- obj_move_standard(78);
+ cur_obj_update_floor_and_walls();
+ cur_obj_move_standard(78);
if (o->oMoveFlags & OBJ_MOVE_ON_GROUND) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
- if (are_objects_collided(o, gMarioObject)) {
- mark_object_for_deletion(o);
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
+ obj_mark_for_deletion(o);
for (i = 0; i < 10; i++) {
spawn_object(o, MODEL_PURPLE_MARBLE, bhvPurpleParticle);
diff --git a/src/game/behaviors/unused_poundable_platform.inc.c b/src/game/behaviors/unused_poundable_platform.inc.c
@@ -13,16 +13,16 @@
*/
void bhv_unused_poundable_platform(void) {
- obj_scale(1.02f);
+ cur_obj_scale(1.02f);
if (o->oAction == 0) {
- if (obj_is_mario_ground_pounding_platform()) {
- func_802A3004();
+ if (cur_obj_is_mario_ground_pounding_platform()) {
+ spawn_mist_particles();
spawn_triangle_break_particles(20, 56, 3.0f, 0);
o->oAction++;
}
} else if (o->oTimer > 7) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
load_object_collision_model();
}
diff --git a/src/game/behaviors/walking_penguin.inc.c b/src/game/behaviors/walking_penguin.inc.c
@@ -1,73 +0,0 @@
-// walking_penguin.c.inc
-
-struct Struct8032FE4C D_8032FE4C[] = { { 60, 0, 6.0f, 1.0f }, { 30, 3, 0.0f, 1.0f },
- { 30, 0, 12.0f, 2.0f }, { 30, 3, 0.0f, 1.0f },
- { 30, 0, -6.0f, 1.0f }, { 30, 3, 0.0f, 1.0f },
- { -1, 0, 0.0f, 0.0f } };
-
-s32 func_802C7AD0(void) {
- o->oForwardVel = 0.0f;
- func_8029ED98(0, 1.0f);
- o->oAngleVelYaw = 0x400;
- o->oMoveAngleYaw += o->oAngleVelYaw;
- if (o->oTimer == 31)
- return 1;
- else
- return 0;
-}
-
-void bhv_walking_penguin_loop(void) {
- f32 sp2C;
- f32 sp28;
- f32 sp24 = 100.0f;
- o->oAngleVelYaw = 0;
- obj_update_floor_and_walls();
- switch (o->oAction) {
- case 0:
- if (o->oTimer == 0) {
- o->oWalkingPenguinUnk10C = 0;
- o->oWalkingPenguinUnk110 = 0;
- }
- if (o->oWalkingPenguinUnk110 < D_8032FE4C[o->oWalkingPenguinUnk10C].unk0)
- o->oWalkingPenguinUnk110++;
- else {
- o->oWalkingPenguinUnk110 = 0;
- o->oWalkingPenguinUnk10C++;
- if (D_8032FE4C[o->oWalkingPenguinUnk10C].unk0 < 0)
- o->oWalkingPenguinUnk10C = 0;
- }
- if (o->oPosX < 300.0f)
- o->oAction++;
- else {
- o->oForwardVel = D_8032FE4C[o->oWalkingPenguinUnk10C].unk2;
- func_8029ED98(D_8032FE4C[o->oWalkingPenguinUnk10C].unk1,
- D_8032FE4C[o->oWalkingPenguinUnk10C].unk3);
- }
- break;
- case 1:
- if (func_802C7AD0())
- o->oAction++;
- break;
- case 2:
- o->oForwardVel = 12.0f;
- func_8029ED98(0, 2.0f);
- if (o->oPosX > 1700.0f)
- o->oAction++;
- break;
- case 3:
- if (func_802C7AD0())
- o->oAction = 0;
- break;
- }
- obj_move_standard(-78);
- if (!obj_hide_if_mario_far_away_y(1000.0f))
- play_penguin_walking_sound(1);
- sp2C = o->oPosX + sins(0xDBB0) * 60.0f;
- sp28 = o->oPosZ + coss(0xDBB0) * 60.0f;
- sp2C += sp24 * sins(0x1BB0);
- sp28 += sp24 * coss(0x1BB0);
- o->oWalkingPenguinUnk100 = sp2C;
- o->oWalkingPenguinUnk104 = sp28;
- print_debug_bottom_up("x %d", o->oPosX);
- print_debug_bottom_up("z %d", o->oPosZ);
-}
diff --git a/src/game/behaviors/warp.inc.c b/src/game/behaviors/warp.inc.c
@@ -15,7 +15,7 @@ void bhv_warp_loop(void) {
o->oInteractStatus = 0;
}
-void BehFadingWarpLoop() // identical to the above function except for o->hitboxRadius
+void bhv_fading_warp_loop() // identical to the above function except for o->hitboxRadius
{
u16 sp6;
if (o->oTimer == 0) {
diff --git a/src/game/behaviors/water_bomb.inc.c b/src/game/behaviors/water_bomb.inc.c
@@ -105,7 +105,7 @@ void water_bomb_spawn_explode_particles(s8 offsetY, s8 forwardVelRange, s8 velYB
sWaterBombExplodeParticles.offsetY = offsetY;
sWaterBombExplodeParticles.forwardVelRange = forwardVelRange;
sWaterBombExplodeParticles.velYBase = velYBase;
- obj_spawn_particles(&sWaterBombExplodeParticles);
+ cur_obj_spawn_particles(&sWaterBombExplodeParticles);
#else
s8 tempVelYBase = velYBase;
s8 tempForwardVelRange = forwardVelRange;
@@ -115,7 +115,7 @@ void water_bomb_spawn_explode_particles(s8 offsetY, s8 forwardVelRange, s8 velYB
sWaterBombExplodeParticles.offsetY = tempOffsetY;
sWaterBombExplodeParticles.forwardVelRange = tempForwardVelRange;
sWaterBombExplodeParticles.velYBase = tempVelYBase;
- obj_spawn_particles(&sWaterBombExplodeParticles);
+ cur_obj_spawn_particles(&sWaterBombExplodeParticles);
} while (0);
#endif
}
@@ -124,7 +124,7 @@ void water_bomb_spawn_explode_particles(s8 offsetY, s8 forwardVelRange, s8 velYB
* Enter the drop action with -40 y vel.
*/
static void water_bomb_act_init(void) {
- PlaySound2(SOUND_OBJ_SOMETHING_LANDING);
+ cur_obj_play_sound_2(SOUND_OBJ_SOMETHING_LANDING);
o->oAction = WATER_BOMB_ACT_DROP;
o->oMoveFlags = 0;
@@ -138,7 +138,7 @@ static void water_bomb_act_init(void) {
static void water_bomb_act_drop(void) {
f32 stretch;
- set_object_hitbox(o, &sWaterBombHitbox);
+ obj_set_hitbox(o, &sWaterBombHitbox);
// Explode if touched or if hit water
if ((o->oInteractStatus & INT_STATUS_INTERACTED) || (o->oMoveFlags & OBJ_MOVE_ENTERED_WATER)) {
@@ -151,7 +151,7 @@ static void water_bomb_act_drop(void) {
o->oWaterBombOnGround = TRUE;
if ((o->oWaterBombNumBounces += 1.0f) < 3.0f) {
- PlaySound2(SOUND_OBJ_WATER_BOMB_BOUNCING);
+ cur_obj_play_sound_2(SOUND_OBJ_WATER_BOMB_BOUNCING);
} else {
create_sound_spawner(SOUND_OBJ_DIVING_IN_WATER);
}
@@ -189,7 +189,7 @@ static void water_bomb_act_drop(void) {
}
o->header.gfx.scale[0] = o->header.gfx.scale[2] = 1.0f - stretch;
- obj_move_standard(78);
+ cur_obj_move_standard(78);
}
/**
@@ -199,7 +199,7 @@ static void water_bomb_act_drop(void) {
static void water_bomb_act_explode(void) {
water_bomb_spawn_explode_particles(25, 60, 10);
o->parentObj->oWaterBombSpawnerBombActive = FALSE;
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
/**
@@ -207,13 +207,13 @@ static void water_bomb_act_explode(void) {
*/
static void water_bomb_act_shot_from_cannon(void) {
if (o->oTimer > 100) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
if (o->oTimer < 7) {
if (o->oTimer == 1) {
water_bomb_spawn_explode_particles(-20, 10, 30);
}
- obj_spawn_particles(&sWaterBombCannonParticle);
+ cur_obj_spawn_particles(&sWaterBombCannonParticle);
}
if (o->header.gfx.scale[1] > 1.2f) {
@@ -221,7 +221,7 @@ static void water_bomb_act_shot_from_cannon(void) {
}
o->header.gfx.scale[0] = o->header.gfx.scale[2] = 2.0f - o->header.gfx.scale[1];
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
}
}
@@ -233,7 +233,7 @@ void bhv_water_bomb_update(void) {
water_bomb_act_shot_from_cannon();
} else {
o->oGraphYOffset = 40.0f * o->header.gfx.scale[1];
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case WATER_BOMB_ACT_INIT:
@@ -255,7 +255,7 @@ void bhv_water_bomb_update(void) {
*/
void bhv_water_bomb_shadow_update(void) {
if (o->parentObj->oAction == WATER_BOMB_ACT_EXPLODE) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
// TODO: What is happening here
f32 bombHeight = o->parentObj->oPosY - o->parentObj->oFloorHeight;
@@ -263,8 +263,8 @@ void bhv_water_bomb_shadow_update(void) {
bombHeight = 500.0f;
}
- copy_object_pos(o, o->parentObj);
+ obj_copy_pos(o, o->parentObj);
o->oPosY = o->parentObj->oFloorHeight + bombHeight;
- copy_object_scale(o, o->parentObj);
+ obj_copy_scale(o, o->parentObj);
}
}
diff --git a/src/game/behaviors/water_bomb_cannon.inc.c b/src/game/behaviors/water_bomb_cannon.inc.c
@@ -4,18 +4,18 @@ void bhv_bubble_cannon_barrel_loop(void) {
struct Object *val04;
if (o->parentObj->oAction == 2) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
} else {
o->oMoveAngleYaw = o->parentObj->oFaceAngleYaw;
o->oMoveAnglePitch = o->parentObj->oMoveAnglePitch + 0x4000;
o->oFaceAnglePitch = o->parentObj->oMoveAnglePitch;
if ((o->oCannonBarrelBubblesUnkF4 += o->oForwardVel) > 0.0f) {
- func_802A2A38();
+ cur_obj_set_pos_via_transform();
obj_forward_vel_approach(-5.0f, 18.0f);
} else {
o->oCannonBarrelBubblesUnkF4 = 0.0f;
- copy_object_pos(o, o->parentObj);
+ obj_copy_pos(o, o->parentObj);
// check this
if (o->parentObj->oWaterCannonUnkF4 != 0) {
@@ -40,7 +40,7 @@ void bhv_bubble_cannon_barrel_loop(void) {
void water_bomb_cannon_act_0(void) {
if (o->oDistanceToMario < 2000.0f) {
spawn_object(o, MODEL_CANNON_BARREL, bhvCannonBarrelBubbles);
- obj_unhide();
+ cur_obj_unhide();
o->oAction = 1;
o->oMoveAnglePitch = o->oWaterCannonUnkFC = 0x1C00;
@@ -61,7 +61,7 @@ void water_bomb_cannon_act_1(void) {
if (o->oWaterCannonUnkF8 != 0) {
o->oWaterCannonUnkF8 -= 1;
} else {
- PlaySound2(SOUND_OBJ_CANNON4);
+ cur_obj_play_sound_2(SOUND_OBJ_CANNON4);
o->oWaterCannonUnkF4 = 70;
o->oWaterCannonUnkFC = 0x1000 + 0x400 * (RandomU16() & 0x3);
o->oWaterCannonUnk100 = -0x2000 + o->oMoveAngleYaw + 0x1000 * (RandomU16() % 5);
@@ -73,12 +73,12 @@ void water_bomb_cannon_act_1(void) {
}
void water_bomb_cannon_act_2(void) {
- obj_hide();
+ cur_obj_hide();
o->oAction = 0;
}
void bhv_water_bomb_cannon_loop(void) {
- obj_push_mario_away_from_cylinder(220.0f, 300.0f);
+ cur_obj_push_mario_away_from_cylinder(220.0f, 300.0f);
switch (o->oAction) {
case 0:
diff --git a/src/game/behaviors/water_mist_particle.inc.c b/src/game/behaviors/water_mist_particle.inc.c
@@ -2,7 +2,7 @@
// TODO: Is this really "mist"?
void bhv_water_mist_spawn_loop(void) {
- func_802ADBBC(0x20000);
+ clear_particle_flags(0x20000);
spawn_object(o, MODEL_MIST, bhvWaterMist);
}
@@ -10,12 +10,12 @@ void bhv_water_mist_loop(void) {
f32 sp1C;
if (o->oTimer == 0) {
o->oMoveAngleYaw = gMarioObject->oMoveAngleYaw;
- translate_object_xz_random(o, 10.0f);
+ obj_translate_xz_random(o, 10.0f);
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
o->oOpacity -= 42;
sp1C = (254 - o->oOpacity) / 254.0 * 1.0 + 0.5; // seen this before
- obj_scale(sp1C);
+ cur_obj_scale(sp1C);
if (o->oOpacity < 2)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
diff --git a/src/game/behaviors/water_objs.inc.c b/src/game/behaviors/water_objs.inc.c
@@ -2,7 +2,7 @@
// TODO: Better name, please
void bhv_water_air_bubble_init(void) {
- obj_scale(4.0f);
+ cur_obj_scale(4.0f);
}
// Fields 0xF4 & 0xF8 seem to be angles for bubble and cannon
@@ -13,35 +13,35 @@ void bhv_water_air_bubble_loop(void) {
o->header.gfx.scale[1] = -sins(o->oWaterObjUnkF4) * 0.5 + 4.0;
o->oWaterObjUnkF4 += 0x400;
if (o->oTimer < 30) {
- obj_become_intangible();
+ cur_obj_become_intangible();
o->oPosY += 3.0f;
} else {
- obj_become_tangible();
- obj_forward_vel_approach_upward(2.0f, 10.0f);
- o->oMoveAngleYaw = angle_to_object(o, gMarioObject);
- obj_move_using_fvel_and_gravity();
+ cur_obj_become_tangible();
+ cur_obj_forward_vel_approach_upward(2.0f, 10.0f);
+ o->oMoveAngleYaw = obj_angle_to_object(o, gMarioObject);
+ cur_obj_move_using_fvel_and_gravity();
}
o->oPosX += RandomFloat() * 4.0f - 2.0f;
o->oPosZ += RandomFloat() * 4.0f - 2.0f;
if (o->oInteractStatus & INT_STATUS_INTERACTED || o->oTimer > 200) {
- PlaySound2(SOUND_GENERAL_QUIET_BUBBLE);
- mark_object_for_deletion(o);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_BUBBLE);
+ obj_mark_for_deletion(o);
for (i = 0; i < 30; i++)
spawn_object(o, MODEL_BUBBLE, bhvBubbleMaybe);
}
if (find_water_level(o->oPosX, o->oPosZ) < o->oPosY)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oInteractStatus = 0;
}
void bhv_bubble_wave_init(void) {
o->oWaterObjUnkFC = 0x800 + (s32)(RandomFloat() * 2048.0f);
o->oWaterObjUnk100 = 0x800 + (s32)(RandomFloat() * 2048.0f);
- PlaySound2(SOUND_GENERAL_QUIET_BUBBLE);
+ cur_obj_play_sound_2(SOUND_GENERAL_QUIET_BUBBLE);
}
-void Unknown802A7E48(void) {
- obj_scale(RandomFloat() + 1.0);
+void scale_bubble_random(void) {
+ cur_obj_scale(RandomFloat() + 1.0);
}
void bhv_bubble_maybe_loop(void) {
@@ -64,13 +64,13 @@ void bhv_small_water_wave_loop(void) {
o->activeFlags = 0;
o->oPosY += 5.0f;
if (gFreeObjectList.next != NULL)
- spawn_object(o, MODEL_SPOT_ON_GROUND, bhvWaterSurfaceWhiteWave2);
+ spawn_object(o, MODEL_SMALL_WATER_SPLASH, bhvObjectWaterSplash);
}
if (o->oInteractStatus & INT_STATUS_INTERACTED)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
-void func_802A81C4(void) {
+void scale_bubble_sin(void) {
o->header.gfx.scale[0] = sins(o->oWaterObjUnkF4) * 0.5 + 2.0;
o->oWaterObjUnkF4 += o->oWaterObjUnkFC;
o->header.gfx.scale[1] = sins(o->oWaterObjUnkF8) * 0.5 + 2.0;
@@ -78,27 +78,27 @@ void func_802A81C4(void) {
}
void bhv_particle_init(void) {
- scale_object_xyz(o, 2.0f, 2.0f, 1.0f);
+ obj_scale_xyz(o, 2.0f, 2.0f, 1.0f);
o->oWaterObjUnkFC = 0x800 + (s32)(RandomFloat() * 2048.0f);
o->oWaterObjUnk100 = 0x800 + (s32)(RandomFloat() * 2048.0f);
- translate_object_xyz_random(o, 100.0f);
+ obj_translate_xyz_random(o, 100.0f);
}
void bhv_particle_loop() {
f32 sp24 = find_water_level(o->oPosX, o->oPosZ);
o->oPosY += 5.0f;
- translate_object_xz_random(o, 4.0f);
- func_802A81C4();
+ obj_translate_xz_random(o, 4.0f);
+ scale_bubble_sin();
if (o->oPosY > sp24 && o->oTimer) {
- mark_object_for_deletion(o);
- try_to_spawn_object(5, 0, o, MODEL_SPOT_ON_GROUND, bhvWaterSurfaceWhiteWave2);
+ obj_mark_for_deletion(o);
+ try_to_spawn_object(5, 0, o, MODEL_SMALL_WATER_SPLASH, bhvObjectWaterSplash);
}
}
void bhv_small_bubbles_loop(void) {
o->oPosY += 5.0f;
- translate_object_xz_random(o, 4.0f);
- func_802A81C4();
+ obj_translate_xz_random(o, 4.0f);
+ scale_bubble_sin();
}
void bhv_fish_group_loop(void) {
diff --git a/src/game/behaviors/water_pillar.inc.c b/src/game/behaviors/water_pillar.inc.c
@@ -1,12 +1,12 @@
// water_pillar.c.inc
-void func_802B95A4(void) {
+void water_level_pillar_undrained(void) {
struct Object *sp1C;
switch (o->oAction) {
case 0:
- if (obj_is_mario_ground_pounding_platform()) {
+ if (cur_obj_is_mario_ground_pounding_platform()) {
o->oAction++;
- func_802A3004();
+ spawn_mist_particles();
}
break;
case 1:
@@ -16,14 +16,14 @@ void func_802B95A4(void) {
o->oAction++;
break;
case 2:
- sp1C = obj_nearest_object_with_behavior(bhvWaterLevelPillar);
+ sp1C = cur_obj_nearest_object_with_behavior(bhvWaterLevelPillar);
if (sp1C != NULL) {
if (sp1C->oAction < 2)
o->oAction++;
}
break;
case 3:
- sp1C = obj_nearest_object_with_behavior(bhvWaterLevelPillar);
+ sp1C = cur_obj_nearest_object_with_behavior(bhvWaterLevelPillar);
if (sp1C != NULL) {
if (sp1C->oAction > 1) {
o->oAction++;
@@ -34,7 +34,7 @@ void func_802B95A4(void) {
}
break;
case 4:
- PlaySound(SOUND_ENV_WATER_DRAIN);
+ cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN);
if (o->oTimer < 300) {
gEnvironmentLevels[2] =
(s32) approach_f32_symmetric(gEnvironmentLevels[2], -2450.0f, 5.0f);
@@ -48,7 +48,7 @@ void func_802B95A4(void) {
}
}
-void func_802B97E4(void) {
+void water_level_pillar_drained(void) {
if (o->oTimer == 0) {
o->oPosY -= 80.0f;
gEnvironmentLevels[2] = -2450;
@@ -63,9 +63,9 @@ void bhv_water_level_pillar_init(void) {
void bhv_water_level_pillar_loop(void) {
if (o->oWaterLevelPillarUnkF8)
- func_802B97E4();
+ water_level_pillar_drained();
else
- func_802B95A4();
+ water_level_pillar_undrained();
gEnvironmentRegions[18] = gEnvironmentLevels[2];
gEnvironmentRegions[6] = gEnvironmentLevels[0];
}
diff --git a/src/game/behaviors/water_ring.inc.c b/src/game/behaviors/water_ring.inc.c
@@ -1,6 +1,6 @@
// water_ring.c.inc
-f32 WaterRingCalcMarioDistInFront(void) {
+f32 water_ring_calc_mario_dist(void) {
f32 marioDistX = o->oPosX - gMarioObject->header.gfx.pos[0];
f32 marioDistY = o->oPosY - (gMarioObject->header.gfx.pos[1] + 80.0f);
f32 marioDistZ = o->oPosZ - gMarioObject->header.gfx.pos[2];
@@ -10,8 +10,8 @@ f32 WaterRingCalcMarioDistInFront(void) {
return marioDistInFront;
}
-void WaterRingInit(void) {
- SetObjAnimation(0);
+void water_ring_init(void) {
+ cur_obj_init_animation(0);
o->oWaterRingScalePhaseX = (s32)(RandomFloat() * 4096.0f) + 0x1000;
o->oWaterRingScalePhaseY = (s32)(RandomFloat() * 4096.0f) + 0x1000;
o->oWaterRingScalePhaseZ = (s32)(RandomFloat() * 4096.0f) + 0x1000;
@@ -25,7 +25,7 @@ void WaterRingInit(void) {
o->oWaterRingNormalY = coss(o->oFaceAnglePitch) * coss(o->oFaceAngleRoll);
o->oWaterRingNormalZ = sins(o->oFaceAnglePitch);
- o->oWaterRingMarioDistInFront = WaterRingCalcMarioDistInFront();
+ o->oWaterRingMarioDistInFront = water_ring_calc_mario_dist();
// Adding this code will alter the ring's graphical orientation to align with the faulty
// collision orientation:
@@ -35,17 +35,17 @@ void WaterRingInit(void) {
}
void bhv_jet_stream_water_ring_init(void) {
- WaterRingInit();
+ water_ring_init();
o->oOpacity = 70;
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
o->oFaceAnglePitch = 0x8000;
}
// sp28 = arg0
// sp2c = ringManager
-void CheckWaterRingCollection(f32 avgScale, struct Object *ringManager) {
- f32 marioDistInFront = WaterRingCalcMarioDistInFront();
+void water_ring_check_collection(f32 avgScale, struct Object *ringManager) {
+ f32 marioDistInFront = water_ring_calc_mario_dist();
struct Object *ringSpawner;
if (!is_point_close_to_object(o, gMarioObject->header.gfx.pos[0],
@@ -83,7 +83,7 @@ void CheckWaterRingCollection(f32 avgScale, struct Object *ringManager) {
o->oWaterRingMarioDistInFront = marioDistInFront;
}
-void SetWaterRingScale(f32 avgScale) {
+void water_ring_set_scale(f32 avgScale) {
o->header.gfx.scale[0] = sins(o->oWaterRingScalePhaseX) * 0.1 + avgScale;
o->header.gfx.scale[1] = sins(o->oWaterRingScalePhaseY) * 0.5 + avgScale;
o->header.gfx.scale[2] = sins(o->oWaterRingScalePhaseZ) * 0.1 + avgScale;
@@ -92,7 +92,7 @@ void SetWaterRingScale(f32 avgScale) {
o->oWaterRingScalePhaseZ += 0x1700;
}
-void WaterRingCollectedLoop(void) {
+void water_ring_act_collected(void) {
f32 avgScale = (f32) o->oTimer * 0.2 + o->oWaterRingAvgScale;
if (o->oTimer >= 21)
@@ -102,10 +102,10 @@ void WaterRingCollectedLoop(void) {
if (o->oOpacity < 0)
o->oOpacity = 0;
- SetWaterRingScale(avgScale);
+ water_ring_set_scale(avgScale);
}
-void JetStreamWaterRingNotCollectedLoop(void) {
+void water_ring_act_not_collected(void) {
f32 avgScale = (f32) o->oTimer / 225.0 * 3.0 + 0.5;
//! In this case ringSpawner and ringManager are the same object,
@@ -119,8 +119,8 @@ void JetStreamWaterRingNotCollectedLoop(void) {
o->activeFlags = 0;
}
- CheckWaterRingCollection(avgScale, ringManager);
- SetWaterRingScale(avgScale);
+ water_ring_check_collection(avgScale, ringManager);
+ water_ring_set_scale(avgScale);
o->oPosY += 10.0f;
o->oFaceAngleYaw += 0x100;
@@ -136,21 +136,21 @@ void JetStreamWaterRingNotCollectedLoop(void) {
void bhv_jet_stream_water_ring_loop(void) {
switch (o->oAction) {
case WATER_RING_ACT_NOT_COLLECTED:
- JetStreamWaterRingNotCollectedLoop();
+ water_ring_act_not_collected();
break;
case WATER_RING_ACT_COLLECTED:
- WaterRingCollectedLoop();
+ water_ring_act_collected();
break;
}
}
-void Unknown802EB8A4(void) {
+void spawn_manta_ray_ring_manager(void) {
struct Object *ringManager = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager);
o->parentObj = ringManager;
}
-void JetStreamRingSpawnerActiveLoop(void) {
+void water_ring_spawner_act_inactive(void) {
//! The Jet Stream Ring Spawner is its own parent object. The code may have been copied
// from the Manta Ray, which spawns rings but also has a Ring Manager object as its
// parent. The Jet Stream Ring Spawner functions as both a spawner and a Ring Manager.
@@ -175,12 +175,12 @@ void JetStreamRingSpawnerActiveLoop(void) {
void bhv_jet_stream_ring_spawner_loop(void) {
switch (o->oAction) {
case JS_RING_SPAWNER_ACT_ACTIVE:
- JetStreamRingSpawnerActiveLoop();
+ water_ring_spawner_act_inactive();
if (o->oWaterRingSpawnerRingsCollected == 5) {
- func_802A3004();
+ spawn_mist_particles();
- create_star(3400.0f, -3200.0f, -500.0f);
+ spawn_default_star(3400.0f, -3200.0f, -500.0f);
o->oAction = JS_RING_SPAWNER_ACT_INACTIVE;
}
@@ -192,11 +192,11 @@ void bhv_jet_stream_ring_spawner_loop(void) {
}
void bhv_manta_ray_water_ring_init(void) {
- WaterRingInit();
+ water_ring_init();
o->oOpacity = 150;
}
-void MantaRayWaterRingNotCollectedLoop(void) {
+void manta_water_ring_act_not_collected(void) {
f32 avgScale = (f32) o->oTimer / 50.0f * 1.3 + 0.1;
struct Object *ringSpawner = o->parentObj;
struct Object *ringManager = ringSpawner->parentObj;
@@ -210,8 +210,8 @@ void MantaRayWaterRingNotCollectedLoop(void) {
o->activeFlags = 0;
}
- CheckWaterRingCollection(avgScale, ringManager);
- SetWaterRingScale(avgScale);
+ water_ring_check_collection(avgScale, ringManager);
+ water_ring_set_scale(avgScale);
set_object_visibility(o, 5000);
if (ringSpawner->oWaterRingSpawnerRingsCollected == 4
@@ -224,11 +224,11 @@ void MantaRayWaterRingNotCollectedLoop(void) {
void bhv_manta_ray_water_ring_loop(void) {
switch (o->oAction) {
case WATER_RING_ACT_NOT_COLLECTED:
- MantaRayWaterRingNotCollectedLoop();
+ manta_water_ring_act_not_collected();
break;
case WATER_RING_ACT_COLLECTED:
- WaterRingCollectedLoop();
+ water_ring_act_collected();
break;
}
}
diff --git a/src/game/behaviors/water_splash.inc.c b/src/game/behaviors/water_splash.inc.c
@@ -1,90 +0,0 @@
-// water_splash.c.inc
-
-struct WaterSplashParams D_8032FDAC = {
- 2, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDrops, 0, 0, 5.0f, 3.0f, 30.0f, 20.0f, 0.5f, 1.0f
-};
-struct WaterSplashParams D_8032FDD0 = {
- 34, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDrops, 0, 0, 2.0f, 3.0f, 20.0f, 20.0f, 0.5f, 1.0f
-};
-struct WaterSplashParams D_8032FDF4 = { 34, MODEL_FISH, bhvWaterDrops, 0, 0, 2.0f,
- 3.0f, 20.0f, 20.0f, 1.0f, 0.0f };
-struct WaterSplashParams D_8032FE18 = {
- 98, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDrops, 0x6000, 0, 2.0f, 8.0f, 10.0f, 10.0f, 0.5f, 1.0f
-};
-
-void bhv_water_splash_loop(void) {
- s32 i;
- if (o->oTimer == 0)
- o->oPosY = find_water_level(o->oPosX, o->oPosZ);
- if (o->oPosY > -10000.0f)
- for (i = 0; i < 3; i++)
- spawn_water_splash(o, &D_8032FDAC);
-}
-
-void bhv_water_drops_loop(void) {
- UNUSED s32 unused;
- f32 sp20 = find_water_level(o->oPosX, o->oPosZ);
- if (o->oTimer == 0) {
- if (obj_has_model(MODEL_FISH))
- o->header.gfx.node.flags &= ~4;
- else
- o->header.gfx.node.flags |= 4;
- o->oFaceAngleYaw = RandomU16();
- }
- o->oVelY -= 4.0f;
- o->oPosY += o->oVelY;
- if (o->oVelY < 0.0f) {
- if (sp20 > o->oPosY) {
- try_to_spawn_object(0, 1.0f, o, MODEL_SPOT_ON_GROUND, bhvWaterSurfaceWhiteWave);
- mark_object_for_deletion(o);
- } else if (o->oTimer > 20)
- mark_object_for_deletion(o);
- }
- if (sp20 < -10000.0f)
- mark_object_for_deletion(o);
-}
-
-void bhv_surface_waves_loop(void) {
- copy_object_pos(o, gMarioObject);
- o->oPosY = gMarioStates->waterLevel + 5;
- if (!(gMarioObject->oMarioParticleFlags & 0x80)) {
- gMarioObject->oActiveParticleFlags &= 0xFF7F;
- o->activeFlags = 0;
- }
-}
-
-void bhv_water_surface_white_wave_init(void) {
- obj_scale(RandomFloat() + 1.5);
-}
-
-void bhv_object_bubble_ripples_init(void) {
- f32 sp1C = find_water_level(o->oPosX, o->oPosZ);
- scale_object_xyz(o, 0.5f, 1.0f, 0.5f);
- o->oPosY = sp1C + 5.0f;
-}
-
-void bhv_surface_wave_shrinking_init(void) {
- UNUSED struct Object *sp1C;
- if ((RandomU16() & 0xFF) <= 0) // weird
- {
- sp1C = spawn_water_splash(o, &D_8032FDF4);
- func_8029EE20(sp1C, blue_fish_seg3_anims_0301C2B0, 0);
- }
-}
-
-void bhv_wave_trail_loop(void) {
- f32 sp1C = find_water_level(o->oPosX, o->oPosZ);
- if (o->oTimer == 0)
- if (gGlobalTimer & 1)
- mark_object_for_deletion(o);
- o->oPosY = sp1C + 5.0f;
- if (o->oTimer == 0)
- o->oWaveTrailUnkF8 = o->header.gfx.scale[0];
- if (o->oAnimState > 3) {
- o->oWaveTrailUnkF8 = o->oWaveTrailUnkF8 - 0.1;
- if (o->oWaveTrailUnkF8 < 0.0f)
- o->oWaveTrailUnkF8 = 0.0f;
- o->header.gfx.scale[0] = o->oWaveTrailUnkF8;
- o->header.gfx.scale[2] = o->oWaveTrailUnkF8;
- }
-}
diff --git a/src/game/behaviors/water_splashes_and_waves.inc.c b/src/game/behaviors/water_splashes_and_waves.inc.c
@@ -0,0 +1,133 @@
+// water_splashes_and_waves.c.inc
+
+// Water droplets from Mario jumping in a pool of water.
+struct WaterDropletParams sWaterSplashDropletParams = {
+ /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE,
+ /* Model */ MODEL_WHITE_PARTICLE_SMALL,
+ /* Behavior */ bhvWaterDroplet,
+ /* Unused (flag-specific) */ 0, 0,
+ /* Random fvel offset, scale */ 5.0f, 3.0f,
+ /* Random yvel offset, scale */ 30.0f, 20.0f,
+ /* Random size offset, scale */ 0.5f, 1.0f
+};
+
+// Water droplets from Mario jumping in shallow water.
+struct WaterDropletParams sShallowWaterSplashDropletParams = {
+ /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL,
+ /* Model */ MODEL_WHITE_PARTICLE_SMALL,
+ /* Behavior */ bhvWaterDroplet,
+ /* Unused (flag-specific) */ 0, 0,
+ /* Random fvel offset, scale */ 2.0f, 3.0f,
+ /* Random yvel offset, scale */ 20.0f, 20.0f,
+ /* Random size offset, scale */ 0.5f, 1.0f
+};
+
+// The fish particle easter egg from Mario jumping in shallow water.
+struct WaterDropletParams sWaterDropletFishParams = {
+ /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL,
+ /* Model */ MODEL_FISH,
+ /* Behavior */ bhvWaterDroplet,
+ /* Unused (flag-specific) */ 0, 0,
+ /* Random fvel offset, scale */ 2.0f, 3.0f,
+ /* Random yvel offset, scale */ 20.0f, 20.0f,
+ /* Random size offset, scale */ 1.0f, 0.0f
+};
+
+// Water droplets from Mario running in shallow water.
+struct WaterDropletParams sShallowWaterWaveDropletParams = {
+ /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000 | WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL,
+ /* Model */ MODEL_WHITE_PARTICLE_SMALL,
+ /* Behavior */ bhvWaterDroplet,
+ /* Move angle range */ 0x6000,
+ /* Unused (flag-specific) */ 0,
+ /* Random fvel offset, scale */ 2.0f, 8.0f,
+ /* Random yvel offset, scale */ 10.0f, 10.0f,
+ /* Random size offset, scale */ 0.5f, 1.0f
+};
+
+
+void bhv_water_splash_spawn_droplets(void) {
+ s32 i;
+ if (o->oTimer == 0)
+ o->oPosY = find_water_level(o->oPosX, o->oPosZ);
+
+ if (o->oPosY > -10000.0f) // Make sure it is not at the default water level
+ for (i = 0; i < 3; i++)
+ spawn_water_droplet(o, &sWaterSplashDropletParams);
+}
+
+void bhv_water_droplet_loop(void) {
+ UNUSED u32 unusedVar;
+ f32 waterLevel = find_water_level(o->oPosX, o->oPosZ);
+
+ if (o->oTimer == 0) {
+ if (cur_obj_has_model(MODEL_FISH))
+ o->header.gfx.node.flags &= ~4;
+ else
+ o->header.gfx.node.flags |= 4;
+ o->oFaceAngleYaw = RandomU16();
+ }
+ // Apply gravity
+ o->oVelY -= 4.0f;
+ o->oPosY += o->oVelY;
+ // Check if fallen back into the water
+ if (o->oVelY < 0.0f) {
+ if (waterLevel > o->oPosY) {
+ // Create the smaller splash
+ try_to_spawn_object(0, 1.0f, o, MODEL_SMALL_WATER_SPLASH, bhvWaterDropletSplash);
+ obj_mark_for_deletion(o);
+ } else if (o->oTimer > 20)
+ obj_mark_for_deletion(o);
+ }
+ if (waterLevel < -10000.0f)
+ obj_mark_for_deletion(o);
+}
+
+void bhv_idle_water_wave_loop(void) {
+ obj_copy_pos(o, gMarioObject);
+ o->oPosY = gMarioStates->waterLevel + 5;
+ if (!(gMarioObject->oMarioParticleFlags & ACTIVE_PARTICLE_IDLE_WATER_WAVE)) {
+ gMarioObject->oActiveParticleFlags &= (u16)~ACTIVE_PARTICLE_IDLE_WATER_WAVE;
+ o->activeFlags = 0;
+ }
+}
+
+void bhv_water_droplet_splash_init(void) {
+ cur_obj_scale(RandomFloat() + 1.5);
+}
+
+void bhv_bubble_splash_init(void) {
+ f32 waterLevel = find_water_level(o->oPosX, o->oPosZ);
+ obj_scale_xyz(o, 0.5f, 1.0f, 0.5f);
+ o->oPosY = waterLevel + 5.0f;
+}
+
+void bhv_shallow_water_splash_init(void) {
+ struct Object *fishObj;
+ // Have a 1 in 256 chance to spawn the fish particle easter egg.
+ if ((RandomU16() & 0xFF) <= 0) // Strange
+ {
+ fishObj = spawn_water_droplet(o, &sWaterDropletFishParams);
+ obj_init_animation_with_sound(fishObj, blue_fish_seg3_anims_0301C2B0, 0);
+ }
+}
+
+void bhv_wave_trail_shrink(void) {
+ f32 waterLevel = find_water_level(o->oPosX, o->oPosZ);
+ // Destroy every other water wave to space them out (this is a terrible way of doing it)
+ if (o->oTimer == 0)
+ if (gGlobalTimer & 1)
+ obj_mark_for_deletion(o);
+ o->oPosY = waterLevel + 5.0f;
+
+ if (o->oTimer == 0)
+ o->oWaveTrailSize = o->header.gfx.scale[0];
+
+ if (o->oAnimState > 3) {
+ o->oWaveTrailSize = o->oWaveTrailSize - 0.1; // Shrink the wave
+ if (o->oWaveTrailSize < 0.0f)
+ o->oWaveTrailSize = 0.0f;
+ o->header.gfx.scale[0] = o->oWaveTrailSize;
+ o->header.gfx.scale[2] = o->oWaveTrailSize;
+ }
+}
diff --git a/src/game/behaviors/water_wave.inc.c b/src/game/behaviors/water_wave.inc.c
@@ -1,4 +1,5 @@
// water_wave.c.inc
+// TODO: Rename to avoid confusion with water_splashes_and_waves
void bhv_object_water_wave_init(void) {
o->oPosY = find_water_level(o->oPosX, o->oPosZ);
diff --git a/src/game/behaviors/wdw_water_level.inc.c b/src/game/behaviors/wdw_water_level.inc.c
@@ -23,7 +23,7 @@ void bhv_water_level_diamond_loop(void) {
o->oAction++; // Sets to WATER_LEVEL_DIAMOND_ACT_IDLE
break;
case WATER_LEVEL_DIAMOND_ACT_IDLE:
- if (are_objects_collided(o, gMarioObject)) {
+ if (obj_check_if_collided_with_object(o, gMarioObject)) {
if (gWDWWaterLevelChanging == 0) {
o->oAction++; // Sets to WATER_LEVEL_DIAMOND_ACT_CHANGE_WATER_LEVEL
gWDWWaterLevelChanging = 1;
@@ -41,18 +41,18 @@ void bhv_water_level_diamond_loop(void) {
o->oAngleVelYaw = 0x800;
} else {
if (o->oTimer == 0)
- PlaySound2(SOUND_GENERAL_WATER_LEVEL_TRIG);
+ cur_obj_play_sound_2(SOUND_GENERAL_WATER_LEVEL_TRIG);
else {
if (*gEnvironmentLevels > o->oWaterLevelTriggerTargetWaterLevel)
- PlaySound(SOUND_ENV_WATER_DRAIN);
+ cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN);
else
- PlaySound(SOUND_ENV_WATER_DRAIN); // same as above
+ cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN); // same as above
}
o->oAngleVelYaw = 0x800;
}
break;
case WATER_LEVEL_DIAMOND_ACT_IDLE_SPINNING:
- if (!are_objects_collided(o, gMarioObject)) {
+ if (!obj_check_if_collided_with_object(o, gMarioObject)) {
gWDWWaterLevelChanging = 0;
o->oAction = WATER_LEVEL_DIAMOND_ACT_IDLE;
o->oAngleVelYaw = 0;
diff --git a/src/game/behaviors/whirlpool.inc.c b/src/game/behaviors/whirlpool.inc.c
@@ -19,11 +19,11 @@ void bhv_whirlpool_init(void) {
o->oFaceAngleRoll = 0;
}
-void func_802E70A8(void) {
- set_object_hitbox(o, &sWhirlpoolHitbox);
+void whirlpool_set_hitbox(void) {
+ obj_set_hitbox(o, &sWhirlpoolHitbox);
}
-void func_802E70DC(void) {
+void whirpool_orient_graph(void) {
f32 cosPitch = coss(o->oFaceAnglePitch);
f32 sinPitch = sins(o->oFaceAnglePitch);
f32 cosRoll = coss(o->oFaceAngleRoll);
@@ -49,7 +49,7 @@ void bhv_whirlpool_loop(void) {
gEnvFxBubbleConfig[ENVFX_STATE_PITCH] = o->oWhirlpoolInitFacePitch;
gEnvFxBubbleConfig[ENVFX_STATE_YAW] = o->oWhirlpoolInitFaceRoll;
- func_802E70DC();
+ whirpool_orient_graph();
o->oFaceAngleYaw += 0x1F40;
} else {
@@ -57,9 +57,9 @@ void bhv_whirlpool_loop(void) {
gEnvFxBubbleConfig[ENVFX_STATE_PARTICLECOUNT] = 0;
}
- PlaySound(SOUND_ENV_WATER);
+ cur_obj_play_sound_1(SOUND_ENV_WATER);
- func_802E70A8();
+ whirlpool_set_hitbox();
}
void bhv_jet_stream_loop(void) {
@@ -71,5 +71,5 @@ void bhv_jet_stream_loop(void) {
} else
gEnvFxBubbleConfig[ENVFX_STATE_PARTICLECOUNT] = 0;
- PlaySound(SOUND_ENV_WATER);
+ cur_obj_play_sound_1(SOUND_ENV_WATER);
}
diff --git a/src/game/behaviors/white_puff.inc.c b/src/game/behaviors/white_puff.inc.c
@@ -4,17 +4,17 @@ void bhv_white_puff_1_loop(void) {
f32 sp1C = 0.1f;
f32 sp18 = 0.5f;
if (o->oTimer == 0) {
- translate_object_xz_random(o, 40.0f);
+ obj_translate_xz_random(o, 40.0f);
o->oPosY += 30.0f;
}
- obj_scale(o->oTimer * sp18 + sp1C);
+ cur_obj_scale(o->oTimer * sp18 + sp1C);
o->oOpacity = 50;
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
if (o->oTimer > 4)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
void bhv_white_puff_2_loop(void) {
if (o->oTimer == 0)
- translate_object_xz_random(o, 40.0f);
+ obj_translate_xz_random(o, 40.0f);
}
diff --git a/src/game/behaviors/white_puff_explode.inc.c b/src/game/behaviors/white_puff_explode.inc.c
@@ -3,7 +3,7 @@
void bhv_white_puff_exploding_loop(void) {
f32 sp24;
if (o->oTimer == 0) {
- obj_compute_vel_xz();
+ cur_obj_compute_vel_xz();
o->oWhitePuffUnkF4 = o->header.gfx.scale[0];
switch (o->oBehParams2ndByte) {
case 2:
@@ -18,20 +18,20 @@ void bhv_white_puff_exploding_loop(void) {
break;
}
}
- obj_move_using_vel_and_gravity();
- obj_apply_drag_xz(o->oDragStrength);
+ cur_obj_move_using_vel_and_gravity();
+ cur_obj_apply_drag_xz(o->oDragStrength);
if (o->oVelY > 100.0f)
o->oVelY = 100.0f;
if (o->oTimer > 20)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oOpacity) {
o->oOpacity += o->oWhitePuffUnkF8;
if (o->oOpacity < 2)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (o->oWhitePuffUnkFC)
sp24 = o->oWhitePuffUnkF4 * ((254 - o->oOpacity) / 254.0);
else
sp24 = o->oWhitePuffUnkF4 * (o->oOpacity / 254.0);
- obj_scale(sp24);
+ cur_obj_scale(sp24);
}
}
diff --git a/src/game/behaviors/whomp.inc.c b/src/game/behaviors/whomp.inc.c
@@ -1,44 +1,44 @@
// whomp.c.inc
-void func_802C61CC(void) {
+void whomp_play_sfx_from_pound_animation(void) {
UNUSED s32 sp2C = o->header.gfx.unk38.animFrame;
s32 sp28 = 0;
if (o->oForwardVel < 5.0f) {
- sp28 = obj_check_anim_frame(0);
- sp28 |= obj_check_anim_frame(23);
+ sp28 = cur_obj_check_anim_frame(0);
+ sp28 |= cur_obj_check_anim_frame(23);
} else {
- sp28 = obj_check_anim_frame_in_range(0, 3);
- sp28 |= obj_check_anim_frame_in_range(23, 3);
+ sp28 = cur_obj_check_anim_frame_in_range(0, 3);
+ sp28 |= cur_obj_check_anim_frame_in_range(23, 3);
}
if (sp28)
- PlaySound2(SOUND_OBJ_POUNDING1);
+ cur_obj_play_sound_2(SOUND_OBJ_POUNDING1);
}
-void ActionWhomp0(void) {
- func_8029ED98(0, 1.0f);
- obj_set_pos_to_home();
+void whomp_act_0(void) {
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
+ cur_obj_set_pos_to_home();
if (o->oBehParams2ndByte != 0) {
gSecondCameraFocus = o;
- obj_scale(2.0f);
+ cur_obj_scale(2.0f);
if (o->oSubAction == 0) {
if (o->oDistanceToMario < 600.0f) {
o->oSubAction++;
func_8031FFB4(0, 60, 40);
} else {
- obj_set_pos_to_home();
+ cur_obj_set_pos_to_home();
o->oHealth = 3;
}
- } else if (obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_114))
+ } else if (cur_obj_update_dialog_with_cutscene(2, 1, CUTSCENE_DIALOG, DIALOG_114))
o->oAction = 2;
} else if (o->oDistanceToMario < 500.0f)
o->oAction = 1;
- func_802C61CC();
+ whomp_play_sfx_from_pound_animation();
}
-void ActionWhomp7(void) {
+void whomp_act_7(void) {
if (o->oSubAction == 0) {
o->oForwardVel = 0.0f;
- func_8029ED98(0, 1.0f);
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
if (o->oTimer > 31)
o->oSubAction++;
else
@@ -48,65 +48,65 @@ void ActionWhomp7(void) {
if (o->oTimer > 42)
o->oAction = 1;
}
- func_802C61CC();
+ whomp_play_sfx_from_pound_animation();
}
-void ActionWhomp1(void) {
+void whomp_act_1(void) {
s16 sp26;
f32 sp20;
f32 sp1C;
sp26 = abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw);
- sp20 = obj_lateral_dist_to_home();
+ sp20 = cur_obj_lateral_dist_to_home();
if (gCurrLevelNum == LEVEL_BITS)
sp1C = 200.0f;
else
sp1C = 700.0f;
- func_8029ED98(0, 1.0f);
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
o->oForwardVel = 3.0f;
if (sp20 > sp1C)
o->oAction = 7;
else if (sp26 < 0x2000) {
if (o->oDistanceToMario < 1500.0f) {
o->oForwardVel = 9.0f;
- func_8029ED98(0, 3.0f);
+ cur_obj_init_animation_with_accel_and_sound(0, 3.0f);
}
if (o->oDistanceToMario < 300.0f)
o->oAction = 3;
}
- func_802C61CC();
+ whomp_play_sfx_from_pound_animation();
}
-void ActionWhomp2(void) {
+void whomp_act_2(void) {
s16 sp1E;
- func_8029ED98(0, 1.0f);
+ cur_obj_init_animation_with_accel_and_sound(0, 1.0f);
o->oForwardVel = 3.0f;
- obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
+ cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200);
if (o->oTimer > 30) {
sp1E = abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw);
if (sp1E < 0x2000) {
if (o->oDistanceToMario < 1500.0f) {
o->oForwardVel = 9.0f;
- func_8029ED98(0, 3.0f);
+ cur_obj_init_animation_with_accel_and_sound(0, 3.0f);
}
if (o->oDistanceToMario < 300.0f)
o->oAction = 3;
}
}
- func_802C61CC();
- if (func_802A6AF8(1000.0f)) {
+ whomp_play_sfx_from_pound_animation();
+ if (mario_is_far_below_object(1000.0f)) {
o->oAction = 0;
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
}
-void ActionWhomp3(void) {
+void whomp_act_3(void) {
o->oForwardVel = 0.0f;
- func_8029ED98(1, 1.0f);
- if (func_8029F788())
+ cur_obj_init_animation_with_accel_and_sound(1, 1.0f);
+ if (cur_obj_check_if_near_animation_end())
o->oAction = 4;
}
-void ActionWhomp4(void) {
+void whomp_act_4(void) {
if (o->oTimer == 0)
o->oVelY = 40.0f;
if (o->oTimer < 8) {
@@ -121,10 +121,10 @@ void ActionWhomp4(void) {
}
}
-void ActionWhomp5(void) {
+void whomp_act_5(void) {
if (o->oSubAction == 0 && o->oMoveFlags & 1) {
- PlaySound2(SOUND_OBJ_WHOMP_LOWPRIO);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_play_sound_2(SOUND_OBJ_WHOMP_LOWPRIO);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
o->oVelY = 0.0f;
o->oSubAction++;
}
@@ -132,22 +132,22 @@ void ActionWhomp5(void) {
o->oAction = 6;
}
-void func_802C6954(void) {
+void king_whomp_on_ground(void) {
Vec3f pos;
if (o->oSubAction == 0) {
- if (obj_is_mario_ground_pounding_platform()) {
+ if (cur_obj_is_mario_ground_pounding_platform()) {
o->oHealth--;
- PlaySound2(SOUND_OBJ2_WHOMP_SOUND_SHORT);
- PlaySound2(SOUND_OBJ_KING_WHOMP_DEATH);
+ cur_obj_play_sound_2(SOUND_OBJ2_WHOMP_SOUND_SHORT);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_WHOMP_DEATH);
if (o->oHealth == 0)
o->oAction = 8;
else {
- func_802B8F7C(pos, &o->oPosX);
- func_802B8F7C(&o->oPosX, &gMarioObject->oPosX);
- func_802AA618(0, 0, 100.0f);
+ vec3f_copy_2(pos, &o->oPosX);
+ vec3f_copy_2(&o->oPosX, &gMarioObject->oPosX);
+ spawn_mist_particles_variable(0, 0, 100.0f);
spawn_triangle_break_particles(20, 138, 3.0f, 4);
- ShakeScreen(SHAKE_POS_SMALL);
- func_802B8F7C(&o->oPosX, pos);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
+ vec3f_copy_2(&o->oPosX, pos);
}
o->oSubAction++;
}
@@ -164,32 +164,32 @@ void func_802C6954(void) {
}
}
-void func_802C6B28(void) {
+void whomp_on_ground(void) {
if (o->oSubAction == 0) {
if (gMarioObject->platform == o) {
- if (obj_is_mario_ground_pounding_platform()) {
+ if (cur_obj_is_mario_ground_pounding_platform()) {
o->oNumLootCoins = 5;
- spawn_object_loot_yellow_coins(o, 5, 20.0f);
+ obj_spawn_loot_yellow_coins(o, 5, 20.0f);
o->oAction = 8;
} else {
- obj_spawn_loot_coin_at_mario_pos();
+ cur_obj_spawn_loot_coin_at_mario_pos();
o->oSubAction++;
}
}
- } else if (!obj_is_mario_on_platform())
+ } else if (!cur_obj_is_mario_on_platform())
o->oSubAction = 0;
}
-void ActionWhomp6(void) {
+void whomp_act_6(void) {
if (o->oSubAction != 10) {
o->oForwardVel = 0.0f;
o->oAngleVelPitch = 0;
o->oAngleVelYaw = 0;
o->oAngleVelRoll = 0;
if (o->oBehParams2ndByte != 0)
- func_802C6954();
+ king_whomp_on_ground();
else
- func_802C6B28();
+ whomp_on_ground();
if (o->oTimer > 100 || (gMarioState->action == ACT_SQUISHED && o->oTimer > 30))
o->oSubAction = 10;
} else {
@@ -207,49 +207,49 @@ void ActionWhomp6(void) {
}
}
-void ActionWhomp8(void) {
+void whomp_act_8(void) {
if (o->oBehParams2ndByte != 0) {
- if (obj_update_dialog_with_cutscene(2, 2, CUTSCENE_DIALOG, DIALOG_115)) {
- set_object_angle(o, 0, 0, 0);
- obj_hide();
- obj_become_intangible();
- func_802AA618(0, 0, 200.0f);
+ if (cur_obj_update_dialog_with_cutscene(2, 2, CUTSCENE_DIALOG, DIALOG_115)) {
+ obj_set_angle(o, 0, 0, 0);
+ cur_obj_hide();
+ cur_obj_become_intangible();
+ spawn_mist_particles_variable(0, 0, 200.0f);
spawn_triangle_break_particles(20, 138, 3.0f, 4);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
o->oPosY += 100.0f;
- create_star(180.0f, 3880.0f, 340.0f);
- PlaySound2(SOUND_OBJ_KING_WHOMP_DEATH);
+ spawn_default_star(180.0f, 3880.0f, 340.0f);
+ cur_obj_play_sound_2(SOUND_OBJ_KING_WHOMP_DEATH);
o->oAction = 9;
}
} else {
- func_802AA618(0, 0, 100.0f);
+ spawn_mist_particles_variable(0, 0, 100.0f);
spawn_triangle_break_particles(20, 138, 3.0f, 4);
- ShakeScreen(SHAKE_POS_SMALL);
+ cur_obj_shake_screen(SHAKE_POS_SMALL);
create_sound_spawner(SOUND_OBJ_THWOMP);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
-void ActionWhomp9(void) {
+void whomp_act_9(void) {
if (o->oTimer == 60)
stop_background_music(SEQUENCE_ARGS(4, SEQ_EVENT_BOSS));
}
void (*sWhompActions[])(void) = {
- ActionWhomp0, ActionWhomp1, ActionWhomp2, ActionWhomp3, ActionWhomp4,
- ActionWhomp5, ActionWhomp6, ActionWhomp7, ActionWhomp8, ActionWhomp9
+ whomp_act_0, whomp_act_1, whomp_act_2, whomp_act_3, whomp_act_4,
+ whomp_act_5, whomp_act_6, whomp_act_7, whomp_act_8, whomp_act_9
};
// MM
void bhv_whomp_loop(void) {
- obj_update_floor_and_walls();
- obj_call_action_function(sWhompActions);
- obj_move_standard(-20);
+ cur_obj_update_floor_and_walls();
+ cur_obj_call_action_function(sWhompActions);
+ cur_obj_move_standard(-20);
if (o->oAction != 9) {
if (o->oBehParams2ndByte != 0)
- obj_hide_if_mario_far_away_y(2000.0f);
+ cur_obj_hide_if_mario_far_away_y(2000.0f);
else
- obj_hide_if_mario_far_away_y(1000.0f);
+ cur_obj_hide_if_mario_far_away_y(1000.0f);
load_object_collision_model();
}
}
diff --git a/src/game/behaviors/wiggler.inc.c b/src/game/behaviors/wiggler.inc.c
@@ -69,7 +69,7 @@ void bhv_wiggler_body_part_update(void) {
struct ChainSegment *segment = &o->parentObj->oWigglerSegments[o->oBehParams2ndByte];
f32 posOffset;
- obj_scale(o->parentObj->header.gfx.scale[0]);
+ cur_obj_scale(o->parentObj->header.gfx.scale[0]);
o->oFaceAnglePitch = segment->pitch;
o->oFaceAngleYaw = segment->yaw;
@@ -90,7 +90,7 @@ void bhv_wiggler_body_part_update(void) {
// while on the ground could cause the tail segments to clip through
// the floor
o->oPosY += -30.0f;
- obj_update_floor_height();
+ cur_obj_update_floor_height();
if (o->oFloorHeight > o->oPosY) // TODO: Check ineq swap
{
o->oPosY = o->oFloorHeight;
@@ -100,13 +100,13 @@ void bhv_wiggler_body_part_update(void) {
segment->posY = o->oPosY;
// Inherit walking animation speed from wiggler
- func_8029ED98(0, o->parentObj->oWigglerWalkAnimSpeed);
+ cur_obj_init_animation_with_accel_and_sound(0, o->parentObj->oWigglerWalkAnimSpeed);
if (o->parentObj->oWigglerWalkAnimSpeed == 0.0f) {
- func_8029F6F0();
+ cur_obj_reverse_animation();
}
if (o->parentObj->oAction == WIGGLER_ACT_SHRINK) {
- obj_become_intangible();
+ cur_obj_become_intangible();
} else {
obj_check_attacks(&sWigglerBodyPartHitbox, o->oAction);
}
@@ -144,13 +144,13 @@ void wiggler_init_segments(void) {
bodyPart =
spawn_object_relative(i, 0, 0, 0, o, MODEL_WIGGLER_BODY, bhvWigglerBody);
if (bodyPart != NULL) {
- func_8029EE20(bodyPart, wiggler_seg5_anims_0500C874, 0);
+ obj_init_animation_with_sound(bodyPart, wiggler_seg5_anims_0500C874, 0);
bodyPart->header.gfx.unk38.animFrame = (23 * i) % 26 - 1;
}
}
o->oAction = WIGGLER_ACT_WALK;
- obj_unhide();
+ cur_obj_unhide();
}
#if defined(VERSION_EU) || defined(AVOID_UB)
@@ -228,7 +228,7 @@ static void wiggler_act_walk(void) {
// If Mario is positioned below the wiggler, assume he entered through the
// lower cave entrance, so don't display text.
- if (gMarioObject->oPosY < o->oPosY || obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_150) != 0) {
+ if (gMarioObject->oPosY < o->oPosY || cur_obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, DIALOG_150) != 0) {
o->oWigglerTextStatus = WIGGLER_TEXT_STATUS_COMPLETED_DIALOG;
}
} else {
@@ -266,7 +266,7 @@ static void wiggler_act_walk(void) {
// If moving at high speeds, could overflow. But can't reach such speeds
// in practice
yawTurnSpeed = (s16)(30.0f * o->oForwardVel);
- obj_rotate_yaw_toward(o->oWigglerTargetYaw, yawTurnSpeed);
+ cur_obj_rotate_yaw_toward(o->oWigglerTargetYaw, yawTurnSpeed);
obj_face_yaw_approach(o->oMoveAngleYaw, 2 * yawTurnSpeed);
obj_face_pitch_approach(0, 0x320);
@@ -304,18 +304,18 @@ static void wiggler_act_jumped_on(void) {
// defeated) or go back to walking
if (o->header.gfx.scale[1] >= 4.0f) {
if (o->oTimer > 30) {
- if (obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, attackText[o->oHealth - 2]) != 0) {
+ if (cur_obj_update_dialog_with_cutscene(2, 0, CUTSCENE_DIALOG, attackText[o->oHealth - 2]) != 0) {
// Because we don't want the wiggler to disappear after being
// defeated, we leave its health at 1
if (--o->oHealth == 1) {
o->oAction = WIGGLER_ACT_SHRINK;
- obj_become_intangible();
+ cur_obj_become_intangible();
} else {
o->oAction = WIGGLER_ACT_WALK;
o->oMoveAngleYaw = o->oFaceAngleYaw;
if (o->oHealth == 2) {
- PlaySound2(SOUND_OBJ_WIGGLER_JUMP);
+ cur_obj_play_sound_2(SOUND_OBJ_WIGGLER_JUMP);
o->oForwardVel = 10.0f;
o->oVelY = 70.0f;
}
@@ -353,16 +353,16 @@ static void wiggler_act_knockback(void) {
static void wiggler_act_shrink(void) {
if (o->oTimer >= 20) {
if (o->oTimer == 20) {
- PlaySound2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
+ cur_obj_play_sound_2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK);
}
// 4 is the default scale, so shrink to 1/4 of regular size
if (approach_f32_ptr(&o->header.gfx.scale[0], 1.0f, 0.1f)) {
- create_star(0.0f, 2048.0f, 0.0f);
+ spawn_default_star(0.0f, 2048.0f, 0.0f);
o->oAction = WIGGLER_ACT_FALL_THROUGH_FLOOR;
}
- obj_scale(o->header.gfx.scale[0]);
+ cur_obj_scale(o->header.gfx.scale[0]);
}
}
@@ -380,7 +380,7 @@ static void wiggler_act_fall_through_floor(void) {
o->oFaceAnglePitch = obj_get_pitch_from_vel();
}
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
}
@@ -389,7 +389,7 @@ static void wiggler_act_fall_through_floor(void) {
* Stop and enter the jumped on action.
*/
void wiggler_jumped_on_attack_handler(void) {
- PlaySound2(SOUND_OBJ_WIGGLER_ATTACKED);
+ cur_obj_play_sound_2(SOUND_OBJ_WIGGLER_ATTACKED);
o->oAction = WIGGLER_ACT_JUMPED_ON;
o->oForwardVel = o->oVelY = 0.0f;
o->oWigglerSquishSpeed = 0.4f;
@@ -410,15 +410,15 @@ void bhv_wiggler_update(void) {
treat_far_home_as_mario(1200.0f);
// Walking animation and sound
- func_8029ED98(0, o->oWigglerWalkAnimSpeed);
+ cur_obj_init_animation_with_accel_and_sound(0, o->oWigglerWalkAnimSpeed);
if (o->oWigglerWalkAnimSpeed != 0.0f) {
func_802F9378(0, 13,
o->oHealth >= 4 ? SOUND_OBJ_WIGGLER_LOW_PITCH : SOUND_OBJ_WIGGLER_HIGH_PITCH);
} else {
- func_8029F6F0();
+ cur_obj_reverse_animation();
}
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
switch (o->oAction) {
case WIGGLER_ACT_WALK:
wiggler_act_walk();
@@ -437,7 +437,7 @@ void bhv_wiggler_update(void) {
break;
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
// Update segment 0 with data from the wiggler object
diff --git a/src/game/behaviors/wind.inc.c b/src/game/behaviors/wind.inc.c
@@ -1,6 +1,6 @@
// wind.c.inc
-void func_802ADC20(s16 pitch, s16 yaw) {
+void spawn_wind_particles(s16 pitch, s16 yaw) {
s32 i;
for (i = 0; i < 3; i++) {
struct Object *wind = spawn_object(o, MODEL_MIST, bhvWind);
@@ -15,25 +15,25 @@ void bhv_wind_loop(void) {
if (o->oTimer == 0) {
o->oOpacity = 100;
if (o->oMoveAnglePitch == 0) {
- translate_object_xz_random(o, 900.0f);
+ obj_translate_xz_random(o, 900.0f);
o->oPosX += sins(o->oMoveAngleYaw + 0x8000) * sp2E; // NOP as Pitch is 0
o->oPosY += 80.0f + random_f32_around_zero(200.0f);
o->oPosZ += coss(o->oMoveAngleYaw + 0x8000) * sp2E; // -coss(a) * sp2E
o->oMoveAngleYaw += random_f32_around_zero(4000.0f);
o->oForwardVel = RandomFloat() * 70.0f + 50.0f;
} else {
- translate_object_xz_random(o, 600.0f);
+ obj_translate_xz_random(o, 600.0f);
o->oPosY -= sp2E - 200; // 300
o->oVelY = RandomFloat() * 30.0f + 50.0f;
o->oMoveAngleYaw = RandomU16();
o->oForwardVel = 10.0f;
}
obj_set_billboard(o);
- obj_scale(sp28);
+ cur_obj_scale(sp28);
}
if (o->oTimer > 8)
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
o->oFaceAnglePitch += 4000.0f + 2000.0f * RandomFloat();
o->oFaceAngleYaw += 4000.0f + 2000.0f * RandomFloat();
- obj_move_using_fvel_and_gravity();
+ cur_obj_move_using_fvel_and_gravity();
}
diff --git a/src/game/behaviors/wind_particle.inc.c b/src/game/behaviors/wind_particle.inc.c
@@ -1,52 +0,0 @@
-// wind_particle.c.inc
-
-struct ObjectHitbox sWindParticleHitbox = {
- /* interactType: */ INTERACT_WIND,
- /* downOffset: */ 0,
- /* damageOrCoinValue: */ 0,
- /* health: */ 0,
- /* numLootCoins: */ 0,
- /* radius: */ 20,
- /* height: */ 70,
- /* hurtboxRadius: */ 20,
- /* hurtboxHeight: */ 70,
-};
-
-void bhv_white_wind_particle_loop(void) {
- struct Object *sp34;
- f32 sp30;
- f32 sp2C;
- f32 sp28;
- set_object_hitbox(o, &sWindParticleHitbox);
- if (o->oTimer == 0) {
- o->oWhiteWindParticleUnkF4 = obj_nearest_object_with_behavior(bhvWalkingPenguin);
- translate_object_xyz_random(o, 100.0f);
- o->oForwardVel = coss(o->oMoveAnglePitch) * 100.0f;
- o->oVelY = sins(o->oMoveAnglePitch) * -100.0f;
- o->oMoveAngleYaw += random_f32_around_zero(o->oBehParams2ndByte * 500);
- o->oOpacity = 100;
- }
- obj_move_using_fvel_and_gravity();
- if (o->oTimer > 15)
- mark_object_for_deletion(o);
- sp34 = o->oWhiteWindParticleUnkF4;
- if (sp34 != 0) {
- sp2C = sp34->oWalkingPenguinUnk100 - o->oPosX;
- sp28 = sp34->oWalkingPenguinUnk104 - o->oPosZ;
- sp30 = sqrtf(sp2C * sp2C + sp28 * sp28);
- if (sp30 < 300.0f) {
- mark_object_for_deletion(o);
- obj_become_intangible();
- }
- }
-}
-
-void func_802C76E0(s32 a0, f32 a1, f32 a2, f32 a3, f32 a4) {
- if ((gGlobalTimer & 1) != 0) {
- spawn_object_relative_with_scale(a0, a2, a3, a4, 0.5f, o, MODEL_WHITE_PARTICLE_DL,
- bhvTinyWhiteWindParticle);
- spawn_object_relative_with_scale(a0, a2, a3, a4, a1, o, MODEL_NONE, bhvWindParticle);
- } else
- spawn_object_relative_with_scale(a0, a2, a3, a4, a1, o, MODEL_MIST, bhvWindParticle);
- spawn_object_relative_with_scale(a0, a2, a3, a4, a1, o, MODEL_NONE, bhvWindParticle);
-}
diff --git a/src/game/behaviors/yoshi.inc.c b/src/game/behaviors/yoshi.inc.c
@@ -26,9 +26,9 @@ void yoshi_walk_loop(void) {
if (is_point_close_to_object(o, o->oHomeX, 3174.0f, o->oHomeZ, 200))
o->oAction = YOSHI_ACT_IDLE;
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
if (sp24 == 0 || sp24 == 15)
- PlaySound2(SOUND_GENERAL_YOSHI_WALK);
+ cur_obj_play_sound_2(SOUND_GENERAL_YOSHI_WALK);
if (o->oInteractStatus == INT_STATUS_INTERACTED)
o->oAction = YOSHI_ACT_TALK;
@@ -58,7 +58,7 @@ void yoshi_idle_loop(void) {
o->oAction = YOSHI_ACT_WALK;
}
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
if (o->oInteractStatus == INT_STATUS_INTERACTED)
o->oAction = YOSHI_ACT_TALK;
@@ -74,7 +74,7 @@ void yoshi_idle_loop(void) {
void yoshi_talk_loop(void) {
if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) {
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
if (set_mario_npc_dialog(1) == 2) {
o->activeFlags |= 0x20;
if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_161)) {
@@ -87,7 +87,7 @@ void yoshi_talk_loop(void) {
}
}
} else {
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
play_puzzle_jingle();
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x500);
}
@@ -98,14 +98,14 @@ void yoshi_walk_and_jump_off_roof_loop(void) {
o->oForwardVel = 10.0f;
object_step();
- SetObjAnimation(1);
+ cur_obj_init_animation(1);
if (o->oTimer == 0)
cutscene_object(CUTSCENE_STAR_SPAWN, o);
o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oYoshiTargetYaw, 0x500);
if (is_point_close_to_object(o, o->oHomeX, 3174.0f, o->oHomeZ, 200)) {
- SetObjAnimation(2);
- PlaySound2(SOUND_GENERAL_ENEMY_ALERT1);
+ cur_obj_init_animation(2);
+ cur_obj_play_sound_2(SOUND_GENERAL_ENEMY_ALERT1);
o->oForwardVel = 50.0f;
o->oVelY = 40.0f;
o->oMoveAngleYaw = -0x3FFF;
@@ -113,12 +113,12 @@ void yoshi_walk_and_jump_off_roof_loop(void) {
}
if (sp26 == 0 || sp26 == 15) {
- PlaySound2(SOUND_GENERAL_YOSHI_WALK);
+ cur_obj_play_sound_2(SOUND_GENERAL_YOSHI_WALK);
}
}
void yoshi_finish_jumping_and_despawn_loop(void) {
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
obj_move_xyz_using_fvel_and_yaw(o);
o->oVelY -= 2.0;
if (o->oPosY < 2100.0f) {
@@ -145,7 +145,7 @@ void yoshi_give_present_loop(void) {
}
}
-void BehYoshiLoop(void) {
+void bhv_yoshi_loop(void) {
switch (o->oAction) {
case YOSHI_ACT_IDLE:
yoshi_idle_loop();
@@ -172,9 +172,9 @@ void BehYoshiLoop(void) {
break;
case YOSHI_ACT_CREDITS:
- SetObjAnimation(0);
+ cur_obj_init_animation(0);
break;
}
- ObjRandomBlink(&o->oYoshiUnkF4);
+ curr_obj_random_blink(&o->oYoshiUnkF4);
}
diff --git a/src/game/camera.c b/src/game/camera.c
@@ -1707,7 +1707,7 @@ struct ParallelTrackingPoint sBBHLibraryParTrackPath[] = {
s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) {
}
-static void unused_80282678(UNUSED s32 unused) {
+static void stub_camera_1(UNUSED s32 unused) {
}
void mode_boss_fight_camera(struct Camera *c) {
@@ -3053,7 +3053,7 @@ void update_camera(struct Camera *c) {
c->defMode = gLakituState.defMode;
camera_course_processing(c);
- dummy_802877EC(c);
+ stub_camera_3(c);
sCButtonsPressed = find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed,
gPlayer1Controller->buttonDown);
@@ -3157,7 +3157,7 @@ void update_camera(struct Camera *c) {
}
// Start any mario-related cutscenes
start_cutscene(c, get_cutscene_from_mario_status(c));
- dummy_802877D8(c);
+ stub_camera_2(c);
gCheckingSurfaceCollisionsForCamera = FALSE;
if (gCurrLevelNum != LEVEL_CASTLE) {
// If fixed camera is selected as the alternate mode, then fix the camera as long as the right
@@ -3529,10 +3529,10 @@ Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) {
return NULL;
}
-void dummy_802877D8(UNUSED struct Camera *c) {
+void stub_camera_2(UNUSED struct Camera *c) {
}
-void dummy_802877EC(UNUSED struct Camera *c) {
+void stub_camera_3(UNUSED struct Camera *c) {
}
void vec3f_sub(Vec3f dst, Vec3f src) {
@@ -5286,7 +5286,7 @@ void approach_camera_height(struct Camera *c, f32 goal, f32 inc) {
}
}
-void unused_8028C3AC(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) {
+void stub_camera_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) {
}
/**
@@ -7206,7 +7206,7 @@ void cutscene_unsoften_music(UNUSED struct Camera *c) {
sequence_player_unlower(0, 60);
}
-static void unused_802905C8(UNUSED struct Camera *c) {
+static void stub_camera_5(UNUSED struct Camera *c) {
}
BAD_RETURN(s32) cutscene_unused_start(UNUSED struct Camera *c) {
@@ -8175,7 +8175,6 @@ BAD_RETURN(s32) cutscene_bowser_arena_end(struct Camera *c) {
transition_next_state(c, 20);
sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE;
sModeOffsetYaw = sMarioCamState->faceAngle[1] + DEGREES(90);
- //! This appears to do nothing
gSecondCameraFocus->oBowserUnk88 = 2;
}
@@ -10000,22 +9999,22 @@ BAD_RETURN(s32) cutscene_enter_painting(struct Camera *c) {
set_fov_function(CAM_FOV_APP_20);
sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT;
- if (ripplingPainting != NULL) {
+ if (gRipplingPainting != NULL) {
paintingAngle[0] = 0;
- paintingAngle[1] = (s32)((ripplingPainting->vYRotation / 360.f) * 65536.f); // convert degrees to IAU
+ paintingAngle[1] = (s32)((gRipplingPainting->yaw / 360.f) * 65536.f); // convert degrees to IAU
paintingAngle[2] = 0;
- focusOffset[0] = ripplingPainting->vSize / 2;
+ focusOffset[0] = gRipplingPainting->size / 2;
focusOffset[1] = focusOffset[0];
focusOffset[2] = 0;
- paintingPos[0] = ripplingPainting->vXPos;
- paintingPos[1] = ripplingPainting->vYPos;
- paintingPos[2] = ripplingPainting->vZPos;
+ paintingPos[0] = gRipplingPainting->posX;
+ paintingPos[1] = gRipplingPainting->posY;
+ paintingPos[2] = gRipplingPainting->posZ;
offset_rotated(focus, paintingPos, focusOffset, paintingAngle);
approach_vec3f_asymptotic(c->focus, focus, 0.1f, 0.1f, 0.1f);
- focusOffset[2] = -(((ripplingPainting->vSize * 1000.f) / 2) / 307.f);
+ focusOffset[2] = -(((gRipplingPainting->size * 1000.f) / 2) / 307.f);
offset_rotated(focus, paintingPos, focusOffset, paintingAngle);
floorHeight = find_floor(focus[0], focus[1] + 500.f, focus[2], &highFloor) + 125.f;
diff --git a/src/game/camera.h b/src/game/camera.h
@@ -684,8 +684,8 @@ extern void reset_camera(struct Camera *);
extern void init_camera(struct Camera *);
extern void select_mario_cam_mode(void);
extern Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context);
-extern void dummy_802877D8(struct Camera *);
-extern void dummy_802877EC(struct Camera *);
+extern void stub_camera_2(struct Camera *);
+extern void stub_camera_3(struct Camera *);
extern void vec3f_sub(Vec3f dst, Vec3f src);
extern void object_pos_to_vec3f(Vec3f, struct Object *);
extern void vec3f_to_object_pos(struct Object *, Vec3f); // static (ASM)
diff --git a/src/game/crash_screen.c b/src/game/crash_screen.c
@@ -4,7 +4,7 @@
#include "sm64.h"
-#ifdef VERSION_EU
+#if defined(VERSION_EU) || defined(VERSION_SH)
s32 _Printf(char *(*prout)(char *, const char *, size_t), char *dst, const char *fmt, va_list args);
diff --git a/src/game/debug.c b/src/game/debug.c
@@ -57,16 +57,16 @@ s8 sDebugInfoButtonSeqID = 0;
s16 sDebugInfoButtonSeq[] = { U_CBUTTONS, L_CBUTTONS, D_CBUTTONS, R_CBUTTONS, -1 };
// most likely present in an ifdef DEBUG build. TODO: check DD version?
-void Stub802C9890(void) {
+void stub_debug_1(void) {
}
-void Stub802C98A0(void) {
+void stub_debug_2(void) {
}
-void Stub802C98B0(void) {
+void stub_debug_3(void) {
}
-void Stub802C98C0(void) {
+void stub_debug_4(void) {
}
/*
@@ -436,7 +436,7 @@ static void try_modify_debug_controls(void) {
}
// possibly a removed debug control (TODO: check DD)
-void stub_802CA5D0(void) {
+void stub_debug_5(void) {
}
/*
@@ -521,7 +521,7 @@ void try_do_mario_debug_object_spawn(void) {
}
// TODO: figure out what this is
-static void Unknown802CA8B4(void) {
+static void debug_print_obj_move_flags(void) {
#ifndef VERSION_EU
if (gCurrentObject->oMoveFlags & OBJ_MOVE_LANDED) {
print_debug_top_down_objectinfo("BOUND %x", gCurrentObject->oMoveFlags);
@@ -554,7 +554,7 @@ static void Unknown802CA8B4(void) {
}
// unused, what is this?
-void Unknown802CAA84(s16 *enemyArr) {
+void debug_enemy_unknown(s16 *enemyArr) {
// copy b1-b4 over to an unknown s16 array
enemyArr[4] = gDebugInfo[DEBUG_PAGE_ENEMYINFO][1];
enemyArr[5] = gDebugInfo[DEBUG_PAGE_ENEMYINFO][2];
diff --git a/src/game/debug.h b/src/game/debug.h
@@ -20,7 +20,7 @@ extern void print_debug_top_down_mapinfo(const char * str, s32 number);
extern void print_debug_bottom_up(const char*,s32);
extern void debug_unknown_level_select_check(void);
extern void reset_debug_objectinfo(void);
-extern void stub_802CA5D0(void);
+extern void stub_debug_5(void);
extern void try_print_debug_mario_object_info(void);
extern void try_do_mario_debug_object_spawn(void);
extern void try_print_debug_mario_level_info(void);
diff --git a/src/game/display.c b/src/game/display.c
@@ -214,7 +214,7 @@ void end_master_display_list(void) {
create_task_structure();
}
-void func_80247D84(void) {
+void draw_reset_bars(void) {
s32 sp24;
s32 sp20;
s32 fbNum;
@@ -242,7 +242,7 @@ void func_80247D84(void) {
osRecvMesg(&gGameVblankQueue, &D_80339BEC, OS_MESG_BLOCK);
}
-void func_80247ED8(void) {
+void rendering_init(void) {
gGfxPool = &gGfxPools[0];
set_segment_base_addr(1, gGfxPool->buffer);
gGfxSPTask = &gGfxPool->spTask;
@@ -257,7 +257,7 @@ void func_80247ED8(void) {
gGlobalTimer++;
}
-void func_80247FAC(void) {
+void config_gfx_pool(void) {
gGfxPool = &gGfxPools[gGlobalTimer % 2];
set_segment_base_addr(1, gGfxPool->buffer);
gGfxSPTask = &gGfxPool->spTask;
diff --git a/src/game/display.h b/src/game/display.h
@@ -23,9 +23,9 @@ extern void clear_viewport(Vp *, s32);
void make_viewport_clip_rect(Vp *viewport);
extern void init_render_image(void);
extern void end_master_display_list(void);
-extern void func_80247D84(void);
-extern void func_80247ED8(void);
-extern void func_80247FAC(void);
+extern void draw_reset_bars(void);
+extern void rendering_init(void);
+extern void config_gfx_pool(void);
extern void display_and_vsync(void);
#endif /* _DISPLAY_H */
diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c
@@ -413,16 +413,16 @@ void envfx_bubbles_update_switch(s32 mode, Vec3s camTo, Vec3s vertex1, Vec3s ver
* Append 15 vertices to 'gfx', which is enough for 5 bubbles starting at
* 'index'. The 3 input vertices represent the roated triangle around (0,0,0)
* that will be translated to bubble positions to draw the bubble image
+ *
+ * TODO: (Scrub C)
*/
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3,
- Vtx *template);
-GLOBAL_ASM("asm/non_matchings/eu/append_bubble_vertex_buffer.s")
-#else
void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3,
Vtx *template) {
s32 i = 0;
Vtx *vertBuf = alloc_display_list(15 * sizeof(Vtx));
+#ifdef VERSION_EU
+ Vtx *p;
+#endif
if (vertBuf == NULL) {
return;
@@ -430,24 +430,47 @@ void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s verte
for (i = 0; i < 15; i += 3) {
vertBuf[i] = template[0];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[0].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex1[0];
+ p[0].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex1[1];
+ p[0].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex1[2];
+#else
vertBuf[i].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex1[0];
vertBuf[i].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex1[1];
vertBuf[i].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex1[2];
+#endif
vertBuf[i + 1] = template[1];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[1].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex2[0];
+ p[1].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex2[1];
+ p[1].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex2[2];
+#else
vertBuf[i + 1].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex2[0];
vertBuf[i + 1].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex2[1];
vertBuf[i + 1].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex2[2];
+#endif
vertBuf[i + 2] = template[2];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[2].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex3[0];
+ p[2].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex3[1];
+ p[2].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex3[2];
+#else
vertBuf[i + 2].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex3[0];
vertBuf[i + 2].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex3[1];
vertBuf[i + 2].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex3[2];
+#endif
}
gSPVertex(gfx, VIRTUAL_TO_PHYSICAL(vertBuf), 15, 0);
}
-#endif
/**
* Appends to the enfvx display list a command setting the appropriate texture
diff --git a/src/game/envfx_snow.c b/src/game/envfx_snow.c
@@ -21,7 +21,7 @@
* implementation for flowers (unused), lava bubbles and jetstream bubbles
* can be found.
* The main entry point for envfx is at the bottom of this file, which is
- * called from geo_enfvx_main in level_geo.c
+ * called from geo_envfx_main in level_geo.c
*/
// Might be duplicate
@@ -340,14 +340,15 @@ void rotate_triangle_vertices(Vec3s vertex1, Vec3s vertex2, Vec3s vertex3, s16 p
* 'index' in the buffer. The 3 input vertices represent the roated triangle
* around (0,0,0) that will be translated to snowflake positions to draw the
* snowflake image.
+ *
+ * TODO: (Scrub C)
*/
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-void append_snowflake_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3);
-GLOBAL_ASM("asm/non_matchings/eu/append_snowflake_vertex_buffer.s")
-#else
void append_snowflake_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s vertex2, Vec3s vertex3) {
s32 i = 0;
Vtx *vertBuf = (Vtx *) alloc_display_list(15 * sizeof(Vtx));
+#ifdef VERSION_EU
+ Vtx *p;
+#endif
if (vertBuf == NULL) {
return;
@@ -355,24 +356,47 @@ void append_snowflake_vertex_buffer(Gfx *gfx, s32 index, Vec3s vertex1, Vec3s ve
for (i = 0; i < 15; i += 3) {
vertBuf[i] = gSnowTempVtx[0];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[0].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex1[0];
+ p[0].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex1[1];
+ p[0].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex1[2];
+#else
vertBuf[i].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex1[0];
vertBuf[i].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex1[1];
vertBuf[i].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex1[2];
+#endif
vertBuf[i + 1] = gSnowTempVtx[1];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[1].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex2[0];
+ p[1].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex2[1];
+ p[1].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex2[2];
+#else
vertBuf[i + 1].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex2[0];
vertBuf[i + 1].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex2[1];
vertBuf[i + 1].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex2[2];
+#endif
vertBuf[i + 2] = gSnowTempVtx[2];
+#ifdef VERSION_EU
+ p = vertBuf;
+ p += i;
+ p[2].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex3[0];
+ p[2].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex3[1];
+ p[2].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex3[2];
+#else
vertBuf[i + 2].v.ob[0] = gEnvFxBuffer[index + i / 3].xPos + vertex3[0];
vertBuf[i + 2].v.ob[1] = gEnvFxBuffer[index + i / 3].yPos + vertex3[1];
vertBuf[i + 2].v.ob[2] = gEnvFxBuffer[index + i / 3].zPos + vertex3[2];
+#endif
}
gSPVertex(gfx, VIRTUAL_TO_PHYSICAL(vertBuf), 15, 0);
}
-#endif
/**
* Updates positions of snow particles and returns a pointer to a display list
diff --git a/src/game/eu_translation.h b/src/game/eu_translation.h
@@ -1,26 +0,0 @@
-#ifndef EU_TRANSLATION_H
-#define EU_TRANSLATION_H
-
-#include "types.h"
-
-// EU translations are contained in three segment 0x19 compressed data blocks
-extern u8 _translation_en_mio0SegmentRomStart[];
-extern u8 _translation_en_mio0SegmentRomEnd[];
-extern u8 _translation_fr_mio0SegmentRomStart[];
-extern u8 _translation_fr_mio0SegmentRomEnd[];
-extern u8 _translation_de_mio0SegmentRomStart[];
-extern u8 _translation_de_mio0SegmentRomEnd[];
-
-extern void *dialog_table_eu_en[];
-extern void *course_name_table_eu_en[];
-extern void *act_name_table_eu_en[];
-
-extern void *dialog_table_eu_fr[];
-extern void *course_name_table_eu_fr[];
-extern void *act_name_table_eu_fr[];
-
-extern void *dialog_table_eu_de[];
-extern void *course_name_table_eu_de[];
-extern void *act_name_table_eu_de[];
-
-#endif /* EU_TRANSLATION_H */
diff --git a/src/game/game.c b/src/game/game.c
@@ -305,12 +305,12 @@ void thread5_game_loop(UNUSED void *arg) {
play_music(2, SEQUENCE_ARGS(0, SEQ_SOUND_PLAYER), 0);
set_sound_mode(save_file_get_sound_mode());
- func_80247ED8();
+ rendering_init();
while (1) {
// if the reset timer is active, run the process to reset the game.
if (gResetTimer) {
- func_80247D84();
+ draw_reset_bars();
continue;
}
profiler_log_thread5_time(THREAD5_START);
@@ -322,7 +322,7 @@ void thread5_game_loop(UNUSED void *arg) {
}
audio_game_loop_tick();
- func_80247FAC();
+ config_gfx_pool();
read_controller_inputs();
addr = level_script_execute(addr);
display_and_vsync();
diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c
@@ -35,7 +35,7 @@ u16 gDialogColorFadeTimer;
s8 gLastDialogLineNum;
s32 gDialogVariable;
u16 gDialogTextAlpha;
-#ifdef VERSION_EU
+#if defined(VERSION_EU)
s16 gDialogX; // D_8032F69A
s16 gDialogY; // D_8032F69C
#endif
@@ -317,7 +317,7 @@ void render_uppercase_diacritic(s16 *xPos, s16 *yPos, u8 letter, u8 diacritic) {
}
#endif // VERSION_EU
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
struct MultiTextEntry {
u8 length;
u8 str[4];
@@ -357,7 +357,7 @@ void render_multi_text_string(s16 *xPos, s16 *yPos, s8 multiTextID) // EU: 802AD
}
#endif
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define MAX_STRING_WIDTH 18
#else
#define MAX_STRING_WIDTH 16
@@ -448,7 +448,7 @@ void print_generic_string(s16 x, s16 y, const u8 *str) {
gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW);
break;
#endif
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
case DIALOG_CHAR_SLASH:
#ifdef VERSION_US
create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * 2), 0.0f, 0.0f);
@@ -781,7 +781,7 @@ s16 get_str_x_pos_from_center(s16 centerPos, u8 *str, UNUSED f32 scale) {
}
#endif
-#if defined(VERSION_JP) || defined(VERSION_EU)
+#if defined(VERSION_JP) || defined(VERSION_EU) || defined(VERSION_SH)
s16 get_str_x_pos_from_center_scale(s16 centerPos, u8 *str, f32 scale) {
s16 strPos = 0;
f32 charsWidth = 0.0f;
@@ -1061,7 +1061,7 @@ void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s
xMatrix[0] = 1;
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
void adjust_pos_and_print_period_char(s8 *xMatrix, s16 *linePos) {
if (linePos[0] != 0) {
create_dl_translation_matrix(MENU_MTX_NOPUSH, xMatrix[0] * 10, 0, 0);
@@ -1136,7 +1136,7 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos)
#endif
}
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
#ifdef VERSION_EU
void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s8 linesPerBox, UNUSED s16 linePos, s8 lowerBound, struct DialogEntry *dialog)
#else
@@ -1193,18 +1193,16 @@ u32 ensure_nonnegative(s16 value) {
return value;
}
-#if defined(VERSION_EU) && !defined(NON_MATCHING)
-// TODO: EU is not quite matching
-void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound);
-GLOBAL_ASM("asm/non_matchings/eu/handle_dialog_text_and_pages.s")
-#else
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog)
#else
void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound)
#endif
{
UNUSED s32 pad[2];
+#ifdef VERSION_EU
+ s16 startY = 14;
+#endif
u8 strChar;
@@ -1236,10 +1234,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
strIdx = gDialogTextPos;
#ifdef VERSION_EU
gDialogX = 0;
-
- // If this is turned into "gDialogY2 = 14;" with a symbol gDialogY2 that
- // alises gDialogY the code matches...
- gDialogY = 14;
+ gDialogY = startY;
#endif
if (gDialogBoxState == DIALOG_STATE_HORIZONTAL) {
@@ -1342,7 +1337,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
#endif
break;
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
case DIALOG_CHAR_PERIOD:
adjust_pos_and_print_period_char(&xMatrix, &linePos);
break;
@@ -1386,7 +1381,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
break;
#endif
default: // any other character
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
if (linePos != 0) {
create_dl_translation_matrix(MENU_MTX_NOPUSH, xMatrix * 10, 0, 0);
}
@@ -1463,7 +1458,6 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l
gLastDialogLineNum = lineNum;
}
-#endif
#ifdef VERSION_JP
#define X_VAL4_1 50
@@ -1503,7 +1497,7 @@ void render_dialog_triangle_choice(void) {
#define Y_VAL5_1 -16
#define Y_VAL5_2 5
#define X_Y_VAL6 0.8f
-#elif defined(VERSION_JP)
+#elif defined(VERSION_JP) || defined(VERSION_SH)
#define X_VAL5 123.0f
#define Y_VAL5_1 -20
#define Y_VAL5_2 2
@@ -1735,7 +1729,7 @@ void render_dialog_entries(void) {
gDialogBoxState = DIALOG_STATE_VERTICAL;
gDialogLineNum = 1;
}
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
lowerBound = 1;
#endif
break;
@@ -1752,7 +1746,7 @@ void render_dialog_entries(void) {
play_sound(SOUND_MENU_MESSAGE_NEXT_PAGE, gDefaultSoundArgs);
}
}
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
lowerBound = 1;
#endif
break;
@@ -1764,7 +1758,7 @@ void render_dialog_entries(void) {
gDialogBoxState = DIALOG_STATE_VERTICAL;
gDialogScrollOffsetY = 0;
}
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
lowerBound = (gDialogScrollOffsetY / 16) + 1;
#endif
break;
@@ -1791,7 +1785,7 @@ void render_dialog_entries(void) {
gLastDialogPageStrPos = 0;
gDialogResponse = 0;
}
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
lowerBound = 1;
#endif
break;
@@ -1808,7 +1802,7 @@ void render_dialog_entries(void) {
ensure_nonnegative(DIAG_VAL3 + dialog->leftOffset),
ensure_nonnegative(240 + ((dialog->linesPerBox * 80) / DIAG_VAL4) - dialog->width));
#endif
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
handle_dialog_text_and_pages(0, dialog);
#else
handle_dialog_text_and_pages(0, dialog, lowerBound);
@@ -1941,9 +1935,13 @@ void do_cutscene_handler(void) {
break;
}
#else
+#if defined(VERSION_SH)
+ // get the x coordinate of where the cutscene string starts.
+ x = get_str_x_pos_from_center_scale(gCutsceneMsgXOffset, gEndCutsceneStringsEn[gCutsceneMsgIndex], 10.0f);
+#else
// get the x coordinate of where the cutscene string starts.
x = get_str_x_pos_from_center(gCutsceneMsgXOffset, gEndCutsceneStringsEn[gCutsceneMsgIndex], 10.0f);
-
+#endif
print_generic_string(x, 240 - gCutsceneMsgYOffset, gEndCutsceneStringsEn[gCutsceneMsgIndex]);
#endif
@@ -2897,7 +2895,7 @@ void render_course_complete_lvl_info_and_hud_str(void) {
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define TXT_SAVEOPTIONS_X x + 10
#elif defined(VERSION_US)
#define TXT_SAVEOPTIONS_X x + 12
diff --git a/src/game/interaction.c b/src/game/interaction.c
@@ -20,24 +20,24 @@
#include "dialog_ids.h"
#include "course_table.h"
-#define INT_GROUND_POUND_OR_TWIRL (1 << 0) // 0x00000001
-#define INT_PUNCH (1 << 1) // 0x00000002
-#define INT_KICK (1 << 2) // 0x00000004
-#define INT_TRIP (1 << 3) // 0x00000008
-#define INT_SLIDE_KICK (1 << 4) // 0x00000010
-#define INT_FAST_ATTACK_OR_SHELL (1 << 5) // 0x00000020
-#define INT_HIT_FROM_ABOVE (1 << 6) // 0x00000040
-#define INT_HIT_FROM_BELOW (1 << 7) // 0x00000080
-
-#define INT_ATTACK_NOT_FROM_BELOW \
- (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \
+#define INT_GROUND_POUND_OR_TWIRL (1 << 0) // 0x01
+#define INT_PUNCH (1 << 1) // 0x02
+#define INT_KICK (1 << 2) // 0x04
+#define INT_TRIP (1 << 3) // 0x08
+#define INT_SLIDE_KICK (1 << 4) // 0x10
+#define INT_FAST_ATTACK_OR_SHELL (1 << 5) // 0x20
+#define INT_HIT_FROM_ABOVE (1 << 6) // 0x40
+#define INT_HIT_FROM_BELOW (1 << 7) // 0x80
+
+#define INT_ATTACK_NOT_FROM_BELOW \
+ (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \
| INT_FAST_ATTACK_OR_SHELL | INT_HIT_FROM_ABOVE)
-#define INT_ANY_ATTACK \
- (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \
+#define INT_ANY_ATTACK \
+ (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \
| INT_FAST_ATTACK_OR_SHELL | INT_HIT_FROM_ABOVE | INT_HIT_FROM_BELOW)
-#define INT_ATTACK_MASK_UNKNOWN_8F \
+#define INT_ATTACK_NOT_WEAK_FROM_ABOVE \
(INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_HIT_FROM_BELOW)
u8 sDelayInvincTimer;
@@ -54,7 +54,7 @@ u32 interact_cannon_base(struct MarioState *, u32, struct Object *);
u32 interact_igloo_barrier(struct MarioState *, u32, struct Object *);
u32 interact_tornado(struct MarioState *, u32, struct Object *);
u32 interact_whirlpool(struct MarioState *, u32, struct Object *);
-u32 interact_wind(struct MarioState *, u32, struct Object *);
+u32 interact_strong_wind(struct MarioState *, u32, struct Object *);
u32 interact_flame(struct MarioState *, u32, struct Object *);
u32 interact_snufit_bullet(struct MarioState *, u32, struct Object *);
u32 interact_clam_or_bubba(struct MarioState *, u32, struct Object *);
@@ -79,55 +79,58 @@ struct InteractionHandler {
};
static struct InteractionHandler sInteractionHandlers[] = {
- { INTERACT_COIN, interact_coin },
- { INTERACT_WATER_RING, interact_water_ring },
- { INTERACT_STAR_OR_KEY, interact_star_or_key },
- { INTERACT_BBH_ENTRANCE, interact_bbh_entrance },
- { INTERACT_WARP, interact_warp },
- { INTERACT_WARP_DOOR, interact_warp_door },
- { INTERACT_DOOR, interact_door },
- { INTERACT_CANNON_BASE, interact_cannon_base },
- { INTERACT_IGLOO_BARRIER, interact_igloo_barrier },
- { INTERACT_TORNADO, interact_tornado },
- { INTERACT_WHIRLPOOL, interact_whirlpool },
- { INTERACT_WIND, interact_wind },
- { INTERACT_FLAME, interact_flame },
- { INTERACT_SNUFIT_BULLET, interact_snufit_bullet },
- { INTERACT_CLAM_OR_BUBBA, interact_clam_or_bubba },
- { INTERACT_BULLY, interact_bully },
- { INTERACT_SHOCK, interact_shock },
- { INTERACT_TRAP_TURN, interact_bounce_top },
- { INTERACT_MR_BLIZZARD, interact_mr_blizzard },
+ { INTERACT_COIN, interact_coin },
+ { INTERACT_WATER_RING, interact_water_ring },
+ { INTERACT_STAR_OR_KEY, interact_star_or_key },
+ { INTERACT_BBH_ENTRANCE, interact_bbh_entrance },
+ { INTERACT_WARP, interact_warp },
+ { INTERACT_WARP_DOOR, interact_warp_door },
+ { INTERACT_DOOR, interact_door },
+ { INTERACT_CANNON_BASE, interact_cannon_base },
+ { INTERACT_IGLOO_BARRIER, interact_igloo_barrier },
+ { INTERACT_TORNADO, interact_tornado },
+ { INTERACT_WHIRLPOOL, interact_whirlpool },
+ { INTERACT_STRONG_WIND, interact_strong_wind },
+ { INTERACT_FLAME, interact_flame },
+ { INTERACT_SNUFIT_BULLET, interact_snufit_bullet },
+ { INTERACT_CLAM_OR_BUBBA, interact_clam_or_bubba },
+ { INTERACT_BULLY, interact_bully },
+ { INTERACT_SHOCK, interact_shock },
+ { INTERACT_TRAP_TURN, interact_bounce_top },
+ { INTERACT_MR_BLIZZARD, interact_mr_blizzard },
{ INTERACT_HIT_FROM_BELOW, interact_hit_from_below },
- { INTERACT_BOUNCE_TOP, interact_bounce_top },
- { INTERACT_DAMAGE, interact_damage },
- { INTERACT_POLE, interact_pole },
- { INTERACT_HOOT, interact_hoot },
- { INTERACT_BREAKABLE, interact_breakable },
- { INTERACT_KOOPA, interact_bounce_top },
- { INTERACT_KOOPA_SHELL, interact_koopa_shell },
- { INTERACT_UNKNOWN_08, interact_unknown_08 },
- { INTERACT_CAP, interact_cap },
- { INTERACT_GRABBABLE, interact_grabbable },
- { INTERACT_TEXT, interact_text },
+ { INTERACT_BOUNCE_TOP, interact_bounce_top },
+ { INTERACT_DAMAGE, interact_damage },
+ { INTERACT_POLE, interact_pole },
+ { INTERACT_HOOT, interact_hoot },
+ { INTERACT_BREAKABLE, interact_breakable },
+ { INTERACT_KOOPA, interact_bounce_top },
+ { INTERACT_KOOPA_SHELL, interact_koopa_shell },
+ { INTERACT_UNKNOWN_08, interact_unknown_08 },
+ { INTERACT_CAP, interact_cap },
+ { INTERACT_GRABBABLE, interact_grabbable },
+ { INTERACT_TEXT, interact_text },
};
static u32 sForwardKnockbackActions[][3] = {
{ ACT_SOFT_FORWARD_GROUND_KB, ACT_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB },
- { ACT_FORWARD_AIR_KB, ACT_FORWARD_AIR_KB, ACT_HARD_FORWARD_AIR_KB },
- { ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB },
+ { ACT_FORWARD_AIR_KB, ACT_FORWARD_AIR_KB, ACT_HARD_FORWARD_AIR_KB },
+ { ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB },
};
static u32 sBackwardKnockbackActions[][3] = {
{ ACT_SOFT_BACKWARD_GROUND_KB, ACT_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB },
- { ACT_BACKWARD_AIR_KB, ACT_BACKWARD_AIR_KB, ACT_HARD_BACKWARD_AIR_KB },
- { ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB },
+ { ACT_BACKWARD_AIR_KB, ACT_BACKWARD_AIR_KB, ACT_HARD_BACKWARD_AIR_KB },
+ { ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB },
};
static u8 sDisplayingDoorText = FALSE;
static u8 sJustTeleported = FALSE;
static u8 sPssSlideStarted = FALSE;
+/**
+ * Returns the type of hat Mario is wearing.
+ */
u32 get_mario_cap_flag(struct Object *capObject) {
void *script = virtual_to_segmented(0x13, capObject->behavior);
@@ -143,7 +146,10 @@ u32 get_mario_cap_flag(struct Object *capObject) {
return 0;
}
-
+/**
+ * Returns true if the passed in object has a moving angle yaw
+ * in the angular range given towards Mario.
+ */
u32 object_facing_mario(struct MarioState *m, struct Object *o, s16 angleRange) {
f32 dx = m->pos[0] - o->oPosX;
f32 dz = m->pos[2] - o->oPosZ;
@@ -158,32 +164,39 @@ u32 object_facing_mario(struct MarioState *m, struct Object *o, s16 angleRange)
return FALSE;
}
-s16 mario_angle_to_object(struct MarioState *m, struct Object *o) {
+s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o) {
f32 dx = o->oPosX - m->pos[0];
f32 dz = o->oPosZ - m->pos[2];
return atan2s(dz, dx);
}
+/**
+ * Determines Mario's interaction with a given object depending on their proximity,
+ * action, speed, and position.
+ */
u32 determine_interaction(struct MarioState *m, struct Object *o) {
u32 interaction = 0;
u32 action = m->action;
if (action & ACT_FLAG_ATTACKING) {
if (action == ACT_PUNCHING || action == ACT_MOVE_PUNCHING || action == ACT_JUMP_KICK) {
- s16 dYawToObject = mario_angle_to_object(m, o) - m->faceAngle[1];
+ s16 dYawToObject = mario_obj_angle_to_object(m, o) - m->faceAngle[1];
if (m->flags & MARIO_PUNCHING) {
+ // 120 degrees total, or 60 each way
if (-0x2AAA <= dYawToObject && dYawToObject <= 0x2AAA) {
interaction = INT_PUNCH;
}
}
if (m->flags & MARIO_KICKING) {
+ // 120 degrees total, or 60 each way
if (-0x2AAA <= dYawToObject && dYawToObject <= 0x2AAA) {
interaction = INT_KICK;
}
}
if (m->flags & MARIO_TRIPPING) {
+ // 180 degrees total, or 90 each way
if (-0x4000 <= dYawToObject && dYawToObject <= 0x4000) {
interaction = INT_TRIP;
}
@@ -193,6 +206,10 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) {
interaction = INT_GROUND_POUND_OR_TWIRL;
}
} else if (action == ACT_GROUND_POUND_LAND || action == ACT_TWIRL_LAND) {
+ // Neither ground pounding nor twirling change Mario's vertical speed on landing.,
+ // so the speed check is nearly always true (perhaps not if you land while going upwards?)
+ // Additionally, actionState it set on each first thing in their action, so this is
+ // only true prior to the very first frame (i.e. active 1 frame prior to it run).
if (m->vel[1] < 0.0f && m->actionState == 0) {
interaction = INT_GROUND_POUND_OR_TWIRL;
}
@@ -205,6 +222,9 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) {
}
}
+ // Prior to this, the interaction type could be overwritten. This requires, however,
+ // that the interaction not be set prior. This specifically overrides turning a ground
+ // pound into just a bounce.
if (interaction == 0 && (action & ACT_FLAG_AIR)) {
if (m->vel[1] < 0.0f) {
if (m->pos[1] > o->oPosY) {
@@ -220,6 +240,9 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) {
return interaction;
}
+/**
+ * Sets the interaction types for INT_STATUS_INTERACTED, INT_STATUS_WAS_ATTACKED
+ */
u32 attack_object(struct Object *o, s32 interaction) {
u32 attackType = 0;
@@ -261,7 +284,7 @@ void mario_stop_riding_object(struct MarioState *m) {
void mario_grab_used_object(struct MarioState *m) {
if (m->heldObj == NULL) {
m->heldObj = m->usedObj;
- set_object_held_state(m->heldObj, bhvCarrySomething3);
+ obj_set_held_state(m->heldObj, bhvCarrySomething3);
}
}
@@ -271,7 +294,7 @@ void mario_drop_held_object(struct MarioState *m) {
stop_shell_music();
}
- set_object_held_state(m->heldObj, bhvCarrySomething4);
+ obj_set_held_state(m->heldObj, bhvCarrySomething4);
// ! When dropping an object instead of throwing it, it will be put at Mario's
// y-positon instead of the HOLP's y-position. This fact is often exploited when
@@ -292,7 +315,7 @@ void mario_throw_held_object(struct MarioState *m) {
stop_shell_music();
}
- set_object_held_state(m->heldObj, bhvCarrySomething5);
+ obj_set_held_state(m->heldObj, bhvCarrySomething5);
m->heldObj->oPosX = m->marioBodyState->heldObjLastPosition[0] + 32.0f * sins(m->faceAngle[1]);
m->heldObj->oPosY = m->marioBodyState->heldObjLastPosition[1];
@@ -403,7 +426,7 @@ u32 mario_check_object_grab(struct MarioState *m) {
result = set_mario_action(m, ACT_PICKING_UP_BOWSER, 0);
}
} else {
- s16 facingDYaw = mario_angle_to_object(m, m->interactObj) - m->faceAngle[1];
+ s16 facingDYaw = mario_obj_angle_to_object(m, m->interactObj) - m->faceAngle[1];
if (facingDYaw >= -0x2AAA && facingDYaw <= 0x2AAA) {
m->usedObj = m->interactObj;
@@ -501,7 +524,7 @@ void hit_object_from_below(struct MarioState *m, UNUSED struct Object *o) {
static u32 unused_determine_knockback_action(struct MarioState *m) {
u32 bonkAction;
- s16 angleToObject = mario_angle_to_object(m, m->interactObj);
+ s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj);
s16 facingDYaw = angleToObject - m->faceAngle[1];
if (m->forwardVel < 16.0f) {
@@ -535,7 +558,7 @@ u32 determine_knockback_action(struct MarioState *m, UNUSED s32 arg) {
s16 terrainIndex = 0; // 1 = air, 2 = water, 0 = default
s16 strengthIndex = 0;
- s16 angleToObject = mario_angle_to_object(m, m->interactObj);
+ s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj);
s16 facingDYaw = angleToObject - m->faceAngle[1];
s16 remainingHealth = m->health - 0x40 * m->hurtCounter;
@@ -633,7 +656,7 @@ void bounce_back_from_attack(struct MarioState *m, u32 interaction) {
}
set_camera_shake_from_hit(SHAKE_ATTACK);
- m->particleFlags |= 0x00040000;
+ m->particleFlags |= PARTICLE_18;
}
if (interaction & (INT_PUNCH | INT_KICK | INT_TRIP | INT_FAST_ATTACK_OR_SHELL)) {
@@ -641,7 +664,7 @@ void bounce_back_from_attack(struct MarioState *m, u32 interaction) {
}
}
-u32 func_8024D664(struct MarioState *m, struct Object *o) {
+u32 should_push_or_pull_door(struct MarioState *m, struct Object *o) {
f32 dx = o->oPosX - m->pos[0];
f32 dz = o->oPosZ - m->pos[2];
@@ -776,7 +799,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O
if (!noExit) {
drop_queued_background_music();
- func_8024924C(126);
+ fadeout_level_music(126);
}
play_sound(SOUND_MENU_STAR_SOUND, m->marioObj->header.gfx.cameraToObject);
@@ -888,7 +911,7 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj
}
if (m->action == ACT_WALKING || m->action == ACT_DECELERATING) {
- actionArg = func_8024D664(m, o) + 0x00000004;
+ actionArg = should_push_or_pull_door(m, o) + 0x00000004;
if (doorAction == 0) {
if (actionArg & 0x00000001) {
@@ -953,7 +976,7 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *
if (m->action == ACT_WALKING || m->action == ACT_DECELERATING) {
if (numStars >= requiredNumStars) {
- u32 actionArg = func_8024D664(m, o);
+ u32 actionArg = should_push_or_pull_door(m, o);
u32 enterDoorAction;
u32 doorSaveFileFlag;
@@ -1008,7 +1031,7 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *
} else if (m->action == ACT_IDLE && sDisplayingDoorText == TRUE && requiredNumStars == 70) {
m->interactObj = o;
m->usedObj = o;
- return set_mario_action(m, ACT_ENTERING_STAR_DOOR, func_8024D664(m, o));
+ return set_mario_action(m, ACT_ENTERING_STAR_DOOR, should_push_or_pull_door(m, o));
}
return FALSE;
@@ -1078,7 +1101,7 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj
return FALSE;
}
-u32 interact_wind(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
+u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
UNUSED struct Object *marioObj = m->marioObj;
if (m->action != ACT_GETTING_BLOWN) {
@@ -1233,7 +1256,7 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object
return FALSE;
}
-static u32 func_8024EF8C(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
+static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
if (!(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) {
sDelayInvincTimer = TRUE;
}
@@ -1356,7 +1379,7 @@ u32 interact_damage(struct MarioState *m, UNUSED u32 interactType, struct Object
u32 interact_breakable(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
u32 interaction = determine_interaction(m, o);
- if (interaction & INT_ATTACK_MASK_UNKNOWN_8F) {
+ if (interaction & INT_ATTACK_NOT_WEAK_FROM_ABOVE) {
attack_object(o, interaction);
bounce_back_from_attack(m, interaction);
@@ -1560,7 +1583,7 @@ u32 interact_grabbable(struct MarioState *m, u32 interactType, struct Object *o)
return FALSE;
}
-u32 func_8024FC94(struct MarioState *m, u32 arg) {
+u32 mario_can_talk(struct MarioState *m, u32 arg) {
s16 val6;
if ((m->action & ACT_FLAG_IDLE) != 0x00000000) {
@@ -1594,8 +1617,8 @@ u32 func_8024FC94(struct MarioState *m, u32 arg) {
#define SIGN_RANGE 0x4000
#endif
-u32 func_8024FD2C(struct MarioState *m, struct Object *o) {
- if ((m->input & READ_MASK) && func_8024FC94(m, 0) && object_facing_mario(m, o, SIGN_RANGE)) {
+u32 check_read_sign(struct MarioState *m, struct Object *o) {
+ if ((m->input & READ_MASK) && mario_can_talk(m, 0) && object_facing_mario(m, o, SIGN_RANGE)) {
s16 facingDYaw = (s16)(o->oMoveAngleYaw + 0x8000) - m->faceAngle[1];
if (facingDYaw >= -SIGN_RANGE && facingDYaw <= SIGN_RANGE) {
f32 targetX = o->oPosX + 105.0f * sins(o->oMoveAngleYaw);
@@ -1614,9 +1637,9 @@ u32 func_8024FD2C(struct MarioState *m, struct Object *o) {
return FALSE;
}
-u32 func_8024FEC0(struct MarioState *m, struct Object *o) {
- if ((m->input & READ_MASK) && func_8024FC94(m, 1)) {
- s16 facingDYaw = mario_angle_to_object(m, o) - m->faceAngle[1];
+u32 check_npc_talk(struct MarioState *m, struct Object *o) {
+ if ((m->input & READ_MASK) && mario_can_talk(m, 1)) {
+ s16 facingDYaw = mario_obj_angle_to_object(m, o) - m->faceAngle[1];
if (facingDYaw >= -0x4000 && facingDYaw <= 0x4000) {
o->oInteractStatus = INT_STATUS_INTERACTED;
@@ -1636,9 +1659,9 @@ u32 interact_text(struct MarioState *m, UNUSED u32 interactType, struct Object *
u32 interact = FALSE;
if (o->oInteractionSubtype & INT_SUBTYPE_SIGN) {
- interact = func_8024FD2C(m, o);
+ interact = check_read_sign(m, o);
} else if (o->oInteractionSubtype & INT_SUBTYPE_NPC) {
- interact = func_8024FEC0(m, o);
+ interact = check_npc_talk(m, o);
} else {
push_mario_out_of_object(m, o, 2.0f);
}
@@ -1661,11 +1684,11 @@ void check_kick_or_punch_wall(struct MarioState *m) {
mario_set_forward_vel(m, -48.0f);
play_sound(SOUND_ACTION_HIT_2, m->marioObj->header.gfx.cameraToObject);
- m->particleFlags |= 0x00040000;
+ m->particleFlags |= PARTICLE_18;
} else if (m->action & ACT_FLAG_AIR) {
mario_set_forward_vel(m, -16.0f);
play_sound(SOUND_ACTION_HIT_2, m->marioObj->header.gfx.cameraToObject);
- m->particleFlags |= 0x00040000;
+ m->particleFlags |= PARTICLE_18;
}
}
}
@@ -1743,7 +1766,7 @@ void pss_end_slide(struct MarioState *m) {
u16 slideTime = level_control_timer(TIMER_CONTROL_STOP);
if (slideTime < 630) {
m->marioObj->oBehParams = (1 << 24);
- create_star(-6358.0f, -4300.0f, 4700.0f);
+ spawn_default_star(-6358.0f, -4300.0f, 4700.0f);
}
sPssSlideStarted = FALSE;
}
diff --git a/src/game/interaction.h b/src/game/interaction.h
@@ -13,7 +13,7 @@
#define INTERACT_KOOPA /* 0x00000080 */ (1 << 7)
#define INTERACT_UNKNOWN_08 /* 0x00000100 */ (1 << 8)
#define INTERACT_BREAKABLE /* 0x00000200 */ (1 << 9)
-#define INTERACT_WIND /* 0x00000400 */ (1 << 10)
+#define INTERACT_STRONG_WIND /* 0x00000400 */ (1 << 10)
#define INTERACT_WARP_DOOR /* 0x00000800 */ (1 << 11)
#define INTERACT_STAR_OR_KEY /* 0x00001000 */ (1 << 12)
#define INTERACT_WARP /* 0x00002000 */ (1 << 13)
@@ -105,7 +105,7 @@ struct BullyCollisionData {
extern u8 D_03009AC8[];
-extern s16 mario_angle_to_object(struct MarioState *, struct Object *);
+extern s16 mario_obj_angle_to_object(struct MarioState *, struct Object *);
extern void mario_stop_riding_object(struct MarioState *);
extern void mario_grab_used_object(struct MarioState *);
extern void mario_drop_held_object(struct MarioState *);
diff --git a/src/game/level_geo.c b/src/game/level_geo.c
@@ -13,7 +13,7 @@
* Geo function that generates a displaylist for environment effects such as
* snow or jetstream bubbles.
*/
-Gfx *geo_enfvx_main(s32 callContext, struct GraphNode *node, f32 c[4][4]) {
+Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, f32 c[4][4]) {
Vec3s marioPos;
Vec3s camFrom;
Vec3s camTo;
diff --git a/src/game/level_geo.h b/src/game/level_geo.h
@@ -8,7 +8,7 @@ struct Struct802761D0
u8 filler4[0x18-0x4];
};
-extern Gfx *geo_enfvx_main(s32 a, struct GraphNode *b, f32 c[4][4]);
+extern Gfx *geo_envfx_main(s32 a, struct GraphNode *b, f32 c[4][4]);
extern Gfx *geo_skybox_main(s32 a, struct GraphNode *b, UNUSED Mat4 *c);
#endif /* _LEVEL_GEO_H */
diff --git a/src/game/level_update.c b/src/game/level_update.c
@@ -202,7 +202,7 @@ u16 level_control_timer(s32 timerOp) {
return gHudDisplay.timer;
}
-u32 pressed_paused(void) {
+u32 pressed_pause(void) {
u32 val4 = get_dialog_id() >= 0;
u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0;
@@ -219,28 +219,28 @@ void set_play_mode(s16 playMode) {
D_80339ECA = 0;
}
-void func_8024975C(s32 arg) {
+void warp_special(s32 arg) {
sCurrPlayMode = PLAY_MODE_CHANGE_LEVEL;
D_80339ECA = 0;
D_80339EE0 = arg;
}
-void func_80249788(u32 arg, u32 color) {
+void fade_into_special_warp(u32 arg, u32 color) {
if (color != 0) {
color = 0xFF;
}
- func_802491FC(190);
+ fadeout_music(190);
play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 0x10, color, color, color);
level_set_transition(30, NULL);
- func_8024975C(arg);
+ warp_special(arg);
}
-void nop_802497FC(void) {
+void stub_level_update_1(void) {
}
-void func_8024980C(u32 arg) {
+void load_level_init_text(u32 arg) {
s32 gotAchievement;
u32 dialogID = gCurrentArea->dialog[arg];
@@ -272,7 +272,7 @@ void func_8024980C(u32 arg) {
}
}
-void func_8024992C(struct SpawnInfo *spawnInfo, u32 arg1) {
+void init_door_warp(struct SpawnInfo *spawnInfo, u32 arg1) {
if (arg1 & 0x00000002) {
spawnInfo->startAngle[1] += 0x8000;
}
@@ -377,7 +377,7 @@ void init_mario_after_warp(void) {
gPlayerSpawnInfos[0].startAngle[2] = 0;
if (marioSpawnType == MARIO_SPAWN_UNKNOWN_01) {
- func_8024992C(&gPlayerSpawnInfos[0], sWarpDest.arg);
+ init_door_warp(&gPlayerSpawnInfos[0], sWarpDest.arg);
}
if (sWarpDest.type == WARP_TYPE_CHANGE_LEVEL || sWarpDest.type == WARP_TYPE_CHANGE_AREA) {
@@ -458,11 +458,11 @@ void init_mario_after_warp(void) {
}
// used for warps inside one level
-void func_8024A02C(void) {
+void warp_area(void) {
if (sWarpDest.type != WARP_TYPE_NOT_WARPING) {
if (sWarpDest.type == WARP_TYPE_CHANGE_AREA) {
level_control_timer(TIMER_CONTROL_HIDE);
- func_8027AA88();
+ unload_mario_area();
load_area(sWarpDest.areaIdx);
}
@@ -471,7 +471,7 @@ void func_8024A02C(void) {
}
// used for warps between levels
-void func_8024A094(void) {
+void warp_level(void) {
gCurrLevelNum = sWarpDest.levelNum;
level_control_timer(TIMER_CONTROL_HIDE);
@@ -480,7 +480,7 @@ void func_8024A094(void) {
init_mario_after_warp();
}
-void func_8024A0E0(void) {
+void warp_credits(void) {
s32 marioAction;
switch (sWarpDest.nodeId) {
@@ -562,7 +562,7 @@ void check_instant_warp(void) {
}
}
-s16 func_8024A48C(s16 arg) {
+s16 music_changed_through_warp(s16 arg) {
struct ObjectWarpNode *warpNode = area_get_warp_node(arg);
s16 levelNum = warpNode->node.destLevel & 0x7F;
@@ -679,7 +679,7 @@ void initiate_painting_warp(void) {
gMarioState->marioObj->header.gfx.node.flags &= ~0x0001;
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
- func_802491FC(398);
+ fadeout_music(398);
}
}
}
@@ -764,7 +764,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
case WARP_OP_TELEPORT:
sDelayedWarpTimer = 20;
sSourceWarpNodeId = (m->usedObj->oBehParams & 0x00FF0000) >> 16;
- val04 = !func_8024A48C(sSourceWarpNodeId);
+ val04 = !music_changed_through_warp(sSourceWarpNodeId);
play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 0x14, 0xFF, 0xFF, 0xFF);
break;
@@ -772,14 +772,14 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
sDelayedWarpTimer = 20;
sDelayedWarpArg = m->actionArg;
sSourceWarpNodeId = (m->usedObj->oBehParams & 0x00FF0000) >> 16;
- val04 = !func_8024A48C(sSourceWarpNodeId);
+ val04 = !music_changed_through_warp(sSourceWarpNodeId);
play_transition(WARP_TRANSITION_FADE_INTO_CIRCLE, 0x14, 0x00, 0x00, 0x00);
break;
case WARP_OP_WARP_OBJECT:
sDelayedWarpTimer = 20;
sSourceWarpNodeId = (m->usedObj->oBehParams & 0x00FF0000) >> 16;
- val04 = !func_8024A48C(sSourceWarpNodeId);
+ val04 = !music_changed_through_warp(sSourceWarpNodeId);
play_transition(WARP_TRANSITION_FADE_INTO_STAR, 0x14, 0x00, 0x00, 0x00);
break;
@@ -801,7 +801,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) {
}
if (val04 && gCurrDemoInput == NULL) {
- func_802491FC((3 * sDelayedWarpTimer / 2) * 8 - 2);
+ fadeout_music((3 * sDelayedWarpTimer / 2) * 8 - 2);
}
}
@@ -819,27 +819,27 @@ void initiate_delayed_warp(void) {
reset_dialog_render_state();
if (gDebugLevelSelect && (sDelayedWarpOp & WARP_OP_TRIGGERS_LEVEL_SELECT)) {
- func_8024975C(-9);
+ warp_special(-9);
} else if (gCurrDemoInput != NULL) {
if (sDelayedWarpOp == WARP_OP_DEMO_END) {
- func_8024975C(-8);
+ warp_special(-8);
} else {
- func_8024975C(-2);
+ warp_special(-2);
}
} else {
switch (sDelayedWarpOp) {
case WARP_OP_GAME_OVER:
save_file_reload();
- func_8024975C(-3);
+ warp_special(-3);
break;
case WARP_OP_CREDITS_END:
- func_8024975C(-1);
+ warp_special(-1);
sound_banks_enable(2, 0x03F0);
break;
case WARP_OP_DEMO_NEXT:
- func_8024975C(-2);
+ warp_special(-2);
break;
case WARP_OP_CREDITS_START:
@@ -965,7 +965,7 @@ s32 play_mode_normal(void) {
}
}
- func_8024A02C();
+ warp_area();
check_instant_warp();
if (sTimerRunning && gHudDisplay.timer < 17999) {
@@ -989,8 +989,8 @@ s32 play_mode_normal(void) {
set_play_mode(PLAY_MODE_CHANGE_LEVEL);
} else if (sTransitionTimer != 0) {
set_play_mode(PLAY_MODE_CHANGE_AREA);
- } else if (pressed_paused()) {
- func_80248C28(1);
+ } else if (pressed_pause()) {
+ lower_background_noise(1);
gCameraMovementFlags |= CAM_MOVE_PAUSE_SCREEN;
set_play_mode(PLAY_MODE_PAUSED);
}
@@ -1003,17 +1003,17 @@ s32 play_mode_paused(void) {
if (gPauseScreenMode == 0) {
set_menu_mode(RENDER_PAUSE_SCREEN);
} else if (gPauseScreenMode == 1) {
- func_80248CB8(1);
+ raise_background_noise(1);
gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN;
set_play_mode(PLAY_MODE_NORMAL);
} else {
// Exit level
if (gDebugLevelSelect) {
- func_80249788(-9, 1);
+ fade_into_special_warp(-9, 1);
} else {
initiate_warp(LEVEL_CASTLE, 1, 0x1F, 0);
- func_80249788(0, 0);
+ fade_into_special_warp(0, 0);
gSavedCourseNum = 0;
}
@@ -1033,7 +1033,7 @@ s32 play_mode_frame_advance(void) {
play_mode_normal();
} else if (gPlayer1Controller->buttonPressed & START_BUTTON) {
gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN;
- func_80248CB8(1);
+ raise_background_noise(1);
set_play_mode(PLAY_MODE_NORMAL);
} else {
gCameraMovementFlags |= CAM_MOVE_PAUSE_SCREEN;
@@ -1141,8 +1141,8 @@ s32 update_level(void) {
}
if (changeLevel) {
- func_80248C10();
- func_80248D90();
+ reset_volume();
+ enable_background_sound();
}
return changeLevel;
@@ -1167,9 +1167,9 @@ s32 init_level(void) {
if (sWarpDest.type != WARP_TYPE_NOT_WARPING) {
if (sWarpDest.nodeId >= WARP_NODE_CREDITS_MIN) {
- func_8024A0E0();
+ warp_credits();
} else {
- func_8024A094();
+ warp_level();
}
} else {
if (gPlayerSpawnInfos[0].areaIndex >= 0) {
diff --git a/src/game/level_update.h b/src/game/level_update.h
@@ -116,8 +116,8 @@ enum HUDDisplayFlag {
u16 level_control_timer(s32 timerOp);
-void func_80249788(u32 arg, u32 color);
-void func_8024980C(u32 arg);
+void fade_into_special_warp(u32 arg, u32 color);
+void load_level_init_text(u32 arg);
s16 level_trigger_warp(struct MarioState *m, s32 warpOp);
void level_set_transition(s16 length, void (*updateFunction)(s16 *));
diff --git a/src/game/macro_special_objects.c b/src/game/macro_special_objects.c
@@ -79,7 +79,7 @@ void spawn_macro_abs_special(u32 model, const BehaviorScript *behavior, s16 x, s
newObj->oMacroUnk110 = (f32) unkC;
}
-static void Unknown802E142C(const BehaviorScript *behavior, s16 a1[]) {
+static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) {
struct Object *sp3C;
s16 model;
diff --git a/src/game/main.c b/src/game/main.c
@@ -83,7 +83,7 @@ void handle_debug_key_sequences(void) {
}
}
-void Unknown80246170(void) {
+void unknown_main_func(void) {
// uninitialized
OSTime time;
u32 b;
@@ -98,13 +98,13 @@ void Unknown80246170(void) {
#pragma GCC diagnostic pop
}
-void Dummy802461CC(void) {
+void stub_main_1(void) {
}
-void Dummy802461DC(void) {
+void stub_main_2(void) {
}
-void Dummy802461EC(void) {
+void stub_main_3(void) {
}
void setup_mesg_queues(void) {
@@ -121,7 +121,7 @@ void setup_mesg_queues(void) {
osSetEventMesg(OS_EVENT_PRENMI, &gIntrMesgQueue, (OSMesg) MESG_NMI_REQUEST);
}
-void AllocPool(void) {
+void alloc_pool(void) {
void *start = (void *) SEG_POOL_START;
void *end = (void *) SEG_POOL_END;
@@ -135,12 +135,19 @@ void create_thread(OSThread *thread, OSId id, void (*entry)(void *), void *arg,
osCreateThread(thread, id, entry, arg, sp, pri);
}
+#ifdef VERSION_SH
+extern void func_sh_802F69CC(void);
+#endif
+
void handle_nmi_request(void) {
gResetTimer = 1;
D_8032C648 = 0;
func_80320890();
sound_banks_disable(2, 0x037A);
- func_802491FC(90);
+ fadeout_music(90);
+#ifdef VERSION_SH
+ func_sh_802F69CC();
+#endif
}
void receive_new_tasks(void) {
@@ -204,14 +211,24 @@ void pretend_audio_sptask_done(void) {
osSendMesg(&gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE, OS_MESG_NOBLOCK);
}
+#ifdef VERSION_SH
+extern void func_sh_8024CC7C(void);
+#endif
+
void handle_vblank(void) {
UNUSED s32 pad; // needed to pad the stack
- Dummy802461EC();
+ stub_main_3();
sNumVblanks++;
+#ifdef VERSION_SH
+ if (gResetTimer > 0 && gResetTimer < 100) {
+ gResetTimer++;
+ }
+#else
if (gResetTimer > 0) {
gResetTimer++;
}
+#endif
receive_new_tasks();
@@ -238,6 +255,9 @@ void handle_vblank(void) {
start_sptask(M_GFXTASK);
}
}
+#ifdef VERSION_SH
+ func_sh_8024CC7C();
+#endif
// Notify the game loop about the vblank.
if (gVblankHandler1 != NULL) {
@@ -308,7 +328,7 @@ void handle_dp_complete(void) {
void thread3_main(UNUSED void *arg) {
setup_mesg_queues();
- AllocPool();
+ alloc_pool();
load_engine_code_segment();
create_thread(&gSoundThread, 4, thread4_sound, NULL, gThread4Stack + 0x2000, 20);
@@ -338,7 +358,7 @@ void thread3_main(UNUSED void *arg) {
handle_nmi_request();
break;
}
- Dummy802461DC();
+ stub_main_2();
}
}
@@ -356,7 +376,7 @@ void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *q
}
}
-void SendMessage(OSMesg *msg) {
+void send_sp_task_message(OSMesg *msg) {
osWritebackDCacheAll();
osSendMesg(&gSPTaskMesgQueue, msg, OS_MESG_NOBLOCK);
}
@@ -397,12 +417,12 @@ void turn_off_audio(void) {
* Initialize hardware, start main thread, then idle.
*/
void thread1_idle(UNUSED void *arg) {
-#ifdef VERSION_US
+#if defined(VERSION_US) || defined(VERSION_SH)
s32 sp24 = osTvType;
#endif
osCreateViManager(OS_PRIORITY_VIMGR);
-#ifdef VERSION_US
+#if defined(VERSION_US) || defined(VERSION_SH)
if (sp24 == TV_TYPE_NTSC) {
osViSetMode(&osViModeTable[OS_VI_NTSC_LAN1]);
} else {
@@ -429,11 +449,11 @@ void thread1_idle(UNUSED void *arg) {
}
}
-void Main(void) {
+void main_func(void) {
UNUSED u8 pad[64]; // needed to pad the stack
osInitialize();
- Dummy802461CC();
+ stub_main_1();
create_thread(&gIdleThread, 1, thread1_idle, NULL, gIdleThreadStack + 0x800, 100);
osStartThread(&gIdleThread);
}
diff --git a/src/game/main.h b/src/game/main.h
@@ -38,6 +38,6 @@ extern s8 gShowDebugText;
extern void set_vblank_handler(s32 a, struct VblankHandler *b, OSMesgQueue *queue, OSMesg *msg);
extern void dispatch_audio_sptask(struct SPTask *spTask);
extern void send_display_list(struct SPTask *a);
-extern void Main(void);
+extern void main(void);
#endif
diff --git a/src/game/mario.c b/src/game/mario.c
@@ -64,7 +64,7 @@ s16 set_mario_animation(struct MarioState *m, s32 targetAnimID) {
struct Object *o = m->marioObj;
struct Animation *targetAnim = m->animation->targetAnim;
- if (func_80278AD4(m->animation, targetAnimID)) {
+ if (load_patchable_table(m->animation, targetAnimID)) {
targetAnim->values = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values);
targetAnim->index = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index);
}
@@ -97,7 +97,7 @@ s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel)
struct Object *o = m->marioObj;
struct Animation *targetAnim = m->animation->targetAnim;
- if (func_80278AD4(m->animation, targetAnimID)) {
+ if (load_patchable_table(m->animation, targetAnimID)) {
targetAnim->values = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->values);
targetAnim->index = (void *) VIRTUAL_TO_PHYSICAL((u8 *) targetAnim + (uintptr_t) targetAnim->index);
}
@@ -278,9 +278,9 @@ void adjust_sound_for_speed(struct MarioState *m) {
void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 waveParticleType) {
if (m->terrainSoundAddend == (SOUND_TERRAIN_WATER << 16)) {
if (waveParticleType != 0) {
- m->particleFlags |= PARTICLE_12;
+ m->particleFlags |= PARTICLE_SHALLOW_WATER_SPLASH;
} else {
- m->particleFlags |= PARTICLE_8;
+ m->particleFlags |= PARTICLE_SHALLOW_WATER_WAVE;
}
} else {
if (m->terrainSoundAddend == (SOUND_TERRAIN_SAND << 16)) {
@@ -722,12 +722,12 @@ void update_mario_sound_and_camera(struct MarioState *m) {
s32 camPreset = m->area->camera->mode;
if (action == ACT_FIRST_PERSON) {
- func_80248CB8(2);
+ raise_background_noise(2);
gCameraMovementFlags &= ~CAM_MOVE_C_UP_MODE;
// Go back to the last camera mode
set_camera_mode(m->area->camera, -1, 1);
} else if (action == ACT_SLEEPING) {
- func_80248CB8(2);
+ raise_background_noise(2);
}
if (!(action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER))) {
@@ -1406,7 +1406,7 @@ void update_mario_inputs(struct MarioState *m) {
// This function is located near other unused trampoline functions,
// perhaps logically grouped here with the timers.
- nop_80254E3C(m);
+ stub_mario_step_1(m);
if (m->wallKickTimer > 0) {
m->wallKickTimer--;
@@ -1738,14 +1738,14 @@ s32 execute_mario_action(UNUSED struct Object *o) {
// Both of the wind handling portions play wind audio only in
// non-Japanese releases.
if (gMarioState->floor->type == SURFACE_HORIZONTAL_WIND) {
- func_802ADC20(0, (gMarioState->floor->force << 8));
+ spawn_wind_particles(0, (gMarioState->floor->force << 8));
#ifndef VERSION_JP
play_sound(SOUND_ENV_WIND2, gMarioState->marioObj->header.gfx.cameraToObject);
#endif
}
if (gMarioState->floor->type == SURFACE_VERTICAL_WIND) {
- func_802ADC20(1, 0);
+ spawn_wind_particles(1, 0);
#ifndef VERSION_JP
play_sound(SOUND_ENV_WIND2, gMarioState->marioObj->header.gfx.cameraToObject);
#endif
diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c
@@ -32,7 +32,7 @@ void play_far_fall_sound(struct MarioState *m) {
}
#ifndef VERSION_JP
-void func_u_8026A090(struct MarioState *m) {
+void play_knockback_sound(struct MarioState *m) {
if (m->actionArg == 0 && (m->forwardVel <= -28.0f || m->forwardVel >= 28.0f)) {
play_sound_if_no_flag(m, SOUND_MARIO_DOH, MARIO_MARIO_SOUND_PLAYED);
} else {
@@ -1089,7 +1089,7 @@ u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFall
return stepResult;
}
-s32 func_8026CDFC(struct MarioState *m) {
+s32 check_wall_kick(struct MarioState *m) {
if ((m->input & INPUT_A_PRESSED) && m->wallKickTimer != 0 && m->prevAction == ACT_AIR_HIT_WALL) {
m->faceAngle[1] += 0x8000;
return set_mario_action(m, ACT_WALL_KICK_AIR, 0);
@@ -1099,12 +1099,12 @@ s32 func_8026CDFC(struct MarioState *m) {
}
s32 act_backward_air_kb(struct MarioState *m) {
- if (func_8026CDFC(m)) {
+ if (check_wall_kick(m)) {
return 1;
}
#ifndef VERSION_JP
- func_u_8026A090(m);
+ play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
@@ -1113,12 +1113,12 @@ s32 act_backward_air_kb(struct MarioState *m) {
}
s32 act_forward_air_kb(struct MarioState *m) {
- if (func_8026CDFC(m)) {
+ if (check_wall_kick(m)) {
return 1;
}
#ifndef VERSION_JP
- func_u_8026A090(m);
+ play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
@@ -1128,7 +1128,7 @@ s32 act_forward_air_kb(struct MarioState *m) {
s32 act_hard_backward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
- func_u_8026A090(m);
+ play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
@@ -1139,7 +1139,7 @@ s32 act_hard_backward_air_kb(struct MarioState *m) {
s32 act_hard_forward_air_kb(struct MarioState *m) {
#ifndef VERSION_JP
- func_u_8026A090(m);
+ play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
@@ -1190,12 +1190,12 @@ s32 act_thrown_forward(struct MarioState *m) {
}
s32 act_soft_bonk(struct MarioState *m) {
- if (func_8026CDFC(m)) {
+ if (check_wall_kick(m)) {
return 1;
}
#ifndef VERSION_JP
- func_u_8026A090(m);
+ play_knockback_sound(m);
#else
play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED);
#endif
@@ -1683,7 +1683,7 @@ s32 act_flying(struct MarioState *m) {
if (is_anim_at_end(m)) {
if (m->actionArg == 2) {
- func_8024980C(0);
+ load_level_init_text(0);
m->actionArg = 1;
}
diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c
@@ -495,14 +495,14 @@ s32 let_go_of_ledge(struct MarioState *m) {
return set_mario_action(m, ACT_SOFT_BONK, 0);
}
-void func_8025F0DC(struct MarioState *m) {
+void climb_up_ledge(struct MarioState *m) {
set_mario_animation(m, MARIO_ANIM_IDLE_HEAD_LEFT);
m->pos[0] += 14.0f * sins(m->faceAngle[1]);
m->pos[2] += 14.0f * coss(m->faceAngle[1]);
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
}
-void func_8025F188(struct MarioState *m) {
+void update_ledge_climb_camera(struct MarioState *m) {
f32 sp4;
if (m->actionTimer < 14) {
@@ -524,7 +524,7 @@ void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction) {
if (is_anim_at_end(m)) {
set_mario_action(m, endAction, 0);
if (endAction == ACT_IDLE) {
- func_8025F0DC(m);
+ climb_up_ledge(m);
}
}
}
@@ -595,7 +595,7 @@ s32 act_ledge_climb_slow(struct MarioState *m) {
if (m->actionTimer >= 28
&& (m->input
& (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))) {
- func_8025F0DC(m);
+ climb_up_ledge(m);
return check_common_action_exits(m);
}
@@ -605,7 +605,7 @@ s32 act_ledge_climb_slow(struct MarioState *m) {
update_ledge_climb(m, MARIO_ANIM_SLOW_LEDGE_GRAB, ACT_IDLE);
- func_8025F188(m);
+ update_ledge_climb_camera(m);
if (m->marioObj->header.gfx.unk38.animFrame == 17) {
m->action = ACT_LEDGE_CLIMB_SLOW_2;
}
@@ -638,7 +638,7 @@ s32 act_ledge_climb_fast(struct MarioState *m) {
if (m->marioObj->header.gfx.unk38.animFrame == 8) {
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
}
- func_8025F188(m);
+ update_ledge_climb_camera(m);
return FALSE;
}
diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c
@@ -180,9 +180,9 @@ void print_displaying_credits_entry(void) {
}
}
-void BehEndPeachLoop(void) {
- set_obj_animation_and_sound_state(sEndPeachAnimation);
- if (func_8029F788()) {
+void bhv_end_peach_loop(void) {
+ cur_obj_init_animation_with_sound(sEndPeachAnimation);
+ if (cur_obj_check_if_near_animation_end()) {
// anims: 0-3, 4, 5, 6-8, 9, 10, 11
if (sEndPeachAnimation < 3 || sEndPeachAnimation == 6 || sEndPeachAnimation == 7) {
sEndPeachAnimation++;
@@ -190,11 +190,11 @@ void BehEndPeachLoop(void) {
}
}
-void BehEndToadLoop(void) {
+void bhv_end_toad_loop(void) {
s32 toadAnimIndex = (gCurrentObject->oPosX >= 0.0f);
- set_obj_animation_and_sound_state(sEndToadAnims[toadAnimIndex]);
- if (func_8029F788()) {
+ cur_obj_init_animation_with_sound(sEndToadAnims[toadAnimIndex]);
+ if (cur_obj_check_if_near_animation_end()) {
// 0-1, 2-3, 4, 5, 6, 7
if (sEndToadAnims[toadAnimIndex] == 0 || sEndToadAnims[toadAnimIndex] == 2) {
sEndToadAnims[toadAnimIndex]++;
@@ -224,7 +224,7 @@ s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) {
}
// unused
-static void Unknown80256FF8(u16 *a0) {
+static void stub_is_textbox_active(u16 *a0) {
if (get_dialog_id() == -1) {
*a0 = 0;
}
@@ -264,7 +264,7 @@ void handle_save_menu(struct MarioState *m) {
save_file_do_save(gCurrSaveFileNum - 1);
if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) {
- func_80249788(-2, 0); // reset game
+ fade_into_special_warp(-2, 0); // reset game
}
}
@@ -398,7 +398,7 @@ s32 act_reading_npc_dialog(struct MarioState *m) {
if (m->actionState < 8) {
// turn to NPC
- angleToNPC = mario_angle_to_object(m, m->usedObj);
+ angleToNPC = mario_obj_angle_to_object(m, m->usedObj);
m->faceAngle[1] =
angleToNPC - approach_s32((angleToNPC - m->faceAngle[1]) << 16 >> 16, 0, 2048, 2048);
// turn head to npc
@@ -605,7 +605,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
switch (++m->actionTimer) {
case 1:
spawn_object(m->marioObj, MODEL_STAR, bhvCelebrationStar);
- func_80248D48();
+ disable_background_sound();
if (m->actionArg & 1) {
play_course_clear();
} else {
@@ -638,7 +638,7 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) {
m->actionState = 2;
} else if (m->actionState == 2 && is_anim_at_end(m)) {
disable_time_stop();
- func_80248D90();
+ enable_background_sound();
dialogID = get_star_collection_dialog(m);
if (dialogID != 0) {
// look up for dialog
@@ -677,7 +677,7 @@ s32 act_star_dance_water(struct MarioState *m) {
s32 act_fall_after_star_grab(struct MarioState *m) {
if (m->pos[1] < m->waterLevel - 130) {
play_sound(SOUND_ACTION_UNKNOWN430, m->marioObj->header.gfx.cameraToObject);
- m->particleFlags |= PARTICLE_6;
+ m->particleFlags |= PARTICLE_WATER_SPLASH;
return set_mario_action(m, ACT_STAR_DANCE_WATER, m->actionArg);
}
if (perform_air_step(m, 1) == AIR_STEP_LANDED) {
@@ -1014,7 +1014,7 @@ s32 act_emerge_from_pipe(struct MarioState *m) {
s32 act_spawn_spin_airborne(struct MarioState *m) {
// entered water, exit action
if (m->pos[1] < m->waterLevel - 100) {
- func_8024980C(0);
+ load_level_init_text(0);
return set_water_plunge_action(m);
}
@@ -1047,7 +1047,7 @@ s32 act_spawn_spin_landing(struct MarioState *m) {
stop_and_set_height_to_floor(m);
set_mario_animation(m, MARIO_ANIM_GENERAL_LAND);
if (is_anim_at_end(m)) {
- func_8024980C(0);
+ load_level_init_text(0);
set_mario_action(m, ACT_IDLE, 0);
}
return FALSE;
@@ -1278,7 +1278,7 @@ s32 act_spawn_no_spin_landing(struct MarioState *m) {
set_mario_animation(m, MARIO_ANIM_GENERAL_LAND);
stop_and_set_height_to_floor(m);
if (is_anim_at_end(m)) {
- func_8024980C(0);
+ load_level_init_text(0);
set_mario_action(m, ACT_IDLE, 0);
}
return FALSE;
@@ -1739,7 +1739,7 @@ static void intro_cutscene_lower_pipe(struct MarioState *m) {
sIntroWarpPipeObj->oPosY -= 5.0f;
if (sIntroWarpPipeObj->oPosY <= 50.0f) {
- mark_object_for_deletion(sIntroWarpPipeObj);
+ obj_mark_for_deletion(sIntroWarpPipeObj);
advance_cutscene_step(m);
}
@@ -1973,7 +1973,7 @@ static void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius) {
// not sure what this does, returns the height of the floor, but idk about the
// other stuff (animation related?)
-static f32 func_8025BC14(struct Object *o) {
+static f32 end_obj_set_visual_pos(struct Object *o) {
struct Surface *surf;
Vec3s sp24;
f32 sp20;
@@ -2018,7 +2018,7 @@ static void end_peach_cutscene_mario_landing(struct MarioState *m) {
sEndJumboStarObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvStaticObject, 0,
2528, -1800, 0, 0, 0);
- scale_object(sEndJumboStarObj, 3.0);
+ obj_scale(sEndJumboStarObj, 3.0);
advance_cutscene_step(m);
}
}
@@ -2063,7 +2063,7 @@ static void end_peach_cutscene_spawn_peach(struct MarioState *m) {
play_transition(WARP_TRANSITION_FADE_FROM_COLOR, 192, 255, 255, 255);
}
if (m->actionTimer == 40) {
- mark_object_for_deletion(sEndJumboStarObj);
+ obj_mark_for_deletion(sEndJumboStarObj);
sEndPeachObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_PEACH, bhvEndPeach, 0, 2428,
-1300, 0, 0, 0);
@@ -2152,7 +2152,7 @@ static void end_peach_cutscene_run_to_peach(struct MarioState *m) {
m->pos[1] = find_floor(m->pos[0], m->pos[1], m->pos[2], &surf);
set_mario_anim_with_accel(m, MARIO_ANIM_RUNNING, 0x00080000);
- func_80263AD4(m, 9, 45);
+ play_step_sound(m, 9, 45);
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
m->particleFlags |= PARTICLE_DUST;
@@ -2366,9 +2366,9 @@ static void end_peach_cutscene_star_dance(struct MarioState *m) {
static void end_peach_cutscene_dialog_3(struct MarioState *m) {
set_mario_animation(m, MARIO_ANIM_FIRST_PERSON);
- sEndPeachObj->oPosY = func_8025BC14(sEndPeachObj);
- sEndRightToadObj->oPosY = func_8025BC14(sEndRightToadObj);
- sEndLeftToadObj->oPosY = func_8025BC14(sEndLeftToadObj);
+ sEndPeachObj->oPosY = end_obj_set_visual_pos(sEndPeachObj);
+ sEndRightToadObj->oPosY = end_obj_set_visual_pos(sEndRightToadObj);
+ sEndLeftToadObj->oPosY = end_obj_set_visual_pos(sEndLeftToadObj);
switch (m->actionTimer) {
case 1:
@@ -2404,7 +2404,7 @@ static void end_peach_cutscene_run_to_castle(struct MarioState *m) {
set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_START_WALK_LOOK_UP
: MARIO_ANIM_CREDITS_LOOK_BACK_THEN_RUN);
- m->marioObj->header.gfx.pos[1] = func_8025BC14(m->marioObj);
+ m->marioObj->header.gfx.pos[1] = end_obj_set_visual_pos(m->marioObj);
if (m->actionState == 0 && is_anim_past_end(m)) {
m->actionState = 1;
@@ -2494,7 +2494,7 @@ static s32 act_end_peach_cutscene(struct MarioState *m) {
sEndCutsceneVp.vp.vscale[1] = 360;
sEndCutsceneVp.vp.vtrans[0] = 640;
sEndCutsceneVp.vp.vtrans[1] = 480;
- func_8027A220(NULL, &sEndCutsceneVp, 0, 0, 0);
+ override_viewport_and_clip(NULL, &sEndCutsceneVp, 0, 0, 0);
return FALSE;
}
@@ -2546,7 +2546,7 @@ static s32 act_credits_cutscene(struct MarioState *m) {
sEndCutsceneVp.vp.vtrans[1] =
(gCurrCreditsEntry->unk02 & 0x20 ? height : -height) * 66 / 100 + 480;
- func_8027A220(&sEndCutsceneVp, 0, 0, 0, 0);
+ override_viewport_and_clip(&sEndCutsceneVp, 0, 0, 0, 0);
}
if (m->actionTimer == TIMER_CREDITS_PROGRESS) {
@@ -2678,7 +2678,7 @@ s32 mario_execute_cutscene_action(struct MarioState *m) {
if (!cancel) {
if (m->input & INPUT_IN_WATER) {
- m->particleFlags |= PARTICLE_7;
+ m->particleFlags |= PARTICLE_IDLE_WATER_WAVE;
}
}
diff --git a/src/game/mario_actions_cutscene.h b/src/game/mario_actions_cutscene.h
@@ -4,8 +4,8 @@
#include "types.h"
extern void print_displaying_credits_entry(void);
-extern void BehEndPeachLoop(void);
-extern void BehEndToadLoop(void);
+extern void bhv_end_peach_loop(void);
+extern void bhv_end_toad_loop(void);
extern s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2);
extern s32 mario_ready_to_speak(void);
extern s32 set_mario_npc_dialog(s32);
diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c
@@ -60,13 +60,13 @@ struct LandingAction sBackflipLandAction = {
Mat4 D_80339F50[2];
-s16 func_80263A50(struct MarioState *m) {
+s16 tilt_body_running(struct MarioState *m) {
s16 pitch = find_floor_slope(m, 0);
pitch = pitch * m->forwardVel / 40.0f;
return -pitch;
}
-void func_80263AD4(struct MarioState *m, s16 frame1, s16 frame2) {
+void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2) {
if (is_anim_past_frame(m, frame1) || is_anim_past_frame(m, frame2)) {
if (m->flags & MARIO_METAL_CAP) {
if (m->marioObj->header.gfx.unk38.animID == MARIO_ANIM_TIPTOE) {
@@ -84,7 +84,7 @@ void func_80263AD4(struct MarioState *m, s16 frame1, s16 frame2) {
}
}
-void func_80263C14(struct MarioState *m) {
+void align_with_floor(struct MarioState *m) {
m->pos[1] = m->floorHeight;
mtxf_align_terrain_triangle(D_80339F50[m->unk00], m->pos, m->faceAngle[1], 40.0f);
m->marioObj->header.gfx.throwMatrix = &D_80339F50[m->unk00];
@@ -514,7 +514,7 @@ s32 begin_braking_action(struct MarioState *m) {
return set_mario_action(m, ACT_DECELERATING, 0);
}
-void func_802652F0(struct MarioState *m) {
+void anim_and_audio_for_walk(struct MarioState *m) {
s32 val14;
struct Object *marioObj = m->marioObj;
s32 val0C = TRUE;
@@ -530,7 +530,7 @@ void func_802652F0(struct MarioState *m) {
if (m->quicksandDepth > 50.0f) {
val14 = (s32)(val04 / 4.0f * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_MOVE_IN_QUICKSAND, val14);
- func_80263AD4(m, 19, 93);
+ play_step_sound(m, 19, 93);
m->actionTimer = 0;
} else {
while (val0C) {
@@ -544,7 +544,7 @@ void func_802652F0(struct MarioState *m) {
val14 = 0x1000;
}
set_mario_anim_with_accel(m, MARIO_ANIM_START_TIPTOE, val14);
- func_80263AD4(m, 7, 22);
+ play_step_sound(m, 7, 22);
if (is_anim_past_frame(m, 23)) {
m->actionTimer = 2;
}
@@ -562,7 +562,7 @@ void func_802652F0(struct MarioState *m) {
val14 = 0x1000;
}
set_mario_anim_with_accel(m, MARIO_ANIM_TIPTOE, val14);
- func_80263AD4(m, 14, 72);
+ play_step_sound(m, 14, 72);
val0C = FALSE;
}
@@ -577,7 +577,7 @@ void func_802652F0(struct MarioState *m) {
//! (Speed Crash) If Mario's speed is more than 2^17.
val14 = (s32)(val04 / 4.0f * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_WALKING, val14);
- func_80263AD4(m, 10, 49);
+ play_step_sound(m, 10, 49);
val0C = FALSE;
}
@@ -590,8 +590,8 @@ void func_802652F0(struct MarioState *m) {
//! (Speed Crash) If Mario's speed is more than 2^17.
val14 = (s32)(val04 / 4.0f * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_RUNNING, val14);
- func_80263AD4(m, 9, 45);
- targetPitch = func_80263A50(m);
+ play_step_sound(m, 9, 45);
+ targetPitch = tilt_body_running(m);
val0C = FALSE;
}
@@ -605,7 +605,7 @@ void func_802652F0(struct MarioState *m) {
marioObj->header.gfx.angle[0] = marioObj->oMarioWalkingPitch;
}
-void func_8026570C(struct MarioState *m) {
+void anim_and_audio_for_hold_walk(struct MarioState *m) {
s32 val0C;
s32 val08 = TRUE;
f32 val04;
@@ -625,7 +625,7 @@ void func_8026570C(struct MarioState *m) {
//! (Speed Crash) Crashes if Mario's speed exceeds or equals 2^15.
val0C = (s32)(val04 * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_SLOW_WALK_WITH_LIGHT_OBJ, val0C);
- func_80263AD4(m, 12, 62);
+ play_step_sound(m, 12, 62);
val08 = FALSE;
}
@@ -640,7 +640,7 @@ void func_8026570C(struct MarioState *m) {
//! (Speed Crash) Crashes if Mario's speed exceeds or equals 2^15.
val0C = (s32)(val04 * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_WALK_WITH_LIGHT_OBJ, val0C);
- func_80263AD4(m, 12, 62);
+ play_step_sound(m, 12, 62);
val08 = FALSE;
}
@@ -653,7 +653,7 @@ void func_8026570C(struct MarioState *m) {
//! (Speed Crash) Crashes if Mario's speed exceeds or equals 2^16.
val0C = (s32)(val04 / 2.0f * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_RUN_WITH_LIGHT_OBJ, val0C);
- func_80263AD4(m, 10, 49);
+ play_step_sound(m, 10, 49);
val08 = FALSE;
}
@@ -662,13 +662,13 @@ void func_8026570C(struct MarioState *m) {
}
}
-void func_80265980(struct MarioState *m) {
+void anim_and_audio_for_heavy_walk(struct MarioState *m) {
s32 val04 = (s32)(m->intendedMag * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_WALK_WITH_HEAVY_OBJ, val04);
- func_80263AD4(m, 26, 79);
+ play_step_sound(m, 26, 79);
}
-void func_802659E8(struct MarioState *m, Vec3f startPos) {
+void push_or_sidle_wall(struct MarioState *m, Vec3f startPos) {
s16 wallAngle;
s16 dWallAngle;
f32 dx = m->pos[0] - startPos[0];
@@ -689,7 +689,7 @@ void func_802659E8(struct MarioState *m, Vec3f startPos) {
if (m->wall == NULL || dWallAngle <= -0x71C8 || dWallAngle >= 0x71C8) {
m->flags |= MARIO_UNKNOWN_31;
set_mario_animation(m, MARIO_ANIM_PUSHING);
- func_80263AD4(m, 6, 18);
+ play_step_sound(m, 6, 18);
} else {
if (dWallAngle < 0) {
set_mario_anim_with_accel(m, MARIO_ANIM_SIDESTEP_RIGHT, val04);
@@ -709,7 +709,7 @@ void func_802659E8(struct MarioState *m, Vec3f startPos) {
}
}
-void func_80265C28(struct MarioState *m, s16 startYaw) {
+void tilt_body_walking(struct MarioState *m, s16 startYaw) {
struct MarioBodyState *val0C = m->marioBodyState;
UNUSED struct Object *marioObj = m->marioObj;
s16 animID = m->marioObj->header.gfx.unk38.animID;
@@ -747,7 +747,7 @@ void func_80265C28(struct MarioState *m, s16 startYaw) {
}
}
-void func_80265DBC(struct MarioState *m, s16 startYaw) {
+void tilt_body_ground_shell(struct MarioState *m, s16 startYaw) {
struct MarioBodyState *val0C = m->marioBodyState;
struct Object *marioObj = m->marioObj;
s16 dYaw = m->faceAngle[1] - startYaw;
@@ -825,20 +825,20 @@ s32 act_walking(struct MarioState *m) {
break;
case GROUND_STEP_NONE:
- func_802652F0(m);
+ anim_and_audio_for_walk(m);
if (m->intendedMag - m->forwardVel > 16.0f) {
m->particleFlags |= PARTICLE_DUST;
}
break;
case GROUND_STEP_HIT_WALL:
- func_802659E8(m, startPos);
+ push_or_sidle_wall(m, startPos);
m->actionTimer = 0;
break;
}
check_ledge_climb_down(m);
- func_80265C28(m, startYaw);
+ tilt_body_walking(m, startYaw);
return FALSE;
}
@@ -922,7 +922,7 @@ s32 act_hold_walking(struct MarioState *m) {
break;
}
- func_8026570C(m);
+ anim_and_audio_for_hold_walk(m);
if (0.4f * m->intendedMag - m->forwardVel > 10.0f) {
m->particleFlags |= PARTICLE_DUST;
@@ -960,7 +960,7 @@ s32 act_hold_heavy_walking(struct MarioState *m) {
break;
}
- func_80265980(m);
+ anim_and_audio_for_heavy_walk(m);
return FALSE;
}
@@ -1130,7 +1130,7 @@ s32 act_decelerating(struct MarioState *m) {
}
set_mario_anim_with_accel(m, MARIO_ANIM_WALKING, val0C);
- func_80263AD4(m, 10, 49);
+ play_step_sound(m, 10, 49);
}
return FALSE;
@@ -1196,7 +1196,7 @@ s32 act_hold_decelerating(struct MarioState *m) {
}
set_mario_anim_with_accel(m, MARIO_ANIM_WALK_WITH_LIGHT_OBJ, val0C);
- func_80263AD4(m, 12, 62);
+ play_step_sound(m, 12, 62);
}
return FALSE;
@@ -1234,7 +1234,7 @@ s32 act_riding_shell_ground(struct MarioState *m) {
break;
}
- func_80265DBC(m, startYaw);
+ tilt_body_ground_shell(m, startYaw);
if (m->floor->type == SURFACE_BURNING) {
play_sound(SOUND_MOVING_RIDING_SHELL_LAVA, m->marioObj->header.gfx.cameraToObject);
} else {
@@ -1289,13 +1289,13 @@ s32 act_crawling(struct MarioState *m) {
//! Possibly unintended missing break
case GROUND_STEP_NONE:
- func_80263C14(m);
+ align_with_floor(m);
break;
}
val04 = (s32)(m->intendedMag * 2.0f * 0x10000);
set_mario_anim_with_accel(m, MARIO_ANIM_CRAWLING, val04);
- func_80263AD4(m, 26, 79);
+ play_step_sound(m, 26, 79);
return FALSE;
}
@@ -1335,7 +1335,7 @@ s32 act_burning_ground(struct MarioState *m) {
}
set_mario_anim_with_accel(m, MARIO_ANIM_RUNNING, (s32)(m->forwardVel / 2.0f * 0x10000));
- func_80263AD4(m, 9, 45);
+ play_step_sound(m, 9, 45);
m->particleFlags |= PARTICLE_11;
play_sound(SOUND_MOVING_LAVA_BURN, m->marioObj->header.gfx.cameraToObject);
@@ -1349,7 +1349,7 @@ s32 act_burning_ground(struct MarioState *m) {
return FALSE;
}
-void func_80267814(struct MarioState *m) {
+void tilt_body_butt_slide(struct MarioState *m) {
s16 intendedDYaw = m->intendedYaw - m->faceAngle[1];
m->marioBodyState->torsoAngle[0] = (s32)(5461.3335f * m->intendedMag / 32.0f * coss(intendedDYaw));
m->marioBodyState->torsoAngle[2] = (s32)(-(5461.3335f * m->intendedMag / 32.0f * sins(intendedDYaw)));
@@ -1373,7 +1373,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32
case GROUND_STEP_NONE:
set_mario_animation(m, animation);
- func_80263C14(m);
+ align_with_floor(m);
m->particleFlags |= PARTICLE_DUST;
break;
@@ -1401,7 +1401,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32
m->vel[2] = m->slideVelZ = slideSpeed * coss(m->slideYaw);
}
- func_80263C14(m);
+ align_with_floor(m);
break;
}
}
@@ -1427,7 +1427,7 @@ s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jump
s32 act_butt_slide(struct MarioState *m) {
s32 cancel = common_slide_action_with_jump(m, ACT_BUTT_SLIDE_STOP, ACT_JUMP, ACT_BUTT_SLIDE_AIR,
MARIO_ANIM_SLIDE);
- func_80267814(m);
+ tilt_body_butt_slide(m);
return cancel;
}
@@ -1440,7 +1440,7 @@ s32 act_hold_butt_slide(struct MarioState *m) {
cancel = common_slide_action_with_jump(m, ACT_UNKNOWN_03F, ACT_HOLD_JUMP, ACT_HOLD_BUTT_SLIDE_AIR,
MARIO_ANIM_SLIDING_ON_BOTTOM_WITH_LIGHT_OBJ);
- func_80267814(m);
+ tilt_body_butt_slide(m);
return cancel;
}
@@ -2004,7 +2004,7 @@ s32 mario_execute_moving_action(struct MarioState *m) {
/* clang-format on */
if (!cancel && (m->input & INPUT_IN_WATER)) {
- m->particleFlags |= PARTICLE_10;
+ m->particleFlags |= PARTICLE_WAVE_TRAIL;
m->particleFlags &= ~PARTICLE_DUST;
}
diff --git a/src/game/mario_actions_moving.h b/src/game/mario_actions_moving.h
@@ -5,7 +5,7 @@
struct MarioState;
-void func_80263AD4(struct MarioState *m, s16 arg1, s16 arg2);
+void play_step_sound(struct MarioState *m, s16 arg1, s16 arg2);
s32 mario_execute_moving_action(struct MarioState *m);
diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c
@@ -461,7 +461,7 @@ s32 mario_execute_object_action(struct MarioState *m) {
/* clang-format on */
if (!cancel && (m->input & INPUT_IN_WATER)) {
- m->particleFlags |= PARTICLE_7;
+ m->particleFlags |= PARTICLE_IDLE_WATER_WAVE;
}
return cancel;
diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c
@@ -15,7 +15,7 @@
#include "save_file.h"
#include "camera.h"
-s32 func_802604E0(struct MarioState *m) {
+s32 check_common_idle_cancels(struct MarioState *m) {
mario_drop_held_object(m);
if (m->floor->normal.y < 0.29237169f) {
return mario_push_off_steep_floor(m, ACT_FREEFALL, 0);
@@ -57,7 +57,7 @@ s32 func_802604E0(struct MarioState *m) {
return 0;
}
-s32 func_802606DC(struct MarioState *m) {
+s32 check_common_hold_idle_cancels(struct MarioState *m) {
if (m->floor->normal.y < 0.29237169f) {
return mario_push_off_steep_floor(m, ACT_HOLD_FREEFALL, 0);
}
@@ -113,7 +113,7 @@ s32 act_idle(struct MarioState *m) {
return set_mario_action(m, ACT_PANTING, 0);
}
- if (func_802604E0(m)) {
+ if (check_common_idle_cancels(m)) {
return 1;
}
@@ -171,7 +171,7 @@ s32 act_idle(struct MarioState *m) {
return 0;
}
-void func_80260BC4(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound) {
+void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound) {
if (m->actionState == actionState && m->marioObj->header.gfx.unk38.animFrame == animFrame) {
play_sound(sound, m->marioObj->header.gfx.cameraToObject);
}
@@ -182,7 +182,7 @@ s32 act_start_sleeping(struct MarioState *m) {
s32 sp24;
#endif
- if (func_802604E0(m)) {
+ if (check_common_idle_cancels(m)) {
return 1;
}
@@ -230,9 +230,9 @@ s32 act_start_sleeping(struct MarioState *m) {
break;
}
- func_80260BC4(m, 1, 41, SOUND_ACTION_PAT_BACK);
- func_80260BC4(m, 1, 49, SOUND_ACTION_PAT_BACK);
- func_80260BC4(m, 3, 15, m->terrainSoundAddend + SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
+ play_anim_sound(m, 1, 41, SOUND_ACTION_PAT_BACK);
+ play_anim_sound(m, 1, 49, SOUND_ACTION_PAT_BACK);
+ play_anim_sound(m, 3, 15, m->terrainSoundAddend + SOUND_ACTION_TERRAIN_BODY_HIT_GROUND);
if (is_anim_at_end(m)) {
m->actionState++;
@@ -281,7 +281,7 @@ s32 act_sleeping(struct MarioState *m) {
sp24 = set_mario_animation(m, MARIO_ANIM_SLEEP_IDLE);
if (sp24 == -1 && !m->actionTimer) {
- func_80248C28(2);
+ lower_background_noise(2);
}
if (sp24 == 2) {
@@ -336,7 +336,7 @@ s32 act_waking_up(struct MarioState *m) {
#ifndef VERSION_JP
func_803205E8(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject);
#endif
- func_80248CB8(2);
+ raise_background_noise(2);
}
if (m->input & INPUT_UNKNOWN_10) {
@@ -420,7 +420,7 @@ s32 act_shivering(struct MarioState *m) {
s32 act_coughing(struct MarioState *m) {
s32 sp1C;
- if (func_802604E0(m)) {
+ if (check_common_idle_cancels(m)) {
return 1;
}
@@ -454,7 +454,7 @@ s32 act_hold_idle(struct MarioState *m) {
return drop_and_set_mario_action(m, ACT_IN_QUICKSAND, 0);
}
- if (func_802606DC(m)) {
+ if (check_common_hold_idle_cancels(m)) {
return 1;
}
@@ -516,7 +516,7 @@ s32 act_in_quicksand(struct MarioState *m) {
return set_mario_action(m, ACT_IDLE, 0);
}
- if (func_802604E0(m) != 0) {
+ if (check_common_idle_cancels(m) != 0) {
return 1;
}
@@ -577,7 +577,7 @@ s32 act_panting(struct MarioState *m) {
return set_mario_action(m, ACT_IDLE, 0);
}
- if (func_802604E0(m)) {
+ if (check_common_idle_cancels(m)) {
return 1;
}
@@ -604,7 +604,7 @@ s32 act_hold_panting_unused(struct MarioState *m) {
return set_mario_action(m, ACT_HOLD_IDLE, 0);
}
- if (func_802606DC(m) != 0) {
+ if (check_common_hold_idle_cancels(m) != 0) {
return 1;
}
@@ -614,7 +614,7 @@ s32 act_hold_panting_unused(struct MarioState *m) {
return 0;
}
-void func_80261D70(struct MarioState *m, s32 animID, u32 action) {
+void stopping_step(struct MarioState *m, s32 animID, u32 action) {
stationary_ground_step(m);
set_mario_animation(m, animID);
if (is_anim_at_end(m) != 0) {
@@ -640,7 +640,7 @@ s32 act_braking_stop(struct MarioState *m) {
return check_common_action_exits(m);
}
- func_80261D70(m, MARIO_ANIM_STOP_SKID, ACT_IDLE);
+ stopping_step(m, MARIO_ANIM_STOP_SKID, ACT_IDLE);
return 0;
}
@@ -653,7 +653,7 @@ s32 act_butt_slide_stop(struct MarioState *m) {
return check_common_action_exits(m);
}
- func_80261D70(m, MARIO_ANIM_STOP_SLIDE, ACT_IDLE);
+ stopping_step(m, MARIO_ANIM_STOP_SLIDE, ACT_IDLE);
if (m->marioObj->header.gfx.unk38.animFrame == 6) {
play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING);
}
@@ -661,7 +661,7 @@ s32 act_butt_slide_stop(struct MarioState *m) {
return 0;
}
-s32 func_80261F8C(struct MarioState *m) {
+s32 act_unknown_03F(struct MarioState *m) {
if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) {
return drop_and_set_mario_action(m, ACT_IDLE, 0);
}
@@ -678,7 +678,7 @@ s32 func_80261F8C(struct MarioState *m) {
return set_mario_action(m, ACT_THROWING, 0);
}
- func_80261D70(m, MARIO_ANIM_STAND_UP_FROM_SLIDING_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
+ stopping_step(m, MARIO_ANIM_STAND_UP_FROM_SLIDING_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
return 0;
}
@@ -691,7 +691,7 @@ s32 act_slide_kick_slide_stop(struct MarioState *m) {
return drop_and_set_mario_action(m, ACT_FREEFALL, 0);
}
- func_80261D70(m, MARIO_ANIM_CROUCH_FROM_SLIDE_KICK, ACT_CROUCHING);
+ stopping_step(m, MARIO_ANIM_CROUCH_FROM_SLIDE_KICK, ACT_CROUCHING);
return 0;
}
@@ -792,7 +792,7 @@ s32 act_stop_crawling(struct MarioState *m) {
return 0;
}
-s32 func_80262574(struct MarioState *m) {
+s32 act_unknown_026(struct MarioState *m) {
s16 sp1E;
f32 sp18;
@@ -826,7 +826,7 @@ s32 func_80262574(struct MarioState *m) {
return 0;
}
-s32 func_802627B8(struct MarioState *m, s32 arg1, u32 action) {
+s32 landing_step(struct MarioState *m, s32 arg1, u32 action) {
stationary_ground_step(m);
set_mario_animation(m, arg1);
if (is_anim_at_end(m)) {
@@ -835,7 +835,7 @@ s32 func_802627B8(struct MarioState *m, s32 arg1, u32 action) {
return 0;
}
-s32 func_80262828(struct MarioState *m, u32 action) {
+s32 check_common_landing_cancels(struct MarioState *m, u32 action) {
if (m->input & INPUT_UNKNOWN_10) {
return set_mario_action(m, ACT_UNKNOWN_026, 0);
}
@@ -864,48 +864,48 @@ s32 func_80262828(struct MarioState *m, u32 action) {
}
s32 act_jump_land_stop(struct MarioState *m) {
- if (func_80262828(m, 0)) {
+ if (check_common_landing_cancels(m, 0)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_LAND_FROM_SINGLE_JUMP, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_LAND_FROM_SINGLE_JUMP, ACT_IDLE);
return 0;
}
s32 act_double_jump_land_stop(struct MarioState *m) {
- if (func_80262828(m, 0)) {
+ if (check_common_landing_cancels(m, 0)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_LAND_FROM_DOUBLE_JUMP, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_LAND_FROM_DOUBLE_JUMP, ACT_IDLE);
return 0;
}
s32 act_side_flip_land_stop(struct MarioState *m) {
- if (func_80262828(m, 0)) {
+ if (check_common_landing_cancels(m, 0)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_SLIDEFLIP_LAND, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_SLIDEFLIP_LAND, ACT_IDLE);
m->marioObj->header.gfx.angle[1] += 0x8000;
return 0;
}
s32 act_freefall_land_stop(struct MarioState *m) {
- if (func_80262828(m, 0)) {
+ if (check_common_landing_cancels(m, 0)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_GENERAL_LAND, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_GENERAL_LAND, ACT_IDLE);
return 0;
}
s32 act_triple_jump_land_stop(struct MarioState *m) {
- if (func_80262828(m, ACT_JUMP)) {
+ if (check_common_landing_cancels(m, ACT_JUMP)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE);
return 0;
}
@@ -914,39 +914,39 @@ s32 act_backflip_land_stop(struct MarioState *m) {
m->input &= -3;
}
- if (func_80262828(m, ACT_BACKFLIP)) {
+ if (check_common_landing_cancels(m, ACT_BACKFLIP)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_TRIPLE_JUMP_LAND, ACT_IDLE);
return 0;
}
s32 act_lava_boost_land(struct MarioState *m) {
m->input &= -0x2011;
- if (func_80262828(m, 0)) {
+ if (check_common_landing_cancels(m, 0)) {
return 1;
}
- func_802627B8(m, MARIO_ANIM_STAND_UP_FROM_LAVA_BOOST, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_STAND_UP_FROM_LAVA_BOOST, ACT_IDLE);
return 0;
}
s32 act_long_jump_land_stop(struct MarioState *m) {
m->input &= -0x2001;
- if (func_80262828(m, ACT_JUMP)) {
+ if (check_common_landing_cancels(m, ACT_JUMP)) {
return 1;
}
- func_802627B8(m,
+ landing_step(m,
!m->marioObj->oMarioLongJumpIsSlow ? MARIO_ANIM_CROUCH_FROM_FAST_LONGJUMP
: MARIO_ANIM_CROUCH_FROM_SLOW_LONGJUMP,
ACT_CROUCHING);
return 0;
}
-s32 func_80262CEC(struct MarioState *m) {
+s32 act_unknown_034(struct MarioState *m) {
if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) {
return drop_and_set_mario_action(m, ACT_IDLE, 0);
}
@@ -963,11 +963,11 @@ s32 func_80262CEC(struct MarioState *m) {
return set_mario_action(m, ACT_THROWING, 0);
}
- func_802627B8(m, MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
+ landing_step(m, MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
return 0;
}
-s32 func_80262DE4(struct MarioState *m) {
+s32 act_unknown_035(struct MarioState *m) {
if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) {
return drop_and_set_mario_action(m, ACT_IDLE, 0);
}
@@ -983,7 +983,7 @@ s32 func_80262DE4(struct MarioState *m) {
if (m->input & INPUT_B_PRESSED) {
return set_mario_action(m, ACT_THROWING, 0);
}
- func_802627B8(m, MARIO_ANIM_FALL_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
+ landing_step(m, MARIO_ANIM_FALL_LAND_WITH_LIGHT_OBJ, ACT_HOLD_IDLE);
return 0;
}
@@ -1000,7 +1000,7 @@ s32 act_air_throw_land(struct MarioState *m) {
mario_throw_held_object(m);
}
- func_802627B8(m, MARIO_ANIM_THROW_LIGHT_OBJECT, ACT_IDLE);
+ landing_step(m, MARIO_ANIM_THROW_LIGHT_OBJECT, ACT_IDLE);
return 0;
}
@@ -1050,7 +1050,7 @@ s32 act_ground_pound_land(struct MarioState *m) {
return set_mario_action(m, ACT_BUTT_SLIDE, 0);
}
- func_802627B8(m, MARIO_ANIM_GROUND_POUND_LANDING, ACT_BUTT_SLIDE_STOP);
+ landing_step(m, MARIO_ANIM_GROUND_POUND_LANDING, ACT_BUTT_SLIDE_STOP);
return 0;
}
@@ -1061,12 +1061,12 @@ s32 act_first_person(struct MarioState *m) {
sp1C = 0 != (m->input & (INPUT_UNKNOWN_10 | 0xC));
if (m->actionState == 0) {
- func_80248C28(2);
+ lower_background_noise(2);
set_camera_mode(m->area->camera, CAMERA_MODE_C_UP, 0x10);
m->actionState = 1;
} else {
if (!(m->input & INPUT_FIRST_PERSON) || sp1C) {
- func_80248CB8(2);
+ raise_background_noise(2);
// Go back to the last camera mode
set_camera_mode(m->area->camera, -1, 1);
return set_mario_action(m, ACT_IDLE, 0);
@@ -1090,10 +1090,10 @@ s32 act_first_person(struct MarioState *m) {
return 0;
}
-s32 func_80263378(struct MarioState *m) {
+s32 check_common_stationary_cancels(struct MarioState *m) {
if (m->pos[1] < m->waterLevel - 100) {
if (m->action == ACT_SPAWN_SPIN_LANDING) {
- func_8024980C(0);
+ load_level_init_text(0);
}
update_mario_sound_and_camera(m);
return set_water_plunge_action(m);
@@ -1116,7 +1116,7 @@ s32 func_80263378(struct MarioState *m) {
s32 mario_execute_stationary_action(struct MarioState *m) {
s32 sp24;
- if (func_80263378(m)) {
+ if (check_common_stationary_cancels(m)) {
return 1;
}
@@ -1144,14 +1144,14 @@ s32 mario_execute_stationary_action(struct MarioState *m) {
case ACT_START_CRAWLING: sp24 = act_start_crawling(m); break;
case ACT_UNKNOWN_024: sp24 = act_stop_crawling(m); break;
case ACT_SLIDE_KICK_SLIDE_STOP: sp24 = act_slide_kick_slide_stop(m); break;
- case ACT_UNKNOWN_026: sp24 = func_80262574(m); break;
+ case ACT_UNKNOWN_026: sp24 = act_unknown_026(m); break;
case ACT_FIRST_PERSON: sp24 = act_first_person(m); break;
case ACT_JUMP_LAND_STOP: sp24 = act_jump_land_stop(m); break;
case ACT_DOUBLE_JUMP_LAND_STOP: sp24 = act_double_jump_land_stop(m); break;
case ACT_FREEFALL_LAND_STOP: sp24 = act_freefall_land_stop(m); break;
case ACT_SIDE_FLIP_LAND_STOP: sp24 = act_side_flip_land_stop(m); break;
- case ACT_UNKNOWN_034: sp24 = func_80262CEC(m); break;
- case ACT_UNKNOWN_035: sp24 = func_80262DE4(m); break;
+ case ACT_UNKNOWN_034: sp24 = act_unknown_034(m); break;
+ case ACT_UNKNOWN_035: sp24 = act_unknown_035(m); break;
case ACT_AIR_THROW_LAND: sp24 = act_air_throw_land(m); break;
case ACT_LAVA_BOOST_LAND: sp24 = act_lava_boost_land(m); break;
case ACT_TWIRL_LAND: sp24 = act_twirl_land(m); break;
@@ -1161,13 +1161,13 @@ s32 mario_execute_stationary_action(struct MarioState *m) {
case ACT_GROUND_POUND_LAND: sp24 = act_ground_pound_land(m); break;
case ACT_BRAKING_STOP: sp24 = act_braking_stop(m); break;
case ACT_BUTT_SLIDE_STOP: sp24 = act_butt_slide_stop(m); break;
- case ACT_UNKNOWN_03F: sp24 = func_80261F8C(m); break;
+ case ACT_UNKNOWN_03F: sp24 = act_unknown_03F(m); break;
}
/* clang-format on */
if (!sp24) {
if (m->input & INPUT_IN_WATER) {
- m->particleFlags |= PARTICLE_7;
+ m->particleFlags |= PARTICLE_IDLE_WATER_WAVE;
}
}
diff --git a/src/game/mario_actions_stationary.h b/src/game/mario_actions_stationary.h
@@ -5,10 +5,10 @@
#define INPUT_UNKNOWN_A41F 0xA41F
-extern s32 func_802604E0(struct MarioState *);
-extern s32 func_802606DC(struct MarioState *);
+extern s32 check_common_idle_cancels(struct MarioState *);
+extern s32 check_common_hold_idle_cancels(struct MarioState *);
extern s32 act_idle(struct MarioState *);
-extern void func_80260BC4(struct MarioState *, u32, s32, u32);
+extern void play_anim_sound(struct MarioState *, u32, s32, u32);
extern s32 act_start_sleeping(struct MarioState *);
extern s32 act_sleeping(struct MarioState *);
extern s32 act_waking_up(struct MarioState *);
@@ -21,18 +21,18 @@ extern s32 act_in_quicksand(struct MarioState *);
extern s32 act_crouching(struct MarioState *);
extern s32 act_panting(struct MarioState *);
extern s32 func_80261C74(struct MarioState *);
-extern void func_80261D70(struct MarioState *, s32, u32);
+extern void stopping_step(struct MarioState *, s32, u32);
extern s32 act_braking_stop(struct MarioState *);
extern s32 act_butt_slide_stop(struct MarioState *);
-extern s32 func_80261F8C(struct MarioState *);
+extern s32 act_unknown_03F(struct MarioState *);
extern s32 act_slide_kick_slide_stop(struct MarioState *);
extern s32 act_start_crouching(struct MarioState *);
extern s32 act_stop_crouching(struct MarioState *);
extern s32 act_start_crawling(struct MarioState *);
extern s32 act_stop_crawling(struct MarioState *);
-extern s32 func_80262574(struct MarioState *);
-extern s32 func_802627B8(struct MarioState *, s32, u32);
-extern s32 func_80262828(struct MarioState *, u32);
+extern s32 act_unknown_026(struct MarioState *);
+extern s32 landing_step(struct MarioState *, s32, u32);
+extern s32 check_common_landing_cancels(struct MarioState *, u32);
extern s32 act_jump_land_stop(struct MarioState *);
extern s32 act_double_jump_land_stop(struct MarioState *);
extern s32 act_side_flip_land_stop(struct MarioState *);
@@ -41,13 +41,13 @@ extern s32 act_triple_jump_land_stop(struct MarioState *);
extern s32 act_backflip_land_stop(struct MarioState *);
extern s32 act_lava_boost_land(struct MarioState *);
extern s32 act_long_jump_land_stop(struct MarioState *);
-extern s32 func_80262CEC(struct MarioState *);
-extern s32 func_80262DE4(struct MarioState *);
+extern s32 act_unknown_034(struct MarioState *);
+extern s32 act_unknown_035(struct MarioState *);
extern s32 act_air_throw_land(struct MarioState *);
extern s32 act_twirl_land(struct MarioState *);
extern s32 act_ground_pound_land(struct MarioState *);
extern s32 act_first_person(struct MarioState *);
-extern s32 func_80263378(struct MarioState *);
+extern s32 check_common_stationary_cancels(struct MarioState *);
extern s32 mario_execute_stationary_action(struct MarioState *);
#endif /* _MARIO_ACTIONS_STATIONARY */
diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c
@@ -193,7 +193,7 @@ static u32 perform_water_step(struct MarioState *m) {
return stepResult;
}
-static BAD_RETURN(u32) func_80270504(struct MarioState *m) {
+static BAD_RETURN(u32) update_water_pitch(struct MarioState *m) {
struct Object *marioObj = m->marioObj;
if (marioObj->header.gfx.angle[0] > 0) {
@@ -308,7 +308,7 @@ static void common_idle_step(struct MarioState *m, s32 animation, s32 arg) {
update_swimming_pitch(m);
update_swimming_speed(m, MIN_SWIM_SPEED);
perform_water_step(m);
- func_80270504(m);
+ update_water_pitch(m);
if (m->faceAngle[0] > 0) {
*val = approach_s32(*val, m->faceAngle[0] / 2, 0x80, 0x200);
@@ -322,7 +322,7 @@ static void common_idle_step(struct MarioState *m, s32 animation, s32 arg) {
set_mario_anim_with_accel(m, animation, arg);
}
- set_swimming_at_surface_particles(m, PARTICLE_7);
+ set_swimming_at_surface_particles(m, PARTICLE_IDLE_WATER_WAVE);
}
static s32 act_water_idle(struct MarioState *m) {
@@ -415,13 +415,13 @@ static s32 act_hold_water_action_end(struct MarioState *m) {
return FALSE;
}
-static void func_8027107C(struct MarioState *m) {
+static void reset_float_globals(struct MarioState *m) {
D_80339FD0 = 0;
D_80339FD2 = 0x800;
D_80339FD4 = m->faceAngle[0] / 256.0f + 20.0f;
}
-static void func_802710CC(struct MarioState *m) {
+static void float_surface_gfx(struct MarioState *m) {
if (D_80339FD2 != 0 && m->pos[1] > m->waterLevel - 85 && m->faceAngle[0] >= 0) {
if ((D_80339FD0 += D_80339FD2) >= 0) {
m->marioObj->header.gfx.pos[1] += D_80339FD4 * sins(D_80339FD0);
@@ -471,14 +471,14 @@ static void common_swimming_step(struct MarioState *m, s16 swimStrength) {
break;
}
- func_80270504(m);
+ update_water_pitch(m);
m->marioBodyState->headAngle[0] = approach_s32(m->marioBodyState->headAngle[0], 0, 0x200, 0x200);
- func_802710CC(m);
- set_swimming_at_surface_particles(m, PARTICLE_10);
+ float_surface_gfx(m);
+ set_swimming_at_surface_particles(m, PARTICLE_WAVE_TRAIL);
}
-static void func_802713A8(struct MarioState *m) {
+static void play_swimming_noise(struct MarioState *m) {
s16 animFrame = m->marioObj->header.gfx.unk38.animFrame;
// (this need to be on one line to match on PAL)
@@ -550,7 +550,7 @@ static s32 act_breaststroke(struct MarioState *m) {
if (m->actionTimer == 1) {
play_sound(sSwimStrength == MIN_SWIM_STRENGTH ? SOUND_ACTION_SWIM : SOUND_ACTION_SWIM_FAST,
m->marioObj->header.gfx.cameraToObject);
- func_8027107C(m);
+ reset_float_globals(m);
}
set_mario_animation(m, MARIO_ANIM_SWIM_PART1);
@@ -617,7 +617,7 @@ static s32 act_flutter_kick(struct MarioState *m) {
sSwimStrength = MIN_SWIM_STRENGTH;
if (m->forwardVel < 14.0f) {
- func_802713A8(m);
+ play_swimming_noise(m);
set_mario_animation(m, MARIO_ANIM_FLUTTERKICK);
}
@@ -668,7 +668,7 @@ static s32 act_hold_breaststroke(struct MarioState *m) {
if (m->actionTimer == 1) {
play_sound(SOUND_ACTION_SWIM, m->marioObj->header.gfx.cameraToObject);
- func_8027107C(m);
+ reset_float_globals(m);
}
set_mario_animation(m, MARIO_ANIM_SWIM_WITH_OBJ_PART1);
@@ -728,7 +728,7 @@ static s32 act_hold_flutter_kick(struct MarioState *m) {
m->forwardVel = approach_f32(m->forwardVel, 12.0f, 0.1f, 0.15f);
if (m->forwardVel < 14.0f) {
- func_802713A8(m);
+ play_swimming_noise(m);
set_mario_animation(m, MARIO_ANIM_FLUTTERKICK_WITH_OBJ);
}
common_swimming_step(m, 0x00A0);
@@ -753,7 +753,7 @@ static s32 act_water_shell_swimming(struct MarioState *m) {
m->forwardVel = approach_f32(m->forwardVel, 30.0f, 2.0f, 1.0f);
- func_802713A8(m);
+ play_swimming_noise(m);
set_mario_animation(m, MARIO_ANIM_FLUTTERKICK_WITH_OBJ);
common_swimming_step(m, 0x012C);
@@ -786,7 +786,7 @@ static s32 act_water_throw(struct MarioState *m) {
update_swimming_pitch(m);
update_swimming_speed(m, MIN_SWIM_SPEED);
perform_water_step(m);
- func_80270504(m);
+ update_water_pitch(m);
set_mario_animation(m, MARIO_ANIM_WATER_THROW_OBJ);
play_sound_if_no_flag(m, SOUND_ACTION_SWIM, MARIO_ACTION_SOUND_PLAYED);
@@ -813,7 +813,7 @@ static s32 act_water_punch(struct MarioState *m) {
update_swimming_pitch(m);
update_swimming_speed(m, MIN_SWIM_SPEED);
perform_water_step(m);
- func_80270504(m);
+ update_water_pitch(m);
m->marioBodyState->headAngle[0] = approach_s32(m->marioBodyState->headAngle[0], 0, 0x200, 0x200);
@@ -966,7 +966,7 @@ static s32 act_water_plunge(struct MarioState *m) {
play_sound(SOUND_MARIO_HAHA_2, m->marioObj->header.gfx.cameraToObject);
}
- m->particleFlags |= PARTICLE_6;
+ m->particleFlags |= PARTICLE_WATER_SPLASH;
m->actionState = 1;
}
@@ -1178,7 +1178,7 @@ static s32 act_metal_water_standing(struct MarioState *m) {
stop_and_set_height_to_floor(m);
if (m->pos[1] >= m->waterLevel - 150) {
- m->particleFlags |= PARTICLE_7;
+ m->particleFlags |= PARTICLE_IDLE_WATER_WAVE;
}
return FALSE;
diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c
@@ -100,7 +100,7 @@ Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *
return gfx;
}
-static void bhvToadMessage_faded(void) {
+static void toad_message_faded(void) {
if (gCurrentObject->oDistanceToMario > 700.0f) {
gCurrentObject->oToadMessageRecentlyTalked = 0;
}
@@ -109,7 +109,7 @@ static void bhvToadMessage_faded(void) {
}
}
-static void bhvToadMessage_opaque(void) {
+static void toad_message_opaque(void) {
if (gCurrentObject->oDistanceToMario > 700.0f) {
gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
} else {
@@ -124,8 +124,8 @@ static void bhvToadMessage_opaque(void) {
}
}
-static void bhvToadMessage_talking(void) {
- if (obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, gCurrentObject->oToadMessageDialogId)
+static void toad_message_talking(void) {
+ if (cur_obj_update_dialog_with_cutscene(3, 1, CUTSCENE_DIALOG, gCurrentObject->oToadMessageDialogId)
!= 0) {
gCurrentObject->oToadMessageRecentlyTalked = 1;
gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING;
@@ -146,42 +146,42 @@ static void bhvToadMessage_talking(void) {
}
}
-static void bhvToadMessage_opacifying(void) {
+static void toad_message_opacifying(void) {
if ((gCurrentObject->oOpacity += 6) == 255) {
gCurrentObject->oToadMessageState = TOAD_MESSAGE_OPAQUE;
}
}
-static void bhvToadMessage_fading(void) {
+static void toad_message_fading(void) {
if ((gCurrentObject->oOpacity -= 6) == 81) {
gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADED;
}
}
-void bhvToadMessage_loop(void) {
+void bhv_toad_message_loop(void) {
if (gCurrentObject->header.gfx.node.flags & GRAPH_RENDER_ACTIVE) {
gCurrentObject->oInteractionSubtype = 0;
switch (gCurrentObject->oToadMessageState) {
case TOAD_MESSAGE_FADED:
- bhvToadMessage_faded();
+ toad_message_faded();
break;
case TOAD_MESSAGE_OPAQUE:
- bhvToadMessage_opaque();
+ toad_message_opaque();
break;
case TOAD_MESSAGE_OPACIFYING:
- bhvToadMessage_opacifying();
+ toad_message_opacifying();
break;
case TOAD_MESSAGE_FADING:
- bhvToadMessage_fading();
+ toad_message_fading();
break;
case TOAD_MESSAGE_TALKING:
- bhvToadMessage_talking();
+ toad_message_talking();
break;
}
}
}
-void bhvToadMessage_init(void) {
+void bhv_toad_message_init(void) {
s32 saveFlags = save_file_get_flags();
s32 starCount = save_file_get_total_star_count(gCurrSaveFileNum - 1, 0, 24);
s32 dialogId = (gCurrentObject->oBehParams >> 24) & 0xFF;
@@ -213,11 +213,11 @@ void bhvToadMessage_init(void) {
gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADED;
gCurrentObject->oOpacity = 81;
} else {
- mark_object_for_deletion(gCurrentObject);
+ obj_mark_for_deletion(gCurrentObject);
}
}
-static void bhvUnlockDoorStar_spawn_particle(s16 angleOffset) {
+static void star_door_unlock_spawn_particles(s16 angleOffset) {
struct Object *sparkleParticle = spawn_object(gCurrentObject, 0, bhvSparkleSpawn);
sparkleParticle->oPosX +=
@@ -228,7 +228,7 @@ static void bhvUnlockDoorStar_spawn_particle(s16 angleOffset) {
sparkleParticle->oPosY -= gCurrentObject->oUnlockDoorStarTimer * 10.0f;
}
-void bhvUnlockDoorStar_init(void) {
+void bhv_unlock_door_star_init(void) {
gCurrentObject->oUnlockDoorStarState = UNLOCK_DOOR_STAR_RISING;
gCurrentObject->oUnlockDoorStarTimer = 0;
gCurrentObject->oUnlockDoorStarYawVel = 0x1000;
@@ -236,10 +236,10 @@ void bhvUnlockDoorStar_init(void) {
gCurrentObject->oPosY += 160.0f;
gCurrentObject->oPosZ += 30.0f * coss(gMarioState->faceAngle[1] - 0x4000);
gCurrentObject->oMoveAngleYaw = 0x7800;
- scale_object(gCurrentObject, 0.5f);
+ obj_scale(gCurrentObject, 0.5f);
}
-void bhvUnlockDoorStar_loop(void) {
+void bhv_unlock_door_star_loop(void) {
UNUSED u8 unused1[4];
s16 prevYaw = gCurrentObject->oMoveAngleYaw;
UNUSED u8 unused2[4];
@@ -253,7 +253,7 @@ void bhvUnlockDoorStar_loop(void) {
gCurrentObject->oPosY += 3.4f; // Raise the star up in the air
gCurrentObject->oMoveAngleYaw +=
gCurrentObject->oUnlockDoorStarYawVel; // Apply yaw velocity
- scale_object(gCurrentObject, gCurrentObject->oUnlockDoorStarTimer / 50.0f
+ obj_scale(gCurrentObject, gCurrentObject->oUnlockDoorStarTimer / 50.0f
+ 0.5f); // Scale the star to be bigger
if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
gCurrentObject->oUnlockDoorStarTimer = 0;
@@ -266,7 +266,7 @@ void bhvUnlockDoorStar_loop(void) {
if (++gCurrentObject->oUnlockDoorStarTimer == 30) {
play_sound(SOUND_MENU_STAR_SOUND,
gCurrentObject->header.gfx.cameraToObject); // Play final sound
- obj_hide(); // Hide the object
+ cur_obj_hide(); // Hide the object
gCurrentObject->oUnlockDoorStarTimer = 0;
gCurrentObject
->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_SPAWNING_PARTICLES
@@ -274,8 +274,8 @@ void bhvUnlockDoorStar_loop(void) {
break;
case UNLOCK_DOOR_STAR_SPAWNING_PARTICLES:
// Spawn two particles, opposite sides of the star.
- bhvUnlockDoorStar_spawn_particle(0);
- bhvUnlockDoorStar_spawn_particle(0x8000);
+ star_door_unlock_spawn_particles(0);
+ star_door_unlock_spawn_particles(0x8000);
if (gCurrentObject->oUnlockDoorStarTimer++ == 20) {
gCurrentObject->oUnlockDoorStarTimer = 0;
gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_DONE
@@ -284,7 +284,7 @@ void bhvUnlockDoorStar_loop(void) {
case UNLOCK_DOOR_STAR_DONE: // The object stays loaded for an additional 50 frames so that the
// sound doesn't immediately stop.
if (gCurrentObject->oUnlockDoorStarTimer++ == 50) {
- mark_object_for_deletion(gCurrentObject);
+ obj_mark_for_deletion(gCurrentObject);
}
break;
}
diff --git a/src/game/mario_misc.h b/src/game/mario_misc.h
@@ -7,10 +7,10 @@ extern struct GraphNodeObject gMirrorMario;
extern struct MarioBodyState gBodyStates[2];
extern Gfx *geo_draw_mario_head_goddard(s32 a, struct GraphNode *b, Mat4 *c);
-extern void bhvToadMessage_loop(void);
-extern void bhvToadMessage_init(void);
-extern void bhvUnlockDoorStar_init(void);
-extern void bhvUnlockDoorStar_loop(void);
+extern void bhv_toad_message_loop(void);
+extern void bhv_toad_message_init(void);
+extern void bhv_unlock_door_star_init(void);
+extern void bhv_unlock_door_star_loop(void);
extern Gfx *geo_mirror_mario_set_alpha(s32 a, struct GraphNode *b, UNUSED Mat4 *c);
extern Gfx *geo_switch_mario_stand_run(s32 run, struct GraphNode *node, UNUSED Mat4 *c);
extern Gfx *geo_switch_mario_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *c);
diff --git a/src/game/mario_step.c b/src/game/mario_step.c
@@ -21,9 +21,9 @@ struct Surface gWaterSurfacePseudoFloor = {
* to be used for the beta trampoline. Its return value
* is used by set_mario_y_vel_based_on_fspeed as a constant
* addition to Mario's Y velocity. Given the closeness of
- * this function to nop_80254E50, it is probable that this
+ * this function to stub_mario_step_2, it is probable that this
* was intended to check whether a trampoline had made itself
- * known through nop_80254E50 and whether Mario was on it,
+ * known through stub_mario_step_2 and whether Mario was on it,
* and if so return a higher value than 0.
*/
f32 get_additive_y_vel_for_jumps(void) {
@@ -33,13 +33,13 @@ f32 get_additive_y_vel_for_jumps(void) {
/**
* Does nothing, but takes in a MarioState. This is only ever
* called by update_mario_inputs, which is called as part of Mario's
- * update routine. Due to its proximity to nop_80254E50, an
+ * update routine. Due to its proximity to stub_mario_step_2, an
* incomplete trampoline function, and get_additive_y_vel_for_jumps,
* a potentially trampoline-related function, it is plausible that
* this could be used for checking if Mario was on the trampoline.
* It could, for example, make him bounce.
*/
-void nop_80254E3C(UNUSED struct MarioState *x) {
+void stub_mario_step_1(UNUSED struct MarioState *x) {
}
/**
@@ -49,7 +49,7 @@ void nop_80254E3C(UNUSED struct MarioState *x) {
* by the trampoline to make itself known to get_additive_y_vel_for_jumps,
* or to set a variable with its intended additive Y vel.
*/
-void nop_80254E50(void) {
+void stub_mario_step_2(void) {
}
void transfer_bully_speed(struct BullyCollisionData *obj1, struct BullyCollisionData *obj2) {
diff --git a/src/game/mario_step.h b/src/game/mario_step.h
@@ -6,8 +6,8 @@
extern struct Surface gWaterSurfacePseudoFloor;
extern f32 get_additive_y_vel_for_jumps(void);
-extern void nop_80254E3C(struct MarioState *);
-extern void nop_80254E50(void);
+extern void stub_mario_step_1(struct MarioState *);
+extern void stub_mario_step_2(void);
extern void mario_bonk_reflection(struct MarioState *, u32);
extern u32 mario_update_quicksand(struct MarioState *, f32);
diff --git a/src/game/memory.c b/src/game/memory.c
@@ -329,7 +329,7 @@ void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd) {
return dest;
}
-void *func_80278304(u32 segment, u8 *srcStart, u8 *srcEnd) {
+void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd) {
UNUSED void *dest = NULL;
u32 compSize = ALIGN16(srcEnd - srcStart);
u8 *compressed = main_pool_alloc(compSize, MEMORY_POOL_RIGHT);
@@ -538,7 +538,7 @@ void func_80278A78(struct MarioAnimation *a, void *b, struct Animation *target)
a->targetAnim = target;
}
-s32 func_80278AD4(struct MarioAnimation *a, u32 index) {
+s32 load_patchable_table(struct MarioAnimation *a, u32 index) {
s32 ret = FALSE;
struct MarioAnimDmaRelatedThing *sp20 = a->animDmaTable;
u8 *addr;
diff --git a/src/game/memory.h b/src/game/memory.h
@@ -40,7 +40,7 @@ u32 main_pool_pop_state(void);
void *load_segment(s32 segment, u8 *srcStart, u8 *srcEnd, u32 side);
void *load_to_fixed_pool_addr(u8 *destAddr, u8 *srcStart, u8 *srcEnd);
void *load_segment_decompress(s32 segment, u8 *srcStart, u8 *srcEnd);
-void *func_80278304(u32 segment, u8 *srcStart, u8 *srcEnd);
+void *load_segment_decompress_heap(u32 segment, u8 *srcStart, u8 *srcEnd);
void load_engine_code_segment(void);
struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side);
@@ -53,6 +53,6 @@ void mem_pool_free(struct MemoryPool *pool, void *addr);
void *alloc_display_list(u32 size);
void func_80278A78(struct MarioAnimation *a, void *b, struct Animation *target);
-s32 func_80278AD4(struct MarioAnimation *a, u32 b);
+s32 load_patchable_table(struct MarioAnimation *a, u32 b);
#endif
diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c
@@ -78,7 +78,7 @@ void set_yoshi_as_not_dead(void) {
}
/**
- * An unused geo function. Bears strong similarity to Geo18_802B7D44, and relates something
+ * An unused geo function. Bears strong similarity to geo_bits_bowser_coloring, and relates something
* of the opacity of an object to something else. Perhaps like, giving a parent object the same
* opacity?
*/
@@ -395,10 +395,10 @@ void obj_splash(s32 waterY, s32 objY) {
// Spawns waves if near surface of water and plays a noise if entering.
if ((f32)(waterY + 30) > o->oPosY && o->oPosY > (f32)(waterY - 30)) {
- spawn_object(o, MODEL_WATER_WAVES_SURF, bhvObjectWaterWave);
+ spawn_object(o, MODEL_IDLE_WATER_WAVE, bhvObjectWaterWave);
if (o->oVelY < -20.0f) {
- PlaySound2(SOUND_OBJ_DIVING_INTO_WATER);
+ cur_obj_play_sound_2(SOUND_OBJ_DIVING_INTO_WATER);
}
}
@@ -739,7 +739,7 @@ s32 obj_lava_death(void) {
}
if ((o->oTimer % 8) == 0) {
- PlaySound2(SOUND_OBJ_BULLY_EXPLODE_2);
+ cur_obj_play_sound_2(SOUND_OBJ_BULLY_EXPLODE_2);
deathSmoke = spawn_object(o, MODEL_SMOKE, bhvBobombBullyDeathSmoke);
deathSmoke->oPosX += RandomFloat() * 20.0f;
deathSmoke->oPosY += RandomFloat() * 20.0f;
diff --git a/src/game/obj_behaviors.h b/src/game/obj_behaviors.h
@@ -11,48 +11,48 @@ extern u8 bob_seg7_metal_ball_path1[];
void set_yoshi_as_not_dead(void);
-s32 CoinStep(s16 *collisionFlagsPtr);
-void MovingCoinFlickerLoop(void);
-void CoinCollected(void);
+s32 coin_step(s16 *collisionFlagsPtr);
+void moving_coin_flicker(void);
+void coin_collected(void);
void bhv_moving_yellow_coin_init(void);
void bhv_moving_yellow_coin_loop(void);
void bhv_moving_blue_coin_init(void);
void bhv_moving_blue_coin_loop(void);
void bhv_blue_coin_sliding_jumping_init(void);
-void func_802E540C(void); /* likely unused */
-void func_802E54DC(void); /* likely unused */
+void blue_coin_sliding_away_from_mario(void); /* likely unused */
+void blue_coin_sliding_slow_down(void); /* likely unused */
void bhv_blue_coin_sliding_loop(void); /* likely unused */
void bhv_blue_coin_jumping_loop(void); /* likely unused */
void bhv_seaweed_init(void);
void bhv_seaweed_bundle_init(void);
void bhv_bobomb_init(void);
-void func_802E5B7C(void);
-void BobombExplodeLoop(void);
-void CheckBobombInteractions(void);
-void BobombPatrolLoop(void);
-void BobombChaseMarioLoop(void);
-void BobombLaunchedLoop(void);
-void GenericBobombFreeLoop(void);
-void StationaryBobombFreeLoop(void);
-void BobombFreeLoop(void);
-void BobombHeldLoop(void);
-void BobombDroppedLoop(void);
-void BobombThrownLoop(void);
-void ObjRandomBlink(s32 *blinkTimer);
+void bobomb_spawn_coin(void);
+void bobomb_act_explode(void);
+void bobomb_check_interactions(void);
+void bobomb_act_patrol(void);
+void bobomb_act_chase_mario(void);
+void bobomb_act_launched(void);
+void generic_bobomb_free_loop(void);
+void stationary_bobomb_free_loop(void);
+void bobomb_free_loop(void);
+void bobomb_held_loop(void);
+void bobomb_dropped_loop(void);
+void bobomb_thrown_loop(void);
+void curr_obj_random_blink(s32 *blinkTimer);
void bhv_bobomb_loop(void);
void bhv_bobomb_fuse_smoke_init(void);
void bhv_bobomb_buddy_init(void);
-void BobombBuddyIdleLoop(void);
-void BobombBuddyCannonLoop(s16 arg0, s16 arg1);
-void BobombBuddyTalkLoop(void);
-void BobombBuddyTurnToTalkLoop(void);
-void BobombBuddyActionLoop(void);
+void bobomb_buddy_act_idle(void);
+void bobomb_buddy_cannon_dialog(s16 arg0, s16 arg1);
+void bobomb_buddy_act_talk(void);
+void bobomb_buddy_act_turn_to_talk(void);
+void bobomb_buddy_actions(void);
void bhv_bobomb_buddy_loop(void);
void bhv_cannon_closed_init(void);
-void CannonTrapDoorOpeningLoop(void);
+void cannon_door_act_opening(void);
void bhv_cannon_closed_loop(void);
void bhv_whirlpool_init(void);
-void func_802E70A8(void);
+void whirlpool_set_hitbox(void);
void WhirlpoolOrientGraph(void);
void bhv_whirlpool_loop(void);
void bhv_jet_stream_loop(void);
@@ -61,23 +61,23 @@ void bhv_homing_amp_loop(void);
void bhv_circling_amp_init(void);
void bhv_circling_amp_loop(void);
void bhv_butterfly_init(void);
-void ButterflyStep(s32 speed);
-void CalculateButterflyAngle(void);
-void ButterflyRestingLoop(void);
-void ButterflyFollowMarioLoop(void);
-void ButterflyReturnHomeLoop(void);
+void butterfly_step(s32 speed);
+void butterfly_calculate_angle(void);
+void butterfly_act_rest(void);
+void butterfly_act_follow_mario(void);
+void butterfly_act_return_home(void);
void bhv_butterfly_loop(void);
void bhv_hoot_init(void);
-f32 HootFindNextFloor(struct FloorGeometry **arg0, f32 arg1);
-void HootFloorBounce(void);
-void HootFreeStep(s16 arg0, s32 arg1);
-void PlayerSetHootYaw(void);
-void HootCarryStep(s32 arg0, UNUSED f32 arg1, UNUSED f32 arg2);
-void HootSurfaceCollision(f32 arg0, UNUSED f32 arg1, f32 arg2);
-void HootAscentLoop(f32 arg0, f32 arg1);
-void HootActionLoop(void);
-void HootTurnToHome(void);
-void HootAwakeLoop(void);
+f32 hoot_find_next_floor(struct FloorGeometry **arg0, f32 arg1);
+void hoot_floor_bounce(void);
+void hoot_free_step(s16 arg0, s32 arg1);
+void hoot_player_set_yaw(void);
+void hoot_carry_step(s32 arg0, UNUSED f32 arg1, UNUSED f32 arg2);
+void hoot_surface_collision(f32 arg0, UNUSED f32 arg1, f32 arg2);
+void hoot_act_ascent(f32 arg0, f32 arg1);
+void hoot_action_loop(void);
+void hoot_turn_to_home(void);
+void hoot_awake_loop(void);
void bhv_hoot_loop(void);
void bhv_beta_holdable_object_init(void); /* unused */
void bhv_beta_holdable_object_loop(void); /* unused */
@@ -94,40 +94,40 @@ void bhv_respawner_loop(void);
void create_respawner(s32 arg0, const BehaviorScript *behToSpawn, s32 minSpawnDist);
void bhv_small_bully_init(void);
void bhv_big_bully_init(void);
-void BullyCheckMarioCollision(void);
-void BullyChaseMarioLoop(void);
-void BullyKnockbackLoop(void);
-void BullyBackUpLoop(void);
-void BullyBackUpCheck(s16 arg0);
-void PlayBullyStompingSound(void);
-void BullyStep(void);
-void BullySpawnCoin(void);
-void BullyLavaDeath(void);
+void bully_check_mario_collision(void);
+void bully_act_chase_mario(void);
+void bully_act_knockback(void);
+void bully_act_back_up(void);
+void bully_backup_check(s16 arg0);
+void bully_play_stomping_sound(void);
+void bully_step(void);
+void bully_spawn_coin(void);
+void bully_act_level_death(void);
void bhv_bully_loop(void);
-void BigBullySpawnMinion(s32 arg0, s32 arg1, s32 arg2, s16 arg3);
+void big_bully_spawn_minion(s32 arg0, s32 arg1, s32 arg2, s16 arg3);
void bhv_big_bully_with_minions_init(void);
-void BigBullyWithMinionsLavaDeath(void);
+void big_bully_spawn_star(void);
void bhv_big_bully_with_minions_loop(void);
-f32 WaterRingCalcMarioDistInFront(void);
-void WaterRingInit(void);
+f32 water_ring_calc_mario_dist(void);
+void water_ring_init(void);
void bhv_jet_stream_water_ring_init(void);
-void CheckWaterRingCollection(f32 avgScale, struct Object* ringManager);
-void SetWaterRingScale(f32 avgScale);
-void WaterRingCollectedLoop(void);
-void JetStreamWaterRingNotCollectedLoop(void);
+void water_ring_check_collection(f32 avgScale, struct Object* ringManager);
+void water_ring_set_scale(f32 avgScale);
+void water_ring_act_collected(void);
+void water_ring_act_not_collected(void);
void bhv_jet_stream_water_ring_loop(void);
-void Unknown802EB8A4(void); /* unused */
-void JetStreamRingSpawnerActiveLoop(void);
+void spawn_manta_ray_ring_manager(void); /* unused */
+void water_ring_spawner_act_inactive(void);
void bhv_jet_stream_ring_spawner_loop(void);
void bhv_manta_ray_water_ring_init(void);
-void MantaRayWaterRingNotCollectedLoop(void);
+void manta_water_ring_act_not_collected(void);
void bhv_manta_ray_water_ring_loop(void);
void bhv_bowser_bomb_loop(void);
void bhv_bowser_bomb_explosion_loop(void);
void bhv_bowser_bomb_smoke_loop(void);
void bhv_celebration_star_init(void);
-void CelebrationStarSpinAroundMarioLoop(void);
-void CelebrationStarFaceCameraLoop(void);
+void celeb_star_act_spin_around_mario(void);
+void celeb_star_act_face_camera(void);
void bhv_celebration_star_loop(void);
void bhv_celebration_star_sparkle_loop(void);
void bhv_star_key_collection_puff_spawner_loop(void);
@@ -140,17 +140,17 @@ void bhv_large_bomp_loop(void);
void bhv_wf_sliding_platform_init(void);
void bhv_wf_sliding_platform_loop(void);
void bhv_moneybag_init(void);
-void MoneybagCheckMarioCollision(void);
-void MoneybagJump(s8 collisionFlags);
-void MoneybagMoveAroundLoop(void);
-void MoneybagReturnHomeLoop(void);
-void MoneybagDisappearLoop(void);
-void MoneybagDeathLoop(void);
+void moneybag_check_mario_collision(void);
+void moneybag_jump(s8 collisionFlags);
+void moneybag_act_move_around(void);
+void moneybag_act_return_home(void);
+void moneybag_act_disappear(void);
+void moneybag_act_death(void);
void bhv_moneybag_loop(void);
void bhv_moneybag_hidden_loop(void);
void bhv_bowling_ball_init(void);
-void func_802EDA14(void);
-void func_802EDA6C(void);
+void bowling_ball_set_hitbox(void);
+void bowling_ball_set_waypoints(void);
void bhv_bowling_ball_roll_loop(void);
void bhv_bowling_ball_initializeLoop(void);
void bhv_bowling_ball_loop(void);
@@ -164,6 +164,6 @@ void bhv_free_bowling_ball_roll_loop(void); /* likely unused */
void bhv_free_bowling_ball_loop(void); /* likely unused */
void bhv_rr_cruiser_wing_init(void);
void bhv_rr_cruiser_wing_loop(void);
-extern void create_star(f32, f32, f32);
+extern void spawn_default_star(f32, f32, f32);
#endif /* _OBJ_BEHAVIORS_H */
diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c
@@ -147,7 +147,7 @@ static s16 obj_get_pitch_from_vel(void) {
*/
static s32 obj_update_race_proposition_dialog(s16 dialogID) {
s32 dialogResponse =
- obj_update_dialog_with_cutscene(2, DIALOG_UNK2_FLAG_0 | DIALOG_UNK2_LEAVE_TIME_STOP_ENABLED, CUTSCENE_RACE_DIALOG, dialogID);
+ cur_obj_update_dialog_with_cutscene(2, DIALOG_UNK2_FLAG_0 | DIALOG_UNK2_LEAVE_TIME_STOP_ENABLED, CUTSCENE_RACE_DIALOG, dialogID);
if (dialogResponse == 2) {
set_mario_npc_dialog(0);
@@ -347,9 +347,9 @@ static void func_802F8D78(f32 arg0, f32 arg1) {
static void obj_rotate_yaw_and_bounce_off_walls(s16 targetYaw, s16 turnAmount) {
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- targetYaw = obj_reflect_move_angle_off_wall();
+ targetYaw = cur_obj_reflect_move_angle_off_wall();
}
- obj_rotate_yaw_toward(targetYaw, turnAmount);
+ cur_obj_rotate_yaw_toward(targetYaw, turnAmount);
}
static s16 obj_get_pitch_to_home(f32 latDistToHome) {
@@ -386,23 +386,23 @@ static s32 clamp_f32(f32 *value, f32 minimum, f32 maximum) {
}
static void func_802F927C(s32 arg0) {
- set_obj_animation_and_sound_state(arg0);
- func_8029F728();
+ cur_obj_init_animation_with_sound(arg0);
+ cur_obj_extend_animation_if_at_end();
}
static s32 func_802F92B0(s32 arg0) {
- set_obj_animation_and_sound_state(arg0);
- return func_8029F788();
+ cur_obj_init_animation_with_sound(arg0);
+ return cur_obj_check_if_near_animation_end();
}
static s32 func_802F92EC(s32 arg0, s32 arg1) {
- set_obj_animation_and_sound_state(arg0);
- return obj_check_anim_frame(arg1);
+ cur_obj_init_animation_with_sound(arg0);
+ return cur_obj_check_anim_frame(arg1);
}
static s32 func_802F932C(s32 arg0) {
- if (func_8029F828()) {
- set_obj_animation_and_sound_state(arg0);
+ if (cur_obj_check_if_at_animation_end()) {
+ cur_obj_init_animation_with_sound(arg0);
return TRUE;
}
return FALSE;
@@ -415,8 +415,8 @@ static s32 func_802F9378(s8 arg0, s8 arg1, u32 sound) {
val04 = 1;
}
- if (obj_check_anim_frame_in_range(arg0, val04) || obj_check_anim_frame_in_range(arg1, val04)) {
- PlaySound2(sound);
+ if (cur_obj_check_anim_frame_in_range(arg0, val04) || cur_obj_check_anim_frame_in_range(arg1, val04)) {
+ cur_obj_play_sound_2(sound);
return TRUE;
}
@@ -642,7 +642,7 @@ static s32 obj_resolve_object_collisions(s32 *targetYaw) {
static s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw) {
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
- *targetYaw = obj_reflect_move_angle_off_wall();
+ *targetYaw = cur_obj_reflect_move_angle_off_wall();
} else if (o->oMoveFlags & OBJ_MOVE_HIT_EDGE) {
*targetYaw = (s16)(o->oMoveAngleYaw + 0x8000);
} else if (!obj_resolve_object_collisions(targetYaw)) {
@@ -655,7 +655,7 @@ static s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw) {
static s32 obj_resolve_collisions_and_turn(s16 targetYaw, s16 turnSpeed) {
obj_resolve_object_collisions(NULL);
- if (obj_rotate_yaw_toward(targetYaw, turnSpeed)) {
+ if (cur_obj_rotate_yaw_toward(targetYaw, turnSpeed)) {
return FALSE;
} else {
return TRUE;
@@ -670,31 +670,31 @@ static void obj_die_if_health_non_positive(void) {
if (o->oHealth <= 0) {
if (o->oDeathSound == 0) {
- func_802A3034(SOUND_OBJ_DEFAULT_DEATH);
+ spawn_mist_particles_with_sound(SOUND_OBJ_DEFAULT_DEATH);
} else if (o->oDeathSound > 0) {
#ifdef VERSION_EU
new_var = o->oDeathSound;
- func_802A3034(new_var);
+ spawn_mist_particles_with_sound(new_var);
#else
- func_802A3034(o->oDeathSound);
+ spawn_mist_particles_with_sound(o->oDeathSound);
#endif
} else {
- func_802A3004();
+ spawn_mist_particles();
}
if ((s32)o->oNumLootCoins < 0) {
spawn_object(o, MODEL_BLUE_COIN, bhvMrIBlueCoin);
} else {
- spawn_object_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
+ obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
}
// This doesn't do anything
- spawn_object_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
+ obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
if (o->oHealth < 0) {
- obj_hide();
- obj_become_intangible();
+ cur_obj_hide();
+ cur_obj_become_intangible();
} else {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
}
}
@@ -721,11 +721,11 @@ static void obj_set_knockback_action(s32 attackType) {
}
o->oFlags &= ~OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW;
- o->oMoveAngleYaw = angle_to_object(gMarioObject, o);
+ o->oMoveAngleYaw = obj_angle_to_object(gMarioObject, o);
}
static void obj_set_squished_action(void) {
- PlaySound2(SOUND_OBJ_STOMPED);
+ cur_obj_play_sound_2(SOUND_OBJ_STOMPED);
o->oAction = OBJ_ACT_SQUISHED;
}
@@ -738,9 +738,9 @@ static s32 obj_die_if_above_lava_and_health_non_positive(void) {
} else if (!(o->oMoveFlags & OBJ_MOVE_ABOVE_LAVA)) {
if (o->oMoveFlags & OBJ_MOVE_ENTERED_WATER) {
if (o->oWallHitboxRadius < 200.0f) {
- PlaySound2(SOUND_OBJ_DIVING_INTO_WATER);
+ cur_obj_play_sound_2(SOUND_OBJ_DIVING_INTO_WATER);
} else {
- PlaySound2(SOUND_OBJ_DIVING_IN_WATER);
+ cur_obj_play_sound_2(SOUND_OBJ_DIVING_IN_WATER);
}
}
return FALSE;
@@ -754,7 +754,7 @@ static s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioActi
u8 *attackHandlers) {
s32 attackType;
- set_object_hitbox(o, hitbox);
+ obj_set_hitbox(o, hitbox);
//! Die immediately if above lava
if (obj_die_if_above_lava_and_health_non_positive()) {
@@ -816,10 +816,10 @@ static s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioActi
}
static void obj_act_knockback(UNUSED f32 baseScale) {
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->header.gfx.unk38.curAnim != NULL) {
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
}
//! Dies immediately if above lava
@@ -829,16 +829,16 @@ static void obj_act_knockback(UNUSED f32 baseScale) {
obj_die_if_health_non_positive();
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
static void obj_act_squished(f32 baseScale) {
f32 targetScaleY = baseScale * 0.3f;
- obj_update_floor_and_walls();
+ cur_obj_update_floor_and_walls();
if (o->header.gfx.unk38.curAnim != NULL) {
- func_8029F728();
+ cur_obj_extend_animation_if_at_end();
}
if (approach_f32_ptr(&o->header.gfx.scale[1], targetScaleY, baseScale * 0.14f)) {
@@ -850,14 +850,14 @@ static void obj_act_squished(f32 baseScale) {
}
o->oForwardVel = 0.0f;
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
}
static s32 obj_update_standard_actions(f32 scale) {
if (o->oAction < 100) {
return TRUE;
} else {
- obj_become_intangible();
+ cur_obj_become_intangible();
switch (o->oAction) {
case OBJ_ACT_HORIZONTAL_KNOCKBACK:
@@ -877,7 +877,7 @@ static s32 obj_update_standard_actions(f32 scale) {
static s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction) {
s32 attackType;
- set_object_hitbox(o, hitbox);
+ obj_set_hitbox(o, hitbox);
//! Dies immediately if above lava
if (obj_die_if_above_lava_and_health_non_positive()) {
@@ -901,15 +901,15 @@ static s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioActio
}
static s32 obj_move_for_one_second(s32 endAction) {
- obj_update_floor_and_walls();
- func_8029F728();
+ cur_obj_update_floor_and_walls();
+ cur_obj_extend_animation_if_at_end();
if (o->oTimer > 30) {
o->oAction = endAction;
return TRUE;
}
- obj_move_standard(-78);
+ cur_obj_move_standard(-78);
return FALSE;
}
diff --git a/src/game/object_collision.c b/src/game/object_collision.c
@@ -7,7 +7,7 @@
#include "object_list_processor.h"
#include "interaction.h"
-struct Object *Unknown802C8460(struct Object *a) {
+struct Object *debug_print_obj_collision(struct Object *a) {
struct Object *sp24;
UNUSED s32 unused;
s32 i;
@@ -22,7 +22,7 @@ struct Object *Unknown802C8460(struct Object *a) {
return NULL;
}
-int func_802C8504(struct Object *a, struct Object *b) {
+int detect_object_hitbox_overlap(struct Object *a, struct Object *b) {
f32 sp3C = a->oPosY - a->hitboxDownOffset;
f32 sp38 = b->oPosY - b->hitboxDownOffset;
f32 dx = a->oPosX - b->oPosX;
@@ -59,7 +59,7 @@ int func_802C8504(struct Object *a, struct Object *b) {
//! no return value
}
-int func_802C870C(struct Object *a, struct Object *b) {
+int detect_object_hurtbox_overlap(struct Object *a, struct Object *b) {
f32 sp3C = a->oPosY - a->hitboxDownOffset;
f32 sp38 = b->oPosY - b->hitboxDownOffset;
f32 sp34 = a->oPosX - b->oPosX;
@@ -91,7 +91,7 @@ int func_802C870C(struct Object *a, struct Object *b) {
//! no return value
}
-void func_802C88A8(struct Object *a) {
+void clear_object_collision(struct Object *a) {
struct Object *sp4 = (struct Object *) a->header.next;
while (sp4 != a) {
@@ -104,12 +104,12 @@ void func_802C88A8(struct Object *a) {
}
}
-void func_802C8918(struct Object *a, struct Object *b, struct Object *c) {
+void check_collision_in_list(struct Object *a, struct Object *b, struct Object *c) {
if (a->oIntangibleTimer == 0) {
while (b != c) {
if (b->oIntangibleTimer == 0) {
- if (func_802C8504(a, b) && b->hurtboxRadius != 0.0f) {
- func_802C870C(a, b);
+ if (detect_object_hitbox_overlap(a, b) && b->hurtboxRadius != 0.0f) {
+ detect_object_hurtbox_overlap(a, b);
}
}
b = (struct Object *) b->header.next;
@@ -117,50 +117,50 @@ void func_802C8918(struct Object *a, struct Object *b, struct Object *c) {
}
}
-void func_802C89CC(void) {
+void check_player_object_collision(void) {
struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_PLAYER];
struct Object *sp18 = (struct Object *) sp1C->header.next;
while (sp18 != sp1C) {
- func_802C8918(sp18, (struct Object *) sp18->header.next, sp1C);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_POLELIKE].next,
+ check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C);
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_POLELIKE].next,
(struct Object *) &gObjectLists[OBJ_LIST_POLELIKE]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_LEVEL].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_LEVEL].next,
(struct Object *) &gObjectLists[OBJ_LIST_LEVEL]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next,
(struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next,
(struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next,
(struct Object *) &gObjectLists[OBJ_LIST_SURFACE]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_DESTRUCTIVE].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_DESTRUCTIVE].next,
(struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]);
sp18 = (struct Object *) sp18->header.next;
}
}
-void func_802C8AD4(void) {
+void check_pushable_object_collision(void) {
struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE];
struct Object *sp18 = (struct Object *) sp1C->header.next;
while (sp18 != sp1C) {
- func_802C8918(sp18, (struct Object *) sp18->header.next, sp1C);
+ check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C);
sp18 = (struct Object *) sp18->header.next;
}
}
-void func_802C8B50(void) {
+void check_destructive_object_collision(void) {
struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE];
struct Object *sp18 = (struct Object *) sp1C->header.next;
while (sp18 != sp1C) {
if (sp18->oDistanceToMario < 2000.0f && !(sp18->activeFlags & ACTIVE_FLAG_UNK9)) {
- func_802C8918(sp18, (struct Object *) sp18->header.next, sp1C);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next,
+ check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C);
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next,
(struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next,
(struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]);
- func_802C8918(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next,
+ check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next,
(struct Object *) &gObjectLists[OBJ_LIST_SURFACE]);
}
sp18 = (struct Object *) sp18->header.next;
@@ -168,14 +168,14 @@ void func_802C8B50(void) {
}
void detect_object_collisions(void) {
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_POLELIKE]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_PLAYER]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_LEVEL]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_SURFACE]);
- func_802C88A8((struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]);
- func_802C89CC();
- func_802C8B50();
- func_802C8AD4();
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_POLELIKE]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_PLAYER]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_LEVEL]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_SURFACE]);
+ clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]);
+ check_player_object_collision();
+ check_destructive_object_collision();
+ check_pushable_object_collision();
}
diff --git a/src/game/object_collision.h b/src/game/object_collision.h
@@ -3,14 +3,14 @@
#include "types.h"
-// extern ? Unknown802C8460(?);
-// extern ? func_802C8504(?);
-// extern ? func_802C870C(?);
-// extern ? func_802C88A8(?);
-// extern ? func_802C8918(?);
-// extern ? func_802C89CC(?);
-// extern ? func_802C8AD4(?);
-// extern ? func_802C8B50(?);
+// extern ? debug_print_obj_collision(?);
+// extern ? detect_object_hitbox_overlap(?);
+// extern ? detect_object_hurtbox_overlap(?);
+// extern ? clear_object_collision(?);
+// extern ? check_collision_in_list(?);
+// extern ? check_player_object_collision(?);
+// extern ? check_pushable_object_collision(?);
+// extern ? check_destructive_object_collision(?);
extern void detect_object_collisions(void);
#endif /* _OBJECT_COLLISION_H */
diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c
@@ -36,35 +36,35 @@ static s8 sLevelsWithRooms[] = { LEVEL_BBH, LEVEL_CASTLE, LEVEL_HMC, -1 };
s32 sGrabReleaseState;
// These can be static:
-extern void func_8029D704(Mat4, Mat4, Mat4);
-extern void func_8029EA0C(struct Object *);
-extern void translate_object_local(struct Object *, s16, s16);
-extern void copy_object_pos(struct Object *, struct Object *);
-extern void copy_object_angle(struct Object *, struct Object *);
-extern struct Object *obj_find_nearest_object_with_behavior(const BehaviorScript *, f32 *);
-extern void obj_move_y(f32, f32, f32);
+extern void create_transformation_from_matrices(Mat4, Mat4, Mat4);
+extern void obj_set_gfx_pos_from_pos(struct Object *);
+extern void obj_translate_local(struct Object *, s16, s16);
+extern void obj_copy_pos(struct Object *, struct Object *);
+extern void obj_copy_angle(struct Object *, struct Object *);
+extern struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *, f32 *);
+extern void cur_obj_move_y(f32, f32, f32);
static s32 clear_move_flag(u32 *, s32);
-extern void func_802AA618(s32, s32, f32);
+extern void spawn_mist_particles_variable(s32, s32, f32);
extern void spawn_triangle_break_particles(s32, s32, f32, s32);
#define o gCurrentObject
-Gfx *Geo18_8029D890(s32 run, UNUSED struct GraphNode *node, f32 mtx[4][4]) {
+Gfx *geo_update_projectile_pos_from_parent(s32 run, UNUSED struct GraphNode *node, f32 mtx[4][4]) {
Mat4 sp20;
struct Object *sp1C;
if (run == TRUE) {
sp1C = (struct Object *) gCurGraphNodeObject; // TODO: change global type to Object pointer
if (sp1C->prevObj) {
- func_8029D704(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
- func_8029D558(sp20, sp1C->prevObj);
- func_8029EA0C(sp1C->prevObj);
+ create_transformation_from_matrices(sp20, mtx, gCurGraphNodeCamera->matrixPtr);
+ obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj);
+ obj_set_gfx_pos_from_pos(sp1C->prevObj);
}
}
return NULL;
}
-Gfx *Geo18_8029D924(s32 run, struct GraphNode *node, UNUSED void *context) {
+Gfx *geo_update_layer_transparency(s32 run, struct GraphNode *node, UNUSED void *context) {
Gfx *sp3C, *sp38;
struct Object *sp34;
struct GraphNodeGenerated *sp30;
@@ -211,7 +211,7 @@ Gfx *geo_switch_area(s32 run, struct GraphNode *node) {
return NULL;
}
-void func_8029D558(Mat4 a0, struct Object *a1) {
+void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1) {
f32 spC, sp8, sp4;
spC = a1->oParentRelativePosX;
@@ -223,7 +223,7 @@ void func_8029D558(Mat4 a0, struct Object *a1) {
a1->oPosZ = spC * a0[0][2] + sp8 * a0[1][2] + sp4 * a0[2][2] + a0[3][2];
}
-void apply_object_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src) {
+void obj_apply_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src) {
dst[0][0] = src[0][0] * obj->header.gfx.scale[0];
dst[1][0] = src[1][0] * obj->header.gfx.scale[1];
dst[2][0] = src[2][0] * obj->header.gfx.scale[2];
@@ -245,7 +245,7 @@ void apply_object_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src) {
dst[3][3] = src[3][3];
}
-void func_8029D704(Mat4 a0, Mat4 a1, Mat4 a2) {
+void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2) {
f32 spC, sp8, sp4;
spC = a2[3][0] * a2[0][0] + a2[3][1] * a2[0][1] + a2[3][2] * a2[0][2];
@@ -274,7 +274,7 @@ void func_8029D704(Mat4 a0, Mat4 a1, Mat4 a2) {
a0[3][3] = 1.0f;
}
-void set_object_held_state(struct Object *obj, const BehaviorScript *heldBehavior) {
+void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior) {
obj->parentObj = o;
if (obj->oFlags & OBJ_FLAG_HOLDABLE) {
@@ -310,7 +310,7 @@ f32 dist_between_objects(struct Object *obj1, struct Object *obj2) {
return sqrtf(dx * dx + dy * dy + dz * dz);
}
-void obj_forward_vel_approach_upward(f32 target, f32 increment) {
+void cur_obj_forward_vel_approach_upward(f32 target, f32 increment) {
if (o->oForwardVel >= target) {
o->oForwardVel = target;
} else {
@@ -378,7 +378,7 @@ s16 approach_s16_symmetric(s16 value, s16 target, s16 increment) {
return value;
}
-s32 obj_rotate_yaw_toward(s16 target, s16 increment) {
+s32 cur_obj_rotate_yaw_toward(s16 target, s16 increment) {
s16 startYaw;
startYaw = (s16) o->oMoveAngleYaw;
@@ -391,7 +391,7 @@ s32 obj_rotate_yaw_toward(s16 target, s16 increment) {
}
}
-s16 angle_to_object(struct Object *obj1, struct Object *obj2) {
+s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2) {
f32 z1, x1, z2, x2;
s16 angle;
@@ -436,26 +436,26 @@ s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleI
return targetAngle;
}
-void set_object_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ) {
+void obj_set_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ) {
obj->oParentRelativePosX = relX;
obj->oParentRelativePosY = relY;
obj->oParentRelativePosZ = relZ;
}
-void set_object_pos(struct Object *obj, s16 x, s16 y, s16 z) {
+void obj_set_pos(struct Object *obj, s16 x, s16 y, s16 z) {
obj->oPosX = x;
obj->oPosY = y;
obj->oPosZ = z;
}
-void set_object_angle(struct Object *a0, s16 pitch, s16 yaw, s16 roll) {
- a0->oFaceAnglePitch = pitch;
- a0->oFaceAngleYaw = yaw;
- a0->oFaceAngleRoll = roll;
+void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll) {
+ obj->oFaceAnglePitch = pitch;
+ obj->oFaceAngleYaw = yaw;
+ obj->oFaceAngleRoll = roll;
- a0->oMoveAnglePitch = pitch;
- a0->oMoveAngleYaw = yaw;
- a0->oMoveAngleRoll = roll;
+ obj->oMoveAnglePitch = pitch;
+ obj->oMoveAngleYaw = yaw;
+ obj->oMoveAngleRoll = roll;
}
/*
@@ -466,8 +466,8 @@ struct Object *spawn_object_abs_with_rot(struct Object *parent, s16 uselessArg,
s16 x, s16 y, s16 z, s16 rx, s16 ry, s16 rz) {
// 'uselessArg' is unused in the function spawn_object_at_origin()
struct Object *newObj = spawn_object_at_origin(parent, uselessArg, model, behavior);
- set_object_pos(newObj, x, y, z);
- set_object_angle(newObj, rx, ry, rz);
+ obj_set_pos(newObj, x, y, z);
+ obj_set_angle(newObj, rx, ry, rz);
return newObj;
}
@@ -482,53 +482,53 @@ struct Object *spawn_object_rel_with_rot(struct Object *parent, u32 model,
s16 yOff, s16 zOff, s16 rx, s16 ry, UNUSED s16 rz) {
struct Object *newObj = spawn_object_at_origin(parent, 0, model, behavior);
newObj->oFlags |= OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT;
- set_object_parent_relative_pos(newObj, xOff, yOff, zOff);
- set_object_angle(newObj, rx, ry, zOff); // Nice typo you got there Nintendo.
+ obj_set_parent_relative_pos(newObj, xOff, yOff, zOff);
+ obj_set_angle(newObj, rx, ry, zOff); // Nice typo you got there Nintendo.
return newObj;
}
-struct Object *Unknown8029E330(struct Object *sp20, s32 model, const BehaviorScript *sp28) {
+struct Object *spawn_obj_with_transform_flags(struct Object *sp20, s32 model, const BehaviorScript *sp28) {
struct Object *sp1C = spawn_object(sp20, model, sp28);
sp1C->oFlags |= OBJ_FLAG_0020 | OBJ_FLAG_0800;
return sp1C;
}
-struct Object *spawn_water_splash(struct Object *parent, struct WaterSplashParams *params) {
+struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params) {
f32 randomScale;
struct Object *newObj = spawn_object(parent, params->model, params->behavior);
- if (params->flags & WATER_SPLASH_FLAG_RAND_ANGLE) {
+ if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE) {
newObj->oMoveAngleYaw = RandomU16();
}
- if (params->flags & WATER_SPLASH_FLAG_RAND_ANGLE_INCR_PLUS_8000) {
+ if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000) {
newObj->oMoveAngleYaw = (s16)(newObj->oMoveAngleYaw + 0x8000)
+ (s16) random_f32_around_zero(params->moveAngleRange);
}
- if (params->flags & WATER_SPLASH_FLAG_RAND_ANGLE_INCR) {
+ if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE_INCR) {
newObj->oMoveAngleYaw =
(s16) newObj->oMoveAngleYaw + (s16) random_f32_around_zero(params->moveAngleRange);
}
- if (params->flags & WATER_SPLASH_FLAG_SET_Y_TO_WATER_LEVEL) {
+ if (params->flags & WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL) {
newObj->oPosY = find_water_level(newObj->oPosX, newObj->oPosZ);
}
- if (params->flags & WATER_SPLASH_FLAG_RAND_OFFSET_XZ) {
- translate_object_xz_random(newObj, params->moveRange);
+ if (params->flags & WATER_DROPLET_FLAG_RAND_OFFSET_XZ) {
+ obj_translate_xz_random(newObj, params->moveRange);
}
- if (params->flags & WATER_SPLASH_FLAG_RAND_OFFSET_XYZ) {
- translate_object_xyz_random(newObj, params->moveRange);
+ if (params->flags & WATER_DROPLET_FLAG_RAND_OFFSET_XYZ) {
+ obj_translate_xyz_random(newObj, params->moveRange);
}
newObj->oForwardVel = RandomFloat() * params->randForwardVelScale + params->randForwardVelOffset;
newObj->oVelY = RandomFloat() * params->randYVelScale + params->randYVelOffset;
randomScale = RandomFloat() * params->randSizeScale + params->randSizeOffset;
- scale_object(newObj, randomScale);
+ obj_scale(newObj, randomScale);
return newObj;
}
@@ -555,7 +555,7 @@ struct Object *spawn_object(struct Object *parent, s32 model, const BehaviorScri
struct Object *obj;
obj = spawn_object_at_origin(parent, 0, model, behavior);
- copy_object_pos_and_angle(obj, parent);
+ obj_copy_pos_and_angle(obj, parent);
return obj;
}
@@ -567,7 +567,7 @@ struct Object *try_to_spawn_object(s16 offsetY, f32 scale, struct Object *parent
if (gFreeObjectList.next != NULL) {
obj = spawn_object(parent, model, behavior);
obj->oPosY += offsetY;
- scale_object(obj, scale);
+ obj_scale(obj, scale);
return obj;
} else {
return NULL;
@@ -578,15 +578,15 @@ struct Object *spawn_object_with_scale(struct Object *parent, s32 model, const B
struct Object *obj;
obj = spawn_object_at_origin(parent, 0, model, behavior);
- copy_object_pos_and_angle(obj, parent);
- scale_object(obj, scale);
+ obj_copy_pos_and_angle(obj, parent);
+ obj_scale(obj, scale);
return obj;
}
-static void build_relative_object_transform(struct Object *obj) {
- build_object_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX);
- translate_object_local(obj, O_POS_INDEX, O_PARENT_RELATIVE_POS_INDEX);
+static void obj_build_relative_transform(struct Object *obj) {
+ obj_build_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX);
+ obj_translate_local(obj, O_POS_INDEX, O_PARENT_RELATIVE_POS_INDEX);
}
struct Object *spawn_object_relative(s16 behaviorParam, s16 relativePosX, s16 relativePosY,
@@ -594,9 +594,9 @@ struct Object *spawn_object_relative(s16 behaviorParam, s16 relativePosX, s16 re
const BehaviorScript *behavior) {
struct Object *obj = spawn_object_at_origin(parent, 0, model, behavior);
- copy_object_pos_and_angle(obj, parent);
- set_object_parent_relative_pos(obj, relativePosX, relativePosY, relativePosZ);
- build_relative_object_transform(obj);
+ obj_copy_pos_and_angle(obj, parent);
+ obj_set_parent_relative_pos(obj, relativePosX, relativePosY, relativePosZ);
+ obj_build_relative_transform(obj);
obj->oBehParams2ndByte = behaviorParam;
obj->oBehParams = (behaviorParam & 0xFF) << 16;
@@ -611,33 +611,33 @@ struct Object *spawn_object_relative_with_scale(s16 behaviorParam, s16 relativeP
obj = spawn_object_relative(behaviorParam, relativePosX, relativePosY, relativePosZ, parent, model,
behavior);
- scale_object(obj, scale);
+ obj_scale(obj, scale);
return obj;
}
-void obj_move_using_vel(void) {
+void cur_obj_move_using_vel(void) {
o->oPosX += o->oVelX;
o->oPosY += o->oVelY;
o->oPosZ += o->oVelZ;
}
-void copy_object_graph_y_offset(struct Object *dst, struct Object *src) {
+void obj_copy_graph_y_offset(struct Object *dst, struct Object *src) {
dst->oGraphYOffset = src->oGraphYOffset;
}
-void copy_object_pos_and_angle(struct Object *dst, struct Object *src) {
- copy_object_pos(dst, src);
- copy_object_angle(dst, src);
+void obj_copy_pos_and_angle(struct Object *dst, struct Object *src) {
+ obj_copy_pos(dst, src);
+ obj_copy_angle(dst, src);
}
-void copy_object_pos(struct Object *dst, struct Object *src) {
+void obj_copy_pos(struct Object *dst, struct Object *src) {
dst->oPosX = src->oPosX;
dst->oPosY = src->oPosY;
dst->oPosZ = src->oPosZ;
}
-void copy_object_angle(struct Object *dst, struct Object *src) {
+void obj_copy_angle(struct Object *dst, struct Object *src) {
dst->oMoveAnglePitch = src->oMoveAnglePitch;
dst->oMoveAngleYaw = src->oMoveAngleYaw;
dst->oMoveAngleRoll = src->oMoveAngleRoll;
@@ -647,17 +647,15 @@ void copy_object_angle(struct Object *dst, struct Object *src) {
dst->oFaceAngleRoll = src->oFaceAngleRoll;
}
-void func_8029EA0C(struct Object *a0) {
- a0->header.gfx.pos[0] = a0->oPosX;
- a0->header.gfx.pos[1] = a0->oPosY;
- a0->header.gfx.pos[2] = a0->oPosZ;
+void obj_set_gfx_pos_from_pos(struct Object *obj) {
+ obj->header.gfx.pos[0] = obj->oPosX;
+ obj->header.gfx.pos[1] = obj->oPosY;
+ obj->header.gfx.pos[2] = obj->oPosZ;
}
-void Unknown8029EA34(struct Object *sp20, u32 sp24) {
- struct Animation **sp1C;
-
- sp1C = o->oAnimations;
- geo_obj_init_animation(&sp20->header.gfx, sp24 + sp1C);
+void obj_init_animation(struct Object *obj, s32 animIndex) {
+ struct Animation **anims = o->oAnimations;
+ geo_obj_init_animation(&obj->header.gfx, &anims[animIndex]);
}
/**
@@ -690,7 +688,7 @@ void linear_mtxf_transpose_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v) {
}
}
-void apply_scale_to_object_transform(struct Object *obj) {
+void obj_apply_scale_to_transform(struct Object *obj) {
f32 scaleX, scaleY, scaleZ;
scaleX = obj->header.gfx.scale[0];
@@ -710,82 +708,83 @@ void apply_scale_to_object_transform(struct Object *obj) {
obj->transform[2][2] *= scaleZ;
}
-void copy_object_scale(struct Object *dst, struct Object *src) {
+void obj_copy_scale(struct Object *dst, struct Object *src) {
dst->header.gfx.scale[0] = src->header.gfx.scale[0];
dst->header.gfx.scale[1] = src->header.gfx.scale[1];
dst->header.gfx.scale[2] = src->header.gfx.scale[2];
}
-void scale_object_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale) {
+void obj_scale_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale) {
obj->header.gfx.scale[0] = xScale;
obj->header.gfx.scale[1] = yScale;
obj->header.gfx.scale[2] = zScale;
}
-void scale_object(struct Object *obj, f32 scale) {
+void obj_scale(struct Object *obj, f32 scale) {
obj->header.gfx.scale[0] = scale;
obj->header.gfx.scale[1] = scale;
obj->header.gfx.scale[2] = scale;
}
-void obj_scale(f32 scale) {
+void cur_obj_scale(f32 scale) {
o->header.gfx.scale[0] = scale;
o->header.gfx.scale[1] = scale;
o->header.gfx.scale[2] = scale;
}
-void SetObjAnimation(s32 arg0) {
- struct Animation **sp1C = o->oAnimations;
- geo_obj_init_animation(&o->header.gfx, sp1C + arg0);
+void cur_obj_init_animation(s32 animIndex) {
+ struct Animation **anims = o->oAnimations;
+ geo_obj_init_animation(&o->header.gfx, &anims[animIndex]);
}
-void set_obj_animation_and_sound_state(s32 arg0) {
- struct Animation **sp1C = o->oAnimations;
- geo_obj_init_animation(&o->header.gfx, sp1C + arg0);
- o->oSoundStateID = arg0;
+
+void cur_obj_init_animation_with_sound(s32 animIndex) {
+ struct Animation **anims = o->oAnimations;
+ geo_obj_init_animation(&o->header.gfx, &anims[animIndex]);
+ o->oSoundStateID = animIndex;
}
-void func_8029ED98(u32 a0, f32 a1) {
- struct Animation **sp1C = o->oAnimations;
- s32 sp18 = (s32)(a1 * 65536.0f);
- geo_obj_init_animation_accel(&o->header.gfx, sp1C + a0, sp18);
- o->oSoundStateID = a0;
+void cur_obj_init_animation_with_accel_and_sound(s32 animIndex, f32 accel) {
+ struct Animation **anims = o->oAnimations;
+ s32 animAccel = (s32)(accel * 65536.0f);
+ geo_obj_init_animation_accel(&o->header.gfx, &anims[animIndex], animAccel);
+ o->oSoundStateID = animIndex;
}
-void func_8029EE20(struct Object *a0, struct Animation **a1, u32 a2) {
- struct Animation **sp1C = a1;
- a0->oAnimations = a1;
- geo_obj_init_animation(&a0->header.gfx, sp1C + a2);
- a0->oSoundStateID = a2;
+void obj_init_animation_with_sound(struct Object *obj, struct Animation **animations, s32 animIndex) {
+ struct Animation **anims = animations;
+ obj->oAnimations = animations;
+ geo_obj_init_animation(&obj->header.gfx, &anims[animIndex]);
+ obj->oSoundStateID = animIndex;
}
-void obj_enable_rendering_and_become_tangible(struct Object *a0) {
- a0->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
- a0->oIntangibleTimer = 0;
+void cur_obj_enable_rendering_and_become_tangible(struct Object *obj) {
+ obj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
+ obj->oIntangibleTimer = 0;
}
-void obj_enable_rendering(void) {
+void cur_obj_enable_rendering(void) {
o->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE;
}
-void obj_disable_rendering_and_become_intangible(struct Object *a0) {
- a0->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
- a0->oIntangibleTimer = -1;
+void cur_obj_disable_rendering_and_become_intangible(struct Object *obj) {
+ obj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
+ obj->oIntangibleTimer = -1;
}
-void obj_disable_rendering(void) {
+void cur_obj_disable_rendering(void) {
o->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
}
-void obj_unhide(void) {
+void cur_obj_unhide(void) {
o->header.gfx.node.flags &= ~GRAPH_RENDER_INVISIBLE;
}
-void obj_hide(void) {
+void cur_obj_hide(void) {
o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE;
}
-void obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward) {
+void cur_obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward) {
f32 facingZ = coss(other->oMoveAngleYaw);
f32 facingX = sins(other->oMoveAngleYaw);
@@ -799,28 +798,28 @@ void obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward)
o->oPosZ = other->oPosZ + dz;
}
-void obj_set_pos_relative_to_parent(f32 dleft, f32 dy, f32 dforward) {
- obj_set_pos_relative(o->parentObj, dleft, dy, dforward);
+void cur_obj_set_pos_relative_to_parent(f32 dleft, f32 dy, f32 dforward) {
+ cur_obj_set_pos_relative(o->parentObj, dleft, dy, dforward);
}
-void obj_enable_rendering_2(void) {
- obj_enable_rendering();
+void cur_obj_enable_rendering_2(void) {
+ cur_obj_enable_rendering();
}
-void obj_unused_init_on_floor(void) {
- obj_enable_rendering();
+void cur_obj_unused_init_on_floor(void) {
+ cur_obj_enable_rendering();
o->oPosY = find_floor_height(o->oPosX, o->oPosY, o->oPosZ);
if (o->oPosY < -10000.0f) {
- obj_set_pos_relative_to_parent(0, 0, -70);
+ cur_obj_set_pos_relative_to_parent(0, 0, -70);
o->oPosY = find_floor_height(o->oPosX, o->oPosY, o->oPosZ);
}
}
-void obj_set_facing_to_move_angles(struct Object *a0) {
- a0->oFaceAnglePitch = a0->oMoveAnglePitch;
- a0->oFaceAngleYaw = a0->oMoveAngleYaw;
- a0->oFaceAngleRoll = a0->oMoveAngleRoll;
+void obj_set_face_angle_to_move_angle(struct Object *obj) {
+ obj->oFaceAnglePitch = obj->oMoveAnglePitch;
+ obj->oFaceAngleYaw = obj->oMoveAngleYaw;
+ obj->oFaceAngleRoll = obj->oMoveAngleRoll;
}
u32 get_object_list_from_behavior(const BehaviorScript *behavior) {
@@ -837,20 +836,20 @@ u32 get_object_list_from_behavior(const BehaviorScript *behavior) {
return objectList;
}
-struct Object *obj_nearest_object_with_behavior(const BehaviorScript *behavior) {
+struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavior) {
struct Object *obj;
f32 dist;
- obj = obj_find_nearest_object_with_behavior(behavior, &dist);
+ obj = cur_obj_find_nearest_object_with_behavior(behavior, &dist);
return obj;
}
-f32 obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) {
+f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) {
struct Object *obj;
f32 dist;
- obj = obj_find_nearest_object_with_behavior(behavior, &dist);
+ obj = cur_obj_find_nearest_object_with_behavior(behavior, &dist);
if (obj == NULL) {
dist = 15000.0f;
}
@@ -858,7 +857,7 @@ f32 obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) {
return dist;
}
-struct Object *obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist) {
+struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist) {
uintptr_t *behaviorAddr = segmented_to_virtual(behavior);
struct Object *closestObj = NULL;
struct Object *obj;
@@ -926,7 +925,7 @@ s32 count_objects_with_behavior(const BehaviorScript *behavior) {
return count;
}
-struct Object *obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist) {
+struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist) {
const BehaviorScript *behaviorAddr = segmented_to_virtual(behavior);
struct ObjectNode *listHead;
struct Object *obj;
@@ -957,18 +956,18 @@ struct Object *obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 ma
return foundObj;
}
-static void obj_reset_timer_and_subaction(void) {
+static void cur_obj_reset_timer_and_subaction(void) {
o->oTimer = 0;
o->oSubAction = 0;
}
-void obj_change_action(s32 action) {
+void cur_obj_change_action(s32 action) {
o->oAction = action;
o->oPrevAction = action;
- obj_reset_timer_and_subaction();
+ cur_obj_reset_timer_and_subaction();
}
-void func_8029F684(f32 f12, f32 f14) {
+void cur_obj_set_vel_from_mario_vel(f32 f12, f32 f14) {
f32 sp4 = gMarioStates[0].forwardVel;
f32 sp0 = f12 * f14;
@@ -979,20 +978,20 @@ void func_8029F684(f32 f12, f32 f14) {
}
}
-BAD_RETURN(s16) func_8029F6F0(void) {
+BAD_RETURN(s16) cur_obj_reverse_animation(void) {
if (o->header.gfx.unk38.animFrame >= 0) {
o->header.gfx.unk38.animFrame--;
}
}
-BAD_RETURN(s32) func_8029F728(void) {
+BAD_RETURN(s32) cur_obj_extend_animation_if_at_end(void) {
s32 sp4 = o->header.gfx.unk38.animFrame;
s32 sp0 = o->header.gfx.unk38.curAnim->unk08 - 2;
if (sp4 == sp0) o->header.gfx.unk38.animFrame--;
}
-s32 func_8029F788(void) {
+s32 cur_obj_check_if_near_animation_end(void) {
u32 spC = (s32) o->header.gfx.unk38.curAnim->flags;
s32 sp8 = o->header.gfx.unk38.animFrame;
s32 sp4 = o->header.gfx.unk38.curAnim->unk08 - 2;
@@ -1011,7 +1010,7 @@ s32 func_8029F788(void) {
return sp0;
}
-s32 func_8029F828(void) {
+s32 cur_obj_check_if_at_animation_end(void) {
s32 sp4 = o->header.gfx.unk38.animFrame;
s32 sp0 = o->header.gfx.unk38.curAnim->unk08 - 1;
@@ -1022,7 +1021,7 @@ s32 func_8029F828(void) {
}
}
-s32 obj_check_anim_frame(s32 frame) {
+s32 cur_obj_check_anim_frame(s32 frame) {
s32 animFrame = o->header.gfx.unk38.animFrame;
if (animFrame == frame) {
@@ -1032,7 +1031,7 @@ s32 obj_check_anim_frame(s32 frame) {
}
}
-s32 obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength) {
+s32 cur_obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength) {
s32 animFrame = o->header.gfx.unk38.animFrame;
if (animFrame >= startFrame && animFrame < startFrame + rangeLength) {
@@ -1042,7 +1041,7 @@ s32 obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength) {
}
}
-s32 Unknown8029F930(s16 *a0) {
+s32 cur_obj_check_frame_prior_current_frame(s16 *a0) {
s16 sp6 = o->header.gfx.unk38.animFrame;
while (*a0 != -1) {
@@ -1072,23 +1071,23 @@ s32 mario_is_dive_sliding(void) {
}
}
-void func_8029FA1C(f32 sp18, s32 sp1C) {
+void cur_obj_set_y_vel_and_animation(f32 sp18, s32 sp1C) {
o->oVelY = sp18;
- set_obj_animation_and_sound_state(sp1C);
+ cur_obj_init_animation_with_sound(sp1C);
}
-void func_8029FA5C(s32 sp18, s32 sp1C) {
- obj_become_intangible();
- obj_disable_rendering();
+void cur_obj_unrender_and_reset_state(s32 sp18, s32 sp1C) {
+ cur_obj_become_intangible();
+ cur_obj_disable_rendering();
if (sp18 >= 0) {
- set_obj_animation_and_sound_state(sp18);
+ cur_obj_init_animation_with_sound(sp18);
}
o->oAction = sp1C;
}
-static void obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY) {
+static void cur_obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY) {
o->oMoveFlags = 0;
o->oFloorHeight = find_floor_height(o->oPosX, o->oPosY + 160.0f, o->oPosZ);
@@ -1096,7 +1095,7 @@ static void obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY) {
o->oPosY = o->oFloorHeight;
} else if (o->oFloorHeight < -10000.0f) {
//! OoB failsafe
- copy_object_pos(o, gMarioObject);
+ obj_copy_pos(o, gMarioObject);
o->oFloorHeight = find_floor_height(o->oPosX, o->oPosY, o->oPosZ);
}
@@ -1104,48 +1103,48 @@ static void obj_move_after_thrown_or_dropped(f32 forwardVel, f32 velY) {
o->oVelY = velY;
if (o->oForwardVel != 0) {
- obj_move_y(/*gravity*/ -4.0f, /*bounce*/ -0.1f, /*buoyancy*/ 2.0f);
+ cur_obj_move_y(/*gravity*/ -4.0f, /*bounce*/ -0.1f, /*buoyancy*/ 2.0f);
}
}
-void obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction) {
+void cur_obj_get_thrown_or_placed(f32 forwardVel, f32 velY, s32 thrownAction) {
if (o->behavior == segmented_to_virtual(bhvBowser)) {
// Interestingly, when bowser is thrown, he is offset slightly to
// mario's right
- obj_set_pos_relative_to_parent(-41.684f, 85.859f, 321.577f);
+ cur_obj_set_pos_relative_to_parent(-41.684f, 85.859f, 321.577f);
} else {
}
- obj_become_tangible();
- obj_enable_rendering();
+ cur_obj_become_tangible();
+ cur_obj_enable_rendering();
o->oHeldState = HELD_FREE;
if ((o->oInteractionSubtype & INT_SUBTYPE_HOLDABLE_NPC) || forwardVel == 0.0f) {
- obj_move_after_thrown_or_dropped(0.0f, 0.0f);
+ cur_obj_move_after_thrown_or_dropped(0.0f, 0.0f);
} else {
o->oAction = thrownAction;
- obj_move_after_thrown_or_dropped(forwardVel, velY);
+ cur_obj_move_after_thrown_or_dropped(forwardVel, velY);
}
}
-void obj_get_dropped(void) {
- obj_become_tangible();
- obj_enable_rendering();
+void cur_obj_get_dropped(void) {
+ cur_obj_become_tangible();
+ cur_obj_enable_rendering();
o->oHeldState = HELD_FREE;
- obj_move_after_thrown_or_dropped(0.0f, 0.0f);
+ cur_obj_move_after_thrown_or_dropped(0.0f, 0.0f);
}
-void obj_set_model(s32 a0) {
- o->header.gfx.sharedChild = gLoadedGraphNodes[a0];
+void cur_obj_set_model(s32 modelID) {
+ o->header.gfx.sharedChild = gLoadedGraphNodes[modelID];
}
void mario_set_flag(s32 flag) {
gMarioStates[0].flags |= flag;
}
-s32 obj_clear_interact_status_flag(s32 flag) {
+s32 cur_obj_clear_interact_status_flag(s32 flag) {
if (o->oInteractStatus & flag) {
o->oInteractStatus &= flag ^ ~(0);
return TRUE;
@@ -1156,7 +1155,7 @@ s32 obj_clear_interact_status_flag(s32 flag) {
/**
* Mark an object to be unloaded at the end of the frame.
*/
-void mark_object_for_deletion(struct Object *obj) {
+void obj_mark_for_deletion(struct Object *obj) {
//! This clears all activeFlags. Since some of these flags disable behavior,
// setting it to 0 could potentially enable unexpected behavior. After an
// object is marked for deletion, it still updates on that frame (I think),
@@ -1164,32 +1163,32 @@ void mark_object_for_deletion(struct Object *obj) {
obj->activeFlags = ACTIVE_FLAGS_DEACTIVATED;
}
-void obj_disable(void) {
- obj_disable_rendering();
- obj_hide();
- obj_become_intangible();
+void cur_obj_disable(void) {
+ cur_obj_disable_rendering();
+ cur_obj_hide();
+ cur_obj_become_intangible();
}
-void obj_become_intangible(void) {
+void cur_obj_become_intangible(void) {
// When the timer is negative, the object is intangible and the timer
// doesn't count down
o->oIntangibleTimer = -1;
}
-void obj_become_tangible(void) {
+void cur_obj_become_tangible(void) {
o->oIntangibleTimer = 0;
}
-void make_object_tangible(struct Object *obj) {
+void obj_become_tangible(struct Object *obj) {
obj->oIntangibleTimer = 0;
}
-void obj_update_floor_height(void) {
+void cur_obj_update_floor_height(void) {
struct Surface *floor;
o->oFloorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor);
}
-struct Surface *obj_update_floor_height_and_get_floor(void) {
+struct Surface *cur_obj_update_floor_height_and_get_floor(void) {
struct Surface *floor;
o->oFloorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor);
return floor;
@@ -1216,12 +1215,12 @@ static void apply_drag_to_value(f32 *value, f32 dragStrength) {
}
}
-void obj_apply_drag_xz(f32 dragStrength) {
+void cur_obj_apply_drag_xz(f32 dragStrength) {
apply_drag_to_value(&o->oVelX, dragStrength);
apply_drag_to_value(&o->oVelZ, dragStrength);
}
-static s32 obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes) {
+static s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes) {
struct Surface *intendedFloor;
f32 intendedX = o->oPosX + o->oVelX;
@@ -1280,7 +1279,7 @@ static s32 obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes)
return FALSE;
}
-static void obj_move_update_underwater_flags(void) {
+static void cur_obj_move_update_underwater_flags(void) {
f32 decelY = (f32)(sqrtf(o->oVelY * o->oVelY) * (o->oDragStrength * 7.0f)) / 100.0L;
if (o->oVelY > 0) {
@@ -1297,7 +1296,7 @@ static void obj_move_update_underwater_flags(void) {
}
}
-static void obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounce) {
+static void cur_obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounce) {
o->oMoveFlags &= ~OBJ_MOVE_13;
if (o->oPosY < o->oFloorHeight) {
@@ -1332,7 +1331,7 @@ static void obj_move_update_ground_air_flags(UNUSED f32 gravity, f32 bounce) {
o->oMoveFlags &= ~OBJ_MOVE_MASK_IN_WATER;
}
-static f32 obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy) {
+static f32 cur_obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy) {
f32 waterLevel;
o->oVelY += gravity + buoyancy;
@@ -1350,7 +1349,7 @@ static f32 obj_move_y_and_get_water_level(f32 gravity, f32 buoyancy) {
return waterLevel;
}
-void obj_move_y(f32 gravity, f32 bounce, f32 buoyancy) {
+void cur_obj_move_y(f32 gravity, f32 bounce, f32 buoyancy) {
f32 waterLevel;
o->oMoveFlags &= ~OBJ_MOVE_LEFT_GROUND;
@@ -1363,12 +1362,12 @@ void obj_move_y(f32 gravity, f32 bounce, f32 buoyancy) {
}
if (!(o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER)) {
- waterLevel = obj_move_y_and_get_water_level(gravity, 0.0f);
+ waterLevel = cur_obj_move_y_and_get_water_level(gravity, 0.0f);
if (o->oPosY > waterLevel) {
//! We only handle floor collision if the object does not enter
// water. This allows e.g. coins to clip through floors if they
// enter water on the same frame.
- obj_move_update_ground_air_flags(gravity, bounce);
+ cur_obj_move_update_ground_air_flags(gravity, bounce);
} else {
o->oMoveFlags |= OBJ_MOVE_ENTERED_WATER;
o->oMoveFlags &= ~OBJ_MOVE_MASK_ON_GROUND;
@@ -1376,9 +1375,9 @@ void obj_move_y(f32 gravity, f32 bounce, f32 buoyancy) {
} else {
o->oMoveFlags &= ~OBJ_MOVE_ENTERED_WATER;
- waterLevel = obj_move_y_and_get_water_level(gravity, buoyancy);
+ waterLevel = cur_obj_move_y_and_get_water_level(gravity, buoyancy);
if (o->oPosY < waterLevel) {
- obj_move_update_underwater_flags();
+ cur_obj_move_update_underwater_flags();
} else {
if (o->oPosY < o->oFloorHeight) {
o->oPosY = o->oFloorHeight;
@@ -1399,7 +1398,7 @@ void obj_move_y(f32 gravity, f32 bounce, f32 buoyancy) {
}
}
-static void nop_802A0964(void) {
+static void stub_obj_helpers_1(void) {
}
static s32 clear_move_flag(u32 *bitSet, s32 flag) {
@@ -1411,7 +1410,7 @@ static s32 clear_move_flag(u32 *bitSet, s32 flag) {
}
}
-void obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius) {
+void cur_obj_unused_resolve_wall_collisions(f32 offsetY, f32 radius) {
if (radius > 0.1L) {
f32_find_wall_collision(&o->oPosX, &o->oPosY, &o->oPosZ, offsetY, radius);
}
@@ -1431,7 +1430,7 @@ s16 abs_angle_diff(s16 x0, s16 x1) {
return diff;
}
-void obj_move_xz_using_fvel_and_yaw(void) {
+void cur_obj_move_xz_using_fvel_and_yaw(void) {
o->oVelX = o->oForwardVel * sins(o->oMoveAngleYaw);
o->oVelZ = o->oForwardVel * coss(o->oMoveAngleYaw);
@@ -1439,7 +1438,7 @@ void obj_move_xz_using_fvel_and_yaw(void) {
o->oPosZ += o->oVelZ;
}
-void obj_move_y_with_terminal_vel(void) {
+void cur_obj_move_y_with_terminal_vel(void) {
if (o->oVelY < -70.0f) {
o->oVelY = -70.0f;
}
@@ -1447,12 +1446,12 @@ void obj_move_y_with_terminal_vel(void) {
o->oPosY += o->oVelY;
}
-void obj_compute_vel_xz(void) {
+void cur_obj_compute_vel_xz(void) {
o->oVelX = o->oForwardVel * sins(o->oMoveAngleYaw);
o->oVelZ = o->oForwardVel * coss(o->oMoveAngleYaw);
}
-f32 func_802A0BF4(f32 value, f32 center, f32 zeroThreshold, f32 increment) {
+f32 increment_velocity_toward_range(f32 value, f32 center, f32 zeroThreshold, f32 increment) {
f32 relative;
if ((relative = value - center) > 0) {
if (relative < zeroThreshold) {
@@ -1469,7 +1468,7 @@ f32 func_802A0BF4(f32 value, f32 center, f32 zeroThreshold, f32 increment) {
}
}
-s32 are_objects_collided(struct Object *obj1, struct Object *obj2) {
+s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2) {
s32 i;
for (i = 0; i < obj1->numCollidedObjs; i++) {
if (obj1->collidedObjs[i] == obj2) {
@@ -1480,15 +1479,15 @@ s32 are_objects_collided(struct Object *obj1, struct Object *obj2) {
return FALSE;
}
-void obj_set_behavior(const BehaviorScript *behavior) {
+void cur_obj_set_behavior(const BehaviorScript *behavior) {
o->behavior = segmented_to_virtual(behavior);
}
-void set_object_behavior(struct Object *obj, const BehaviorScript *behavior) {
+void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior) {
obj->behavior = segmented_to_virtual(behavior);
}
-s32 obj_has_behavior(const BehaviorScript *behavior) {
+s32 cur_obj_has_behavior(const BehaviorScript *behavior) {
if (o->behavior == segmented_to_virtual(behavior)) {
return TRUE;
} else {
@@ -1496,7 +1495,7 @@ s32 obj_has_behavior(const BehaviorScript *behavior) {
}
}
-s32 object_has_behavior(struct Object *obj, const BehaviorScript *behavior) {
+s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior) {
if (obj->behavior == segmented_to_virtual(behavior)) {
return TRUE;
} else {
@@ -1504,7 +1503,7 @@ s32 object_has_behavior(struct Object *obj, const BehaviorScript *behavior) {
}
}
-f32 obj_lateral_dist_from_mario_to_home(void) {
+f32 cur_obj_lateral_dist_from_mario_to_home(void) {
f32 dist;
f32 dx = o->oHomeX - gMarioObject->oPosX;
f32 dz = o->oHomeZ - gMarioObject->oPosZ;
@@ -1513,7 +1512,7 @@ f32 obj_lateral_dist_from_mario_to_home(void) {
return dist;
}
-f32 obj_lateral_dist_to_home(void) {
+f32 cur_obj_lateral_dist_to_home(void) {
f32 dist;
f32 dx = o->oHomeX - o->oPosX;
f32 dz = o->oHomeZ - o->oPosZ;
@@ -1522,7 +1521,7 @@ f32 obj_lateral_dist_to_home(void) {
return dist;
}
-s32 obj_outside_home_square(f32 halfLength) {
+s32 cur_obj_outside_home_square(f32 halfLength) {
if (o->oHomeX - halfLength > o->oPosX) {
return TRUE;
}
@@ -1542,7 +1541,7 @@ s32 obj_outside_home_square(f32 halfLength) {
return 0;
}
-s32 obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ) {
+s32 cur_obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ) {
if (o->oHomeX + minX > o->oPosX) {
return TRUE;
}
@@ -1562,20 +1561,20 @@ s32 obj_outside_home_rectangle(f32 minX, f32 maxX, f32 minZ, f32 maxZ) {
return FALSE;
}
-void obj_set_pos_to_home(void) {
+void cur_obj_set_pos_to_home(void) {
o->oPosX = o->oHomeX;
o->oPosY = o->oHomeY;
o->oPosZ = o->oHomeZ;
}
-void obj_set_pos_to_home_and_stop(void) {
- obj_set_pos_to_home();
+void cur_obj_set_pos_to_home_and_stop(void) {
+ cur_obj_set_pos_to_home();
o->oForwardVel = 0;
o->oVelY = 0;
}
-void obj_shake_y(f32 amount) {
+void cur_obj_shake_y(f32 amount) {
//! Technically could cause a bit of drift, but not much
if (o->oTimer % 2 == 0) {
o->oPosY += amount;
@@ -1584,32 +1583,32 @@ void obj_shake_y(f32 amount) {
}
}
-void obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent) {
+void cur_obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent) {
gPlayerCameraState->cameraEvent = (s16) cameraEvent;
gSecondCameraFocus = o;
}
-void Unknown802A11E4(UNUSED s32 sp0, UNUSED s32 sp4, f32 sp8) {
+void set_mario_interact_hoot_if_in_range(UNUSED s32 sp0, UNUSED s32 sp4, f32 sp8) {
if (o->oDistanceToMario < sp8) {
gMarioObject->oInteractStatus = 1;
}
}
-void obj_set_billboard(struct Object *a0) {
- a0->header.gfx.node.flags |= GRAPH_RENDER_BILLBOARD;
+void obj_set_billboard(struct Object *obj) {
+ obj->header.gfx.node.flags |= GRAPH_RENDER_BILLBOARD;
}
-void obj_set_hitbox_radius_and_height(f32 radius, f32 height) {
+void cur_obj_set_hitbox_radius_and_height(f32 radius, f32 height) {
o->hitboxRadius = radius;
o->hitboxHeight = height;
}
-void obj_set_hurtbox_radius_and_height(f32 radius, f32 height) {
+void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height) {
o->hurtboxRadius = radius;
o->hurtboxHeight = height;
}
-static void spawn_object_loot_coins(struct Object *obj, s32 numCoins, f32 sp30,
+static void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30,
const BehaviorScript *coinBehavior,
s16 posJitter, s16 model) {
s32 i;
@@ -1630,21 +1629,21 @@ static void spawn_object_loot_coins(struct Object *obj, s32 numCoins, f32 sp30,
obj->oNumLootCoins--;
coin = spawn_object(obj, model, coinBehavior);
- translate_object_xz_random(coin, posJitter);
+ obj_translate_xz_random(coin, posJitter);
coin->oPosY = spawnHeight;
coin->oCoinUnk110 = sp30;
}
}
-void spawn_object_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter) {
- spawn_object_loot_coins(obj, numCoins, sp28, bhvBlueCoinJumping, posJitter, MODEL_BLUE_COIN);
+void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter) {
+ obj_spawn_loot_coins(obj, numCoins, sp28, bhvBlueCoinJumping, posJitter, MODEL_BLUE_COIN);
}
-void spawn_object_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28) {
- spawn_object_loot_coins(obj, numCoins, sp28, bhvSingleCoinGetsSpawned, 0, MODEL_YELLOW_COIN);
+void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28) {
+ obj_spawn_loot_coins(obj, numCoins, sp28, bhvSingleCoinGetsSpawned, 0, MODEL_YELLOW_COIN);
}
-void obj_spawn_loot_coin_at_mario_pos(void) {
+void cur_obj_spawn_loot_coin_at_mario_pos(void) {
struct Object *coin;
if (o->oNumLootCoins <= 0) {
return;
@@ -1655,10 +1654,10 @@ void obj_spawn_loot_coin_at_mario_pos(void) {
coin = spawn_object(o, MODEL_YELLOW_COIN, bhvSingleCoinGetsSpawned);
coin->oVelY = 30.0f;
- copy_object_pos(coin, gMarioObject);
+ obj_copy_pos(coin, gMarioObject);
}
-f32 obj_abs_y_dist_to_home(void) {
+f32 cur_obj_abs_y_dist_to_home(void) {
f32 dist = o->oHomeY - o->oPosY;
if (dist < 0) {
@@ -1668,7 +1667,7 @@ f32 obj_abs_y_dist_to_home(void) {
return dist;
}
-s32 Unknown802A1548() {
+s32 cur_obj_advance_looping_anim() {
s32 spC = o->header.gfx.unk38.animFrame;
s32 sp8 = o->header.gfx.unk38.curAnim->unk08;
s32 sp4;
@@ -1686,7 +1685,7 @@ s32 Unknown802A1548() {
return sp4;
}
-static s32 obj_detect_steep_floor(s16 steepAngleDegrees) {
+static s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) {
struct Surface *intendedFloor;
f32 intendedX, intendedFloorHeight, intendedZ;
f32 deltaFloorHeight;
@@ -1713,7 +1712,7 @@ static s32 obj_detect_steep_floor(s16 steepAngleDegrees) {
return 0;
}
-s32 obj_resolve_wall_collisions(void) {
+s32 cur_obj_resolve_wall_collisions(void) {
s32 numCollisions;
struct Surface *wall;
struct WallCollisionData collisionData;
@@ -1747,8 +1746,8 @@ s32 obj_resolve_wall_collisions(void) {
return 0;
}
-static void obj_update_floor(void) {
- struct Surface *floor = obj_update_floor_height_and_get_floor();
+static void cur_obj_update_floor(void) {
+ struct Surface *floor = cur_obj_update_floor_height_and_get_floor();
o->oFloor = floor;
if (floor != NULL) {
@@ -1770,7 +1769,7 @@ static void obj_update_floor(void) {
}
}
-static void obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees) {
+static void cur_obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees) {
#ifdef VERSION_JP
o->oMoveFlags &= ~OBJ_MOVE_ABOVE_LAVA;
#else
@@ -1778,7 +1777,7 @@ static void obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees)
#endif
if (o->activeFlags & (ACTIVE_FLAG_FAR_AWAY | ACTIVE_FLAG_IN_DIFFERENT_ROOM)) {
- obj_update_floor();
+ cur_obj_update_floor();
o->oMoveFlags &= ~OBJ_MOVE_MASK_HIT_WALL_OR_IN_WATER;
if (o->oPosY > o->oFloorHeight) {
@@ -1786,27 +1785,27 @@ static void obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees)
}
} else {
o->oMoveFlags &= ~OBJ_MOVE_HIT_WALL;
- if (obj_resolve_wall_collisions()) {
+ if (cur_obj_resolve_wall_collisions()) {
o->oMoveFlags |= OBJ_MOVE_HIT_WALL;
}
- obj_update_floor();
+ cur_obj_update_floor();
if (o->oPosY > o->oFloorHeight) {
o->oMoveFlags |= OBJ_MOVE_IN_AIR;
}
- if (obj_detect_steep_floor(steepSlopeDegrees)) {
+ if (cur_obj_detect_steep_floor(steepSlopeDegrees)) {
o->oMoveFlags |= OBJ_MOVE_HIT_WALL;
}
}
}
-void obj_update_floor_and_walls(void) {
- obj_update_floor_and_resolve_wall_collisions(60);
+void cur_obj_update_floor_and_walls(void) {
+ cur_obj_update_floor_and_resolve_wall_collisions(60);
}
-void obj_move_standard(s16 steepSlopeAngleDegrees) {
+void cur_obj_move_standard(s16 steepSlopeAngleDegrees) {
f32 gravity = o->oGravity;
f32 bounce = o->oBounce;
f32 buoyancy = o->oBuoyancy;
@@ -1830,11 +1829,11 @@ void obj_move_standard(s16 steepSlopeAngleDegrees) {
steepSlopeNormalY = coss(steepSlopeAngleDegrees * (0x10000 / 360));
- obj_compute_vel_xz();
- obj_apply_drag_xz(dragStrength);
+ cur_obj_compute_vel_xz();
+ cur_obj_apply_drag_xz(dragStrength);
- obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes);
- obj_move_y(gravity, bounce, buoyancy);
+ cur_obj_move_xz(steepSlopeNormalY, careAboutEdgesAndSteepSlopes);
+ cur_obj_move_y(gravity, bounce, buoyancy);
if (o->oForwardVel < 0) {
negativeSpeed = TRUE;
@@ -1846,7 +1845,7 @@ void obj_move_standard(s16 steepSlopeAngleDegrees) {
}
}
-static s32 obj_within_12k_bounds(void) {
+static s32 cur_obj_within_12k_bounds(void) {
if (o->oPosX < -12000.0f || 12000.0f < o->oPosX) {
return FALSE;
}
@@ -1862,8 +1861,8 @@ static s32 obj_within_12k_bounds(void) {
return TRUE;
}
-void obj_move_using_vel_and_gravity(void) {
- if (obj_within_12k_bounds()) {
+void cur_obj_move_using_vel_and_gravity(void) {
+ if (cur_obj_within_12k_bounds()) {
o->oPosX += o->oVelX;
o->oPosZ += o->oVelZ;
o->oVelY += o->oGravity; //! No terminal velocity
@@ -1871,12 +1870,12 @@ void obj_move_using_vel_and_gravity(void) {
}
}
-void obj_move_using_fvel_and_gravity(void) {
- obj_compute_vel_xz();
- obj_move_using_vel_and_gravity(); //! No terminal velocity
+void cur_obj_move_using_fvel_and_gravity(void) {
+ cur_obj_compute_vel_xz();
+ cur_obj_move_using_vel_and_gravity(); //! No terminal velocity
}
-void set_object_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy,
+void obj_set_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy,
f32 dforward) {
f32 facingZ = coss(other->oMoveAngleYaw);
f32 facingX = sins(other->oMoveAngleYaw);
@@ -1891,7 +1890,7 @@ void set_object_pos_relative(struct Object *obj, struct Object *other, f32 dleft
obj->oPosZ = other->oPosZ + dz;
}
-s16 obj_angle_to_home(void) {
+s16 cur_obj_angle_to_home(void) {
s16 angle;
f32 dx = o->oHomeX - o->oPosX;
f32 dz = o->oHomeZ - o->oPosZ;
@@ -1900,7 +1899,7 @@ s16 obj_angle_to_home(void) {
return angle;
}
-void func_802A2008(struct Object *a0, struct Object *a1) {
+void obj_set_gfx_pos_at_obj_pos(struct Object *a0, struct Object *a1) {
a0->header.gfx.pos[0] = a1->oPosX;
a0->header.gfx.pos[1] = a1->oPosY + a1->oGraphYOffset;
a0->header.gfx.pos[2] = a1->oPosZ;
@@ -1914,7 +1913,7 @@ void func_802A2008(struct Object *a0, struct Object *a1) {
* Transform the vector at localTranslateIndex into the object's local
* coordinates, and then add it to the vector at posIndex.
*/
-void translate_object_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex) {
+void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex) {
f32 dx = obj->rawData.asF32[localTranslateIndex + 0];
f32 dy = obj->rawData.asF32[localTranslateIndex + 1];
f32 dz = obj->rawData.asF32[localTranslateIndex + 2];
@@ -1927,7 +1926,7 @@ void translate_object_local(struct Object *obj, s16 posIndex, s16 localTranslate
obj->transform[0][2] * dx + obj->transform[1][2] * dy + obj->transform[2][2] * dz;
}
-void build_object_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex) {
+void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex) {
f32 translate[3];
s16 rotation[3];
@@ -1942,24 +1941,24 @@ void build_object_transform_from_pos_and_angle(struct Object *obj, s16 posIndex,
mtxf_rotate_zxy_and_translate(obj->transform, translate, rotation);
}
-void func_802A2270(struct Object *obj) {
+void obj_set_throw_matrix_from_transform(struct Object *obj) {
if (obj->oFlags & OBJ_FLAG_0020) {
- build_object_transform_from_pos_and_angle(obj, O_POS_INDEX, O_FACE_ANGLE_INDEX);
- apply_scale_to_object_transform(obj);
+ obj_build_transform_from_pos_and_angle(obj, O_POS_INDEX, O_FACE_ANGLE_INDEX);
+ obj_apply_scale_to_transform(obj);
}
obj->header.gfx.throwMatrix = obj->transform;
//! Sets scale of gCurrentObject instead of obj. Not exploitable since this
// function is only called with obj = gCurrentObject
- obj_scale(1.0f);
+ cur_obj_scale(1.0f);
}
-void build_object_transform_relative_to_parent(struct Object *obj) {
+void obj_build_transform_relative_to_parent(struct Object *obj) {
struct Object *parent = obj->parentObj;
- build_object_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX);
- apply_scale_to_object_transform(obj);
+ obj_build_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX);
+ obj_apply_scale_to_transform(obj);
mtxf_mul(obj->transform, obj->transform, parent->transform);
obj->oPosX = obj->transform[3][0];
@@ -1970,10 +1969,10 @@ void build_object_transform_relative_to_parent(struct Object *obj) {
//! Sets scale of gCurrentObject instead of obj. Not exploitable since this
// function is only called with obj = gCurrentObject
- obj_scale(1.0f);
+ cur_obj_scale(1.0f);
}
-void Unknown802A2380(struct Object *a0) {
+void obj_create_transform_from_self(struct Object *a0) {
a0->oFlags &= ~OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT;
a0->oFlags |= OBJ_FLAG_0800;
@@ -1982,25 +1981,25 @@ void Unknown802A2380(struct Object *a0) {
a0->transform[3][2] = a0->oPosZ;
}
-void obj_rotate_move_angle_using_vel(void) {
+void cur_obj_rotate_move_angle_using_vel(void) {
o->oMoveAnglePitch += o->oAngleVelPitch;
o->oMoveAngleYaw += o->oAngleVelYaw;
o->oMoveAngleRoll += o->oAngleVelRoll;
}
-void obj_rotate_face_angle_using_vel(void) {
+void cur_obj_rotate_face_angle_using_vel(void) {
o->oFaceAnglePitch += o->oAngleVelPitch;
o->oFaceAngleYaw += o->oAngleVelYaw;
o->oFaceAngleRoll += o->oAngleVelRoll;
}
-void obj_set_face_angle_to_move_angle(void) {
+void cur_obj_set_face_angle_to_move_angle(void) {
o->oFaceAnglePitch = o->oMoveAnglePitch;
o->oFaceAngleYaw = o->oMoveAngleYaw;
o->oFaceAngleRoll = o->oMoveAngleRoll;
}
-s32 obj_follow_path(UNUSED s32 unusedArg) {
+s32 cur_obj_follow_path(UNUSED s32 unusedArg) {
struct Waypoint *startWaypoint;
struct Waypoint *lastWaypoint;
struct Waypoint *targetWaypoint;
@@ -2064,23 +2063,23 @@ f32 random_f32_around_zero(f32 diameter) {
return RandomFloat() * diameter - diameter / 2;
}
-void scale_object_random(struct Object *obj, f32 rangeLength, f32 minScale) {
+void obj_scale_random(struct Object *obj, f32 rangeLength, f32 minScale) {
f32 scale = RandomFloat() * rangeLength + minScale;
- scale_object_xyz(obj, scale, scale, scale);
+ obj_scale_xyz(obj, scale, scale, scale);
}
-void translate_object_xyz_random(struct Object *obj, f32 rangeLength) {
+void obj_translate_xyz_random(struct Object *obj, f32 rangeLength) {
obj->oPosX += RandomFloat() * rangeLength - rangeLength * 0.5f;
obj->oPosY += RandomFloat() * rangeLength - rangeLength * 0.5f;
obj->oPosZ += RandomFloat() * rangeLength - rangeLength * 0.5f;
}
-void translate_object_xz_random(struct Object *obj, f32 rangeLength) {
+void obj_translate_xz_random(struct Object *obj, f32 rangeLength) {
obj->oPosX += RandomFloat() * rangeLength - rangeLength * 0.5f;
obj->oPosZ += RandomFloat() * rangeLength - rangeLength * 0.5f;
}
-static void func_802A297C(struct Object *a0) {
+static void obj_build_vel_from_transform(struct Object *a0) {
f32 spC = a0->oUnkC0;
f32 sp8 = a0->oUnkBC;
f32 sp4 = a0->oForwardVel;
@@ -2090,9 +2089,9 @@ static void func_802A297C(struct Object *a0) {
a0->oVelZ = a0->transform[0][2] * spC + a0->transform[1][2] * sp8 + a0->transform[2][2] * sp4;
}
-void func_802A2A38(void) {
- build_object_transform_from_pos_and_angle(o, O_PARENT_RELATIVE_POS_INDEX, O_MOVE_ANGLE_INDEX);
- func_802A297C(o);
+void cur_obj_set_pos_via_transform(void) {
+ obj_build_transform_from_pos_and_angle(o, O_PARENT_RELATIVE_POS_INDEX, O_MOVE_ANGLE_INDEX);
+ obj_build_vel_from_transform(o);
o->oPosX += o->oVelX;
o->oPosY += o->oVelY;
o->oPosZ += o->oVelZ;
@@ -2157,18 +2156,18 @@ struct Object_test
/*0x25C*/ void *respawnInfo;
};
-s16 obj_reflect_move_angle_off_wall(void) {
+s16 cur_obj_reflect_move_angle_off_wall(void) {
s16 angle = ((struct Object_test*)o)->rawData.moving.special.WallAngle - (s16) ((struct Object_test*)o)->rawData.moving.MoveAngleYaw + (s16) ((struct Object_test*)o)->rawData.moving.special.WallAngle +0x8000;
return angle;
}
#else
-s16 obj_reflect_move_angle_off_wall(void) {
+s16 cur_obj_reflect_move_angle_off_wall(void) {
s16 angle = o->oWallAngle - ((s16) o->oMoveAngleYaw - (s16) o->oWallAngle) + 0x8000;
return angle;
}
#endif
-void obj_spawn_particles(struct SpawnParticlesInfo *info) {
+void cur_obj_spawn_particles(struct SpawnParticlesInfo *info) {
struct Object *particle;
s32 i;
f32 scale;
@@ -2199,11 +2198,11 @@ void obj_spawn_particles(struct SpawnParticlesInfo *info) {
particle->oForwardVel = RandomFloat() * info->forwardVelRange + info->forwardVelBase;
particle->oVelY = RandomFloat() * info->velYRange + info->velYBase;
- scale_object_xyz(particle, scale, scale, scale);
+ obj_scale_xyz(particle, scale, scale, scale);
}
}
-void set_object_hitbox(struct Object *obj, struct ObjectHitbox *hitbox) {
+void obj_set_hitbox(struct Object *obj, struct ObjectHitbox *hitbox) {
if (!(obj->oFlags & OBJ_FLAG_30)) {
obj->oFlags |= OBJ_FLAG_30;
@@ -2212,7 +2211,7 @@ void set_object_hitbox(struct Object *obj, struct ObjectHitbox *hitbox) {
obj->oHealth = hitbox->health;
obj->oNumLootCoins = hitbox->numLootCoins;
- obj_become_tangible();
+ cur_obj_become_tangible();
}
obj->hitboxRadius = obj->header.gfx.scale[0] * hitbox->radius;
@@ -2246,7 +2245,7 @@ s32 absi(s32 a0) {
}
}
-s32 obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks) {
+s32 cur_obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks) {
s32 done = FALSE;
s32 timeBlinking;
@@ -2264,7 +2263,7 @@ s32 obj_wait_then_blink(s32 timeUntilBlinking, s32 numBlinks) {
return done;
}
-s32 obj_is_mario_ground_pounding_platform(void) {
+s32 cur_obj_is_mario_ground_pounding_platform(void) {
if (gMarioObject->platform == o) {
if (gMarioStates[0].action == ACT_GROUND_POUND_LAND) {
return TRUE;
@@ -2274,16 +2273,16 @@ s32 obj_is_mario_ground_pounding_platform(void) {
return FALSE;
}
-void func_802A3004(void) {
- func_802AA618(0, 0, 46.0f);
+void spawn_mist_particles(void) {
+ spawn_mist_particles_variable(0, 0, 46.0f);
}
-void func_802A3034(s32 sp18) {
- func_802AA618(0, 0, 46.0f);
+void spawn_mist_particles_with_sound(s32 sp18) {
+ spawn_mist_particles_variable(0, 0, 46.0f);
create_sound_spawner(sp18);
}
-void obj_push_mario_away(f32 radius) {
+void cur_obj_push_mario_away(f32 radius) {
f32 marioRelX = gMarioObject->oPosX - o->oPosX;
f32 marioRelZ = gMarioObject->oPosZ - o->oPosZ;
f32 marioDist = sqrtf(sqr(marioRelX) + sqr(marioRelZ));
@@ -2296,7 +2295,7 @@ void obj_push_mario_away(f32 radius) {
}
}
-void obj_push_mario_away_from_cylinder(f32 radius, f32 extentY) {
+void cur_obj_push_mario_away_from_cylinder(f32 radius, f32 extentY) {
f32 marioRelY = gMarioObject->oPosY - o->oPosY;
if (marioRelY < 0) {
@@ -2304,33 +2303,33 @@ void obj_push_mario_away_from_cylinder(f32 radius, f32 extentY) {
}
if (marioRelY < extentY) {
- obj_push_mario_away(radius);
+ cur_obj_push_mario_away(radius);
}
}
-void BehDustSmokeLoop(void) {
+void bhv_dust_smoke_loop(void) {
o->oPosX += o->oVelX;
o->oPosY += o->oVelY;
o->oPosZ += o->oVelZ;
if (o->oSmokeTimer == 10) {
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
}
o->oSmokeTimer++;
}
-static void nop_802A3294(void) {
+static void stub_obj_helpers_2(void) {
}
-s32 func_802A32A4(s8 *a0) {
+s32 cur_obj_set_direction_table(s8 *a0) {
o->oToxBoxUnk1AC = a0;
o->oToxBoxUnk1B0 = 0;
return *(s8 *) o->oToxBoxUnk1AC;
}
-s32 func_802A32E0(void) {
+s32 cur_obj_progress_direction_table(void) {
s8 spF;
s8 *sp8 = o->oToxBoxUnk1AC;
s32 sp4 = o->oToxBoxUnk1B0 + 1;
@@ -2346,10 +2345,10 @@ s32 func_802A32E0(void) {
return spF;
}
-void nop_802A3380(UNUSED s32 sp0, UNUSED s32 sp4) {
+void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4) {
}
-void func_802A3398(s32 a0, s32 a1, f32 sp10, f32 sp14) {
+void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14) {
f32 sp4 = sp14 - sp10;
f32 sp0 = (f32) o->oTimer / a1;
@@ -2366,17 +2365,17 @@ void func_802A3398(s32 a0, s32 a1, f32 sp10, f32 sp14) {
}
}
-void func_802A3470(void) {
+void cur_obj_set_pos_to_home_with_debug(void) {
o->oPosX = o->oHomeX + gDebugInfo[5][0];
o->oPosY = o->oHomeY + gDebugInfo[5][1];
o->oPosZ = o->oHomeZ + gDebugInfo[5][2];
- obj_scale(gDebugInfo[5][3] / 100.0f + 1.0l);
+ cur_obj_scale(gDebugInfo[5][3] / 100.0f + 1.0l);
}
-void nop_802A3544(void) {
+void stub_obj_helpers_4(void) {
}
-s32 obj_is_mario_on_platform(void) {
+s32 cur_obj_is_mario_on_platform(void) {
if (gMarioObject->platform == o) {
return TRUE;
} else {
@@ -2384,7 +2383,7 @@ s32 obj_is_mario_on_platform(void) {
}
}
-s32 obj_shake_y_until(s32 cycles, s32 amount) {
+s32 cur_obj_shake_y_until(s32 cycles, s32 amount) {
if (o->oTimer % 2 != 0) {
o->oPosY -= amount;
} else {
@@ -2398,7 +2397,7 @@ s32 obj_shake_y_until(s32 cycles, s32 amount) {
}
}
-s32 func_802A362C(s32 a0) {
+s32 cur_obj_move_up_and_down(s32 a0) {
if (a0 >= 4 || a0 < 0) {
return 1;
}
@@ -2407,12 +2406,12 @@ s32 func_802A362C(s32 a0) {
return 0;
}
-void obj_call_action_function(void (*actionFunctions[])(void)) {
+void cur_obj_call_action_function(void (*actionFunctions[])(void)) {
void (*actionFunction)(void) = actionFunctions[o->oAction];
actionFunction();
}
-static struct Object *func_802A36D8(s32 sp20, s32 sp24) {
+static struct Object *spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24) {
struct Object *sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit);
sp1C->oSparkleSpawnUnk1B0 = sp24;
sp1C->oBehParams = o->oBehParams;
@@ -2424,15 +2423,15 @@ static struct Object *func_802A36D8(s32 sp20, s32 sp24) {
// old unused initializer for 2d star spawn behavior.
// speculation: was 2d spawn handler from spaceworld 1995.
// uses behavior parameters not used in the current sparkle code.
-void Unknown802A3750(void) {
- func_802A36D8(0, 0);
+void spawn_base_star_with_no_lvl_exit(void) {
+ spawn_star_with_no_lvl_exit(0, 0);
}
-s32 func_802A377C(s32 a0) {
+s32 bit_shift_left(s32 a0) {
return D_8032F0A4[a0];
}
-s32 obj_mario_far_away(void) {
+s32 cur_obj_mario_far_away(void) {
f32 dx = o->oHomeX - gMarioObject->oPosX;
f32 dy = o->oHomeY - gMarioObject->oPosY;
f32 dz = o->oHomeZ - gMarioObject->oPosZ;
@@ -2445,7 +2444,7 @@ s32 obj_mario_far_away(void) {
}
}
-s32 obj_is_mario_moving_fast_or_in_air(s32 speedThreshold) {
+s32 is_mario_moving_fast_or_in_air(s32 speedThreshold) {
if (gMarioStates[0].forwardVel > speedThreshold) {
return TRUE;
}
@@ -2457,7 +2456,7 @@ s32 obj_is_mario_moving_fast_or_in_air(s32 speedThreshold) {
}
}
-s32 item_in_array(s8 item, s8 *array) {
+s32 is_item_in_array(s8 item, s8 *array) {
while (*array != -1) {
if (*array == item) {
return TRUE;
@@ -2469,14 +2468,14 @@ s32 item_in_array(s8 item, s8 *array) {
return FALSE;
}
-static void nop_802A3968(void) {
+static void stub_obj_helpers_5(void) {
}
void bhv_init_room(void) {
struct Surface *floor;
f32 floorHeight;
- if (item_in_array(gCurrLevelNum, sLevelsWithRooms)) {
+ if (is_item_in_array(gCurrLevelNum, sLevelsWithRooms)) {
floorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor);
if (floor != NULL) {
@@ -2497,7 +2496,7 @@ void bhv_init_room(void) {
}
}
-void obj_enable_rendering_if_mario_in_room(void) {
+void cur_obj_enable_rendering_if_mario_in_room(void) {
register s32 marioInRoom;
if (o->oRoom != -1 && gMarioCurrentRoom != 0) {
@@ -2512,21 +2511,21 @@ void obj_enable_rendering_if_mario_in_room(void) {
}
if (marioInRoom) {
- obj_enable_rendering();
+ cur_obj_enable_rendering();
o->activeFlags &= ~ACTIVE_FLAG_IN_DIFFERENT_ROOM;
gNumRoomedObjectsInMarioRoom++;
} else {
- obj_disable_rendering();
+ cur_obj_disable_rendering();
o->activeFlags |= ACTIVE_FLAG_IN_DIFFERENT_ROOM;
gNumRoomedObjectsNotInMarioRoom++;
}
}
}
-s32 obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins) {
+s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins) {
s32 interacted = FALSE;
- set_object_hitbox(o, hitbox);
+ obj_set_hitbox(o, hitbox);
if (noLootCoins) {
o->oNumLootCoins = 0;
@@ -2534,9 +2533,9 @@ s32 obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSou
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
if (o->oInteractStatus & INT_STATUS_WAS_ATTACKED) {
- func_802A3004();
- spawn_object_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
- mark_object_for_deletion(o);
+ spawn_mist_particles();
+ obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
+ obj_mark_for_deletion(o);
create_sound_spawner(deathSound);
} else {
interacted = TRUE;
@@ -2547,39 +2546,40 @@ s32 obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSou
return interacted;
}
-void func_802A3C98(f32 sp18, s32 sp1C) {
- func_802AA618(0, 0, sp18);
+
+void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C) {
+ spawn_mist_particles_variable(0, 0, sp18);
spawn_triangle_break_particles(30, 138, 3.0f, 4);
- mark_object_for_deletion(o);
+ obj_mark_for_deletion(o);
if (sp1C == 1) {
- spawn_object_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
+ obj_spawn_loot_yellow_coins(o, o->oNumLootCoins, 20.0f);
} else if (sp1C == 2) {
- spawn_object_loot_blue_coins(o, o->oNumLootCoins, 20.0f, 150);
+ obj_spawn_loot_blue_coins(o, o->oNumLootCoins, 20.0f, 150);
}
}
-void set_object_collision_data(struct Object *obj, const void *segAddr) {
+void obj_set_collision_data(struct Object *obj, const void *segAddr) {
obj->collisionData = segmented_to_virtual(segAddr);
}
-void obj_if_hit_wall_bounce_away(void) {
+void cur_obj_if_hit_wall_bounce_away(void) {
if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) {
o->oMoveAngleYaw = o->oWallAngle;
}
}
-s32 obj_hide_if_mario_far_away_y(f32 distY) {
+s32 cur_obj_hide_if_mario_far_away_y(f32 distY) {
if (absf(o->oPosY - gMarioObject->oPosY) < distY) {
- obj_unhide();
+ cur_obj_unhide();
return FALSE;
} else {
- obj_hide();
+ cur_obj_hide();
return TRUE;
}
}
-Gfx *Geo18_802A45E4(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
+Gfx *geo_offset_klepto_held_object(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
if (run == TRUE) {
((struct GraphNodeTranslationRotation *) node->next)->translation[0] = 300;
((struct GraphNodeTranslationRotation *) node->next)->translation[1] = 300;
@@ -2589,7 +2589,7 @@ Gfx *Geo18_802A45E4(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) {
return NULL;
}
-s32 Unknown802A3E84(s32 a0, struct GraphNode *a1, UNUSED s32 sp8) {
+s32 geo_offset_klepto_debug(s32 a0, struct GraphNode *a1, UNUSED s32 sp8) {
if (a0 == 1) {
((struct GraphNode_802A45E4 *) a1->next)->unk18 = gDebugInfo[4][0];
((struct GraphNode_802A45E4 *) a1->next)->unk1A = gDebugInfo[4][1];
@@ -2602,8 +2602,8 @@ s32 Unknown802A3E84(s32 a0, struct GraphNode *a1, UNUSED s32 sp8) {
return 0;
}
-s32 obj_is_hidden(struct Object *a0) {
- if (a0->header.gfx.node.flags & GRAPH_RENDER_INVISIBLE) {
+s32 obj_is_hidden(struct Object *obj) {
+ if (obj->header.gfx.node.flags & GRAPH_RENDER_INVISIBLE) {
return TRUE;
} else {
return FALSE;
@@ -2626,13 +2626,13 @@ void clear_time_stop_flags(s32 flag) {
gTimeStopState = gTimeStopState & (flag ^ 0xFFFFFFFF);
}
-s32 func_802A3FF8(f32 radius, f32 height, UNUSED s32 unused) {
+s32 cur_obj_can_mario_activate_textbox(f32 radius, f32 height, UNUSED s32 unused) {
f32 latDistToMario;
UNUSED s16 angleFromMario;
if (o->oDistanceToMario < 1500.0f) {
latDistToMario = lateral_dist_between_objects(o, gMarioObject);
- angleFromMario = angle_to_object(gMarioObject, o);
+ angleFromMario = obj_angle_to_object(gMarioObject, o);
if (latDistToMario < radius && o->oPosY < gMarioObject->oPosY + 160.0f
&& gMarioObject->oPosY < o->oPosY + height && !(gMarioStates[0].action & ACT_FLAG_AIR)
@@ -2644,11 +2644,12 @@ s32 func_802A3FF8(f32 radius, f32 height, UNUSED s32 unused) {
return FALSE;
}
-s32 obj_is_mario_in_range_and_ready_to_speak(f32 radius, f32 height) {
- return func_802A3FF8(radius, height, 0x1000);
+s32 cur_obj_can_mario_activate_textbox_2(f32 radius, f32 height) {
+ // The last argument here is unused. When this function is called directly the argument is always set to 0x7FFF.
+ return cur_obj_can_mario_activate_textbox(radius, height, 0x1000);
}
-static void obj_end_dialog(s32 dialogFlags, s32 dialogResult) {
+static void cur_obj_end_dialog(s32 dialogFlags, s32 dialogResult) {
o->oDialogResponse = dialogResult;
o->oDialogState++;
@@ -2657,7 +2658,7 @@ static void obj_end_dialog(s32 dialogFlags, s32 dialogResult) {
}
}
-s32 obj_update_dialog(s32 actionArg, s32 dialogFlags, s32 dialogID, UNUSED s32 unused) {
+s32 cur_obj_update_dialog(s32 actionArg, s32 dialogFlags, s32 dialogID, UNUSED s32 unused) {
s32 dialogResponse = 0;
UNUSED s32 doneTurning = TRUE;
@@ -2706,14 +2707,14 @@ s32 obj_update_dialog(s32 actionArg, s32 dialogFlags, s32 dialogID, UNUSED s32 u
case DIALOG_UNK1_AWAIT_DIALOG:
if (dialogFlags & DIALOG_UNK1_FLAG_RESPONSE) {
if (gDialogResponse != 0) {
- obj_end_dialog(dialogFlags, gDialogResponse);
+ cur_obj_end_dialog(dialogFlags, gDialogResponse);
}
} else if (dialogFlags & DIALOG_UNK1_FLAG_DEFAULT) {
if (get_dialog_id() == -1) {
- obj_end_dialog(dialogFlags, 3);
+ cur_obj_end_dialog(dialogFlags, 3);
}
} else {
- obj_end_dialog(dialogFlags, 3);
+ cur_obj_end_dialog(dialogFlags, 3);
}
break;
@@ -2734,7 +2735,7 @@ s32 obj_update_dialog(s32 actionArg, s32 dialogFlags, s32 dialogID, UNUSED s32 u
return dialogResponse;
}
-s32 obj_update_dialog_with_cutscene(s32 actionArg, s32 dialogFlags, s32 cutsceneTable, s32 dialogID) {
+s32 cur_obj_update_dialog_with_cutscene(s32 actionArg, s32 dialogFlags, s32 cutsceneTable, s32 dialogID) {
s32 dialogResponse = 0;
s32 doneTurning = TRUE;
@@ -2768,7 +2769,7 @@ s32 obj_update_dialog_with_cutscene(s32 actionArg, s32 dialogFlags, s32 cutscene
case DIALOG_UNK2_TURN_AND_INTERRUPT_MARIO_ACTION:
if (dialogFlags & DIALOG_UNK2_FLAG_0) {
- doneTurning = obj_rotate_yaw_toward(angle_to_object(o, gMarioObject), 0x800);
+ doneTurning = cur_obj_rotate_yaw_toward(obj_angle_to_object(o, gMarioObject), 0x800);
if (o->oDialogResponse >= 0x21) {
doneTurning = TRUE;
}
@@ -2812,15 +2813,15 @@ s32 obj_update_dialog_with_cutscene(s32 actionArg, s32 dialogFlags, s32 cutscene
return dialogResponse;
}
-s32 obj_has_model(u16 a0) {
- if (o->header.gfx.sharedChild == gLoadedGraphNodes[a0]) {
+s32 cur_obj_has_model(u16 modelID) {
+ if (o->header.gfx.sharedChild == gLoadedGraphNodes[modelID]) {
return TRUE;
} else {
return FALSE;
}
}
-void obj_align_gfx_with_floor(void) {
+void cur_obj_align_gfx_with_floor(void) {
struct Surface *floor;
Vec3f floorNormal;
Vec3f position;
@@ -2852,11 +2853,11 @@ s32 mario_is_within_rectangle(s16 minX, s16 maxX, s16 minZ, s16 maxZ) {
return TRUE;
}
-void ShakeScreen(s32 shake) {
+void cur_obj_shake_screen(s32 shake) {
set_camera_shake_from_point(shake, o->oPosX, o->oPosY, o->oPosZ);
}
-s32 attack_collided_non_mario_object(struct Object *obj) {
+s32 obj_attack_collided_from_other_object(struct Object *obj) {
s32 numCollidedObjs;
struct Object *other;
s32 touchedOtherObject = FALSE;
@@ -2875,7 +2876,7 @@ s32 attack_collided_non_mario_object(struct Object *obj) {
return touchedOtherObject;
}
-s32 obj_was_attacked_or_ground_pounded(void) {
+s32 cur_obj_was_attacked_or_ground_pounded(void) {
s32 attacked = FALSE;
if ((o->oInteractStatus & INT_STATUS_INTERACTED)
@@ -2883,7 +2884,7 @@ s32 obj_was_attacked_or_ground_pounded(void) {
attacked = TRUE;
}
- if (obj_is_mario_ground_pounding_platform()) {
+ if (cur_obj_is_mario_ground_pounding_platform()) {
attacked = TRUE;
}
@@ -2891,30 +2892,30 @@ s32 obj_was_attacked_or_ground_pounded(void) {
return attacked;
}
-void copy_object_behavior_params(struct Object *dst, struct Object *src) {
+void obj_copy_behavior_params(struct Object *dst, struct Object *src) {
dst->oBehParams = src->oBehParams;
dst->oBehParams2ndByte = src->oBehParams2ndByte;
}
-void func_802A4A70(s32 sp18, s32 sp1C) {
- set_obj_animation_and_sound_state(sp18);
- o->header.gfx.unk38.animFrame = sp1C;
+void cur_obj_init_animation_and_anim_frame(s32 animIndex, s32 animFrame) {
+ cur_obj_init_animation_with_sound(animIndex);
+ o->header.gfx.unk38.animFrame = animFrame;
}
-s32 func_802A4AB0(s32 sp18) {
- set_obj_animation_and_sound_state(sp18);
- return func_8029F788();
+s32 cur_obj_init_animation_and_check_if_near_end(s32 animIndex) {
+ cur_obj_init_animation_with_sound(animIndex);
+ return cur_obj_check_if_near_animation_end();
}
-void func_802A4AEC(s32 sp18) {
- set_obj_animation_and_sound_state(sp18);
- func_8029F728();
+void cur_obj_init_animation_and_extend_if_at_end(s32 animIndex) {
+ cur_obj_init_animation_with_sound(animIndex);
+ cur_obj_extend_animation_if_at_end();
}
-s32 obj_check_grabbed_mario(void) {
+s32 cur_obj_check_grabbed_mario(void) {
if (o->oInteractStatus & INT_STATUS_GRABBED_MARIO) {
o->oKingBobombUnk88 = 1;
- obj_become_intangible();
+ cur_obj_become_intangible();
return TRUE;
}
@@ -2963,9 +2964,9 @@ s32 player_performed_grab_escape_action(void) {
}
#endif
-void obj_unused_play_footstep_sound(s32 animFrame1, s32 animFrame2, s32 sound) {
- if (obj_check_anim_frame(animFrame1) || obj_check_anim_frame(animFrame2)) {
- PlaySound2(sound);
+void cur_obj_unused_play_footstep_sound(s32 animFrame1, s32 animFrame2, s32 sound) {
+ if (cur_obj_check_anim_frame(animFrame1) || cur_obj_check_anim_frame(animFrame2)) {
+ cur_obj_play_sound_2(sound);
}
}
@@ -2979,7 +2980,7 @@ void disable_time_stop_including_mario(void) {
o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP;
}
-s32 obj_check_interacted(void) {
+s32 cur_obj_check_interacted(void) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
o->oInteractStatus = 0;
return TRUE;
@@ -2988,7 +2989,7 @@ s32 obj_check_interacted(void) {
}
}
-void obj_spawn_loot_blue_coin(void) {
+void cur_obj_spawn_loot_blue_coin(void) {
if (o->oNumLootCoins >= 5) {
spawn_object(o, MODEL_BLUE_COIN, bhvMrIBlueCoin);
o->oNumLootCoins -= 5;
@@ -2996,10 +2997,10 @@ void obj_spawn_loot_blue_coin(void) {
}
#ifndef VERSION_JP
-void obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY) {
+void cur_obj_spawn_star_at_y_offset(f32 targetX, f32 targetY, f32 targetZ, f32 offsetY) {
f32 objectPosY = o->oPosY;
o->oPosY += offsetY + gDebugInfo[5][0];
- create_star(targetX, targetY, targetZ);
+ spawn_default_star(targetX, targetY, targetZ);
o->oPosY = objectPosY;
}
#endif
diff --git a/src/game/object_helpers.h b/src/game/object_helpers.h
@@ -14,21 +14,21 @@ struct ChainSegment
s16 roll;
};
-#define WATER_SPLASH_FLAG_RAND_ANGLE 0x02
-#define WATER_SPLASH_FLAG_RAND_OFFSET_XZ 0x04
-#define WATER_SPLASH_FLAG_RAND_OFFSET_XYZ 0x08
-#define WATER_SPLASH_FLAG_SET_Y_TO_WATER_LEVEL 0x20
-#define WATER_SPLASH_FLAG_RAND_ANGLE_INCR_PLUS_8000 0x40
-#define WATER_SPLASH_FLAG_RAND_ANGLE_INCR 0x80
+#define WATER_DROPLET_FLAG_RAND_ANGLE 0x02
+#define WATER_DROPLET_FLAG_RAND_OFFSET_XZ 0x04 // Unused
+#define WATER_DROPLET_FLAG_RAND_OFFSET_XYZ 0x08 // Unused
+#define WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL 0x20
+#define WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000 0x40
+#define WATER_DROPLET_FLAG_RAND_ANGLE_INCR 0x80 // Unused
-// Call spawn_water_splash with this struct to spawn an object.
-struct WaterSplashParams
+// Call spawn_water_droplet with this struct to spawn an object.
+struct WaterDropletParams
{
- s16 flags; // spawn flags, see WATER_SPLASH_FLAG_* defines above
+ s16 flags; // Droplet spawn flags, see defines above
s16 model;
const BehaviorScript *behavior;
- s16 moveAngleRange; // only used for flags 0x40 & 0x80
- s16 moveRange; // only used for flags 0x04 & 0x08
+ s16 moveAngleRange; // Only used for RAND_ANGLE_INCR flags
+ s16 moveRange; // Only used for RAND_OFFSET flags
f32 randForwardVelOffset;
f32 randForwardVelScale;
f32 randYVelOffset;
@@ -120,7 +120,7 @@ extern void* D_060576FC;
// extern ? D_8032F738;
// extern ? D_8032F728;
// extern ? D_8032F754;
-extern s8 dddStatus;
+extern s8 gDddPaintingStatus;
// extern ? D_8035FEE8;
// extern ? sCageUkikiPath;
// extern ? sUkikiActions;
@@ -164,8 +164,8 @@ extern s8 dddStatus;
// extern ? D_80336704;
// extern ? D_8033670C;
-extern Gfx *Geo18_8029D890(s32 run, UNUSED struct GraphNode *node, f32 mtx[4][4]);
-extern Gfx *Geo18_8029D924(s32 run, struct GraphNode *node, UNUSED void *context);
+extern Gfx *geo_update_projectile_pos_from_parent(s32 run, UNUSED struct GraphNode *node, f32 mtx[4][4]);
+extern Gfx *geo_update_layer_transparency(s32 run, struct GraphNode *node, UNUSED void *context);
#ifdef AVOID_UB
extern Gfx *geo_switch_anim_state(s32 run, struct GraphNode *node, void *context);
extern Gfx *geo_switch_area(s32 run, struct GraphNode *node, void *context);
@@ -173,163 +173,163 @@ extern Gfx *geo_switch_area(s32 run, struct GraphNode *node, void *context);
extern Gfx *geo_switch_anim_state(s32 run, struct GraphNode *node);
extern Gfx *geo_switch_area(s32 run, struct GraphNode *node);
#endif
-extern void func_8029D558(Mat4, struct Object *);
-void apply_object_scale_to_matrix(struct Object *, Mat4, Mat4);
-extern void func_8029D704(Mat4,Mat4,Mat4);
-void set_object_held_state(struct Object *, const BehaviorScript *);
+extern void obj_update_pos_from_parent_transformation(Mat4, struct Object *);
+void obj_apply_scale_to_matrix(struct Object *, Mat4, Mat4);
+extern void create_transformation_from_matrices(Mat4,Mat4,Mat4);
+void obj_set_held_state(struct Object *, const BehaviorScript *);
extern f32 lateral_dist_between_objects(struct Object *, struct Object *);
extern f32 dist_between_objects(struct Object *, struct Object *);
-extern void obj_forward_vel_approach_upward(f32,f32);
+extern void cur_obj_forward_vel_approach_upward(f32,f32);
extern s32 approach_f32_signed(f32*,f32,f32);
extern f32 approach_f32_symmetric(f32,f32,f32);
extern s16 approach_s16_symmetric(s16 arg0, s16 arg1, s16 arg2);
-extern s32 obj_rotate_yaw_toward(s16,s16);
-extern s16 angle_to_object(struct Object *, struct Object *);
+extern s32 cur_obj_rotate_yaw_toward(s16,s16);
+extern s16 obj_angle_to_object(struct Object *, struct Object *);
extern s16 obj_turn_toward_object(struct Object *, struct Object *, s16, s16);
-extern void set_object_parent_relative_pos(struct Object*,s16,s16,s16);
-extern void set_object_pos(struct Object*,s16,s16,s16);
-extern void set_object_angle(struct Object*,s16,s16,s16);
+extern void obj_set_parent_relative_pos(struct Object*,s16,s16,s16);
+extern void obj_set_pos(struct Object*,s16,s16,s16);
+extern void obj_set_angle(struct Object*,s16,s16,s16);
extern struct Object *spawn_object_abs_with_rot(struct Object *, s16, u32, const BehaviorScript *, s16, s16, s16, s16, s16, s16);
extern struct Object *spawn_object_rel_with_rot(struct Object *sp20, u32 sp24, const BehaviorScript *sp28, s16 sp2E, s16 sp32, s16 sp36, s16 sp3A, s16 sp3E, s16 sp42);
-// extern ? Unknown8029E330(?);
-extern struct Object *spawn_water_splash(struct Object *, struct WaterSplashParams *);
+// extern ? spawn_obj_with_transform_flags(?);
+extern struct Object *spawn_water_droplet(struct Object *, struct WaterDropletParams *);
extern struct Object *spawn_object_at_origin(struct Object *, s32, u32, const BehaviorScript *);
extern struct Object *spawn_object(struct Object *, s32, const BehaviorScript *);
extern struct Object* try_to_spawn_object(s16,f32,struct Object*,s32,const BehaviorScript *);
extern struct Object* spawn_object_with_scale(struct Object*,s32,const BehaviorScript *,f32);
-// extern ? build_relative_object_transform(?);
+// extern ? obj_build_relative_transform(?);
extern struct Object* spawn_object_relative(s16, s16, s16, s16, struct Object *, s32, const BehaviorScript *);
extern struct Object* spawn_object_relative_with_scale(s16,s16,s16,s16,f32,struct Object *,s32,const BehaviorScript *);
-// extern ? obj_move_using_vel(?);
-extern void copy_object_graph_y_offset(struct Object*,struct Object*);
-extern void copy_object_pos_and_angle(struct Object *, struct Object *);
-extern void copy_object_pos(struct Object*,struct Object*);
-// extern ? copy_object_angle(?);
-extern void func_8029EA0C(struct Object*);
-// extern ? Unknown8029EA34(?);
+// extern ? cur_obj_move_using_vel(?);
+extern void obj_copy_graph_y_offset(struct Object*,struct Object*);
+extern void obj_copy_pos_and_angle(struct Object *, struct Object *);
+extern void obj_copy_pos(struct Object*,struct Object*);
+// extern ? obj_copy_angle(?);
+extern void obj_set_gfx_pos_from_pos(struct Object*);
+// extern ? spawn_obj_with_transform_flags(?);
extern void linear_mtxf_mul_vec3f(f32 [4][4], Vec3f, Vec3f);
extern void linear_mtxf_transpose_mul_vec3f(f32 [4][4], Vec3f, Vec3f);
-// extern ? apply_scale_to_object_transform(?);
-void copy_object_scale(struct Object *toObj, struct Object *fromObj);
-extern void scale_object_xyz(struct Object* obj, f32 xScale, f32 yScale, f32 zScale);
-extern void scale_object(struct Object *, f32);
-extern void obj_scale(f32);
-extern void set_obj_animation_and_sound_state(s32);
-extern void func_8029ED98(u32, f32);
-extern void SetObjAnimation(s32 arg0);
-void func_8029EE20(struct Object *a0, struct Animation **a1, u32 a2);
+// extern ? obj_apply_scale_to_transform(?);
+void obj_copy_scale(struct Object *toObj, struct Object *fromObj);
+extern void obj_scale_xyz(struct Object* obj, f32 xScale, f32 yScale, f32 zScale);
+extern void obj_scale(struct Object *, f32);
+extern void cur_obj_scale(f32);
+extern void cur_obj_init_animation_with_sound(s32);
+extern void cur_obj_init_animation_with_accel_and_sound(s32, f32);
+extern void cur_obj_init_animation(s32 arg0);
+void obj_init_animation_with_sound(struct Object *a0, struct Animation **a1, s32 a2);
// extern ? obj_enable_rendering_and_become_tangible(?);
-extern void obj_enable_rendering(void);
+extern void cur_obj_enable_rendering(void);
// extern ? obj_disable_rendering_and_become_intangible(?);
-extern void obj_disable_rendering(void);
-extern void obj_unhide(void);
-extern void obj_hide(void);
-extern void obj_set_pos_relative(struct Object *MarioObj, f32, f32, f32);
-// extern ? obj_set_pos_relative_to_parent(?);
-extern void obj_enable_rendering_2(void);
+extern void cur_obj_disable_rendering(void);
+extern void cur_obj_unhide(void);
+extern void cur_obj_hide(void);
+extern void cur_obj_set_pos_relative(struct Object *MarioObj, f32, f32, f32);
+// extern ? cur_obj_set_pos_relative_to_parent(?);
+extern void cur_obj_enable_rendering_2(void);
// extern ? obj_unused_init_on_floor(?);
-extern void obj_set_facing_to_move_angles(struct Object *);
+extern void obj_set_face_angle_to_move_angle(struct Object *);
u32 get_object_list_from_behavior(const BehaviorScript *behavior);
-extern struct Object *obj_nearest_object_with_behavior(const BehaviorScript *);
-f32 obj_dist_to_nearest_object_with_behavior(const BehaviorScript*);
-extern struct Object *obj_find_nearest_object_with_behavior(const BehaviorScript *, f32 *);
+extern struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *);
+f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript*);
+extern struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *, f32 *);
extern struct Object *find_unimportant_object(void);
// extern ? count_unimportant_objects(?);
extern s32 count_objects_with_behavior(const BehaviorScript *behavior);
-struct Object* obj_find_nearby_held_actor(const BehaviorScript *,f32);
+struct Object* cur_obj_find_nearby_held_actor(const BehaviorScript *,f32);
// extern ? obj_reset_timer_and_subaction(?);
-void obj_change_action(s32);
-void func_8029F684(f32,f32);
-BAD_RETURN(s16) func_8029F6F0(void);
-extern BAD_RETURN(s32) func_8029F728(void);
-extern s32 func_8029F788(void);
-extern s32 func_8029F828(void);
-extern s32 obj_check_anim_frame(s32);
-extern s32 obj_check_anim_frame_in_range(s32, s32);
-// extern ? Unknown8029F930(?);
+void cur_obj_change_action(s32);
+void cur_obj_set_vel_from_mario_vel(f32,f32);
+BAD_RETURN(s16) cur_obj_reverse_animation(void);
+extern BAD_RETURN(s32) cur_obj_extend_animation_if_at_end(void);
+extern s32 cur_obj_check_if_near_animation_end(void);
+extern s32 cur_obj_check_if_at_animation_end(void);
+extern s32 cur_obj_check_anim_frame(s32);
+extern s32 cur_obj_check_anim_frame_in_range(s32, s32);
+// extern ? cur_obj_check_frame_prior_current_frame(?);
s32 mario_is_in_air_action(void);
s32 mario_is_dive_sliding(void);
-void func_8029FA1C(f32,s32);
-void func_8029FA5C(s32,s32);
+void cur_obj_set_y_vel_and_animation(f32,s32);
+void cur_obj_unrender_and_reset_state(s32,s32);
// extern ? obj_move_after_thrown_or_dropped(?);
-void obj_get_thrown_or_placed(f32,f32,s32);
-extern void obj_get_dropped(void);
-extern void obj_set_model(s32);
+void cur_obj_get_thrown_or_placed(f32,f32,s32);
+extern void cur_obj_get_dropped(void);
+extern void cur_obj_set_model(s32);
// extern ? mario_set_flag(?);
-s32 obj_clear_interact_status_flag(s32);
-extern void mark_object_for_deletion(struct Object *);
-void obj_disable(void);
-extern void obj_become_intangible(void);
-extern void obj_become_tangible(void);
-void make_object_tangible(struct Object*);
-void obj_update_floor_height(void);
-struct Surface* obj_update_floor_height_and_get_floor(void);
+s32 cur_obj_clear_interact_status_flag(s32);
+extern void obj_mark_for_deletion(struct Object *);
+void cur_obj_disable(void);
+extern void cur_obj_become_intangible(void);
+extern void cur_obj_become_tangible(void);
+extern void obj_become_tangible(struct Object*);
+void cur_obj_update_floor_height(void);
+struct Surface* cur_obj_update_floor_height_and_get_floor(void);
// extern ? apply_drag_to_value(?);
-void obj_apply_drag_xz(f32);
-// extern ? obj_move_xz(?);
-// extern ? obj_move_update_underwater_flags(?);
-// extern ? obj_move_update_ground_air_flags(?);
-// extern ? obj_move_y_and_get_water_level(?);
-void obj_move_y(f32,f32,f32);
+void cur_obj_apply_drag_xz(f32);
+// extern ? cur_obj_move_xz(?);
+// extern ? cur_obj_move_update_underwater_flags(?);
+// extern ? cur_obj_move_update_ground_air_flags(?);
+// extern ? cur_obj_move_y_and_get_water_level(?);
+void cur_obj_move_y(f32,f32,f32);
// extern ? clear_move_flag(?);
-// extern ? obj_unused_resolve_wall_collisions(?);
+// extern ? cur_obj_unused_resolve_wall_collisions(?);
extern s16 abs_angle_diff(s16, s16);
-extern void obj_move_xz_using_fvel_and_yaw(void);
-extern void obj_move_y_with_terminal_vel(void);
-void obj_compute_vel_xz(void);
-f32 func_802A0BF4(f32,f32,f32,f32);
-extern s32 are_objects_collided(struct Object *, struct Object *);
-void obj_set_behavior(const BehaviorScript *);
-void set_object_behavior(struct Object *, const BehaviorScript *);
-extern s32 obj_has_behavior(const BehaviorScript *);
-s32 object_has_behavior(struct Object *, const BehaviorScript *);
-f32 obj_lateral_dist_from_mario_to_home(void);
-extern f32 obj_lateral_dist_to_home(void);
+extern void cur_obj_move_xz_using_fvel_and_yaw(void);
+extern void cur_obj_move_y_with_terminal_vel(void);
+void cur_obj_compute_vel_xz(void);
+f32 increment_velocity_toward_range(f32,f32,f32,f32);
+extern s32 obj_check_if_collided_with_object(struct Object *, struct Object *);
+void cur_obj_set_behavior(const BehaviorScript *);
+void obj_set_behavior(struct Object *, const BehaviorScript *);
+extern s32 cur_obj_has_behavior(const BehaviorScript *);
+s32 obj_has_behavior(struct Object *, const BehaviorScript *);
+f32 cur_obj_lateral_dist_from_mario_to_home(void);
+extern f32 cur_obj_lateral_dist_to_home(void);
// extern ? obj_outside_home_square(?);
// extern ? obj_outside_home_rectangle(?);
-extern void obj_set_pos_to_home(void);
-void obj_set_pos_to_home_and_stop(void);
-extern void obj_shake_y(f32);
-void obj_start_cam_event(struct Object *obj, s32 cameraEvent);
-// extern ? Unknown802A11E4(?);
+extern void cur_obj_set_pos_to_home(void);
+void cur_obj_set_pos_to_home_and_stop(void);
+extern void cur_obj_shake_y(f32);
+void cur_obj_start_cam_event(struct Object *obj, s32 cameraEvent);
+// extern ? set_mario_interact_hoot_if_in_range(?);
void obj_set_billboard(struct Object *a0);
-void obj_set_hitbox_radius_and_height(f32,f32);
-void obj_set_hurtbox_radius_and_height(f32,f32);
-// extern ? spawn_object_loot_coins(?);
-// extern ? spawn_object_loot_blue_coins(?);
-extern void spawn_object_loot_yellow_coins(struct Object *, s32, f32);
-void obj_spawn_loot_coin_at_mario_pos(void);
+void cur_obj_set_hitbox_radius_and_height(f32,f32);
+void cur_obj_set_hurtbox_radius_and_height(f32,f32);
+// extern ? obj_spawn_loot_coins(?);
+// extern ? obj_spawn_loot_blue_coins(?);
+extern void obj_spawn_loot_yellow_coins(struct Object *, s32, f32);
+void cur_obj_spawn_loot_coin_at_mario_pos(void);
// extern ? obj_abs_y_dist_to_home(?);
-// extern ? Unknown802A1548(?);
+// extern ? cur_obj_advance_looping_anim(?);
// extern ? obj_detect_steep_floor(?);
-s32 obj_resolve_wall_collisions(void);
+s32 cur_obj_resolve_wall_collisions(void);
// extern ? obj_update_floor(?);
// extern ? obj_update_floor_and_resolve_wall_collisions(?);
-extern void obj_update_floor_and_walls(void);
-extern void obj_move_standard(s16);
+extern void cur_obj_update_floor_and_walls(void);
+extern void cur_obj_move_standard(s16);
// extern ? obj_within_12k_bounds(?);
-void obj_move_using_vel_and_gravity(void);
-void obj_move_using_fvel_and_gravity(void);
+void cur_obj_move_using_vel_and_gravity(void);
+void cur_obj_move_using_fvel_and_gravity(void);
// extern ? set_object_pos_relative(?);
-s16 obj_angle_to_home(void);
-void func_802A2008(struct Object*,struct Object*);
-extern void translate_object_local(struct Object*,s16,s16);
-extern void build_object_transform_from_pos_and_angle(struct Object *, s16, s16);
-extern void func_802A2270(struct Object *);
-extern void build_object_transform_relative_to_parent(struct Object *);
-// extern ? Unknown802A2380(?);
+s16 cur_obj_angle_to_home(void);
+void obj_set_gfx_pos_at_obj_pos(struct Object*,struct Object*);
+extern void obj_translate_local(struct Object*,s16,s16);
+extern void obj_build_transform_from_pos_and_angle(struct Object *, s16, s16);
+extern void obj_set_throw_matrix_from_transform(struct Object *);
+extern void obj_build_transform_relative_to_parent(struct Object *);
+// extern ? obj_create_transform_from_self(?);
// extern ? obj_rotate_move_angle_using_vel(?);
-void obj_rotate_face_angle_using_vel(void);
+void cur_obj_rotate_face_angle_using_vel(void);
// extern ? obj_set_face_angle_to_move_angle(?);
-extern s32 obj_follow_path(UNUSED s32);
+extern s32 cur_obj_follow_path(UNUSED s32);
extern void chain_segment_init(struct ChainSegment *);
extern f32 random_f32_around_zero(f32);
-void scale_object_random(struct Object*,f32,f32);
-extern void translate_object_xyz_random(struct Object *, f32);
-extern void translate_object_xz_random(struct Object *, f32);
-// extern ? func_802A297C(?);
-void func_802A2A38(void);
-void obj_spawn_particles(struct SpawnParticlesInfo *sp28);
-extern s16 obj_reflect_move_angle_off_wall(void);
+void obj_scale_random(struct Object*,f32,f32);
+extern void obj_translate_xyz_random(struct Object *, f32);
+extern void obj_translate_xz_random(struct Object *, f32);
+// extern ? obj_build_vel_from_transform(?);
+void cur_obj_set_pos_via_transform(void);
+void cur_obj_spawn_particles(struct SpawnParticlesInfo *sp28);
+extern s16 cur_obj_reflect_move_angle_off_wall(void);
#endif /* OBJECT_HELPERS_H */
diff --git a/src/game/object_helpers2.h b/src/game/object_helpers2.h
@@ -24,71 +24,71 @@ struct GraphNode_802A45E4 {
/*0x22*/ s16 unk22;
};
-extern void set_object_hitbox(struct Object* obj, struct ObjectHitbox *arg1);
+extern void obj_set_hitbox(struct Object* obj, struct ObjectHitbox *arg1);
s32 signum_positive(s32);
extern f32 absf(f32);
extern s32 absi(s32 a0);
-s32 obj_wait_then_blink(s32 a0, s32 a1);
-s32 obj_is_mario_ground_pounding_platform(void);
-extern void func_802A3004(void);
-extern void func_802A3034(s32 sp18);
-void obj_push_mario_away(f32);
-void obj_push_mario_away_from_cylinder(f32 sp20, f32 sp24);
-// extern ? BehDustSmokeLoop(?);
-s32 func_802A32A4(s8*);
-s32 func_802A32E0(void);
-// extern ? nop_802A3380(?);
-extern void func_802A3398(s32,s32,f32,f32);
-void func_802A3470(void);
-extern s32 obj_is_mario_on_platform(void);
+s32 cur_obj_wait_then_blink(s32 a0, s32 a1);
+s32 cur_obj_is_mario_ground_pounding_platform(void);
+extern void spawn_mist_particles(void);
+extern void spawn_mist_particles_with_sound(s32 sp18);
+void cur_obj_push_mario_away(f32);
+void cur_obj_push_mario_away_from_cylinder(f32 sp20, f32 sp24);
+// extern ? bhv_dust_smoke_loop(?);
+s32 cur_obj_set_direction_table(s8*);
+s32 cur_obj_progress_direction_table(void);
+// extern ? stub_obj_helpers_3(?);
+extern void cur_obj_scale_over_time(s32,s32,f32,f32);
+void cur_obj_set_pos_to_home_with_debug(void);
+extern s32 cur_obj_is_mario_on_platform(void);
// extern ? obj_shake_y_until(?);
-s32 func_802A362C(s32);
-void obj_call_action_function(void(*[])(void));
-// extern ? func_802A36D8(?);
-// extern ? Unknown802A3750(?);
-s32 func_802A377C(s32);
-s32 obj_mario_far_away(void);
-s32 obj_is_mario_moving_fast_or_in_air(s32);
-s32 item_in_array(s8,s8*);
+s32 cur_obj_move_up_and_down(s32);
+void cur_obj_call_action_function(void(*[])(void));
+// extern ? spawn_star_with_no_lvl_exit(?);
+// extern ? spawn_base_star_with_no_lvl_exit(?);
+s32 bit_shift_left(s32);
+s32 cur_obj_mario_far_away(void);
+s32 is_mario_moving_fast_or_in_air(s32);
+s32 is_item_in_array(s8,s8*);
extern void bhv_init_room(void); // 802A3978
-extern void obj_enable_rendering_if_mario_in_room(void);
-s32 obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox*,s32,s32);
-void func_802A3C98(f32 sp18, s32 sp1C);
-void set_object_collision_data(struct Object*, const void*);
-void obj_if_hit_wall_bounce_away(void);
-s32 obj_hide_if_mario_far_away_y(f32);
-extern Gfx *Geo18_802A45E4(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]);
-// extern ? Unknown802A3E84(?);
+extern void cur_obj_enable_rendering_if_mario_in_room(void);
+s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox*,s32,s32);
+void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C);
+void obj_set_collision_data(struct Object*, const void*);
+void cur_obj_if_hit_wall_bounce_away(void);
+s32 cur_obj_hide_if_mario_far_away_y(f32);
+extern Gfx *geo_offset_klepto_held_object(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]);
+// extern ? geo_offset_klepto_debug(?);
s32 obj_is_hidden(struct Object*);
extern void enable_time_stop(void);
extern void disable_time_stop(void);
void set_time_stop_flags(s32);
void clear_time_stop_flags(s32);
-s32 func_802A3FF8(f32,f32,s32);
-extern s32 obj_is_mario_in_range_and_ready_to_speak(f32 sp18, f32 sp1C);
+s32 cur_obj_can_mario_activate_textbox(f32,f32,s32);
+extern s32 cur_obj_can_mario_activate_textbox_2(f32 sp18, f32 sp1C);
// extern ? obj_end_dialog(?);
-s32 obj_update_dialog(s32 arg0, s32 dialogFlags, s32 dialogID, s32 unused);
-s32 obj_update_dialog_with_cutscene(s32 arg0, s32 dialogFlags, s32 cutsceneTable, s32 dialogID);
-s32 obj_has_model(u16);
-extern void obj_align_gfx_with_floor(void);
+s32 cur_obj_update_dialog(s32 arg0, s32 dialogFlags, s32 dialogID, s32 unused);
+s32 cur_obj_update_dialog_with_cutscene(s32 arg0, s32 dialogFlags, s32 cutsceneTable, s32 dialogID);
+s32 cur_obj_has_model(u16);
+extern void cur_obj_align_gfx_with_floor(void);
// extern ? mario_is_within_rectangle(?);
-void ShakeScreen(s32 shake);
-extern s32 attack_collided_non_mario_object(struct Object *obj);
-s32 obj_was_attacked_or_ground_pounded(void);
-void copy_object_behavior_params(struct Object*,struct Object*);
-void func_802A4A70(s32,s32);
-s32 func_802A4AB0(s32);
-void func_802A4AEC(s32);
-s32 obj_check_grabbed_mario(void);
+void cur_obj_shake_screen(s32 shake);
+extern s32 obj_attack_collided_from_other_object(struct Object *obj);
+s32 cur_obj_was_attacked_or_ground_pounded(void);
+void obj_copy_behavior_params(struct Object*,struct Object*);
+void cur_obj_init_animation_and_anim_frame(s32,s32);
+s32 cur_obj_init_animation_and_check_if_near_end(s32);
+void cur_obj_init_animation_and_extend_if_at_end(s32);
+s32 cur_obj_check_grabbed_mario(void);
s32 player_performed_grab_escape_action(void);
-// extern ? obj_unused_play_footstep_sound(?);
+// extern ? cur_obj_unused_play_footstep_sound(?);
// extern ? enable_time_stop_including_mario(?);
extern void disable_time_stop_including_mario(void);
-s32 obj_check_interacted(void);
-void obj_spawn_loot_blue_coin(void);
+s32 cur_obj_check_interacted(void);
+void cur_obj_spawn_loot_blue_coin(void);
#ifndef VERSION_JP
-void obj_spawn_star_at_y_offset(f32 f12, f32 f14, f32 a2, f32 a3);
+void cur_obj_spawn_star_at_y_offset(f32 f12, f32 f14, f32 a2, f32 a3);
#endif
#endif /* OBJECT_HELPERS2_H */
diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c
@@ -196,24 +196,24 @@ struct ParticleProperties {
* A table mapping particle flags to various properties use when spawning a particle.
*/
struct ParticleProperties sParticleTypes[] = {
- { PARTICLE_DUST, ACTIVE_PARTICLE_0, MODEL_MIST, bhvMarioDustGenerator },
- { PARTICLE_1, ACTIVE_PARTICLE_18, MODEL_NONE, bhvWallTinyStarParticleSpawn },
- { PARTICLE_4, ACTIVE_PARTICLE_4, MODEL_NONE, bhvPoundTinyStarParticleSpawn },
- { PARTICLE_SPARKLES, ACTIVE_PARTICLE_3, MODEL_SPARKLES, bhvSpecialTripleJumpSparkles },
- { PARTICLE_5, ACTIVE_PARTICLE_5, MODEL_BUBBLE, bhvBubbleMario },
- { PARTICLE_6, ACTIVE_PARTICLE_6, MODEL_WATER_SPLASH, bhvWaterSplash },
- { PARTICLE_7, ACTIVE_PARTICLE_7, MODEL_WATER_WAVES_SURF, bhvSurfaceWaves },
- { PARTICLE_9, ACTIVE_PARTICLE_9, MODEL_WHITE_PARTICLE_SMALL, bhvWaterWaves },
- { PARTICLE_10, ACTIVE_PARTICLE_10, MODEL_WATER_WAVES, bhvWaveTrailOnSurface },
- { PARTICLE_11, ACTIVE_PARTICLE_11, MODEL_RED_FLAME, bhvFlameMario },
- { PARTICLE_8, ACTIVE_PARTICLE_8, MODEL_NONE, bhvWavesGenerator },
- { PARTICLE_12, ACTIVE_PARTICLE_12, MODEL_NONE, bhvSurfaceWaveShrinking },
- { PARTICLE_LEAVES, ACTIVE_PARTICLE_13, MODEL_NONE, bhvSnowLeafParticleSpawn },
- { PARTICLE_14, ACTIVE_PARTICLE_16, MODEL_NONE, bhvGroundSnow },
- { PARTICLE_17, ACTIVE_PARTICLE_17, MODEL_NONE, bhvWaterMistSpawn },
- { PARTICLE_15, ACTIVE_PARTICLE_14, MODEL_NONE, bhvGroundSand },
- { PARTICLE_16, ACTIVE_PARTICLE_15, MODEL_NONE, bhvPoundWhitePuffs },
- { PARTICLE_18, ACTIVE_PARTICLE_19, MODEL_NONE, bhvPunchTinyTriangleSpawn },
+ { PARTICLE_DUST, ACTIVE_PARTICLE_0, MODEL_MIST, bhvMarioDustGenerator },
+ { PARTICLE_1, ACTIVE_PARTICLE_18, MODEL_NONE, bhvWallTinyStarParticleSpawn },
+ { PARTICLE_4, ACTIVE_PARTICLE_4, MODEL_NONE, bhvPoundTinyStarParticleSpawn },
+ { PARTICLE_SPARKLES, ACTIVE_PARTICLE_3, MODEL_SPARKLES, bhvSpecialTripleJumpSparkles },
+ { PARTICLE_5, ACTIVE_PARTICLE_5, MODEL_BUBBLE, bhvBubbleMario },
+ { PARTICLE_WATER_SPLASH, ACTIVE_PARTICLE_6, MODEL_WATER_SPLASH, bhvWaterSplash },
+ { PARTICLE_IDLE_WATER_WAVE, ACTIVE_PARTICLE_IDLE_WATER_WAVE, MODEL_IDLE_WATER_WAVE, bhvIdleWaterWave },
+ { PARTICLE_9, ACTIVE_PARTICLE_9, MODEL_WHITE_PARTICLE_SMALL, bhvWaterWaves },
+ { PARTICLE_WAVE_TRAIL, ACTIVE_PARTICLE_WAVE_TRAIL, MODEL_WAVE_TRAIL, bhvWaveTrail },
+ { PARTICLE_11, ACTIVE_PARTICLE_11, MODEL_RED_FLAME, bhvFlameMario },
+ { PARTICLE_SHALLOW_WATER_WAVE, ACTIVE_PARTICLE_SHALLOW_WATER_WAVE, MODEL_NONE, bhvShallowWaterWave },
+ { PARTICLE_SHALLOW_WATER_SPLASH, ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH, MODEL_NONE, bhvShallowWaterSplash },
+ { PARTICLE_LEAVES, ACTIVE_PARTICLE_13, MODEL_NONE, bhvSnowLeafParticleSpawn },
+ { PARTICLE_14, ACTIVE_PARTICLE_16, MODEL_NONE, bhvGroundSnow },
+ { PARTICLE_17, ACTIVE_PARTICLE_17, MODEL_NONE, bhvWaterMistSpawn },
+ { PARTICLE_15, ACTIVE_PARTICLE_14, MODEL_NONE, bhvGroundSand },
+ { PARTICLE_16, ACTIVE_PARTICLE_15, MODEL_NONE, bhvPoundWhitePuffs },
+ { PARTICLE_18, ACTIVE_PARTICLE_19, MODEL_NONE, bhvPunchTinyTriangleSpawn },
{ 0, 0, MODEL_NONE, NULL },
};
@@ -257,7 +257,7 @@ void spawn_particle(u32 activeParticleFlag, s16 model, const BehaviorScript *beh
struct Object *particle;
gCurrentObject->oActiveParticleFlags |= activeParticleFlag;
particle = spawn_object_at_origin(gCurrentObject, 0, model, behavior);
- copy_object_pos_and_angle(particle, gCurrentObject);
+ obj_copy_pos_and_angle(particle, gCurrentObject);
}
}
@@ -519,7 +519,7 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) {
}
}
-void stub_8029CA50() {
+void stub_obj_list_processor_1() {
}
/**
@@ -545,7 +545,7 @@ void clear_objects(void) {
clear_object_lists(gObjectListArray);
stub_80385BF0();
- stub_8029CA50();
+ stub_obj_list_processor_1();
for (i = 0; i < OBJECT_POOL_CAPACITY; i++) {
gObjectPool[i].activeFlags = ACTIVE_FLAGS_DEACTIVATED;
@@ -636,7 +636,7 @@ void update_objects(UNUSED s32 unused) {
gCheckingSurfaceCollisionsForCamera = FALSE;
reset_debug_objectinfo();
- stub_802CA5D0();
+ stub_debug_5();
gObjectLists = gObjectListArray;
diff --git a/src/game/paintings.c b/src/game/paintings.c
@@ -12,103 +12,259 @@
#include "segment2.h"
#include "paintings.h"
+/**
+ * @file paintings.c
+ *
+ * Implements the rippling painting effect. Paintings are GraphNodes that exist without being connected
+ * to any particular object.
+ *
+ * Paintings are defined in level data. Look at levels/castle_inside/painting.inc.c for examples.
+ *
+ * The ripple effect uses data that is split into several parts:
+ * The mesh positions are generated from a base mesh. See seg2_painting_triangle_mesh near the
+ * bottom of bin/segment2.c
+ *
+ * The lighting for the ripple is also generated from a base table, seg2_painting_mesh_neighbor_tris
+ * in bin/segment2.c
+ *
+ * Each painting's texture uses yet another table to map its texture to the mesh.
+ * These maps are in level data, see levels/castle_inside/painting.inc.c for example.
+ *
+ * Finally, each painting has two display lists, normal and rippling, which are defined in the same
+ * level data file as the Painting itself. See levels/castle_inside/painting.inc.c.
+ *
+ *
+ * Painting state machine:
+ * Paintings spawn in the PAINTING_IDLE state
+ * From IDLE, paintings can change to PAINTING_RIPPLE or PAINTING_ENTERED
+ * - This state checks for ENTERED because if mario waits long enough, a PROXIMITY painting could
+ * reset to IDLE
+ *
+ * Paintings in the PAINTING_RIPPLE state are passively rippling.
+ * For RIPPLE_TRIGGER_PROXIMITY paintings, this means mario bumped the wall in front of the
+ * painting.
+ *
+ * Paintings that use RIPPLE_TRIGGER_CONTINUOUS try to transition to this state as soon as possible,
+ * usually when mario enters the room.
+ *
+ * A PROXIMITY painting will automatically reset to IDLE if its ripple magnitude becomes small
+ * enough.
+ *
+ * Paintings in the PAINTING_ENTERED state have been entered by mario.
+ * A CONTINUOUS painting will automatically reset to RIPPLE if its ripple magnitude becomes small
+ * enough.
+ */
+
+/**
+ * Triggers a passive ripple on the left side of the painting.
+ */
+#define RIPPLE_LEFT 0x20
+
+/**
+ * Triggers a passive ripple in the middle the painting.
+ */
+#define RIPPLE_MIDDLE 0x10
+
+/**
+ * Triggers a passive ripple on the right side of the painting.
+ */
+#define RIPPLE_RIGHT 0x8
+
+/**
+ * Triggers an entry ripple on the left side of the painting.
+ */
+#define ENTER_LEFT 0x4
+
+/**
+ * Triggers an entry ripple in the middle of the painting.
+ */
+#define ENTER_MIDDLE 0x2
+
+/**
+ * Triggers an entry ripple on the right side of the painting.
+ */
+#define ENTER_RIGHT 0x1
+
+/**
+ * Use the 1/4th part of the painting that is nearest to mario's current floor.
+ */
+#define NEAREST_4TH 30
+
+/**
+ * Use mario's relative x position.
+ * @see painting_mario_x
+ */
+#define MARIO_X 40
+
+/**
+ * Use the x center of the painting.
+ */
+#define MIDDLE_X 50
+
+/**
+ * Use mario's relative y position.
+ * @see painting_mario_y
+ */
+#define MARIO_Y 60
+
+/**
+ * Use mario's relative z position.
+ * @see painting_mario_z
+ */
+#define MARIO_Z 70
+
+/**
+ * Use the y center of the painting.
+ */
+#define MIDDLE_Y 80
+
+/**
+ * Does nothing to the timer.
+ * Why -56 instead of false? Who knows.
+ */
+#define DONT_RESET -56
+
+/**
+ * Reset the timer to 0.
+ */
+#define RESET_TIMER 100
+
+/// A copy of the type of floor mario is standing on.
s16 gPaintingMarioFloorType;
-float gPaintingMarioXPos, gPaintingMarioYPos, gPaintingMarioZPos;
-struct Thing *D_8035FFA0;
-Vec3f *D_8035FFA4;
-struct Painting *ripplingPainting;
-s8 dddStatus;
-
-struct Painting *hmcPaintings[] = {
+// A copy of mario's position
+f32 gPaintingMarioXPos, gPaintingMarioYPos, gPaintingMarioZPos;
+
+/**
+ * When a painting is rippling, this mesh is generated each frame using the Painting's parameters.
+ *
+ * This mesh only contains the vertex positions and normals.
+ * Paintings use an additional array to map textures to the mesh.
+ */
+struct PaintingMeshVertex *gPaintingMesh;
+
+/**
+ * The painting's surface normals, used to approximate each of the vertex normals (for gouraud shading).
+ */
+Vec3f *gPaintingTriNorms;
+
+/**
+ * The painting that is currently rippling. Only one painting can be rippling at once.
+ */
+struct Painting *gRipplingPainting;
+
+/**
+ * Whether the DDD painting is moved forward, should being moving backwards, or has already moved backwards.
+ */
+s8 gDddPaintingStatus;
+
+struct Painting *sHmcPaintings[] = {
&cotmc_painting,
NULL,
};
-struct Painting *insideCastlePaintings[] = {
+struct Painting *sInsideCastlePaintings[] = {
&bob_painting, &ccm_painting, &wf_painting, &jrb_painting, &lll_painting,
&ssl_painting, &hmc_painting, &ddd_painting, &wdw_painting, &thi_tiny_painting,
&ttm_painting, &ttc_painting, &sl_painting, &thi_huge_painting, NULL,
};
-struct Painting *ttmPaintings[] = {
+struct Painting *sTtmPaintings[] = {
&ttm_slide_painting,
NULL,
};
-struct Painting **paintingGroups[] = {
- hmcPaintings,
- insideCastlePaintings,
- ttmPaintings,
+struct Painting **sPaintingGroups[] = {
+ sHmcPaintings,
+ sInsideCastlePaintings,
+ sTtmPaintings,
};
s16 gPaintingUpdateCounter = 1;
s16 gLastPaintingUpdateCounter = 0;
-void stopAllRippleExcept(s16 *idptr, struct Painting *paintingGroup[]) {
+/**
+ * Stop paintings in paintingGroup from rippling if their id is different from *idptr.
+ */
+void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) {
s16 index;
s16 id = *idptr;
index = 0;
- while (paintingGroup[index] != NULL) // for each painting
- {
+ while (paintingGroup[index] != NULL) {
struct Painting *painting = segmented_to_virtual(paintingGroup[index]);
+
+ // stop all rippling except for the selected painting
if (painting->id != id) {
- painting->rippleStatus = 0; // stop all rippling except for the selected painting
+ painting->state = 0;
}
index++;
}
}
-float find_mario_y_position_on_painting(struct Painting *painting) {
- //! unnecessary use of double constants
- float marioYOffsetFromPainting = gPaintingMarioYPos - painting->vYPos + 50.0;
-
- if (marioYOffsetFromPainting < 0.0) {
- marioYOffsetFromPainting = 0.0; // If Mario is below the bottom, return the bottom
- } else if (marioYOffsetFromPainting
- > painting->vSize) { // If Mario is above the top, return the top
- marioYOffsetFromPainting = painting->vSize;
+/**
+ * @return mario's y position inside the painting (bounded).
+ */
+f32 painting_mario_y(struct Painting *painting) {
+ //! Unnecessary use of double constants
+ // Add 50 to make the ripple closer to mario's center of mass.
+ f32 relY = gPaintingMarioYPos - painting->posY + 50.0;
+
+ if (relY < 0.0) {
+ relY = 0.0;
+ } else if (relY > painting->size) {
+ relY = painting->size;
}
- return marioYOffsetFromPainting;
+ return relY;
}
-float find_mario_z_position_on_painting(struct Painting *painting) {
- float marioZOffsetFromPainting = painting->vZPos - gPaintingMarioZPos;
+/**
+ * @return mario's z position inside the painting (bounded).
+ */
+f32 painting_mario_z(struct Painting *painting) {
+ f32 relZ = painting->posZ - gPaintingMarioZPos;
- if (marioZOffsetFromPainting < 0.0) {
- marioZOffsetFromPainting = 0.0; // If Mario is past the left side, return the left side
- } else if (marioZOffsetFromPainting > painting->vSize) {
- marioZOffsetFromPainting =
- painting->vSize; // If Mario is past the right side, return the right side
+ if (relZ < 0.0) {
+ relZ = 0.0;
+ } else if (relZ > painting->size) {
+ relZ = painting->size;
}
- return marioZOffsetFromPainting;
+ return relZ;
}
-float painting_find_vertical_ripple_location(struct Painting *painting, s8 rippleSpot) {
- switch (rippleSpot) {
+/**
+ * @return The y origin for the ripple, based on ySource.
+ * For floor paintings, the z-axis is treated as y.
+ */
+f32 painting_ripple_y(struct Painting *painting, s8 ySource) {
+ switch (ySource) {
case MARIO_Y:
- return find_mario_y_position_on_painting(painting); // normal vertical paintings
+ return painting_mario_y(painting); // normal wall paintings
break;
case MARIO_Z:
- return find_mario_z_position_on_painting(painting); // horizontal paintings use X and Z
+ return painting_mario_z(painting); // floor paintings use X and Z
break;
case MIDDLE_Y:
- return painting->vSize / 2.0; // some concentric ripples don't care about Mario
+ return painting->size / 2.0; // some concentric ripples don't care about Mario
break;
}
}
-float find_part_of_painting_near_mario(struct Painting *painting) {
- float firstQuarter = painting->vSize / 4.0; // 1/4 of the way across the painting
- float secondQuarter = painting->vSize / 2.0; // 1/2 of the way across the painting
- float thirdQuarter = painting->vSize * 3.0 / 4.0; // 3/4 of the way across the painting
+/**
+ * Return the quarter of the painting that is closest to the floor mario entered.
+ */
+f32 painting_nearest_4th(struct Painting *painting) {
+ f32 firstQuarter = painting->size / 4.0; // 1/4 of the way across the painting
+ f32 secondQuarter = painting->size / 2.0; // 1/2 of the way across the painting
+ f32 thirdQuarter = painting->size * 3.0 / 4.0; // 3/4 of the way across the painting
- if (painting->floorEntered & STAND_LEFT) {
+ if (painting->floorEntered & RIPPLE_LEFT) {
return firstQuarter;
- } else if (painting->floorEntered & STAND_MIDDLE) {
+ } else if (painting->floorEntered & RIPPLE_MIDDLE) {
return secondQuarter;
- } else if (painting->floorEntered & STAND_RIGHT) {
+ } else if (painting->floorEntered & RIPPLE_RIGHT) {
return thirdQuarter;
+
+ // Same as ripple floors.
} else if (painting->floorEntered & ENTER_LEFT) {
return firstQuarter;
} else if (painting->floorEntered & ENTER_MIDDLE) {
@@ -118,718 +274,855 @@ float find_part_of_painting_near_mario(struct Painting *painting) {
}
}
-float find_mario_x_position_on_painting(struct Painting *painting) {
- float mario_x_offset_from_painting = gPaintingMarioXPos - painting->vXPos;
+/**
+ * @return mario's x position inside the painting (bounded).
+ */
+f32 painting_mario_x(struct Painting *painting) {
+ f32 relX = gPaintingMarioXPos - painting->posX;
- if (mario_x_offset_from_painting < 0.0) {
- mario_x_offset_from_painting = 0.0; // If Mario is past the left side, return the left side
- } else if (mario_x_offset_from_painting > painting->vSize) {
- mario_x_offset_from_painting =
- painting->vSize; // If Mario is past the right side, return the right side
+ if (relX < 0.0) {
+ relX = 0.0;
+ } else if (relX > painting->size) {
+ relX = painting->size;
}
- return mario_x_offset_from_painting;
+ return relX;
}
-float painting_find_horizontal_ripple_location(struct Painting *painting, s8 rippleSpot) {
- switch (rippleSpot) {
- case NEAR_MARIO_LATERALLY: // normal vertical paintings
- return find_part_of_painting_near_mario(painting);
+/**
+ * @return The x origin for the ripple, based on xSource.
+ */
+f32 painting_ripple_x(struct Painting *painting, s8 xSource) {
+ switch (xSource) {
+ case NEAREST_4TH: // normal wall paintings
+ return painting_nearest_4th(painting);
break;
case MARIO_X: // horizontally placed paintings use X and Z
- return find_mario_x_position_on_painting(painting);
+ return painting_mario_x(painting);
break;
case MIDDLE_X: // concentric rippling may not care about Mario
- return painting->vSize / 2.0;
+ return painting->size / 2.0;
break;
}
}
-void painting_set_ripple_type(s8 intendedStatus, struct Painting *painting,
- struct Painting *paintingGroup[], s8 hRippleSpot, s8 vRippleSpot,
- s8 resetTimer) {
- stopAllRippleExcept(&painting->id, paintingGroup); // make sure no other paintings are rippling
- switch (intendedStatus) // set the variables necessary for the given ripple status
- {
- case RIPPLE_STATE_IDLE:
- painting->currRippleMag = painting->passiveRippleMag;
- painting->rippleMagMultiplier = painting->passiveRippleMagMultiplier;
- painting->currRippleRate = painting->passiveRippleRate;
+/**
+ * Set the painting's state, causing it to start a passive ripple or a ripple from mario entering.
+ *
+ * @param state The state to enter
+ * @param painting,paintingGroup identifies the painting that is changing state
+ * @param xSource,ySource what to use for the x and y origin of the ripple
+ * @param resetTimer if 100, set the timer to 0
+ */
+void painting_state(s8 state, struct Painting *painting, struct Painting *paintingGroup[],
+ s8 xSource, s8 ySource, s8 resetTimer) {
+ // make sure no other paintings are rippling
+ stop_other_paintings(&painting->id, paintingGroup);
+
+ // use a different set of variables depending on the state
+ switch (state) {
+ case PAINTING_RIPPLE:
+ painting->currRippleMag = painting->passiveRippleMag;
+ painting->rippleDecay = painting->passiveRippleDecay;
+ painting->currRippleRate = painting->passiveRippleRate;
painting->dispersionFactor = painting->passiveDispersionFactor;
break;
- case RIPPLE_STATE_ENTRY:
- painting->currRippleMag = painting->entryRippleMag;
- painting->rippleMagMultiplier = painting->entryRippleMagMultiplier;
- painting->currRippleRate = painting->entryRippleRate;
+
+ case PAINTING_ENTERED:
+ painting->currRippleMag = painting->entryRippleMag;
+ painting->rippleDecay = painting->entryRippleDecay;
+ painting->currRippleRate = painting->entryRippleRate;
painting->dispersionFactor = painting->entryDispersionFactor;
break;
}
- painting->rippleStatus = intendedStatus;
- painting->horizontalRippleSpot =
- painting_find_horizontal_ripple_location(painting, hRippleSpot); // find the ripple location
- painting->verticalRippleSpot = painting_find_vertical_ripple_location(painting, vRippleSpot);
+ painting->state = state;
+ painting->rippleX = painting_ripple_x(painting, xSource);
+ painting->rippleY = painting_ripple_y(painting, ySource);
gPaintingMarioYEntry = gPaintingMarioYPos;
+
+ // Because true or false would be too simple...
if (resetTimer == RESET_TIMER) {
painting->rippleTimer = 0.0f;
}
- ripplingPainting = painting;
-}
-
-void vertical_proximity_ripple_painting_ripple(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned vertically that follow RIPPLE_TRIGGER_PROXIMITY, set
- // some flags depending on where Mario is
-{
- if (painting->floorEntered & STAND_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
- } else if (painting->floorEntered & STAND_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
- } else if (painting->floorEntered & STAND_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ gRipplingPainting = painting;
+}
+
+/**
+ * Idle update function for wall paintings that use RIPPLE_TRIGGER_PROXIMITY.
+ */
+void wall_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) {
+ // Check for mario triggering a ripple
+ if (painting->floorEntered & RIPPLE_LEFT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_MIDDLE) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_RIGHT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
+
+ // Check for mario entering
} else if (painting->floorEntered & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
}
}
-void vertical_proximity_ripple_painting_ripple_if_mario_enters(
- struct Painting *painting,
- struct Painting *paintingGroup[]) // For paintings aligned vertically that follow
- // RIPPLE_TRIGGER_PROXIMITY, set some flags if Mario enters
-{
+/**
+ * Rippling update function for wall paintings that use RIPPLE_TRIGGER_PROXIMITY.
+ */
+void wall_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) {
if (painting->floorEntered & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
- }
-}
-
-void vertical_continuous_ripple_painting_ripple(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned vertically that follow RIPPLE_TRIGGER_CONTINUOUS (DDD
- // only), set some flags depending on where Mario is
-{
- if (painting->floorEntered & STAND_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
+ }
+}
+
+/**
+ * Idle update function for wall paintings that use RIPPLE_TRIGGER_CONTINUOUS.
+ */
+void wall_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) {
+ // Check for mario triggering a ripple
+ if (painting->floorEntered & RIPPLE_LEFT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_MIDDLE) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_RIGHT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+
+ // Check for mario entering
} else if (painting->floorEntered & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
} else if (painting->floorEntered & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER);
}
}
-void vertical_continuous_ripple_painting_ripple_if_mario_enters(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned vertically that follow RIPPLE_TRIGGER_CONTINUOUS (DDD
- // only), set some flags if Mario enters
-{
+/**
+ * Rippling update function for wall paintings that use RIPPLE_TRIGGER_CONTINUOUS.
+ */
+void wall_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) {
if (painting->floorEntered & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, DONT_RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET);
} else if (painting->floorEntered & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, DONT_RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET);
} else if (painting->floorEntered & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, NEAR_MARIO_LATERALLY,
- MARIO_Y, DONT_RESET_TIMER);
- }
-}
-
-void horizontal_proximity_ripple_painting_ripple(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned horizontally that follow RIPPLE_TRIGGER_PROXIMITY
- // (these are not found in-game), set some flags depending on where Mario is
-{
- if (painting->floorEntered & STAND_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
- } else if (painting->marioNewlyUnderPainting) {
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET);
+ }
+}
+
+/**
+ * Idle update function for floor paintings that use RIPPLE_TRIGGER_PROXIMITY.
+ *
+ * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game.
+ */
+void floor_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) {
+ // Check for mario triggering a ripple
+ if (painting->floorEntered & RIPPLE_LEFT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_MIDDLE) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_RIGHT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
+
+ // Only check for mario entering if he jumped below the surface
+ } else if (painting->marioWentUnder) {
if (painting->currFloor & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
}
}
}
-void horizontal_proximity_ripple_painting_ripple_if_mario_enters(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned horizontally that follow RIPPLE_TRIGGER_PROXIMITY
- // (these are not found in-game), set some flags if Mario enters
-{
- if (painting->marioNewlyUnderPainting) {
+/**
+ * Rippling update function for floor paintings that use RIPPLE_TRIGGER_PROXIMITY.
+ *
+ * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game.
+ */
+void floor_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) {
+ if (painting->marioWentUnder) {
if (painting->currFloor & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
}
}
}
-void horizontal_continuous_ripple_painting_ripple(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned horizontally that follow RIPPLE_TRIGGER_CONTINUOUS
- // (HMC and CotMC), set some flags depending on where Mario is
-{
- if (painting->floorEntered & STAND_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
- } else if (painting->floorEntered & STAND_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_IDLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y,
- RESET_TIMER);
+/**
+ * Idle update function for floor paintings that use RIPPLE_TRIGGER_CONTINUOUS.
+ *
+ * Both floor paintings (HMC and CotMC) are hidden behind a door, which hides the ripple's start up.
+ * The floor just inside the doorway is RIPPLE_LEFT, so the painting starts rippling as soon as mario
+ * enters the room.
+ */
+void floor_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) {
+ // Check for mario triggering a ripple
+ if (painting->floorEntered & RIPPLE_LEFT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_MIDDLE) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+ } else if (painting->floorEntered & RIPPLE_RIGHT) {
+ painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER);
+
+ // Check for mario entering
} else if (painting->currFloor & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
} else if (painting->currFloor & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER);
}
}
-void horizontal_continuous_ripple_painting_ripple_if_mario_enters(
- struct Painting *painting,
- struct Painting
- *paintingGroup[]) // For paintings aligned horizontally that follow RIPPLE_TRIGGER_CONTINUOUS
- // (HMC and CotMC), set some flags if Mario enters
-{
- if (painting->marioNewlyUnderPainting) {
+/**
+ * Rippling update function for floor paintings that use RIPPLE_TRIGGER_CONTINUOUS.
+ */
+void floor_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) {
+ if (painting->marioWentUnder) {
if (painting->currFloor & ENTER_LEFT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- DONT_RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET);
} else if (painting->currFloor & ENTER_MIDDLE) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- DONT_RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET);
} else if (painting->currFloor & ENTER_RIGHT) {
- painting_set_ripple_type(RIPPLE_STATE_ENTRY, painting, paintingGroup, MARIO_X, MARIO_Z,
- DONT_RESET_TIMER);
+ painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET);
}
}
}
+/**
+ * Check for mario entering one of the special floors associated with the painting.
+ */
void painting_update_floors(struct Painting *painting) {
s16 paintingId = painting->id;
- s8 leftSideStand = 0;
- s8 middleStand = 0;
- s8 rightSideStand = 0;
- s8 leftSideEnter = 0;
- s8 middleEnter = 0;
- s8 rightSideEnter = 0;
+ s8 rippleLeft = 0;
+ s8 rippleMiddle = 0;
+ s8 rippleRight = 0;
+ s8 enterLeft = 0;
+ s8 enterMiddle = 0;
+ s8 enterRight = 0;
/* The area in front of every painting in the game (except HMC and CotMC, which *\
|* act a little differently) is made up of 3 special floor triangles with special *|
|* (unique) surface types. This code checks which surface Mario is currently on *|
\* and sets a bitfield accordingly. */
- if (gPaintingMarioFloorType
- == paintingId * 3
- + SURFACE_PAINTING_WOBBLE_A6) { // check if Mario's current floor is one of the
- // special floors
- leftSideStand = STAND_LEFT;
+ // check if Mario's current floor is one of the special floors
+ if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A6) {
+ rippleLeft = RIPPLE_LEFT;
}
if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A7) {
- middleStand = STAND_MIDDLE;
+ rippleMiddle = RIPPLE_MIDDLE;
}
if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WOBBLE_A8) {
- rightSideStand = STAND_RIGHT;
+ rippleRight = RIPPLE_RIGHT;
}
if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D3) {
- leftSideEnter = ENTER_LEFT;
+ enterLeft = ENTER_LEFT;
}
if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D4) {
- middleEnter = ENTER_MIDDLE;
+ enterMiddle = ENTER_MIDDLE;
}
if (gPaintingMarioFloorType == paintingId * 3 + SURFACE_PAINTING_WARP_D5) {
- rightSideEnter = ENTER_RIGHT;
+ enterRight = ENTER_RIGHT;
}
painting->lastFloor = painting->currFloor;
- painting->currFloor = leftSideStand + middleStand + rightSideStand + leftSideEnter + middleEnter
- + rightSideEnter; // at most 1 of these will be nonzero;
- painting->floorEntered =
- (painting->lastFloor ^ painting->currFloor)
- & painting->currFloor; // floorEntered is true iff currFloor is true and lastFloor is false
- // (Mario just entered the floor on this frame)
- painting->lastMarioUnderPainting = painting->currMarioUnderPainting;
- if (gPaintingMarioYPos < painting->vYPos) {
- painting->currMarioUnderPainting = 1; // If Mario is below the painting, set a variable
+ // at most 1 of these will be nonzero;
+ painting->currFloor = rippleLeft + rippleMiddle + rippleRight + enterLeft + enterMiddle + enterRight;
+
+ // floorEntered is true iff currFloor is true and lastFloor is false
+ // (Mario just entered the floor on this frame)
+ painting->floorEntered = (painting->lastFloor ^ painting->currFloor) & painting->currFloor;
+
+ painting->marioWasUnder = painting->marioIsUnder;
+ // Check if mario has fallen below the painting (used for floor paintings)
+ if (gPaintingMarioYPos < painting->posY) {
+ painting->marioIsUnder = TRUE;
} else {
- painting->currMarioUnderPainting = 0; // Otherwise, reset it
+ painting->marioIsUnder = FALSE;
}
- painting->marioNewlyUnderPainting =
- (painting->lastMarioUnderPainting ^ painting->currMarioUnderPainting)
- & painting->currMarioUnderPainting; // Again, marioNewlyUnderPainting is true iff he is under it
- // this frame but wasn't last frame.
+
+ // mario "went under" if he was not under last frame, but is under now
+ painting->marioWentUnder = (painting->marioWasUnder ^ painting->marioIsUnder) & painting->marioIsUnder;
}
-void painting_update_ripple_status(struct Painting *painting) {
+/**
+ * Update the ripple's timer and magnitude, making it propagate outwards.
+ *
+ * Automatically changes the painting back to IDLE state (or RIPPLE for continuous paintings) if the
+ * ripple's magnitude becomes small enough.
+ */
+void painting_update_ripple_state(struct Painting *painting) {
if (gPaintingUpdateCounter != gLastPaintingUpdateCounter) {
- painting->currRippleMag *= painting->rippleMagMultiplier;
- painting->rippleTimer +=
- 1.0; //! After ~6.47 days, paintings with RIPPLE_TRIGGER_CONTINUOUS will increment this to
- //! 16777216 (1 << 24), at which point it will freeze (due to floating-point
- //! imprecision?) and the painting will stop rippling. This happens to HMC, DDD, and
- //! CotMC. This happens on Wii VC. Untested on N64 and Wii U VC.
+ painting->currRippleMag *= painting->rippleDecay;
+
+ //! After ~6.47 days, paintings with RIPPLE_TRIGGER_CONTINUOUS will increment this to
+ //! 16777216 (1 << 24), at which point it will freeze (due to floating-point
+ //! imprecision?) and the painting will stop rippling. This happens to HMC, DDD, and
+ //! CotMC. This happens on Wii VC. Untested on N64 and Wii U VC.
+ painting->rippleTimer += 1.0;
}
if (painting->rippleTrigger == RIPPLE_TRIGGER_PROXIMITY) {
- if (painting->currRippleMag <= 1.0) // if the painting is barely rippling, make it stop rippling
- {
- painting->rippleStatus = RIPPLE_STATE_NONE;
- ripplingPainting = NULL;
+ // if the painting is barely rippling, make it stop rippling
+ if (painting->currRippleMag <= 1.0) {
+ painting->state = PAINTING_IDLE;
+ gRipplingPainting = NULL;
}
} else if (painting->rippleTrigger == RIPPLE_TRIGGER_CONTINUOUS) {
- if (painting->rippleStatus == RIPPLE_STATE_ENTRY
- && painting->currRippleMag
- <= painting->passiveRippleMag) // if the painting is doing the entry ripple but the
- // ripples are as small as those from the passive
- // ripple, make it do a passive ripple
- {
- painting->rippleStatus = RIPPLE_STATE_IDLE;
+ // if the painting is doing the entry ripple but the ripples are as small as those from the
+ // passive ripple, make it do a passive ripple
+ // If mario goes below the surface but doesn't warp, the painting will eventually reset.
+ if (painting->state == PAINTING_ENTERED && painting->currRippleMag <= painting->passiveRippleMag) {
+
+ painting->state = PAINTING_RIPPLE;
painting->currRippleMag = painting->passiveRippleMag;
- painting->rippleMagMultiplier = painting->passiveRippleMagMultiplier;
+ painting->rippleDecay = painting->passiveRippleDecay;
painting->currRippleRate = painting->passiveRippleRate;
painting->dispersionFactor = painting->passiveDispersionFactor;
}
}
}
-s16 painting_calculate_point_ripple(struct Painting *painting, float xpos,
- float ypos) // note that xpos and ypos correspond to a point on the
- // face of the painting, not actual axes
-{
- float rippleMag = painting->currRippleMag;
- float rippleRate = painting->currRippleRate;
- float dispersionFactor = painting->dispersionFactor;
- float rippleTimer = painting->rippleTimer;
- float hRippleSpot = painting->horizontalRippleSpot;
- float vRippleSpot = painting->verticalRippleSpot;
- float distanceToRippleSpot;
- float scaledDistance;
-
- xpos *= painting->vSize / DEFAULT_HEIGHT; // scale x position of point by painting size
- ypos *= painting->vSize / DEFAULT_HEIGHT; // scale y position of point by painting size
- distanceToRippleSpot =
- sqrtf((xpos - hRippleSpot) * (xpos - hRippleSpot)
- + (ypos - vRippleSpot) * (ypos - vRippleSpot)); // distance from point to ripple spot
- scaledDistance =
- distanceToRippleSpot / dispersionFactor; // scale distance by dispersion factor so that ripples
- // farther from the ripple spot are smaller
- if (rippleTimer < scaledDistance) {
- return 0; // if the ripple hasn't reached the point yet, make the point magnitude 0
+/**
+ * @return the ripple function at posX, posY
+ * note that posX and posY correspond to a point on the face of the painting, not actual axes
+ */
+s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) {
+ /// Controls the peaks of the ripple.
+ f32 rippleMag = painting->currRippleMag;
+ /// Controls the ripple's frequency
+ f32 rippleRate = painting->currRippleRate;
+ /// Controls how fast the ripple spreads
+ f32 dispersionFactor = painting->dispersionFactor;
+ /// How far the ripple has spread
+ f32 rippleTimer = painting->rippleTimer;
+ /// x and y ripple origin
+ f32 rippleX = painting->rippleX;
+ f32 rippleY = painting->rippleY;
+
+ f32 distanceToOrigin;
+ f32 rippleDistance;
+
+ posX *= painting->size / PAINTING_SIZE;
+ posY *= painting->size / PAINTING_SIZE;
+ distanceToOrigin = sqrtf((posX - rippleX) * (posX - rippleX) + (posY - rippleY) * (posY - rippleY));
+ // A larger dispersionFactor makes the ripple spread slower
+ rippleDistance = distanceToOrigin / dispersionFactor;
+ if (rippleTimer < rippleDistance) {
+ // if the ripple hasn't reached the point yet, make the point magnitude 0
+ return 0;
} else {
+ // use a cosine wave to make the ripple go up and down,
+ // scaled by the painting's ripple magnitude
+ f32 rippleZ = rippleMag * cosf(rippleRate * (2 * M_PI) * (rippleTimer - rippleDistance));
- float rippleHeight =
- rippleMag
- * cosf(rippleRate * (2 * M_PI)
- * (rippleTimer
- - scaledDistance)); // use a cosine wave to make the ripple go up and down, and
- // scale it by the painting's ripple magnitude
-
- return round_float(rippleHeight); // round it to an int and return it
+ // round it to an int and return it
+ return round_float(rippleZ);
}
}
-s16 painting_conditionally_calculate_point_ripple(struct Painting *painting, s16 condition,
- s16 xpos, s16 ypos) {
- s16 rippleHeight = 0;
+/**
+ * If movable, return the ripple function at (posX, posY)
+ * else return 0
+ */
+s16 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY) {
+ s16 rippleZ = 0;
- if (condition) {
- rippleHeight = painting_calculate_point_ripple(painting, xpos, ypos);
+ if (movable) {
+ rippleZ = calculate_ripple_at_point(painting, posX, posY);
}
- return rippleHeight;
+ return rippleZ;
}
-void Print1(struct Painting *painting, s16 *b, s16 c) {
- s16 sp1E;
-
- D_8035FFA0 = mem_pool_alloc(gEffectsMemoryPool, c * sizeof(struct Thing));
- if (D_8035FFA0 == NULL) {
+/**
+ * Allocates and generates a mesh for the rippling painting effect by modifying the passed in `mesh`
+ * based on the painting's current ripple state.
+ *
+ * The `mesh` table describes the location of mesh vertices, whether they move when rippling, and what
+ * triangles they belong to.
+ *
+ * The static mesh passed in is organized into two lists. This function only uses the first list,
+ * painting_calculate_triangle_normals below uses the second one.
+ *
+ * The first list describes the vertices in this format:
+ * numVertices
+ * v0 x, v0 y, movable
+ * ...
+ * vN x, vN y, movable
+ * Where x and y are from 0 to PAINTING_SIZE, movable is 0 or 1.
+ *
+ * The mesh used in game, seg2_painting_triangle_mesh, is in bin/segment2.c.
+ */
+void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) {
+ s16 i;
+
+ gPaintingMesh = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(struct PaintingMeshVertex));
+ if (gPaintingMesh == NULL) {
}
- for (sp1E = 0; sp1E < c; sp1E++) {
- D_8035FFA0[sp1E].unk0[0] = b[sp1E * 3 + 1];
- D_8035FFA0[sp1E].unk0[1] = b[sp1E * 3 + 2];
- D_8035FFA0[sp1E].unk0[2] = painting_conditionally_calculate_point_ripple(
- painting, b[(sp1E + 1) * 3], D_8035FFA0[sp1E].unk0[0], D_8035FFA0[sp1E].unk0[1]);
+ // accesses are off by 1 since the first entry is the number of vertices
+ for (i = 0; i < numTris; i++) {
+ gPaintingMesh[i].pos[0] = mesh[i * 3 + 1];
+ gPaintingMesh[i].pos[1] = mesh[i * 3 + 2];
+ // The "z coordinate" of each vertex in the mesh is either 1 or 0. Instead of being an
+ // actual coordinate, it just determines whether the vertex moves
+ gPaintingMesh[i].pos[2] = ripple_if_movable(painting, mesh[i * 3 + 3],
+ gPaintingMesh[i].pos[0], gPaintingMesh[i].pos[1]);
}
}
-void Print2(s16 *a, s16 b, s16 c) {
- s16 sp46;
-
- D_8035FFA4 = mem_pool_alloc(gEffectsMemoryPool, c * sizeof(Vec3f));
- if (D_8035FFA4 == NULL) {
+/**
+ * Calculate the surface normals of each triangle in the generated ripple mesh.
+ *
+ * The static mesh passed in is organized into two lists. This function uses the second list,
+ * painting_generate_mesh above uses the first one.
+ *
+ * The second list in `mesh` describes the mesh's triangles in this format:
+ * numTris
+ * tri0 v0, tri0 v1, tri0 v2
+ * ...
+ * triN v0, triN v1, triN v2
+ * Where each v0, v1, v2 is an index into the first list in `mesh`.
+ *
+ * The mesh used in game, seg2_painting_triangle_mesh, is in bin/segment2.c.
+ */
+void painting_calculate_triangle_normals(s16 *mesh, s16 numVtx, s16 numTris) {
+ s16 i;
+
+ gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f));
+ if (gPaintingTriNorms == NULL) {
}
- for (sp46 = 0; sp46 < c; sp46++) {
- s16 sp44 = b * 3 + sp46 * 3 + 2;
- s16 sp42 = a[sp44];
- s16 sp40 = a[sp44 + 1];
- s16 sp3E = a[sp44 + 2];
- f32 sp38 = D_8035FFA0[sp42].unk0[0];
- f32 sp34 = D_8035FFA0[sp42].unk0[1];
- f32 sp30 = D_8035FFA0[sp42].unk0[2];
- f32 sp2C = D_8035FFA0[sp40].unk0[0];
- f32 sp28 = D_8035FFA0[sp40].unk0[1];
- f32 sp24 = D_8035FFA0[sp40].unk0[2];
- f32 sp20 = D_8035FFA0[sp3E].unk0[0];
- f32 sp1C = D_8035FFA0[sp3E].unk0[1];
- f32 sp18 = D_8035FFA0[sp3E].unk0[2];
-
- D_8035FFA4[sp46][0] = (sp28 - sp34) * (sp18 - sp24) - (sp24 - sp30) * (sp1C - sp28);
- D_8035FFA4[sp46][1] = (sp24 - sp30) * (sp20 - sp2C) - (sp2C - sp38) * (sp18 - sp24);
- D_8035FFA4[sp46][2] = (sp2C - sp38) * (sp1C - sp28) - (sp28 - sp34) * (sp20 - sp2C);
+ for (i = 0; i < numTris; i++) {
+ s16 tri = numVtx * 3 + i * 3 + 2; // Add 2 because of the 2 length entries preceding the list
+ s16 v0 = mesh[tri];
+ s16 v1 = mesh[tri + 1];
+ s16 v2 = mesh[tri + 2];
+
+ f32 x0 = gPaintingMesh[v0].pos[0];
+ f32 y0 = gPaintingMesh[v0].pos[1];
+ f32 z0 = gPaintingMesh[v0].pos[2];
+
+ f32 x1 = gPaintingMesh[v1].pos[0];
+ f32 y1 = gPaintingMesh[v1].pos[1];
+ f32 z1 = gPaintingMesh[v1].pos[2];
+
+ f32 x2 = gPaintingMesh[v2].pos[0];
+ f32 y2 = gPaintingMesh[v2].pos[1];
+ f32 z2 = gPaintingMesh[v2].pos[2];
+
+ // Cross product to find each triangle's normal vector
+ gPaintingTriNorms[i][0] = (y1 - y0) * (z2 - z1) - (z1 - z0) * (y2 - y1);
+ gPaintingTriNorms[i][1] = (z1 - z0) * (x2 - x1) - (x1 - x0) * (z2 - z1);
+ gPaintingTriNorms[i][2] = (x1 - x0) * (y2 - y1) - (y1 - y0) * (x2 - x1);
}
}
-s8 small_float_to_byte(float decimal) // This function converts a decimal to a signed byte by
- // multiplying it by 127 or 128 and rounding away from 0.
-{
- s8 convertedFloat;
-
- if (decimal > 0.0) {
- convertedFloat = decimal * 127.0 + 0.5; // round up
- } else if (decimal < 0.0) {
- convertedFloat = decimal * 128.0 - 0.5; // round down
+/**
+ * Rounds a floating-point component of a normal vector to an s8 by multiplying it by 127 or 128 and
+ * rounding away from 0.
+ */
+s8 normalize_component(f32 comp) {
+ s8 rounded;
+
+ if (comp > 0.0) {
+ rounded = comp * 127.0 + 0.5; // round up
+ } else if (comp < 0.0) {
+ rounded = comp * 128.0 - 0.5; // round down
} else {
- convertedFloat = 0; // don't round 0
+ rounded = 0; // don't round 0
}
- return convertedFloat;
+ return rounded;
}
-void func_802D39DC(s16 *a, s16 b) {
+/**
+ * Approximates the painting mesh's vertex normals by averaging the normals of all triangles sharing a
+ * vertex. Used for gouraud lighting.
+ *
+ * After each triangle's surface normal is calculated, the `neighborTris` table describes which triangles
+ * each vertex should use when calculating the average normal vector.
+ *
+ * The table is a list of entries in this format:
+ * numNeighbors, tri0, tri1, ..., triN
+ *
+ * Where each 'tri' is an index into gPaintingTriNorms.
+ * Entry i in `neighborTris` corresponds to the vertex at gPaintingMesh[i]
+ *
+ * The table used in game, seg2_painting_mesh_neighbor_tris, is in bin/segment2.c.
+ */
+void painting_average_vertex_normals(s16 *neighborTris, s16 numVtx) {
UNUSED s16 unused;
- s16 sp34;
- s16 index;
- s16 index2;
- s16 sp2E;
- s16 sp2C = 0;
-
- for (index = 0; index < b; index++) {
- f32 sp28 = 0.0f;
- f32 sp24 = 0.0f;
- f32 sp20 = 0.0f;
- f32 sp1C;
-
- sp2E = a[sp2C];
- for (index2 = 0; index2 < sp2E; index2++) {
- sp34 = a[sp2C + index2 + 1];
- sp28 += D_8035FFA4[sp34][0];
- sp24 += D_8035FFA4[sp34][1];
- sp20 += D_8035FFA4[sp34][2];
+ s16 tri;
+ s16 i;
+ s16 j;
+ s16 neighbors;
+ s16 entry = 0;
+
+ for (i = 0; i < numVtx; i++) {
+ f32 nx = 0.0f;
+ f32 ny = 0.0f;
+ f32 nz = 0.0f;
+ f32 nlen;
+
+ // The first number of each entry is the number of adjacent tris
+ neighbors = neighborTris[entry];
+ for (j = 0; j < neighbors; j++) {
+ tri = neighborTris[entry + j + 1];
+ nx += gPaintingTriNorms[tri][0];
+ ny += gPaintingTriNorms[tri][1];
+ nz += gPaintingTriNorms[tri][2];
}
- sp2C += sp2E + 1;
- sp28 /= sp2E;
- sp24 /= sp2E;
- sp20 /= sp2E;
- sp1C = sqrtf(sp28 * sp28 + sp24 * sp24 + sp20 * sp20);
- if (sp1C == 0.0) {
- D_8035FFA0[index].unk6[0] = 0;
- D_8035FFA0[index].unk6[1] = 0;
- D_8035FFA0[index].unk6[2] = 0;
+ // Move to the next vertex's entry
+ entry += neighbors + 1;
+
+ // average the surface normals from each neighboring tri
+ nx /= neighbors;
+ ny /= neighbors;
+ nz /= neighbors;
+ nlen = sqrtf(nx * nx + ny * ny + nz * nz);
+
+ if (nlen == 0.0) {
+ gPaintingMesh[i].norm[0] = 0;
+ gPaintingMesh[i].norm[1] = 0;
+ gPaintingMesh[i].norm[2] = 0;
} else {
- D_8035FFA0[index].unk6[0] = small_float_to_byte(sp28 / sp1C);
- D_8035FFA0[index].unk6[1] = small_float_to_byte(sp24 / sp1C);
- D_8035FFA0[index].unk6[2] = small_float_to_byte(sp20 / sp1C);
+ gPaintingMesh[i].norm[0] = normalize_component(nx / nlen);
+ gPaintingMesh[i].norm[1] = normalize_component(ny / nlen);
+ gPaintingMesh[i].norm[2] = normalize_component(nz / nlen);
}
}
}
-void *func_802D3CF0(u8 *img, s16 tWidth, s16 tHeight, s16 *d, s16 e, s16 f, u8 g) {
- s16 sp9E;
- s16 sp9C;
- s16 sp9A;
- s16 sp98;
- s16 sp96;
+/**
+ * Creates a display list that draws the rippling painting, with 'img' mapped to the painting's mesh,
+ * using 'textureMap'.
+ *
+ * If the textureMap doesn't describe the whole mesh, then multiple calls are needed to draw the whole
+ * painting.
+ */
+Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapVerts, s16 mapTris, u8 alpha) {
+ s16 group;
+ s16 map;
+ s16 triGroup;
+ s16 mapping;
+ s16 meshVtx;
s16 tx;
s16 ty;
- s16 sp90 = f / 5;
- s16 sp8E = f % 5;
- s16 sp8C = f * 3;
- s16 sp8A = sp90 * 2 + sp8E + 7;
- Vtx *verts = alloc_display_list(sp8C * sizeof(*verts));
- Gfx *sp80 = alloc_display_list(sp8A * sizeof(*sp80));
- Gfx *sp7C = sp80;
-
- if (verts == NULL || sp80 == NULL) {
- }
-
- gLoadBlockTexture(sp7C++, tWidth, tHeight, G_IM_FMT_RGBA, img);
-
- for (sp9E = 0; sp9E < sp90; sp9E++) {
- sp9A = e * 3 + sp9E * 15 + 2;
- for (sp9C = 0; sp9C < 15; sp9C++) {
- sp98 = d[sp9A + sp9C];
- sp96 = d[sp98 * 3 + 1];
- tx = d[sp98 * 3 + 2];
- ty = d[sp98 * 3 + 3];
- make_vertex(verts, sp9E * 15 + sp9C, D_8035FFA0[sp96].unk0[0], D_8035FFA0[sp96].unk0[1],
- D_8035FFA0[sp96].unk0[2], tx, ty, D_8035FFA0[sp96].unk6[0],
- D_8035FFA0[sp96].unk6[1], D_8035FFA0[sp96].unk6[2], g);
+
+ // We can fit 15 (16 / 3) vertices in the RSP's vertex buffer.
+ // Group triangles by 5, with one remainder group.
+ s16 triGroups = mapTris / 5;
+ s16 remGroupTris = mapTris % 5;
+ s16 numVtx = mapTris * 3;
+
+ s16 commands = triGroups * 2 + remGroupTris + 7;
+ Vtx *verts = alloc_display_list(numVtx * sizeof(Vtx));
+ Gfx *dlist = alloc_display_list(commands * sizeof(Gfx));
+ Gfx *gfx = dlist;
+
+ if (verts == NULL || dlist == NULL) {
+ }
+
+ gLoadBlockTexture(gfx++, tWidth, tHeight, G_IM_FMT_RGBA, img);
+
+ // Draw the groups of 5 first
+ for (group = 0; group < triGroups; group++) {
+
+ // The triangle groups are the second part of the texture map.
+ // Each group is a list of 15 mappings
+ triGroup = mapVerts * 3 + group * 15 + 2;
+ for (map = 0; map < 15; map++) {
+ // The mapping is just an index into the earlier part of the textureMap
+ // Some mappings are repeated, for example, when multiple triangles share a vertex
+ mapping = textureMap[triGroup + map];
+
+ // The first entry is the ID of the vertex in the mesh
+ meshVtx = textureMap[mapping * 3 + 1];
+
+ // The next two are the texture coordinates for that vertex
+ tx = textureMap[mapping * 3 + 2];
+ ty = textureMap[mapping * 3 + 3];
+
+ // Map the texture and place it in the verts array
+ make_vertex(verts, group * 15 + map, gPaintingMesh[meshVtx].pos[0], gPaintingMesh[meshVtx].pos[1],
+ gPaintingMesh[meshVtx].pos[2], tx, ty, gPaintingMesh[meshVtx].norm[0],
+ gPaintingMesh[meshVtx].norm[1], gPaintingMesh[meshVtx].norm[2], alpha);
}
- gSPVertex(sp7C++, VIRTUAL_TO_PHYSICAL(verts + sp9E * 15), 15, 0);
- gSPDisplayList(sp7C++, dl_paintings_draw_ripples);
- }
-
- sp9A = e * 3 + sp90 * 15 + 2;
- for (sp9C = 0; sp9C < sp8E * 3; sp9C++) {
- sp98 = d[sp9A + sp9C];
- sp96 = d[sp98 * 3 + 1];
- tx = d[sp98 * 3 + 2];
- ty = d[sp98 * 3 + 3];
- make_vertex(verts, sp90 * 15 + sp9C, D_8035FFA0[sp96].unk0[0], D_8035FFA0[sp96].unk0[1],
- D_8035FFA0[sp96].unk0[2], tx, ty, D_8035FFA0[sp96].unk6[0],
- D_8035FFA0[sp96].unk6[1], D_8035FFA0[sp96].unk6[2], g);
- }
- gSPVertex(sp7C++, VIRTUAL_TO_PHYSICAL(verts + sp90 * 15), sp8E * 3, 0);
- for (sp9E = 0; sp9E < sp8E; sp9E++)
- gSP1Triangle(sp7C++, sp9E * 3, sp9E * 3 + 1, sp9E * 3 + 2, 0);
- gSPEndDisplayList(sp7C);
- return sp80;
-}
-
-Gfx *func_802D43FC(struct Painting *painting) {
- float sp4C = painting->vSize / DEFAULT_HEIGHT;
- Mtx *sp48 = alloc_display_list(sizeof(Mtx));
- Mtx *sp44 = alloc_display_list(sizeof(Mtx));
- Mtx *sp40 = alloc_display_list(sizeof(Mtx));
- Mtx *sp3C = alloc_display_list(sizeof(Mtx));
- Gfx *sp38 = alloc_display_list(5 * sizeof(Gfx));
- Gfx *sp34 = sp38;
-
- if (sp48 == NULL || sp44 == NULL || sp40 == NULL || sp38 == NULL) {
- }
-
- guTranslate(sp40, painting->vXPos, painting->vYPos, painting->vZPos);
- guRotate(sp48, painting->vXRotation, 1.0f, 0.0f, 0.0f);
- guRotate(sp44, painting->vYRotation, 0.0f, 1.0f, 0.0f);
- guScale(sp3C, sp4C, sp4C, sp4C);
-
- gSPMatrix(sp34++, sp40, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH);
- gSPMatrix(sp34++, sp48, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
- gSPMatrix(sp34++, sp44, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
- gSPMatrix(sp34++, sp3C, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
- gSPEndDisplayList(sp34);
-
- return sp38;
-}
-
-Gfx *func_802D45FC(struct Painting *painting) {
- s16 sp66;
- s16 sp64;
- s16 sp62;
- s16 *sp5C;
- s16 faceCount = painting->faceCount;
+
+ // Load the vertices and draw the 5 triangles
+ gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL(verts + group * 15), 15, 0);
+ gSPDisplayList(gfx++, dl_paintings_draw_ripples);
+ }
+
+ // One group left with < 5 triangles
+ triGroup = mapVerts * 3 + triGroups * 15 + 2;
+ // Map the texture to the triangles
+ for (map = 0; map < remGroupTris * 3; map++) {
+ mapping = textureMap[triGroup + map];
+ meshVtx = textureMap[mapping * 3 + 1];
+ tx = textureMap[mapping * 3 + 2];
+ ty = textureMap[mapping * 3 + 3];
+ make_vertex(verts, triGroups * 15 + map, gPaintingMesh[meshVtx].pos[0], gPaintingMesh[meshVtx].pos[1],
+ gPaintingMesh[meshVtx].pos[2], tx, ty, gPaintingMesh[meshVtx].norm[0],
+ gPaintingMesh[meshVtx].norm[1], gPaintingMesh[meshVtx].norm[2], alpha);
+ }
+
+ // Draw the triangles individually
+ gSPVertex(gfx++, VIRTUAL_TO_PHYSICAL(verts + triGroups * 15), remGroupTris * 3, 0);
+ for (group = 0; group < remGroupTris; group++) {
+ gSP1Triangle(gfx++, group * 3, group * 3 + 1, group * 3 + 2, 0);
+ }
+
+ gSPEndDisplayList(gfx);
+ return dlist;
+}
+
+/**
+ * Orient the painting mesh for rendering.
+ */
+Gfx *painting_model_view_transform(struct Painting *painting) {
+ f32 sizeRatio = painting->size / PAINTING_SIZE;
+ Mtx *rotX = alloc_display_list(sizeof(Mtx));
+ Mtx *rotY = alloc_display_list(sizeof(Mtx));
+ Mtx *translate = alloc_display_list(sizeof(Mtx));
+ Mtx *scale = alloc_display_list(sizeof(Mtx));
+ Gfx *dlist = alloc_display_list(5 * sizeof(Gfx));
+ Gfx *gfx = dlist;
+
+ if (rotX == NULL || rotY == NULL || translate == NULL || dlist == NULL) {
+ }
+
+ guTranslate(translate, painting->posX, painting->posY, painting->posZ);
+ guRotate(rotX, painting->pitch, 1.0f, 0.0f, 0.0f);
+ guRotate(rotY, painting->yaw, 0.0f, 1.0f, 0.0f);
+ guScale(scale, sizeRatio, sizeRatio, sizeRatio);
+
+ gSPMatrix(gfx++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH);
+ gSPMatrix(gfx++, rotX, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
+ gSPMatrix(gfx++, rotY, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
+ gSPMatrix(gfx++, scale, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH);
+ gSPEndDisplayList(gfx);
+
+ return dlist;
+}
+
+/**
+ * Ripple a painting that has 1 or more images that need to be mapped
+ */
+Gfx *painting_ripple_image(struct Painting *painting) {
+ s16 meshVerts;
+ s16 meshTris;
+ s16 i;
+ s16 *textureMap;
+ s16 imageCount = painting->imageCount;
s16 tWidth = painting->textureWidth;
s16 tHeight = painting->textureHeight;
- s16 **meshArray = segmented_to_virtual(painting->meshData);
- u8 **tArray = segmented_to_virtual(painting->textureArray);
- Gfx *sp48 = alloc_display_list((faceCount + 6) * sizeof(Gfx));
- Gfx *sp44 = sp48;
+ s16 **textureMaps = segmented_to_virtual(painting->textureMaps);
+ u8 **textures = segmented_to_virtual(painting->textureArray);
+ Gfx *dlist = alloc_display_list((imageCount + 6) * sizeof(Gfx));
+ Gfx *gfx = dlist;
- if (sp48 == NULL) {
- return sp48;
+ if (dlist == NULL) {
+ return dlist;
}
- gSPDisplayList(sp44++, func_802D43FC(painting));
- gSPDisplayList(sp44++, dl_paintings_rippling_begin);
- gSPDisplayList(sp44++, painting->displayList68);
+ gSPDisplayList(gfx++, painting_model_view_transform(painting));
+ gSPDisplayList(gfx++, dl_paintings_rippling_begin);
+ gSPDisplayList(gfx++, painting->rippleDisplayList);
- for (sp62 = 0; sp62 < faceCount; sp62++) {
- sp5C = segmented_to_virtual(meshArray[sp62]);
- sp66 = sp5C[0];
- sp64 = sp5C[sp66 * 3 + 1];
- gSPDisplayList(sp44++, func_802D3CF0(tArray[sp62], tWidth, tHeight, sp5C, sp66, sp64,
- painting->brightness));
+ // Map each image to the mesh's vertices
+ for (i = 0; i < imageCount; i++) {
+ textureMap = segmented_to_virtual(textureMaps[i]);
+ meshVerts = textureMap[0];
+ meshTris = textureMap[meshVerts * 3 + 1];
+ gSPDisplayList(gfx++, render_painting(textures[i], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha));
}
- painting_update_ripple_status(painting);
- gSPPopMatrix(sp44++, G_MTX_MODELVIEW);
- gSPDisplayList(sp44++, dl_paintings_rippling_end);
- gSPEndDisplayList(sp44);
- return sp48;
+
+ // Update the ripple, may automatically reset the painting's state.
+ painting_update_ripple_state(painting);
+
+ gSPPopMatrix(gfx++, G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, dl_paintings_rippling_end);
+ gSPEndDisplayList(gfx);
+ return dlist;
}
-Gfx *func_802D4874(struct Painting *painting) {
- s16 sp5E;
- s16 sp5C;
- s16 *sp58;
+/**
+ * Ripple a painting that has 1 "environment map" texture.
+ */
+Gfx *painting_ripple_env_mapped(struct Painting *painting) {
+ s16 meshVerts;
+ s16 meshTris;
+ s16 *textureMap;
s16 tWidth = painting->textureWidth;
s16 tHeight = painting->textureHeight;
- s16 **meshArray = segmented_to_virtual(painting->meshData);
+ s16 **textureMaps = segmented_to_virtual(painting->textureMaps);
u8 **tArray = segmented_to_virtual(painting->textureArray);
- Gfx *sp48 = alloc_display_list(7 * sizeof(Gfx));
- Gfx *sp44 = sp48;
+ Gfx *dlist = alloc_display_list(7 * sizeof(Gfx));
+ Gfx *gfx = dlist;
- if (sp48 == NULL) {
- return sp48;
+ if (dlist == NULL) {
+ return dlist;
}
- gSPDisplayList(sp44++, func_802D43FC(painting));
- gSPDisplayList(sp44++, dl_paintings_env_mapped_begin);
- gSPDisplayList(sp44++, painting->displayList68);
- sp58 = segmented_to_virtual(meshArray[0]);
- sp5E = sp58[0];
- sp5C = sp58[sp5E * 3 + 1];
- gSPDisplayList(sp44++,
- func_802D3CF0(tArray[0], tWidth, tHeight, sp58, sp5E, sp5C, painting->brightness));
- painting_update_ripple_status(painting);
- gSPPopMatrix(sp44++, G_MTX_MODELVIEW);
- gSPDisplayList(sp44++, dl_paintings_env_mapped_end);
- gSPEndDisplayList(sp44);
- return sp48;
+ gSPDisplayList(gfx++, painting_model_view_transform(painting));
+ gSPDisplayList(gfx++, dl_paintings_env_mapped_begin);
+ gSPDisplayList(gfx++, painting->rippleDisplayList);
+
+ // Map the image to the mesh's vertices
+ textureMap = segmented_to_virtual(textureMaps[0]);
+ meshVerts = textureMap[0];
+ meshTris = textureMap[meshVerts * 3 + 1];
+ gSPDisplayList(gfx++, render_painting(tArray[0], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha));
+
+ // Update the ripple, may automatically reset the painting's state.
+ painting_update_ripple_state(painting);
+
+ gSPPopMatrix(gfx++, G_MTX_MODELVIEW);
+ gSPDisplayList(gfx++, dl_paintings_env_mapped_end);
+ gSPEndDisplayList(gfx);
+ return dlist;
}
+/**
+ * Generates a mesh, calculates vertex normals for lighting, and renders a rippling painting.
+ * The mesh and vertex normals are regenerated and freed every frame.
+ */
Gfx *display_painting_rippling(struct Painting *painting) {
- s16 *sp34 = segmented_to_virtual(seg2_triangle_mesh);
- s16 *sp30 = segmented_to_virtual(seg2_mesh_order);
- s16 sp2E = sp34[0];
- s16 sp2C = sp34[sp2E * 3 + 1];
- Gfx *sp28;
-
- Print1(painting, sp34, sp2E);
- Print2(sp34, sp2E, sp2C);
- func_802D39DC(sp30, sp2E);
- switch (painting->rippleShape) {
- case RIPPLE_SHAPE_WAVE:
- sp28 = func_802D45FC(painting);
+ s16 *mesh = segmented_to_virtual(seg2_painting_triangle_mesh);
+ s16 *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris);
+ s16 numVtx = mesh[0];
+ s16 numTris = mesh[numVtx * 3 + 1];
+ Gfx *dlist;
+
+ // Generate the mesh and its lighting data
+ painting_generate_mesh(painting, mesh, numVtx);
+ painting_calculate_triangle_normals(mesh, numVtx, numTris);
+ painting_average_vertex_normals(neighborTris, numVtx);
+
+ // Map the painting's texture depending on the painting's texture type.
+ switch (painting->textureType) {
+ case PAINTING_IMAGE:
+ dlist = painting_ripple_image(painting);
break;
- case RIPPLE_SHAPE_CONCENTRIC:
- sp28 = func_802D4874(painting);
+ case PAINTING_ENV_MAP:
+ dlist = painting_ripple_env_mapped(painting);
break;
}
- mem_pool_free(gEffectsMemoryPool, D_8035FFA0);
- mem_pool_free(gEffectsMemoryPool, D_8035FFA4);
- return sp28;
+
+ // The mesh data is freed every frame.
+ mem_pool_free(gEffectsMemoryPool, gPaintingMesh);
+ mem_pool_free(gEffectsMemoryPool, gPaintingTriNorms);
+ return dlist;
}
+/**
+ * Render a normal painting.
+ */
Gfx *display_painting_not_rippling(struct Painting *painting) {
- Gfx *sp2C = alloc_display_list(4 * sizeof(Gfx));
- Gfx *sp28 = sp2C;
+ Gfx *dlist = alloc_display_list(4 * sizeof(Gfx));
+ Gfx *gfx = dlist;
- if (sp2C == NULL) {
- return sp2C;
+ if (dlist == NULL) {
+ return dlist;
}
- gSPDisplayList(sp28++, func_802D43FC(painting));
- gSPDisplayList(sp28++, painting->displayList58);
- gSPPopMatrix(sp28++, G_MTX_MODELVIEW);
- gSPEndDisplayList(sp28);
- return sp2C;
+ gSPDisplayList(gfx++, painting_model_view_transform(painting));
+ gSPDisplayList(gfx++, painting->normalDisplayList);
+ gSPPopMatrix(gfx++, G_MTX_MODELVIEW);
+ gSPEndDisplayList(gfx);
+ return dlist;
}
+/**
+ * Clear mario-related state and clear gRipplingPainting.
+ */
void reset_painting(struct Painting *painting) {
painting->lastFloor = 0;
painting->currFloor = 0;
painting->floorEntered = 0;
- painting->lastMarioUnderPainting = 0;
- painting->currMarioUnderPainting = 0;
- painting->marioNewlyUnderPainting = 0;
- ripplingPainting = NULL;
-}
-
-void update_ddd_painting(struct Painting *painting, float frontPos, float backPos,
- float speed) // Tells the DDD painting whether to move back
-{
- u32 dddFlags = save_file_get_star_flags(gCurrSaveFileNum - 1,
- DIRE_DIRE_DOCKS - 1); // Obtain the DDD star flags
- u32 saveFileFlags = save_file_get_flags(); // Get the other save file flags
- u32 bowsersSubBeaten =
- dddFlags & BOARD_BOWSERS_SUB; // Find out whether Board Bowser's Sub was collected
- u32 dddBack = saveFileFlags & SAVE_FLAG_DDD_MOVED_BACK; // Check whether DDD has already moved back
+ painting->marioWasUnder = 0;
+ painting->marioIsUnder = 0;
+ painting->marioWentUnder = 0;
+
+ gRipplingPainting = NULL;
+}
+
+/**
+ * Controls the x coordinate of the DDD painting.
+ *
+ * Before mario gets the "Board Bowser's Sub" star in DDD, the painting spawns at frontPos.
+ *
+ * If mario just got the star, the painting's x coordinate moves to backPos at a rate of `speed` units.
+ *
+ * When the painting reaches backPos, a save flag is set so that the painting will spawn at backPos
+ * whenever it loads.
+ *
+ * This function also sets gDddPaintingStatus, which controls the warp:
+ * 0 (0b00): set x coordinate to frontPos
+ * 2 (0b10): set x coordinate to backPos
+ * 3 (0b11): same as 2. Bit 0 is ignored
+ */
+void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32 speed) {
+ // Obtain the DDD star flags
+ u32 dddFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_DDD - 1);
+ // Get the other save file flags
+ u32 saveFileFlags = save_file_get_flags();
+ // Find out whether Board Bowser's Sub was collected
+ u32 bowsersSubBeaten = dddFlags & BOARD_BOWSERS_SUB;
+ // Check whether DDD has already moved back
+ u32 dddBack = saveFileFlags & SAVE_FLAG_DDD_MOVED_BACK;
if (!bowsersSubBeaten && !dddBack) {
- painting->vXPos = frontPos; // If we haven't collected the star or moved the painting, put the
- // painting at the front
- dddStatus = 0;
- } else if (bowsersSubBeaten
- && !dddBack) // If we've collected the star but not moved the painting back,
- {
- painting->vXPos +=
- speed; // Each frame, move the painting by a certain speed towards the back area.
- dddStatus = BOWSERS_SUB_BEATEN;
- if (painting->vXPos >= backPos) {
- painting->vXPos = backPos;
- save_file_set_flags(
- SAVE_FLAG_DDD_MOVED_BACK); // Tell the save file that we've moved DDD back.
+ // If we haven't collected the star or moved the painting, put the painting at the front
+ painting->posX = frontPos;
+ gDddPaintingStatus = 0;
+ } else if (bowsersSubBeaten && !dddBack) {
+ // If we've collected the star but not moved the painting back,
+ // Each frame, move the painting by a certain speed towards the back area.
+ painting->posX += speed;
+ gDddPaintingStatus = BOWSERS_SUB_BEATEN;
+ if (painting->posX >= backPos) {
+ painting->posX = backPos;
+ // Tell the save file that we've moved DDD back.
+ save_file_set_flags(SAVE_FLAG_DDD_MOVED_BACK);
}
} else if (bowsersSubBeaten && dddBack) {
- painting->vXPos =
- backPos; // If the painting has already moved back, place it in the back position.
- dddStatus = BOWSERS_SUB_BEATEN | DDD_BACK;
+ // If the painting has already moved back, place it in the back position.
+ painting->posX = backPos;
+ gDddPaintingStatus = BOWSERS_SUB_BEATEN | DDD_BACK;
}
}
-struct Struct802D4E04 {
- u8 filler0[2];
- s16 unk2;
- u8 filler4[20];
- u32 unk18; // the upper half is the painting's id
-};
-
-void func_802D4E04(struct GraphNodeGenerated *a, struct Painting *b) {
- switch (b->brightness) {
- case 0xFF: // brightest
- a->fnNode.node.flags = (a->fnNode.node.flags & 0xFF) | 0x100;
+/**
+ * Set the painting's node's layer based on its alpha
+ */
+void set_painting_layer(struct GraphNodeGenerated *gen, struct Painting *painting) {
+ switch (painting->alpha) {
+ case 0xFF: // Opaque
+ gen->fnNode.node.flags = (gen->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8);
break;
default:
- a->fnNode.node.flags = (a->fnNode.node.flags & 0xFF) | 0x500;
+ gen->fnNode.node.flags = (gen->fnNode.node.flags & 0xFF) | (LAYER_TRANSPARENT << 8);
break;
}
}
+/**
+ * Display either a normal painting or a rippling one depending on the painting's ripple status
+ */
Gfx *display_painting(struct Painting *painting) {
- switch (painting->rippleStatus) {
- case RIPPLE_STATE_NONE:
+ switch (painting->state) {
+ case PAINTING_IDLE:
return display_painting_not_rippling(painting);
break;
default:
@@ -838,96 +1131,117 @@ Gfx *display_painting(struct Painting *painting) {
}
}
-void vertical_painting_ripple(struct Painting *painting, struct Painting *paintingGroup[]) {
- if (painting->rippleTrigger
- == RIPPLE_TRIGGER_PROXIMITY) // make the painting ripple using a different function based on its
- // ripple trigger and status
- {
- switch (painting->rippleStatus) {
- case RIPPLE_STATE_NONE:
- vertical_proximity_ripple_painting_ripple(painting, paintingGroup);
+/**
+ * Update function for wall paintings.
+ * Calls a different update function depending on the painting's ripple trigger and current state.
+ */
+void wall_painting_update(struct Painting *painting, struct Painting *paintingGroup[]) {
+ if (painting->rippleTrigger == RIPPLE_TRIGGER_PROXIMITY) {
+ switch (painting->state) {
+ case PAINTING_IDLE:
+ wall_painting_proximity_idle(painting, paintingGroup);
break;
- case RIPPLE_STATE_IDLE:
- vertical_proximity_ripple_painting_ripple_if_mario_enters(painting, paintingGroup);
+ case PAINTING_RIPPLE:
+ wall_painting_proximity_rippling(painting, paintingGroup);
break;
}
} else if (painting->rippleTrigger == RIPPLE_TRIGGER_CONTINUOUS) {
- switch (painting->rippleStatus) {
- case RIPPLE_STATE_NONE:
- vertical_continuous_ripple_painting_ripple(painting, paintingGroup);
+ switch (painting->state) {
+ case PAINTING_IDLE:
+ wall_painting_continuous_idle(painting, paintingGroup);
break;
- case RIPPLE_STATE_IDLE:
- vertical_continuous_ripple_painting_ripple_if_mario_enters(painting, paintingGroup);
+ case PAINTING_RIPPLE:
+ wall_painting_continuous_rippling(painting, paintingGroup);
break;
}
}
}
-void horizontal_painting_ripple(struct Painting *painting, struct Painting *paintingGroup[]) {
- if (painting->rippleTrigger
- == RIPPLE_TRIGGER_PROXIMITY) // make the painting ripple using a different function based on its
- // ripple trigger and status
- {
- switch (painting->rippleStatus) // No horizontal proximity ripple paintings exist in-game.
- {
- case RIPPLE_STATE_NONE:
- horizontal_proximity_ripple_painting_ripple(painting, paintingGroup);
+/**
+ * Update function for floor paintings (HMC and CotMC)
+ * Calls a different update function depending on the painting's ripple trigger and current state.
+ *
+ * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game.
+ */
+void floor_painting_update(struct Painting *painting, struct Painting *paintingGroup[]) {
+ if (painting->rippleTrigger == RIPPLE_TRIGGER_PROXIMITY) {
+ switch (painting->state) {
+ case PAINTING_IDLE:
+ floor_painting_proximity_idle(painting, paintingGroup);
break;
- case RIPPLE_STATE_IDLE:
- horizontal_proximity_ripple_painting_ripple_if_mario_enters(painting, paintingGroup);
+ case PAINTING_RIPPLE:
+ floor_painting_proximity_rippling(painting, paintingGroup);
break;
}
} else if (painting->rippleTrigger == RIPPLE_TRIGGER_CONTINUOUS) {
- switch (painting->rippleStatus) {
- case RIPPLE_STATE_NONE:
- horizontal_continuous_ripple_painting_ripple(painting, paintingGroup);
+ switch (painting->state) {
+ case PAINTING_IDLE:
+ floor_painting_continuous_idle(painting, paintingGroup);
break;
- case RIPPLE_STATE_IDLE:
- horizontal_continuous_ripple_painting_ripple_if_mario_enters(painting, paintingGroup);
+ case PAINTING_RIPPLE:
+ floor_painting_continuous_rippling(painting, paintingGroup);
break;
}
}
}
-Gfx *Geo18_802D5B98(s32 run, struct GraphNode *node, UNUSED void *context) {
- struct GraphNodeGenerated *sp2C = (struct GraphNodeGenerated *) node;
- s32 sp28 = (sp2C->parameter >> 8) & 0xFF;
- s32 id = sp2C->parameter & 0xFF;
- Gfx *sp20 = NULL;
- struct Painting **paintingGroup = paintingGroups[sp28];
+/**
+ * Render and update the painting whose id and group matches the values in the GraphNode's parameter.
+ * Use PAINTING_ID(id, group) to set the right parameter in a level's geo layout.
+ */
+Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *context) {
+ struct GraphNodeGenerated *gen = (struct GraphNodeGenerated *) node;
+ s32 group = (gen->parameter >> 8) & 0xFF;
+ s32 id = gen->parameter & 0xFF;
+ Gfx *paintingDlist = NULL;
+ struct Painting **paintingGroup = sPaintingGroups[group];
struct Painting *painting = segmented_to_virtual(paintingGroup[id]);
- if (run != TRUE) {
+ if (callContext != GEO_CONTEXT_RENDER) {
reset_painting(painting);
- } else if (run == TRUE) // because the extra comparison was really necessary...
- {
- if (sp28 == 1 && id == PAINTING_ID_DDD) { // painting is DDD painting
- update_ddd_painting(painting, 3456.0f, 5529.6f, 20.0f);
+ } else if (callContext == GEO_CONTEXT_RENDER) {
+
+ // Update the ddd painting before drawing
+ if (group == 1 && id == PAINTING_ID_DDD) {
+ move_ddd_painting(painting, 3456.0f, 5529.6f, 20.0f);
}
- func_802D4E04(sp2C, painting);
- sp20 = display_painting(painting);
+
+ // Determine if the painting is transparent
+ set_painting_layer(gen, painting);
+
+ // Draw before updating
+ paintingDlist = display_painting(painting);
+
+ // Update the painting
painting_update_floors(painting);
- switch ((s16) painting->vXRotation) {
- case ROTATION_VERTICAL:
- vertical_painting_ripple(painting, paintingGroup);
+ switch ((s16) painting->pitch) {
+ // only paintings with 0 pitch are treated as walls
+ case 0:
+ wall_painting_update(painting, paintingGroup);
break;
default:
- horizontal_painting_ripple(painting, paintingGroup);
+ floor_painting_update(painting, paintingGroup);
break;
}
}
- return sp20;
+ return paintingDlist;
}
-Gfx *Geo18_802D5D0C(s32 run, UNUSED struct GraphNode *node, UNUSED f32 c[4][4]) {
+/**
+ * Update the painting system's local copy of mario's current floor and position.
+ */
+Gfx *geo_painting_update(s32 callContext, UNUSED struct GraphNode *node, UNUSED f32 c[4][4]) {
struct Surface *surface;
- if (run != TRUE) {
+ // Reset the update counter
+ if (callContext != GEO_CONTEXT_RENDER) {
gLastPaintingUpdateCounter = gAreaUpdateCounter - 1;
gPaintingUpdateCounter = gAreaUpdateCounter;
} else {
gLastPaintingUpdateCounter = gPaintingUpdateCounter;
gPaintingUpdateCounter = gAreaUpdateCounter;
+
+ // Store mario's floor and position
find_floor(gMarioObject->oPosX, gMarioObject->oPosY, gMarioObject->oPosZ, &surface);
gPaintingMarioFloorType = surface->type;
gPaintingMarioXPos = gMarioObject->oPosX;
diff --git a/src/game/paintings.h b/src/game/paintings.h
@@ -1,97 +1,120 @@
#ifndef PAINTINGS_H
#define PAINTINGS_H
-#define DEFAULT_HEIGHT 614.0
+#include "types.h"
+
+/**
+ * @file paintings.h
+ */
+
+/// Use to properly set a GraphNodeGenerated's parameter to point to the right painting
+#define PAINTING_ID(id, grp) id | (grp << 8)
+
+/// The default painting side length
+#define PAINTING_SIZE 614.0
#define PAINTING_ID_DDD 7
-#define DIRE_DIRE_DOCKS 9
#define BOARD_BOWSERS_SUB 1
#define BOWSERS_SUB_BEATEN 0x2
#define DDD_BACK 0x1
-#define STAND_LEFT 0x20
-#define STAND_MIDDLE 0x10
-#define STAND_RIGHT 0x8
-#define ENTER_LEFT 0x4
-#define ENTER_MIDDLE 0x2
-#define ENTER_RIGHT 0x1
-
-#define RIPPLE_SHAPE_WAVE 0
-#define RIPPLE_SHAPE_CONCENTRIC 1
-
-#define RIPPLE_STATE_NONE 0
-#define RIPPLE_STATE_IDLE 1
-#define RIPPLE_STATE_ENTRY 2
+#define PAINTING_IDLE 0
+#define PAINTING_RIPPLE 1
+#define PAINTING_ENTERED 2
#define RIPPLE_TRIGGER_PROXIMITY 10
#define RIPPLE_TRIGGER_CONTINUOUS 20
-#define ROTATION_VERTICAL 0
-
-#define NEAR_MARIO_LATERALLY 30
-#define MARIO_X 40
-#define MIDDLE_X 50
-#define MARIO_Y 60
-#define MARIO_Z 70
-#define MIDDLE_Y 80
-
-#define DONT_RESET_TIMER -56
-#define RESET_TIMER 100
+/// Painting that uses 1 or more images as a texture
+#define PAINTING_IMAGE 0
+/// Painting that has one texture used for an environment map effect
+#define PAINTING_ENV_MAP 1
struct Painting
{
s16 id;
- s8 faceCount;
- s8 rippleShape;
+ /// How many images should be drawn when the painting is rippling.
+ s8 imageCount;
+ /// Either PAINTING_IMAGE or PAINTING_ENV_MAP
+ s8 textureType;
+ /// The floor mario was on last frame
s8 lastFloor;
+ /// The floor mario is currently on
s8 currFloor;
+ /// The floor mario just entered
s8 floorEntered;
- s8 rippleStatus;
+ /// The painting's state, see top of paintings.c
+ s8 state;
- float vXRotation;
- float vYRotation;
+ /// The painting's rotation
+ f32 pitch;
+ f32 yaw;
- float vXPos;
- float vYPos;
- float vZPos;
+ /// The painting's position
+ f32 posX;
+ f32 posY;
+ f32 posZ;
- float currRippleMag;
- float passiveRippleMag;
- float entryRippleMag;
+ /// Controls how high the peaks of the ripple are.
+ f32 currRippleMag;
+ f32 passiveRippleMag;
+ f32 entryRippleMag;
- float rippleMagMultiplier;
- float passiveRippleMagMultiplier;
- float entryRippleMagMultiplier;
+ /// Multiplier that controls how fast the ripple regresses to the IDLE state.
+ f32 rippleDecay;
+ f32 passiveRippleDecay;
+ f32 entryRippleDecay;
- float currRippleRate;
- float passiveRippleRate;
- float entryRippleRate;
+ /// Controls the ripple's frequency
+ f32 currRippleRate;
+ f32 passiveRippleRate;
+ f32 entryRippleRate;
- float dispersionFactor; // the rate at which the magnitude of the ripple decreases as you move farther from the central point of the ripple
- float passiveDispersionFactor;
- float entryDispersionFactor;
+ /// The rate at which the magnitude of the ripple decreases as you move farther from the central
+ /// point of the ripple
+ f32 dispersionFactor;
+ f32 passiveDispersionFactor;
+ f32 entryDispersionFactor;
- float rippleTimer;
+ /// How far the ripple has spread
+ f32 rippleTimer;
- float horizontalRippleSpot;
- float verticalRippleSpot;
+ /// The x and y origin of the ripple
+ f32 rippleX;
+ f32 rippleY;
- const Gfx *displayList58;
- const s16 *const *meshData;
+ /// Display list used when the painting is normal.
+ const Gfx *normalDisplayList;
+ /// Data used to map the texture to the mesh
+ const s16 *const *textureMaps;
+
+ // Texture data
const u8 *const *textureArray;
s16 textureWidth;
s16 textureHeight;
- const Gfx *displayList68;
+
+ /// Display list used when the painting is rippling.
+ const Gfx *rippleDisplayList;
+ /// Controls when a passive ripple starts. RIPPLE_TRIGGER_CONTINUOUS or RIPPLE_TRIGGER_PROXIMITY.
s8 rippleTrigger;
- u8 brightness;
- s8 lastMarioUnderPainting;
- s8 currMarioUnderPainting;
- s8 marioNewlyUnderPainting;
- float vSize;
+
+ /// The painting's transparency. Determines what layer the painting is in.
+ u8 alpha;
+
+ /// True if mario was under the painting's y coordinate last frame
+ s8 marioWasUnder;
+ /// True if mario is currently under the painting's y coordinate
+ s8 marioIsUnder;
+ /// True if mario just went under the painting's y coordinate on this frame
+ s8 marioWentUnder;
+
+ /// Uniformly scales the painting to a multiple of PAINTING_SIZE.
+ /// By default a painting is 614.0 x 614.0
+ f32 size;
};
extern struct Painting cotmc_painting;
@@ -114,23 +137,26 @@ extern struct Painting thi_huge_painting;
extern struct Painting ttm_slide_painting;
extern u16 gAreaUpdateCounter;
-extern float gPaintingMarioYEntry;
+extern f32 gPaintingMarioYEntry;
// defined in file
extern s16 gPaintingMarioFloorType;
-extern float gPaintingMarioXPos, gPaintingMarioYPos, gPaintingMarioZPos;
-
-struct Thing { //TODO: Give me a better name
- /*0x00*/ s16 unk0[3];
- /*0x06*/ s8 unk6[3];
+extern f32 gPaintingMarioXPos, gPaintingMarioYPos, gPaintingMarioZPos;
+
+/**
+ * Contains the position and normal of a vertex in the painting's generated mesh.
+ */
+struct PaintingMeshVertex {
+ /*0x00*/ s16 pos[3];
+ /*0x06*/ s8 norm[3];
};
-extern struct Thing *D_8035FFA0;
-extern Vec3f *D_8035FFA4;
-extern struct Painting *ripplingPainting;
-extern s8 dddStatus;
+extern struct PaintingMeshVertex *gPaintingMesh;
+extern Vec3f *gPaintingTriNorms;
+extern struct Painting *gRipplingPainting;
+extern s8 gDddPaintingStatus;
-extern Gfx *Geo18_802D5B98(s32 run, struct GraphNode *node, void *context);
-extern Gfx *Geo18_802D5D0C(s32 run, struct GraphNode *node, f32 c[4][4]);
+extern Gfx *geo_painting_draw(s32 run, struct GraphNode *node, void *context);
+extern Gfx *geo_painting_update(s32 run, struct GraphNode *node, f32 c[4][4]);
#endif /* PAINTINGS_H */
diff --git a/src/game/save_file.c b/src/game/save_file.c
@@ -44,7 +44,7 @@ STATIC_ASSERT(ARRAY_COUNT(gLevelToCourseNumTable) == LEVEL_COUNT - 1,
// This was probably used to set progress to 100% for debugging, but
// it was removed from the release ROM.
-static void no_op(void) {
+static void stub_save_file_1(void) {
UNUSED s32 pad;
}
@@ -316,7 +316,7 @@ void save_file_load_all(void) {
}
}
- no_op();
+ stub_save_file_1();
}
/**
diff --git a/src/game/save_file.h b/src/game/save_file.h
@@ -150,9 +150,11 @@ void check_if_should_set_warp_checkpoint(struct WarpNode *a);
s32 check_warp_checkpoint(struct WarpNode *a);
#ifdef VERSION_EU
-#define LANGUAGE_ENGLISH 0
-#define LANGUAGE_FRENCH 1
-#define LANGUAGE_GERMAN 2
+enum EuLanguages {
+ LANGUAGE_ENGLISH,
+ LANGUAGE_FRENCH,
+ LANGUAGE_GERMAN
+};
void eu_set_language(u16 language);
u16 eu_get_language(void);
diff --git a/src/game/segment2.h b/src/game/segment2.h
@@ -41,8 +41,8 @@ extern Gfx dl_paintings_rippling_begin[];
extern Gfx dl_paintings_rippling_end[];
extern Gfx dl_paintings_env_mapped_begin[];
extern Gfx dl_paintings_env_mapped_end[];
-extern u8 seg2_triangle_mesh[];
-extern u8 seg2_mesh_order[];
+extern u8 seg2_painting_triangle_mesh[];
+extern u8 seg2_painting_mesh_neighbor_tris[];
extern u8* main_hud_lut[58];
extern Gfx dl_hud_img_load_tex_block[];
extern Gfx dl_hud_img_begin[];
diff --git a/src/game/sound_init.c b/src/game/sound_init.c
@@ -73,11 +73,11 @@ static s8 paintingEjectSoundPlayed = FALSE;
static void play_menu_sounds_extra(int a, void *b);
-void func_80248C10(void) {
+void reset_volume(void) {
D_8032C6C0 = 0;
}
-void func_80248C28(s32 a) // Soften volume
+void lower_background_noise(s32 a) // Soften volume
{
switch (a) {
case 1:
@@ -90,7 +90,7 @@ void func_80248C28(s32 a) // Soften volume
D_8032C6C0 |= a;
}
-void func_80248CB8(s32 a) // harden volume
+void raise_background_noise(s32 a) // harden volume
{
switch (a) {
case 1:
@@ -103,14 +103,14 @@ void func_80248CB8(s32 a) // harden volume
D_8032C6C0 &= ~a;
}
-void func_80248D48(void) {
+void disable_background_sound(void) {
if (D_8032C6C4 == 0) {
D_8032C6C4 = 1;
sound_banks_disable(2, 0x037A);
}
}
-void func_80248D90(void) {
+void enable_background_sound(void) {
if (D_8032C6C4 == 1) {
D_8032C6C4 = 0;
sound_banks_enable(2, 0x037A);
@@ -157,9 +157,8 @@ void play_menu_sounds(s16 soundMenuFlags) {
* Plays the painting eject sound effect if it has not already been played
*/
void play_painting_eject_sound(void) {
- if (ripplingPainting != NULL
- && ripplingPainting->rippleStatus == 2) // ripple when Mario enters painting
- {
+ if (gRipplingPainting != NULL && gRipplingPainting->state == PAINTING_ENTERED) {
+ // ripple when Mario enters painting
if (paintingEjectSoundPlayed == FALSE) {
play_sound(SOUND_GENERAL_PAINTING_EJECT,
gMarioStates[0].marioObj->header.gfx.cameraToObject);
@@ -207,14 +206,14 @@ void set_background_music(u16 a, u16 seqArgs, s16 fadeTimer) {
}
}
-void func_802491FC(s16 fadeOutTime) {
+void fadeout_music(s16 fadeOutTime) {
func_803210D4(fadeOutTime);
sCurrentMusic = MUSIC_NONE;
sCurrentShellMusic = MUSIC_NONE;
sCurrentCapMusic = MUSIC_NONE;
}
-void func_8024924C(s16 fadeTimer) {
+void fadeout_level_music(s16 fadeTimer) {
sequence_player_fade_out(0, fadeTimer);
sCurrentMusic = MUSIC_NONE;
sCurrentShellMusic = MUSIC_NONE;
diff --git a/src/game/sound_init.h b/src/game/sound_init.h
@@ -16,18 +16,18 @@
#define SOUND_MENU_MODE_MONO 1
#define SOUND_MENU_MODE_HEADSET 2
-extern void func_80248C10(void);
-extern void func_80248CB8(s32);
-extern void func_80248C28(s32);
-extern void func_80248D48(void);
-extern void func_80248D90(void);
+extern void reset_volume(void);
+extern void raise_background_noise(s32);
+extern void lower_background_noise(s32);
+extern void disable_background_sound(void);
+extern void enable_background_sound(void);
extern void set_sound_mode(u16);
extern void play_menu_sounds(s16 a);
extern void play_painting_eject_sound(void);
extern void play_infinite_stairs_music(void);
extern void set_background_music(u16, u16, s16);
-extern void func_802491FC(s16);
-extern void func_8024924C(s16 fadeTimer);
+extern void fadeout_music(s16);
+extern void fadeout_level_music(s16 fadeTimer);
extern void play_cutscene_music(u16);
extern void play_shell_music(void);
extern void stop_shell_music(void);
diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c
@@ -363,6 +363,6 @@ struct Object *create_object(const BehaviorScript *behScript) {
* Mark an object to be unloaded at the end of the frame.
*/
void mark_obj_for_deletion(struct Object *obj) {
- //! Same issue as mark_object_for_deletion
+ //! Same issue as obj_mark_for_deletion
obj->activeFlags = ACTIVE_FLAGS_DEACTIVATED;
}
diff --git a/src/game/spawn_sound.c b/src/game/spawn_sound.c
@@ -28,14 +28,14 @@ void exec_anim_sound_state(struct SoundState *soundStates) {
// in the sound state information, -1 (0xFF) is for empty
// animFrame entries. These checks skips them.
if ((animFrame = soundStates[stateIdx].animFrame1) >= 0) {
- if (obj_check_anim_frame(animFrame)) {
- PlaySound2(soundStates[stateIdx].soundMagic);
+ if (cur_obj_check_anim_frame(animFrame)) {
+ cur_obj_play_sound_2(soundStates[stateIdx].soundMagic);
}
}
if ((animFrame = soundStates[stateIdx].animFrame2) >= 0) {
- if (obj_check_anim_frame(animFrame)) {
- PlaySound2(soundStates[stateIdx].soundMagic);
+ if (cur_obj_check_anim_frame(animFrame)) {
+ cur_obj_play_sound_2(soundStates[stateIdx].soundMagic);
}
}
} break;
@@ -54,17 +54,16 @@ void create_sound_spawner(s32 soundMagic) {
/*
* The following 2 functions are relevent to the sound state function
- * above. While only PlaySound2 is used, they may have been intended as
+ * above. While only cur_obj_play_sound_2 is used, they may have been intended as
* seperate left/right leg functions that went unused.
*/
-void PlaySound(s32 soundMagic) {
+void cur_obj_play_sound_1(s32 soundMagic) {
if (gCurrentObject->header.gfx.node.flags & 0x0001) {
play_sound(soundMagic, gCurrentObject->header.gfx.cameraToObject);
}
}
-// duplicate function, but its the used one
-void PlaySound2(s32 soundMagic) {
+void cur_obj_play_sound_2(s32 soundMagic) {
if (gCurrentObject->header.gfx.node.flags & 0x0001) {
play_sound(soundMagic, gCurrentObject->header.gfx.cameraToObject);
}
diff --git a/src/game/spawn_sound.h b/src/game/spawn_sound.h
@@ -16,8 +16,8 @@ struct SoundState
s32 soundMagic;
};
-extern void PlaySound(s32);
-extern void PlaySound2(s32);
+extern void cur_obj_play_sound_1(s32);
+extern void cur_obj_play_sound_2(s32);
extern void create_sound_spawner(s32);
extern void exec_anim_sound_state(struct SoundState *soundStates);
diff --git a/src/menu/file_select.c b/src/menu/file_select.c
@@ -20,6 +20,12 @@
#include "file_select.h"
#include "dialog_ids.h"
+#include "eu_translation.h"
+#ifdef VERSION_EU
+#undef LANGUAGE_FUNCTION
+#define LANGUAGE_FUNCTION sLanguageMode
+#endif
+
/**
* @file file_select.c
* This file implements how the file select and it's menus render and function.
@@ -27,11 +33,10 @@
* special menu messages and phases, button states and button clicked checks.
*/
-
#ifdef VERSION_US
// The current sound mode is automatically centered on US due to
// the large length difference between options.
-// sSoundTextY unused (EU supports its existance).
+// sSoundTextY unused (EU supports its existence).
static s16 sSoundTextX;
static s16 sSoundTextY;
#endif
@@ -56,7 +61,7 @@ static struct Object *sMainMenuButtons[NUM_BUTTONS];
#ifdef VERSION_EU
// The current sound mode is automatically centered on US due to
// the large length difference between options.
-// sSoundTextY unused
+// sSoundTextY is unused
static s16 sSoundTextX;
static s16 sSoundTextY;
#endif
@@ -65,12 +70,11 @@ static s16 sSoundTextY;
// sYesNoColor[0]: YES | sYesNoColor[1]: NO
static u8 sYesNoColor[2];
-// Unused variable that is written to for the centered X value for some strings.
+// Unused variable that is written to define centered X value for some strings.
#ifdef VERSION_EU
static s16 sCenteredX;
#endif
-
// The button that is selected when it is clicked.
static s8 sSelectedButtonID = MENU_BUTTON_NONE;
@@ -113,17 +117,10 @@ static s16 sMainMenuTimer = 0;
// 0: gSoundMode = 0 (Stereo) | 1: gSoundMode = 3 (Mono) | 2: gSoundMode = 1 (Headset)
static s8 sSoundMode = 0;
-// PAL changes most text to arrays for each language. This define allows these
-// differences to be combined.
+// Active language for PAL arrays, values defined similar to sSoundMode
+// 0: English | 1: French | 2: German
#ifdef VERSION_EU
- #define LANGUAGE_ARRAY(cmd) cmd[sLanguageMode]
-#else
- #define LANGUAGE_ARRAY(cmd) cmd
-#endif
-
-// Active language for PAL arrays.
-#ifdef VERSION_EU
-static s8 sLanguageMode = LANGUAGE_EN;
+static s8 sLanguageMode = LANGUAGE_ENGLISH;
#endif
// Tracks which button will be pressed in the erase confirmation prompt (yes/no).
@@ -141,7 +138,7 @@ static s8 sSelectedFileNum = 0;
// coin high score, 1 for high score across all files.
static s8 sScoreFileCoinScoreMode = 0;
-// If no save file exists, open the language menu so the user can find it.
+// In PAL, if no save file exists, open the language menu so the user can find it.
#ifdef VERSION_EU
static s8 sOpenLangSettings = FALSE;
#endif
@@ -272,7 +269,7 @@ static unsigned char textNo[][5] = {{ TEXT_NO }, { TEXT_NO_FR }, { TEXT_NO_DE }}
#endif
#ifdef VERSION_EU
-// TODO: Should the following should be data local to functions?
+// In EU, Erase File and Sound Select strings are outside it's print string function
static unsigned char textEraseFile[][17] = {
{ TEXT_ERASE_FILE_BUTTON }, { TEXT_ERASE_FILE_BUTTON_FR }, { TEXT_ERASE_FILE_BUTTON_DE }
};
@@ -299,7 +296,7 @@ static unsigned char textLanguage[][9] = {{ TEXT_ENGLISH }, { TEXT_FRENCH }, { T
static unsigned char textMario[] = { TEXT_MARIO };
static unsigned char textHiScore[][15] = {{ TEXT_HI_SCORE }, { TEXT_HI_SCORE_FR }, { TEXT_HI_SCORE_DE }};
-static unsigned char textMyScore2[][10] = {{ TEXT_MY_SCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE }};
+static unsigned char textMyScore[][10] = {{ TEXT_MY_SCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE }};
static unsigned char textNew[][5] = {{ TEXT_NEW }, { TEXT_NEW_FR }, { TEXT_NEW_DE }};
static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE };
@@ -321,7 +318,7 @@ void beh_yellow_background_menu_init(void) {
* Properly scales the background in the main menu.
*/
void beh_yellow_background_menu_loop(void) {
- obj_scale(9.0f);
+ cur_obj_scale(9.0f);
}
/**
@@ -558,7 +555,7 @@ void bhv_menu_button_loop(void) {
sCursorClickingTimer = 4;
break;
}
- obj_scale(gCurrentObject->oMenuButtonScale);
+ cur_obj_scale(gCurrentObject->oMenuButtonScale);
}
/**
@@ -645,7 +642,6 @@ void render_score_menu_buttons(struct Object *scoreButton) {
#else
#define SCORE_TIMER 31
#endif
-
/**
* In the score menu, checks if a button was clicked to play a sound, button state and other functions.
*/
@@ -793,17 +789,10 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) {
sFadeOutText = TRUE;
sMainMenuTimer = 0;
save_file_copy(sSelectedFileIndex, copyFileButtonID - MENU_BUTTON_COPY_MIN);
- #ifdef VERSION_EU
sMainMenuButtons[copyFileButtonID]->header.gfx.sharedChild =
gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE];
sMainMenuButtons[copyFileButtonID - MENU_BUTTON_COPY_MIN]->header.gfx.sharedChild =
gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE];
- #else
- sMainMenuButtons[copyFileButtonID]->header.gfx.sharedChild =
- gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE];
- sMainMenuButtons[copyFileButtonID - MENU_BUTTON_COPY_MIN]->header.gfx.sharedChild =
- gLoadedGraphNodes[MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE];
- #endif
} else {
// If clicked in a existing save file, play buzz sound
if (MENU_BUTTON_COPY_FILE_A + sSelectedFileIndex == copyFileButtonID) {
@@ -1019,9 +1008,9 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) {
#undef MAIN_RETURN_TIMER
#ifdef VERSION_EU
- #define SOUND_Y 388
+ #define SOUND_BUTTON_Y 388
#else
- #define SOUND_Y 0
+ #define SOUND_BUTTON_Y 0
#endif
/**
@@ -1030,15 +1019,15 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) {
void render_sound_mode_menu_buttons(struct Object *soundModeButton) {
// Stereo option button
sMainMenuButtons[MENU_BUTTON_STEREO] = spawn_object_rel_with_rot(
- soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, SOUND_Y, -100, 0, -0x8000, 0);
+ soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, SOUND_BUTTON_Y, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_STEREO]->oMenuButtonScale = 0.11111111f;
// Mono option button
sMainMenuButtons[MENU_BUTTON_MONO] = spawn_object_rel_with_rot(
- soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, SOUND_Y, -100, 0, -0x8000, 0);
+ soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 0, SOUND_BUTTON_Y, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_MONO]->oMenuButtonScale = 0.11111111f;
// Headset option button
sMainMenuButtons[MENU_BUTTON_HEADSET] = spawn_object_rel_with_rot(
- soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, SOUND_Y, -100, 0, -0x8000, 0);
+ soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, -533, SOUND_BUTTON_Y, -100, 0, -0x8000, 0);
sMainMenuButtons[MENU_BUTTON_HEADSET]->oMenuButtonScale = 0.11111111f;
#ifdef VERSION_EU
@@ -1064,7 +1053,7 @@ void render_sound_mode_menu_buttons(struct Object *soundModeButton) {
sMainMenuButtons[MENU_BUTTON_OPTION_MIN + sSoundMode]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN;
#endif
}
-#undef SOUND_Y
+#undef SOUND_BUTTON_Y
/**
* In the sound mode menu, checks if a button was clicked to change sound mode & button state.
@@ -1078,14 +1067,16 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) {
s16 buttonY = sMainMenuButtons[buttonID]->oPosY;
if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) {
- // If sound mode button clicked, select it
- // The check will always be true because of the group configured above
+ // If sound mode button clicked, select it and define sound mode
+ // The check will always be true because of the group configured above (In JP & US)
if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO
|| buttonID == MENU_BUTTON_HEADSET) {
if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) {
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
#ifndef VERSION_EU
+ // Sound menu buttons don't return to Main Menu in EU
+ // because they don't have a case in bhv_menu_button_manager_loop
sSelectedButtonID = buttonID;
#endif
sSoundMode = buttonID - MENU_BUTTON_OPTION_MIN;
@@ -1093,6 +1084,7 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) {
}
}
#ifdef VERSION_EU
+ // If language mode button clicked, select it and change language
if (buttonID == MENU_BUTTON_LANGUAGE_ENGLISH || buttonID == MENU_BUTTON_LANGUAGE_FRENCH
|| buttonID == MENU_BUTTON_LANGUAGE_GERMAN) {
if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) {
@@ -1102,6 +1094,7 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) {
eu_set_language(sLanguageMode);
}
}
+ // If neither of the buttons above are pressed, return to main menu
if (buttonID == MENU_BUTTON_LANGUAGE_RETURN) {
play_sound(SOUND_MENU_CLICK_FILE_SELECT, gDefaultSoundArgs);
sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT;
@@ -1351,7 +1344,7 @@ void bhv_menu_button_manager_init(void) {
sMainMenuButtons[MENU_BUTTON_ERASE] = spawn_object_rel_with_rot(
gCurrentObject, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, 2134, -3500, 0, 0, 0, 0);
sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonScale = 1.0f;
- // Sound mode menu button
+ // Sound mode menu button (Option Mode in EU)
sMainMenuButtons[MENU_BUTTON_SOUND_MODE] = spawn_object_rel_with_rot(
gCurrentObject, MODEL_MAIN_MENU_PURPLE_SOUND_BUTTON, bhvMenuButton, 6400, -3500, 0, 0, 0, 0);
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonScale = 1.0f;
@@ -1359,7 +1352,7 @@ void bhv_menu_button_manager_init(void) {
sTextBaseAlpha = 0;
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND
#else
#define SAVE_FILE_SOUND SOUND_MENU_STAR_SOUND_OKEY_DOKEY
@@ -1396,7 +1389,8 @@ void check_main_menu_clicked_buttons(void) {
}
}
#ifdef VERSION_EU
- if (sOpenLangSettings == TRUE){
+ // Open Options Menu if sOpenLangSettings is TRUE (It's TRUE when there's no saves)
+ if (sOpenLangSettings == TRUE) {
sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING;
sSelectedButtonID = MENU_BUTTON_SOUND_MODE;
sOpenLangSettings = FALSE;
@@ -1542,6 +1536,8 @@ void bhv_menu_button_manager_loop(void) {
check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]);
break;
+ // STEREO, MONO and HEADSET buttons are undefined so they can be selected without
+ // exiting the Options menu, as a result they added a return button
#ifdef VERSION_EU
case MENU_BUTTON_LANGUAGE_RETURN:
return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]);
@@ -1729,7 +1725,7 @@ void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) {
}
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define SELECT_FILE_X 96
#define SCORE_X 50
#define COPY_X 115
@@ -1763,7 +1759,10 @@ void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) {
/**
* Prints main menu strings that shows on the yellow background menu screen.
- * Does not print the strings of text for EU, only the symbols.
+ *
+ * In EU this function acts like "print_save_file_strings" because
+ * print_main_lang_strings is first called to render the strings for the 4 buttons.
+ * Same rule applies for score, copy and erase strings.
*/
void print_main_menu_strings(void) {
// Print "SELECT FILE" text
@@ -1785,7 +1784,7 @@ void print_main_menu_strings(void) {
print_generic_string(SCORE_X, 39, textScore);
print_generic_string(COPY_X, 39, textCopy);
print_generic_string(ERASE_X, 39, textErase);
-#ifndef VERSION_JP
+#if !defined(VERSION_JP) && !defined(VERSION_SH)
sSoundTextX = get_str_x_pos_from_center(254, textSoundModes[sSoundMode], 10.0f);
#endif
print_generic_string(SOUNDMODE_X1, 39, textSoundModes[sSoundMode]);
@@ -1803,33 +1802,34 @@ void print_main_menu_strings(void) {
#ifdef VERSION_EU
/**
- * Prints main menu strings that shows on the yellow background menu screen with language switching.
- * Calls print_main_menu_strings to print the other symbols.
+ * Prints the first part main menu strings that shows on the yellow background menu screen.
+ * Has the strings for the 4 buttons below the save buttons that get changed depending of the language.
+ * Calls print_main_menu_strings to print the remaining strings.
*/
-void print_lang_strings(void) {
+void print_main_lang_strings(void) {
s16 centeredX;
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
- centeredX = get_str_x_pos_from_center_scale(0xa0, textSelectFile[sLanguageMode], 12.0f);
+ centeredX = get_str_x_pos_from_center_scale(160, textSelectFile[sLanguageMode], 12.0f);
sCenteredX = centeredX;
- print_hud_lut_string(2, centeredX, 35, textSelectFile[sLanguageMode]);
+ print_hud_lut_string(HUD_LUT_GLOBAL, centeredX, 35, textSelectFile[sLanguageMode]);
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end);
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
- centeredX = get_str_x_pos_from_center(0x4C, textScore[sLanguageMode], 10.0f);
+ centeredX = get_str_x_pos_from_center(76, textScore[sLanguageMode], 10.0f);
sCenteredX = centeredX;
- print_generic_string(centeredX, 0x27, textScore[sLanguageMode]);
- centeredX = get_str_x_pos_from_center(0x83, textCopy[sLanguageMode], 10.0f);
+ print_generic_string(centeredX, 39, textScore[sLanguageMode]);
+ centeredX = get_str_x_pos_from_center(131, textCopy[sLanguageMode], 10.0f);
sCenteredX = centeredX;
- print_generic_string(centeredX, 0x27, textCopy[sLanguageMode]);
- centeredX = get_str_x_pos_from_center(0xbd, textErase[sLanguageMode], 10.0f);
+ print_generic_string(centeredX, 39, textCopy[sLanguageMode]);
+ centeredX = get_str_x_pos_from_center(189, textErase[sLanguageMode], 10.0f);
sCenteredX = centeredX;
- print_generic_string(centeredX, 0x27, textErase[sLanguageMode]);
- centeredX = get_str_x_pos_from_center(0xf5, textOption[sLanguageMode], 10.0f);
+ print_generic_string(centeredX, 39, textErase[sLanguageMode]);
+ centeredX = get_str_x_pos_from_center(245, textOption[sLanguageMode], 10.0f);
sCenteredX = centeredX;
- print_generic_string(centeredX, 0x27, textOption[sLanguageMode]);
+ print_generic_string(centeredX, 39, textOption[sLanguageMode]);
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
print_main_menu_strings();
@@ -1871,7 +1871,7 @@ void score_menu_display_message(s8 messageID) {
}
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define RETURN_X 45
#define COPYFILE_X1 128
#define ERASEFILE_X1 228
@@ -1955,7 +1955,7 @@ void print_score_menu_strings(void) {
#endif
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define NOFILE_COPY_X 90
#define COPY_FILE_X 90
#define COPYIT_WHERE_X 90
@@ -2074,7 +2074,7 @@ void copy_menu_update_message(void) {
}
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define VIEWSCORE_X1 133
#define ERASEFILE_X2 220
#elif VERSION_EU
@@ -2137,7 +2137,7 @@ void print_copy_menu_strings(void) {
#endif
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define CURSOR_X 160.0f
#define MENU_ERASE_YES_MIN_X 0x91
#define MENU_ERASE_YES_MAX_X 0xA4
@@ -2214,7 +2214,11 @@ void print_erase_menu_prompt(s16 x, s16 y) {
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
}
-#ifdef VERSION_JP
+// MARIO_ERASED_VAR is the value there the letter "A" is, it works like this:
+// US and EU --- JP
+// M a r i o A --- マ リ オ A
+// 0 1 2 3 4 5 6 --- 0 1 2 3
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define ERASE_FILE_X 96
#define NOSAVE_DATA_X3 90
#define MARIO_ERASED_VAR 3
@@ -2325,7 +2329,7 @@ void erase_menu_update_message(void) {
}
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define VIEWSCORE_X2 133
#define COPYFILE_X2 223
#else
@@ -2347,7 +2351,7 @@ void print_erase_menu_strings(void) {
// Print messageID called inside a erase_menu_update_message case
erase_menu_display_message(sStatusMessageID);
- #ifndef VERSION_EU
+#ifndef VERSION_EU
// Print file star counts
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
@@ -2356,28 +2360,29 @@ void print_erase_menu_strings(void) {
print_save_file_star_count(SAVE_FILE_C, 90, 119);
print_save_file_star_count(SAVE_FILE_D, 211, 119);
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end);
- #endif
+#endif
// Print menu names
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
- #ifdef VERSION_EU
+
+#ifdef VERSION_EU
centeredX = get_str_x_pos_from_center(69, textReturn[sLanguageMode], 10.0f);
print_generic_string(centeredX, 35, textReturn[sLanguageMode]);
centeredX = get_str_x_pos_from_center(159, textViewScore[sLanguageMode], 10.0f);
print_generic_string(centeredX, 35, textViewScore[sLanguageMode]);
centeredX = get_str_x_pos_from_center(249, textCopyFileButton[sLanguageMode], 10.0f);
print_generic_string(centeredX, 35, textCopyFileButton[sLanguageMode]);
- #else
+#else
print_generic_string(RETURN_X, 35, textReturn);
print_generic_string(VIEWSCORE_X2, 35, textViewScore);
print_generic_string(COPYFILE_X2, 35, textCopyFileButton);
- #endif
+#endif
gSPDisplayList(gDisplayListHead++, dl_ia_text_end);
- #ifdef VERSION_EU
+#ifdef VERSION_EU
print_main_menu_strings();
- #else
+#else
// Print file names
gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
@@ -2386,10 +2391,10 @@ void print_erase_menu_strings(void) {
print_menu_generic_string(89, 105, textMarioC);
print_menu_generic_string(211, 105, textMarioD);
gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end);
- #endif
+#endif
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define SOUND_HUD_X 96
#elif VERSION_US
#define SOUND_HUD_X 88
@@ -2397,6 +2402,8 @@ void print_erase_menu_strings(void) {
/**
* Prints sound mode menu strings that shows on the purple background menu screen.
+ *
+ * In EU, this function acts like "print_option_mode_menu_strings" because of languages.
*/
void print_sound_mode_menu_strings(void) {
s32 mode;
@@ -2424,9 +2431,10 @@ void print_sound_mode_menu_strings(void) {
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end);
- // Print sound mode names
gSPDisplayList(gDisplayListHead++, dl_ia_text_begin);
-#ifdef VERSION_EU
+
+#ifdef VERSION_EU // In EU their X position get increased each string
+ // Print sound mode names
for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) {
if (mode == sSoundMode) {
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
@@ -2438,7 +2446,7 @@ void print_sound_mode_menu_strings(void) {
141, textSoundModes[sLanguageMode * 3 + mode]);
}
- // EU also prints language names in this menu
+ // In EU, print language mode names
for (mode = 0, textX = 90; mode < 3; textX += 70, mode++) {
if (mode == sLanguageMode) {
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
@@ -2450,6 +2458,7 @@ void print_sound_mode_menu_strings(void) {
72, textLanguage[mode]);
}
#else
+ // Print sound mode names
for (mode = 0; mode < 3; mode++) {
if (mode == sSoundMode) {
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha);
@@ -2493,6 +2502,16 @@ void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) {
#endif
}
+#if defined(VERSION_JP) || defined(VERSION_SH)
+ #define HISCORE_COIN_ICON_X 0
+ #define HISCORE_COIN_TEXT_X 16
+ #define HISCORE_COIN_NAMES_X 45
+#else
+ #define HISCORE_COIN_ICON_X 18
+ #define HISCORE_COIN_TEXT_X 34
+ #define HISCORE_COIN_NAMES_X 60
+#endif
+
/**
* Prints course coins collected in a score menu save file.
*/
@@ -2501,7 +2520,7 @@ void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s1
u8 stars = save_file_get_star_flags(fileIndex, courseIndex);
unsigned char textCoinX[] = { TEXT_COIN_X };
unsigned char textStar[] = { TEXT_STAR };
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define LENGTH 5
#else
#define LENGTH 8
@@ -2525,25 +2544,14 @@ void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s1
}
// HISCORE
else {
-#ifdef VERSION_JP
- // Print "[coin] x"
- print_menu_generic_string(x, y, textCoinX);
- // Print coin highscore
- int_to_str((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText);
- print_menu_generic_string(x + 16, y, coinScoreText);
- // Print coin highscore file
- print_menu_generic_string(x + 45, y,
- fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]);
-#else
// Print "[coin] x"
- print_menu_generic_string(x + 18, y, textCoinX);
+ print_menu_generic_string(x + HISCORE_COIN_ICON_X, y, textCoinX);
// Print coin highscore
int_to_str((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText);
- print_menu_generic_string(x + 34, y, coinScoreText);
+ print_menu_generic_string(x + HISCORE_COIN_TEXT_X, y, coinScoreText);
// Print coin highscore file
- print_menu_generic_string(x + 60, y,
+ print_menu_generic_string(x + HISCORE_COIN_NAMES_X, y,
fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]);
-#endif
}
}
@@ -2552,7 +2560,7 @@ void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s1
*/
void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
s16 i = 0;
- unsigned char starScoreText[20]; // unknown length
+ unsigned char starScoreText[19];
u8 stars = save_file_get_star_flags(fileIndex, courseIndex);
s8 starCount = save_file_get_course_star_count(fileIndex, courseIndex);
// Don't count 100 coin star
@@ -2568,7 +2576,7 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
print_menu_generic_string(x, y, starScoreText);
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define MARIO_X 28
#define FILE_LETTER_X 86
#define LEVEL_NAME_X 23
@@ -2592,34 +2600,35 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
* Prints save file score strings that shows when a save file is chosen inside the score menu.
*/
void print_save_file_scores(s8 fileIndex) {
- // TODO: This beginning decl-order stuff can be simplified by moving the
- // static declarations here.
-#ifdef VERSION_EU
+#ifndef VERSION_EU
+ unsigned char textMario[] = { TEXT_MARIO };
+#endif
+#ifndef VERSION_US
unsigned char textFileLetter[] = { TEXT_ZERO };
+#endif
+#if defined(VERSION_JP) || defined(VERSION_SH)
+ void **levelNameTable = segmented_to_virtual(seg2_course_name_table);
+#endif
+#ifndef VERSION_EU
+ unsigned char textHiScore[] = { TEXT_HI_SCORE };
+ unsigned char textMyScore[] = { TEXT_MY_SCORE };
+ #ifdef VERSION_US
+ unsigned char textFileLetter[] = { TEXT_ZERO };
+ void **levelNameTable = segmented_to_virtual(seg2_course_name_table);
+ #endif
+#else
void **levelNameTable;
switch (sLanguageMode) {
- case LANGUAGE_EN:
+ case LANGUAGE_ENGLISH:
levelNameTable = segmented_to_virtual(eu_course_strings_en_table);
break;
- case LANGUAGE_FR:
+ case LANGUAGE_FRENCH:
levelNameTable = segmented_to_virtual(eu_course_strings_fr_table);
break;
- case LANGUAGE_DE:
+ case LANGUAGE_GERMAN:
levelNameTable = segmented_to_virtual(eu_course_strings_de_table);
break;
}
-#else
- unsigned char textMario[] = { TEXT_MARIO };
- #ifdef VERSION_JP
- unsigned char textFileLetter[] = { TEXT_ZERO };
- void **levelNameTable = segmented_to_virtual(seg2_course_name_table);
- #endif
- unsigned char textHiScore[] = { TEXT_HI_SCORE };
- unsigned char textMyScore[] = { TEXT_MY_SCORE };
- #ifdef VERSION_US
- unsigned char textFileLetter[] = { TEXT_ZERO };
- void **levelNameTable = segmented_to_virtual(seg2_course_name_table);
- #endif
#endif
textFileLetter[0] = fileIndex + ASCII_TO_DIALOG('A'); // get letter of file selected
@@ -2640,7 +2649,7 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
//! Huge print list, for loops exist for a reason!
// PADCHAR is used to difference an x position value between
// JP and US when the course number is only one digit.
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define PADCHAR 0
#define PRINT_COURSE_SCORES(courseIndex, pad) \
print_menu_generic_string(23 + (pad * 3), 23 + 12 * courseIndex, segmented_to_virtual(levelNameTable[courseIndex - 1])); \
@@ -2677,28 +2686,22 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) {
// Print castle secret stars
print_score_file_castle_secret_stars(fileIndex, SECRET_STARS_X, 215);
-#ifdef VERSION_EU
- if (sScoreFileCoinScoreMode == 0) {
- print_menu_generic_string(
- get_str_x_pos_from_center(257, textMyScore2[sLanguageMode], 10.0f),
- 24,
- textMyScore2[sLanguageMode]
- );
- } else {
- print_menu_generic_string(
- get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f),
- 24,
- textHiScore[sLanguageMode]
- );
- }
-#else
// Print current coin score mode
if (sScoreFileCoinScoreMode == 0) {
+#ifdef VERSION_EU
+ print_menu_generic_string(get_str_x_pos_from_center(257, textMyScore[sLanguageMode], 10.0f),
+ 24, textMyScore[sLanguageMode]);
+#else
print_menu_generic_string(MYSCORE_X, 24, textMyScore);
+#endif
} else {
+#ifdef VERSION_EU
+ print_menu_generic_string(get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f),
+ 24,textHiScore[sLanguageMode]);
+#else
print_menu_generic_string(HISCORE_X, 24, textHiScore);
- }
#endif
+ }
gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end);
}
@@ -2714,8 +2717,8 @@ static void print_file_select_strings(void) {
switch (sSelectedButtonID) {
case MENU_BUTTON_NONE:
#ifdef VERSION_EU
- // Ultimately calls print_main_menu_strings, but prints strings first.
- print_lang_strings();
+ // Ultimately calls print_main_menu_strings, but prints main language strings first.
+ print_main_lang_strings();
#else
print_main_menu_strings();
#endif
@@ -2747,8 +2750,8 @@ static void print_file_select_strings(void) {
break;
}
// If all 4 save file exists, define true to sAllFilesExist to prevent more copies in copy menu
- if (save_file_exists(SAVE_FILE_A) == TRUE && save_file_exists(SAVE_FILE_B) == TRUE && save_file_exists(SAVE_FILE_C) == TRUE
- && save_file_exists(SAVE_FILE_D) == TRUE) {
+ if (save_file_exists(SAVE_FILE_A) == TRUE && save_file_exists(SAVE_FILE_B) == TRUE &&
+ save_file_exists(SAVE_FILE_C) == TRUE && save_file_exists(SAVE_FILE_D) == TRUE) {
sAllFilesExist = TRUE;
} else {
sAllFilesExist = FALSE;
@@ -2817,9 +2820,9 @@ s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) {
sMainMenuTimer = 0;
sEraseYesNoHoverState = MENU_ERASE_HOVER_NONE;
sSoundMode = save_file_get_sound_mode();
-
#ifdef VERSION_EU
sLanguageMode = eu_get_language();
+
for (fileNum = 0; fileNum < 4; fileNum++) {
if (save_file_exists(fileNum) == TRUE) {
sOpenLangSettings = FALSE;
@@ -2829,7 +2832,6 @@ s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) {
}
}
#endif
-
//! no return value
#ifdef AVOID_UB
return 0;
diff --git a/src/menu/file_select.h b/src/menu/file_select.h
@@ -124,12 +124,6 @@ enum SoundModeMenuActionPhase {
SOUND_MODE_PHASE_MAIN
};
-enum Languages {
- LANGUAGE_EN,
- LANGUAGE_FR,
- LANGUAGE_DE
-};
-
extern u32 gGlobalTimer;
extern void beh_yellow_background_menu_init(void);
diff --git a/src/menu/level_select_menu.c b/src/menu/level_select_menu.c
@@ -49,7 +49,7 @@ int run_press_start_demo_timer(s32 timer) {
// player is idle on PRESS START screen.
// start the mario demo animation for the demo list.
- func_80278AD4(&gDemo, gDemoInputListID);
+ load_patchable_table(&gDemo, gDemoInputListID);
// if the next demo sequence ID is the count limit, reset it back to
// the first sequence.
diff --git a/src/menu/star_select.c b/src/menu/star_select.c
@@ -17,7 +17,7 @@
#include "behavior_data.h"
#include "text_strings.h"
#include "star_select.h"
-#include "game/eu_translation.h"
+#include "eu_translation.h"
/**
* @file star_select.c
@@ -79,7 +79,7 @@ void bhv_act_selector_star_type_loop(void) {
break;
}
// Scale act selector stars depending of the type selected
- obj_scale(gCurrentObject->oStarSelectorSize);
+ cur_obj_scale(gCurrentObject->oStarSelectorSize);
// Unused timer, only referenced here. Probably replaced by sActSelectorMenuTimer
gCurrentObject->oStarSelectorTimer++;
}
@@ -211,21 +211,23 @@ void print_course_number(void) {
create_dl_translation_matrix(MENU_MTX_PUSH, 158.0f, 81.0f, 0.0f);
+ // Full wood texture in JP & US, lower part of it on EU
gSPDisplayList(gDisplayListHead++, dl_menu_rgba16_wood_course);
#ifdef VERSION_EU
+ // Change upper part of the wood texture depending of the language defined
switch (language) {
- case 0:
+ case LANGUAGE_ENGLISH:
gSPDisplayList(gDisplayListHead++, dl_menu_texture_course_upper);
break;
- case 1:
+ case LANGUAGE_FRENCH:
gSPDisplayList(gDisplayListHead++, dl_menu_texture_niveau_upper);
break;
- case 2:
+ case LANGUAGE_GERMAN:
gSPDisplayList(gDisplayListHead++, dl_menu_texture_kurs_upper);
break;
}
-
+
gSPDisplayList(gDisplayListHead++, dl_menu_rgba16_wood_course_end);
#endif
@@ -244,7 +246,7 @@ void print_course_number(void) {
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_end);
}
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
#define ACT_NAME_X 158
#else
#define ACT_NAME_X 163
@@ -284,22 +286,22 @@ void print_act_selector_strings(void) {
#ifdef VERSION_EU
switch (language) {
- case 0:
+ case LANGUAGE_ENGLISH:
actNameTbl = segmented_to_virtual(act_name_table_eu_en);
levelNameTbl = segmented_to_virtual(course_name_table_eu_en);
break;
- case 1:
+ case LANGUAGE_FRENCH:
actNameTbl = segmented_to_virtual(act_name_table_eu_fr);
levelNameTbl = segmented_to_virtual(course_name_table_eu_fr);
break;
- case 2:
+ case LANGUAGE_GERMAN:
actNameTbl = segmented_to_virtual(act_name_table_eu_de);
levelNameTbl = segmented_to_virtual(course_name_table_eu_de);
break;
}
currLevelName = segmented_to_virtual(levelNameTbl[gCurrCourseNum - 1]);
#endif
-
+
// Print the coin highscore.
gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin);
gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255);
@@ -316,11 +318,12 @@ void print_act_selector_strings(void) {
print_generic_string(102, 118, myScore);
#endif
}
- // Print the level name; add 3 to skip the number and spacing to get to the actual string to center.
- // TODO: There has to be a way to merge these, but US seems to need lvlNameX and EU doesn't
- // TODO: allow it to be declared.
+
#ifdef VERSION_EU
print_generic_string(get_str_x_pos_from_center(160, currLevelName + 3, 10.0f), 33, currLevelName + 3);
+#elif defined(VERSION_SH)
+ lvlNameX = get_str_x_pos_from_center_scale(160, currLevelName + 3, 10.0f);
+ print_generic_string(lvlNameX, 33, currLevelName + 3);
#else
lvlNameX = get_str_x_pos_from_center(160, currLevelName + 3, 10.0f);
print_generic_string(lvlNameX, 33, currLevelName + 3);
@@ -339,9 +342,12 @@ void print_act_selector_strings(void) {
// Print the name of the selected act.
if (sVisibleStars != 0) {
selectedActName = segmented_to_virtual(actNameTbl[(gCurrCourseNum - 1) * 6 + sSelectedActIndex]);
-// TODO: Same merge issues as levelNameX above.
+
#ifdef VERSION_EU
print_menu_generic_string(get_str_x_pos_from_center(ACT_NAME_X, selectedActName, 8.0f), 81, selectedActName);
+#elif defined(VERSION_SH)
+ actNameX = get_str_x_pos_from_center_scale(ACT_NAME_X, selectedActName, 8.0f);
+ print_menu_generic_string(actNameX, 81, selectedActName);
#else
actNameX = get_str_x_pos_from_center(ACT_NAME_X, selectedActName, 8.0f);
print_menu_generic_string(actNameX, 81, selectedActName);
@@ -414,7 +420,7 @@ s32 lvl_update_obj_and_load_act_button_actions(UNUSED s32 arg, UNUSED s32 unused
#else
if ((gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON | B_BUTTON | Z_TRIG))) {
#endif
-#ifdef VERSION_JP
+#if defined(VERSION_JP) || defined(VERSION_SH)
play_sound(SOUND_MENU_STAR_SOUND, gDefaultSoundArgs);
#else
play_sound(SOUND_MENU_STAR_SOUND_LETS_A_GO, gDefaultSoundArgs);
diff --git a/tools/apply_patch.sh b/tools/apply_patch.sh
diff --git a/tools/create_patch.sh b/tools/create_patch.sh
diff --git a/tools/ido5.3_compiler/usr/lib/acpp b/tools/ido5.3_compiler/usr/lib/acpp
Binary files differ.
diff --git a/tools/ido5.3_compiler/usr/lib/copt b/tools/ido5.3_compiler/usr/lib/copt
Binary files differ.
diff --git a/tools/patch_libmalloc.py b/tools/patch_libmalloc.py
diff --git a/tools/revert_patch.sh b/tools/revert_patch.sh
diff --git a/undefined_syms.txt b/undefined_syms.txt
@@ -28,3 +28,7 @@ D_B0000014 = 0xB0000014;
D_C0000000 = 0xC0000000;
D_C0000008 = 0xC0000008;
D_C000000C = 0xC000000C;
+
+/* Shindou symbols */
+func_sh_802F69CC = 0x802F69CC;
+func_sh_8024CC7C = 0x8024CC7C;
+\ No newline at end of file