[Kernel] Fixed xex2_version

This commit is contained in:
Adrian 2025-04-15 12:15:46 +01:00 committed by Radosław Gliński
parent 31d715d100
commit bde7d5579a
2 changed files with 6 additions and 16 deletions

View file

@ -1333,19 +1333,9 @@ std::string Emulator::FindLaunchModule() {
}
static std::string format_version(xex2_version version) {
// fmt::format doesn't like bit fields
uint32_t major, minor, build, qfe;
major = version.major;
minor = version.minor;
build = version.build;
qfe = version.qfe;
if (qfe) {
return fmt::format("{}.{}.{}.{}", major, minor, build, qfe);
}
if (build) {
return fmt::format("{}.{}.{}", major, minor, build);
}
return fmt::format("{}.{}", major, minor);
// fmt::format doesn't like bit fields we use + to bypass it
return fmt::format("{}.{}.{}.{}", +version.major, +version.minor,
+version.build, +version.qfe);
}
X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path,

View file

@ -375,10 +375,10 @@ struct xex2_opt_file_format_info {
union xex2_version {
uint32_t value;
struct {
uint32_t major : 4;
uint32_t minor : 4;
uint32_t build : 16;
uint32_t qfe : 8;
uint32_t build : 16;
uint32_t minor : 4;
uint32_t major : 4;
};
};