libjoybus
Joybus implementation for 32-bit MCUs
Loading...
Searching...
No Matches
PixelFX Game ID Target

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.

Detailed Description

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.

Macro Definition Documentation

◆ JOYBUS_TARGET_PIXELFX_GAMEID

#define JOYBUS_TARGET_PIXELFX_GAMEID ( target)
Value:
((struct joybus_target_pixelfx_gameid *)(target))
PixelFX game ID Joybus target.
Definition pixelfx_gameid.h:46

Macro to cast from a generic Joybus target to a PixelFX game ID target.

Typedef Documentation

◆ joybus_target_pixelfx_gameid_received_cb

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.

Parameters
targetthe target that received the game ID, with the ID in its game_id field

Function Documentation

◆ joybus_target_pixelfx_gameid_init()

void joybus_target_pixelfx_gameid_init ( struct joybus_target_pixelfx_gameid * target)

Initialize a PixelFX game ID target.

Parameters
targetthe target to initialize

◆ joybus_target_pixelfx_gameid_set_received_cb()

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.

Parameters
targetthe target to set the callback for
callbackthe callback function