MIDIRead

C Specification


#include <revolution/midi.h>

#define MIDI_CHAN0                   0
#define MIDI_CHAN1                   1
#define MIDI_CHAN2                   2
#define MIDI_CHAN3                   3
#define MIDI_MAX_CHAN                4

#define MIDI_JSTAT_MASK           0x3a
#define MIDI_JSTAT_FLAGS_SHIFT       4
#define MIDI_JSTAT_FLAGS_MASK     0x30
#define MIDI_JSTAT_SEND           0x08
#define MIDI_JSTAT_RECV           0x02

s32 MIDIRead(s32 chan, u8* dst, u8* status);

Arguments

chan One of the MIDI_CHANn Nintendo GameCube Controller Sockets.
dst u8 type of pointer to the buffer that stores read data.
status Pointer to the u8 type of variable that stores the status returned by the MIDI adapter. The value is masked using MIDI_JSTAT_MASK and is valid only when execution terminates normally.

Return Values

Returns one of the following codes. As long as MIDI_READY is returned, execution terminates normally.

MIDI_READY
MIDI_NOT_READY

Description

Gets four bytes of data from the MIDI adapter.
The function call will fail if a MIDI adapter is not connected.

This function may put the current thread to sleep. For precautions when calling similar functions, refer to Interrupts and Callback Functions.

See Also

MIDIReadAsync
Interrupts and Callback Functions

Revision History

2007/09/25 Added information on the sleep status of threads.
2007/05/09 Initial version.


CONFIDENTIAL