From 7c218ec8714aa9d4d4f5445291bd575d1bf69238 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 10:48:50 -0300 Subject: [PATCH 01/25] first look at cloudResetAt --- include/mario/mario.h | 4 +--- include/party/party_cloud.h | 5 +++++ src/party/party_cloud.c | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index fa65469..7db142c 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -94,9 +94,7 @@ typedef struct MarioWork { f32 unk144; //0x144 f32 unk148; //0x148 f32 unk14C; //0x14C - f32 unk150; //0x150 - f32 unk154; //0x154 - f32 unk158; //0x158 + Vec unk150; //0x150 f32 camFollowRate; //0x15C u8 unk160[0x168 - 0x160]; //0x160 s32 unk168; //0x168 diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index bbf1d4d..b623f64 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -2,4 +2,9 @@ #include +extern Vec* cloud_at; +extern float float_0p01_8041dfb0; +extern float float_0_8041df70; + void cloudGetAt(Vec* position); +void cloudResetAt(); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index c70afd6..cd5b6e9 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -1,5 +1,6 @@ #include "party/party_cloud.h" #include "party.h" +#include "mario/mario.h" Vec cloud_at; @@ -23,3 +24,25 @@ void cloudGetAt(Vec* position) { } } } + +void cloudResetAt() { + MarioWork* mario = marioGetPtr(); + u32 partyId = marioGetPartyId(); + PartyEntry* party = partyGetPtr(partyId); + + if(party != NULL && party->currentMemberId == PARTY_FLURRIE) { + CameraEntry* camera = camGetPtr(CAMERA_3D); + + cloud_at->x = (camera->target).x; + cloud_at->y = (camera->target).y; + cloud_at->z = (camera->target).z; + + marioCamZoomOffReq2(600); + } + + mario->dispFlags = mario->dispFlags & ~(1 << 8); //kDisableMakeDispDir + mario->dispFlags = mario->dispFlags & ~(1 << 2); //kForceFrontPose + marioAdjustMoveDir(); + mario->unk150.x = float_0p01_8041dfb0; + mario->unk138 = float_0_8041df70; +} From 985ed32d60c3f08918bc37fbb88d9307574ef9c2 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 11:31:17 -0300 Subject: [PATCH 02/25] move globals inside c file --- include/party/party_cloud.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index b623f64..b03047f 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -2,9 +2,5 @@ #include -extern Vec* cloud_at; -extern float float_0p01_8041dfb0; -extern float float_0_8041df70; - void cloudGetAt(Vec* position); void cloudResetAt(); From d2d584c2e6503644b96b11b8f3046bce6a289493 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 12:30:37 -0300 Subject: [PATCH 03/25] finish cloudResetAt --- src/party/party_cloud.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index cd5b6e9..f6e3a80 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -32,10 +32,11 @@ void cloudResetAt() { if(party != NULL && party->currentMemberId == PARTY_FLURRIE) { CameraEntry* camera = camGetPtr(CAMERA_3D); - - cloud_at->x = (camera->target).x; - cloud_at->y = (camera->target).y; - cloud_at->z = (camera->target).z; + cloud_at.x = camera->target.x; + camera = camGetPtr(CAMERA_3D); + cloud_at.y = camera->target.y; + camera = camGetPtr(CAMERA_3D); + cloud_at.z = camera->target.z; marioCamZoomOffReq2(600); } @@ -43,6 +44,6 @@ void cloudResetAt() { mario->dispFlags = mario->dispFlags & ~(1 << 8); //kDisableMakeDispDir mario->dispFlags = mario->dispFlags & ~(1 << 2); //kForceFrontPose marioAdjustMoveDir(); - mario->unk150.x = float_0p01_8041dfb0; - mario->unk138 = float_0_8041df70; + mario->unk150.x = 0.01f; + mario->unk138 = 0.0f; } From b027b040c745cf544632e538164ccd6ed6f0a238 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 13:48:01 -0300 Subject: [PATCH 04/25] decomp cloudGetStatus --- include/party.h | 4 +++- include/party/party_cloud.h | 1 + src/party/party_cloud.c | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/party.h b/include/party.h index e915b5f..33dc227 100644 --- a/include/party.h +++ b/include/party.h @@ -39,7 +39,9 @@ typedef struct PartyEntry { s8 currentSlotId; //0x2F u8 field_0x30; //0x30 s8 currentMemberId; //0x31, PartyMembers - u8 field_0x32[0x160 - 0x32]; //0x32 + u8 field_0x32[0x39 - 0x32]; //0x32 + u8 useMotionId; //0x39 + u8 field_0x3a[0x160 - 0x3a]; MarioWork* playerPtr; //0x160 s32 camId; //0x164 u8 field_0x168[0x188 - 0x168]; //0x168 diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index b03047f..5ce6904 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -4,3 +4,4 @@ void cloudGetAt(Vec* position); void cloudResetAt(); +u8 cloudGetStatus(); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index f6e3a80..fc73ce2 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -47,3 +47,19 @@ void cloudResetAt() { mario->unk150.x = 0.01f; mario->unk138 = 0.0f; } + +u8 cloudGetStatus() { + u32 partyId = marioGetPartyId(); + PartyEntry* party = partyGetPtr(partyId); + u8 status = 2; + + if (party == NULL || (party->currentMemberId == PARTY_FLURRIE && (party->flags & (1 << 8)) == 0)) { + status = 0; + return status; + } + else if (party->useMotionId == 10 && party->useMotionId < 20) { + status = 1; + } + + return status; +} From 2d624dcae1eff5e81d7bc4928062649f5d1b26b5 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 14:13:07 -0300 Subject: [PATCH 05/25] decomp mot_cloud --- include/mario/mario.h | 4 +++- src/party/party_cloud.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index 7db142c..c4961e4 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -70,7 +70,9 @@ typedef struct MarioWork { s8 colorId; //0x3D u8 field_0x3E[0x44 - 0x3E]; //0x3E u32 currSubMotionId; //0x44 - u8 field_0x48[0x5C - 0x48]; //0x48 + u32 wMultiTimer; //0x48 + u8 field_0x48[0x50 - 0x4C]; //0x4C + s16 airTimer; // 0x50 s16 unk5C; //0x5C s16 unk5E; //0x5E s16 unk60; //0x60 diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index fc73ce2..85c93dd 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -63,3 +63,15 @@ u8 cloudGetStatus() { return status; } + +void mot_cloud() { + MarioWork* mario = marioGetPtr(); + + if((mario->trigFlags & 0x1) != 0) { + mario->trigFlags &= ~0x1; + mario->flags &= ~0xF0000; + mario->wMultiTimer = 0; + mario->airTimer = 0; + mario->currSubMotionId = 0; + } +} From c02b7d832cc05e1b4eff3875e6930150c4615a3b Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 18:02:58 -0300 Subject: [PATCH 06/25] decomp cloudGetBreathDir --- include/mario/mario.h | 3 ++- include/party.h | 47 ++++++++++++++++++++++++++++++++++++- include/party/party_cloud.h | 1 + src/party/party_cloud.c | 23 ++++++++++++++++++ 4 files changed, 72 insertions(+), 2 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index c4961e4..6adae02 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -71,8 +71,9 @@ typedef struct MarioWork { u8 field_0x3E[0x44 - 0x3E]; //0x3E u32 currSubMotionId; //0x44 u32 wMultiTimer; //0x48 - u8 field_0x48[0x50 - 0x4C]; //0x4C + u8 field_0x4C[0x50 - 0x4C]; //0x4C s16 airTimer; // 0x50 + u8 field_0x52[0x5C - 0x52]; //0x52 s16 unk5C; //0x5C s16 unk5E; //0x5E s16 unk60; //0x60 diff --git a/include/party.h b/include/party.h index 33dc227..04d4d94 100644 --- a/include/party.h +++ b/include/party.h @@ -28,6 +28,48 @@ typedef enum PartyMember { } PartyMember; #pragma enumsalwaysint on +#pragma enumsalwaysint off +typedef enum PartyFlags { + kIsActive = 0x1, + kIsGrounded = 0x2, + kIsFollower = 0x4, + kIsPartner = 0x8, + kIsJumping = 0x10, + kIsFalling = 0x20, + kIsStepping = 0x40, + kInShallowWater = 0x80, + kIsBeingUsed = 0x100, + kPaperMode = 0x1000, + kMotSlitFloor = 0x2000, + kIsRidingPlane = 0x10000, + kIsRidingShip = 0x20000, + kIsBehindMario = 0x80000, + kSleepOn = 0x400000, + kBgMode = 0x800000, + kDisableFrontWallChk = 0x1000000, + kForceFall = 0x2000000, + kDisableFloors = 0x4000000, + kRunOff = 0x10000000, + kCtrlOff = 0x20000000, + kCtrlOff2 = 0x40000000, + kIsEvtUse = 0x80000000 +} PartyFlags; +#pragma enumsalwaysint on + +#pragma enumsalwaysint off +typedef enum PartySlotId { + kParty, //0x0 + kFollower, //0x1 + kNone = 0xFFFFFFFF +} PartySlotId; +#pragma enumsalwaysint on + +typedef struct UseStruct { + u32 unk0; //0x0 + f32 unk4; //0x4 + u8 field_0x8[0x18 - 0x8]; //0x8 +} UseStruct; + typedef struct PartyEntry { u32 flags; //0x0 u32 flags2; //0x4 @@ -44,7 +86,10 @@ typedef struct PartyEntry { u8 field_0x3a[0x160 - 0x3a]; MarioWork* playerPtr; //0x160 s32 camId; //0x164 - u8 field_0x168[0x188 - 0x168]; //0x168 + s32 yoshiPsndSFXId ; //0x168 + s32 unk16C; //0x16C + UseStruct* useStruct; //0x170 + u8 field_0x168[0x188 - 0x174]; //0x174 } PartyEntry; PartyEntry* partyGetPtr(s32 id); diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index 5ce6904..1c174b7 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -5,3 +5,4 @@ void cloudGetAt(Vec* position); void cloudResetAt(); u8 cloudGetStatus(); +f32 cloudGetBreathDir(void); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 85c93dd..441b0c2 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -1,6 +1,7 @@ #include "party/party_cloud.h" #include "party.h" #include "mario/mario.h" +#include "mario/mario_sbr.h" Vec cloud_at; @@ -75,3 +76,25 @@ void mot_cloud() { mario->currSubMotionId = 0; } } + +f32 cloudGetBreathDir() { + PartyEntry* party = partyGetPtr(kParty); + f32 breathDir; + + if (party == NULL) { + breathDir = 0.0f; + return breathDir; + } + + if ((party->flags & kIsBeingUsed) != 0 && (party->useMotionId < 10)){ + breathDir = -1.0f; + } + else if (party->useStruct == NULL) { + breathDir = 0.0f; + } + else { + breathDir = toMovedir(party->useStruct->unk4); + } + + return breathDir; +} From 42c66d4eeba764b81b0e23754add39d03df33deb Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 18:50:05 -0300 Subject: [PATCH 07/25] Adjust to use enums where possible --- include/mario/mario.h | 35 +++++++++++++++++++++++++++++++++++ src/party/party_cloud.c | 4 ++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index 6adae02..8fc4984 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -50,6 +50,41 @@ typedef enum MarioMotion { } MarioMotion; #pragma enumsalwaysint on +// #pragma enumsalwaysint off +// typedef enum MarioFlags { +// kActive = 0x1, +// kCtrlOff = 0x2, +// kCtrlOff2 = 0x4, +// kKeyOff = 0x8, +// kForcedMovement = 0x20, +// kUseForceDirection = 0x40, +// kStopAirMovement = 0x80, +// kFloorsDisabled = 0x100, +// kForceFall = 0x200, +// kWallsDisabled = 0x400, +// kHammerHitWall = 0x800, +// kPreBattlePhysics = 0x1000, +// kIsCarryingBobbery = 0x2000, +// kItemGetDisabled = 0x4000, +// kIsPushing = 0x8000, +// kIsJumping = 0x10000, +// kIsFalling = 0x20000, +// kIsStepping = 0x40000, +// kHasInputJump = 0x80000, +// kPaperMode = 0x100000, +// kGoneThroughBars = 0x200000, +// kPartyWalkDisabled = 0x400000, +// kSlitAbilityDisabled = 0x800000, +// kTubeMode = 0x1000000, +// kBgMode = 0x2000000, +// kInShallowWater = 0x4000000, +// kIsTouchingCeiling = 0x8000000, +// kChgMotDisabled = 0x10000000, +// kIsShadowMario = 0x40000000, +// kIs8Bit = 0x80000000 +// } MarioFlags; +// #pragma enumsalwaysint on + //TODO: US struct is bigger, 0x2F8 vs 0x2E0 typedef struct MarioWork { u32 flags; //0x0 diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 441b0c2..d957b2a 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -70,7 +70,7 @@ void mot_cloud() { if((mario->trigFlags & 0x1) != 0) { mario->trigFlags &= ~0x1; - mario->flags &= ~0xF0000; + mario->flags &= ~0xF0000; //~(kHasInputJump|kIsStepping|kIsFalling|kIsJumping); mario->wMultiTimer = 0; mario->airTimer = 0; mario->currSubMotionId = 0; @@ -86,7 +86,7 @@ f32 cloudGetBreathDir() { return breathDir; } - if ((party->flags & kIsBeingUsed) != 0 && (party->useMotionId < 10)){ + if ((party->flags & kIsBeingUsed) != 0 && (party->useMotionId < kFall)){ breathDir = -1.0f; } else if (party->useStruct == NULL) { From 2c901a4964e497c42291587318ba97ac7646f8a5 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 19:41:07 -0300 Subject: [PATCH 08/25] decomp cloudGetBreathDist --- include/party.h | 3 ++- src/party/party_cloud.c | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/include/party.h b/include/party.h index 04d4d94..c2c401e 100644 --- a/include/party.h +++ b/include/party.h @@ -67,7 +67,8 @@ typedef enum PartySlotId { typedef struct UseStruct { u32 unk0; //0x0 f32 unk4; //0x4 - u8 field_0x8[0x18 - 0x8]; //0x8 + f32 unk8; //0x8 + u8 field_0x8[0x18 - 0xC]; //0xC } UseStruct; typedef struct PartyEntry { diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index d957b2a..4050fd8 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -98,3 +98,23 @@ f32 cloudGetBreathDir() { return breathDir; } + +f32 cloudGetBreathDist() { + u32 partyId = marioGetPartyId(); + PartyEntry* party = partyGetPtr(partyId); + f32 breathDist; + + if (party == NULL) { + breathDist = 0.0f; + return breathDist; + } + + if ((party->currentMemberId != PARTY_FLURRIE || (party->flags & kIsBeingUsed) == 0) || party->useMotionId < kFall) { + breathDist = 0.0f; + } + else { + breathDist = party->useStruct->unk8; + } + + return breathDist; +} From 20307670c72b254e77736dd21ed7618d545258d4 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 20:28:51 -0300 Subject: [PATCH 09/25] rename enums --- include/mario/mario.h | 152 ++++++++++++++++++++-------------------- include/party.h | 86 +++++++++++------------ src/party/party_cloud.c | 12 ++-- 3 files changed, 125 insertions(+), 125 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index 8fc4984..c23139e 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -5,85 +5,85 @@ #pragma enumsalwaysint off typedef enum MarioMotion { - kStay, //0x0 - kWalk, //0x1 - kDash, //0x2 - kJump, //0x3 - kJumpNPC, //0x4 - kJumpSw, //0x5 - kJumpStand, //0x6 - kJump2, //0x7 - kJump3, //0x8 - kJumpSmall, //0x9 - kFall, //0xA - kFall2, //0xB - kUpstairs, //0xC - kLand, //0xD - kTalk, //0xE - kGetItem, //0xF - kHip, //0x10 - kHip2, //0x11 - kHammer, //0x12 - kHammer2, //0x13 - kJabara, //0x14 - kSlit, //0x15 - kRoll, //0x16 - kKaze, //0x17 - kPlane, //0x18 - kShip, //0x19 - kYoshi, //0x1A - kCloud, //0x1B - kVivian, //0x1C - kDokan, //0x1D - kGrasp, //0x1E - kDamage, //0x1F - kDamageToge, //0x20 - kBottomless, //0x21 - kForceReset, //0x22 - kShadow, //0x23 - kPartyUse, //0x24 - kKpaSwim, //0x25 - kKpaPowUp, //0x26 - kKpaPowDown, //0x27 - kDummy, //0x28 - kMotionMax = 0xFFFF + MARIO_MOTION_STAY, //0x0 + MARIO_MOTION_WALK, //0x1 + MARIO_MOTION_DASH, //0x2 + MARIO_MOTION_JUMP, //0x3 + MARIO_MOTION_JUMP_NPC, //0x4 + MARIO_MOTION_JUMP_SW, //0x5 + MARIO_MOTION_JUMP_STAND, //0x6 + MARIO_MOTION_JUMP_2, //0x7 + MARIO_MOTION_JUMP_3, //0x8 + MARIO_MOTION_JUMP_SMALL, //0x9 + MARIO_MOTION_FALL, //0xA + MARIO_MOTION_FALL_2, //0xB + MARIO_MOTION_UPSTAIRS, //0xC + MARIO_MOTION_LAND, //0xD + MARIO_MOTION_TALK, //0xE + MARIO_MOTION_GET_ITEM, //0xF + MARIO_MOTION_HIP, //0x10 + MARIO_MOTION_HIP_2, //0x11 + MARIO_MOTION_HAMMER, //0x12 + MARIO_MOTION_HAMMER_2, //0x13 + MARIO_MOTION_JABARA, //0x14 + MARIO_MOTION_SLIT, //0x15 + MARIO_MOTION_ROLL, //0x16 + MARIO_MOTION_KAZE, //0x17 + MARIO_MOTION_PLANE, //0x18 + MARIO_MOTION_SHIP, //0x19 + MARIO_MOTION_YOSHI, //0x1A + MARIO_MOTION_CLOUD, //0x1B + MARIO_MOTION_VIVIAN, //0x1C + MARIO_MOTION_DOKAN, //0x1D + MARIO_MOTION_GRASP, //0x1E + MARIO_MOTION_DAMAGE, //0x1F + MARIO_MOTION_DAMAGE_TOGE, //0x20 + MARIO_MOTION_BOTTOMLESS, //0x21 + MARIO_MOTION_FORCE_RESET, //0x22 + MARIO_MOTION_SHADOW, //0x23 + MARIO_MOTION_PARTY_USE, //0x24 + MARIO_MOTION_KPA_SWIM, //0x25 + MARIO_MOTION_KPA_POW_UP, //0x26 + MARIO_MOTION_KPA_POW_DOWN, //0x27 + MARIO_MOTION_DUMMY, //0x28 + MARIO_MOTION_MOTION_MAX = 0xFFFF } MarioMotion; #pragma enumsalwaysint on -// #pragma enumsalwaysint off -// typedef enum MarioFlags { -// kActive = 0x1, -// kCtrlOff = 0x2, -// kCtrlOff2 = 0x4, -// kKeyOff = 0x8, -// kForcedMovement = 0x20, -// kUseForceDirection = 0x40, -// kStopAirMovement = 0x80, -// kFloorsDisabled = 0x100, -// kForceFall = 0x200, -// kWallsDisabled = 0x400, -// kHammerHitWall = 0x800, -// kPreBattlePhysics = 0x1000, -// kIsCarryingBobbery = 0x2000, -// kItemGetDisabled = 0x4000, -// kIsPushing = 0x8000, -// kIsJumping = 0x10000, -// kIsFalling = 0x20000, -// kIsStepping = 0x40000, -// kHasInputJump = 0x80000, -// kPaperMode = 0x100000, -// kGoneThroughBars = 0x200000, -// kPartyWalkDisabled = 0x400000, -// kSlitAbilityDisabled = 0x800000, -// kTubeMode = 0x1000000, -// kBgMode = 0x2000000, -// kInShallowWater = 0x4000000, -// kIsTouchingCeiling = 0x8000000, -// kChgMotDisabled = 0x10000000, -// kIsShadowMario = 0x40000000, -// kIs8Bit = 0x80000000 -// } MarioFlags; -// #pragma enumsalwaysint on +#pragma enumsalwaysint off +typedef enum MarioFlags { + MARIO_ACTIVE = 0x1, + MARIO_CTRL_OFF = 0x2, + MARIO_CTRL_OFF_2 = 0x4, + MARIO_KEY_OFF = 0x8, + MARIO_FORCED_MOVEMENT = 0x20, + MARIO_USE_FORCE_DIRECTION = 0x40, + MARIO_STOP_AIR_MOVEMENT = 0x80, + MARIO_FLOORS_DISABLED = 0x100, + MARIO_FORCE_WALL = 0x200, + MARIO_WALLS_DISABLED = 0x400, + MARIO_HAMMER_HIT_WALL = 0x800, + MARIO_PRE_BATTLE_PHYSICS = 0x1000, + MARIO_IS_CARRYING_BOBBERY = 0x2000, + MARIO_ITEM_GET_DISABLED = 0x4000, + MARIO_IS_PUSHING = 0x8000, + MARIO_IS_JUMPING = 0x10000, + MARIO_IS_FALLING = 0x20000, + MARIO_IS_STEPPING = 0x40000, + MARIO_HAS_INPUT_JUMP = 0x80000, + MARIO_PAPER_MODE = 0x100000, + MARIO_GONE_THROUGH_BARS = 0x200000, + MARIO_PARTY_WALK_DISABLED = 0x400000, + MARIO_SLIT_ABILITY_DISABLED = 0x800000, + MARIO_TUBE_MODE = 0x1000000, + MARIO_BG_MODE = 0x2000000, + MARIO_IN_SHALLOW_WATER = 0x4000000, + MARIO_IS_TOUCHING_CEILING = 0x8000000, + MARIO_CHG_MOT_DISABLED = 0x10000000, + MARIO_IS_SHADOW_MARIO = 0x40000000, + MARIO_IS_8_BIT = 0x80000000 +} MarioFlags; +#pragma enumsalwaysint on //TODO: US struct is bigger, 0x2F8 vs 0x2E0 typedef struct MarioWork { diff --git a/include/party.h b/include/party.h index c2c401e..1e1d58a 100644 --- a/include/party.h +++ b/include/party.h @@ -5,54 +5,54 @@ #pragma enumsalwaysint off typedef enum PartyMember { - PARTY_NONE, //0 - PARTY_GOOMBELLA, //1 - PARTY_KOOPS, //2 - PARTY_BOBBERY, //3 - PARTY_YOSHI, //4 - PARTY_FLURRIE, //5 - PARTY_VIVIAN, //6 - PARTY_MS_MOWZ, //7 - PARTY_EGG, //8 - PARTY_FLAVIO, //9 - PARTY_PUNIO, //10 - PARTY_FRANKLY, //11 - PARTY_GUS, //12 - PARTY_GOOMBELLA_FOLLOWER, //13 - PARTY_KOOPS_FOLLOWER, //14 - PARTY_BOBBERY_FOLLOWER, //15 - PARTY_YOSHI_FOLLOWER, //16 - PARTY_FLURRIE_FOLLOWER, //17 - PARTY_VIVIAN_FOLLOWER, //18 - PARTY_MS_MOWZ_FOLLOWER //19 + PARTY_MEMBER_NONE, //0 + PARTY_MEMBER_GOOMBELLA, //1 + PARTY_MEMBER_KOOPS, //2 + PARTY_MEMBER_BOBBERY, //3 + PARTY_MEMBER_YOSHI, //4 + PARTY_MEMBER_FLURRIE, //5 + PARTY_MEMBER_VIVIAN, //6 + PARTY_MEMBER_MS_MOWZ, //7 + PARTY_MEMBER_EGG, //8 + PARTY_MEMBER_FLAVIO, //9 + PARTY_MEMBER_PUNIO, //10 + PARTY_MEMBER_FRANKLY, //11 + PARTY_MEMBER_GUS, //12 + PARTY_MEMBER_GOOMBELLA_FOLLOWER, //13 + PARTY_MEMBER_KOOPS_FOLLOWER, //14 + PARTY_MEMBER_BOBBERY_FOLLOWER, //15 + PARTY_MEMBER_YOSHI_FOLLOWER, //16 + PARTY_MEMBER_FLURRIE_FOLLOWER, //17 + PARTY_MEMBER_VIVIAN_FOLLOWER, //18 + PARTY_MEMBER_MS_MOWZ_FOLLOWER //19 } PartyMember; #pragma enumsalwaysint on #pragma enumsalwaysint off typedef enum PartyFlags { - kIsActive = 0x1, - kIsGrounded = 0x2, - kIsFollower = 0x4, - kIsPartner = 0x8, - kIsJumping = 0x10, - kIsFalling = 0x20, - kIsStepping = 0x40, - kInShallowWater = 0x80, - kIsBeingUsed = 0x100, - kPaperMode = 0x1000, - kMotSlitFloor = 0x2000, - kIsRidingPlane = 0x10000, - kIsRidingShip = 0x20000, - kIsBehindMario = 0x80000, - kSleepOn = 0x400000, - kBgMode = 0x800000, - kDisableFrontWallChk = 0x1000000, - kForceFall = 0x2000000, - kDisableFloors = 0x4000000, - kRunOff = 0x10000000, - kCtrlOff = 0x20000000, - kCtrlOff2 = 0x40000000, - kIsEvtUse = 0x80000000 + PARTY_FLAG_IS_ACTIVE = 0x1, + PARTY_FLAG_IS_GROUNDED = 0x2, + PARTY_FLAG_IS_FOLLOWER = 0x4, + PARTY_FLAG_IS_PARTNER = 0x8, + PARTY_FLAG_IS_JUMPING = 0x10, + PARTY_FLAG_IS_FALLING = 0x20, + PARTY_FLAG_IS_STEPPING = 0x40, + PARTY_FLAG_IN_SHALLOW_WATER = 0x80, + PARTY_FLAG_IS_BEING_USED = 0x100, + PARTY_FLAG_PAPER_MODE = 0x1000, + PARTY_FLAG_MOT_SLIT_FLOOR = 0x2000, + PARTY_FLAG_IS_RIDING_PLANE = 0x10000, + PARTY_FLAG_IS_RIDING_SHIP = 0x20000, + PARTY_FLAG_IS_BEHIND_MARIO = 0x80000, + PARTY_FLAG_SLEEP_ON = 0x400000, + PARTY_FLAG_BG_MODE = 0x800000, + PARTY_FLAG_DISABLE_FRONT_WALL_CHK = 0x1000000, + PARTY_FLAG_FORCE_FALL = 0x2000000, + PARTY_FLAG_DISABLE_FLOORS = 0x4000000, + PARTY_FLAG_RUN_OFF = 0x10000000, + PARTY_FLAG_CTRL_OFF = 0x20000000, + PARTY_FLAG_CTRL_OFF_2 = 0x40000000, + PARTY_FLAG_IS_EVT_USE = 0x80000000 } PartyFlags; #pragma enumsalwaysint on diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 4050fd8..171fb64 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -10,7 +10,7 @@ void cloudGetAt(Vec* position) { u32 partyId = marioGetPartyId(); PartyEntry* party = partyGetPtr(partyId); - if (party == NULL || (party->currentMemberId == PARTY_FLURRIE && (party->flags & (1 << 8)) == 0)) { + if (party == NULL || (party->currentMemberId == PARTY_MEMBER_FLURRIE && (party->flags & PARTY_FLAG_IS_BEING_USED) == 0)) { return; } @@ -31,7 +31,7 @@ void cloudResetAt() { u32 partyId = marioGetPartyId(); PartyEntry* party = partyGetPtr(partyId); - if(party != NULL && party->currentMemberId == PARTY_FLURRIE) { + if(party != NULL && party->currentMemberId == PARTY_MEMBER_FLURRIE) { CameraEntry* camera = camGetPtr(CAMERA_3D); cloud_at.x = camera->target.x; camera = camGetPtr(CAMERA_3D); @@ -54,7 +54,7 @@ u8 cloudGetStatus() { PartyEntry* party = partyGetPtr(partyId); u8 status = 2; - if (party == NULL || (party->currentMemberId == PARTY_FLURRIE && (party->flags & (1 << 8)) == 0)) { + if (party == NULL || (party->currentMemberId == PARTY_MEMBER_FLURRIE && (party->flags & PARTY_FLAG_IS_BEING_USED) == 0)) { status = 0; return status; } @@ -70,7 +70,7 @@ void mot_cloud() { if((mario->trigFlags & 0x1) != 0) { mario->trigFlags &= ~0x1; - mario->flags &= ~0xF0000; //~(kHasInputJump|kIsStepping|kIsFalling|kIsJumping); + mario->flags &= ~(MARIO_HAS_INPUT_JUMP|MARIO_IS_STEPPING|MARIO_IS_FALLING|MARIO_IS_JUMPING); mario->wMultiTimer = 0; mario->airTimer = 0; mario->currSubMotionId = 0; @@ -86,7 +86,7 @@ f32 cloudGetBreathDir() { return breathDir; } - if ((party->flags & kIsBeingUsed) != 0 && (party->useMotionId < kFall)){ + if ((party->flags & PARTY_FLAG_IS_BEING_USED) != 0 && (party->useMotionId < MARIO_MOTION_FALL)){ breathDir = -1.0f; } else if (party->useStruct == NULL) { @@ -109,7 +109,7 @@ f32 cloudGetBreathDist() { return breathDist; } - if ((party->currentMemberId != PARTY_FLURRIE || (party->flags & kIsBeingUsed) == 0) || party->useMotionId < kFall) { + if ((party->currentMemberId != PARTY_MEMBER_FLURRIE || (party->flags & PARTY_FLAG_IS_BEING_USED) == 0) || party->useMotionId < MARIO_MOTION_FALL) { breathDist = 0.0f; } else { From e02e798110aa216f386a5561b2507fd8ebcf0ae6 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Sun, 31 May 2026 20:58:04 -0300 Subject: [PATCH 10/25] fix renaming errors --- src/mario/mario.c | 6 +++--- src/mario/mario_cam.c | 8 ++++---- src/party/party_kuribo.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mario/mario.c b/src/mario/mario.c index 76fafe5..a9a1135 100644 --- a/src/mario/mario.c +++ b/src/mario/mario.c @@ -126,7 +126,7 @@ BOOL marioItemGetOk(void) { } BOOL marioCaseEventValidChk(void) { - if (mp->currMotionId == kPlane) { + if (mp->currMotionId == MARIO_MOTION_PLANE) { return FALSE; } else { @@ -135,7 +135,7 @@ BOOL marioCaseEventValidChk(void) { } BOOL mario8005BB80(void) { - if (mp->currMotionId == kRoll || mp->flags & 0x100000) { + if (mp->currMotionId == MARIO_MOTION_ROLL || mp->flags & 0x100000) { return FALSE; } return TRUE; @@ -285,7 +285,7 @@ void mario80058374(void) { MarioMotion mot = wp->currMotionId; s32 flags; - if (mot != kShip && mot != kRoll && mot != kPlane && mot != kJabara && mot != kYoshi) { + if (mot != MARIO_MOTION_SHIP && mot != MARIO_MOTION_ROLL && mot != MARIO_MOTION_PLANE && mot != MARIO_MOTION_JABARA && mot != MARIO_MOTION_YOSHI) { flags = wp->dispFlags; if (!(flags & 0x1000000)) { marioChgPose("M_D_1"); //inline diff --git a/src/mario/mario_cam.c b/src/mario/mario_cam.c index dbf9d6c..8344b4d 100644 --- a/src/mario/mario_cam.c +++ b/src/mario/mario_cam.c @@ -22,9 +22,9 @@ void marioResetCamShift(void) { void marioResetCamShiftRate(void) { MarioWork* mario = marioGetPtr(); - mario->unk150 = 0.03; - mario->unk154 = 0.06; - mario->unk158 = 0.06; + mario->unk150.x = 0.03; + mario->unk150.y = 0.06; + mario->unk150.z = 0.06; mario->unk64 = 0.0f; mario->unk68 = 2.0f; mario->unk6C = (Vec){ 0.0f, 0.0f, 0.0f }; @@ -195,7 +195,7 @@ BOOL marioCamZoomUp(void) { yOffset = (320.0f - (f32)mario->unk16C) / 3.5f; } - if (party && party->currentMemberId == PARTY_FLURRIE && party->flags & 0x100) { + if (party && party->currentMemberId == PARTY_MEMBER_FLURRIE && party->flags & 0x100) { angleAdjust = toMovedir(mario->unk1A8) >= 180.0f ? -70.0f : 70.0f; tempX = mario->unk168; zoomDistance = 550.0f; diff --git a/src/party/party_kuribo.c b/src/party/party_kuribo.c index 7c9f7d6..1af8c3a 100644 --- a/src/party/party_kuribo.c +++ b/src/party/party_kuribo.c @@ -9,7 +9,7 @@ u32 msg_ep; //unknown since it only gets written to once and never used BOOL christineGetStatus(void) { PartyEntry* party = partyGetPtr(marioGetPartyId()); - if (!party || party->currentMemberId != PARTY_GOOMBELLA || !(party->flags & 0x100)) { + if (!party || party->currentMemberId != PARTY_MEMBER_GOOMBELLA || !(party->flags & 0x100)) { return FALSE; } return TRUE; From e4a9cb06f5e78c0c5a4ec12370b3e069b18f2e70 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Mon, 1 Jun 2026 10:17:34 -0300 Subject: [PATCH 11/25] add missing includes --- include/mario/mario_cam.h | 3 ++- include/mario/mario_sbr.h | 1 + src/party/party_cloud.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/mario/mario_cam.h b/include/mario/mario_cam.h index d547681..6b4e18e 100644 --- a/include/mario/mario_cam.h +++ b/include/mario/mario_cam.h @@ -2,4 +2,5 @@ #include -s32 marioGetCamId(void); \ No newline at end of file +s32 marioGetCamId(void); +void marioCamZoomOffReq2(s32); diff --git a/include/mario/mario_sbr.h b/include/mario/mario_sbr.h index 95f17c3..3b14d4a 100644 --- a/include/mario/mario_sbr.h +++ b/include/mario/mario_sbr.h @@ -5,3 +5,4 @@ void marioSetBottomlessResetPosition(f32 x, f32 y, f32 z); f32 revise360(f32 angle); f32 toMovedir(f32 angle); +void marioAdjustMoveDir(void); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 171fb64..ef090fb 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -2,6 +2,8 @@ #include "party.h" #include "mario/mario.h" #include "mario/mario_sbr.h" +#include "mario/mario_party.h" +#include "mario/mario_cam.h" Vec cloud_at; From f202e1ed10e74c4879f0e0e95880aa2db74027d3 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Mon, 1 Jun 2026 10:30:01 -0300 Subject: [PATCH 12/25] rename MarioFlag items --- include/mario/mario.h | 60 ++++++++++++++++++++--------------------- src/party/party_cloud.c | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index c23139e..0654b32 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -52,36 +52,36 @@ typedef enum MarioMotion { #pragma enumsalwaysint off typedef enum MarioFlags { - MARIO_ACTIVE = 0x1, - MARIO_CTRL_OFF = 0x2, - MARIO_CTRL_OFF_2 = 0x4, - MARIO_KEY_OFF = 0x8, - MARIO_FORCED_MOVEMENT = 0x20, - MARIO_USE_FORCE_DIRECTION = 0x40, - MARIO_STOP_AIR_MOVEMENT = 0x80, - MARIO_FLOORS_DISABLED = 0x100, - MARIO_FORCE_WALL = 0x200, - MARIO_WALLS_DISABLED = 0x400, - MARIO_HAMMER_HIT_WALL = 0x800, - MARIO_PRE_BATTLE_PHYSICS = 0x1000, - MARIO_IS_CARRYING_BOBBERY = 0x2000, - MARIO_ITEM_GET_DISABLED = 0x4000, - MARIO_IS_PUSHING = 0x8000, - MARIO_IS_JUMPING = 0x10000, - MARIO_IS_FALLING = 0x20000, - MARIO_IS_STEPPING = 0x40000, - MARIO_HAS_INPUT_JUMP = 0x80000, - MARIO_PAPER_MODE = 0x100000, - MARIO_GONE_THROUGH_BARS = 0x200000, - MARIO_PARTY_WALK_DISABLED = 0x400000, - MARIO_SLIT_ABILITY_DISABLED = 0x800000, - MARIO_TUBE_MODE = 0x1000000, - MARIO_BG_MODE = 0x2000000, - MARIO_IN_SHALLOW_WATER = 0x4000000, - MARIO_IS_TOUCHING_CEILING = 0x8000000, - MARIO_CHG_MOT_DISABLED = 0x10000000, - MARIO_IS_SHADOW_MARIO = 0x40000000, - MARIO_IS_8_BIT = 0x80000000 + MARIO_FLAG_ACTIVE = 0x1, + MARIO_FLAG_CTRL_OFF = 0x2, + MARIO_FLAG_CTRL_OFF_2 = 0x4, + MARIO_FLAG_KEY_OFF = 0x8, + MARIO_FLAG_FORCED_MOVEMENT = 0x20, + MARIO_FLAG_USE_FORCE_DIRECTION = 0x40, + MARIO_FLAG_STOP_AIR_MOVEMENT = 0x80, + MARIO_FLAG_FLOORS_DISABLED = 0x100, + MARIO_FLAG_FORCE_WALL = 0x200, + MARIO_FLAG_WALLS_DISABLED = 0x400, + MARIO_FLAG_HAMMER_HIT_WALL = 0x800, + MARIO_FLAG_PRE_BATTLE_PHYSICS = 0x1000, + MARIO_FLAG_IS_CARRYING_BOBBERY = 0x2000, + MARIO_FLAG_ITEM_GET_DISABLED = 0x4000, + MARIO_FLAG_IS_PUSHING = 0x8000, + MARIO_FLAG_IS_JUMPING = 0x10000, + MARIO_FLAG_IS_FALLING = 0x20000, + MARIO_FLAG_IS_STEPPING = 0x40000, + MARIO_FLAG_HAS_INPUT_JUMP = 0x80000, + MARIO_FLAG_PAPER_MODE = 0x100000, + MARIO_FLAG_GONE_THROUGH_BARS = 0x200000, + MARIO_FLAG_PARTY_WALK_DISABLED = 0x400000, + MARIO_FLAG_SLIT_ABILITY_DISABLED = 0x800000, + MARIO_FLAG_TUBE_MODE = 0x1000000, + MARIO_FLAG_BG_MODE = 0x2000000, + MARIO_FLAG_IN_SHALLOW_WATER = 0x4000000, + MARIO_FLAG_IS_TOUCHING_CEILING = 0x8000000, + MARIO_FLAG_CHG_MOT_DISABLED = 0x10000000, + MARIO_FLAG_IS_SHADOW_MARIO = 0x40000000, + MARIO_FLAG_IS_8_BIT = 0x80000000 } MarioFlags; #pragma enumsalwaysint on diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index ef090fb..76a7e48 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -72,7 +72,7 @@ void mot_cloud() { if((mario->trigFlags & 0x1) != 0) { mario->trigFlags &= ~0x1; - mario->flags &= ~(MARIO_HAS_INPUT_JUMP|MARIO_IS_STEPPING|MARIO_IS_FALLING|MARIO_IS_JUMPING); + mario->flags &= ~(MARIO_FLAG_HAS_INPUT_JUMP|MARIO_FLAG_IS_STEPPING|MARIO_FLAG_IS_FALLING|MARIO_FLAG_IS_JUMPING); mario->wMultiTimer = 0; mario->airTimer = 0; mario->currSubMotionId = 0; From d8800ec9b21c788ba9f32453cffe2ca3518fc725 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Mon, 1 Jun 2026 21:43:59 -0300 Subject: [PATCH 13/25] decomp cloudGetBreathPower --- include/party.h | 4 +++- src/party/party_cloud.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/include/party.h b/include/party.h index 1e1d58a..71d9f7a 100644 --- a/include/party.h +++ b/include/party.h @@ -84,7 +84,9 @@ typedef struct PartyEntry { s8 currentMemberId; //0x31, PartyMembers u8 field_0x32[0x39 - 0x32]; //0x32 u8 useMotionId; //0x39 - u8 field_0x3a[0x160 - 0x3a]; + u8 field_0x3A[0x58 - 0x3A]; //0x3A + Vec position; //0x58 + u8 field_0x3a[0x160 - 0x64]; //0x64 MarioWork* playerPtr; //0x160 s32 camId; //0x164 s32 yoshiPsndSFXId ; //0x168 diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 76a7e48..245a702 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -4,6 +4,8 @@ #include "mario/mario_sbr.h" #include "mario/mario_party.h" #include "mario/mario_cam.h" +#include "system.h" +#include Vec cloud_at; @@ -120,3 +122,40 @@ f32 cloudGetBreathDist() { return breathDist; } + +f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { + PartyEntry* party = partyGetPtr(kParty); + f32 breathPower; + f32 dist; + f32 angle; + f32 unk8; + f32 val; + + breathPower = 0.0f; + if (party == NULL) { + return breathPower; + } + + val = 10.0f; + if( + party->currentMemberId == PARTY_MEMBER_FLURRIE + && (party->flags & PARTY_FLAG_IS_BEING_USED) != 0 + && party->useMotionId >= MARIO_MOTION_FALL + && ((fabs(party->position.y - param_2->y - 18.0f)) <= val) + ) { + unk8 = party->useStruct->unk8; + if (-((0.5f * param_1) - distABf(party->position.x, party->position.z, param_2->x, param_2->z)) <= unk8) { + dist = toMovedir(party->useStruct->unk4); + angle = angleABf(party->position.x, party->position.z, param_2->x, param_2->z); + dist = revise360(angle - dist); + + if (dist <= 30.0f || dist >= 330.0f) { + breathPower = cos((3.1415927f * dist) / 180.0f); + val = 100.0f; + breathPower = val * fabsf(breathPower); + } + } + } + + return breathPower; +} From 2abe1756de1a99ed3c2cdfaf086c2a4b430e8c82 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Mon, 1 Jun 2026 22:43:33 -0300 Subject: [PATCH 14/25] start cloudGetHitBreathout --- src/party/party_cloud.c | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 245a702..0884aef 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -159,3 +159,47 @@ f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { return breathPower; } + + +// Might be beyond me at the moment +// +// u8 cloudGetHitBreathout(u8 param_1) { +// u32 partyId = marioGetPartyId(); +// PartyEntry* party = partyGetPtr(partyId); +// u8 hitBreathout; + +// if (party == NULL) { +// hitBreathout = 0.0f; +// return hitBreathout; +// } + +// if ( +// party->currentMemberId == PARTY_MEMBER_FLURRIE +// && (party->flags & PARTY_FLAG_IS_BEING_USED) != 0 +// && party->useMotionId >= MARIO_MOTION_FALL +// ){ +// hitBreathout = 0; +// switch (param_1) { +// case 0: +// hitBreathout = (int)party->useStruct + 0x20; +// break; +// case 1: +// hitBreathout = (int)party->useStruct + 0x24; +// break; +// case 2: +// hitBreathout = (int)party->useStruct + 0x28; +// break; +// case 3: +// hitBreathout = (int)party->useStruct + 0x2C; +// break; +// default: +// hitBreathout = 0; +// break; +// } +// return hitBreathout; +// } +// else { +// hitBreathout = 0; +// } +// return hitBreathout; +// } From b4a8a7ae1766fdf13e9bb0d6535968f074610414 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Tue, 2 Jun 2026 18:59:35 -0300 Subject: [PATCH 15/25] change useStruct to void* --- include/party.h | 9 +-------- src/party/party_cloud.c | 9 +++++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/party.h b/include/party.h index 71d9f7a..4a53635 100644 --- a/include/party.h +++ b/include/party.h @@ -64,13 +64,6 @@ typedef enum PartySlotId { } PartySlotId; #pragma enumsalwaysint on -typedef struct UseStruct { - u32 unk0; //0x0 - f32 unk4; //0x4 - f32 unk8; //0x8 - u8 field_0x8[0x18 - 0xC]; //0xC -} UseStruct; - typedef struct PartyEntry { u32 flags; //0x0 u32 flags2; //0x4 @@ -91,7 +84,7 @@ typedef struct PartyEntry { s32 camId; //0x164 s32 yoshiPsndSFXId ; //0x168 s32 unk16C; //0x16C - UseStruct* useStruct; //0x170 + void* useStruct; //0x170 u8 field_0x168[0x188 - 0x174]; //0x174 } PartyEntry; diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 0884aef..4af1ccd 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -1,4 +1,5 @@ #include "party/party_cloud.h" +#include "dolphin/types.h" #include "party.h" #include "mario/mario.h" #include "mario/mario_sbr.h" @@ -97,7 +98,7 @@ f32 cloudGetBreathDir() { breathDir = 0.0f; } else { - breathDir = toMovedir(party->useStruct->unk4); + breathDir = toMovedir(*(float*)((int)party->useStruct + 0x4)); } return breathDir; @@ -117,7 +118,7 @@ f32 cloudGetBreathDist() { breathDist = 0.0f; } else { - breathDist = party->useStruct->unk8; + breathDist = *(float*)((int)party->useStruct + 0x8); } return breathDist; @@ -143,9 +144,9 @@ f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { && party->useMotionId >= MARIO_MOTION_FALL && ((fabs(party->position.y - param_2->y - 18.0f)) <= val) ) { - unk8 = party->useStruct->unk8; + unk8 = *(float*)((int)party->useStruct + 0x8); if (-((0.5f * param_1) - distABf(party->position.x, party->position.z, param_2->x, param_2->z)) <= unk8) { - dist = toMovedir(party->useStruct->unk4); + dist = toMovedir(*(float*)((int)party->useStruct + 0x4)); angle = angleABf(party->position.x, party->position.z, param_2->x, param_2->z); dist = revise360(angle - dist); From eb9c4ff9d94d8d86d476821cf18f9a0d896212a0 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:11:50 -0300 Subject: [PATCH 16/25] convert MarioFlags to bit shift values --- include/mario/mario.h | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index 0654b32..68195af 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -52,36 +52,36 @@ typedef enum MarioMotion { #pragma enumsalwaysint off typedef enum MarioFlags { - MARIO_FLAG_ACTIVE = 0x1, - MARIO_FLAG_CTRL_OFF = 0x2, - MARIO_FLAG_CTRL_OFF_2 = 0x4, - MARIO_FLAG_KEY_OFF = 0x8, - MARIO_FLAG_FORCED_MOVEMENT = 0x20, - MARIO_FLAG_USE_FORCE_DIRECTION = 0x40, - MARIO_FLAG_STOP_AIR_MOVEMENT = 0x80, - MARIO_FLAG_FLOORS_DISABLED = 0x100, - MARIO_FLAG_FORCE_WALL = 0x200, - MARIO_FLAG_WALLS_DISABLED = 0x400, - MARIO_FLAG_HAMMER_HIT_WALL = 0x800, - MARIO_FLAG_PRE_BATTLE_PHYSICS = 0x1000, - MARIO_FLAG_IS_CARRYING_BOBBERY = 0x2000, - MARIO_FLAG_ITEM_GET_DISABLED = 0x4000, - MARIO_FLAG_IS_PUSHING = 0x8000, - MARIO_FLAG_IS_JUMPING = 0x10000, - MARIO_FLAG_IS_FALLING = 0x20000, - MARIO_FLAG_IS_STEPPING = 0x40000, - MARIO_FLAG_HAS_INPUT_JUMP = 0x80000, - MARIO_FLAG_PAPER_MODE = 0x100000, - MARIO_FLAG_GONE_THROUGH_BARS = 0x200000, - MARIO_FLAG_PARTY_WALK_DISABLED = 0x400000, - MARIO_FLAG_SLIT_ABILITY_DISABLED = 0x800000, - MARIO_FLAG_TUBE_MODE = 0x1000000, - MARIO_FLAG_BG_MODE = 0x2000000, - MARIO_FLAG_IN_SHALLOW_WATER = 0x4000000, - MARIO_FLAG_IS_TOUCHING_CEILING = 0x8000000, - MARIO_FLAG_CHG_MOT_DISABLED = 0x10000000, - MARIO_FLAG_IS_SHADOW_MARIO = 0x40000000, - MARIO_FLAG_IS_8_BIT = 0x80000000 + MARIO_FLAG_ACTIVE = (1 << 0), + MARIO_FLAG_CTRL_OFF = (1 << 1), + MARIO_FLAG_CTRL_OFF_2 = (1 << 2), + MARIO_FLAG_KEY_OFF = (1 << 3), + MARIO_FLAG_FORCED_MOVEMENT = (1 << 5), + MARIO_FLAG_USE_FORCE_DIRECTION = (1 << 6), + MARIO_FLAG_STOP_AIR_MOVEMENT = (1 << 7), + MARIO_FLAG_FLOORS_DISABLED = (1 << 8), + MARIO_FLAG_FORCE_WALL = (1 << 9), + MARIO_FLAG_WALLS_DISABLED = (1 << 10), + MARIO_FLAG_HAMMER_HIT_WALL = (1 << 11), + MARIO_FLAG_PRE_BATTLE_PHYSICS = (1 << 12), + MARIO_FLAG_IS_CARRYING_BOBBERY = (1 << 13), + MARIO_FLAG_ITEM_GET_DISABLED = (1 << 14), + MARIO_FLAG_IS_PUSHING = (1 << 15), + MARIO_FLAG_IS_JUMPING = (1 << 16), + MARIO_FLAG_IS_FALLING = (1 << 17), + MARIO_FLAG_IS_STEPPING = (1 << 18), + MARIO_FLAG_HAS_INPUT_JUMP = (1 << 19), + MARIO_FLAG_PAPER_MODE = (1 << 20), + MARIO_FLAG_GONE_THROUGH_BARS = (1 << 21), + MARIO_FLAG_PARTY_WALK_DISABLED = (1 << 22), + MARIO_FLAG_SLIT_ABILITY_DISABLED = (1 << 23), + MARIO_FLAG_TUBE_MODE = (1 << 24), + MARIO_FLAG_BG_MODE = (1 << 25), + MARIO_FLAG_IN_SHALLOW_WATER = (1 << 26), + MARIO_FLAG_IS_TOUCHING_CEILING = (1 << 27), + MARIO_FLAG_CHG_MOT_DISABLED = (1 << 28), + MARIO_FLAG_IS_SHADOW_MARIO = (1 << 30), + MARIO_FLAG_IS_8_BIT = (1 << 31) } MarioFlags; #pragma enumsalwaysint on From 9f53af2685a57de1ba270cbd950149e9b0dfb9b5 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:14:49 -0300 Subject: [PATCH 17/25] convert PartyFlags to bit shift values --- include/party.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/include/party.h b/include/party.h index 4a53635..16c826f 100644 --- a/include/party.h +++ b/include/party.h @@ -30,29 +30,29 @@ typedef enum PartyMember { #pragma enumsalwaysint off typedef enum PartyFlags { - PARTY_FLAG_IS_ACTIVE = 0x1, - PARTY_FLAG_IS_GROUNDED = 0x2, - PARTY_FLAG_IS_FOLLOWER = 0x4, - PARTY_FLAG_IS_PARTNER = 0x8, - PARTY_FLAG_IS_JUMPING = 0x10, - PARTY_FLAG_IS_FALLING = 0x20, - PARTY_FLAG_IS_STEPPING = 0x40, - PARTY_FLAG_IN_SHALLOW_WATER = 0x80, - PARTY_FLAG_IS_BEING_USED = 0x100, - PARTY_FLAG_PAPER_MODE = 0x1000, - PARTY_FLAG_MOT_SLIT_FLOOR = 0x2000, - PARTY_FLAG_IS_RIDING_PLANE = 0x10000, - PARTY_FLAG_IS_RIDING_SHIP = 0x20000, - PARTY_FLAG_IS_BEHIND_MARIO = 0x80000, - PARTY_FLAG_SLEEP_ON = 0x400000, - PARTY_FLAG_BG_MODE = 0x800000, - PARTY_FLAG_DISABLE_FRONT_WALL_CHK = 0x1000000, - PARTY_FLAG_FORCE_FALL = 0x2000000, - PARTY_FLAG_DISABLE_FLOORS = 0x4000000, - PARTY_FLAG_RUN_OFF = 0x10000000, - PARTY_FLAG_CTRL_OFF = 0x20000000, - PARTY_FLAG_CTRL_OFF_2 = 0x40000000, - PARTY_FLAG_IS_EVT_USE = 0x80000000 + PARTY_FLAG_IS_ACTIVE = (1 << 0), + PARTY_FLAG_IS_GROUNDED = (1 << 1), + PARTY_FLAG_IS_FOLLOWER = (1 << 2), + PARTY_FLAG_IS_PARTNER = (1 << 3), + PARTY_FLAG_IS_JUMPING = (1 << 4), + PARTY_FLAG_IS_FALLING = (1 << 5), + PARTY_FLAG_IS_STEPPING = (1 << 6), + PARTY_FLAG_IN_SHALLOW_WATER = (1 << 7), + PARTY_FLAG_IS_BEING_USED = (1 << 8), + PARTY_FLAG_PAPER_MODE = (1 << 12), + PARTY_FLAG_MOT_SLIT_FLOOR = (1 << 13), + PARTY_FLAG_IS_RIDING_PLANE = (1 << 16), + PARTY_FLAG_IS_RIDING_SHIP = (1 << 17), + PARTY_FLAG_IS_BEHIND_MARIO = (1 << 19), + PARTY_FLAG_SLEEP_ON = (1 << 22), + PARTY_FLAG_BG_MODE = (1 << 23), + PARTY_FLAG_DISABLE_FRONT_WALL_CHK = (1 << 24), + PARTY_FLAG_FORCE_FALL = (1 << 25), + PARTY_FLAG_DISABLE_FLOORS = (1 << 26), + PARTY_FLAG_RUN_OFF = (1 << 28), + PARTY_FLAG_CTRL_OFF = (1 << 29), + PARTY_FLAG_CTRL_OFF_2 = (1 << 30), + PARTY_FLAG_IS_EVT_USE = (1 << 31) } PartyFlags; #pragma enumsalwaysint on From 9ff43d137606ade7b2cbd528612b9f6629a2043a Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:18:50 -0300 Subject: [PATCH 18/25] remove w prefix from multiTimer --- include/mario/mario.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mario/mario.h b/include/mario/mario.h index 68195af..6d8ec9f 100644 --- a/include/mario/mario.h +++ b/include/mario/mario.h @@ -105,7 +105,7 @@ typedef struct MarioWork { s8 colorId; //0x3D u8 field_0x3E[0x44 - 0x3E]; //0x3E u32 currSubMotionId; //0x44 - u32 wMultiTimer; //0x48 + u32 multiTimer; //0x48, ??? u8 field_0x4C[0x50 - 0x4C]; //0x4C s16 airTimer; // 0x50 u8 field_0x52[0x5C - 0x52]; //0x52 From 1db4a948ce92b13815f0df1463d6bc11f457d755 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:20:44 -0300 Subject: [PATCH 19/25] clean up PartySlotId --- include/party.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/party.h b/include/party.h index 16c826f..7f173a6 100644 --- a/include/party.h +++ b/include/party.h @@ -58,9 +58,9 @@ typedef enum PartyFlags { #pragma enumsalwaysint off typedef enum PartySlotId { - kParty, //0x0 - kFollower, //0x1 - kNone = 0xFFFFFFFF + PARTY_SLOT_PARTY = 0, //0x0 + PARTY_SLOT_FOLLOWER = 1, //0x1 + PARTY_SLOT_NONE = -1 } PartySlotId; #pragma enumsalwaysint on From a49eb7f21e68e3ac686228063cb5d6c04024073c Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:21:27 -0300 Subject: [PATCH 20/25] add name changes to decomped code --- src/party/party_cloud.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 4af1ccd..41aeb3d 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -76,14 +76,14 @@ void mot_cloud() { if((mario->trigFlags & 0x1) != 0) { mario->trigFlags &= ~0x1; mario->flags &= ~(MARIO_FLAG_HAS_INPUT_JUMP|MARIO_FLAG_IS_STEPPING|MARIO_FLAG_IS_FALLING|MARIO_FLAG_IS_JUMPING); - mario->wMultiTimer = 0; + mario->multiTimer = 0; mario->airTimer = 0; mario->currSubMotionId = 0; } } f32 cloudGetBreathDir() { - PartyEntry* party = partyGetPtr(kParty); + PartyEntry* party = partyGetPtr(PARTY_SLOT_PARTY); f32 breathDir; if (party == NULL) { @@ -125,7 +125,7 @@ f32 cloudGetBreathDist() { } f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { - PartyEntry* party = partyGetPtr(kParty); + PartyEntry* party = partyGetPtr(PARTY_SLOT_PARTY); f32 breathPower; f32 dist; f32 angle; From a585f91e1ef0dc1c1993bf4ac27f2a697dae79a9 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:29:13 -0300 Subject: [PATCH 21/25] remove temp variables in cloudResetAt --- src/party/party_cloud.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 41aeb3d..80b62b7 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -37,12 +37,9 @@ void cloudResetAt() { PartyEntry* party = partyGetPtr(partyId); if(party != NULL && party->currentMemberId == PARTY_MEMBER_FLURRIE) { - CameraEntry* camera = camGetPtr(CAMERA_3D); - cloud_at.x = camera->target.x; - camera = camGetPtr(CAMERA_3D); - cloud_at.y = camera->target.y; - camera = camGetPtr(CAMERA_3D); - cloud_at.z = camera->target.z; + cloud_at.x = camGetPtr(CAMERA_3D)->target.x; + cloud_at.y = camGetPtr(CAMERA_3D)->target.y; + cloud_at.z = camGetPtr(CAMERA_3D)->target.z; marioCamZoomOffReq2(600); } From 6ad93406aea4c2d096cd981c659098195cb489eb Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 17:32:25 -0300 Subject: [PATCH 22/25] additional party_cloud cleanup --- src/party/party_cloud.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index 80b62b7..c9cb1f2 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -44,8 +44,8 @@ void cloudResetAt() { marioCamZoomOffReq2(600); } - mario->dispFlags = mario->dispFlags & ~(1 << 8); //kDisableMakeDispDir - mario->dispFlags = mario->dispFlags & ~(1 << 2); //kForceFrontPose + mario->dispFlags &= ~(1 << 8); //kDisableMakeDispDir + mario->dispFlags &= ~(1 << 2); //kForceFrontPose marioAdjustMoveDir(); mario->unk150.x = 0.01f; mario->unk138 = 0.0f; @@ -84,8 +84,7 @@ f32 cloudGetBreathDir() { f32 breathDir; if (party == NULL) { - breathDir = 0.0f; - return breathDir; + return 0.0f; } if ((party->flags & PARTY_FLAG_IS_BEING_USED) != 0 && (party->useMotionId < MARIO_MOTION_FALL)){ From dcaec224f08a4369d2098ebc9ada6d663f501930 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Wed, 3 Jun 2026 18:48:18 -0300 Subject: [PATCH 23/25] Add PartyCloud and cast useStruct --- include/party/party_cloud.h | 7 +++++++ src/party/party_cloud.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index 1c174b7..579de39 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -2,6 +2,13 @@ #include +typedef struct PartyCloud { + f32 unk0; + f32 unk4; + f32 unk8; + u8 field_0xC[0x48 - 0xC]; +} PartyCloud; + void cloudGetAt(Vec* position); void cloudResetAt(); u8 cloudGetStatus(); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index c9cb1f2..d67031e 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -94,7 +94,8 @@ f32 cloudGetBreathDir() { breathDir = 0.0f; } else { - breathDir = toMovedir(*(float*)((int)party->useStruct + 0x4)); + PartyCloud* cloud = (PartyCloud*)party->useStruct; + breathDir = toMovedir(cloud->unk4); } return breathDir; @@ -114,7 +115,8 @@ f32 cloudGetBreathDist() { breathDist = 0.0f; } else { - breathDist = *(float*)((int)party->useStruct + 0x8); + PartyCloud* cloud = (PartyCloud*)party->useStruct; + breathDist = cloud->unk8; } return breathDist; @@ -140,9 +142,11 @@ f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { && party->useMotionId >= MARIO_MOTION_FALL && ((fabs(party->position.y - param_2->y - 18.0f)) <= val) ) { - unk8 = *(float*)((int)party->useStruct + 0x8); + PartyCloud* cloud = (PartyCloud*)party->useStruct; + unk8 = cloud->unk8; if (-((0.5f * param_1) - distABf(party->position.x, party->position.z, param_2->x, param_2->z)) <= unk8) { - dist = toMovedir(*(float*)((int)party->useStruct + 0x4)); + PartyCloud* cloud = (PartyCloud*)party->useStruct; + dist = toMovedir(cloud->unk4); angle = angleABf(party->position.x, party->position.z, param_2->x, param_2->z); dist = revise360(angle - dist); From 4e3b00f8b6517c96db4e9000567e8ad0b449fd64 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Thu, 4 Jun 2026 08:59:36 -0300 Subject: [PATCH 24/25] change GUS to CRAW --- include/party.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/party.h b/include/party.h index 7f173a6..c066a2c 100644 --- a/include/party.h +++ b/include/party.h @@ -17,7 +17,7 @@ typedef enum PartyMember { PARTY_MEMBER_FLAVIO, //9 PARTY_MEMBER_PUNIO, //10 PARTY_MEMBER_FRANKLY, //11 - PARTY_MEMBER_GUS, //12 + PARTY_MEMBER_CRAW, //12 PARTY_MEMBER_GOOMBELLA_FOLLOWER, //13 PARTY_MEMBER_KOOPS_FOLLOWER, //14 PARTY_MEMBER_BOBBERY_FOLLOWER, //15 From 5d062a0913cdb0f0b46a6ff58b824090e194bf98 Mon Sep 17 00:00:00 2001 From: Ilwyd Date: Thu, 4 Jun 2026 14:42:35 -0300 Subject: [PATCH 25/25] finish cloudGetHitBreathout --- include/party/party_cloud.h | 14 +++++-- src/party/party_cloud.c | 76 +++++++++++++++++-------------------- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/include/party/party_cloud.h b/include/party/party_cloud.h index 579de39..f644aa1 100644 --- a/include/party/party_cloud.h +++ b/include/party/party_cloud.h @@ -3,13 +3,19 @@ #include typedef struct PartyCloud { - f32 unk0; - f32 unk4; - f32 unk8; - u8 field_0xC[0x48 - 0xC]; + f32 unk0; //0x0 + f32 unk4; //0x4 + f32 unk8; //0x8 + u8 field_0xC[0x20 - 0xC]; // 0xC + s32 unk20; //0x20 + s32 unk24; //0x24 + s32 unk28; //0x28 + s32 unk2C; //0x2C + u8 field_0x30[0x48 - 0xC]; } PartyCloud; void cloudGetAt(Vec* position); void cloudResetAt(); u8 cloudGetStatus(); f32 cloudGetBreathDir(void); +s32 cloudGetHitBreathout(s32 param_1); diff --git a/src/party/party_cloud.c b/src/party/party_cloud.c index d67031e..c58fc20 100644 --- a/src/party/party_cloud.c +++ b/src/party/party_cloud.c @@ -1,5 +1,6 @@ #include "party/party_cloud.h" #include "dolphin/types.h" +#include "musyx/musyx.h" #include "party.h" #include "mario/mario.h" #include "mario/mario_sbr.h" @@ -162,45 +163,36 @@ f32 cloudGetBreathPower(f32 param_1, Vec* param_2) { } -// Might be beyond me at the moment -// -// u8 cloudGetHitBreathout(u8 param_1) { -// u32 partyId = marioGetPartyId(); -// PartyEntry* party = partyGetPtr(partyId); -// u8 hitBreathout; - -// if (party == NULL) { -// hitBreathout = 0.0f; -// return hitBreathout; -// } - -// if ( -// party->currentMemberId == PARTY_MEMBER_FLURRIE -// && (party->flags & PARTY_FLAG_IS_BEING_USED) != 0 -// && party->useMotionId >= MARIO_MOTION_FALL -// ){ -// hitBreathout = 0; -// switch (param_1) { -// case 0: -// hitBreathout = (int)party->useStruct + 0x20; -// break; -// case 1: -// hitBreathout = (int)party->useStruct + 0x24; -// break; -// case 2: -// hitBreathout = (int)party->useStruct + 0x28; -// break; -// case 3: -// hitBreathout = (int)party->useStruct + 0x2C; -// break; -// default: -// hitBreathout = 0; -// break; -// } -// return hitBreathout; -// } -// else { -// hitBreathout = 0; -// } -// return hitBreathout; -// } +s32 cloudGetHitBreathout(s32 param_1) { + u32 partyId = marioGetPartyId(); + PartyEntry* party = partyGetPtr(partyId); + s32 hitBreathout; + + if (party == NULL) { + return 0; + } + + if ( + party->currentMemberId != PARTY_MEMBER_FLURRIE + || (party->flags & PARTY_FLAG_IS_BEING_USED) == 0 + || party->useMotionId < MARIO_MOTION_FALL + ){ + return 0; + } + + hitBreathout = 0; + if (param_1 == 0) { + hitBreathout = ((PartyCloud*)party->useStruct)->unk20; + } + else if (param_1 == 1) { + hitBreathout = ((PartyCloud*)party->useStruct)->unk24; + } + else if (param_1 == 2) { + hitBreathout = ((PartyCloud*)party->useStruct)->unk28; + } + else if (param_1 == 3) { + hitBreathout = ((PartyCloud*)party->useStruct)->unk2C; + } + + return hitBreathout; +}