Emuforums.com

Go Back   Emuforums.com > PS2 Emulation > PS2 Plugin Questions & Plugin Troubleshooting
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read

WON'T YOU JOIN US?
You are not a registered member and
are viewing this site as a guest.
Registration is simple and FREE.
Join this CrowdGather community today.
Registration offers the following perks:

» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging

join

Reply
 
Thread Tools Display Modes
Old July 17th, 2007, 14:32   #1
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
how to create plugins for pcsx2 ???

hello, it's again me.
I would like how do I can create plugins for pcsx2.

bye.
Luigi__ is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old July 17th, 2007, 16:18   #2
NeXaR
PCSX2 Team Worshipper
 
NeXaR's Avatar
 
Join Date: Jan 2007
Location: Spain
Posts: 126
My guess is: if you have to ask this question, you probably can't
__________________
Intel Core2Quad q6600 G0 @3.0Ghz
Asus Striker Extreme
2 x 2Gb Corsair Dominator
2 x XFX8800GTX SLi
Aerocool HorsePower 750W
320Gb SataII Western Digital
Sata Pioneer DVD-RW drive


NeXaR is offline   Reply With Quote
Old July 17th, 2007, 18:20   #3
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
nothing is impossible. That could be very difficult, but not impossible.

bye.
Luigi__ is offline   Reply With Quote
Old July 17th, 2007, 19:15   #4
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
Alright, let's start off with these questions. Can you code? Ever programmed a .dll file before? Do you know anything about graphics programming? Do you know anything about emulation programming? Anyway...

First of all, coding a GS plugin is NOT a walk in the park. If you are just beginning to learn C++ and Direct3D, this is not something I'd reccomend you attempt.

But I'm not going to discourage you one bit. To start off with, here's a check list of things you should know/have before beginning your GS plugin:

1. You should at least know how to code with C or C++. I personally reccomend 100% pure C, but C++ will work fine as long as don't over use OOP or use it improperly.

2. Don't just know your target API (Direct3D, OpenGL, etc.), master it! You will need a WIDE knowledge of your target API before beginning.

3. Get comfortable with programming in the specific OS you wish to use. Windows and Linux.

4. Learn a thing or two about emulation. If you don't know anything about emulation coding in general (i.e. what a CPU/GPU interpreter is) then you should not be writing a plugin. Go to emutalk.com. I have dedicated a thread to emu programming tutorials there.
Neat emulator programming tutorial - EmuTalk.net

5. Learn to code some apps for the PS2. This will help you more than ANYTHING! go to PS2DEV.ORG: Playstation Programming - ;. You will learn much about the GS and how it interacts with the PS2 as a whole. Start off simple, then get complicated! Catch my drift?

6. Now you are ready to begin writing your plugin. Familiarize yourself with the PS2E plugin API. Read the PS2Edefs.h to learn what you need to implement for your plugin to work.

7. Get as much documentation on the GS and the PS2 as you possibly can. Do a google search or ask someone.

8. Write your plugin. If you are successful, submit it to the pcsx2 team so they can check it out so they can verify your work. Try not to base your plugin off another if you can help it. It's ok to do this, but if your plugin looks like a clone of another, then you will look like a theif.

I hope this goes well for you. Please don't hesitate to ask someone like refraction, chaoscode, or any pcsx2 dev like shadow, asadr, saqib for help. Best of luck.
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!
blueshogun96 is offline   Reply With Quote
Old July 17th, 2007, 20:44   #5
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
He didn't say GS plugin. If he were just considering writing a pad plugin, it's not too hard. Anything else requires a lot more knowledge about the PS2. Next, in order of difficulty, would probably be a CDVD plugin (Since there are open source samples, and it's much simpler than sound or graphics).

Not sure how the others would rank. If you had the PS2 low level specs, writing an HDD emulator might not be too bad (Though I could be wrong). Not sure there's really much point in that, though.

Sound and GS plugins are pretty clearly the most difficult.


Regardless, as NeXaR said: If you have to ask, you probably can't.
ChickenLiver is offline   Reply With Quote
Old July 17th, 2007, 21:05   #6
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
chickenliver is right. I never said "GS Plugin", I just said "plugin", that can be pad plugin, usb plugin, firewire plugin (but I don't have any Firewire port on my pc )or dev9 plugin, maybe sound plugin.
I don't know very much c++ but I have Microsoft Visual Studio .
I don't know direct3d at all , so I won't create a gs plugin.
I opened the sources of UsbLinuz (a null plugin), I understood that Ps2Edefs.h is the api of pcsx2 and contains the functions for each type of plugin.
I understood how works the "plugin version", the needed versions are shown in a file but I don't remember the name of this file.

really I intend writing an usb plugin for pcsx2, this is missing (Usbnull is a null plugin and it does nothing) and Usb devices are used by some games like Eyetoy Play (webcam) or Buzz (buzzers).
I said that will be difficult but not impossible. Nothing is impossible.

bye.

Last edited by Luigi__; July 17th, 2007 at 21:12.. Reason: Automerged Doublepost
Luigi__ is offline   Reply With Quote
Old July 17th, 2007, 21:26   #7
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
Well, you never specified and usually that's what people ask for. But now you know what you need to know just in case you want to go for the GS, and still, most of the stuff I just said applies to any plugin

If you're wanting to write a USB plugin, get some documentation on how USB works first. Then find some documentation on what USB device you're trying to emulate. A great thing to do is this: Let's say you want to emulate GunCon. If possible, try to find some homebrew apps that use the GunCon or write some of your own (see the links I gave you earlier). Test them on a PS2 to make sure they work. If they do, test them on your plugin to make sure you get the same results. That's basically what I do for my projects although I'm not doing anything PS2 related right now Best of luck though
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!
blueshogun96 is offline   Reply With Quote
Old July 17th, 2007, 21:57   #8
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
Ahh...So you do have a clue (No offense, but a fair number of people ask similar questions and know nothing about coding, and imagine spending very little time to get something doing exactly what they want). Then you could probably do it, with enough work. You might want to wait until you're more familiar with a programming language, though. Understanding headers (Or code) at a high level is a lot different from actually implementing them.

I considered writing a USB plugin myself at one point, but it didn't seem worth the effort, as I don't have a whole lot of games that take advantage of it.

You'd probably want to do high level emulation. Write an emulator that mimics a specified device/set of devices rather than one that maps PS2 USB calls to PC device USB calls. Otherwise, you'd have to have exclusive low-level device access to USB devices.

I'd start by learning how things work on the PS2 side, myself. USBRead/Write obviously adhere to some addressing scheme that you should start by learning. This could be some standard USB addressing scheme, come to think of it, but I don't think it is.

Last edited by ChickenLiver; July 17th, 2007 at 22:53..
ChickenLiver is offline   Reply With Quote
Old July 17th, 2007, 22:31   #9
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
I think I must redirect the PS2 usb data to the selected port among the ports of my pc, and redirect the data sent by the peripheral connected to the selected port to pcsx2. and twice because the ps2 has 2 usb ports. This looks easy but it isn't. But with it games like Eyetoy Play, using usb devices, could be Ingame, or Playable, instead of Intro.
I tried Eyetoy (the original dvd) on pcsx2, I got the lang selection menu, I could select a language but I couldn't validate because the game needs the Eyetoy camera, so a purple background appears instead of the image that the webcam sees.

bye.
Luigi__ is offline   Reply With Quote
Old July 17th, 2007, 22:56   #10
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
Ahh...I was thinking more along the lines of emulating a USB HDD or similar.

For Eyetoy (Which I've never heard of), you'd probably want to use low level emulation, as blueshogun96 suggested.
ChickenLiver is offline   Reply With Quote
Old July 18th, 2007, 00:04   #11
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
emulating the EyeToy is going to be tough. I called myself trying to write one about 2 years ago, but I lost the source code to that plugin as well as other plugins I was working on when my backup HDD went corrupt on me. Sir GiGaHerz was also starting a eyetoy plugin, but never could get it to work. Good luck either way

EDIT: Below is an old GS plugin that I wrote a long time ago. It used DirectDraw/Direct3D7 for graphics. It's outdated and obsolete (meaning the plugin specs predate the requirements for PCSX2 0.9x). The last build was lost when my HDD went corrupt. Ever since then, I never worked on it again. It was even starting to run games that GSdx9 would choke on (never tested it against ZeroGS because my video card was crap). Of course you could always update the plugin specs and it would work again, but I never felt like it. If you ever want to, you can base a GS plugin off of this one. I'm pretty sure it's simple and easy to understand since it was written mostly in 100% pure C.
Attached Files
File Type: rar GSrex_src_0.1b_Mar3_2006.rar (98.8 KB, 36 views)
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!

Last edited by blueshogun96; July 18th, 2007 at 03:28..
blueshogun96 is offline   Reply With Quote
Old July 18th, 2007, 10:11   #12
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
I've got the Eyetoy camera as I have got the Playstation 2.
The task is to redirect the images that the camera sees to pcsx2.
Blueshogun96, that is kind of you for your old gs plugin (gsrex). I tried to build it with my Microsoft Visual C++ compiler, but this compiler found exactly 1088 errors . It always finds errors with sources that I didn't make .
What compiler have you used for build your gs plugin?

bye.
Luigi__ is offline   Reply With Quote
Old July 18th, 2007, 14:34   #13
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
Visual C++ (2003, I believe). You can tell by the vcproj file and its contents. You'll need to have the DirectX SDK installed, however, presumably, and the Windows libraries as well if you don't already.

Last edited by ChickenLiver; July 18th, 2007 at 17:36..
ChickenLiver is offline   Reply With Quote
Old July 18th, 2007, 16:58   #14
Luigi__
Formerly NHervé
 
Luigi__'s Avatar
 
Join Date: Jul 2007
Location: Peach__'s castle
Posts: 818
I can't open the .vcproj files, I need .dsp or .dsw files.
Sure I have DirectX, I have Windows Vista so I have DX10.

bye.
Luigi__ is offline   Reply With Quote
Old July 18th, 2007, 17:40   #15
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
You need the DirectX SDK (Software development kit), not just the runtime dlls. It includes headers and library files needed for compilation and linking.

Ahh...So you have Visual C++ 6.0? You can download 2005 express for free from Microsoft's site. You could also probably manage to compile it with 6.0 if you set up your environment right. You'd need to add the DirectX SDK library and include directory to your paths and add the correct lib files to be linked to in your project options, however. The latest SDK may not work with Visual C++ 6.0 without a bit of work, however. I recommend you upgrade. I don't believe the express edition download includes the Windows SDK, either, so you'd need to download that as well.

Last edited by ChickenLiver; July 18th, 2007 at 17:46..
ChickenLiver is offline   Reply With Quote
Old July 18th, 2007, 17:50   #16
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
Yeah, you're going to need DirectX SDK (DirectX 7 or later) in order to compile and link this plugin. And yeah, I used Visual Studio 2003 (v7.1) to build this project. There are alot of project specific options used so just throwing them in a new VS6.0 project without setting up the compiler isn't going to work. AFAIK, the latest SDK should work fine with VS6.0, but you'll have to set up the projects yourself. But I do recommend you getting an upgrade. I use Visual Studio 6, 7.1 (2003) and 8.0 (2005) all on the same comp. So there's no need to uninstall your previous one.
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!
blueshogun96 is offline   Reply With Quote
Old July 18th, 2007, 18:07   #17
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
I'm pretty sure the most recent version of d3dx9.lib does not work with VC 6.0. You can find compatible versions of the library, but if you download the normal version of the SDK, you won't be able to compile anything that uses it. I have no idea if you'd need this file when compiling a DirectX 7 app, though my copy of the SDK has no d3dx7.lib.
ChickenLiver is offline   Reply With Quote
Old July 18th, 2007, 22:32   #18
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
Quote:
Originally Posted by ChickenLiver View Post
I'm pretty sure the most recent version of d3dx9.lib does not work with VC 6.0. You can find compatible versions of the library, but if you download the normal version of the SDK, you won't be able to compile anything that uses it. I have no idea if you'd need this file when compiling a DirectX 7 app, though my copy of the SDK has no d3dx7.lib.
Hmmm. I'm assuming you never programmed Direct3D 7 before?

There is no such lib as d3dx7.lib. Back in the old Direct3D Immediate Mode days, every version of Direct3D (up to 7) used the same lib, same header file, and the same .DLL (d3d.lib, d3d.h, and d3d.dll). The only exception is the D3DX library. You need d3dx.lib to link it. It should be there.

Anyway, I'll check to see if the latest SDK will work with 6.0 later. I don't see why the .lib file won't be compatible with VS6.0 though.
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!
blueshogun96 is offline   Reply With Quote
Old July 18th, 2007, 22:51   #19
ChickenLiver
Emu author
 
Join Date: Apr 2006
Location: Perdition
Posts: 590
Nope, never used it, though I also don't trust Microsoft not to rename a library file. d3dx9.lib is obviously for dx9, but for backward compatibility, wasn't sure whether it was used or not.

If you google the file name along with visual studio 6.0, you'll find claims that d3dx9.lib is not compatible with it, as of the summer 2004 update.
ChickenLiver is offline   Reply With Quote
Old July 18th, 2007, 23:26   #20
blueshogun96
Last Xbox Emu Author
 
blueshogun96's Avatar
 
Join Date: Jun 2004
Location: Seattle, WA, USA
Posts: 5,843
Is that so? I installed A DirectX SDK from 2005 on my laptop running Win98 and VS6.0 and all the samples compiled OK, and that laptop only supports D3DDEVTYPE_REF and D3DDEVTYPE_SW, no D3DDEVTYPE_HAL.
__________________

Official Website of Shogun3D's RyuAwai!

Shogun3D Game Development Blog

Zengjük a Dalt: Manliest Song Ever!
blueshogun96 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

Forum Jump

All times are GMT +1. The time now is 10:17.

© 2006 - 2012 Emu Forums | About Emu Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.