load param.sfo

This commit is contained in:
InoriRus
2022-05-31 16:18:55 +10:00
parent 50b54b2607
commit 877560b7f6
54 changed files with 10562 additions and 245 deletions
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>697</width>
<height>587</height>
<width>837</width>
<height>822</height>
</rect>
</property>
<property name="windowTitle">
@@ -17,6 +17,19 @@
<locale language="English" country="UnitedStates"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" rowspan="2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="sizeConstraint">
@@ -89,6 +102,12 @@
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="MandatoryLineEdit" name="base_directory_lineedit">
<property name="minimumSize">
<size>
<width>550</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the directory where game is located&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
@@ -109,6 +128,43 @@
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Param file</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLineEdit" name="param_file_lineedit">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Path to &lt;span style=&quot; font-weight:600;&quot;&gt;param.sfo&lt;/span&gt; file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="browse_param_file_button">
<property name="text">
<string>Browse...</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
@@ -132,20 +188,6 @@
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<item row="1" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Screen resoultion:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_screen_resolution">
<property name="toolTip">
<string>Window resolution</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QFrame" name="frame_4">
<property name="frameShape">
@@ -168,19 +210,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBox_shader_validation">
<property name="toolTip">
<string>Validate SPIR-V binary</string>
</property>
<property name="text">
<string>Shader validation</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_vulkan_validation">
<property name="toolTip">
@@ -194,6 +223,19 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkBox_shader_validation">
<property name="toolTip">
<string>Validate SPIR-V binary</string>
</property>
<property name="text">
<string>Shader validation</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkBox_cmd_dump">
<property name="toolTip">
@@ -207,22 +249,36 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="checkBox_spirv_printf">
<property name="enabled">
<bool>false</bool>
<item row="1" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="toolTip">
<string>Enable GL_EXT_debug_printf extension</string>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Spirv debug printf</string>
</property>
</widget>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Screen resoultion:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_screen_resolution">
<property name="toolTip">
<string>Window resolution</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
@@ -237,6 +293,13 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Shader log direction:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="comboBox_shader_log_direction">
<property name="toolTip">
@@ -244,6 +307,13 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Shader log folder:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="MandatoryLineEdit" name="lineEdit_shader_log_folder">
<property name="toolTip">
@@ -254,6 +324,13 @@
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Command buffer dump folder:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="MandatoryLineEdit" name="lineEdit_cmd_dump_folder">
<property name="toolTip">
@@ -264,6 +341,13 @@
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Printf direction:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="comboBox_printf_direction">
<property name="toolTip">
@@ -271,6 +355,13 @@
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Printf output file:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="MandatoryLineEdit" name="lineEdit_printf_file">
<property name="toolTip">
@@ -281,6 +372,13 @@
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Profiler direction:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="comboBox_profiler_direction">
<property name="toolTip">
@@ -288,45 +386,10 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_21">
<item row="9" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Shader log direction:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Shader log folder:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Command buffer dump folder:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Printf direction:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Printf output file:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Profiler direction:</string>
<string>Profiler output file:</string>
</property>
</widget>
</item>
@@ -340,12 +403,54 @@
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Profiler output file:</string>
</property>
</widget>
<item row="11" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="image">
<property name="minimumSize">
<size>
<width>240</width>
<height>135</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
@@ -426,21 +531,11 @@
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="params_table"/>
</item>
</layout>
</item>
<item row="1" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+9 -9
View File
@@ -102,8 +102,9 @@ public:
Configuration() = default;
QString Name;
QString BaseDir; /* Game base directory */
QString name;
QString basedir; /* Game base directory */
QString param_file; /* Path to param.sfo */
Resolution screen_resolution = Resolution::R1280X720;
bool neo = true;
@@ -118,7 +119,6 @@ public:
QString printf_output_file = "_kyty.txt";
ProfilerDirection profiler_direction = ProfilerDirection::None;
QString profiler_output_file = "_profile.prof";
bool spirv_debug_printf_enabled = false;
QStringList elfs;
QStringList elfs_selected;
@@ -127,8 +127,9 @@ public:
void WriteSettings(QSettings* s) const
{
KYTY_CFG_SET(Name);
KYTY_CFG_SET(BaseDir);
KYTY_CFG_SET(name);
KYTY_CFG_SET(basedir);
KYTY_CFG_SET(param_file);
KYTY_CFG_SET(screen_resolution);
KYTY_CFG_SET(neo);
KYTY_CFG_SET(vulkan_validation_enabled);
@@ -142,7 +143,6 @@ public:
KYTY_CFG_SET(printf_output_file);
KYTY_CFG_SET(profiler_direction);
KYTY_CFG_SET(profiler_output_file);
KYTY_CFG_SET(spirv_debug_printf_enabled);
KYTY_CFG_SETL(elfs);
KYTY_CFG_SETL(elfs_selected);
KYTY_CFG_SETL(libs);
@@ -151,8 +151,9 @@ public:
void ReadSettings(QSettings* s)
{
KYTY_CFG_GET(Name);
KYTY_CFG_GET(BaseDir);
KYTY_CFG_GET(name);
KYTY_CFG_GET(basedir);
KYTY_CFG_GET(param_file);
KYTY_CFG_GET(screen_resolution);
KYTY_CFG_GET(neo);
KYTY_CFG_GET(vulkan_validation_enabled);
@@ -166,7 +167,6 @@ public:
KYTY_CFG_GET(printf_output_file);
KYTY_CFG_GET(profiler_direction);
KYTY_CFG_GET(profiler_output_file);
KYTY_CFG_GET(spirv_debug_printf_enabled);
KYTY_CFG_GETL(elfs);
KYTY_CFG_GETL(elfs_selected);
KYTY_CFG_GETL(libs);
@@ -53,8 +53,10 @@ protected:
void adjust_size();
void save();
void browse_base_path();
void browse_param_file();
void scan_elfs();
void scan_libs();
void load_param_sfo();
void clear();
void test();
};
+118
View File
@@ -0,0 +1,118 @@
#ifndef LAUNCHER_INCLUDE_PSF_H_
#define LAUNCHER_INCLUDE_PSF_H_
#include "Common.h"
#include <QFile>
#include <QString>
class Psf
{
public:
Psf() = default;
virtual ~Psf() = default;
KYTY_QT_CLASS_NO_COPY(Psf);
void Load(const QString& file_name);
[[nodiscard]] const QMap<QString, QVariant>& GetMap() const { return m_map; }
private:
QMap<QString, QVariant> m_map;
};
inline void Psf::Load(const QString& file_name)
{
struct ParamInfo
{
uint16_t name_offset;
uint16_t type;
uint32_t size1;
uint32_t size2;
uint32_t value_offset;
};
QFile f(file_name);
if (!f.open(QIODevice::ReadOnly))
{
return;
}
QDataStream s(&f);
s.setByteOrder(QDataStream::LittleEndian);
uint32_t magic1 = 0;
uint32_t magic2 = 0;
s >> magic1;
s >> magic2;
if (magic1 != 0x46535000 && magic2 != 0x00000101)
{
return;
}
uint32_t name_tbl_offset = 0;
uint32_t value_tbl_offset = 0;
uint32_t params_num = 0;
s >> name_tbl_offset;
s >> value_tbl_offset;
s >> params_num;
if (name_tbl_offset == 0 || value_tbl_offset == 0 || value_tbl_offset <= name_tbl_offset || params_num == 0)
{
return;
}
uint32_t name_tbl_size = value_tbl_offset - name_tbl_offset;
auto* params = new ParamInfo[params_num];
auto* name_tbl = new char[name_tbl_size];
for (uint32_t i = 0; i < params_num; i++)
{
s >> params[i].name_offset;
s >> params[i].type;
s >> params[i].size1;
s >> params[i].size2;
s >> params[i].value_offset;
}
s.device()->seek(name_tbl_offset);
s.readRawData(name_tbl, static_cast<int>(name_tbl_size));
for (uint32_t i = 0; i < params_num; i++)
{
QString name = name_tbl + params[i].name_offset;
switch (params[i].type)
{
case 0x0204:
{
s.device()->seek(value_tbl_offset + params[i].value_offset);
QByteArray buf(static_cast<int>(params[i].size1), Qt::Uninitialized);
s.readRawData(buf.data(), static_cast<int>(params[i].size1));
QString value(buf);
m_map.insert(name, value);
break;
}
case 0x0404:
{
uint32_t value = 0;
s.device()->seek(value_tbl_offset + params[i].value_offset);
s >> value;
m_map.insert(name, value);
break;
}
default:;
}
}
delete[] params;
delete[] name_tbl;
}
#endif /* LAUNCHER_INCLUDE_PSF_H_ */
@@ -4,6 +4,7 @@
#include "ConfigurationListWidget.h"
#include "MainDialog.h"
#include "MandatoryLineEdit.h"
#include "Psf.h"
#include <QByteArray>
#include <QCheckBox>
@@ -20,6 +21,7 @@
#include <QListWidget>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QPicture>
#include <QPushButton>
#include <QSettings>
#include <QStringList>
@@ -32,6 +34,7 @@ constexpr char SETTINGS_CFG_LAST_GEOMETRY[] = "geometry";
constexpr char SETTINGS_LAST_BASE_DIR[] = "last_base_dir";
constexpr char COLOR_SELECTED[] = "#e2ffe2";
constexpr char COLOR_NOT_SELECTED[] = "#ffffff";
constexpr char COLOR_ODD_ROW[] = "#fff5e5";
static void ChangeColor(QListWidgetItem* item)
{
@@ -53,6 +56,7 @@ ConfigurationEditDialog::ConfigurationEditDialog(Kyty::Configuration* info, Conf
connect(m_ui->clear_button, &QPushButton::clicked, this, &ConfigurationEditDialog::clear);
connect(m_ui->test_button, &QPushButton::clicked, this, &ConfigurationEditDialog::test);
connect(m_ui->browse_base_dir_button, &QPushButton::clicked, this, &ConfigurationEditDialog::browse_base_path);
connect(m_ui->browse_param_file_button, &QPushButton::clicked, this, &ConfigurationEditDialog::browse_param_file);
connect(m_ui->comboBox_shader_log_direction, &QComboBox::currentTextChanged,
[=](const QString& text)
{
@@ -74,6 +78,7 @@ ConfigurationEditDialog::ConfigurationEditDialog(Kyty::Configuration* info, Conf
log == Kyty::Configuration::ProfilerDirection::FileAndNetwork);
});
connect(m_ui->base_directory_lineedit, &QLineEdit::textChanged, this, &ConfigurationEditDialog::scan_elfs);
connect(m_ui->param_file_lineedit, &QLineEdit::textChanged, this, &ConfigurationEditDialog::load_param_sfo);
connect(m_ui->listWidget_elfs, &QListWidget::itemChanged, this, &ChangeColor);
connect(m_ui->listWidget_libs, &QListWidget::itemChanged, this, &ChangeColor);
connect(&m_process, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
@@ -83,10 +88,17 @@ ConfigurationEditDialog::ConfigurationEditDialog(Kyty::Configuration* info, Conf
restoreGeometry(g_last_geometry);
m_ui->params_table->setWordWrap(false);
m_ui->params_table->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
m_ui->params_table->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
m_ui->params_table->horizontalHeader()->setStretchLastSection(true);
m_ui->params_table->setStyleSheet("selection-background-color: lightgray; selection-color: black;");
Init();
scan_libs();
scan_elfs();
load_param_sfo();
}
QString ConfigurationEditDialog::g_last_base_dir;
@@ -134,8 +146,9 @@ static void ListInit(QComboBox* combo, T value)
void ConfigurationEditDialog::Init()
{
m_ui->name_lineedit->setText(m_info->Name);
m_ui->base_directory_lineedit->setText(m_info->BaseDir);
m_ui->name_lineedit->setText(m_info->name);
m_ui->base_directory_lineedit->setText(m_info->basedir);
m_ui->param_file_lineedit->setText(m_info->param_file);
ListInit(m_ui->comboBox_screen_resolution, m_info->screen_resolution);
m_ui->checkBox_neo->setChecked(m_info->neo);
m_ui->checkBox_shader_validation->setChecked(m_info->shader_validation_enabled);
@@ -149,7 +162,6 @@ void ConfigurationEditDialog::Init()
m_ui->lineEdit_printf_file->setText(m_info->printf_output_file);
ListInit(m_ui->comboBox_profiler_direction, m_info->profiler_direction);
m_ui->lineEdit_profiler_file->setText(m_info->profiler_output_file);
m_ui->checkBox_spirv_printf->setChecked(m_info->spirv_debug_printf_enabled);
}
void ConfigurationEditDialog::SetTitle(const QString& str)
@@ -184,8 +196,9 @@ static void UpdateList(QStringList* list, QStringList* list_selected, QListWidge
static void UpdateInfo(Kyty::Configuration* info, Ui::ConfigurationEditDialog* ui)
{
info->Name = ui->name_lineedit->text();
info->BaseDir = ui->base_directory_lineedit->text();
info->name = ui->name_lineedit->text();
info->basedir = ui->base_directory_lineedit->text();
info->param_file = ui->param_file_lineedit->text();
info->screen_resolution = TextToEnum<Kyty::Configuration::Resolution>(ui->comboBox_screen_resolution->currentText());
info->neo = ui->checkBox_neo->isChecked();
info->vulkan_validation_enabled = ui->checkBox_vulkan_validation->isChecked();
@@ -200,7 +213,6 @@ static void UpdateInfo(Kyty::Configuration* info, Ui::ConfigurationEditDialog* u
info->printf_output_file = ui->lineEdit_printf_file->text();
info->profiler_direction = TextToEnum<Kyty::Configuration::ProfilerDirection>(ui->comboBox_profiler_direction->currentText());
info->profiler_output_file = ui->lineEdit_profiler_file->text();
info->spirv_debug_printf_enabled = ui->checkBox_spirv_printf->isChecked();
info->elfs.clear();
info->elfs_selected.clear();
@@ -258,6 +270,23 @@ void ConfigurationEditDialog::browse_base_path()
}
}
void ConfigurationEditDialog::browse_param_file()
{
QString text = m_ui->param_file_lineedit->text();
if (text.isEmpty())
{
text = m_ui->base_directory_lineedit->text();
}
QString file = QFileDialog::getOpenFileName(this, tr("Select param.sfo"), text.isEmpty() ? g_last_base_dir : text, "param.sfo");
if (!file.isEmpty())
{
m_ui->param_file_lineedit->setText(file);
}
}
void ConfigurationEditDialog::scan_elfs()
{
auto dir = m_ui->base_directory_lineedit->text();
@@ -356,6 +385,62 @@ void ConfigurationEditDialog::scan_libs()
m_ui->listWidget_libs->sortItems();
}
void ConfigurationEditDialog::load_param_sfo()
{
auto file_name = m_ui->param_file_lineedit->text();
m_ui->image->clear();
m_ui->params_table->clear();
m_ui->params_table->setRowCount(0);
m_ui->params_table->setColumnCount(2);
m_ui->params_table->setHorizontalHeaderLabels({tr("Parameter"), tr("Value")});
m_ui->params_table->resizeColumnsToContents();
QFile param(file_name);
if (param.exists())
{
Psf psf;
psf.Load(file_name);
const auto& map = psf.GetMap();
m_ui->params_table->setColumnCount(2);
m_ui->params_table->setRowCount(map.size());
int index = 0;
for (auto& m: map.toStdMap())
{
auto* item1 = new QTableWidgetItem(m.first);
item1->setFlags(item1->flags() ^ Qt::ItemIsEditable);
auto* item2 = new QTableWidgetItem(
m.second.type() == QVariant::UInt ? QString("0x%1").arg(m.second.toUInt(), 8, 16, QLatin1Char('0')) : m.second.toString());
item2->setFlags(item2->flags() ^ Qt::ItemIsEditable);
if (index % 2 != 0)
{
item1->setBackground(QColor(COLOR_ODD_ROW));
item2->setBackground(QColor(COLOR_ODD_ROW));
}
m_ui->params_table->setItem(index, 0, item1);
m_ui->params_table->setItem(index, 1, item2);
index++;
}
m_ui->params_table->resizeRowsToContents();
m_ui->params_table->resizeColumnToContents(0);
QFile image(QFileInfo(file_name).absoluteDir().filePath("pic1.png"));
if (image.exists())
{
QPixmap picture;
picture.load(image.fileName());
m_ui->image->setPixmap(picture.scaledToWidth(m_ui->image->width(), Qt::SmoothTransformation));
}
}
}
void ConfigurationEditDialog::clear()
{
auto* old_info = m_info;
@@ -368,6 +453,7 @@ void ConfigurationEditDialog::clear()
scan_elfs();
scan_libs();
load_param_sfo();
}
void ConfigurationEditDialog::test()
+2 -2
View File
@@ -11,7 +11,7 @@ ConfigurationItem::ConfigurationItem(Kyty::Configuration* info, QListWidget* par
setSizeHint(QSize(0, 18));
if (m_info != nullptr)
{
setText(m_info->Name);
setText(m_info->name);
}
SetRunning(false);
}
@@ -25,7 +25,7 @@ void ConfigurationItem::Update()
{
if (m_info != nullptr)
{
setText(m_info->Name);
setText(m_info->name);
}
}
+7 -3
View File
@@ -42,6 +42,7 @@ constexpr char KYTY_MOUNT[] = "kyty_mount";
constexpr char KYTY_EXECUTE[] = "kyty_execute";
constexpr char KYTY_LOAD_ELF[] = "kyty_load_elf";
constexpr char KYTY_LOAD_SYMBOLS[] = "kyty_load_symbols";
constexpr char KYTY_LOAD_PARAM_SFO[] = "kyty_load_param_sfo";
constexpr char KYTY_INIT[] = "kyty_init";
constexpr char KYTY_LUA_FILE[] = "kyty_run.lua";
constexpr DWORD CMD_X_CHARS = 175;
@@ -183,6 +184,7 @@ void MainDialogPrivate::FindInterpreter()
found = found && lines.contains(QString("Lua function: ") + KYTY_EXECUTE);
found = found && lines.contains(QString("Lua function: ") + KYTY_LOAD_ELF);
found = found && lines.contains(QString("Lua function: ") + KYTY_LOAD_SYMBOLS);
found = found && lines.contains(QString("Lua function: ") + KYTY_LOAD_PARAM_SFO);
found = found && lines.contains(QString("Lua function: ") + KYTY_INIT);
}
@@ -234,11 +236,13 @@ static bool CreateLuaScript(Kyty::Configuration* info, const QString& file_name)
s << "\t PrintfOutputFile = '" << info->printf_output_file << "';\n";
s << "\t ProfilerDirection = '" << EnumToText(info->profiler_direction) << "';\n";
s << "\t ProfilerOutputFile = '" << info->profiler_output_file << "';\n";
s << "\t SpirvDebugPrintfEnabled = " << (info->spirv_debug_printf_enabled ? "true" : "false") << ";\n";
s << "\t SpirvDebugPrintfEnabled = false;\n";
s << "}\n";
s << KYTY_INIT << "(cfg);\n";
s << KYTY_MOUNT << "('" << info->BaseDir << "', '/app0');\n";
s << KYTY_MOUNT << "('" << info->basedir << "', '/app0');\n";
s << KYTY_LOAD_PARAM_SFO << "('" << info->param_file << "');\n";
for (const auto& elf: info->elfs_selected)
{
@@ -357,7 +361,7 @@ void MainDialogPrivate::Update()
if (run_enabled && item != nullptr)
{
const auto* info = item->GetInfo();
auto dir = info->BaseDir;
auto dir = info->basedir;
run_enabled = !dir.isEmpty() && QDir(dir).exists();
}
+77 -61
View File
@@ -9,225 +9,241 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="43"/>
<location filename="../forms/configuration_edit_dialog.ui" line="56"/>
<source>Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="50"/>
<location filename="../forms/configuration_edit_dialog.ui" line="63"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Configuration name&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="84"/>
<location filename="../forms/configuration_edit_dialog.ui" line="97"/>
<source>Mount app0 to</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="93"/>
<location filename="../forms/configuration_edit_dialog.ui" line="112"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Name of the directory where game is located&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="103"/>
<location filename="../forms/configuration_edit_dialog.ui" line="122"/>
<location filename="../forms/configuration_edit_dialog.ui" line="159"/>
<source>Browse...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="138"/>
<location filename="../forms/configuration_edit_dialog.ui" line="271"/>
<source>Screen resoultion:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="145"/>
<location filename="../forms/configuration_edit_dialog.ui" line="278"/>
<source>Window resolution</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="161"/>
<location filename="../forms/configuration_edit_dialog.ui" line="203"/>
<source>Enable PS4 Pro mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="164"/>
<location filename="../forms/configuration_edit_dialog.ui" line="206"/>
<source>Neo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="174"/>
<location filename="../forms/configuration_edit_dialog.ui" line="229"/>
<source>Validate SPIR-V binary</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="177"/>
<location filename="../forms/configuration_edit_dialog.ui" line="232"/>
<source>Shader validation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="187"/>
<location filename="../forms/configuration_edit_dialog.ui" line="216"/>
<source>Enable Vulkan validation layers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="190"/>
<source>Vulkan validation</source>
<location filename="../forms/configuration_edit_dialog.ui" line="140"/>
<source>Param file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="200"/>
<source>Dump command buffers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="203"/>
<source>Command buffer dump</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="216"/>
<source>Enable GL_EXT_debug_printf extension</source>
<location filename="../forms/configuration_edit_dialog.ui" line="149"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Path to &lt;span style=&quot; font-weight:600;&quot;&gt;param.sfo&lt;/span&gt; file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="219"/>
<source>Spirv debug printf</source>
<source>Vulkan validation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="229"/>
<location filename="../forms/configuration_edit_dialog.ui" line="242"/>
<source>Dump command buffers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="245"/>
<source>Command buffer dump</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="285"/>
<source>Shader optimization type:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="236"/>
<location filename="../forms/configuration_edit_dialog.ui" line="292"/>
<source>Optimize shaders for code size or performance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="243"/>
<location filename="../forms/configuration_edit_dialog.ui" line="306"/>
<source>Dump shaders to file or console window. If enabled may decrease emulator performance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="250"/>
<location filename="../forms/configuration_edit_dialog.ui" line="320"/>
<source>Specify directory to dump shaders</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="260"/>
<location filename="../forms/configuration_edit_dialog.ui" line="337"/>
<source>Specify directory to dump command buffers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="270"/>
<location filename="../forms/configuration_edit_dialog.ui" line="354"/>
<source>Print logs to file or console window. If enabled may decrease emulator performance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="277"/>
<location filename="../forms/configuration_edit_dialog.ui" line="368"/>
<source>Specify file to dump logs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="287"/>
<location filename="../forms/configuration_edit_dialog.ui" line="385"/>
<source>Enable/disable profiler. If enabled may decrease emulator performance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="294"/>
<location filename="../forms/configuration_edit_dialog.ui" line="299"/>
<source>Shader log direction:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="301"/>
<location filename="../forms/configuration_edit_dialog.ui" line="313"/>
<source>Shader log folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="308"/>
<location filename="../forms/configuration_edit_dialog.ui" line="330"/>
<source>Command buffer dump folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="315"/>
<location filename="../forms/configuration_edit_dialog.ui" line="347"/>
<source>Printf direction:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="322"/>
<location filename="../forms/configuration_edit_dialog.ui" line="361"/>
<source>Printf output file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="329"/>
<location filename="../forms/configuration_edit_dialog.ui" line="378"/>
<source>Profiler direction:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="336"/>
<location filename="../forms/configuration_edit_dialog.ui" line="399"/>
<source>Specify file to dump profiler info</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="346"/>
<location filename="../forms/configuration_edit_dialog.ui" line="392"/>
<source>Profiler output file:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="373"/>
<location filename="../forms/configuration_edit_dialog.ui" line="478"/>
<source>Load elf:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="380"/>
<location filename="../forms/configuration_edit_dialog.ui" line="485"/>
<source>Select executables to load</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="408"/>
<location filename="../forms/configuration_edit_dialog.ui" line="513"/>
<source>Select libraries to load</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="418"/>
<location filename="../forms/configuration_edit_dialog.ui" line="523"/>
<source>Load library:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="455"/>
<location filename="../forms/configuration_edit_dialog.ui" line="550"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="471"/>
<location filename="../forms/configuration_edit_dialog.ui" line="566"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="491"/>
<location filename="../forms/configuration_edit_dialog.ui" line="586"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../forms/configuration_edit_dialog.ui" line="507"/>
<location filename="../forms/configuration_edit_dialog.ui" line="602"/>
<source>Test</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="239"/>
<location filename="../src/ConfigurationEditDialog.cpp" line="251"/>
<source>Save failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="239"/>
<location filename="../src/ConfigurationEditDialog.cpp" line="251"/>
<source>Please fill all mandatory fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="252"/>
<location filename="../src/ConfigurationEditDialog.cpp" line="264"/>
<source>Open Directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="282"/>
<source>Select param.sfo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="396"/>
<source>Parameter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/ConfigurationEditDialog.cpp" line="396"/>
<source>Value</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ConfigurationListWidget</name>
@@ -322,12 +338,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="272"/>
<location filename="../src/MainDialog.cpp" line="276"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="272"/>
<location filename="../src/MainDialog.cpp" line="276"/>
<source>Can&apos;t create file:
</source>
<translation type="unfinished"></translation>
@@ -336,27 +352,27 @@
<context>
<name>MainDialogPrivate</name>
<message>
<location filename="../src/MainDialog.cpp" line="138"/>
<location filename="../src/MainDialog.cpp" line="139"/>
<source>Settings file: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="164"/>
<location filename="../src/MainDialog.cpp" line="165"/>
<source>Emulator: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="176"/>
<location filename="../src/MainDialog.cpp" line="177"/>
<source>Version: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="191"/>
<location filename="../src/MainDialog.cpp" line="193"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/MainDialog.cpp" line="191"/>
<location filename="../src/MainDialog.cpp" line="193"/>
<source>Can&apos;t find emulator</source>
<translation type="unfinished"></translation>
</message>