|
libjoybus
Joybus implementation for 32-bit MCUs
|
Joybus target which listens for the PixelFX game ID command. More...
Data Structures | |
| struct | joybus_target_pixelfx_gameid |
| PixelFX game ID Joybus target. More... | |
Macros | |
| #define | JOYBUS_TARGET_PIXELFX_GAMEID(target) |
| Macro to cast from a generic Joybus target to a PixelFX game ID target. | |
| #define | JOYBUS_PIXELFX_GAMEID_SIZE 10 |
| Size of a PixelFX game ID, in bytes. | |
Typedefs | |
| typedef void(* | joybus_target_pixelfx_gameid_received_cb) (struct joybus_target_pixelfx_gameid *target) |
| Callback type for game ID received events. | |
Functions | |
| void | joybus_target_pixelfx_gameid_init (struct joybus_target_pixelfx_gameid *target) |
| Initialize a PixelFX game ID target. | |
| void | joybus_target_pixelfx_gameid_set_received_cb (struct joybus_target_pixelfx_gameid *target, joybus_target_pixelfx_gameid_received_cb callback) |
| Set the game ID received callback for the target. | |
Joybus target which listens for the PixelFX game ID command.
N64 flash carts and Swiss on the GameCube send it over the controller port so that attached devices know which game is running. The command carries 10 bytes of game ID and expects no reply, so this target never sends one.
The ID bytes depend on the console. An N64 sends CRC1 and CRC2 from the ROM header, the media format and the country code. A GameCube sends the 8-byte boot hash, the console ID and the country code. All zeros clears the game ID.
An N64 sends the command to the first controller port only. Swiss sends it to every port.
| #define JOYBUS_TARGET_PIXELFX_GAMEID | ( | target | ) |
Macro to cast from a generic Joybus target to a PixelFX game ID target.
| typedef void(* joybus_target_pixelfx_gameid_received_cb) (struct joybus_target_pixelfx_gameid *target) |
Callback type for game ID received events.
Runs in interrupt context, so it must return quickly and must not block. Copy or flag the ID and act on it from the main loop.
| target | the target that received the game ID, with the ID in its game_id field |
| void joybus_target_pixelfx_gameid_init | ( | struct joybus_target_pixelfx_gameid * | target | ) |
Initialize a PixelFX game ID target.
| target | the target to initialize |
| void joybus_target_pixelfx_gameid_set_received_cb | ( | struct joybus_target_pixelfx_gameid * | target, |
| joybus_target_pixelfx_gameid_received_cb | callback ) |
Set the game ID received callback for the target.
| target | the target to set the callback for |
| callback | the callback function |