diff --git a/include/functions.h b/include/functions.h index 70306b8..aa354e9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -36,6 +36,10 @@ s16 func_80665DE0(f32, f32, f32, f32); // TODO: Figure out why adding this here causes func_806CF42C to not match // void func_80679200(Actor*, Actor*, s32, u8, s32, s32); +void func_8067DF44(f32, f32, f32, f32, u8, u8); +s32 func_80677FA8(s32, s32); // spawnActorWrapper() +void func_807149C8(u8 arg0, u8 arg1, u8 arg2, u8 arg3); + // Heap stuff??? void func_8061130C(void *); diff --git a/progress/progress.global_asm.csv b/progress/progress.global_asm.csv index e83076b..ef50ab0 100644 --- a/progress/progress.global_asm.csv +++ b/progress/progress.global_asm.csv @@ -1471,7 +1471,7 @@ us,.code,func_806A5174,1612,no us,.code,func_806C71E8,8,yes us,.code,func_8062B630,48,no us,.code,func_806623CC,8,yes -us,.code,func_806B0354,1052,no +us,.code,func_806B0354,1052,yes us,.code,func_80671260,388,no us,.code,func_806C93E4,80,yes us,.code,func_80713764,320,no @@ -2514,7 +2514,7 @@ us,.code,func_8063BF34,696,no us,.code,func_8068A810,32,yes us,.code,func_80689B10,156,yes us,.code,func_806F4E74,72,yes -us,.code,func_806B24B8,728,no +us,.code,func_806B24B8,724,yes us,.code,func_80732534,228,no us,.code,func_806ACA88,376,no us,.code,func_80679290,164,yes diff --git a/progress/progress.total.csv b/progress/progress.total.csv index 7ed0f99..0a92d95 100644 --- a/progress/progress.total.csv +++ b/progress/progress.total.csv @@ -1471,7 +1471,7 @@ us,.code,func_806A5174,1612,no us,.code,func_806C71E8,8,yes us,.code,func_8062B630,48,no us,.code,func_806623CC,8,yes -us,.code,func_806B0354,1052,no +us,.code,func_806B0354,1052,yes us,.code,func_80671260,388,no us,.code,func_806C93E4,80,yes us,.code,func_80713764,320,no @@ -2514,7 +2514,7 @@ us,.code,func_8063BF34,696,no us,.code,func_8068A810,32,yes us,.code,func_80689B10,156,yes us,.code,func_806F4E74,72,yes -us,.code,func_806B24B8,728,no +us,.code,func_806B24B8,724,yes us,.code,func_80732534,228,no us,.code,func_806ACA88,376,no us,.code,func_80679290,164,yes diff --git a/progress/progress_global_asm.svg b/progress/progress_global_asm.svg index 8a20633..052797b 100644 --- a/progress/progress_global_asm.svg +++ b/progress/progress_global_asm.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ global_asm - 17.2592% - 17.2592% + 17.4038% + 17.4038% \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg index 1741d48..58971cd 100644 --- a/progress/progress_total.svg +++ b/progress/progress_total.svg @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ Donkey Kong 64 (US) - 17.7279% - 17.7279% + 17.8359% + 17.8359% \ No newline at end of file diff --git a/src/bonus/code_12A0.c b/src/bonus/code_12A0.c index e91a412..5c66778 100644 --- a/src/bonus/code_12A0.c +++ b/src/bonus/code_12A0.c @@ -3,7 +3,6 @@ #include "variables.h" -s32 func_80677FA8(s32, s32); // spawnActorWrapper() void func_80627948(Actor*, s32, s32, s32); void func_8069D2AC(s32,s32,u8, s32, s32, s32, s32, s32); u8 func_8070E750(u8, s32, s32); diff --git a/src/global_asm/code_42630.c b/src/global_asm/code_42630.c index ef1bdfc..d62fec2 100644 --- a/src/global_asm/code_42630.c +++ b/src/global_asm/code_42630.c @@ -41,8 +41,6 @@ void func_8065A708(f32, f32, s32, f32, f32, f32, f32, s32, u8, u8, u8); // TODO: u8 func_80661300(s32); void func_8066134C(s32, u8); -void func_8067DF44(f32, f32, f32, f32, s32, s32); - void func_80714950(s32); void func_80714998(s32); void func_807149B8(s32); @@ -585,7 +583,6 @@ void func_80714950(s32); void func_8071498C(void*); void func_80714998(s32); void func_807149B8(s32); -void func_807149C8(s32, s32, s32, s32); extern s32 D_80717D4C; /* diff --git a/src/global_asm/code_80150.c b/src/global_asm/code_80150.c index 6b076ae..d08f65e 100644 --- a/src/global_asm/code_80150.c +++ b/src/global_asm/code_80150.c @@ -6,7 +6,6 @@ void func_8065D254(Actor*, s32, s32, s32, s32, s32, s32, s32, s32, s32, f32); void func_80665564(Actor*, f32); void func_8067AAB8(Actor* arg0, s32 arg1, s16 arg2, f32 arg3, s16 arg4); void func_8067ACB4(Actor*); -void func_8067DF44(f32, f32, f32, f32, u8, u8); void func_80683AD8(); void func_80679200(Actor*, Actor*, s32, u8, s32, s32); diff --git a/src/global_asm/code_89250.c b/src/global_asm/code_89250.c index b42b225..e753f3b 100644 --- a/src/global_asm/code_89250.c +++ b/src/global_asm/code_89250.c @@ -36,7 +36,6 @@ extern f64 D_80759B60; // y extern f64 D_80759B70; extern f64 D_80759B68; -void func_80677FA8(s32, s32); // spawnActorWrapper() void func_80719A0C(void); // Function pointer void func_8068588C(Actor *arg0, s16 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, s32 arg6); void func_806858E8(Actor*, s16, f32, f32, f32, f32, s32); diff --git a/src/global_asm/code_ACDC0.c b/src/global_asm/code_ACDC0.c index 782173d..af695e0 100644 --- a/src/global_asm/code_ACDC0.c +++ b/src/global_asm/code_ACDC0.c @@ -478,7 +478,7 @@ void func_806AA304(Struct806AA304_arg0 *arg0, s32 arg1) { func_806AB4EC(arg0, &D_80720D38, 0x2D, 0xC8, 1.0f, 2, 1); func_806AB4EC(arg0, &D_8072104C, 0x113, 0xC8, 1.0f, 2, 1); } - *current_character_index = sp8C; + current_character_index[0] = sp8C; } */ diff --git a/src/global_asm/code_B2CE0.c b/src/global_asm/code_B2CE0.c index 4242a25..341cdd5 100644 --- a/src/global_asm/code_B2CE0.c +++ b/src/global_asm/code_B2CE0.c @@ -76,6 +76,43 @@ void func_806AE2B0(s32 arg0, s16 arg1, s16 arg2, s16 arg3) { #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AE394.s") +extern f32 D_8075AE30; + +void func_8065A708(f32, f32, f32, f32, f32, f32, f32, s32, s32, s32, s32); +void func_8070033C(f32, f32, f32, f32, f32, f32, f32, s32, s32, s32); + +/* +// TODO: Our stack is too big, only issue +void func_806AE394(f32 arg0, f32 arg1) { + f32 dx; + f32 dz; + f32 dy; + s32 pad; + f32 sp50[6]; + s16 sp4E; + + func_80671C0C(current_actor_pointer, 1, &sp50[5], &sp50[4], &sp50[3]); + func_80671C0C(current_actor_pointer, 2, &sp50[2], &sp50[1], &sp50[0]); + sp4E = func_80665DE0(sp50[2], sp50[0], sp50[5], sp50[3]); + func_8070033C(sp50[5], sp50[4], sp50[3], sp50[2], sp50[1], sp50[0], D_8075AE30, 0xFF, 0xFF, 0xFF); + sp50[5] = (func_80612794(sp4E) * arg0) + current_actor_pointer->x_position; + sp50[3] = (func_80612790(sp4E) * arg0) + current_actor_pointer->z_position; + func_8065A708(sp50[5], current_actor_pointer->y_position, sp50[3], 0.0f, 0.0f, 0.0f, arg1, 0, 0xFF, 0xFF, 0xFF); + if (current_actor_pointer->control_state != 0) { + dx = D_807FDC94->x_position - sp50[5]; + dy = D_807FDC94->y_position - current_actor_pointer->y_position; + dz = D_807FDC94->z_position - sp50[3]; + if (((dx * dx) + (dy * dy) + (dz * dz)) < (arg1 * arg1)) { + current_actor_pointer->y_rotation = func_80665DE0(D_807FDC94->x_position, D_807FDC94->z_position, current_actor_pointer->x_position, current_actor_pointer->z_position); + func_806EB0C0(0x43, current_actor_pointer, 0); + current_actor_pointer->control_state = 0; + current_actor_pointer->control_state_progress = 0; + } + } +} +*/ + +// Jumptable #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AE588.s") void func_806AEE08(void) { @@ -90,6 +127,7 @@ void func_806AEE08(void) { // Jumptable #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AEE84.s") +// Jumptable #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AF688.s") #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AFA60.s") @@ -122,6 +160,7 @@ void func_806AFA60(u8 arg0) { } */ +// Jumptable #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806AFB58.s") void func_806B02EC(void) { @@ -133,7 +172,84 @@ void func_806B02EC(void) { func_806319C4(current_actor_pointer, 0); } -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806B0354.s") +extern f32 D_8075B1A8; + +void func_806852C4(f32, f32, f32, f32); +s32 func_80726164(Actor*, s16, s16, s16, void*); +void func_8072AB74(s32, f32, f32, s32, f32); + +void func_806B0354(void) { + func_80729B00(); + if (((D_807FBB70->unk200 == 9) || (D_807FBB70->unk15 != 0)) && (current_actor_pointer->control_state != 0x37)) { + func_8072D714(D_807FBB70->unk1FC, 0x37A); + current_actor_pointer->unk138 &= 0xFFFF7FFF; + } + switch (current_actor_pointer->control_state) { + case 0x4: + if (current_actor_pointer->animation_state->unk64 == 0x378) { + current_actor_pointer->control_state = 0x23; + current_actor_pointer->control_state_progress = 0; + } else if ((func_8072E22C(0x64) != 0) && (func_80726164(current_actor_pointer, D_807FDC94->x_position, D_807FDC94->y_position, D_807FDC94->z_position, D_807FDCA0) != 0)) { + func_80614EBC(current_actor_pointer, 0x37B); + current_actor_pointer->control_state = 0x23; + current_actor_pointer->control_state_progress = 0; + func_806852C4(D_8075B1A8, current_actor_pointer->x_position, current_actor_pointer->y_position + 10.0f, current_actor_pointer->z_position); + } + break; + case 0x23: + switch (current_actor_pointer->control_state_progress) { + case 0: + func_8072B324(current_actor_pointer, D_807FDC9C->unkD); + current_actor_pointer->control_state_progress += 1; + // Fallthrough + case 1: + if (((rand() >> 0xF) % 1000) >= 0x3E4) { + current_actor_pointer->control_state_progress += 1; + func_80614EBC(current_actor_pointer, 0x379); + func_8072B324(current_actor_pointer, 0); + } else { + if (current_actor_pointer->animation_state->unk64 == 0x378) { + func_8072AB74(0x23, D_807FDC94->x_position, D_807FDC94->z_position, 0, 0.0f); + } else { + func_8072E1A4(0xA, D_807FDC94); + } + if ((func_8072E22C(0xC8) == 0) || (func_80726164(current_actor_pointer, D_807FDC94->x_position, D_807FDC94->y_position, D_807FDC94->z_position, D_807FDCA0) == 0)) { + func_80614EBC(current_actor_pointer, 0x37C); + current_actor_pointer->control_state = 4; + current_actor_pointer->control_state_progress = 0; + func_8072B324(current_actor_pointer, 0); + } + } + break; + case 2: + func_8072AB74(0, D_807FDC94->x_position, D_807FDC94->z_position, 0x200, 0.0f); + break; + } + break; + case 0x37: + switch (current_actor_pointer->control_state_progress) { + case 0: + func_8072AB74(0, 0.0f, 0.0f, 0x200, 0.0f); + break; + case 1: + func_806A5C60(current_actor_pointer); + current_actor_pointer->control_state_progress += 1; + // fallthrough + case 2: + func_8072DC7C(0xA); + break; + case 3: + current_actor_pointer->control_state = 0x40; + break; + } + break; + default: + func_8072B7CC(0x378); + break; + } + func_8072881C(0, &D_807FDC90->unk28); + func_806319C4(current_actor_pointer, 0); +} #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806B0770.s") @@ -172,4 +288,5 @@ s32 func_806B0770(void) { } */ +// Jumptable #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B2CE0/func_806B0848.s") diff --git a/src/global_asm/code_B6C50.c b/src/global_asm/code_B6C50.c index 6faf2a2..a15bb40 100644 --- a/src/global_asm/code_B6C50.c +++ b/src/global_asm/code_B6C50.c @@ -5,4 +5,161 @@ #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B6C50/func_806B1F50.s") -#pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_B6C50/func_806B24B8.s") +extern s32 D_8072030C; +extern f64 D_8075B3C0; + +void func_80714C08(void*, f32, Actor*, s32, s32); +void func_8068588C(Actor*, s32, f32, f32, f32, f32, s32); +void func_80665564(Actor*, f32); +void func_807149A8(s16); +void func_80604CBC(Actor*, s32, s32, s32, s32, s32, f32, s32); +void func_806319C4(Actor*, s32); + +/* +// TODO: Doable, very good progress made +void func_806B1F50(void) { + u8 sp37; + + func_80729B00(); + if (!(current_actor_pointer->object_properties_bitfield & 0x10)) { + D_807FDC98->unk46 |= 0xA0; + current_actor_pointer->object_properties_bitfield |= 0x400; + current_actor_pointer->control_state = 0; + current_actor_pointer->control_state_progress = 0; + func_80677FA8(0x73, 0x7D); + D_807FDC90->unk4 = D_807FBB44; + func_8067B238(D_807FBB44, current_actor_pointer, 0.3f); + D_807FBB44->x_position = (func_80612794(current_actor_pointer->y_rotation) * 14.0f) + current_actor_pointer->x_position; + D_807FBB44->z_position = (func_80612790(current_actor_pointer->y_rotation) * 14.0f) + current_actor_pointer->z_position; + func_8066EA90(D_807FBB44, 3); + func_8066EA90(D_807FBB44, 1); + func_80665564(D_807FBB44, 14.0f); + current_actor_pointer->unk68 &= 0xFFBF; + D_807FBB44->object_properties_bitfield |= 0x1000; + func_807149B8(1); + func_807149FC(-1); + func_807149A8(D_807FBB44->draw_distance * 0.75); + func_80714C08(&D_8072030C, 0.28f, D_807FBB44, 1, 2); + func_80614EBC(current_actor_pointer, 0x300); + func_80604CBC(current_actor_pointer, 0x135, 0x64, 0, 0, 0x78, 1.0f, 0); + } + if ((D_807FBB70->unk15 != 0) || (D_807FBB70->unk200 == 9)) { + current_actor_pointer->unk11C->control_state = 0; + playCutscene(current_actor_pointer, 6, 5); + current_actor_pointer->noclip_byte = 1; + current_actor_pointer->control_state = 0x37; + current_actor_pointer->control_state_progress = 0; + } else if (D_807FBB70->unk200 == 4) { + current_actor_pointer->control_state_progress++; + } + switch (current_actor_pointer->control_state) { + case 0x27: + break; + case 0x0: + if (func_80629148() != 0) { + func_806A2A10(0xDC, 0x2A, 0x1E); + func_806A2B08(current_actor_pointer->unk11C); + current_actor_pointer->control_state = 7; + current_actor_pointer->control_state_progress = 0; + } + break; + case 0x37: + switch (current_actor_pointer->control_state_progress) { + case 0x3C: + current_actor_pointer->object_properties_bitfield &= ~4; + current_actor_pointer->unk68 &= 0xFFBF; + func_80608528(current_actor_pointer, 0xED, 0xFF, 0x7F, 0x14); + func_8067DF44(current_actor_pointer->x_position, current_actor_pointer->y_position, current_actor_pointer->z_position, (current_actor_pointer->animation_state->scale_y * 2) / D_8075B3C0, 0, 1); + func_806782C0(D_807FDC94); + current_actor_pointer->control_state_progress += 1; + break; + case 0x64: + func_806782C0(current_actor_pointer->unk11C); + current_actor_pointer->control_state = 0x40; + playSong(0x2A, 1.0f); + // Fallthrough + default: + current_actor_pointer->control_state_progress++; + break; + } + break; + default: + if ((current_actor_pointer->unk11C != NULL) && (current_actor_pointer->unk11C->control_state == 5)) { + current_actor_pointer->unk138 &= 0xFFFF7FFF; + func_80605314(current_actor_pointer, 0); + func_80726EE0(0); + func_8071586C(D_807FDC94); + func_806782C0(current_actor_pointer->unk11C); + current_actor_pointer->control_state = 0x27; + current_actor_pointer->control_state_progress = 0; + playCutscene(current_actor_pointer, 3, 1); + func_80614EBC(current_actor_pointer, 0x307); + current_actor_pointer->y_rotation += 0x800; + current_actor_pointer->z_position += 5.0f; + } + if ((current_actor_pointer->control_state_progress != 0) && (func_8067AF44(D_807FDC94) != 0) && ((object_timer % 7) == 0)) { + sp37 = (current_actor_pointer->control_state_progress * -0x1E) + 0xB4; + func_80714998(3); + func_807149C8(sp37, sp37, sp37, current_actor_pointer->shadow_opacity); + func_8068588C(D_807FDC94, 1, 1.0f, 0.0f, 0.0f, 0.0f, -0x96); + } + break; + } + func_806319C4(current_actor_pointer, 0); +} +*/ + +extern s32 D_80720340; +extern f32 D_8075B3C8; +extern f64 D_8075B3D0; +extern f64 D_8075B3D8; +extern f64 D_8075B3E0; + +void func_8072AB74(s32, f32, f32, s32, f32); +void func_80613C48(Actor*, s32, f32, f32); + +void func_806B24B8(void) { + Actor *temp_v0; + f32 dx; + f32 dz; + + func_80729B00(); + if (!(current_actor_pointer->object_properties_bitfield & 0x10)) { + temp_v0 = func_8067ADB4(0x110); + if (temp_v0 != NULL) { + D_807FDC90->unk4 = temp_v0; + } + D_807FDC9C->unk10 = 0x23; + func_80613C48(current_actor_pointer, 0x599, 0, 0); + current_actor_pointer->unk68 &= 0xFFBF; + func_80604CBC(current_actor_pointer, 0x139, 0x78, 0, 1, 0x3C, D_8075B3C8, 0); + current_actor_pointer->object_properties_bitfield |= 0x400; + } + if ((object_timer % 10U) == 0) { + func_807149B8(1); + func_80714C08(&D_80720340, current_actor_pointer->animation_state->scale_y * D_8075B3D0 * D_8075B3D8, current_actor_pointer, 1, 2); + } + if (func_8067AF44(D_807FDC94) == 0) { + D_807FDC90->unk4 = player_pointer; + D_807FDC94 = D_807FDC90->unk4; + } + if ((D_807FBB70->unk15 != 0) || (D_807FBB70->unk200 == 9)) { + current_actor_pointer->noclip_byte = 1; + current_actor_pointer->control_state = 0x40; + func_8067DF44(current_actor_pointer->x_position, current_actor_pointer->y_position, current_actor_pointer->z_position, current_actor_pointer->animation_state->scale_y / D_8075B3E0, 0, 1); + } + if (current_actor_pointer->control_state == 0x23) { + if (current_actor_pointer->unkF0 == 0) { + dx = current_actor_pointer->x_position - D_807FDC94->x_position; + dz = current_actor_pointer->z_position - D_807FDC94->z_position; + if (sqrtf((dx * dx) + (dz * dz)) < 30.0f) { + func_80608528(current_actor_pointer, 0x2CA, 0xFF, 0x7F, 0x14); + current_actor_pointer->unkF0 = 1; + } + } + func_8072AB74(0x23, D_807FDC94->x_position, D_807FDC94->z_position, 0, 0.0f); + } else { + func_8072B7CC(0x1F8); + } + func_806319C4(current_actor_pointer, 0); +} diff --git a/src/global_asm/code_B7490.c b/src/global_asm/code_B7490.c index c3a1d5a..3b92aed 100644 --- a/src/global_asm/code_B7490.c +++ b/src/global_asm/code_B7490.c @@ -17,7 +17,6 @@ s32 func_80726164(Actor*, s16, s16, s16, void*); void func_806B3E7C(); void func_8068588C(Actor *, s32, f32, f32, f32, f32, s32); void func_80714998(s32); -void func_807149C8(u8, u8, u8, u8); void func_806653C0(Actor*, f32, f32); void func_80665564(Actor*, f32); void func_806086CC(f32, f32, f32, s32, s32, s32, s32, s32, f32, s32); diff --git a/src/global_asm/code_C1E70.c b/src/global_asm/code_C1E70.c index 0a74456..f03612f 100644 --- a/src/global_asm/code_C1E70.c +++ b/src/global_asm/code_C1E70.c @@ -5,7 +5,6 @@ // Doable, big, interesting #pragma GLOBAL_ASM("asm/nonmatchings/global_asm/code_C1E70/func_806BD170.s") -void func_80677FA8(s32, s32); extern s8 D_80750660; extern s8 D_807506A4; extern s8 D_807FC8D0; diff --git a/src/global_asm/code_CEAE0.c b/src/global_asm/code_CEAE0.c index 4aa8c78..1b74ac2 100644 --- a/src/global_asm/code_CEAE0.c +++ b/src/global_asm/code_CEAE0.c @@ -196,7 +196,6 @@ void func_806F4D70(u8, s32, s32, s32, f32); void func_8068EA38(); // Needed for function pointer void func_806FFB2C(void); // Needed for function pointer -void func_80677FA8(s32, s32); // spawnActorWrapper() u8 func_806CDD24(Actor *arg0, f32 arg1, f32 arg2, s32 arg3); u8 func_806CE174(Actor *arg0, f32 arg1, f32 arg2, s32 arg3); diff --git a/src/race/code_0.c b/src/race/code_0.c index 41202fa..a666665 100644 --- a/src/race/code_0.c +++ b/src/race/code_0.c @@ -22,7 +22,6 @@ void func_8002D0FC(); void func_805FF544(); void func_80604CBC(Actor *, s32, s32, s32, s32, s32, f32, s32); -void func_80677FA8(s32, s32); // spawnActorWrapper() typedef struct RaceStruct8 { u8 pad0[0x36]; diff --git a/symbol_addrs.global_asm.us.txt b/symbol_addrs.global_asm.us.txt index c0ded00..5132ab7 100644 --- a/symbol_addrs.global_asm.us.txt +++ b/symbol_addrs.global_asm.us.txt @@ -235,3 +235,4 @@ D_807504CC = 0x807504CC; D_807504C0 = 0x807504C0; D_807504C8 = 0x807504C8; D_8075A7A4 = 0x8075A7A4; +D_8075B3C8 = 0x8075B3C8;