diff options
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_web.cpp | 73 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_web.ui | 12 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoint_observer.cpp | 27 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoint_observer.h | 33 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints.cpp | 221 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints.h | 45 | ||||
| -rw-r--r-- | src/yuzu/debugger/graphics/graphics_breakpoints_p.h | 37 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.cpp | 15 | ||||
| -rw-r--r-- | src/yuzu/debugger/wait_tree.h | 11 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/main.h | 8 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 13 |
13 files changed, 69 insertions, 445 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index ff1c1d985..11ae1e66e 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -78,11 +78,6 @@ add_executable(yuzu configuration/configure_web.cpp configuration/configure_web.h configuration/configure_web.ui - debugger/graphics/graphics_breakpoint_observer.cpp - debugger/graphics/graphics_breakpoint_observer.h - debugger/graphics/graphics_breakpoints.cpp - debugger/graphics/graphics_breakpoints.h - debugger/graphics/graphics_breakpoints_p.h debugger/console.cpp debugger/console.h debugger/profiler.cpp diff --git a/src/yuzu/configuration/configure_web.cpp b/src/yuzu/configuration/configure_web.cpp index 336b062b3..8637f5b3c 100644 --- a/src/yuzu/configuration/configure_web.cpp +++ b/src/yuzu/configuration/configure_web.cpp @@ -11,6 +11,31 @@ #include "yuzu/configuration/configure_web.h" #include "yuzu/uisettings.h" +static constexpr char token_delimiter{':'}; + +static std::string GenerateDisplayToken(const std::string& username, const std::string& token) { + if (username.empty() || token.empty()) { + return {}; + } + + const std::string unencoded_display_token{username + token_delimiter + token}; + QByteArray b{unencoded_display_token.c_str()}; + QByteArray b64 = b.toBase64(); + return b64.toStdString(); +} + +static std::string UsernameFromDisplayToken(const std::string& display_token) { + const std::string unencoded_display_token{ + QByteArray::fromBase64(display_token.c_str()).toStdString()}; + return unencoded_display_token.substr(0, unencoded_display_token.find(token_delimiter)); +} + +static std::string TokenFromDisplayToken(const std::string& display_token) { + const std::string unencoded_display_token{ + QByteArray::fromBase64(display_token.c_str()).toStdString()}; + return unencoded_display_token.substr(unencoded_display_token.find(token_delimiter) + 1); +} + ConfigureWeb::ConfigureWeb(QWidget* parent) : QWidget(parent), ui(std::make_unique<Ui::ConfigureWeb>()) { ui->setupUi(this); @@ -63,13 +88,18 @@ void ConfigureWeb::SetConfiguration() { ui->web_signup_link->setOpenExternalLinks(true); ui->web_token_info_link->setOpenExternalLinks(true); + if (Settings::values.yuzu_username.empty()) { + ui->username->setText(tr("Unspecified")); + } else { + ui->username->setText(QString::fromStdString(Settings::values.yuzu_username)); + } + ui->toggle_telemetry->setChecked(Settings::values.enable_telemetry); - ui->edit_username->setText(QString::fromStdString(Settings::values.yuzu_username)); - ui->edit_token->setText(QString::fromStdString(Settings::values.yuzu_token)); + ui->edit_token->setText(QString::fromStdString( + GenerateDisplayToken(Settings::values.yuzu_username, Settings::values.yuzu_token))); // Connect after setting the values, to avoid calling OnLoginChanged now connect(ui->edit_token, &QLineEdit::textChanged, this, &ConfigureWeb::OnLoginChanged); - connect(ui->edit_username, &QLineEdit::textChanged, this, &ConfigureWeb::OnLoginChanged); user_verified = true; @@ -80,12 +110,13 @@ void ConfigureWeb::ApplyConfiguration() { Settings::values.enable_telemetry = ui->toggle_telemetry->isChecked(); UISettings::values.enable_discord_presence = ui->toggle_discordrpc->isChecked(); if (user_verified) { - Settings::values.yuzu_username = ui->edit_username->text().toStdString(); - Settings::values.yuzu_token = ui->edit_token->text().toStdString(); + Settings::values.yuzu_username = + UsernameFromDisplayToken(ui->edit_token->text().toStdString()); + Settings::values.yuzu_token = TokenFromDisplayToken(ui->edit_token->text().toStdString()); } else { - QMessageBox::warning(this, tr("Username and token not verified"), - tr("Username and token were not verified. The changes to your " - "username and/or token have not been saved.")); + QMessageBox::warning( + this, tr("Token not verified"), + tr("Token was not verified. The change to your token has not been saved.")); } } @@ -96,17 +127,15 @@ void ConfigureWeb::RefreshTelemetryID() { } void ConfigureWeb::OnLoginChanged() { - if (ui->edit_username->text().isEmpty() && ui->edit_token->text().isEmpty()) { + if (ui->edit_token->text().isEmpty()) { user_verified = true; const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); - ui->label_username_verified->setPixmap(pixmap); ui->label_token_verified->setPixmap(pixmap); } else { user_verified = false; const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); - ui->label_username_verified->setPixmap(pixmap); ui->label_token_verified->setPixmap(pixmap); } } @@ -114,10 +143,11 @@ void ConfigureWeb::OnLoginChanged() { void ConfigureWeb::VerifyLogin() { ui->button_verify_login->setDisabled(true); ui->button_verify_login->setText(tr("Verifying...")); - verify_watcher.setFuture(QtConcurrent::run([username = ui->edit_username->text().toStdString(), - token = ui->edit_token->text().toStdString()] { - return Core::VerifyLogin(username, token); - })); + verify_watcher.setFuture(QtConcurrent::run( + [username = UsernameFromDisplayToken(ui->edit_token->text().toStdString()), + token = TokenFromDisplayToken(ui->edit_token->text().toStdString())] { + return Core::VerifyLogin(username, token); + })); } void ConfigureWeb::OnLoginVerified() { @@ -127,16 +157,15 @@ void ConfigureWeb::OnLoginVerified() { user_verified = true; const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("checked")).pixmap(16); - ui->label_username_verified->setPixmap(pixmap); ui->label_token_verified->setPixmap(pixmap); + ui->username->setText( + QString::fromStdString(UsernameFromDisplayToken(ui->edit_token->text().toStdString()))); } else { const QPixmap pixmap = QIcon::fromTheme(QStringLiteral("failed")).pixmap(16); - ui->label_username_verified->setPixmap(pixmap); ui->label_token_verified->setPixmap(pixmap); - - QMessageBox::critical( - this, tr("Verification failed"), - tr("Verification failed. Check that you have entered your username and token " - "correctly, and that your internet connection is working.")); + ui->username->setText(tr("Unspecified")); + QMessageBox::critical(this, tr("Verification failed"), + tr("Verification failed. Check that you have entered your token " + "correctly, and that your internet connection is working.")); } } diff --git a/src/yuzu/configuration/configure_web.ui b/src/yuzu/configuration/configure_web.ui index 2f4b9dd73..8c07d1165 100644 --- a/src/yuzu/configuration/configure_web.ui +++ b/src/yuzu/configuration/configure_web.ui @@ -55,11 +55,7 @@ </widget> </item> <item row="0" column="1" colspan="3"> - <widget class="QLineEdit" name="edit_username"> - <property name="maxLength"> - <number>36</number> - </property> - </widget> + <widget class="QLabel" name="username" /> </item> <item row="1" column="0"> <widget class="QLabel" name="label_token"> @@ -79,14 +75,10 @@ </property> </widget> </item> - <item row="0" column="4"> - <widget class="QLabel" name="label_username_verified"> - </widget> - </item> <item row="1" column="1" colspan="3"> <widget class="QLineEdit" name="edit_token"> <property name="maxLength"> - <number>36</number> + <number>80</number> </property> <property name="echoMode"> <enum>QLineEdit::Password</enum> diff --git a/src/yuzu/debugger/graphics/graphics_breakpoint_observer.cpp b/src/yuzu/debugger/graphics/graphics_breakpoint_observer.cpp deleted file mode 100644 index 5f459ccfb..000000000 --- a/src/yuzu/debugger/graphics/graphics_breakpoint_observer.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include <QMetaType> -#include "yuzu/debugger/graphics/graphics_breakpoint_observer.h" - -BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr<Tegra::DebugContext> debug_context, - const QString& title, QWidget* parent) - : QDockWidget(title, parent), BreakPointObserver(debug_context) { - qRegisterMetaType<Tegra::DebugContext::Event>("Tegra::DebugContext::Event"); - - connect(this, &BreakPointObserverDock::Resumed, this, &BreakPointObserverDock::OnResumed); - - // NOTE: This signal is emitted from a non-GUI thread, but connect() takes - // care of delaying its handling to the GUI thread. - connect(this, &BreakPointObserverDock::BreakPointHit, this, - &BreakPointObserverDock::OnBreakPointHit, Qt::BlockingQueuedConnection); -} - -void BreakPointObserverDock::OnMaxwellBreakPointHit(Tegra::DebugContext::Event event, void* data) { - emit BreakPointHit(event, data); -} - -void BreakPointObserverDock::OnMaxwellResume() { - emit Resumed(); -} diff --git a/src/yuzu/debugger/graphics/graphics_breakpoint_observer.h b/src/yuzu/debugger/graphics/graphics_breakpoint_observer.h deleted file mode 100644 index ab32f0115..000000000 --- a/src/yuzu/debugger/graphics/graphics_breakpoint_observer.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <QDockWidget> -#include "video_core/debug_utils/debug_utils.h" - -/** - * Utility class which forwards calls to OnMaxwellBreakPointHit and OnMaxwellResume to public slots. - * This is because the Maxwell breakpoint callbacks are called from a non-GUI thread, while - * the widget usually wants to perform reactions in the GUI thread. - */ -class BreakPointObserverDock : public QDockWidget, - protected Tegra::DebugContext::BreakPointObserver { - Q_OBJECT - -public: - BreakPointObserverDock(std::shared_ptr<Tegra::DebugContext> debug_context, const QString& title, - QWidget* parent = nullptr); - - void OnMaxwellBreakPointHit(Tegra::DebugContext::Event event, void* data) override; - void OnMaxwellResume() override; - -signals: - void Resumed(); - void BreakPointHit(Tegra::DebugContext::Event event, void* data); - -private: - virtual void OnBreakPointHit(Tegra::DebugContext::Event event, void* data) = 0; - virtual void OnResumed() = 0; -}; diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp b/src/yuzu/debugger/graphics/graphics_breakpoints.cpp deleted file mode 100644 index 1c80082a4..000000000 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.cpp +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include <QLabel> -#include <QMetaType> -#include <QPushButton> -#include <QTreeView> -#include <QVBoxLayout> -#include "common/assert.h" -#include "yuzu/debugger/graphics/graphics_breakpoints.h" -#include "yuzu/debugger/graphics/graphics_breakpoints_p.h" - -BreakPointModel::BreakPointModel(std::shared_ptr<Tegra::DebugContext> debug_context, - QObject* parent) - : QAbstractListModel(parent), context_weak(debug_context), - at_breakpoint(debug_context->at_breakpoint), - active_breakpoint(debug_context->active_breakpoint) {} - -int BreakPointModel::columnCount(const QModelIndex& parent) const { - return 1; -} - -int BreakPointModel::rowCount(const QModelIndex& parent) const { - return static_cast<int>(Tegra::DebugContext::Event::NumEvents); -} - -QVariant BreakPointModel::data(const QModelIndex& index, int role) const { - const auto event = static_cast<Tegra::DebugContext::Event>(index.row()); - - switch (role) { - case Qt::DisplayRole: { - if (index.column() == 0) { - return DebugContextEventToString(event); - } - break; - } - - case Qt::CheckStateRole: { - if (index.column() == 0) - return data(index, Role_IsEnabled).toBool() ? Qt::Checked : Qt::Unchecked; - break; - } - - case Qt::BackgroundRole: { - if (at_breakpoint && index.row() == static_cast<int>(active_breakpoint)) { - return QBrush(QColor(0xE0, 0xE0, 0x10)); - } - break; - } - - case Role_IsEnabled: { - auto context = context_weak.lock(); - return context && context->breakpoints[(int)event].enabled; - } - - default: - break; - } - return QVariant(); -} - -Qt::ItemFlags BreakPointModel::flags(const QModelIndex& index) const { - if (!index.isValid()) - return 0; - - Qt::ItemFlags flags = Qt::ItemIsEnabled; - if (index.column() == 0) - flags |= Qt::ItemIsUserCheckable; - return flags; -} - -bool BreakPointModel::setData(const QModelIndex& index, const QVariant& value, int role) { - const auto event = static_cast<Tegra::DebugContext::Event>(index.row()); - - switch (role) { - case Qt::CheckStateRole: { - if (index.column() != 0) - return false; - - auto context = context_weak.lock(); - if (!context) - return false; - - context->breakpoints[(int)event].enabled = value == Qt::Checked; - QModelIndex changed_index = createIndex(index.row(), 0); - emit dataChanged(changed_index, changed_index); - return true; - } - } - - return false; -} - -void BreakPointModel::OnBreakPointHit(Tegra::DebugContext::Event event) { - auto context = context_weak.lock(); - if (!context) - return; - - active_breakpoint = context->active_breakpoint; - at_breakpoint = context->at_breakpoint; - emit dataChanged(createIndex(static_cast<int>(event), 0), - createIndex(static_cast<int>(event), 0)); -} - -void BreakPointModel::OnResumed() { - auto context = context_weak.lock(); - if (!context) - return; - - at_breakpoint = context->at_breakpoint; - emit dataChanged(createIndex(static_cast<int>(active_breakpoint), 0), - createIndex(static_cast<int>(active_breakpoint), 0)); - active_breakpoint = context->active_breakpoint; -} - -QString BreakPointModel::DebugContextEventToString(Tegra::DebugContext::Event event) { - switch (event) { - case Tegra::DebugContext::Event::MaxwellCommandLoaded: - return tr("Maxwell command loaded"); - case Tegra::DebugContext::Event::MaxwellCommandProcessed: - return tr("Maxwell command processed"); - case Tegra::DebugContext::Event::IncomingPrimitiveBatch: - return tr("Incoming primitive batch"); - case Tegra::DebugContext::Event::FinishedPrimitiveBatch: - return tr("Finished primitive batch"); - case Tegra::DebugContext::Event::NumEvents: - break; - } - - return tr("Unknown debug context event"); -} - -GraphicsBreakPointsWidget::GraphicsBreakPointsWidget( - std::shared_ptr<Tegra::DebugContext> debug_context, QWidget* parent) - : QDockWidget(tr("Maxwell Breakpoints"), parent), Tegra::DebugContext::BreakPointObserver( - debug_context) { - setObjectName(QStringLiteral("TegraBreakPointsWidget")); - - status_text = new QLabel(tr("Emulation running")); - resume_button = new QPushButton(tr("Resume")); - resume_button->setEnabled(false); - - breakpoint_model = new BreakPointModel(debug_context, this); - breakpoint_list = new QTreeView; - breakpoint_list->setRootIsDecorated(false); - breakpoint_list->setHeaderHidden(true); - breakpoint_list->setModel(breakpoint_model); - - qRegisterMetaType<Tegra::DebugContext::Event>("Tegra::DebugContext::Event"); - - connect(breakpoint_list, &QTreeView::doubleClicked, this, - &GraphicsBreakPointsWidget::OnItemDoubleClicked); - - connect(resume_button, &QPushButton::clicked, this, - &GraphicsBreakPointsWidget::OnResumeRequested); - - connect(this, &GraphicsBreakPointsWidget::BreakPointHit, this, - &GraphicsBreakPointsWidget::OnBreakPointHit, Qt::BlockingQueuedConnection); - connect(this, &GraphicsBreakPointsWidget::Resumed, this, &GraphicsBreakPointsWidget::OnResumed); - - connect(this, &GraphicsBreakPointsWidget::BreakPointHit, breakpoint_model, - &BreakPointModel::OnBreakPointHit, Qt::BlockingQueuedConnection); - connect(this, &GraphicsBreakPointsWidget::Resumed, breakpoint_model, - &BreakPointModel::OnResumed); - - connect(this, &GraphicsBreakPointsWidget::BreakPointsChanged, - [this](const QModelIndex& top_left, const QModelIndex& bottom_right) { - breakpoint_model->dataChanged(top_left, bottom_right); - }); - - QWidget* main_widget = new QWidget; - auto main_layout = new QVBoxLayout; - { - auto sub_layout = new QHBoxLayout; - sub_layout->addWidget(status_text); - sub_layout->addWidget(resume_button); - main_layout->addLayout(sub_layout); - } - main_layout->addWidget(breakpoint_list); - main_widget->setLayout(main_layout); - - setWidget(main_widget); -} - -void GraphicsBreakPointsWidget::OnMaxwellBreakPointHit(Event event, void* data) { - // Process in GUI thread - emit BreakPointHit(event, data); -} - -void GraphicsBreakPointsWidget::OnBreakPointHit(Tegra::DebugContext::Event event, void* data) { - status_text->setText(tr("Emulation halted at breakpoint")); - resume_button->setEnabled(true); -} - -void GraphicsBreakPointsWidget::OnMaxwellResume() { - // Process in GUI thread - emit Resumed(); -} - -void GraphicsBreakPointsWidget::OnResumed() { - status_text->setText(tr("Emulation running")); - resume_button->setEnabled(false); -} - -void GraphicsBreakPointsWidget::OnResumeRequested() { - if (auto context = context_weak.lock()) - context->Resume(); -} - -void GraphicsBreakPointsWidget::OnItemDoubleClicked(const QModelIndex& index) { - if (!index.isValid()) - return; - - QModelIndex check_index = breakpoint_list->model()->index(index.row(), 0); - QVariant enabled = breakpoint_list->model()->data(check_index, Qt::CheckStateRole); - QVariant new_state = Qt::Unchecked; - if (enabled == Qt::Unchecked) - new_state = Qt::Checked; - breakpoint_list->model()->setData(check_index, new_state, Qt::CheckStateRole); -} diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints.h b/src/yuzu/debugger/graphics/graphics_breakpoints.h deleted file mode 100644 index a920a2ae5..000000000 --- a/src/yuzu/debugger/graphics/graphics_breakpoints.h +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <memory> -#include <QDockWidget> -#include "video_core/debug_utils/debug_utils.h" - -class QLabel; -class QPushButton; -class QTreeView; - -class BreakPointModel; - -class GraphicsBreakPointsWidget : public QDockWidget, Tegra::DebugContext::BreakPointObserver { - Q_OBJECT - - using Event = Tegra::DebugContext::Event; - -public: - explicit GraphicsBreakPointsWidget(std::shared_ptr<Tegra::DebugContext> debug_context, - QWidget* parent = nullptr); - - void OnMaxwellBreakPointHit(Tegra::DebugContext::Event event, void* data) override; - void OnMaxwellResume() override; - -signals: - void Resumed(); - void BreakPointHit(Tegra::DebugContext::Event event, void* data); - void BreakPointsChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); - -private: - void OnBreakPointHit(Tegra::DebugContext::Event event, void* data); - void OnItemDoubleClicked(const QModelIndex&); - void OnResumeRequested(); - void OnResumed(); - - QLabel* status_text; - QPushButton* resume_button; - - BreakPointModel* breakpoint_model; - QTreeView* breakpoint_list; -}; diff --git a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h b/src/yuzu/debugger/graphics/graphics_breakpoints_p.h deleted file mode 100644 index fb488e38f..000000000 --- a/src/yuzu/debugger/graphics/graphics_breakpoints_p.h +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 Citra Emulator Project -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <memory> -#include <QAbstractListModel> -#include "video_core/debug_utils/debug_utils.h" - -class BreakPointModel : public QAbstractListModel { - Q_OBJECT - -public: - enum { - Role_IsEnabled = Qt::UserRole, - }; - - BreakPointModel(std::shared_ptr<Tegra::DebugContext> context, QObject* parent); - - int columnCount(const QModelIndex& parent = QModelIndex()) const override; - int rowCount(const QModelIndex& parent = QModelIndex()) const override; - QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - Qt::ItemFlags flags(const QModelIndex& index) const override; - - bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; - - void OnBreakPointHit(Tegra::DebugContext::Event event); - void OnResumed(); - -private: - static QString DebugContextEventToString(Tegra::DebugContext::Event event); - - std::weak_ptr<Tegra::DebugContext> context_weak; - bool at_breakpoint; - Tegra::DebugContext::Event active_breakpoint; -}; diff --git a/src/yuzu/debugger/wait_tree.cpp b/src/yuzu/debugger/wait_tree.cpp index 188f798c0..727bd8a94 100644 --- a/src/yuzu/debugger/wait_tree.cpp +++ b/src/yuzu/debugger/wait_tree.cpp @@ -57,7 +57,7 @@ std::size_t WaitTreeItem::Row() const { std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList() { std::vector<std::unique_ptr<WaitTreeThread>> item_list; std::size_t row = 0; - auto add_threads = [&](const std::vector<Kernel::SharedPtr<Kernel::Thread>>& threads) { + auto add_threads = [&](const std::vector<std::shared_ptr<Kernel::Thread>>& threads) { for (std::size_t i = 0; i < threads.size(); ++i) { item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i])); item_list.back()->row = row; @@ -80,7 +80,7 @@ QString WaitTreeText::GetText() const { WaitTreeMutexInfo::WaitTreeMutexInfo(VAddr mutex_address, const Kernel::HandleTable& handle_table) : mutex_address(mutex_address) { - mutex_value = Memory::Read32(mutex_address); + mutex_value = Core::System::GetInstance().Memory().Read32(mutex_address); owner_handle = static_cast<Kernel::Handle>(mutex_value & Kernel::Mutex::MutexOwnerMask); owner = handle_table.Get<Kernel::Thread>(owner_handle); } @@ -115,10 +115,11 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons std::vector<std::unique_ptr<WaitTreeItem>> list; constexpr std::size_t BaseRegister = 29; + auto& memory = Core::System::GetInstance().Memory(); u64 base_pointer = thread.GetContext().cpu_registers[BaseRegister]; while (base_pointer != 0) { - const u64 lr = Memory::Read64(base_pointer + sizeof(u64)); + const u64 lr = memory.Read64(base_pointer + sizeof(u64)); if (lr == 0) { break; } @@ -126,7 +127,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeCallstack::GetChildren() cons list.push_back(std::make_unique<WaitTreeText>( tr("0x%1").arg(lr - sizeof(u32), 16, 16, QLatin1Char{'0'}))); - base_pointer = Memory::Read64(base_pointer); + base_pointer = memory.Read64(base_pointer); } return list; @@ -172,8 +173,8 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeWaitObject::GetChildren() con return list; } -WaitTreeObjectList::WaitTreeObjectList( - const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, bool w_all) +WaitTreeObjectList::WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::WaitObject>>& list, + bool w_all) : object_list(list), wait_all(w_all) {} WaitTreeObjectList::~WaitTreeObjectList() = default; @@ -325,7 +326,7 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const { WaitTreeEvent::WaitTreeEvent(const Kernel::ReadableEvent& object) : WaitTreeWaitObject(object) {} WaitTreeEvent::~WaitTreeEvent() = default; -WaitTreeThreadList::WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list) +WaitTreeThreadList::WaitTreeThreadList(const std::vector<std::shared_ptr<Kernel::Thread>>& list) : thread_list(list) {} WaitTreeThreadList::~WaitTreeThreadList() = default; diff --git a/src/yuzu/debugger/wait_tree.h b/src/yuzu/debugger/wait_tree.h index f2b13be24..631274a5f 100644 --- a/src/yuzu/debugger/wait_tree.h +++ b/src/yuzu/debugger/wait_tree.h @@ -83,7 +83,7 @@ private: VAddr mutex_address; u32 mutex_value; Kernel::Handle owner_handle; - Kernel::SharedPtr<Kernel::Thread> owner; + std::shared_ptr<Kernel::Thread> owner; }; class WaitTreeCallstack : public WaitTreeExpandableItem { @@ -116,15 +116,14 @@ protected: class WaitTreeObjectList : public WaitTreeExpandableItem { Q_OBJECT public: - WaitTreeObjectList(const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& list, - bool wait_all); + WaitTreeObjectList(const std::vector<std::shared_ptr<Kernel::WaitObject>>& list, bool wait_all); ~WaitTreeObjectList() override; QString GetText() const override; std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; private: - const std::vector<Kernel::SharedPtr<Kernel::WaitObject>>& object_list; + const std::vector<std::shared_ptr<Kernel::WaitObject>>& object_list; bool wait_all; }; @@ -149,14 +148,14 @@ public: class WaitTreeThreadList : public WaitTreeExpandableItem { Q_OBJECT public: - explicit WaitTreeThreadList(const std::vector<Kernel::SharedPtr<Kernel::Thread>>& list); + explicit WaitTreeThreadList(const std::vector<std::shared_ptr<Kernel::Thread>>& list); ~WaitTreeThreadList() override; QString GetText() const override; std::vector<std::unique_ptr<WaitTreeItem>> GetChildren() const override; private: - const std::vector<Kernel::SharedPtr<Kernel::Thread>>& thread_list; + const std::vector<std::shared_ptr<Kernel::Thread>>& thread_list; }; class WaitTreeModel : public QAbstractItemModel { diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 160613ee1..b21fbf826 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -93,7 +93,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "core/perf_stats.h" #include "core/settings.h" #include "core/telemetry_session.h" -#include "video_core/debug_utils/debug_utils.h" #include "yuzu/about_dialog.h" #include "yuzu/bootmanager.h" #include "yuzu/compatdb.h" @@ -101,7 +100,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_dialog.h" #include "yuzu/debugger/console.h" -#include "yuzu/debugger/graphics/graphics_breakpoints.h" #include "yuzu/debugger/profiler.h" #include "yuzu/debugger/wait_tree.h" #include "yuzu/discord.h" @@ -187,8 +185,6 @@ GMainWindow::GMainWindow() provider(std::make_unique<FileSys::ManualContentProvider>()) { InitializeLogging(); - debug_context = Tegra::DebugContext::Construct(); - setAcceptDrops(true); ui.setupUi(this); statusBar()->hide(); @@ -495,11 +491,6 @@ void GMainWindow::InitializeDebugWidgets() { debug_menu->addAction(microProfileDialog->toggleViewAction()); #endif - graphicsBreakpointsWidget = new GraphicsBreakPointsWidget(debug_context, this); - addDockWidget(Qt::RightDockWidgetArea, graphicsBreakpointsWidget); - graphicsBreakpointsWidget->hide(); - debug_menu->addAction(graphicsBreakpointsWidget->toggleViewAction()); - waitTreeWidget = new WaitTreeWidget(this); addDockWidget(Qt::LeftDockWidgetArea, waitTreeWidget); waitTreeWidget->hide(); @@ -817,6 +808,9 @@ QStringList GMainWindow::GetUnsupportedGLExtensions() { if (!GLAD_GL_ARB_multi_bind) { unsupported_ext.append(QStringLiteral("ARB_multi_bind")); } + if (!GLAD_GL_ARB_clip_control) { + unsupported_ext.append(QStringLiteral("ARB_clip_control")); + } // Extensions required to support some texture formats. if (!GLAD_GL_EXT_texture_compression_s3tc) { @@ -866,8 +860,6 @@ bool GMainWindow::LoadROM(const QString& filename) { Core::System& system{Core::System::GetInstance()}; system.SetFilesystem(vfs); - system.SetGPUDebugContext(debug_context); - system.SetAppletFrontendSet({ nullptr, // Parental Controls std::make_unique<QtErrorDisplay>(*this), // diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 7f46bea2b..a56f9a981 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -22,7 +22,6 @@ class Config; class EmuThread; class GameList; class GImageInfo; -class GraphicsBreakPointsWidget; class GRenderWindow; class LoadingScreen; class MicroProfileDialog; @@ -42,10 +41,6 @@ class ManualContentProvider; class VfsFilesystem; } // namespace FileSys -namespace Tegra { -class DebugContext; -} - enum class EmulatedDirectoryTarget { NAND, SDMC, @@ -223,8 +218,6 @@ private: Ui::MainWindow ui; - std::shared_ptr<Tegra::DebugContext> debug_context; - GRenderWindow* render_window; GameList* game_list; LoadingScreen* loading_screen; @@ -255,7 +248,6 @@ private: // Debugger panes ProfilerWidget* profilerWidget; MicroProfileDialog* microProfileDialog; - GraphicsBreakPointsWidget* graphicsBreakpointsWidget; WaitTreeWidget* waitTreeWidget; QAction* actions_recent_files[max_recent_files_item]; diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index a1ce3c0c3..21f422500 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -140,11 +140,6 @@ <string>Load Folder...</string> </property> </action> - <action name="action_Load_Symbol_Map"> - <property name="text"> - <string>Load Symbol Map...</string> - </property> - </action> <action name="action_Exit"> <property name="text"> <string>E&xit</string> @@ -221,14 +216,6 @@ <string>Show Status Bar</string> </property> </action> - <action name="action_Select_Game_List_Root"> - <property name="text"> - <string>Select Game Directory...</string> - </property> - <property name="toolTip"> - <string>Selects a folder to display in the game list</string> - </property> - </action> <action name="action_Select_NAND_Directory"> <property name="text"> <string>Select NAND Directory...</string> |
