1
0
Fork 1
forked from suyu/suyu

feat: Added Build ID on game properties panel

This commit is contained in:
Akatsuki Levi 2024-03-13 11:07:26 -03:00
parent 1157a4c1f9
commit c4bb998c68
No known key found for this signature in database
GPG key ID: BB4057BB9E0F1C7A
3 changed files with 87 additions and 60 deletions

2
externals/xbyak vendored

@ -1 +1 @@
Subproject commit a1ac3750f9a639b5a6c6d6c7da4259b8d6790989
Subproject commit 9c0f5d3ecb06d2c93c2b59becb9b3b763213e74e

View file

@ -17,14 +17,17 @@
#include <QTimer>
#include "common/fs/fs_util.h"
#include "common/hex_util.h"
#include "common/settings_enums.h"
#include "common/settings_input.h"
#include "configuration/shared_widget.h"
#include "core/core.h"
#include "core/file_sys/control_metadata.h"
#include "core/file_sys/ips_layer.h"
#include "core/file_sys/patch_manager.h"
#include "core/file_sys/xts_archive.h"
#include "core/loader/loader.h"
#include "core/loader/nso.h"
#include "frontend_common/config.h"
#include "suyu/configuration/configuration_shared.h"
#include "suyu/configuration/configure_audio.h"
@ -44,8 +47,8 @@
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
std::vector<VkDeviceInfo::Record>& vk_device_records,
Core::System& system_)
: QDialog(parent),
ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_},
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_},
system{system_},
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
tab_group{std::make_shared<std::vector<ConfigurationShared::Tab*>>()} {
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
@ -151,6 +154,16 @@ void ConfigurePerGame::LoadConfiguration() {
ui->display_title_id->setText(
QStringLiteral("%1").arg(title_id, 16, 16, QLatin1Char{'0'}).toUpper());
Loader::NSOHeader nso_header{};
if (sizeof(Loader::NSOHeader) != file->ReadObject(&nso_header)) {
LOG_ERROR(Core, "Could not read header for file {}", file->GetFullPath());
return;
}
const auto build_id_raw = Common::HexToString(nso_header.build_id);
const auto build_id = build_id_raw.substr(0, build_id_raw.find_last_not_of('0') + 1);
ui->display_build_id->setText(QString::fromStdString(build_id));
const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
system.GetContentProvider()};
const auto control = pm.GetControlMetadata();

View file

@ -67,8 +67,18 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QLineEdit" name="display_developer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="display_size">
<widget class="QLineEdit" name="display_format">
<property name="enabled">
<bool>true</bool>
</property>
@ -77,20 +87,17 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="display_version">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<item row="7" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Name</string>
<string>Size</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Filename</string>
</property>
</widget>
</item>
@ -101,6 +108,13 @@
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="display_title_id">
<property name="enabled">
@ -111,7 +125,38 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Developer</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Format</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="display_version">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLineEdit" name="display_filename">
<property name="enabled">
<bool>true</bool>
@ -121,23 +166,6 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="display_format">
<property name="enabled">
<bool>true</bool>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Filename</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="display_name">
<property name="enabled">
@ -148,8 +176,8 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="display_developer">
<item row="7" column="1">
<widget class="QLineEdit" name="display_size">
<property name="enabled">
<bool>true</bool>
</property>
@ -158,31 +186,17 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="display_build_id">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Format</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Version</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Developer</string>
<string>Build ID</string>
</property>
</widget>
</item>