Common
LightGun_Read
inline u8 LightGun_Read(
u8 port
)

Read light gun data from the given port.

Parameters
port
u8

Input port to read (INPUT_PORT1 or INPUT_PORT2)

Return

Light gun state (use GetTrigger and GetLight functions to get state information).

ASCII Plus-X Terminator Laser
LightGun_ASCII_GetTrigger
inline bool LightGun_ASCII_GetTrigger(
u8 state
)

Get the trigger status of the ASCII light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

FALSE if the trigger is not pressed.

LightGun_ASCII_GetLight
inline u8 LightGun_ASCII_GetLight(
u8 state
)

Get the light status of the ASCII light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

FALSE if the gun don't detect light (not pointing to white image on screen).

MHT Ingenieros Gun-Stick
LightGun_GunStick_GetTrigger
inline bool LightGun_GunStick_GetTrigger(
u8 state
)

Get the trigger status of the MHT Ingenieros Gun-Stick light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

FALSE if the trigger is not pressed.

LightGun_GunStick_GetLight
inline u8 LightGun_GunStick_GetLight(
u8 state
)

Get the light status of the MHT Ingenieros Gun-Stick light gun.  Parameters: state - Current state of the light gun (from LightGun_Read)

Return

FALSE if the gun don't detect light (not pointing to white image on screen).

Phenix Light Gun
LightGun_Phenix_GetTriggerA
inline bool LightGun_Phenix_GetTriggerA(
u8 state
)

Get the trigger A status of the Phenix light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

FALSE if the trigger A is not pressed.

LightGun_Phenix_GetTriggerB
inline bool LightGun_Phenix_GetTriggerB(
u8 state
)

Get the trigger B status of the Phenix light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

FALSE if the trigger B is not pressed.

LightGun_Phenix_GetLight
inline u8 LightGun_Phenix_GetLight(
u8 state
)

Get the light status of the Phenix light gun.

Parameters
state
u8

Current state of the light gun (from LightGun_Read)

Return

Detected 3-bit RGB color

0b000: Black (no light detected)
0b001: Blue
0b010: Green
0b011: Cyan
0b100: Red
0b101: Magenta
0b110: Yellow
0b111: White (light detected)