early-access version 1411

This commit is contained in:
pineappleEA 2021-02-04 03:47:55 +01:00
parent 7023d1239c
commit 228b484ea0
7 changed files with 31 additions and 17 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1410. This is the source code for early-access 1411.
## Legal Notice ## Legal Notice

View file

@ -120,7 +120,7 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
s32 user_value{}; s32 user_value{};
R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1), R_UNLESS(UpdateIfEqual(system, std::addressof(user_value), addr, value, value + 1),
Svc::ResultInvalidCurrentMemory); Svc::ResultInvalidCurrentMemory);
R_UNLESS(user_value == value, Svc::ResultInvalidState); R_UNLESS_NOLOG(user_value == value, Svc::ResultInvalidState);
auto it = thread_tree.nfind_light({addr, -1}); auto it = thread_tree.nfind_light({addr, -1});
while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&

View file

@ -70,10 +70,16 @@ void Mouse::MouseMove(int x, int y, int center_x, int center_y) {
for (MouseInfo& info : mouse_info) { for (MouseInfo& info : mouse_info) {
if (Settings::values.mouse_panning) { if (Settings::values.mouse_panning) {
const auto mouse_change = Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y); const auto mouse_change = Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y);
info.data.axis = {mouse_change.x, -mouse_change.y}; const auto angle = std::atan2(-mouse_change.y, mouse_change.x);
const auto length =
(mouse_change.y * mouse_change.y) + (mouse_change.x * mouse_change.x);
if (mouse_change.x == 0 && mouse_change.y == 0) { info.data.axis = {static_cast<int>(100 * std::cos(angle)),
static_cast<int>(100 * std::sin(angle))};
if (length < 4) {
info.tilt_speed = 0; info.tilt_speed = 0;
info.data.axis = {};
} else { } else {
info.tilt_direction = mouse_change.Cast<float>(); info.tilt_direction = mouse_change.Cast<float>();
info.tilt_speed = info.tilt_direction.Normalize() * info.sensitivity; info.tilt_speed = info.tilt_direction.Normalize() * info.sensitivity;

View file

@ -510,7 +510,7 @@ void Config::ReadControlValues() {
ReadSetting(QStringLiteral("emulate_analog_keyboard"), false).toBool(); ReadSetting(QStringLiteral("emulate_analog_keyboard"), false).toBool();
Settings::values.mouse_panning = ReadSetting(QStringLiteral("mouse_panning"), false).toBool(); Settings::values.mouse_panning = ReadSetting(QStringLiteral("mouse_panning"), false).toBool();
Settings::values.mouse_panning_sensitivity = Settings::values.mouse_panning_sensitivity =
ReadSetting(QStringLiteral("mouse_panning_sensitivity"), 16).toFloat(); ReadSetting(QStringLiteral("mouse_panning_sensitivity"), 1).toFloat();
ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), true); ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), true);
ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"), ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"),
@ -1190,7 +1190,7 @@ void Config::SaveControlValues() {
Settings::values.emulate_analog_keyboard, false); Settings::values.emulate_analog_keyboard, false);
WriteSetting(QStringLiteral("mouse_panning"), Settings::values.mouse_panning, false); WriteSetting(QStringLiteral("mouse_panning"), Settings::values.mouse_panning, false);
WriteSetting(QStringLiteral("mouse_panning_sensitivity"), WriteSetting(QStringLiteral("mouse_panning_sensitivity"),
Settings::values.mouse_panning_sensitivity, 16.0f); Settings::values.mouse_panning_sensitivity, 1.0f);
qt_config->endGroup(); qt_config->endGroup();
} }

View file

@ -2574,23 +2574,26 @@
</item> </item>
<item row="2" column="2"> <item row="2" column="2">
<widget class="QDoubleSpinBox" name="mouse_panning_sensitivity"> <widget class="QDoubleSpinBox" name="mouse_panning_sensitivity">
<property name="toolTip">
<string>Mouse sensitivity</string>
</property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>1</number> <number>2</number>
</property> </property>
<property name="minimum"> <property name="minimum">
<double>0.100000000000000</double> <double>0.100000000000000</double>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>32.000000000000000</double> <double>16.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.100000000000000</double> <double>0.010000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>16.000000000000000</double> <double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>

View file

@ -590,9 +590,7 @@ void ConfigureInputPlayer::ApplyConfiguration() {
if (player_index == 0) { if (player_index == 0) {
auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX]; auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
const auto handheld_connected = handheld.connected; const auto handheld_connected = handheld.connected;
if (player.controller_type == Settings::ControllerType::Handheld) { handheld = player;
handheld = player;
}
handheld.connected = handheld_connected; handheld.connected = handheld_connected;
} }
} }
@ -606,7 +604,7 @@ void ConfigureInputPlayer::TryConnectSelectedController() {
controller_type != Settings::ControllerType::Handheld; controller_type != Settings::ControllerType::Handheld;
// Connect Handheld depending on Player 1's controller configuration. // Connect Handheld depending on Player 1's controller configuration.
if (player_index == 0 && controller_type == Settings::ControllerType::Handheld) { if (player_index == 0) {
auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX]; auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
const auto handheld_connected = ui->groupConnectedController->isChecked() && const auto handheld_connected = ui->groupConnectedController->isChecked() &&
controller_type == Settings::ControllerType::Handheld; controller_type == Settings::ControllerType::Handheld;

View file

@ -852,8 +852,14 @@ void GMainWindow::InitializeHotkeys() {
[] { Settings::values.audio_muted = !Settings::values.audio_muted; }); [] { Settings::values.audio_muted = !Settings::values.audio_muted; });
connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Mouse Panning"), this), connect(hotkey_registry.GetHotkey(main_window, QStringLiteral("Toggle Mouse Panning"), this),
&QShortcut::activated, this, &QShortcut::activated, this, [&] {
[] { Settings::values.mouse_panning = !Settings::values.mouse_panning; }); Settings::values.mouse_panning = !Settings::values.mouse_panning;
if (UISettings::values.hide_mouse || Settings::values.mouse_panning) {
mouse_hide_timer.start();
render_window->installEventFilter(render_window);
render_window->setAttribute(Qt::WA_Hover, true);
}
});
} }
void GMainWindow::SetDefaultUIGeometry() { void GMainWindow::SetDefaultUIGeometry() {
@ -2603,7 +2609,8 @@ void GMainWindow::UpdateUISettings() {
} }
void GMainWindow::HideMouseCursor() { void GMainWindow::HideMouseCursor() {
if (emu_thread == nullptr || UISettings::values.hide_mouse == false) { if (emu_thread == nullptr ||
(!UISettings::values.hide_mouse && !Settings::values.mouse_panning)) {
mouse_hide_timer.stop(); mouse_hide_timer.stop();
ShowMouseCursor(); ShowMouseCursor();
return; return;