From d75f0c4d9af6cf77da736eed1b3cac98c1950aed Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Wed, 14 May 2025 15:47:50 -0400 Subject: [PATCH] Match scroll_particle_textures (#575) * scroll_particle_textures progress * Match scroll_particle_textures * Update score --- README.md | 18 +++++++++--------- requirements.txt | 2 +- src/menu.c | 13 +++++++------ src/particles.c | 23 +++++++++++------------ 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 0e610c43..7d1c2673 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ All versions are supported, and the US 1.0 version (SHA1 = 0cb115d8716dbbc2922fd As of May 14, 2025, this is our current score: -    Decomp progress: 87.61% +    Decomp progress: 87.64% -    Documentation progress: 56.95% +    Documentation progress: 56.98% --- @@ -121,11 +121,11 @@ As of May 14, 2025, this is our current score: ``` ===================================================================== ADVENTURE ONE (ASM -> C Decompilation) - --------------- 87.61% Complete (88.53% NON_MATCHING) --------------- - # Decompiled functions: 1893 - # GLOBAL_ASM remaining: 58 + --------------- 87.64% Complete (88.56% NON_MATCHING) --------------- + # Decompiled functions: 1894 + # GLOBAL_ASM remaining: 57 # NON_MATCHING functions: 6 - # NON_EQUIVALENT WIP functions: 18 + # NON_EQUIVALENT WIP functions: 17 ---------------------------- Game Status ---------------------------- Balloons: 40/47, Keys: 4/4, Trophies: 4/5 T.T. Amulets: 4/4, Wizpig Amulets: 4/4 @@ -133,9 +133,9 @@ As of May 14, 2025, this is our current score: We are racing in Darkmoon Caverns. (Lap 3/3) ===================================================================== ADVENTURE TWO (Cleanup & Documentation) - -------------------------- 56.95% Complete -------------------------- - # Documented functions: 1178 - # Undocumented remaining: 476 + -------------------------- 56.98% Complete -------------------------- + # Documented functions: 1179 + # Undocumented remaining: 475 ---------------------------- Game Status ---------------------------- Balloons: 27/47, Keys: 3/4, Trophies: 2/5 T.T. Amulets: 3/4, Wizpig Amulets: 2/4 diff --git a/requirements.txt b/requirements.txt index 3539fe43..7f04f0ea 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ colorama>=0.4.6 watchdog>=6.0.0 Levenshtein>=0.26.1 cxxfilt>=0.3.0 -mapfile-parser>=2.7.1 +mapfile-parser>=2.7.5 PyYAML>=6.0.2 colour>=0.1.5 \ No newline at end of file diff --git a/src/menu.c b/src/menu.c index 5e852fe4..1af79fc3 100644 --- a/src/menu.c +++ b/src/menu.c @@ -660,6 +660,7 @@ s16 sGameTitleTileTextures[12] = { TEXTURE_TITLE_SEGMENT_01, TEXTURE_TITLE_SEGME TEXTURE_TITLE_SEGMENT_10, TEXTURE_TITLE_SEGMENT_11, -1 }; #endif +// Final value is all NULL so that the texrect_draw function knows when to stop. DrawTexture sGameTitleTileOffsets[12] = { { NULL, -75, -32 }, { NULL, -60, -32 }, { NULL, -45, -32 }, { NULL, -30, -32 }, { NULL, -15, -32 }, { NULL, 0, -32 }, { NULL, 15, -32 }, { NULL, 30, -32 }, { NULL, 45, -32 }, @@ -3325,7 +3326,7 @@ void menu_title_screen_init(void) { gTitleAudioCounter = 0; gMenuStage = TITLESCREEN_START; menu_assetgroup_load(sGameTitleTileTextures); - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(sGameTitleTileOffsets) - 1; i++) { sGameTitleTileOffsets[i].texture = gMenuAssets[sGameTitleTileTextures[i]]; } music_voicelimit_set(27); @@ -5433,7 +5434,7 @@ void menu_boot_init(void) { menu_assetgroup_load(sGameTitleTileTextures); // Sets up the 11 texture pointers for the "Diddy Kong Racing" logo. - for (i = 0; i < 11; i++) { + for (i = 0; i < ARRAY_COUNT(sGameTitleTileOffsets) - 1; i++) { sGameTitleTileOffsets[i].texture = gMenuAssets[sGameTitleTileTextures[i]]; } @@ -13744,9 +13745,9 @@ void menu_asset_load(s32 assetID) { i = (*gAssetsMenuElementIds)[assetID]; if ((i & ASSET_MASK_TEXTURE) == ASSET_MASK_TEXTURE) { - gMenuAssets[assetID] = (TextureHeader *) load_texture(i & 0x3FFF); + gMenuAssets[assetID] = load_texture(i & 0x3FFF); } else if (i & ASSET_MASK_SPRITE) { - gMenuAssets[assetID] = (TextureHeader *) func_8007C12C(i & 0x3FFF, 0); + gMenuAssets[assetID] = func_8007C12C(i & 0x3FFF, 0); } else if (i & ASSET_MASK_OBJECT) { if (gMenuElementIdCount) {} // Fakematch entry.objectID = i & 0xFFFF; @@ -13754,9 +13755,9 @@ void menu_asset_load(s32 assetID) { entry.x = 0; entry.y = 0; entry.z = 0; - gMenuAssets[assetID] = (TextureHeader *) spawn_object(&entry, 0); + gMenuAssets[assetID] = spawn_object(&entry, 0); } else { - gMenuAssets[assetID] = (TextureHeader *) object_model_init(i & 0x3FFF, 0); + gMenuAssets[assetID] = object_model_init(i & 0x3FFF, 0); } gMenuAssetActive[assetID] = TRUE; diff --git a/src/particles.c b/src/particles.c index 7397595a..39c45c57 100644 --- a/src/particles.c +++ b/src/particles.c @@ -683,27 +683,26 @@ void emitter_init_with_pos(ParticleEmitter *emitter, s32 behaviourID, s32 partic * Scrolls textures downward for point and line particles. * Texture state repeats in an 8-frame loop. */ -#ifdef NON_EQUIVALENT void scroll_particle_textures(s32 updateRate) { s32 i; + s32 j; gParticleTextureScrollOffset = (gParticleTextureScrollOffset + (updateRate << 6)) & 0x1FF; - for (i = 0; i < ARRAY_COUNT(gLineParticleTriangles); i++) { - gLineParticleTriangles[i].uv2.v = gLineParticleVCoords[i].s[0] + gParticleTextureScrollOffset; - gLineParticleTriangles[i].uv1.v = gLineParticleVCoords[i].s[1] + gParticleTextureScrollOffset; - gLineParticleTriangles[i].uv0.v = gLineParticleVCoords[i].s[2] + gParticleTextureScrollOffset; + for (i = 0, j = 0; i < ARRAY_COUNT(gLineParticleTriangles); i++) { + gLineParticleTriangles[i].uv0.v = gLineParticleVCoords[j].s[0] + gParticleTextureScrollOffset; + gLineParticleTriangles[i].uv1.v = gLineParticleVCoords[j].s[1] + gParticleTextureScrollOffset; + gLineParticleTriangles[i].uv2.v = gLineParticleVCoords[j].s[2] + gParticleTextureScrollOffset; + j++; } - for (i = 0; i < ARRAY_COUNT(gPointParticleTriangles); i++) { - gPointParticleTriangles[i].uv0.v = gPointParticleVCoords[i].s[0] + gParticleTextureScrollOffset; - gPointParticleTriangles[i].uv1.v = gPointParticleVCoords[i].s[1] + gParticleTextureScrollOffset; - gPointParticleTriangles[i].uv2.v = gPointParticleVCoords[i].s[2] + gParticleTextureScrollOffset; + for (i = 0, j = 0; i < ARRAY_COUNT(gPointParticleTriangles); i++) { + gPointParticleTriangles[i].uv0.v = gPointParticleVCoords[j].s[0] + gParticleTextureScrollOffset; + gPointParticleTriangles[i].uv1.v = gPointParticleVCoords[j].s[1] + gParticleTextureScrollOffset; + gPointParticleTriangles[i].uv2.v = gPointParticleVCoords[j].s[2] + gParticleTextureScrollOffset; + j++; } } -#else -#pragma GLOBAL_ASM("asm/nonmatchings/particles/scroll_particle_textures.s") -#endif /** * Initializes the emitter if it has been activated for an object.