SNES Mouse support (1-2 mice on ports 1/2) More...
Macros | |
| #define | MOUSE_BUTTON_LEFT 0x01 |
| #define | MOUSE_BUTTON_RIGHT 0x02 |
| #define | MOUSE_SENS_HIGH 2 |
| #define | MOUSE_SENS_LOW 0 |
| #define | MOUSE_SENS_MEDIUM 1 |
Functions | |
| u8 | mouseButtonsHeld (u8 port) |
| Get currently held mouse buttons. | |
| u8 | mouseButtonsPressed (u8 port) |
| Get newly pressed mouse buttons this frame. | |
| u8 | mouseGetSensitivity (u8 port) |
| Get current mouse sensitivity. | |
| s16 | mouseGetX (u8 port) |
| Get X displacement since last frame. | |
| s16 | mouseGetY (u8 port) |
| Get Y displacement since last frame. | |
| u8 | mouseInit (u8 port) |
| Initialize mouse on given port. | |
| u8 | mouseIsConnected (u8 port) |
| Check if mouse is connected on port. | |
| void | mouseSetSensitivity (u8 port, u8 sensitivity) |
| Set mouse sensitivity. | |
SNES Mouse support (1-2 mice on ports 1/2)
The SNES mouse provides 2 buttons and relative X/Y displacement. Displacement is read via bit-bang in the NMI handler after mouseInit().
| #define MOUSE_BUTTON_LEFT 0x01 |
Left mouse button
| #define MOUSE_BUTTON_RIGHT 0x02 |
Right mouse button
| #define MOUSE_SENS_HIGH 2 |
High sensitivity
| #define MOUSE_SENS_LOW 0 |
Low sensitivity
| #define MOUSE_SENS_MEDIUM 1 |
Medium sensitivity
Get currently held mouse buttons.
| port | Controller port (0 or 1) |
Get newly pressed mouse buttons this frame.
| port | Controller port (0 or 1) |
Get current mouse sensitivity.
| port | Controller port (0 or 1) |
Get X displacement since last frame.
Returns signed displacement: positive = right, negative = left. Raw hardware format is sign-magnitude; this function converts it.
| port | Controller port (0 or 1) |
Get Y displacement since last frame.
Returns signed displacement: positive = down, negative = up.
| port | Controller port (0 or 1) |
Initialize mouse on given port.
Detects if a mouse is connected by checking the auto-joypad device signature. If found, cycles sensitivity to fix the Nintendo power-on bug and enables mouse reading in the NMI handler.
| port | Controller port (0 = port 1, 1 = port 2) |
Check if mouse is connected on port.
| port | Controller port (0 or 1) |