mirror of
https://github.com/zeldaret/oot
synced 2026-08-21 14:37:24 -04:00
padmgr and related (#71)
* In process of moving changes over from old repo * Merged in changes * Finished import of padmgr changes from old repo * Adjusted some volatile * Improving padmgr volatile situation * Almost matched osReadMempak * Working on osMempakDataCRC * Explanations and equivalents but no matches for osMempakAddrCRC and osMempakDataCRC * OK after merge * Matched osMempakAddrCRC and osMempakDataCRC * Matched osReadMempak * Updated PadMgr function names to be less like original code * Changed variable names to make them further from original code * Changed names and it stopped matching * Undid clang-format steamrollering whitespace memes * Cleaned up Input names * More formatting changes * Moved padmgr to z64.h, deleted padmgr.h
This commit is contained in:
@@ -2,11 +2,37 @@
|
||||
#define _ULTRA64_CONTROLLER_H_
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#include <PR/os_cont.h>
|
||||
#include <PR/os_message.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x00 */ union{
|
||||
u16 button;
|
||||
struct{
|
||||
u16 a : 1;
|
||||
u16 b : 1;
|
||||
u16 z : 1;
|
||||
u16 s : 1;
|
||||
u16 du : 1;
|
||||
u16 dd : 1;
|
||||
u16 dl : 1;
|
||||
u16 dr : 1;
|
||||
u16 illegal_h : 1;
|
||||
u16 illegal_l : 1;
|
||||
u16 l : 1;
|
||||
u16 r : 1;
|
||||
u16 cu : 1;
|
||||
u16 cd : 1;
|
||||
u16 cl : 1;
|
||||
u16 cr : 1;
|
||||
};
|
||||
};
|
||||
/* 0x02 */ s8 x;
|
||||
/* 0x03 */ s8 y;
|
||||
} PadInput; // size = 0x4
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 slot_type; //0xFF for valid command, 0x00 for don't read this controller, 0xFE for end of commands
|
||||
@@ -19,11 +45,7 @@ typedef struct
|
||||
{
|
||||
PIF_header_t hdr;
|
||||
union{
|
||||
struct{
|
||||
u16 button;
|
||||
s8 rawStickX;
|
||||
s8 rawStickY;
|
||||
};
|
||||
PadInput input;
|
||||
struct{
|
||||
u8 ctl_type_lo;
|
||||
u8 ctl_type_hi;
|
||||
@@ -42,6 +64,10 @@ typedef union
|
||||
};
|
||||
} PIF_mempak_wr_t;
|
||||
|
||||
typedef struct {
|
||||
u8 data[0x20];
|
||||
} PIF_mempak_data_t;
|
||||
|
||||
typedef union
|
||||
{
|
||||
u8 bytes[0x40];
|
||||
@@ -75,9 +101,9 @@ extern u32 gOsContInitialized; // = 0
|
||||
extern OSMesgQueue _osContMesgQueue;
|
||||
extern OSMesg _osContMesgBuff[4];
|
||||
|
||||
extern s32 osSetVibration(unk_controller_t *arg0, u32 vibrate);
|
||||
extern s32 osSetRumble(unk_controller_t *arg0, u32 vibrate);
|
||||
extern void osSetUpMempakWrite(s32 ctrlridx, pif_data_buffer_t* buf);
|
||||
extern s32 osProbeVibrationPack(OSMesgQueue* ctrlrqueue, unk_controller_t *unk_controller, u32 ctrlridx);
|
||||
extern s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, unk_controller_t *unk_controller, u32 ctrlridx);
|
||||
extern void __osSiCreateAccessQueue();
|
||||
extern void __osSiGetAccess();
|
||||
extern void __osSiRelAccess();
|
||||
|
||||
Reference in New Issue
Block a user