diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2023-03-29 20:52:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-29 18:52:15 -0600 |
| commit | 782ed71f6135152697c6da5a232cef4aa1804d85 (patch) | |
| tree | d6aeccc50bebbfa7c9319dfb6428a1b025c7e9ae /src | |
| parent | 8d118db0b25edfbabb059e4b977e339ca9d8f885 (diff) | |
Massive data relocation (#295)
Mostly relocating rodata from data/* files to the appropriate
asm/nonmatching/* files, although there is some plain data
relocating to be found in here too.
Big change to note is the addition of the code_802AAA70.c file,
split from memory.c. Based on some padding in the ro/data for
memory it seems clear that a split is needed, although it is
not clear that exact spot chosen for the split is correct.
Still, it gets the file padding for the ro/data and text segments
correct so it can't be too wrong.
Also included is an update to the asm_processor tool to support
the .hword directive. I made a PR to the main repo of that
project with an identical change and it was accepted.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'src')
37 files changed, 3518 insertions, 3702 deletions
diff --git a/src/actors.c b/src/actors.c index db61a51cb..3602a6dab 100644 --- a/src/actors.c +++ b/src/actors.c @@ -15,6 +15,7 @@ #include "code_80005FD0.h" #include "code_80071F00.h" #include "code_8008C1D0.h" +#include "code_802AAA70.h" #include <sounds.h> #include "audio/external.h" #include "common_textures.h" diff --git a/src/actors_extended.c b/src/actors_extended.c index b0a84606c..16a913ecf 100644 --- a/src/actors_extended.c +++ b/src/actors_extended.c @@ -7,6 +7,7 @@ #include "waypoints.h" #include "code_80005FD0.h" #include "code_80091750.h" +#include "code_802AAA70.h" #include "actors.h" #include "actors_extended.h" #include "audio/external.h" diff --git a/src/audio/external.c b/src/audio/external.c index f5f07b19c..27a85c2c5 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -279,8 +279,6 @@ void func_800C1DA4(Camera *arg0, Vec3s arg1, struct Unk_8018EFD8 *arg2) { arg2->unk18[2] = func_80041724(temp_f12, temp_f14, arg1[1]); } -#ifdef NEEDS_RODATA -extern f32 D_800F35DC;// = 0.1f void func_800C1E2C(Camera *camera, Vec3f arg1, struct Unk_8018EFD8 *arg2) { f32 sp44; f32 temp_f6; @@ -316,13 +314,7 @@ void func_800C1E2C(Camera *camera, Vec3f arg1, struct Unk_8018EFD8 *arg2) { arg2->unk2C *= (((*arg2->unk24) / D_800EA06C[arg2->unk30].unk00[1]) + D_800EA06C[arg2->unk30].unk00[0]) + D_800E9F34[arg2->unk30]; } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1E2C.s") -#endif -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -extern f32 D_800F35E0;// = 100000.0f; void func_800C1F8C(void) { u8 var_s1; u8 var_a1; @@ -367,13 +359,7 @@ void func_800C1F8C(void) { } } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C1F8C.s") -#endif -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -extern f32 D_800F35E4;// = 100000.0f; f32 *func_800C21E8(Vec3f arg0, u32 arg1) { u8 var_v0; f32 *ret; @@ -402,9 +388,6 @@ f32 *func_800C21E8(Vec3f arg0, u32 arg1) { } return ret; } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C21E8.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c @@ -3100,12 +3083,6 @@ void func_800C64A0(s32 playerId) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C64A0.s") #endif -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -extern f32 D_800F3730;// = 0.6f; -extern f32 D_800F3734;// = 13000.0f; -extern f32 D_800F3738;// = 0.95f - void func_800C6758(u8 playerId) { switch (D_800E9E74[playerId]) { /* irregular */ case 3: @@ -3121,9 +3098,6 @@ void func_800C6758(u8 playerId) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C6758.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c @@ -3978,15 +3952,6 @@ void func_800C86D8(u8 playerId) { } } -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -extern f32 D_800F3894;// = 0.7f; -extern f32 D_800F3898;// = 0.1f; -extern f32 D_800F389C;// = 0.03f; -extern f32 D_800F38A0;// = 0.16f; -extern f32 D_800F38A4;// = 0.15f; -extern f32 D_800F38A8;// = 0.03f; - void func_800C8770(u8 playerId) { if ((gPlayers[playerId].unk_0BC & 0x40000000) == 0x40000000) { D_800E9F24[playerId] = 1; @@ -4018,9 +3983,6 @@ void func_800C8770(u8 playerId) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C8770.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -4037,11 +3999,6 @@ void func_800C8920(void) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C8920.s") #endif -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -extern f32 D_800F38AC;// = 0.012f; -extern f32 D_800F38B0;// = 0.85f; - void func_800C89E4(void) { if (D_800EA180 != 0) { D_800EA180++; @@ -4064,9 +4021,6 @@ void func_800C89E4(void) { } } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C89E4.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c @@ -4653,21 +4607,6 @@ void func_800C99E0(Vec3f arg0, s32 arg1) { GLOBAL_ASM("asm/non_matchings/audio/external/func_800C99E0.s") #endif -#ifdef NEEDS_RODATA -// data/rodata_audio_2.s -// jpt_800F3960 -extern f32 D_800F3980;// = 0.35f -extern f32 D_800F3984;// = 1568.979614f -extern f32 D_800F3988;// = 0.6f -extern f32 D_800F398C;// = 1478.461548f -extern f32 D_800F3990;// = 0.6f -extern f32 D_800F3994;// = 1747.272827f -extern f32 D_800F3998;// = 0.2f -extern f32 D_800F399C;// = 2135.555664f -extern f32 D_800F39A0;// = 0.4f -extern f32 D_800F39A4;// = 1922.0f - - void func_800C9A88(u8 playerId) { u8 var_s0; u32 soundBits; @@ -4719,9 +4658,6 @@ void func_800C9A88(u8 playerId) { } } } -#else -GLOBAL_ASM("asm/non_matchings/audio/external/func_800C9A88.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c diff --git a/src/audio/heap.c b/src/audio/heap.c index 8ccaa6461..9361d27ec 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -8,6 +8,52 @@ extern struct SoundAllocPool gNotesAndBuffersPool; +/** + * Given that (almost) all of these are format strings, it is highly likely + * that they are meant to be used in some sort of printf variant. But I don't + * care to try and figure out which function gets which string(s) + * So I've place them all here instead. +**/ +char heapAudioString00[] = "Warning:Kill Note %x \n"; +char heapAudioString01[] = "Kill Voice %d (ID %d) %d\n"; +char heapAudioString02[] = "Warning: Running Sequence's data disappear!\n"; +char heapAudioString03[] = "Audio:Memory:Heap OverFlow : Not Allocate %d!\n"; +char heapAudioString04[] = "Audio:Memory:DataHeap Not Allocate \n"; +char heapAudioString05[] = "StayHeap Not Allocate %d\n"; +char heapAudioString06[] = "AutoHeap Not Allocate %d\n"; +char heapAudioString07[] = "Status ID0 : %d ID1 : %d\n"; +char heapAudioString08[] = "id 0 is Stopping\n"; +char heapAudioString09[] = "id 0 is Stop\n"; +char heapAudioString10[] = "id 1 is Stopping\n"; +char heapAudioString11[] = "id 1 is Stop\n"; +char heapAudioString12[] = "WARNING: NO FREE AUTOSEQ AREA.\n"; +char heapAudioString13[] = "WARNING: NO STOP AUTO AREA.\n"; +char heapAudioString14[] = " AND TRY FORCE TO STOP SIDE \n"; +char heapAudioString15[] = "Check ID0 (seq ID %d) Useing ...\n"; +char heapAudioString16[] = "Check ID1 (seq ID %d) Useing ...\n"; +char heapAudioString17[] = "No Free Seq area.\n"; +char heapAudioString18[] = "CH %d: ID %d\n"; +char heapAudioString19[] = "TWO SIDES ARE LOADING... ALLOC CANCELED.\n"; +char heapAudioString20[] = "WARNING: Before Area Overlaid After."; +char heapAudioString21[] = "WARNING: After Area Overlaid Before."; +char heapAudioString22[] = "MEMORY:SzHeapAlloc ERROR: sza->side %d\n"; +char heapAudioString23[] = "Audio:MEMORY:SzHeap Overflow error. (%d bytes)\n"; +char heapAudioString24[] = "Auto Heap Unhit for ID %d\n"; +char heapAudioString25[] = "Heap Reconstruct Start %x\n"; +char heapAudioString26[] = "AHPBASE %x\n"; +char heapAudioString27[] = "AHPCUR %x\n"; +char heapAudioString28[] = "HeapTop %x\n"; +char heapAudioString29[] = "SynoutRate %d / %d \n"; +char heapAudioString30[] = "FXSIZE %d\n"; +char heapAudioString31[] = "FXCOMP %d\n"; +char heapAudioString32[] = "FXDOWN %d\n"; +char heapAudioString33[] = "WaveCacheLen: %d\n"; +char heapAudioString34[] = "SpecChange Finished\n"; +char heapAudioString35[] = "Fbank Seq %x\n"; +char heapAudioString36[] = "Already Load Type %d,ID %d\n"; +char heapAudioString37[] = "Warning:Emem Over,not alloc %d\n"; +char heapAudioString38[] = "Write %d\n"; + #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 extern u8 D_803B0380; @@ -69,11 +115,10 @@ void discard_bank(s32 bankId) { if (note->noteSubEu.bankId == bankId) { // (These prints are unclear. Arguments are picked semi-randomly.) - eu_stubbed_printf_1("Warning:Kill Note %x \n", i); + // eu_stubbed_printf_1("Warning:Kill Note %x \n", i); if (note->priority >= NOTE_PRIORITY_MIN) { - eu_stubbed_printf_3("Kill Voice %d (ID %d) %d\n", note->waveId, - bankId, note->priority); - eu_stubbed_printf_0("Warning: Running Sequence's data disappear!\n"); + // eu_stubbed_printf_3("Kill Voice %d (ID %d) %d\n", note->waveId, bankId, note->priority); + // eu_stubbed_printf_0("Warning: Running Sequence's data disappear!\n"); note->parentLayer->enabled = FALSE; // is 0x48, should be 0x44 note->parentLayer->finished = TRUE; } @@ -106,7 +151,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) { *pos = 0; } } else { - eu_stubbed_printf_1("Heap OverFlow : Not Allocate %d!\n", size); + // eu_stubbed_printf_1("Heap OverFlow : Not Allocate %d!\n", size); return NULL; } pool->numAllocatedEntries++; diff --git a/src/audio/load.c b/src/audio/load.c index 88ecadf7a..9c4a81095 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -37,45 +37,62 @@ extern u8 sSampleDmaReuseQueueHead1; // sSampleDmaReuseQueueHead1 extern u8 sSampleDmaReuseQueueHead2; // sSampleDmaReuseQueueHead2 /** + * Given that (almost) all of these are format strings, it is highly likely + * that they are meant to be used in some sort of printf variant. But I don't + * care to try and figure out which function gets which string(s) + * So I've place them all here instead. +**/ +char loadAudioString00[] = "Romcopy %x -> %x ,size %x\n"; +char loadAudioString01[] = "Romcopyend\n"; +char loadAudioString02[] = "CAUTION:WAVE CACHE FULL %d"; +char loadAudioString03[] = "LOAD Rom :%x -> Ram :%x Len:%x\n"; +char loadAudioString04[] = "BASE %x %x\n"; +char loadAudioString05[] = "LOAD %x %x %x\n"; +char loadAudioString06[] = "INSTTOP %x\n"; +char loadAudioString07[] = "INSTMAP[0] %x\n"; +char loadAudioString08[] = "already flags %d\n"; +char loadAudioString09[] = "already flags %d\n"; +char loadAudioString10[] = "ERR:SLOW BANK DMA BUSY\n"; +char loadAudioString11[] = "ERR:SLOW DMA BUSY\n"; +char loadAudioString12[] = "Check %d bank %d\n"; +char loadAudioString13[] = "Cache Check\n"; +char loadAudioString14[] = "NO BANK ERROR\n"; +char loadAudioString15[] = "BANK %d LOADING START\n"; +char loadAudioString16[] = "BANK %d LOAD MISS (NO MEMORY)!\n"; +char loadAudioString17[] = "BANK %d ALREADY CACHED\n"; +char loadAudioString18[] = "BANK LOAD MISS! FOR %d\n"; +char loadAudioString19[] = "Seq %d Loading Start\n"; +char loadAudioString20[] = "Heap Overflow Error\n"; +char loadAudioString21[] = "SEQ %d ALREADY CACHED\n"; +char loadAudioString22[] = "Ok,one bank slow load Start \n"; +char loadAudioString23[] = "Sorry,too many %d bank is none.fast load Start \n"; +char loadAudioString24[] = "Seq %d:Default Load Id is %d\n"; +char loadAudioString25[] = "Seq Loading Start\n"; +char loadAudioString26[] = "Error:Before Sequence-SlowDma remain.\n"; +char loadAudioString27[] = " Cancel Seq Start.\n"; +char loadAudioString28[] = "SEQ %d ALREADY CACHED\n"; +char loadAudioString29[] = "Clear Workarea %x -%x size %x \n"; +char loadAudioString30[] = "AudioHeap is %x\n"; +char loadAudioString31[] = "Heap reset.Synth Change %x \n"; +char loadAudioString32[] = "Heap %x %x %x\n"; +char loadAudioString33[] = "Main Heap Initialize.\n"; +char loadAudioString34[] = "---------- Init Completed. ------------\n"; +char loadAudioString35[] = " Syndrv :[%6d]\n"; +char loadAudioString36[] = " Seqdrv :[%6d]\n"; +char loadAudioString37[] = " audiodata :[%6d]\n"; +char loadAudioString38[] = "---------------------------------------\n"; + +/** * Performs an immediate DMA copy */ void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes) { - eu_stubbed_printf_3("Romcopy %x -> %x ,size %x\n", devAddr, vAddr, nbytes); + // eu_stubbed_printf_3("Romcopy %x -> %x ,size %x\n", devAddr, vAddr, nbytes); osInvalDCache(vAddr, nbytes); osPiStartDma(&D_803B6740, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes, &D_803B6720); osRecvMesg(&D_803B6720, NULL, OS_MESG_BLOCK); - eu_stubbed_printf_0("Romcopyend\n"); + // eu_stubbed_printf_0("Romcopyend\n"); } -const char audioString34[] = "CAUTION:WAVE CACHE FULL %d"; -const char audioString35[] = "LOAD Rom :%x -> Ram :%x Len:%x\n"; -const char audioString36[] = "BASE %x %x\n"; -const char audioString37[] = "LOAD %x %x %x\n"; -const char audioString38[] = "INSTTOP %x\n"; -const char audioString39[] = "INSTMAP[0] %x\n"; -const char audioString40[] = "already flags %d\n"; -const char audioString41[] = "already flags %d\n"; -const char audioString42[] = "ERR:SLOW BANK DMA BUSY\n"; -const char audioString43[] = "ERR:SLOW DMA BUSY\n"; -const char audioString44[] = "Check %d bank %d\n"; -const char audioString45[] = "Cache Check\n"; -const char audioString46[] = "NO BANK ERROR\n"; -const char audioString47[] = "BANK %d LOADING START\n"; -const char audioString48[] = "BANK %d LOAD MISS (NO MEMORY)!\n"; -const char audioString49[] = "BANK %d ALREADY CACHED\n"; -const char audioString50[] = "BANK LOAD MISS! FOR %d\n"; - - -const char audioString51[] = "Seq %d Loading Start\n"; - -const char audioString52[] = "Heap Overflow Error\n"; - -const char asdf[] = "SEQ %d ALREADY CACHED\n"; -const char fdsa[] = "Ok,one bank slow load Start \n"; -const char af[] = "Sorry,too many %d bank is none.fast load Start \n"; - - - /** * Performs an asynchronus (normal priority) DMA copy */ diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 5a8f7da4e..f6dec69ec 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -49,8 +49,17 @@ f32 gLeftVolRampings; //f32 *gCurrentLeftVolRamping; // Points to any of the three left buffers above //f32 *gCurrentRightVolRamping; // Points to any of the three right buffers above -u8 audioString1[] = "pitch %x: delaybytes %d : olddelay %d\n"; -u8 audioString2[] = "cont %x: delaybytes %d : olddelay %d\n"; +/** + * Given that (almost) all of these are format strings, it is highly likely + * that they are meant to be used in some sort of printf variant. But I don't + * care to try and figure out which function gets which string(s) + * So I've place them all here instead. +**/ +char synthesisAudioString0[] = "Terminate-Canceled Channel %d,Phase %d\n"; +char synthesisAudioString1[] = "Copy %d\n"; +char synthesisAudioString2[] = "%d->%d\n"; +char synthesisAudioString3[] = "pitch %x: delaybytes %d : olddelay %d\n"; +char synthesisAudioString4[] = "cont %x: delaybytes %d : olddelay %d\n"; // Equivalent functionality as the US/JP version, // just that the reverb structure is chosen from an array with index diff --git a/src/camera.c b/src/camera.c index 7ea44085c..7c58c759e 100644 --- a/src/camera.c +++ b/src/camera.c @@ -8,6 +8,9 @@ #include "waypoints.h" #include "variables.h" #include "code_8001F980.h" +#include "code_802AAA70.h" + +f32 D_800DDB30[] = { 0.4f, 0.6f, 0.275f, 0.3f }; Camera cameras[4]; Camera *camera1 = &cameras[0]; diff --git a/src/camera.h b/src/camera.h index d29827c2e..e33fffa3a 100644 --- a/src/camera.h +++ b/src/camera.h @@ -67,6 +67,8 @@ extern f32 D_80164A30; extern f32 D_80164A90[]; extern f32 D_80164AA0[]; +extern f32 D_800DDB30[]; + extern Camera cameras[]; extern Camera *camera1; extern Camera *camera2; diff --git a/src/code_80004740.c b/src/code_80004740.c index e1253219d..ea3053463 100644 --- a/src/code_80004740.c +++ b/src/code_80004740.c @@ -6,6 +6,11 @@ #include "code_80004740.h" #include "memory.h" +Vec3s D_80162D70; +s16 D_80162D76; +s16 D_80162D78; +s16 D_80162D7A; + void func_80004740(Mtx *dest, Mat4 src) { #ifdef AVOID_UB // Avoid type-casting which is technically UB by calling the equivalent diff --git a/src/code_80005FD0.c b/src/code_80005FD0.c index 8b57eb2fc..d9b214fce 100644 --- a/src/code_80005FD0.c +++ b/src/code_80005FD0.c @@ -10,6 +10,7 @@ #include "code_8001F980.h" #include "code_80027D00.h" #include "code_80071F00.h" +#include "code_802AAA70.h" #include "variables.h" #include <actor_types.h> #include "vehicles.h" diff --git a/src/code_80027D00.c b/src/code_80027D00.c index 4f25f277f..1332993df 100644 --- a/src/code_80027D00.c +++ b/src/code_80027D00.c @@ -8,9 +8,316 @@ #include "code_8001F980.h" #include "code_80027D00.h" #include "code_8008C1D0.h" +#include "code_802AAA70.h" #include "waypoints.h" #include "audio/external.h" +s16 D_800E3810[] = { + 1, 2, 3, 4, 5, 6, 7, 0 +}; + +s16 D_800E3820[] = { + 0, 2, 3, 4, 5, 6, 7, 0 +}; + +s16 D_800E3830[] = { + 0, 1, 3, 4, 5, 6, 7, 0 +}; + +s16 D_800E3840[] = { + 0, 1, 2, 4, 5, 6, 7, 0 +}; + +s16 D_800E3850[] = { + 0, 1, 2, 3, 5, 6, 7, 0 +}; + +s16 D_800E3860[] = { + 0, 1, 2, 3, 4, 6, 7, 0 +}; + +s16 D_800E3870[] = { + 0, 1, 2, 3, 4, 5, 7, 0 +}; + +s16 D_800E3880[] = { + 0, 1, 2, 3, 4, 5, 6, 0 +}; + +s16 *D_800E3890[] = { + D_800E3810, D_800E3820, D_800E3830, D_800E3840, + D_800E3850, D_800E3860, D_800E3870, D_800E3880 +}; + +s16 D_800E38B0[] = { + 2, 3, 4, 5, 6, 7 +}; + +s16 D_800E38BC[] = { + 1, 3, 4, 5, 6, 7 +}; + +s16 D_800E38C8[] = { + 1, 2, 4, 5, 6, 7 +}; + +s16 D_800E38D4[] = { + 1, 2, 3, 5, 6, 7 +}; + +s16 D_800E38E0[] = { + 1, 2, 3, 4, 6, 7 +}; + +s16 D_800E38EC[] = { + 1, 2, 3, 4, 5, 7 +}; + +s16 D_800E38F8[] = { + 1, 2, 3, 4, 5, 6 +}; + +s16 D_800E3904[] = { + 2, 3, 4, 5, 6, 7 +}; + +s16 D_800E3910[] = { + 0, 3, 4, 5, 6, 7 +}; + +s16 D_800E391C[] = { + 0, 2, 4, 5, 6, 7 +}; + +s16 D_800E3928[] = { + 0, 2, 3, 5, 6, 7 +}; + +s16 D_800E3934[] = { + 0, 2, 3, 4, 6, 7 +}; + +s16 D_800E3940[] = { + 0, 2, 3, 4, 5, 7 +}; + +s16 D_800E394C[] = { + 0, 2, 3, 4, 5, 6 +}; + +s16 D_800E3958[] = { + 1, 3, 4, 5, 6, 7 +}; + +s16 D_800E3964[] = { + 0, 3, 4, 5, 6, 7 +}; + +s16 D_800E3970[] = { + 0, 1, 4, 5, 6, 7 +}; + +s16 D_800E397C[] = { + 0, 1, 3, 5, 6, 7 +}; + +s16 D_800E3988[] = { + 0, 1, 3, 4, 6, 7 +}; + +s16 D_800E3994[] = { + 0, 1, 3, 4, 5, 7 +}; + +s16 D_800E39A0[] = { + 0, 1, 3, 4, 5, 6 +}; + +s16 D_800E39AC[] = { + 1, 2, 4, 5, 6, 7 +}; + +s16 D_800E39B8[] = { + 0, 2, 4, 5, 6, 7 +}; + +s16 D_800E39C4[] = { + 0, 1, 4, 5, 6, 7 +}; + +s16 D_800E39D0[] = { + 0, 1, 2, 5, 6, 7 +}; + +s16 D_800E39DC[] = { + 0, 1, 2, 4, 6, 7 +}; + +s16 D_800E39E8[] = { + 0, 1, 2, 4, 5, 7 +}; + +s16 D_800E39F4[] = { + 0, 1, 2, 4, 5, 6 +}; + +s16 D_800E3A00[] = { + 1, 2, 3, 5, 6, 7 +}; + +s16 D_800E3A0C[] = { + 0, 2, 3, 5, 6, 7 +}; + +s16 D_800E3A18[] = { + 0, 1, 3, 5, 6, 7 +}; + +s16 D_800E3A24[] = { + 0, 1, 2, 5, 6, 7 +}; + +s16 D_800E3A30[] = { + 0, 1, 2, 3, 6, 7 +}; + +s16 D_800E3A3C[] = { + 0, 1, 2, 3, 5, 7 +}; + +s16 D_800E3A48[] = { + 0, 1, 2, 3, 5, 6 +}; + +s16 D_800E3A54[] = { + 1, 2, 3, 4, 6, 7 +}; + +s16 D_800E3A60[] = { + 0, 2, 3, 4, 6, 7 +}; + +s16 D_800E3A6C[] = { + 0, 1, 3, 4, 6, 7 +}; + +s16 D_800E3A78[] = { + 0, 1, 2, 3, 6, 7 +}; + +s16 D_800E3A84[] = { + 0, 1, 2, 4, 6, 7 +}; + +s16 D_800E3A90[] = { + 0, 1, 2, 3, 4, 7 +}; + +s16 D_800E3A9C[] = { + 0, 1, 2, 3, 4, 6 +}; + +s16 D_800E3AA8[] = { + 1, 2, 3, 4, 5, 7 +}; + +s16 D_800E3AB4[] = { + 0, 2, 3, 4, 5, 7 +}; + +s16 D_800E3AC0[] = { + 0, 1, 3, 4, 5, 7 +}; + +s16 D_800E3ACC[] = { + 0, 1, 2, 3, 5, 7 +}; + +s16 D_800E3AD8[] = { + 0, 1, 2, 3, 4, 7 +}; + +s16 D_800E3AE4[] = { + 0, 1, 2, 4, 5, 7 +}; + +s16 D_800E3AF0[] = { + 0, 1, 2, 3, 4, 5 +}; + +s16 D_800E3AFC[] = { + 1, 2, 3, 4, 5, 6 +}; + +s16 D_800E3B08[] = { + 0, 2, 3, 4, 5, 6 +}; + +s16 D_800E3B14[] = { + 0, 1, 3, 4, 5, 6 +}; + +s16 D_800E3B20[] = { + 0, 1, 2, 3, 5, 6 +}; + +s16 D_800E3B2C[] = { + 0, 1, 2, 3, 4, 6 +}; + +s16 D_800E3B38[] = { + 0, 1, 2, 4, 5, 6 +}; + +s16 D_800E3B44[] = { + 0, 1, 2, 3, 4, 5 +}; + +s16 *D_800E3B50[] = { + D_800E38B0, D_800E38B0, D_800E38BC, D_800E38C8, + D_800E38D4, D_800E38E0, D_800E38EC, D_800E38F8 +}; + +s16 *D_800E3B70[] = { + D_800E3904, D_800E3904, D_800E3910, D_800E391C, + D_800E3928, D_800E3934, D_800E3940, D_800E394C +}; + +s16 *D_800E3B90[] = { + D_800E3958, D_800E3964, D_800E3964, D_800E3970, + D_800E397C, D_800E3988, D_800E3994, D_800E39A0 +}; + +s16 *D_800E3BB0[] = { + D_800E39AC, D_800E39B8, D_800E39C4, D_800E39C4, + D_800E39D0, D_800E39DC, D_800E39E8, D_800E39F4 +}; + +s16 *D_800E3BD0[] = { + D_800E3A00, D_800E3A0C, D_800E3A18, D_800E3A24, + D_800E3A24, D_800E3A30, D_800E3A3C, D_800E3A48 +}; + +s16 *D_800E3BF0[] = { + D_800E3A54, D_800E3A60, D_800E3A6C, D_800E3A84, + D_800E3A78, D_800E3A78, D_800E3A90, D_800E3A9C +}; + +s16 *D_800E3C10[] = { + D_800E3AA8, D_800E3AB4, D_800E3AC0, D_800E3AE4, + D_800E3ACC, D_800E3AD8, D_800E3ACC, D_800E3AF0 +}; + +s16 *D_800E3C30[] = { + D_800E3AFC, D_800E3B08, D_800E3B14, D_800E3B38, + D_800E3B20, D_800E3B2C, D_800E3B44, D_800E3B44 +}; + +s16 **D_800E3C50[] = { + D_800E3B50, D_800E3B70, D_800E3B90, D_800E3BB0, + D_800E3BD0, D_800E3BF0, D_800E3C10, D_800E3C30 +}; + // func_80027D00 s32 get_player_index_for_player(Player *player) { s32 index; @@ -1360,26 +1667,26 @@ void func_8002AB70(Player *player) { } if ((player->unk_0BC & 0x100000) == 0x100000) { move_f32_towards(&player->unk_DAC, 20.0f, 1.0f); - player->kartGravity = D_800ED7B8; + player->kartGravity = 3500.0f; } if ((player->unk_0BC & 4) == 4) { move_f32_towards(&player->unk_DAC, 25.0f, 1.0f); player->kartGravity = 1800.0f; } if ((player->unk_0BC & 0x400) == 0x400) { - player->kartGravity = D_800ED7BC; + player->kartGravity = 1100.0f; } if (player->unk_0BC & 0x80000) { - player->kartGravity = D_800ED7C0; + player->kartGravity = 1500.0f; } if ((player->unk_044 & 0x800) != 0) { - player->kartGravity = D_800ED7C4; + player->kartGravity = 1900.0f; } if ((player->unk_0BC & 0x800000) == 0x800000) { player->kartGravity = 300.0f; } if ((player->unk_0BC & 0x01000000) == 0x01000000) { - player->kartGravity = D_800ED7C8; + player->kartGravity = 550.0f; } if ((player->unk_0BC & 0x02000000) == 0x02000000) { player->kartGravity = 800.0f; @@ -1479,12 +1786,6 @@ void func_8002AE38(Player *player, s8 arg1, f32 arg2, f32 arg3, f32 arg4, f32 ar } } -#ifdef NEEDS_RODATA -//data_0DD0A0_2.s -// Might be plain data? -extern u16 D_800E3C70[10];// = { 0x0003, 0x0016, 0x0026, 0x003c, 0x0050, 0x0069, 0x0090, 0x009d, 0x00a9, 0x00cc }; -extern u16 D_800E3C84[10];// = { 0x000c, 0x0021, 0x002f, 0x0045, 0x005f, 0x007a, 0x0098, 0x00a5, 0x00b3, 0x00d5 }; - void func_8002B218(Player *player) { u16 someIndex; u16 sp38[10] = { 0x0003, 0x0016, 0x0026, 0x003c, 0x0050, 0x0069, 0x0090, 0x009d, 0x00a9, 0x00cc }; @@ -1504,9 +1805,6 @@ void func_8002B218(Player *player) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002B218.s") -#endif void func_8002B308(Player *player, s8 arg1, s8 arg2) { if ((player->statusEffects & 2) == 2) { @@ -1745,12 +2043,7 @@ void func_8002BB9C(Player *player, f32 *arg1, f32 *arg2, f32 *arg3) { #else GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002BB9C.s") #endif - -#ifdef NEEDS_RODATA -// data_0DD0A0_2.s -// extern s32 D_800E3CAC; -// extern s32 D_800E3CC8; - + 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 }; @@ -1779,9 +2072,6 @@ void func_8002BD58(Player *player) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002BD58.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit b7eac665cffd02361f73cec283ef16d0a35a0e5b @@ -3334,20 +3624,6 @@ void func_8002FCA8(Player *player, s8 arg1) { player->unk_208 = player->unk_088 - var_f12; } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f64 D_800ED8D8;// = 1.1; -extern f64 D_800ED8E0;// = 1.1; -extern f64 D_800ED8E8;// = 1.0125; -extern f64 D_800ED8F0;// = 1.2; -extern f64 D_800ED8F8;// = 1.025; -extern f64 D_800ED900;// = 1.2; -extern f64 D_800ED908;// = 0.7; -extern f64 D_800ED910;// = 0.7; -extern f64 D_800ED918;// = 0.004; -extern f64 D_800ED920;// = 0.004; -extern f64 D_800ED928;// = 0.7; - void func_8002FE84(Player *player, f32 arg1) { f32 temp_f0_3; f32 var_f0; @@ -3393,27 +3669,6 @@ void func_8002FE84(Player *player, f32 arg1) { player->unk_098 = (temp_f0_3 * temp_f0_3) / 25.0f; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8002FE84.s") -#endif - -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f64 D_800ED940;// = -0.2 -extern f64 D_800ED948;// = -0.55 -extern f64 D_800ED950;// = 0.004 -extern f64 D_800ED958;// = 0.004 -extern f64 D_800ED960;// = 0.01 -extern f64 D_800ED968;// = 0.01 -extern f64 D_800ED970;// = 0.008 -extern f64 D_800ED978;// = 0.008 -extern f64 D_800ED980;// = 0.3 -extern f64 D_800ED988;// = 0.15 -extern f64 D_800ED990;// = 0.05 -extern f64 D_800ED998;// = 0.04 -extern f64 D_800ED9A0;// = -0.85 -extern f64 D_800ED9A8;// = -0.55 -extern f64 D_800ED9B0;// = 0.05 f32 func_80030150(Player *player, s8 arg1) { f32 var_f0; @@ -3427,8 +3682,10 @@ f32 func_80030150(Player *player, s8 arg1) { if ((player->unk_0BC & 0x200) != 0x200) { if ((s32) player->boundingBoxCorners[3].surfaceType >= 0xF) { // ??????? - } else + if(1) {} + } else { var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[3].surfaceType]; + } if ((s32) player->boundingBoxCorners[2].surfaceType < 0xF) var_f0 += D_800E2E90[player->characterId][player->boundingBoxCorners[2].surfaceType]; @@ -3542,20 +3799,7 @@ f32 func_80030150(Player *player, s8 arg1) { func_8002FE84(player, var_f2); return (1.0f - player->unk_104) * var_f2; } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80030150.s") -#endif -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f32 D_800ED9B8// = 0.35f; -extern f32 D_800ED9BC// = 0.55f; -extern f32 D_800ED9C0// = 0.94f; -extern f32 D_800ED9C4// = 0.85f; -extern f32 D_800ED9C8// = 0.46f; -extern f32 D_800ED9CC// = 0.48f; -extern f32 D_800ED9D0// = 0.3f; -extern f32 D_800ED9D4// = 0.54f; void func_80030A34(Player *player) { f32 var_f0; f32 var_f2; @@ -3604,9 +3848,6 @@ void func_80030A34(Player *player) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80030A34.s") -#endif // This is likely the function responsible for detecting triple-tap "A" for "fast" acceleration void func_80030C34(Player *player) { @@ -3738,77 +3979,70 @@ player->unk_214 is possibly the max-acceleration allowed No speculation on what player->unk_0C4 could be */ void func_80030FC8(Player *player) { - f64 some_multiplier; s32 player_index; player_index = get_player_index_for_player(player); if (D_80165460[player_index] == 0) { - if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800ED9D8))) { - some_multiplier = D_800ED9E0; - player->unk_09C += gKartAccelerationTables[player->characterId][0] + (some_multiplier * (player->unk_0C4 / 182)); + if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.1))) { + player->unk_09C += gKartAccelerationTables[player->characterId][0] + (0.05 * (player->unk_0C4 / 182)); } - some_multiplier = D_800ED9E8; - if (((player->unk_214 * D_800ED9F0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800ED9F8))) { - player->unk_09C += gKartAccelerationTables[player->characterId][1] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.1) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.2))) { + player->unk_09C += gKartAccelerationTables[player->characterId][1] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA00) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA08))) { - player->unk_09C += gKartAccelerationTables[player->characterId][2] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.2) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.3))) { + player->unk_09C += gKartAccelerationTables[player->characterId][2] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA10) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA18))) { - player->unk_09C += gKartAccelerationTables[player->characterId][3] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.3) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.4))) { + player->unk_09C += gKartAccelerationTables[player->characterId][3] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA20) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5 ))) { - player->unk_09C += gKartAccelerationTables[player->characterId][4] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.4) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5))) { + player->unk_09C += gKartAccelerationTables[player->characterId][4] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA28))) { - player->unk_09C += gKartAccelerationTables[player->characterId][5] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.6))) { + player->unk_09C += gKartAccelerationTables[player->characterId][5] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA30) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA38))) { - player->unk_09C += gKartAccelerationTables[player->characterId][6] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.6) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.7))) { + player->unk_09C += gKartAccelerationTables[player->characterId][6] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA40) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA48))) { - player->unk_09C += gKartAccelerationTables[player->characterId][7] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.7) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.8))) { + player->unk_09C += gKartAccelerationTables[player->characterId][7] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA50) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA58))) { - player->unk_09C += gKartAccelerationTables[player->characterId][8] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.8) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.9))) { + player->unk_09C += gKartAccelerationTables[player->characterId][8] + (0.05 * (player->unk_0C4 / 182)); } - if (((player->unk_214 * D_800EDA60) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0 ))) { - player->unk_09C += gKartAccelerationTables[player->characterId][9] + (some_multiplier * (player->unk_0C4 / 182)); + if (((player->unk_214 * 0.9) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0))) { + player->unk_09C += gKartAccelerationTables[player->characterId][9] + (0.05 * (player->unk_0C4 / 182)); } } else { - if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA68))) { - some_multiplier = D_800EDA70; - player->unk_09C += (gKartAccelerationTables[player->characterId][0] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.1))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][0] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - some_multiplier = D_800EDA78; - if (((player->unk_214 * D_800EDA80) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA88))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][1] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.1) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.2))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][1] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDA90) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDA98))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][2] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.2) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.3))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][2] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAA0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDAA8))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][3] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.3) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.4))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][3] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAB0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5 ))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][4] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.4) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][4] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDAB8))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][5] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.6))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][5] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAC0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDAC8))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][6] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.6) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.7))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][6] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAD0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDAD8))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][7] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.7) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.8))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][7] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAE0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDAE8))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][8] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; - // Only here to satisfy the compiler gods, may they bless us with byte-for-byte matches - if (1) { } if (1) { } if (1) { } if (1) { } if (1) { } + if (((player->unk_214 * 0.8) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.9))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][8] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } - if (((player->unk_214 * D_800EDAF0) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0 ))) { - player->unk_09C += (gKartAccelerationTables[player->characterId][9] + (some_multiplier * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; + if (((player->unk_214 * 0.9) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0))) { + player->unk_09C += (gKartAccelerationTables[player->characterId][9] + (0.05 * (player->unk_0C4 / 182))) * gKartTable800E36B0[player->characterId]; } } if (player->unk_09C < 0.0f) { @@ -3835,7 +4069,7 @@ void func_80031F48(Player *player, f32 arg1) { if (player->unk_09C <= 0.0f) { player->unk_09C = 0.0f; } - if (player->unk_094 < D_800EDAF8) { + if (player->unk_094 < 0.2) { player->unk_08C = 0.0f; } if (player->unk_214 <= player->unk_09C) { @@ -3973,10 +4207,6 @@ void func_8003221C(Player *player) { } } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f64 D_800EDB00;// = 0.02; -extern f64 D_800EDB08;// = 1.2; void func_800323E4(Player *player) { s32 var_v1; f32 test; @@ -4046,31 +4276,6 @@ void func_800323E4(Player *player) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800323E4.s") -#endif - -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f64 D_800EDB10// = 0.1; -extern f64 D_800EDB18// = 0.1; -extern f64 D_800EDB20// = 0.2; -extern f64 D_800EDB28// = 0.2; -extern f64 D_800EDB30// = 0.3; -extern f64 D_800EDB38// = 0.3; -extern f64 D_800EDB40// = 0.4; -extern f64 D_800EDB48// = 0.4; -extern f64 D_800EDB50// = 0.6; -extern f64 D_800EDB58// = 0.6; -extern f64 D_800EDB60// = 0.7; -extern f64 D_800EDB68// = 0.7; -extern f64 D_800EDB70// = 0.8; -extern f64 D_800EDB78// = 0.8; -extern f64 D_800EDB80// = 0.9; -extern f64 D_800EDB88// = 0.9; -extern f32 D_800EDB90// = 0.9; -extern s16 D_801656F0; -extern s32 gRaceFrameCounter; void func_80032700(Player *player) { s32 temp_v0; @@ -4127,69 +4332,59 @@ void func_80032700(Player *player) { player->unk_044 |= 0x20; player->unk_098 = (player->unk_09C * player->unk_09C) / 25.0f; } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80032700.s") -#endif void func_80032CB0(Player *player, f32 arg1) { player->unk_09C -= arg1; if (player->unk_09C <= 0.0f) { player->unk_09C = 0.0f; } - if (player->unk_094 < D_800EDB98) { + if (player->unk_094 < 0.2) { player->unk_08C = 0.0f; } if (player->unk_214 <= player->unk_09C) { player->unk_09C = player->unk_214; } - if ((f64) player->unk_09C <= (player->unk_214 * D_800EDBA0)) { - player->statusEffects &= 0xEFFFFFFF; + if ((f64) player->unk_09C <= (player->unk_214 * 0.7)) { + player->statusEffects &= ~0x10000000; } - player->statusEffects &= 0xFDFFFFFF; - player->unk_044 &= 0xFFDF; + player->statusEffects &= ~0x02000000; + player->unk_044 &= ~0x0020; player->unk_098 = (player->unk_09C * player->unk_09C) / 25.0f; } void func_80032D94(Player *player) { - f64 some_multiplier; UNUSED s32 player_index; player_index = get_player_index_for_player(player); - if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDBA8))) { - some_multiplier = D_800EDBB0; - player->unk_09C += gKartAccelerationTables[player->characterId][0] * some_multiplier; + if ((0.0 <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.1))) { + player->unk_09C += gKartAccelerationTables[player->characterId][0] * 3.2; } - some_multiplier = D_800EDBB8; - if (((player->unk_214 * D_800EDBC0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDBC8))) { - player->unk_09C += gKartAccelerationTables[player->characterId][1] * some_multiplier; + if (((player->unk_214 * 0.1) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.2))) { + player->unk_09C += gKartAccelerationTables[player->characterId][1] * 3.2; } - if (((player->unk_214 * D_800EDBD0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDBD8))) { - player->unk_09C += gKartAccelerationTables[player->characterId][2] * some_multiplier; + if (((player->unk_214 * 0.2) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.3))) { + player->unk_09C += gKartAccelerationTables[player->characterId][2] * 3.2; } - if (((player->unk_214 * D_800EDBE0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDBE8))) { - player->unk_09C += gKartAccelerationTables[player->characterId][3] * some_multiplier; - if (1) { } if (1) { } if (1) { } if (1) { } if (1) { } + if (((player->unk_214 * 0.3) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.4))) { + player->unk_09C += gKartAccelerationTables[player->characterId][3] * 3.2; } - if (((player->unk_214 * D_800EDBF0) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5 ))) { - player->unk_09C += gKartAccelerationTables[player->characterId][4] * some_multiplier; - if (1) { } if (1) { } if (1) { } if (1) { } if (1) { } + if (((player->unk_214 * 0.4) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.5))) { + player->unk_09C += gKartAccelerationTables[player->characterId][4] * 3.2; } - if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDBF8))) { - player->unk_09C += gKartAccelerationTables[player->characterId][5] * some_multiplier; + if (((player->unk_214 * 0.5) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.6))) { + player->unk_09C += gKartAccelerationTables[player->characterId][5] * 3.2; } - if (((player->unk_214 * D_800EDC00) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDC08))) { - player->unk_09C += gKartAccelerationTables[player->characterId][6] * some_multiplier; + if (((player->unk_214 * 0.6) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.7))) { + player->unk_09C += gKartAccelerationTables[player->characterId][6] * 3.2; } - if (((player->unk_214 * D_800EDC10) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDC18))) { - some_multiplier = D_800EDC20; - player->unk_09C += gKartAccelerationTables[player->characterId][7] * some_multiplier; + if (((player->unk_214 * 0.7) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.8))) { + player->unk_09C += gKartAccelerationTables[player->characterId][7] * 2.8; } - some_multiplier = D_800EDC28; - if (((player->unk_214 * D_800EDC30) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * D_800EDC38))) { - player->unk_09C += gKartAccelerationTables[player->characterId][8] * some_multiplier; + if (((player->unk_214 * 0.8) <= player->unk_09C) && (player->unk_09C < (player->unk_214 * 0.9))) { + player->unk_09C += gKartAccelerationTables[player->characterId][8] * 2.8; } - if (((player->unk_214 * D_800EDC40) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0 ))) { - player->unk_09C += gKartAccelerationTables[player->characterId][9] * some_multiplier; + if (((player->unk_214 * 0.9) <= player->unk_09C) && (player->unk_09C <= (player->unk_214 * 1.0))) { + player->unk_09C += gKartAccelerationTables[player->characterId][9] * 2.8; } if (player->unk_09C < 0.0f) { player->unk_09C = 0.0f; @@ -4208,29 +4403,6 @@ void func_80033280(Player *player, f32 arg1) { player->unk_098 = (player->unk_09C * player->unk_09C) / 25.0f; } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0 -extern f64 D_800EDC48// = 0.1; -extern f64 D_800EDC50// = 3.2; -extern f64 D_800EDC58// = 3.2; -extern f64 D_800EDC60// = 0.1; -extern f64 D_800EDC68// = 0.2; -extern f64 D_800EDC70// = 0.2; -extern f64 D_800EDC78// = 0.3; -extern f64 D_800EDC80// = 0.3; -extern f64 D_800EDC88// = 0.4; -extern f64 D_800EDC90// = 0.4; -extern f64 D_800EDC98// = 0.6; -extern f64 D_800EDCA0// = 0.6; -extern f64 D_800EDCA8// = 0.7; -extern f64 D_800EDCB0// = 0.7; -extern f64 D_800EDCB8// = 0.8; -extern f64 D_800EDCC0// = 2.8; -extern f64 D_800EDCC8// = 2.8; -extern f64 D_800EDCD0// = 0.8; -extern f64 D_800EDCD8// = 0.9; -extern f64 D_800EDCE0// = 0.9; - void func_800332E8(Player *player, s32 arg1) { if ((D_80165280[arg1] >= 0.0) && (D_80165280[arg1] < ((f64) player->unk_214 * 0.1))) { D_80165280[arg1] += gKartAccelerationTables[player->characterId][0] * 3.2; @@ -4268,9 +4440,6 @@ void func_800332E8(Player *player, s32 arg1) { } player->unk_098 = (D_80165280[arg1] * D_80165280[arg1]) / 25.0f; } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800332E8.s") -#endif void func_800337CC(Player *player, f32 arg1, s32 arg2) { player->unk_044 &= ~0x20; @@ -5057,13 +5226,6 @@ block_123: GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80033AE0.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_2.s -extern f32 D_800E4068[0xA8]; -extern f32 D_800E4308[8];// = { 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f, 3.0f }; -// data/data_0DD0A0_3_0_0.s -extern f64 D_800EDD88;// = 0.8; - void func_8003680C(Player *player, s16 arg1) { s32 sp304 = 0; f32 stackPadding0[6]; @@ -5157,9 +5319,6 @@ void func_8003680C(Player *player, s16 arg1) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_8003680C.s") -#endif void func_80036C5C(Player *arg0) { if (((arg0->unk_094 / 18.0f) * 216.0f) > 20.0f) { @@ -5188,16 +5347,6 @@ void func_80036CB4(Player *player) { } } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0.s -extern f64 D_800EDD90;// = 0.02; -extern f64 D_800EDD98;// = 0.01; -extern f64 D_800EDDA0;// = 0.05; -extern f64 D_800EDDA8;// = 0.1; -extern f64 D_800EDDB0;// = 0.15; -extern f64 D_800EDDB8;// = 0.1; -extern f64 D_800EDDC0;// = 0.05; - void func_80036DB4(Player *player, Vec3f arg1, Vec3f arg2) { s16 thing; s16 stackPadding0; @@ -5252,19 +5401,6 @@ void func_80036DB4(Player *player, Vec3f arg1, Vec3f arg2) { arg2[1] = arg1[1]; arg2[2] = arg1[2]; } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_80036DB4.s") -#endif - -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0_0.s -extern f64 D_800EDDC8;// = 0.02; -extern f64 D_800EDDD0;// = 0.01; -extern f64 D_800EDDD8;// = 0.05; -extern f64 D_800EDDE0;// = 0.1; -extern f64 D_800EDDE8;// = 0.15; -extern f64 D_800EDDF0;// = 0.1; -extern f64 D_800EDDF8;// = 0.05; void func_800371F4(Player *player, Vec3f arg1, Vec3f arg2) { s16 var_v0; @@ -5319,9 +5455,6 @@ void func_800371F4(Player *player, Vec3f arg1, Vec3f arg2) { arg2[1] = arg1[1]; arg2[2] = arg1[2]; } -#else -GLOBAL_ASM("asm/non_matchings/code_80027D00/func_800371F4.s") -#endif void func_80037614(Player *player, Vec3f arg1, Vec3f arg2) { f32 var_f12; diff --git a/src/code_80027D00.h b/src/code_80027D00.h index d34b56f2c..f8d898fc7 100644 --- a/src/code_80027D00.h +++ b/src/code_80027D00.h @@ -73,78 +73,87 @@ void func_80038BE4(Player*, s16); /* This is where I'd put my static data, if I had any */ -extern s16 D_80164AF0; -extern Player *D_801653C0[8]; - -extern f32 D_800ED7B8; -extern f32 D_800ED7BC; -extern f32 D_800ED7C0; -extern f32 D_800ED7C4; -extern f32 D_800ED7C8; - -extern f64 D_800ED9D8; -extern f64 D_800ED9E0; -extern f64 D_800ED9E8; -extern f64 D_800ED9F0; -extern f64 D_800ED9F8; -extern f64 D_800EDA00; -extern f64 D_800EDA08; -extern f64 D_800EDA10; -extern f64 D_800EDA18; -extern f64 D_800EDA20; -extern f64 D_800EDA28; -extern f64 D_800EDA30; -extern f64 D_800EDA38; -extern f64 D_800EDA40; -extern f64 D_800EDA48; -extern f64 D_800EDA50; -extern f64 D_800EDA58; -extern f64 D_800EDA60; +extern s16 D_800E3810[]; +extern s16 D_800E3820[]; +extern s16 D_800E3830[]; +extern s16 D_800E3840[]; +extern s16 D_800E3850[]; +extern s16 D_800E3860[]; +extern s16 D_800E3870[]; +extern s16 D_800E3880[]; +extern s16 *D_800E3890[]; -extern f64 D_800EDA68; -extern f64 D_800EDA70; -extern f64 D_800EDA78; -extern f64 D_800EDA80; -extern f64 D_800EDA88; -extern f64 D_800EDA90; -extern f64 D_800EDA98; -extern f64 D_800EDAA0; -extern f64 D_800EDAA8; -extern f64 D_800EDAB0; -extern f64 D_800EDAB8; -extern f64 D_800EDAC0; -extern f64 D_800EDAC8; -extern f64 D_800EDAD0; -extern f64 D_800EDAD8; -extern f64 D_800EDAE0; -extern f64 D_800EDAE8; -extern f64 D_800EDAF0; +extern s16 D_800E38B0[]; +extern s16 D_800E38BC[]; +extern s16 D_800E38C8[]; +extern s16 D_800E38D4[]; +extern s16 D_800E38E0[]; +extern s16 D_800E38EC[]; +extern s16 D_800E38F8[]; +extern s16 D_800E3904[]; +extern s16 D_800E3910[]; +extern s16 D_800E391C[]; +extern s16 D_800E3928[]; +extern s16 D_800E3934[]; +extern s16 D_800E3940[]; +extern s16 D_800E394C[]; +extern s16 D_800E3958[]; +extern s16 D_800E3964[]; +extern s16 D_800E3970[]; +extern s16 D_800E397C[]; +extern s16 D_800E3988[]; +extern s16 D_800E3994[]; +extern s16 D_800E39A0[]; +extern s16 D_800E39AC[]; +extern s16 D_800E39B8[]; +extern s16 D_800E39C4[]; +extern s16 D_800E39D0[]; +extern s16 D_800E39DC[]; +extern s16 D_800E39E8[]; +extern s16 D_800E39F4[]; +extern s16 D_800E3A00[]; +extern s16 D_800E3A0C[]; +extern s16 D_800E3A18[]; +extern s16 D_800E3A24[]; +extern s16 D_800E3A30[]; +extern s16 D_800E3A3C[]; +extern s16 D_800E3A48[]; +extern s16 D_800E3A54[]; +extern s16 D_800E3A60[]; +extern s16 D_800E3A6C[]; +extern s16 D_800E3A78[]; +extern s16 D_800E3A84[]; +extern s16 D_800E3A90[]; +extern s16 D_800E3A9C[]; +extern s16 D_800E3AA8[]; +extern s16 D_800E3AB4[]; +extern s16 D_800E3AC0[]; +extern s16 D_800E3ACC[]; +extern s16 D_800E3AD8[]; +extern s16 D_800E3AE4[]; +extern s16 D_800E3AF0[]; +extern s16 D_800E3AFC[]; +extern s16 D_800E3B08[]; +extern s16 D_800E3B14[]; +extern s16 D_800E3B20[]; +extern s16 D_800E3B2C[]; +extern s16 D_800E3B38[]; +extern s16 D_800E3B44[]; +extern s16 *D_800E3B50[]; +extern s16 *D_800E3B70[]; +extern s16 *D_800E3B90[]; +extern s16 *D_800E3BB0[]; +extern s16 *D_800E3BD0[]; +extern s16 *D_800E3BF0[]; +extern s16 *D_800E3C10[]; +extern s16 *D_800E3C30[]; +extern s16 **D_800E3C50[]; -extern f64 D_800EDAF8; - -extern f64 D_800EDB98; -extern f64 D_800EDBA0; +extern s16 D_80164AF0; +extern Player *D_801653C0[8]; -extern f64 D_800EDBA8; -extern f64 D_800EDBB0; -extern f64 D_800EDBB8; -extern f64 D_800EDBC0; -extern f64 D_800EDBC8; -extern f64 D_800EDBD0; -extern f64 D_800EDBD8; -extern f64 D_800EDBE0; -extern f64 D_800EDBE8; -extern f64 D_800EDBF0; -extern f64 D_800EDBF8; -extern f64 D_800EDC00; -extern f64 D_800EDC08; -extern f64 D_800EDC10; -extern f64 D_800EDC18; -extern f64 D_800EDC20; -extern f64 D_800EDC28; -extern f64 D_800EDC30; -extern f64 D_800EDC38; -extern f64 D_800EDC40; +extern s16 D_801656F0; +extern s32 gRaceFrameCounter; extern struct Controller *gControllerEight; extern struct Controller *gControllerFour; diff --git a/src/code_800431B0.c b/src/code_800431B0.c index 76f3a2046..0432f104d 100644 --- a/src/code_800431B0.c +++ b/src/code_800431B0.c @@ -13,6 +13,7 @@ #include "code_800431B0.h" #include "code_80071F00.h" #include "code_80091750.h" +#include "code_802AAA70.h" #include "main.h" void func_800431B0(Vec3f arg0, Vec3s arg1, f32 arg2, Vtx *vtx) { diff --git a/src/code_80057C60.c b/src/code_80057C60.c index 44678c289..0305e10ae 100644 --- a/src/code_80057C60.c +++ b/src/code_80057C60.c @@ -3049,7 +3049,7 @@ void func_8005D898(Player* player, s16 arg1, UNUSED s32 arg2, UNUSED s8 arg3, UN if (player->unk_22A >= 2) { func_8005D800(&player->unk_258[10 + arg1], 0xFF9600, 0x70); } - + if (player->unk_22A >= 2) { // Why not put this in previous if statement? player->unk_258[10 + arg1].unk_040 = 2; @@ -4091,9 +4091,6 @@ block_19: GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80060504.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f64 D_800EE580;// = 0.1 void func_800608E0(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { f32 var_f0; f32 sp50; @@ -4121,9 +4118,6 @@ void func_800608E0(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { player->unk_258[arg1].unk_000[2] = player->pos[2] + sp48; player->unk_258[arg1].unk_000[1] = player->pos[1] + sp4C; } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800608E0.s") -#endif void func_80060B14(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { if ((gCurrentCourseId != 0x0010) && (gCurrentCourseId != 0x000D)) { @@ -4135,13 +4129,6 @@ void func_80060B14(Player *player, s16 arg1, s32 arg2, s8 arg3, s8 arg4) { } } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f64 D_800EE588;// = -1.8; -extern f64 D_800EE590;// = -1.8; -extern f64 D_800EE598;// = -1.8; -extern f64 D_800EE5A0;// = -1.8; - void func_80060BCC(Player *player, s16 arg1, s32 arg2, s32 arg3) { s32 sp54; s32 stackPadding0; @@ -4177,9 +4164,6 @@ void func_80060BCC(Player *player, s16 arg1, s32 arg2, s32 arg3) { player->unk_258[arg1 + 10].unk_00C = (sp48 + 2.0f) / 10.0f; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80060BCC.s") -#endif void func_80060F50(Player* player, s16 arg1, UNUSED s8 arg2, s8 arg3) { func_8005D794(player, &player->unk_258[arg1], 0.0f, 0.0f, 0.0f, 0, 0); @@ -4191,8 +4175,8 @@ void func_80060F50(Player* player, s16 arg1, UNUSED s8 arg2, s8 arg3) { func_8005D800(&player->unk_258[arg1], 0xFFFFFF, 0xFF); } - player->unk_258[arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[arg1].unk_020) * D_800EE5A8); - player->unk_258[arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[arg1].unk_020) * D_800EE5B0); + player->unk_258[arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[arg1].unk_020) * -5.8); + player->unk_258[arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[arg1].unk_020) * -5.8); player->unk_258[arg1].unk_000[1] = D_801652A0[arg3]; player->unk_0DE &= ~0x0008; } @@ -4250,9 +4234,6 @@ void func_800612F8(Player *player, s32 arg1, s32 arg2, s32 arg3) { player->unk_046 &= ~0x0008; } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f64 D_800EE5B8;// = 1.9; void func_80061430(Player *player, s32 arg1, s32 arg2, s32 arg3) { s32 var_s2; @@ -4272,9 +4253,6 @@ void func_80061430(Player *player, s32 arg1, s32 arg2, s32 arg3) { } player->unk_044 &= ~0x1000; } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80061430.s") -#endif #ifdef NEEDS_RODATA // data_0DD0A0_2.s @@ -4535,10 +4513,6 @@ void func_80062484(Player* player, UnkPlayerStruct258* arg1, s32 arg2) { arg1->unk_01E = 0; } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -// jpt_800EE5C8 - void func_800624D8(Player *player, s32 arg1, s32 arg2, s32 arg3) { s32 var_s1; @@ -4628,16 +4602,13 @@ void func_800624D8(Player *player, s32 arg1, s32 arg2, s32 arg3) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800624D8.s") -#endif void func_800628C0(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_01C = 1; player->unk_258[20 + arg3].unk_020 = -player->unk_02C[1]; player->unk_258[20 + arg3].unk_012 = 2; player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = D_800EE5FC; + player->unk_258[20 + arg3].unk_00C = 0.2f; } void func_80062914(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { @@ -4653,7 +4624,7 @@ void func_80062968(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_020 = -player->unk_02C[1]; player->unk_258[20 + arg3].unk_012 = 5; player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = D_800EE600; + player->unk_258[20 + arg3].unk_00C = 0.2f; } void func_800629BC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { @@ -4661,14 +4632,14 @@ void func_800629BC(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_020 = -player->unk_02C[1]; player->unk_258[20 + arg3].unk_012 = 6; player->unk_258[20 + arg3].unk_01E = 0; - player->unk_258[20 + arg3].unk_00C = D_800EE604; + player->unk_258[20 + arg3].unk_00C = 0.2f; player->unk_258[20 + arg3].unk_000[1] = 0.0f; } void func_80062A18(Player* player, s8 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_01C = 1; player->unk_258[20 + arg3].unk_012 = 3; - player->unk_258[20 + arg1 /* arg1 instead of arg3 */].unk_00C = D_800EE608; + player->unk_258[20 + arg1 /* arg1 instead of arg3 */].unk_00C = 0.2f; player->unk_258[20 + arg3].unk_01E = 1; player->unk_258[20 + arg3].unk_020 = 0; player->unk_0B6 &= ~0x0080; @@ -4680,7 +4651,7 @@ void func_80062A18(Player* player, s8 arg1, UNUSED s8 arg2, s8 arg3) { void func_80062AA8(Player* player, UNUSED s8 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_01C = 1; player->unk_258[20 + arg3].unk_012 = 5; - player->unk_258[20 + arg3].unk_00C = D_800EE60C; + player->unk_258[20 + arg3].unk_00C = 0.1f; player->unk_258[20 + arg3].unk_01E = 0; player->unk_258[20 + arg3].unk_000[1] = (player->pos[1] + player->boundingBoxSize) - 2.5; } @@ -4800,7 +4771,7 @@ void func_80062F98(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { ++player->unk_258[10 + arg1].unk_01E; player->unk_258[10 + arg1].unk_000[1] += temp_f0; if ((player->unk_0CA & 1) == 1) { - player->unk_258[10 + arg1].unk_000[1] += (temp_f0 + D_800EE648); + player->unk_258[10 + arg1].unk_000[1] += (temp_f0 + 0.3); if ((player->unk_258[10 + arg1].unk_01E == 0x10) || ((D_801652A0[arg2] - player->unk_258[10 + arg1].unk_000[1]) < 3.0f)) { player->unk_258[10 + arg1].unk_01C = 0; player->unk_258[10 + arg1].unk_01E = 0; @@ -4815,8 +4786,8 @@ void func_80062F98(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { void func_800630C0(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { ++player->unk_258[arg1].unk_01E; - player->unk_258[arg1].unk_000[2] = player->pos[2] + coss(player->unk_258[arg1].unk_020) * D_800EE650; - player->unk_258[arg1].unk_000[0] = player->pos[0] + sins(player->unk_258[arg1].unk_020) * D_800EE658; + player->unk_258[arg1].unk_000[2] = player->pos[2] + coss(player->unk_258[arg1].unk_020) * -5.8; + player->unk_258[arg1].unk_000[0] = player->pos[0] + sins(player->unk_258[arg1].unk_020) * -5.8; player->unk_258[arg1].unk_000[1] = D_801652A0[arg2]; if (player->unk_258[arg1].unk_01E == 15) { player->unk_258[arg1].unk_01C = 0; @@ -4861,7 +4832,7 @@ void func_80063268(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[arg1].unk_000[0] = player->pos[0] + (sins((player->unk_258[arg1].unk_020 + player->unk_258[arg1].unk_040)) * 5.5); player->unk_258[arg1].unk_000[1] = ((player->pos[1] - 5.0f) + player->unk_258[arg1].unk_024); ++player->unk_258[arg1].unk_01E; - player->unk_258[arg1].unk_00C += D_800EE660; + player->unk_258[arg1].unk_00C += 0.05; player->unk_258[arg1].unk_03E -= 5; if ((s32) player->unk_258[arg1].unk_03E <= 0) { @@ -4898,7 +4869,7 @@ void func_80063408(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[10 + arg1].unk_012 = 0; } - player->unk_258[10 + arg1].unk_00C += D_800EE668; + player->unk_258[10 + arg1].unk_00C += 0.08; if (player->unk_258[10 + arg1].unk_01E >= 4) { player->unk_258[10 + arg1].unk_03E -= 16; } @@ -4932,7 +4903,7 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += D_800EE670; + player->unk_258[10 + arg1].unk_000[1] += 0.2; if (((player->unk_0BC & 0x80) != 0) || ((player->unk_0BC & 0x40) != 0)) { player->unk_258[10 + arg1].unk_01C = 0; player->unk_258[10 + arg1].unk_01E = 0; @@ -4944,7 +4915,7 @@ void func_800635D4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[10 + arg1].unk_012 = 0; } - player->unk_258[10 + arg1].unk_00C += D_800EE678; + player->unk_258[10 + arg1].unk_00C += 0.1; if (player->unk_258[10 + arg1].unk_040 == 0) { if (player->unk_258[10 + arg1].unk_01E >= 4) { player->unk_258[10 + arg1].unk_03E -= 12; @@ -4964,21 +4935,21 @@ 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].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); + player->unk_258[10 + arg1].unk_000[2] = player->boundingBoxCorners[2].cornerPos[2] + (-1.8f * 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] + (-1.8f * 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].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_000[2] = player->boundingBoxCorners[3].cornerPos[2] + (-1.8f * 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] + (-1.8f * 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; + player->unk_258[10 + arg1].unk_000[1] += 0.3; if (player->unk_258[10 + arg1].unk_01E == 8) { player->unk_258[10 + arg1].unk_01C = 0; player->unk_258[10 + arg1].unk_01E = 0; player->unk_258[10 + arg1].unk_012 = 0; } - player->unk_258[10 + arg1].unk_00C += D_800EE698; + player->unk_258[10 + arg1].unk_00C += 0.15; if (player->unk_258[10 + arg1].unk_040 == 0) { if ((s32) player->unk_258[10 + arg1].unk_01E >= 4) { --player->unk_258[10 + arg1].unk_03E; @@ -5007,7 +4978,7 @@ void func_80063BD4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } ++player->unk_258[10 + arg1].unk_01E; - player->unk_258[10 + arg1].unk_000[1] += D_800EE6A0; + player->unk_258[10 + arg1].unk_000[1] += 0.2; if (player->unk_258[10 + arg1].unk_01E == 8) { player->unk_258[10 + arg1].unk_01C = 0; player->unk_258[10 + arg1].unk_01E = 0; @@ -5015,7 +4986,7 @@ void func_80063BD4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { } player->unk_258[10 + arg1].unk_018 = 2.0f; - player->unk_258[10 + arg1].unk_00C -= D_800EE6A8; + player->unk_258[10 + arg1].unk_00C -= 0.06; } void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { @@ -5034,12 +5005,12 @@ void func_80063D58(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[10 + arg1].unk_012 = 0; } - player->unk_258[10 + arg1].unk_00C += D_800EE6B0; + player->unk_258[10 + arg1].unk_00C += 0.2; if (player->unk_258[10 + arg1].unk_01E >= 4) { player->unk_258[10 + arg1].unk_03E -= 18; - player->unk_258[10 + arg1].unk_000[1] -= D_800EE6B8; + player->unk_258[10 + arg1].unk_000[1] -= 0.1; } else { - player->unk_258[10 + arg1].unk_000[1] += D_800EE6C0; + player->unk_258[10 + arg1].unk_000[1] += 0.4; } if (player->unk_258[10 + arg1].unk_03E <= 0) { @@ -5075,7 +5046,7 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { sp40 = D_801652A0[arg2] - player->pos[1] - 3.0f; if (((player->unk_0DE & 1) != 0) && (gCurrentCourseId != COURSE_KOOPA_BEACH)) { - sp40 = D_801652A0[arg2] - player->pos[1] + D_800EE6C8; + sp40 = D_801652A0[arg2] - player->pos[1] + 0.1; } func_80062B18(&sp44, &sp40, &sp3C, 0.0f, sp40, -4.0f + ((-player->unk_258[arg1].unk_01E * (player->unk_094 / 18.0f) * 216.0f) / 10.0f), -player->unk_258[arg1].unk_020, 2 * -player->unk_206); @@ -5089,7 +5060,7 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { player->unk_258[arg1].unk_012 = 0; } player->unk_258[arg1].unk_018 = 2.0f; - player->unk_258[arg1].unk_00C -= D_800EE6D0; + player->unk_258[arg1].unk_00C -= 0.35; if (player->unk_258[arg1].unk_00C < 0.0f) { player->unk_258[arg1].unk_00C = 0.0f; } @@ -5101,8 +5072,8 @@ void func_80064184(Player* player, s16 arg1, s8 arg2, UNUSED s8 arg3) { } void func_800643A8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { - player->unk_258[10 + arg1].unk_000[2] = player->pos[2] + (D_800EE6D8 * player->unk_258[10 + arg1].unk_01E * coss(player->unk_258[10 + arg1].unk_020)); - player->unk_258[10 + arg1].unk_000[0] = player->pos[0] + (D_800EE6E0 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020)); + player->unk_258[10 + arg1].unk_000[2] = player->pos[2] + (-1.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->pos[0] + (-1.2 * player->unk_258[10 + arg1].unk_01E * sins(player->unk_258[10 + arg1].unk_020)); player->unk_258[10 + arg1].unk_000[1] = player->unk_258[10 + arg1].unk_000[1] + 0.5; ++player->unk_258[10 + arg1].unk_01E; @@ -5112,18 +5083,13 @@ void func_800643A8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[10 + arg1].unk_012 = 0; } - player->unk_258[10 + arg1].unk_00C += D_800EE6E8; + player->unk_258[10 + arg1].unk_00C += 0.2; player->unk_258[10 + arg1].unk_03E -= 8; if (player->unk_258[10 + arg1].unk_03E <= 0) { player->unk_258[10 + arg1].unk_03E = 0; } } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f64 D_800EE6F0;// = -0.7; -extern f64 D_800EE6F8;// = 0.2; - void func_800644E8(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 thing2; s32 stackPadding0; @@ -5151,14 +5117,6 @@ void func_800644E8(Player *player, s16 arg1, s32 arg2, s32 arg3) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_800644E8.s") -#endif - -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f64 D_800EE6F0;// = -0.6; -extern f64 D_800EE6F8;// = 0.1; void func_80064664(Player *player, s16 arg1, s32 arg2, s32 arg3) { f32 temp_f4; @@ -5184,15 +5142,12 @@ void func_80064664(Player *player, s16 arg1, s32 arg2, s32 arg3) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_80064664.s") -#endif void func_800647C8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_000[2] = player->pos[2] + ((D_800EE710 * (player->unk_258[30 + arg1].unk_01E)) * coss(player->unk_258[30 + arg1].unk_020)); - player->unk_258[30 + arg1].unk_000[0] = player->pos[0] + ((D_800EE718 * (player->unk_258[30 + arg1].unk_01E)) * sins(player->unk_258[30 + arg1].unk_020)); + player->unk_258[30 + arg1].unk_000[2] = player->pos[2] + ((-0.8 * (player->unk_258[30 + arg1].unk_01E)) * coss(player->unk_258[30 + arg1].unk_020)); + player->unk_258[30 + arg1].unk_000[0] = player->pos[0] + ((-0.8 * (player->unk_258[30 + arg1].unk_01E)) * sins(player->unk_258[30 + arg1].unk_020)); player->unk_258[30 + arg1].unk_000[1] = (player->unk_074 + 2.0f); if (player->unk_258[30 + arg1].unk_01E == 14) { @@ -5209,8 +5164,8 @@ void func_800647C8(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_800648E4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_00C -= D_800EE720; - player->unk_258[30 + arg1].unk_000[1] += D_800EE728; + player->unk_258[30 + arg1].unk_00C -= 0.06; + player->unk_258[30 + arg1].unk_000[1] += 0.1; player->unk_258[30 + arg1].unk_03E -= 12; if (player->unk_258[30 + arg1].unk_03E <= 0) { @@ -5226,7 +5181,7 @@ void func_800648E4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80064988(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { ++player->unk_258[30 + arg1].unk_01E; - player->unk_258[30 + arg1].unk_000[1] -= D_800EE730; + player->unk_258[30 + arg1].unk_000[1] -= 0.3; if (player->unk_258[30 + arg1].unk_01E == 10) { player->unk_258[30 + arg1].unk_01C = 0; @@ -5242,7 +5197,7 @@ void func_800649F4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[30 + arg1].unk_000[2] = player->unk_21C + (((-temp) * player->unk_258[30 + arg1].unk_01E) * coss(player->unk_258[30 + arg1].unk_020)); player->unk_258[30 + arg1].unk_000[0] = player->unk_218 + (((-temp) * player->unk_258[30 + arg1].unk_01E) * sins(player->unk_258[30 + arg1].unk_020)); player->unk_258[30 + arg1].unk_000[1] = player->pos[1] + player->unk_258[30 + arg1].unk_014; - player->unk_258[30 + arg1].unk_00C += D_800EE738; + player->unk_258[30 + arg1].unk_00C += 0.04; ++player->unk_258[30 + arg1].unk_01E; if (player->unk_258[30 + arg1].unk_01E == 12) { @@ -5261,11 +5216,11 @@ void func_800649F4(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { void func_80064B30(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { f32 temp; - temp = player->unk_258[30 + arg1].unk_018 * D_800EE740; + temp = player->unk_258[30 + arg1].unk_018 * 1.2; player->unk_258[30 + arg1].unk_000[2] = (player->pos[2] + (-temp * player->unk_258[30 + arg1].unk_01E) * (coss(player->unk_258[30 + arg1].unk_020))); player->unk_258[30 + arg1].unk_000[0] = (player->pos[0] + (-temp * player->unk_258[30 + arg1].unk_01E) * (sins(player->unk_258[30 + arg1].unk_020))); - player->unk_258[30 + arg1].unk_000[1] += D_800EE748; + player->unk_258[30 + arg1].unk_000[1] += 0.1; ++player->unk_258[30 + arg1].unk_01E; if (player->unk_258[30 + arg1].unk_01E == 10) { @@ -5294,7 +5249,7 @@ void func_80064C74(Player* player, s16 arg1, UNUSED s8 arg2, UNUSED s8 arg3) { player->unk_258[30 + arg1].unk_000[2] = player->pos[2] + (coss(player->unk_258[30 + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); player->unk_258[30 + arg1].unk_000[0] = player->pos[0] + (sins(player->unk_258[30 + arg1].unk_020 - player->unk_02C[1] - player->unk_0C0) * 5.0f); player->unk_258[30 + arg1].unk_000[1] = player->pos[1] - 1.0f; - player->unk_258[30 + arg1].unk_00C += D_800EE750; + player->unk_258[30 + arg1].unk_00C += 0.4; ++player->unk_258[30 + arg1].unk_01E; if (player->unk_258[30 + arg1].unk_01E == 10) { @@ -5322,7 +5277,7 @@ void func_80064DEC(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { player->unk_258[20 + arg3].unk_012 = 0; } - player->unk_258[20 + arg3].unk_00C += D_800EE758; + player->unk_258[20 + arg3].unk_00C += 0.8; if (player->unk_258[20 + arg3].unk_00C >= (f64) 2.5) { player->unk_258[20 + arg3].unk_00C = 2.5f; } @@ -5331,12 +5286,12 @@ void func_80064DEC(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { void func_80064EA4(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { ++player->unk_258[20 + arg3].unk_01E; if (player->unk_258[20 + arg3].unk_01E < 4) { - player->unk_258[20 + arg3].unk_00C += D_800EE760; + player->unk_258[20 + arg3].unk_00C += 1.2; if (player->unk_258[20 + arg3].unk_00C >= 3.5) { player->unk_258[20 + arg3].unk_00C = 3.5f; } } else { - player->unk_258[20 + arg3].unk_00C -= D_800EE768; + player->unk_258[20 + arg3].unk_00C -= 1.8; if (player->unk_258[20 + arg3].unk_00C <= 0.0f) { player->unk_0B6 &= ~0x1000; player->unk_258[20 + arg3].unk_01C = 0; @@ -5348,10 +5303,10 @@ void func_80064EA4(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { void func_80064F88(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { ++player->unk_258[20 + arg3].unk_01E; - player->unk_258[20 + arg3].unk_00C += D_800EE770; + player->unk_258[20 + arg3].unk_00C += 0.15; - if (D_800EE778 <= player->unk_258[20 + arg3].unk_00C) { - player->unk_258[20 + arg3].unk_00C = D_800EE780; + if (1.2 <= player->unk_258[20 + arg3].unk_00C) { + player->unk_258[20 + arg3].unk_00C = 1.2f; } if (player->unk_258[20 + arg3].unk_01E >= 12) { player->unk_0B6 &= ~0x0800; @@ -5364,8 +5319,8 @@ void func_80064F88(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { void func_80065030(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { ++player->unk_258[20 + arg3].unk_01E; - player->unk_258[20 + arg3].unk_000[1] += D_800EE788; - player->unk_258[20 + arg3].unk_00C += D_800EE790; + player->unk_258[20 + arg3].unk_000[1] += 0.8; + player->unk_258[20 + arg3].unk_00C += 0.4; if (player->unk_258[20 + arg3].unk_00C >= (f64) 1.5) { player->unk_258[20 + arg3].unk_00C = 1.5f; } @@ -5387,14 +5342,14 @@ void func_800650FC(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { } else { player->unk_258[20 + arg3].unk_020 -= 4732; } - + if (((player->unk_0BC & 0x80) != 0x80) && ((player->unk_0BC & 0x40) != 0x40)) { player->unk_258[20 + arg3].unk_01C = 0; player->unk_258[20 + arg3].unk_01E = 0; player->unk_258[20 + arg3].unk_012 = 0; } - player->unk_258[20 + arg3].unk_00C += D_800EE798; + player->unk_258[20 + arg3].unk_00C += 0.08; if (player->unk_258[20 + arg3].unk_00C >= 1.5) { player->unk_258[20 + arg3].unk_00C = 1.5f; } @@ -5403,12 +5358,12 @@ void func_800650FC(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { void func_800651F4(Player* player, UNUSED s16 arg1, UNUSED s8 arg2, s8 arg3) { ++player->unk_258[20 + arg3].unk_01E; if (player->unk_258[20 + arg3].unk_01E < 8) { - player->unk_258[20 + arg3].unk_00C += D_800EE7A0; - if (D_800EE7A8 <= player->unk_258[20 + arg3].unk_00C) { - player->unk_258[20 + arg3].unk_00C = D_800EE7B0; + player->unk_258[20 + arg3].unk_00C += 0.2; + if (1.2 <= player->unk_258[20 + arg3].unk_00C) { + player->unk_258[20 + arg3].unk_00C = 1.2f; } } else { - player->unk_258[20 + arg3].unk_00C -= D_800EE7B8; + player->unk_258[20 + arg3].unk_00C -= 0.4; if (player->unk_258[20 + arg3].unk_00C <= 0.0f) { player->unk_0B6 &= ~0x0020; player->unk_258[20 + arg3].unk_01C = 0; @@ -10070,7 +10025,6 @@ void func_8006DC54(Player* player, s8 arg1, s8 arg2) { } } -#ifdef NEEDS_RODATA void func_8006DD3C(Player* arg0, s8 arg1, s8 arg2) { s16 temp_s0; s32 temp_v0; @@ -10111,15 +10065,12 @@ void func_8006DD3C(Player* arg0, s8 arg1, s8 arg2) { break; } if (arg0->unk_258[21].unk_012 == 5) { - func_80067D3C(arg0, arg2, D_8018D480, 1, D_800EE948, 0xFFFFFF); - func_8006801C(arg0, arg2, D_8018D484, 1, D_800EE94C, 0xFF); + func_80067D3C(arg0, arg2, D_8018D480, 1, 1.6f, 0xFFFFFF); + func_8006801C(arg0, arg2, D_8018D484, 1, 1.6f, 0xFF); } } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80057C60/func_8006DD3C.s") -#endif void func_8006E058(void) { switch (gActiveScreenMode) { diff --git a/src/code_80057C60.h b/src/code_80057C60.h index 58b8836c1..d435c1ad6 100644 --- a/src/code_80057C60.h +++ b/src/code_80057C60.h @@ -159,14 +159,14 @@ void func_800658A0(Player*, s8, s16, s8); void func_80066998(Player*, s8, s16, s8); -void func_80067964(Player*, s8, s32, s8, s32); +void func_80067964(Player*, s8, f32, s8, s32); void func_80067D3C(Player*, s8, s32, s32, f32, s32); void func_8006801C(Player*, s8, s32, s32, f32, s32); -void func_80068310(Player*, s8, s32, s8, s32); -void func_80068724(Player*, s8, s32, s8, s32); -void func_80068AA4(Player*, s8, s32, s8, s32); -void func_80068DA0(Player*, s8, s32, s8, s32); +void func_80068310(Player*, s8, f32, s8, s32); +void func_80068724(Player*, s8, f32, s8, s32); +void func_80068AA4(Player*, s8, f32, s8, s32); +void func_80068DA0(Player*, s8, f32, s8, s32); void func_8006A280(Player*, s8, s16, s8); void func_8006A7C0(Player*, f32, f32, s8, s8); @@ -233,62 +233,6 @@ extern struct UnkStruct_800DC5EC *D_800DC5F4; extern struct UnkStruct_800DC5EC *D_800DC5F8; extern u16 D_800DC5FC; -extern f64 D_800EE5A8; -extern f64 D_800EE5B0; -extern f32 D_800EE5FC; -extern f32 D_800EE600; -extern f32 D_800EE604; -extern f32 D_800EE608; -extern f32 D_800EE60C; -extern f64 D_800EE648; -extern f64 D_800EE650; -extern f64 D_800EE658; -extern f64 D_800EE660; -extern f64 D_800EE668; -extern f64 D_800EE670; -extern f64 D_800EE678; -extern f32 D_800EE680; -extern f32 D_800EE684; -extern f32 D_800EE688; -extern f32 D_800EE68C; -extern f64 D_800EE690; -extern f64 D_800EE698; -extern f64 D_800EE6A0; -extern f64 D_800EE6A8; -extern f64 D_800EE6B0; -extern f64 D_800EE6B8; -extern f64 D_800EE6C0; -extern f64 D_800EE6C8; -extern f64 D_800EE6D0; -extern f64 D_800EE6D8; -extern f64 D_800EE6E0; -extern f64 D_800EE6E8; -extern f64 D_800EE700; -extern f64 D_800EE708; -extern f64 D_800EE710; -extern f64 D_800EE718; -extern f64 D_800EE720; -extern f64 D_800EE728; -extern f64 D_800EE730; -extern f64 D_800EE738; -extern f64 D_800EE740; -extern f64 D_800EE748; -extern f64 D_800EE750; -extern f64 D_800EE758; -extern f64 D_800EE760; -extern f64 D_800EE768; -extern f64 D_800EE770; -extern f64 D_800EE778; -extern f32 D_800EE780; -extern f64 D_800EE788; -extern f64 D_800EE790; -extern f64 D_800EE798; -extern f64 D_800EE7A0; -extern f64 D_800EE7A8; -extern f32 D_800EE7B0; -extern f64 D_800EE7B8; -extern f32 D_800EE948; -extern f32 D_800EE94C; extern s32 D_80164394; extern s32 D_80164398; diff --git a/src/code_80071F00.c b/src/code_80071F00.c index cba30a91b..856d2fca4 100644 --- a/src/code_80071F00.c +++ b/src/code_80071F00.c @@ -1453,12 +1453,6 @@ void func_80074FD8(s32 objectIndex) { } } -#ifdef NEEDS_RODATA -extern f64 D_800EEAB0;// = 0.0005; -extern f64 D_800EEAB8;// = 0.05 -extern f64 D_800EEAC0;// = 0.05 -extern f64 D_800EEAC8;// = 0.1 - void func_800750D8(s32 objectIndex, s32 arg1, Vec3f arg2, s32 arg3, s32 arg4) { s32 sp24; s32 temp_v0; @@ -1481,9 +1475,6 @@ void func_800750D8(s32 objectIndex, s32 arg1, Vec3f arg2, s32 arg3, s32 arg4) { temp_v1->unk_0B2[1] = temp_v0 * 0x50; temp_v1->unk_0B2[2] = temp_v0 * 0x50; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_800750D8.s") -#endif void func_80075304(Vec3f arg0, s32 arg1, s32 arg2, s32 arg3) { s32 var_s1; @@ -1593,9 +1584,9 @@ void func_80075714(s32 objectIndex) { func_80075698(objectIndex); break; case 2: - D_80165C18[objectIndex].unk_038[1] -= D_800EEAD0; + D_80165C18[objectIndex].unk_038[1] -= 0.03; f32_step_up_towards(&D_80165C18[objectIndex].unk_028[1], 100.0f, D_80165C18[objectIndex].unk_038[1]); - func_8007415C(objectIndex, &D_80165C18[objectIndex].unk_000, 0.55f, 1.0f, D_800EEAD8, 1, 0); + func_8007415C(objectIndex, &D_80165C18[objectIndex].unk_000, 0.55f, 1.0f, 0.1f, 1, 0); if (func_80073B00(objectIndex, &D_80165C18[objectIndex].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(objectIndex); } @@ -1733,9 +1724,9 @@ void func_80075B84(s32 arg0) { func_80075B08(arg0); break; case 2: - D_80165C18[arg0].unk_038[1] -= D_800EEAE0; + D_80165C18[arg0].unk_038[1] -= 0.03; f32_step_up_towards(&D_80165C18[arg0].unk_028[1], 100.0f, D_80165C18[arg0].unk_038[1]); - func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, D_800EEAE8, 1, 0); + func_8007415C(arg0, &D_80165C18[arg0].unk_000, 0.55f, 1.0f, 0.1f, 1, 0); if (func_80073B00(arg0, &D_80165C18[arg0].unk_0A0, 0xFF, 0x1E, 7, 0, 0) != 0) { func_80072488(arg0); } @@ -1955,9 +1946,6 @@ void func_8007634C(s32 objectIndex) { func_80072488(objectIndex); } -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -// jpt_800EEAEC void func_800763CC(s32 objectIndex) { struct_80165C18_entry *temp_s0; @@ -1995,9 +1983,6 @@ void func_800763CC(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_800763CC.s") -#endif void func_80076538(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { @@ -2139,9 +2124,6 @@ void func_80076958(s32 objectIndex) { func_80072488(objectIndex); } -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -// jpt_800EEB00 void func_800769D8(s32 objectIndex) { struct_80165C18_entry *temp_s0; @@ -2171,9 +2153,6 @@ void func_800769D8(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_800769D8.s") -#endif void func_80076AEC(s32 objectIndex) { s32 thing; @@ -2225,10 +2204,6 @@ void func_80076B84(void) { } } -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f32 D_800EEB14; // = 0.3f; - void func_80076C9C(s32 objectIndex, Vec3f arg1, s16 arg2) { struct_80165C18_entry *temp_v0; @@ -2244,9 +2219,6 @@ void func_80076C9C(s32 objectIndex, Vec3f arg1, s16 arg2) { func_8008B8BC(objectIndex, 0U, 0U, 0U); func_8008B80C(objectIndex, 0.0f, 0.0f, 0.0f); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80076C9C.s") -#endif void func_80076D70(Vec3f arg0, f32 arg1, s16 arg2) { s32 temp_v0; @@ -2468,8 +2440,6 @@ void func_80077450(s32 objectIndex) { } } -#ifdef NEEDS_RODATA - void func_80077584(s32 objectIndex) { struct_80165C18_entry *temp_v0; @@ -2486,9 +2456,6 @@ void func_80077584(s32 objectIndex) { func_80087710(objectIndex); func_8008BF18(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077584.s") -#endif void func_80077640(void) { s32 someIndex; @@ -2510,10 +2477,6 @@ void func_80077640(void) { } } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f32 D_800EEB38;// = 0.1f; - void func_80077700(s32 objectIndex, Vec3f arg1, s32 arg2) { s32 stackPadding1; u16 stackPadding0; @@ -2555,9 +2518,6 @@ void func_80077700(s32 objectIndex, Vec3f arg1, s32 arg2) { func_8008B888(objectIndex, 0U, (arg2 * 0xFFFF) / 20, 0U); func_8008B8BC(objectIndex, temp_s0, sp3E, sp3C); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077700.s") -#endif s32 func_80077A54(Vec3f arg0, s32 arg1) { s32 temp_v0; @@ -2674,10 +2634,6 @@ loop_3: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077D5C.s") #endif -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -extern f32 D_800EEB3C;// = 0.15f; - void func_80077E20(s32 objectIndex) { struct_80165C18_entry *temp_v0; @@ -2696,9 +2652,6 @@ void func_80077E20(s32 objectIndex) { temp_v0->unk_0A4 = 0; func_80072488(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80077E20.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -2841,10 +2794,6 @@ void func_80078170(s32 arg0, ? arg1) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078170.s") #endif -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.x -extern f32 D_800EEB48;// = 0.15f; - void func_80078220(s32 objectIndex) { struct_80165C18_entry *temp_v0; @@ -2856,19 +2805,6 @@ void func_80078220(s32 objectIndex) { func_80086EF0(objectIndex); func_80072488(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078220.s") -#endif - -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f64 D_800EEB50; // = 0.03; -extern f64 D_800EEB58; // = 0.01; -extern f64 D_800EEB60; // = -0.3; -extern f64 D_800EEB68; // = 45.0; -extern f64 D_800EEB70; // = 0.03; -extern f64 D_800EEB78; // = 0.01; -extern f64 D_800EEB80; // = -0.6; void func_80078288(s32 objectIndex) { s16 sp3E; @@ -2924,9 +2860,6 @@ void func_80078288(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80078288.s") -#endif void func_800786EC(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0A6) { /* irregular */ @@ -4728,10 +4661,6 @@ void func_8007BBBC(s32 objectIndex) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BBBC.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f64 D_800EEE08;// -1650.0; - void func_8007BD04(s32 playerId) { s32 objectIndex; @@ -4743,9 +4672,6 @@ void func_8007BD04(s32 playerId) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007BD04.s") -#endif void func_8007BDA8(void) { s32 pad; @@ -5522,15 +5448,6 @@ loop_5: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D070.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f64 D_800EEEE8;// = -1775.0; -extern f64 D_800EEEF0;// = 130.0; -extern f64 D_800EEEF8;// = -2500.0; -extern f64 D_800EEF00;// = 220.0; -extern f64 D_800EEF08;// = -2100.0; -extern f64 D_800EEF10;// = -290.0; - void func_8007D360(s32 objectIndex, s32 arg1) { if (arg1 == 1) { D_80165C18[objectIndex].unk_010[0] = (f32) ((-1775.0 - random_int(0x001EU)) * (f64) D_8018D01C); @@ -5562,13 +5479,6 @@ void func_8007D360(s32 objectIndex, s32 arg1) { D_80165C18[objectIndex].unk_034 = (random_int(4U) + 5.0); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D360.s") -#endif - -#ifdef NEEDS_RODATA -// data/data_0D00A0_3_0.s -extern f32 D_800EEF18; // = 0.1f; void func_8007D6A8(s32 objectIndex, s32 arg1) { s32 stackPadding0; @@ -5582,9 +5492,6 @@ void func_8007D6A8(s32 objectIndex, s32 arg1) { func_800721C0(objectIndex, 0x00000200); temp_v0->unk_0C8 = 3; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D6A8.s") -#endif void func_8007D714(s32 arg0) { s32 var_v0; @@ -5640,13 +5547,6 @@ void func_8007D8AC(s32 arg0) { func_80086E70(arg0); } -#ifdef NEEDS_RODATA - -extern f64 D_800EEF20;// = 2540.0; -extern f64 D_800EEF28;// = -2540.0; -extern f64 D_800EEF30;// = 2150.0; -extern f64 D_800EEF38;// = -2150.0; - void func_8007D8D4(s32 objectIndex, s32 arg1) { switch (D_80165C18[objectIndex].unk_0A6) { case 1: @@ -5678,9 +5578,6 @@ void func_8007D8D4(s32 objectIndex, s32 arg1) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007D8D4.s") -#endif void func_8007DA4C(s32 arg0) { func_8008781C(arg0); @@ -5799,10 +5696,6 @@ block_19: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007DB44.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f32 D_800EEF40;// = 1150.0f; - void func_8007DDC0(s32 objectIndex) { f32 sp2C; struct_80165C18_entry *temp_s0; @@ -5842,9 +5735,6 @@ void func_8007DDC0(s32 objectIndex) { temp_s0->unk_0A4 = 2; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007DDC0.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -6007,10 +5897,6 @@ void func_8007E1F4(s32 objectIndex) { } } -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -extern f32 D_800EEF68;// -1371.0f; - void func_8007E358(s32 objectIndex) { D_80165C18[objectIndex].unk_004[0] = -1371.0f * D_8018D01C; D_80165C18[objectIndex].unk_004[1] = 31.0f; @@ -6021,13 +5907,6 @@ void func_8007E358(s32 objectIndex) { D_80165C18[objectIndex].unk_084[7] = 0; func_80072488(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007E358.s") -#endif - -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -// jpt_800EEF6C void func_8007E3EC(s32 objectIndex) { @@ -6060,9 +5939,6 @@ void func_8007E3EC(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007E3EC.s") -#endif void func_8007E4C4(void) { s32 objectIndex = D_80183EA8; @@ -6392,10 +6268,6 @@ void func_8007EE5C(s32 objectIndex) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007EE5C.s") #endif -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -// jpt_800EEFD0 - void func_8007EFBC(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 1: @@ -6471,13 +6343,6 @@ void func_8007EFBC(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007EFBC.s") -#endif - -#ifdef NEEDS_RODATA -// data/data_0DD0A0_3_0.s -// jpt_800EF018 void func_8007F280(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { @@ -6554,9 +6419,6 @@ void func_8007F280(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8007F280.s") -#endif void func_8007F544(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0DD) { /* irregular */ @@ -7716,10 +7578,6 @@ void func_80081848(s32 objectIndex) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80081848.s") #endif -#ifdef NEEDS_RODATA - -extern f64 D_800EF138;// = 0.184; - void func_80081924(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 1: @@ -7755,9 +7613,6 @@ void func_80081924(s32 objectIndex) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80081924.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -8340,7 +8195,6 @@ block_8: GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80082B34.s") #endif -#ifdef NEEDS_RODATA void func_80082C30(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 1: @@ -8381,9 +8235,6 @@ void func_80082C30(s32 objectIndex) { D_80165C18[objectIndex].unk_004[1] = (f32) (D_80165C18[objectIndex].unk_044 + 2.5); } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80082C30.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -8536,7 +8387,6 @@ void func_8008311C(s32 objectIndex, s32 arg1) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8008311C.s") #endif -#ifdef NEEDS_RODATA void func_80083248(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 0: @@ -8568,9 +8418,6 @@ void func_80083248(s32 objectIndex) { D_80165C18[objectIndex].unk_004[1] = D_80165C18[objectIndex].unk_044 + 6.0; } } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80083248.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -8762,7 +8609,6 @@ void func_80083868(s32 objectIndex) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80083868.s") #endif -#ifdef NEEDS_RODATA void func_80083948(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 1: @@ -8794,9 +8640,6 @@ void func_80083948(s32 objectIndex) { func_80073D0C(objectIndex, &D_80165C18[objectIndex].unk_0A0, -0x00001000, 0x00001000, 0x00000400, 1, -1); D_80165C18[objectIndex].unk_0B2[2] = D_80165C18[objectIndex].unk_0A0 + 0x8000; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80083948.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -9613,7 +9456,6 @@ void func_800853DC(s32 objectIndex) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_800853DC.s") #endif -#ifdef NEEDS_RODATA void func_80085534(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 1: @@ -9664,9 +9506,6 @@ void func_80085534(s32 objectIndex) { func_800877C4(objectIndex); D_80165C18[objectIndex].unk_0BE[1] += 0x100; } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80085534.s") -#endif #ifdef MIPS_TO_C //generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 @@ -10125,10 +9964,6 @@ void func_8008629C(s32 objectIndex, s32 arg1) { GLOBAL_ASM("asm/non_matchings/code_80071F00/func_8008629C.s") #endif -#ifdef NEEDS_RODATA - -extern f64 D_800EF468;// = 0.1; - void func_80086424(s32 objectIndex) { switch (D_80165C18[objectIndex].unk_0AE) { case 0: @@ -10151,9 +9986,6 @@ void func_80086424(s32 objectIndex) { } func_8008BF18(objectIndex); } -#else -GLOBAL_ASM("asm/non_matchings/code_80071F00/func_80086424.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc diff --git a/src/code_80071F00.h b/src/code_80071F00.h index 374d3ca13..545159e50 100644 --- a/src/code_80071F00.h +++ b/src/code_80071F00.h @@ -258,10 +258,6 @@ extern OSMesgQueue gDmaMesgQueue; extern OSMesg gMainReceivedMesg; extern OSIoMesg gDmaIoMesg; -extern f64 D_800EEAD0; -extern f32 D_800EEAD8; -extern f64 D_800EEAE0; -extern f32 D_800EEAE8; extern s32 D_80162DF8; extern s32 D_80165598; extern s16 D_80165740; diff --git a/src/code_80086E70.c b/src/code_80086E70.c index 59e543b41..611f2d522 100644 --- a/src/code_80086E70.c +++ b/src/code_80086E70.c @@ -9,6 +9,7 @@ #include "memory.h" #include "code_80071F00.h" #include "code_80086E70.h" +#include "code_802AAA70.h" void func_80086E70(s32 arg0) { D_80165C18[arg0].unk_0AE = 1;// * 0xE0)) = 1; @@ -848,26 +849,6 @@ UNUSED void func_8008900C(Player *player) { player->unk_09C = 0.0f; } -#ifdef NEEDS_RODATA -//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc -extern Player *gPlayerOne; -extern s16 gCurrentCourseId; /* unable to generate initializer */ -// These are all .rodata -extern f32 D_800EF4A0; -extern f32 D_800EF4A4; -extern f32 D_800EF4A8; -extern f32 D_800EF4AC; -extern f32 D_800EF4B0; -extern f32 D_800EF4B4; -extern f32 D_800EF4B8; -extern f32 D_800EF4BC; -extern f32 D_800EF4C0; -extern f32 D_800EF4C4; -extern f32 D_800EF4C8; -extern f32 D_800EF4CC; -extern f32 D_800EF4D0; -extern f32 D_800EF4D4; - void func_80089020(s32 playerId, f32 *arg1) { f32 var_f0; f32 var_f2; @@ -879,7 +860,7 @@ void func_80089020(s32 playerId, f32 *arg1) { var_f2 = -*arg1; } if (player->unk_0BC & 0xC0) { - if (gCurrentCourseId == 0x000C) { + if (gCurrentCourseId == COURSE_SHERBET_LAND) { if (var_f2 <= 0.5) { var_f0 = 0.025f; } else if (var_f2 <= 2.0) { @@ -900,7 +881,7 @@ void func_80089020(s32 playerId, f32 *arg1) { var_f0 = 0.25f; } } - } else if (gCurrentCourseId == 0x000C) { + } else if (gCurrentCourseId == COURSE_SHERBET_LAND) { if (var_f2 <= 0.5) { var_f0 = 0.025f; } else if (var_f2 <= 2.0) { @@ -916,16 +897,13 @@ void func_80089020(s32 playerId, f32 *arg1) { } else if (var_f2 <= 3.0) { var_f0 = 0.07f; } else if (var_f2 <= 4.0) { - var_f0 = 0.1f; - } else { var_f0 = 0.075f; + } else { + var_f0 = 0.1f; } } f32_step_towards(arg1, 0.0f, var_f0); } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_80089020.s") -#endif #ifdef MIPS_TO_C //generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc @@ -1360,8 +1338,6 @@ UNUSED void func_8008A610(s32 objectIndex) { } } -#ifdef NEEDS_RODATA -extern f64 D_800EF4F0;// = 500.0; void func_8008A6DC(s32 objectIndex, f32 arg1) { u16 var_a2; s32 loopIndex; @@ -1382,9 +1358,6 @@ void func_8008A6DC(s32 objectIndex, f32 arg1) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A6DC.s") -#endif UNUSED void func_8008A810(s32 arg0) { func_8008A6DC(arg0, 500.0f); diff --git a/src/code_80086E70.h b/src/code_80086E70.h index 2e9c291e6..4c65f0380 100644 --- a/src/code_80086E70.h +++ b/src/code_80086E70.h @@ -137,6 +137,8 @@ extern s32 D_80183DA8; extern s32 D_80183DC8; extern f32 gVBlankTimer; extern UnkActorInner D_8018C3B0; +extern Player *gPlayerOne; extern Player *gPlayerOneCopy; +extern s16 gCurrentCourseId; #endif diff --git a/src/code_8008C1D0.c b/src/code_8008C1D0.c index e4b802aa8..61ae4cbbf 100644 --- a/src/code_8008C1D0.c +++ b/src/code_8008C1D0.c @@ -748,14 +748,14 @@ void func_8008D9C0(Player* player) { if (player->unk_D98 == 1) { player->unk_D9C += player->unk_DA0; - if (D_800EF568 <= player->unk_D9C) { + if (2002.0f <= player->unk_D9C) { player->unk_DA0 = 10.0f; player->unk_D98 *= -1; } } if (player->unk_D98 == -1) { player->unk_D9C -= player->unk_DA0; - if (player->unk_D9C <= D_800EF56C) { + if (player->unk_D9C <= -2002.0f) { player->unk_DA0 = 10.0f; player->unk_D98 *= -1; } @@ -835,7 +835,7 @@ void func_8008DC08(Player* player, s8 arg1) { break; case 1: player->unk_DC4 = 4.5f; - player->pos[1] += D_800EF570; + player->pos[1] += 0.13; ++player->unk_238; if ((player->unk_046 & 0x80) != 0) { @@ -855,7 +855,7 @@ void func_8008DC08(Player* player, s8 arg1) { } player->unk_D9C += player->unk_DA0; - if (D_800EF578 <= player->unk_D9C) { + if (3458.0f <= player->unk_D9C) { player->unk_DA0 = 0.0f; break; } @@ -872,7 +872,7 @@ void func_8008DC08(Player* player, s8 arg1) { } player->unk_DC4 = 4.5f; - player->pos[1] -= D_800EF580; + player->pos[1] -= 0.085; if ((player->unk_0BC & 8) != 8) { D_8018D990[arg1] = 3; @@ -906,7 +906,7 @@ void func_8008DF98(Player* player, s8 arg1) { player->statusEffects &= ~0x4000; player->unk_0BC |= 0x40020000; player->unk_0BC &= ~0x10; - player->unk_08C *= D_800EF588; + player->unk_08C *= 0.6; player->unk_0B0 = 0; player->unk_224 = 1.0f; D_8018D930[arg1] = gCourseTimer; @@ -933,11 +933,6 @@ void func_8008DF98(Player* player, s8 arg1) { } } -#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 test; if (((player->unk_0BC & 0x8000) == 0x8000) && ((player->unk_0BC & 0x04000000) != 0x04000000)) { @@ -988,9 +983,6 @@ void func_8008E118(Player *player, s8 arg1) { } } } -#else -GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_8008E118.s") -#endif void func_8008E3C0(Player* player, UNUSED s8 arg1) { move_f32_towards(&player->unk_224, 1.0f, 0.1f); @@ -1260,7 +1252,7 @@ void func_8008EDC0(Player* player) { player->unk_0BC &= ~0x00100000; player->boostPower = 0.0f; if (player->unk_0C2 >= 0x33) { - temp_f0 = D_800EF5A0; + temp_f0 = 0.7; player->unk_09C = (player->unk_09C * temp_f0); player->unk_08C = (player->unk_08C * temp_f0); } @@ -1333,7 +1325,7 @@ void func_8008F104(Player* player, s8 arg1) { void func_8008F1B8(Player* player, s8 arg1) { s16 temp; - player->unk_08C = (player->unk_210 * D_800EF5A8); + player->unk_08C = (player->unk_210 * 0.05); if (player->unk_0B2 < 0) { if ((player->unk_044 & 0x80) == 0x80) { player->unk_02C[1] += 182; @@ -1665,10 +1657,6 @@ void func_8008FEDC(Player* player, UNUSED s8 arg1) { player->kartHopAcceleration = 0.0f; } -#ifdef NEEDS_RODATA -// data_0DD0A0_3_0.s -// jpt_800EF5B0 - void func_8008FF08(Player *player, s8 playerId) { if(player->nearestWaypointId){} switch (gCurrentCourseId) { @@ -1742,9 +1730,6 @@ void func_8008FF08(Player *player, s8 playerId) { break; } } -#else -GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_8008FF08.s") -#endif #ifdef NEEDS_RODATA // data_0DD0A0_2_0.s @@ -2088,7 +2073,6 @@ void func_80090970(Player *player, s8 arg1, s8 arg2) { GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_80090970.s") #endif -#ifdef NEEDS_RODATA s32 func_800910E4(Player *arg0) { 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)) { @@ -2117,9 +2101,6 @@ func_800910E4_label: return 0; } } -#else -GLOBAL_ASM("asm/non_matchings/code_8008C1D0/func_800910E4.s") -#endif void func_800911B4(Player* player, s8 arg1) { s32 temp_v0; @@ -2128,9 +2109,9 @@ void func_800911B4(Player* player, s8 arg1) { player->unk_044 |= 0x1800; player->unk_044 &= ~0x0400; player->unk_044 |= 0x2000; - player->kartHopJerk = D_800EF678; + player->kartHopJerk = 0.002f; player->kartHopAcceleration = 0.0f; - player->kartHopVelocity = D_800EF67C; + player->kartHopVelocity = 2.6f; player->unk_0B2 = 2; player->unk_0C0 = 0; player->unk_07C = 0; diff --git a/src/code_8008C1D0.h b/src/code_8008C1D0.h index 037ba393e..3e3153218 100644 --- a/src/code_8008C1D0.h +++ b/src/code_8008C1D0.h @@ -108,6 +108,7 @@ void func_8008FF08(Player*, s8); void func_80090178(Player*, s8, Vec3f, Vec3f); void func_80090778(Player*); void func_80090868(Player*); +s32 func_800910E4(Player*); void func_800911B4(Player*, s8); void func_80091298(Player*, s8); void func_80091440(s8); @@ -117,11 +118,9 @@ void func_800914A0(); void func_800098FC(u32, Player*); // audio/external.c void func_800C9250(u8); -void func_800CA24C(u8); void func_800CA59C(u8); void func_800CA730(u8); void func_800CA984(u8); -void func_800CAACC(u8); void func_800CAFC0(u8); void func_800CB064(u8); @@ -136,16 +135,6 @@ extern f32 D_800E37B0[]; extern f32 D_800E3790[]; extern f32 D_800E37D0[]; extern f32 D_800E37F0[]; -extern f32 D_800EF568; -extern f32 D_800EF56C; -extern f64 D_800EF570; -extern f32 D_800EF578; -extern f64 D_800EF580; -extern f64 D_800EF588; -extern f64 D_800EF5A0; -extern f64 D_800EF5A8; -extern f32 D_800EF678; -extern f32 D_800EF67C; extern u16 D_80152308; extern u16 D_8015F6F8; extern s16 D_80165190[4][8]; diff --git a/src/code_80280650.c b/src/code_80280650.c index 083cf5a89..cc29f9d17 100644 --- a/src/code_80280650.c +++ b/src/code_80280650.c @@ -141,15 +141,13 @@ s32 D_80284E40[] = { void func_8028093C(struct UnkStruct_80280658 *arg0) { struct UnkStruct_80280658 *temp_v0; - f32 temp_f0; if (arg0->unk44 < 0x1E) { arg0->unk14 += 2.5f; - arg0->unk10 += func_80280850(D_80286B74); - arg0->unk18 += func_80280850(D_80286B78); + arg0->unk10 += func_80280850(0.2f); + arg0->unk18 += func_80280850(0.2f); } else if (arg0->unk2C == 4) { temp_v0 = func_80280734(&D_80284E7C); - temp_f0 = D_80286B7C; temp_v0->unk10 = arg0->unk10; temp_v0->unk14 = arg0->unk14; temp_v0->unk18 = arg0->unk18; @@ -157,8 +155,8 @@ void func_8028093C(struct UnkStruct_80280658 *arg0) { temp_v0->unk3C = 0xFF; temp_v0->unk40 = -0x11; temp_v0->unk44 = 0x64; - temp_v0->unk34 = temp_f0; - temp_v0->unk38 = temp_f0; + temp_v0->unk34 = 1.8700001f; + temp_v0->unk38 = 1.8700001f; } } diff --git a/src/code_80280650.h b/src/code_80280650.h index e73e3e4e7..5c505af0a 100644 --- a/src/code_80280650.h +++ b/src/code_80280650.h @@ -92,9 +92,7 @@ void ending_sequence_loop(); extern struct UnkStruct_80280658 *D_802874F8; extern struct UnkStruct_80280658 *D_80284E7C; -extern f32 D_80286B74; -extern f32 D_80286B78; -extern f32 D_80286B7C; + extern s32 D_80284E88; extern s32 D_802874E0; extern s8 D_802874F4; diff --git a/src/code_802AAA70.c b/src/code_802AAA70.c new file mode 100644 index 000000000..1af3aa79c --- /dev/null +++ b/src/code_802AAA70.c @@ -0,0 +1,2796 @@ +#include "code_802AAA70.h" +#include "math_util.h" +#include "variables.h" +#include <actor_types.h> + +// Used for the choco mountain guard rail +void nullify_displaylist(uintptr_t addr) { + s32 segment = SEGMENT_NUMBER2(addr); + s32 offset = SEGMENT_OFFSET(addr); + + Gfx *macro; + + macro = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + macro->words.w0 = G_ENDDL << 24; + macro->words.w1 = 0; +} + +void func_802AAAAC(UnkActorInner *arg0) { + arg0->unk36 = 0x1388; + arg0->unk38 = 0x1388; + arg0->unk3A = 0x1388; + arg0->unk30 = 0; + arg0->unk32 = 0; + arg0->unk34 = 0; + arg0->unk3C[0] = 0; + arg0->unk3C[1] = 0; + arg0->unk3C[2] = 0; + vec3f_set(arg0->unk48, 0.0f, 0.0f, 1.0f); + vec3f_set(arg0->unk54, 1.0f, 0.0f, 0.0f); + vec3f_set(arg0->unk60, 0.0f, 1.0f, 0.0f); +} + +#ifdef MIPS_TO_C +//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(Player *player) { + f32 sp1C; + f32 sp18; + f32 temp_f0; + f32 temp_f2; + s16 temp_v0; + s32 temp_v1; + + temp_v0 = gCurrentCourseId; + 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; + } + if (temp_f0 < 67.0f) { + goto block_43; + } + if (D_802B9E10 < temp_f2) { + goto block_43; + } + if (temp_f2 < D_802B9E14) { + goto block_43; + } + return D_802B9E18; + 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; + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AAB4C.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +static f32 D_802B9E48 = -0.9f; + +s32 func_802AAE4C(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { + f32 sp6C; + f32 sp64; + f32 sp3C; + f32 sp2C; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp18; + f32 sp14; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f10; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f16; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f4; + f32 temp_f8; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; + + temp_v1 = &D_8015F580[arg5]; + temp_f0 = temp_v1->gravity; + var_v0_2 = 1; + if (temp_f0 < D_802B9E48) { + return 0; + } + if (arg2 < (f32) temp_v1->vtx3[0]) { + return 0; + } + if (arg4 < (f32) temp_v1->vtx3[2]) { + return 0; + } + if ((f32) temp_v1->vtx2[0] < arg2) { + return 0; + } + if ((f32) temp_v1->vtx2[2] < arg4) { + return 0; + } + sp2C = temp_f0; + if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp6C = (f32) temp_a3->v.ob[0]; + sp8 = arg4; + sp10 = arg2; + temp_f8 = (f32) temp_a0->v.ob[2] - arg4; + sp64 = (f32) temp_a3->v.ob[2]; + temp_f4 = (f32) temp_a2->v.ob[0] - arg2; + sp28 = temp_f8; + sp24 = temp_f4; + sp20 = (f32) temp_a0->v.ob[0] - arg2; + temp_f0_2 = temp_f8 * temp_f4; + sp8 = temp_f8; + spC = temp_f4; + sp1C = (f32) temp_a2->v.ob[2] - arg4; + temp_f2 = sp20 * sp1C; + temp_f10 = temp_f0_2 - temp_f2; + sp18 = temp_f10; + sp3C = temp_f10; + if (temp_f2 == temp_f0_2) { + sp14 = arg4; + temp_f0_3 = sp6C - sp10; + temp_f2_2 = sp64 - arg4; + if ((((sp1C * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_3 * sp8))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f2_3 = sp64 - arg4; + temp_f0_4 = sp6C - arg2; + temp_f14 = sp24 * temp_f2_3; + temp_f12 = sp1C * temp_f0_4; + if (temp_f14 == temp_f12) { + if ((sp3C * ((temp_f2_3 * sp20) - (temp_f0_4 * sp28))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp18 * temp_f16) < 0.0f) { + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp28; + temp_f12_2 = temp_f2_3 * sp20; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; + } + } + } + } + if (var_v0_2 == 0) { + return 0; + } + temp_f0_5 = ((temp_v1->height * arg2) + (sp2C * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_5 > 0.0f) { + if (temp_f0_5 < arg0->unk3C[2]) { + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_5; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; + } + return 0; + } + var_v0 = 0; + if (temp_f0_5 > -16.0f) { + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_5; + var_v0 = 1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; + } + return var_v0; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AAE4C.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AB288(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { + f32 sp70; + f32 sp6C; + f32 sp3C; + f32 sp2C; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp14; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f16; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f4; + f32 temp_f6; + f32 temp_f8; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; + + temp_v1 = &D_8015F580[arg5]; + var_v0_2 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { + return 0; + } + if ((f32) temp_v1->vtx2[0] < arg2) { + return 0; + } + if ((f32) temp_v1->vtx2[1] < arg3) { + return 0; + } + if (arg3 < (f32) temp_v1->vtx3[1]) { + return 0; + } + temp_f2 = arg1 * 3.0f; + if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { + return 0; + } + if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp70 = (f32) temp_a3->v.ob[0]; + sp8 = arg3; + sp10 = arg2; + temp_f4 = (f32) temp_a0->v.ob[1] - arg3; + sp6C = (f32) temp_a3->v.ob[1]; + temp_f8 = (f32) temp_a2->v.ob[0] - arg2; + sp2C = temp_f4; + sp28 = temp_f8; + sp24 = (f32) temp_a0->v.ob[0] - arg2; + temp_f0 = temp_f4 * temp_f8; + sp8 = temp_f4; + spC = temp_f8; + sp20 = (f32) temp_a2->v.ob[1] - arg3; + temp_f2_2 = sp24 * sp20; + temp_f6 = temp_f0 - temp_f2_2; + sp1C = temp_f6; + sp3C = temp_f6; + if (temp_f2_2 == temp_f0) { + sp14 = arg3; + temp_f0_2 = sp70 - sp10; + temp_f2_3 = sp6C - arg3; + if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f2_4 = sp6C - arg3; + temp_f0_3 = sp70 - arg2; + temp_f14 = sp28 * temp_f2_4; + temp_f12 = sp20 * temp_f0_3; + if (temp_f14 == temp_f12) { + if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp1C * temp_f16) < 0.0f) { + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp2C; + temp_f12_2 = temp_f2_4 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; + } + } + } + } + if (var_v0_2 == 0) { + return 0; + } + temp_f0_4 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_4 > 0.0f) { + if (temp_f0_4 < arg0->unk3C[0]) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + } + return 0; + } + var_v0 = 0; + if (temp_f0_4 > -16.0f) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4; + var_v0 = 1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + } + return var_v0; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AB288.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AB6C4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { + f32 sp68; + f32 sp64; + f32 sp38; + f32 sp2C; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp14; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f10; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f16; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f4; + f32 temp_f6; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + s32 var_v0_2; + + temp_v1 = &D_8015F580[arg5]; + var_v0_2 = 1; + if (arg4 < (f32) temp_v1->vtx3[2]) { + return 0; + } + if ((f32) temp_v1->vtx2[2] < arg4) { + return 0; + } + if ((f32) temp_v1->vtx2[1] < arg3) { + return 0; + } + if (arg3 < (f32) temp_v1->vtx3[1]) { + return 0; + } + temp_f0 = arg1 * 3.0f; + if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { + return 0; + } + if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp64 = (f32) temp_a3->v.ob[2]; + sp8 = arg3; + sp10 = arg4; + temp_f6 = (f32) temp_a0->v.ob[1] - arg3; + sp68 = (f32) temp_a3->v.ob[1]; + temp_f10 = (f32) temp_a2->v.ob[2] - arg4; + sp2C = temp_f6; + sp28 = temp_f10; + sp24 = (f32) temp_a0->v.ob[2] - arg4; + temp_f0_2 = temp_f6 * temp_f10; + sp8 = temp_f6; + spC = temp_f10; + sp20 = (f32) temp_a2->v.ob[1] - arg3; + temp_f2 = sp24 * sp20; + temp_f4 = temp_f0_2 - temp_f2; + sp1C = temp_f4; + sp38 = temp_f4; + if (temp_f2 == temp_f0_2) { + sp14 = arg3; + temp_f0_3 = sp64 - sp10; + temp_f2_2 = sp68 - arg3; + if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f2_3 = sp68 - arg3; + temp_f0_4 = sp64 - arg4; + temp_f14 = sp28 * temp_f2_3; + temp_f12 = sp20 * temp_f0_4; + if (temp_f14 == temp_f12) { + if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { + var_v0_2 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp1C * temp_f16) < 0.0f) { + var_v0_2 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp2C; + temp_f12_2 = temp_f2_3 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0_2 = 0; + } + } + } + } + if (var_v0_2 == 0) { + return 0; + } + temp_f0_5 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; + if (temp_f0_5 > 0.0f) { + if (temp_f0_5 < arg0->unk3C[1]) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + } + return 0; + } + var_v0 = 0; + if (temp_f0_5 > -16.0f) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5; + var_v0 = 1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + } + return var_v0; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AB6C4.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { + f32 sp6C; + f32 sp64; + f32 sp60; + f32 sp58; + f32 sp3C; + f32 sp28; + f32 sp20; + f32 sp1C; + Vtx *temp_a0; + Vtx *temp_a1; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f10; + f32 temp_f12; + f32 temp_f14; + f32 temp_f16; + f32 temp_f16_2; + f32 temp_f18; + f32 temp_f20; + f32 temp_f22; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f6; + mk64_surface_map_ram *temp_v0; + s32 var_v1; + + temp_v0 = &D_8015F580[arg2 & 0xFFFF]; + temp_a1 = temp_v0->vtxs[1]; + temp_a0 = temp_v0->vtxs[0]; + var_v1 = 1; + sp60 = (f32) temp_a1->v.ob[0]; + temp_f20 = (f32) temp_a0->v.ob[2] - arg1; + sp58 = (f32) temp_a1->v.ob[2]; + temp_a3 = temp_v0->vtxs[2]; + temp_f22 = (f32) temp_a0->v.ob[0] - arg0; + sp6C = (f32) temp_a3->v.ob[0]; + temp_f10 = sp60 - arg0; + temp_f0 = temp_f20 * temp_f10; + sp28 = temp_f10; + sp64 = (f32) temp_a3->v.ob[2]; + temp_f6 = sp58 - arg1; + temp_f2 = temp_f22 * temp_f6; + sp20 = temp_f6; + sp1C = temp_f0 - temp_f2; + sp3C = sp1C; + if (temp_f2 == temp_f0) { + temp_f0_2 = sp6C - arg0; + temp_f2_2 = sp64 - arg1; + if ((((temp_f6 * temp_f0_2) - (temp_f10 * temp_f2_2)) * ((temp_f2_2 * temp_f22) - (temp_f0_2 * temp_f20))) < 0.0f) { + var_v1 = 0; + } + } else { + temp_f2_3 = sp64 - arg1; + temp_f0_3 = sp6C - arg0; + temp_f18 = sp28 * temp_f2_3; + temp_f16 = sp20 * temp_f0_3; + if (temp_f18 == temp_f16) { + if ((sp3C * ((temp_f2_3 * temp_f22) - (temp_f0_3 * temp_f20))) < 0.0f) { + var_v1 = 0; + } + } else { + temp_f12 = temp_f16 - temp_f18; + if ((sp1C * temp_f12) < 0.0f) { + var_v1 = 0; + } else { + temp_f16_2 = temp_f0_3 * temp_f20; + temp_f14 = temp_f2_3 * temp_f22; + if ((temp_f16_2 != temp_f14) && ((temp_f12 * (temp_f14 - temp_f16_2)) < 0.0f)) { + var_v1 = 0; + } + } + } + } + return var_v1; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802ABB04.s") +#endif + +s8 func_802ABD10(u16 arg0) { + mk64_surface_map_ram *tile = &D_8015F580[arg0]; + return tile->surfaceType; +} + +s16 func_802ABD40(u16 arg0) { + mk64_surface_map_ram *tile = &D_8015F580[arg0]; + return tile->flags & 0xFF; +} + +s16 func_802ABD7C(u16 arg0) { + mk64_surface_map_ram *tile = &D_8015F580[arg0]; + return tile->flags & 0x1000; +} + +s16 func_802ABDB8(u16 arg0) { + mk64_surface_map_ram *tile = &D_8015F580[arg0]; + return tile->flags & 0x400; +} + +s16 func_802ABDF4(u16 arg0) { + mk64_surface_map_ram *tile = &D_8015F580[arg0]; + return tile->flags & 0x800; +} + +f32 func_802ABE30(f32 arg0, f32 arg1, f32 arg2, u16 arg3) { + mk64_surface_map_ram *tile = &D_8015F580[arg3]; + if (tile->gravity == 0.0f) { + return arg1; + } + return ((tile->height * arg0) + (tile->rotation * arg2) + tile->height2) / -tile->gravity; +} + +f32 func_802ABEAC(UnkActorInner *arg0, Vec3f arg1) { + if (arg0->unk34 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk3A); + } + if (arg0->unk30 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk36); + } + if (arg0->unk32 == 1) { + return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk38); + } + return arg1[1]; +} + +#ifdef MIPS_TO_C +//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f +void process_shell_collision(f32 *arg0, f32 arg1, f32 *velocity, f32 arg3) { + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp24; + f32 spC; + f32 sp8; + f32 sp4; + f32 sp0; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f10; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f16_2; + f32 temp_f16_3; + f32 temp_f18; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f6; + f64 temp_f16; + + temp_f2 = velocity->unk0; + temp_f12 = velocity->unk4; + temp_f14 = velocity->unk8; + temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f12 * temp_f12) + (temp_f14 * temp_f14)); + temp_f16 = (f64) temp_f0; + sp24 = temp_f0; + if ((temp_f16 > 4.5) || (temp_f16 < 3.5)) { + sp24 = 4.0f; + } + temp_f10 = arg0->unk8; + sp4 = temp_f10; + temp_f16_2 = arg0->unk0; + temp_f18 = arg0->unk4; + temp_f0_2 = (temp_f10 * temp_f14) + ((temp_f16_2 * temp_f2) + (temp_f18 * temp_f12)); + sp0 = temp_f16_2 * temp_f0_2; + spC = temp_f18 * temp_f0_2; + sp40 = temp_f2 - sp0; + sp3C = temp_f12 - spC; + temp_f6 = temp_f10 * temp_f0_2; + sp8 = temp_f6; + sp38 = temp_f14 - temp_f6; + temp_f2_2 = sp40 - sp0; + temp_f12_2 = sp3C - spC; + temp_f14_2 = sp38 - temp_f6; + temp_f16_3 = (1.0f / sqrtf((temp_f2_2 * temp_f2_2) + (temp_f12_2 * temp_f12_2) + (temp_f14_2 * temp_f14_2))) * sp24; + velocity->unk0 = temp_f2_2 * temp_f16_3; + velocity->unk4 = (f32) (temp_f12_2 * temp_f16_3); + velocity->unk8 = (f32) (temp_f14_2 * temp_f16_3); +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/process_shell_collision.s") +#endif + +void func_802AC098(UnkActorInner *arg0, f32 *velocity) { + if (arg0->unk3C[0] < 0.0f) { + process_shell_collision(arg0->unk48, arg0->unk3C[0], velocity, 2.0f); + } + + if (arg0->unk3C[1] < 0.0f) { + process_shell_collision(arg0->unk54, arg0->unk3C[1], velocity, 2.0f); + } +} + +void func_802AC114(Vec3f arg0, f32 arg1, Vec3f arg2, f32 arg3) { + f32 temp_f0; + f32 temp_f12; + f32 temp_f14; + f32 temp_f16; + f32 temp_f18; + f32 temp_f20; + f32 temp_f2; + f32 tmp1; + f32 tmp2; + f32 tmp3; + + temp_f0 = arg2[0]; + temp_f2 = arg2[1]; + temp_f12 = arg2[2]; + temp_f14 = -arg0[0]; + temp_f16 = -arg0[1]; + temp_f18 = -arg0[2]; + temp_f20 = (temp_f14 * temp_f0) + (temp_f16 * temp_f2) + (temp_f18 * temp_f12); + tmp1 = temp_f0 - (temp_f20 * temp_f14); + tmp2 = temp_f2 - (temp_f20 * temp_f16); + tmp3 = temp_f12 - (temp_f20 * temp_f18); + if (arg1 < -3.5) { + arg2[0] = tmp1 - (temp_f20 * temp_f14 * 0.5f); + arg2[1] = tmp2 - (temp_f20 * temp_f16 * 0.5f); + arg2[2] = tmp3 - (temp_f20 * temp_f18 * 0.5f); + } else { + arg2[0] = tmp1; + arg2[1] = tmp2; + arg2[2] = tmp3; + } +} + +#ifdef MIPS_TO_C +//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 +mk64_surface_map_ram *func_802AAE4C(s16 *, ?, f32, f32, f32, s32); /* extern */ +mk64_surface_map_ram *func_802AB288(s16 *, ?, f32, f32, f32, s32); /* extern */ +mk64_surface_map_ram *func_802AB6C4(s16 *, ?, f32, f32, f32, s32); /* extern */ +extern u8 D_8014F110; +extern s32 D_8015F584; +extern s16 D_8015F6E8; +extern s16 D_8015F6EA; +extern s16 D_8015F6F0; +extern s16 D_8015F6F2; + +UNUSED mk64_surface_map_ram *func_802AC22C(void *arg0) { + f32 spE4; + f32 spE0; + f32 spDC; + s16 spD4; + s16 spD2; + s16 spD0; + s32 sp70; + f32 temp_f22; + f32 temp_f24; + f32 temp_f26; + s16 temp_v0_2; + s16 temp_v1; + s32 temp_at; + s32 temp_f4; + s32 temp_f6; + s32 temp_t3; + s32 var_s2; + u16 temp_s0; + u16 temp_v1_3; + u16 var_s1; + u16 var_v0; + u8 temp_v0; + void *temp_v1_2; + + spD0 = 0; + spD2 = 0; + spD4 = 0; + spDC = 1000.0f; + spE0 = 1000.0f; + spE4 = 1000.0f; + temp_v0 = arg0->unkD; + temp_f22 = arg0->unk0; + temp_f24 = arg0->unk4; + temp_f26 = arg0->unk8; + switch (temp_v0) { /* irregular */ + case 0x80: + if (func_802AB6C4(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); + return (mk64_surface_map_ram *)1; + } + default: +block_10: + temp_v0_2 = D_8015F6EA; + temp_v1 = D_8015F6F2; + temp_f4 = (s32) ((temp_f22 - (f32) temp_v0_2) / (f32) ((s32) (D_8015F6E8 - temp_v0_2) / 32)); + temp_f6 = (s32) ((temp_f26 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32)); + if ((s16) temp_f4 < 0) { + return NULL; + } + if ((s16) temp_f6 < 0) { + return NULL; + } + if ((s16) temp_f4 >= 0x20) { + return NULL; + } + if ((s16) temp_f6 >= 0x20) { + return NULL; + } + temp_v1_2 = ((s16) ((s16) temp_f4 + ((s16) temp_f6 << 5)) * 4) + &D_8014F110; + var_v0 = temp_v1_2->unk2; + sp70 = (s32) var_v0; + if (var_v0 == 0) { + return NULL; + } + var_s1 = temp_v1_2->unk0; + var_s2 = 0; + if (sp70 > 0) { +loop_22: + temp_s0 = *(D_8015F584 + (var_s1 * 2)); + var_v0 = (u16) &D_8015F580[temp_s0]; + temp_v1_3 = var_v0->unk0; + if ((temp_v1_3 & 0x4000) != 0) { + if (arg0->unkE != temp_s0) { + var_v0 = func_802AAE4C(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); + if (var_v0 == (u16) (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); + arg0->unkD = 0x40U; + arg0->unkE = temp_s0; + arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; + if ((D_8015F580[temp_s0].flags & 0x1000) != 0) { + arg0->unk14 = (mk64_surface_map_ram *)1; + return (mk64_surface_map_ram *)1; + } + arg0->unk14 = NULL; + return (mk64_surface_map_ram *)1; + } + } + goto block_37; + } + if ((temp_v1_3 & 0x8000) != 0) { + if ((var_v0->unk1C != 1.0f) && (arg0->unkE != temp_s0)) { + var_v0 = func_802AB6C4(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); + if (var_v0 == (u16) (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); + arg0->unkD = 0x80U; + arg0->unkE = temp_s0; + arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; + return (mk64_surface_map_ram *)1; + } + } + goto block_37; + } + if ((var_v0->unk24 != 1.0f) && (arg0->unkE != temp_s0)) { + var_v0 = func_802AB288(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); + if (var_v0 == (u16) (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); + arg0->unkD = 0x20U; + arg0->unkE = temp_s0; + arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; + return (mk64_surface_map_ram *)1; + } + } +block_37: + temp_t3 = (var_s2 + 1) & 0xFFFF; + temp_at = temp_t3 < sp70; + var_s2 = temp_t3; + var_s1 = (var_s1 + 1) & 0xFFFF; + if (temp_at == 0) { + goto block_38; + } + goto loop_22; + } +block_38: + arg0->unk10 = temp_f24; + arg0->unkC = 0; + return (mk64_surface_map_ram *) var_v0; + case 0x40: + if (func_802AAE4C(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); + return (mk64_surface_map_ram *)1; + } + goto block_10; + case 0x20: + if (func_802AB288(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { + arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); + return (mk64_surface_map_ram *)1; + } + goto block_10; + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AC22C.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AC760(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { + f32 sp6C; + f32 sp64; + f32 sp38; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp18; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f10; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f12_3; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f14_3; + f32 temp_f16; + f32 temp_f16_2; + f32 temp_f18; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f4; + f32 temp_f6; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { + return 0; + } + if (arg4 < (f32) temp_v1->vtx3[2]) { + return 0; + } + if ((f32) temp_v1->vtx2[0] < arg2) { + return 0; + } + if ((f32) temp_v1->vtx2[2] < arg4) { + return 0; + } + if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp6C = (f32) temp_a3->v.ob[0]; + sp8 = arg4; + sp10 = arg2; + temp_f6 = (f32) temp_a0->v.ob[2] - arg4; + sp64 = (f32) temp_a3->v.ob[2]; + temp_f4 = (f32) temp_a2->v.ob[0] - arg2; + sp28 = temp_f6; + sp24 = temp_f4; + sp20 = (f32) temp_a0->v.ob[0] - arg2; + temp_f0 = temp_f6 * temp_f4; + sp8 = temp_f6; + spC = temp_f4; + temp_f18 = sp8; + sp1C = (f32) temp_a2->v.ob[2] - arg4; + temp_f2 = sp20 * sp1C; + temp_f10 = temp_f0 - temp_f2; + sp18 = temp_f10; + sp38 = temp_f10; + if (temp_f2 == temp_f0) { + sp8 = arg4; + temp_f0_2 = sp6C - sp10; + temp_f2_2 = sp64 - arg4; + if ((((sp1C * temp_f0_2) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_2 * temp_f18))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f2_3 = sp64 - arg4; + temp_f0_3 = sp6C - arg2; + temp_f14 = sp24 * temp_f2_3; + temp_f12 = sp1C * temp_f0_3; + if (temp_f14 == temp_f12) { + if ((sp38 * ((temp_f2_3 * sp20) - (temp_f0_3 * sp28))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp18 * temp_f16) < 0.0f) { + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp28; + temp_f12_2 = temp_f2_3 * sp20; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; + } + } + } + } + if (var_v0 == 0) { + return 0; + } + temp_f2_4 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; + temp_f0_4 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; + if (arg1 < temp_f0_4) { + if (temp_f0_4 < arg0->unk3C[2]) { + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_4 - arg1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; + } + return 0; + } + if (((temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2) < 0.0f) { + return 0; + } + arg0->unk34 = 1; + arg0->unk3A = arg5; + arg0->unk3C[2] = temp_f0_4 - arg1; + arg0->unk60[0] = temp_v1->height; + arg0->unk60[1] = temp_v1->gravity; + arg0->unk60[2] = temp_v1->rotation; + return 1; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AC760.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802ACBA4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { + f32 sp70; + f32 sp6C; + f32 sp48; + f32 sp3C; + f32 sp2C; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp14; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f10; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f12_3; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f14_3; + f32 temp_f16; + f32 temp_f16_2; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f2_5; + f32 temp_f4; + f32 temp_f4_2; + f32 temp_f6; + f32 temp_f8; + f32 var_f10; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg2 < (f32) temp_v1->vtx3[0]) { + return 0; + } + if ((f32) temp_v1->vtx2[0] < arg2) { + return 0; + } + if ((f32) temp_v1->vtx2[1] < arg3) { + return 0; + } + if (arg3 < (f32) temp_v1->vtx3[1]) { + return 0; + } + temp_f2 = arg1 * 3.0f; + if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { + return 0; + } + if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp70 = (f32) temp_a3->v.ob[0]; + sp8 = arg3; + sp10 = arg2; + temp_f10 = (f32) temp_a0->v.ob[1] - arg3; + sp6C = (f32) temp_a3->v.ob[1]; + temp_f6 = (f32) temp_a2->v.ob[0] - arg2; + sp2C = temp_f10; + sp28 = temp_f6; + sp24 = (f32) temp_a0->v.ob[0] - arg2; + temp_f0 = temp_f10 * temp_f6; + sp8 = temp_f10; + spC = temp_f6; + sp20 = (f32) temp_a2->v.ob[1] - arg3; + temp_f2_2 = sp24 * sp20; + temp_f4 = temp_f0 - temp_f2_2; + sp1C = temp_f4; + sp3C = temp_f4; + if (temp_f2_2 == temp_f0) { + sp14 = arg3; + temp_f0_2 = sp70 - sp10; + temp_f2_3 = sp6C - arg3; + if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f2_4 = sp6C - arg3; + temp_f0_3 = sp70 - arg2; + temp_f14 = sp28 * temp_f2_4; + temp_f12 = sp20 * temp_f0_3; + if (temp_f14 == temp_f12) { + if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp1C * temp_f16) < 0.0f) { + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_3 * sp2C; + temp_f12_2 = temp_f2_4 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; + } + } + } + } + if (var_v0 == 0) { + return 0; + } + temp_f2_5 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; + temp_f0_4 = (temp_f2_5 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; + if (temp_v1->flags & 0x200) { + temp_f4_2 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; + sp48 = temp_f4_2; + if ((temp_f0_4 > 0.0f) && (temp_f4_2 > 0.0f)) { + if (temp_f0_4 < arg1) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + return 1; + } + return 0; + } + if ((temp_f0_4 < 0.0f) && (sp48 < 0.0f)) { + temp_f0_5 = temp_f0_4 * -1.0f; + if (temp_f0_5 < arg1) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_5 - arg1; + arg0->unk48[0] = -temp_v1->height; + arg0->unk48[1] = -temp_v1->gravity; + arg0->unk48[2] = -temp_v1->rotation; + return 1; + } + return 0; + } + if ((temp_f0_4 > 0.0f) && (sp48 < 0.0f)) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = -(temp_f0_4 + arg1); + arg0->unk48[0] = -temp_v1->height; + arg0->unk48[1] = -temp_v1->gravity; + var_f10 = -temp_v1->rotation; + arg0->unk48[2] = var_f10; + return 1; + } + if ((temp_f0_4 < 0.0f) && (sp48 > 0.0f)) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 + arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + return 1; + } + if (temp_f0_4 == 0.0f) { + if (sp48 >= 0.0f) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = sp48 + arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + return 1; + } + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = -(sp48 + arg1); + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + var_f10 = temp_v1->rotation; + arg0->unk48[2] = var_f10; + return 1; + } + return 0; + } + if (arg1 < temp_f0_4) { + if (temp_f0_4 < arg0->unk3C[0]) { + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + arg0->unk48[2] = temp_v1->rotation; + } + return 0; + } + temp_f8 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; + sp48 = temp_f8; + if (temp_f8 < 0.0f) { + return 0; + } + arg0->unk30 = 1; + arg0->unk36 = arg5; + arg0->unk3C[0] = temp_f0_4 - arg1; + arg0->unk48[0] = temp_v1->height; + arg0->unk48[1] = temp_v1->gravity; + var_f10 = temp_v1->rotation; +block_54: + arg0->unk48[2] = var_f10; + return 1; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802ACBA4.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +s32 func_802AD278(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { + f32 sp68; + f32 sp64; + f32 sp44; + f32 sp38; + f32 sp2C; + f32 sp28; + f32 sp24; + f32 sp20; + f32 sp1C; + f32 sp14; + f32 sp10; + f32 spC; + f32 sp8; + Vtx *temp_a0; + Vtx *temp_a2; + Vtx *temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f0_6; + f32 temp_f10; + f32 temp_f10_2; + f32 temp_f12; + f32 temp_f12_2; + f32 temp_f12_3; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f14_3; + f32 temp_f16; + f32 temp_f16_2; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f4; + f32 temp_f6; + f32 temp_f8; + f32 var_f8; + mk64_surface_map_ram *temp_v1; + s32 var_v0; + + temp_v1 = &D_8015F580[arg5]; + var_v0 = 1; + if (arg4 < (f32) temp_v1->vtx3[2]) { + return 0; + } + if ((f32) temp_v1->vtx2[2] < arg4) { + return 0; + } + if ((f32) temp_v1->vtx2[1] < arg3) { + return 0; + } + if (arg3 < (f32) temp_v1->vtx3[1]) { + return 0; + } + temp_f0 = arg1 * 3.0f; + if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { + return 0; + } + if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { + return 0; + } + temp_a0 = temp_v1->vtxs[0]; + temp_a3 = temp_v1->vtxs[2]; + temp_a2 = temp_v1->vtxs[1]; + sp64 = (f32) temp_a3->v.ob[2]; + sp8 = arg3; + sp10 = arg4; + temp_f8 = (f32) temp_a0->v.ob[1] - arg3; + sp68 = (f32) temp_a3->v.ob[1]; + temp_f6 = (f32) temp_a2->v.ob[2] - arg4; + sp2C = temp_f8; + sp28 = temp_f6; + sp24 = (f32) temp_a0->v.ob[2] - arg4; + temp_f0_2 = temp_f8 * temp_f6; + sp8 = temp_f8; + spC = temp_f6; + sp20 = (f32) temp_a2->v.ob[1] - arg3; + temp_f2 = sp24 * sp20; + temp_f10 = temp_f0_2 - temp_f2; + sp1C = temp_f10; + sp38 = temp_f10; + if (temp_f2 == temp_f0_2) { + sp14 = arg3; + temp_f0_3 = sp64 - sp10; + temp_f2_2 = sp68 - arg3; + if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f2_3 = sp68 - arg3; + temp_f0_4 = sp64 - arg4; + temp_f14 = sp28 * temp_f2_3; + temp_f12 = sp20 * temp_f0_4; + if (temp_f14 == temp_f12) { + if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { + var_v0 = 0; + } + } else { + temp_f16 = temp_f12 - temp_f14; + if ((sp1C * temp_f16) < 0.0f) { + var_v0 = 0; + } else { + temp_f14_2 = temp_f0_4 * sp2C; + temp_f12_2 = temp_f2_3 * sp24; + if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { + var_v0 = 0; + } + } + } + } + if (var_v0 == 0) { + return 0; + } + temp_f2_4 = temp_v1->height; + temp_f12_3 = temp_v1->gravity; + temp_f14_3 = temp_v1->rotation; + temp_f16_2 = temp_v1->height2; + temp_f0_5 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; + if (temp_v1->flags & 0x200) { + temp_f10_2 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; + sp44 = temp_f10_2; + if ((temp_f0_5 > 0.0f) && (temp_f10_2 > 0.0f)) { + if (temp_f0_5 < arg1) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + return 1; + } + return 0; + } + if ((temp_f0_5 < 0.0f) && (sp44 < 0.0f)) { + temp_f0_6 = temp_f0_5 * -1.0f; + if (temp_f0_6 < arg1) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_6 - arg1; + arg0->unk54[0] = -temp_v1->height; + arg0->unk54[1] = -temp_v1->gravity; + arg0->unk54[2] = -temp_v1->rotation; + return 1; + } + return 0; + } + if ((temp_f0_5 > 0.0f) && (sp44 < 0.0f)) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = -(temp_f0_5 + arg1); + arg0->unk54[0] = -temp_v1->height; + arg0->unk54[1] = -temp_v1->gravity; + var_f8 = -temp_v1->rotation; + arg0->unk54[2] = var_f8; + return 1; + } + if ((temp_f0_5 < 0.0f) && (sp44 > 0.0f)) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 + arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + return 1; + } + if (temp_f0_5 == 0.0f) { + if (sp44 >= 0.0f) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = sp44 + arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + return 1; + } + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = -(sp44 + arg1); + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + var_f8 = temp_v1->rotation; + arg0->unk54[2] = var_f8; + return 1; + } + return 0; + } + if (arg1 < temp_f0_5) { + if (temp_f0_5 < arg0->unk3C[1]) { + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + arg0->unk54[2] = temp_v1->rotation; + } + return 0; + } + temp_f4 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; + sp44 = temp_f4; + if (temp_f4 < 0.0f) { + return 0; + } + arg0->unk32 = 1; + arg0->unk38 = arg5; + arg0->unk3C[1] = temp_f0_5 - arg1; + arg0->unk54[0] = temp_v1->height; + arg0->unk54[1] = temp_v1->gravity; + var_f8 = temp_v1->rotation; + arg0->unk54[2] = var_f8; + return 1; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AD278.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b +s32 func_802AC760(f32, f32, f32, f32, f32, f32, f32, f32, f32); /* extern */ +s32 func_802ACBA4(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */ +s32 func_802AD278(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */ +extern u8 D_8014F110; +extern s32 D_8015F584; +extern s16 D_8015F6E8; +extern s16 D_8015F6EA; +extern s16 D_8015F6F0; +extern s16 D_8015F6F2; + +s32 func_802AD950(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + s16 temp_v0_4; + s16 temp_v1; + s32 temp_f10; + s32 temp_f16; + s32 temp_t7; + u16 temp_s6; + u16 temp_v0; + u16 temp_v0_2; + u16 temp_v0_3; + u16 temp_v0_5; + u16 temp_v1_3; + void *temp_v1_2; + s32 phi_s4; + s32 phi_s4_2; + u16 phi_s2; + s32 phi_s3; + s32 phi_s4_3; + s32 phi_s4_4; + s32 phi_s4_5; + s32 phi_s4_6; + + arg0->unk30 = 0; + arg0->unk32 = 0; + arg0->unk34 = 0; + arg0->unk3C = 1000.0f; + arg0->unk40 = 1000.0f; + arg0->unk44 = 1000.0f; + temp_v0 = arg0->unk3A; + phi_s4_6 = 0; + if (((s32) temp_v0 < (s32) D_8015F588) && (func_802AC760(arg1, arg2, arg3, arg4, (bitwise f32) temp_v0, arg5, arg6, arg7) == 1)) { + phi_s4_6 = 0x00004000; + } + temp_v0_2 = arg0->unk36; + phi_s4_4 = phi_s4_6; + if (((s32) temp_v0_2 < (s32) D_8015F588) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_2, arg5, arg6, arg7) == 1)) { + phi_s4_4 = (phi_s4_6 | 0x2000) & 0xFFFF; + } + temp_v0_3 = arg0->unk38; + phi_s4 = phi_s4_4; + if (((s32) temp_v0_3 < (s32) D_8015F588) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_3, arg5, arg6, arg7) == 1)) { + phi_s4 = (phi_s4_4 | 0x8000) & 0xFFFF; + } + phi_s4_2 = phi_s4; + phi_s4_3 = phi_s4; + if (phi_s4 == 0x0000E000) { + goto block_39; + } + temp_v0_4 = D_8015F6EA; + temp_v1 = D_8015F6F2; + temp_f10 = (s32) ((arg2 - (f32) temp_v0_4) / (f32) ((s32) (D_8015F6E8 - temp_v0_4) / 32)); + temp_f16 = (s32) ((arg4 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32)); + if ((s16) temp_f10 < 0) { + return 0; + } + if ((s16) temp_f16 < 0) { + return 0; + } + if ((s16) temp_f10 >= 0x20) { + return 0; + } + if ((s16) temp_f16 >= 0x20) { + return 0; + } + temp_v1_2 = ((s16) ((s16) temp_f10 + ((s16) temp_f16 << 5)) * 4) + &D_8014F110; + temp_s6 = temp_v1_2->unk2; + phi_s3 = 0; + if (temp_s6 == 0) { + + } else { + phi_s2 = temp_v1_2->unk0; + if ((s32) temp_s6 > 0) { +loop_22: + phi_s4_3 = phi_s4_2; + phi_s4_5 = phi_s4_2; + if (phi_s4_2 == 0x0000E000) { + + } else { + temp_v0_5 = *(D_8015F584 + (phi_s2 * 2)); + temp_v1_3 = D_8015F580[temp_v0_5].flags; + if ((temp_v1_3 & 0x4000) != 0) { + if (((phi_s4_2 & 0x4000) == 0) && (arg0->unk3A != temp_v0_5) && (func_802AC760((bitwise f32) arg0, arg1, arg2, arg3, arg4, (bitwise f32) temp_v0_5, arg5, arg6, arg7) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x4000) & 0xFFFF; + } + } else if ((temp_v1_3 & 0x8000) != 0) { + if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk38 != temp_v0_5) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x8000) & 0xFFFF; + } + } else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk36 != temp_v0_5) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x2000) & 0xFFFF; + } + temp_t7 = (phi_s3 + 1) & 0xFFFF; + phi_s4_2 = phi_s4_5; + phi_s2 = (phi_s2 + 1) & 0xFFFF; + phi_s3 = temp_t7; + phi_s4_3 = phi_s4_5; + if (temp_t7 < (s32) temp_s6) { + goto loop_22; + } + } + } + } +block_39: + return phi_s4_3; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AD950.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +s32 func_802AAE4C(void *, f32, f32, f32, f32, s32); // extern +s32 func_802AB288(void *, void *, f32, f32, f32, s32); // extern +s32 func_802AB6C4(void *, void *, f32, f32, f32, s32); // extern +extern u8 D_8014F110; +extern s32 D_8015F584; + +s32 func_802ADDC8(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4) { + s16 temp_v0_4; + s16 temp_v1; + s32 temp_f4; + s32 temp_f6; + s32 temp_t7; + u16 temp_s6; + u16 temp_v0; + u16 temp_v0_2; + u16 temp_v0_3; + u16 temp_v0_5; + u16 temp_v1_3; + void *temp_v1_2; + s32 phi_s4; + s32 phi_s4_2; + u16 phi_s2; + s32 phi_s3; + s32 phi_s4_3; + s32 phi_s4_4; + s32 phi_s4_5; + s32 phi_s4_6; + + arg0->unk0 = 0; + arg0->unk2 = 0; + arg0->unk4 = 0; + arg0->unkC = 1000.0f; + arg0->unk10 = 1000.0f; + arg0->unk14 = 1000.0f; + temp_v0 = arg0->unkA; + phi_s4_6 = 0; + if ((temp_v0 < D_8015F588) && (func_802AAE4C(arg1, arg2, arg3, arg4, (bitwise f32) temp_v0) == 1)) { + phi_s4_6 = 0x4000; + } + temp_v0_2 = arg0->unk6; + phi_s4_4 = phi_s4_6; + if ((temp_v0_2 < D_8015F588) && (func_802AB288(arg0, arg1, arg2, arg3, arg4, temp_v0_2) == 1)) { + phi_s4_4 = (phi_s4_6 | 0x2000) & 0xFFFF; + } + temp_v0_3 = arg0->unk8; + phi_s4 = phi_s4_4; + if ((temp_v0_3 < D_8015F588) && (func_802AB6C4(arg0, arg1, arg2, arg3, arg4, temp_v0_3) == 1)) { + phi_s4 = (phi_s4_4 | 0x8000) & 0xFFFF; + } + phi_s4_2 = phi_s4; + phi_s4_3 = phi_s4; + if (phi_s4 == 0xE000) { + goto block_39; + } + temp_v0_4 = D_8015F6EA; + temp_v1 = D_8015F6F2; + temp_f4 = (arg2 - temp_v0_4) / ((D_8015F6E8 - temp_v0_4) / 0x20); + temp_f6 = (arg4 - temp_v1) / ((D_8015F6F0 - temp_v1) / 0x20); + if (temp_f4 < 0) { + return 0; + } + if (temp_f6 < 0) { + return 0; + } + if (temp_f4 >= 0x20) { + return 0; + } + if (temp_f6 >= 0x20) { + return 0; + } + temp_v1_2 = ((temp_f4 + (temp_f6 << 5)) * 4) + &D_8014F110; + temp_s6 = temp_v1_2->unk2; + phi_s3 = 0; + if (temp_s6 == 0) { + + } else { + phi_s2 = temp_v1_2->unk0; + if (temp_s6 > 0) { +loop_22: + phi_s4_3 = phi_s4_2; + phi_s4_5 = phi_s4_2; + if (phi_s4_2 == 0xE000) { + + } else { + temp_v0_5 = *(D_8015F584 + (phi_s2 * 2)); + temp_v1_3 = *(D_8015F580 + (temp_v0_5 * 0x2C)); + if ((temp_v1_3 & 0x4000) != 0) { + if (((phi_s4_2 & 0x4000) == 0) && (arg0->unkA != temp_v0_5) && (func_802AAE4C(arg0, (bitwise f32) arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x4000) & 0xFFFF; + } + } else if ((temp_v1_3 & 0x8000) != 0) { + if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk8 != temp_v0_5) && (func_802AB6C4(arg0, arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x8000) & 0xFFFF; + } + } else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk6 != temp_v0_5) && (func_802AB288(arg0, arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { + phi_s4_5 = (phi_s4_2 | 0x2000) & 0xFFFF; + } + temp_t7 = (phi_s3 + 1) & 0xFFFF; + phi_s4_2 = phi_s4_5; + phi_s2 = (phi_s2 + 1) & 0xFFFF; + phi_s3 = temp_t7; + phi_s4_3 = phi_s4_5; + if (temp_t7 < temp_s6) { + goto loop_22; + } + } + } + } +block_39: + return phi_s4_3; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802ADDC8.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022 +s32 func_802ABB04(f32, f32, s32); /* extern */ +extern ? D_8014F110; +extern s32 D_8015F584; +static f32 D_802B9E4C = -3000.0f; +static f32 D_802B9E50 = 3000.0f; +static f32 D_802B9E54 = 3000.0f; +static f32 D_802B9E58 = 3000.0f; +static f32 D_802B9E5C = 3000.0f; +static f32 D_802B9E60 = 3000.0f; + +f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) { + f32 temp_f0; + f32 var_f20; + s32 temp_at; + s32 temp_f4; + s32 temp_f6; + s32 temp_t0; + s32 temp_t9; + s32 var_s2; + u16 temp_s0; + u16 temp_t1; + u16 var_s1; + void *temp_t2; + + var_f20 = D_802B9E4C; + temp_f4 = (s32) ((arg0 - (f32) D_8015F6EA) / (f32) ((s32) (D_8015F6E8 - D_8015F6EA) / 32)); + temp_f6 = (s32) ((arg2 - (f32) D_8015F6F2) / (f32) ((s32) (D_8015F6F0 - D_8015F6F2) / 32)); + temp_t0 = (s16) temp_f6 << 5; + temp_t2 = ((s16) ((s16) temp_f4 + temp_t0) * 4) + &D_8014F110; + temp_t1 = temp_t2->unk2; + if ((s16) temp_f4 < 0) { + return D_802B9E50; + } + if ((s16) temp_f6 & 0x04000000) { + return D_802B9E54; + } + if ((s16) temp_f4 >= 0x20) { + return D_802B9E58; + } + if (temp_t0 >= 0x400) { + return D_802B9E5C; + } + if (temp_t1 == 0) { + return D_802B9E60; + } + var_s1 = temp_t2->unk0; + var_s2 = 0; + if ((s32) temp_t1 > 0) { + do { + temp_s0 = *(D_8015F584 + (var_s1 * 2)); + if ((D_8015F580[temp_s0].flags & 0x4000) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) { + temp_f0 = func_802ABE30(arg0, arg1, arg2, temp_s0 & 0xFFFF); + if ((temp_f0 <= arg1) && (var_f20 < temp_f0)) { + var_f20 = temp_f0; + } + } + temp_t9 = (var_s2 + 1) & 0xFFFF; + temp_at = temp_t9 < (s32) temp_t1; + var_s2 = temp_t9; + var_s1 = (var_s1 + 1) & 0xFFFF; + } while (temp_at != 0); + } + return var_f20; +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AE1C0.s") +#endif + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +extern s32 D_8015F59C; +extern s32 D_8015F5A0; +extern s32 D_8015F5A4; +extern s16 D_8015F6E8; +extern s16 D_8015F6EA; +extern s16 D_8015F6F0; +extern s16 D_8015F6F2; +extern s16 D_8015F6FA; +extern s16 D_8015F6FC; +static f32 D_802B9E64 = -0.9f; +static f32 D_802B9E68 = 0.9f; +static f32 D_802B9E6C = 0.1f; +static f32 D_802B9E70 = -0.1f; + +void func_802AE434(Vtx *arg0, Vtx *arg1, Vtx *arg2, s8 arg3, u16 arg4) { + s16 spBA; + s16 spB8; + s16 spB6; + s16 spB2; + s16 spAC; + s16 spAA; + f32 sp58; + f32 sp54; + f32 sp50; + f32 sp4C; + s16 sp4A; + s16 sp48; + s16 sp44; + s16 sp42; + Vtx *sp1C; /* compiler-managed */ + f64 sp10; + f64 sp8; + f64 sp0; + Vtx *temp_t1; + Vtx *temp_t2; + Vtx *temp_t6; + f32 temp_f0; + f32 temp_f18_2; + f32 temp_f4_2; + f64 temp_f12; + f64 temp_f14; + f64 temp_f16; + f64 temp_f18; + f64 temp_f2; + f64 temp_f4; + f64 temp_f8; + mk64_surface_map_ram *temp_t0; + s16 var_a0; + s16 var_a1; + s16 var_a2; + s16 var_a3; + s16 var_t1; + s16 var_t2; + s16 var_t3; + s16 var_t4; + s16 var_t5; + s16 var_v0; + s16 var_v1; + s32 temp_a0; + s32 temp_a1; + s32 temp_a2; + s32 temp_a3; + s32 temp_v0; + s32 temp_v1; + u16 temp_a0_2; + u16 temp_a3_2; + u16 temp_v1_2; + u16 var_a1_2; + u16 var_t8; + u16 var_t9; + + temp_t0 = &D_8015F580[D_8015F588]; + temp_t0->vtxs[0] = arg0; + temp_t0->vtxs[1] = arg1; + temp_t0->vtxs[2] = arg2; + if ((arg0->v.flag != 4) || (arg1->v.flag != 4) || (temp_t0->vtxs[2]->v.flag != 4)) { + temp_t6 = temp_t0->vtxs[0]; + sp1C = temp_t6; + temp_t1 = temp_t0->vtxs[1]; + temp_t2 = temp_t0->vtxs[2]; + var_a0 = temp_t6->v.ob[0]; + var_t3 = temp_t1->v.ob[0]; + var_a2 = temp_t6->v.ob[1]; + var_a1 = temp_t6->v.ob[2]; + var_a3 = temp_t1->v.ob[1]; + var_t4 = temp_t1->v.ob[2]; + var_t5 = temp_t2->v.ob[0]; + var_v0 = temp_t2->v.ob[1]; + var_v1 = temp_t2->v.ob[2]; + if ((var_a0 == var_t3) && (var_a1 == var_t4)) { + temp_t0->vtxs[2] = arg1; + temp_t0->vtxs[1] = arg2; + var_a0 = arg0->v.ob[0]; + var_a2 = arg0->v.ob[1]; + var_a1 = arg0->v.ob[2]; + var_t3 = arg1->v.ob[0]; + var_a3 = arg1->v.ob[1]; + var_t4 = arg1->v.ob[2]; + var_t5 = arg2->v.ob[0]; + var_v0 = arg2->v.ob[1]; + var_v1 = arg2->v.ob[2]; + } + if (var_a0 >= var_t3) { + if (var_a0 >= var_t5) { + sp4A = var_a0; + } else { + goto block_12; + } + } else if (var_t3 >= var_t5) { + sp4A = var_t3; + } else { +block_12: + sp4A = var_t5; + } + if (var_a1 >= var_t4) { + if (var_a1 >= var_v1) { + sp48 = var_a1; + } else { + goto block_19; + } + } else if (var_t4 >= var_v1) { + sp48 = var_t4; + } else { +block_19: + sp48 = var_v1; + } + if (var_a2 >= var_a3) { + if (var_a2 >= var_v0) { + sp42 = var_a2; + } else { + goto block_26; + } + } else if (var_a3 >= var_v0) { + sp42 = var_a3; + } else { +block_26: + sp42 = var_v0; + } + if (var_t3 >= var_a0) { + if (var_t5 >= var_a0) { + sp44 = var_a0; + } else { + goto block_33; + } + } else if (var_t5 >= var_t3) { + sp44 = var_t3; + } else { +block_33: + sp44 = var_t5; + } + if (var_a3 >= var_a2) { + if (var_v0 >= var_a2) { + var_t2 = var_a2; + } else { + var_t2 = var_v0; + } + } else if (var_v0 >= var_a3) { + var_t2 = var_a3; + } else { + var_t2 = var_v0; + } + if (var_t4 >= var_a1) { + if (var_v1 >= var_a1) { + var_t1 = var_a1; + } else { + var_t1 = var_v1; + } + } else if (var_v1 >= var_t4) { + var_t1 = var_t4; + } else { + var_t1 = var_v1; + } + spAA = var_v1; + spB8 = var_a2; + spB2 = var_a3; + spAC = var_v0; + temp_v0 = spB2 - spB8; + temp_v1 = spAA - var_t4; + spB6 = var_a1; + spBA = var_a0; + temp_a0 = var_t4 - spB6; + temp_a1 = spAC - spB2; + temp_a2 = var_t5 - var_t3; + temp_a3 = var_t3 - spBA; + temp_f12 = (f64) ((temp_v0 * temp_v1) - (temp_a0 * temp_a1)); + temp_f18 = temp_f12 * temp_f12; + sp10 = temp_f18; + temp_f14 = (f64) ((temp_a0 * temp_a2) - (temp_a3 * temp_v1)); + temp_f8 = temp_f14 * temp_f14; + sp8 = temp_f8; + temp_f16 = (f64) ((temp_a3 * temp_a1) - (temp_v0 * temp_a2)); + temp_f4 = temp_f16 * temp_f16; + sp0 = temp_f4; + temp_f2 = (f64) sqrtf((f32) (temp_f18 + temp_f8 + temp_f4)); + if ((temp_f2 != 0.0) && ((temp_f0 = (f32) ((f64) (f32) temp_f12 / temp_f2), sp58 = temp_f0, temp_f4_2 = (f32) ((f64) (f32) temp_f14 / temp_f2), sp1C = temp_f4_2, sp54 = temp_f4_2, temp_f18_2 = (f32) ((f64) (f32) temp_f16 / temp_f2), sp50 = temp_f18_2, sp4C = -(((f32) spBA * temp_f0) + (temp_f4_2 * (f32) spB8) + (temp_f18_2 * (f32) spB6)), (D_8015F59C == 0)) || (!(temp_f4_2 < D_802B9E64) && !(D_802B9E68 < temp_f4_2))) && ((D_8015F5A0 == 0) || !(sp1C < D_802B9E6C) || !(D_802B9E70 < sp1C))) { + temp_t0->vtx2[0] = sp4A; + temp_t0->vtx3[2] = var_t1; + temp_t0->vtx3[1] = var_t2; + temp_t0->vtx3[0] = sp44; + temp_t0->vtx2[1] = sp42; + temp_t0->vtx2[2] = sp48; + if (sp44 < D_8015F6EA) { + D_8015F6EA = sp44; + } + if (var_t2 < D_8015F6EE) { + D_8015F6EE = var_t2; + } + if (var_t1 < D_8015F6F2) { + D_8015F6F2 = var_t1; + } + if (D_8015F6E8 < sp4A) { + D_8015F6E8 = sp4A; + } + if (D_8015F6EC < sp42) { + D_8015F6EC = sp42; + } + if (D_8015F6F0 < sp48) { + D_8015F6F0 = sp48; + } + temp_t0->height = sp58; + temp_t0->gravity = sp54; + var_a1_2 = arg4; + temp_t0->rotation = sp50; + temp_t0->height2 = sp4C; + temp_t0->surfaceType = (u16) arg3; + D_8015F6FA = 0; + D_8015F6FC = 0; + temp_a3_2 = temp_t0->vtxs[0]->v.flag; + temp_v1_2 = temp_t0->vtxs[1]->v.flag; + temp_a0_2 = temp_t0->vtxs[2]->v.flag; + if ((temp_a3_2 == 1) && (temp_v1_2 == 1) && (temp_a0_2 == 1)) { + var_t8 = (arg4 | 0x400) & 0xFFFF; + goto block_81; + } + if ((temp_a3_2 == 2) && (temp_v1_2 == 2) && (temp_a0_2 == 2)) { + var_a1_2 = (arg4 | 0x800) & 0xFFFF; + } else if ((temp_a3_2 == 3) && (temp_v1_2 == 3) && (temp_a0_2 == 3)) { + var_a1_2 = (arg4 | 0x1000) & 0xFFFF; + } else if (D_8015F5A4 != 0) { + var_t8 = (arg4 | 0x200) & 0xFFFF; +block_81: + var_a1_2 = var_t8; + } + temp_t0->flags = var_a1_2; + if (sp10 <= sp8) { + var_t9 = var_a1_2 | 0x4000; + if (sp0 <= sp8) { + goto block_89; + } + } + if ((sp8 < sp10) && (sp0 <= sp10)) { + temp_t0->flags |= 0x8000; + } else { + var_t9 = temp_t0->flags | 0x2000; +block_89: + temp_t0->flags = var_t9; + } + D_8015F588 += 1; + } + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AE434.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +void func_802AE434(s32, s32, s32, s8, s32); // extern +extern ? D_8015F668; + +void func_802AEB14(s32 arg0, s8 arg1, u16 arg2) { + func_802AE434(*(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)), *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)), arg1, arg2); +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AEB14.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +void func_802AE434(s32, s32, s32, s8, s32); // extern +extern ? D_8015F668; + +void func_802AEBA4(s32 arg0, s32 arg1, s8 arg2, u16 arg3) { + s32 sp28; + s32 sp24; + s32 sp20; + + sp28 = *(&D_8015F668 + ((((arg1 & 0xFF0000) >> 0x10) >> 1) * 4)); + sp24 = *(&D_8015F668 + ((((arg1 & 0xFF00) >> 8) >> 1) * 4)); + sp20 = *(&D_8015F668 + (((arg1 & 0xFF) >> 1) * 4)); + func_802AE434(*(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)), *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)), arg2, arg3); + func_802AE434(sp28, sp24, sp20, arg2, arg3); +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AEBA4.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +void func_802AE434(s32, s32, s32, s8, s32); // extern +extern ? D_8015F668; + +void func_802AECA0(s32 arg0, s8 arg1, u16 arg2) { + s32 sp2C; + s32 sp24; + s32 sp20; + s32 temp_a0; + s32 temp_a2; + + temp_a0 = *(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)); + temp_a2 = *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)); + sp2C = temp_a0; + sp24 = temp_a2; + sp20 = *(&D_8015F668 + ((((arg0 & 0xFF000000) >> 0x18) >> 1) * 4)); + func_802AE434(temp_a0, *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), temp_a2, arg1, arg2); + func_802AE434(temp_a0, sp24, sp20, arg1, arg2); +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AECA0.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +extern ? D_8015F668; +extern uintptr_t gSegmentTable; + +void func_802AED6C(u32 arg0, s32 arg1, s32 arg2) { + s32 temp_a2; + s32 temp_t0; + s32 temp_v0; + s32 temp_v0_2; + s32 temp_v0_3; + s32 temp_v0_4; + s32 temp_v0_5; + s32 temp_v1; + s32 temp_v1_2; + s32 phi_v0; + s32 *phi_a0; + s32 phi_v1; + s32 phi_v0_2; + void *phi_a0_2; + s32 phi_v1_2; + s32 phi_a2; + s32 phi_a2_2; + + temp_v0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; + phi_v0 = temp_v0; + phi_v1 = 0; + phi_v0_2 = temp_v0; + phi_a2 = arg2; + phi_v1_2 = 0; + phi_a2_2 = arg2; + if (arg1 != 0) { + temp_t0 = arg1 & 3; + if (temp_t0 != 0) { + phi_a0 = (arg2 * 4) + &D_8015F668; + do { + *phi_a0 = phi_v0; + temp_v1 = phi_v1 + 1; + temp_v0_2 = phi_v0 + 0x10; + temp_a2 = phi_a2_2 + 1; + phi_v0 = temp_v0_2; + phi_a0 += 4; + phi_v1 = temp_v1; + phi_v0_2 = temp_v0_2; + phi_a2 = temp_a2; + phi_v1_2 = temp_v1; + phi_a2_2 = temp_a2; + } while (temp_t0 != temp_v1); + if (temp_v1 != arg1) { + goto block_5; + } + } else { +block_5: + phi_a0_2 = (phi_a2 * 4) + &D_8015F668; + do { + phi_a0_2->unk0 = phi_v0_2; + temp_v0_3 = phi_v0_2 + 0x10; + phi_a0_2->unk4 = temp_v0_3; + temp_v0_4 = temp_v0_3 + 0x10; + phi_a0_2->unk8 = temp_v0_4; + temp_v0_5 = temp_v0_4 + 0x10; + phi_a0_2->unkC = temp_v0_5; + temp_v1_2 = phi_v1_2 + 4; + phi_v0_2 = temp_v0_5 + 0x10; + phi_a0_2 += 0x10; + phi_v1_2 = temp_v1_2; + } while (temp_v1_2 != arg1); + } + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AED6C.s") +#endif + +s32 func_802AEE1C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { + f32 temp_f0; + f32 temp_f18; + f32 temp_f2; + + temp_f0 = arg6 - arg4; + temp_f2 = arg7 - arg5; + if (temp_f0 == 0.0f) { + if (arg4 < arg0) { + return 0; + } + if (arg1 < arg4) { + return 0; + } + if (temp_f2 > 0.0f) { + if ((arg5 < arg2) && (arg3 < arg7)) { + return 1; + } + } else if ((arg7 < arg2) && (arg3 < arg5)) { + return 1; + } + } else { + if (temp_f2 == 0.0f) { + if (arg5 < arg2) { + return 0; + } + if (arg3 < arg5) { + return 0; + } + if (temp_f0 > 0.0f) { + if ((arg4 < arg0) && (arg1 < arg6)) { + return 1; + } + } else if ((arg6 < arg0) && (arg1 < arg4)) { + return 1; + } + } else { + temp_f18 = ((temp_f0 / temp_f2) * (arg2 - arg5)) + arg4; + if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { + return 1; + } + temp_f18 = ((temp_f0 / temp_f2) * (arg3 - arg5)) + arg4; + if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { + return 1; + } + temp_f18 = ((temp_f2 / temp_f0) * (arg0 - arg4)) + arg5; + if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { + return 1; + } + temp_f18 = ((temp_f2 / temp_f0) * (arg1 - arg4)) + arg5; + if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { + return 1; + } + } + } + return 0; +} + +s32 func_802AF0FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u16 surfaceMapIndex) { + mk64_surface_map_ram *temp_v0; + s16 vx1; + s16 vz1; + s16 vx2; + s16 vz2; + s16 vx3; + s16 vz3; + + temp_v0 = &D_8015F580[surfaceMapIndex]; + vx1 = temp_v0->vtxs[0]->v.ob[0]; + vz1 = temp_v0->vtxs[0]->v.ob[2]; + vx2 = temp_v0->vtxs[1]->v.ob[0]; + vz2 = temp_v0->vtxs[1]->v.ob[2]; + vx3 = temp_v0->vtxs[2]->v.ob[0]; + vz3 = temp_v0->vtxs[2]->v.ob[2]; + if ((vx1 >= arg0) && (arg1 >= vx1) && (vz1 >= arg2) && (arg3 >= vz1)) { + return 1; + } + if ((vx2 >= arg0) && (arg1 >= vx2) && (vz2 >= arg2) && (arg3 >= vz2)) { + return 1; + } + if ((vx3 >= arg0) && (arg1 >= vx3) && (vz3 >= arg2) && (arg3 >= vz3)) { + return 1; + } + if (func_802AEE1C(arg0, arg1, arg2, arg3, vx1, vz1, vx2, vz2) == 1) { + return 1; + } + if (func_802AEE1C(arg0, arg1, arg2, arg3, vx2, vz2, vx3, vz3) == 1) { + return 1; + } + if (func_802AEE1C(arg0, arg1, arg2, arg3, vx3, vz3, vx1, vz1) == 1) { + return 1; + } + return 0; +} + +#ifdef MIPS_TO_C +//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c +extern ? D_8014F110; +extern s32 D_8015F584; +extern u16 D_8015F58A; +extern s16 D_8015F6E8; +extern s16 D_8015F6EA; +extern s16 D_8015F6F0; +extern s16 D_8015F6F2; +extern s32 gPrevLoadedAddress; + +void func_802AF314(void) { + s32 sp4C; + ? *var_v0; + s16 temp_a1; + s16 temp_a3; + s16 temp_s1; + s16 temp_s2; + s32 temp_fp; + s32 temp_s6; + s32 var_s0; + s32 var_s3; + s32 var_s5; + s32 var_s7; + void *temp_v0; + void *temp_v0_2; + + var_v0 = &D_8014F110; + do { + var_v0 += 0x10; + var_v0->unk-A = 0; + var_v0->unk-6 = 0; + var_v0->unk-2 = 0; + var_v0->unk-E = 0; + } while (var_v0 != &gNumActors); + D_8015F58A = 0; + D_8015F584 = gPrevLoadedAddress; + var_s7 = 0; + temp_s6 = (s32) (D_8015F6E8 - D_8015F6EA) / 32; + temp_fp = (s32) (D_8015F6F0 - D_8015F6F2) / 32; + do { + var_s5 = 0; + sp4C = temp_fp * var_s7; +loop_4: + var_s0 = 0; + var_s3 = 0; + temp_s1 = (D_8015F6EA + (temp_s6 * var_s5)) - 0x14; + temp_s2 = (D_8015F6F2 + sp4C) - 0x14; + if ((s32) D_8015F588 > 0) { + do { + temp_a3 = temp_s2 + temp_fp + 0x28; + temp_v0 = var_s3 + D_8015F580; + if ((temp_v0->unkE >= temp_s2) && (temp_a3 >= temp_v0->unk8)) { + temp_a1 = temp_s1 + temp_s6 + 0x28; + if ((temp_v0->unkA >= temp_s1) && (temp_a1 >= temp_v0->unk4)) { + if (func_802AF0FC(temp_s1, temp_a1, temp_s2, temp_a3, (u16) var_s0) == 1) { + temp_v0_2 = (((var_s7 << 5) + var_s5) * 4) + &D_8014F110; + if (temp_v0_2->unk2 == 0) { + temp_v0_2->unk0 = (u16) D_8015F58A; + } + temp_v0_2->unk2 = (u16) (temp_v0_2->unk2 + 1); + *(D_8015F584 + (D_8015F58A * 2)) = (s16) var_s0; + D_8015F58A += 1; + } + } + } + var_s0 += 1; + var_s3 += 0x2C; + } while (var_s0 < (s32) D_8015F588); + } + var_s5 += 1; + if (var_s5 != 0x20) { + goto loop_4; + } + var_s7 += 1; + } while (var_s7 != 0x20); +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AF314.s") +#endif + +void func_802AF588(s32 arg0) { + func_802AF5D8(arg0, -1, 0xFF); +} + +void func_802AF5AC(s32 arg0, s8 arg1) { + func_802AF5D8(arg0, arg1, 0xFF); +} + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +void func_802AEB14(u32, s8, s32); // extern +void func_802AEBA4(u32, u32, s8, s32); // extern +void func_802AECA0(u32, s8, s32); // extern +void func_802AED6C(u32, s32, u32); // extern +extern s16 D_8015F6FA; +extern s16 D_8015F6FC; +extern uintptr_t gSegmentTable; + +void func_802AF5D8(u32 arg0, s8 arg1, s32 arg2) { + s32 temp_s5; + s32 temp_v0; + u32 temp_s0; + u32 temp_s1; + void *phi_s3; + s32 phi_s6; + s32 phi_s6_2; + + D_8015F6FA = 0; + temp_s5 = arg2 & 0xFFFF; + D_8015F6FC = 0; + phi_s3 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; + phi_s6_2 = 0; +loop_1: + temp_s0 = phi_s3->unk0; + temp_s1 = phi_s3->unk4; + temp_v0 = temp_s0 & 0xFF000000; + if (temp_v0 == 0x6000000) { + func_802AF5D8(temp_s1, arg1, temp_s5 & 0xFFFF); + phi_s6 = phi_s6_2 + 1; + goto block_12; + } + if (temp_v0 == 0x4000000) { + func_802AED6C(temp_s1, (temp_s0 >> 0xA) & 0x3F, ((temp_s0 >> 0x10) & 0xFF) >> 1); + phi_s6 = phi_s6_2 + 1; + goto block_12; + } + if (temp_v0 == 0xBF000000) { + D_8015F58C += 1; + func_802AEB14(temp_s1, arg1, temp_s5 & 0xFFFF); + phi_s6 = phi_s6_2 + 1; + goto block_12; + } + if (temp_v0 == 0xB1000000) { + D_8015F58C += 2; + func_802AEBA4(temp_s0, temp_s1, arg1, temp_s5 & 0xFFFF); + phi_s6 = phi_s6_2 + 1; + goto block_12; + } + if (temp_v0 == 0xB5000000) { + D_8015F58C += 2; + func_802AECA0(temp_s1, arg1, temp_s5 & 0xFFFF); + phi_s6 = phi_s6_2 + 1; + goto block_12; + } + phi_s6 = phi_s6_2 + 1; + if (temp_v0 != 0xB8000000) { +block_12: + phi_s3 += 8; + phi_s6_2 = phi_s6; + if (phi_s6 != 0x1FFF) { + goto loop_1; + } + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AF5D8.s") +#endif + +void func_802AF7B4(uintptr_t addr, s32 uls, s32 ult) { + s32 segment = SEGMENT_NUMBER2(addr); + s32 offset = SEGMENT_OFFSET(addr); + Gfx *phi_v0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); + s32 gfxCommand; + + uls = (uls << 12) & 0xFFF000; + ult &= 0xFFF; + + while(1) { + + gfxCommand = phi_v0->words.w0 & 0xFF000000; + + if (gfxCommand == G_ENDDL << 24) { + break; + } else if (gfxCommand == (G_SETTILESIZE << 24)) { + phi_v0->words.w0 = 0xF2000000 | uls | ult; + + break; + } + phi_v0++; + } +} + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +extern uintptr_t gSegmentTable; + +void func_802AF83C(u32 arg0, u32 arg1, ? arg2, s8 arg3, u8 arg4, u8 arg5, u8 arg6) { + u32 temp_v1; + void *phi_v0; + u32 phi_v1; + + phi_v0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; + phi_v1 = 0; + if (arg1 != 0) { + do { + temp_v1 = phi_v1 + 1; + phi_v1 = temp_v1; + if (arg4 != 0) { + phi_v0->unkC = arg4; + phi_v0->unkD = arg5; + phi_v0->unkE = arg6; + } + phi_v0->unkF = arg3; + phi_v0 += 0x10; + } while (temp_v1 < arg1); + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AF83C.s") +#endif + +#ifdef MIPS_TO_C +//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 +void func_802AF83C(u32, s32, u32, s8, s32, s32, s32); // extern +extern uintptr_t gSegmentTable; + +void func_802AF8BC(u32 arg0, s8 arg1, s32 arg2, s32 arg3, u8 arg4) { + s32 temp_s2; + s32 temp_s3; + s32 temp_v1; + u32 temp_a0; + u32 temp_v0; + void *phi_s0; + + temp_s2 = arg2 & 0xFF; + temp_s3 = arg3 & 0xFF; + phi_s0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; +loop_1: + temp_v0 = phi_s0->unk0; + temp_a0 = phi_s0->unk4; + temp_v1 = temp_v0 & 0xFF000000; + if (temp_v1 != 0xB8000000) { + if (temp_v1 == 0x6000000) { + func_802AF8BC(temp_a0, arg1, temp_s2 & 0xFF, temp_s3 & 0xFF, arg4); + phi_s0 += 8; + } else { + if (temp_v1 == 0x4000000) { + func_802AF83C(temp_a0, (temp_v0 >> 0xA) & 0x3F, ((temp_v0 >> 0x10) & 0xFF) >> 1, arg1, temp_s2, temp_s3, arg4); + } + phi_s0 += 8; + } + goto loop_1; + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AF8BC.s") +#endif + +void func_802AF9F0(Vec3f arg0, f32 arg1, Vec3f arg2) { + arg2[0] -= arg0[0] * arg1; + arg2[1] -= arg0[1] * arg1; + arg2[2] -= arg0[2] * arg1; +} + +#ifdef MIPS_TO_C +//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 */ +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 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; + s16 spFC; + s16 spFA; + s16 spF8; + f32 spD4; + s32 sp8C; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f0_3; + f32 temp_f0_4; + f32 temp_f0_5; + f32 temp_f0_6; + f32 temp_f20; + f32 temp_f22; + f32 temp_f24; + f32 temp_f26; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 temp_f2_5; + f32 temp_f2_6; + 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; + + sp104 = 1000.0f; + sp108 = 1000.0f; + sp10C = 1000.0f; + temp_f20 = player->boundingBoxSize; + spFE = 0x1388; + sp100 = 0x1388; + sp102 = 0x1388; + spF8 = 0; + spFA = 0; + spFC = 0; + temp_v0 = corner->surfaceFlags; + 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; + } + } + 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 ((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 + (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) && !((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; + 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 loop_34; + } +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; + } + } + 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 block_22; + case 0x0: + goto block_22; + } +} +#else +GLOBAL_ASM("asm/non_matchings/code_802AAA70/func_802AFA34.s") +#endif diff --git a/src/code_802AAA70.h b/src/code_802AAA70.h new file mode 100644 index 000000000..6f838d459 --- /dev/null +++ b/src/code_802AAA70.h @@ -0,0 +1,31 @@ +#ifndef CODE_802AAA70_H +#define CODE_802AAA70_H + +#include "common_structs.h" + +void nullify_displaylist(uintptr_t); +void func_802AAAAC(UnkActorInner*); +s8 func_802ABD10(u16); +s16 func_802ABD40(u16); +s16 func_802ABD7C(u16); +s16 func_802ABDB8(u16); +s16 func_802ABDF4(u16); +f32 func_802ABE30(f32, f32, f32, u16); +f32 func_802ABEAC(UnkActorInner*, Vec3f); +void process_shell_collision(Vec3f, f32, Vec3f, f32); +void func_802AC098(UnkActorInner*, f32*); +void func_802AC114(Vec3f, f32, Vec3f, f32); +void func_802AD950(UnkActorInner*, f32, f32, f32, f32, f32, f32, f32); +s32 func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); +f32 func_802AE1C0(f32, f32, f32); +s32 func_802AEE1C(s16, s16, s16, s16, s16, s16, s16, s16); +s32 func_802AF0FC(s16, s16, s16, s16, u16); +void func_802AF314(); +void func_802AF588(s32); +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); + +#endif diff --git a/src/main.h b/src/main.h index d6d7c8feb..adc737900 100644 --- a/src/main.h +++ b/src/main.h @@ -114,6 +114,4 @@ extern struct UnkStruct_800DC5EC *D_800DC5EC; extern u16 D_800DC5B0; extern s32 gPlayerWinningIndex; -extern s32 gEnableResourceMeters; - #endif diff --git a/src/math_util.c b/src/math_util.c index 93b2ff347..185d9ecb2 100644 --- a/src/math_util.c +++ b/src/math_util.c @@ -193,13 +193,13 @@ void mtxf_translate(Mat4 dest, Vec3f b) { dest[3][1] = b[1]; dest[3][2] = b[2]; } -extern f64 D_802B9FB0; // = 0.017453292222222222; + // Note the use of `2` which generates diff asm than just using floats (2.0f). void func_802B5564(Mat4 arg0, u16 *arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { f32 temp; s32 i, j; mtxf_identity(arg0); - arg2 *= D_802B9FB0; + arg2 *= 0.017453292222222222; temp = cosf(arg2 / 2) / sinf(arg2 / 2); arg0[0][0] = temp / arg3; arg0[1][1] = temp; @@ -1004,7 +1004,6 @@ GLOBAL_ASM("asm/non_matchings/math_util/func_802B75F8.s") * Helper function for atan2s. Does a look up of the arctangent of y/x assuming * the resulting angle is in range [0, 0x2000] (1/8 of a circle). */ -extern f32 D_802B9FD8; // = 1000000.0f; u16 atan2_lookup(f32 y, f32 x) { u16 ret; @@ -1012,7 +1011,7 @@ u16 atan2_lookup(f32 y, f32 x) { if (x == 0) { ret = gArctanTable[0]; } else { - if (D_802B9FD8 < y / x) { + if (1000000.0f < y / x) { if (y > 0.0f) { ret = 0x4000; } else { @@ -1125,10 +1124,8 @@ f32 func_802B79F0(f32 arg0, f32 arg1) { GLOBAL_ASM("asm/non_matchings/math_util/func_802B79F0.s") #endif -extern f64 D_802BA018; // = 3.141592653589793; - UNUSED u16 func_802B7B50(f32 arg0, f32 arg1) { - return ((func_802B79B8(arg0, arg1) * 32768.0f) / D_802BA018); + return ((func_802B79B8(arg0, arg1) * 32768.0f) / 3.141592653589793); } UNUSED void func_802B7C18(f32 arg0) { diff --git a/src/math_util.h b/src/math_util.h index 6f1fb086a..738857877 100644 --- a/src/math_util.h +++ b/src/math_util.h @@ -70,9 +70,6 @@ f32 coss(u16); s32 func_802B8058(u16, u16, u16); f32 func_802B80D0(Vec3f, Vec3f, u16, f32, f32, f32); -extern f64 D_802B9FB0; // = 0.017453292222222222; -extern f32 D_802B9FD8; // = 1000000.0f; -extern f64 D_802BA018; // = 3.141592653589793; extern u16 gRandomSeed16; #endif // MATH_UTIL_H diff --git a/src/math_util_2.c b/src/math_util_2.c index f9d8d0c0f..f84876bf5 100644 --- a/src/math_util_2.c +++ b/src/math_util_2.c @@ -8,6 +8,7 @@ #include "objects.h" #include "memory.h" +#include "code_802AAA70.h" #pragma intrinsic (sqrtf) diff --git a/src/memory.c b/src/memory.c index 8666d95cc..8775f3303 100644 --- a/src/memory.c +++ b/src/memory.c @@ -12,7 +12,6 @@ #include "variables.h" #include "common_structs.h" #include "math_util.h" -#include <actor_types.h> //#include "segment_symbols.h" #include "segments.h" @@ -1047,7 +1046,7 @@ loop_1: goto loop_1; case 0x10: func_802A884C(temp_s1, temp_s0, (s8) temp_a0); - goto loop_1; + goto loop_1; case 0x11: func_802A884C(temp_s1, temp_s0, (s8) temp_a0); goto loop_1; @@ -1383,2795 +1382,3 @@ s32 load_course(s32 courseId) { gPrevLoadedAddress = prevLoadedAddress_saved; return temp_v0; } - -// Used for the choco mountain guard rail -void nullify_displaylist(uintptr_t addr) { - s32 segment = SEGMENT_NUMBER2(addr); - s32 offset = SEGMENT_OFFSET(addr); - - Gfx *macro; - - macro = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); - macro->words.w0 = G_ENDDL << 24; - macro->words.w1 = 0; -} - -void func_802AAAAC(UnkActorInner *arg0) { - arg0->unk36 = 0x1388; - arg0->unk38 = 0x1388; - arg0->unk3A = 0x1388; - arg0->unk30 = 0; - arg0->unk32 = 0; - arg0->unk34 = 0; - arg0->unk3C[0] = 0; - arg0->unk3C[1] = 0; - arg0->unk3C[2] = 0; - vec3f_set(arg0->unk48, 0.0f, 0.0f, 1.0f); - vec3f_set(arg0->unk54, 1.0f, 0.0f, 0.0f); - vec3f_set(arg0->unk60, 0.0f, 1.0f, 0.0f); -} - -#ifdef MIPS_TO_C -//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(Player *player) { - f32 sp1C; - f32 sp18; - f32 temp_f0; - f32 temp_f2; - s16 temp_v0; - s32 temp_v1; - - temp_v0 = gCurrentCourseId; - 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; - } - if (temp_f0 < 67.0f) { - goto block_43; - } - if (D_802B9E10 < temp_f2) { - goto block_43; - } - if (temp_f2 < D_802B9E14) { - goto block_43; - } - return D_802B9E18; - 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; - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AAB4C.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -static f32 D_802B9E48 = -0.9f; - -s32 func_802AAE4C(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { - f32 sp6C; - f32 sp64; - f32 sp3C; - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp18; - f32 sp14; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f10; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f4; - f32 temp_f8; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - s32 var_v0_2; - - temp_v1 = &D_8015F580[arg5]; - temp_f0 = temp_v1->gravity; - var_v0_2 = 1; - if (temp_f0 < D_802B9E48) { - return 0; - } - if (arg2 < (f32) temp_v1->vtx3[0]) { - return 0; - } - if (arg4 < (f32) temp_v1->vtx3[2]) { - return 0; - } - if ((f32) temp_v1->vtx2[0] < arg2) { - return 0; - } - if ((f32) temp_v1->vtx2[2] < arg4) { - return 0; - } - sp2C = temp_f0; - if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp6C = (f32) temp_a3->v.ob[0]; - sp8 = arg4; - sp10 = arg2; - temp_f8 = (f32) temp_a0->v.ob[2] - arg4; - sp64 = (f32) temp_a3->v.ob[2]; - temp_f4 = (f32) temp_a2->v.ob[0] - arg2; - sp28 = temp_f8; - sp24 = temp_f4; - sp20 = (f32) temp_a0->v.ob[0] - arg2; - temp_f0_2 = temp_f8 * temp_f4; - sp8 = temp_f8; - spC = temp_f4; - sp1C = (f32) temp_a2->v.ob[2] - arg4; - temp_f2 = sp20 * sp1C; - temp_f10 = temp_f0_2 - temp_f2; - sp18 = temp_f10; - sp3C = temp_f10; - if (temp_f2 == temp_f0_2) { - sp14 = arg4; - temp_f0_3 = sp6C - sp10; - temp_f2_2 = sp64 - arg4; - if ((((sp1C * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_3 * sp8))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f2_3 = sp64 - arg4; - temp_f0_4 = sp6C - arg2; - temp_f14 = sp24 * temp_f2_3; - temp_f12 = sp1C * temp_f0_4; - if (temp_f14 == temp_f12) { - if ((sp3C * ((temp_f2_3 * sp20) - (temp_f0_4 * sp28))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp18 * temp_f16) < 0.0f) { - var_v0_2 = 0; - } else { - temp_f14_2 = temp_f0_4 * sp28; - temp_f12_2 = temp_f2_3 * sp20; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0_2 = 0; - } - } - } - } - if (var_v0_2 == 0) { - return 0; - } - temp_f0_5 = ((temp_v1->height * arg2) + (sp2C * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; - if (temp_f0_5 > 0.0f) { - if (temp_f0_5 < arg0->unk3C[2]) { - arg0->unk34 = 1; - arg0->unk3A = arg5; - arg0->unk3C[2] = temp_f0_5; - arg0->unk60[0] = temp_v1->height; - arg0->unk60[1] = temp_v1->gravity; - arg0->unk60[2] = temp_v1->rotation; - } - return 0; - } - var_v0 = 0; - if (temp_f0_5 > -16.0f) { - arg0->unk34 = 1; - arg0->unk3A = arg5; - arg0->unk3C[2] = temp_f0_5; - var_v0 = 1; - arg0->unk60[0] = temp_v1->height; - arg0->unk60[1] = temp_v1->gravity; - arg0->unk60[2] = temp_v1->rotation; - } - return var_v0; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AAE4C.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802AB288(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { - f32 sp70; - f32 sp6C; - f32 sp3C; - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp14; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - f32 temp_f4; - f32 temp_f6; - f32 temp_f8; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - s32 var_v0_2; - - temp_v1 = &D_8015F580[arg5]; - var_v0_2 = 1; - if (arg2 < (f32) temp_v1->vtx3[0]) { - return 0; - } - if ((f32) temp_v1->vtx2[0] < arg2) { - return 0; - } - if ((f32) temp_v1->vtx2[1] < arg3) { - return 0; - } - if (arg3 < (f32) temp_v1->vtx3[1]) { - return 0; - } - temp_f2 = arg1 * 3.0f; - if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { - return 0; - } - if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp70 = (f32) temp_a3->v.ob[0]; - sp8 = arg3; - sp10 = arg2; - temp_f4 = (f32) temp_a0->v.ob[1] - arg3; - sp6C = (f32) temp_a3->v.ob[1]; - temp_f8 = (f32) temp_a2->v.ob[0] - arg2; - sp2C = temp_f4; - sp28 = temp_f8; - sp24 = (f32) temp_a0->v.ob[0] - arg2; - temp_f0 = temp_f4 * temp_f8; - sp8 = temp_f4; - spC = temp_f8; - sp20 = (f32) temp_a2->v.ob[1] - arg3; - temp_f2_2 = sp24 * sp20; - temp_f6 = temp_f0 - temp_f2_2; - sp1C = temp_f6; - sp3C = temp_f6; - if (temp_f2_2 == temp_f0) { - sp14 = arg3; - temp_f0_2 = sp70 - sp10; - temp_f2_3 = sp6C - arg3; - if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f2_4 = sp6C - arg3; - temp_f0_3 = sp70 - arg2; - temp_f14 = sp28 * temp_f2_4; - temp_f12 = sp20 * temp_f0_3; - if (temp_f14 == temp_f12) { - if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp1C * temp_f16) < 0.0f) { - var_v0_2 = 0; - } else { - temp_f14_2 = temp_f0_3 * sp2C; - temp_f12_2 = temp_f2_4 * sp24; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0_2 = 0; - } - } - } - } - if (var_v0_2 == 0) { - return 0; - } - temp_f0_4 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; - if (temp_f0_4 > 0.0f) { - if (temp_f0_4 < arg0->unk3C[0]) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - } - return 0; - } - var_v0 = 0; - if (temp_f0_4 > -16.0f) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4; - var_v0 = 1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - } - return var_v0; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AB288.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802AB6C4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5) { - f32 sp68; - f32 sp64; - f32 sp38; - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp14; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f10; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f4; - f32 temp_f6; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - s32 var_v0_2; - - temp_v1 = &D_8015F580[arg5]; - var_v0_2 = 1; - if (arg4 < (f32) temp_v1->vtx3[2]) { - return 0; - } - if ((f32) temp_v1->vtx2[2] < arg4) { - return 0; - } - if ((f32) temp_v1->vtx2[1] < arg3) { - return 0; - } - if (arg3 < (f32) temp_v1->vtx3[1]) { - return 0; - } - temp_f0 = arg1 * 3.0f; - if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { - return 0; - } - if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp64 = (f32) temp_a3->v.ob[2]; - sp8 = arg3; - sp10 = arg4; - temp_f6 = (f32) temp_a0->v.ob[1] - arg3; - sp68 = (f32) temp_a3->v.ob[1]; - temp_f10 = (f32) temp_a2->v.ob[2] - arg4; - sp2C = temp_f6; - sp28 = temp_f10; - sp24 = (f32) temp_a0->v.ob[2] - arg4; - temp_f0_2 = temp_f6 * temp_f10; - sp8 = temp_f6; - spC = temp_f10; - sp20 = (f32) temp_a2->v.ob[1] - arg3; - temp_f2 = sp24 * sp20; - temp_f4 = temp_f0_2 - temp_f2; - sp1C = temp_f4; - sp38 = temp_f4; - if (temp_f2 == temp_f0_2) { - sp14 = arg3; - temp_f0_3 = sp64 - sp10; - temp_f2_2 = sp68 - arg3; - if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f2_3 = sp68 - arg3; - temp_f0_4 = sp64 - arg4; - temp_f14 = sp28 * temp_f2_3; - temp_f12 = sp20 * temp_f0_4; - if (temp_f14 == temp_f12) { - if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { - var_v0_2 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp1C * temp_f16) < 0.0f) { - var_v0_2 = 0; - } else { - temp_f14_2 = temp_f0_4 * sp2C; - temp_f12_2 = temp_f2_3 * sp24; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0_2 = 0; - } - } - } - } - if (var_v0_2 == 0) { - return 0; - } - temp_f0_5 = ((temp_v1->height * arg2) + (temp_v1->gravity * arg3) + (temp_v1->rotation * arg4) + temp_v1->height2) - arg1; - if (temp_f0_5 > 0.0f) { - if (temp_f0_5 < arg0->unk3C[1]) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - } - return 0; - } - var_v0 = 0; - if (temp_f0_5 > -16.0f) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5; - var_v0 = 1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - } - return var_v0; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AB6C4.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802ABB04(f32 arg0, f32 arg1, s32 arg2) { - f32 sp6C; - f32 sp64; - f32 sp60; - f32 sp58; - f32 sp3C; - f32 sp28; - f32 sp20; - f32 sp1C; - Vtx *temp_a0; - Vtx *temp_a1; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f10; - f32 temp_f12; - f32 temp_f14; - f32 temp_f16; - f32 temp_f16_2; - f32 temp_f18; - f32 temp_f20; - f32 temp_f22; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f6; - mk64_surface_map_ram *temp_v0; - s32 var_v1; - - temp_v0 = &D_8015F580[arg2 & 0xFFFF]; - temp_a1 = temp_v0->vtxs[1]; - temp_a0 = temp_v0->vtxs[0]; - var_v1 = 1; - sp60 = (f32) temp_a1->v.ob[0]; - temp_f20 = (f32) temp_a0->v.ob[2] - arg1; - sp58 = (f32) temp_a1->v.ob[2]; - temp_a3 = temp_v0->vtxs[2]; - temp_f22 = (f32) temp_a0->v.ob[0] - arg0; - sp6C = (f32) temp_a3->v.ob[0]; - temp_f10 = sp60 - arg0; - temp_f0 = temp_f20 * temp_f10; - sp28 = temp_f10; - sp64 = (f32) temp_a3->v.ob[2]; - temp_f6 = sp58 - arg1; - temp_f2 = temp_f22 * temp_f6; - sp20 = temp_f6; - sp1C = temp_f0 - temp_f2; - sp3C = sp1C; - if (temp_f2 == temp_f0) { - temp_f0_2 = sp6C - arg0; - temp_f2_2 = sp64 - arg1; - if ((((temp_f6 * temp_f0_2) - (temp_f10 * temp_f2_2)) * ((temp_f2_2 * temp_f22) - (temp_f0_2 * temp_f20))) < 0.0f) { - var_v1 = 0; - } - } else { - temp_f2_3 = sp64 - arg1; - temp_f0_3 = sp6C - arg0; - temp_f18 = sp28 * temp_f2_3; - temp_f16 = sp20 * temp_f0_3; - if (temp_f18 == temp_f16) { - if ((sp3C * ((temp_f2_3 * temp_f22) - (temp_f0_3 * temp_f20))) < 0.0f) { - var_v1 = 0; - } - } else { - temp_f12 = temp_f16 - temp_f18; - if ((sp1C * temp_f12) < 0.0f) { - var_v1 = 0; - } else { - temp_f16_2 = temp_f0_3 * temp_f20; - temp_f14 = temp_f2_3 * temp_f22; - if ((temp_f16_2 != temp_f14) && ((temp_f12 * (temp_f14 - temp_f16_2)) < 0.0f)) { - var_v1 = 0; - } - } - } - } - return var_v1; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802ABB04.s") -#endif - -s8 func_802ABD10(u16 arg0) { - mk64_surface_map_ram *tile = &D_8015F580[arg0]; - return tile->surfaceType; -} - -s16 func_802ABD40(u16 arg0) { - mk64_surface_map_ram *tile = &D_8015F580[arg0]; - return tile->flags & 0xFF; -} - -s16 func_802ABD7C(u16 arg0) { - mk64_surface_map_ram *tile = &D_8015F580[arg0]; - return tile->flags & 0x1000; -} - -s16 func_802ABDB8(u16 arg0) { - mk64_surface_map_ram *tile = &D_8015F580[arg0]; - return tile->flags & 0x400; -} - -s16 func_802ABDF4(u16 arg0) { - mk64_surface_map_ram *tile = &D_8015F580[arg0]; - return tile->flags & 0x800; -} - -f32 func_802ABE30(f32 arg0, f32 arg1, f32 arg2, u16 arg3) { - mk64_surface_map_ram *tile = &D_8015F580[arg3]; - if (tile->gravity == 0.0f) { - return arg1; - } - return ((tile->height * arg0) + (tile->rotation * arg2) + tile->height2) / -tile->gravity; -} - -f32 func_802ABEAC(UnkActorInner *arg0, Vec3f arg1) { - if (arg0->unk34 == 1) { - return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk3A); - } - if (arg0->unk30 == 1) { - return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk36); - } - if (arg0->unk32 == 1) { - return func_802ABE30(arg1[0], arg1[1], arg1[2], arg0->unk38); - } - return arg1[1]; -} - -#ifdef MIPS_TO_C -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -void process_shell_collision(f32 *arg0, f32 arg1, f32 *velocity, f32 arg3) { - f32 sp40; - f32 sp3C; - f32 sp38; - f32 sp24; - f32 spC; - f32 sp8; - f32 sp4; - f32 sp0; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f10; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f16_2; - f32 temp_f16_3; - f32 temp_f18; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f6; - f64 temp_f16; - - temp_f2 = velocity->unk0; - temp_f12 = velocity->unk4; - temp_f14 = velocity->unk8; - temp_f0 = sqrtf((temp_f2 * temp_f2) + (temp_f12 * temp_f12) + (temp_f14 * temp_f14)); - temp_f16 = (f64) temp_f0; - sp24 = temp_f0; - if ((temp_f16 > 4.5) || (temp_f16 < 3.5)) { - sp24 = 4.0f; - } - temp_f10 = arg0->unk8; - sp4 = temp_f10; - temp_f16_2 = arg0->unk0; - temp_f18 = arg0->unk4; - temp_f0_2 = (temp_f10 * temp_f14) + ((temp_f16_2 * temp_f2) + (temp_f18 * temp_f12)); - sp0 = temp_f16_2 * temp_f0_2; - spC = temp_f18 * temp_f0_2; - sp40 = temp_f2 - sp0; - sp3C = temp_f12 - spC; - temp_f6 = temp_f10 * temp_f0_2; - sp8 = temp_f6; - sp38 = temp_f14 - temp_f6; - temp_f2_2 = sp40 - sp0; - temp_f12_2 = sp3C - spC; - temp_f14_2 = sp38 - temp_f6; - temp_f16_3 = (1.0f / sqrtf((temp_f2_2 * temp_f2_2) + (temp_f12_2 * temp_f12_2) + (temp_f14_2 * temp_f14_2))) * sp24; - velocity->unk0 = temp_f2_2 * temp_f16_3; - velocity->unk4 = (f32) (temp_f12_2 * temp_f16_3); - velocity->unk8 = (f32) (temp_f14_2 * temp_f16_3); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/process_shell_collision.s") -#endif - -void func_802AC098(UnkActorInner *arg0, f32 *velocity) { - if (arg0->unk3C[0] < 0.0f) { - process_shell_collision(arg0->unk48, arg0->unk3C[0], velocity, 2.0f); - } - - if (arg0->unk3C[1] < 0.0f) { - process_shell_collision(arg0->unk54, arg0->unk3C[1], velocity, 2.0f); - } -} - -void func_802AC114(Vec3f arg0, f32 arg1, Vec3f arg2, f32 arg3) { - f32 temp_f0; - f32 temp_f12; - f32 temp_f14; - f32 temp_f16; - f32 temp_f18; - f32 temp_f20; - f32 temp_f2; - f32 tmp1; - f32 tmp2; - f32 tmp3; - - temp_f0 = arg2[0]; - temp_f2 = arg2[1]; - temp_f12 = arg2[2]; - temp_f14 = -arg0[0]; - temp_f16 = -arg0[1]; - temp_f18 = -arg0[2]; - temp_f20 = (temp_f14 * temp_f0) + (temp_f16 * temp_f2) + (temp_f18 * temp_f12); - tmp1 = temp_f0 - (temp_f20 * temp_f14); - tmp2 = temp_f2 - (temp_f20 * temp_f16); - tmp3 = temp_f12 - (temp_f20 * temp_f18); - if (arg1 < -3.5) { - arg2[0] = tmp1 - (temp_f20 * temp_f14 * 0.5f); - arg2[1] = tmp2 - (temp_f20 * temp_f16 * 0.5f); - arg2[2] = tmp3 - (temp_f20 * temp_f18 * 0.5f); - } else { - arg2[0] = tmp1; - arg2[1] = tmp2; - arg2[2] = tmp3; - } -} - -#ifdef MIPS_TO_C -//generated by m2c commit bece1d6db17040749f77dbbd090363cc6fb926f9 -mk64_surface_map_ram *func_802AAE4C(s16 *, ?, f32, f32, f32, s32); /* extern */ -mk64_surface_map_ram *func_802AB288(s16 *, ?, f32, f32, f32, s32); /* extern */ -mk64_surface_map_ram *func_802AB6C4(s16 *, ?, f32, f32, f32, s32); /* extern */ -extern u8 D_8014F110; -extern s32 D_8015F584; -extern s16 D_8015F6E8; -extern s16 D_8015F6EA; -extern s16 D_8015F6F0; -extern s16 D_8015F6F2; - -UNUSED mk64_surface_map_ram *func_802AC22C(void *arg0) { - f32 spE4; - f32 spE0; - f32 spDC; - s16 spD4; - s16 spD2; - s16 spD0; - s32 sp70; - f32 temp_f22; - f32 temp_f24; - f32 temp_f26; - s16 temp_v0_2; - s16 temp_v1; - s32 temp_at; - s32 temp_f4; - s32 temp_f6; - s32 temp_t3; - s32 var_s2; - u16 temp_s0; - u16 temp_v1_3; - u16 var_s1; - u16 var_v0; - u8 temp_v0; - void *temp_v1_2; - - spD0 = 0; - spD2 = 0; - spD4 = 0; - spDC = 1000.0f; - spE0 = 1000.0f; - spE4 = 1000.0f; - temp_v0 = arg0->unkD; - temp_f22 = arg0->unk0; - temp_f24 = arg0->unk4; - temp_f26 = arg0->unk8; - switch (temp_v0) { /* irregular */ - case 0x80: - if (func_802AB6C4(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); - return (mk64_surface_map_ram *)1; - } - default: -block_10: - temp_v0_2 = D_8015F6EA; - temp_v1 = D_8015F6F2; - temp_f4 = (s32) ((temp_f22 - (f32) temp_v0_2) / (f32) ((s32) (D_8015F6E8 - temp_v0_2) / 32)); - temp_f6 = (s32) ((temp_f26 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32)); - if ((s16) temp_f4 < 0) { - return NULL; - } - if ((s16) temp_f6 < 0) { - return NULL; - } - if ((s16) temp_f4 >= 0x20) { - return NULL; - } - if ((s16) temp_f6 >= 0x20) { - return NULL; - } - temp_v1_2 = ((s16) ((s16) temp_f4 + ((s16) temp_f6 << 5)) * 4) + &D_8014F110; - var_v0 = temp_v1_2->unk2; - sp70 = (s32) var_v0; - if (var_v0 == 0) { - return NULL; - } - var_s1 = temp_v1_2->unk0; - var_s2 = 0; - if (sp70 > 0) { -loop_22: - temp_s0 = *(D_8015F584 + (var_s1 * 2)); - var_v0 = (u16) &D_8015F580[temp_s0]; - temp_v1_3 = var_v0->unk0; - if ((temp_v1_3 & 0x4000) != 0) { - if (arg0->unkE != temp_s0) { - var_v0 = func_802AAE4C(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); - if (var_v0 == (u16) (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - arg0->unkD = 0x40U; - arg0->unkE = temp_s0; - arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; - if ((D_8015F580[temp_s0].flags & 0x1000) != 0) { - arg0->unk14 = (mk64_surface_map_ram *)1; - return (mk64_surface_map_ram *)1; - } - arg0->unk14 = NULL; - return (mk64_surface_map_ram *)1; - } - } - goto block_37; - } - if ((temp_v1_3 & 0x8000) != 0) { - if ((var_v0->unk1C != 1.0f) && (arg0->unkE != temp_s0)) { - var_v0 = func_802AB6C4(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); - if (var_v0 == (u16) (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - arg0->unkD = 0x80U; - arg0->unkE = temp_s0; - arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; - return (mk64_surface_map_ram *)1; - } - } - goto block_37; - } - if ((var_v0->unk24 != 1.0f) && (arg0->unkE != temp_s0)) { - var_v0 = func_802AB288(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) temp_s0); - if (var_v0 == (u16) (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, temp_s0 & 0xFFFF); - arg0->unkD = 0x20U; - arg0->unkE = temp_s0; - arg0->unkC = (s8) D_8015F580[temp_s0].surfaceType; - return (mk64_surface_map_ram *)1; - } - } -block_37: - temp_t3 = (var_s2 + 1) & 0xFFFF; - temp_at = temp_t3 < sp70; - var_s2 = temp_t3; - var_s1 = (var_s1 + 1) & 0xFFFF; - if (temp_at == 0) { - goto block_38; - } - goto loop_22; - } -block_38: - arg0->unk10 = temp_f24; - arg0->unkC = 0; - return (mk64_surface_map_ram *) var_v0; - case 0x40: - if (func_802AAE4C(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); - return (mk64_surface_map_ram *)1; - } - goto block_10; - case 0x20: - if (func_802AB288(&spD0, 0x40A00000, temp_f22, temp_f24, temp_f26, (s32) arg0->unkE) == (mk64_surface_map_ram *)1) { - arg0->unk10 = func_802ABE30(temp_f22, temp_f24, temp_f26, arg0->unkE); - return (mk64_surface_map_ram *)1; - } - goto block_10; - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AC22C.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802AC760(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { - f32 sp6C; - f32 sp64; - f32 sp38; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp18; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f10; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f12_3; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f14_3; - f32 temp_f16; - f32 temp_f16_2; - f32 temp_f18; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - f32 temp_f4; - f32 temp_f6; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - - temp_v1 = &D_8015F580[arg5]; - var_v0 = 1; - if (arg2 < (f32) temp_v1->vtx3[0]) { - return 0; - } - if (arg4 < (f32) temp_v1->vtx3[2]) { - return 0; - } - if ((f32) temp_v1->vtx2[0] < arg2) { - return 0; - } - if ((f32) temp_v1->vtx2[2] < arg4) { - return 0; - } - if (arg3 < ((f32) temp_v1->vtx3[1] - (arg1 * 3.0f))) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp6C = (f32) temp_a3->v.ob[0]; - sp8 = arg4; - sp10 = arg2; - temp_f6 = (f32) temp_a0->v.ob[2] - arg4; - sp64 = (f32) temp_a3->v.ob[2]; - temp_f4 = (f32) temp_a2->v.ob[0] - arg2; - sp28 = temp_f6; - sp24 = temp_f4; - sp20 = (f32) temp_a0->v.ob[0] - arg2; - temp_f0 = temp_f6 * temp_f4; - sp8 = temp_f6; - spC = temp_f4; - temp_f18 = sp8; - sp1C = (f32) temp_a2->v.ob[2] - arg4; - temp_f2 = sp20 * sp1C; - temp_f10 = temp_f0 - temp_f2; - sp18 = temp_f10; - sp38 = temp_f10; - if (temp_f2 == temp_f0) { - sp8 = arg4; - temp_f0_2 = sp6C - sp10; - temp_f2_2 = sp64 - arg4; - if ((((sp1C * temp_f0_2) - (spC * temp_f2_2)) * ((temp_f2_2 * sp20) - (temp_f0_2 * temp_f18))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f2_3 = sp64 - arg4; - temp_f0_3 = sp6C - arg2; - temp_f14 = sp24 * temp_f2_3; - temp_f12 = sp1C * temp_f0_3; - if (temp_f14 == temp_f12) { - if ((sp38 * ((temp_f2_3 * sp20) - (temp_f0_3 * sp28))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp18 * temp_f16) < 0.0f) { - var_v0 = 0; - } else { - temp_f14_2 = temp_f0_3 * sp28; - temp_f12_2 = temp_f2_3 * sp20; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0 = 0; - } - } - } - } - if (var_v0 == 0) { - return 0; - } - temp_f2_4 = temp_v1->height; - temp_f12_3 = temp_v1->gravity; - temp_f14_3 = temp_v1->rotation; - temp_f16_2 = temp_v1->height2; - temp_f0_4 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; - if (arg1 < temp_f0_4) { - if (temp_f0_4 < arg0->unk3C[2]) { - arg0->unk34 = 1; - arg0->unk3A = arg5; - arg0->unk3C[2] = temp_f0_4 - arg1; - arg0->unk60[0] = temp_v1->height; - arg0->unk60[1] = temp_v1->gravity; - arg0->unk60[2] = temp_v1->rotation; - } - return 0; - } - if (((temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2) < 0.0f) { - return 0; - } - arg0->unk34 = 1; - arg0->unk3A = arg5; - arg0->unk3C[2] = temp_f0_4 - arg1; - arg0->unk60[0] = temp_v1->height; - arg0->unk60[1] = temp_v1->gravity; - arg0->unk60[2] = temp_v1->rotation; - return 1; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AC760.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802ACBA4(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { - f32 sp70; - f32 sp6C; - f32 sp48; - f32 sp3C; - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp14; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f10; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f12_3; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f14_3; - f32 temp_f16; - f32 temp_f16_2; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - f32 temp_f2_5; - f32 temp_f4; - f32 temp_f4_2; - f32 temp_f6; - f32 temp_f8; - f32 var_f10; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - - temp_v1 = &D_8015F580[arg5]; - var_v0 = 1; - if (arg2 < (f32) temp_v1->vtx3[0]) { - return 0; - } - if ((f32) temp_v1->vtx2[0] < arg2) { - return 0; - } - if ((f32) temp_v1->vtx2[1] < arg3) { - return 0; - } - if (arg3 < (f32) temp_v1->vtx3[1]) { - return 0; - } - temp_f2 = arg1 * 3.0f; - if (arg4 < ((f32) temp_v1->vtx3[2] - temp_f2)) { - return 0; - } - if (((f32) temp_v1->vtx2[2] + temp_f2) < arg4) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp70 = (f32) temp_a3->v.ob[0]; - sp8 = arg3; - sp10 = arg2; - temp_f10 = (f32) temp_a0->v.ob[1] - arg3; - sp6C = (f32) temp_a3->v.ob[1]; - temp_f6 = (f32) temp_a2->v.ob[0] - arg2; - sp2C = temp_f10; - sp28 = temp_f6; - sp24 = (f32) temp_a0->v.ob[0] - arg2; - temp_f0 = temp_f10 * temp_f6; - sp8 = temp_f10; - spC = temp_f6; - sp20 = (f32) temp_a2->v.ob[1] - arg3; - temp_f2_2 = sp24 * sp20; - temp_f4 = temp_f0 - temp_f2_2; - sp1C = temp_f4; - sp3C = temp_f4; - if (temp_f2_2 == temp_f0) { - sp14 = arg3; - temp_f0_2 = sp70 - sp10; - temp_f2_3 = sp6C - arg3; - if ((((sp20 * temp_f0_2) - (spC * temp_f2_3)) * ((temp_f2_3 * sp24) - (temp_f0_2 * sp8))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f2_4 = sp6C - arg3; - temp_f0_3 = sp70 - arg2; - temp_f14 = sp28 * temp_f2_4; - temp_f12 = sp20 * temp_f0_3; - if (temp_f14 == temp_f12) { - if ((sp3C * ((temp_f2_4 * sp24) - (temp_f0_3 * sp2C))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp1C * temp_f16) < 0.0f) { - var_v0 = 0; - } else { - temp_f14_2 = temp_f0_3 * sp2C; - temp_f12_2 = temp_f2_4 * sp24; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0 = 0; - } - } - } - } - if (var_v0 == 0) { - return 0; - } - temp_f2_5 = temp_v1->height; - temp_f12_3 = temp_v1->gravity; - temp_f14_3 = temp_v1->rotation; - temp_f16_2 = temp_v1->height2; - temp_f0_4 = (temp_f2_5 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; - if (temp_v1->flags & 0x200) { - temp_f4_2 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; - sp48 = temp_f4_2; - if ((temp_f0_4 > 0.0f) && (temp_f4_2 > 0.0f)) { - if (temp_f0_4 < arg1) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4 - arg1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - return 1; - } - return 0; - } - if ((temp_f0_4 < 0.0f) && (sp48 < 0.0f)) { - temp_f0_5 = temp_f0_4 * -1.0f; - if (temp_f0_5 < arg1) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_5 - arg1; - arg0->unk48[0] = -temp_v1->height; - arg0->unk48[1] = -temp_v1->gravity; - arg0->unk48[2] = -temp_v1->rotation; - return 1; - } - return 0; - } - if ((temp_f0_4 > 0.0f) && (sp48 < 0.0f)) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = -(temp_f0_4 + arg1); - arg0->unk48[0] = -temp_v1->height; - arg0->unk48[1] = -temp_v1->gravity; - var_f10 = -temp_v1->rotation; - arg0->unk48[2] = var_f10; - return 1; - } - if ((temp_f0_4 < 0.0f) && (sp48 > 0.0f)) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4 + arg1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - return 1; - } - if (temp_f0_4 == 0.0f) { - if (sp48 >= 0.0f) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = sp48 + arg1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - return 1; - } - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = -(sp48 + arg1); - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - var_f10 = temp_v1->rotation; - arg0->unk48[2] = var_f10; - return 1; - } - return 0; - } - if (arg1 < temp_f0_4) { - if (temp_f0_4 < arg0->unk3C[0]) { - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4 - arg1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - arg0->unk48[2] = temp_v1->rotation; - } - return 0; - } - temp_f8 = (temp_f2_5 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; - sp48 = temp_f8; - if (temp_f8 < 0.0f) { - return 0; - } - arg0->unk30 = 1; - arg0->unk36 = arg5; - arg0->unk3C[0] = temp_f0_4 - arg1; - arg0->unk48[0] = temp_v1->height; - arg0->unk48[1] = temp_v1->gravity; - var_f10 = temp_v1->rotation; -block_54: - arg0->unk48[2] = var_f10; - return 1; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802ACBA4.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -s32 func_802AD278(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, u16 arg5, f32 arg6, f32 arg7, f32 arg8) { - f32 sp68; - f32 sp64; - f32 sp44; - f32 sp38; - f32 sp2C; - f32 sp28; - f32 sp24; - f32 sp20; - f32 sp1C; - f32 sp14; - f32 sp10; - f32 spC; - f32 sp8; - Vtx *temp_a0; - Vtx *temp_a2; - Vtx *temp_a3; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f0_6; - f32 temp_f10; - f32 temp_f10_2; - f32 temp_f12; - f32 temp_f12_2; - f32 temp_f12_3; - f32 temp_f14; - f32 temp_f14_2; - f32 temp_f14_3; - f32 temp_f16; - f32 temp_f16_2; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - f32 temp_f4; - f32 temp_f6; - f32 temp_f8; - f32 var_f8; - mk64_surface_map_ram *temp_v1; - s32 var_v0; - - temp_v1 = &D_8015F580[arg5]; - var_v0 = 1; - if (arg4 < (f32) temp_v1->vtx3[2]) { - return 0; - } - if ((f32) temp_v1->vtx2[2] < arg4) { - return 0; - } - if ((f32) temp_v1->vtx2[1] < arg3) { - return 0; - } - if (arg3 < (f32) temp_v1->vtx3[1]) { - return 0; - } - temp_f0 = arg1 * 3.0f; - if (arg2 < ((f32) temp_v1->vtx3[0] - temp_f0)) { - return 0; - } - if (((f32) temp_v1->vtx2[0] + temp_f0) < arg2) { - return 0; - } - temp_a0 = temp_v1->vtxs[0]; - temp_a3 = temp_v1->vtxs[2]; - temp_a2 = temp_v1->vtxs[1]; - sp64 = (f32) temp_a3->v.ob[2]; - sp8 = arg3; - sp10 = arg4; - temp_f8 = (f32) temp_a0->v.ob[1] - arg3; - sp68 = (f32) temp_a3->v.ob[1]; - temp_f6 = (f32) temp_a2->v.ob[2] - arg4; - sp2C = temp_f8; - sp28 = temp_f6; - sp24 = (f32) temp_a0->v.ob[2] - arg4; - temp_f0_2 = temp_f8 * temp_f6; - sp8 = temp_f8; - spC = temp_f6; - sp20 = (f32) temp_a2->v.ob[1] - arg3; - temp_f2 = sp24 * sp20; - temp_f10 = temp_f0_2 - temp_f2; - sp1C = temp_f10; - sp38 = temp_f10; - if (temp_f2 == temp_f0_2) { - sp14 = arg3; - temp_f0_3 = sp64 - sp10; - temp_f2_2 = sp68 - arg3; - if ((((sp20 * temp_f0_3) - (spC * temp_f2_2)) * ((temp_f2_2 * sp24) - (temp_f0_3 * sp8))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f2_3 = sp68 - arg3; - temp_f0_4 = sp64 - arg4; - temp_f14 = sp28 * temp_f2_3; - temp_f12 = sp20 * temp_f0_4; - if (temp_f14 == temp_f12) { - if ((sp38 * ((temp_f2_3 * sp24) - (temp_f0_4 * sp2C))) < 0.0f) { - var_v0 = 0; - } - } else { - temp_f16 = temp_f12 - temp_f14; - if ((sp1C * temp_f16) < 0.0f) { - var_v0 = 0; - } else { - temp_f14_2 = temp_f0_4 * sp2C; - temp_f12_2 = temp_f2_3 * sp24; - if ((temp_f14_2 != temp_f12_2) && ((temp_f16 * (temp_f12_2 - temp_f14_2)) < 0.0f)) { - var_v0 = 0; - } - } - } - } - if (var_v0 == 0) { - return 0; - } - temp_f2_4 = temp_v1->height; - temp_f12_3 = temp_v1->gravity; - temp_f14_3 = temp_v1->rotation; - temp_f16_2 = temp_v1->height2; - temp_f0_5 = (temp_f2_4 * arg2) + (temp_f12_3 * arg3) + (temp_f14_3 * arg4) + temp_f16_2; - if (temp_v1->flags & 0x200) { - temp_f10_2 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; - sp44 = temp_f10_2; - if ((temp_f0_5 > 0.0f) && (temp_f10_2 > 0.0f)) { - if (temp_f0_5 < arg1) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5 - arg1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - return 1; - } - return 0; - } - if ((temp_f0_5 < 0.0f) && (sp44 < 0.0f)) { - temp_f0_6 = temp_f0_5 * -1.0f; - if (temp_f0_6 < arg1) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_6 - arg1; - arg0->unk54[0] = -temp_v1->height; - arg0->unk54[1] = -temp_v1->gravity; - arg0->unk54[2] = -temp_v1->rotation; - return 1; - } - return 0; - } - if ((temp_f0_5 > 0.0f) && (sp44 < 0.0f)) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = -(temp_f0_5 + arg1); - arg0->unk54[0] = -temp_v1->height; - arg0->unk54[1] = -temp_v1->gravity; - var_f8 = -temp_v1->rotation; - arg0->unk54[2] = var_f8; - return 1; - } - if ((temp_f0_5 < 0.0f) && (sp44 > 0.0f)) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5 + arg1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - return 1; - } - if (temp_f0_5 == 0.0f) { - if (sp44 >= 0.0f) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = sp44 + arg1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - return 1; - } - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = -(sp44 + arg1); - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - var_f8 = temp_v1->rotation; - arg0->unk54[2] = var_f8; - return 1; - } - return 0; - } - if (arg1 < temp_f0_5) { - if (temp_f0_5 < arg0->unk3C[1]) { - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5 - arg1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - arg0->unk54[2] = temp_v1->rotation; - } - return 0; - } - temp_f4 = (temp_f2_4 * arg6) + (temp_f12_3 * arg7) + (temp_f14_3 * arg8) + temp_f16_2; - sp44 = temp_f4; - if (temp_f4 < 0.0f) { - return 0; - } - arg0->unk32 = 1; - arg0->unk38 = arg5; - arg0->unk3C[1] = temp_f0_5 - arg1; - arg0->unk54[0] = temp_v1->height; - arg0->unk54[1] = temp_v1->gravity; - var_f8 = temp_v1->rotation; - arg0->unk54[2] = var_f8; - return 1; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AD278.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit a8f43e46d33dcb7e04d9cdc44a10b3daf4c92c3b -s32 func_802AC760(f32, f32, f32, f32, f32, f32, f32, f32, f32); /* extern */ -s32 func_802ACBA4(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */ -s32 func_802AD278(UnkActorInner *, f32, f32, f32, f32, s32, f32, f32, f32); /* extern */ -extern u8 D_8014F110; -extern s32 D_8015F584; -extern s16 D_8015F6E8; -extern s16 D_8015F6EA; -extern s16 D_8015F6F0; -extern s16 D_8015F6F2; - -s32 func_802AD950(UnkActorInner *arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - s16 temp_v0_4; - s16 temp_v1; - s32 temp_f10; - s32 temp_f16; - s32 temp_t7; - u16 temp_s6; - u16 temp_v0; - u16 temp_v0_2; - u16 temp_v0_3; - u16 temp_v0_5; - u16 temp_v1_3; - void *temp_v1_2; - s32 phi_s4; - s32 phi_s4_2; - u16 phi_s2; - s32 phi_s3; - s32 phi_s4_3; - s32 phi_s4_4; - s32 phi_s4_5; - s32 phi_s4_6; - - arg0->unk30 = 0; - arg0->unk32 = 0; - arg0->unk34 = 0; - arg0->unk3C = 1000.0f; - arg0->unk40 = 1000.0f; - arg0->unk44 = 1000.0f; - temp_v0 = arg0->unk3A; - phi_s4_6 = 0; - if (((s32) temp_v0 < (s32) D_8015F588) && (func_802AC760(arg1, arg2, arg3, arg4, (bitwise f32) temp_v0, arg5, arg6, arg7) == 1)) { - phi_s4_6 = 0x00004000; - } - temp_v0_2 = arg0->unk36; - phi_s4_4 = phi_s4_6; - if (((s32) temp_v0_2 < (s32) D_8015F588) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_2, arg5, arg6, arg7) == 1)) { - phi_s4_4 = (phi_s4_6 | 0x2000) & 0xFFFF; - } - temp_v0_3 = arg0->unk38; - phi_s4 = phi_s4_4; - if (((s32) temp_v0_3 < (s32) D_8015F588) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_3, arg5, arg6, arg7) == 1)) { - phi_s4 = (phi_s4_4 | 0x8000) & 0xFFFF; - } - phi_s4_2 = phi_s4; - phi_s4_3 = phi_s4; - if (phi_s4 == 0x0000E000) { - goto block_39; - } - temp_v0_4 = D_8015F6EA; - temp_v1 = D_8015F6F2; - temp_f10 = (s32) ((arg2 - (f32) temp_v0_4) / (f32) ((s32) (D_8015F6E8 - temp_v0_4) / 32)); - temp_f16 = (s32) ((arg4 - (f32) temp_v1) / (f32) ((s32) (D_8015F6F0 - temp_v1) / 32)); - if ((s16) temp_f10 < 0) { - return 0; - } - if ((s16) temp_f16 < 0) { - return 0; - } - if ((s16) temp_f10 >= 0x20) { - return 0; - } - if ((s16) temp_f16 >= 0x20) { - return 0; - } - temp_v1_2 = ((s16) ((s16) temp_f10 + ((s16) temp_f16 << 5)) * 4) + &D_8014F110; - temp_s6 = temp_v1_2->unk2; - phi_s3 = 0; - if (temp_s6 == 0) { - - } else { - phi_s2 = temp_v1_2->unk0; - if ((s32) temp_s6 > 0) { -loop_22: - phi_s4_3 = phi_s4_2; - phi_s4_5 = phi_s4_2; - if (phi_s4_2 == 0x0000E000) { - - } else { - temp_v0_5 = *(D_8015F584 + (phi_s2 * 2)); - temp_v1_3 = D_8015F580[temp_v0_5].flags; - if ((temp_v1_3 & 0x4000) != 0) { - if (((phi_s4_2 & 0x4000) == 0) && (arg0->unk3A != temp_v0_5) && (func_802AC760((bitwise f32) arg0, arg1, arg2, arg3, arg4, (bitwise f32) temp_v0_5, arg5, arg6, arg7) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x4000) & 0xFFFF; - } - } else if ((temp_v1_3 & 0x8000) != 0) { - if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk38 != temp_v0_5) && (func_802AD278(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x8000) & 0xFFFF; - } - } else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk36 != temp_v0_5) && (func_802ACBA4(arg0, arg1, arg2, arg3, arg4, (s32) temp_v0_5, arg5, arg6, arg7) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x2000) & 0xFFFF; - } - temp_t7 = (phi_s3 + 1) & 0xFFFF; - phi_s4_2 = phi_s4_5; - phi_s2 = (phi_s2 + 1) & 0xFFFF; - phi_s3 = temp_t7; - phi_s4_3 = phi_s4_5; - if (temp_t7 < (s32) temp_s6) { - goto loop_22; - } - } - } - } -block_39: - return phi_s4_3; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AD950.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -s32 func_802AAE4C(void *, f32, f32, f32, f32, s32); // extern -s32 func_802AB288(void *, void *, f32, f32, f32, s32); // extern -s32 func_802AB6C4(void *, void *, f32, f32, f32, s32); // extern -extern u8 D_8014F110; -extern s32 D_8015F584; - -s32 func_802ADDC8(void *arg0, void *arg1, f32 arg2, f32 arg3, f32 arg4) { - s16 temp_v0_4; - s16 temp_v1; - s32 temp_f4; - s32 temp_f6; - s32 temp_t7; - u16 temp_s6; - u16 temp_v0; - u16 temp_v0_2; - u16 temp_v0_3; - u16 temp_v0_5; - u16 temp_v1_3; - void *temp_v1_2; - s32 phi_s4; - s32 phi_s4_2; - u16 phi_s2; - s32 phi_s3; - s32 phi_s4_3; - s32 phi_s4_4; - s32 phi_s4_5; - s32 phi_s4_6; - - arg0->unk0 = 0; - arg0->unk2 = 0; - arg0->unk4 = 0; - arg0->unkC = 1000.0f; - arg0->unk10 = 1000.0f; - arg0->unk14 = 1000.0f; - temp_v0 = arg0->unkA; - phi_s4_6 = 0; - if ((temp_v0 < D_8015F588) && (func_802AAE4C(arg1, arg2, arg3, arg4, (bitwise f32) temp_v0) == 1)) { - phi_s4_6 = 0x4000; - } - temp_v0_2 = arg0->unk6; - phi_s4_4 = phi_s4_6; - if ((temp_v0_2 < D_8015F588) && (func_802AB288(arg0, arg1, arg2, arg3, arg4, temp_v0_2) == 1)) { - phi_s4_4 = (phi_s4_6 | 0x2000) & 0xFFFF; - } - temp_v0_3 = arg0->unk8; - phi_s4 = phi_s4_4; - if ((temp_v0_3 < D_8015F588) && (func_802AB6C4(arg0, arg1, arg2, arg3, arg4, temp_v0_3) == 1)) { - phi_s4 = (phi_s4_4 | 0x8000) & 0xFFFF; - } - phi_s4_2 = phi_s4; - phi_s4_3 = phi_s4; - if (phi_s4 == 0xE000) { - goto block_39; - } - temp_v0_4 = D_8015F6EA; - temp_v1 = D_8015F6F2; - temp_f4 = (arg2 - temp_v0_4) / ((D_8015F6E8 - temp_v0_4) / 0x20); - temp_f6 = (arg4 - temp_v1) / ((D_8015F6F0 - temp_v1) / 0x20); - if (temp_f4 < 0) { - return 0; - } - if (temp_f6 < 0) { - return 0; - } - if (temp_f4 >= 0x20) { - return 0; - } - if (temp_f6 >= 0x20) { - return 0; - } - temp_v1_2 = ((temp_f4 + (temp_f6 << 5)) * 4) + &D_8014F110; - temp_s6 = temp_v1_2->unk2; - phi_s3 = 0; - if (temp_s6 == 0) { - - } else { - phi_s2 = temp_v1_2->unk0; - if (temp_s6 > 0) { -loop_22: - phi_s4_3 = phi_s4_2; - phi_s4_5 = phi_s4_2; - if (phi_s4_2 == 0xE000) { - - } else { - temp_v0_5 = *(D_8015F584 + (phi_s2 * 2)); - temp_v1_3 = *(D_8015F580 + (temp_v0_5 * 0x2C)); - if ((temp_v1_3 & 0x4000) != 0) { - if (((phi_s4_2 & 0x4000) == 0) && (arg0->unkA != temp_v0_5) && (func_802AAE4C(arg0, (bitwise f32) arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x4000) & 0xFFFF; - } - } else if ((temp_v1_3 & 0x8000) != 0) { - if (((phi_s4_2 & 0x8000) == 0) && (arg0->unk8 != temp_v0_5) && (func_802AB6C4(arg0, arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x8000) & 0xFFFF; - } - } else if (((phi_s4_2 & 0x2000) == 0) && (arg0->unk6 != temp_v0_5) && (func_802AB288(arg0, arg1, arg2, arg3, arg4, temp_v0_5) == 1)) { - phi_s4_5 = (phi_s4_2 | 0x2000) & 0xFFFF; - } - temp_t7 = (phi_s3 + 1) & 0xFFFF; - phi_s4_2 = phi_s4_5; - phi_s2 = (phi_s2 + 1) & 0xFFFF; - phi_s3 = temp_t7; - phi_s4_3 = phi_s4_5; - if (temp_t7 < temp_s6) { - goto loop_22; - } - } - } - } -block_39: - return phi_s4_3; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802ADDC8.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit d9d3d6575355663122de59f6b2882d8f174e2355 on Dec-09-2022 -s32 func_802ABB04(f32, f32, s32); /* extern */ -extern ? D_8014F110; -extern s32 D_8015F584; -static f32 D_802B9E4C = -3000.0f; -static f32 D_802B9E50 = 3000.0f; -static f32 D_802B9E54 = 3000.0f; -static f32 D_802B9E58 = 3000.0f; -static f32 D_802B9E5C = 3000.0f; -static f32 D_802B9E60 = 3000.0f; - -f32 func_802AE1C0(f32 arg0, f32 arg1, f32 arg2) { - f32 temp_f0; - f32 var_f20; - s32 temp_at; - s32 temp_f4; - s32 temp_f6; - s32 temp_t0; - s32 temp_t9; - s32 var_s2; - u16 temp_s0; - u16 temp_t1; - u16 var_s1; - void *temp_t2; - - var_f20 = D_802B9E4C; - temp_f4 = (s32) ((arg0 - (f32) D_8015F6EA) / (f32) ((s32) (D_8015F6E8 - D_8015F6EA) / 32)); - temp_f6 = (s32) ((arg2 - (f32) D_8015F6F2) / (f32) ((s32) (D_8015F6F0 - D_8015F6F2) / 32)); - temp_t0 = (s16) temp_f6 << 5; - temp_t2 = ((s16) ((s16) temp_f4 + temp_t0) * 4) + &D_8014F110; - temp_t1 = temp_t2->unk2; - if ((s16) temp_f4 < 0) { - return D_802B9E50; - } - if ((s16) temp_f6 & 0x04000000) { - return D_802B9E54; - } - if ((s16) temp_f4 >= 0x20) { - return D_802B9E58; - } - if (temp_t0 >= 0x400) { - return D_802B9E5C; - } - if (temp_t1 == 0) { - return D_802B9E60; - } - var_s1 = temp_t2->unk0; - var_s2 = 0; - if ((s32) temp_t1 > 0) { - do { - temp_s0 = *(D_8015F584 + (var_s1 * 2)); - if ((D_8015F580[temp_s0].flags & 0x4000) && (func_802ABB04(arg0, arg2, temp_s0 & 0xFFFF) == 1)) { - temp_f0 = func_802ABE30(arg0, arg1, arg2, temp_s0 & 0xFFFF); - if ((temp_f0 <= arg1) && (var_f20 < temp_f0)) { - var_f20 = temp_f0; - } - } - temp_t9 = (var_s2 + 1) & 0xFFFF; - temp_at = temp_t9 < (s32) temp_t1; - var_s2 = temp_t9; - var_s1 = (var_s1 + 1) & 0xFFFF; - } while (temp_at != 0); - } - return var_f20; -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AE1C0.s") -#endif - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -extern s32 D_8015F59C; -extern s32 D_8015F5A0; -extern s32 D_8015F5A4; -extern s16 D_8015F6E8; -extern s16 D_8015F6EA; -extern s16 D_8015F6F0; -extern s16 D_8015F6F2; -extern s16 D_8015F6FA; -extern s16 D_8015F6FC; -static f32 D_802B9E64 = -0.9f; -static f32 D_802B9E68 = 0.9f; -static f32 D_802B9E6C = 0.1f; -static f32 D_802B9E70 = -0.1f; - -void func_802AE434(Vtx *arg0, Vtx *arg1, Vtx *arg2, s8 arg3, u16 arg4) { - s16 spBA; - s16 spB8; - s16 spB6; - s16 spB2; - s16 spAC; - s16 spAA; - f32 sp58; - f32 sp54; - f32 sp50; - f32 sp4C; - s16 sp4A; - s16 sp48; - s16 sp44; - s16 sp42; - Vtx *sp1C; /* compiler-managed */ - f64 sp10; - f64 sp8; - f64 sp0; - Vtx *temp_t1; - Vtx *temp_t2; - Vtx *temp_t6; - f32 temp_f0; - f32 temp_f18_2; - f32 temp_f4_2; - f64 temp_f12; - f64 temp_f14; - f64 temp_f16; - f64 temp_f18; - f64 temp_f2; - f64 temp_f4; - f64 temp_f8; - mk64_surface_map_ram *temp_t0; - s16 var_a0; - s16 var_a1; - s16 var_a2; - s16 var_a3; - s16 var_t1; - s16 var_t2; - s16 var_t3; - s16 var_t4; - s16 var_t5; - s16 var_v0; - s16 var_v1; - s32 temp_a0; - s32 temp_a1; - s32 temp_a2; - s32 temp_a3; - s32 temp_v0; - s32 temp_v1; - u16 temp_a0_2; - u16 temp_a3_2; - u16 temp_v1_2; - u16 var_a1_2; - u16 var_t8; - u16 var_t9; - - temp_t0 = &D_8015F580[D_8015F588]; - temp_t0->vtxs[0] = arg0; - temp_t0->vtxs[1] = arg1; - temp_t0->vtxs[2] = arg2; - if ((arg0->v.flag != 4) || (arg1->v.flag != 4) || (temp_t0->vtxs[2]->v.flag != 4)) { - temp_t6 = temp_t0->vtxs[0]; - sp1C = temp_t6; - temp_t1 = temp_t0->vtxs[1]; - temp_t2 = temp_t0->vtxs[2]; - var_a0 = temp_t6->v.ob[0]; - var_t3 = temp_t1->v.ob[0]; - var_a2 = temp_t6->v.ob[1]; - var_a1 = temp_t6->v.ob[2]; - var_a3 = temp_t1->v.ob[1]; - var_t4 = temp_t1->v.ob[2]; - var_t5 = temp_t2->v.ob[0]; - var_v0 = temp_t2->v.ob[1]; - var_v1 = temp_t2->v.ob[2]; - if ((var_a0 == var_t3) && (var_a1 == var_t4)) { - temp_t0->vtxs[2] = arg1; - temp_t0->vtxs[1] = arg2; - var_a0 = arg0->v.ob[0]; - var_a2 = arg0->v.ob[1]; - var_a1 = arg0->v.ob[2]; - var_t3 = arg1->v.ob[0]; - var_a3 = arg1->v.ob[1]; - var_t4 = arg1->v.ob[2]; - var_t5 = arg2->v.ob[0]; - var_v0 = arg2->v.ob[1]; - var_v1 = arg2->v.ob[2]; - } - if (var_a0 >= var_t3) { - if (var_a0 >= var_t5) { - sp4A = var_a0; - } else { - goto block_12; - } - } else if (var_t3 >= var_t5) { - sp4A = var_t3; - } else { -block_12: - sp4A = var_t5; - } - if (var_a1 >= var_t4) { - if (var_a1 >= var_v1) { - sp48 = var_a1; - } else { - goto block_19; - } - } else if (var_t4 >= var_v1) { - sp48 = var_t4; - } else { -block_19: - sp48 = var_v1; - } - if (var_a2 >= var_a3) { - if (var_a2 >= var_v0) { - sp42 = var_a2; - } else { - goto block_26; - } - } else if (var_a3 >= var_v0) { - sp42 = var_a3; - } else { -block_26: - sp42 = var_v0; - } - if (var_t3 >= var_a0) { - if (var_t5 >= var_a0) { - sp44 = var_a0; - } else { - goto block_33; - } - } else if (var_t5 >= var_t3) { - sp44 = var_t3; - } else { -block_33: - sp44 = var_t5; - } - if (var_a3 >= var_a2) { - if (var_v0 >= var_a2) { - var_t2 = var_a2; - } else { - var_t2 = var_v0; - } - } else if (var_v0 >= var_a3) { - var_t2 = var_a3; - } else { - var_t2 = var_v0; - } - if (var_t4 >= var_a1) { - if (var_v1 >= var_a1) { - var_t1 = var_a1; - } else { - var_t1 = var_v1; - } - } else if (var_v1 >= var_t4) { - var_t1 = var_t4; - } else { - var_t1 = var_v1; - } - spAA = var_v1; - spB8 = var_a2; - spB2 = var_a3; - spAC = var_v0; - temp_v0 = spB2 - spB8; - temp_v1 = spAA - var_t4; - spB6 = var_a1; - spBA = var_a0; - temp_a0 = var_t4 - spB6; - temp_a1 = spAC - spB2; - temp_a2 = var_t5 - var_t3; - temp_a3 = var_t3 - spBA; - temp_f12 = (f64) ((temp_v0 * temp_v1) - (temp_a0 * temp_a1)); - temp_f18 = temp_f12 * temp_f12; - sp10 = temp_f18; - temp_f14 = (f64) ((temp_a0 * temp_a2) - (temp_a3 * temp_v1)); - temp_f8 = temp_f14 * temp_f14; - sp8 = temp_f8; - temp_f16 = (f64) ((temp_a3 * temp_a1) - (temp_v0 * temp_a2)); - temp_f4 = temp_f16 * temp_f16; - sp0 = temp_f4; - temp_f2 = (f64) sqrtf((f32) (temp_f18 + temp_f8 + temp_f4)); - if ((temp_f2 != 0.0) && ((temp_f0 = (f32) ((f64) (f32) temp_f12 / temp_f2), sp58 = temp_f0, temp_f4_2 = (f32) ((f64) (f32) temp_f14 / temp_f2), sp1C = temp_f4_2, sp54 = temp_f4_2, temp_f18_2 = (f32) ((f64) (f32) temp_f16 / temp_f2), sp50 = temp_f18_2, sp4C = -(((f32) spBA * temp_f0) + (temp_f4_2 * (f32) spB8) + (temp_f18_2 * (f32) spB6)), (D_8015F59C == 0)) || (!(temp_f4_2 < D_802B9E64) && !(D_802B9E68 < temp_f4_2))) && ((D_8015F5A0 == 0) || !(sp1C < D_802B9E6C) || !(D_802B9E70 < sp1C))) { - temp_t0->vtx2[0] = sp4A; - temp_t0->vtx3[2] = var_t1; - temp_t0->vtx3[1] = var_t2; - temp_t0->vtx3[0] = sp44; - temp_t0->vtx2[1] = sp42; - temp_t0->vtx2[2] = sp48; - if (sp44 < D_8015F6EA) { - D_8015F6EA = sp44; - } - if (var_t2 < D_8015F6EE) { - D_8015F6EE = var_t2; - } - if (var_t1 < D_8015F6F2) { - D_8015F6F2 = var_t1; - } - if (D_8015F6E8 < sp4A) { - D_8015F6E8 = sp4A; - } - if (D_8015F6EC < sp42) { - D_8015F6EC = sp42; - } - if (D_8015F6F0 < sp48) { - D_8015F6F0 = sp48; - } - temp_t0->height = sp58; - temp_t0->gravity = sp54; - var_a1_2 = arg4; - temp_t0->rotation = sp50; - temp_t0->height2 = sp4C; - temp_t0->surfaceType = (u16) arg3; - D_8015F6FA = 0; - D_8015F6FC = 0; - temp_a3_2 = temp_t0->vtxs[0]->v.flag; - temp_v1_2 = temp_t0->vtxs[1]->v.flag; - temp_a0_2 = temp_t0->vtxs[2]->v.flag; - if ((temp_a3_2 == 1) && (temp_v1_2 == 1) && (temp_a0_2 == 1)) { - var_t8 = (arg4 | 0x400) & 0xFFFF; - goto block_81; - } - if ((temp_a3_2 == 2) && (temp_v1_2 == 2) && (temp_a0_2 == 2)) { - var_a1_2 = (arg4 | 0x800) & 0xFFFF; - } else if ((temp_a3_2 == 3) && (temp_v1_2 == 3) && (temp_a0_2 == 3)) { - var_a1_2 = (arg4 | 0x1000) & 0xFFFF; - } else if (D_8015F5A4 != 0) { - var_t8 = (arg4 | 0x200) & 0xFFFF; -block_81: - var_a1_2 = var_t8; - } - temp_t0->flags = var_a1_2; - if (sp10 <= sp8) { - var_t9 = var_a1_2 | 0x4000; - if (sp0 <= sp8) { - goto block_89; - } - } - if ((sp8 < sp10) && (sp0 <= sp10)) { - temp_t0->flags |= 0x8000; - } else { - var_t9 = temp_t0->flags | 0x2000; -block_89: - temp_t0->flags = var_t9; - } - D_8015F588 += 1; - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AE434.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802AE434(s32, s32, s32, s8, s32); // extern -extern ? D_8015F668; - -void func_802AEB14(s32 arg0, s8 arg1, u16 arg2) { - func_802AE434(*(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)), *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)), arg1, arg2); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AEB14.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802AE434(s32, s32, s32, s8, s32); // extern -extern ? D_8015F668; - -void func_802AEBA4(s32 arg0, s32 arg1, s8 arg2, u16 arg3) { - s32 sp28; - s32 sp24; - s32 sp20; - - sp28 = *(&D_8015F668 + ((((arg1 & 0xFF0000) >> 0x10) >> 1) * 4)); - sp24 = *(&D_8015F668 + ((((arg1 & 0xFF00) >> 8) >> 1) * 4)); - sp20 = *(&D_8015F668 + (((arg1 & 0xFF) >> 1) * 4)); - func_802AE434(*(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)), *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)), arg2, arg3); - func_802AE434(sp28, sp24, sp20, arg2, arg3); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AEBA4.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802AE434(s32, s32, s32, s8, s32); // extern -extern ? D_8015F668; - -void func_802AECA0(s32 arg0, s8 arg1, u16 arg2) { - s32 sp2C; - s32 sp24; - s32 sp20; - s32 temp_a0; - s32 temp_a2; - - temp_a0 = *(&D_8015F668 + ((((arg0 & 0xFF0000) >> 0x10) >> 1) * 4)); - temp_a2 = *(&D_8015F668 + (((arg0 & 0xFF) >> 1) * 4)); - sp2C = temp_a0; - sp24 = temp_a2; - sp20 = *(&D_8015F668 + ((((arg0 & 0xFF000000) >> 0x18) >> 1) * 4)); - func_802AE434(temp_a0, *(&D_8015F668 + ((((arg0 & 0xFF00) >> 8) >> 1) * 4)), temp_a2, arg1, arg2); - func_802AE434(temp_a0, sp24, sp20, arg1, arg2); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AECA0.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern ? D_8015F668; -extern uintptr_t gSegmentTable; - -void func_802AED6C(u32 arg0, s32 arg1, s32 arg2) { - s32 temp_a2; - s32 temp_t0; - s32 temp_v0; - s32 temp_v0_2; - s32 temp_v0_3; - s32 temp_v0_4; - s32 temp_v0_5; - s32 temp_v1; - s32 temp_v1_2; - s32 phi_v0; - s32 *phi_a0; - s32 phi_v1; - s32 phi_v0_2; - void *phi_a0_2; - s32 phi_v1_2; - s32 phi_a2; - s32 phi_a2_2; - - temp_v0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; - phi_v0 = temp_v0; - phi_v1 = 0; - phi_v0_2 = temp_v0; - phi_a2 = arg2; - phi_v1_2 = 0; - phi_a2_2 = arg2; - if (arg1 != 0) { - temp_t0 = arg1 & 3; - if (temp_t0 != 0) { - phi_a0 = (arg2 * 4) + &D_8015F668; - do { - *phi_a0 = phi_v0; - temp_v1 = phi_v1 + 1; - temp_v0_2 = phi_v0 + 0x10; - temp_a2 = phi_a2_2 + 1; - phi_v0 = temp_v0_2; - phi_a0 += 4; - phi_v1 = temp_v1; - phi_v0_2 = temp_v0_2; - phi_a2 = temp_a2; - phi_v1_2 = temp_v1; - phi_a2_2 = temp_a2; - } while (temp_t0 != temp_v1); - if (temp_v1 != arg1) { - goto block_5; - } - } else { -block_5: - phi_a0_2 = (phi_a2 * 4) + &D_8015F668; - do { - phi_a0_2->unk0 = phi_v0_2; - temp_v0_3 = phi_v0_2 + 0x10; - phi_a0_2->unk4 = temp_v0_3; - temp_v0_4 = temp_v0_3 + 0x10; - phi_a0_2->unk8 = temp_v0_4; - temp_v0_5 = temp_v0_4 + 0x10; - phi_a0_2->unkC = temp_v0_5; - temp_v1_2 = phi_v1_2 + 4; - phi_v0_2 = temp_v0_5 + 0x10; - phi_a0_2 += 0x10; - phi_v1_2 = temp_v1_2; - } while (temp_v1_2 != arg1); - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AED6C.s") -#endif - -s32 func_802AEE1C(s16 arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, s16 arg5, s16 arg6, s16 arg7) { - f32 temp_f0; - f32 temp_f18; - f32 temp_f2; - - temp_f0 = arg6 - arg4; - temp_f2 = arg7 - arg5; - if (temp_f0 == 0.0f) { - if (arg4 < arg0) { - return 0; - } - if (arg1 < arg4) { - return 0; - } - if (temp_f2 > 0.0f) { - if ((arg5 < arg2) && (arg3 < arg7)) { - return 1; - } - } else if ((arg7 < arg2) && (arg3 < arg5)) { - return 1; - } - } else { - if (temp_f2 == 0.0f) { - if (arg5 < arg2) { - return 0; - } - if (arg3 < arg5) { - return 0; - } - if (temp_f0 > 0.0f) { - if ((arg4 < arg0) && (arg1 < arg6)) { - return 1; - } - } else if ((arg6 < arg0) && (arg1 < arg4)) { - return 1; - } - } else { - temp_f18 = ((temp_f0 / temp_f2) * (arg2 - arg5)) + arg4; - if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { - return 1; - } - temp_f18 = ((temp_f0 / temp_f2) * (arg3 - arg5)) + arg4; - if ((arg0 <= temp_f18) && (temp_f18 <= arg1)) { - return 1; - } - temp_f18 = ((temp_f2 / temp_f0) * (arg0 - arg4)) + arg5; - if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { - return 1; - } - temp_f18 = ((temp_f2 / temp_f0) * (arg1 - arg4)) + arg5; - if ((arg2 <= temp_f18) && (temp_f18 <= arg3)) { - return 1; - } - } - } - return 0; -} - -s32 func_802AF0FC(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u16 surfaceMapIndex) { - mk64_surface_map_ram *temp_v0; - s16 vx1; - s16 vz1; - s16 vx2; - s16 vz2; - s16 vx3; - s16 vz3; - - temp_v0 = &D_8015F580[surfaceMapIndex]; - vx1 = temp_v0->vtxs[0]->v.ob[0]; - vz1 = temp_v0->vtxs[0]->v.ob[2]; - vx2 = temp_v0->vtxs[1]->v.ob[0]; - vz2 = temp_v0->vtxs[1]->v.ob[2]; - vx3 = temp_v0->vtxs[2]->v.ob[0]; - vz3 = temp_v0->vtxs[2]->v.ob[2]; - if ((vx1 >= arg0) && (arg1 >= vx1) && (vz1 >= arg2) && (arg3 >= vz1)) { - return 1; - } - if ((vx2 >= arg0) && (arg1 >= vx2) && (vz2 >= arg2) && (arg3 >= vz2)) { - return 1; - } - if ((vx3 >= arg0) && (arg1 >= vx3) && (vz3 >= arg2) && (arg3 >= vz3)) { - return 1; - } - if (func_802AEE1C(arg0, arg1, arg2, arg3, vx1, vz1, vx2, vz2) == 1) { - return 1; - } - if (func_802AEE1C(arg0, arg1, arg2, arg3, vx2, vz2, vx3, vz3) == 1) { - return 1; - } - if (func_802AEE1C(arg0, arg1, arg2, arg3, vx3, vz3, vx1, vz1) == 1) { - return 1; - } - return 0; -} - -#ifdef MIPS_TO_C -//generated by m2c commit 0927f17aac197848d4ebdf0c6bbad74b01f0851c -extern ? D_8014F110; -extern s32 D_8015F584; -extern u16 D_8015F58A; -extern s16 D_8015F6E8; -extern s16 D_8015F6EA; -extern s16 D_8015F6F0; -extern s16 D_8015F6F2; -extern s32 gPrevLoadedAddress; - -void func_802AF314(void) { - s32 sp4C; - ? *var_v0; - s16 temp_a1; - s16 temp_a3; - s16 temp_s1; - s16 temp_s2; - s32 temp_fp; - s32 temp_s6; - s32 var_s0; - s32 var_s3; - s32 var_s5; - s32 var_s7; - void *temp_v0; - void *temp_v0_2; - - var_v0 = &D_8014F110; - do { - var_v0 += 0x10; - var_v0->unk-A = 0; - var_v0->unk-6 = 0; - var_v0->unk-2 = 0; - var_v0->unk-E = 0; - } while (var_v0 != &gNumActors); - D_8015F58A = 0; - D_8015F584 = gPrevLoadedAddress; - var_s7 = 0; - temp_s6 = (s32) (D_8015F6E8 - D_8015F6EA) / 32; - temp_fp = (s32) (D_8015F6F0 - D_8015F6F2) / 32; - do { - var_s5 = 0; - sp4C = temp_fp * var_s7; -loop_4: - var_s0 = 0; - var_s3 = 0; - temp_s1 = (D_8015F6EA + (temp_s6 * var_s5)) - 0x14; - temp_s2 = (D_8015F6F2 + sp4C) - 0x14; - if ((s32) D_8015F588 > 0) { - do { - temp_a3 = temp_s2 + temp_fp + 0x28; - temp_v0 = var_s3 + D_8015F580; - if ((temp_v0->unkE >= temp_s2) && (temp_a3 >= temp_v0->unk8)) { - temp_a1 = temp_s1 + temp_s6 + 0x28; - if ((temp_v0->unkA >= temp_s1) && (temp_a1 >= temp_v0->unk4)) { - if (func_802AF0FC(temp_s1, temp_a1, temp_s2, temp_a3, (u16) var_s0) == 1) { - temp_v0_2 = (((var_s7 << 5) + var_s5) * 4) + &D_8014F110; - if (temp_v0_2->unk2 == 0) { - temp_v0_2->unk0 = (u16) D_8015F58A; - } - temp_v0_2->unk2 = (u16) (temp_v0_2->unk2 + 1); - *(D_8015F584 + (D_8015F58A * 2)) = (s16) var_s0; - D_8015F58A += 1; - } - } - } - var_s0 += 1; - var_s3 += 0x2C; - } while (var_s0 < (s32) D_8015F588); - } - var_s5 += 1; - if (var_s5 != 0x20) { - goto loop_4; - } - var_s7 += 1; - } while (var_s7 != 0x20); -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AF314.s") -#endif - -void func_802AF588(s32 arg0) { - func_802AF5D8(arg0, -1, 0xFF); -} - -void func_802AF5AC(s32 arg0, s8 arg1) { - func_802AF5D8(arg0, arg1, 0xFF); -} - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802AEB14(u32, s8, s32); // extern -void func_802AEBA4(u32, u32, s8, s32); // extern -void func_802AECA0(u32, s8, s32); // extern -void func_802AED6C(u32, s32, u32); // extern -extern s16 D_8015F6FA; -extern s16 D_8015F6FC; -extern uintptr_t gSegmentTable; - -void func_802AF5D8(u32 arg0, s8 arg1, s32 arg2) { - s32 temp_s5; - s32 temp_v0; - u32 temp_s0; - u32 temp_s1; - void *phi_s3; - s32 phi_s6; - s32 phi_s6_2; - - D_8015F6FA = 0; - temp_s5 = arg2 & 0xFFFF; - D_8015F6FC = 0; - phi_s3 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; - phi_s6_2 = 0; -loop_1: - temp_s0 = phi_s3->unk0; - temp_s1 = phi_s3->unk4; - temp_v0 = temp_s0 & 0xFF000000; - if (temp_v0 == 0x6000000) { - func_802AF5D8(temp_s1, arg1, temp_s5 & 0xFFFF); - phi_s6 = phi_s6_2 + 1; - goto block_12; - } - if (temp_v0 == 0x4000000) { - func_802AED6C(temp_s1, (temp_s0 >> 0xA) & 0x3F, ((temp_s0 >> 0x10) & 0xFF) >> 1); - phi_s6 = phi_s6_2 + 1; - goto block_12; - } - if (temp_v0 == 0xBF000000) { - D_8015F58C += 1; - func_802AEB14(temp_s1, arg1, temp_s5 & 0xFFFF); - phi_s6 = phi_s6_2 + 1; - goto block_12; - } - if (temp_v0 == 0xB1000000) { - D_8015F58C += 2; - func_802AEBA4(temp_s0, temp_s1, arg1, temp_s5 & 0xFFFF); - phi_s6 = phi_s6_2 + 1; - goto block_12; - } - if (temp_v0 == 0xB5000000) { - D_8015F58C += 2; - func_802AECA0(temp_s1, arg1, temp_s5 & 0xFFFF); - phi_s6 = phi_s6_2 + 1; - goto block_12; - } - phi_s6 = phi_s6_2 + 1; - if (temp_v0 != 0xB8000000) { -block_12: - phi_s3 += 8; - phi_s6_2 = phi_s6; - if (phi_s6 != 0x1FFF) { - goto loop_1; - } - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AF5D8.s") -#endif - -void func_802AF7B4(uintptr_t addr, s32 uls, s32 ult) { - s32 segment = SEGMENT_NUMBER2(addr); - s32 offset = SEGMENT_OFFSET(addr); - Gfx *phi_v0 = VIRTUAL_TO_PHYSICAL2(gSegmentTable[segment] + offset); - s32 gfxCommand; - - uls = (uls << 12) & 0xFFF000; - ult &= 0xFFF; - - while(1) { - - gfxCommand = phi_v0->words.w0 & 0xFF000000; - - if (gfxCommand == G_ENDDL << 24) { - break; - } else if (gfxCommand == (G_SETTILESIZE << 24)) { - phi_v0->words.w0 = 0xF2000000 | uls | ult; - - break; - } - phi_v0++; - } -} - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -extern uintptr_t gSegmentTable; - -void func_802AF83C(u32 arg0, u32 arg1, ? arg2, s8 arg3, u8 arg4, u8 arg5, u8 arg6) { - u32 temp_v1; - void *phi_v0; - u32 phi_v1; - - phi_v0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; - phi_v1 = 0; - if (arg1 != 0) { - do { - temp_v1 = phi_v1 + 1; - phi_v1 = temp_v1; - if (arg4 != 0) { - phi_v0->unkC = arg4; - phi_v0->unkD = arg5; - phi_v0->unkE = arg6; - } - phi_v0->unkF = arg3; - phi_v0 += 0x10; - } while (temp_v1 < arg1); - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AF83C.s") -#endif - -#ifdef MIPS_TO_C -//generated by mips_to_c commit 3c3b0cede1a99430bfd3edf8d385802b94f91307 -void func_802AF83C(u32, s32, u32, s8, s32, s32, s32); // extern -extern uintptr_t gSegmentTable; - -void func_802AF8BC(u32 arg0, s8 arg1, s32 arg2, s32 arg3, u8 arg4) { - s32 temp_s2; - s32 temp_s3; - s32 temp_v1; - u32 temp_a0; - u32 temp_v0; - void *phi_s0; - - temp_s2 = arg2 & 0xFF; - temp_s3 = arg3 & 0xFF; - phi_s0 = *(&gSegmentTable + ((arg0 >> 0x18) * 4)) + (arg0 & 0xFFFFFF) + 0x80000000; -loop_1: - temp_v0 = phi_s0->unk0; - temp_a0 = phi_s0->unk4; - temp_v1 = temp_v0 & 0xFF000000; - if (temp_v1 != 0xB8000000) { - if (temp_v1 == 0x6000000) { - func_802AF8BC(temp_a0, arg1, temp_s2 & 0xFF, temp_s3 & 0xFF, arg4); - phi_s0 += 8; - } else { - if (temp_v1 == 0x4000000) { - func_802AF83C(temp_a0, (temp_v0 >> 0xA) & 0x3F, ((temp_v0 >> 0x10) & 0xFF) >> 1, arg1, temp_s2, temp_s3, arg4); - } - phi_s0 += 8; - } - goto loop_1; - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AF8BC.s") -#endif - -void func_802AF9F0(Vec3f arg0, f32 arg1, Vec3f arg2) { - arg2[0] -= arg0[0] * arg1; - arg2[1] -= arg0[1] * arg1; - arg2[2] -= arg0[2] * arg1; -} - -#ifdef MIPS_TO_C -//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 */ -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 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; - s16 spFC; - s16 spFA; - s16 spF8; - f32 spD4; - s32 sp8C; - f32 temp_f0; - f32 temp_f0_2; - f32 temp_f0_3; - f32 temp_f0_4; - f32 temp_f0_5; - f32 temp_f0_6; - f32 temp_f20; - f32 temp_f22; - f32 temp_f24; - f32 temp_f26; - f32 temp_f2; - f32 temp_f2_2; - f32 temp_f2_3; - f32 temp_f2_4; - f32 temp_f2_5; - f32 temp_f2_6; - 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; - - sp104 = 1000.0f; - sp108 = 1000.0f; - sp10C = 1000.0f; - temp_f20 = player->boundingBoxSize; - spFE = 0x1388; - sp100 = 0x1388; - sp102 = 0x1388; - spF8 = 0; - spFA = 0; - spFC = 0; - temp_v0 = corner->surfaceFlags; - 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; - } - } - 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 ((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 + (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) && !((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; - 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 loop_34; - } -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; - } - } - 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 block_22; - case 0x0: - goto block_22; - } -} -#else -GLOBAL_ASM("asm/non_matchings/memory/func_802AFA34.s") -#endif diff --git a/src/memory.h b/src/memory.h index 300dafd53..fb66e7cdf 100644 --- a/src/memory.h +++ b/src/memory.h @@ -86,30 +86,6 @@ void func_802A8EA8(Gfx*, u8, u8); void func_802A8F14(Gfx*, u8, u8); void func_802A94D8(Gfx*, u8, u8); void func_802A9544(Gfx*, u8, u8); -void nullify_displaylist(uintptr_t); -void func_802AAAAC(UnkActorInner*); -s8 func_802ABD10(u16); -s16 func_802ABD40(u16); -s16 func_802ABD7C(u16); -s16 func_802ABDB8(u16); -s16 func_802ABDF4(u16); -f32 func_802ABE30(f32, f32, f32, u16); -f32 func_802ABEAC(UnkActorInner*, Vec3f); -void process_shell_collision(Vec3f, f32, Vec3f, f32); -void func_802AC098(UnkActorInner*, f32*); -void func_802AC114(Vec3f, f32, Vec3f, f32); -void func_802AD950(UnkActorInner*, f32, f32, f32, f32, f32, f32, f32); -s32 func_802ADDC8(UnkActorInner*, f32, f32, f32, f32); -f32 func_802AE1C0(f32, f32, f32); -s32 func_802AEE1C(s16, s16, s16, s16, s16, s16, s16, s16); -s32 func_802AF0FC(s16, s16, s16, s16, u16); -void func_802AF314(); -void func_802AF588(s32); -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[]; diff --git a/src/profiler.c b/src/profiler.c index 05b7fd424..dd674fc40 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -7,11 +7,14 @@ struct ProfilerFrameData gProfilerFrameData[2]; extern u32 D_800DC568; extern u32 D_800DC56C; -extern s16 D_800DC664; -extern s16 D_800DC668; // gCurrentFrameIndex1? -extern s16 D_800DC66C; // gCurrentFrameIndex2? extern Gfx *gDisplayListHead; +s32 gEnableResourceMeters = 0; + +s16 D_800DC664 = 0; +s16 D_800DC668 = 1; +s16 D_800DC66C = 0; + void profiler_log_thread5_time(enum ProfilerGameEvent eventID) { gProfilerFrameData[D_800DC668].gameTimes[eventID] = osGetTime(); diff --git a/src/profiler.h b/src/profiler.h index a291bd408..567f302be 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -45,4 +45,6 @@ void profiler_log_gfx_time(enum ProfilerGfxEvent eventID); void profiler_log_vblank_time(void); void draw_profiler(void); +extern s32 gEnableResourceMeters; + #endif /* PROFILER_H */ diff --git a/src/render_courses.c b/src/render_courses.c index d3f07441e..a8025e635 100644 --- a/src/render_courses.c +++ b/src/render_courses.c @@ -8,6 +8,7 @@ #include "math_util.h" #include "memory.h" #include "code_80281780.h" +#include "code_802AAA70.h" #include "render_courses.h" f32 gFloatArray802B8790[] = { diff --git a/src/skybox_and_splitscreen.c b/src/skybox_and_splitscreen.c index 384e8b1e7..fd3dc97a9 100644 --- a/src/skybox_and_splitscreen.c +++ b/src/skybox_and_splitscreen.c @@ -515,22 +515,6 @@ void func_802A4A0C(Vtx *arg0, struct UnkStruct_800DC5EC *arg1, s32 arg2, s32 arg GLOBAL_ASM("asm/non_matchings/skybox/func_802A4A0C.s") #endif -#ifdef NEEDS_RODATA -//generated by m2c commit 9841ff34ca242f5f14b2eab2b54a7a65ac47d80f -// data/data_121DA0_2_2.s -// jtbl_802B9BB8 -extern f32 D_802B9BB4;// = 6800.0f; -extern f32 D_802B9C04;// = 2700.0f; -extern f32 D_802B9C08;// = 1500.0f; -extern f32 D_802B9C0C;// = 5000.0f; -extern f32 D_802B9C10;// = 4500.0f; -extern f32 D_802B9C14;// = 7000.0f; -extern f32 D_802B9C18;// = 6800.0f; -extern f32 D_802B9C1C;// = 1.3333334f; -extern f32 D_802B9C20;// = 0.6666667f; -extern f32 D_802B9C24;// = 2.6666667f; -extern f32 D_802B9C28;// = 1.3333334f; - void func_802A4D18(void) { f32 var_f10; @@ -584,22 +568,19 @@ void func_802A4D18(void) { } switch (gScreenModeSelection) { /* switch 1; irregular */ case SCREEN_MODE_1P: /* switch 1 */ - D_80150148 = 1.333333f; + D_80150148 = 1.33333334f; return; case SCREEN_MODE_2P_SPLITSCREEN_VERTICAL: /* switch 1 */ - D_80150148 = 2.666666f; + D_80150148 = 0.66666667f; return; case SCREEN_MODE_2P_SPLITSCREEN_HORIZONTAL: /* switch 1 */ - D_80150148 = 0.666666f; + D_80150148 = 2.66666667f; return; case SCREEN_MODE_3P_4P_SPLITSCREEN: /* switch 1 */ - D_80150148 = 1.333333f; + D_80150148 = 1.33333334f; return; } } -#else -GLOBAL_ASM("asm/non_matchings/skybox/func_802A4D18.s") -#endif void func_802A4EF4(void) { switch(gActiveScreenMode) { diff --git a/src/spawn_players.c b/src/spawn_players.c index 22b5093ff..990ac5409 100644 --- a/src/spawn_players.c +++ b/src/spawn_players.c @@ -9,6 +9,7 @@ #include "math_util.h" #include "code_80027D00.h" #include "code_80057C60.h" +#include "code_802AAA70.h" #include "render_courses.h" #include "spawn_players.h" diff --git a/src/spawn_players.h b/src/spawn_players.h index a62cb2675..6853efb91 100644 --- a/src/spawn_players.h +++ b/src/spawn_players.h @@ -26,8 +26,6 @@ void func_8003D080(); void func_8003DB5C(); extern s16 D_80165560[]; -extern s32* D_800E3C50[]; -extern u16* D_800E3890[]; extern s16 D_80165340; |
