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
6 changes: 3 additions & 3 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23232,7 +23232,7 @@ grTGn_803E98DC = .data:0x803E98DC; // type:object size:0x34 scope:global
@89 = .data:0x803E9910; // type:object size:0x21 scope:local data:string
@90 = .data:0x803E9934; // type:object size:0xB scope:local data:string
@138 = .data:0x803E9940; // type:object size:0x1F scope:local data:string
unk_arr_803E9960 = .data:0x803E9960; // type:object size:0xD68 scope:global
stage_id_map = .data:0x803E9960; // type:object size:0xD68 scope:global
db_build_timestamp = .data:0x803EA6C8; // type:object size:0x20 data:string
@41 = .data:0x803EA6E8; // type:object size:0x9 scope:local data:string
@42 = .data:0x803EA6F4; // type:object size:0x11 scope:local data:string
Expand Down Expand Up @@ -27218,8 +27218,8 @@ grHr_804D49CC = .sdata:0x804D49CC; // type:object size:0x3 scope:global data:str
grHr_804D49D0 = .sdata:0x804D49D0; // type:object size:0x3 scope:global data:string
grHeal_804D49D8 = .sdata:0x804D49D8; // type:object size:0x8 scope:global data:2byte
grHeal_804D49E0 = .sdata:0x804D49E0; // type:object size:0x5 scope:global data:string
unk_struct_804D49E8 = .sdata:0x804D49E8; // type:object size:0x8 scope:global data:4byte
unk_struct_804D49F0 = .sdata:0x804D49F0; // type:object size:0x8 scope:global data:4byte
selected_stage = .sdata:0x804D49E8; // type:object size:0x8 scope:global data:4byte
default_stage_pair = .sdata:0x804D49F0; // type:object size:0x8 scope:global data:4byte
@137 = .sdata:0x804D49F8; // type:object size:0x8 scope:local data:string
@186 = .sdata:0x804D4A00; // type:object size:0x2 scope:local data:string
DbLevel = .sdata:0x804D4A08; // type:object size:0x4 scope:global data:4byte
Expand Down
6 changes: 3 additions & 3 deletions src/melee/gm/gm_16AE.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void fn_8016B7F8(void)
PAD_STACK(4);

ftLib_800868A4();
Stage_802252E4((InternalStageId) tmp->x24C8.xE, NULL);
Stage_802252E4(tmp->x24C8.xE, NULL);
grStadium_801D4040();
if (!tmp->x24C8.x1_3) {
ifStatus_802F6EA4(4, -1, -1, 0, NULL, fn_8016B784);
Expand Down Expand Up @@ -2000,7 +2000,7 @@ void fn_8016E730(StartMeleeData* arg0)
ftCo_800C06C0();
mpColl_80041C78();
Ground_801C0378(0x40);
Stage_802251E8((enum InternalStageId) arg0->rules.xE, NULL);
Stage_802251E8(arg0->rules.xE, NULL);

r30 = &lbl_8046B6A0;

Expand Down Expand Up @@ -2140,7 +2140,7 @@ void gm_8016EC28_OnEnter(void* arg0)
un_802FD404();
tmp2 = &lbl_8046B6A0;
ftLib_800868A4();
Stage_802252E4((InternalStageId) tmp2->x24C8.xE, NULL);
Stage_802252E4(tmp2->x24C8.xE, NULL);
grStadium_801D4040();
if (!lbl_8046B6A0.x24C8.x1_3) {
ifStatus_802F6EA4(4, -1, -1, 0, 0, fn_8016B784);
Expand Down
6 changes: 3 additions & 3 deletions src/melee/gm/gm_1832.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ void fn_80186634(void* arg0)
lb_8000FCDC();
mpColl_80041C78();
Ground_801C0378(0x40);
Stage_802251E8(InternalStageID_Unk00, NULL);
Stage_802251E8(ExternalStageID_Unk00, NULL);
Item_80266FA8();
Item_80266FCC();
Stage_8022524C();
Expand Down Expand Up @@ -1446,7 +1446,7 @@ void fn_80187714(void)
lb_8000FCDC();
mpColl_80041C78();
Ground_801C0378(64);
Stage_802251E8(0, NULL);
Stage_802251E8(ExternalStageID_Unk00, NULL);
Stage_8022524C();
Item_80266FA8();
Item_80266FCC();
Expand Down Expand Up @@ -1771,7 +1771,7 @@ typedef struct gm_80187F48_EnterData {
u16 stage_id;
} gm_80187F48_EnterData;

static inline InternalStageId
static inline ExternalStageId
gm_80187F48_GetStageId(gm_80187F48_EnterData* data)
{
return data->stage_id;
Expand Down
3 changes: 1 addition & 2 deletions src/melee/gm/gm_1B14.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,7 @@ void gm_801B1EEC(GameScene* arg0)
gm_80473814.x6 = stage_id;
vs_data->data.rules.xE = stage_id;
lbAudioAx_80026F2C(0x18);
lbAudioAx_8002702C(8, lbAudioAx_80026EBC((enum InternalStageId)(
u16) vs_data->data.rules.xE));
lbAudioAx_8002702C(8, lbAudioAx_80026EBC(vs_data->data.rules.xE));
lbAudioAx_80027168();
}

Expand Down
4 changes: 2 additions & 2 deletions src/melee/gm/gm_1BA8.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void gm_801BAD70(GameScene* arg0)
stage_list = ((struct gm_evlevel*) *lvlpp)->x10;
stage = stage_list->stage[ev->x20];
md->rules.xE = stage;
ev->x48 = (InternalStageId) stage;
ev->x48 = stage;
if (ev->x20 > 0) {
md->rules.x1_2 = 1;
md->rules.x1_3 = 1;
Expand Down Expand Up @@ -843,7 +843,7 @@ s32 gm_801BBB64(void)
ev->x44 = 1;
}
pp = &tbl[idx];
ev->x48 = (InternalStageId) * (u16*) ((u8*) (*pp)->x8 + 6);
ev->x48 = *(u16*) ((u8*) (*pp)->x8 + 6);
for (i = 0; i < 4; i++) {
player_init = (&(*pp)->x14)[i];
if (player_init != NULL) {
Expand Down
4 changes: 2 additions & 2 deletions src/melee/gm/gmallstar.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void gm_801B5324(UnkAllstarData* arg0, u8 arg1)
}
}

gc->stage_id = (InternalStageId) opp_data->x2;
gc->stage_id = opp_data->x2;
lbDvd_80018254();

audio = lbAudioAx_80026E84((CharacterKind) (s8) arg0->x0.ckind);
Expand All @@ -462,7 +462,7 @@ void gm_801B5324(UnkAllstarData* arg0, u8 arg1)
}
}

audio |= lbAudioAx_80026EBC((InternalStageId) opp_data->x2);
audio |= lbAudioAx_80026EBC(opp_data->x2);
lbAudioAx_80026F2C(0x1C);
lbAudioAx_8002702C(0xC, audio);
lbAudioAx_80027168();
Expand Down
7 changes: 3 additions & 4 deletions src/melee/gm/gmclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,8 @@ static gmClassicMatchup* gmClassic_801B2BA4(gmClassicMatchup* arg0, u8* arg1,

for (temp = arg2; temp->x0 != 0xD; temp++) {
if (temp->xC != NULL) {
stage1 = Stage_8022519C((InternalStageId) entry->x00);
if (Stage_8022519C((InternalStageId) temp->xC->x00) == stage1)
{
stage1 = Stage_8022519C(entry->x00);
if (Stage_8022519C(temp->xC->x00) == stage1) {
result = entry;
goto next;
}
Expand Down Expand Up @@ -800,7 +799,7 @@ void gmClassic_801B3500(GameScene* arg0)
}

{
InternalStageId stage_id;
ExternalStageId stage_id;
if (entry->x1 == 0x80 && entry->x2 == 1) {
stage_id = (u16) gm_801647F8(ad->x0.ckind);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gm/gmregclear.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ static inline void gm_8017CE34_SetupColors(UnkAdventureData* arg1, s32 count,
}

s32 gm_8017CE34(StartMeleeData* arg0, UnkAdventureData* arg1, s8* arg2,
u8 arg3, u8 arg4, u8 arg5, s32 arg6, InternalStageId arg7,
u8 arg3, u8 arg4, u8 arg5, s32 arg6, ExternalStageId arg7,
s32 count, s32 arg9)
{
u8 colors[16];
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gm/gmregclear.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/* 17CBAC */ UNK_RET gm_8017CBAC(UnkAdventureData*, struct gmm_x0_528_t*, u8);
/* 17CD94 */ u8 gm_8017CD94(UnkAdventureData*, int, int, int);
/* 17CE34 */ s32 gm_8017CE34(StartMeleeData*, UnkAdventureData*, s8*, u8, u8,
u8, s32, InternalStageId, s32 count, s32);
u8, s32, ExternalStageId, s32 count, s32);
/* 17D7AC */ bool gm_8017D7AC(MatchExitInfo*, Unk1PData*, u8);
/* 17D9C0 */ s32 fn_8017D9C0(u8* arg0, u8* arg1);
/* 17DB58 */ void gm_8017DB58(struct Unk1PData_x24* arg0);
Expand Down
3 changes: 1 addition & 2 deletions src/melee/gm/gmstamina.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ void gm_801B927C(GameScene* arg0)
*vs = sss->data;

lbAudioAx_80026F2C(0x18);
lbAudioAx_8002702C(
8, lbAudioAx_80026EBC((enum InternalStageId) sss->force_stage_id));
lbAudioAx_8002702C(8, lbAudioAx_80026EBC(sss->force_stage_id));
lbAudioAx_80027168();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gm/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ struct gmm_x0 {
/* 0x0570 */ int x40;
/* 0x0574 */ s8 x44;
/* 0x0575 */ u8 x45;
/* 0x0578 */ InternalStageId x48;
/* 0x0578 */ ExternalStageId x48;
/* 0x057C */ s8 x4C[4]; ///< CharacterKind
/* 0x0580 */ u8 x50[4]; ///< character color
struct gmm_x0_584_t {
Expand Down
43 changes: 43 additions & 0 deletions src/melee/gr/forward.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,49 @@ typedef enum InternalStageId {
FIGURE3
} InternalStageId;

/// External stage IDs, the public stage numbering used by
/// #StartMeleeRules::xE and the Stage_802251E8 argument. #stage_id_map
/// converts them to #InternalStageId values; entries 0x21+ are
/// single-player, event, and other mode variants.
typedef enum ExternalStageId {
ExternalStageID_Unk00,
ExternalStageID_TEST,
ExternalStageID_IZUMI,
ExternalStageID_PSTADIUM,
ExternalStageID_CASTLE,
ExternalStageID_KONGO,
ExternalStageID_ZEBES,
ExternalStageID_CORNERIA,
ExternalStageID_STORY,
ExternalStageID_ONETT,
ExternalStageID_MUTECITY,
ExternalStageID_RCRUISE,
ExternalStageID_GARDEN,
ExternalStageID_GREATBAY,
ExternalStageID_SHRINE,
ExternalStageID_KRAID,
ExternalStageID_YORSTER,
ExternalStageID_GREENS,
ExternalStageID_FOURSIDE,
ExternalStageID_INISHIE1,
ExternalStageID_INISHIE2,
ExternalStageID_Unk21, // maps to InternalStageID_Unk26
ExternalStageID_VENOM,
ExternalStageID_PURA,
ExternalStageID_BIGBLUE,
ExternalStageID_ICEMTN,
ExternalStageID_Unk26, // second Icicle Mountain entry
ExternalStageID_FLATZONE,
ExternalStageID_OLDPUPUPU,
ExternalStageID_OLDYOSHI,
ExternalStageID_OLDKONGO,
ExternalStageID_BATTLE,
ExternalStageID_LAST,

ExternalStageID_BIGBLUEROUTE = 0x49,
ExternalStageID_HEAL = 0x55,
} ExternalStageId;

typedef struct unkCastle unkCastle;

typedef void (*unkCastleCallback)(void*, struct unkCastle*);
Expand Down
26 changes: 13 additions & 13 deletions src/melee/gr/ground.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,24 +428,24 @@ void Ground_801C06B8(InternalStageId arg0)
}
}

void Ground_801C0754(StructPairWithStageID* pair)
void Ground_801C0754(StageIdPair* pair)
{
StageData* stage;
s32 arg3;
Ground_801BFFB0();
stage_info.internal_stage_id = pair->stage_id;
stage = Ground_803DFEDC[pair->stage_id];
arg3 = (pair->list_idx == 0x55) ? 0 : 1;
stage_info.internal_stage_id = pair->internal_id;
stage = Ground_803DFEDC[pair->internal_id];
arg3 = (pair->external_id == ExternalStageID_HEAL) ? 0 : 1;
grDatFiles_801C6038(stage->data1, 0, arg3);
Ground_801C28CC(&stage_info.xA0, pair->list_idx);
Ground_801C28CC(&stage_info.xA0, pair->external_id);
stage_info.x178 = stage->callback5;
stage_info.x17C = stage->callback6;
Ground_801C5878();
}

void Ground_801C0800(StructPairWithStageID* pair)
void Ground_801C0800(StageIdPair* pair)
{
StageData* stage_data = Ground_803DFEDC[pair->stage_id];
StageData* stage_data = Ground_803DFEDC[pair->internal_id];
Ground_801C38D0(stage_info.param->x8, stage_info.param->x14,
stage_info.param->x1C, stage_info.param->x18);
Ground_801C38EC(stage_info.param->x10, stage_info.param->xC);
Expand Down Expand Up @@ -663,20 +663,20 @@ void Ground_801C0C2C(HSD_GObj* arg0)
}
}

void Ground_801C0F78(StructPairWithStageID* pair)
void Ground_801C0F78(StageIdPair* pair)
{
Ground_803DFEDC[pair->stage_id]->OnLoad();
Ground_803DFEDC[pair->internal_id]->OnLoad();
}

void Ground_801C0FB8(StructPairWithStageID* pair)
void Ground_801C0FB8(StageIdPair* pair)
{
struct {
void* unk0;
s32 unk4;
void (*unk8)(s32);
}* cur;
void* next;
Ground_803DFEDC[pair->stage_id]->OnStart();
Ground_803DFEDC[pair->internal_id]->OnStart();
for (cur = stage_info.x6A4; cur != NULL; cur = next) {
next = cur->unk0;
cur->unk8(cur->unk4);
Expand All @@ -687,9 +687,9 @@ void Ground_801C0FB8(StructPairWithStageID* pair)
Ground_801C0C2C, 10);
}

void Ground_DemoInit(StructPairWithStageID* pair, s32 arg1)
void Ground_DemoInit(StageIdPair* pair, s32 arg1)
{
Ground_803DFEDC[pair->stage_id]->OnDemoInit(arg1);
Ground_803DFEDC[pair->internal_id]->OnDemoInit(arg1);
}

void Ground_801C10B8(HSD_GObj* arg0, HSD_GObjEvent arg1)
Expand Down
10 changes: 5 additions & 5 deletions src/melee/gr/ground.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
/* 1C0690 */ GXColor* Ground_801C0690(void);
/* 1C06A4 */ GXColor* Ground_801C06A4(void);
/* 1C06B8 */ void Ground_801C06B8(InternalStageId);
/* 1C0754 */ void Ground_801C0754(StructPairWithStageID* pair);
/* 1C0800 */ void Ground_801C0800(StructPairWithStageID* pair);
/* 1C0F78 */ void Ground_801C0F78(StructPairWithStageID* pair);
/* 1C0FB8 */ void Ground_801C0FB8(StructPairWithStageID* pair);
/* 1C1074 */ void Ground_DemoInit(StructPairWithStageID* pair, s32);
/* 1C0754 */ void Ground_801C0754(StageIdPair* pair);
/* 1C0800 */ void Ground_801C0800(StageIdPair* pair);
/* 1C0F78 */ void Ground_801C0F78(StageIdPair* pair);
/* 1C0FB8 */ void Ground_801C0FB8(StageIdPair* pair);
/* 1C1074 */ void Ground_DemoInit(StageIdPair* pair, s32);
/* 1C10B8 */ void Ground_801C10B8(HSD_GObj*, HSD_GObjEvent);
/* 1C1154 */ void Ground_801C1154(void);
/* 1C1158 */ void Ground_801C1158(void);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/gr/grvenom.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ void grVenom_802040AC(Ground_GObj* arg) {}

void grVenom_802040B0(Ground_GObj* arg) {}

enum_t Stage_80225194(void);
ExternalStageId Stage_80225194(void);

void fn_802040B4(Ground_GObj* gobj)
{
Expand Down
Loading
Loading