1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 15:34:41 +00:00

Decompile jpegdecoder.c, padsetup.c and code_800C3C20.c (#217)

* Decompile jpegdecoder.c, padsetup.c and code_800C3C20.c

* change func_800C3C20's prototype and rename some fields in jpeg related structs

* Fix comment in Jpeg_GetU16 and change func_800C3C20

* use a switch in padsetup.c
This commit is contained in:
Random 2020-06-22 00:43:14 +02:00 committed by GitHub
parent afce6a3c36
commit ab1ec89f22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 389 additions and 653 deletions

33
src/code/padsetup.c Normal file
View file

@ -0,0 +1,33 @@
#include <global.h>
s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status) {
s32 ret;
s32 i;
*outMask = 0xFF;
ret = osContInit(mq, outMask, status);
if (ret != 0) {
return ret;
}
if (*outMask == 0xFF) {
if (osContStartQuery(mq) != 0) {
return 1;
}
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
osContGetQuery(status);
*outMask = 0;
for (i = 0; i < 4; i++) {
switch (status[i].errno) {
case 0:
if (status[i].type == CONT_TYPE_NORMAL) {
*outMask |= 1 << i;
}
break;
default:
break;
}
}
}
return 0;
}