mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
Initial accelerometer support
This commit is contained in:
parent
ff7e0f9ca8
commit
c772b1c702
4 changed files with 45 additions and 3 deletions
|
@ -56,6 +56,7 @@ class HIDService {
|
|||
s16 circlePadX, circlePadY; // Circlepad state
|
||||
s16 touchScreenX, touchScreenY; // Touchscreen state
|
||||
s16 roll, pitch, yaw; // Gyroscope state
|
||||
s16 accelX, accelY, accelZ; // Accelerometer state
|
||||
|
||||
bool accelerometerEnabled;
|
||||
bool eventsInitialized;
|
||||
|
@ -87,6 +88,11 @@ class HIDService {
|
|||
*(T*)&sharedMem[offset] = value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T* getSharedMemPointer(size_t offset) {
|
||||
return (T*)&sharedMem[offset];
|
||||
}
|
||||
|
||||
public:
|
||||
static constexpr float gyroscopeCoeff = 14.375f; // Same as retail 3DS
|
||||
|
||||
|
@ -130,6 +136,12 @@ class HIDService {
|
|||
void setPitch(s16 value) { pitch = value; }
|
||||
void setYaw(s16 value) { yaw = value; }
|
||||
|
||||
void setAccel(s16 x, s16 y, s16 z) {
|
||||
accelX = x;
|
||||
accelY = y;
|
||||
accelZ = z;
|
||||
}
|
||||
|
||||
void updateInputs(u64 currentTimestamp);
|
||||
|
||||
void setSharedMem(u8* ptr) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue