forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

long time, no speak...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Wed Jan 17, 2007 5:44 am    Post subject: long time, no speak... Reply with quote

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
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Jan 17, 2007 6:07 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Wed Jan 17, 2007 6:19 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Jan 17, 2007 6:40 am    Post subject: Reply with quote

Quote:
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
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Wed Jan 17, 2007 8:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
white rabbit



Joined: 06 Jul 2005
Posts: 60

PostPosted: Wed Jan 17, 2007 11:36 pm    Post subject: Reply with quote

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:

// HEADER FILE...
class foo
{
  foo(){};
  virtual ~foo(){};

  int bar( int toInc );
};

Code:

// EXPORTED CODE FILE...
#include "foo.h"
int foo::bar( int toInc )
{
  return toInc+1;
};

Code:

# EXPORT.EXP
<export sys stuff>
<export myLib header>
EXPORT_FUNC(MANGLED_foo::MANGLED_bar);
<export myLib footer>

Code:

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

void main()
{
  foo myFoo = new foo();
  int i = myFoo.bar( 32 );
}


and it would work? Or do I need ...

Code:

// 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?
Back to top
View user's profile Send private message
jockyw2001



Joined: 29 Sep 2005
Posts: 339

PostPosted: Sun Jan 21, 2007 7:33 pm    Post subject: Reply with quote

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:
$ 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 ...
================
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group