Introduce pad header

This commit is contained in:
gamemasterplc 2023-12-23 11:55:51 -06:00
parent c97fa8c5ee
commit 9b9438ca3a
8 changed files with 45 additions and 17 deletions

View file

@ -1,7 +1,7 @@
#include "common.h"
#include "game/object.h"
#include "game/printfunc.h"
#include "dolphin/pad.h"
#include "game/pad.h"
#include "math.h"

View file

@ -1,8 +1,7 @@
#include "REL/w10Dll.h"
#include "game/pad.h"
#include "game/data.h"
s16 HuPadStatGet(s16 i); //TODO: Move to some other header file since gamework.c relies on an implicit declaration of it
char lbl_1_data_98[] = "@@@@@@@@@@@@@@ Tutorial Exit @@@@@@@@@@@@@@\n\000";
w10DllUnk03 lbl_1_data_C6[11] = {

View file

@ -1,6 +1,7 @@
#include "common.h"
#include "game/printfunc.h"
#include "game/object.h"
#include "game/pad.h"
#define OM_OVL_HIS_MAX 16
#define OM_MAX_GROUPS 10

View file

@ -1,6 +1,8 @@
#include "common.h"
#include "dolphin.h"
#include "game/msm.h"
#include "game/pad.h"
typedef struct pad_rumble {
s16 duration;
@ -9,7 +11,6 @@ typedef struct pad_rumble {
s16 time;
} PadRumble;
void HuPadRead(void);
static void PadReadVSync(u32 retraceCount);
static void PadADConv(s16 pad, PADStatus *status);
@ -45,7 +46,7 @@ static s8 _PadErr[4];
static u32 RumbleBit;
u32 VCounter;
u32 chanTbl[4] = { PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, PAD_CHAN3_BIT };
static u32 chanTbl[4] = { PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, PAD_CHAN3_BIT };
extern int HuDvdErrWait;
@ -119,10 +120,10 @@ static void PadReadVSync(u32 retraceCount)
} else {
u16 button = curr_status->button;
if(curr_status->triggerL & 0xC0) {
button |= 0x4000;
button |= PAD_BUTTON_TRIGGER_L;
}
if(curr_status->triggerR & 0xC0) {
button |= 0x2000;
button |= PAD_BUTTON_TRIGGER_R;
}
if(button && _PadBtn[i] == button) {
if(_PadRepCnt[i] > 20) {
@ -246,7 +247,7 @@ void HuPadRumbleAllStop(void)
}
}
int HuPadStatGet(s16 pad)
s16 HuPadStatGet(s16 pad)
{
return _PadErr[pad];
}

View file

@ -6,6 +6,7 @@
#include "game/dvd.h"
#include "game/memory.h"
#include "game/process.h"
#include "game/pad.h"
#include "math.h"
#include "stdarg.h"
@ -45,10 +46,6 @@ void HuAR_ARAMtoMRAM(void*);
void mtxTransCat(Mtx, float, float, float);
void *MessData_MesPtrGet(void*, u32);
extern u16 HuPadBtn[4];
extern u8 HuPadDStkRep[4];
WindowData ATTRIBUTE_ALIGN(32) winData[32];
u32 winKey[4];
keyBufData winComKeyBuf[256];