Add Firmware keyword in log if it is indeed firmware (#343)

Co-authored-by: LotP1 <rasmus.stilling.pedersen1@gmail.com>
This commit is contained in:
WilliamWsyHK 2024-12-07 18:03:01 +08:00 committed by GitHub
parent 0bc1eddaeb
commit d00754477e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 15 deletions

View file

@ -84,12 +84,19 @@ namespace Ryujinx.HLE.Loaders.Processes
return false;
}
bool isFirmware = ProgramId is >= 0x0100000000000819 and <= 0x010000000000081C;
bool isFirmwareApplication = ProgramId <= 0x0100000000007FFF;
string name = !isFirmware
? (isFirmwareApplication ? "Firmware Application " : "") + (!string.IsNullOrWhiteSpace(Name) ? Name : "<Unknown Name>")
: "Firmware";
// TODO: LibHac npdm currently doesn't support version field.
string version = ProgramId > 0x0100000000007FFF
? DisplayVersion
string version = !isFirmware
? (!string.IsNullOrWhiteSpace(DisplayVersion) ? DisplayVersion : "<Unknown Version>")
: device.System.ContentManager.GetCurrentFirmwareVersion()?.VersionString ?? "?";
Logger.Info?.Print(LogClass.Loader, $"Application Loaded: {Name} v{version} [{ProgramIdText}] [{(Is64Bit ? "64-bit" : "32-bit")}]");
Logger.Info?.Print(LogClass.Loader, $"Application Loaded: {name} v{version} [{ProgramIdText}] [{(Is64Bit ? "64-bit" : "32-bit")}]");
return true;
}