- HandleDualShock to be processed on PC version

This commit is contained in:
Ilya Shurumov 2021-03-04 20:31:53 +06:00
parent e2e9b691a2
commit d0d3f5009a
3 changed files with 20 additions and 24 deletions

View File

@ -235,7 +235,6 @@ void ClearPad(int pad)
// [D]
void HandleDualShock(void)
{
#ifdef PSX
PAD* pPad;
static unsigned char align[6] = {
@ -271,11 +270,11 @@ void HandleDualShock(void)
switch (state)
{
case 0:
case 4:
case PadStateDiscon:
case PadStateReqInfo:
break;
case 1:
pPad->state = 1;
case PadStateFindPad:
pPad->state = PadStateFindPad;
if (pPad->dsactive != 0)
{
@ -288,15 +287,15 @@ void HandleDualShock(void)
pPad->vibrate = 0;
}
break;
case 2:
if (pPad->state != 6)
pPad->state = 6;
case PadStateFindCTP1:
if (pPad->state != PadStateStable)
pPad->state = PadStateStable;
break;
case 6:
if (pPad->state != 6)
case PadStateStable:
if (pPad->state != PadStateStable)
{
if (PadInfoMode(port, 4, 1) != 7)
if (PadInfoMode(port, InfoModeIdTable, 1) != 7)
{
pPad->dualshock = 0;
pPad->state = 6;
@ -313,7 +312,7 @@ void HandleDualShock(void)
if (PadSetActAlign(port, align) != 0)
{
pPad->dsactive = 1;
pPad->state = 6;
pPad->state = PadStateStable;
pPad->motors[0] = 0;
pPad->motors[1] = 0;
pPad->vibrate = 0;
@ -330,7 +329,7 @@ void HandleDualShock(void)
break;
}
if (pPad->state == 6)
if (pPad->state == PadStateStable)
{
if (pPad->dsactive == 0 || (pPad->vibrate == 0 && pPad->alarmShakeCounter == 0 || 50 < dsload))
{
@ -361,10 +360,7 @@ void HandleDualShock(void)
pPad->vibrate--;
}
}
}
#endif
}
// [D]

View File

@ -43,11 +43,11 @@ extern unsigned int PadEnableCom(unsigned int unk00);
extern void PadEnableGun(unsigned char unk00);
extern void PadRemoveGun();
extern int PadGetState(int port);
extern int PadInfoMode(int unk00, int, int unk01);
extern int PadInfoAct(int unk00, int, int unk01);
extern int PadInfoMode(int port, int term, int offs);
extern int PadInfoAct(int port, int acno, int term);
extern int PadInfoComb(int unk00, int, int unk01);
extern int PadSetActAlign(int unk00, unsigned char* unk01);
extern int PadSetActAlign(int port, unsigned char* table);
extern int PadSetMainMode(int socket, int offs, int lock);
extern void PadSetAct(int unk00, unsigned char* unk01, int unk02);
extern void PadSetAct(int port, unsigned char* table, int len);
#endif

View File

@ -128,12 +128,12 @@ int PadGetState(int port)
return 0;
}
int PadInfoMode(int unk00, int unk01, int unk02)
int PadInfoMode(int port, int term, int offs)
{
return 7;//?
}
int PadInfoAct(int unk00, int unk01, int unk02)
int PadInfoAct(int port, int acno, int term)
{
PSYX_UNIMPLEMENTED();
return 0;
@ -145,7 +145,7 @@ int PadInfoComb(int unk00, int unk01, int unk02)
return 0;
}
int PadSetActAlign(int unk00, unsigned char* unk01)
int PadSetActAlign(int port, unsigned char* table)
{
PSYX_UNIMPLEMENTED();
return 0;
@ -157,7 +157,7 @@ int PadSetMainMode(int socket, int offs, int lock)
return 0;
}
void PadSetAct(int unk00, unsigned char* unk01, int unk02)
void PadSetAct(int port, unsigned char* table, int len)
{
PSYX_UNIMPLEMENTED();
}