diff options
| author | Random <28494085+Random06457@users.noreply.github.com> | 2020-10-03 17:22:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-03 11:22:44 -0400 |
| commit | 174af7384d1cfcbf15da02d9069bf02bdc433c20 (patch) | |
| tree | e4fb18346f71047c123ec4d34a80ae7e4d8ab9ea /src/libultra_code/osContStartReadData.c | |
| parent | 6136ee6debd570a63fc695a6f4664553303f2324 (diff) | |
libultra cleanup (#215)
* cleanup libultra
* fixes
- use quotes instead of <> for includes
- add macros for zelda specific thread priorities
- fix Makefile
- properly format the remaining pfs structs
* fix button macros + add CHECK_BTN_ANY/CHECK_BTN_ALL
* remove ULTRA_ABS
* fix includes
* update z_player.c/z_lib.c + run format.sh
* merge upstream/master
* fix include in En_Goroiwa
* fix includes
Diffstat (limited to 'src/libultra_code/osContStartReadData.c')
| -rw-r--r-- | src/libultra_code/osContStartReadData.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/libultra_code/osContStartReadData.c b/src/libultra_code/osContStartReadData.c deleted file mode 100644 index d45b07f6e..000000000 --- a/src/libultra_code/osContStartReadData.c +++ /dev/null @@ -1,56 +0,0 @@ -#include <ultra64.h> -#include <global.h> -#include <ultra64/controller.h> - -s32 osContStartReadData(OSMesgQueue* mq) { - s32 ret; - __osSiGetAccess(); - if (__osContLastPoll != 1) { - __osPackReadData(); - __osSiRawStartDma(OS_WRITE, &__osPifInternalBuff); - osRecvMesg(mq, NULL, OS_MESG_BLOCK); - } - ret = __osSiRawStartDma(OS_READ, &__osPifInternalBuff); - __osContLastPoll = CONT_CMD_READ_BUTTON; - __osSiRelAccess(); - return ret; -} - -void osContGetReadData(OSContPad* contData) { - u8* bufptr; - __OSContReadHeader read; - s32 i; - bufptr = (u8*)(&__osPifInternalBuff); - for (i = 0; i < __osMaxControllers; i++, bufptr += sizeof(read), contData++) { - read = *((__OSContReadHeader*)bufptr); - contData->errno = (read.rxsize & 0xC0) >> 4; - if (contData->errno == 0) { - contData->button = read.button; - contData->stick_x = read.joyX; - contData->stick_y = read.joyY; - } - }; -} - -void __osPackReadData() { - u8* bufptr; - __OSContReadHeader read; - s32 i; - bufptr = (u8*)(&__osPifInternalBuff); - for (i = 0; i < 0xF; i++) { - __osPifInternalBuff.ram[i] = 0; - } - __osPifInternalBuff.status = 1; - read.align = 0xFF; - read.txsize = 1; - read.rxsize = 4; - read.poll = CONT_CMD_READ_BUTTON; - read.button = 0xFFFF; - read.joyX = 0xFF; - read.joyY = 0xFF; - for (i = 0; i < __osMaxControllers; i++) { - *((__OSContReadHeader*)bufptr) = read; - bufptr += sizeof(read); - } - *((u8*)bufptr) = CONT_CMD_END; -} |
