diff options
Diffstat (limited to '')
-rw-r--r-- | src/common/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/core/hle/service/am/am.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/am/am.h | 1 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 20 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_input.ui | 2 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 17 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 |
7 files changed, 46 insertions, 4 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 73bf626d4..566695fde 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -182,8 +182,9 @@ create_target_directory_groups(common) target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) target_link_libraries(common PRIVATE lz4::lz4 xbyak) -if (MSVC) +if (TARGET zstd::zstd) target_link_libraries(common PRIVATE zstd::zstd) else() - target_link_libraries(common PRIVATE zstd) + target_link_libraries(common PRIVATE + $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>) endif() diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 9c62ebc60..9116dd77c 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -636,6 +636,10 @@ void AppletMessageQueue::RequestExit() { PushMessage(AppletMessage::Exit); } +void AppletMessageQueue::RequestResume() { + PushMessage(AppletMessage::Resume); +} + void AppletMessageQueue::FocusStateChanged() { PushMessage(AppletMessage::FocusStateChanged); } diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 988ead215..53144427b 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h @@ -90,6 +90,7 @@ public: AppletMessage PopMessage(); std::size_t GetMessageCount() const; void RequestExit(); + void RequestResume(); void FocusStateChanged(); void OperationModeChanged(); diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 5114b8be2..3e9dc4a13 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -720,7 +720,25 @@ std::pair<s32, Errno> BSD::RecvImpl(s32 fd, u32 flags, std::vector<u8>& message) if (!IsFileDescriptorValid(fd)) { return {-1, Errno::BADF}; } - return Translate(file_descriptors[fd]->socket->Recv(flags, message)); + + FileDescriptor& descriptor = *file_descriptors[fd]; + + // Apply flags + if ((flags & FLAG_MSG_DONTWAIT) != 0) { + flags &= ~FLAG_MSG_DONTWAIT; + if ((descriptor.flags & FLAG_O_NONBLOCK) == 0) { + descriptor.socket->SetNonBlock(true); + } + } + + const auto [ret, bsd_errno] = Translate(descriptor.socket->Recv(flags, message)); + + // Restore original state + if ((descriptor.flags & FLAG_O_NONBLOCK) == 0) { + descriptor.socket->SetNonBlock(false); + } + + return {ret, bsd_errno}; } std::pair<s32, Errno> BSD::RecvFromImpl(s32 fd, u32 flags, std::vector<u8>& message, diff --git a/src/yuzu/configuration/configure_input.ui b/src/yuzu/configuration/configure_input.ui index 2707025e7..d51774028 100644 --- a/src/yuzu/configuration/configure_input.ui +++ b/src/yuzu/configuration/configure_input.ui @@ -166,7 +166,7 @@ <item> <widget class="QRadioButton" name="radioUndocked"> <property name="text"> - <string>Undocked</string> + <string>Handheld</string> </property> </widget> </item> diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index ed802d329..e60d84054 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1131,6 +1131,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { OnPauseGame(); } else if (!emu_thread->IsRunning() && auto_paused && state == Qt::ApplicationActive) { auto_paused = false; + RequestGameResume(); OnStartGame(); } } @@ -2570,6 +2571,7 @@ void GMainWindow::OnPauseContinueGame() { if (emu_thread->IsRunning()) { OnPauseGame(); } else { + RequestGameResume(); OnStartGame(); } } @@ -3749,6 +3751,21 @@ void GMainWindow::RequestGameExit() { } } +void GMainWindow::RequestGameResume() { + auto& sm{system->ServiceManager()}; + auto applet_oe = sm.GetService<Service::AM::AppletOE>("appletOE"); + auto applet_ae = sm.GetService<Service::AM::AppletAE>("appletAE"); + + if (applet_oe != nullptr) { + applet_oe->GetMessageQueue()->RequestResume(); + return; + } + + if (applet_ae != nullptr) { + applet_ae->GetMessageQueue()->RequestResume(); + } +} + void GMainWindow::filterBarSetChecked(bool state) { ui->action_Show_Filter_Bar->setChecked(state); emit(OnToggleFilterBar()); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 8cf224c9c..09e37f152 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -244,6 +244,7 @@ private: bool ConfirmChangeGame(); bool ConfirmForceLockedExit(); void RequestGameExit(); + void RequestGameResume(); void closeEvent(QCloseEvent* event) override; private slots: |