1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Matched some controller files (#178)

* 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
This commit is contained in:
Lucas Shaw 2020-06-17 04:16:30 -07:00 committed by GitHub
parent 229e0c8629
commit b86edcf92c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 650 additions and 1001 deletions

View file

@ -1,8 +1,8 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <alloca.h>
#include <vt.h>
#include <PR/os_cont.h>
// data
const char* sExceptionNames[] = {

View file

@ -1,5 +1,5 @@
#include <global.h>
#include <PR/os_cont.h>
#include <ultra64/controller.h>
void FlagSet_Update(GlobalContext* globalCtx) {
static s32 entryIdx = 0;

View file

@ -1,7 +1,7 @@
#include <global.h>
#include <ultra64/hardware.h>
#include <ultra64/controller.h>
#include <vt.h>
#include <PR/os_cont.h>
#define GFXPOOL_HEAD_MAGIC 0x1234
#define GFXPOOL_TAIL_MAGIC 0x5678

View file

@ -1,10 +1,8 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <vt.h>
#include <PR/os_cont.h>
#include <ultra64/controller.h>
s32 D_8012D280 = 1;
OSMesgQueue* PadMgr_LockSerialMesgQueue(PadMgr* padmgr) {
@ -78,7 +76,7 @@ void PadMgr_RumbleControl(PadMgr* padmgr) {
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック ぶるぶるぶるぶる");
osSyncPrintf(VT_RST);
if (osSetRumble(&padmgr->unk_controller[i], temp) != 0) {
if (osSetRumble(&padmgr->pfs[i], temp) != 0) {
padmgr->pakType[i] = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
// "A communication error has occurred with the vibraton pack"
@ -100,7 +98,7 @@ void PadMgr_RumbleControl(PadMgr* padmgr) {
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止");
osSyncPrintf(VT_RST);
if (osSetRumble(&padmgr->unk_controller[i], 0) != 0) {
if (osSetRumble(&padmgr->pfs[i], 0) != 0) {
padmgr->pakType[i] = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
// "A communication error has occurred with the vibration pack"
@ -139,12 +137,12 @@ void PadMgr_RumbleControl(PadMgr* padmgr) {
i = frame % 4;
if (padmgr->ctrlrIsConnected[i] && (padmgr->padStatus[i].status & 1) && (padmgr->pakType[i] != 1)) {
var4 = osProbeRumblePak(ctrlrQ, &padmgr->unk_controller[i], i);
var4 = osProbeRumblePak(ctrlrQ, &padmgr->pfs[i], i);
if (var4 == 0) {
padmgr->pakType[i] = 1;
osSetRumble(&padmgr->unk_controller[i], 1);
osSetRumble(&padmgr->unk_controller[i], 0);
osSetRumble(&padmgr->pfs[i], 1);
osSetRumble(&padmgr->pfs[i], 0);
osSyncPrintf(VT_FGCOL(YELLOW));
// "Recognized vibration pack"
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パックを認識しました");
@ -172,14 +170,14 @@ void PadMgr_RumbleStop(PadMgr* padmgr) {
ctrlrQ = PadMgr_LockSerialMesgQueue(padmgr);
for (i = 0; i < 4; i++) {
if (osProbeRumblePak(ctrlrQ, &padmgr->unk_controller[i], i) == 0) {
if (osProbeRumblePak(ctrlrQ, &padmgr->pfs[i], i) == 0) {
if ((gFaultStruct.msgId == 0) && (padmgr->rumbleOnFrames != 0)) {
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("padmgr: %dコン: %s\n", i + 1, "振動パック 停止"); // "Stop vibration pack"
osSyncPrintf(VT_RST);
}
osSetRumble(&padmgr->unk_controller[i], 0);
osSetRumble(&padmgr->pfs[i], 0);
}
}
@ -417,7 +415,7 @@ void PadMgr_Init(PadMgr* padmgr, OSMesgQueue* siIntMsgQ, IrqMgr* irqMgr, OSId id
func_800FCD40(siIntMsgQ, &padmgr->validCtrlrsMask, padmgr);
padmgr->ncontrollers = 4;
func_80104D00(padmgr->ncontrollers);
osContSetCh(padmgr->ncontrollers);
osCreateThread(&padmgr->thread, id, PadMgr_ThreadEntry, padmgr, stack, priority);
osStartThread(&padmgr->thread);

View file

@ -1,6 +1,6 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <PR/os_cont.h>
typedef struct {
u8 x;

View file

@ -1,6 +1,6 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <PR/os_cont.h>
u16 D_8011E1C0 = 0;
u16 D_8011E1C4 = 0;

View file

@ -1,7 +1,7 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <vt.h>
#include <PR/os_cont.h>
typedef struct {
/* 0x00 */ u8 scene;

View file

@ -1,6 +1,6 @@
#include <ultra64.h>
#include <ultra64/controller.h>
#include <global.h>
#include <PR/os_cont.h>
void Sample_HandleStateChange(SampleContext* this) {
if (CHECK_PAD(this->state.input[0].press, START_BUTTON)) {