From 36e34b9c1c850b064a09d8ba4dc00ac89bf3ff51 Mon Sep 17 00:00:00 2001 From: Banjo Kazooie Date: Sat, 21 Jan 2023 20:27:01 -0600 Subject: [PATCH] document core2/ch/bubble.c --- decompressed.us.v10.yaml | 6 +++--- include/enums.h | 8 +++++--- src/core2/{code_3ECE0.c => ch/bubble.c} | 22 +++++++++++----------- src/core2/spawnqueue.c | 4 ++-- 4 files changed, 21 insertions(+), 19 deletions(-) rename src/core2/{code_3ECE0.c => ch/bubble.c} (64%) diff --git a/decompressed.us.v10.yaml b/decompressed.us.v10.yaml index a2277585..bb234c2b 100644 --- a/decompressed.us.v10.yaml +++ b/decompressed.us.v10.yaml @@ -643,7 +643,7 @@ segments: - [0xF92D30, c, ch/gameSelect] #DONE - [0xF94430, c, code_3EAD0] #DONE - [0xF94590, c, code_3EC30] #DONE - - [0xF94640, c, code_3ECE0] #DONE + - [0xF94640, c, ch/bubble] #DONE - [0xF94850, c, ch/bigbutt] #DONE - [0xF95A50, c, code_400F0] #DONE - [0xF96400, c, ch/jiggy] #DONE @@ -940,7 +940,7 @@ segments: - [0x10347A0, .data, ch/gameSelect] - [0x1034900, .data, code_3EAD0] - [0x1034980, .data, code_3EC30] - - [0x10349B0, .data, code_3ECE0] + - [0x10349B0, .data, ch/bubble] - [0x10349E0, .data, ch/bigbutt] - [0x1034AC0, .data, code_400F0] - [0x1034C60, .data, ch/jiggy] @@ -1209,7 +1209,7 @@ segments: - [0x1044990, .rodata, code_3AE10] - [0x10449A0, .rodata, spawnqueue] - [0x10449F0, .rodata, ch/gameSelect] - - [0x1044B70, .rodata, code_3ECE0] + - [0x1044B70, .rodata, ch/bubble] - [0x1044B80, .rodata, ch/bigbutt] - [0x1044C60, .rodata, code_400F0] - [0x1044CC0, .rodata, ch/jiggy] diff --git a/include/enums.h b/include/enums.h index 97357087..4b26b87d 100644 --- a/include/enums.h +++ b/include/enums.h @@ -3469,6 +3469,8 @@ enum asset_e ASSET_701_SPRITE_LENS_SHUTTER_MASK, ASSET_702_SPRITE_UNKNOWN, + ASSET_704_SPRITE_BUBBLE = 0x704, + ASSET_708_SPRITE_EGG_PROJECTILE = 0x708, ASSET_70A_SPRITE_BUBBLE_1 = 0x70a, @@ -3765,9 +3767,9 @@ enum marker_e{ MARKER_67_JUJU = 0x67, MARKER_69_CHUMP_FISH = 0x69, - MARKER_6A_GLOOP = 0x6A, - - MARKER_6C_TANKTUP = 0x6C, + MARKER_6A_GLOOP, + MARKER_6B_GLOOPBUBBLE, + MARKER_6C_TANKTUP, MARKER_6D_TANKTUP_LEG, MARKER_6E_PINK_EGG_LARGEST, diff --git a/src/core2/code_3ECE0.c b/src/core2/ch/bubble.c similarity index 64% rename from src/core2/code_3ECE0.c rename to src/core2/ch/bubble.c index dc759b71..1f2c8b8d 100644 --- a/src/core2/code_3ECE0.c +++ b/src/core2/ch/bubble.c @@ -6,18 +6,18 @@ typedef struct { s32 unk0; }ActorLocal_Core2_3ECE0; -void func_802C5DDC(Actor *this); +void chBubble_update(Actor *this); extern void func_802F32C4(s32, f32[3], f32, ActorMarker *, void(*)(f32[3], f32, ActorMarker *)); /* .data */ -ActorInfo D_80365FE0 = { - 0x6B, 0xE7, 0x704, - 0, NULL, func_802C5DDC, func_80326224, func_80325340, +ActorInfo chBubble = { + MARKER_6B_GLOOPBUBBLE, ACTOR_E7_GLOOP_BUBBLE, ASSET_704_SPRITE_BUBBLE, + 0, NULL, chBubble_update, func_80326224, func_80325340, 0, 0, 0.0f, 0 }; /* .code */ -int func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){ +int __chBubble_func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){ s32 pad2C; Actor *this = marker_getActor(marker); ActorLocal_Core2_3ECE0 *local = (ActorLocal_Core2_3ECE0 *) &this->local; @@ -38,11 +38,11 @@ int func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){ return sp1C; } -void func_802C5D54(Actor *this){ +void __chBubble_freeCallback(Actor *this){ func_8030E988(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 100.0f, 3000.0f); } -void func_802C5DA0(ActorMarker *this_marker, ActorMarker *other_marker){ +void __chBubble_collisionCallback(ActorMarker *this_marker, ActorMarker *other_marker){ Actor *this = marker_getActor(this_marker); ActorLocal_Core2_3ECE0 *local = (ActorLocal_Core2_3ECE0 *) &this->local; local->unk0 = 1; @@ -50,12 +50,12 @@ void func_802C5DA0(ActorMarker *this_marker, ActorMarker *other_marker){ } -void func_802C5DDC(Actor *this){ +void chBubble_update(Actor *this){ if(!this->initialized){ this->initialized = TRUE; - marker_setCollisionScripts(this->marker, func_802C5DA0, NULL, NULL); - marker_setFreeMethod(this->marker, func_802C5D54); - func_802F32C4(func_8032994C(), this->position, 200.0f, this->marker, func_802C5C70); + marker_setCollisionScripts(this->marker, __chBubble_collisionCallback, NULL, NULL); + marker_setFreeMethod(this->marker, __chBubble_freeCallback); + func_802F32C4(func_8032994C(), this->position, 200.0f, this->marker, __chBubble_func_802C5C70); this->unk60 = 10.0f; } } diff --git a/src/core2/spawnqueue.c b/src/core2/spawnqueue.c index 3b4d2532..8494315a 100644 --- a/src/core2/spawnqueue.c +++ b/src/core2/spawnqueue.c @@ -21,7 +21,7 @@ extern ActorInfo D_80365F00; //banjo.cooking extern ActorInfo D_80365F60; extern ActorInfo D_80365F84; //turbotrainers extern ActorInfo D_80365FB0; //shrapnel -extern ActorInfo D_80365FE0; +extern ActorInfo chBubble; extern ActorInfo D_80366090; //bigbutt extern ActorInfo D_803660B4; //brownbull extern ActorInfo D_803662A8; //jiggy @@ -250,7 +250,7 @@ void spawnQueue_reset(void){ spawnableActorList_add(&D_80367A50, actor_new, 0x0000004); //chbadshad spawnableActorList_add(&D_803685A0, actor_new, 0x0000040); //mumbotoken spawnableActorList_add(&D_80367F30, actor_new, 0x0000400); - spawnableActorList_add(&D_80365FE0, actor_new, 0x0000004); + spawnableActorList_add(&chBubble, actor_new, 0x0000004); spawnableActorList_add(&chGloop, actor_new, 0x000008A); //gloop spawnableActorList_add(&D_80366F20, actor_new, 0x0000000); //chshockjump spawnableActorList_add(&D_80366F44, actor_new, 0x0000000); //flight_pad