Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27656,7 +27656,7 @@ efLib_804D64EC = .sbss:0x804D64EC; // type:object size:0x4 scope:global data:4by
efLib_804D64F0 = .sbss:0x804D64F0; // type:object size:0x8 scope:global data:4byte
Fighter_804D64F8 = .sbss:0x804D64F8; // type:object size:0x4 scope:global data:4byte
Fighter_804D64FC = .sbss:0x804D64FC; // type:object size:0x4 scope:global data:4byte
Fighter_804D6500 = .sbss:0x804D6500; // type:object size:0x4 scope:global data:4byte
gCrowdConfig = .sbss:0x804D6500; // type:object size:0x4 scope:global data:4byte
Fighter_804D6504 = .sbss:0x804D6504; // type:object size:0x4 scope:global data:4byte
Fighter_804D6508 = .sbss:0x804D6508; // type:object size:0x4 scope:global data:4byte
Fighter_804D650C = .sbss:0x804D650C; // type:object size:0x4 scope:global data:4byte
Expand Down
4 changes: 2 additions & 2 deletions src/melee/ft/fighter.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ u32 Fighter_804D64F8 = 0;

// the following seems to be an array, initialized in reverse in
struct Fighter_804D64FC_t* Fighter_804D64FC = NULL;
UNK_T Fighter_804D6500 = NULL;
CrowdConfig* gCrowdConfig = NULL;
HSD_Joint* Fighter_804D6504 = NULL;
u8* Fighter_804D6508 = NULL;
u8* Fighter_804D650C = NULL;
Expand Down Expand Up @@ -216,7 +216,7 @@ void Fighter_LoadCommonData(void)
Fighter_804D650C = pData[18];
Fighter_804D6508 = pData[19];
Fighter_804D6504 = pData[20];
Fighter_804D6500 = pData[21];
gCrowdConfig = pData[21];
Fighter_804D64FC = pData[22];
}

Expand Down
1 change: 0 additions & 1 deletion src/melee/ft/fighter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ struct plAllocInfo;
/* 459080 */ extern HSD_ObjAllocData fighter_x2040_alloc_data;
/* 4590AC */ extern HSD_ObjAllocData fighter_x59C_alloc_data;
/* 4598B8 */ extern ftData* gFtDataList[FTKIND_MAX];
/* 4D6500 */ extern UNK_T Fighter_804D6500;
/* 4D6504 */ extern HSD_Joint* Fighter_804D6504;
/* 4D6508 */ extern u8* Fighter_804D6508;
/* 4D650C */ extern u8* Fighter_804D650C;
Expand Down
78 changes: 39 additions & 39 deletions src/melee/vi/vi1202.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void un_80321294(HSD_GObj* gobj)
HSD_CObj* cobj = GET_COBJ(gobj);
HSD_CObjAnim(cobj);
if (cobj->aobj->curr_frame == 1.0F) {
vi_8031C9B4(0xe, 0);
vi_8031C9B4(0xE, 0);
}
if (cobj->aobj->curr_frame == cobj->aobj->end_frame) {
lb_800145F4();
Expand Down Expand Up @@ -80,9 +80,9 @@ void un_80321950(vi1202_UnkStruct* s)
s->x4 = 0x10000;
s->x8 = 1.0F;
s->xC = 0;
s->x10 = M2C_FIELD(Fighter_804D6500, s32*, 0x20);
s->x10 = gCrowdConfig->cheer_limit;
s->x14 = 0x83D60;
s->x18 = M2C_FIELD(Fighter_804D6500, s32*, 0x28);
s->x18 = gCrowdConfig->max_gasp_count;
s->x1C = 0;
s->x20 = 0;
s->x24 = 0;
Expand All @@ -104,10 +104,10 @@ void un_80321A00(HSD_GObj* gobj)
{
s32 zero;
vi1202_UnkStruct* data = un_804D7050;
void* fighter = Fighter_804D6500;
CrowdConfig* vdata = gCrowdConfig;

if (data->x18 >= M2C_FIELD(fighter, s32*, 0x28)) {
if (data->x10 < M2C_FIELD(fighter, s32*, 0x20)) {
if (data->x18 >= vdata->max_gasp_count) {
if (data->x10 < vdata->cheer_limit) {
data->x10 = data->x10 + 1;
}
return;
Expand All @@ -118,12 +118,12 @@ void un_80321A00(HSD_GObj* gobj)
}
data->x18 = data->x18 + 1;

if (data->x18 < M2C_FIELD(Fighter_804D6500, s32*, 0x28)) {
if (data->x18 < gCrowdConfig->max_gasp_count) {
if (data->x1C != 0) {
zero = 0;
data->x1C = zero;
data->x10 = zero;
data->x18 = M2C_FIELD(Fighter_804D6500, s32*, 0x28);
data->x18 = gCrowdConfig->max_gasp_count;
un_80321C28();
if (data->x20 != 0) {
un_80321CA4(0x144);
Expand Down Expand Up @@ -157,7 +157,7 @@ void un_80321AF4(HSD_GObj* gobj)
if (ftLib_8008731C(cur) == 0) {
ftLib_80086644(cur, &pos);

if (pos.y < M2C_FIELD(Fighter_804D6500, f32*, 0x40) +
if (pos.y < gCrowdConfig->blastzone_y_offset +
M2C_FIELD(mpLib, f32*, 0x14))
{
data->x24 = data->x24 + 1;
Expand All @@ -171,8 +171,8 @@ void un_80321AF4(HSD_GObj* gobj)
cur = cur->next;
}

if (old_x24 < M2C_FIELD(Fighter_804D6500, s32*, 0x3C)) {
if (data->x24 >= M2C_FIELD(Fighter_804D6500, s32*, 0x3C)) {
if (old_x24 < gCrowdConfig->fighters_near_blastzone) {
if (data->x24 >= gCrowdConfig->fighters_near_blastzone) {
if (flag != 0) {
un_8032201C(data->xC, 3);
} else {
Expand Down Expand Up @@ -202,12 +202,12 @@ void un_80321C28(void)
void un_80321C70(void)
{
vi1202_UnkStruct* data = un_804D7050;
void* fighter = Fighter_804D6500;
CrowdConfig* vdata = gCrowdConfig;
s32 x18 = data->x18;
if (x18 >= M2C_FIELD(fighter, s32*, 0x28)) {
if (x18 >= vdata->max_gasp_count) {
return;
}
if (x18 >= M2C_FIELD(fighter, s32*, 0x24)) {
if (x18 >= vdata->x24) {
data->x1C = 1;
}
}
Expand Down Expand Up @@ -261,10 +261,10 @@ void un_8032201C(int arg0, s32 cat)

if ((u32) arg0 != 0) {
if ((u32) data->xC == (u32) arg0) {
void* fighter = Fighter_804D6500;
CrowdConfig* vdata = gCrowdConfig;
vi1202_UnkStruct* data2 = un_804D7050;
if (data2->x18 < M2C_FIELD(fighter, s32*, 0x28)) {
if (data2->x18 >= M2C_FIELD(fighter, s32*, 0x24)) {
if (data2->x18 < vdata->max_gasp_count) {
if (data2->x18 >= vdata->x24) {
data2->x1C = 1;
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ void un_80322178(int arg)

bool un_80322258(float arg)
{
f32 val2c = M2C_FIELD(Fighter_804D6500, f32*, 0x2c);
f32 val2c = gCrowdConfig->horiz_margin;
f32 val18 = M2C_FIELD(mpLib_80458868, f32*, 0x18);
f32 val1c;
if (arg >= val2c + val18) {
Expand All @@ -330,36 +330,36 @@ bool un_80322258(float arg)

s32 un_80322298(float arg)
{
void* fighter = Fighter_804D6500;
if (arg >= M2C_FIELD(fighter, f32*, 0x8)) {
CrowdConfig* vdata = gCrowdConfig;
if (arg >= vdata->kb_threshold_high) {
return 3;
}
if (arg >= M2C_FIELD(fighter, f32*, 0x4)) {
if (arg >= vdata->kb_threshold_mid) {
return 2;
}
if (arg >= M2C_FIELD(fighter, f32*, 0x0)) {
if (arg >= vdata->kb_threshold_low) {
return 1;
}
return 0;
}

f32 un_803222EC(f32 arg1, f32 arg2)
{
void* fighter = Fighter_804D6500;
if (!(arg2 > M2C_FIELD(fighter, f32*, 0xc))) {
CrowdConfig* vdata = gCrowdConfig;
if (!(arg2 > vdata->angle_min)) {
return arg1;
}
if (!(arg2 < M2C_FIELD(fighter, f32*, 0x10))) {
if (!(arg2 < vdata->angle_max)) {
return arg1;
}
return arg1 * M2C_FIELD(fighter, f32*, 0x14);
return arg1 * vdata->angle_mult;
}

void un_80322314(void)
{
vi1202_UnkStruct* data = un_804D7050;
void* fighter = Fighter_804D6500;
if (data->x18 >= M2C_FIELD(fighter, s32*, 0x28)) {
CrowdConfig* vdata = gCrowdConfig;
if (data->x18 >= vdata->max_gasp_count) {
return;
}
data->x1C = 1;
Expand All @@ -368,29 +368,29 @@ void un_80322314(void)

bool un_803224DC(s32 spawn_id, f32 pos_x, f32 kb_mag)
{
void* fighter = Fighter_804D6500;
CrowdConfig* vdata = gCrowdConfig;
s32 cat;
s32 out_of_bounds;

if (kb_mag >= M2C_FIELD(fighter, f32*, 0x8)) {
if (kb_mag >= vdata->kb_threshold_high) {
cat = 3;
} else if (kb_mag >= M2C_FIELD(fighter, f32*, 0x4)) {
} else if (kb_mag >= vdata->kb_threshold_mid) {
cat = 2;
} else if (kb_mag >= M2C_FIELD(fighter, f32*, 0x0)) {
} else if (kb_mag >= vdata->kb_threshold_low) {
cat = 1;
} else {
cat = 0;
}

{
f32 val2c = M2C_FIELD(fighter, f32*, 0x2c);
f32 val2c = vdata->horiz_margin;
f32 val18 = M2C_FIELD(mpLib_80458868, f32*, 0x18);
f32 val1c;

if (pos_x < val2c + val18) {
out_of_bounds = 1;
} else {
val1c = M2C_FIELD(mpLib_80458868, f32*, 0x1c);
val1c = M2C_FIELD(mpLib_80458868, f32*, 0x1C);
if (pos_x > val1c - val2c) {
out_of_bounds = 1;
} else {
Expand All @@ -410,18 +410,18 @@ int un_80322598(int arg0, float arg1)
{
f32 val14 = M2C_FIELD(mpLib_80458868, f32*, 0x14);
s32 cat;
void* fighter;
CrowdConfig* vdata;
if (arg1 >= val14) {
goto ret_zero;
}
fighter = Fighter_804D6500;
if (arg1 < M2C_FIELD(fighter, f32*, 0x38) + val14) {
vdata = gCrowdConfig;
if (arg1 < vdata->recovery_y_low + val14) {
ret_zero:
return 0;
}
if (arg1 > M2C_FIELD(fighter, f32*, 0x30) + val14) {
if (arg1 > vdata->recovery_y_high + val14) {
cat = 3;
} else if (arg1 > M2C_FIELD(fighter, f32*, 0x34) + val14) {
} else if (arg1 > vdata->recovery_y_mid + val14) {
cat = 2;
} else {
cat = 1;
Expand Down
35 changes: 35 additions & 0 deletions src/melee/vi/vi1202.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,41 @@

typedef struct vi1202_UnkStruct vi1202_UnkStruct;

/// Configuration for crowd/announcer reactions during matches.
///
/// Evidence for "Crowd" naming:
/// - Symbol names from UnclePunch's Training Mode map (Feb 2019)
/// - Functions at 0x80321900+ named CrowdSFXManager_* in that map
/// - Audio function 0x8002411C named lbAudio_PlayCrowdSFX
/// - Code triggers match wiki descriptions of crowd gasps/cheers
typedef struct CrowdConfig {
/// Knockback thresholds for crowd gasp intensity (cat 1/2/3)
/* 0x00 */ f32 kb_threshold_low;
/* 0x04 */ f32 kb_threshold_mid;
/* 0x08 */ f32 kb_threshold_high;
/// Angle range and multiplier for crowd reaction modifier
/* 0x0C */ f32 angle_min;
/* 0x10 */ f32 angle_max;
/* 0x14 */ f32 angle_mult;
/* 0x18 */ u8 pad18[0x20 - 0x18];
/// Cheer/gasp timing limits
/* 0x20 */ s32 cheer_limit;
/* 0x24 */ s32 x24;
/* 0x28 */ s32 max_gasp_count;
/// Horizontal margin from blast zone for out-of-bounds check
/* 0x2C */ f32 horiz_margin;
/// Y-position thresholds for recovery gasp intensity (cat 3/2/1)
/* 0x30 */ f32 recovery_y_high;
/* 0x34 */ f32 recovery_y_mid;
/* 0x38 */ f32 recovery_y_low;
/// Fighter count threshold to trigger blast zone proximity gasp
/* 0x3C */ s32 fighters_near_blastzone;
/// Y-offset added to blast zone bottom for proximity check
/* 0x40 */ f32 blastzone_y_offset;
} CrowdConfig;

/* 4D6500 */ extern CrowdConfig* gCrowdConfig;

/* 32110C */ void un_8032110C(HSD_GObj*);
/* 321130 */ void un_80321130(HSD_GObj*);
/* 321154 */ void un_80321154(HSD_GObj*);
Expand Down