Initial accelerometer support
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user