diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-05 07:17:39 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-05-05 07:17:39 +0000 |
| commit | ad055a84cd084b0de505fea5c61a9e3ac9ec9297 (patch) | |
| tree | d28f8f6967676c8cee0751f1731fdfb1b8d5d288 /libpcsxcore | |
| parent | fb3257e40a998d0a10c0219c159390a600c43e7c (diff) | |
| download | pcsxr-ad055a84cd084b0de505fea5c61a9e3ac9ec9297.tar.gz | |
Got rid of PAD_readPort1()/PAD_readPort2().
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@47359 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/plugins.c | 109 | ||||
| -rw-r--r-- | libpcsxcore/plugins.h | 4 | ||||
| -rw-r--r-- | libpcsxcore/psemu_plugin_defs.h | 10 | ||||
| -rw-r--r-- | libpcsxcore/sio.c | 2 |
4 files changed, 9 insertions, 116 deletions
diff --git a/libpcsxcore/plugins.c b/libpcsxcore/plugins.c index fd103d87..3d66de51 100644 --- a/libpcsxcore/plugins.c +++ b/libpcsxcore/plugins.c @@ -503,93 +503,6 @@ int LoadSPUplugin(char *SPUdll) { void *hPAD1Driver = NULL; void *hPAD2Driver = NULL; -static unsigned char buf[256]; -unsigned char stdpar[10] = { 0x00, 0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; -unsigned char mousepar[8] = { 0x00, 0x12, 0x5a, 0xff, 0xff, 0xff, 0xff }; -unsigned char analogpar[9] = { 0x00, 0xff, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - -static int bufcount, bufc; - -PadDataS padd1, padd2; - -unsigned char _PADstartPoll(PadDataS *pad) { - bufc = 0; - - switch (pad->controllerType) { - case PSE_PAD_TYPE_MOUSE: - mousepar[3] = pad->buttonStatus & 0xff; - mousepar[4] = pad->buttonStatus >> 8; - mousepar[5] = pad->moveX; - mousepar[6] = pad->moveY; - - memcpy(buf, mousepar, 7); - bufcount = 6; - break; - case PSE_PAD_TYPE_NEGCON: // npc101/npc104(slph00001/slph00069) - analogpar[1] = 0x23; - analogpar[3] = pad->buttonStatus & 0xff; - analogpar[4] = pad->buttonStatus >> 8; - analogpar[5] = pad->rightJoyX; - analogpar[6] = pad->rightJoyY; - analogpar[7] = pad->leftJoyX; - analogpar[8] = pad->leftJoyY; - - memcpy(buf, analogpar, 9); - bufcount = 8; - break; - case PSE_PAD_TYPE_ANALOGPAD: // scph1150 - analogpar[1] = 0x73; - analogpar[3] = pad->buttonStatus & 0xff; - analogpar[4] = pad->buttonStatus >> 8; - analogpar[5] = pad->rightJoyX; - analogpar[6] = pad->rightJoyY; - analogpar[7] = pad->leftJoyX; - analogpar[8] = pad->leftJoyY; - - memcpy(buf, analogpar, 9); - bufcount = 8; - break; - case PSE_PAD_TYPE_ANALOGJOY: // scph1110 - analogpar[1] = 0x53; - analogpar[3] = pad->buttonStatus & 0xff; - analogpar[4] = pad->buttonStatus >> 8; - analogpar[5] = pad->rightJoyX; - analogpar[6] = pad->rightJoyY; - analogpar[7] = pad->leftJoyX; - analogpar[8] = pad->leftJoyY; - - memcpy(buf, analogpar, 9); - bufcount = 8; - break; - case PSE_PAD_TYPE_STANDARD: - default: - stdpar[3] = pad->buttonStatus & 0xff; - stdpar[4] = pad->buttonStatus >> 8; - - memcpy(buf, stdpar, 5); - bufcount = 4; - } - - return buf[bufc++]; -} - -unsigned char _PADpoll(unsigned char value) { - if (bufc > bufcount) return 0; - return buf[bufc++]; -} - -unsigned char CALLBACK PAD1__startPoll(int pad) { - PadDataS padd; - - PAD1_readPort1(&padd); - - return _PADstartPoll(&padd); -} - -unsigned char CALLBACK PAD1__poll(unsigned char value) { - return _PADpoll(value); -} - long CALLBACK PAD1__configure(void) { return 0; } void CALLBACK PAD1__about(void) {} long CALLBACK PAD1__test(void) { return 0; } @@ -620,30 +533,17 @@ int LoadPAD1plugin(char *PAD1dll) { LoadPad1Sym1(open, "PADopen"); LoadPad1Sym1(close, "PADclose"); LoadPad1Sym0(query, "PADquery"); - LoadPad1Sym1(readPort1, "PADreadPort1"); LoadPad1Sym0(configure, "PADconfigure"); LoadPad1Sym0(test, "PADtest"); LoadPad1Sym0(about, "PADabout"); LoadPad1Sym0(keypressed, "PADkeypressed"); - LoadPad1Sym0(startPoll, "PADstartPoll"); - LoadPad1Sym0(poll, "PADpoll"); + LoadPad1Sym1(startPoll, "PADstartPoll"); + LoadPad1Sym1(poll, "PADpoll"); LoadPad1SymN(setSensitive, "PADsetSensitive"); return 0; } -unsigned char CALLBACK PAD2__startPoll(int pad) { - PadDataS padd; - - PAD2_readPort2(&padd); - - return _PADstartPoll(&padd); -} - -unsigned char CALLBACK PAD2__poll(unsigned char value) { - return _PADpoll(value); -} - long CALLBACK PAD2__configure(void) { return 0; } void CALLBACK PAD2__about(void) {} long CALLBACK PAD2__test(void) { return 0; } @@ -674,13 +574,12 @@ int LoadPAD2plugin(char *PAD2dll) { LoadPad2Sym1(open, "PADopen"); LoadPad2Sym1(close, "PADclose"); LoadPad2Sym0(query, "PADquery"); - LoadPad2Sym1(readPort2, "PADreadPort2"); LoadPad2Sym0(configure, "PADconfigure"); LoadPad2Sym0(test, "PADtest"); LoadPad2Sym0(about, "PADabout"); LoadPad2Sym0(keypressed, "PADkeypressed"); - LoadPad2Sym0(startPoll, "PADstartPoll"); - LoadPad2Sym0(poll, "PADpoll"); + LoadPad2Sym1(startPoll, "PADstartPoll"); + LoadPad2Sym1(poll, "PADpoll"); LoadPad2SymN(setSensitive, "PADsetSensitive"); return 0; diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h index 017f28eb..297327a9 100644 --- a/libpcsxcore/plugins.h +++ b/libpcsxcore/plugins.h @@ -244,8 +244,6 @@ typedef long (CALLBACK* PADshutdown)(void); typedef long (CALLBACK* PADtest)(void);
typedef long (CALLBACK* PADclose)(void);
typedef long (CALLBACK* PADquery)(void);
-typedef long (CALLBACK* PADreadPort1)(PadDataS*);
-typedef long (CALLBACK* PADreadPort2)(PadDataS*);
typedef long (CALLBACK* PADkeypressed)(void);
typedef unsigned char (CALLBACK* PADstartPoll)(int);
typedef unsigned char (CALLBACK* PADpoll)(unsigned char);
@@ -260,7 +258,6 @@ PADtest PAD1_test; PADopen PAD1_open;
PADclose PAD1_close;
PADquery PAD1_query;
-PADreadPort1 PAD1_readPort1;
PADkeypressed PAD1_keypressed;
PADstartPoll PAD1_startPoll;
PADpoll PAD1_poll;
@@ -274,7 +271,6 @@ PADtest PAD2_test; PADopen PAD2_open;
PADclose PAD2_close;
PADquery PAD2_query;
-PADreadPort2 PAD2_readPort2;
PADkeypressed PAD2_keypressed;
PADstartPoll PAD2_startPoll;
PADpoll PAD2_poll;
diff --git a/libpcsxcore/psemu_plugin_defs.h b/libpcsxcore/psemu_plugin_defs.h index baaf7836..1b16fd42 100644 --- a/libpcsxcore/psemu_plugin_defs.h +++ b/libpcsxcore/psemu_plugin_defs.h @@ -132,8 +132,8 @@ typedef struct long PADtest(void); // called from Configure Dialog and after PADopen(); long PADquery(void); - long PADreadPort1(PadDataS *); - long PADreadPort2(PadDataS *); + unsigned char PADstartPoll(int); + unsigned char PADpoll(unsigned char); */ @@ -142,9 +142,9 @@ typedef struct // notice that PSEmu will call PADinit and PADopen only once when they are from // same plugin -// might be used in port 1 (must support PADreadPort1() function) +// might be used in port 1 #define PSE_PAD_USE_PORT1 1 -// might be used in port 2 (must support PADreadPort2() function) +// might be used in port 2 #define PSE_PAD_USE_PORT2 2 @@ -194,7 +194,7 @@ typedef struct unsigned short buttonStatus; // for analog pad fill those next 4 bytes - // values are analog in range 0-255 where 128 is center position + // values are analog in range 0-255 where 127 is center position unsigned char rightJoyX, rightJoyY, leftJoyX, leftJoyY; // for mouse fill those next 2 bytes diff --git a/libpcsxcore/sio.c b/libpcsxcore/sio.c index c3293ef4..8a91ec2a 100644 --- a/libpcsxcore/sio.c +++ b/libpcsxcore/sio.c @@ -42,8 +42,6 @@ static unsigned int mcdst,rdwr; static unsigned char adrH,adrL; static unsigned int padst; -PadDataS pad; - char Mcd1Data[MCD_SIZE], Mcd2Data[MCD_SIZE]; // clk cycle byte |
