1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-23 13:54:44 +00:00
oot/src/libultra_code/contquery.c
Lucas Shaw 7e195a3562
Matched most remaining libultra files (#221)
* osPfsIsPlug.c and osContSetCh.c OK

* update

* __osPfsGetStatus.c OK

* removed unused asm

* Updated all libultra controller files to use new structs instead of the temporary structs. Added os_pfs.h

* controller updates

* fixed header guard

* Made suggested changes

* guLookAt.c OK

* commit

* __osPfsSelectBank.c OK

* osPfsDeleteFile.c OK

* pfsreadwritefile.c OK

* osPfsFreeBlocks.c OK

* cleaned up ospfsfreeblocks

* started pfsinitpak.c

* pfsallocatefile.c OK

* contpfs.c decompiled with 1 non matching

* osPfsFindFile.c OK

* pfsinitpak.c decompiled. one non-matching

* Actually fixed merge conflict

* sins.c OK

* cosf.c sinf.c and sins.c OK

* moved osAfterPreNMI to its own file. Renamed code_801031F0 to contquery.c

* pfschecker.c OK

* final update and rename

* Removed makefile testing thing that i accidentally added

* Made suggested changes
2020-07-06 20:15:01 -04:00

34 lines
899 B
C

#include "libultra_internal.h"
#include <global.h>
/**
* osContStartQuery:
* Starts to read the values for SI device status and type which are connected to the controller port and joyport
* connector.
**/
s32 osContStartQuery(OSMesgQueue* mq) {
s32 ret;
ret = 0;
__osSiGetAccess();
if (__osContLastPoll != CONT_CMD_REQUEST_STATUS) {
__osPackRequestData(CONT_CMD_REQUEST_STATUS);
ret = __osSiRawStartDma(OS_WRITE, &__osPifInternalBuff);
osRecvMesg(mq, NULL, OS_MESG_BLOCK);
}
ret = __osSiRawStartDma(OS_READ, &__osPifInternalBuff);
__osContLastPoll = CONT_CMD_REQUEST_STATUS;
__osSiRelAccess();
return ret;
}
/**
* osContGetQuery:
* Returns the values from osContStartQuery to status. Both functions must be paired for use.
**/
void osContGetQuery(OSContStatus* data) {
u8 pattern;
__osContGetInitData(&pattern, data);
}