The SDK auto-detects controllers when it can. If you get the port type, you'll see what has been detected.
Code: Select all
/**
* \brief
* Get peripheral type for the specified port.<br>
*<br>
* The peripheral type for each port is automatically detected during JOY_init().<br>
* This function returns that type to help decide how the port support should be set.<br>
* Types greater than 15 are not derived via Sega's controller ID method.<br>
*<br>
* \param port
* Port we want to get the peripheral type.<br>
* <b>PORT_1</b> = port 1<br>
* <b>PORT_2</b> = port 2<br>
* \return type
* Peripheral type.<br>
* <b>PORT_TYPE_MENACER</b> = Sega Menacer<br>
* <b>PORT_TYPE_JUSTIFIER</b> = Konami Justifier<br>
* <b>PORT_TYPE_MOUSE</b> = Sega MegaMouse<br>
* <b>PORT_TYPE_TEAMPLAYER</b> = Sega TeamPlayer<br>
* <b>PORT_TYPE_PAD</b> = Sega joypad<br>
* <b>PORT_TYPE_UNKNOWN</b> = unidentified or no peripheral<br>
* <b>PORT_TYPE_EA4WAYPLAY</b> = EA 4-Way Play<br>
*<br>
* Ex : get peripheral type in port 1 :<br>
* type = JOY_getPortType(PORT_1);<br>
*<br>
*/
u8 JOY_getPortType(u16 port);
The type of pad is also auto-detected, and the way to figure out which you have is to read the joy pad, then check the type field (the top four bits of the buttons value returned by JOY_readJoypad).
Code: Select all
#define JOY_TYPE_PAD3 0x00
#define JOY_TYPE_PAD6 0x01
#define JOY_TYPE_MOUSE 0x02
#define JOY_TYPE_TRACKBALL 0x03
#define JOY_TYPE_MENACER 0x04
#define JOY_TYPE_JUSTIFIER 0x05
#define JOY_TYPE_UNKNOWN 0x0F
#define JOY_TYPE_SHIFT 12
#define JOY_TYPE_MASK 0xF000
You only set the support explicitly under certain conditions:
1 - Set 3 button support when you have a 6 button pad, but don't need all 6 buttons. Setting 3 button support makes the pad read a little faster.
2 - Certain controllers take a long time to read, so they default to OFF unless they are the only controller found. The mouse is a good example. The mouse is not enabled unless there's no pad plugged in. Set support to mouse when you need it and get port shows it's available.
3 - Certain controllers take more system resources and/or aren't often used, so they default to off. A light gun is a good example. Set support for the gun if get port shows it's available and you want to use it.
4 - Certain controllers cannot be detected, like the trackball. Set the support for the trackball when you require it or the user selects on option (onscreen) saying it's available and they want to use it.
So you don't need to set the support for 6 button controllers - it's automatically set if you have one plugged in. The current SDK has an example for the controllers showing how to get the port type, how to determine what is being read, how to set the support, etc.