diff options
Diffstat (limited to 'src/yuzu')
-rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_graphics.ui | 35 | ||||
-rw-r--r-- | src/yuzu/debugger/wait_tree.cpp | 35 | ||||
-rw-r--r-- | src/yuzu/debugger/wait_tree.h | 22 |
5 files changed, 71 insertions, 25 deletions
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index cd94693c1..6209fff75 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -630,6 +630,7 @@ void Config::ReadRendererValues() { Settings::values.vulkan_device = ReadSetting(QStringLiteral("vulkan_device"), 0).toInt(); Settings::values.resolution_factor = ReadSetting(QStringLiteral("resolution_factor"), 1.0).toFloat(); + Settings::values.aspect_ratio = ReadSetting(QStringLiteral("aspect_ratio"), 0).toInt(); Settings::values.use_frame_limit = ReadSetting(QStringLiteral("use_frame_limit"), true).toBool(); Settings::values.frame_limit = ReadSetting(QStringLiteral("frame_limit"), 100).toInt(); @@ -1064,6 +1065,7 @@ void Config::SaveRendererValues() { WriteSetting(QStringLiteral("vulkan_device"), Settings::values.vulkan_device, 0); WriteSetting(QStringLiteral("resolution_factor"), static_cast<double>(Settings::values.resolution_factor), 1.0); + WriteSetting(QStringLiteral("aspect_ratio"), Settings::values.aspect_ratio, 0); WriteSetting(QStringLiteral("use_frame_limit"), Settings::values.use_frame_limit, true); WriteSetting(QStringLiteral("frame_limit"), Settings::values.frame_limit, 100); WriteSetting(QStringLiteral("use_disk_shader_cache"), Settings::values.use_disk_shader_cache, diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index f57a24e36..ea899c080 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp @@ -97,6 +97,7 @@ void ConfigureGraphics::SetConfiguration() { ui->api->setCurrentIndex(static_cast<int>(Settings::values.renderer_backend)); ui->resolution_factor_combobox->setCurrentIndex( static_cast<int>(FromResolutionFactor(Settings::values.resolution_factor))); + ui->aspect_ratio_combobox->setCurrentIndex(Settings::values.aspect_ratio); ui->use_disk_shader_cache->setEnabled(runtime_lock); ui->use_disk_shader_cache->setChecked(Settings::values.use_disk_shader_cache); ui->use_accurate_gpu_emulation->setChecked(Settings::values.use_accurate_gpu_emulation); @@ -114,6 +115,7 @@ void ConfigureGraphics::ApplyConfiguration() { Settings::values.vulkan_device = vulkan_device; Settings::values.resolution_factor = ToResolutionFactor(static_cast<Resolution>(ui->resolution_factor_combobox->currentIndex())); + Settings::values.aspect_ratio = ui->aspect_ratio_combobox->currentIndex(); Settings::values.use_disk_shader_cache = ui->use_disk_shader_cache->isChecked(); Settings::values.use_accurate_gpu_emulation = ui->use_accurate_gpu_emulation->isChecked(); Settings::values.use_asynchronous_gpu_emulation = diff --git a/src/yuzu/configuration/configure_graphics.ui b/src/yuzu/configuration/configure_graphics.ui index e24372204..db60426ab 100644 --- a/src/yuzu/configuration/configure_graphics.ui +++ b/src/yuzu/configuration/configure_graphics.ui @@ -139,6 +139,41 @@ </layout> </item> <item> + <layout class="QHBoxLayout" name="horizontalLayout_6"> + <item> + <widget class="QLabel" name="ar_label"> + <property name="text"> + <string>Aspect Ratio:</string> + </property> + </widget> + </item> + <item> + <widget class="QComboBox" name="aspect_ratio_combobox"> + <item> + <property name="text"> + <string>Default (16:9)</string> + </property> + </item> + <item> + <property name="text"> + <string>Force 4:3</string> + </property> + </item> + <item> + <property name="text"> + <string>Force 21:9</string> + </property> + </item> + <item> + <property name="text"> + <string>Stretch to Window</string> + </property> + </item> + </widget> + </item> + </layout> + </item> + <item> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> <widget class="QLabel" name="bg_label"> diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 727bd8a94..3f1a94627 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp @@ -12,8 +12,8 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/readable_event.h" #include "core/hle/kernel/scheduler.h" +#include "core/hle/kernel/synchronization_object.h" #include "core/hle/kernel/thread.h" -#include "core/hle/kernel/wait_object.h" #include "core/memory.h" WaitTreeItem::WaitTreeItem() = default; @@ -133,8 +133,9 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons return list; } -WaitTreeWaitObject::WaitTreeWaitObject(const Kernel::WaitObject& o) : object(o) {} -WaitTreeWaitObject::~WaitTreeWaitObject() = default; +WaitTreeSynchronizationObject::WaitTreeSynchronizationObject(const Kernel::SynchronizationObject& o) + : object(o) {} +WaitTreeSynchronizationObject::~WaitTreeSynchronizationObject() = default; WaitTreeExpandableItem::WaitTreeExpandableItem() = default; WaitTreeExpandableItem::~WaitTreeExpandableItem() = default; @@ -143,25 +144,26 @@ bool WaitTreeExpandableItem::IsExpandable() const { return true; } -QString WaitTreeWaitObject::GetText() const { +QString WaitTreeSynchronizationObject::GetText() const { return tr("[%1]%2 %3") .arg(object.GetObjectId()) .arg(QString::fromStdString(object.GetTypeName()), QString::fromStdString(object.GetName())); } -std::unique_ptr<WaitTreeWaitObject> WaitTreeWaitObject::make(const Kernel::WaitObject& object) { +std::unique_ptr<WaitTreeSynchronizationObject> WaitTreeSynchronizationObject::make( + const Kernel::SynchronizationObject& object) { switch (object.GetHandleType()) { case Kernel::HandleType::ReadableEvent: return std::make_unique<WaitTreeEvent>(static_cast<const Kernel::ReadableEvent&>(object)); case Kernel::HandleType::Thread: return std::make_unique<WaitTreeThread>(static_cast<const Kernel::Thread&>(object)); default: - return std::make_unique<WaitTreeWaitObject>(object); + return std::make_unique<WaitTreeSynchronizationObject>(object); } } -std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() const { +std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeSynchronizationObject::GetChildren() const { std::vector<std::unique_ptr<WaitTreeItem>> list; const auto& threads = object.GetWaitingThreads(); @@ -173,8 +175,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() con return list; } -WaitTreeObjectList::WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::WaitObject>>& list, - bool w_all) +WaitTreeObjectList::WaitTreeObjectList( + const std::vector<std::shared_ptr<Kernel::SynchronizationObject>>& list, bool w_all) : object_list(list), wait_all(w_all) {} WaitTreeObjectList::~WaitTreeObjectList() = default; @@ -188,11 +190,12 @@ QString WaitTreeObjectList::GetText() const { std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeObjectList::GetChildren() const { std::vector<std::unique_ptr<WaitTreeItem>> list(object_list.size()); std::transform(object_list.begin(), object_list.end(), list.begin(), - [](const auto& t) { return WaitTreeWaitObject::make(*t); }); + [](const auto& t) { return WaitTreeSynchronizationObject::make(*t); }); return list; } -WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) : WaitTreeWaitObject(thread) {} +WaitTreeThread::WaitTreeThread(const Kernel::Thread& thread) + : WaitTreeSynchronizationObject(thread) {} WaitTreeThread::~WaitTreeThread() = default; QString WaitTreeThread::GetText() const { @@ -241,7 +244,8 @@ QString WaitTreeThread::GetText() const { const QString pc_info = tr(" PC = 0x%1 LR = 0x%2") .arg(context.pc, 8, 16, QLatin1Char{'0'}) .arg(context.cpu_registers[30], 8, 16, QLatin1Char{'0'}); - return QStringLiteral("%1%2 (%3) ").arg(WaitTreeWaitObject::GetText(), pc_info, status); + return QStringLiteral("%1%2 (%3) ") + .arg(WaitTreeSynchronizationObject::GetText(), pc_info, status); } QColor WaitTreeThread::GetColor() const { @@ -273,7 +277,7 @@ QColor WaitTreeThread::GetColor() const { } std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { - std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeWaitObject::GetChildren()); + std::vector<std::unique_ptr<WaitTreeItem>> list(WaitTreeSynchronizationObject::GetChildren()); const auto& thread = static_cast<const Kernel::Thread&>(object); @@ -314,7 +318,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { } if (thread.GetStatus() == Kernel::ThreadStatus::WaitSynch) { - list.push_back(std::make_unique<WaitTreeObjectList>(thread.GetWaitObjects(), + list.push_back(std::make_unique<WaitTreeObjectList>(thread.GetSynchronizationObjects(), thread.IsSleepingOnWait())); } @@ -323,7 +327,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { return list; } -WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) : WaitTreeWaitObject(object) {} +WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) + : WaitTreeSynchronizationObject(object) {} WaitTreeEvent::~WaitTreeEvent() = default; WaitTreeThreadList::WaitTreeThreadList(const std::vector<std::shared_ptr<Kernel::Thread>>& list) diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index 631274a5f..8e3bc4b24 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h @@ -19,7 +19,7 @@ class EmuThread; namespace Kernel { class HandleTable; class ReadableEvent; -class WaitObject; +class SynchronizationObject; class Thread; } // namespace Kernel @@ -99,35 +99,37 @@ private: const Kernel::Thread& thread; }; -class WaitTreeWaitObject : public WaitTreeExpandableItem { +class WaitTreeSynchronizationObject : public WaitTreeExpandableItem { Q_OBJECT public: - explicit WaitTreeWaitObject(const Kernel::WaitObject& object); - ~WaitTreeWaitObject() override; + explicit WaitTreeSynchronizationObject(const Kernel::SynchronizationObject& object); + ~WaitTreeSynchronizationObject() override; - static std::unique_ptr<WaitTreeWaitObject> make(const Kernel::WaitObject& object); + static std::unique_ptr<WaitTreeSynchronizationObject> make( + const Kernel::SynchronizationObject& object); QString GetText() const override; std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; protected: - const Kernel::WaitObject& object; + const Kernel::SynchronizationObject& object; }; class WaitTreeObjectList : public WaitTreeExpandableItem { Q_OBJECT public: - WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::WaitObject>>& list, bool wait_all); + WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::SynchronizationObject>>& list, + bool wait_all); ~WaitTreeObjectList() override; QString GetText() const override; std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; private: - const std::vector<std::shared_ptr<Kernel::WaitObject>>& object_list; + const std::vector<std::shared_ptr<Kernel::SynchronizationObject>>& object_list; bool wait_all; }; -class WaitTreeThread : public WaitTreeWaitObject { +class WaitTreeThread : public WaitTreeSynchronizationObject { Q_OBJECT public: explicit WaitTreeThread(const Kernel::Thread& thread); @@ -138,7 +140,7 @@ public: std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; }; -class WaitTreeEvent : public WaitTreeWaitObject { +class WaitTreeEvent : public WaitTreeSynchronizationObject { Q_OBJECT public: explicit WaitTreeEvent(const Kernel::ReadableEvent& object); |