Melee Modding Library
2.0.0
A C library for modding Super Smash Bros Melee
|
Emulate a player's controller. More...
#include "gctypes.h"
Go to the source code of this file.
Data Structures | |
struct | Controller |
Represents the state of a controller. More... | |
Macros | |
#define | TILT_RADIUS 0.3 |
#define | DEFAULT_CONTROLLER ((Controller) {0, 0.f, 0.f, 0.f, 0.f}) |
#define | BUTTON_BITS 0x000F |
#define | RADIUS_BITS 0x00F0 |
#define | ANGLE_BITS 0xFF00 |
#define | NO_BUTTON 0x00 |
#define | A_BUTTON 0x01 |
#define | B_BUTTON 0x02 |
#define | X_BUTTON 0x03 |
#define | Z_BUTTON 0x04 |
#define | L_BUTTON 0x05 |
#define | START_BUTTON 0x06 |
#define | DPAD_UP 0x07 |
#define | DPAD_DOWN 0x08 |
#define | DPAD_LEFT 0x09 |
#define | DPAD_RIGHT 0x0a |
#define | CSTICK_UP 0x0b |
#define | CSTICK_DOWN 0x0c |
#define | CSTICK_LEFT 0x0d |
#define | CSTICK_RIGHT 0x0e |
#define | NO_STICK 0x00 |
#define | TILT_STICK 0x10 |
#define | FULL_STICK 0x20 |
Functions | |
void | setController (Controller *controller, u16 state) |
Set the state of the controller. More... | |
void | writeController (Controller *controller, u32 port, bool pData) |
Write the state of controller to the memory addresses read by the game. More... | |
Emulate a player's controller.
struct Controller |
#define BUTTON_BITS 0x000F |
Controller bit mask
#define RADIUS_BITS 0x00F0 |
Controller bit mask
#define ANGLE_BITS 0xFF00 |
Controller bit mask
#define NO_BUTTON 0x00 |
Button Flag
#define A_BUTTON 0x01 |
Button Flag
#define B_BUTTON 0x02 |
Button Flag
#define X_BUTTON 0x03 |
Button Flag
#define Z_BUTTON 0x04 |
Button Flag
#define L_BUTTON 0x05 |
Button Flag
#define START_BUTTON 0x06 |
Button Flag
#define DPAD_UP 0x07 |
Button Flag
#define DPAD_DOWN 0x08 |
Button Flag
#define DPAD_LEFT 0x09 |
Button Flag
#define DPAD_RIGHT 0x0a |
Button Flag
#define CSTICK_UP 0x0b |
Button Flag
#define CSTICK_DOWN 0x0c |
Button Flag
#define CSTICK_LEFT 0x0d |
Button Flag
#define CSTICK_RIGHT 0x0e |
Button Flag
#define NO_STICK 0x00 |
Button Flag
#define TILT_STICK 0x10 |
Button Flag
#define FULL_STICK 0x20 |
Button Flag
#define TILT_RADIUS 0.3 |
Radius of stick that defines a tilt
#define DEFAULT_CONTROLLER ((Controller) {0, 0.f, 0.f, 0.f, 0.f}) |
Default Controller struct
void setController | ( | Controller * | controller, |
u16 | state | ||
) |
Set the state of the controller.
controller | - Pointer to a Controller struct. |
state | - 16-bit integer encoding the controller state. 0x000F - buttons 0x00F0 - stick radius 0xFF00 - stick angle |
void writeController | ( | Controller * | controller, |
u32 | port, | ||
bool | pData | ||
) |
Write the state of controller
to the memory addresses read by the game.
controller | - Pointer to a Controller struct. |
port | - Which player port to write to {1,2,3,4} |
pData | - Write controller to PlayerData |