Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
SIBios.h
Go to the documentation of this file.
1#ifndef SIBIOS_H
2#define SIBIOS_H
3
5#include "dolphin/os/OSTime.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define SI_MAX_CHAN 4
12#define SI_MAX_COMCSR_INLNGTH 128
13#define SI_MAX_COMCSR_OUTLNGTH 128
14#define SI_ERROR_UNDER_RUN 0x0001
15#define SI_ERROR_OVER_RUN 0x0002
16#define SI_ERROR_COLLISION 0x0004
17#define SI_ERROR_NO_RESPONSE 0x0008
18#define SI_ERROR_WRST 0x0010
19#define SI_ERROR_RDST 0x0020
20#define SI_ERROR_UNKNOWN 0x0040
21#define SI_ERROR_BUSY 0x0080
22#define SI_CHAN0 0
23#define SI_CHAN1 1
24#define SI_CHAN2 2
25#define SI_CHAN3 3
26#define SI_CHAN0_BIT 0x80000000
27#define SI_CHAN1_BIT 0x40000000
28#define SI_CHAN2_BIT 0x20000000
29#define SI_CHAN3_BIT 0x10000000
30#define SI_CHAN_BIT(chan) (SI_CHAN0_BIT >> (chan))
31#define SI_TYPE_MASK 0x18000000u
32#define SI_TYPE_N64 0x00000000u
33#define SI_TYPE_DOLPHIN 0x08000000u
34#define SI_TYPE_GC SI_TYPE_DOLPHIN
35#define SI_GC_WIRELESS 0x80000000
36#define SI_GC_NOMOTOR 0x20000000
37#define SI_GC_STANDARD 0x01000000
38#define SI_WIRELESS_RECEIVED 0x40000000
39#define SI_WIRELESS_IR 0x04000000
40#define SI_WIRELESS_STATE 0x02000000
41#define SI_WIRELESS_ORIGIN 0x00200000
42#define SI_WIRELESS_FIX_ID 0x00100000
43#define SI_WIRELESS_TYPE 0x000f0000
44#define SI_WIRELESS_LITE_MASK 0x000c0000
45#define SI_WIRELESS_LITE 0x00040000
46#define SI_WIRELESS_CONT_MASK 0x00080000
47#define SI_WIRELESS_CONT 0x00000000
48#define SI_WIRELESS_ID 0x00c0ff00
49#define SI_WIRELESS_TYPE_ID (SI_WIRELESS_TYPE | SI_WIRELESS_ID)
50#define SI_N64_CONTROLLER (SI_TYPE_N64 | 0x05000000)
51#define SI_N64_MIC (SI_TYPE_N64 | 0x00010000)
52#define SI_N64_KEYBOARD (SI_TYPE_N64 | 0x00020000)
53#define SI_N64_MOUSE (SI_TYPE_N64 | 0x02000000)
54#define SI_GBA (SI_TYPE_N64 | 0x00040000)
55#define SI_GC_CONTROLLER (SI_TYPE_GC | SI_GC_STANDARD)
56#define SI_GC_RECEIVER (SI_TYPE_GC | SI_GC_WIRELESS)
57#define SI_GC_WAVEBIRD \
58 (SI_TYPE_GC | SI_GC_WIRELESS | SI_GC_STANDARD | SI_WIRELESS_STATE | SI_WIRELESS_FIX_ID)
59#define SI_GC_KEYBOARD (SI_TYPE_GC | 0x00200000)
60#define SI_GC_STEERING (SI_TYPE_GC | 0x00000000)
61
63typedef void (*SITypeAndStatusCallback)(s32 chan, u32 type);
64
74
82
97
102
103BOOL SIBusy(void);
104BOOL SIIsChanBusy(s32 chan);
109void SIInit(void);
110u32 SIGetStatus(s32 chan);
111void SISetCommand(s32 chan, u32 command);
112void SITransferCommands(void);
113u32 SISetXY(u32 x, u32 y);
117BOOL SIGetResponse(s32 chan, void* data);
118BOOL SITransfer(s32 chan, void* output, u32 outputBytes, void* input, u32 inputBytes,
119 SICallback callback, OSTime delay);
120u32 SIGetType(s32 chan);
122
123vu32 __SIRegs[64] AT_ADDRESS(0xCC006400);
124
125#ifdef __cplusplus
126}
127#endif
128
129#endif /* SIBIOS_H */
static OSContext context
Definition JUTException.cpp:233
void(* __OSInterruptHandler)(__OSInterrupt interrupt, OSContext *context)
Definition OSInterrupt.h:112
s16 __OSInterrupt
Definition OSInterrupt.h:110
s64 OSTime
Definition OSTime.h:10
static void SIInterruptHandler(__OSInterrupt interrupt, OSContext *context)
BOOL SIGetResponse(s32 chan, void *data)
Definition SIBios.c:485
BOOL SIRegisterPollingHandler(__OSInterruptHandler handler)
Definition SIBios.c:251
u32 SISetXY(u32 x, u32 y)
Definition SIBios.c:399
void SIInit(void)
Definition SIBios.c:301
BOOL SITransfer(s32 chan, void *output, u32 outputBytes, void *input, u32 inputBytes, SICallback callback, OSTime delay)
Definition SIBios.c:518
u32 SIEnablePolling(u32 poll)
Definition SIBios.c:416
void(* SITypeAndStatusCallback)(s32 chan, u32 type)
Definition SIBios.h:63
u32 SIDisablePolling(u32 poll)
Definition SIBios.c:449
static BOOL SIEnablePollingInterrupt(BOOL enable)
u32 SIGetTypeAsync(s32 chan, SITypeAndStatusCallback callback)
Definition SIBios.c:682
void(* SICallback)(s32 chan, u32 sr, OSContext *context)
Definition SIBios.h:62
vu32 __SIRegs[64] AT_ADDRESS(0xCC006400)
u32 SIGetStatus(s32 chan)
Definition SIBios.c:369
u32 SIGetType(s32 chan)
Definition SIBios.c:646
static BOOL SIGetResponseRaw(s32 chan)
BOOL SIUnregisterPollingHandler(__OSInterruptHandler handler)
Definition SIBios.c:275
BOOL SIIsChanBusy(s32 chan)
Definition SIBios.c:38
BOOL SIBusy(void)
Definition SIBios.c:30
void SISetCommand(s32 chan, u32 command)
Definition SIBios.c:388
void SITransferCommands(void)
Definition SIBios.c:393
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static u16 data[4]
Definition d_vibration.cpp:114
double x double x
Definition e_atan2.c:58
double x double y
Definition e_atan2.c:58
Definition OSContext.h:137
Definition SIBios.h:83
u32 inlngth
Definition SIBios.h:92
u32 pad1
Definition SIBios.h:91
u32 pad0
Definition SIBios.h:89
u32 comerr
Definition SIBios.h:86
u32 rdstintmsk
Definition SIBios.h:88
u32 outlngth
Definition SIBios.h:90
u32 tstart
Definition SIBios.h:95
u32 rdstint
Definition SIBios.h:87
u32 pad2
Definition SIBios.h:93
u32 tcintmsk
Definition SIBios.h:85
u32 channel
Definition SIBios.h:94
u32 tcint
Definition SIBios.h:84
Definition SIBios.h:75
u32 poll
Definition SIBios.h:77
void * input
Definition SIBios.h:79
s32 chan
Definition SIBios.h:76
SICallback callback
Definition SIBios.h:80
u32 inputBytes
Definition SIBios.h:78
Definition SIBios.h:65
void * input
Definition SIBios.h:69
OSTime fire
Definition SIBios.h:72
SICallback callback
Definition SIBios.h:71
s32 chan
Definition SIBios.h:66
u32 outputBytes
Definition SIBios.h:68
void * output
Definition SIBios.h:67
u32 inputBytes
Definition SIBios.h:70
int BOOL
Definition types.h:27
unsigned long u32
Definition types.h:10
volatile u32 vu32
Definition types.h:15
signed long s32
Definition types.h:6
Definition SIBios.h:98
u32 val
Definition SIBios.h:99
SIComm_s f
Definition SIBios.h:100