better disc info display

This commit is contained in:
TakaRikka
2026-05-16 21:06:55 -07:00
parent 9a3428983b
commit 1a7c853d9b
5 changed files with 61 additions and 21 deletions
+8 -1
View File
@@ -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);
+7 -15
View File
@@ -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) {
+14 -1
View File
@@ -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);
+30 -2
View File
@@ -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);
+2 -2
View File
@@ -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<u8>(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 =
[] {