summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--externals/CMakeLists.txt3
m---------externals/SDL0
-rw-r--r--src/core/hle/service/glue/arp.cpp10
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/npad.h1
-rw-r--r--src/core/hle/service/set/set.cpp3
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp6
-rw-r--r--src/core/hle/service/vi/vi.cpp8
-rw-r--r--src/input_common/CMakeLists.txt2
-rw-r--r--src/input_common/sdl/sdl_impl.cpp10
-rw-r--r--src/video_core/texture_cache/util.cpp2
-rw-r--r--src/yuzu_cmd/config.cpp10
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.cpp9
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp10
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp8
16 files changed, 72 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e208715d7..2c1c3d560 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -274,9 +274,9 @@ if (ENABLE_SDL2)
274 target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}") 274 target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
275 target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}") 275 target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
276 else() 276 else()
277 find_package(SDL2 2.0.12) 277 find_package(SDL2 2.0.14)
278 278
279 if(SDL2_FOUND) 279 if (SDL2_FOUND)
280 # Some installations don't set SDL2_LIBRARIES 280 # Some installations don't set SDL2_LIBRARIES
281 if("${SDL2_LIBRARIES}" STREQUAL "") 281 if("${SDL2_LIBRARIES}" STREQUAL "")
282 message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") 282 message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
@@ -286,10 +286,10 @@ if (ENABLE_SDL2)
286 include_directories(SYSTEM ${SDL2_INCLUDE_DIRS}) 286 include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
287 add_library(SDL2 INTERFACE) 287 add_library(SDL2 INTERFACE)
288 target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}") 288 target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARIES}")
289 else()
290 message(STATUS "SDL2 2.0.14 or newer not found, falling back to externals.")
289 endif() 291 endif()
290 endif() 292 endif()
291else()
292 set(SDL2_FOUND NO)
293endif() 293endif()
294 294
295# Install any missing dependencies with conan install 295# Install any missing dependencies with conan install
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 6e4591b4e..e044d9730 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -46,8 +46,7 @@ add_library(unicorn-headers INTERFACE)
46target_include_directories(unicorn-headers INTERFACE ./unicorn/include) 46target_include_directories(unicorn-headers INTERFACE ./unicorn/include)
47 47
48# SDL2 48# SDL2
49if (NOT SDL2_FOUND) 49if (NOT SDL2_FOUND AND ENABLE_SDL2)
50 set(SDL2_FOUND YES)
51 add_subdirectory(SDL EXCLUDE_FROM_ALL) 50 add_subdirectory(SDL EXCLUDE_FROM_ALL)
52endif() 51endif()
53 52
diff --git a/externals/SDL b/externals/SDL
Subproject 983bbf9ef3e572a073a6f5877faf1c0b4803527 Subproject 4cd981609b50ed273d80c635c1ca4c1e5518fb2
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp
index 322125135..7b1c6677c 100644
--- a/src/core/hle/service/glue/arp.cpp
+++ b/src/core/hle/service/glue/arp.cpp
@@ -157,9 +157,9 @@ class IRegistrar final : public ServiceFramework<IRegistrar> {
157 friend class ARP_W; 157 friend class ARP_W;
158 158
159public: 159public:
160 explicit IRegistrar( 160 using IssuerFn = std::function<ResultCode(u64, ApplicationLaunchProperty, std::vector<u8>)>;
161 Core::System& system_, 161
162 std::function<ResultCode(u64, ApplicationLaunchProperty, std::vector<u8>)> issuer) 162 explicit IRegistrar(Core::System& system_, IssuerFn&& issuer)
163 : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} { 163 : ServiceFramework{system_, "IRegistrar"}, issue_process_id{std::move(issuer)} {
164 // clang-format off 164 // clang-format off
165 static const FunctionInfo functions[] = { 165 static const FunctionInfo functions[] = {
@@ -238,9 +238,9 @@ private:
238 rb.Push(RESULT_SUCCESS); 238 rb.Push(RESULT_SUCCESS);
239 } 239 }
240 240
241 std::function<ResultCode(u64, ApplicationLaunchProperty, std::vector<u8>)> issue_process_id; 241 IssuerFn issue_process_id;
242 bool issued = false; 242 bool issued = false;
243 ApplicationLaunchProperty launch; 243 ApplicationLaunchProperty launch{};
244 std::vector<u8> control; 244 std::vector<u8> control;
245}; 245};
246 246
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 783386fcf..113a41254 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -147,7 +147,7 @@ bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) {
147 device_handle.device_index < DeviceIndex::MaxDeviceIndex; 147 device_handle.device_index < DeviceIndex::MaxDeviceIndex;
148} 148}
149 149
150Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) { 150Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system) {
151 latest_vibration_values.fill({DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE}); 151 latest_vibration_values.fill({DEFAULT_VIBRATION_VALUE, DEFAULT_VIBRATION_VALUE});
152} 152}
153 153
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 14d0ac067..c3b07bd41 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -587,6 +587,5 @@ private:
587 std::array<ControllerPad, 10> npad_pad_states{}; 587 std::array<ControllerPad, 10> npad_pad_states{};
588 std::array<TriggerState, 10> npad_trigger_states{}; 588 std::array<TriggerState, 10> npad_trigger_states{};
589 bool is_in_lr_assignment_mode{false}; 589 bool is_in_lr_assignment_mode{false};
590 Core::System& system;
591}; 590};
592} // namespace Service::HID 591} // namespace Service::HID
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index bc7dc776f..fbdc4793d 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -104,9 +104,10 @@ void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) {
104 layout = key_code->second; 104 layout = key_code->second;
105 } 105 }
106 106
107 ctx.WriteBuffer(layout);
108
107 IPC::ResponseBuilder rb{ctx, 2}; 109 IPC::ResponseBuilder rb{ctx, 2};
108 rb.Push(RESULT_SUCCESS); 110 rb.Push(RESULT_SUCCESS);
109 ctx.WriteBuffer(layout);
110} 111}
111} // Anonymous namespace 112} // Anonymous namespace
112 113
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index 3117627cf..19d7a1a0c 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -140,11 +140,12 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) {
140 return; 140 return;
141 } 141 }
142 142
143 ctx.WriteBuffer(posix_time);
144
143 // TODO(bunnei): Handle multiple times 145 // TODO(bunnei): Handle multiple times
144 IPC::ResponseBuilder rb{ctx, 3}; 146 IPC::ResponseBuilder rb{ctx, 3};
145 rb.Push(RESULT_SUCCESS); 147 rb.Push(RESULT_SUCCESS);
146 rb.PushRaw<u32>(1); // Number of times we're returning 148 rb.PushRaw<u32>(1); // Number of times we're returning
147 ctx.WriteBuffer(posix_time);
148} 149}
149 150
150void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) { 151void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
@@ -163,10 +164,11 @@ void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
163 return; 164 return;
164 } 165 }
165 166
167 ctx.WriteBuffer(posix_time);
168
166 IPC::ResponseBuilder rb{ctx, 3}; 169 IPC::ResponseBuilder rb{ctx, 3};
167 rb.Push(RESULT_SUCCESS); 170 rb.Push(RESULT_SUCCESS);
168 rb.PushRaw<u32>(1); // Number of times we're returning 171 rb.PushRaw<u32>(1); // Number of times we're returning
169 ctx.WriteBuffer(posix_time);
170} 172}
171 173
172} // namespace Service::Time 174} // namespace Service::Time
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index 348360b51..7ae07d072 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -1129,9 +1129,11 @@ private:
1129 } 1129 }
1130 1130
1131 NativeWindow native_window{*buffer_queue_id}; 1131 NativeWindow native_window{*buffer_queue_id};
1132 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize());
1133
1132 IPC::ResponseBuilder rb{ctx, 4}; 1134 IPC::ResponseBuilder rb{ctx, 4};
1133 rb.Push(RESULT_SUCCESS); 1135 rb.Push(RESULT_SUCCESS);
1134 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize())); 1136 rb.Push<u64>(buffer_size);
1135 } 1137 }
1136 1138
1137 void CloseLayer(Kernel::HLERequestContext& ctx) { 1139 void CloseLayer(Kernel::HLERequestContext& ctx) {
@@ -1173,10 +1175,12 @@ private:
1173 } 1175 }
1174 1176
1175 NativeWindow native_window{*buffer_queue_id}; 1177 NativeWindow native_window{*buffer_queue_id};
1178 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize());
1179
1176 IPC::ResponseBuilder rb{ctx, 6}; 1180 IPC::ResponseBuilder rb{ctx, 6};
1177 rb.Push(RESULT_SUCCESS); 1181 rb.Push(RESULT_SUCCESS);
1178 rb.Push(*layer_id); 1182 rb.Push(*layer_id);
1179 rb.Push<u64>(ctx.WriteBuffer(native_window.Serialize())); 1183 rb.Push<u64>(buffer_size);
1180 } 1184 }
1181 1185
1182 void DestroyStrayLayer(Kernel::HLERequestContext& ctx) { 1186 void DestroyStrayLayer(Kernel::HLERequestContext& ctx) {
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index c3cfe7efc..de53e1fda 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -62,7 +62,7 @@ else()
62 ) 62 )
63endif() 63endif()
64 64
65if(SDL2_FOUND) 65if (ENABLE_SDL2)
66 target_sources(input_common PRIVATE 66 target_sources(input_common PRIVATE
67 sdl/sdl_impl.cpp 67 sdl/sdl_impl.cpp
68 sdl/sdl_impl.h 68 sdl/sdl_impl.h
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index 9418e78fa..f682a6db4 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -17,7 +17,17 @@
17#include <unordered_map> 17#include <unordered_map>
18#include <utility> 18#include <utility>
19#include <vector> 19#include <vector>
20
21// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
22#ifdef __clang__
23#pragma clang diagnostic push
24#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
25#endif
20#include <SDL.h> 26#include <SDL.h>
27#ifdef __clang__
28#pragma clang diagnostic pop
29#endif
30
21#include "common/logging/log.h" 31#include "common/logging/log.h"
22#include "common/param_package.h" 32#include "common/param_package.h"
23#include "common/settings_input.h" 33#include "common/settings_input.h"
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 0ab297413..8c4a5523b 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -1139,7 +1139,7 @@ void DeduceBlitImages(ImageInfo& dst_info, ImageInfo& src_info, const ImageBase*
1139 dst_info.format = src->info.format; 1139 dst_info.format = src->info.format;
1140 } 1140 }
1141 if (!src && dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) { 1141 if (!src && dst && GetFormatType(dst->info.format) != SurfaceType::ColorTexture) {
1142 src_info.format = src->info.format; 1142 src_info.format = dst->info.format;
1143 } 1143 }
1144} 1144}
1145 1145
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index 2f984d1b8..7e1d5f379 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -4,7 +4,17 @@
4 4
5#include <memory> 5#include <memory>
6#include <sstream> 6#include <sstream>
7
8// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
9#ifdef __clang__
10#pragma clang diagnostic push
11#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
12#endif
7#include <SDL.h> 13#include <SDL.h>
14#ifdef __clang__
15#pragma clang diagnostic pop
16#endif
17
8#include <inih/cpp/INIReader.h> 18#include <inih/cpp/INIReader.h>
9#include "common/file_util.h" 19#include "common/file_util.h"
10#include "common/logging/log.h" 20#include "common/logging/log.h"
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
index ce8b7c218..3bb555a6b 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp
@@ -2,7 +2,16 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
6#ifdef __clang__
7#pragma clang diagnostic push
8#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
9#endif
5#include <SDL.h> 10#include <SDL.h>
11#ifdef __clang__
12#pragma clang diagnostic pop
13#endif
14
6#include "common/logging/log.h" 15#include "common/logging/log.h"
7#include "common/scm_rev.h" 16#include "common/scm_rev.h"
8#include "core/core.h" 17#include "core/core.h"
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
index a765fa7b3..3c49a300b 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp
@@ -5,8 +5,18 @@
5#include <algorithm> 5#include <algorithm>
6#include <cstdlib> 6#include <cstdlib>
7#include <string> 7#include <string>
8
8#define SDL_MAIN_HANDLED 9#define SDL_MAIN_HANDLED
10// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
11#ifdef __clang__
12#pragma clang diagnostic push
13#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
14#endif
9#include <SDL.h> 15#include <SDL.h>
16#ifdef __clang__
17#pragma clang diagnostic pop
18#endif
19
10#include <fmt/format.h> 20#include <fmt/format.h>
11#include <glad/glad.h> 21#include <glad/glad.h>
12#include "common/assert.h" 22#include "common/assert.h"
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
index dfd53e285..3401ad4b4 100644
--- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
+++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp
@@ -16,7 +16,15 @@
16#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" 16#include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h"
17 17
18// Include these late to avoid polluting everything with Xlib macros 18// Include these late to avoid polluting everything with Xlib macros
19// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
20#ifdef __clang__
21#pragma clang diagnostic push
22#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
23#endif
19#include <SDL.h> 24#include <SDL.h>
25#ifdef __clang__
26#pragma clang diagnostic pop
27#endif
20#include <SDL_syswm.h> 28#include <SDL_syswm.h>
21 29
22EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) 30EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem)