early-access version 2188

This commit is contained in:
pineappleEA
2021-11-05 16:31:40 +01:00
parent 5f43bc959e
commit c0d328a7bf
64 changed files with 172 additions and 184 deletions
+1 -3
View File
@@ -27,13 +27,11 @@
#include "common/assert.h"
#include "common/microprofile.h"
#include "common/param_package.h"
#include "common/scm_rev.h"
#include "common/scope_exit.h"
#include "common/settings.h"
#include "core/core.h"
#include "core/frontend/framebuffer_layout.h"
#include "core/hle/kernel/k_process.h"
#include "input_common/drivers/keyboard.h"
#include "input_common/drivers/mouse.h"
#include "input_common/drivers/tas_input.h"
@@ -68,7 +66,7 @@ void EmuThread::run() {
if (Settings::values.use_disk_shader_cache.GetValue()) {
system.Renderer().ReadRasterizer()->LoadDiskResources(
system.CurrentProcess()->GetTitleID(), stop_token,
system.GetCurrentProcessProgramID(), stop_token,
[this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
emit LoadProgress(stage, value, total);
});
@@ -2,17 +2,18 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/core.h"
#include "core/hid/hid_core.h"
#include "ui_configure_debug_controller.h"
#include "yuzu/configuration/configure_debug_controller.h"
#include "yuzu/configuration/configure_input_player.h"
ConfigureDebugController::ConfigureDebugController(QWidget* parent,
InputCommon::InputSubsystem* input_subsystem,
InputProfiles* profiles, Core::System& system)
InputProfiles* profiles,
Core::HID::HIDCore& hid_core, bool is_powered_on)
: QDialog(parent), ui(std::make_unique<Ui::ConfigureDebugController>()),
debug_controller(
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, system, true)) {
debug_controller(new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles,
hid_core, is_powered_on, true)) {
ui->setupUi(this);
ui->controllerLayout->addWidget(debug_controller);
@@ -13,8 +13,8 @@ class ConfigureInputPlayer;
class InputProfiles;
namespace Core {
class System;
namespace Core::HID {
class HIDCore;
}
namespace InputCommon {
@@ -30,7 +30,8 @@ class ConfigureDebugController : public QDialog {
public:
explicit ConfigureDebugController(QWidget* parent, InputCommon::InputSubsystem* input_subsystem,
InputProfiles* profiles, Core::System& system);
InputProfiles* profiles, Core::HID::HIDCore& hid_core,
bool is_powered_on);
~ConfigureDebugController() override;
void ApplyConfiguration();
+1 -1
View File
@@ -74,7 +74,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
hotkeys_tab->Populate(registry);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
input_tab->Initialize(input_subsystem, system_);
input_tab->Initialize(input_subsystem);
general_tab->SetResetCallback([&] { this->close(); });
+17 -12
View File
@@ -10,6 +10,8 @@
#include <QTimer>
#include "core/core.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/applet_ae.h"
#include "core/hle/service/am/applet_oe.h"
@@ -73,25 +75,27 @@ ConfigureInput::ConfigureInput(Core::System& system_, QWidget* parent)
ConfigureInput::~ConfigureInput() = default;
void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem, Core::System& system,
void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem,
std::size_t max_players) {
const bool is_powered_on = system.IsPoweredOn();
auto& hid_core = system.HIDCore();
player_controllers = {
new ConfigureInputPlayer(this, 0, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 1, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 2, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 3, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 4, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 5, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 6, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
new ConfigureInputPlayer(this, 7, ui->consoleInputSettings, input_subsystem, profiles.get(),
system),
hid_core, is_powered_on),
};
player_tabs = {
@@ -147,10 +151,11 @@ void ConfigureInput::Initialize(InputCommon::InputSubsystem* input_subsystem, Co
advanced = new ConfigureInputAdvanced(this);
ui->tabAdvanced->setLayout(new QHBoxLayout(ui->tabAdvanced));
ui->tabAdvanced->layout()->addWidget(advanced);
connect(advanced, &ConfigureInputAdvanced::CallDebugControllerDialog,
[this, input_subsystem, &system] {
CallConfigureDialog<ConfigureDebugController>(*this, input_subsystem,
profiles.get(), system);
[this, input_subsystem, &hid_core, is_powered_on] {
CallConfigureDialog<ConfigureDebugController>(
*this, input_subsystem, profiles.get(), hid_core, is_powered_on);
});
connect(advanced, &ConfigureInputAdvanced::CallMouseConfigDialog, [this, input_subsystem] {
CallConfigureDialog<ConfigureMouseAdvanced>(*this, input_subsystem);
+1 -2
View File
@@ -42,8 +42,7 @@ public:
~ConfigureInput() override;
/// Initializes the input dialog with the given input subsystem.
void Initialize(InputCommon::InputSubsystem* input_subsystem_, Core::System& system,
std::size_t max_players = 8);
void Initialize(InputCommon::InputSubsystem* input_subsystem_, std::size_t max_players = 8);
/// Save all button configurations to settings file.
void ApplyConfiguration();
@@ -12,7 +12,6 @@
#include <QMessageBox>
#include <QTimer>
#include "common/param_package.h"
#include "core/core.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "core/hid/hid_types.h"
@@ -134,18 +133,17 @@ QString ConfigureInputPlayer::AnalogToText(const Common::ParamPackage& param,
ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_index,
QWidget* bottom_row,
InputCommon::InputSubsystem* input_subsystem_,
InputProfiles* profiles_, Core::System& system_,
bool debug)
InputProfiles* profiles_, Core::HID::HIDCore& hid_core_,
bool is_powered_on_, bool debug)
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index(player_index),
debug(debug), input_subsystem{input_subsystem_}, profiles(profiles_),
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()),
bottom_row(bottom_row), system{system_} {
debug(debug), is_powered_on{is_powered_on_}, input_subsystem{input_subsystem_},
profiles(profiles_), timeout_timer(std::make_unique<QTimer>()),
poll_timer(std::make_unique<QTimer>()), bottom_row(bottom_row), hid_core{hid_core_} {
if (player_index == 0) {
auto* emulated_controller_p1 =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* emulated_controller_hanheld =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
emulated_controller_p1->SaveCurrentConfig();
emulated_controller_p1->EnableConfiguration();
emulated_controller_hanheld->SaveCurrentConfig();
@@ -157,7 +155,7 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
emulated_controller = emulated_controller_p1;
}
} else {
emulated_controller = system_.HIDCore().GetEmulatedControllerByIndex(player_index);
emulated_controller = hid_core.GetEmulatedControllerByIndex(player_index);
emulated_controller->SaveCurrentConfig();
emulated_controller->EnableConfiguration();
}
@@ -487,9 +485,9 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
if (player_index == 0) {
auto* emulated_controller_p1 =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* emulated_controller_hanheld =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
bool is_connected = emulated_controller->IsConnected(true);
emulated_controller_p1->SetNpadStyleIndex(type);
@@ -547,9 +545,9 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
ConfigureInputPlayer::~ConfigureInputPlayer() {
if (player_index == 0) {
auto* emulated_controller_p1 =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* emulated_controller_hanheld =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
emulated_controller_p1->DisableConfiguration();
emulated_controller_hanheld->DisableConfiguration();
} else {
@@ -560,9 +558,9 @@ ConfigureInputPlayer::~ConfigureInputPlayer() {
void ConfigureInputPlayer::ApplyConfiguration() {
if (player_index == 0) {
auto* emulated_controller_p1 =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* emulated_controller_hanheld =
system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
emulated_controller_p1->DisableConfiguration();
emulated_controller_p1->SaveCurrentConfig();
emulated_controller_p1->EnableConfiguration();
@@ -846,12 +844,11 @@ void ConfigureInputPlayer::SetConnectableControllers() {
}
};
if (!system.IsPoweredOn()) {
if (!is_powered_on) {
add_controllers(true);
return;
}
add_controllers(false, system.HIDCore().GetSupportedStyleTag());
add_controllers(false, hid_core.GetSupportedStyleTag());
}
Core::HID::NpadStyleIndex ConfigureInputPlayer::GetControllerTypeFromIndex(int index) const {
@@ -29,10 +29,6 @@ class QWidget;
class InputProfiles;
namespace Core {
class System;
}
namespace InputCommon {
class InputSubsystem;
}
@@ -45,11 +41,8 @@ namespace Ui {
class ConfigureInputPlayer;
}
namespace Core {
class System;
}
namespace Core::HID {
class HIDCore;
class EmulatedController;
enum class NpadStyleIndex : u8;
} // namespace Core::HID
@@ -60,8 +53,8 @@ class ConfigureInputPlayer : public QWidget {
public:
explicit ConfigureInputPlayer(QWidget* parent, std::size_t player_index, QWidget* bottom_row,
InputCommon::InputSubsystem* input_subsystem_,
InputProfiles* profiles_, Core::System& system_,
bool debug = false);
InputProfiles* profiles_, Core::HID::HIDCore& hid_core_,
bool is_powered_on_, bool debug = false);
~ConfigureInputPlayer() override;
/// Save all button configurations to settings file.
@@ -173,6 +166,7 @@ private:
std::size_t player_index;
bool debug;
bool is_powered_on;
InputCommon::InputSubsystem* input_subsystem;
@@ -228,5 +222,5 @@ private:
/// parent of the widget to this widget (but thats fine).
QWidget* bottom_row;
Core::System& system;
Core::HID::HIDCore& hid_core;
};
@@ -6,7 +6,8 @@
#include <QMenu>
#include <QPainter>
#include <QTimer>
#include "core/core.h"
#include "core/hid/emulated_controller.h"
#include "yuzu/configuration/configure_input_player_widget.h"
PlayerControlPreview::PlayerControlPreview(QWidget* parent) : QFrame(parent) {
@@ -7,10 +7,10 @@
#include <array>
#include <QFrame>
#include <QPointer>
#include "common/input.h"
#include "common/settings.h"
#include "common/settings_input.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "core/hid/hid_types.h"
class QLabel;
@@ -11,8 +11,8 @@ ConfigureInputProfileDialog::ConfigureInputProfileDialog(
QWidget* parent, InputCommon::InputSubsystem* input_subsystem, InputProfiles* profiles,
Core::System& system)
: QDialog(parent), ui(std::make_unique<Ui::ConfigureInputProfileDialog>()),
profile_widget(
new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles, system, false)) {
profile_widget(new ConfigureInputPlayer(this, 9, nullptr, input_subsystem, profiles,
system.HIDCore(), system.IsPoweredOn(), false)) {
ui->setupUi(this);
ui->controllerLayout->addWidget(profile_widget);
+5 -5
View File
@@ -6,17 +6,17 @@
#include <QLayout>
#include <QString>
#include "common/settings.h"
#include "core/core.h"
#include "core/hid/emulated_controller.h"
#include "core/hid/hid_core.h"
#include "input_common/drivers/tas_input.h"
#include "input_common/main.h"
#include "yuzu/configuration/configure_input_player_widget.h"
#include "yuzu/debugger/controller.h"
ControllerDialog::ControllerDialog(Core::System& system_,
ControllerDialog::ControllerDialog(Core::HID::HIDCore& hid_core_,
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
QWidget* parent)
: QWidget(parent, Qt::Dialog), system{system_}, input_subsystem{input_subsystem_} {
: QWidget(parent, Qt::Dialog), hid_core{hid_core_}, input_subsystem{input_subsystem_} {
setObjectName(QStringLiteral("Controller"));
setWindowTitle(tr("Controller P1"));
resize(500, 350);
@@ -41,8 +41,8 @@ ControllerDialog::ControllerDialog(Core::System& system_,
void ControllerDialog::refreshConfiguration() {
UnloadController();
auto* player_1 = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* handheld = system.HIDCore().GetEmulatedController(Core::HID::NpadIdType::Handheld);
auto* player_1 = hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
auto* handheld = hid_core.GetEmulatedController(Core::HID::NpadIdType::Handheld);
// Display the correct controller
controller = handheld->IsConnected() ? handheld : player_1;
+3 -6
View File
@@ -15,11 +15,8 @@ namespace InputCommon {
class InputSubsystem;
}
namespace Core {
class System;
}
namespace Core::HID {
class HIDCore;
class EmulatedController;
enum class ControllerTriggerType;
} // namespace Core::HID
@@ -28,7 +25,7 @@ class ControllerDialog : public QWidget {
Q_OBJECT
public:
explicit ControllerDialog(Core::System& system_,
explicit ControllerDialog(Core::HID::HIDCore& hid_core_,
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
QWidget* parent = nullptr);
@@ -55,6 +52,6 @@ private:
QAction* toggle_view_action = nullptr;
PlayerControlPreview* widget;
Core::System& system;
Core::HID::HIDCore& hid_core;
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem;
};
+3 -3
View File
@@ -927,7 +927,7 @@ void GMainWindow::InitializeDebugWidgets() {
waitTreeWidget->hide();
debug_menu->addAction(waitTreeWidget->toggleViewAction());
controller_dialog = new ControllerDialog(*system, input_subsystem, this);
controller_dialog = new ControllerDialog(system->HIDCore(), input_subsystem, this);
controller_dialog->hide();
debug_menu->addAction(controller_dialog->toggleViewAction());
@@ -2827,7 +2827,7 @@ void GMainWindow::OnConfigureTas() {
}
void GMainWindow::OnConfigurePerGame() {
const u64 title_id = system->CurrentProcess()->GetTitleID();
const u64 title_id = system->GetCurrentProcessProgramID();
OpenPerGameConfiguration(title_id, game_path.toStdString());
}
@@ -2926,7 +2926,7 @@ void GMainWindow::OnToggleFilterBar() {
}
void GMainWindow::OnCaptureScreenshot() {
const u64 title_id = system->CurrentProcess()->GetTitleID();
const u64 title_id = system->GetCurrentProcessProgramID();
const auto screenshot_path =
QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir));
const auto date =