mirror of https://github.com/n64decomp/mk64.git
A bunch of unrelated, assorted changes (#263)
Couple matches functions, an update to a struct, a bunch of header files adjustments, and some mips_to_c regenerations Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
This commit is contained in:
parent
82b53f5928
commit
b7e7b34998
|
|
@ -1,109 +0,0 @@
|
|||
glabel func_8001D794
|
||||
/* 01E394 8001D794 27BDFF70 */ addiu $sp, $sp, -0x90
|
||||
/* 01E398 8001D798 AFBF0034 */ sw $ra, 0x34($sp)
|
||||
/* 01E39C 8001D79C AFB20030 */ sw $s2, 0x30($sp)
|
||||
/* 01E3A0 8001D7A0 AFB1002C */ sw $s1, 0x2c($sp)
|
||||
/* 01E3A4 8001D7A4 AFB00028 */ sw $s0, 0x28($sp)
|
||||
/* 01E3A8 8001D7A8 F7B40020 */ sdc1 $f20, 0x20($sp)
|
||||
/* 01E3AC 8001D7AC AFA7009C */ sw $a3, 0x9c($sp)
|
||||
/* 01E3B0 8001D7B0 C4A40030 */ lwc1 $f4, 0x30($a1)
|
||||
/* 01E3B4 8001D7B4 3C013F80 */ li $at, 0x3F800000 # 1.000000
|
||||
/* 01E3B8 8001D7B8 4481A000 */ mtc1 $at, $f20
|
||||
/* 01E3BC 8001D7BC E7A40060 */ swc1 $f4, 0x60($sp)
|
||||
/* 01E3C0 8001D7C0 C4A60034 */ lwc1 $f6, 0x34($a1)
|
||||
/* 01E3C4 8001D7C4 3C0140C0 */ li $at, 0x40C00000 # 6.000000
|
||||
/* 01E3C8 8001D7C8 44815000 */ mtc1 $at, $f10
|
||||
/* 01E3CC 8001D7CC E7A60064 */ swc1 $f6, 0x64($sp)
|
||||
/* 01E3D0 8001D7D0 C4A80038 */ lwc1 $f8, 0x38($a1)
|
||||
/* 01E3D4 8001D7D4 44800000 */ mtc1 $zero, $f0
|
||||
/* 01E3D8 8001D7D8 00A08025 */ move $s0, $a1
|
||||
/* 01E3DC 8001D7DC 460A4101 */ sub.s $f4, $f8, $f10
|
||||
/* 01E3E0 8001D7E0 00C08825 */ move $s1, $a2
|
||||
/* 01E3E4 8001D7E4 00809025 */ move $s2, $a0
|
||||
/* 01E3E8 8001D7E8 44070000 */ mfc1 $a3, $f0
|
||||
/* 01E3EC 8001D7EC E7A40068 */ swc1 $f4, 0x68($sp)
|
||||
/* 01E3F0 8001D7F0 C4A6003C */ lwc1 $f6, 0x3c($a1)
|
||||
/* 01E3F4 8001D7F4 27A4006C */ addiu $a0, $sp, 0x6c
|
||||
/* 01E3F8 8001D7F8 E7A60054 */ swc1 $f6, 0x54($sp)
|
||||
/* 01E3FC 8001D7FC C4A80040 */ lwc1 $f8, 0x40($a1)
|
||||
/* 01E400 8001D800 E7A80058 */ swc1 $f8, 0x58($sp)
|
||||
/* 01E404 8001D804 C4AA0044 */ lwc1 $f10, 0x44($a1)
|
||||
/* 01E408 8001D808 E7AA005C */ swc1 $f10, 0x5c($sp)
|
||||
/* 01E40C 8001D80C C4A4000C */ lwc1 $f4, 0xc($a1)
|
||||
/* 01E410 8001D810 E4C40000 */ swc1 $f4, ($a2)
|
||||
/* 01E414 8001D814 C4A60010 */ lwc1 $f6, 0x10($a1)
|
||||
/* 01E418 8001D818 E4C60004 */ swc1 $f6, 4($a2)
|
||||
/* 01E41C 8001D81C C4A80014 */ lwc1 $f8, 0x14($a1)
|
||||
/* 01E420 8001D820 44050000 */ mfc1 $a1, $f0
|
||||
/* 01E424 8001D824 E4C80008 */ swc1 $f8, 8($a2)
|
||||
/* 01E428 8001D828 87AE00AA */ lh $t6, 0xaa($sp)
|
||||
/* 01E42C 8001D82C 4406A000 */ mfc1 $a2, $f20
|
||||
/* 01E430 8001D830 0C0AD950 */ jal func_802B6540
|
||||
/* 01E434 8001D834 AFAE0010 */ sw $t6, 0x10($sp)
|
||||
/* 01E438 8001D838 27A40054 */ addiu $a0, $sp, 0x54
|
||||
/* 01E43C 8001D83C 0C0AD8EE */ jal func_802B63B8
|
||||
/* 01E440 8001D840 27A5006C */ addiu $a1, $sp, 0x6c
|
||||
/* 01E444 8001D844 C7AA0054 */ lwc1 $f10, 0x54($sp)
|
||||
/* 01E448 8001D848 C6440014 */ lwc1 $f4, 0x14($s2)
|
||||
/* 01E44C 8001D84C C7A6005C */ lwc1 $f6, 0x5c($sp)
|
||||
/* 01E450 8001D850 C648001C */ lwc1 $f8, 0x1c($s2)
|
||||
/* 01E454 8001D854 46045380 */ add.s $f14, $f10, $f4
|
||||
/* 01E458 8001D858 C6440018 */ lwc1 $f4, 0x18($s2)
|
||||
/* 01E45C 8001D85C C7AA0058 */ lwc1 $f10, 0x58($sp)
|
||||
/* 01E460 8001D860 46083400 */ add.s $f16, $f6, $f8
|
||||
/* 01E464 8001D864 C608000C */ lwc1 $f8, 0xc($s0)
|
||||
/* 01E468 8001D868 C6260000 */ lwc1 $f6, ($s1)
|
||||
/* 01E46C 8001D86C 46045480 */ add.s $f18, $f10, $f4
|
||||
/* 01E470 8001D870 27A40060 */ addiu $a0, $sp, 0x60
|
||||
/* 01E474 8001D874 27A5006C */ addiu $a1, $sp, 0x6c
|
||||
/* 01E478 8001D878 46087281 */ sub.s $f10, $f14, $f8
|
||||
/* 01E47C 8001D87C 46145102 */ mul.s $f4, $f10, $f20
|
||||
/* 01E480 8001D880 C62A0004 */ lwc1 $f10, 4($s1)
|
||||
/* 01E484 8001D884 46043200 */ add.s $f8, $f6, $f4
|
||||
/* 01E488 8001D888 E6280000 */ swc1 $f8, ($s1)
|
||||
/* 01E48C 8001D88C C6060010 */ lwc1 $f6, 0x10($s0)
|
||||
/* 01E490 8001D890 46069101 */ sub.s $f4, $f18, $f6
|
||||
/* 01E494 8001D894 46142202 */ mul.s $f8, $f4, $f20
|
||||
/* 01E498 8001D898 C6240008 */ lwc1 $f4, 8($s1)
|
||||
/* 01E49C 8001D89C 46085180 */ add.s $f6, $f10, $f8
|
||||
/* 01E4A0 8001D8A0 E6260004 */ swc1 $f6, 4($s1)
|
||||
/* 01E4A4 8001D8A4 C60A0014 */ lwc1 $f10, 0x14($s0)
|
||||
/* 01E4A8 8001D8A8 460A8201 */ sub.s $f8, $f16, $f10
|
||||
/* 01E4AC 8001D8AC 46144182 */ mul.s $f6, $f8, $f20
|
||||
/* 01E4B0 8001D8B0 46062280 */ add.s $f10, $f4, $f6
|
||||
/* 01E4B4 8001D8B4 0C0AD8EE */ jal func_802B63B8
|
||||
/* 01E4B8 8001D8B8 E62A0008 */ swc1 $f10, 8($s1)
|
||||
/* 01E4BC 8001D8BC C7A80060 */ lwc1 $f8, 0x60($sp)
|
||||
/* 01E4C0 8001D8C0 C6440014 */ lwc1 $f4, 0x14($s2)
|
||||
/* 01E4C4 8001D8C4 C7A60068 */ lwc1 $f6, 0x68($sp)
|
||||
/* 01E4C8 8001D8C8 C64A001C */ lwc1 $f10, 0x1c($s2)
|
||||
/* 01E4CC 8001D8CC 46044380 */ add.s $f14, $f8, $f4
|
||||
/* 01E4D0 8001D8D0 C6000000 */ lwc1 $f0, ($s0)
|
||||
/* 01E4D4 8001D8D4 C6440018 */ lwc1 $f4, 0x18($s2)
|
||||
/* 01E4D8 8001D8D8 460A3400 */ add.s $f16, $f6, $f10
|
||||
/* 01E4DC 8001D8DC C7A80064 */ lwc1 $f8, 0x64($sp)
|
||||
/* 01E4E0 8001D8E0 8FAF009C */ lw $t7, 0x9c($sp)
|
||||
/* 01E4E4 8001D8E4 46007181 */ sub.s $f6, $f14, $f0
|
||||
/* 01E4E8 8001D8E8 46044480 */ add.s $f18, $f8, $f4
|
||||
/* 01E4EC 8001D8EC 46143282 */ mul.s $f10, $f6, $f20
|
||||
/* 01E4F0 8001D8F0 46005200 */ add.s $f8, $f10, $f0
|
||||
/* 01E4F4 8001D8F4 E5E80000 */ swc1 $f8, ($t7)
|
||||
/* 01E4F8 8001D8F8 C6020004 */ lwc1 $f2, 4($s0)
|
||||
/* 01E4FC 8001D8FC 8FB800A0 */ lw $t8, 0xa0($sp)
|
||||
/* 01E500 8001D900 46029101 */ sub.s $f4, $f18, $f2
|
||||
/* 01E504 8001D904 46142182 */ mul.s $f6, $f4, $f20
|
||||
/* 01E508 8001D908 46023280 */ add.s $f10, $f6, $f2
|
||||
/* 01E50C 8001D90C E70A0000 */ swc1 $f10, ($t8)
|
||||
/* 01E510 8001D910 C60C0008 */ lwc1 $f12, 8($s0)
|
||||
/* 01E514 8001D914 8FB900A4 */ lw $t9, 0xa4($sp)
|
||||
/* 01E518 8001D918 460C8201 */ sub.s $f8, $f16, $f12
|
||||
/* 01E51C 8001D91C 46144102 */ mul.s $f4, $f8, $f20
|
||||
/* 01E520 8001D920 460C2180 */ add.s $f6, $f4, $f12
|
||||
/* 01E524 8001D924 E7260000 */ swc1 $f6, ($t9)
|
||||
/* 01E528 8001D928 8FBF0034 */ lw $ra, 0x34($sp)
|
||||
/* 01E52C 8001D92C 8FB20030 */ lw $s2, 0x30($sp)
|
||||
/* 01E530 8001D930 8FB1002C */ lw $s1, 0x2c($sp)
|
||||
/* 01E534 8001D934 8FB00028 */ lw $s0, 0x28($sp)
|
||||
/* 01E538 8001D938 D7B40020 */ ldc1 $f20, 0x20($sp)
|
||||
/* 01E53C 8001D93C 03E00008 */ jr $ra
|
||||
/* 01E540 8001D940 27BD0090 */ addiu $sp, $sp, 0x90
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
glabel func_802AF9F0
|
||||
/* 119000 802AF9F0 44856000 */ mtc1 $a1, $f12
|
||||
/* 119004 802AF9F4 C4860000 */ lwc1 $f6, ($a0)
|
||||
/* 119008 802AF9F8 C4C40000 */ lwc1 $f4, ($a2)
|
||||
/* 11900C 802AF9FC C4D00004 */ lwc1 $f16, 4($a2)
|
||||
/* 119010 802AFA00 460C3202 */ mul.s $f8, $f6, $f12
|
||||
/* 119014 802AFA04 46082281 */ sub.s $f10, $f4, $f8
|
||||
/* 119018 802AFA08 C4C80008 */ lwc1 $f8, 8($a2)
|
||||
/* 11901C 802AFA0C E4CA0000 */ swc1 $f10, ($a2)
|
||||
/* 119020 802AFA10 C4920004 */ lwc1 $f18, 4($a0)
|
||||
/* 119024 802AFA14 460C9182 */ mul.s $f6, $f18, $f12
|
||||
/* 119028 802AFA18 46068101 */ sub.s $f4, $f16, $f6
|
||||
/* 11902C 802AFA1C E4C40004 */ swc1 $f4, 4($a2)
|
||||
/* 119030 802AFA20 C48A0008 */ lwc1 $f10, 8($a0)
|
||||
/* 119034 802AFA24 460C5482 */ mul.s $f18, $f10, $f12
|
||||
/* 119038 802AFA28 46124401 */ sub.s $f16, $f8, $f18
|
||||
/* 11903C 802AFA2C 03E00008 */ jr $ra
|
||||
/* 119040 802AFA30 E4D00008 */ swc1 $f16, 8($a2)
|
||||
|
|
@ -191,9 +191,7 @@ typedef struct {
|
|||
} mk64_surface_map_ram; // size = 0x2C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ f32 cornerX;
|
||||
/* 0x04 */ f32 cornerY;
|
||||
/* 0x08 */ f32 cornerZ;
|
||||
/* 0x00 */ Vec3f cornerPos;
|
||||
// Type of surface the corner is above
|
||||
/* 0x0C */ u8 surfaceType;
|
||||
// Close to being a copy of the top byte of the surface_map "flag" member
|
||||
|
|
@ -201,7 +199,7 @@ typedef struct {
|
|||
// Don't know if "tile" is right the right term
|
||||
// D_8015F580 is a pointer to an array of "tile" structs. This is an index to that array
|
||||
/* 0x0E */ u16 surfaceMapIndex;
|
||||
// cornerX/Y/Z place the corner "in the air" as it were, this member indicates the Y position of the corner's "on the ground" sibling
|
||||
// cornerPos places the corner "in the air" as it were, this member indicates the Y position of the corner's "on the ground" sibling
|
||||
// On flat ground this value should be cornerY - gKartBoundingBoxTable[characterId]
|
||||
/* 0x10 */ f32 cornerGroundY;
|
||||
// Something lighting related. 1 when in a shaded region, 2 when in a tree's shadow
|
||||
|
|
@ -274,7 +272,14 @@ typedef struct {
|
|||
/* 0x00C6 */ s16 unk_0C6;
|
||||
/* 0x00C8 */ s16 unk_0C8;
|
||||
/* 0x00CA */ s16 unk_0CA;
|
||||
/* 0x00CC */ char unk_0CC[0x10];
|
||||
/* 0x00CC */ s16 unk_0CC;
|
||||
/* 0x00CE */ s16 unk_0CE;
|
||||
/* 0x00D0 */ s16 unk_0D0;
|
||||
/* 0x00D2 */ s16 unk_0D2;
|
||||
/* 0x00D4 */ s16 unk_0D4;
|
||||
/* 0x00D6 */ s16 unk_0D6;
|
||||
/* 0x00D8 */ s16 unk_0D8;
|
||||
/* 0x00DA */ s16 unk_0DA;
|
||||
/* 0x00DC */ s16 boostTimer;
|
||||
/* 0x00DE */ u16 unk_0DE;
|
||||
/* 0x00E0 */ s16 unk_0E0;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ void mio0decode(u8* arg0, u8* arg1);
|
|||
|
||||
void func_8000F2DC(void);
|
||||
void func_8000F628(void);
|
||||
void func_802B6540(f32* arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4);
|
||||
void func_8006B7E4(Player* player, s32 arg1);
|
||||
void func_800267AC(Player* player, s8 arg1, s8 arg2);
|
||||
void func_8005D290(void);
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ extern s16 *D_801645A0[];
|
|||
extern s16 D_80162FCE;
|
||||
// Shadows values from gPathIndexByPlayerId
|
||||
extern s32 D_80163448;
|
||||
// Shadows values from gPathIndexByPlayerId, but is an array
|
||||
extern u16 D_80165310[];
|
||||
// Shadows values from D_80164560
|
||||
extern struct TrackWayPoint *D_801631D0;
|
||||
// Shadows values from D_80164570
|
||||
|
|
|
|||
|
|
@ -26,22 +26,21 @@ GLOBAL_ASM("asm/non_matchings/audio/external/func_800C13FC.s")
|
|||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
|
||||
extern ? D_80191420;
|
||||
|
||||
f32 func_800C1480(s32 arg0, s32 arg1) {
|
||||
? sp-10;
|
||||
f32 temp_f0;
|
||||
f32 temp_f12;
|
||||
f32 var_f2;
|
||||
f32 var_f2_2;
|
||||
s32 temp_v0_2;
|
||||
s32 temp_v1;
|
||||
s32 var_v0;
|
||||
void *temp_v0;
|
||||
s32 phi_v0;
|
||||
f32 phi_f2;
|
||||
f32 phi_f2_2;
|
||||
|
||||
sp-10.unk10 = arg0;
|
||||
sp-10.unk14 = arg1;
|
||||
unksp-10.unk10 = arg0;
|
||||
unksp-10.unk14 = arg1;
|
||||
temp_v0 = ((arg0 & 0xFF) * 0x3C0) + ((arg1 & 0xFF) * 0x30) + &D_80191420;
|
||||
temp_v1 = temp_v0->unk24;
|
||||
if (temp_v1 & 0x400000) {
|
||||
|
|
@ -50,30 +49,31 @@ f32 func_800C1480(s32 arg0, s32 arg1) {
|
|||
temp_f0 = temp_v0->unk1C;
|
||||
temp_v0_2 = temp_v1 & 0x30000;
|
||||
if (temp_f0 > 2000.0f) {
|
||||
phi_f2 = 0.0f;
|
||||
var_f2 = 0.0f;
|
||||
} else {
|
||||
if (temp_v0_2 != 0x10000) {
|
||||
if (temp_v0_2 != 0x20000) {
|
||||
if (temp_v0_2 != 0x30000) {
|
||||
phi_v0 = 0x190;
|
||||
} else {
|
||||
phi_v0 = 0x3E8;
|
||||
}
|
||||
} else {
|
||||
phi_v0 = 0x29A;
|
||||
}
|
||||
} else {
|
||||
phi_v0 = 0x1F4;
|
||||
switch (temp_v0_2) { /* irregular */
|
||||
default:
|
||||
var_v0 = 0x190;
|
||||
break;
|
||||
case 0x10000:
|
||||
var_v0 = 0x1F4;
|
||||
break;
|
||||
case 0x20000:
|
||||
var_v0 = 0x29A;
|
||||
break;
|
||||
case 0x30000:
|
||||
var_v0 = 0x3E8;
|
||||
break;
|
||||
}
|
||||
temp_f12 = phi_v0;
|
||||
temp_f12 = (f32) var_v0;
|
||||
if (temp_f0 < temp_f12) {
|
||||
phi_f2_2 = (((temp_f12 - temp_f0) / temp_f12) * 0.5) + 0.5;
|
||||
var_f2_2 = (f32) (((f64) ((temp_f12 - temp_f0) / temp_f12) * 0.5) + 0.5);
|
||||
} else {
|
||||
phi_f2_2 = (1.0 - ((temp_f0 - temp_f12) / (2000.0f - temp_f12))) * 0.5;
|
||||
var_f2_2 = (f32) ((1.0 - (f64) ((temp_f0 - temp_f12) / (2000.0f - temp_f12))) * 0.5);
|
||||
}
|
||||
phi_f2 = phi_f2_2 * phi_f2_2;
|
||||
var_f2 = var_f2_2 * var_f2_2;
|
||||
}
|
||||
return phi_f2;
|
||||
return var_f2;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1480.s")
|
||||
|
|
|
|||
203
src/audio/load.c
203
src/audio/load.c
|
|
@ -230,34 +230,27 @@ void *func_800BAD0C(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
|||
return (devAddr - dmaDevAddr) + dma->buffer;
|
||||
}
|
||||
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
s32 osPiStartDma(void *, ?, ?, s32, s32, s32, ? *); // extern
|
||||
extern OSMesgQueue gCurrAudioFrameDmaQueue;
|
||||
extern OSIoMesg gCurrAudioFrameDmaIoMesgBufs;
|
||||
extern ? sSampleDmas;
|
||||
extern u32 gSampleDmaNumListItems;
|
||||
extern u32 sSampleDmaListSize1;
|
||||
extern u8 sSampleDmaReuseQueue1;
|
||||
extern u8 sSampleDmaReuseQueue2;
|
||||
extern u8 sSampleDmaReuseQueueTail1;
|
||||
extern u8 sSampleDmaReuseQueueTail2;
|
||||
extern u8 sSampleDmaReuseQueueHead2;
|
||||
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
|
||||
extern s32 gCurrAudioFrameDmaCount;
|
||||
|
||||
s32 func_800BAD0C(s32 arg0, s32 arg1, s32 arg2, u8 *arg3) {
|
||||
void *sp40;
|
||||
void *func_800BAD0C(u32 devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) {
|
||||
struct SharedDma *sp40;
|
||||
s32 sp30;
|
||||
s32 temp_s0;
|
||||
s32 temp_t9;
|
||||
s32 temp_v0_2;
|
||||
s32 temp_v0_4;
|
||||
s32 temp_v1_6;
|
||||
s32 temp_v1_3;
|
||||
s32 var_t2;
|
||||
s32 var_t3;
|
||||
struct SharedDma *temp_t0;
|
||||
struct SharedDma *var_a0;
|
||||
struct SharedDma *var_t0;
|
||||
u16 temp_v0_6;
|
||||
u32 temp_a1;
|
||||
u32 temp_a1_2;
|
||||
u32 temp_v1;
|
||||
u32 temp_v1_3;
|
||||
u32 temp_v1_4;
|
||||
u32 temp_s0;
|
||||
u32 var_v1;
|
||||
u32 var_v1_2;
|
||||
u8 *temp_v0_3;
|
||||
u8 *temp_v0_5;
|
||||
u8 temp_a0;
|
||||
|
|
@ -265,120 +258,102 @@ s32 func_800BAD0C(s32 arg0, s32 arg1, s32 arg2, u8 *arg3) {
|
|||
u8 temp_a1_4;
|
||||
u8 temp_a3;
|
||||
u8 temp_t2;
|
||||
u8 temp_t2_2;
|
||||
u8 temp_v0;
|
||||
u8 temp_v1;
|
||||
u8 temp_v1_2;
|
||||
u8 temp_v1_5;
|
||||
void *temp_t0;
|
||||
void *temp_t0_2;
|
||||
void *phi_t0;
|
||||
u32 phi_v1;
|
||||
void *phi_a0;
|
||||
u8 phi_v1_2;
|
||||
s32 phi_t3;
|
||||
void *phi_t0_2;
|
||||
s32 phi_t2;
|
||||
|
||||
phi_t3 = 0;
|
||||
phi_t3 = 0;
|
||||
if ((arg2 != 0) || (temp_a1 = sSampleDmaListSize1, temp_v0 = *arg3, phi_v1 = 0, ((temp_v0 < temp_a1) == 0))) {
|
||||
var_t3 = 0;
|
||||
if ((arg2 != 0) || (temp_a1 = sSampleDmaListSize1, temp_v0 = *dmaIndexRef, var_v1 = 0, ((temp_v0 < temp_a1) == 0))) {
|
||||
temp_a1_2 = gSampleDmaNumListItems;
|
||||
temp_v1_3 = sSampleDmaListSize1;
|
||||
phi_v1_2 = temp_v1_3;
|
||||
if (temp_v1_3 < temp_a1_2) {
|
||||
phi_a0 = (temp_v1_3 * 0x10) + &sSampleDmas;
|
||||
var_v1_2 = sSampleDmaListSize1;
|
||||
if (var_v1_2 < temp_a1_2) {
|
||||
var_a0 = &sSampleDmas[var_v1_2];
|
||||
loop_4:
|
||||
temp_v0_4 = arg0 - phi_a0->unk4;
|
||||
if ((temp_v0_4 >= 0) && ((phi_a0->unkA - arg1) >= temp_v0_4)) {
|
||||
if (phi_a0->unkE == 0) {
|
||||
temp_t0 = var_a0;
|
||||
temp_v0_2 = devAddr - var_a0->source;
|
||||
if ((temp_v0_2 >= 0) && ((u32) (var_a0->bufSize - size) >= (u32) temp_v0_2)) {
|
||||
if (var_a0->ttl == 0) {
|
||||
temp_a1_3 = sSampleDmaReuseQueueTail2;
|
||||
if (sSampleDmaReuseQueueHead2 != temp_a1_3) {
|
||||
temp_a3 = phi_a0->unkD;
|
||||
temp_v0_5 = &sSampleDmaReuseQueue2 + temp_a1_3;
|
||||
temp_a3 = var_a0->reuseIndex;
|
||||
temp_v0_3 = &sSampleDmaReuseQueue2[temp_a1_3];
|
||||
if (temp_a1_3 != temp_a3) {
|
||||
*(&sSampleDmaReuseQueue2 + temp_a3) = *temp_v0_5;
|
||||
(&sSampleDmas + (*temp_v0_5 * 0x10))->unkD = phi_a0->unkD;
|
||||
sSampleDmaReuseQueue2[temp_a3] = *temp_v0_3;
|
||||
sSampleDmas[*temp_v0_3].reuseIndex = var_a0->reuseIndex;
|
||||
}
|
||||
sSampleDmaReuseQueueTail2 = temp_a1_3 + 1;
|
||||
}
|
||||
}
|
||||
phi_a0->unkE = 0x3C;
|
||||
*arg3 = phi_v1_2;
|
||||
return (phi_a0->unk0 + arg0) - phi_a0->unk4;
|
||||
var_a0->ttl = 0x3C;
|
||||
*dmaIndexRef = (u8) var_v1_2;
|
||||
return &var_a0->buffer[devAddr] - var_a0->source;
|
||||
}
|
||||
temp_v1_4 = phi_v1_2 + 1;
|
||||
phi_a0 += 0x10;
|
||||
phi_v1_2 = temp_v1_4;
|
||||
if (temp_v1_4 >= temp_a1_2) {
|
||||
sp40 = phi_a0;
|
||||
var_v1_2 += 1;
|
||||
var_a0 += 0x10;
|
||||
if (var_v1_2 >= temp_a1_2) {
|
||||
sp40 = temp_t0;
|
||||
goto block_14;
|
||||
}
|
||||
goto loop_4;
|
||||
}
|
||||
block_14:
|
||||
temp_a1_4 = sSampleDmaReuseQueueTail2;
|
||||
phi_t0_2 = sp40;
|
||||
var_t0 = sp40;
|
||||
if ((sSampleDmaReuseQueueHead2 != temp_a1_4) && (arg2 != 0)) {
|
||||
temp_t2 = *(&sSampleDmaReuseQueue2 + temp_a1_4);
|
||||
temp_t2 = sSampleDmaReuseQueue2[temp_a1_4];
|
||||
sSampleDmaReuseQueueTail2 = temp_a1_4 + 1;
|
||||
sp30 = temp_t2;
|
||||
phi_t3 = 1;
|
||||
phi_t0_2 = &sSampleDmas + (temp_t2 * 0x10);
|
||||
var_t0 = &sSampleDmas[temp_t2];
|
||||
var_t3 = 1;
|
||||
sp30 = (s32) temp_t2;
|
||||
}
|
||||
goto block_27;
|
||||
}
|
||||
temp_t0 = &sSampleDmas + (temp_v0 * 0x10);
|
||||
phi_t0 = temp_t0;
|
||||
phi_t0_2 = temp_t0;
|
||||
var_t0 = &sSampleDmas[temp_v0];
|
||||
if (temp_a1 != 0) {
|
||||
loop_19:
|
||||
temp_v1 = phi_v1 + 1;
|
||||
temp_v0_2 = arg0 - phi_t0->unk4;
|
||||
phi_v1 = temp_v1;
|
||||
if ((temp_v0_2 >= 0) && ((phi_t0->unkA - arg1) >= temp_v0_2)) {
|
||||
if (phi_t0->unkE == 0) {
|
||||
temp_v1_2 = sSampleDmaReuseQueueTail1;
|
||||
temp_a0 = phi_t0->unkD;
|
||||
temp_v0_3 = &sSampleDmaReuseQueue1 + temp_v1_2;
|
||||
if (temp_v1_2 != temp_a0) {
|
||||
*(&sSampleDmaReuseQueue1 + temp_a0) = *temp_v0_3;
|
||||
(&sSampleDmas + (*temp_v0_3 * 0x10))->unkD = phi_t0->unkD;
|
||||
temp_t9 = var_v1 * 0x10;
|
||||
var_v1 += 1;
|
||||
temp_v0_4 = devAddr - var_t0->source;
|
||||
if ((temp_v0_4 >= 0) && ((u32) (var_t0->bufSize - size) >= (u32) temp_v0_4)) {
|
||||
if (var_t0->ttl == 0) {
|
||||
temp_v1 = sSampleDmaReuseQueueTail1;
|
||||
temp_a0 = var_t0->reuseIndex;
|
||||
temp_v0_5 = &sSampleDmaReuseQueue1[temp_v1];
|
||||
if (temp_v1 != temp_a0) {
|
||||
sSampleDmaReuseQueue1[temp_a0] = *temp_v0_5;
|
||||
sSampleDmas[*temp_v0_5].reuseIndex = var_t0->reuseIndex;
|
||||
}
|
||||
sSampleDmaReuseQueueTail1 = temp_v1_2 + 1;
|
||||
sSampleDmaReuseQueueTail1 = temp_v1 + 1;
|
||||
}
|
||||
phi_t0->unkE = 2;
|
||||
return (phi_t0->unk0 + arg0) - phi_t0->unk4;
|
||||
var_t0->ttl = 2;
|
||||
return &var_t0->buffer[devAddr] - var_t0->source;
|
||||
}
|
||||
temp_t0_2 = &sSampleDmas + (phi_v1 * 0x10);
|
||||
phi_t0 = temp_t0_2;
|
||||
phi_t0_2 = temp_t0_2;
|
||||
if (temp_v1 >= temp_a1) {
|
||||
var_t0 = sSampleDmas + temp_t9;
|
||||
if (var_v1 >= temp_a1) {
|
||||
goto block_27;
|
||||
}
|
||||
goto loop_19;
|
||||
}
|
||||
block_27:
|
||||
phi_t2 = sp30;
|
||||
if (phi_t3 == 0) {
|
||||
temp_v1_5 = sSampleDmaReuseQueueTail1;
|
||||
temp_t2_2 = *(&sSampleDmaReuseQueue1 + temp_v1_5);
|
||||
sSampleDmaReuseQueueTail1 = temp_v1_5 + 1;
|
||||
phi_t0_2 = &sSampleDmas + (temp_t2_2 * 0x10);
|
||||
phi_t2 = temp_t2_2;
|
||||
var_t2 = sp30;
|
||||
if (var_t3 == 0) {
|
||||
temp_v1_2 = sSampleDmaReuseQueueTail1;
|
||||
var_t2 = (s32) sSampleDmaReuseQueue1[temp_v1_2];
|
||||
sSampleDmaReuseQueueTail1 = temp_v1_2 + 1;
|
||||
var_t0 = sSampleDmas + (var_t2 * 0x10);
|
||||
}
|
||||
temp_v0_6 = phi_t0_2->unkA;
|
||||
temp_s0 = arg0 & ~0xF;
|
||||
phi_t0_2->unkE = 2;
|
||||
phi_t0_2->unk4 = temp_s0;
|
||||
phi_t0_2->unk8 = temp_v0_6;
|
||||
temp_v1_6 = gCurrAudioFrameDmaCount;
|
||||
temp_t9 = temp_v1_6 * 0x18;
|
||||
gCurrAudioFrameDmaCount = temp_v1_6 + 1;
|
||||
sp30 = phi_t2;
|
||||
sp40 = phi_t0_2;./
|
||||
osPiStartDma(temp_t9 + &gCurrAudioFrameDmaIoMesgBufs, 0, 0, temp_s0, phi_t0_2->unk0, temp_v0_6, &gCurrAudioFrameDmaQueue);
|
||||
*arg3 = phi_t2;
|
||||
return (arg0 - temp_s0) + phi_t0_2->unk0;
|
||||
temp_v0_6 = var_t0->bufSize;
|
||||
temp_s0 = devAddr & ~0xF;
|
||||
var_t0->ttl = 2;
|
||||
var_t0->source = temp_s0;
|
||||
var_t0->sizeUnused = temp_v0_6;
|
||||
temp_v1_3 = gCurrAudioFrameDmaCount;
|
||||
gCurrAudioFrameDmaCount = temp_v1_3 + 1;
|
||||
sp30 = var_t2;
|
||||
sp40 = var_t0;
|
||||
osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[temp_v1_3], 0, 0, temp_s0, var_t0->buffer, (u32) temp_v0_6, &gCurrAudioFrameDmaQueue);
|
||||
*dmaIndexRef = (u8) var_t2;
|
||||
return &var_t0->buffer[devAddr - temp_s0];
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/audio/load/func_800BAD0C.s")
|
||||
|
|
@ -475,43 +450,35 @@ s32 func_800BB304(struct AudioBankSample *sample) {
|
|||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
s32 func_800BB304(s32); // extern
|
||||
void *func_800BC948(); // extern
|
||||
void *func_800BC9F8(?); // extern
|
||||
//generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b
|
||||
void *func_800BC948(); /* extern */
|
||||
void *func_800BC9F8(s32); /* extern */
|
||||
|
||||
void func_800BB388(s32 arg1, ? arg2) {
|
||||
void func_800BB388(s32 arg0, s32 arg1, s32 arg2) {
|
||||
void *sp1C;
|
||||
void *temp_ret;
|
||||
void *temp_v0;
|
||||
void *temp_v0_2;
|
||||
|
||||
if (arg1 < 0x7F) {
|
||||
temp_ret = func_800BC948();
|
||||
temp_v0 = temp_ret;
|
||||
if (temp_v0 == 0) {
|
||||
temp_v0 = func_800BC948();
|
||||
if (temp_v0 == NULL) {
|
||||
return;
|
||||
}
|
||||
if (temp_v0->unk1 != 0) {
|
||||
sp1C = temp_v0;
|
||||
func_800BB304(temp_v0->unk8);
|
||||
}
|
||||
sp1C = temp_ret;
|
||||
func_800BB304(temp_ret->unk10);
|
||||
if (temp_ret->unk2 != 0x7F) {
|
||||
func_800BB304(temp_ret->unk18);
|
||||
return;
|
||||
sp1C = temp_v0;
|
||||
func_800BB304(temp_v0->unk10);
|
||||
if (temp_v0->unk2 != 0x7F) {
|
||||
func_800BB304(temp_v0->unk18);
|
||||
}
|
||||
// Duplicate return node #11. Try simplifying control flow for better match
|
||||
return;
|
||||
}
|
||||
if (arg1 == 0x7F) {
|
||||
} else if (arg1 == 0x0000007F) {
|
||||
temp_v0_2 = func_800BC9F8(arg2);
|
||||
if (temp_v0_2 == 0) {
|
||||
if (temp_v0_2 == NULL) {
|
||||
return;
|
||||
}
|
||||
func_800BB304(temp_v0_2->unk4);
|
||||
// Duplicate return node #11. Try simplifying control flow for better match
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -9,4 +9,10 @@
|
|||
#define PRELOAD_BANKS 2
|
||||
#define PRELOAD_SEQUENCE 1
|
||||
|
||||
void func_800BAAF8(uintptr_t, void*, size_t, OSMesgQueue*, OSIoMesg*);
|
||||
void func_800BAB58(uintptr_t*, u8**, ssize_t*, OSMesgQueue*, OSIoMesg*);
|
||||
void func_800BAC04();
|
||||
void func_800BB030(s32);
|
||||
s32 func_800BB304(struct AudioBankSample*);
|
||||
|
||||
#endif // AUDIO_LOAD_H
|
||||
|
|
|
|||
76
src/camera.c
76
src/camera.c
|
|
@ -3,6 +3,7 @@
|
|||
#include <common_structs.h>
|
||||
#include <defines.h>
|
||||
#include "camera.h"
|
||||
#include "math_util.h"
|
||||
|
||||
Camera cameras[4];
|
||||
Camera *camera1 = &cameras[0];
|
||||
|
|
@ -551,47 +552,46 @@ void func_8001D53C(Player *player, Camera *camera, f32 *arg2, f32 *arg3, f32 *ar
|
|||
GLOBAL_ASM("asm/non_matchings/camera/func_8001D53C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
void func_802B6540(f32 *, ?, f32, ?, s32); /* extern */
|
||||
void func_8001D794(Player *player, Camera *camera, Vec3f arg2, f32 *arg3, f32 *arg4, f32 *arg5, s16 arg6) {
|
||||
Mat3 sp6C;
|
||||
Vec3f sp60;
|
||||
Vec3f sp54;
|
||||
f32 stackPadding[4];
|
||||
f32 test1;
|
||||
f32 test2;
|
||||
f32 test3;
|
||||
|
||||
void func_8001D794(Player *player, Camera *camera, f32 *arg2, f32 *arg3, f32 *arg4, f32 *arg5, s16 arg6) {
|
||||
f32 sp6C;
|
||||
f32 sp68;
|
||||
f32 sp64;
|
||||
f32 sp60;
|
||||
f32 sp5C;
|
||||
f32 sp58;
|
||||
f32 sp54;
|
||||
f32 temp_f0;
|
||||
f32 temp_f12;
|
||||
f32 temp_f2;
|
||||
sp60[0] = camera->unk_30[0];
|
||||
sp60[1] = camera->unk_30[1];
|
||||
sp60[2] = camera->unk_30[2] - 6;
|
||||
|
||||
sp60 = camera->unk_30[0];
|
||||
sp64 = camera->unk_30[1];
|
||||
sp68 = camera->unk_30[2] - 6.0f;
|
||||
sp54 = camera->unk_3C[0];
|
||||
sp58 = camera->unk_3C[1];
|
||||
sp5C = camera->unk_3C[2];
|
||||
arg2->unk0 = camera->lookAt[0];
|
||||
arg2->unk4 = (f32) camera->lookAt[1];
|
||||
arg2->unk8 = (f32) camera->lookAt[2];
|
||||
func_802B6540(&sp6C, 0, 1.0f, 0, (s32) arg6);
|
||||
func_802B63B8(&sp54, &sp6C);
|
||||
arg2->unk0 += ((sp54 + player->pos[0]) - camera->lookAt[0]) * 1.0f;
|
||||
arg2->unk4 = (f32) (arg2->unk4 + (((sp58 + player->pos[1]) - camera->lookAt[1]) * 1.0f));
|
||||
arg2->unk8 = (f32) (arg2->unk8 + (((sp5C + player->pos[2]) - camera->lookAt[2]) * 1.0f));
|
||||
func_802B63B8(&sp60, &sp6C);
|
||||
temp_f0 = camera->pos[0];
|
||||
*arg3 = (((sp60 + player->pos[0]) - temp_f0) * 1.0f) + temp_f0;
|
||||
temp_f2 = camera->pos[1];
|
||||
*arg4 = (((sp64 + player->pos[1]) - temp_f2) * 1.0f) + temp_f2;
|
||||
temp_f12 = camera->pos[2];
|
||||
*arg5 = (((sp68 + player->pos[2]) - temp_f12) * 1.0f) + temp_f12;
|
||||
sp54[0] = camera->unk_3C[0];
|
||||
sp54[1] = camera->unk_3C[1];
|
||||
sp54[2] = camera->unk_3C[2];
|
||||
|
||||
arg2[0] = camera->lookAt[0];
|
||||
arg2[1] = camera->lookAt[1];
|
||||
arg2[2] = camera->lookAt[2];
|
||||
|
||||
func_802B6540(sp6C, 0, 1, 0, arg6);
|
||||
func_802B63B8(sp54, sp6C);
|
||||
|
||||
test1 = player->pos[0] + sp54[0];
|
||||
test3 = player->pos[2] + sp54[2];
|
||||
test2 = player->pos[1] + sp54[1];
|
||||
arg2[0] += (test1 - camera->lookAt[0]) * 1;
|
||||
arg2[1] += (test2 - camera->lookAt[1]) * 1;
|
||||
arg2[2] += (test3 - camera->lookAt[2]) * 1;
|
||||
|
||||
func_802B63B8(sp60, sp6C);
|
||||
|
||||
test1 = player->pos[0] + sp60[0];
|
||||
test3 = player->pos[2] + sp60[2];
|
||||
test2 = player->pos[1] + sp60[1];
|
||||
*arg3 = camera->pos[0] + ((test1 - camera->pos[0]) * 1);
|
||||
*arg4 = camera->pos[1] + ((test2 - camera->pos[1]) * 1);
|
||||
*arg5 = camera->pos[2] + ((test3 - camera->pos[2]) * 1);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/camera/func_8001D794.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 3b40ab93768f52ac241c5ae84ef58ef6bc4cb1de
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ typedef struct {
|
|||
|
||||
void func_8001CA10(Camera*);
|
||||
void func_8001CA24(Player*, f32);
|
||||
void func_8001D794(Player*, Camera*, Vec3f, f32*, f32*, f32*, s16);
|
||||
|
||||
extern Camera cameras[];
|
||||
extern Camera *camera1;
|
||||
|
|
|
|||
|
|
@ -991,12 +991,12 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
|||
sp40 = temp_f2;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(&sp8C, (f32 (*)[3]) &sp5C[0]);
|
||||
sp80 = player->boundingBoxCorners[0].cornerX;
|
||||
sp84 = player->boundingBoxCorners[0].cornerY;
|
||||
sp88 = player->boundingBoxCorners[0].cornerZ;
|
||||
player->boundingBoxCorners[0].cornerX = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[0].cornerY = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[0].cornerZ = sp94 + player->pos[2];
|
||||
sp80 = player->boundingBoxCorners[0].cornerPos[0];
|
||||
sp84 = player->boundingBoxCorners[0].cornerPos[1];
|
||||
sp88 = player->boundingBoxCorners[0].cornerPos[2];
|
||||
player->boundingBoxCorners[0].cornerPos[0] = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[0].cornerPos[1] = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[0].cornerPos[2] = sp94 + player->pos[2];
|
||||
func_802AFA34(player, player->boundingBoxCorners, sp80, sp84, sp88);
|
||||
temp_f14 = -sp48;
|
||||
temp_f2_2 = (f64) temp_f14;
|
||||
|
|
@ -1006,12 +1006,12 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
|||
sp94 = sp40;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(&sp8C, (f32 (*)[3]) &sp5C[0]);
|
||||
sp80 = player->boundingBoxCorners[1].cornerX;
|
||||
sp84 = player->boundingBoxCorners[1].cornerY;
|
||||
sp88 = player->boundingBoxCorners[1].cornerZ;
|
||||
player->boundingBoxCorners[1].cornerX = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[1].cornerY = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[1].cornerZ = sp94 + player->pos[2];
|
||||
sp80 = player->boundingBoxCorners[1].cornerPos[0];
|
||||
sp84 = player->boundingBoxCorners[1].cornerPos[1];
|
||||
sp88 = player->boundingBoxCorners[1].cornerPos[2];
|
||||
player->boundingBoxCorners[1].cornerPos[0] = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[1].cornerPos[1] = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[1].cornerPos[2] = sp94 + player->pos[2];
|
||||
func_802AFA34(player, &player->boundingBoxCorners[1], sp80, sp84, sp88);
|
||||
temp_f12 = sp34 + 4.0f;
|
||||
sp8C = (f32) (sp38 - 2.6);
|
||||
|
|
@ -1019,23 +1019,23 @@ void func_80029B4C(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
|||
sp40 = temp_f12;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(&sp8C, (f32 (*)[3]) &sp5C[0]);
|
||||
sp80 = player->boundingBoxCorners[2].cornerX;
|
||||
sp84 = player->boundingBoxCorners[2].cornerY;
|
||||
sp88 = player->boundingBoxCorners[2].cornerZ;
|
||||
player->boundingBoxCorners[2].cornerX = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[2].cornerY = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[2].cornerZ = sp94 + player->pos[2];
|
||||
sp80 = player->boundingBoxCorners[2].cornerPos[0];
|
||||
sp84 = player->boundingBoxCorners[2].cornerPos[1];
|
||||
sp88 = player->boundingBoxCorners[2].cornerPos[2];
|
||||
player->boundingBoxCorners[2].cornerPos[0] = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[2].cornerPos[1] = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[2].cornerPos[2] = sp94 + player->pos[2];
|
||||
func_802AFA34(player, &player->boundingBoxCorners[2], sp80, sp84, sp88);
|
||||
sp8C = (f32) (sp28 + 2.6);
|
||||
sp94 = sp40;
|
||||
sp90 = -player->boundingBoxSize;
|
||||
func_802B63B8(&sp8C, (f32 (*)[3]) &sp5C[0]);
|
||||
sp80 = player->boundingBoxCorners[3].cornerX;
|
||||
sp84 = player->boundingBoxCorners[3].cornerY;
|
||||
sp88 = player->boundingBoxCorners[3].cornerZ;
|
||||
player->boundingBoxCorners[3].cornerX = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[3].cornerY = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[3].cornerZ = sp94 + player->pos[2];
|
||||
sp80 = player->boundingBoxCorners[3].cornerPos[0];
|
||||
sp84 = player->boundingBoxCorners[3].cornerPos[1];
|
||||
sp88 = player->boundingBoxCorners[3].cornerPos[2];
|
||||
player->boundingBoxCorners[3].cornerPos[0] = sp8C + player->pos[0];
|
||||
player->boundingBoxCorners[3].cornerPos[1] = sp90 + player->pos[1];
|
||||
player->boundingBoxCorners[3].cornerPos[2] = sp94 + player->pos[2];
|
||||
func_802AFA34(player, &player->boundingBoxCorners[3], sp80, sp84, sp88);
|
||||
if (!(player->unk_0BC & 8)) {
|
||||
move_f32_towards(&player->unk_230, (player->boundingBoxCorners[0].cornerGroundY + player->boundingBoxCorners[2].cornerGroundY) / 2.0f, 0.5f);
|
||||
|
|
@ -1124,27 +1124,27 @@ void func_8002A194(Player *player, f32 arg1, f32 arg2, f32 arg3) {
|
|||
temp_t7 = (temp_v1 + 0x2000) & 0xFFFF;
|
||||
sp28 = temp_t7;
|
||||
sp3A = temp_v1;
|
||||
player->boundingBoxCorners[0].cornerZ = (coss((u16) temp_t7) * var_f20) + arg3;
|
||||
player->boundingBoxCorners[0].cornerPos[2] = (coss((u16) temp_t7) * var_f20) + arg3;
|
||||
temp_f12 = (sins((u16) sp28) * var_f20) + arg1;
|
||||
player->boundingBoxCorners[0].cornerX = temp_f12;
|
||||
player->boundingBoxCorners[0].cornerGroundY = func_802ABE30(temp_f12, arg2, player->boundingBoxCorners[0].cornerZ, player->unk_110.unk3A);
|
||||
player->boundingBoxCorners[0].cornerPos[0] = temp_f12;
|
||||
player->boundingBoxCorners[0].cornerGroundY = func_802ABE30(temp_f12, arg2, player->boundingBoxCorners[0].cornerPos[2], player->unk_110.unk3A);
|
||||
temp_t8 = (sp3A - 0x2000) & 0xFFFF;
|
||||
sp28 = temp_t8;
|
||||
player->boundingBoxCorners[1].cornerZ = (coss((u16) temp_t8) * var_f20) + arg3;
|
||||
player->boundingBoxCorners[1].cornerPos[2] = (coss((u16) temp_t8) * var_f20) + arg3;
|
||||
temp_f12_2 = (sins((u16) sp28) * var_f20) + arg1;
|
||||
player->boundingBoxCorners[1].cornerX = temp_f12_2;
|
||||
player->boundingBoxCorners[1].cornerGroundY = func_802ABE30(temp_f12_2, arg2, player->boundingBoxCorners[1].cornerZ, player->unk_110.unk3A);
|
||||
player->boundingBoxCorners[1].cornerPos[0] = temp_f12_2;
|
||||
player->boundingBoxCorners[1].cornerGroundY = func_802ABE30(temp_f12_2, arg2, player->boundingBoxCorners[1].cornerPos[2], player->unk_110.unk3A);
|
||||
temp_t9 = (sp3A + 0x6000) & 0xFFFF;
|
||||
sp28 = temp_t9;
|
||||
player->boundingBoxCorners[2].cornerZ = (coss((u16) temp_t9) * var_f20) + arg3;
|
||||
player->boundingBoxCorners[2].cornerPos[2] = (coss((u16) temp_t9) * var_f20) + arg3;
|
||||
temp_f12_3 = (sins((u16) sp28) * var_f20) + arg1;
|
||||
player->boundingBoxCorners[2].cornerX = temp_f12_3;
|
||||
player->boundingBoxCorners[2].cornerGroundY = func_802ABE30(temp_f12_3, arg2, player->boundingBoxCorners[2].cornerZ, player->unk_110.unk3A);
|
||||
player->boundingBoxCorners[2].cornerPos[0] = temp_f12_3;
|
||||
player->boundingBoxCorners[2].cornerGroundY = func_802ABE30(temp_f12_3, arg2, player->boundingBoxCorners[2].cornerPos[2], player->unk_110.unk3A);
|
||||
temp_t0 = (sp3A - 0x6000) & 0xFFFF;
|
||||
sp28 = temp_t0;
|
||||
player->boundingBoxCorners[3].cornerZ = (coss((u16) temp_t0) * var_f20) + arg3;
|
||||
player->boundingBoxCorners[3].cornerX = (sins((u16) sp28) * var_f20) + arg1;
|
||||
player->boundingBoxCorners[3].cornerGroundY = func_802ABE30(player->boundingBoxCorners[2].cornerX, arg2, player->boundingBoxCorners[2].cornerZ, player->unk_110.unk3A);
|
||||
player->boundingBoxCorners[3].cornerPos[2] = (coss((u16) temp_t0) * var_f20) + arg3;
|
||||
player->boundingBoxCorners[3].cornerPos[0] = (sins((u16) sp28) * var_f20) + arg1;
|
||||
player->boundingBoxCorners[3].cornerGroundY = func_802ABE30(player->boundingBoxCorners[2].cornerPos[0], arg2, player->boundingBoxCorners[2].cornerPos[2], player->unk_110.unk3A);
|
||||
if ((player->unk_0BC & 8) != 8) {
|
||||
temp_f0 = player->boundingBoxCorners[0].cornerGroundY;
|
||||
temp_f2 = player->boundingBoxCorners[2].cornerGroundY;
|
||||
|
|
@ -1958,59 +1958,37 @@ void func_8002BB9C(Player *player, f32 *arg1, f32 *arg2, f32 *arg3) {
|
|||
GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002BB9C.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
extern ? D_800E3CAC;
|
||||
extern ? D_800E3CC8;
|
||||
#ifdef NEEDS_RODATA
|
||||
// data_0DD0A0_2.s
|
||||
// extern s32 D_800E3CAC;
|
||||
// extern s32 D_800E3CC8;
|
||||
|
||||
void func_8002BD58(void *arg0) {
|
||||
? sp2C;
|
||||
? spC;
|
||||
void func_8002BD58(Player *player) {
|
||||
s32 sp2C[7] = { 0x002f0000, 0x00300000, 0x00310000, 0x00320000, 0x00320000, 0x00320000, 0x00320000 };
|
||||
s32 spC[8] = { 0x00280000, 0x002c0000, 0x00300000, 0x00320000, 0x00320000, 0x00320000, 0x00320000, 0x00320000 };
|
||||
s16 temp_t5;
|
||||
s16 temp_v0;
|
||||
s32 phi_v0;
|
||||
|
||||
sp2C.unk0 = D_800E3CAC.unk0;
|
||||
sp2C.unk4 = D_800E3CAC.unk4;
|
||||
sp2C.unk8 = D_800E3CAC.unk8;
|
||||
sp2C.unkC = D_800E3CAC.unkC;
|
||||
sp2C.unk10 = D_800E3CAC.unk10;
|
||||
sp2C.unk14 = D_800E3CAC.unk14;
|
||||
sp2C.unk18 = D_800E3CAC.unk18;
|
||||
spC.unk0 = D_800E3CC8.unk0;
|
||||
spC.unk4 = D_800E3CC8.unk4;
|
||||
spC.unk8 = D_800E3CC8.unk8;
|
||||
spC.unkC = D_800E3CC8.unkC;
|
||||
spC.unk10 = D_800E3CC8.unk10;
|
||||
spC.unk14 = D_800E3CC8.unk14;
|
||||
spC.unk18 = D_800E3CC8.unk18;
|
||||
spC.unk1C = D_800E3CC8.unk1C;
|
||||
temp_v0 = arg0->unk234;
|
||||
if (temp_v0 >= 0) {
|
||||
if ((temp_v0 >= 5) && (temp_v0 < 0x1E)) {
|
||||
arg0->unk7C = *(&sp2C + ((temp_v0 / 6) * 4));
|
||||
if (player->unk_234 >= 0) {
|
||||
if ((player->unk_234 >= 5) && (player->unk_234 < 0x1E)) {
|
||||
player->unk_07C = sp2C[player->unk_234 / 6];
|
||||
}
|
||||
if ((temp_v0 >= 0x1E) && (temp_v0 < 0x50)) {
|
||||
arg0->unk7C = *(&spC + (((temp_v0 - 0x1E) / 0xC) * 4));
|
||||
if ((player->unk_234 >= 0x1E) && (player->unk_234 < 0x50)) {
|
||||
player->unk_07C = spC[(s32) (player->unk_234 - 0x1E) / 12];
|
||||
}
|
||||
if (((temp_v0 < 0x50) || (temp_v0 >= 0x5B)) && (temp_v0 >= 0x5B) && (temp_v0 < 0xA1)) {
|
||||
arg0->unk7C = sp10;
|
||||
return;
|
||||
if (((player->unk_234 < 0x50) || (player->unk_234 >= 0x5B)) && (player->unk_234 >= 0x5B) && (player->unk_234 < 0xA1)) {
|
||||
player->unk_07C = spC[1];
|
||||
}
|
||||
} else {
|
||||
temp_t5 = -player->unk_234;
|
||||
if ((player->unk_234 < -4) && (player->unk_234 >= -0x1E)) {
|
||||
player->unk_07C = sp2C[temp_t5 / 6] * -1;
|
||||
}
|
||||
if ((player->unk_234 < -0x1E) && (player->unk_234 >= -0x50)) {
|
||||
player->unk_07C = spC[(s32) (temp_t5 - 0x1E) / 12] * -1;
|
||||
}
|
||||
if (((player->unk_234 >= -0x50) || (player->unk_234 < -0x5A)) && (player->unk_234 < -0x5A) && (player->unk_234 >= -0xA0)) {
|
||||
player->unk_07C = spC[1] * -1;
|
||||
}
|
||||
// Duplicate return node #23. Try simplifying control flow for better match
|
||||
return;
|
||||
}
|
||||
temp_t5 = temp_v0 * -1;
|
||||
if ((temp_v0 < -4) && (temp_v0 >= -0x1E)) {
|
||||
arg0->unk7C = *(&sp2C + ((temp_t5 / 6) * 4)) * -1;
|
||||
}
|
||||
phi_v0 = arg0->unk234;
|
||||
if ((arg0->unk234 < -0x1E) && (arg0->unk234 >= -0x50)) {
|
||||
arg0->unk7C = *(&spC + (((temp_t5 - 0x1E) / 0xC) * 4)) * -1;
|
||||
phi_v0 = arg0->unk234;
|
||||
}
|
||||
if (((phi_v0 >= -0x50) || (phi_v0 < -0x5A)) && (phi_v0 < -0x5A) && (phi_v0 >= -0xA0)) {
|
||||
arg0->unk7C = sp10 * -1;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -6789,13 +6767,12 @@ void func_80038BE4(Player *player, s16 arg1) {
|
|||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
void func_80029B4C(Player *, f32, f32, f32); /* extern */
|
||||
void func_8002AE38(Player *, s8, f32, f32, f32, f32); /* extern */
|
||||
void func_8002C4F8(Player *, s8); /* extern */
|
||||
void func_8002C954(Player *, s8, f32 *); /* extern */
|
||||
void func_8002CD48(Player *, s8, s8); /* extern */
|
||||
void func_802B6540(f32 *, f32, f32, f32, s32); /* extern */
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
? func_80029B4C(Player *, f32, f32, f32); /* extern */
|
||||
? func_8002AE38(Player *, s8, f32, f32, f32, f32); /* extern */
|
||||
? func_8002C4F8(Player *, s8); /* extern */
|
||||
? func_8002C954(Player *, s8, f32 *); /* extern */
|
||||
? func_8002CD48(Player *, s8, s8); /* extern */
|
||||
static ? D_800E4328; /* unable to generate initializer */
|
||||
static ? D_800E4334; /* unable to generate initializer */
|
||||
static ? D_800E4340; /* unable to generate initializer */
|
||||
|
|
@ -6916,7 +6893,7 @@ void func_80038C6C(Player *player, Camera *camera, s8 arg2, s8 arg3) {
|
|||
player->unk_058 = 0.0f;
|
||||
player->unk_060 = 0.0f;
|
||||
player->unk_05C = 1.0f;
|
||||
func_802B6540(sp50, 0.0f, 1.0f, 0.0f, (s32) player->unk_02E);
|
||||
func_802B6540((f32 (*)[3]) sp50, 0.0f, 1.0f, 0.0f, (s16) (s32) player->unk_02E);
|
||||
player->unk_0BC |= 8;
|
||||
player->unk_0C2 += 1;
|
||||
sp98 = player->unk_110.unk3C[2];
|
||||
|
|
@ -6931,19 +6908,19 @@ void func_80038C6C(Player *player, Camera *camera, s8 arg2, s8 arg3) {
|
|||
if (sp98 <= 0.0f) {
|
||||
func_8003F46C(player, &sp7C, &sp88, &sp108, &sp98, &spEC, &spE8, &spE4);
|
||||
}
|
||||
sp98 = player->unk_110.unk3C;
|
||||
sp98 = player->unk_110.unk3C[0];
|
||||
if (sp98 < 0.0f) {
|
||||
func_8003F734(player, &sp7C, &sp88, &sp98, &spEC, &spE8, &spE4);
|
||||
func_8002C954(player, arg3, &sp88);
|
||||
}
|
||||
sp98 = player->unk_110.unk40;
|
||||
sp98 = player->unk_110.unk3C[1];
|
||||
if (sp98 < 0.0f) {
|
||||
func_8003FBAC(player, &sp7C, &sp88, &sp98, &spEC, &spE8, &spE4);
|
||||
func_8002C954(player, arg3, &sp88);
|
||||
}
|
||||
sp98 = player->unk_110.unk3C;
|
||||
sp98 = player->unk_110.unk3C[0];
|
||||
if (sp98 >= 0.0f) {
|
||||
sp98 = player->unk_110.unk40;
|
||||
sp98 = player->unk_110.unk3C[1];
|
||||
if (sp98 >= 0.0f) {
|
||||
player->unk_046 &= 0xFFDF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3162,9 +3162,9 @@ void func_8005D898(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
s32 temp_lo;
|
||||
|
||||
if (player->unk_0C0 >= 0) {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], player->boundingBoxCorners[2].cornerX, player->boundingBoxCorners[2].cornerGroundY + 2.0f, player->boundingBoxCorners[2].cornerZ, player->boundingBoxCorners[2].surfaceType, 1);
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], player->boundingBoxCorners[2].cornerPos[0], player->boundingBoxCorners[2].cornerGroundY + 2.0f, player->boundingBoxCorners[2].cornerPos[2], player->boundingBoxCorners[2].surfaceType, 1);
|
||||
} else {
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], player->boundingBoxCorners[3].cornerX, player->boundingBoxCorners[3].cornerGroundY + 2.0f, player->boundingBoxCorners[3].cornerZ, player->boundingBoxCorners[3].surfaceType, 0);
|
||||
func_8005D794(player, &player->unk_258[10 + arg1], player->boundingBoxCorners[3].cornerPos[0], player->boundingBoxCorners[3].cornerGroundY + 2.0f, player->boundingBoxCorners[3].cornerPos[2], player->boundingBoxCorners[3].surfaceType, 0);
|
||||
}
|
||||
|
||||
temp_lo = player->unk_0C0 / 182;
|
||||
|
|
@ -3315,8 +3315,8 @@ void func_8005DAF4(Player *player, s32 arg1, s8 arg2, s32 arg3) {
|
|||
if ((temp_v0 == 0) || (temp_v0 == 4)) {
|
||||
sp44 = 1;
|
||||
sp3C = player->boundingBoxCorners[2].cornerGroundY + 2.0f;
|
||||
sp40 = player->boundingBoxCorners[2].cornerX;
|
||||
sp38 = player->boundingBoxCorners[2].cornerZ;
|
||||
sp40 = player->boundingBoxCorners[2].cornerPos[0];
|
||||
sp38 = player->boundingBoxCorners[2].cornerPos[2];
|
||||
phi_t1 = (s32) player->boundingBoxCorners[2].surfaceType;
|
||||
}
|
||||
phi_f12 = sp3C;
|
||||
|
|
@ -3326,8 +3326,8 @@ void func_8005DAF4(Player *player, s32 arg1, s8 arg2, s32 arg3) {
|
|||
if ((temp_v0 == 2) || (temp_v0 == 6)) {
|
||||
phi_t1 = (s32) player->boundingBoxCorners[3].surfaceType;
|
||||
phi_f12 = player->boundingBoxCorners[3].cornerGroundY + 2.0f;
|
||||
phi_f14 = player->boundingBoxCorners[3].cornerZ;
|
||||
phi_f2 = player->boundingBoxCorners[3].cornerX;
|
||||
phi_f14 = player->boundingBoxCorners[3].cornerPos[2];
|
||||
phi_f2 = player->boundingBoxCorners[3].cornerPos[0];
|
||||
phi_t3 = 0;
|
||||
}
|
||||
switch (phi_t1) {
|
||||
|
|
@ -3624,9 +3624,9 @@ void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3) {
|
|||
temp_f0 = player->boundingBoxCorners[2].cornerGroundY;
|
||||
if ((f64) (D_801652A0[arg3] - temp_f0) >= 3.5) {
|
||||
sp44 = 1;
|
||||
sp40 = player->boundingBoxCorners[2].cornerX;
|
||||
sp40 = player->boundingBoxCorners[2].cornerPos[0];
|
||||
sp3C = temp_f0 + 2.0f;
|
||||
sp38 = player->boundingBoxCorners[2].cornerZ;
|
||||
sp38 = player->boundingBoxCorners[2].cornerPos[2];
|
||||
phi_t0 = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -3639,8 +3639,8 @@ void func_8005EA94(Player *player, s16 arg1, s32 arg2, s8 arg3) {
|
|||
if ((f64) (D_801652A0[arg3] - temp_f0_2) >= 3.5) {
|
||||
phi_t0 = 0;
|
||||
phi_f12 = temp_f0_2 + 2.0f;
|
||||
phi_f14 = player->boundingBoxCorners[3].cornerZ;
|
||||
phi_f2 = player->boundingBoxCorners[3].cornerX;
|
||||
phi_f14 = player->boundingBoxCorners[3].cornerPos[2];
|
||||
phi_f2 = player->boundingBoxCorners[3].cornerPos[0];
|
||||
phi_t1 = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -3752,8 +3752,8 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) {
|
|||
if ((temp_v0 == 2) || (temp_v0 == 4)) {
|
||||
sp44 = 1;
|
||||
sp3C = player->boundingBoxCorners[2].cornerGroundY + 2.0f;
|
||||
sp40 = player->boundingBoxCorners[2].cornerX;
|
||||
sp38 = player->boundingBoxCorners[2].cornerZ;
|
||||
sp40 = player->boundingBoxCorners[2].cornerPos[0];
|
||||
sp38 = player->boundingBoxCorners[2].cornerPos[2];
|
||||
phi_t2 = (s32) player->boundingBoxCorners[2].surfaceType;
|
||||
}
|
||||
phi_f12 = sp38;
|
||||
|
|
@ -3762,8 +3762,8 @@ void func_8005ED48(Player *player, s16 arg1, s32 arg2, s32 arg3) {
|
|||
phi_t3 = sp44;
|
||||
if ((temp_v0 == 0) || (temp_v0 == 6)) {
|
||||
phi_t2 = (s32) player->boundingBoxCorners[3].surfaceType;
|
||||
phi_f12 = player->boundingBoxCorners[3].cornerZ;
|
||||
phi_f0 = player->boundingBoxCorners[3].cornerX;
|
||||
phi_f12 = player->boundingBoxCorners[3].cornerPos[2];
|
||||
phi_f0 = player->boundingBoxCorners[3].cornerPos[0];
|
||||
phi_f2 = player->boundingBoxCorners[3].cornerGroundY + 2.0f;
|
||||
phi_t3 = 0;
|
||||
}
|
||||
|
|
@ -5577,11 +5577,11 @@ void func_80063268(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
|
||||
void func_80063408(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + (player->unk_258[10 + arg1].unk_01E * -7) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + (player->unk_258[10 + arg1].unk_01E * -7) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
|
||||
++player->unk_258[10 + arg1].unk_01E;
|
||||
|
|
@ -5616,19 +5616,19 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
if ((player->unk_0BC * 2) < 0) {
|
||||
func_80062B18(&sp44, &sp40, &sp3C, -2.0f, 0.0f, (-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16, -player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + sp3C;
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + sp3C;
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
} else if ((player->unk_0BC * 2) < 0) {
|
||||
func_80062B18(&sp44, &sp40, &sp3C, 2.0f, 0.0f, (-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16, - player->unk_258[10 + arg1].unk_020, 2 * -player->unk_206);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + sp3C;
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + sp44;
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + sp3C;
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 16) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
|
||||
++player->unk_258[10 + arg1].unk_01E;
|
||||
|
|
@ -5664,11 +5664,11 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
|
||||
void func_800639DC(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + (D_800EE680 * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + (D_800EE684 * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + (D_800EE680 * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + (D_800EE684 * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + (D_800EE688 * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + (D_800EE68C * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + (D_800EE688 * player->unk_258[10 + arg1].unk_01E) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + (D_800EE68C * player->unk_258[10 + arg1].unk_01E) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
++player->unk_258[10 + arg1].unk_01E;
|
||||
player->unk_258[10 + arg1].unk_000[1] += D_800EE690;
|
||||
|
|
@ -5699,11 +5699,11 @@ void func_800639DC(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
|
||||
void func_80063BD4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020));
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + (-2 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020));
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + (-2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020));
|
||||
}
|
||||
|
||||
++player->unk_258[10 + arg1].unk_01E;
|
||||
|
|
@ -5720,11 +5720,11 @@ void func_80063BD4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
|||
|
||||
void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) {
|
||||
if (player->unk_258[10 + arg1].unk_010 == 1) {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerZ + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerX + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[2].cornerPos[0] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
} else {
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerZ + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerX + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[3].cornerPos[2] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * coss(player->unk_258[10 + arg1].unk_020);
|
||||
player->unk_258[10 + arg1].unk_000[0] = player->boundingBoxCorners[3].cornerPos[0] + ((-player->unk_258[10 + arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 20.0f) * sins(player->unk_258[10 + arg1].unk_020);
|
||||
}
|
||||
|
||||
++player->unk_258[10 + arg1].unk_01E;
|
||||
|
|
|
|||
|
|
@ -1523,9 +1523,9 @@ void func_80070780(void) {
|
|||
temp_s0_4 = D_80183EA0->unk0;
|
||||
func_80073444(temp_s0_4, &D_06007BB8, &D_06007DB8, 0x20U, (u16) 0x00000040);
|
||||
temp_v0_5 = &D_80165C18[temp_s0_4];
|
||||
temp_v0_5->unk_0B2 = 0;
|
||||
temp_v0_5->unk_0B4 = 0;
|
||||
temp_v0_5->unk_0B6 = 0x8000;
|
||||
temp_v0_5->unk_0B2[0] = 0;
|
||||
temp_v0_5->unk_0B2[1] = 0;
|
||||
temp_v0_5->unk_0B2[2] = 0x8000;
|
||||
func_800723A4(D_80183EA0->unk4, 0);
|
||||
func_800723A4(D_80183EA0->unk8, 0);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -336,24 +336,15 @@ void func_8008C8C4(Player* player, s8 arg1) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
extern s16 D_8018D920;
|
||||
static ? D_800E6F60; /* unable to generate initializer */
|
||||
#ifdef NEEDS_RODATA
|
||||
// data_0DD0A0_2_0.s
|
||||
extern s16 D_800E6F60[];// = { 1092, 1092, 2184, 1638, 1820 }
|
||||
|
||||
void func_8008C9EC(Player *player, s8 arg1) {
|
||||
s16 *temp_a0;
|
||||
s16 *temp_a0_2;
|
||||
s16 *temp_v0;
|
||||
s16 *temp_v0_2;
|
||||
s16 temp_t7;
|
||||
s16 temp_t8;
|
||||
s16 temp_v1;
|
||||
s16 temp_v1_2;
|
||||
s16 stackPadding1;
|
||||
s16 stackPadding2;
|
||||
s16 sp30[5] = { 1092, 1092, 2184, 1638, 1820 };
|
||||
|
||||
sp30[0].unk0 = (s32) D_800E6F60.unk0;
|
||||
sp30[0].unk4 = (s32) D_800E6F60.unk4;
|
||||
sp30[0].unk8 = (u16) D_800E6F60.unk8;
|
||||
player->unk_206 = 0;
|
||||
player->unk_0C4 = 0;
|
||||
if ((player->unk_046 & 0x40) == 0x40) {
|
||||
|
|
@ -369,14 +360,11 @@ void func_8008C9EC(Player *player, s8 arg1) {
|
|||
}
|
||||
}
|
||||
if ((player->unk_0BC & 0x80) == 0x80) {
|
||||
temp_a0 = &(&sp30[0])[player->unk_0B2];
|
||||
player->unk_02E -= *temp_a0;
|
||||
temp_v0 = (arg1 * 2) + &D_8018D920;
|
||||
temp_t7 = *temp_v0 - *temp_a0;
|
||||
*temp_v0 = temp_t7;
|
||||
temp_v1 = player->unk_0B2;
|
||||
if ((s16) ((s32) (temp_t7 & 0xFFFF) / (s32) (0x10000 / (s32) (0x168 / (s32) ((s16) (&sp30[0])[temp_v1] / 182)))) == 0) {
|
||||
player->unk_0B2 = temp_v1 - 1;
|
||||
player->unk_02C[1] -= sp30[player->unk_0B2];
|
||||
D_8018D920[arg1] -= sp30[player->unk_0B2];
|
||||
stackPadding1 = (u16)D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182)));
|
||||
if (stackPadding1 == 0) {
|
||||
player->unk_0B2--;
|
||||
if (player->unk_0B2 <= 0) {
|
||||
if (gModeSelection == BATTLE) {
|
||||
func_8006B8B4(player, arg1);
|
||||
|
|
@ -385,14 +373,11 @@ void func_8008C9EC(Player *player, s8 arg1) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
temp_a0_2 = &(&sp30[0])[player->unk_0B2];
|
||||
player->unk_02E += *temp_a0_2;
|
||||
temp_v0_2 = (arg1 * 2) + &D_8018D920;
|
||||
temp_t8 = *temp_v0_2 - *temp_a0_2;
|
||||
*temp_v0_2 = temp_t8;
|
||||
temp_v1_2 = player->unk_0B2;
|
||||
if ((s16) ((s32) (temp_t8 & 0xFFFF) / (s32) (0x10000 / (s32) (0x168 / (s32) ((s16) (sp + (temp_v1_2 * 2))->unk30 / 182)))) == 0) {
|
||||
player->unk_0B2 = temp_v1_2 - 1;
|
||||
player->unk_02C[1] += sp30[player->unk_0B2];
|
||||
D_8018D920[arg1] -= sp30[player->unk_0B2];
|
||||
stackPadding2 = (u16)D_8018D920[arg1] / (0x10000 / (0x168 / (sp30[player->unk_0B2] / 182)));
|
||||
if (stackPadding2 == 0) {
|
||||
player->unk_0B2--;
|
||||
if (player->unk_0B2 <= 0) {
|
||||
func_8008C8C4(player, arg1);
|
||||
if (gModeSelection == BATTLE) {
|
||||
|
|
@ -430,7 +415,7 @@ void func_8008CDC0(Player* player, s8 arg1) {
|
|||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
void func_8008CEB0(Player *player, s8 arg1) {
|
||||
f32 sp2C;
|
||||
s16 sp2A;
|
||||
|
|
@ -445,7 +430,7 @@ void func_8008CEB0(Player *player, s8 arg1) {
|
|||
s32 temp_v0;
|
||||
s32 temp_v0_2;
|
||||
|
||||
var_v1 = player->unk_0B4 + 1;
|
||||
var_v1 = (s16) player->unk_0B4 + 1;
|
||||
var_f0 = player->unk_0B8;
|
||||
var_a3 = player->unk_0AC;
|
||||
temp_f16 = (s32) ((f64) ((f32) var_v1 * var_f0) - (0.2 * (f64) (var_v1 * var_v1)));
|
||||
|
|
@ -493,7 +478,7 @@ block_9:
|
|||
}
|
||||
player->unk_078 += var_a2 * 0x12;
|
||||
player->unk_0B8 = var_f0;
|
||||
player->unk_0B4 = var_v1;
|
||||
player->unk_0B4 = (u16) var_v1;
|
||||
player->unk_0AC = var_a3;
|
||||
if (player->unk_0BC & 8) {
|
||||
func_8008C73C(player, arg1);
|
||||
|
|
@ -946,77 +931,59 @@ void func_8008DF98(Player* player, s8 arg1) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
extern s16 D_8018D920;
|
||||
#ifdef NEEDS_RODATA
|
||||
// data_0DD0A0_3_0.s
|
||||
extern f64 D_800EF590;// = 0.6;
|
||||
extern f64 D_800EF598;// = 0.9;
|
||||
|
||||
void func_8008E118(Player *player, s8 arg1) {
|
||||
s16 *temp_v0_2;
|
||||
s16 *temp_v0_3;
|
||||
s16 *temp_v0_4;
|
||||
s16 temp_t0;
|
||||
s32 temp_v0;
|
||||
s8 temp_t1;
|
||||
s8 var_a2;
|
||||
|
||||
temp_v0 = player->unk_0BC;
|
||||
var_a2 = arg1;
|
||||
if (((temp_v0 & 0x8000) == 0x8000) && ((temp_v0 & 0x04000000) != 0x04000000)) {
|
||||
player->unk_0BC = temp_v0 & 0xFFFDFFFF;
|
||||
s16 test;
|
||||
if (((player->unk_0BC & 0x8000) == 0x8000) && ((player->unk_0BC & 0x04000000) != 0x04000000)) {
|
||||
player->unk_0BC &= ~0x20000;
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_07C = 0;
|
||||
player->unk_0C0 = 0;
|
||||
temp_t1 = arg1;
|
||||
player->unk_02E = player->unk_0AE;
|
||||
arg1 = arg1;
|
||||
func_8008E3C0(player, temp_t1);
|
||||
temp_v0_2 = &(*D_80165190)[arg1];
|
||||
temp_v0_2->unk0 = 1;
|
||||
temp_v0_2->unk10 = 1;
|
||||
temp_v0_2->unk20 = 1;
|
||||
temp_v0_2->unk30 = 1;
|
||||
player->unk_02C[1] = player->unk_0AE;
|
||||
func_8008E3C0(player, arg1);
|
||||
D_80165190[0][arg1] = 1;
|
||||
D_80165190[1][arg1] = 1;
|
||||
D_80165190[2][arg1] = 1;
|
||||
D_80165190[3][arg1] = 1;
|
||||
func_8008DABC(player, arg1);
|
||||
return;
|
||||
}
|
||||
if ((temp_v0 & 0x20000) == 0x20000) {
|
||||
player->unk_02E -= 0x5B0;
|
||||
temp_v0_3 = (var_a2 * 2) + &D_8018D920;
|
||||
temp_t0 = *temp_v0_3 - 0x5B0;
|
||||
*temp_v0_3 = temp_t0;
|
||||
if ((s16) ((s32) (temp_t0 & 0xFFFF) / 1456) == 0) {
|
||||
player->unk_0B2 -= 1;
|
||||
} else if ((player->unk_0BC & 0x20000) == 0x20000) {
|
||||
player->unk_02C[1] -= 0x5B0;
|
||||
D_8018D920[arg1] -= 0x5B0;
|
||||
test = (u16)D_8018D920[arg1] / 1456;
|
||||
if (test == 0) {
|
||||
player->unk_0B2--;
|
||||
if (player->unk_0B2 <= 0) {
|
||||
player->unk_0A8 = 0;
|
||||
player->unk_0BC &= 0xFFFDFFFF;
|
||||
player->unk_0BC &= ~0x20000;
|
||||
player->unk_07C = 0;
|
||||
player->unk_0C0 = 0;
|
||||
temp_v0_4 = &(*D_80165190)[var_a2];
|
||||
player->unk_02E = player->unk_0AE;
|
||||
temp_v0_4->unk0 = 1;
|
||||
temp_v0_4->unk10 = 1;
|
||||
temp_v0_4->unk20 = 1;
|
||||
temp_v0_4->unk30 = 1;
|
||||
player->unk_02C[1] = player->unk_0AE;
|
||||
D_80165190[0][arg1] = 1;
|
||||
D_80165190[1][arg1] = 1;
|
||||
D_80165190[2][arg1] = 1;
|
||||
D_80165190[3][arg1] = 1;
|
||||
}
|
||||
}
|
||||
func_80031F48(player, 1.0f);
|
||||
return;
|
||||
}
|
||||
player->unk_0B0 += 1;
|
||||
player->unk_08C = (f32) ((f64) player->unk_08C * 0.6);
|
||||
if ((player->unk_0B0 == 1) && (player->unk_000 & 0x4000)) {
|
||||
arg1 = var_a2;
|
||||
func_800C90F4(var_a2 & 0xFF, (player->characterId * 0x10) + 0x29008005);
|
||||
var_a2 = arg1;
|
||||
}
|
||||
if ((player->unk_0B0 >= 0) && (player->unk_0B0 < 0x1CC)) {
|
||||
move_f32_towards(&player->unk_224, 0.7f, 0.1f);
|
||||
move_f32_towards(&player->boundingBoxSize, (f32) ((f64) gKartBoundingBoxSizeTable[player->characterId] * 0.9), 0.1f);
|
||||
return;
|
||||
}
|
||||
arg1 = var_a2;
|
||||
func_8008E3C0(player, var_a2);
|
||||
if (player->unk_000 & 0x4000) {
|
||||
func_800C90F4(arg1 & 0xFF, (player->characterId * 0x10) + 0x29008008);
|
||||
} else {
|
||||
player->unk_0B0 += 1;
|
||||
player->unk_08C = (f32) ((f64) player->unk_08C * 0.6);
|
||||
if ((player->unk_0B0 == 1) && (player->unk_000 & 0x4000)) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008005);
|
||||
}
|
||||
if ((player->unk_0B0 >= 0) && (player->unk_0B0 < 0x1CC)) {
|
||||
move_f32_towards(&player->unk_224, 0.7f, 0.1f);
|
||||
move_f32_towards(&player->boundingBoxSize, (f32) ((f64) gKartBoundingBoxSizeTable[player->characterId] * 0.9), 0.1f);
|
||||
} else {
|
||||
func_8008E3C0(player, arg1);
|
||||
if (player->unk_000 & 0x4000) {
|
||||
func_800C90F4(arg1, (player->characterId * 0x10) + 0x29008008);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -1697,84 +1664,67 @@ void func_8008FEDC(Player* player, UNUSED s8 arg1) {
|
|||
}
|
||||
|
||||
#ifdef NEEDS_RODATA
|
||||
void func_8008FF08(Player *player, s8 arg1) {
|
||||
s8 arg1Copy;
|
||||
arg1Copy = arg1;
|
||||
// data_0DD0A0_3_0.s
|
||||
// jpt_800EF5B0
|
||||
|
||||
void func_8008FF08(Player *player, s8 playerId) {
|
||||
if(player->nearestWaypointId){}
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_BOWSER_CASTLE:
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0x235) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x247)) {
|
||||
player->nearestWaypointId = 0x214U;
|
||||
break;
|
||||
if (((s16)gNearestWaypointByPlayerId[playerId] >= 0x235) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x247)) {
|
||||
player->nearestWaypointId = 0x214;
|
||||
} else if (((s16)gNearestWaypointByPlayerId[playerId] >= 0x267) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x277)) {
|
||||
player->nearestWaypointId = 0x25B;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
}
|
||||
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0x267) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x277)) {
|
||||
player->nearestWaypointId = 0x25BU;
|
||||
break;
|
||||
}
|
||||
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[arg1Copy];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case COURSE_BANSHEE_BOARDWALK:
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0x12C) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x13C)) {
|
||||
if (((s16)gNearestWaypointByPlayerId[playerId] >= 0x12C) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x13C)) {
|
||||
player->nearestWaypointId = 0x12CU;
|
||||
break;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
}
|
||||
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[arg1Copy];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
case COURSE_RAINBOW_ROAD:
|
||||
player->nearestWaypointId = D_80165320[arg1Copy];
|
||||
player->nearestWaypointId = D_80165320[playerId];
|
||||
break;
|
||||
case COURSE_FRAPPE_SNOWLAND:
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0xF0) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x105)) {
|
||||
if (((s16)gNearestWaypointByPlayerId[playerId] >= 0xF0) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x105)) {
|
||||
player->nearestWaypointId = 0xF0U;
|
||||
break;
|
||||
} else {
|
||||
player->nearestWaypointId = D_80165320[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
}
|
||||
|
||||
player->nearestWaypointId = D_80165320[arg1Copy];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case COURSE_ROYAL_RACEWAY:
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0x258) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x2A4)) {
|
||||
if (((s16)gNearestWaypointByPlayerId[playerId] >= 0x258) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x2A4)) {
|
||||
player->nearestWaypointId = 0x258U;
|
||||
break;
|
||||
} else {
|
||||
player->nearestWaypointId = D_80165320[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
}
|
||||
|
||||
player->nearestWaypointId = D_80165320[arg1Copy];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case COURSE_DK_JUNGLE:
|
||||
if ((((s16)gNearestWaypointByPlayerId[arg1Copy]) >= 0xB9) && (((s16)gNearestWaypointByPlayerId[arg1Copy]) < 0x119)) {
|
||||
if (((s16)gNearestWaypointByPlayerId[playerId] >= 0xB9) && ((s16)gNearestWaypointByPlayerId[playerId] < 0x119)) {
|
||||
player->nearestWaypointId = 0xB9U;
|
||||
break;
|
||||
} else {
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
}
|
||||
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[arg1Copy];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case COURSE_BLOCK_FORT:
|
||||
case COURSE_SKYSCRAPER:
|
||||
|
|
@ -1783,10 +1733,9 @@ void func_8008FF08(Player *player, s8 arg1) {
|
|||
player->nearestWaypointId = 0U;
|
||||
break;
|
||||
default:
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[arg1Copy];
|
||||
player->nearestWaypointId = gNearestWaypointByPlayerId[playerId];
|
||||
if (player->nearestWaypointId < 0) {
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex + player->nearestWaypointId;
|
||||
break;
|
||||
player->nearestWaypointId = gWaypointCountByPathIndex[0] + player->nearestWaypointId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1795,171 +1744,102 @@ void func_8008FF08(Player *player, s8 arg1) {
|
|||
GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_8008FF08.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
extern ? D_80165310;
|
||||
static ? D_800E6F6C; /* unable to generate initializer */
|
||||
static ? D_800E6F7C; /* unable to generate initializer */
|
||||
static ? D_800E6F8C; /* unable to generate initializer */
|
||||
static ? D_800E6F9C; /* unable to generate initializer */
|
||||
static ? D_800E6FAC; /* unable to generate initializer */
|
||||
static ? D_800E6FBC; /* unable to generate initializer */
|
||||
static ? D_800E6FCC; /* unable to generate initializer */
|
||||
static ? D_800E6FDC; /* unable to generate initializer */
|
||||
static ? D_800E6FEC; /* unable to generate initializer */
|
||||
static ? D_800E6FFC; /* unable to generate initializer */
|
||||
static ? D_800E700C; /* unable to generate initializer */
|
||||
static ? D_800E701C; /* unable to generate initializer */
|
||||
static ? D_800E702C; /* unable to generate initializer */
|
||||
static ? D_800E703C; /* unable to generate initializer */
|
||||
static ? D_800E704C; /* unable to generate initializer */
|
||||
static ? D_800E705C; /* unable to generate initializer */
|
||||
s16 gCurrentCourseId; /* unable to generate initializer */
|
||||
#ifdef NEEDS_RODATA
|
||||
// data_0DD0A0_2_0.s
|
||||
extern f32 D_800E6F6C[4];// = { 0.0f, 0.0f, -700.0f, 700.0f };
|
||||
extern f32 D_800E6F7C[4];// = { 700.0f, -700.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E6F8C[4];// = { 0.0f, 0.0f, -650.0f, 650.0f };
|
||||
extern f32 D_800E6F9C[4];// = { 650.0f, -650.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E6FAC[4];// = { 0.0f, 0.0f, -400.0f, 400.0f };
|
||||
extern f32 D_800E6FBC[4];// = { 400.0f, -400.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E6FCC[4];// = { 0.0f, 0.0f, -350.0f, 350.0f };
|
||||
extern f32 D_800E6FDC[4];// = { 350.0f, -350.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E6FEC[4];// = { 0.0f, 0.0f, -675.0f, 675.0f };
|
||||
extern f32 D_800E6FFC[4];// = { 675.0f, -675.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E700C[4];// = { 0.0f, 0.0f, -550.0f, 550.0f };
|
||||
extern f32 D_800E701C[4];// = { 550.0f, -550.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E702C[4];// = { 0.0f, 0.0f, -575.0f, 575.0f };
|
||||
extern f32 D_800E703C[4];// = { 575.0f, -575.0f, 0.0f, 0.0f };
|
||||
extern f32 D_800E704C[4];// = { 10.0f, -10.0f, -575.0f, 575.0f };
|
||||
extern f32 D_800E705C[4];// = { 575.0f, -575.0f, 10.0f, -10.0f };
|
||||
// data_0DD0A0_3_0.s
|
||||
// jpt_800EF5F8
|
||||
|
||||
void func_80090178(Player *player, s8 arg1, f32 *arg2, f32 *arg3) {
|
||||
? sp78;
|
||||
? sp68;
|
||||
? sp58;
|
||||
? sp48;
|
||||
? sp38;
|
||||
? sp28;
|
||||
? sp18;
|
||||
? sp8;
|
||||
f32 var_f10;
|
||||
s16 temp_t9;
|
||||
s32 temp_a0;
|
||||
s32 temp_a0_2;
|
||||
void func_80090178(Player *player, s8 playerId, Vec3f arg2, Vec3f arg3) {
|
||||
u16 test;
|
||||
struct TrackWayPoint *temp_v1;
|
||||
struct TrackWayPoint *temp_v1_2;
|
||||
struct TrackWayPoint *temp_v1_3;
|
||||
struct TrackWayPoint *temp_v1_4;
|
||||
u16 *temp_t0;
|
||||
u16 temp_t1;
|
||||
f32 spF8[4] = { 0.0f, 0.0f, -700.0f, 700.0f };
|
||||
f32 spE8[4] = { 700.0f, -700.0f, 0.0f, 0.0f };
|
||||
f32 spD8[4] = { 0.0f, 0.0f, -650.0f, 650.0f };
|
||||
f32 spC8[4] = { 650.0f, -650.0f, 0.0f, 0.0f };
|
||||
f32 spB8[4] = { 0.0f, 0.0f, -400.0f, 400.0f };
|
||||
f32 spA8[4] = { 400.0f, -400.0f, 0.0f, 0.0f };
|
||||
f32 sp98[4] = { 0.0f, 0.0f, -350.0f, 350.0f };
|
||||
f32 sp88[4] = { 350.0f, -350.0f, 0.0f, 0.0f };
|
||||
f32 sp78[4] = { 0.0f, 0.0f, -675.0f, 675.0f };
|
||||
f32 sp68[4] = { 675.0f, -675.0f, 0.0f, 0.0f };
|
||||
f32 sp58[4] = { 0.0f, 0.0f, -550.0f, 550.0f };
|
||||
f32 sp48[4] = { 550.0f, -550.0f, 0.0f, 0.0f };
|
||||
f32 sp38[4] = { 0.0f, 0.0f, -575.0f, 575.0f };
|
||||
f32 sp28[4] = { 575.0f, -575.0f, 0.0f, 0.0f };
|
||||
f32 sp18[4] = { 10.0f, -10.0f, -575.0f, 575.0f };
|
||||
f32 sp08[4] = { 575.0f, -575.0f, 10.0f, -10.0f };
|
||||
|
||||
spF8[0].unk0 = D_800E6F6C.unk0;
|
||||
spF8[0].unk4 = (s32) D_800E6F6C.unk4;
|
||||
spF8[0].unk8 = (s32) D_800E6F6C.unk8;
|
||||
spF8[0].unkC = (s32) D_800E6F6C.unkC;
|
||||
spE8[0].unk0 = D_800E6F7C.unk0;
|
||||
spE8[0].unk4 = (s32) D_800E6F7C.unk4;
|
||||
spE8[0].unk8 = (s32) D_800E6F7C.unk8;
|
||||
spE8[0].unkC = (s32) D_800E6F7C.unkC;
|
||||
spD8[0].unk0 = D_800E6F8C.unk0;
|
||||
spD8[0].unk4 = (s32) D_800E6F8C.unk4;
|
||||
spD8[0].unk8 = (s32) D_800E6F8C.unk8;
|
||||
spD8[0].unkC = (s32) D_800E6F8C.unkC;
|
||||
spC8[0].unk0 = D_800E6F9C.unk0;
|
||||
spC8[0].unk4 = (s32) D_800E6F9C.unk4;
|
||||
spC8[0].unk8 = (s32) D_800E6F9C.unk8;
|
||||
spC8[0].unkC = (s32) D_800E6F9C.unkC;
|
||||
spB8[0].unk0 = D_800E6FAC.unk0;
|
||||
spB8[0].unk4 = (s32) D_800E6FAC.unk4;
|
||||
spB8[0].unk8 = (s32) D_800E6FAC.unk8;
|
||||
spB8[0].unkC = (s32) D_800E6FAC.unkC;
|
||||
spA8[0].unk0 = D_800E6FBC.unk0;
|
||||
spA8[0].unk4 = (s32) D_800E6FBC.unk4;
|
||||
spA8[0].unk8 = (s32) D_800E6FBC.unk8;
|
||||
spA8[0].unkC = (s32) D_800E6FBC.unkC;
|
||||
sp98[0].unk0 = D_800E6FCC.unk0;
|
||||
sp98[0].unk4 = (s32) D_800E6FCC.unk4;
|
||||
sp98[0].unk8 = (s32) D_800E6FCC.unk8;
|
||||
sp98[0].unkC = (s32) D_800E6FCC.unkC;
|
||||
sp88[0].unk0 = D_800E6FDC.unk0;
|
||||
sp88[0].unk4 = (s32) D_800E6FDC.unk4;
|
||||
sp88[0].unk8 = (s32) D_800E6FDC.unk8;
|
||||
sp88[0].unkC = (s32) D_800E6FDC.unkC;
|
||||
sp78.unk4 = (s32) D_800E6FEC.unk4;
|
||||
sp78.unk0 = (s32) D_800E6FEC.unk0;
|
||||
sp78.unk8 = (s32) D_800E6FEC.unk8;
|
||||
sp78.unkC = (s32) D_800E6FEC.unkC;
|
||||
sp68.unk0 = (s32) D_800E6FFC.unk0;
|
||||
sp68.unk4 = (s32) D_800E6FFC.unk4;
|
||||
sp68.unkC = (s32) D_800E6FFC.unkC;
|
||||
sp68.unk8 = (s32) D_800E6FFC.unk8;
|
||||
sp58.unk0 = (s32) D_800E700C.unk0;
|
||||
sp58.unk4 = (s32) D_800E700C.unk4;
|
||||
sp58.unkC = (s32) D_800E700C.unkC;
|
||||
sp58.unk8 = (s32) D_800E700C.unk8;
|
||||
sp48.unk0 = (s32) D_800E701C.unk0;
|
||||
sp48.unk4 = (s32) D_800E701C.unk4;
|
||||
sp48.unkC = (s32) D_800E701C.unkC;
|
||||
sp48.unk8 = (s32) D_800E701C.unk8;
|
||||
sp38.unk0 = (s32) D_800E702C.unk0;
|
||||
sp38.unk4 = (s32) D_800E702C.unk4;
|
||||
sp38.unkC = (s32) D_800E702C.unkC;
|
||||
sp38.unk8 = (s32) D_800E702C.unk8;
|
||||
sp28.unk0 = (s32) D_800E703C.unk0;
|
||||
sp28.unk4 = (s32) D_800E703C.unk4;
|
||||
sp28.unkC = (s32) D_800E703C.unkC;
|
||||
sp28.unk8 = (s32) D_800E703C.unk8;
|
||||
sp18.unk0 = (s32) D_800E704C.unk0;
|
||||
sp18.unk4 = (s32) D_800E704C.unk4;
|
||||
sp18.unkC = (s32) D_800E704C.unkC;
|
||||
sp18.unk8 = (s32) D_800E704C.unk8;
|
||||
sp8.unk0 = (s32) D_800E705C.unk0;
|
||||
sp8.unk4 = (s32) D_800E705C.unk4;
|
||||
sp8.unkC = (s32) D_800E705C.unkC;
|
||||
sp8.unk8 = (s32) D_800E705C.unk8;
|
||||
temp_t9 = gCurrentCourseId;
|
||||
switch (temp_t9) {
|
||||
case 4:
|
||||
temp_t0 = (arg1 * 2) + &D_80165310;
|
||||
temp_v1 = &D_80164550[*temp_t0][(u16) player->nearestWaypointId];
|
||||
arg2->unk0 = (f32) temp_v1->wayPointX;
|
||||
arg2->unk4 = (f32) temp_v1->wayPointY;
|
||||
arg2->unk8 = (f32) temp_v1->wayPointZ;
|
||||
temp_t1 = *temp_t0;
|
||||
temp_v1_2 = &D_80164550[temp_t1][(s32) (player->nearestWaypointId + 5) % (s32) (gWaypointCountByPathIndex[temp_t1] + 1)];
|
||||
arg3->unk0 = (f32) temp_v1_2->wayPointX;
|
||||
arg3->unk4 = (f32) temp_v1_2->wayPointY;
|
||||
arg3->unk8 = (f32) temp_v1_2->wayPointZ;
|
||||
return;
|
||||
case 15:
|
||||
arg2->unk4 = 0.0f;
|
||||
arg2->unk0 = (&spF8[0])[arg1];
|
||||
arg2->unk8 = (f32) (&spE8[0])[arg1];
|
||||
arg3->unk4 = 0.0f;
|
||||
arg3->unk0 = (&spD8[0])[arg1];
|
||||
var_f10 = (&spC8[0])[arg1];
|
||||
block_8:
|
||||
arg3->unk8 = var_f10;
|
||||
return;
|
||||
case 16:
|
||||
arg2->unk4 = 480.0f;
|
||||
arg2->unk0 = (&spB8[0])[arg1];
|
||||
arg2->unk8 = (f32) (&spA8[0])[arg1];
|
||||
arg3->unk4 = 480.0f;
|
||||
arg3->unk0 = (&sp98[0])[arg1];
|
||||
arg3->unk8 = (f32) (&sp88[0])[arg1];
|
||||
return;
|
||||
case 17:
|
||||
temp_a0 = arg1 * 4;
|
||||
arg2->unk4 = 0.0f;
|
||||
arg2->unk0 = (sp + temp_a0)->unk78;
|
||||
arg2->unk8 = (f32) (sp + temp_a0)->unk68;
|
||||
arg3->unk4 = 0.0f;
|
||||
arg3->unk0 = (sp + temp_a0)->unk58;
|
||||
arg3->unk8 = (f32) (sp + temp_a0)->unk48;
|
||||
return;
|
||||
case 19:
|
||||
temp_a0_2 = arg1 * 4;
|
||||
arg2->unk4 = 200.0f;
|
||||
arg2->unk0 = (sp + temp_a0_2)->unk38;
|
||||
arg2->unk8 = (f32) (sp + temp_a0_2)->unk28;
|
||||
arg3->unk4 = 200.0f;
|
||||
arg3->unk0 = (sp + temp_a0_2)->unk18;
|
||||
var_f10 = (sp + temp_a0_2)->unk8;
|
||||
goto block_8;
|
||||
switch (gCurrentCourseId) {
|
||||
case COURSE_YOSHI_VALLEY:
|
||||
test = player->nearestWaypointId;
|
||||
temp_v1 = &D_80164550[D_80165310[playerId]][test];
|
||||
arg2[0] = temp_v1->wayPointX;
|
||||
arg2[1] = temp_v1->wayPointY;
|
||||
arg2[2] = temp_v1->wayPointZ;
|
||||
temp_v1 = &D_80164550[D_80165310[playerId]][(player->nearestWaypointId + 5) % (gWaypointCountByPathIndex[D_80165310[playerId]] + 1)];
|
||||
arg3[0] = temp_v1->wayPointX;
|
||||
arg3[1] = temp_v1->wayPointY;
|
||||
arg3[2] = temp_v1->wayPointZ;
|
||||
break;
|
||||
case COURSE_BLOCK_FORT:
|
||||
arg2[0] = spF8[playerId];
|
||||
arg2[1] = 0.0f;
|
||||
arg2[2] = spE8[playerId];
|
||||
arg3[0] = spD8[playerId];
|
||||
arg3[1] = 0.0f;
|
||||
arg3[2] = spC8[playerId];
|
||||
break;
|
||||
case COURSE_SKYSCRAPER:
|
||||
arg2[0] = spB8[playerId];
|
||||
arg2[1] = 480.0f;
|
||||
arg2[2] = spA8[playerId];
|
||||
arg3[0] = sp98[playerId];
|
||||
arg3[1] = 480.0f;
|
||||
arg3[2] = sp88[playerId];
|
||||
break;
|
||||
case COURSE_DOUBLE_DECK:
|
||||
arg2[0] = sp78[playerId];
|
||||
arg2[1] = 0.0f;
|
||||
arg2[2] = sp68[playerId];
|
||||
arg3[0] = sp58[playerId];
|
||||
arg3[1] = 0.0f;
|
||||
arg3[2] = sp48[playerId];
|
||||
break;
|
||||
case COURSE_BIG_DONUT:
|
||||
arg2[0] = sp38[playerId];
|
||||
arg2[1] = 200.0f;
|
||||
arg2[2] = sp28[playerId];
|
||||
arg3[0] = sp18[playerId];
|
||||
arg3[1] = 200.0f;
|
||||
arg3[2] = sp08[playerId];
|
||||
break;
|
||||
default:
|
||||
temp_v1_3 = &(*D_80164550)[(u16) player->nearestWaypointId];
|
||||
arg2->unk0 = (f32) temp_v1_3->wayPointX;
|
||||
arg2->unk4 = (f32) temp_v1_3->wayPointY;
|
||||
arg2->unk8 = (f32) temp_v1_3->wayPointZ;
|
||||
temp_v1_4 = &(*D_80164550)[(s32) (player->nearestWaypointId + 5) % (s32) (*gWaypointCountByPathIndex + 1)];
|
||||
arg3->unk0 = (f32) temp_v1_4->wayPointX;
|
||||
arg3->unk4 = (f32) temp_v1_4->wayPointY;
|
||||
var_f10 = (f32) temp_v1_4->wayPointZ;
|
||||
goto block_8;
|
||||
test = player->nearestWaypointId;
|
||||
temp_v1 = &D_80164550[0][test];
|
||||
arg2[0] = temp_v1->wayPointX;
|
||||
arg2[1] = temp_v1->wayPointY;
|
||||
arg2[2] = temp_v1->wayPointZ;
|
||||
temp_v1 = &D_80164550[0][(player->nearestWaypointId + 5) % (gWaypointCountByPathIndex[0] + 1)];
|
||||
arg3[0] = temp_v1->wayPointX;
|
||||
arg3[1] = temp_v1->wayPointY;
|
||||
arg3[2] = temp_v1->wayPointZ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -2027,14 +1907,11 @@ void func_80090868(Player* player) {
|
|||
}
|
||||
}
|
||||
|
||||
// Note that D_80004334 is a fake pointer.
|
||||
// Should put this func through mips to C prior to decomp.
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
void func_80090178(Player *, s8, f32 *, f32 *); /* extern */
|
||||
void func_8009E020(s8, ?); /* extern */
|
||||
void func_8009E088(s8, ?); /* extern */
|
||||
void func_800C9018(u8, ?); /* extern */
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
? func_8009E020(s8, ?); /* extern */
|
||||
? func_8009E088(s8, ?); /* extern */
|
||||
? func_800C9018(u8, ?); /* extern */
|
||||
extern ? D_80165330;
|
||||
|
||||
void func_80090970(Player *player, s8 arg1, s8 arg2) {
|
||||
|
|
@ -2120,7 +1997,7 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) {
|
|||
break;
|
||||
case 2:
|
||||
func_80090178(player, arg1, &sp44, &sp38);
|
||||
player->unk_02E = -func_802B5224(&sp44, &sp38);
|
||||
player->unk_02C[1] = -func_802B5224(&sp44, &sp38);
|
||||
player->pos[0] = sp44;
|
||||
player->pos[1] = sp48 + 40.0f;
|
||||
player->unk_222 = 3;
|
||||
|
|
@ -2138,8 +2015,8 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) {
|
|||
player->pos[2] = sp4C;
|
||||
temp_v0_5 = arg1 * 0x1C70;
|
||||
sp28 = temp_v0_5;
|
||||
player->pos[2] += coss((temp_v0_5 - player->unk_02E) & 0xFFFF) * -5.0f;
|
||||
temp_f6 = sins((temp_v0_5 - player->unk_02E) & 0xFFFF) * -5.0f;
|
||||
player->pos[2] += coss((temp_v0_5 - player->unk_02C[1]) & 0xFFFF) * -5.0f;
|
||||
temp_f6 = sins((temp_v0_5 - player->unk_02C[1]) & 0xFFFF) * -5.0f;
|
||||
player->unk_0C6 += 8;
|
||||
player->pos[0] += temp_f6;
|
||||
if (player->unk_0C6 >= 0xF0) {
|
||||
|
|
@ -2152,8 +2029,8 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) {
|
|||
case 4:
|
||||
temp_v0_6 = player->unk_0C8;
|
||||
if ((temp_v0_6 == 0x0096) || (temp_v0_6 == 0x00C8) || (temp_v0_6 == 0x00FA)) {
|
||||
player->pos[2] += coss(-player->unk_02E & 0xFFFF) * -10.0f;
|
||||
player->pos[0] += sins(-player->unk_02E & 0xFFFF) * -10.0f;
|
||||
player->pos[2] += coss(-player->unk_02C[1] & 0xFFFF) * -10.0f;
|
||||
player->pos[0] += sins(-player->unk_02C[1] & 0xFFFF) * -10.0f;
|
||||
}
|
||||
if (player->unk_0C8 == 0x00FC) {
|
||||
temp_v0_7 = *D_80164550;
|
||||
|
|
@ -2209,10 +2086,9 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) {
|
|||
GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_80090970.s")
|
||||
#endif
|
||||
|
||||
#if NEEDS_RODATA
|
||||
#ifdef NEEDS_RODATA
|
||||
s32 func_800910E4(Player *arg0) {
|
||||
s32 phi_v0;
|
||||
phi_v0 = 0;
|
||||
s32 phi_v0 = 0;
|
||||
if ((((((arg0->unk_0CA & 2) == 2) || ((arg0->unk_0CA & 8) == 8)) || ((arg0->unk_000 & 0x40) != 0)) || ((arg0->unk_000 & 0x800) != 0)) || ((arg0->unk_000 & 0x8000) == 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -2284,51 +2160,40 @@ void func_800911B4(Player* player, s8 arg1) {
|
|||
} while (temp_v0 < 10);
|
||||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
|
||||
|
||||
extern s8 D_801658BC;
|
||||
extern s16 D_8018D920;
|
||||
static ? D_800E706C; /* unable to generate initializer */
|
||||
#ifdef NEEDS_RODATA
|
||||
// data_0DD0A0_2_0.s
|
||||
// May actually be a Vec3f? Its hard to tell if the 0.0f is part of the array or not
|
||||
extern f32 D_800E706C[4];// = { 27.16666666666f, 25.16666666666f, 23.16666666666f, 0.0f };
|
||||
|
||||
void func_80091298(Player *player, s8 arg1) {
|
||||
f32 temp_f0;
|
||||
f32 temp_f2;
|
||||
s16 *temp_a2;
|
||||
s16 temp_t9;
|
||||
s16 var_v1;
|
||||
s32 stackPadding1;
|
||||
Vec3f spC = { 27.16666666666f, 25.16666666666f, 23.16666666666f };
|
||||
|
||||
spC[0].unk0 = D_800E706C.unk0;
|
||||
spC[0].unk4 = (s32) D_800E706C.unk4;
|
||||
spC[0].unk8 = (s32) D_800E706C.unk8;
|
||||
player->unk_044 |= 0x2000;
|
||||
if (player->unk_0B2 == 0) {
|
||||
var_v1 = 0;
|
||||
} else {
|
||||
temp_a2 = (arg1 * 2) + &D_8018D920;
|
||||
player->unk_02E -= 0xE38;
|
||||
temp_t9 = *temp_a2 - 0xE38;
|
||||
*temp_a2 = temp_t9;
|
||||
var_v1 = (s16) ((s32) (temp_t9 & 0xFFFF) / 3640);
|
||||
player->unk_02C[1] -= 0xE38;
|
||||
D_8018D920[arg1] -= 0xE38;
|
||||
var_v1 = (u16)D_8018D920[arg1] / 3640;
|
||||
}
|
||||
if (((var_v1 == 9) && (player->unk_0B2 == 1)) || ((var_v1 == 0) && (player->unk_0B2 == 2)) || (player->unk_0B2 == 0)) {
|
||||
player->unk_0B2 -= 1;
|
||||
player->unk_0B2--;
|
||||
if (player->unk_0B2 <= 0) {
|
||||
player->unk_0B2 = 0;
|
||||
}
|
||||
if (player->unk_0B2 == 0) {
|
||||
temp_f2 = player->boundingBoxSize;
|
||||
temp_f0 = (&spC[0])[arg1];
|
||||
if ((player->pos[1] - (temp_f2 + 1.0f)) <= temp_f0) {
|
||||
if ((player->pos[1] - (player->boundingBoxSize + 1.0f)) <= spC[arg1]) {
|
||||
player->pos[1] = (f32) ((f64) (spC[arg1] + player->boundingBoxSize) + 1.08);
|
||||
player->unk_DCC = 0;
|
||||
player->unk_0A8 = 0;
|
||||
player->pos[1] = (f32) ((f64) (temp_f0 + temp_f2) + 1.08);
|
||||
player->unk_07C = 0;
|
||||
player->unk_0C0 = 0;
|
||||
player->unk_044 &= 0xF7FF;
|
||||
player->unk_DC0 = 3.0f;
|
||||
player->unkD4 = 0;
|
||||
player->unk_044 &= ~0x800;
|
||||
player->kartGravity = gKartGravityTable[player->characterId];
|
||||
player->unk_0D4 = 0;
|
||||
player->unk_000 |= 0x2000;
|
||||
player->unk_094 = 0.0f;
|
||||
player->unk_08C = 0.0f;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ void func_8008C62C(Player*, s8);
|
|||
void func_8008C6D0(Player*, s8);
|
||||
void func_8008C73C(Player*, s8);
|
||||
void func_8008C8C4(Player*, s8);
|
||||
void func_8008C9EC(Player*, s8);
|
||||
void func_8008CDC0(Player*, s8);
|
||||
void func_8008D0E4(Player*, s8);
|
||||
void func_8008D0FC(Player*, s8);
|
||||
|
|
@ -69,6 +70,7 @@ void func_8008D9C0(Player*);
|
|||
void func_8008DABC(Player*, s8);
|
||||
void func_8008DC08(Player*, s8);
|
||||
void func_8008DF98(Player*, s8);
|
||||
void func_8008E118(Player*, s8);
|
||||
void func_8008E3C0(Player*, s8);
|
||||
void func_8008E4A4(Player*, s8);
|
||||
void func_8008E6C0(Player*, s8);
|
||||
|
|
@ -103,9 +105,11 @@ void func_8008FDF4(Player*, s8);
|
|||
void func_8008FE84(Player*, s8);
|
||||
void func_8008FEDC(Player*, s8);
|
||||
void func_8008FF08(Player*, s8);
|
||||
void func_80090178(Player*, s8, Vec3f, Vec3f);
|
||||
void func_80090778(Player*);
|
||||
void func_80090868(Player*);
|
||||
void func_800911B4(Player*, s8);
|
||||
void func_80091298(Player*, s8);
|
||||
void func_80091440(s8);
|
||||
void func_800914A0();
|
||||
|
||||
|
|
@ -153,6 +157,7 @@ extern s32 D_80165420[];
|
|||
extern s32 D_80165440[];
|
||||
extern s32 D_80165460[];
|
||||
extern s32 D_80165480[];
|
||||
extern s8 D_801658BC;
|
||||
extern s32 D_8018D900[];
|
||||
extern s16 D_8018D920[];
|
||||
extern s32 D_8018D930[];
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ union GrandPrixPointsUnion
|
|||
|
||||
/* Function Prototypes */
|
||||
|
||||
s32 func_800B5020(u32 time, s32 charId);
|
||||
|
||||
void func_800B45E0(s32);
|
||||
void write_save_data_grand_prix_points_and_sound_mode();
|
||||
void func_800B46D0(void);
|
||||
|
|
@ -34,6 +32,7 @@ s32 func_800B4FB0(s32);
|
|||
void func_800B5404(s32, s32);
|
||||
u8 func_800B54C0(s32, s32);
|
||||
u8 func_800B54EC(s32, s32);
|
||||
s32 func_800B5020(u32 time, s32 charId);
|
||||
u8 func_800B5508(s32, s32, s32);
|
||||
s32 func_800B5530(s32);
|
||||
s32 func_800B555C();
|
||||
|
|
|
|||
|
|
@ -1446,15 +1446,15 @@ UNUSED void func_802B8614(Player *player) {
|
|||
f64 temp_f4;
|
||||
f64 temp_f6;
|
||||
|
||||
temp_f6 = (f64) player->boundingBoxCorners[1].cornerX;
|
||||
temp_f6 = (f64) player->boundingBoxCorners[1].cornerPos[0];
|
||||
sp70 = (f64) player->boundingBoxCorners[1].cornerGroundY;
|
||||
sp68 = (f64) player->boundingBoxCorners[1].cornerZ;
|
||||
temp_f30 = (f64) player->boundingBoxCorners[0].cornerX;
|
||||
sp68 = (f64) player->boundingBoxCorners[1].cornerPos[2];
|
||||
temp_f30 = (f64) player->boundingBoxCorners[0].cornerPos[0];
|
||||
sp58 = (f64) player->boundingBoxCorners[0].cornerGroundY;
|
||||
sp50 = (f64) player->boundingBoxCorners[0].cornerZ;
|
||||
sp48 = (f64) player->boundingBoxCorners[3].cornerX;
|
||||
sp50 = (f64) player->boundingBoxCorners[0].cornerPos[2];
|
||||
sp48 = (f64) player->boundingBoxCorners[3].cornerPos[0];
|
||||
sp40 = (f64) player->boundingBoxCorners[3].cornerGroundY;
|
||||
temp_f4 = (f64) player->boundingBoxCorners[3].cornerZ;
|
||||
temp_f4 = (f64) player->boundingBoxCorners[3].cornerPos[2];
|
||||
temp_f2 = sp58 - sp70;
|
||||
sp38 = temp_f4;
|
||||
temp_f12 = temp_f4 - sp50;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ void func_802B63B8(Vec3f, Mat3);
|
|||
void func_802B6434(Vec3f, Mat4);
|
||||
void func_802B64B0(s32, s32, s32, s32);
|
||||
void func_802B64C4(Vec3f, s16);
|
||||
void func_802B6540(Mat3, f32, f32, f32, s16);
|
||||
void func_802B6BC0(Mat4, s16, f32, f32, f32);
|
||||
void func_802B6D58(Mat4, Vec3f, Vec3f);
|
||||
void func_802B71CC(Mat4, Mat4, Mat4);
|
||||
|
|
|
|||
463
src/memory.c
463
src/memory.c
|
|
@ -1482,86 +1482,57 @@ void func_802AAAAC(UnkActorInner *arg0) {
|
|||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
s32 func_802ABD10(u16, void *); // extern
|
||||
s32 func_802ABD40(u16, void *); // extern
|
||||
extern f32 D_802B9E00;
|
||||
extern f32 D_802B9E04;
|
||||
extern f32 D_802B9E08;
|
||||
extern f32 D_802B9E0C;
|
||||
extern f32 D_802B9E10;
|
||||
extern f32 D_802B9E14;
|
||||
extern f32 D_802B9E18;
|
||||
extern f32 D_802B9E1C;
|
||||
extern f32 D_802B9E20;
|
||||
extern f32 D_802B9E24;
|
||||
extern f32 D_802B9E28;
|
||||
extern f32 D_802B9E2C;
|
||||
extern f32 D_802B9E30;
|
||||
extern f32 D_802B9E34;
|
||||
extern f32 D_802B9E38;
|
||||
extern f32 D_802B9E3C;
|
||||
extern f32 D_802B9E40;
|
||||
extern f32 D_802B9E44;
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
extern f32 D_8015F8E4;
|
||||
static f32 D_802B9E00 = 1859.0f;
|
||||
static f32 D_802B9E04 = 1549.0f;
|
||||
static f32 D_802B9E08 = -1102.0f;
|
||||
static f32 D_802B9E0C = -1402.0f;
|
||||
static f32 D_802B9E10 = 2405.0f;
|
||||
static f32 D_802B9E14 = 2233.0f;
|
||||
static f32 D_802B9E18 = 0.8f;
|
||||
static f32 D_802B9E1C = -475.0f;
|
||||
static f32 D_802B9E20 = -33.9f;
|
||||
static f32 D_802B9E24 = -838.0f;
|
||||
static f32 D_802B9E28 = -475.0f;
|
||||
static f32 D_802B9E2C = -475.0f;
|
||||
static f32 D_802B9E30 = -993.0f;
|
||||
static f32 D_802B9E34 = -33.9f;
|
||||
static f32 D_802B9E38 = -475.0f;
|
||||
static f32 D_802B9E3C = -33.9f;
|
||||
static f32 D_802B9E40 = -475.0f;
|
||||
static f32 D_802B9E44 = -33.9f;
|
||||
s16 gCurrentCourseId; /* unable to generate initializer */
|
||||
|
||||
f32 func_802AAB4C(void *arg0) {
|
||||
f32 func_802AAB4C(Player *player) {
|
||||
f32 sp1C;
|
||||
f32 sp18;
|
||||
f32 temp_f0;
|
||||
f32 temp_f2;
|
||||
s16 temp_v0;
|
||||
s32 temp_v1;
|
||||
u16 temp_a0;
|
||||
void *temp_a1;
|
||||
|
||||
temp_v0 = gCurrentCourseId;
|
||||
temp_a1 = arg0;
|
||||
temp_f0 = arg0->unk14;
|
||||
temp_f2 = arg0->unk1C;
|
||||
if (temp_v0 != 2) {
|
||||
if (temp_v0 != 6) {
|
||||
if (temp_v0 != 0xC) {
|
||||
if (temp_v0 != 0x12) {
|
||||
goto block_43;
|
||||
}
|
||||
temp_a0 = temp_a1->unk11A;
|
||||
sp18 = temp_f2;
|
||||
sp1C = temp_f0;
|
||||
arg0 = temp_a1;
|
||||
temp_v1 = func_802ABD40(temp_a0, temp_a1) & 0xFF;
|
||||
if (temp_v1 == 0xFF) {
|
||||
sp18 = temp_f2;
|
||||
sp1C = temp_f0;
|
||||
if ((func_802ABD10(arg0->unk11A, arg0) & 0xFF) == 0xF) {
|
||||
return D_802B9E1C;
|
||||
}
|
||||
if (temp_f0 > -478.0f) {
|
||||
return D_802B9E20;
|
||||
}
|
||||
if (temp_f0 < D_802B9E24) {
|
||||
return D_802B9E28;
|
||||
}
|
||||
if (temp_f2 > -436.0f) {
|
||||
return D_802B9E2C;
|
||||
}
|
||||
if (temp_f2 < D_802B9E30) {
|
||||
return D_802B9E34;
|
||||
}
|
||||
if (temp_f2 < temp_f0) {
|
||||
return D_802B9E38;
|
||||
}
|
||||
return D_802B9E3C;
|
||||
}
|
||||
if (temp_v1 >= 0x14) {
|
||||
return D_802B9E40;
|
||||
}
|
||||
return D_802B9E44;
|
||||
}
|
||||
if ((func_802ABD10(temp_a1->unk11A, temp_a1) & 0xFF) == 5) {
|
||||
return D_8015F6EE - 0xA;
|
||||
}
|
||||
temp_f0 = player->pos[0];
|
||||
temp_f2 = player->pos[2];
|
||||
switch (temp_v0) { /* irregular */
|
||||
case 2:
|
||||
if (D_802B9E00 < temp_f0) {
|
||||
goto block_43;
|
||||
}
|
||||
if (temp_f0 < D_802B9E04) {
|
||||
goto block_43;
|
||||
}
|
||||
if (D_802B9E08 < temp_f2) {
|
||||
goto block_43;
|
||||
}
|
||||
if (temp_f2 < D_802B9E0C) {
|
||||
block_43:
|
||||
default:
|
||||
return D_8015F8E4;
|
||||
}
|
||||
return 20.0f;
|
||||
case 6:
|
||||
if (temp_f0 > 239.0f) {
|
||||
goto block_43;
|
||||
}
|
||||
|
|
@ -1575,21 +1546,43 @@ f32 func_802AAB4C(void *arg0) {
|
|||
goto block_43;
|
||||
}
|
||||
return D_802B9E18;
|
||||
}
|
||||
if (D_802B9E00 < temp_f0) {
|
||||
case 12:
|
||||
if ((func_802ABD10(player->unk_110.unk3A) & 0xFF) == 5) {
|
||||
return (f32) (D_8015F6EE - 0xA);
|
||||
}
|
||||
goto block_43;
|
||||
case 18:
|
||||
sp18 = temp_f2;
|
||||
sp1C = temp_f0;
|
||||
temp_v1 = func_802ABD40(player->unk_110.unk3A) & 0xFF;
|
||||
if (temp_v1 == 0xFF) {
|
||||
sp18 = temp_f2;
|
||||
sp1C = temp_f0;
|
||||
if ((func_802ABD10(player->unk_110.unk3A) & 0xFF) == 0xF) {
|
||||
return D_802B9E1C;
|
||||
}
|
||||
if (temp_f0 > -478.0f) {
|
||||
return D_802B9E20;
|
||||
}
|
||||
if (temp_f0 < D_802B9E24) {
|
||||
return D_802B9E28;
|
||||
}
|
||||
if (temp_f2 > -436.0f) {
|
||||
return D_802B9E2C;
|
||||
}
|
||||
if (temp_f2 < D_802B9E30) {
|
||||
return D_802B9E34;
|
||||
}
|
||||
if (temp_f2 < temp_f0) {
|
||||
return D_802B9E38;
|
||||
}
|
||||
return D_802B9E3C;
|
||||
}
|
||||
if (temp_v1 >= 0x14) {
|
||||
return D_802B9E40;
|
||||
}
|
||||
return D_802B9E44;
|
||||
}
|
||||
if (temp_f0 < D_802B9E04) {
|
||||
goto block_43;
|
||||
}
|
||||
if (D_802B9E08 < temp_f2) {
|
||||
goto block_43;
|
||||
}
|
||||
if (temp_f2 < D_802B9E0C) {
|
||||
block_43:
|
||||
return D_8015F8E4;
|
||||
}
|
||||
return 20.0f;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/memory/func_802AAB4C.s")
|
||||
|
|
@ -4120,23 +4113,23 @@ block_12:
|
|||
GLOBAL_ASM("asm/non_matchings/memory/func_802AF5D8.s")
|
||||
#endif
|
||||
|
||||
void func_802AF7B4(uintptr_t addr, s32 arg1, s32 arg2) {
|
||||
void func_802AF7B4(uintptr_t addr, s32 uls, s32 ult) {
|
||||
s32 segment = SEGMENT_NUMBER2(addr);
|
||||
s32 offset = SEGMENT_OFFSET(addr);
|
||||
struct UnkStruct802AF7B4 *phi_v0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
|
||||
s32 temp_v1;
|
||||
Gfx *phi_v0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset);
|
||||
s32 gfxCommand;
|
||||
|
||||
arg1 = (arg1 << 12) & 0xFFF000;
|
||||
arg2 &= 0xFFF;
|
||||
uls = (uls << 12) & 0xFFF000;
|
||||
ult &= 0xFFF;
|
||||
|
||||
while(1) {
|
||||
|
||||
temp_v1 = phi_v0->unk0 & 0xFF000000;
|
||||
gfxCommand = phi_v0->words.w0 & 0xFF000000;
|
||||
|
||||
if (temp_v1 == G_ENDDL << 24) {
|
||||
if (gfxCommand == G_ENDDL << 24) {
|
||||
break;
|
||||
} else if (temp_v1 == G_SETTILESIZE << 24) {
|
||||
phi_v0->unk0 = 0xF2000000 | arg1 | arg2;
|
||||
} else if (gfxCommand == (G_SETTILESIZE << 24)) {
|
||||
phi_v0->words.w0 = 0xF2000000 | uls | ult;
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -4210,38 +4203,31 @@ loop_1:
|
|||
GLOBAL_ASM("asm/non_matchings/memory/func_802AF8BC.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
void func_802AF9F0(void *arg0, f32 arg1, void *arg2) {
|
||||
arg2->unk0 = arg2->unk0 - (arg0->unk0 * arg1);
|
||||
arg2->unk4 = arg2->unk4 - (arg0->unk4 * arg1);
|
||||
arg2->unk8 = arg2->unk8 - (arg0->unk8 * arg1);
|
||||
void func_802AF9F0(Vec3f arg0, f32 arg1, Vec3f arg2) {
|
||||
arg2[0] -= arg0[0] * arg1;
|
||||
arg2[1] -= arg0[1] * arg1;
|
||||
arg2[2] -= arg0[2] * arg1;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/memory/func_802AF9F0.s")
|
||||
#endif
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 792017ad9d422c2467bd42686f383a5c41f41c75
|
||||
f32 func_802ABE30(f32, f32, f32, u16); /* extern */
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
s32 func_802AC760(s16 *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */
|
||||
s32 func_802ACBA4(s16 *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */
|
||||
s32 func_802AD278(s16 *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */
|
||||
void func_802AF9F0(f32, ? *, ?32, kartBoundingBoxCorner *); /* extern */
|
||||
extern u8 D_8014F110;
|
||||
extern ? D_8014F110;
|
||||
extern s32 D_8015F584;
|
||||
extern s16 D_8015F6E8;
|
||||
extern s16 D_8015F6EA;
|
||||
extern s16 D_8015F6F0;
|
||||
extern s16 D_8015F6F2;
|
||||
|
||||
s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f32 cornerY, f32 cornerZ) {
|
||||
? sp128;
|
||||
? sp11C;
|
||||
? sp110;
|
||||
?32 sp10C;
|
||||
?32 sp108;
|
||||
?32 sp104;
|
||||
s32 func_802AFA34(Player *player, KartBoundingBoxCorner *corner, f32 cornerPos[0], f32 cornerPos[1], f32 cornerPos[2]) {
|
||||
f32 sp128;
|
||||
f32 sp11C;
|
||||
f32 sp110;
|
||||
f32 sp10C;
|
||||
f32 sp108;
|
||||
f32 sp104;
|
||||
s16 sp102;
|
||||
s16 sp100;
|
||||
s16 spFE;
|
||||
|
|
@ -4269,22 +4255,21 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3
|
|||
mk64_surface_map_ram *temp_v0_4;
|
||||
s16 temp_v0_2;
|
||||
s16 temp_v1;
|
||||
s32 temp_at;
|
||||
s32 temp_f10;
|
||||
s32 temp_f16;
|
||||
s32 temp_t6;
|
||||
s32 var_s2;
|
||||
u16 temp_s0;
|
||||
u16 temp_v0_3;
|
||||
u16 temp_v1_3;
|
||||
u16 var_s1;
|
||||
u8 temp_v0;
|
||||
void *temp_v1_2;
|
||||
u16 phi_s1;
|
||||
s16 *phi_s7;
|
||||
f32 phi_f30;
|
||||
s32 phi_s2;
|
||||
|
||||
sp104 = 0x447A0000;
|
||||
sp108 = 0x447A0000;
|
||||
sp10C = 0x447A0000;
|
||||
sp104 = 1000.0f;
|
||||
sp108 = 1000.0f;
|
||||
sp10C = 1000.0f;
|
||||
temp_f20 = player->boundingBoxSize;
|
||||
spFE = 0x1388;
|
||||
sp100 = 0x1388;
|
||||
|
|
@ -4293,150 +4278,140 @@ s32 func_802AFA34(Player *player, kartBoundingBoxCorner *corner, f32 cornerX, f3
|
|||
spFA = 0;
|
||||
spFC = 0;
|
||||
temp_v0 = corner->surfaceFlags;
|
||||
temp_f22 = corner->cornerX;
|
||||
temp_f24 = corner->cornerY;
|
||||
temp_f26 = corner->cornerZ;
|
||||
if (temp_v0 != 0) {
|
||||
phi_s7 = &spF8;
|
||||
if (temp_v0 != 0x20) {
|
||||
phi_s7 = &spF8;
|
||||
if (temp_v0 != 0x40) {
|
||||
phi_s7 = &spF8;
|
||||
if (temp_v0 != 0x80) {
|
||||
goto block_21;
|
||||
}
|
||||
if (func_802AD278(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) {
|
||||
temp_f0 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2 = player->pos[1];
|
||||
if (!(temp_f2 < temp_f0) && !((2.0f * temp_f20) < (temp_f2 - temp_f0))) {
|
||||
corner->cornerGroundY = temp_f0;
|
||||
func_802AF9F0(temp_f0, &sp11C, sp108, corner);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
phi_f30 = 2.0f;
|
||||
goto block_22;
|
||||
}
|
||||
if (func_802AC760(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) {
|
||||
temp_f0_2 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2_2 = player->pos[1];
|
||||
if (!(temp_f2_2 < temp_f0_2) && !((2.0f * temp_f20) < (temp_f2_2 - temp_f0_2))) {
|
||||
corner->cornerGroundY = temp_f0_2;
|
||||
func_802AF9F0(temp_f0_2, &sp128, sp10C, corner);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
phi_f30 = 2.0f;
|
||||
goto block_22;
|
||||
}
|
||||
if (func_802ACBA4(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerX, cornerY, cornerZ) == 1) {
|
||||
temp_f0_3 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2_3 = player->pos[1];
|
||||
if (!(temp_f2_3 < temp_f0_3) && !((2.0f * temp_f20) < (temp_f2_3 - temp_f0_3))) {
|
||||
corner->cornerGroundY = temp_f0_3;
|
||||
func_802AF9F0(temp_f0_3, &sp110, sp104, corner);
|
||||
temp_f22 = corner->cornerPos[0];
|
||||
temp_f24 = corner->cornerPos[1];
|
||||
temp_f26 = corner->cornerPos[2];
|
||||
switch (temp_v0) { /* irregular */
|
||||
case 0x80:
|
||||
if (func_802AD278(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerPos[0], cornerPos[1], cornerPos[2]) == 1) {
|
||||
temp_f0 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2 = player->pos[1];
|
||||
if (!(temp_f2 < temp_f0) && !((2.0f * temp_f20) < (temp_f2 - temp_f0))) {
|
||||
corner->cornerGroundY = temp_f0;
|
||||
func_802AF9F0(&sp11C, sp108, &corner->cornerPos[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
phi_f30 = 2.0f;
|
||||
goto block_22;
|
||||
}
|
||||
block_21:
|
||||
phi_s7 = &spF8;
|
||||
phi_f30 = 2.0f;
|
||||
default:
|
||||
block_22:
|
||||
temp_v0_2 = D_8015F6EA;
|
||||
temp_v1 = D_8015F6F2;
|
||||
temp_f10 = (s32) ((temp_f22 - (f32) temp_v0_2) / (f32) ((s32) (D_8015F6E8 - temp_v0_2) / 32));
|
||||
temp_f16 = (s32) ((temp_f26 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32));
|
||||
if ((s32) (s16) temp_f10 < 0) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s32) (s16) temp_f16 < 0) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s32) (s16) temp_f10 >= 0x20) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s32) (s16) temp_f16 >= 0x20) {
|
||||
goto block_57;
|
||||
}
|
||||
temp_v1_2 = ((s16) ((s16) temp_f10 + ((s16) temp_f16 << 5)) * 4) + &D_8014F110;
|
||||
temp_v0_3 = temp_v1_2->unk2;
|
||||
sp8C = (s32) temp_v0_3;
|
||||
if (temp_v0_3 == 0) {
|
||||
goto block_57;
|
||||
}
|
||||
phi_s1 = temp_v1_2->unk0;
|
||||
phi_s2 = 0;
|
||||
if (sp8C > 0) {
|
||||
temp_v0_2 = D_8015F6EA;
|
||||
temp_v1 = D_8015F6F2;
|
||||
temp_f10 = (s32) ((temp_f22 - (f32) temp_v0_2) / (f32) ((s32) (D_8015F6E8 - temp_v0_2) / 32));
|
||||
temp_f16 = (s32) ((temp_f26 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32));
|
||||
if ((s16) temp_f10 < 0) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s16) temp_f16 < 0) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s16) temp_f10 >= 0x20) {
|
||||
goto block_57;
|
||||
}
|
||||
if ((s16) temp_f16 >= 0x20) {
|
||||
goto block_57;
|
||||
}
|
||||
temp_v1_2 = ((s16) ((s16) temp_f10 + ((s16) temp_f16 << 5)) * 4) + &D_8014F110;
|
||||
temp_v0_3 = temp_v1_2->unk2;
|
||||
sp8C = (s32) temp_v0_3;
|
||||
if (temp_v0_3 == 0) {
|
||||
goto block_57;
|
||||
}
|
||||
var_s1 = temp_v1_2->unk0;
|
||||
var_s2 = 0;
|
||||
if (sp8C > 0) {
|
||||
loop_34:
|
||||
temp_s0 = *(D_8015F584 + (phi_s1 * 2));
|
||||
temp_v0_4 = &(*D_8015F580)[temp_s0];
|
||||
temp_v1_3 = temp_v0_4->flags;
|
||||
if ((temp_v1_3 & 0x4000) != 0) {
|
||||
if ((corner->surfaceMapIndex != temp_s0) && (func_802AC760(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) {
|
||||
temp_s0 = *(D_8015F584 + (var_s1 * 2));
|
||||
temp_v0_4 = &D_8015F580[temp_s0];
|
||||
temp_v1_3 = temp_v0_4->flags;
|
||||
if (temp_v1_3 & 0x4000) {
|
||||
if ((corner->surfaceMapIndex != temp_s0) && (func_802AC760(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerPos[0], cornerPos[1], cornerPos[2]) == 1)) {
|
||||
temp_f0_2 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
temp_f2_2 = player->pos[1];
|
||||
if (!(temp_f2_2 < temp_f0_2) && !((2.0f * temp_f20) < (temp_f2_2 - temp_f0_2))) {
|
||||
spD4 = temp_f0_2;
|
||||
func_802AF9F0(&sp128, sp10C, &corner->cornerPos[0]);
|
||||
corner->cornerGroundY = spD4;
|
||||
corner->surfaceFlags = 0x40;
|
||||
corner->surfaceMapIndex = temp_s0;
|
||||
corner->surfaceType = (u8) D_8015F580[temp_s0].surfaceType;
|
||||
if (D_8015F580[temp_s0].flags & 0x1000) {
|
||||
corner->unk_14 = 1;
|
||||
return 1;
|
||||
}
|
||||
corner->unk_14 = 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
goto block_55;
|
||||
}
|
||||
if (temp_v1_3 & 0x8000) {
|
||||
if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802AD278(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerPos[0], cornerPos[1], cornerPos[2]) == 1)) {
|
||||
temp_f0_3 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
temp_f2_3 = player->pos[1];
|
||||
if (!(temp_f2_3 < temp_f0_3) && !((2.0f * temp_f20) < (temp_f2_3 - temp_f0_3))) {
|
||||
corner->cornerGroundY = temp_f0_3;
|
||||
func_802AF9F0(&sp11C, sp108, &corner->cornerPos[0]);
|
||||
corner->cornerGroundY = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
corner->surfaceFlags = 0x80;
|
||||
corner->surfaceMapIndex = temp_s0;
|
||||
corner->surfaceType = (u8) D_8015F580[temp_s0].surfaceType;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
goto block_55;
|
||||
}
|
||||
if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802ACBA4(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerPos[0], cornerPos[1], cornerPos[2]) == 1)) {
|
||||
temp_f0_4 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
temp_f2_4 = player->pos[1];
|
||||
if (!(temp_f2_4 < temp_f0_4) && !((phi_f30 * temp_f20) < (temp_f2_4 - temp_f0_4))) {
|
||||
spD4 = temp_f0_4;
|
||||
func_802AF9F0(temp_f0_4, &sp128, sp10C, corner);
|
||||
corner->cornerGroundY = spD4;
|
||||
corner->surfaceFlags = 0x40;
|
||||
if (!(temp_f2_4 < temp_f0_4) && !((2.0f * temp_f20) < (temp_f2_4 - temp_f0_4))) {
|
||||
corner->cornerGroundY = temp_f0_4;
|
||||
func_802AF9F0(&sp110, sp104, &corner->cornerPos[0]);
|
||||
corner->surfaceFlags = 0x20;
|
||||
corner->surfaceMapIndex = temp_s0;
|
||||
corner->surfaceType = (u8) (*D_8015F580)[temp_s0].surfaceType;
|
||||
if (((*D_8015F580)[temp_s0].flags & 0x1000) != 0) {
|
||||
corner->unk_14 = 1;
|
||||
return 1;
|
||||
}
|
||||
corner->unk_14 = 0;
|
||||
corner->surfaceType = (u8) D_8015F580[temp_s0].surfaceType;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
goto block_55;
|
||||
}
|
||||
if ((temp_v1_3 & 0x8000) != 0) {
|
||||
if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802AD278(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) {
|
||||
temp_f0_5 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
temp_f2_5 = player->pos[1];
|
||||
if (!(temp_f2_5 < temp_f0_5) && !((phi_f30 * temp_f20) < (temp_f2_5 - temp_f0_5))) {
|
||||
corner->cornerGroundY = temp_f0_5;
|
||||
func_802AF9F0(temp_f0_5, &sp11C, sp108, corner);
|
||||
corner->cornerGroundY = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
corner->surfaceFlags = 0x80;
|
||||
corner->surfaceMapIndex = temp_s0;
|
||||
corner->surfaceType = (u8) (*D_8015F580)[temp_s0].surfaceType;
|
||||
return 1;
|
||||
}
|
||||
block_55:
|
||||
temp_t6 = (var_s2 + 1) & 0xFFFF;
|
||||
temp_at = temp_t6 < sp8C;
|
||||
var_s2 = temp_t6;
|
||||
var_s1 = (var_s1 + 1) & 0xFFFF;
|
||||
if (temp_at == 0) {
|
||||
goto block_56;
|
||||
}
|
||||
goto block_55;
|
||||
goto loop_34;
|
||||
}
|
||||
if ((temp_v0_4->gravity != 0.0f) && (corner->surfaceMapIndex != temp_s0) && (func_802ACBA4(phi_s7, temp_f20, temp_f22, temp_f24, temp_f26, (s32) temp_s0, cornerX, cornerY, cornerZ) == 1)) {
|
||||
temp_f0_6 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF);
|
||||
temp_f2_6 = player->pos[1];
|
||||
if (!(temp_f2_6 < temp_f0_6) && !((phi_f30 * temp_f20) < (temp_f2_6 - temp_f0_6))) {
|
||||
corner->cornerGroundY = temp_f0_6;
|
||||
func_802AF9F0(temp_f0_6, &sp110, sp104, corner);
|
||||
corner->surfaceFlags = 0x20;
|
||||
corner->surfaceMapIndex = temp_s0;
|
||||
corner->surfaceType = (u8) (*D_8015F580)[temp_s0].surfaceType;
|
||||
block_56:
|
||||
corner->cornerGroundY = temp_f24;
|
||||
corner->surfaceType = 0;
|
||||
block_57:
|
||||
return 0;
|
||||
case 0x40:
|
||||
if (func_802AC760(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerPos[0], cornerPos[1], cornerPos[2]) == 1) {
|
||||
temp_f0_5 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2_5 = player->pos[1];
|
||||
if (!(temp_f2_5 < temp_f0_5) && !((2.0f * temp_f20) < (temp_f2_5 - temp_f0_5))) {
|
||||
corner->cornerGroundY = temp_f0_5;
|
||||
func_802AF9F0(&sp128, sp10C, &corner->cornerPos[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
block_55:
|
||||
temp_t6 = (phi_s2 + 1) & 0xFFFF;
|
||||
phi_s1 = (phi_s1 + 1) & 0xFFFF;
|
||||
phi_s2 = temp_t6;
|
||||
if (temp_t6 >= sp8C) {
|
||||
goto block_56;
|
||||
goto block_22;
|
||||
case 0x20:
|
||||
if (func_802ACBA4(&spF8, temp_f20, temp_f22, temp_f24, temp_f26, (s32) corner->surfaceMapIndex, cornerPos[0], cornerPos[1], cornerPos[2]) == 1) {
|
||||
temp_f0_6 = func_802ABE30(temp_f22, temp_f24, temp_f26, corner->surfaceMapIndex);
|
||||
temp_f2_6 = player->pos[1];
|
||||
if (!(temp_f2_6 < temp_f0_6) && !((2.0f * temp_f20) < (temp_f2_6 - temp_f0_6))) {
|
||||
corner->cornerGroundY = temp_f0_6;
|
||||
func_802AF9F0(&sp110, sp104, &corner->cornerPos[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
goto loop_34;
|
||||
goto block_22;
|
||||
case 0x0:
|
||||
goto block_22;
|
||||
}
|
||||
block_56:
|
||||
corner->cornerGroundY = temp_f24;
|
||||
corner->surfaceType = 0;
|
||||
block_57:
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/memory/func_802AFA34.s")
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ void func_802AF5AC(s32, s8);
|
|||
void func_802AF5D8(u32, s8, s32);
|
||||
void func_802AF7B4(uintptr_t, s32, s32);
|
||||
void func_802AF8BC(uintptr_t, s8, u8, u8, u8);
|
||||
void func_802AF9F0(Vec3f, f32, Vec3f);
|
||||
|
||||
// main.c
|
||||
extern struct D_80150158 gD_80150158[];
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -154,7 +154,7 @@ extern s32 gGamestate;
|
|||
extern s32 gModeSelection;
|
||||
extern u16 gNumActors;
|
||||
extern s32 D_8015F58C;
|
||||
extern uintptr_t D_8015F580;
|
||||
extern mk64_surface_map_ram *D_8015F580;
|
||||
extern s32 gCCSelection;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -441,64 +441,62 @@ void func_802A487C(Vtx *arg0, UNUSED s32 arg1, UNUSED s32 arg2, UNUSED s32 arg3,
|
|||
}
|
||||
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307
|
||||
//void init_rdp(); // extern
|
||||
//void func_802A450C(); // extern
|
||||
//void func_802B5564(? *, ? *, s32, s32, f32, f32, f32); // extern
|
||||
//void func_802B5794(? *, void *, void *); // extern
|
||||
//void func_802B6434(f32 *, ? *); // extern
|
||||
//void func_802B71CC(? *, ? *, ? *); // extern
|
||||
|
||||
extern s32 D_80150148;
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
? func_802B5794(f32 (*)[4], Camera *, f32 *); /* extern */
|
||||
extern ? D_0D008E98;
|
||||
extern f32 D_80150148;
|
||||
extern f32 D_8015014C;
|
||||
extern f32 D_80150150;
|
||||
extern f32 D_802B9BB0;
|
||||
// gControllers
|
||||
void func_802A4A0C(Vtx *arg0, struct UnkStruct_800DC5EC *arg1, s32 arg2, s32 arg3) {
|
||||
Camera *sp13C = arg1->camera;
|
||||
s32 sp128;
|
||||
s32 spE8;
|
||||
s32 spA8;
|
||||
s32 sp68;
|
||||
static f32 D_802B9BB0 = 30000.0f;
|
||||
s16 gCurrentCourseId; /* unable to generate initializer */
|
||||
|
||||
void func_802A4A0C(Vtx *arg0, struct UnkStruct_800DC5EC *arg1, s32 arg2, s32 arg3) {
|
||||
Camera *sp13C;
|
||||
u16 sp128;
|
||||
f32 sp64;
|
||||
f32 sp60;
|
||||
f32 sp5C;
|
||||
f32 sp58;
|
||||
Gfx *temp_v0;
|
||||
Gfx *temp_v0_2;
|
||||
Gfx *temp_v0_3;
|
||||
Gfx *temp_v0_4;
|
||||
Gfx *temp_v0_5;
|
||||
Gfx *temp_v0_6;
|
||||
Gfx *temp_v0_7;
|
||||
Gfx *temp_v0_8;
|
||||
Gfx *temp_v0_9;
|
||||
f32 temp_f0;
|
||||
f32 temp_f10;
|
||||
f32 temp_f16;
|
||||
f32 temp_f18;
|
||||
f32 temp_f6;
|
||||
s16 temp_t5;
|
||||
|
||||
sp13C = arg1->camera;
|
||||
func_802A450C(arg0);
|
||||
sp64 = D_802B9BB0;
|
||||
sp5C = 0.0f;
|
||||
sp60 = 0.0f;
|
||||
|
||||
func_802B5564(&spE8, &sp128, sp13C->unk30, D_80150148, D_80150150, D_8015014C, 1.0f);
|
||||
func_802B5794(&spA8, sp13C, sp13C->unk);
|
||||
func_802B71CC(&sp68, &spE8, &spA8);
|
||||
sp58 = spA4 + ((sp74 * sp5C) + (sp84 * sp60) + (sp94 * sp64));
|
||||
func_802B6434(&sp5C, &sp68);
|
||||
temp_f0 = 1.0 / sp58;
|
||||
func_802B5564((f32 (*)[4]) &spE8[0], &sp128, sp13C->unk_B4, D_80150148, D_80150150, D_8015014C, 1.0f);
|
||||
func_802B5794((f32 (*)[4]) &spA8[0], sp13C, sp13C->lookAt);
|
||||
func_802B71CC((f32 (*)[4]) &sp68[0], (f32 (*)[4]) &spE8[0], (f32 (*)[4]) &spA8[0]);
|
||||
sp58 = spA4 + ((sp68[3] * sp5C) + (sp84 * sp60) + (sp94 * sp64));
|
||||
func_802B6434(&sp5C, (f32 (*)[4]) &sp68[0]);
|
||||
temp_f0 = (f32) (1.0 / (f64) sp58);
|
||||
temp_f18 = sp5C * temp_f0;
|
||||
temp_f6 = sp60 * temp_f0;
|
||||
temp_f10 = temp_f18 * 160.0f;
|
||||
sp5C = temp_f18;
|
||||
temp_f16 = temp_f6 * 120.0f;
|
||||
sp60 = temp_f6;
|
||||
sp5C = temp_f10;
|
||||
sp5C = temp_f18 * 160.0f;
|
||||
sp60 = temp_f16;
|
||||
temp_t5 = 0x78 - temp_f16;
|
||||
arg1->pathCounter = temp_t5;
|
||||
arg0->v.ob[0] = temp_t5;//->unk12 = temp_t5;
|
||||
arg0->v.ob[1] = temp_t5; // = temp_t5; //unk22
|
||||
arg0->v.ob[4] = temp_t5;//unk42 = temp_t5;
|
||||
arg0->v.ob[7] = temp_t5;//unk72 = temp_t5;
|
||||
temp_t5 = 0x78 - (s32) temp_f16;
|
||||
arg1->cameraHeight = temp_t5;
|
||||
arg0->unk12 = temp_t5;
|
||||
arg0->unk22 = temp_t5;
|
||||
arg0->unk42 = temp_t5;
|
||||
arg0->unk72 = temp_t5;
|
||||
init_rdp();
|
||||
|
||||
gDPSetRenderMode(gDisplayListHead++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
|
||||
gSPClearGeometryMode(gDisplayListHead++, G_ZBUFFER | G_LIGHTING);
|
||||
guOrtho(&gGfxPool->mtxPool[0], 0.0f, 320.0f, 0.0f, 240.0f, 0.0f, 5.0f, 1.0f);
|
||||
|
|
@ -507,44 +505,9 @@ void func_802A4A0C(Vtx *arg0, struct UnkStruct_800DC5EC *arg1, s32 arg2, s32 arg
|
|||
gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(&D_0D008E98), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPVertex(gDisplayListHead++, &arg0, 4, 0);
|
||||
gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 1, 3, 2, 0);
|
||||
|
||||
/*
|
||||
temp_v0->unk0 = 0xB900031D;
|
||||
temp_v0->unk4 = 0xF0A4000;
|
||||
|
||||
temp_v0_2->unk0 = 0xB6000000;
|
||||
temp_v0_2->unk4 = 0x20001;
|
||||
|
||||
guOrtho(gGfxPool, 0.0f, 320.0f, 0.0f, 240.0f, 0.0f, 5.0f, 1.0f);
|
||||
|
||||
temp_v0_3->unk4 = 0xFFFF;
|
||||
temp_v0_3->unk0 = 0xB4000000;
|
||||
|
||||
temp_v0_4->unk0 = 0x1030040;
|
||||
temp_v0_4->unk4 = gGfxPool & 0x1FFFFFFF;
|
||||
temp_v0_5 = gDisplayListHead;
|
||||
gDisplayListHead = temp_v0_5 + 8;
|
||||
temp_v0_5->unk4 = &D_0D008E98 & 0x1FFFFFFF;
|
||||
temp_v0_5->unk0 = 0x1020040;
|
||||
|
||||
temp_v0_6->unk4 = arg0;
|
||||
temp_v0_6->unk0 = 0x400103F;
|
||||
|
||||
temp_v0_7->unk0 = 0xB1000602;
|
||||
temp_v0_7->unk4 = 0x20604;
|
||||
*/
|
||||
if (gCurrentCourseId == COURSE_RAINBOW_ROAD) {
|
||||
|
||||
gSPVertex(gDisplayListHead++, &arg0[4], 4, 0);
|
||||
gSP2Triangles(gDisplayListHead++, 0, 3, 1, 0, 0, 0, 0, 0);
|
||||
|
||||
/*
|
||||
temp_v0_8->unk4 = arg0 + 0x40;
|
||||
temp_v0_8->unk0 = 0x400103F;
|
||||
|
||||
temp_v0_9->unk4 = 0x20604;
|
||||
temp_v0_9->unk0 = 0xB1000602;
|
||||
*/
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@
|
|||
#include "framebuffers.h"
|
||||
#include "kart_dma.h"
|
||||
#include "camera.h"
|
||||
#include "math_util.h"
|
||||
#include "code_80027D00.h"
|
||||
#include "code_80057C60.h"
|
||||
#include "render_courses.h"
|
||||
#include "spawn_players.h"
|
||||
|
||||
// arg4 is height? Or something like that?
|
||||
|
|
@ -256,21 +259,21 @@ void spawn_player(Player *player, s8 playerIndex, f32 startingRow, f32 startingC
|
|||
player->unk_110.unk38 = 0;
|
||||
player->unk_110.unk3A = 0;
|
||||
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerX = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerY = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerZ = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerPos[0] = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerPos[1] = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_LEFT_TYRE].cornerPos[2] = 0.0f;
|
||||
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerX = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerY = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerZ = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerPos[0] = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerPos[1] = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerPos[2] = 0.0f;
|
||||
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerX = 0.0f;
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerY = 0.0f;
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerZ = 0.0f;
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerPos[0] = 0.0f;
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerPos[1] = 0.0f;
|
||||
player->boundingBoxCorners[BACK_LEFT_TYRE].cornerPos[2] = 0.0f;
|
||||
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerX = 0.0f;
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerY = 0.0f;
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerZ = 0.0f;
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerPos[0] = 0.0f;
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerPos[1] = 0.0f;
|
||||
player->boundingBoxCorners[BACK_RIGHT_TYRE].cornerPos[2] = 0.0f;
|
||||
|
||||
player->boundingBoxCorners[ FRONT_LEFT_TYRE].cornerGroundY = 0.0f;
|
||||
player->boundingBoxCorners[FRONT_RIGHT_TYRE].cornerGroundY = 0.0f;
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
#include <common_structs.h>
|
||||
#include <defines.h>
|
||||
#include "framebuffers.h"
|
||||
#include "code_800B45E0.h"
|
||||
#include "staff_ghosts.h"
|
||||
|
||||
extern s32 mio0encode(s32 input, s32, s32);
|
||||
extern s32 func_80040174(void *, s32, s32);
|
||||
extern s32 func_800B4E24(s32 arg0);
|
||||
extern void func_80005AE8(Player *ply);
|
||||
|
||||
u32 *D_80162D80;
|
||||
u8 *D_80162D80;
|
||||
s16 D_80162D84;
|
||||
s16 D_80162D86;
|
||||
|
||||
u16 D_80162D86;
|
||||
u16 D_80162D88;
|
||||
|
||||
u32 D_80162D8C;
|
||||
s16 D_80162D90;
|
||||
u32 *D_80162D94;
|
||||
|
|
@ -479,130 +479,82 @@ void func_80005AE8(Player *ply) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
#ifdef MIPS_TO_C
|
||||
//generated by m2c commit 6b6e1390bf30013247343623194964ff13d0c45b
|
||||
extern s32 D_80162DC8;
|
||||
extern s32 D_80162DCC;
|
||||
extern s32 D_80162DD0;
|
||||
extern s32 D_80162DDC;
|
||||
extern s32 D_80162DEC;
|
||||
extern s32 D_80162DF8;
|
||||
extern s32 D_80162DFC;
|
||||
extern s32 D_80162E00;
|
||||
extern s32 D_8018CA78;
|
||||
|
||||
void func_80005B18(void) {
|
||||
s16 *temp_v0_2;
|
||||
s16 *temp_v0_3;
|
||||
s32 temp_v0;
|
||||
u16 *phi_a3;
|
||||
|
||||
if (gModeSelection == TIME_TRIALS) {
|
||||
temp_v0 = gLapCountByPlayerId[0];
|
||||
//phi_a3 = &D_80162DD4;
|
||||
if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && D_80162DF8 != 1) {
|
||||
//if (D_80162DF8 != 1) {
|
||||
|
||||
if (gModeSelection == 1) {
|
||||
if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 != 1)) {
|
||||
if (D_80162DD4 == 1) {
|
||||
D_80162DD0 = D_80162DCC;
|
||||
func_800052A4(); //gModeSelection, &D_80162DDC, 3, &D_80162DD4);
|
||||
func_800052A4();
|
||||
D_80162DD4 = 0;
|
||||
D_80162DDC = 1;
|
||||
D_80162DE0 = gPlayerOne->characterId;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
D_80162E00 = 0;
|
||||
D_80162DFC = D_8018CA78;
|
||||
func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC);
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
} else if (gLapCountByPlayerId[1] != 3) {
|
||||
D_80162DD0 = D_80162DCC;
|
||||
func_800052A4();
|
||||
D_80162DDC = 1;
|
||||
D_80162DE0 = gPlayerOne->characterId;
|
||||
D_80162DFC = D_8018CA78;
|
||||
D_80162E00 = 0;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
|
||||
} else {
|
||||
if (gLapCountByPlayerId[4] != 3) {
|
||||
D_80162DD0 = D_80162DCC;
|
||||
func_800052A4(); // gModeSelection, &D_80162DDC, 3, &D_80162DD4);
|
||||
D_80162DDC = 1;
|
||||
D_80162DE0 = gPlayerOne->characterId;
|
||||
D_80162DFC = D_8018CA78;
|
||||
D_80162E00 = 0;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC);
|
||||
func_80005AE8(gPlayerThree);
|
||||
return;
|
||||
|
||||
D_80162D80 = D_802BFB80[0][D_80162DC8][3].pixel_index_array;
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DD0 = D_80162DCC;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
D_80162DD8 = 0;
|
||||
D_80162DD4 = 0;
|
||||
D_80162DDC = 1;
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
}
|
||||
} else {
|
||||
if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 == 1)) {
|
||||
D_80162D80 = D_802BFB80[0][D_80162DC8][3].pixel_index_array;
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DDC = 1;
|
||||
}
|
||||
if ((gPlayerOne->unk_000 & 0x800) == 0x800) {
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
} else {
|
||||
D_80162DEC += 1;
|
||||
if (D_80162DEC >= 0x65) {
|
||||
D_80162DEC = 0x00000064;
|
||||
}
|
||||
if ((gModeSelection == 1) && (gActiveScreenMode == 0)) {
|
||||
if ((D_80162DD4 == 0) && (gLapCountByPlayerId[1] != 3)) {
|
||||
func_800057DC();
|
||||
}
|
||||
if ((D_80162DD6 == 0) && (gLapCountByPlayerId[2] != 3)) {
|
||||
func_8000561C();
|
||||
}
|
||||
if (!(gPlayerOne->unk_000 & 0x800)) {
|
||||
func_8000599C();
|
||||
}
|
||||
}
|
||||
}
|
||||
D_80162D80 = (void *) &D_802BFB80[0][D_80162DC8][3];
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DD0 = D_80162DCC;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
D_80162DD8 = 0;
|
||||
D_80162DD4 = 0;
|
||||
D_80162DDC = 1;
|
||||
func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC, 3, &D_80162DD4);
|
||||
func_80005AE8(gPlayerThree);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
if ((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0) && (D_80162DF8 == 1)) {
|
||||
D_80162D80 = (void *) &D_802BFB80[0][D_80162DC8][3];
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DDC = 1;
|
||||
}
|
||||
if (( gPlayerOne->unk_000 & PLAYER_CINEMATIC_MODE) == PLAYER_CINEMATIC_MODE) {
|
||||
func_80005AE8(gPlayerTwo); // (u16) &D_80162DDC, 3, phi_a3);
|
||||
func_80005AE8(gPlayerThree);
|
||||
return;
|
||||
};
|
||||
D_80162DEC++;
|
||||
if (D_80162DEC > 100) {
|
||||
D_80162DEC = 100;
|
||||
}
|
||||
if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P)) {
|
||||
if ((D_80162DD4 == 0) && (gLapCountByPlayerId[4] != 3)) {
|
||||
func_800057DC(); //gModeSelection, &D_80162DDC, 3, &D_80162DD4);
|
||||
}
|
||||
if ((D_80162DD6 == 0) && (3 != gLapCountByPlayerId[8])) {
|
||||
func_8000561C();
|
||||
}
|
||||
if (( gPlayerOne->unk_000 & PLAYER_CINEMATIC_MODE) == 0) {
|
||||
func_8000599C();
|
||||
}
|
||||
}
|
||||
D_80162D80 = &D_802BFB80[(D_80162DC8 << 0xF) + 0x3000];
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DD0 = D_80162DCC;
|
||||
D_80162DE8 = gPlayerOne->characterId;
|
||||
D_80162DD8 = 0;
|
||||
D_80162DD4 = 0;
|
||||
D_80162DDC = 1;
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
return;
|
||||
}
|
||||
if (((gLapCountByPlayerId[0] == 3) && (D_80162DDC == 0)) && (D_80162DF8 == 1))
|
||||
{
|
||||
D_80162D80 = &D_802BFB80[(D_80162DC8 << 0xF) + 0x3000];
|
||||
D_80162D84 = D_80162D86;
|
||||
D_80162DDC = 1;
|
||||
}
|
||||
if ((gPlayerOne->unk_000 & 0x800) == 0x800)
|
||||
{
|
||||
func_80005AE8(gPlayerTwo);
|
||||
func_80005AE8(gPlayerThree);
|
||||
return;
|
||||
}
|
||||
;
|
||||
D_80162DEC++;
|
||||
if (D_80162DEC > 100)
|
||||
{
|
||||
D_80162DEC = 100;
|
||||
}
|
||||
if ((gModeSelection == TIME_TRIALS) && (gActiveScreenMode == SCREEN_MODE_1P))
|
||||
{
|
||||
if ((D_80162DD4 == 0) && (gLapCountByPlayerId[1] != 3))
|
||||
{
|
||||
func_800057DC();
|
||||
}
|
||||
if ((D_80162DD6 == 0) && (3 != gLapCountByPlayerId[8]))
|
||||
{
|
||||
func_8000561C();
|
||||
}
|
||||
if ((gPlayerOne->unk_000 & (1 << 11)) == 0)
|
||||
{
|
||||
func_8000599C();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/staff_ghosts/func_80005B18.s")
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,9 +5,26 @@
|
|||
#include "common_structs.h"
|
||||
#include <types.h>
|
||||
|
||||
s32 func_800051C4(void);
|
||||
void func_8000522C(void);
|
||||
void func_80005AE8(Player *);
|
||||
void func_80004EF0();
|
||||
void func_80004FB0();
|
||||
void func_80004FF8();
|
||||
void set_staff_ghost();
|
||||
s32 func_800051C4();
|
||||
void func_8000522C();
|
||||
void func_800052A4();
|
||||
void func_80005310();
|
||||
void func_8000546C();
|
||||
void func_8000561C();
|
||||
void func_800057DC();
|
||||
void func_8000599C();
|
||||
void func_80005AE8(Player*);
|
||||
void func_80005E6C();
|
||||
void staff_ghosts_loop();
|
||||
|
||||
// mi0decode
|
||||
|
||||
extern s32 mio0encode(s32 input, s32, s32);
|
||||
extern s32 func_80040174(void *, s32, s32);
|
||||
|
||||
extern s32 D_80162DC8;
|
||||
extern s32 D_80162DCC;
|
||||
|
|
|
|||
Loading…
Reference in New Issue