long time, no speak...

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

long time, no speak...

Post by white rabbit »

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 :)
Last edited by white rabbit on Wed Jan 17, 2007 6:52 am, edited 1 time in total.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

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
Thanks for the very speedy reply :)

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!
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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.
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
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

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.
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 :

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.
white rabbit
Posts: 60
Joined: Wed Jul 06, 2005 7:03 pm

Post by white rabbit »

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
So I could have something like:

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&#40;MANGLED_foo&#58;&#58;MANGLED_bar&#41;;
<export myLib footer>

Code: Select all

// IMPORT CODE FILE
#include "foo.h"

void main&#40;&#41;
&#123;
  foo myFoo = new foo&#40;&#41;;
  int i = myFoo.bar&#40; 32 &#41;;
&#125;
and it would work? Or do I need ...

Code: Select all

// IMPORT CODE FILE
#include "foo.h"

void main&#40;&#41;
&#123;
  MANGLED_foo myFoo = new MANGLED_foo&#40;&#41;;
  int i = myFoo.MANGLED_bar&#40; 32 &#41;;
&#125;
??

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?
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

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 :)
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.

Code: Select all

$ usbhostfs_pc.exe -vv
USBHostFS &#40;c&#41; TyRaNiD 2k6
Root directory&#58; /home/jockyw/projects/PMPVLC009-rev4/ffplay_resample
found 5 busses
found 5 busses
found 5 busses
Accepting async connection &#40;0&#41; 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 ...
================
Post Reply