mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-17 21:03:21 -04:00
Attempt to decompile func0f164e8c
This commit is contained in:
@@ -7091,7 +7091,7 @@ bool g_PortalStack[20] = {0};
|
||||
s32 g_PortalStackIndex = 0x00000000;
|
||||
u32 g_PortalMode = 0x00000000;
|
||||
u32 var8007fcb0 = 0x00000190;
|
||||
u32 var8007fcb4 = 0x00000000;
|
||||
f32 var8007fcb4 = 0;
|
||||
u32 var8007fcb8 = 0x00000000;
|
||||
u32 var8007fcbc = 0x00000000;
|
||||
|
||||
|
||||
@@ -15873,6 +15873,44 @@ glabel var7f1b76c4
|
||||
/* f164f98: 27bd0048 */ addiu $sp,$sp,0x48
|
||||
);
|
||||
|
||||
// regalloc in callee-save registers
|
||||
// The empty if-statements below narrow it down to just two swapped registers
|
||||
//s32 func0f164e8c(struct coord *arg0, struct coord *arg1)
|
||||
//{
|
||||
// s32 bestportalnum = -1;
|
||||
// s32 count = 0;
|
||||
// f32 bestthing = F32_MAX;
|
||||
// f32 thisthing;
|
||||
// s32 i;
|
||||
//
|
||||
// for (i = 0; g_Portals[i].unk00; i++) {
|
||||
// if (func00017e30(i, arg0, arg1)) {
|
||||
// thisthing = var8007fcb4;
|
||||
//
|
||||
// if (thisthing < 0) {
|
||||
// thisthing = -thisthing;
|
||||
// }
|
||||
//
|
||||
// if (thisthing < bestthing) {
|
||||
// bestportalnum = i;
|
||||
// bestthing = thisthing;
|
||||
// count++;
|
||||
//
|
||||
// if (i);
|
||||
// if (bestportalnum);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (i);
|
||||
// if (bestportalnum);
|
||||
// }
|
||||
//
|
||||
// if (count);
|
||||
// if (bestportalnum);
|
||||
//
|
||||
// return bestportalnum;
|
||||
//}
|
||||
|
||||
GLOBAL_ASM(
|
||||
glabel func0f164f9c
|
||||
/* f164f9c: 00001825 */ or $v1,$zero,$zero
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#define osSyncPrintf
|
||||
|
||||
#define F32_MAX 3.4028234663853E+38 // 7f7fffff
|
||||
#define S32_MAX 2147483647
|
||||
#define U32_MAX 4294967295
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ extern bool g_PortalStack[20];
|
||||
extern s32 g_PortalStackIndex;
|
||||
extern u32 g_PortalMode;
|
||||
extern u32 var8007fcb0;
|
||||
extern u32 var8007fcb4;
|
||||
extern f32 var8007fcb4;
|
||||
extern struct stagetableentry g_Stages[61];
|
||||
extern u32 var80081018;
|
||||
extern u32 var80081058;
|
||||
|
||||
@@ -40,7 +40,7 @@ u32 func00017c2c(void);
|
||||
u32 func00017cbc(void);
|
||||
u32 func00017ce0(void);
|
||||
u32 func00017dc4(void);
|
||||
u32 func00017e30(void);
|
||||
bool func00017e30(s32 portalnum, struct coord *arg1, struct coord *arg2);
|
||||
u32 func00018148(void);
|
||||
void func000185d0(struct defaultobj *obj, s32 arg1);
|
||||
u32 func00018680(void);
|
||||
|
||||
Reference in New Issue
Block a user