[APT] Implement new 3DS check, [OS] Fix mem allog bug & impl more of HID
This commit is contained in:
@@ -11,6 +11,7 @@ class APTService {
|
||||
|
||||
// Service commands
|
||||
void getLockHandle(u32 messagePointer);
|
||||
void checkNew3DS(u32 messagePointer);
|
||||
|
||||
public:
|
||||
APTService(Memory& mem) : mem(mem) {}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
class HIDService {
|
||||
Handle handle = KernelHandles::HID;
|
||||
Memory& mem;
|
||||
u8* sharedMem; // Pointer to HID shared memory
|
||||
|
||||
MAKE_LOG_FUNCTION(log, hidLogger)
|
||||
|
||||
// Service commands
|
||||
@@ -16,4 +18,11 @@ public:
|
||||
HIDService(Memory& mem) : mem(mem) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
|
||||
void setSharedMem(u8* ptr) {
|
||||
sharedMem = ptr;
|
||||
if (ptr != nullptr) { // Zero-fill shared memory in case the process tries to read stale service data or vice versa
|
||||
std::memset(ptr, 0xff, 0x2b0);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -34,6 +34,9 @@ public:
|
||||
|
||||
// Forward a SendSyncRequest IPC message to the service with the respective handle
|
||||
void sendCommandToService(u32 messagePointer, Handle handle);
|
||||
|
||||
// Wrappers for communicating with certain services
|
||||
void requestGPUInterrupt(GPUInterrupt type) { gsp_gpu.requestInterrupt(type); }
|
||||
void setGSPSharedMem(u8* ptr) { gsp_gpu.setSharedMem(ptr); }
|
||||
void setHIDSharedMem(u8* ptr) { hid.setSharedMem(ptr); }
|
||||
};
|
||||
Reference in New Issue
Block a user