GPUupdateLace GPU_updateLace;
GPUinit GPU_init;
-GPUshutdown GPU_shutdown;
+GPUshutdown GPU_shutdown;
GPUconfigure GPU_configure;
GPUtest GPU_test;
GPUabout GPU_about;
GPUreadStatus GPU_readStatus;
GPUreadData GPU_readData;
GPUreadDataMem GPU_readDataMem;
-GPUwriteStatus GPU_writeStatus;
+GPUwriteStatus GPU_writeStatus;
GPUwriteData GPU_writeData;
GPUwriteDataMem GPU_writeDataMem;
GPUdmaChain GPU_dmaChain;
CDRinit CDR_init;
CDRshutdown CDR_shutdown;
CDRopen CDR_open;
-CDRclose CDR_close;
+CDRclose CDR_close;
CDRtest CDR_test;
CDRgetTN CDR_getTN;
CDRgetTD CDR_getTD;
NETinit NET_init;
NETshutdown NET_shutdown;
NETopen NET_open;
-NETclose NET_close;
+NETclose NET_close;
NETtest NET_test;
NETconfigure NET_configure;
NETabout NET_about;
SIO1init SIO1_init;
SIO1shutdown SIO1_shutdown;
SIO1open SIO1_open;
-SIO1close SIO1_close;
+SIO1close SIO1_close;
SIO1test SIO1_test;
SIO1configure SIO1_configure;
SIO1about SIO1_about;
void *drv;
hGPUDriver = SysLoadLibrary(GPUdll);
- if (hGPUDriver == NULL) {
+ if (hGPUDriver == NULL) {
GPU_configure = NULL;
- SysMessage (_("Could not load GPU plugin %s!"), GPUdll); return -1;
+ SysMessage (_("Could not load GPU plugin %s!"), GPUdll); return -1;
}
drv = hGPUDriver;
LoadGpuSym1(init, "GPUinit");
LoadSpuSym0(about, "SPUabout");
LoadSpuSym0(test, "SPUtest");
LoadSpuSym1(writeRegister, "SPUwriteRegister");
- LoadSpuSym1(readRegister, "SPUreadRegister");
+ LoadSpuSym1(readRegister, "SPUreadRegister");
LoadSpuSym1(writeDMA, "SPUwriteDMA");
LoadSpuSym1(readDMA, "SPUreadDMA");
LoadSpuSym1(writeDMAMem, "SPUwriteDMAMem");
static int PadMode[8]; /* 0 : digital 1: analog */
static unsigned char buf[256];
-static unsigned char bufMulti[34] = { 0x80, 0x5a,
+static unsigned char bufMulti[34] = { 0x80, 0x5a,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
+
unsigned char stdpar[8] = { 0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-unsigned char multitappar[34] = { 0x80, 0x5a,
+unsigned char multitappar[34] = { 0x80, 0x5a,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
+
//response for request 44, 45, 46, 47, 4C, 4D
static unsigned char resp45[8] = {0xF3, 0x5A, 0x01, 0x02, 0x00, 0x02, 0x01, 0x00};
static unsigned char resp46_00[8] = {0xF3, 0x5A, 0x00, 0x00, 0x01, 0x02, 0x00, 0x0A};
// AA rumble large motor speed 0x00 -> 0xFF
// RESPONSE
// header 3 Bytes
- // 0x00
- // PadId -> 0x41 for digital pas, 0x73 for analog pad
+ // 0x00
+ // PadId -> 0x41 for digital pas, 0x73 for analog pad
// 0x5A mode has not change (no press on analog button on the center of pad), 0x00 the analog button have been pressed and the mode switch
// 6 Bytes for keystates
CMD_READ_DATA_AND_VIBRATE = 0x42,
-
+
// REQUEST
// Header
// 0x0N, 0x43, 0x00, XX, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// XX = 00 -> Normal mode : Seconde bytes of response = padId
// XX = 01 -> Configuration mode : Seconde bytes of response = 0xF3
// RESPONSE
- // enter in config mode example :
+ // enter in config mode example :
// req : 01 43 00 01 00 00 00 00 00 00
// res : 00 41 5A buttons state, analog states
- // exit config mode :
+ // exit config mode :
// req : 01 43 00 00 00 00 00 00 00 00
// res : 00 F3 5A buttons state, analog states
CMD_CONFIG_MODE = 0x43,
-
+
// Set led State
// REQUEST
// 0x0N, 0x44, 0x00, VAL, SEL, 0x00, 0x00, 0x00, 0x00
// RESPONSE
// 0x00, 0xF3, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
CMD_SET_MODE_AND_LOCK = 0x44,
-
+
// Get Analog Led state
// REQUEST
// 0x0N, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// VAL = 00 Led OFF
// VAL = 01 Led ON
CMD_QUERY_MODEL_AND_MODE = 0x45,
-
+
//Get Variable A
// REQUEST
// 0x0N, 0x46, 0x00, 0xXX, 0x00, 0x00, 0x00, 0x00, 0x00
// XX=01
// 0x00, 0xF3, 0x5A, 0x00, 0x00, 0x01, 0x01, 0x01, 0x14
CMD_QUERY_ACT = 0x46,
-
+
// REQUEST
// 0x0N, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
// RESPONSE
// 0x00, 0xF3, 0x5A, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00
CMD_QUERY_COMB = 0x47,
-
+
// REQUEST
// 0x0N, 0x4C, 0x00, 0xXX, 0x00, 0x00, 0x00, 0x00, 0x00
// RESPONSE
// XX = 1
// 0x00, 0xF3, 0x5A, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00
CMD_QUERY_MODE = 0x4C,
-
+
// REQUEST
// 0x0N, 0x4D, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
// RESPONSE
break;
}
}
-
+
void vibrate(int padIndex){
if (pad[padIndex].Vib[0] != pad[padIndex].VibF[0] || pad[padIndex].Vib[1] != pad[padIndex].VibF[1]) {
//value is different update Value and call libretro for vibration
stdpar[1] = 0x5a;
stdpar[2] = pad->buttonStatus & 0xff;
stdpar[3] = pad->buttonStatus >> 8;
-
+
//This code assumes an X resolution of 256 and a Y resolution of 240
int xres = 256;
int yres = 240;
-
- //The code wants an input range for x and y of 0-1023 we passed in -32767 -> 32767
+
+ //The code wants an input range for x and y of 0-1023 we passed in -32767 -> 32767
int absX = (pad->absoluteX / 64) + 512;
int absY = (pad->absoluteY / 64) + 512;
-
+
//Keep within limits
if (absX > 1023) absX = 1023;
if (absX < 0) absX = 0;
if (absY > 1023) absY = 1023;
if (absY < 0) absY = 0;
-
- stdpar[4] = 0x5a - (xres - 256) / 3 + (((xres - 256) / 3 + 356) * absX >> 10);
+
+ stdpar[4] = 0x5a - (xres - 256) / 3 + (((xres - 256) / 3 + 356) * absX >> 10);
stdpar[5] = (0x5a - (xres - 256) / 3 + (((xres - 256) / 3 + 356) * absX >> 10)) >> 8;
stdpar[6] = 0x20 + (yres * absY >> 10);
stdpar[7] = (0x20 + (yres * absY >> 10)) >> 8;
-
+
//Offscreen - Point at the side of the screen so PSX thinks you are pointing offscreen
//Required as a mouse can't be offscreen
//Coordinates X=0001h, Y=000Ah indicates "no light"
stdpar[4] = 0x01;
stdpar[5] = 0x00;
stdpar[6] = 0x0A;
- stdpar[7] = 0x00;
+ stdpar[7] = 0x00;
}
-
+
memcpy(buf, stdpar, 8);
respSize = 8;
break;
if (reqPos == 0) {
//mem the request number
req = value;
-
+
// Don't enable Analog/Vibration for a standard pad
if (in_type[port] == PSE_PAD_TYPE_STANDARD) {
; // Pad keystate already in buffer
initBufForRequest(port, value);
}
}
-
+
//if no new request the pad return 0xff, for signaling connected
if (reqPos >= respSize) return 0xff;
-
+
switch(reqPos){
case 2:
reqIndex2Treatment(port, value);
}
//printf("%2x:%2x, ",value,tmp);
return tmp;
-
+
}
PAD2_readPort2(&padd);
multitap2 = padd.portMultitap;
}
-
+
// just one pad is on port 1 : NO MULTITAP
if (multitap2 == 0) {
PadDataS padd;
if (hPAD1Driver != NULL) PAD1_shutdown();
if (hPAD2Driver != NULL) PAD2_shutdown();
- if (Config.UseNet && hNETDriver != NULL) NET_shutdown();
+ if (Config.UseNet && hNETDriver != NULL) NET_shutdown();
if (hCDRDriver != NULL) { SysCloseLibrary(hCDRDriver); hCDRDriver = NULL; }
if (hGPUDriver != NULL) { SysCloseLibrary(hGPUDriver); hGPUDriver = NULL; }