From 1a7c853d9be2a38b2347850fd79af386fe0d0d8d Mon Sep 17 00:00:00 2001 From: TakaRikka Date: Sat, 16 May 2026 21:06:55 -0700 Subject: [PATCH] better disc info display --- src/d/d_s_logo.cpp | 9 ++++++++- src/dusk/iso_validate.cpp | 22 +++++++--------------- src/dusk/iso_validate.hpp | 15 ++++++++++++++- src/dusk/ui/prelaunch.cpp | 32 ++++++++++++++++++++++++++++++-- src/dusk/ui/settings.cpp | 4 ++-- 5 files changed, 61 insertions(+), 21 deletions(-) diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index db0cfa1387..7a58a4cf77 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -907,7 +907,14 @@ dScnLogo_c::~dScnLogo_c() { mDoExt_getRubyFont(); mDoExt_setAraCacheSize(free_size - aram_heap->getTotalFreeSize()); -#if VERSION == VERSION_GCN_JPN +#if TARGET_PC + if (getGameVersion() == GameVersion::GcnJpn) { + if (dComIfGp_getFontArchive() != NULL) { + dComIfGp_getFontArchive()->unmount(); + dComIfGp_setFontArchive(NULL); + } + } +#elif VERSION == VERSION_GCN_JPN if (dComIfGp_getFontArchive() != NULL) { dComIfGp_getFontArchive()->unmount(); dComIfGp_setFontArchive(NULL); diff --git a/src/dusk/iso_validate.cpp b/src/dusk/iso_validate.cpp index fbb05bab13..9dc2c894b8 100644 --- a/src/dusk/iso_validate.cpp +++ b/src/dusk/iso_validate.cpp @@ -60,18 +60,6 @@ const char* verification_state_name(dusk::DiscVerificationState state) noexcept namespace dusk::iso { -enum class Platform : u8 { - GameCube, - Wii, -}; - -enum class Region : u8 { - NorthAmerica, - Europe, - Japan, - Korea, -}; - struct KnownDisc { std::string_view id; Platform platform; @@ -216,7 +204,9 @@ ValidationError validate(const char* path, VerificationStatus& status, DiscInfo& return ValidationError::WrongGame; } status.knownDisc = knownDisc; - info.isPal = knownDisc->region == Region::Europe; + + info.platform = knownDisc->platform; + info.region = knownDisc->region; if (!knownDisc->supported) { return ValidationError::WrongVersion; } @@ -251,7 +241,9 @@ ValidationError inspect(const char* path, DiscInfo& info) { if (!knownDisc) { return ValidationError::WrongGame; } - info.isPal = knownDisc->region == Region::Europe; + + info.platform = knownDisc->platform; + info.region = knownDisc->region; if (!knownDisc->supported) { return ValidationError::WrongVersion; } @@ -260,7 +252,7 @@ ValidationError inspect(const char* path, DiscInfo& info) { bool isPal(const char* path) { DiscInfo info{}; - return inspect(path, info) == ValidationError::Success && info.isPal; + return inspect(path, info) == ValidationError::Success && info.region == Region::Europe; } void log_verification_state(std::string_view path, DiscVerificationState state) { diff --git a/src/dusk/iso_validate.hpp b/src/dusk/iso_validate.hpp index 176284fd02..c064aa81cd 100644 --- a/src/dusk/iso_validate.hpp +++ b/src/dusk/iso_validate.hpp @@ -17,6 +17,18 @@ enum class ValidationError : u8 { Success }; +enum class Platform : u8 { + GameCube, + Wii, +}; + +enum class Region : u8 { + NorthAmerica, + Europe, + Japan, + Korea, +}; + struct VerificationStatus { std::atomic_size_t bytesRead = 0; std::atomic_size_t bytesTotal = 0; @@ -25,7 +37,8 @@ struct VerificationStatus { }; struct DiscInfo { - bool isPal = false; + Platform platform = Platform::GameCube; + Region region = Region::NorthAmerica; }; ValidationError inspect(const char* path, DiscInfo& info); diff --git a/src/dusk/ui/prelaunch.cpp b/src/dusk/ui/prelaunch.cpp index ef6b6e5709..44f7ea47d6 100644 --- a/src/dusk/ui/prelaunch.cpp +++ b/src/dusk/ui/prelaunch.cpp @@ -877,8 +877,36 @@ void Prelaunch::update() { if (mDiscDetail != nullptr) { if (activeDiscLoaded) { mDiscDetail->SetProperty(Rml::PropertyId::Display, Rml::Style::Display::Block); - Rml::String innerRML = "GameCube • "; - innerRML += state.activeDiscInfo.isPal ? "EUR" : "USA"; + Rml::String innerRML = ""; + + switch (state.activeDiscInfo.platform) { + case iso::Platform::GameCube: + innerRML += "GameCube"; + break; + case iso::Platform::Wii: + innerRML += "Wii"; + break; + } + + innerRML += " • "; + + switch (state.activeDiscInfo.region) { + case iso::Region::Japan: + innerRML += "JPN"; + break; + case iso::Region::Europe: + innerRML += "EUR"; + break; + case iso::Region::NorthAmerica: + innerRML += "USA"; + break; + case iso::Region::Korea: + innerRML += "KOR"; + break; + default: + innerRML += "Unknown"; + break; + } mDiscDetail->SetInnerRML(innerRML); } else { mDiscDetail->SetProperty(Rml::PropertyId::Display, Rml::Style::Display::None); diff --git a/src/dusk/ui/settings.cpp b/src/dusk/ui/settings.cpp index f12cb11ade..0300b84747 100644 --- a/src/dusk/ui/settings.cpp +++ b/src/dusk/ui/settings.cpp @@ -562,7 +562,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { .getValue = [] { const auto& state = prelaunch_state(); - if (!state.configuredDiscCanLaunch || !state.configuredDiscInfo.isPal) { + if (!state.configuredDiscCanLaunch || state.configuredDiscInfo.region != iso::Region::Europe) { return kLanguageNames[0]; } const u8 idx = static_cast(getSettings().game.language.getValue()); @@ -572,7 +572,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) { [] { const auto& state = prelaunch_state(); return !state.configuredDiscCanLaunch || - !state.configuredDiscInfo.isPal; + state.configuredDiscInfo.region != iso::Region::Europe; }, .isModified = [] {