MelonSpeedruns' squashed commits

* Fix RB channels + Remove mipmaps for now

* Remove loading most Layout files from a TPHD dump

* Fixes the main map crashing

* added folder picker to pre-launch options

* reduced tears of light needed count to 12 instead of 16
This commit is contained in:
MelonSpeedruns
2026-05-04 15:28:34 -04:00
committed by Irastris
parent aa23ae244f
commit 41e128c582
6 changed files with 52 additions and 4 deletions
+8
View File
@@ -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;
+5 -1
View File
@@ -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]);
}
+4
View File
@@ -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;
}
}
+12 -3
View File
@@ -131,9 +131,9 @@ std::vector<u8> expandR5G6B5toRgba8(std::span<const u8> 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<u8>((px >> 11) & 0x1F);
u8 b5 = static_cast<u8>((px >> 11) & 0x1F);
u8 g6 = static_cast<u8>((px >> 5) & 0x3F);
u8 b5 = static_cast<u8>(px & 0x1F);
u8 r5 = static_cast<u8>(px & 0x1F);
out[i * 4 + 0] = static_cast<u8>((r5 << 3) | (r5 >> 2));
out[i * 4 + 1] = static_cast<u8>((g6 << 2) | (g6 >> 4));
out[i * 4 + 2] = static_cast<u8>((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<std::vector<u8>*> tryLoadHdArchive(std::string_view gcPath) {
+20
View File
@@ -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) {
+3
View File
@@ -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);