mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 22:55:40 +12:00
Merge pull request #345 from wheremyfoodat/gaming
Fix Kernel WaitSynchronization1 HLE, properly report CirclePadPro as not connected
This commit is contained in:
commit
4dd66498d5
2 changed files with 9 additions and 4 deletions
|
@ -96,7 +96,7 @@ void Kernel::svcSignalEvent() {
|
||||||
// Result WaitSynchronization1(Handle handle, s64 timeout_nanoseconds)
|
// Result WaitSynchronization1(Handle handle, s64 timeout_nanoseconds)
|
||||||
void Kernel::waitSynchronization1() {
|
void Kernel::waitSynchronization1() {
|
||||||
const Handle handle = regs[0];
|
const Handle handle = regs[0];
|
||||||
const s64 ns = s64(u64(regs[1]) | (u64(regs[2]) << 32));
|
const s64 ns = s64(u64(regs[2]) | (u64(regs[3]) << 32));
|
||||||
logSVC("WaitSynchronization1(handle = %X, ns = %lld)\n", handle, ns);
|
logSVC("WaitSynchronization1(handle = %X, ns = %lld)\n", handle, ns);
|
||||||
|
|
||||||
const auto object = getObject(handle);
|
const auto object = getObject(handle);
|
||||||
|
|
|
@ -120,9 +120,14 @@ void IRUserService::requireConnection(u32 messagePointer) {
|
||||||
u32 sharedMemAddress = sharedMemory.value().addr;
|
u32 sharedMemAddress = sharedMemory.value().addr;
|
||||||
|
|
||||||
if (deviceID == u8(DeviceID::CirclePadPro)) {
|
if (deviceID == u8(DeviceID::CirclePadPro)) {
|
||||||
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionStatus), 2); // Citra uses 2 here but only 1 works??
|
// Note: We temporarily pretend we don't have a CirclePad Pro. This code must change when we emulate it or N3DS C-stick
|
||||||
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionRole), 2);
|
constexpr u8 status = 1; // Not connected. Any value other than 2 is considered not connected.
|
||||||
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, isConnected), 1);
|
constexpr u8 role = 0;
|
||||||
|
constexpr u8 connected = 0;
|
||||||
|
|
||||||
|
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionStatus), status);
|
||||||
|
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, connectionRole), role);
|
||||||
|
mem.write8(sharedMemAddress + offsetof(SharedMemoryStatus, isConnected), connected);
|
||||||
|
|
||||||
connectedDevice = true;
|
connectedDevice = true;
|
||||||
if (connectionStatusEvent.has_value()) {
|
if (connectionStatusEvent.has_value()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue