Merge branch 'master' into cellPadSet

This commit is contained in:
Megamouse 2025-12-03 15:50:45 +01:00 committed by GitHub
commit fc19584557
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 26 additions and 17 deletions

2
.gitmodules vendored
View file

@ -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"]

2
3rdparty/FAudio vendored

@ -1 +1 @@
Subproject commit 8de3616b5b204260fe639e76587731d8a73b8d2c
Subproject commit 4ea8afea6ba857c24e40877f487d000d559b196d

@ -1 +1 @@
Subproject commit f42423643ec9011c98cccc0bb790722bbbd3f30b
Subproject commit d6b2a974608dec3b76fb1e36c189f22b9cf3650c

@ -1 +1 @@
Subproject commit badbf8da4ee72b3ef599c721ffc9899e8d7c8d90
Subproject commit 7f3ae3d57459e59943a4ecfefc8f6277ec6bf540

View file

@ -12,28 +12,45 @@ namespace rsx
namespace aligned_allocator
{
template <size_t Align>
requires (Align != 0) && ((Align & (Align - 1)) == 0)
size_t align_up(size_t size)
{
return (size + (Align - 1)) & ~(Align - 1);
}
template <size_t Align>
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<NativeAlign>(size));
#else
return std::aligned_alloc(Align, size);
return std::aligned_alloc(Align, align_up<Align>(size));
#endif
}
template <size_t Align>
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<Align>(prev_size) >= new_size)
{
return prev_ptr;
}
ensure(reinterpret_cast<usz>(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<NativeAlign>(new_size));
#else
void* ret = std::aligned_alloc(Align, align_up<Align>(new_size));
#endif
std::memcpy(ret, prev_ptr, std::min(prev_size, new_size));
std::free(prev_ptr);
return ret;

View file

@ -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)