diff --git a/src/d/actor/d_a_kytag04.cpp b/src/d/actor/d_a_kytag04.cpp index 21f6d85b93..4afb24d4d2 100644 --- a/src/d/actor/d_a_kytag04.cpp +++ b/src/d/actor/d_a_kytag04.cpp @@ -260,12 +260,20 @@ static int daKytag04_Create(fopAc_ac_c* i_this) { a_this->mNeedDropNum = i_this->current.angle.z & 0xFF; + #if DUSK_TPHD + a_this->mNeedDropNum = 12; + #endif + int phase_state = dComIfG_resLoad(&a_this->mPhase, "Kytag04"); if (phase_state == cPhs_COMPLEATE_e) { a_this->field_0x5b4 = (fopAcM_GetParam(i_this) >> 8) & 7; a_this->mStageNo = (i_this->current.angle.z >> 8) & 0xFF; a_this->mExitID = fopAcM_GetParam(i_this) & 0xFF; a_this->mNeedDropNum = i_this->current.angle.z & 0xFF; + #if DUSK_TPHD + a_this->mNeedDropNum = 12; + #endif + a_this->field_0x5b5 = fopAcM_GetParam(i_this) >> 0x10; a_this->field_0x5b6 = fopAcM_GetParam(i_this) >> 0x18; diff --git a/src/d/actor/d_a_obj_drop.cpp b/src/d/actor/d_a_obj_drop.cpp index 18d27840f7..f011747fa7 100644 --- a/src/d/actor/d_a_obj_drop.cpp +++ b/src/d/actor/d_a_obj_drop.cpp @@ -103,9 +103,13 @@ void daObjDrop_c::dropGet() { dComIfGs_setLightDropNum(dComIfGp_getStartStageDarkArea(), num + 1); if (dComIfGp_getStartStageDarkArea() == 2 && + #if DUSK_TPHD + dComIfGs_getLightDropNum(dComIfGp_getStartStageDarkArea()) == 11) + #else dComIfGs_getLightDropNum(dComIfGp_getStartStageDarkArea()) == 15) + #endif { - /* dSv_event_flag_c::F_0005 - Misc. - Gathered 14 Tears of Light in area 4 */ + /* dSv_event_flag_c::F_0005 - Misc. - Gathered 15 Tears of Light in area 4 */ dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[9]); } diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index aa5b5659e9..42be975197 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -2563,7 +2563,11 @@ u8 dComIfG_getNowCalcRegion() { bool dComIfGp_isLightDropMapVisible() { for (int i = 0; i < 3; i++) { + #if DUSK_TPHD + if (dComIfGs_isLightDropGetFlag(i) != FALSE && dComIfGs_getLightDropNum(i) < 12) { + #else if (dComIfGs_isLightDropGetFlag(i) != FALSE && dComIfGs_getLightDropNum(i) < 16) { + #endif return true; } } diff --git a/src/dusk/tphd/HdAssetLayer.cpp b/src/dusk/tphd/HdAssetLayer.cpp index 36f9a254e3..6bd2f54bba 100644 --- a/src/dusk/tphd/HdAssetLayer.cpp +++ b/src/dusk/tphd/HdAssetLayer.cpp @@ -131,9 +131,9 @@ std::vector expandR5G6B5toRgba8(std::span in, u32 width, u32 heigh // GX2 stores RGB565 pixel data in GPU-native LE u16 px; std::memcpy(&px, &in[i * 2], sizeof(px)); - u8 r5 = static_cast((px >> 11) & 0x1F); + u8 b5 = static_cast((px >> 11) & 0x1F); u8 g6 = static_cast((px >> 5) & 0x3F); - u8 b5 = static_cast(px & 0x1F); + u8 r5 = static_cast(px & 0x1F); out[i * 4 + 0] = static_cast((r5 << 3) | (r5 >> 2)); out[i * 4 + 1] = static_cast((g6 << 2) | (g6 >> 4)); out[i * 4 + 2] = static_cast((b5 << 3) | (b5 >> 2)); @@ -316,7 +316,7 @@ void registerHdSurface(const Gx2FormatMapping& m, const GtxSurface& s, r.width = s.width; r.height = s.height; r.gxFormat = m.newGxFormat; - r.mipCount = std::max(decoded.mipCount, 1u); + r.mipCount = 0; // r.mipCount = std::max(decoded.mipCount, 1u); aurora::gfx::hd_register_replacement(pixelPtr, std::move(r)); } @@ -522,9 +522,18 @@ void setHdContentPath(std::filesystem::path contentPath) { // HD arcs whose Wii-U layouts don't match the GC UI pipeline. static constexpr std::string_view kHdSkipList[] = { + "res/Object/LogoUs.arc", + "res/Object/balloon2D.arc", + "res/Object/Coach2D.arc", + "res/Object/fileSel.arc", "res/Layout/button.arc", "res/Layout/Title2D.arc", "res/Layout/main2D.arc", + "res/Layout/dmapres.arc", + "res/Layout/fmapres.arc", + "res/Layout/saveres.arc", + "res/FieldMap/res-f.arc", + "res/FieldMap/res-d.arc", }; std::optional*> tryLoadHdArchive(std::string_view gcPath) { diff --git a/src/dusk/ui/prelaunch.cpp b/src/dusk/ui/prelaunch.cpp index 87f00c3809..31cfde75e2 100644 --- a/src/dusk/ui/prelaunch.cpp +++ b/src/dusk/ui/prelaunch.cpp @@ -495,6 +495,21 @@ void file_dialog_callback(void*, const char* path, const char* error) { begin_disc_verification(path); } +void folder_dialog_callback(void*, const char* path, const char* error) { + auto& state = prelaunch_state(); + if (error != nullptr) { + return; + } + if (path == nullptr) { + return; + } + + state.selectedHdContentPath = path; + state.errorString.clear(); + getSettings().backend.hdContentPath.setValue(state.selectedHdContentPath); + config::Save(); +} + PrelaunchState sPrelaunchState; } // namespace @@ -644,6 +659,11 @@ void open_iso_picker() noexcept { kDiscFileFilters.data(), kDiscFileFilters.size(), nullptr, false); } +void open_folder_picker() noexcept { + ensure_initialized(); + ShowFolderSelect(&folder_dialog_callback, nullptr, aurora::window::get_sdl_window(), nullptr); +} + bool is_restart_pending() noexcept { const auto& state = prelaunch_state(); if (!state.activeDiscPath.empty() && state.configuredDiscPath != state.activeDiscPath) { diff --git a/src/dusk/ui/prelaunch.hpp b/src/dusk/ui/prelaunch.hpp index 0fbb64ded9..ba67a03a61 100644 --- a/src/dusk/ui/prelaunch.hpp +++ b/src/dusk/ui/prelaunch.hpp @@ -47,6 +47,8 @@ struct PrelaunchState { iso::ValidationError configuredDiscValidation = iso::ValidationError::Unknown; std::string activeDiscPath; iso::DiscInfo activeDiscInfo{}; + std::string initialHdContentPath; + std::string selectedHdContentPath; GameLanguage initialLanguage = GameLanguage::English; std::string initialGraphicsBackend; int initialCardFileType = 0; @@ -60,6 +62,7 @@ PrelaunchState& prelaunch_state() noexcept; void ensure_initialized() noexcept; void refresh_configured_disc_state() noexcept; void open_iso_picker() noexcept; +void open_folder_picker() noexcept; bool is_restart_pending() noexcept; void try_push_verification_modal(Document& host);