From 8e671e2fff831ac0066fa4e4e760419c18d7e4f3 Mon Sep 17 00:00:00 2001 From: Unnunu Date: Fri, 17 Feb 2023 04:56:57 +0300 Subject: [PATCH] match SetSpriteShading (#944) --- include/variables.h | 4 +- src/C50A0.c | 16 +- src/d0a70_len_4fe0.c | 12 +- src/de740_len_23f0.c | 64 +++--- src/evt/demo_api.c | 71 +++++- src/evt/script_list.c | 4 +- src/sprite.c | 10 +- src/world/area_kkj/common/Searchlights.inc.c | 2 +- src/world/area_kkj/kkj_10/kkj_10_1_main.c | 4 +- src/world/area_kkj/kkj_11/kkj_11_1_main.c | 4 +- src/world/area_kkj/kkj_12/kkj_12_1_main.c | 2 +- src/world/area_kkj/kkj_12/kkj_12_2_npc.c | 2 +- src/world/area_mgm/mgm_01/mgm_01_1_main.c | 6 +- src/world/area_mim/mim_12/mim_12_5_gate.c | 6 +- ver/us/asm/bss3.s | 12 +- .../evt/demo_api/SetSpriteShading.s | 214 ------------------ ver/us/symbol_addrs.txt | 16 +- ver/us/undefined_syms.txt | 2 + 18 files changed, 149 insertions(+), 302 deletions(-) delete mode 100644 ver/us/asm/nonmatchings/evt/demo_api/SetSpriteShading.s diff --git a/include/variables.h b/include/variables.h index 2790da5f1d..24e52000e6 100644 --- a/include/variables.h +++ b/include/variables.h @@ -106,8 +106,8 @@ extern s32 D_800A0964; extern s8 D_800A0B94; extern s16 D_800A0BB8; -extern SpriteShadingProfile* D_801512B0; -extern SpriteShadingProfile* D_80151328; +extern SpriteShadingProfile* gAuxSpriteShadingProfile; +extern SpriteShadingProfile* gSpriteShadingProfile; extern Window gWindows[64]; diff --git a/src/C50A0.c b/src/C50A0.c index e60ccee469..2c71f0f732 100644 --- a/src/C50A0.c +++ b/src/C50A0.c @@ -1406,7 +1406,7 @@ void appendGfx_item_entity(void* data) { gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (D_80151328->flags != 0) { + if (gSpriteShadingProfile->flags != 0) { gSPDisplayList(gMasterGfxPos++, D_8014BBD8); } else { gSPDisplayList(gMasterGfxPos++, D_8014B870); @@ -1415,7 +1415,7 @@ void appendGfx_item_entity(void* data) { gSPDisplayList(gMasterGfxPos++, D_8014C620); if (itemEntity->flags & (ITEM_ENTITY_FLAG_8000000 | ITEM_ENTITY_FLAG_TRANSPARENT)) { - if (D_80151328->flags != 0) { + if (gSpriteShadingProfile->flags != 0) { gDPSetRenderMode(gMasterGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); @@ -1432,7 +1432,7 @@ void appendGfx_item_entity(void* data) { if (!(itemEntity->flags & ITEM_ENTITY_FLAG_40000)) { gDPLoadTLUT_pal16(gMasterGfxPos++, 0, gHudElementCacheTablePalette[itemEntity->lookupPaletteIndex].data); - if (D_80151328->flags != 0) { + if (gSpriteShadingProfile->flags != 0) { gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 12, gHudElementCacheTableRaster[itemEntity->lookupRasterIndex].data); gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); @@ -1467,7 +1467,7 @@ void appendGfx_item_entity(void* data) { gSPDisplayList(gMasterGfxPos++, D_8014C678); } else { gDPLoadTLUT_pal16(gMasterGfxPos++, 0, gHudElementCacheTablePalette[itemEntity->lookupPaletteIndex].data); - if (D_80151328->flags != 0) { + if (gSpriteShadingProfile->flags != 0) { gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 16, gHudElementCacheTableRaster[itemEntity->lookupRasterIndex].data); gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); @@ -1614,7 +1614,7 @@ void render_item_entities(void) { gDisplayContext->matrixStack[gMatrixListPos] = sp18; gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (D_80151328->flags != 0) { + if (gSpriteShadingProfile->flags != 0) { gSPDisplayList(gMasterGfxPos++, D_8014BBD8); } else { gSPDisplayList(gMasterGfxPos++, D_8014B870); @@ -1632,7 +1632,7 @@ void render_item_entities(void) { alpha = alpha * (255 - a1) / 255; } if (item->flags & (ITEM_ENTITY_FLAG_TRANSPARENT | ITEM_ENTITY_FLAG_8000000)) { - if (D_80151328->flags) { + if (gSpriteShadingProfile->flags) { gDPSetRenderMode(gMasterGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)); } else { @@ -1646,7 +1646,7 @@ void render_item_entities(void) { if (!(item->flags & ITEM_ENTITY_FLAG_40000)) { gDPLoadTLUT_pal16(gMasterGfxPos++, 0, gHudElementCacheTablePalette[item->lookupPaletteIndex].data); - if (D_80151328->flags) { + if (gSpriteShadingProfile->flags) { gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 12, gHudElementCacheTableRaster[item->lookupRasterIndex].data); gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); @@ -1674,7 +1674,7 @@ void render_item_entities(void) { gSPDisplayList(gMasterGfxPos++, D_8014C678); } else { gDPLoadTLUT_pal16(gMasterGfxPos++, 0, gHudElementCacheTablePalette[item->lookupPaletteIndex].data); - if (D_80151328->flags) { + if (gSpriteShadingProfile->flags) { gDPSetTextureImage(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 16, gHudElementCacheTableRaster[item->lookupRasterIndex].data); gDPSetTile(gMasterGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD); gDPLoadSync(gMasterGfxPos++); diff --git a/src/d0a70_len_4fe0.c b/src/d0a70_len_4fe0.c index bda447247c..aa6a6bf616 100644 --- a/src/d0a70_len_4fe0.c +++ b/src/d0a70_len_4fe0.c @@ -1338,7 +1338,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { s32 alpha2; if (!(state->flags & FOLD_STATE_FLAG_20)) { - if ((D_80151328->flags & 1) && + if ((gSpriteShadingProfile->flags & 1) && (state->arrayIdx != 0) && (state->flags & someFlags) && (state->renderType == FOLD_RENDER_TYPE_0 @@ -1374,7 +1374,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { break; } - if ((D_80151328->flags & 2) && (D_80156954[0][0].arrayIdx != 0) && (state->flags & someFlags)) { + if ((gSpriteShadingProfile->flags & 2) && (D_80156954[0][0].arrayIdx != 0) && (state->flags & someFlags)) { cam = &gCameras[gCurrentCamID]; if (gGameStatusPtr->isBattle == 2) { @@ -1411,7 +1411,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { G_TX_NOLOD, G_TX_NOLOD, // shift, 0x100, 0x100); // scroll - if ((D_80151328->flags & 2) && state->arrayIdx != 0 && (state->flags & someFlags)) { + if ((gSpriteShadingProfile->flags & 2) && state->arrayIdx != 0 && (state->flags & someFlags)) { alpha2 = 255; cam = &gCameras[gCurrentCamID]; @@ -1467,7 +1467,7 @@ void func_8013CFA8(FoldState* state, Matrix4f mtx) { } } - if ((D_80151328->flags & 2) && D_80156954[0][0].arrayIdx != 0 && (state->flags & someFlags)) { + if ((gSpriteShadingProfile->flags & 2) && D_80156954[0][0].arrayIdx != 0 && (state->flags & someFlags)) { cam = &gCameras[gCurrentCamID]; if (gGameStatusPtr->isBattle == 2) { gSPViewport(gMasterGfxPos++, &D_8014EE40); @@ -1506,7 +1506,7 @@ void func_8013DAB4(FoldState* state, Matrix4f mtx) { s32 llIdx = firstVtxIdx + (i + 1) * (state->subdivX + 1) + j; s32 lrIdx = firstVtxIdx + (i + 1) * (state->subdivX + 1) + j + 1; if (!(state->flags & FOLD_STATE_FLAG_20)) { - if ((D_80151328->flags & 1) && + if ((gSpriteShadingProfile->flags & 1) && (*D_80156954)[0].arrayIdx != 0 && (state->flags & (FOLD_STATE_FLAG_100000 | FOLD_STATE_FLAG_80000)) && (state->renderType == FOLD_RENDER_TYPE_0 @@ -1575,7 +1575,7 @@ void func_8013E2F0(FoldState* state, Matrix4f mtx) { if (!(state->flags & FOLD_STATE_FLAG_20)) { gDPSetTextureLUT(gMasterGfxPos++, G_TT_RGBA16); gDPLoadTLUT_pal16(gMasterGfxPos++, 0, fold_currentImage->palette); - if ((D_80151328->flags & 1) && (state->flags & (FOLD_STATE_FLAG_100000 | FOLD_STATE_FLAG_80000)) && + if ((gSpriteShadingProfile->flags & 1) && (state->flags & (FOLD_STATE_FLAG_100000 | FOLD_STATE_FLAG_80000)) && (state->renderType == FOLD_RENDER_TYPE_0 || state->renderType == FOLD_RENDER_TYPE_2 || state->renderType == FOLD_RENDER_TYPE_7 diff --git a/src/de740_len_23f0.c b/src/de740_len_23f0.c index 8bcd08ae76..2992a5dc0f 100644 --- a/src/de740_len_23f0.c +++ b/src/de740_len_23f0.c @@ -2,10 +2,10 @@ #include "sprite.h" #include "nu/nusys.h" -extern SpriteShadingProfile D_801595C0; -extern SpriteShadingProfile D_80159670; -extern SpriteShadingProfile D_80159720; -extern SpriteShadingProfile D_801597D0; +extern SpriteShadingProfile wSpriteShadingProfile; +extern SpriteShadingProfile bSpriteShadingProfile; +extern SpriteShadingProfile wSpriteShadingProfileAux; +extern SpriteShadingProfile bSpriteShadingProfileAux; extern s8 D_80159880[0x20]; extern int ENVIRONMENT; @@ -25,35 +25,35 @@ void clear_sprite_shading_data(void) { init_sprite_shading_data(); - for (i = 0; i < ARRAY_COUNT(D_80151328->sources); i++) { - D_80151328->sources[i].flags = LIGHT_SOURCE_DISABLED; - D_801512B0->sources[i].flags = LIGHT_SOURCE_DISABLED; + for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) { + gSpriteShadingProfile->sources[i].flags = LIGHT_SOURCE_DISABLED; + gAuxSpriteShadingProfile->sources[i].flags = LIGHT_SOURCE_DISABLED; } - D_80151328->flags = 0; - D_80151328->ambientColor.r = D_80151328->ambientColor.g = D_80151328->ambientColor.b = 50; - D_80151328->ambientPower = 10; + gSpriteShadingProfile->flags = 0; + gSpriteShadingProfile->ambientColor.r = gSpriteShadingProfile->ambientColor.g = gSpriteShadingProfile->ambientColor.b = 50; + gSpriteShadingProfile->ambientPower = 10; - D_801512B0->flags = 0; - D_801512B0->ambientColor.r = D_801512B0->ambientColor.g = D_801512B0->ambientColor.b = 50; - D_801512B0->ambientPower = 20; + gAuxSpriteShadingProfile->flags = 0; + gAuxSpriteShadingProfile->ambientColor.r = gAuxSpriteShadingProfile->ambientColor.g = gAuxSpriteShadingProfile->ambientColor.b = 50; + gAuxSpriteShadingProfile->ambientPower = 20; } void init_sprite_shading_data(void) { if (!gGameStatusPtr->isBattle) { - D_80151328 = &D_801595C0; - D_801512B0 = &D_80159720; + gSpriteShadingProfile = &wSpriteShadingProfile; + gAuxSpriteShadingProfile = &wSpriteShadingProfileAux; } else { - D_80151328 = &D_80159670; - D_801512B0 = &D_801597D0; + gSpriteShadingProfile = &bSpriteShadingProfile; + gAuxSpriteShadingProfile = &bSpriteShadingProfileAux; } } void sprite_shading_set_light_source(u32 idx, s8 flags, f32 x, f32 y, f32 z, u8 r, u8 g, u8 b, f32 falloff, s8 arg9) { SpriteShadingLightSource* lightSource; - if (idx < ARRAY_COUNT(D_80151328->sources)) { - lightSource = &D_80151328->sources[idx]; + if (idx < ARRAY_COUNT(gSpriteShadingProfile->sources)) { + lightSource = &gSpriteShadingProfile->sources[idx]; lightSource->flags = flags; lightSource->pos.x = x; lightSource->pos.y = y; @@ -116,9 +116,9 @@ void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s3 sp94 = 0.0f; sp98 = 0.0f; - shadowR = D_80151328->ambientColor.r; - shadowG = D_80151328->ambientColor.g; - shadowB = D_80151328->ambientColor.b; + shadowR = gSpriteShadingProfile->ambientColor.r; + shadowG = gSpriteShadingProfile->ambientColor.g; + shadowB = gSpriteShadingProfile->ambientColor.b; if (((-sp64 * camera->perspectiveMatrix[0][2]) + (sp68 * camera->perspectiveMatrix[2][2])) < 0.0f) { sp60 = 1.0f; @@ -126,8 +126,8 @@ void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s3 sp60 = -1.0f; } - for (i = 0; i < ARRAY_COUNT(D_80151328->sources); i++) { - lightSource = &D_80151328->sources[i]; + for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) { + lightSource = &gSpriteShadingProfile->sources[i]; if (lightSource->flags & LIGHT_SOURCE_ENABLED) { dx = sp54 - lightSource->pos.x; dy = sp58 - lightSource->pos.y; @@ -246,10 +246,10 @@ void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s3 alpha, shadowX, shadowY, shadowZ, shadowR, shadowG, shadowB, - D_80151328->ambientColor.r + sp78 + sp84, - D_80151328->ambientColor.g + sp7C + sp88, - D_80151328->ambientColor.b + sp80 + sp8C, - D_80151328->ambientPower, otherModeLBits + gSpriteShadingProfile->ambientColor.r + sp78 + sp84, + gSpriteShadingProfile->ambientColor.g + sp7C + sp88, + gSpriteShadingProfile->ambientColor.b + sp80 + sp8C, + gSpriteShadingProfile->ambientPower, otherModeLBits ); } else { appendGfx_shading_palette( @@ -258,10 +258,10 @@ void create_shading_palette(Matrix4f mtx, s32 uls, s32 ult, s32 lrs, s32 lrt, s3 alpha, shadowX, shadowY, shadowZ, shadowR, shadowG, shadowB, - D_80151328->ambientColor.r + sp78 + sp90, - D_80151328->ambientColor.g + sp7C + sp94, - D_80151328->ambientColor.b + sp80 + sp98, - D_80151328->ambientPower, otherModeLBits + gSpriteShadingProfile->ambientColor.r + sp78 + sp90, + gSpriteShadingProfile->ambientColor.g + sp7C + sp94, + gSpriteShadingProfile->ambientColor.b + sp80 + sp98, + gSpriteShadingProfile->ambientPower, otherModeLBits ); } } diff --git a/src/evt/demo_api.c b/src/evt/demo_api.c index 8a52732b0a..1a09c1a423 100644 --- a/src/evt/demo_api.c +++ b/src/evt/demo_api.c @@ -1,21 +1,80 @@ #include "common.h" +#include "ld_addrs.h" // TODO: not sure where these go u8 D_802D9D70 = 254; u8 D_802D9D71 = 254; u16 StarShrineLightBeamAlpha = 255; -extern s32 D_802DBB60; -extern s32 D_802DBB64; // unused? -extern s32 D_802DBB68; +extern s32 gSpriteShadingHeader[2]; +extern u8 gSpriteShadingData[0x100]; -INCLUDE_ASM(ApiStatus, "evt/demo_api", SetSpriteShading, Evt* script, s32 isInitialCall); +extern u8 sprite_shading_profiles_data_ROM_START[]; + +s32 SetSpriteShading(Evt* script, s32 isInitialCall) { + Bytecode* args = script->ptrReadPos; + s32 profileID = evt_get_variable(script, *args++); + s32 shadingGroupOffset = (profileID >> 0x10) * 8; + s32 shadingProfileOffset = (profileID & 0xFFFF) * 4; + s32 dataOffset; + s32 i; + s32 romStart; + s32 romEnd; + s32 count; + s32 falloff; + s32 data; + SpriteShadingProfile* profile; + + if (profileID == SHADING_NONE) { + return ApiStatus_DONE2; + } + + // load shading group data + romStart = (s32)sprite_shading_profiles_ROM_START; + romEnd = romStart + 8; + dma_copy((u8*) shadingGroupOffset + romStart, (u8*) shadingGroupOffset + romEnd, gSpriteShadingHeader); + + // load offset to shading data + romStart = shadingProfileOffset + (s32)sprite_shading_profiles_ROM_START; + data = gSpriteShadingHeader[0]; + dma_copy((u8*)gSpriteShadingHeader[1] + romStart, (u8*)gSpriteShadingHeader[1] + romStart + 4, gSpriteShadingHeader); + + // load shading data + dataOffset = (s32)sprite_shading_profiles_data_ROM_START + data + gSpriteShadingHeader[0]; + dma_copy((u8*) dataOffset, (u8*) dataOffset + sizeof(gSpriteShadingData), &gSpriteShadingData); + + profile = gSpriteShadingProfile; + count = gSpriteShadingData[0]; + profile->ambientColor.r = gSpriteShadingData[2]; + profile->ambientColor.g = gSpriteShadingData[3]; + profile->ambientColor.b = gSpriteShadingData[4]; + profile->ambientPower = gSpriteShadingData[5]; + + for (i = 0; i < count; i++) { + SpriteShadingLightSource* source = &gSpriteShadingProfile->sources[i]; + source->flags = gSpriteShadingData[6 + 16 * i + 0]; + source->rgb.r = gSpriteShadingData[6 + 16 * i + 1]; + source->rgb.g = gSpriteShadingData[6 + 16 * i + 2]; + source->rgb.b = gSpriteShadingData[6 + 16 * i + 3]; + source->pos.x = (s16) ((gSpriteShadingData[6 + 16 * i + 4] << 8) + gSpriteShadingData[6 + 16 * i + 5]); + source->pos.y = (s16) ((gSpriteShadingData[6 + 16 * i + 6] << 8) + gSpriteShadingData[6 + 16 * i + 7]); + source->pos.z = (s16) ((gSpriteShadingData[6 + 16 * i + 8] << 8) + gSpriteShadingData[6 + 16 * i + 9]); + falloff = gSpriteShadingData[6 + 16 * i + 13] + + (gSpriteShadingData[6 + 16 * i + 12] << 8) + + (gSpriteShadingData[6 + 16 * i + 11] << 16) + + (gSpriteShadingData[6 + 16 * i + 10] << 24); + source->falloff = *(f32*)&falloff; + source->unk_14 = gSpriteShadingData[6 + 16 * i + 14]; + } + gSpriteShadingProfile->flags |= 1; + return ApiStatus_DONE2; +} ApiStatus EnableSpriteShading(Evt* script, s32 isInitialCall) { if (evt_get_variable(script, *script->ptrReadPos) != 0) { - D_80151328->flags |= 1; + gSpriteShadingProfile->flags |= 1; } else { - D_80151328->flags &= ~1; + gSpriteShadingProfile->flags &= ~1; } return ApiStatus_DONE2; } diff --git a/src/evt/script_list.c b/src/evt/script_list.c index ff9b20fbf3..4ce403985a 100644 --- a/src/evt/script_list.c +++ b/src/evt/script_list.c @@ -66,9 +66,9 @@ BSS s32 D_802DB828[2]; // unused? BSS PopupMenu D_802DB830; // demo_api -BSS s32 D_802DBB60; +BSS s32 gSpriteShadingHeader; BSS s32 D_802DBB64; // unused? -BSS s32 D_802DBB68; +BSS s32 gSpriteShadingData; BSS s32 D_802DB8B6C; // unused? BSS char D_802DBB70[0x100]; diff --git a/src/sprite.c b/src/sprite.c index ba5614272c..8129476b50 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -230,14 +230,14 @@ void spr_appendGfx_component_flat( s32 alpha ) { gDPLoadTLUT_pal16(gMasterGfxPos++, 0, palette); - if (D_80151328->flags & 1) { + if (gSpriteShadingProfile->flags & 1) { gDPScrollMultiTile2_4b(gMasterGfxPos++, raster, G_IM_FMT_CI, width, height, 0, 0, width - 1, height - 1, 0, G_TX_CLAMP, G_TX_CLAMP, 8, 8, G_TX_NOLOD, G_TX_NOLOD, 256, 256); gDPSetTile(gMasterGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0x0100, 2, 0, G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); gDPSetTileSize(gMasterGfxPos++, 2, 0, 0, 63 << 2, 0); - if (D_80151328->flags & 2) { + if (gSpriteShadingProfile->flags & 2) { Camera* camera = &gCameras[gCurrentCamID]; if (gGameStatusPtr->isBattle == 2) { gSPViewport(gMasterGfxPos++, &D_802DF3E0); @@ -264,7 +264,7 @@ void spr_appendGfx_component_flat( gDPScrollTextureBlock_4b(gMasterGfxPos++, raster, G_IM_FMT_CI, width, height, 0, G_TX_CLAMP, G_TX_CLAMP, 8, 8, G_TX_NOLOD, G_TX_NOLOD, 256, 256); - if (D_80151328->flags & 2) { + if (gSpriteShadingProfile->flags & 2) { Camera* camera = &gCameras[gCurrentCamID]; if (gGameStatusPtr->isBattle == 2) { gSPViewport(gMasterGfxPos++, &D_802DF3E0); @@ -301,7 +301,7 @@ void spr_appendGfx_component_flat( } } - if (D_80151328->flags & 2) { + if (gSpriteShadingProfile->flags & 2) { Camera* camera = &gCameras[gCurrentCamID]; if (gGameStatusPtr->isBattle == 2) { @@ -358,7 +358,7 @@ void spr_appendGfx_component( gSPMatrix(gMasterGfxPos++, VIRTUAL_TO_PHYSICAL(&gDisplayContext->matrixStack[gMatrixListPos++]), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (D_80151328->flags & 1) { + if (gSpriteShadingProfile->flags & 1) { if ((u8) opacity == 255) { gSPDisplayList(gMasterGfxPos++, D_802DF460); } else { diff --git a/src/world/area_kkj/common/Searchlights.inc.c b/src/world/area_kkj/common/Searchlights.inc.c index 0134451f07..996b4449e1 100644 --- a/src/world/area_kkj/common/Searchlights.inc.c +++ b/src/world/area_kkj/common/Searchlights.inc.c @@ -91,7 +91,7 @@ API_CALLABLE(N(UpdateSearchlight)) { // place light source 30 units ahead of the flashlight add_vec2D_polar(&x, &z, 30.0f, npc->yaw); - lightSource = &D_80151328->sources[lightSourceIdx]; + lightSource = &gSpriteShadingProfile->sources[lightSourceIdx]; lightSource->pos.x = x; lightSource->pos.y = npc->pos.y + 20.0f; lightSource->pos.z = z; diff --git a/src/world/area_kkj/kkj_10/kkj_10_1_main.c b/src/world/area_kkj/kkj_10/kkj_10_1_main.c index be2178330f..06e6ef3271 100644 --- a/src/world/area_kkj/kkj_10/kkj_10_1_main.c +++ b/src/world/area_kkj/kkj_10/kkj_10_1_main.c @@ -3,8 +3,8 @@ API_CALLABLE(N(DisableAllLightSources)) { s32 i; - for (i = 0; i < ARRAY_COUNT(D_80151328->sources); i++) { - D_80151328->sources[i].flags = LIGHT_SOURCE_DISABLED; + for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) { + gSpriteShadingProfile->sources[i].flags = LIGHT_SOURCE_DISABLED; } return ApiStatus_DONE2; diff --git a/src/world/area_kkj/kkj_11/kkj_11_1_main.c b/src/world/area_kkj/kkj_11/kkj_11_1_main.c index 82a3d2370b..50d232915e 100644 --- a/src/world/area_kkj/kkj_11/kkj_11_1_main.c +++ b/src/world/area_kkj/kkj_11/kkj_11_1_main.c @@ -3,8 +3,8 @@ API_CALLABLE(N(DisableAllLightSources)) { s32 i; - for (i = 0; i < ARRAY_COUNT(D_80151328->sources); i++) { - D_80151328->sources[i].flags = LIGHT_SOURCE_DISABLED; + for (i = 0; i < ARRAY_COUNT(gSpriteShadingProfile->sources); i++) { + gSpriteShadingProfile->sources[i].flags = LIGHT_SOURCE_DISABLED; } return ApiStatus_DONE2; diff --git a/src/world/area_kkj/kkj_12/kkj_12_1_main.c b/src/world/area_kkj/kkj_12/kkj_12_1_main.c index 05d56f560c..df459fd761 100644 --- a/src/world/area_kkj/kkj_12/kkj_12_1_main.c +++ b/src/world/area_kkj/kkj_12/kkj_12_1_main.c @@ -4,7 +4,7 @@ API_CALLABLE(N(DisableSpotlightSources)) { s32 i; for (i = 0; i < 2; i++) { - D_80151328->sources[i].flags = LIGHT_SOURCE_DISABLED; + gSpriteShadingProfile->sources[i].flags = LIGHT_SOURCE_DISABLED; } return ApiStatus_DONE2; diff --git a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c index 2a68deef22..410eaf69ab 100644 --- a/src/world/area_kkj/kkj_12/kkj_12_2_npc.c +++ b/src/world/area_kkj/kkj_12/kkj_12_2_npc.c @@ -7,7 +7,7 @@ #include "../common/ApproachPlayer100Units.inc.c" API_CALLABLE(N(DisableLightSource1)) { - D_80151328->sources[1].flags = LIGHT_SOURCE_DISABLED; + gSpriteShadingProfile->sources[1].flags = LIGHT_SOURCE_DISABLED; return ApiStatus_DONE2; } diff --git a/src/world/area_mgm/mgm_01/mgm_01_1_main.c b/src/world/area_mgm/mgm_01/mgm_01_1_main.c index 77f7504358..fc165ae60f 100644 --- a/src/world/area_mgm/mgm_01/mgm_01_1_main.c +++ b/src/world/area_mgm/mgm_01/mgm_01_1_main.c @@ -22,13 +22,13 @@ API_CALLABLE(N(GetSpotlightPos)) { lightBeamRotX = spotLightPosZ * -0.35 * 0.3; lightBeamRotZ = spotLightPosX * 0.35; - + evt_set_float_variable(script, LVar0, spotLightPosX); evt_set_float_variable(script, LVar1, spotLightPosZ); evt_set_float_variable(script, LVar2, lightBeamRotX); evt_set_float_variable(script, LVar3, lightBeamRotZ); - - shading = D_80151328; + + shading = gSpriteShadingProfile; shading->sources[0].pos.x = gPlayerStatusPtr->position.x * 0.8; shading->sources[0].pos.y = 80.0f; shading->sources[0].pos.z = gPlayerStatusPtr->position.z + 50.0f; diff --git a/src/world/area_mim/mim_12/mim_12_5_gate.c b/src/world/area_mim/mim_12/mim_12_5_gate.c index 70f74b8b69..6bbb821c2b 100644 --- a/src/world/area_mim/mim_12/mim_12_5_gate.c +++ b/src/world/area_mim/mim_12/mim_12_5_gate.c @@ -80,7 +80,7 @@ API_CALLABLE(N(InterpBackgroundDarkness)) { } API_CALLABLE(N(InterpSpriteShadingColor)) { - SpriteShadingProfile* shadingProfile = D_80151328; + SpriteShadingProfile* shadingProfile = gSpriteShadingProfile; Bytecode* args = script->ptrReadPos; if (isInitialCall) { @@ -91,7 +91,7 @@ API_CALLABLE(N(InterpSpriteShadingColor)) { script->varTable[4] = shadingProfile->ambientColor.g; script->varTable[5] = shadingProfile->ambientColor.b; script->varTable[6] = 0; - D_80151328->flags |= 1; + gSpriteShadingProfile->flags |= 1; } script->varTable[6]++; @@ -101,7 +101,7 @@ API_CALLABLE(N(InterpSpriteShadingColor)) { if (script->varTable[6] == 20) { if (script->varTable[0] == 255) { - D_80151328->flags &= ~1; + gSpriteShadingProfile->flags &= ~1; } return ApiStatus_DONE2; } diff --git a/ver/us/asm/bss3.s b/ver/us/asm/bss3.s index ec84ab89d2..5833a5ba45 100644 --- a/ver/us/asm/bss3.s +++ b/ver/us/asm/bss3.s @@ -7,7 +7,7 @@ .section .bss -dlabel D_801512B0 +dlabel gAuxSpriteShadingProfile .space 4 dlabel gHudElementsNumber @@ -103,7 +103,7 @@ dlabel D_80151320 dlabel entity_numShadows .space 4 -dlabel D_80151328 +dlabel gSpriteShadingProfile .space 4 dlabel entity_area_specific_data_is_loaded @@ -643,16 +643,16 @@ dlabel D_8015959E dlabel gBackroundLastScrollValue .space 0x00000020 -dlabel D_801595C0 +dlabel wSpriteShadingProfile .space 0x000000b0 -dlabel D_80159670 +dlabel bSpriteShadingProfile .space 0x000000b0 -dlabel D_80159720 +dlabel wSpriteShadingProfileAux .space 0x000000b0 -dlabel D_801597D0 +dlabel bSpriteShadingProfileAux .space 0x000000b0 dlabel D_80159880 diff --git a/ver/us/asm/nonmatchings/evt/demo_api/SetSpriteShading.s b/ver/us/asm/nonmatchings/evt/demo_api/SetSpriteShading.s deleted file mode 100644 index 1ddbe95543..0000000000 --- a/ver/us/asm/nonmatchings/evt/demo_api/SetSpriteShading.s +++ /dev/null @@ -1,214 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel SetSpriteShading -/* FE0B0 802D9700 27BDFF98 */ addiu $sp, $sp, -0x68 -/* FE0B4 802D9704 AFBF0064 */ sw $ra, 0x64($sp) -/* FE0B8 802D9708 AFBE0060 */ sw $fp, 0x60($sp) -/* FE0BC 802D970C AFB7005C */ sw $s7, 0x5c($sp) -/* FE0C0 802D9710 AFB60058 */ sw $s6, 0x58($sp) -/* FE0C4 802D9714 AFB50054 */ sw $s5, 0x54($sp) -/* FE0C8 802D9718 AFB40050 */ sw $s4, 0x50($sp) -/* FE0CC 802D971C AFB3004C */ sw $s3, 0x4c($sp) -/* FE0D0 802D9720 AFB20048 */ sw $s2, 0x48($sp) -/* FE0D4 802D9724 AFB10044 */ sw $s1, 0x44($sp) -/* FE0D8 802D9728 AFB00040 */ sw $s0, 0x40($sp) -/* FE0DC 802D972C 8C82000C */ lw $v0, 0xc($a0) -/* FE0E0 802D9730 0C0B1EAF */ jal evt_get_variable -/* FE0E4 802D9734 8C450000 */ lw $a1, ($v0) -/* FE0E8 802D9738 00021C03 */ sra $v1, $v0, 0x10 -/* FE0EC 802D973C 000330C0 */ sll $a2, $v1, 3 -/* FE0F0 802D9740 3043FFFF */ andi $v1, $v0, 0xffff -/* FE0F4 802D9744 00039080 */ sll $s2, $v1, 2 -/* FE0F8 802D9748 2403FFFF */ addiu $v1, $zero, -1 -/* FE0FC 802D974C 104300AF */ beq $v0, $v1, .L802D9A0C -/* FE100 802D9750 24020002 */ addiu $v0, $zero, 2 -/* FE104 802D9754 3C100031 */ lui $s0, %hi(sprite_shading_profiles_ROM_START) -/* FE108 802D9758 26105B80 */ addiu $s0, $s0, %lo(sprite_shading_profiles_ROM_START) -/* FE10C 802D975C 00D02021 */ addu $a0, $a2, $s0 -/* FE110 802D9760 26050008 */ addiu $a1, $s0, 8 -/* FE114 802D9764 00C52821 */ addu $a1, $a2, $a1 -/* FE118 802D9768 3C11802E */ lui $s1, %hi(D_802DBB60) -/* FE11C 802D976C 2631BB60 */ addiu $s1, $s1, %lo(D_802DBB60) -/* FE120 802D9770 0C00A5CF */ jal dma_copy -/* FE124 802D9774 0220302D */ daddu $a2, $s1, $zero -/* FE128 802D9778 0220302D */ daddu $a2, $s1, $zero -/* FE12C 802D977C 8E240004 */ lw $a0, 4($s1) -/* FE130 802D9780 02508021 */ addu $s0, $s2, $s0 -/* FE134 802D9784 00902021 */ addu $a0, $a0, $s0 -/* FE138 802D9788 8E300000 */ lw $s0, ($s1) -/* FE13C 802D978C 0C00A5CF */ jal dma_copy -/* FE140 802D9790 24850004 */ addiu $a1, $a0, 4 -/* FE144 802D9794 3C12802E */ lui $s2, %hi(D_802DBB68) -/* FE148 802D9798 2652BB68 */ addiu $s2, $s2, %lo(D_802DBB68) -/* FE14C 802D979C 0240302D */ daddu $a2, $s2, $zero -/* FE150 802D97A0 8E220000 */ lw $v0, ($s1) -/* FE154 802D97A4 3C030031 */ lui $v1, %hi(sprite_shading_profiles_ROM_START + 0x1D0) -/* FE158 802D97A8 24635D50 */ addiu $v1, $v1, %lo(sprite_shading_profiles_ROM_START + 0x1D0) -/* FE15C 802D97AC 00431021 */ addu $v0, $v0, $v1 -/* FE160 802D97B0 02028021 */ addu $s0, $s0, $v0 -/* FE164 802D97B4 0200202D */ daddu $a0, $s0, $zero -/* FE168 802D97B8 0C00A5CF */ jal dma_copy -/* FE16C 802D97BC 24850100 */ addiu $a1, $a0, 0x100 -/* FE170 802D97C0 3C058015 */ lui $a1, %hi(D_80151328) -/* FE174 802D97C4 24A51328 */ addiu $a1, $a1, %lo(D_80151328) -/* FE178 802D97C8 92470000 */ lbu $a3, ($s2) -/* FE17C 802D97CC 8CA30000 */ lw $v1, ($a1) -/* FE180 802D97D0 92420002 */ lbu $v0, 2($s2) -/* FE184 802D97D4 AFA70014 */ sw $a3, 0x14($sp) -/* FE188 802D97D8 A06200AC */ sb $v0, 0xac($v1) -/* FE18C 802D97DC 92420003 */ lbu $v0, 3($s2) -/* FE190 802D97E0 A06200AD */ sb $v0, 0xad($v1) -/* FE194 802D97E4 92420004 */ lbu $v0, 4($s2) -/* FE198 802D97E8 A06200AE */ sb $v0, 0xae($v1) -/* FE19C 802D97EC 92420005 */ lbu $v0, 5($s2) -/* FE1A0 802D97F0 0000882D */ daddu $s1, $zero, $zero -/* FE1A4 802D97F4 10E0007F */ beqz $a3, .L802D99F4 -/* FE1A8 802D97F8 A06200AF */ sb $v0, 0xaf($v1) -/* FE1AC 802D97FC 0240802D */ daddu $s0, $s2, $zero -/* FE1B0 802D9800 24070014 */ addiu $a3, $zero, 0x14 -/* FE1B4 802D9804 AFA7002C */ sw $a3, 0x2c($sp) -/* FE1B8 802D9808 24070010 */ addiu $a3, $zero, 0x10 -/* FE1BC 802D980C 240B0011 */ addiu $t3, $zero, 0x11 -/* FE1C0 802D9810 240C0012 */ addiu $t4, $zero, 0x12 -/* FE1C4 802D9814 240D0013 */ addiu $t5, $zero, 0x13 -/* FE1C8 802D9818 240E000F */ addiu $t6, $zero, 0xf -/* FE1CC 802D981C 240F000E */ addiu $t7, $zero, 0xe -/* FE1D0 802D9820 241E000D */ addiu $fp, $zero, 0xd -/* FE1D4 802D9824 2417000C */ addiu $s7, $zero, 0xc -/* FE1D8 802D9828 2416000B */ addiu $s6, $zero, 0xb -/* FE1DC 802D982C 2415000A */ addiu $s5, $zero, 0xa -/* FE1E0 802D9830 24140009 */ addiu $s4, $zero, 9 -/* FE1E4 802D9834 24130008 */ addiu $s3, $zero, 8 -/* FE1E8 802D9838 24190007 */ addiu $t9, $zero, 7 -/* FE1EC 802D983C 24180006 */ addiu $t8, $zero, 6 -/* FE1F0 802D9840 24120004 */ addiu $s2, $zero, 4 -/* FE1F4 802D9844 AFA70030 */ sw $a3, 0x30($sp) -.L802D9848: -/* FE1F8 802D9848 01D05021 */ addu $t2, $t6, $s0 -/* FE1FC 802D984C 25CE0010 */ addiu $t6, $t6, 0x10 -/* FE200 802D9850 01F04821 */ addu $t1, $t7, $s0 -/* FE204 802D9854 25EF0010 */ addiu $t7, $t7, 0x10 -/* FE208 802D9858 03D04021 */ addu $t0, $fp, $s0 -/* FE20C 802D985C 27DE0010 */ addiu $fp, $fp, 0x10 -/* FE210 802D9860 02D03021 */ addu $a2, $s6, $s0 -/* FE214 802D9864 26D60010 */ addiu $s6, $s6, 0x10 -/* FE218 802D9868 02B02021 */ addu $a0, $s5, $s0 -/* FE21C 802D986C 26B50010 */ addiu $s5, $s5, 0x10 -/* FE220 802D9870 03101021 */ addu $v0, $t8, $s0 -/* FE224 802D9874 02901821 */ addu $v1, $s4, $s0 -/* FE228 802D9878 8FA7002C */ lw $a3, 0x2c($sp) -/* FE22C 802D987C 26940010 */ addiu $s4, $s4, 0x10 -/* FE230 802D9880 00F03821 */ addu $a3, $a3, $s0 -/* FE234 802D9884 AFA70028 */ sw $a3, 0x28($sp) -/* FE238 802D9888 8FA7002C */ lw $a3, 0x2c($sp) -/* FE23C 802D988C 27180010 */ addiu $t8, $t8, 0x10 -/* FE240 802D9890 24E70010 */ addiu $a3, $a3, 0x10 -/* FE244 802D9894 AFA7002C */ sw $a3, 0x2c($sp) -/* FE248 802D9898 8FA70030 */ lw $a3, 0x30($sp) -/* FE24C 802D989C 26310001 */ addiu $s1, $s1, 1 -/* FE250 802D98A0 00F03821 */ addu $a3, $a3, $s0 -/* FE254 802D98A4 AFA70024 */ sw $a3, 0x24($sp) -/* FE258 802D98A8 8FA70030 */ lw $a3, 0x30($sp) -/* FE25C 802D98AC 3C058015 */ lui $a1, %hi(D_80151328) -/* FE260 802D98B0 8CA51328 */ lw $a1, %lo(D_80151328)($a1) -/* FE264 802D98B4 24E70010 */ addiu $a3, $a3, 0x10 -/* FE268 802D98B8 AFA70030 */ sw $a3, 0x30($sp) -/* FE26C 802D98BC 01703821 */ addu $a3, $t3, $s0 -/* FE270 802D98C0 AFA70020 */ sw $a3, 0x20($sp) -/* FE274 802D98C4 01903821 */ addu $a3, $t4, $s0 -/* FE278 802D98C8 AFA7001C */ sw $a3, 0x1c($sp) -/* FE27C 802D98CC 01B03821 */ addu $a3, $t5, $s0 -/* FE280 802D98D0 AFA70018 */ sw $a3, 0x18($sp) -/* FE284 802D98D4 90420000 */ lbu $v0, ($v0) -/* FE288 802D98D8 00B22821 */ addu $a1, $a1, $s2 -/* FE28C 802D98DC A0A20000 */ sb $v0, ($a1) -/* FE290 802D98E0 03301021 */ addu $v0, $t9, $s0 -/* FE294 802D98E4 90420000 */ lbu $v0, ($v0) -/* FE298 802D98E8 26520018 */ addiu $s2, $s2, 0x18 -/* FE29C 802D98EC A0A20001 */ sb $v0, 1($a1) -/* FE2A0 802D98F0 02701021 */ addu $v0, $s3, $s0 -/* FE2A4 802D98F4 90420000 */ lbu $v0, ($v0) -/* FE2A8 802D98F8 256B0010 */ addiu $t3, $t3, 0x10 -/* FE2AC 802D98FC A0A20002 */ sb $v0, 2($a1) -/* FE2B0 802D9900 90620000 */ lbu $v0, ($v1) -/* FE2B4 802D9904 02F03821 */ addu $a3, $s7, $s0 -/* FE2B8 802D9908 A0A20003 */ sb $v0, 3($a1) -/* FE2BC 802D990C 90830000 */ lbu $v1, ($a0) -/* FE2C0 802D9910 90C20000 */ lbu $v0, ($a2) -/* FE2C4 802D9914 00031A00 */ sll $v1, $v1, 8 -/* FE2C8 802D9918 00431021 */ addu $v0, $v0, $v1 -/* FE2CC 802D991C 00021400 */ sll $v0, $v0, 0x10 -/* FE2D0 802D9920 00021403 */ sra $v0, $v0, 0x10 -/* FE2D4 802D9924 44820000 */ mtc1 $v0, $f0 -/* FE2D8 802D9928 00000000 */ nop -/* FE2DC 802D992C 46800020 */ cvt.s.w $f0, $f0 -/* FE2E0 802D9930 E4A00004 */ swc1 $f0, 4($a1) -/* FE2E4 802D9934 90E30000 */ lbu $v1, ($a3) -/* FE2E8 802D9938 91020000 */ lbu $v0, ($t0) -/* FE2EC 802D993C 00031A00 */ sll $v1, $v1, 8 -/* FE2F0 802D9940 00431021 */ addu $v0, $v0, $v1 -/* FE2F4 802D9944 00021400 */ sll $v0, $v0, 0x10 -/* FE2F8 802D9948 00021403 */ sra $v0, $v0, 0x10 -/* FE2FC 802D994C 44820000 */ mtc1 $v0, $f0 -/* FE300 802D9950 00000000 */ nop -/* FE304 802D9954 46800020 */ cvt.s.w $f0, $f0 -/* FE308 802D9958 E4A00008 */ swc1 $f0, 8($a1) -/* FE30C 802D995C 91230000 */ lbu $v1, ($t1) -/* FE310 802D9960 91420000 */ lbu $v0, ($t2) -/* FE314 802D9964 00031A00 */ sll $v1, $v1, 8 -/* FE318 802D9968 00431021 */ addu $v0, $v0, $v1 -/* FE31C 802D996C 00021400 */ sll $v0, $v0, 0x10 -/* FE320 802D9970 00021403 */ sra $v0, $v0, 0x10 -/* FE324 802D9974 44820000 */ mtc1 $v0, $f0 -/* FE328 802D9978 00000000 */ nop -/* FE32C 802D997C 46800020 */ cvt.s.w $f0, $f0 -/* FE330 802D9980 E4A0000C */ swc1 $f0, 0xc($a1) -/* FE334 802D9984 8FA7001C */ lw $a3, 0x1c($sp) -/* FE338 802D9988 258C0010 */ addiu $t4, $t4, 0x10 -/* FE33C 802D998C 90E30000 */ lbu $v1, ($a3) -/* FE340 802D9990 8FA70018 */ lw $a3, 0x18($sp) -/* FE344 802D9994 00031A00 */ sll $v1, $v1, 8 -/* FE348 802D9998 90E20000 */ lbu $v0, ($a3) -/* FE34C 802D999C 8FA70020 */ lw $a3, 0x20($sp) -/* FE350 802D99A0 00431021 */ addu $v0, $v0, $v1 -/* FE354 802D99A4 90E40000 */ lbu $a0, ($a3) -/* FE358 802D99A8 8FA70024 */ lw $a3, 0x24($sp) -/* FE35C 802D99AC 00042400 */ sll $a0, $a0, 0x10 -/* FE360 802D99B0 90E30000 */ lbu $v1, ($a3) -/* FE364 802D99B4 00441021 */ addu $v0, $v0, $a0 -/* FE368 802D99B8 00031E00 */ sll $v1, $v1, 0x18 -/* FE36C 802D99BC 00431021 */ addu $v0, $v0, $v1 -/* FE370 802D99C0 AFA20010 */ sw $v0, 0x10($sp) -/* FE374 802D99C4 C7A00010 */ lwc1 $f0, 0x10($sp) -/* FE378 802D99C8 25AD0010 */ addiu $t5, $t5, 0x10 -/* FE37C 802D99CC E4A00010 */ swc1 $f0, 0x10($a1) -/* FE380 802D99D0 8FA70028 */ lw $a3, 0x28($sp) -/* FE384 802D99D4 26F70010 */ addiu $s7, $s7, 0x10 -/* FE388 802D99D8 90E20000 */ lbu $v0, ($a3) -/* FE38C 802D99DC 27390010 */ addiu $t9, $t9, 0x10 -/* FE390 802D99E0 A0A20014 */ sb $v0, 0x14($a1) -/* FE394 802D99E4 8FA70014 */ lw $a3, 0x14($sp) -/* FE398 802D99E8 0227102A */ slt $v0, $s1, $a3 -/* FE39C 802D99EC 1440FF96 */ bnez $v0, .L802D9848 -/* FE3A0 802D99F0 26730010 */ addiu $s3, $s3, 0x10 -.L802D99F4: -/* FE3A4 802D99F4 3C048015 */ lui $a0, %hi(D_80151328) -/* FE3A8 802D99F8 8C841328 */ lw $a0, %lo(D_80151328)($a0) -/* FE3AC 802D99FC 94830000 */ lhu $v1, ($a0) -/* FE3B0 802D9A00 24020002 */ addiu $v0, $zero, 2 -/* FE3B4 802D9A04 34630001 */ ori $v1, $v1, 1 -/* FE3B8 802D9A08 A4830000 */ sh $v1, ($a0) -.L802D9A0C: -/* FE3BC 802D9A0C 8FBF0064 */ lw $ra, 0x64($sp) -/* FE3C0 802D9A10 8FBE0060 */ lw $fp, 0x60($sp) -/* FE3C4 802D9A14 8FB7005C */ lw $s7, 0x5c($sp) -/* FE3C8 802D9A18 8FB60058 */ lw $s6, 0x58($sp) -/* FE3CC 802D9A1C 8FB50054 */ lw $s5, 0x54($sp) -/* FE3D0 802D9A20 8FB40050 */ lw $s4, 0x50($sp) -/* FE3D4 802D9A24 8FB3004C */ lw $s3, 0x4c($sp) -/* FE3D8 802D9A28 8FB20048 */ lw $s2, 0x48($sp) -/* FE3DC 802D9A2C 8FB10044 */ lw $s1, 0x44($sp) -/* FE3E0 802D9A30 8FB00040 */ lw $s0, 0x40($sp) -/* FE3E4 802D9A34 03E00008 */ jr $ra -/* FE3E8 802D9A38 27BD0068 */ addiu $sp, $sp, 0x68 diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index bba387d617..aae645834f 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -4833,7 +4833,7 @@ gEntityModelCount = 0x80151318; // rom:0xE7A18 D_8015131C = 0x8015131C; // type:data rom:0xE7A1C D_80151320 = 0x80151320; // type:data rom:0xE7A20 D_80151324 = 0x80151324; // type:data rom:0xE7A24 -D_80151328 = 0x80151328; // type:data rom:0xE7A28 +gSpriteShadingProfile = 0x80151328; // type:data rom:0xE7A28 D_8015132C = 0x8015132C; // type:data rom:0xE7A2C entity_updateCounter = 0x80151330; // type:data rom:0xE7A30 gTriggerCount = 0x80151334; // rom:0xE7A34 @@ -5227,10 +5227,10 @@ gBackgroundPalette = 0x801593A0; // type:data rom:0xEFAA0 ShakeCam = 0x802CB2A8; // type:func rom:0xEFC58 D_8015959E = 0x8015959E; // type:data rom:0xEFC9E gBackroundLastScrollValue = 0x801595A0; // type:data rom:0xEFCA0 -D_801595C0 = 0x801595C0; // type:data rom:0xEFCC0 -D_80159670 = 0x80159670; // type:data rom:0xEFD70 -D_80159720 = 0x80159720; // type:data rom:0xEFE20 -D_801597D0 = 0x801597D0; // type:data rom:0xEFED0 +wSpriteShadingProfile = 0x801595C0; // type:data rom:0xEFCC0 +bSpriteShadingProfile = 0x80159670; // type:data rom:0xEFD70 +wSpriteShadingProfileAux = 0x80159720; // type:data rom:0xEFE20 +bSpriteShadingProfileAux = 0x801597D0; // type:data rom:0xEFED0 exec_ShakeCam1 = 0x802CB56C; // type:func rom:0xEFF1C exec_ShakeCamX = 0x802CB5C8; // type:func rom:0xEFF78 D_80159880 = 0x80159880; // type:data rom:0xEFF80 @@ -26033,7 +26033,7 @@ get_default_variation_for_song = 0x8014A430; // D_8014F120 = 0x8014F120; // type:data D_8014F128 = 0x8014F128; // type:data rodata_padding_2 = 0x80150BBC; // type:data -D_801512B0 = 0x801512B0; // type:data +gAuxSpriteShadingProfile = 0x801512B0; // type:data D_801512E8 = 0x801512E8; // type:data B_801512F0 = 0x801512F0; // type:data gBattleEntityList = 0x801513F8; // @@ -27178,8 +27178,8 @@ MusicEventList = 0x802DB7D0; // type:data RunningMusicEvents = 0x802DB7D8; // type:data RunningMusicEventIDs = 0x802DB800; // type:data D_802DB830 = 0x802DB830; // type:data -D_802DBB60 = 0x802DBB60; // type:data -D_802DBB68 = 0x802DBB68; // type:data +gSpriteShadingHeader = 0x802DBB60; // type:data +gSpriteShadingData = 0x802DBB68; // type:data gWorldMapFlags = 0x802DBC70; // size:0xC DoorModelsSwingCW = 0x802DBC7C; // type:data wPushBlockGrids = 0x802DBC88; // type:data diff --git a/ver/us/undefined_syms.txt b/ver/us/undefined_syms.txt index b3a197ded8..87ca044665 100644 --- a/ver/us/undefined_syms.txt +++ b/ver/us/undefined_syms.txt @@ -8,6 +8,8 @@ D_804DC500 = 0x804DC500; fx_sun_undeclared = fx_sun; +sprite_shading_profiles_data_ROM_START = sprite_shading_profiles_ROM_START + 0x1D0; + battle_move_end = mushroom_VRAM_END; battle_move_end = MAX(battle_move_end, fire_flower_VRAM_END); battle_move_end = MAX(battle_move_end, dusty_hammer_VRAM_END);