jak-project/game/sce/libpad.h

65 lines
1.5 KiB
C
Raw Normal View History

#pragma once
2021-08-14 16:00:50 -04:00
/*!
* @file libpad.h
* Stub implementation of the EE pad (controller) library
*/
#include "common/common_types.h"
#define SCE_PAD_DMA_BUFFER_SIZE 0x100
2021-08-14 16:00:50 -04:00
// pad status
2021-08-14 16:05:38 -04:00
#define scePadStateDiscon 0
#define scePadStateFindPad 1
2021-08-14 16:00:50 -04:00
#define scePadStateFindCTP1 2
2021-08-14 16:05:38 -04:00
#define scePadStateExecCmd 5
#define scePadStateStable 6
#define scePadStateError 7
#define scePadStateClosed 99
2021-08-14 16:00:50 -04:00
// pad mode info checks
2021-08-14 16:05:38 -04:00
#define InfoModeCurID 1
#define InfoModeCurExID 2
2021-08-14 16:00:50 -04:00
#define InfoModeCurExOffs 3
2021-08-14 16:05:38 -04:00
#define InfoModeIdTable 4
2021-08-14 16:00:50 -04:00
// pad async request states
2021-08-14 16:05:38 -04:00
#define scePadReqStateComplete 0
#define scePadReqStateFaild 1 // lol
#define scePadReqStateFailed 1
#define scePadReqStateBusy 2
2021-08-14 16:00:50 -04:00
// pad actuator info checks
2021-08-14 16:05:38 -04:00
#define InfoActFunc 1
#define InfoActSub 2
#define InfoActSize 3
#define InfoActCurr 4
2021-08-14 16:00:50 -04:00
struct CPadInfo;
namespace ee {
2021-08-14 16:00:50 -04:00
// controller modes (not in the lib)
enum PadMode {
Controller = 4,
DualShock = 7,
DualShock2 = DualShock,
NeGcon = 2,
Joystick = 5,
NamcoGun = 6
};
int scePadPortOpen(int port, int slot, void* data);
2021-08-14 16:00:50 -04:00
int scePadGetState(int port, int slot);
int scePadInfoMode(int port, int slot, int term, int offs);
int scePadRead(int port, int slot, u8* rdata);
int scePadSetActDirect(int port, int slot, const u8* data);
2021-08-14 16:00:50 -04:00
int scePadSetActAlign(int port, int slot, const u8* data);
int scePadSetMainMode(int port, int slot, int offs, int lock);
int scePadGetReqState(int port, int slot);
int scePadInfoAct(int port, int slot, int actno, int term);
int scePadInfoPressMode(int port, int slot);
int scePadEnterPressMode(int port, int slot);
2021-08-14 16:05:38 -04:00
} // namespace ee