diff --git a/README.md b/README.md index 319b05ce..9781c356 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ This repo contains a work-in-progress decompilation of Diddy Kong Racing for the All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fda38e533b9fe63bb9670) of the game is the default if not specified. -As of May 4, 2025, this is our current score: +As of May 5, 2025, this is our current score: -    Decomp progress: 84.43% +    Decomp progress: 84.46%     Documentation progress: 53.79% @@ -117,15 +117,15 @@ s32 is_drumstick_unlocked(void) { ``` -As of May 4, 2025, this is our current score: +As of May 5, 2025, this is our current score: ``` ======================================================== ADVENTURE ONE (ASM -> C Decompilation) - -------- 84.43% Complete (85.98% NON_MATCHING) --------- - # Decompiled functions: 1877 - # GLOBAL_ASM remaining: 74 + -------- 84.46% Complete (86.01% NON_MATCHING) --------- + # Decompiled functions: 1878 + # GLOBAL_ASM remaining: 73 # NON_MATCHING functions: 8 - # NON_EQUIVALENT WIP functions: 27 + # NON_EQUIVALENT WIP functions: 26 --------------------- Game Status ---------------------- Balloons: 39/47, Keys: 4/4, Trophies: 4/5 T.T. Amulets: 4/4, Wizpig Amulets: 4/4 diff --git a/src/objects.c b/src/objects.c index b08cef08..9ab31689 100644 --- a/src/objects.c +++ b/src/objects.c @@ -2447,41 +2447,40 @@ void func_80011134(Object *arg0, s32 arg1) { #pragma GLOBAL_ASM("asm/nonmatchings/objects/func_80011134.s") #endif -#ifdef NON_EQUIVALENT -// Probably NON_MATCHING, but not sure. // This is a function for doors void func_80011264(ObjectModel *model, Object *obj) { + Object_64 *obj64; s32 current; s32 remaining; s32 i; - Object_Door *door; TriangleBatchInfo *batch; - if (model->unk50 > 0) { - batch = &model->batches[0]; - door = &obj->unk64->door; - current = ((door->balloonCount / 10) - 1) << 2; - if (model->textures[batch->textureIndex].texture) {} // fakematch - if (1) { // fakematch - remaining = ((door->balloonCount % 10) << 2); - } - for (i = 0; i < model->numberOfBatches; i++, batch++) { - if (batch->flags & 0x10000) { - if (batch->textureIndex != 0xFF) { // 0xFF = No Texture - if (model->textures[batch->textureIndex].texture->numOfTextures > 0x900) { - batch->unk7 = remaining; - } else if (current >= 0) { - batch->unk7 = current; - } - if (door) {} // fakematch + if (model->unk50 <= 0) { + return; + } + + obj64 = obj->unk64; + remaining = obj64->door.balloonCount; + current = ((remaining / 10) - 1) << 2; + remaining = (remaining % 10) << 2; + i = 0; + batch = model->batches; + + while (i < model->numberOfBatches) { + if (batch[i].flags & 0x10000) { + if (batch[i].textureIndex != TEX_INDEX_NO_TEXTURE) { + // Fakematch + if (model->textures[batch[i].textureIndex].texture) {} + if ((model->textures[batch[i].textureIndex].texture->numOfTextures) > 0x900) { + batch[i].unk7 = remaining; + } else if (current >= 0) { + batch[i].unk7 = current; } } } + i++; } } -#else -#pragma GLOBAL_ASM("asm/nonmatchings/objects/func_80011264.s") -#endif /** * Do nothing. Unused. diff --git a/src/racer.c b/src/racer.c index ac161aff..09896250 100644 --- a/src/racer.c +++ b/src/racer.c @@ -6438,11 +6438,11 @@ void func_80059208(Object *obj, Object_Racer *racer, s32 updateRate) { if (temp_v0_4->altRouteID == -1) { racer->unk1C8 = 0; } - counter = racer->checkpoint - 1; - if (counter < 0) { - counter += temp_v0; + angle = racer->checkpoint - 1; + if (angle < 0) { + angle += temp_v0; } - temp_v0_4 = get_checkpoint_node(counter); + temp_v0_4 = get_checkpoint_node(angle); if (temp_v0_4->altRouteID == -1) { racer->unk1C8 = 0; }