remove most NON_MATCHING labels and add notes to a few C files.

This commit is contained in:
Mallos31 2023-07-20 16:35:13 -04:00
parent 0848a0d049
commit 495305a8ed
22 changed files with 31 additions and 1026 deletions

3
.gitignore vendored
View File

@ -17,4 +17,5 @@ stats/
*.old
ctx.c
.ninja_log
build.ninja
build.ninja
function_references.txt

View File

@ -36,15 +36,15 @@ typedef struct {
/*0x60*/u16 unk60;
/*0x62*/char unk62[4];
/*0x66*/s16 animID;
u16 animFrames;
u16 totalFrames;
u16 animSpeed;
s16 unkAnimID; //may be nextAnimID, but doesn't seem to be. Research needed.
s16 unk70;
char unk72[0x2];
u16 unk74;
char unk76[0xA];
NPCData2* unk80;
/*0x68*/u16 animFrames;
/*0x6A*/u16 totalFrames;
/*0x6C*/u16 animSpeed;
/*0x6E*/s16 unkAnimID; //may be nextAnimID, but doesn't seem to be. Research needed.
/*0x70*/s16 unk70;
/*0x72*/char unk72[0x2];
/*0x74*/u16 unk74;
/*0x76*/char unk76[0xA];
/*0x80*/NPCData2* unk80;
}NPCData;
#endif

View File

@ -127,43 +127,3 @@ void func_8000111C(unk111Cs* arg0) {
#pragma GLOBAL_ASM("asm/nonmatchings/1850/func_80002428.s")
#pragma GLOBAL_ASM("asm/nonmatchings/1850/func_800025E8.s")
#ifdef NON_MATCHING
void func_800025E8(void) {
OSMesg* sp4C;
OSMesg* temp_s5;
sp4C = NULL;
D_8007B348 = 0;
func_80031CB0();
func_80100000();
UpdateBGM(0x14);
if ((u16)gGameMode == 5) {
do {
func_800314C0((s32)D_80092870);
D_8007B2F8 = 0;
func_80026658();
func_800011DC(&D_80301000 + (D_8007B2F4 * 0xD150));
temp_s5 = (&D_80301000) + (D_8007B2F4 * 0xD150);
if (D_8007B348 == 0) {
D_8007B348 += 1;
do {
osRecvMesg(&D_8007B9E8, sp4C, 1);
} while (*(s16*)sp4C != (s16)1);
} else {
do {
osRecvMesg(&D_8007B9E8, sp4C, 1);
} while (*(s16*)sp4C != (s16)2);
}
osSendMesg(D_8007B9D8, temp_s5, 1);
D_8007B2F4 ^= 1;
} while ((u16)gGameMode == 5);
}
UpdateBGM(-1);
func_80026658();
D_8007B2E4 |= 0x8000;
do {
osRecvMesg(&D_8007B9E8, sp4C, 1);
} while (*(s16*)sp4C != (s16)2);
}
#endif

View File

@ -219,58 +219,6 @@ void func_8001A238(void) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/191F0/func_8001A268.s")
#ifdef NON_MATCHING
unk1a238s *func_8001A268(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9, f32 argA, f32 argB)
{
s32 i;
test3 *temp_t0;
unk1a238s *var_v1;
s32 new_var;
unk800DA828s *temp_t9;
i = 0x1F;
var_v1 = &D_800875A8;
while (i != 0 && var_v1->unk0 != 0) {
i--;
var_v1++;
}
var_v1->unkC = arg5;
var_v1->unk10 = arg6;
var_v1->unk14 = arg7;
var_v1->unk18 = arg8;
temp_t0 = &D_800EB9EC[arg0];
var_v1->unk1C = arg9;
var_v1->unk20 = argA;
var_v1->unk24 = argB;
var_v1->unk28 = 0.0f;
var_v1->unk2C = 0.0f;
temp_t9 = temp_t0;
var_v1->unk30 = 1.0f;
var_v1->unk38 = temp_t9->unk0;
var_v1->unk3C = temp_t9->unk4;
var_v1->unk4 = 0;
var_v1->unk6 = arg3;
var_v1->unk40 = temp_t9->unk8;
var_v1->unk40 = &D_800CB4E0[arg1];
var_v1->unk0 = var_v1->unk3A;
var_v1->unk2 = (s16) var_v1->unk3A;
temp_t9 = &D_800DA828[arg2];
var_v1->unk8 = (s16) arg4;
var_v1->unk34 = 0;
var_v1->unk44 = temp_t9->unk0;
var_v1->unk48 = temp_t9->unk4;
new_var = temp_t9->unk8;
var_v1->unk4C = new_var;
var_v1->unk50 = temp_t9->unkC;
var_v1->unk54 = temp_t9->unk10;
return var_v1;
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/191F0/func_8001A398.s")

View File

@ -120,21 +120,6 @@ void func_8001D820(void) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/1D160/func_8001D828.s")
#ifdef NON_MATCHING
u8 func_8001D828(void)
{
u8 ret;
if ((gBattleState & 0x100) || ((getRandomNumber(4U)) == 0))
{
ret = D_8007C9B8[getRandomNumber(D_8008C59A)].unk00->unk34;
}
else
{
ret = 0xFF;
}
return ret;
}
#endif
void func_8001D89C(void) {
}

View File

@ -1,3 +1,5 @@
/*rename to animation.c*/
#include "common.h"
typedef struct {
@ -10,23 +12,13 @@ typedef struct {
/*0x28*/ f32 unk28;
/*0x2C*/ f32 unk2C;
/*0x30*/ s16 unk30; //maybe padding.
/*0x32*/ u16 frameNum;
/*0x34*/ Vec3f nextPos;
/*0x40*/ f32 nextYRot;
/*0x44*/ f32 nextZRot;
/*0x48*/ f32 nextXRot;
/*0x4C*/ Vec3f nextScale;
/*0x58*/ f32 unk58;
/*0x5C*/ f32 unk5C;
/*0x60*/ f32 unk60;
/*0x64*/ s16 unk64;
/*0x66*/ u16 nextFrameNum;
/*0x32*/ u16 startingFrame;
}LimbKeyframe;
typedef struct {
LimbKeyframe* unk0;
LimbKeyframe* unk0; //pointer to an array
u16 unk4;
u16 unk6;
u16 numFramesInAnim;
f32 unk8;
f32 unkC;
f32 unk10;
@ -43,6 +35,7 @@ void func_80022F60(f32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4);
#pragma GLOBAL_ASM("asm/nonmatchings/23740/func_80022B40.s")
//#pragma GLOBAL_ASM("asm/nonmatchings/23740/func_80022F60.s")
void func_80022F60(f32 arg0, f32 *arg1, f32 *arg2, f32 *arg3, f32 *arg4)
{

View File

@ -1,4 +1,5 @@
#include "common.h"
#include "monsters.h"
typedef struct unk_2513c_s{
s32 unk0;
@ -51,6 +52,7 @@ extern ALHeap D_8008F240;
extern ALCSPlayer D_8008F994;
extern ALSeqpConfig D_8008FB14;
extern ALCSPlayer D_8008FB30;
extern s32 D_8008FCB0;
@ -163,21 +165,9 @@ s32 func_80025938(void) {
#pragma GLOBAL_ASM("asm/nonmatchings/25290/func_80025B3C.s")
#pragma GLOBAL_ASM("asm/nonmatchings/25290/func_80025B8C.s")
#ifdef NON_MATCHING
void func_80025B8C(s32 arg0, s32 arg1, s32 arg2) {
s32 temp_v0 = D_80053970;
D_8005390C[temp_v0] = arg0;
D_8005392C[temp_v0] = arg1;
D_8005394C[temp_v0] = arg2;
temp_v0++;
D_80053970 = temp_v0 & 7;
D_8008FCB4 = temp_v0 ;
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/25290/func_80025BD8.s")
#pragma GLOBAL_ASM("asm/nonmatchings/25290/func_80025E0C.s")

View File

@ -1,3 +1,5 @@
/*probably pause_menu.c but currently unsure.*/
#include "common.h"

View File

@ -47,46 +47,7 @@ for (i = 0; i != 4; i++){
}
#pragma GLOBAL_ASM("asm/nonmatchings/2F1E0/func_8002E628.s")
#ifdef NON_MATCHING
void func_8002E628(s32 arg0, u8 arg1) {
s32 i;
s32 j;
if (!arg1) {
D_800905E0[arg0].ypos = 0;
D_800905E0[arg0].height = 0;
D_800905E0[arg0].unk0 = 0;
D_800905E0[arg0].xpos = D_800905E0[arg0].ypos;
D_800905E0[arg0].width = D_800905E0[arg0].height;
}
D_800905E0[arg0].quillTimer = 1;
D_800905E0[arg0].unkE = 0;
D_800905E0[arg0].unkF = 0;
D_800905E0[arg0].unk10 = 0;
D_800905E0[arg0].unk12 = 0;
D_800905E0[arg0].unk14 = -1;
D_800905E0[arg0].unk15 = 0;
D_800905E0[arg0].unk16 = 0;
for (i = 0; i < 0x20; i++) {
D_800905E0[arg0].unk17[i] = -1;
}
for(i = 0 ; i < 0x400; i++){
D_800905E0[arg0].unk9C[i] = -1;
D_800905E0[arg0].unk49C[i] = -1;
}
D_800905E0[arg0].unk38 = 0;
D_800905E0[arg0].unk3A = 0;
for(i = 0; i != 0x18; i++) {
for (j = 0; j < 4; j++) {
D_800905E0[arg0].unk3C[j][i] = -1;
}
}
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/2F1E0/func_8002E768.s")

View File

@ -43,73 +43,4 @@ void loadTextTextureAndPal(void) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/31A10/func_80030EA0.s")
#ifdef NON_MATCHING
void func_80030EA0(s32 arg0, s32 arg1, u8 *arg2)
{
s32 temp_t3;
temps *temp_t0;
gDPPipeSync(gMasterGfxPos++);
gDPSetTextureLUT(gMasterGfxPos++, 2 << 14);
for (; (*arg2) != 0xFF; arg2++)
{
if ((*arg2) & 0x80)
{
temp_t3 = (*arg2) & 0x1F;
switch ((*arg2) & 0x60)
{
case 0x0:
gDPLoadTextureTile_4b(gMasterGfxPos++, &D_803232A0[temp_t3], 2, 304, 0, 0, 0, 303, 12, 0, 0 | 0, 0 | 0, 0, 0, 0, 0);
break;
case 0x20:
gDPLoadTLUT_pal16(gMasterGfxPos++, 0, &gTextPalettes[temp_t3 & 0xFFFF]);
break;
case 0x40:
if (temp_t3 < 0x10)
{
D_80092860 = temp_t3;
}
else
{
D_80092864 = temp_t3;
}
break;
case 0x60:
if (temp_t3 != 0)
{
if (((temp_t3 != 0x13) && (temp_t3 != 0x14)) && (temp_t3 == 0x1E))
{
gSPDisplayList(gMasterGfxPos++, D_8005FAA0);
}
}
else
{
arg1 += D_8005FA90[D_80092860].unkC;
}
break;
}
}
else
{
temp_t0 = &D_8005FA90[D_80092860];
temp_t3 = (*arg2) & 0x7F;
if (temp_t3 == 0x7F)
{
arg0 += temp_t0->unk8 + D_80092864;
}
else
{
gSPTextureRectangle(gMasterGfxPos++, arg0 << 2, arg1 << 2, (arg0 + temp_t0->unk0) << 2, (0, (arg1 + temp_t0->unk4) << 2), 0, (D_8005FA90[D_80092860].unk0 * temp_t3) * 32, 0, (qs510_t) (1 * 0x0400), (qs510_t) (1 * 0x0400));
arg0 = (arg0 + D_8005FA90[D_80092860].unk8) + D_80092864;
}
}
}
gDPPipeSync(gMasterGfxPos++);
gDPSetTextureLUT(gMasterGfxPos++, 0 << 14);
}
#endif

View File

@ -1,3 +1,5 @@
/*rename to ovl_load.c*/
#include "common.h"
extern u8 D_DA68F0[];

View File

@ -239,29 +239,7 @@ void func_800069FC(sPlayerAction* arg0, BrianData2* arg1, MonsterBattleData* arg
#pragma GLOBAL_ASM("asm/nonmatchings/33D0/func_80006F6C.s")
#pragma GLOBAL_ASM("asm/nonmatchings/33D0/func_80007030.s")
#ifdef NON_MATCHING
s32 func_80007030(s32 arg0, unk1d924s2* arg1) {
s32 var_v1;
s32 sp1C;
var_v1 = 0;
if (!(arg1->unk60 & 1) && !(D_8007B2E4 & 0x80)) {
if (gBattleState & 1) {
if (!(gBattleState & 0x202)) {
sp1C = 0;
var_v1 = sp1C;
if ((func_80015B50() == 0) && (D_8008C594 == 0)) {
var_v1 = 1;
}
}
} else {
var_v1 = 1;
}
}
return var_v1;
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/33D0/func_800070C0.s")

View File

@ -76,153 +76,8 @@ extern s32 D_A7A190;
void func_80008948(s32 arg0);
#pragma GLOBAL_ASM("asm/nonmatchings/8650/func_80007A50.s")
#ifdef NON_MATCHING
void func_80007A50(void)
{
s32 start;
s32 end;
s32 size;
D_8007BCE4 = 0;
if (!(gAllowBattles & 1))
{
D_8007BCB0 = &D_800547F0[D_80084F1C->unk12];
start = D_871900;
end = D_873F20;
size = end - start;
dma_write(start, D_8020C0D0, size);
start = D_A725D0;
end = D_A7A190;
size = end - start;
dma_write(start, D_802A0000, size);
start = D_8007BCB0->start;
end = D_8007BCB0->end;
size = end - start;
dma_write((u8 *) start, &D_8020E6F0, size);
func_800080E8();
D_8007BCB4 = 0;
if (((u16) D_8007B2E8) == 1)
{
func_80008AD8(0, &D_80054828);
func_8002E768(1);
return;
}
if (((u16) D_8007B2E8) == 4)
{
func_80008AD8(0, &D_80054C04);
func_8002E768(1);
}
}
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/8650/func_80007B64.s")
#ifdef NON_MATCHING
void func_80007B64(void)
{
PosRot *new_var;
NPCData *npc;
PosRot *npcPosRot;
f32 temp_f20;
f32 temp_f22;
f32 var_f8;
s32 var_s4;
npc = (NPCData *) D_8007BD30;
for (var_s4 = D_8007BCE4; var_s4 != 0; var_s4--)
{
{
new_var = &npc->PosRot;
switch (npc->action)
{
case 0:
if (npc->unk80->unk4 == 2)
{
npc->actionTimer--;
if (npc->actionTimer == 0)
{
if (((s32) ((u16) D_8007BCB4)) < 3)
{
npc->action = 1;
npcPosRot = &npc->PosRot;
npc->actionTimer = (getRandomNumber(2U) + 1) * npc->unk80->unk10->unkE;
func_8001D8B0((NPCData *) npcPosRot, 1, 1, 1, 1, (u16) 1);
temp_f20 = npc->xWanderOrigin - npcPosRot->pos.x;
temp_f22 = npc->zWanderOrigin - npcPosRot->pos.z;
if (_nsqrtf((temp_f20 * temp_f20) + (temp_f22 * temp_f22)) > 50.0)
{
npcPosRot->rot.y = func_80023210(temp_f20, temp_f22);
}
else
{
var_f8 = getRandomNumber(0x10U);
npcPosRot->rot.y = (f32) ((var_f8 * (M_PI / 8)) - (M_PI / 2));
}
D_8007BCB4++;
}
else
{
npc->actionTimer = (1 + getRandomNumber(2U)) * npc->unk80->unk10->unk2;
}
}
}
break;
case 1:
npcPosRot = new_var;
D_8007BCB8.unk0 = 0.0f;
D_8007BCB8.unk4 = 0.4f;
func_800232F4(npcPosRot->rot.y, &D_8007BCB8);
func_80008290(D_8007BCB8.unk0, D_8007BCB8.unk4, (NPCData *) npcPosRot);
npc->actionTimer--;
if (!npc->actionTimer)
{
npc->action = 0;
npc->actionTimer = (u16) npc->unk80->unk10->unk2;
func_8001D8B0((NPCData *) npcPosRot, 0, 1, 0, 1, (u16) 1);
D_8007BCB4--;
}
break;
case 2:
if (npc->actionTimer != 0)
{
npc->actionTimer--;
npcPosRot = new_var;
npcPosRot->rot.f[1] += npc->unk10 / 15.0f;
if (npc->actionTimer == 0)
{
func_8001D8B0((NPCData *) npcPosRot, (s32) npc->unk80->unk18, 1, (s32) npc->unk80->unk18, 1, (u16) 1);
}
}
break;
case 3:
npcPosRot = new_var;
npc->actionTimer -= 1;
npcPosRot->rot.y -= npc->unk10 / 15.0f;
if (npc->actionTimer == 0)
{
npc->action = 0;
npc->actionTimer = (u16) npc->unk80->unk10->unk2;
npcPosRot->rot.y = npc->yRotReturn;
func_8001D8B0((NPCData *) npcPosRot, 0, 1, 0, 1, (u16) 1);
}
break;
}
npc++;
}
}
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/8650/func_80007F18.s")

View File

@ -219,18 +219,7 @@ void func_8000B110(void) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/97B0/func_8000B140.s")
#ifdef NON_MATCHING
s32 func_8000B140(TestStruct* arg0) {
s32 var_v1;
for(var_v1 = 0; var_v1 < 6; var_v1++) {
if(arg0 == &D_8007C9BC[var_v1]) {
break;
}
}
return var_v1;
}
#endif
#pragma GLOBAL_ASM("asm/nonmatchings/97B0/func_8000B170.s")

View File

@ -70,192 +70,6 @@ s32 func_8000F5A4(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/FA60/func_8000F6A4.s")
#ifdef NON_MATCHING
s32 func_8000F6A4(f32 *arg0, f32 *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6)
{
s32 sp5C;
f32 sp58;
f32 sp54;
f32 sp4C;
f32 sp3C;
f32 sp34;
f32 sp30;
f32 sp2C;
f32 sp28;
f32 sp24;
f32 sp20;
f32 temp_f0;
f32 temp_f0_2;
f32 temp_f0_3;
f32 temp_f0_4;
f32 temp_f0_5;
f32 temp_f12_2;
f32 temp_f12_3;
f32 temp_f12_4;
f32 temp_f14;
f32 temp_f14_2;
f32 temp_f14_3;
f32 temp_f16;
f32 temp_f16_2;
f32 temp_f18;
f32 temp_f18_2;
f32 temp_f2_2;
f32 temp_f2;
f32 temp_f2_3;
f32 temp_f2_4;
f32 temp_f2_5;
f32 temp_f6;
f32 var_f12;
f32 var_f14;
f32 var_f14_2;
f32 var_f14_3;
f32 var_f14_4;
f32 var_f16;
f32 var_f16_2;
f32 var_f16_3;
f32 var_f18;
f32 var_f18_2;
f32 var_f18_3;
f32 var_f20;
f32 var_f20_2;
f32 var_f20_3;
f32 var_f2;
s32 var_v1;
var_f18 = (arg3 <= arg5) ? (arg3) : (arg5);
var_f16 = (arg5 < arg3) ? (arg3) : (arg5);
var_f20 = (arg4 <= arg6) ? (arg4) : (arg6);
var_f14 = (arg6 < arg4) ? (arg4) : (arg6);
if (((((*arg0) < (var_f18 - arg2)) || ((var_f16 + arg2) < (*arg0))) || ((temp_f2 = *arg1, temp_f2 < (var_f20 - arg2)))) || ((var_f14 + arg2) < temp_f2))
{
return 0;
}
if (arg3 == arg5)
{
var_f18_2 = (-(arg6 - arg4)) / (arg5 - arg3);
var_f18_2 = 1.0f;
var_f16_2 = 0.0f;
var_f20_2 = -arg3;
}
else
if (arg4 == arg6)
{
var_f18_2 = 0.0f;
var_f16_2 = 1.0f;
var_f20_2 = -arg4;
}
else
{
var_f16_2 = 1.0f;
var_f20_2 = ((-var_f18_2) * arg3) - arg4;
}
var_f14_2 = ((temp_f2 * var_f16_2) + (var_f18_2 * (*arg0))) + var_f20_2;
if (var_f14_2 < 0.0f)
{
var_f14_2 = -var_f14_2;
}
sp5C = 0;
sp4C = var_f14_2;
sp54 = var_f16_2;
sp58 = var_f18_2;
var_v1 = 0;
temp_f2_2 = var_f14_2 / _nsqrtf((var_f18_2 * var_f18_2) + (var_f16_2 * (sp58 = var_f16_2)));
sp3C = temp_f2_2;
if (temp_f2_2 < arg2)
{
if (var_f18_2 == 0.0f)
{
temp_f0 = *arg0;
var_f2 = 1.0f;
var_f12 = 0.0f;
sp24 = temp_f0;
var_f14_3 = -temp_f0;
sp20 = *arg1;
}
else
if (var_f16_2 == 0.0f)
{
temp_f0_2 = *arg1;
var_f2 = 0.0f;
var_f12 = 1.0f;
sp20 = temp_f0_2;
var_f14_3 = -temp_f0_2;
sp24 = *arg0;
}
else
{
var_f2 = (-1.0f) / var_f18_2;
sp24 = *arg0;
temp_f6 = *arg1;
var_f12 = 1.0f;
sp20 = temp_f6;
var_f14_3 = ((-var_f2) * sp24) - temp_f6;
}
temp_f0_3 = (var_f18_2 * var_f12) - (var_f2 * var_f16_2);
sp34 = ((var_f14_3 * var_f16_2) - (var_f20_2 * var_f12)) / temp_f0_3;
sp30 = ((var_f2 * var_f20_2) - (var_f18_2 * var_f14_3)) / temp_f0_3;
var_f2 = arg3;
var_f18_3 = (arg3 <= arg5) ? (arg5) : (arg3);
var_f16_3 = (arg5 < arg3) ? (arg5) : (arg3);
var_f20_3 = (arg4 <= arg6) ? (arg4) : (arg6);
var_f14_4 = (arg6 < arg4) ? (arg4) : (arg6);
if ((((sp34 < var_f18_3) || (var_f16_3 < sp34)) || (sp30 < var_f20_3)) || (var_f14_4 < sp30))
{
temp_f18 = var_f2 - sp24;
temp_f16 = arg4 - sp20;
temp_f0_4 = _nsqrtf((temp_f18 * temp_f18) + (temp_f16 * temp_f16));
if (temp_f0_4 < arg2)
{
temp_f2_3 = var_f2 - (*arg0);
temp_f14 = arg4 - (*arg1);
sp2C = temp_f2_3;
sp28 = temp_f14;
temp_f12_2 = (f32) (((((f64) arg2) + D_80071268) - ((f64) temp_f0_4)) / ((f64) _nsqrtf((temp_f2_3 * temp_f2_3) + (temp_f14 * temp_f14))));
*arg0 -= temp_f2_3 * temp_f12_2;
*arg1 -= temp_f14 * temp_f12_2;
return 1;
}
temp_f18_2 = arg5 - (*arg0);
temp_f16_2 = arg6 - (*arg1);
temp_f0_5 = _nsqrtf((temp_f18_2 * temp_f18_2) + (temp_f16_2 * temp_f16_2));
if (temp_f0_5 < arg2)
{
var_f16_2 = 1.0f;
temp_f2_4 = var_f2 - (*arg0);
temp_f14_2 = arg4 - (*arg1);
sp2C = temp_f2_4;
sp28 = temp_f14_2;
temp_f12_3 = (f32) (((((f64) arg2) + D_80071270) - ((f64) temp_f0_5)) / ((f64) _nsqrtf((temp_f2_4 * temp_f2_4) + (temp_f14_2 * temp_f14_2))));
*arg0 -= temp_f2_4 * temp_f12_3;
*arg1 -= temp_f14_2 * temp_f12_3;
return 1;
}
return 0;
}
temp_f2_5 = sp34 - sp24;
temp_f14_3 = sp30 - sp20;
if (sp3C != 0.0f)
{
sp2C = temp_f2_5;
sp28 = temp_f14_3;
if (var_f18_2)
{
var_f12 = var_f12;
}
temp_f12_4 = (f32) (((((f64) arg2) + D_80071278) - ((f64) sp3C)) / ((f64) _nsqrtf((temp_f2_5 * temp_f2_5) + (temp_f14_3 * temp_f14_3))));
*arg0 -= temp_f2_5 * temp_f12_4;
*arg1 -= temp_f14_3 * temp_f12_4;
}
var_v1 = 1;
goto block_48;
}
block_48:
return var_v1;
}
#endif

View File

@ -1,3 +1,5 @@
/*Rename to eletale_math.c*/
#include "common.h"
typedef struct {
@ -398,41 +400,7 @@ void func_80023BCC(Mtx* arg0, f32 arg1, f32 arg2, f32 arg3) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/camera/func_80023C1C.s")
#ifdef NON_MATCHING
void func_80023C1C(MtxF *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7, f32 arg8, f32 arg9)
{
f32 s1;
f32 s2;
f32 s3;
f32 c2;
f32 c3;
f32 c1;
arg5 *= D_8004D74C;
arg6 *= D_8004D74C;
s1 = sinf(arg4 * D_8004D74C);
c1 = cosf(arg4 * ((0, D_8004D74C)));
s2 = sinf(arg5);
c2 = cosf(arg5);
s3 = sinf(arg6);
c3 = cosf(arg6);
arg0->mf[0][0] = ((c3 * c2) + ((s3 * s1) * s2)) * arg7;
arg0->mf[0][1] = (s3 * c1) * arg7;
arg0->mf[0][2] = (((-s2) * c3) + ((s3 * s1) * c2)) * arg7;
arg0->mf[0][3] = 0.0f;
arg0->mf[1][0] = (((-s3) * c2) + ((c3 * s1) * s2)) * arg8;
arg0->mf[1][1] = (c3 * c1) * arg8;
arg0->mf[1][2] = (((-s3) * (-s2)) + ((c3 * s1) * c2)) * arg8;
arg0->mf[1][3] = 0.0f;
arg0->mf[2][0] = (c1 * s2) * arg9;
arg0->mf[2][1] = (-s1) * arg9;
arg0->mf[2][2] = (c1 * c2) * arg9;
arg0->mf[2][3] = 0.0f;
arg0->mf[3][0] = arg1;
arg0->mf[3][1] = arg2;
arg0->mf[3][2] = arg3;
arg0->mf[3][3] = 1.0f;
}
#endif
//#pragma GLOBAL_ASM("asm/nonmatchings/camera/func_80023DF4.s")
void func_80023DF4(f32 (*arg0)[4], f32 arg1, f32 arg2, f32 arg3) {

123
src/hud.c
View File

@ -127,7 +127,7 @@ extern u8 D_8004D2B4;
extern s32 D_8004D2B8;
extern s32 D_8004D2BC;
extern s32 D_8007BA78;
extern s32 D_8007BA7C;
extern s32 gTreasureChestPointer;
extern u16 D_8007BABA;
extern u16 D_8007BAC0;
extern unk1ebdcs* D_8007BAC8;
@ -189,128 +189,7 @@ void HUDInit(void)
D_8008C630 = 0;
}
#pragma GLOBAL_ASM("asm/nonmatchings/hud/func_8001E25C.s")
#ifdef NON_MATCHING
void func_8001E25C(Mtx* arg0) {
EnemyAction* var_v1_3;
s32 temp_lo;
s32 temp_v0_4;
s32 var_v0;
s32 i;
gSPMatrix(gMasterGfxPos++, D_2000040, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
guTranslate(arg0 + (D_8007B2F8 << 6) + 0xC0, -160.0f, -120.0f, 0.0f);
gSPMatrix(gMasterGfxPos++, &D_2000000[D_8007B2F8]/*.unkC0*/, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); //removed .unkC0 until I figure out what to do with it.
D_8007B2F8 += 1;
gSPDisplayList(gMasterGfxPos++, D_803A6FC0);
if (D_8004D2B4 != 0) {
if (D_8004D2BC != 0) {
D_8004D2BC--;
}
temp_v0_4 = 0xF - D_8004D2BC;
temp_lo = temp_v0_4 * temp_v0_4;
D_8008C660 = temp_lo >> 1;
D_8008C664 = temp_lo;
if (!(D_8007B2E4 & 0x480)) {
if ((D_8007BAE4 == 0.0f) && (D_8007BAEC == 0.0f)) {
D_8004D2B8++;
if (D_8004D2B8 >= 0x1F) {
D_8004D2BC = 0xF;
D_8004D2B4 = 0;
D_8004D2B8 = 0;
}
} else {
D_8004D2B8 = 0;
}
}
} else {
if (D_8004D2BC != 0) {
D_8004D2BC--;
}
temp_lo = D_8004D2BC * D_8004D2BC;
D_8008C660 = temp_lo >> 1;
D_8008C664 = temp_lo;
if (!(gBattleState & 1) && !(D_8007B2E4 & 0x480)) {
if ((D_8007BAE4 != 0.0f) || (D_8007BAEC != 0.0f)) {
D_8004D2B8++;
if (D_8004D2B8 >= 0x1F) {
D_8004D2BC = 0xF;
D_8004D2B4 += 1;
D_8004D2B8 = 0;
}
} else {
D_8004D2B8 = 0;
}
}
}
gHUDResolutionX = 0x1C - D_8008C660;
gHUDResolutionY = 0x18;
var_v0 = D_8007B2E4 & 0xC00;
if (var_v0 == 0) {
func_8001E7FC(&gPlayerPos);
var_v0 = D_8007B2E4 & 0xC00;
}
gHUDResolutionX = 0x1C - D_8008C664;
gHUDResolutionY = 0xC5;
if (var_v0 == 0) {
func_8001EBDC(D_8007BAC8);
}
var_v0 = gBattleState & 1;
if ((D_80084EE0 & 0xD) && (var_v0 == 0) && !(D_80084F1C->unk14 & 8)) {
func_8001EA84(arg0);
var_v0 = gBattleState & 1;
}
gHUDResolutionY = 0;
gHUDResolutionX = 0;
if ((var_v0 != 0) && ((u16) D_8008C630 != 0)) {
func_800203D0();
D_8008C630 = (u16) D_8008C630 - 1;
}
if (D_8007B2E4 & 4) {
func_8001ED5C(&D_8007BAB8);
} else if (D_8007B2E4 & 8) {
func_8001F3DC(&D_8007BAB8);
}
gHUDResolutionY = 0;
gHUDResolutionX = 0;
D_8008C658 = 0x140;
D_8008C65C = 0xF0;
if (gBattleState & 1) {
Draw_MISS_Icon();
if (!(gBattleState & 2) && (D_8007BABA != 0) && !(D_8007BB2C & 1) && !(D_80086F10 & 1)) {
func_8001FA60((D_8007BABA - 1) & 0xFFFF);
}
if ((D_8007BAC0 & 0x20) && !(D_8007B2E4 & 0x800)) {
func_8001FB94();
}
func_8001FEEC(&gPlayerPos);
if (D_8007C990 != 0) {
for (i = 0; i < D_8007C990; i++) {
if (D_8007C998[i].battleData.modelID != -1) {
func_8001FEEC(&D_8007C998[i].battleData);
}
}
}
} else {
if ((D_8007BA74 != 0) && !(D_8007B2E4 & 7)) {
func_8001F818();
return;
}
if ((D_8007BA78 != 0) && !(D_8007B2E4 & 0xB)) {
func_8001F900();
return;
}
if ((D_8007BA7C != 0) && !(D_8007B2E4 & 7)) {
func_8001F9B0();
}
}
}
#endif
//#pragma GLOBAL_ASM("asm/nonmatchings/hud/func_8001E7FC.s")
void func_8001E7FC(BrianData2 *arg0)
{

View File

@ -186,36 +186,7 @@ s32 CheckIfInventoryFull(void) {
}
#pragma GLOBAL_ASM("asm/nonmatchings/inventory/func_80021240.s")
#ifdef NON_MATCHING
s32 func_80021240(u8 arg0)
{
s32 var_v1 = 0;
u8 temp_t9;
u8 new_var2;
u8 *var_a2;
u8 *new_var;
var_a2 = &gInventory[0x95];
var_a2 = &D_8008CF77;
while (var_v1 == 0)
{
new_var2 = *var_a2;
temp_t9 = new_var2;
new_var = var_a2;
new_var2 = 0;
var_a2 -= 1;
if (arg0 == temp_t9)
{
var_v1 += 1;
}
if (var_a2 == ((new_var2, new_var)))
{
break;
}
}
return var_v1;
}
#endif
//#pragma GLOBAL_ASM("asm/nonmatchings/inventory/AddItemToInventory.s")
void AddItemToInventory(u8 itemID) {

View File

@ -71,229 +71,6 @@ s32 func_8010004C_DA693C(void) { //s32 may be incorrect, but seeing as the funci
}
#pragma GLOBAL_ASM("asm/nonmatchings/ovl_overlay1/DA68F0/func_801000A8_DA6998.s")
#ifdef NON_MATCHING
s32 func_801000A8_DA6998(void)
{
u32 var_a1;
if (D_80103120_DA9A10 == 0)
{
D_8011AD30 = 3;
gGlobalStartScreenTimer = 1;
D_8011AD44 = 0;
D_8006AC60 = 0;
D_80103120_DA9A10 += 1;
}
switch (D_8011AD30)
{
case 3:
gGlobalStartScreenTimer--;
if (gGlobalStartScreenTimer == 0)
{
gGlobalStartScreenTimer = 0x1518;
D_8011AD30 += 1;
D_80103424_DA9D14 = 0x14;
D_80103420_DA9D10 = 2;
}
break;
case 4:
func_801006D8_DA6FC8();
if (D_80103420_DA9D10 == 2)
{
func_80102E30_DA9720();
}
if (((gGlobalStartScreenTimer == 0) && (D_8011AD44 == 0)) && (D_80103110_DA9A00 == 0))
{
D_80103110_DA9A00 = 1;
D_80103424_DA9D14 = 0x3C;
D_80103420_DA9D10 = 1;
gGlobalStartScreenTimer = 0x3C;
}
if (D_80103110_DA9A00 == 1)
{
func_80102E30_DA9720();
if (D_80103420_DA9D10 == 0)
{
gPushStartBlinkTimer = 0;
gPushStartBlinkFrequency = 8;
gGlobalStartScreenTimer = 0;
D_8011AD30 = 0;
D_80103110_DA9A00 = 0;
D_8011AD44 = 0;
}
}
if ((gGlobalStartScreenTimer == 0) && (D_8011AD44 == 1))
{
D_8011AD44 = 2;
gGlobalStartScreenTimer = 2;
D_8011AD30 += 1;
}
break;
case 5:
func_801006D8_DA6FC8();
if (D_8010311C_DA9A0C == 0)
{
var_a1 = D_80103118_DA9A08 + 1;
}
else
{
var_a1 = 0;
}
if (((((!(D_80092876 & 0xF000)) && (D_80092871 >= (-0x13))) && (D_80092871 < 0x14)) && (D_80092872 >= (-0x13))) && (D_80092872 < 0x14))
{
D_8010311C_DA9A0C = 0;
}
else
{
D_8010311C_DA9A0C = 1;
}
D_80103118_DA9A08 = var_a1;
if (var_a1 >= 0x1C21U)
{
D_8010311C_DA9A0C = 0;
D_8011AD44 = 4;
D_80103110_DA9A00 = 1;
gGlobalStartScreenTimer = 2;
D_80103118_DA9A08 = 0;
}
if (D_80103110_DA9A00 == 0)
{
gGlobalStartScreenTimer = 0x14;
}
if ((gGlobalStartScreenTimer == 0) && ((D_8011AD44 == 3) || (D_8011AD44 == 4)))
{
if (D_8011AD44 == 4)
{
D_80103110_DA9A00 = 2;
D_80103424_DA9D14 = 0x3C;
D_80103420_DA9D10 = 1;
}
gGlobalStartScreenTimer = 0x3C;
if (D_8011AD44 == 3)
{
D_8011AD44 = 5;
D_8011AD30 += 1;
gPushStartBlinkTimer = 0xFF;
gPushStartBlinkFrequency = 0;
D_80103110_DA9A00 = 0;
}
}
if (D_80103110_DA9A00 == 2)
{
func_80102E30_DA9720();
if (D_80103420_DA9D10 == 0)
{
gPushStartBlinkTimer = 0;
gPushStartBlinkFrequency = 8;
gGlobalStartScreenTimer = 0;
D_8011AD38 = 0;
D_8011AD30 = 3;
D_80103110_DA9A00 = 0;
}
}
break;
case 6:
func_801006D8_DA6FC8();
if (D_80103114_DA9A04 < 2)
{
D_80103114_DA9A04++;
}
else
if ((D_8007B344 & 0xF0) == 0x10)
{
D_8011AD30 = 8;
D_80103424_DA9D14 = 0x3C;
D_80103420_DA9D10 = 1;
}
else
{
D_8011AD30 = 8;
D_80103424_DA9D14 = 0x3C;
D_80103420_DA9D10 = 1;
}
break;
case 7:
func_801006D8_DA6FC8();
if (D_80103110_DA9A00 == 0)
{
gGlobalStartScreenTimer = 0x14;
}
if (D_8011AD44 == 2)
{
D_8011AD30 = 5;
}
if ((gGlobalStartScreenTimer == 0) && ((((((D_8011AD44 == 0xB) || (D_8011AD44 == 0xC)) || (D_8011AD44 == 0xD)) || (D_8011AD44 == 0xE)) || (D_8011AD44 == 9)) || (D_8011AD44 == 0xA)))
{
if (D_8011AD44 == 9)
{
gGlobalStartScreenTimer = 0xA;
D_8011AD30 = 5;
D_80103110_DA9A00 = 0;
D_8011AD44 = 2;
D_8011AD44 = 2;
}
if (D_8011AD44 == 0xA)
{
gGlobalStartScreenTimer = 0xA;
D_8011AD30 = 5;
D_80103110_DA9A00 = 0;
D_8011AD44 = 2;
D_8011AD44 = 2;
}
if (D_8011AD44 == 0xC)
{
gGlobalStartScreenTimer = 5;
D_8011AD44 = 9;
D_80103110_DA9A00 = 0;
}
if (D_8011AD44 == 0xB)
{
gGlobalStartScreenTimer = 0x3C;
D_8011AD30 += 1;
D_8011AD44 = 0xF;
gPushStartBlinkTimer = 0;
gPushStartBlinkFrequency = 0x100;
D_80103424_DA9D14 = 0x3C;
D_80103420_DA9D10 = 1;
;
D_80103110_DA9A00 = 0;
}
if (D_8011AD44 == 0xD)
{
gGlobalStartScreenTimer = 5;
D_8011AD44 = 0xA;
D_80103110_DA9A00 = 0;
}
if (D_8011AD44 == 0xE)
{
gGlobalStartScreenTimer = 0xA;
D_8011AD30 = 5;
D_8011AD44 = 2;
D_80103110_DA9A00 = 0;
}
}
break;
case 8:
func_80100B14_DA7404();
func_80102E30_DA9720();
break;
}
if (gGlobalStartScreenTimer == 0)
{
D_8010311C_DA9A0C = 0;
D_80103118_DA9A08 = 0;
}
return gGlobalStartScreenTimer;
}
#endif
//#pragma GLOBAL_ASM("asm/nonmatchings/ovl_overlay1/DA68F0/func_801006D8_DA6FC8.s")

View File

@ -392,6 +392,7 @@ __osViCurr = 0x80070A80;
__osViNext = 0x80070A84;
gGameMode = 0x8007b2e0;
gMasterGfxPos = 0x8007B2FC;
gTreasureChestPointer = 0x8007BA7C;
gPlayerData = 0x8007BA80;
gFireSpirits = 0x8007BAA4;
gEarthSpirits = 0x8007BAA5;

@ -1 +1 @@
Subproject commit 6dd4d3adcbfb3ee607b9a1e2bba3502d27217d44
Subproject commit 41c1b303e7761a35fd67d85de09cec5ea4b4eac6

@ -1 +1 @@
Subproject commit 312d57a03d5fd03bbd98106e9986f1257b75d950
Subproject commit d87e50f4ed96bc2a00e3b0c65d453608fb6b57cc