diff options
| author | Random <28494085+Random06457@users.noreply.github.com> | 2020-06-22 00:43:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-21 18:43:14 -0400 |
| commit | ab1ec89f22808c38426f7e0d4e4f0e1a5bc3aec9 (patch) | |
| tree | 55db3fee7706e85d9f35c55444fb8fd0617c21b1 /src/code/padsetup.c | |
| parent | afce6a3c3685e09d94aa094ab4f2bb346d58b0ed (diff) | |
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
Diffstat (limited to 'src/code/padsetup.c')
| -rw-r--r-- | src/code/padsetup.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/code/padsetup.c b/src/code/padsetup.c new file mode 100644 index 000000000..045724a51 --- /dev/null +++ b/src/code/padsetup.c @@ -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; +} |
