diff --git a/BUILDING.md b/BUILDING.md index 1821f2bc30..70ddd16b44 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -48,7 +48,7 @@ make -j $(nproc) OPTFLAGS=-O2 DEBUG=0 ## macOS -1. Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, dylibbundler` (can be installed via brew, etc) +1. Requires Xcode (or xcode-tools) && `sdl2, libpng, glew, cmake, pkgconfig, dylibbundler` (can be installed via homebrew, macports, etc) ```bash # Clone the repo git clone https://github.com/HarbourMasters/Shipwright.git diff --git a/Jenkinsfile b/Jenkinsfile index 7f3589ec84..f9ac7e7c8e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { options { timestamps() skipDefaultCheckout(true) + disableConcurrentBuilds(abortPrevious: true) } stages { diff --git a/README.md b/README.md index 8546d6ea75..baae758c96 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Ship does not include assets and as such requires a prior copy of the game t 4) Launch `soh.exe` ### Supported Games -#### Ocarina of Time Debug (not Master Quest) +#### Ocarina of Time Debug PAL GC (not Master Quest) > Currently the recommended option ``` Build team: `zelda@srd022j` diff --git a/libultraship/libultraship/Controller.cpp b/libultraship/libultraship/Controller.cpp index 6fc99c5c2c..1e59e55c3c 100644 --- a/libultraship/libultraship/Controller.cpp +++ b/libultraship/libultraship/Controller.cpp @@ -9,7 +9,7 @@ namespace Ship { - Controller::Controller() : isRumbling(false), wStickX(0), wStickY(0), wGyroX(0), wGyroY(0), dwPressedButtons(0){ + Controller::Controller() : isRumbling(false), wStickX(0), wStickY(0), wGyroX(0), wGyroY(0), wCamX(0), wCamY(0), dwPressedButtons(0){ Attachment = nullptr; profiles.resize(MAXCONTROLLERS); for(int slot = 0; slot < MAXCONTROLLERS; slot++) { diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index 8fe9609047..f1f1fd12b1 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -975,8 +975,12 @@ namespace SohImGui { Tooltip("The default response to Kaepora Gaebora is\nalways that you understood what he said"); EnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback"); Tooltip("Skip the part where the Ocarina playback is called when you play\na song"); + EnhancementCheckbox("Prevent Dropped Ocarina Inputs", "gDpadNoDropOcarinaInput"); + Tooltip("Prevent dropping inputs when playing the ocarina quickly"); EnhancementCheckbox("Instant Putaway", "gInstantPutaway"); Tooltip("Allow Link to put items away without having to wait around"); + EnhancementCheckbox("Mask Select in Inventory", "gMaskSelect"); + Tooltip("After completing the mask trading sub-quest,\npress A and any direction on the mask slot to change masks"); ImGui::EndMenu(); } @@ -1017,6 +1021,8 @@ namespace SohImGui { Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses"); EnhancementCheckbox("No Heart Drops", "gNoHeartDrops"); Tooltip("Disables heart drops, but not heart placements, like from a Deku Scrub running off\nThis simulates Hero Mode from other games in the series"); + EnhancementCheckbox("Always Win Goron Pot", "gGoronPot"); + Tooltip("Always get the heart piece/purple rupee from the spinning Goron pot"); if (ImGui::BeginMenu("Potion Values")) { @@ -1130,6 +1136,8 @@ namespace SohImGui { Tooltip("Allow you to rotate Link on the Equipment menu with the DPAD\nUse DPAD-Up or DPAD-Down to reset Link's rotation"); EnhancementRadioButton("Rotate Link with C-buttons", "gPauseLiveLinkRotation", 2); Tooltip("Allow you to rotate Link on the Equipment menu with the C-buttons\nUse C-Up or C-Down to reset Link's rotation"); + EnhancementRadioButton("Rotate Link with Right Stick", "gPauseLiveLinkRotation", 3); + Tooltip("Allow you to rotate Link on the Equipment menu with the Right Stick\nYou can zoom in by pointing up and reset Link's rotation by pointing down"); if (CVar_GetS32("gPauseLiveLinkRotation", 0) != 0) { EnhancementSliderInt("Rotation Speed: %d", "##MinRotationSpeed", "gPauseLiveLinkRotationSpeed", 1, 20, ""); @@ -1157,6 +1165,8 @@ namespace SohImGui { Tooltip("Randomize the animation played each time you open the menu"); EnhancementRadioButton("Random cycle", "gPauseLiveLink", 16); Tooltip("Randomize the animation played on the menu after a certain time"); + EnhancementRadioButton("Random cycle (Idle)", "gPauseLiveLink", 17); + Tooltip("Randomize the animation played on the menu after a certain time (Idle animations only)"); if (CVar_GetS32("gPauseLiveLink", 0) >= 16) { EnhancementSliderInt("Frame to wait: %d", "##MinFrameCount", "gMinFrameCount", 1, 1000, "", 0, true); } @@ -1354,6 +1364,8 @@ namespace SohImGui { { EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled"); Tooltip("Enables Debug Mode, allowing you to select maps with L + R + Z, noclip with L + D-pad Right,\nand open the debug menu with L on the pause screen"); + EnhancementCheckbox("OoT Skulltula Debug", "gSkulltulaDebugEnabled"); + Tooltip("Enables Skulltula Debug, when moving the cursor in the menu above various map\nicons (boss key, compass, map screen locations, etc) will set the GS bits in that\narea. USE WITH CAUTION AS IT DOES NOT UPDATE THE GS COUNT."); EnhancementCheckbox("Fast File Select", "gSkipLogoTitle"); Tooltip("Load the game to the selected menu or file\n\"Zelda Map Select\" require debug mode else you will fallback to File choose menu\nUsing a file number that don't have save will create a save file only\nif you toggle on \"Create a new save if none ?\" else it will bring you to the\nFile choose menu"); if (CVar_GetS32("gSkipLogoTitle", 0)) { diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp index 91e63227ea..0a04c9580f 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp @@ -20,6 +20,8 @@ #include #include +#include "../../Cvar.h" + #include "gfx_pc.h" #include "gfx_cc.h" #include "gfx_window_manager_api.h" @@ -2649,7 +2651,8 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, co gfx_wapi->init(game_name, start_in_fullscreen, width, height); gfx_rapi->init(); gfx_rapi->update_framebuffer_parameters(0, width, height, 1, false, true, true, true); - gfx_current_dimensions.internal_mul = 1; + gfx_current_dimensions.internal_mul = CVar_GetFloat("gInternalResolution", 1); + gfx_msaa_level = CVar_GetS32("gMSAAValue", 1); gfx_current_dimensions.width = width; gfx_current_dimensions.height = height; game_framebuffer = gfx_rapi->create_framebuffer(); diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 4f20155d4a..6dc6b18b4c 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -22,28 +22,9 @@ static BootCommand sCommands[] = { { "--skiplogo", BootCommands_Command_SkipLogo void BootCommands_Init() { - CVar_RegisterS32("gDisableLOD", 0); CVar_RegisterS32("gDebugEnabled", 0); - CVar_RegisterS32("gPauseLiveLink", 0); - CVar_RegisterS32("gMinimalUI", 0); - CVar_RegisterS32("gRedGanonBlood", 0); - CVar_RegisterS32("gHoverFishing", 0); - CVar_RegisterS32("gN64WeirdFrames", 0); - CVar_RegisterS32("gBombchusOOB", 0); - CVar_RegisterS32("gUniformLR", 0); - CVar_RegisterS32("gTwoHandedIdle", 0); - CVar_RegisterS32("gDekuNutUpgradeFix", 0); - CVar_RegisterS32("gNaviTextFix", 0); - CVar_RegisterS32("gNewDrops", 0); - CVar_RegisterS32("gVisualAgony", 0); CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French - CVar_RegisterS32("gForgeTime", 3); - CVar_RegisterS32("gGravediggingTourFix", 1); CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom - CVar_RegisterS32("gUseNaviCol", 0); - CVar_RegisterS32("gUseTunicsCol", 0); - CVar_RegisterS32("gGuardVision", 0); - CVar_RegisterS32("gTimeFlowFileSelect", 0); } //void BootCommands_ParseBootArgs(char* str) diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index c5d1509847..cab454b13a 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -1028,7 +1028,7 @@ s8 D_80131870 = 0; u8 D_80131874 = 0; u8 D_80131878 = 0; u8 D_8013187C = 0; -u8 D_80131880 = 0; +u8 sOcarinaDropInputTimer = 0; OcarinaNote sPierresSong[108] = { { 0xFF, 0, 0, 0, 0, 0, 0 }, @@ -1550,9 +1550,11 @@ void func_800ED458(s32 arg0) { u32 phi_v1_2; bool dpad = CVar_GetS32("gDpadOcarinaText", 0); - if (D_80130F3C != 0 && D_80131880 != 0) { - D_80131880--; - return; + if (D_80130F3C != 0 && sOcarinaDropInputTimer != 0) { + sOcarinaDropInputTimer--; + if (!CVar_GetS32("gDpadNoDropOcarinaInput", 0)) { + return; + } } if ((D_8016BA10 == 0) || @@ -2057,7 +2059,7 @@ void func_800EE6F4(void) { } if ((D_80130F3C != 0) && (sPrevOcarinaNoteVal != sCurOcarinaBtnVal)) { - D_80131880 = 1; + sOcarinaDropInputTimer = 1; } sPrevOcarinaNoteVal = sCurOcarinaBtnVal; @@ -2110,7 +2112,7 @@ void func_800EE930(void) { sRecordingStaff.noteIdx = OCARINA_NOTE_INVALID; sRecordingStaff.state = 0xFF; sRecordingStaff.pos = 0; - D_80131880 = 0; + sOcarinaDropInputTimer = 0; } f32 D_80131C8C = 0.0f; diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index c2fddaab1d..b31209d83a 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -996,6 +996,7 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.shadowScale = 0.3f; this->actor.world.rot.x = 0x4000; GetItem_Draw(globalCtx, GID_RUPEE_PURPLE); + break; } else { Actor_SetScale(&this->actor, 0.03f); this->actor.shape.shadowScale = 6.0f; @@ -1231,27 +1232,40 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, s16 case GI_PRELUDE_OF_LIGHT: color_slot = 5; break; + case GI_STICK_UPGRADE_20: + case GI_STICK_UPGRADE_30: + color_slot = 6; + break; + case GI_NUT_UPGRADE_30: + case GI_NUT_UPGRADE_40: + color_slot = 7; + break; } - s16* colors[7][3] = { - { 34, 255, 76 }, // Minuet and Magic Upgrades Colors - { 177, 35, 35 }, // Bolero and Double Defense Colors - { 115, 251, 253 }, // Serenade Color - { 177, 122, 35 }, // Requiem Color - { 177, 28, 212 }, // Nocturne Color - { 255, 255, 92 }, // Prelude Color - { 255, 255, 255} // White Color placeholder + s16* colors[9][3] = { + { 34, 255, 76 }, // Minuet and Magic Upgrades Colors + { 177, 35, 35 }, // Bolero and Double Defense Colors + { 115, 251, 253 }, // Serenade Color + { 177, 122, 35 }, // Requiem Color + { 177, 28, 212 }, // Nocturne Color + { 255, 255, 92 }, // Prelude Color + { 31, 152, 49 }, // Stick Upgrade Color + { 222, 182, 20 }, // Nut Upgrade Color + { 255, 255, 255 } // White Color placeholder }; - s16* colorsEnv[7][3] = { - { 30, 110, 30 }, // Minuet and Magic Upgrades Colors - { 90, 10, 10 }, // Bolero and Double Defense Colors - { 35, 35, 177 }, // Serenade Color - { 70, 20, 10 }, // Requiem Color - { 100, 20, 140 }, // Nocturne Color - { 100, 100, 10 }, // Prelude Color - { 154, 154, 154 } // White Color placeholder + s16* colorsEnv[9][3] = { + { 30, 110, 30 }, // Minuet and Magic Upgrades Colors + { 90, 10, 10 }, // Bolero and Double Defense Colors + { 35, 35, 177 }, // Serenade Color + { 70, 20, 10 }, // Requiem Color + { 100, 20, 140 }, // Nocturne Color + { 100, 100, 10 }, // Prelude Color + { 5, 50, 10 }, // Stick Upgrade Color + { 150, 100, 5 }, // Nut Upgrade Color + { 154, 154, 154 } // White Color placeholder }; + static Vec3f velocity = { 0.0f, 0.2f, 0.0f }; static Vec3f accel = { 0.0f, 0.05f, 0.0f }; Color_RGBA8 primColor = { colors[color_slot][0], colors[color_slot][1], colors[color_slot][2], 0 }; @@ -1304,7 +1318,8 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); s32 randoGetItemId = Randomizer_GetRandomizedItemId(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); @@ -1364,7 +1379,8 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) { f32 mtxScale = 16.0f; Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); s32 randoGetItemId = Randomizer_GetRandomizedItemId(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index a636a0abff..6572f6fc16 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -713,6 +713,11 @@ void Minimap_Draw(GlobalContext* globalCtx) { OPEN_DISPS(globalCtx->state.gfxCtx); + // If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set + bool enableMapToggle = + !(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) || + CVar_GetS32("gEnableMapToggle", 0); + if (globalCtx->pauseCtx.state < 4) { //Minimap margins s16 X_Margins_Minimap; @@ -781,7 +786,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { } } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) { osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx)); // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, @@ -948,7 +953,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position } - if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) { // clang-format off if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index a12a144810..470cec3540 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -763,7 +763,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, 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)){ + } else if (!CVar_GetS32("gUseTunicsCol",0)) { if (tunic >= 3) { color->r = sOriginalTunicColors[0].r; color->g = sOriginalTunicColors[0].g; @@ -1673,7 +1673,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, Vec3s* srcTable; s32 i; bool canswitchrnd = false; - s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 1); + s16 SelectedMode = CVar_GetS32("gPauseLiveLink", 0); MinFrameCount = CVar_GetS32("gMinFrameCount", 200); gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); @@ -1699,7 +1699,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, }; s16 AnimArraySize = ARRAY_COUNT(PauseMenuAnimSet); - if (CVar_GetS32("gPauseLiveLink", !0) || CVar_GetS32("gPauseTriforce", 0)) { + if (CVar_GetS32("gPauseLiveLink", 0) || CVar_GetS32("gPauseTriforce", 0)) { uintptr_t anim = 0; // Initialise anim if (CUR_EQUIP_VALUE(EQUIP_SWORD) >= 3) { @@ -1712,7 +1712,6 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, // Link is idle so revert to 0 EquipedStance = 0; } - if (SelectedMode == 16) { // Apply Random function s16 SwitchAtFrame = 0; @@ -1749,6 +1748,89 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, anim = PauseMenuAnimSet[SelectedAnim][EquipedStance]; } FrameCountSinceLastAnim++; + } else if (SelectedMode == 17) { + // Apply Random function + s16 SwitchAtFrame = 0; + s16 CurAnimDuration = 0; + s16 LastAnim; + if (FrameCountSinceLastAnim == 0) { + // When opening Kaleido this will be passed one time + SelectedAnim = (rand() % (6 - 1 + 1)) + 1; + 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) { + LastAnim = SelectedAnim; + if (LastAnim==1) { + if ((CUR_EQUIP_VALUE(EQUIP_SWORD)!=PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!= PLAYER_SHIELD_NONE)) { // if the player has a sword and shield equipped + if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) { // if he's an adult or a kid with the deku shield + SelectedAnim = (rand() % (6 - 2 + 1)) + 2; // select any 5 animations that aren't the default standing anim + } else { //else if he's a child with a shield that isn't the deku shield + s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations + if (randval==4) { //if its the shield anim + SelectedAnim==6; // set to yawn anim + } else { + SelectedAnim=randval; + } + } + } else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) != PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has a sword equipped but no shield + s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations + if (randval==4) { //if its the shield anim + SelectedAnim==6; // set to yawn anim + } else { + SelectedAnim=randval; + } + } else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)!=PLAYER_SHIELD_NONE)) { //if the player has a shield equipped but no sword + if ((LINK_AGE_IN_YEARS == YEARS_ADULT) || (CUR_EQUIP_VALUE(EQUIP_SHIELD) == PLAYER_SHIELD_DEKU)) {// if he's an adult or a kid with the deku shield + s16 randval = (rand() % (5 - 2 + 1)) + 2; // 4 animations + if (randval==5) { //if its the sword anim + SelectedAnim==6; // set to yawn anim + } else { + SelectedAnim=randval; + } + } else { + s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations + if (randval==4) { //if its the shield anim + SelectedAnim==6; // set to yawn anim + } else { + SelectedAnim=randval; + } + } + } else if ((CUR_EQUIP_VALUE(EQUIP_SWORD) == PLAYER_SWORD_NONE) && (CUR_EQUIP_VALUE(EQUIP_SHIELD)==PLAYER_SHIELD_NONE)) { // if the player has no sword or shield equipped + s16 randval = (rand() % (4 - 2 + 1)) + 2; // 3 animations + if (randval==4) { //if its the shield anim + SelectedAnim==6; // set to yawn anim + } else { + SelectedAnim=randval; + } + } + } else { + SelectedAnim = 1; + } + if (SelectedAnim == 0) { + // prevent loading 0 that would result to a crash. Also makes sure default idle is every other anim + 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) { diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 18175c1247..5c20fa6025 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -227,7 +227,7 @@ void BgSpot06Objects_GateSpawnBubbles(BgSpot06Objects* this, GlobalContext* glob void BgSpot06Objects_GateWaitForSwitch(BgSpot06Objects* this, GlobalContext* globalCtx) { s32 i; - if (Flags_GetSwitch(globalCtx, this->switchFlag)) { + if ((CVar_GetS32("gWaterTempleGateFix", 0) == 0 || LINK_IS_ADULT) && Flags_GetSwitch(globalCtx, this->switchFlag)) { this->timer = 100; this->dyna.actor.world.pos.y += 3.0f; this->actionFunc = BgSpot06Objects_GateWaitToOpen; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index c085033512..f2eee75566 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -297,7 +297,7 @@ void func_808B7F74(BgSpot18Basket* this) { shapeRotY = this->dyna.actor.shape.rot.y; this->actionFunc = func_808B7FC0; - if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19)) { + if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVar_GetS32("gGoronPot", 0)) { this->unk_218 = 2; } else if (shapeRotY < 0x26C2) { this->unk_218 = 1; diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 3dbc97a078..7ba83aebfc 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -53,6 +53,7 @@ void BossMo_UpdateCore(Actor* thisx, GlobalContext* globalCtx); void BossMo_UpdateTent(Actor* thisx, GlobalContext* globalCtx); void BossMo_DrawCore(Actor* thisx, GlobalContext* globalCtx); void BossMo_DrawTent(Actor* thisx, GlobalContext* globalCtx); +void BossMo_Reset(void); void BossMo_UpdateEffects(BossMo* this, GlobalContext* globalCtx); void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx); @@ -131,7 +132,7 @@ const ActorInit Boss_Mo_InitVars = { (ActorFunc)BossMo_Destroy, (ActorFunc)BossMo_UpdateTent, (ActorFunc)BossMo_DrawTent, - NULL, + (ActorResetFunc)BossMo_Reset, }; static BossMo* sMorphaCore = NULL; diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index b42ad6cbf2..c5d0238e7f 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -520,7 +520,8 @@ void EnExItem_DrawItems(EnExItem* this, GlobalContext* globalCtx) { break; } - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } } @@ -534,7 +535,8 @@ void EnExItem_DrawHeartPiece(EnExItem* this, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck( RC_MARKET_BOMBCHU_BOWLING_SECOND_PRIZE, GI_HEART_PIECE); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 97f8fb5e04..4ea819f332 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -139,7 +139,9 @@ typedef enum { /* 9 */ ENGO2_ANIM_9, /* 10 */ ENGO2_ANIM_10, /* 11 */ ENGO2_ANIM_11, - /* 12 */ ENGO2_ANIM_12 + /* 12 */ ENGO2_ANIM_12, + /* 13 */ ENGO2_ANIM_13, // Fixed Goron Wakeup Animation + /* 14 */ ENGO2_ANIM_14 // Fixed Biggoron Wakeup Animation } EnGo2Animation; static AnimationInfo sAnimationInfo[] = { @@ -149,7 +151,8 @@ static AnimationInfo sAnimationInfo[] = { { &gGoronAnim_002D80, 1.0f, 0.0f, -1.0f, 0x02, -8.0f }, { &gGoronAnim_00161C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_001A00, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_0021D0, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_004930, 0.0f, 0.0f, -1.0f, 0x01, -8.0f }, { &gGoronAnim_000750, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - { &gGoronAnim_000D5C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, + { &gGoronAnim_000D5C, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronAnim_004930, 0.0f, 0.0f, -1.0f, 0x00, 0.0f }, + { &gGoronAnim_004930, 0.0f, 1.0f, -1.0f, 0x01, 0.0f }, }; static EnGo2DustEffectData sDustEffectData[2][4] = { @@ -1341,10 +1344,10 @@ void EnGo2_WakeUp(EnGo2* this, GlobalContext* globalCtx) { } if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { OnePointCutscene_Init(globalCtx, 4200, -99, &this->actor, MAIN_CAM); - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ((CVar_GetS32("gGoronSpeen", 0) == 1) ? ENGO2_ANIM_10 : ENGO2_ANIM_14)); this->skelAnime.playSpeed = 0.5f; } else { - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_1); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ((CVar_GetS32("gGoronSpeen", 0) == 1) ? ENGO2_ANIM_1 : ENGO2_ANIM_13)); this->skelAnime.playSpeed = 1.0f; } this->actionFunc = func_80A46B40; diff --git a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index cfa115dafc..b0354008d2 100644 --- a/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/soh/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -230,7 +230,8 @@ void ItemEtcetera_DrawThroughLens(Actor* thisx, GlobalContext* globalCtx) { if(gSaveContext.n64ddFlag && globalCtx->sceneNum == 16) { s32 randoGetItemId = GetChestGameRandoGetItemId(this->actor.room, this->giDrawId, globalCtx); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } if (randoGetItemId != GI_NONE) { @@ -255,7 +256,8 @@ void ItemEtcetera_Draw(Actor* thisx, GlobalContext* globalCtx) { randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_LH_UNDERWATER_ITEM, GI_LETTER_RUTO); } - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 9992d08b3e..72fc688763 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -215,7 +215,8 @@ void ItemOcarina_Draw(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.n64ddFlag) { s32 randoGetItemId = Randomizer_GetItemIdFromKnownCheck(RC_HF_OCARINA_OF_TIME_ITEM, GI_OCARINA_OOT); - if (randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) { + if ((randoGetItemId >= GI_MINUET_OF_FOREST && randoGetItemId <= GI_DOUBLE_DEFENSE) || + (randoGetItemId >= GI_STICK_UPGRADE_20 && randoGetItemId <= GI_NUT_UPGRADE_40)) { EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemId); } GetItem_Draw(globalCtx, Randomizer_GetItemModelFromId(randoGetItemId)); diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index cb2ae66d2b..569ec28022 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -7131,7 +7131,7 @@ void func_808409CC(GlobalContext* globalCtx, Player* this) { if (sp34 < 4) { if (((sp34 != 0) && (sp34 != 3)) || ((this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && ((sp34 == 3) || Player_GetSwordHeld(this)))) { - if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVar_GetS32("gTwoHandedIdle", 1) == 1) { + if ((sp34 == 1) && Player_HoldsTwoHandedWeapon(this) && CVar_GetS32("gTwoHandedIdle", 0) == 1) { sp34 = 4; } sp38 = sp34 + 9; diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 8a82efd008..e1a0aae742 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -924,7 +924,7 @@ void FileChoose_DrawOptionsImpl(GameState* thisx) { gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA, G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language], - gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + gOptionsMenuSettings[i].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); gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); } @@ -948,7 +948,7 @@ void FileChoose_DrawOptionsImpl(GameState* thisx) { gDPLoadTextureBlock(POLY_OPA_DISP++, gOptionsMenuSettings[i].texture[gSaveContext.language], G_IM_FMT_IA, G_IM_SIZ_8b, gOptionsMenuSettings[i].width[gSaveContext.language], - gOptionsMenuHeaders[i].height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + gOptionsMenuSettings[i].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); gSP1Quadrangle(POLY_OPA_DISP++, vtx, vtx + 2, vtx + 3, vtx + 1, 0); } diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index 50c7c8a362..699dff6266 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -333,6 +333,7 @@ void Title_Init(GameState* thisx) { } else { quote = SetQuote(); + this->staticSegment = NULL; //this->staticSegment = GAMESTATE_ALLOC_MC(&this->state, size); osSyncPrintf("z_title.c\n"); //ASSERT(this->staticSegment != NULL); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 863c8ef4aa..edcc21c076 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -98,9 +98,11 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { f32 scale; Input* input = &globalCtx->state.input[0]; s16 RotationSpeed = 150 * CVar_GetS32("gPauseLiveLinkRotationSpeed", 0); + u8 AllowStickRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 3) ? true : false; u8 AllowCRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 2) ? true : false; u8 AllowDPadRotation = (CVar_GetS32("gPauseLiveLinkRotation", 0) == 1) ? true : false; + if (LINK_AGE_IN_YEARS == YEARS_CHILD) { pos.x = 2.0f; pos.y = -130.0f; @@ -120,22 +122,32 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { link_kaleido_rot.x = link_kaleido_rot.z = 0; - if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) || + if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DLEFT)) || // rotate (AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CLEFT))) { link_kaleido_rot.y = link_kaleido_rot.y - RotationSpeed; } else if ((AllowDPadRotation && CHECK_BTN_ALL(input->cur.button, BTN_DRIGHT)) || (AllowCRotation && CHECK_BTN_ALL(input->cur.button, BTN_CRIGHT))) { link_kaleido_rot.y = link_kaleido_rot.y + RotationSpeed; + } else if(AllowStickRotation && input->cur.cam_x != 0){ + link_kaleido_rot.y = link_kaleido_rot.y + (input->cur.cam_x*(((f32)RotationSpeed)/600.0f)); } - if ((AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP)) || + if ((AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DUP)) || // reset rotation (AllowDPadRotation && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { link_kaleido_rot.y = 32300; } else if ((AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CUP)) || (AllowCRotation && CHECK_BTN_ALL(input->press.button, BTN_CDOWN))) { link_kaleido_rot.y = 32300; + } else if (AllowStickRotation && input->cur.cam_y < -1200) { + link_kaleido_rot.y = 32300; } + if (AllowStickRotation && input->cur.cam_y>0) { // Zoom in + scale = scale + input->cur.cam_y*.00005; + pos.y = pos.y - input->cur.cam_y*.25; + } + + link_kaleido_rot.x = 0; extern int fbTest; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 6a0e32beac..8bb4cc4318 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -9,6 +9,7 @@ u8 gAmmoItems[] = { static s16 sEquipState = 0; static s16 sEquipAnimTimer = 0; static s16 sEquipMoveTimer = 10; +bool gSelectingMask; static s16 sAmmoVtxOffset[] = { 0, 2, 4, 6, 99, 99, 8, 99, 99, 10, 99, 99, 99, 99, 99, 99, 12, @@ -108,7 +109,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { pauseCtx->nameColorSet = 0; if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM)) { - moveCursorResult = 0; + moveCursorResult = 0 || gSelectingMask; oldCursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorItem = pauseCtx->cursorItem[PAUSE_ITEM]; @@ -282,7 +283,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorSpecialPos == 0) { if (cursorItem != PAUSE_ITEM_NONE) { if ((ABS(pauseCtx->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { - moveCursorResult = 0; + moveCursorResult = 0 || gSelectingMask; cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; @@ -350,6 +351,40 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { KaleidoScope_SetCursorVtx(pauseCtx, index, pauseCtx->itemVtx); if ((pauseCtx->debugState == 0) && (pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0)) { + if (CVar_GetS32("gMaskSelect", 0) && (gSaveContext.eventChkInf[8] & 0x8000) && + cursorSlot == SLOT_TRADE_CHILD && CHECK_BTN_ALL(input->press.button, BTN_A)) { + Audio_PlaySoundGeneral(NA_SE_SY_DECIDE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + gSelectingMask = !gSelectingMask; + } + if (gSelectingMask) { + pauseCtx->cursorColorSet = 8; + if (((pauseCtx->stickRelX > 30 || pauseCtx->stickRelY > 30) || + dpad && CHECK_BTN_ANY(input->press.button, BTN_DRIGHT | BTN_DUP)) && + INV_CONTENT(ITEM_TRADE_CHILD) < ITEM_MASK_TRUTH) { + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + ++INV_CONTENT(ITEM_TRADE_CHILD); + } else if (((pauseCtx->stickRelX < -30 || pauseCtx->stickRelY < -30) || + dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DDOWN)) && + INV_CONTENT(ITEM_TRADE_CHILD) > ITEM_MASK_KEATON) { + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + --INV_CONTENT(ITEM_TRADE_CHILD); + } else if ((pauseCtx->stickRelX < -30 || pauseCtx->stickRelX > 30 || pauseCtx->stickRelY < -30 || pauseCtx->stickRelY > 30) || + dpad && CHECK_BTN_ANY(input->press.button, BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT)) { + INV_CONTENT(ITEM_TRADE_CHILD) ^= ITEM_MASK_KEATON ^ ITEM_MASK_TRUTH; + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } + for (uint16_t cSlotIndex = 0; cSlotIndex < ARRAY_COUNT(gSaveContext.equips.cButtonSlots); cSlotIndex++) { + if (gSaveContext.equips.cButtonSlots[cSlotIndex] == SLOT_TRADE_CHILD) { + if (!LINK_IS_ADULT || CVar_GetS32("gNoRestrictAge", 0)) { + gSaveContext.equips.buttonItems[cSlotIndex+1] = INV_CONTENT(ITEM_TRADE_CHILD); + } else if (INV_CONTENT(ITEM_TRADE_CHILD) != gSaveContext.equips.buttonItems[cSlotIndex+1]) { + gSaveContext.equips.cButtonSlots[cSlotIndex] = SLOT_NONE; + gSaveContext.equips.buttonItems[cSlotIndex+1] = ITEM_NONE; + } + } + } + gSelectingMask = cursorSlot == SLOT_TRADE_CHILD; + } u16 buttonsToCheck = BTN_CLEFT | BTN_CDOWN | BTN_CRIGHT; if (CVar_GetS32("gDpadEquips", 0) && (!CVar_GetS32("gDpadPauseName", 0) || CHECK_BTN_ALL(input->cur.button, BTN_CUP))) { buttonsToCheck |= BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT; @@ -474,6 +509,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { void KaleidoScope_SetupItemEquip(GlobalContext* globalCtx, u16 item, u16 slot, s16 animX, s16 animY) { Input* input = &globalCtx->state.input[0]; PauseContext* pauseCtx = &globalCtx->pauseCtx; + gSelectingMask = false; if (CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) { pauseCtx->equipTargetCBtn = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h index fa1d88fecf..b272297f19 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope.h @@ -10,6 +10,7 @@ extern s16 D_8082AB2C[]; extern u8 gSlotAgeReqs[]; extern u8 gEquipAgeReqs[][4]; extern u8 gAreaGsFlags[]; +extern bool gSelectingMask; void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfxCtx); s32 KaleidoScope_UpdateQuestStatusPoint(PauseContext* pauseCtx, s32 point); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 79c4c21e89..9071e7a0f2 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -867,6 +867,7 @@ void KaleidoScope_SetDefaultCursor(GlobalContext* globalCtx) { PauseContext* pauseCtx = &globalCtx->pauseCtx; s16 s; s16 i; + gSelectingMask = false; switch (pauseCtx->pageIndex) { case PAUSE_ITEM: @@ -900,6 +901,7 @@ void KaleidoScope_SetDefaultCursor(GlobalContext* globalCtx) { void KaleidoScope_SwitchPage(PauseContext* pauseCtx, u8 pt) { pauseCtx->unk_1E4 = 1; pauseCtx->unk_1EA = 0; + gSelectingMask = false; if (!pt) { pauseCtx->mode = pauseCtx->pageIndex * 2 + 1; @@ -1821,7 +1823,7 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { POLY_KAL_DISP = KaleidoScope_QuadTextureIA4(POLY_KAL_DISP, pauseCtx->nameSegment, 128, 16, 0); } - if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gDebugEnabled", 0) != 0) { + if (pauseCtx->pageIndex == PAUSE_MAP && CVar_GetS32("gSkulltulaDebugEnabled", 0) != 0) { if (YREG(7) != 0) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("キンスタ数(%d) Get_KIN_STA=%x (%x) (%x)\n", YREG(6), GET_GS_FLAGS(YREG(6)),