Slot-2 Motion Pak, Guitar Grip emulation (#2183)

* Add DS Motion Pak emulation

* Add retail Motion Pak emulation, Guitar Grip emulation

* Simplify Motion Pak acceleration conversion formula

* Fix Motion Pak emulation axes

* Motion Pak: Emulate console laying on a flat table when motion input is not detected

* Motion Pak: Add comment

* GBACartMotionPak: Update comment
This commit is contained in:
Adrian "asie" Siekierka
2025-06-22 16:30:01 +02:00
committed by GitHub
parent 2d04222442
commit fd74181f7d
14 changed files with 471 additions and 5 deletions

View File

@ -322,6 +322,18 @@ void Camera_CaptureFrame(int num, u32* frame, int width, int height, bool yuv, v
// interface for addon inputs
enum KeyType
{
KeyGuitarGripGreen,
KeyGuitarGripRed,
KeyGuitarGripYellow,
KeyGuitarGripBlue,
};
// Check if a given key is being pressed.
// @param type The type of the key to check.
bool Addon_KeyDown(KeyType type, void* userdata);
// Called by the DS Rumble Pak emulation to start the necessary
// rumble effects on the connected game controller, if available.
// @param len The duration of the controller rumble effect in milliseconds.
@ -331,6 +343,42 @@ void Addon_RumbleStart(u32 len, void* userdata);
// rumble effects on the connected game controller, if available.
void Addon_RumbleStop(void* userdata);
enum MotionQueryType
{
/**
* @brief X axis acceleration, measured in SI meters per second squared.
* On a DS, the X axis refers to the top screen X-axis (left ... right).
*/
MotionAccelerationX,
/**
* @brief Y axis acceleration, measured in SI meters per second squared.
* On a DS, the Y axis refers to the top screen Y-axis (bottom ... top).
*/
MotionAccelerationY,
/**
* @brief Z axis acceleration, measured in SI meters per second squared.
* On a DS, the Z axis refers to the axis perpendicular to the top screen (farther ... closer).
*/
MotionAccelerationZ,
/**
* @brief X axis rotation, measured in radians per second.
*/
MotionRotationX,
/**
* @brief Y axis rotation, measured in radians per second.
*/
MotionRotationY,
/**
* @brief Z axis rotation, measured in radians per second.
*/
MotionRotationZ,
};
// Called by the DS Motion Pak emulation to query the game controller's
// aceelration and rotation, if available.
// @param type The value being queried.
float Addon_MotionQuery(MotionQueryType type, void* userdata);
struct DynamicLibrary;
/**