Hi guys,
I've finally moved house and got most of the inital work on it out of the way, so I want to start PSP dev again now 2007 has rolled around and to make up for me pretty much just gaving up in 2006 :(
I'm coming back to my code, and as always happens, I keep thinking "why the hell did I do it like that?!"
A quick few questions:
1 - What firmware should I be on now for development?
2 - What version of the PSP SDK should I get (given that I can't get SVN working :() - e.g. has much changed in the last 6 months?
3 - I've just started taking my c++ statically linked code for my 3D organic meshes and turning them into PRXs, but I can't get my head around exporting classes. I've done a search, but the forum doesn't seem to shed any light... I guess I should get the newest SDK I can and check out the tutorials and hope some c++ classes are already in there?
Hope everybody is ok :)
TyRiNaD - I have the 2.0 PSPLink - yet again I take my hat off to you on creating an amazing tool for PSP dev :)
long time, no speak...
-
- Posts: 60
- Joined: Wed Jul 06, 2005 7:03 pm
long time, no speak...
Last edited by white rabbit on Wed Jan 17, 2007 6:52 am, edited 1 time in total.
1. Up to you, amazingly I now run 3.03oe for my development purposes (although I still have my 1.0 tucked away). As you can use psplink even in 3.03 mode it is quite convinient :)
2. Get SVN working :P It hasn't changed massively but it has changed. Maybe ill do a new source release soon.
3. Exporting classes will be a bitch :P Two possibilities, first compile your c++ classes and determine the mangled names and set them in the export.exp file, painful but possible. The other would be to create a class factory with the implementation inside the prx, now as long as the functions are all virtual in theory you should be able to call them without linking across the real functions, maybe. Either way isn't pleasant. Maybe just dont bother :P
You could of course spell my name right :P
2. Get SVN working :P It hasn't changed massively but it has changed. Maybe ill do a new source release soon.
3. Exporting classes will be a bitch :P Two possibilities, first compile your c++ classes and determine the mangled names and set them in the export.exp file, painful but possible. The other would be to create a class factory with the implementation inside the prx, now as long as the functions are all virtual in theory you should be able to call them without linking across the real functions, maybe. Either way isn't pleasant. Maybe just dont bother :P
You could of course spell my name right :P
-
- Posts: 60
- Joined: Wed Jul 06, 2005 7:03 pm
Thanks for the very speedy reply :)TyRaNiD wrote:1. Up to you, amazingly I now run 3.03oe for my development purposes (although I still have my 1.0 tucked away). As you can use psplink even in 3.03 mode it is quite convinient :)
2. Get SVN working :P It hasn't changed massively but it has changed. Maybe ill do a new source release soon.
3. Exporting classes will be a bitch :P Two possibilities, first compile your c++ classes and determine the mangled names and set them in the export.exp file, painful but possible. The other would be to create a class factory with the implementation inside the prx, now as long as the functions are all virtual in theory you should be able to call them without linking across the real functions, maybe. Either way isn't pleasant. Maybe just dont bother :P
You could of course spell my name right :P
I've heard a couple of people on another site I use (oddly about cars though, and not console dev) 3.03oe, thought they were talking rubbish, but I guess I'm just too harsh. I'll have a looksee :)
I'll have a go, but this laptop is pretty old, but I love M$ Visual Studio 2005 (I know that means I will burn in hell for eternity, but hey ho) so don't want to use linux on it just to get SVN working, maybe I need to have a proper dig around on CygWin.
Damn and blast! I'll have a go at using virtuals as I'm not sure if I can use the h file to map to the mangled names? Maybe I just need to give up and port them to c, but I really don't like that idea as my code structure is ok even though some of my implimentation is questionable in places.
Sorry mate! I'm never any good at that sort of thing ;) I'll have to write your name out 100 times then I won't forget, of course, copy paste is easy ;o)
TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD TyRaNiD
HeHe!
Well the mangled names are auto generated, you dont have to worry about them if you have a h file normally, it is only when you need to link things together and the sdk provides no means of flagging an exported function or class inside the code so you have to pull the mangled names from the gcc output and put them in export.exp yourself. Of course I could probably do something about that :PDamn and blast! I'll have a go at using virtuals as I'm not sure if I can use the h file to map to the mangled names? Maybe I just need to give up and port them to c, but I really don't like that idea as my code structure is ok even though some of my implimentation is questionable in places.
very long time ago, not on psp but for my own OS on a 486, i tried to rename c++ functions. If i remember well. It was something like :white rabbit wrote:Damn and blast! I'll have a go at using virtuals as I'm not sure if I can use the h file to map to the mangled names? Maybe I just need to give up and port them to c, but I really don't like that idea as my code structure is ok even though some of my implimentation is questionable in places.
class XXX : ...
{
...
int doSomething(int aint) asm("xxx_doSomething");
int doSomething(int aint);
...
}
the method will be output with this name instead of a mangled one.
Of course it must be declared in a header, not in a source so other people can link with such a library.
but well, it was a long time ago.
-
- Posts: 60
- Joined: Wed Jul 06, 2005 7:03 pm
So I could have something like:TyRaNiD wrote: Well the mangled names are auto generated, you dont have to worry about them if you have a h file normally, it is only when you need to link things together and the sdk provides no means of flagging an exported function or class inside the code so you have to pull the mangled names from the gcc output and put them in export.exp yourself. Of course I could probably do something about that :P
Code: Select all
// HEADER FILE...
class foo
{
foo(){};
virtual ~foo(){};
int bar( int toInc );
};
Code: Select all
// EXPORTED CODE FILE...
#include "foo.h"
int foo::bar( int toInc )
{
return toInc+1;
};
Code: Select all
# EXPORT.EXP
<export sys stuff>
<export myLib header>
EXPORT_FUNC(MANGLED_foo::MANGLED_bar);
<export myLib footer>
Code: Select all
// IMPORT CODE FILE
#include "foo.h"
void main()
{
foo myFoo = new foo();
int i = myFoo.bar( 32 );
}
Code: Select all
// IMPORT CODE FILE
#include "foo.h"
void main()
{
MANGLED_foo myFoo = new MANGLED_foo();
int i = myFoo.MANGLED_bar( 32 );
}
Maybe I should try rather than just ask - I'll go and have a play after work tonight :p
ETA - I'm thinking that actually that may not work as the code that imports will not know that the function is part of a class so will the stack be prepared for the "this" pointer?
-
- Posts: 339
- Joined: Thu Sep 29, 2005 4:19 pm
How did you do that? I can't get psplink to work on 3.03oeB: I've updated pspsdk and built a fresh psplink version. I'm using the usb version for psplink.ini and copied the 1.50 release to GAME150. If I start usbhostfs_pc it repeatedly shows "found 5 busses". If I start psplink on PSP, it connects and after starting Pcterm it says "Accepting async connection (0) from 127.0.0.1" (see below), but no command works.TyRaNiD wrote:1. Up to you, amazingly I now run 3.03oe for my development purposes (although I still have my 1.0 tucked away). As you can use psplink even in 3.03 mode it is quite convinient :)
Code: Select all
$ usbhostfs_pc.exe -vv
USBHostFS (c) TyRaNiD 2k6
Root directory: /home/jockyw/projects/PMPVLC009-rev4/ffplay_resample
found 5 busses
found 5 busses
found 5 busses
Accepting async connection (0) from 127.0.0.1
found 5 busses
...
EDIT: Sorry, please ignore this question! I forgot to put libusb.a and usb.h in the release dirs. Now it works fine. Stupid me ...
================