Functions
NTap_Check
inline u8 NTap_Check()

Check the presence of Ninja Tap in the joystick ports.

Return

Ninja Tap information. See NTap_GetInfo

NTap_GetInfo
inline u8 NTap_GetInfo()

Get Ninja Tap information.  NTap_Check function must be called first.

Return

Number of usable joysticks and types. See NTap_Check.

7    6   5   4   3   2   1   0
│ │ │ │ └───┴───┴───┴── Nomber of joystick port available (2, 5 or 8)
│ │ └───┴────────────────── Tap type pluged in port 1 (0=No Tap, 1=Ninja Tap, 2=Shinobi Tap)
└────┴────────────────────────── Tap type pluged in port 2 (0=No Tap, 1=Ninja Tap, 2=Shinobi Tap)
NTap_GetPortNum
inline u8 NTap_GetPortNum()

Get total number of joystick port.  NTap_Check function must be called first.

Return

Number of usable joysticks. See NTap_Check.

NTap_Update
void NTap_Update()

Update the status of all joysticks whether they are connected to a Ninja Tap or directly to the port.

NTap_GetData
inline u8 NTap_GetData(
u8 idx
)

Get the data of a given joystick according to its index.  NTap_Update function must be called first.

Parameters
idx
u8

Joystick port index.  For example, if the Ninja Tap is connected to port B, the first entry (index 0) will be the joystick connected directly to port A, while the next (index 1) will be the joystick connected to the first port of the Ninja Tap.

Return

State of the joystick. Bit set to 0 are triggered.

7    6   5   4   3   2   1   0
│ │ │ │ │ │ │ └── Right direction
│ │ │ │ │ │ └────── Left direction
│ │ │ │ │ └────────── Down direction
│ │ │ │ └────────────── Up direction
│ │ │ └────────────────── Start bouton (for NES pad)
│ │ └────────────────────── Select bouton (for NES pad)
│ └────────────────────────── A bouton
└─────────────────────────────── B bouton
NTap_IsPressed
inline u8 NTap_IsPressed(
u8 idx,
u8 btn
)

Check if the given bouton is pressed on the given joystick index NTap_Update function must be called first.

Parameters
idx
u8

Joystick port index.

btn
u8

Bouton value.  Can be one of <NTAP_RIGHT>, <NTAP_LEFT>, <NTAP_DOWN>, <NTAP_UP>, <NTAP_START>, <NTAP_SELECT>, <NTAP_A> or <NTAP_B>.

Return

TRUE if button is currently pressed, FALSE otherwise.

NTap_IsPushed
inline u8 NTap_IsPushed(
u8 idx,
u8 btn
)

Check if the given bouton has just been pushed on the given joystick index NTap_Update function must be called first.

Parameters
idx
u8

Joystick port index.

btn
u8

Bouton value. See NTap_IsPressed.

Return

TRUE if button has just been pushed this frame, FALSE otherwise.

NTap_IsReleased
inline u8 NTap_IsReleased(
u8 idx,
u8 btn
)

Check if the given bouton has just been released on the given joystick index NTap_Update function must be called first.

Parameters
idx
u8

Joystick port index.

btn
u8

Bouton value. See NTap_IsPressed.

Return

TRUE if button has just been released this frame, FALSE otherwise.