mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-18 19:51:30 +12:00
[HID] Add touchscreen
This commit is contained in:
parent
5200c10b27
commit
4f619086e9
1 changed files with 5 additions and 0 deletions
|
@ -149,8 +149,13 @@ void HIDService::updateInputs(u64 currentTick) {
|
||||||
writeSharedMem<u64>(0xA8, currentTick); // Write new tick count
|
writeSharedMem<u64>(0xA8, currentTick); // Write new tick count
|
||||||
}
|
}
|
||||||
writeSharedMem<u32>(0xB8, nextTouchscreenIndex); // Index last updated by the HID module
|
writeSharedMem<u32>(0xB8, nextTouchscreenIndex); // Index last updated by the HID module
|
||||||
|
const size_t touchEntryOffset = 0xC8 + (nextTouchscreenIndex * 8); // Offset in the array of 8 touchscreen entries
|
||||||
nextTouchscreenIndex = (nextTouchscreenIndex + 1) % 8; // Move to next entry
|
nextTouchscreenIndex = (nextTouchscreenIndex + 1) % 8; // Move to next entry
|
||||||
|
|
||||||
|
writeSharedMem<u16>(touchEntryOffset, touchScreenX);
|
||||||
|
writeSharedMem<u16>(touchEntryOffset + 2, touchScreenY);
|
||||||
|
writeSharedMem<u8>(touchEntryOffset + 4, touchScreenPressed ? 1 : 0);
|
||||||
|
|
||||||
// Next, update accelerometer state
|
// Next, update accelerometer state
|
||||||
if (nextAccelerometerIndex == 0) {
|
if (nextAccelerometerIndex == 0) {
|
||||||
writeSharedMem<u64>(0x110, readSharedMem<u64>(0x108)); // Copy previous tick count
|
writeSharedMem<u64>(0x110, readSharedMem<u64>(0x108)); // Copy previous tick count
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue