diff options
| author | Baoulettes <perlouzerie@hotmail.fr> | 2022-05-29 23:02:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-29 23:02:19 +0200 |
| commit | ea0ea0366be367fa6c8015772728489a22ebfdde (patch) | |
| tree | 90d295b68a32dc8eb312778865be226e6ed31c8d /soh/src/code | |
| parent | 72125bbd1e604369527e99056390bda2d37d9d9b (diff) | |
| parent | daec428cb3844bdb5261f5ddf47b613cce514d05 (diff) | |
Merge branch 'develop' into 3DProjectiles
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_actor.c | 2 | ||||
| -rw-r--r-- | soh/src/code/z_lifemeter.c | 49 | ||||
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 13 | ||||
| -rw-r--r-- | soh/src/code/z_parameter.c | 21 | ||||
| -rw-r--r-- | soh/src/code/z_player_lib.c | 154 | ||||
| -rw-r--r-- | soh/src/code/z_sram.c | 4 |
6 files changed, 190 insertions, 53 deletions
diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index ba5d4dcd6..bdb2fe78c 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -2290,8 +2290,8 @@ void Actor_DrawFaroresWindPointer(GlobalContext* globalCtx) { ((void)0, gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y) + yOffset, ((void)0, gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z), 255, 255, 255, lightRadius); - CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 5474); } + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 5474); } void func_80030488(GlobalContext* globalCtx) { diff --git a/soh/src/code/z_lifemeter.c b/soh/src/code/z_lifemeter.c index 30b18683f..e45850a73 100644 --- a/soh/src/code/z_lifemeter.c +++ b/soh/src/code/z_lifemeter.c @@ -128,6 +128,13 @@ void HealthMeter_Init(GlobalContext* globalCtx) { HeartDDOutline[0] = CVar_GetS32("gDDCCHeartsPrimR", 90); HeartDDOutline[1] = CVar_GetS32("gDDCCHeartsPrimG", 90); HeartDDOutline[2] = CVar_GetS32("gDDCCHeartsPrimB", 90); + } else { + HeartInner[0] = HEARTS_PRIM_R; + HeartInner[1] = HEARTS_PRIM_G; + HeartInner[2] = HEARTS_PRIM_B; + HeartDDOutline[0] = HEARTS_DD_PRIM_R; + HeartDDOutline[1] = HEARTS_DD_PRIM_G; + HeartDDOutline[2] = HEARTS_DD_PRIM_B; } interfaceCtx->unk_228 = 0x140; @@ -194,12 +201,12 @@ void HealthMeter_Update(GlobalContext* globalCtx) { HeartDDOutline[1] = CVar_GetS32("gDDCCHeartsPrimG", sHeartsDDPrim[0][1]); HeartDDOutline[2] = CVar_GetS32("gDDCCHeartsPrimB", sHeartsDDPrim[0][2]); } else { - HeartInner[0] = sHeartsPrimColors[0][0]; - HeartInner[1] = sHeartsPrimColors[0][1]; - HeartInner[2] = sHeartsPrimColors[0][2]; - HeartDDOutline[0] = sHeartsDDPrim[0][0]; - HeartDDOutline[1] = sHeartsDDPrim[0][1]; - HeartDDOutline[2] = sHeartsDDPrim[0][2]; + HeartInner[0] = HEARTS_PRIM_R; + HeartInner[1] = HEARTS_PRIM_G; + HeartInner[2] = HEARTS_PRIM_B; + HeartDDOutline[0] = HEARTS_DD_PRIM_R; + HeartDDOutline[1] = HEARTS_DD_PRIM_G; + HeartDDOutline[2] = HEARTS_DD_PRIM_B; } if (interfaceCtx->unk_200 != 0) { @@ -299,33 +306,33 @@ void HealthMeter_Update(GlobalContext* globalCtx) { sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF; sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF; } else { - sHeartsDDPrim[2][0] = HeartInner[0]; - sHeartsDDPrim[2][1] = HeartInner[1]; - sHeartsDDPrim[2][2] = HeartInner[2]; + sHeartsDDPrim[2][0] = HEARTS_PRIM_R; + sHeartsDDPrim[2][1] = HEARTS_PRIM_G; + sHeartsDDPrim[2][2] = HEARTS_PRIM_B; - sHeartsDDPrim[1][0] = sHeartsDDPrimColors[ddType][0]; - sHeartsDDPrim[1][1] = sHeartsDDPrimColors[ddType][1]; - sHeartsDDPrim[1][2] = sHeartsDDPrimColors[ddType][2]; + sHeartsDDPrim[1][0] = HEARTS_DD_PRIM_R; + sHeartsDDPrim[1][1] = HEARTS_DD_PRIM_G; + sHeartsDDPrim[1][2] = HEARTS_DD_PRIM_B; - sHeartsDDEnv[1][0] = sHeartsDDEnvColors[ddType][0]; - sHeartsDDEnv[1][1] = sHeartsDDEnvColors[ddType][1]; - sHeartsDDEnv[1][2] = sHeartsDDEnvColors[ddType][2]; + sHeartsDDEnv[1][0] = HEARTS_PRIM_R; + sHeartsDDEnv[1][1] = HEARTS_PRIM_G; + sHeartsDDEnv[1][2] = HEARTS_PRIM_B; rFactor = sHeartsDDPrimFactors[ddType][0] * ddFactor; gFactor = sHeartsDDPrimFactors[ddType][1] * ddFactor; bFactor = sHeartsDDPrimFactors[ddType][2] * ddFactor; - sBeatingHeartsDDPrim[0] = (u8)(rFactor + HeartDDOutline[0]) & 0xFF; - sBeatingHeartsDDPrim[1] = (u8)(gFactor + HeartDDOutline[1]) & 0xFF; - sBeatingHeartsDDPrim[2] = (u8)(bFactor + HeartDDOutline[2]) & 0xFF; + sBeatingHeartsDDPrim[0] = (u8)(rFactor + HEARTS_DD_PRIM_R) & 0xFF; + sBeatingHeartsDDPrim[1] = (u8)(gFactor + HEARTS_DD_PRIM_G) & 0xFF; + sBeatingHeartsDDPrim[2] = (u8)(bFactor + HEARTS_DD_PRIM_B) & 0xFF; rFactor = sHeartsDDEnvFactors[ddType][0] * ddFactor; gFactor = sHeartsDDEnvFactors[ddType][1] * ddFactor; bFactor = sHeartsDDEnvFactors[ddType][2] * ddFactor; - sBeatingHeartsDDEnv[0] = (u8)(rFactor + HeartDDInner[0]) & 0xFF; - sBeatingHeartsDDEnv[1] = (u8)(gFactor + HeartDDInner[1]) & 0xFF; - sBeatingHeartsDDEnv[2] = (u8)(bFactor + HeartDDInner[2]) & 0xFF; + sBeatingHeartsDDEnv[0] = (u8)(rFactor + HEARTS_PRIM_R) & 0xFF; + sBeatingHeartsDDEnv[1] = (u8)(gFactor + HEARTS_PRIM_G) & 0xFF; + sBeatingHeartsDDEnv[2] = (u8)(bFactor + HEARTS_PRIM_B) & 0xFF; } } diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 33bc9a95e..84cf20e71 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -272,6 +272,13 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) { const char** languageSegmentTable; Font* font; const char* seg; + u16 bufferId = textId; + // Use the better owl message if better owl is enabled + if (CVar_GetS32("gBetterOwl", 0) != 0 && (bufferId == 0x2066 || bufferId == 0x607B || + bufferId == 0x10C2 || bufferId == 0x10C6 || bufferId == 0x206A)) + { + bufferId = 0x71B3; + } if (gSaveContext.language == LANGUAGE_GER) messageTableEntry = sGerMessageEntryTablePtr; @@ -287,7 +294,7 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) { while (messageTableEntry->textId != 0xFFFF) { font = &globalCtx->msgCtx.font; - if (messageTableEntry->textId == textId) { + if (messageTableEntry->textId == bufferId) { foundSeg = messageTableEntry->segment; font->charTexBuf[0] = messageTableEntry->typePos; @@ -298,14 +305,14 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) { // "Message found!!!" osSyncPrintf(" メッセージが,見つかった!!! = %x " "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", - textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); + bufferId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); return; } messageTableEntry++; } // "Message not found!!!" - osSyncPrintf(" メッセージが,見つからなかった!!! = %x\n", textId); + osSyncPrintf(" メッセージが,見つからなかった!!! = %x\n", bufferId); font = &globalCtx->msgCtx.font; messageTableEntry = sNesMessageEntryTablePtr; diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index dcfcdb05b..a9e9e4f9e 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2884,7 +2884,26 @@ void Interface_DrawItemButtons(GlobalContext* globalCtx) { gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); - + + //There is probably a more elegant way to do it. + char* doAction = actionsTbl[3]; + char newName[512]; + if (gSaveContext.language != LANGUAGE_ENG) { + size_t length = strlen(doAction); + strcpy(newName, doAction); + if (gSaveContext.language == LANGUAGE_FRA) { + newName[length - 6] = 'F'; + newName[length - 5] = 'R'; + newName[length - 4] = 'A'; + } else if (gSaveContext.language == LANGUAGE_GER) { + newName[length - 6] = 'G'; + newName[length - 5] = 'E'; + newName[length - 4] = 'R'; + } + doAction = newName; + } + memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, ResourceMgr_LoadTexByName(doAction), DO_ACTION_TEX_SIZE); + gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE * 2, G_IM_FMT_IA, DO_ACTION_TEX_WIDTH, DO_ACTION_TEX_HEIGHT, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index af95f26df..cf7fbd51c 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -744,26 +744,38 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, #else gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[eyeIndex])); #endif - Color_RGB8 NewColor[3]; - color = &sTunicColors[tunic]; - if (CVar_GetS32("gUseTunicsCol",0) == 1) { - if (tunic == PLAYER_TUNIC_KOKIRI || tunic == PLAYER_TUNIC_GORON || tunic == PLAYER_TUNIC_ZORA) { - NewColor[PLAYER_TUNIC_KOKIRI].r = CVar_GetS32("gTunic_Kokiri_R", sTunicColors[PLAYER_TUNIC_KOKIRI].r); - NewColor[PLAYER_TUNIC_KOKIRI].g = CVar_GetS32("gTunic_Kokiri_G", sTunicColors[PLAYER_TUNIC_KOKIRI].g); - NewColor[PLAYER_TUNIC_KOKIRI].b = CVar_GetS32("gTunic_Kokiri_B", sTunicColors[PLAYER_TUNIC_KOKIRI].b); - NewColor[PLAYER_TUNIC_GORON].r = CVar_GetS32("gTunic_Goron_R", sTunicColors[PLAYER_TUNIC_GORON].r); - NewColor[PLAYER_TUNIC_GORON].g = CVar_GetS32("gTunic_Goron_G", sTunicColors[PLAYER_TUNIC_GORON].g); - NewColor[PLAYER_TUNIC_GORON].b = CVar_GetS32("gTunic_Goron_B", sTunicColors[PLAYER_TUNIC_GORON].b); - NewColor[PLAYER_TUNIC_ZORA].r = CVar_GetS32("gTunic_Zora_R", sTunicColors[PLAYER_TUNIC_ZORA].r); - NewColor[PLAYER_TUNIC_ZORA].g = CVar_GetS32("gTunic_Zora_G", sTunicColors[PLAYER_TUNIC_ZORA].g); - NewColor[PLAYER_TUNIC_ZORA].b = CVar_GetS32("gTunic_Zora_B", sTunicColors[PLAYER_TUNIC_ZORA].b); + + Color_RGB8 sTemp; + Color_RGB8 sOriginalTunicColors[] = { + { 30, 105, 27 }, + { 100, 20, 0 }, + { 0, 60, 100 }, + }; + color = &sTemp; + if (tunic == PLAYER_TUNIC_KOKIRI && CVar_GetS32("gUseTunicsCol",0)) { + color->r = CVar_GetS32("gTunic_Kokiri_R", sTunicColors[PLAYER_TUNIC_KOKIRI].r); + color->g = CVar_GetS32("gTunic_Kokiri_G", sTunicColors[PLAYER_TUNIC_KOKIRI].g); + color->b = CVar_GetS32("gTunic_Kokiri_B", sTunicColors[PLAYER_TUNIC_KOKIRI].b); + } else if (tunic == PLAYER_TUNIC_GORON && CVar_GetS32("gUseTunicsCol",0)) { + color->r = CVar_GetS32("gTunic_Goron_R", sTunicColors[PLAYER_TUNIC_GORON].r); + color->g = CVar_GetS32("gTunic_Goron_G", sTunicColors[PLAYER_TUNIC_GORON].g); + color->b = CVar_GetS32("gTunic_Goron_B", sTunicColors[PLAYER_TUNIC_GORON].b); + } else if (tunic == PLAYER_TUNIC_ZORA && CVar_GetS32("gUseTunicsCol",0)) { + color->r = CVar_GetS32("gTunic_Zora_R", sTunicColors[PLAYER_TUNIC_ZORA].r); + color->g = CVar_GetS32("gTunic_Zora_G", sTunicColors[PLAYER_TUNIC_ZORA].g); + color->b = CVar_GetS32("gTunic_Zora_B", sTunicColors[PLAYER_TUNIC_ZORA].b); + } else if (!CVar_GetS32("gUseTunicsCol",0)){ + if (tunic >= 3) { + color->r = sOriginalTunicColors[0].r; + color->g = sOriginalTunicColors[0].g; + color->b = sOriginalTunicColors[0].b; } else { - NewColor[PLAYER_TUNIC_KOKIRI].r = CVar_GetS32("gTunic_Kokiri_R", sTunicColors[PLAYER_TUNIC_KOKIRI].r); - NewColor[PLAYER_TUNIC_KOKIRI].g = CVar_GetS32("gTunic_Kokiri_G", sTunicColors[PLAYER_TUNIC_KOKIRI].g); - NewColor[PLAYER_TUNIC_KOKIRI].b = CVar_GetS32("gTunic_Kokiri_B", sTunicColors[PLAYER_TUNIC_KOKIRI].b); + color->r = sOriginalTunicColors[tunic].r; + color->g = sOriginalTunicColors[tunic].g; + color->b = sOriginalTunicColors[tunic].b; } - color = NewColor; } + gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0); sDListsLodOffset = lod * 2; @@ -1649,26 +1661,118 @@ void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 3288); } +uintptr_t SelectedAnim = 0; // Current Animaiton on the menu +s16 EquipedStance; // Link's current mode (Two handed, One handed...) +s16 FrameCountSinceLastAnim = 0; // Time since last animation +s16 MinFrameCount; // Frame to wait before checking if we need to change the animation + void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, Vec3f* pos, Vec3s* rot, f32 scale, s32 sword, s32 tunic, s32 shield, s32 boots) { + Input* p1Input = &globalCtx->state.input[0]; Vec3f eye = { 0.0f, 0.0f, -400.0f }; Vec3f at = { 0.0f, 0.0f, 0.0f }; Vec3s* destTable; Vec3s* srcTable; s32 i; + bool canswitchrnd = false; + s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 1); + MinFrameCount = CVar_GetS32("gMinFrameCount", 200); gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800); - if (CVar_GetS32("gPauseLiveLink", 0) || CVar_GetS32("gPauseTriforce", 0)) { - uintptr_t anim = gPlayerAnim_003238; // idle + uintptr_t* PauseMenuAnimSet[15][4] = { + { 0, 0, 0, 0 }, // 0 = none + // IDLE // Two Handed // No shield // Kid Hylian Shield + { gPlayerAnim_003238, gPlayerAnim_002BE0, gPlayerAnim_003240, gPlayerAnim_003240 }, // Idle + { gPlayerAnim_003200, gPlayerAnim_003200, gPlayerAnim_003200, gPlayerAnim_003200 }, // Idle look around + { gPlayerAnim_0033E0, gPlayerAnim_0033E0, gPlayerAnim_0033E0, gPlayerAnim_0033E0 }, // Idle Belt + { gPlayerAnim_003418, gPlayerAnim_003418, gPlayerAnim_003418, gPlayerAnim_003418 }, // Idle shield adjust + { gPlayerAnim_003420, gPlayerAnim_003428, gPlayerAnim_003420, gPlayerAnim_003420 }, // Idle test sword + { gPlayerAnim_0033F0, gPlayerAnim_0033F0, gPlayerAnim_0033F0, gPlayerAnim_0033F0 }, // Idle yawn + { gPlayerAnim_0025D0, gPlayerAnim_002BD0, gPlayerAnim_0025D0, gPlayerAnim_0025D0 }, // Battle Stance + { gPlayerAnim_003290, gPlayerAnim_002BF8, gPlayerAnim_003290, gPlayerAnim_003290 }, // Walking (No shield) + { gPlayerAnim_003268, gPlayerAnim_002BF8, gPlayerAnim_003268, gPlayerAnim_003268 }, // Walking (Holding shield) + { gPlayerAnim_003138, gPlayerAnim_002B40, gPlayerAnim_003138, gPlayerAnim_003138 }, // Running (No shield) + { gPlayerAnim_003140, gPlayerAnim_002B40, gPlayerAnim_003140, gPlayerAnim_003140 }, // Running (Holding shield) + { gPlayerAnim_0031A8, gPlayerAnim_0031A8, gPlayerAnim_0031A8, gPlayerAnim_0031A8 }, // Hand on hip + { gPlayerAnim_002AF0, gPlayerAnim_002928, gPlayerAnim_002AF0, gPlayerAnim_002AF0 }, // Spin Charge + { gPlayerAnim_002820, gPlayerAnim_002820, gPlayerAnim_002820, gPlayerAnim_002820 }, // Look at hand + }; + s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet); + + if (CVar_GetS32("gPauseLiveLink", !0) || CVar_GetS32("gPauseTriforce", 0)) { + uintptr_t anim = 0; // Initialise anim + + if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) { + EquipedStance = 1; + } else if (CUR_EQUIP_VALUE(EQUIP_SHIELD) == 0) { + EquipedStance = 2; + } else if (CUR_EQUIP_VALUE(EQUIP_SHIELD) == 2 && LINK_AGE_IN_YEARS == YEARS_CHILD) { + EquipedStance = 3; + } else { + // Link is idle so revert to 0 + EquipedStance = 0; + } + + if (SelectedMode == 16) { + // Apply Random function + s16 SwitchAtFrame = 0; + s16 CurAnimDuration = 0; + if (FrameCountSinceLastAnim == 0) { + // When opening Kaleido this will be passed one time + SelectedAnim = rand() % (AnimArraySize - 0); + if (SelectedAnim == 0) { + // prevent loading 0 that would result to a crash. + SelectedAnim = 1; + } + } else if (FrameCountSinceLastAnim >= 1) { + SwitchAtFrame = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]); + CurAnimDuration = Animation_GetLastFrame(PauseMenuAnimSet[SelectedAnim][EquipedStance]); + if (SwitchAtFrame < MinFrameCount) { + // Animation frame count is lower than minimal wait time then we wait for another round. + // This will be looped to always add current animation time if that still lower than minimum time + while (SwitchAtFrame < MinFrameCount) { + SwitchAtFrame = SwitchAtFrame + CurAnimDuration; + } + } else if (CurAnimDuration >= MinFrameCount) { + // Since we have more (or same) animation time than min duration we set the wait time to animation + // time. + SwitchAtFrame = CurAnimDuration; + } + if (FrameCountSinceLastAnim >= SwitchAtFrame) { + SelectedAnim = rand() % (AnimArraySize - 0); + if (SelectedAnim == 0) { + // prevent loading 0 that would result to a crash. + SelectedAnim = 1; + } + FrameCountSinceLastAnim = 1; + } + anim = PauseMenuAnimSet[SelectedAnim][EquipedStance]; + } + FrameCountSinceLastAnim++; + } else if (SelectedMode == 15) { + // When opening Kaleido this will be passed one time + if (FrameCountSinceLastAnim < 1) { + SelectedAnim = rand() % (AnimArraySize - 0); + FrameCountSinceLastAnim++; + if (SelectedAnim == 0) { + // prevent loading 0 that would result to a crash. + SelectedAnim = 1; + } + FrameCountSinceLastAnim = 1; + } + if (CHECK_BTN_ALL(p1Input->press.button, BTN_B) || CHECK_BTN_ALL(p1Input->press.button, BTN_START)) { + FrameCountSinceLastAnim = 0; + } + anim = PauseMenuAnimSet[SelectedAnim][EquipedStance]; + } else if (SelectedMode < 16) { + // Not random so we place our CVar as SelectedAnim + SelectedAnim = SelectedMode; + anim = PauseMenuAnimSet[SelectedAnim][EquipedStance]; + } - if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) - anim = gPlayerAnim_002BE0; // Two Handed Anim - else if (CUR_EQUIP_VALUE(EQUIP_SHIELD) == 0) - anim = gPlayerAnim_003240; - else if (CUR_EQUIP_VALUE(EQUIP_SHIELD) == 2 && LINK_AGE_IN_YEARS == YEARS_CHILD) - anim = gPlayerAnim_003240; + anim = PauseMenuAnimSet[SelectedAnim][EquipedStance]; //anim = gPlayerAnim_003428; // Use for biggoron sword? diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index a774636f7..16835d7ad 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -836,7 +836,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { for (i = 0; i < ARRAY_COUNTU(sZeldaMagic) - 3; i++) { if (sZeldaMagic[i + SRAM_HEADER_MAGIC] != sramCtx->readBuff[i + SRAM_HEADER_MAGIC]) { osSyncPrintf("SRAM破壊!!!!!!\n"); // "SRAM destruction! ! ! ! ! !" - gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; + gSaveContext.language = CVar_GetS32("gLanguages", 0); memcpy(sramCtx->readBuff, sZeldaMagic, sizeof(sZeldaMagic)); sramCtx->readBuff[SRAM_HEADER_LANGUAGE] = gSaveContext.language; Sram_WriteSramHeader(sramCtx); @@ -845,7 +845,7 @@ void Sram_InitSram(GameState* gameState, SramContext* sramCtx) { gSaveContext.audioSetting = sramCtx->readBuff[SRAM_HEADER_SOUND] & 3; gSaveContext.zTargetSetting = sramCtx->readBuff[SRAM_HEADER_ZTARGET] & 1; - gSaveContext.language = sramCtx->readBuff[SRAM_HEADER_LANGUAGE]; + gSaveContext.language = CVar_GetS32("gLanguages", 0); if (gSaveContext.language >= LANGUAGE_MAX) { gSaveContext.language = LANGUAGE_ENG; |
