Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MorsGames
GitHub Repository: MorsGames/sm64plus
Path: blob/master/lib/src/__osSyncPutChars.c
7857 views
1
#include "libultra_internal.h"
2
3
typedef struct {
4
u8 unk00 : 2;
5
u8 pad : 4;
6
u8 unk01 : 2;
7
u8 unk2[3];
8
} unkStruct;
9
10
u32 D_80334A40 = 0;
11
u32 D_80334A44 = 1;
12
13
void __osSyncPutChars(s32 a0, s32 a1, u8 *a2) {
14
unkStruct sp24;
15
s32 sp20;
16
u32 sp1c;
17
sp24.unk00 = a0;
18
sp24.unk01 = a1;
19
20
for (sp20 = 0; sp20 < a1; sp20++) {
21
sp24.unk2[sp20] = a2[sp20];
22
}
23
24
while (!__osAtomicDec(&D_80334A44)) {
25
;
26
}
27
28
sp1c = __osDisableInt();
29
30
*(u32 *) 0xC0000000 = *(u32 *) &sp24;
31
while (!(__osGetCause() & 0x2000)) {
32
;
33
}
34
*(u32 *) 0xC000000C = 0;
35
D_80334A44++;
36
37
__osRestoreInt(sp1c);
38
}
39
40