early-access version 1368

This commit is contained in:
pineappleEA 2021-01-24 11:42:13 +01:00
parent f9c0a5a412
commit ab51cd958f
4 changed files with 39 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 1367. This is the source code for early-access 1368.
## Legal Notice ## Legal Notice

View file

@ -54,7 +54,7 @@ foreach(FILENAME IN ITEMS ${SHADER_FILES})
OUTPUT OUTPUT
${SPIRV_HEADER_FILE} ${SPIRV_HEADER_FILE}
COMMAND COMMAND
${GLSLANGVALIDATOR} -V ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE} ${GLSLANGVALIDATOR} -V --quiet ${GLSL_FLAGS} --variable-name ${SPIRV_VARIABLE_NAME} -o ${SPIRV_HEADER_FILE} ${SOURCE_FILE}
MAIN_DEPENDENCY MAIN_DEPENDENCY
${SOURCE_FILE} ${SOURCE_FILE}
) )

View file

@ -190,12 +190,16 @@ void ConfigureInput::ApplyConfiguration() {
// This emulates a delay between disconnecting and reconnecting controllers as some games // This emulates a delay between disconnecting and reconnecting controllers as some games
// do not respond to a change in controller type if it was instantaneous. // do not respond to a change in controller type if it was instantaneous.
using namespace std::chrono_literals; using namespace std::chrono_literals;
std::this_thread::sleep_for(60ms); std::this_thread::sleep_for(150ms);
for (auto* controller : player_controllers) { for (auto* controller : player_controllers) {
controller->TryConnectSelectedController(); controller->TryConnectSelectedController();
} }
// This emulates a delay between disconnecting and reconnecting controllers as some games
// do not respond to a change in controller type if it was instantaneous.
std::this_thread::sleep_for(150ms);
advanced->ApplyConfiguration(); advanced->ApplyConfiguration();
const bool pre_docked_mode = Settings::values.use_docked_mode.GetValue(); const bool pre_docked_mode = Settings::values.use_docked_mode.GetValue();

View file

@ -589,11 +589,11 @@ void ConfigureInputPlayer::ApplyConfiguration() {
// Apply configuration for handheld // Apply configuration for handheld
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;
if (player.controller_type == Settings::ControllerType::Handheld) { if (player.controller_type == Settings::ControllerType::Handheld) {
handheld = player; handheld = player;
} }
handheld.connected = ui->groupConnectedController->isChecked() && handheld.connected = handheld_connected;
player.controller_type == Settings::ControllerType::Handheld;
} }
} }
@ -605,6 +605,18 @@ void ConfigureInputPlayer::TryConnectSelectedController() {
const auto player_connected = ui->groupConnectedController->isChecked() && const auto player_connected = ui->groupConnectedController->isChecked() &&
controller_type != Settings::ControllerType::Handheld; controller_type != Settings::ControllerType::Handheld;
// Connect Handheld depending on Player 1's controller configuration.
if (player_index == 0 && controller_type == Settings::ControllerType::Handheld) {
auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
const auto handheld_connected = ui->groupConnectedController->isChecked() &&
controller_type == Settings::ControllerType::Handheld;
// Connect only if handheld is going from disconnected to connected
if (!handheld.connected && handheld_connected) {
UpdateController(controller_type, HANDHELD_INDEX, true);
}
handheld.connected = handheld_connected;
}
if (player.controller_type == controller_type && player.connected == player_connected) { if (player.controller_type == controller_type && player.connected == player_connected) {
// Set vibration devices in the event that the input device has changed. // Set vibration devices in the event that the input device has changed.
ConfigureVibration::SetVibrationDevices(player_index); ConfigureVibration::SetVibrationDevices(player_index);
@ -616,22 +628,11 @@ void ConfigureInputPlayer::TryConnectSelectedController() {
ConfigureVibration::SetVibrationDevices(player_index); ConfigureVibration::SetVibrationDevices(player_index);
// Connect/Disconnect Handheld depending on Player 1's controller configuration.
if (player_index == 0) {
auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
if (controller_type == Settings::ControllerType::Handheld) {
handheld = player;
}
handheld.connected = ui->groupConnectedController->isChecked() &&
controller_type == Settings::ControllerType::Handheld;
UpdateController(Settings::ControllerType::Handheld, HANDHELD_INDEX, handheld.connected);
}
if (!player.connected) { if (!player.connected) {
return; return;
} }
UpdateController(controller_type, player_index, player_connected); UpdateController(controller_type, player_index, true);
} }
void ConfigureInputPlayer::TryDisconnectSelectedController() { void ConfigureInputPlayer::TryDisconnectSelectedController() {
@ -642,11 +643,28 @@ void ConfigureInputPlayer::TryDisconnectSelectedController() {
const auto player_connected = ui->groupConnectedController->isChecked() && const auto player_connected = ui->groupConnectedController->isChecked() &&
controller_type != Settings::ControllerType::Handheld; controller_type != Settings::ControllerType::Handheld;
// Disconnect Handheld depending on Player 1's controller configuration.
if (player_index == 0 && player.controller_type == Settings::ControllerType::Handheld) {
const auto& handheld = Settings::values.players.GetValue()[HANDHELD_INDEX];
const auto handheld_connected = ui->groupConnectedController->isChecked() &&
controller_type == Settings::ControllerType::Handheld;
// Disconnect only if handheld is going from connected to disconnected
if (handheld.connected && !handheld_connected) {
UpdateController(controller_type, HANDHELD_INDEX, false);
}
return;
}
// Do not do anything if the controller configuration has not changed. // Do not do anything if the controller configuration has not changed.
if (player.controller_type == controller_type && player.connected == player_connected) { if (player.controller_type == controller_type && player.connected == player_connected) {
return; return;
} }
// Do not disconnect if the controller is already disconnected
if (!player.connected) {
return;
}
// Disconnect the controller first. // Disconnect the controller first.
UpdateController(controller_type, player_index, false); UpdateController(controller_type, player_index, false);
} }