diff --git a/.gitmodules b/.gitmodules index 6f0cd78a5b..77fae5cf55 100644 --- a/.gitmodules +++ b/.gitmodules @@ -21,7 +21,7 @@ ignore = dirty [submodule "3rdparty/hidapi"] path = 3rdparty/hidapi/hidapi - url = ../../RPCS3/hidapi.git + url = ../../libusb/hidapi.git branch = master ignore = dirty [submodule "3rdparty/pugixml"] diff --git a/3rdparty/FAudio b/3rdparty/FAudio index 8de3616b5b..4ea8afea6b 160000 --- a/3rdparty/FAudio +++ b/3rdparty/FAudio @@ -1 +1 @@ -Subproject commit 8de3616b5b204260fe639e76587731d8a73b8d2c +Subproject commit 4ea8afea6ba857c24e40877f487d000d559b196d diff --git a/3rdparty/hidapi/hidapi b/3rdparty/hidapi/hidapi index f42423643e..d6b2a97460 160000 --- a/3rdparty/hidapi/hidapi +++ b/3rdparty/hidapi/hidapi @@ -1 +1 @@ -Subproject commit f42423643ec9011c98cccc0bb790722bbbd3f30b +Subproject commit d6b2a974608dec3b76fb1e36c189f22b9cf3650c diff --git a/3rdparty/libsdl-org/SDL b/3rdparty/libsdl-org/SDL index badbf8da4e..7f3ae3d574 160000 --- a/3rdparty/libsdl-org/SDL +++ b/3rdparty/libsdl-org/SDL @@ -1 +1 @@ -Subproject commit badbf8da4ee72b3ef599c721ffc9899e8d7c8d90 +Subproject commit 7f3ae3d57459e59943a4ecfefc8f6277ec6bf540 diff --git a/rpcs3/Emu/RSX/Common/simple_array.hpp b/rpcs3/Emu/RSX/Common/simple_array.hpp index 4f8d2a5100..00dd6e7d95 100644 --- a/rpcs3/Emu/RSX/Common/simple_array.hpp +++ b/rpcs3/Emu/RSX/Common/simple_array.hpp @@ -12,28 +12,45 @@ namespace rsx namespace aligned_allocator { template + requires (Align != 0) && ((Align & (Align - 1)) == 0) + size_t align_up(size_t size) + { + return (size + (Align - 1)) & ~(Align - 1); + } + + template + requires (Align != 0) && ((Align & (Align - 1)) == 0) void* malloc(size_t size) { -#ifdef _WIN32 +#if defined(_WIN32) return _aligned_malloc(size, Align); +#elif defined(__APPLE__) + constexpr size_t NativeAlign = std::max(Align, sizeof(void*)); + return std::aligned_alloc(NativeAlign, align_up(size)); #else - return std::aligned_alloc(Align, size); + return std::aligned_alloc(Align, align_up(size)); #endif } template + requires (Align != 0) && ((Align & (Align - 1)) == 0) void* realloc(void* prev_ptr, [[maybe_unused]] size_t prev_size, size_t new_size) { - if (prev_size >= new_size) + if (align_up(prev_size) >= new_size) { return prev_ptr; } ensure(reinterpret_cast(prev_ptr) % Align == 0, "Pointer not aligned to Align"); -#ifdef _WIN32 +#if defined(_WIN32) return _aligned_realloc(prev_ptr, new_size, Align); #else - void* ret = std::aligned_alloc(Align, new_size); +#if defined(__APPLE__) + constexpr size_t NativeAlign = std::max(Align, sizeof(void*)); + void* ret = std::aligned_alloc(NativeAlign, align_up(new_size)); +#else + void* ret = std::aligned_alloc(Align, align_up(new_size)); +#endif std::memcpy(ret, prev_ptr, std::min(prev_size, new_size)); std::free(prev_ptr); return ret; diff --git a/rpcs3/Input/ds3_pad_handler.cpp b/rpcs3/Input/ds3_pad_handler.cpp index 0495ef1c05..8d8318ce45 100644 --- a/rpcs3/Input/ds3_pad_handler.cpp +++ b/rpcs3/Input/ds3_pad_handler.cpp @@ -266,14 +266,6 @@ void ds3_pad_handler::check_add_device(hid_device* hidDevice, hid_enumerated_dev } device->report_id = buf[0]; -#elif defined (__APPLE__) - int res = hid_init_sixaxis_usb(hidDevice); - if (res < 0) - { - ds3_log.error("check_add_device: hid_init_sixaxis_usb failed! (result=%d, error=%s)", res, hid_error(hidDevice)); - HidDevice::close(hidDevice); - return; - } #endif for (wchar_t ch : wide_serial)