|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Enjoy writing plugins...
![]() Join Date: Nov 2002
Location: Beijing, China
Posts: 52
|
Question about writing pad plugin on PSXeven
Hi,
I'm trying to write a pad plugin on PSXeven. I've found the following description: data contents of normal PAD.(push low) byte b7 b6 b5 b4 b3 b2 b1 b0 0 --- N.A. 1 0x41 'A' 2 0x5a 'Z' 3 LEFT DOWN RGHT UP STA 1 1 SEL 4 Square X O Triangle R1 L1 R2 L2 I use the description of 3rd and 4th bytes to form "unsigned short buttonStatus" in struct PadDataS like this: 0xFFDF -> Right 0xDFFF -> Circle etc. The problem is, some games works w/o problem, but some others behave odd. It seems that 0x0020 -> Right, 0x2000 -> Circle is the right way. I think there shouldn't be any difference between games in pad processing, so there must be something wrong in my code. What's probably wrong w/ my code?
__________________
Athlon XP 2700+ / 768 M DDR SDRAM / Radeon 9700 Pro w/ 128 M DDR / 120 G Seagate + 80 G IBM / 8X DVD+-RW |
|
|
|
|
|
#3 (permalink) |
|
Enjoy writing plugins...
![]() Join Date: Nov 2002
Location: Beijing, China
Posts: 52
|
I've simplified the code to the simplest form, but the problem remains on PSXeven(no problem on other emulators):
#include <windows.h> #include "PSEmu_Plugin_Defs.h" ULONG CALLBACK PSEgetLibType() { return PSE_LT_PAD; } PCHAR CALLBACK PSEgetLibName() { return "test pad plugin"; } ULONG CALLBACK PSEgetLibVersion() { return (1 << 16) | (1 << 8) | 1; } LONG CALLBACK PADinit(LONG lFlag) { return PSE_INIT_ERR_SUCCESS; } VOID CALLBACK PADshutdown() { } LONG CALLBACK PADopen(HWND hWnd) { return PSE_PAD_ERR_SUCCESS; } LONG CALLBACK PADclose() { return PSE_PAD_ERR_SUCCESS; } LONG CALLBACK PADreadPort1(PadDataS * pData) { pData->controllerType = PSE_PAD_TYPE_STANDARD; pData->buttonStatus = 0xFFFF; if(GetAsyncKeyState(VK_RIGHT)) pData->buttonStatus = 0xFFDF; // ... return PSE_PAD_ERR_SUCCESS; } LONG CALLBACK PADreadPort2(PadDataS * pData) { return PSE_PAD_ERR_SUCCESS; } LONG CALLBACK PADquery() { return PSE_PAD_USE_PORT1 | PSE_PAD_USE_PORT2; } LONG CALLBACK PADconfigure() { return PSE_PAD_ERR_SUCCESS; } LONG CALLBACK PADtest() { return PSE_PAD_ERR_SUCCESS; } VOID CALLBACK PADabout() { }
__________________
Athlon XP 2700+ / 768 M DDR SDRAM / Radeon 9700 Pro w/ 128 M DDR / 120 G Seagate + 80 G IBM / 8X DVD+-RW Last edited by ZanePSX; May 6th, 2005 at 14:44. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|