-
Notifications
You must be signed in to change notification settings - Fork 72
/
OSSerial.c
159 lines (128 loc) · 2.49 KB
/
OSSerial.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#include <platform.h>
#include <placeholder.h>
#include <dolphin/os/OSInterrupt.h>
#include <dolphin/os/OSSerial.h>
#include <dolphin/os/OSTime.h>
#include <dolphin/sipriv.h>
extern UNK_T OSSerial_804D73C8;
extern UNK_T VIGetCurrentLine(UNK_PARAMS);
static bool SIGetResponseRaw(s32 chan);
static void GetTypeCallback(s32 chan, u32 error, OSContext* context);
static bool __SITransfer(void);
static bool SIEnablePollingInterrupt(bool enable);
extern struct {
enum_t status;
u32 xy;
s32 _[0x20 - 0x8];
} Si;
bool SIBusy(void)
{
if (Si.status != -1) {
return true;
}
return false;
}
extern struct {
s32 x0;
u8 pad[32 - 4];
} Packet[];
bool SIIsChanBusy(s32 status)
{
bool result = true;
if (Packet[status].x0 == -1 && Si.status != status) {
result = false;
}
return result;
}
static void CompleteTransfer(void)
{
NOT_IMPLEMENTED;
}
static void SIInterruptHandler(void)
{
NOT_IMPLEMENTED;
}
static bool SIEnablePollingInterrupt(bool enable)
{
NOT_IMPLEMENTED;
}
bool SIRegisterPollingHandler(__OSInterruptHandler handler)
{
NOT_IMPLEMENTED;
}
bool SIUnregisterPollingHandler(__OSInterruptHandler handler)
{
NOT_IMPLEMENTED;
}
void SIInit(void)
{
NOT_IMPLEMENTED;
}
static bool __SITransfer(void)
{
NOT_IMPLEMENTED;
}
u32 SIGetStatus(s32 chan)
{
NOT_IMPLEMENTED;
}
extern volatile struct {
u32 command, x4, x8;
} SIRegs[] AT_ADDRESS(0xCC006400);
void SISetCommand(s32 index, u32 value)
{
SIRegs[index].command = value;
}
void SITransferCommands(void)
{
SIRegs[4].x8 = 0x80000000;
}
u32 SISetXY(u32 x, u32 y)
{
bool intr;
u32 temp_r4 = (x << 0x10);
temp_r4 |= (y << 8);
intr = OSDisableInterrupts();
Si.xy &= 0xFC0000FF;
Si.xy |= temp_r4;
temp_r4 = Si.xy;
OSRestoreInterrupts(intr);
return temp_r4;
}
u32 SIEnablePolling(u32 poll)
{
NOT_IMPLEMENTED;
}
u32 SIDisablePolling(u32 poll)
{
NOT_IMPLEMENTED;
}
bool SIGetResponseRaw(s32 chan)
{
NOT_IMPLEMENTED;
}
bool SIGetResponse(s32 chan, void* data)
{
NOT_IMPLEMENTED;
}
static void AlarmHandler(void)
{
NOT_IMPLEMENTED;
}
bool SITransfer(s32 chan, void* output, u32 outputBytes, void* input,
u32 inputBytes, SICallback callback, OSTime delay)
{
NOT_IMPLEMENTED;
}
void GetTypeCallback(s32 chan, u32 error, OSContext* context)
{
NOT_IMPLEMENTED;
}
u32 SIGetType(s32 arg0)
{
NOT_IMPLEMENTED;
}
u32 SIGetTypeAsync(s32 chan, SITypeAndStatusCallback callback)
{
NOT_IMPLEMENTED;
}