Emuforums.com

Go Back   Emuforums.com > PSX Emulation > PSX Plugin Questions & Troubleshooting
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old May 5th, 2005   #1 (permalink)
Enjoy writing plugins...
 
ZanePSX's Avatar
 
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
ZanePSX is offline   Reply With Quote
Old May 5th, 2005   #2 (permalink)
the only one you've ever SEEN
 
hushypushy's Avatar
 
Join Date: May 2003
Location: San Francisco
Posts: 21,837
thread moved to Plugin Questioning & Troubleshooting since this is a generic plugin question than one directly about PSXeven.
__________________
Dedicated to mediocrity and repetition since 1994.

2008 "How Not to Post" guide
hushypushy is offline   Reply With Quote
Old May 6th, 2005   #3 (permalink)
Enjoy writing plugins...
 
ZanePSX's Avatar
 
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.
ZanePSX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 18:05.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5