GetPadBuf

Gets controller buffers

void GetPadBuf (
        volatile unsigned char **buf1,
        volatile unsigned char **buf2
)

Arguments

buf1 Pointer to a storage location that will contain a pointer to the port1 controller.
buf2 Pointer to a storage location that will contain a pointer to the port2 controller.

Return Value

None.

Explanation

The storage locations of the system controller buffers are obtained and stored at the memory locations pointed to by buf1 and buf2.
Communication with the controllers occurs every vertical synchronization interruption and information read from the controllers is stored in the system controller buffers. GetPadBuf() can be used to obtain pointers to these buffers. There is a separate buffer for each controller. The table below shows the arrangement of data within each buffer.
 
Bytes Content
0 0xff:   No controller 
0x00: Controller present
1 Upper 4 bits: Terminal type 
Lower 4 bits: Received data size (in 1/2 bytes)
2~ Received data (maximum 32 bytes)

The received data format varies according to the type of controller indicated by ‘terminal type’. The terminal types supported by the library are shown in the following table:
 

Terminal Type Device Name
0x1 Mouse
0x2 NeGCon
0x4 Standard controller
0x5 Joystick

Please refer to the "User’s Guide" for a description of the contents of received data corresponding to each terminal type, or see the Net Yaroze Members' Web site.