Skip to content

Rest of BOTS decomp #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
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 decompile/General/223/223_Full.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void DECOMP_RR_EndEvent_DrawMenu(void)
elapsedFrames -= FPS_DOUBLE(140);

// -10
char* str = 0x1f800000;
char* str = (char*)0x1f800000;
str[0] = '-';
str[1] = '1';
str[2] = '0';
Expand Down
4 changes: 2 additions & 2 deletions decompile/General/233/233_21_CS_Camera_ThTick_Boss.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void CS_Camera_ThTick_Boss(struct Thread* t)
if (gGT->threadBuckets[OTHER].thread != 0)
break;

CS_LoadBoss(bcd);
DECOMP_CS_LoadBoss(bcd);
OVR_233.cutsceneState = 3;
break;

Expand All @@ -81,7 +81,7 @@ void CS_Camera_ThTick_Boss(struct Thread* t)

// head is incremented by callback,
// body has no callback, increment now
mArr[1] = (unsigned int)mArr[1] + 4;
mArr[1] = mArr[1] + 1;

gGT->modelPtr[mArr[0]->id] = mArr[0];
gGT->modelPtr[mArr[1]->id] = mArr[1];
Expand Down
60 changes: 58 additions & 2 deletions decompile/General/BOTS/BOTS_04_Adv_AdjustDifficulty.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,62 @@
#include <common.h>

void BOTS_Adv_AdjustDifficulty(void) //TODO: & add "DECOMP_" prefix
void DECOMP_BOTS_Adv_AdjustDifficulty(void)
{
//TODO
int bossIdOrLevelId;
if ((sdata->gGT->gameMode1 & ADVENTURE_BOSS) != 0)
{
bossIdOrLevelId = sdata->gGT->bossID;

sdata->difficultyParams[0] = &data.BossDifficulty[0];
}
else
{
bossIdOrLevelId = sdata->gGT->levelID;

sdata->difficultyParams[0] = &data.ArcadeDifficulty[0];
}

//these two lines might be wrong.
sdata->difficultyParams[1] = sdata->difficultyParams[0] + (bossIdOrLevelId * 0xe);
sdata->difficultyParams[0] = sdata->difficultyParams[0] + (bossIdOrLevelId * 0xe) + 0xe;

if ((sdata->gGT->gameMode1 & ARCADE_MODE) == 0)
{
if ((sdata->gGT->gameMode1 & ADVENTURE_CUP) == 0)
{
if ((sdata->gGT->gameMode1 & ADVENTURE_BOSS) != 0)
{

}
else
{

}
}
else
{
if (sdata->gGT->cup.cupID == 4)
{
if ((sdata->gGT->gameMode2 & CHEAT_ADV) != 0)
{

}
}
else
{
if ((sdata->gGT->gameMode2 & CHEAT_ADV) != 0)
{

}
}
}
}
else
{
if ((sdata->gGT->gameMode2 & CHEAT_SUPERHARD) != 0)
{

}
}
LAB_80012888:
}
10 changes: 5 additions & 5 deletions decompile/General/BOTS/BOTS_07_LevInstColl.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ void DECOMP_BOTS_LevInstColl(struct Thread* param_1)

if ((sps->bspHitbox->flag & 0x80) != 0)
{
struct QuadBlock* qb = sps->bspHitbox->data.leaf.ptrQuadBlockArray;
int iVar3 = *(int*)&qb->bbox.min[0]; //x & y concatenated, I'm confused though, it's being passed as `struct Instance*`
if (iVar3 != 0)
struct InstDef* instDef = sps->bspHitbox->data.hitbox.instDef;
struct Instance* inst = instDef->ptrInstance;
if (inst != NULL)
{
struct MetaDataMODEL* mdm = DECOMP_COLL_LevModelMeta(qb->blockID);
struct MetaDataMODEL* mdm = DECOMP_COLL_LevModelMeta(instDef->modelID);
if (mdm != NULL)
{
if (mdm->LInC != NULL)
{
mdm->LInC((struct Instance*)iVar3, param_1, sps); //1st param doesn't make much sense to me...
mdm->LInC(inst, param_1, sps);
}
}
}
Expand Down
Loading