diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/audio_core/stream.cpp | 9 | ||||
| -rw-r--r-- | src/common/string_util.cpp | 14 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/olsc/olsc.cpp | 13 | ||||
| -rw-r--r-- | src/video_core/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.cpp | 34 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.h | 2 |
7 files changed, 56 insertions, 28 deletions
diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 5b0b285cd..b0f6f0c34 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp | |||
| @@ -111,7 +111,14 @@ void Stream::PlayNextBuffer(std::chrono::nanoseconds ns_late) { | |||
| 111 | 111 | ||
| 112 | sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); | 112 | sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); |
| 113 | 113 | ||
| 114 | core_timing.ScheduleEvent(GetBufferReleaseNS(*active_buffer) - ns_late, release_event, {}); | 114 | const auto buffer_release_ns = GetBufferReleaseNS(*active_buffer); |
| 115 | |||
| 116 | // If ns_late is higher than the update rate ignore the delay | ||
| 117 | if (ns_late > buffer_release_ns) { | ||
| 118 | ns_late = {}; | ||
| 119 | } | ||
| 120 | |||
| 121 | core_timing.ScheduleEvent(buffer_release_ns - ns_late, release_event, {}); | ||
| 115 | } | 122 | } |
| 116 | 123 | ||
| 117 | void Stream::ReleaseActiveBuffer(std::chrono::nanoseconds ns_late) { | 124 | void Stream::ReleaseActiveBuffer(std::chrono::nanoseconds ns_late) { |
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 4cba2aaa4..7b614ad89 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp | |||
| @@ -141,27 +141,13 @@ std::string ReplaceAll(std::string result, const std::string& src, const std::st | |||
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | std::string UTF16ToUTF8(const std::u16string& input) { | 143 | std::string UTF16ToUTF8(const std::u16string& input) { |
| 144 | #ifdef _MSC_VER | ||
| 145 | // Workaround for missing char16_t/char32_t instantiations in MSVC2017 | ||
| 146 | std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert; | ||
| 147 | std::basic_string<__int16> tmp_buffer(input.cbegin(), input.cend()); | ||
| 148 | return convert.to_bytes(tmp_buffer); | ||
| 149 | #else | ||
| 150 | std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; | 144 | std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; |
| 151 | return convert.to_bytes(input); | 145 | return convert.to_bytes(input); |
| 152 | #endif | ||
| 153 | } | 146 | } |
| 154 | 147 | ||
| 155 | std::u16string UTF8ToUTF16(const std::string& input) { | 148 | std::u16string UTF8ToUTF16(const std::string& input) { |
| 156 | #ifdef _MSC_VER | ||
| 157 | // Workaround for missing char16_t/char32_t instantiations in MSVC2017 | ||
| 158 | std::wstring_convert<std::codecvt_utf8_utf16<__int16>, __int16> convert; | ||
| 159 | auto tmp_buffer = convert.from_bytes(input); | ||
| 160 | return std::u16string(tmp_buffer.cbegin(), tmp_buffer.cend()); | ||
| 161 | #else | ||
| 162 | std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; | 149 | std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> convert; |
| 163 | return convert.from_bytes(input); | 150 | return convert.from_bytes(input); |
| 164 | #endif | ||
| 165 | } | 151 | } |
| 166 | 152 | ||
| 167 | #ifdef _WIN32 | 153 | #ifdef _WIN32 |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 51a010a55..1e2677320 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -110,6 +110,7 @@ void IAppletResource::DeactivateController(HidController controller) { | |||
| 110 | 110 | ||
| 111 | IAppletResource ::~IAppletResource() { | 111 | IAppletResource ::~IAppletResource() { |
| 112 | system.CoreTiming().UnscheduleEvent(pad_update_event, 0); | 112 | system.CoreTiming().UnscheduleEvent(pad_update_event, 0); |
| 113 | system.CoreTiming().UnscheduleEvent(motion_update_event, 0); | ||
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { | 116 | void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 4440135ed..e2ac71fa1 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp | |||
| @@ -17,7 +17,7 @@ public: | |||
| 17 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 18 | {0, &OLSC::Initialize, "Initialize"}, | 18 | {0, &OLSC::Initialize, "Initialize"}, |
| 19 | {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, | 19 | {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, |
| 20 | {13, nullptr, "GetSaveDataBackupSetting"}, | 20 | {13, &OLSC::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"}, |
| 21 | {14, &OLSC::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"}, | 21 | {14, &OLSC::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"}, |
| 22 | {15, nullptr, "SetCustomData"}, | 22 | {15, nullptr, "SetCustomData"}, |
| 23 | {16, nullptr, "DeleteSaveDataBackupSetting"}, | 23 | {16, nullptr, "DeleteSaveDataBackupSetting"}, |
| @@ -52,6 +52,17 @@ private: | |||
| 52 | rb.Push(RESULT_SUCCESS); | 52 | rb.Push(RESULT_SUCCESS); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | void GetSaveDataBackupSetting(Kernel::HLERequestContext& ctx) { | ||
| 56 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); | ||
| 57 | |||
| 58 | // backup_setting is set to 0 since real value is unknown | ||
| 59 | constexpr u64 backup_setting = 0; | ||
| 60 | |||
| 61 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 62 | rb.Push(RESULT_SUCCESS); | ||
| 63 | rb.Push(backup_setting); | ||
| 64 | } | ||
| 65 | |||
| 55 | void SetSaveDataBackupSettingEnabled(Kernel::HLERequestContext& ctx) { | 66 | void SetSaveDataBackupSettingEnabled(Kernel::HLERequestContext& ctx) { |
| 56 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); | 67 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); |
| 57 | 68 | ||
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 2cf95937e..dd4c29ed3 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -271,14 +271,13 @@ create_target_directory_groups(video_core) | |||
| 271 | target_link_libraries(video_core PUBLIC common core) | 271 | target_link_libraries(video_core PUBLIC common core) |
| 272 | target_link_libraries(video_core PRIVATE glad xbyak) | 272 | target_link_libraries(video_core PRIVATE glad xbyak) |
| 273 | 273 | ||
| 274 | if (MSVC) | 274 | if (YUZU_USE_BUNDLED_FFMPEG AND NOT WIN32) |
| 275 | target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) | 275 | add_dependencies(video_core ffmpeg-build) |
| 276 | target_link_libraries(video_core PUBLIC ${FFMPEG_LIBRARY_DIR}/swscale.lib ${FFMPEG_LIBRARY_DIR}/avcodec.lib ${FFMPEG_LIBRARY_DIR}/avutil.lib) | ||
| 277 | else() | ||
| 278 | target_include_directories(video_core PRIVATE ${FFMPEG_INCLUDE_DIR}) | ||
| 279 | target_link_libraries(video_core PRIVATE ${FFMPEG_LIBRARIES}) | ||
| 280 | endif() | 276 | endif() |
| 281 | 277 | ||
| 278 | target_include_directories(video_core PRIVATE ${FFmpeg_INCLUDE_DIR}) | ||
| 279 | target_link_libraries(video_core PRIVATE ${FFmpeg_LIBRARIES}) | ||
| 280 | |||
| 282 | add_dependencies(video_core host_shaders) | 281 | add_dependencies(video_core host_shaders) |
| 283 | target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) | 282 | target_include_directories(video_core PRIVATE ${HOST_SHADERS_INCLUDE}) |
| 284 | target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include) | 283 | target_include_directories(video_core PRIVATE sirit ../../externals/Vulkan-Headers/include) |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index e3e8bde48..e77ccc057 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -699,9 +699,9 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center) | |||
| 699 | { | 699 | { |
| 700 | // Draw joysticks | 700 | // Draw joysticks |
| 701 | using namespace Settings::NativeAnalog; | 701 | using namespace Settings::NativeAnalog; |
| 702 | DrawProJoystick(p, center + QPointF(-111, -55) + (axis_values[LStick].value * 11), | 702 | DrawProJoystick(p, center + QPointF(-111, -55), axis_values[LStick].value, 11, |
| 703 | button_values[Settings::NativeButton::LStick]); | 703 | button_values[Settings::NativeButton::LStick]); |
| 704 | DrawProJoystick(p, center + QPointF(51, 0) + (axis_values[RStick].value * 11), | 704 | DrawProJoystick(p, center + QPointF(51, 0), axis_values[RStick].value, 11, |
| 705 | button_values[Settings::NativeButton::RStick]); | 705 | button_values[Settings::NativeButton::RStick]); |
| 706 | DrawRawJoystick(p, center + QPointF(-50, 105), axis_values[LStick].raw_value, | 706 | DrawRawJoystick(p, center + QPointF(-50, 105), axis_values[LStick].raw_value, |
| 707 | axis_values[LStick].properties); | 707 | axis_values[LStick].properties); |
| @@ -2273,15 +2273,39 @@ void PlayerControlPreview::DrawJoystickSideview(QPainter& p, const QPointF cente | |||
| 2273 | p.drawLine(p2.at(32), p2.at(71)); | 2273 | p.drawLine(p2.at(32), p2.at(71)); |
| 2274 | } | 2274 | } |
| 2275 | 2275 | ||
| 2276 | void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, bool pressed) { | 2276 | void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, const QPointF offset, |
| 2277 | float offset_scalar, bool pressed) { | ||
| 2278 | const float radius1 = 24.0f; | ||
| 2279 | const float radius2 = 17.0f; | ||
| 2280 | |||
| 2281 | const QPointF offset_center = center + offset * offset_scalar; | ||
| 2282 | |||
| 2283 | const auto amplitude = static_cast<float>( | ||
| 2284 | 1.0 - std::sqrt((offset.x() * offset.x()) + (offset.y() * offset.y())) * 0.1f); | ||
| 2285 | |||
| 2286 | const float rotation = | ||
| 2287 | ((offset.x() == 0) ? atan(1) * 2 : atan(offset.y() / offset.x())) * (180 / (atan(1) * 4)); | ||
| 2288 | |||
| 2289 | p.save(); | ||
| 2290 | p.translate(offset_center); | ||
| 2291 | p.rotate(rotation); | ||
| 2292 | |||
| 2277 | // Outer circle | 2293 | // Outer circle |
| 2278 | p.setPen(colors.outline); | 2294 | p.setPen(colors.outline); |
| 2279 | p.setBrush(pressed ? colors.highlight : colors.button); | 2295 | p.setBrush(pressed ? colors.highlight : colors.button); |
| 2280 | DrawCircle(p, center, 24.0f); | 2296 | p.drawEllipse(QPointF(0, 0), radius1 * amplitude, radius1); |
| 2281 | 2297 | ||
| 2282 | // Inner circle | 2298 | // Inner circle |
| 2283 | p.setBrush(pressed ? colors.highlight2 : colors.button2); | 2299 | p.setBrush(pressed ? colors.highlight2 : colors.button2); |
| 2284 | DrawCircle(p, center, 17.0f); | 2300 | |
| 2301 | const float inner_offset = | ||
| 2302 | (radius1 - radius2) * 0.4f * ((offset.x() == 0 && offset.y() < 0) ? -1.0f : 1.0f); | ||
| 2303 | const float offset_factor = (1.0f - amplitude) / 0.1f; | ||
| 2304 | |||
| 2305 | p.drawEllipse(QPointF((offset.x() < 0) ? -inner_offset : inner_offset, 0) * offset_factor, | ||
| 2306 | radius2 * amplitude, radius2); | ||
| 2307 | |||
| 2308 | p.restore(); | ||
| 2285 | } | 2309 | } |
| 2286 | 2310 | ||
| 2287 | void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, bool pressed) { | 2311 | void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, bool pressed) { |
diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 39565f795..676effbfd 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h | |||
| @@ -140,7 +140,7 @@ private: | |||
| 140 | void DrawJoystickSideview(QPainter& p, QPointF center, float angle, float size, bool pressed); | 140 | void DrawJoystickSideview(QPainter& p, QPointF center, float angle, float size, bool pressed); |
| 141 | void DrawRawJoystick(QPainter& p, QPointF center, const QPointF value, | 141 | void DrawRawJoystick(QPainter& p, QPointF center, const QPointF value, |
| 142 | const Input::AnalogProperties properties); | 142 | const Input::AnalogProperties properties); |
| 143 | void DrawProJoystick(QPainter& p, QPointF center, bool pressed); | 143 | void DrawProJoystick(QPainter& p, QPointF center, QPointF offset, float scalar, bool pressed); |
| 144 | void DrawGCJoystick(QPainter& p, QPointF center, bool pressed); | 144 | void DrawGCJoystick(QPainter& p, QPointF center, bool pressed); |
| 145 | 145 | ||
| 146 | // Draw button functions | 146 | // Draw button functions |