Read state
JoyMega_Read3
u8 JoyMega_Read3(
enum INPUT_PORT port
)

Read Megadrive 3-button joypad through JoyMega adapter

Parameters
port
enum INPUT_PORT

The port to read (can be <INPUT_PORT1> or <INPUT_PORT2>)

Return

State of the buttons (0: pressed, 1: released)

 7 6 5 4 3 2 1 0
–-–-–-–-–-–-–-–--
S A C B R L D U
│ │ │ │ │ │ │ └── Up
│ │ │ │ │ │ └──── Down
│ │ │ │ │ └────── Left
│ │ │ │ └──────── Right
│ │ │ └────────── Trigger B
│ │ └──────────── Trigger C
│ └────────────── Trigger A
└──────────────── Trigger Start
JoyMega_Read6
u16 JoyMega_Read6(
enum INPUT_PORT port
)

Read Megadrive 6-button joypad through JoyMega adapter

Parameters
port
enum INPUT_PORT

The port to read (can be <INPUT_PORT1> or <INPUT_PORT2>)

Return

State of the buttons (0: pressed, 1: released)

 F E D C B A 9 8 | 7 6 5 4 3 2 1 0
–-–-–-–-–-–-–-–--–-–-–-–-–-–-–-–--–
x x x x M X Y Z S A C B R L D U
│ │ │ │ │ │ │ │ │ │ │ └── Up
│ │ │ │ │ │ │ │ │ │ └──── Down
│ │ │ │ │ │ │ │ │ └────── Left
│ │ │ │ │ │ │ │ └──────── Right
│ │ │ │ │ │ │ └────────── Trigger B
│ │ │ │ │ │ └──────────── Trigger C
│ │ │ │ │ └────────────── Trigger A
│ │ │ │ └──────────────── Trigger Start
│ │ │ └──────────────────── Trigger Z
│ │ └────────────────────── Trigger Y
│ └──────────────────────── Trigger X
└────────────────────────── Trigger Mode
Check state
JoyMega_IsPressedUp
inline bool JoyMega_IsPressedUp(
u8 state
)

Check if 'up' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedDown
inline bool JoyMega_IsPressedDown(
u8 state
)

Check if 'down' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedLeft
inline bool JoyMega_IsPressedLeft(
u8 state
)

Check if 'left' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedRight
inline bool JoyMega_IsPressedRight(
u8 state
)

Check if 'right' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedA
inline bool JoyMega_IsPressedA(
u8 state
)

Check if 'A' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedB
inline bool JoyMega_IsPressedB(
u8 state
)

Check if 'B' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedC
inline bool JoyMega_IsPressedC(
u8 state
)

Check if 'C' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedStart
inline bool JoyMega_IsPressedStart(
u8 state
)

Check if 'start' button is pressed

Parameters
state
u8

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6 (lower part)

Return

TRUE if the button is pressed

JoyMega_IsPressedX
inline bool JoyMega_IsPressedX(
u16 state
)

Check if 'X' button is pressed

Parameters
state
u16

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6

Return

TRUE if the button is pressed

JoyMega_IsPressedY
inline bool JoyMega_IsPressedY(
u16 state
)

Check if 'Y' button is pressed

Parameters
state
u16

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6

Return

TRUE if the button is pressed

JoyMega_IsPressedZ
inline bool JoyMega_IsPressedZ(
u16 state
)

Check if 'Z' button is pressed

Parameters
state
u16

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6

Return

TRUE if the button is pressed

JoyMega_IsPressedMode
inline bool JoyMega_IsPressedMode(
u16 state
)

Check if 'mode' button is pressed

Parameters
state
u16

State of the joystick returned by JoyMega_Read3 or JoyMega_Read6

Return

TRUE if the button is pressed