Preliminary Python port

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

Moderators: cheriff, TyRaNiD

Post Reply
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Preliminary Python port

Post by fraca7 »

Hello. I've just "released" a preliminary port of the Python programming language for the PSP, with bindings for the essential PSP APIs as well as part of pspgu.

More details on my blog: http://fraca7.free.fr/blog/

Feedback is welcome.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

the screenshot looks promising.. have you implemented full 32-bit color?
Chaosmachine Studios: High Quality Homebrew.
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Post by fraca7 »

Yes. The initial goal was to wrap enough of libpspgu to port one of the samples to Python, so the sceGuDrawArray function is part of it. Unfortunately, the API is not quite Pythonic; you have to do low-level stuff with the struct module. This will change soon.
Istari
Posts: 10
Joined: Fri Sep 30, 2005 2:34 am

Post by Istari »

I have been trying to build, using the code from your repository. And I'm getting errors. The command I use is:

Code: Select all

python-psp/PSP$ make
How do you fix the undefined reference to _stat?
It seems to me that you are using some voodoo to build, and haven't put all the nessecary code in svn. ;) (Please correct me if I'm wrong)

Is there any particular reason why you aren't using SWIG, or something similar, to wrap the SDK?
nashdj
Posts: 3
Joined: Tue Jan 27, 2004 1:18 am

Post by nashdj »

Istari wrote:I have been trying to build...
I just checked out and built revision 13 with no problems.
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Post by fraca7 »

I also got the _stat problem using an older version of psptoolchain. Just update it and it will be OK.
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Post by fraca7 »

Istari: About SWIG. Apart from the classic Bison/Flex pair, I don't trust a computer program to generate correct C code. Hell, I don't even trust most C programmers to generate correct C code, for that matter.

The Python/C API is so simple and elegant that I just use it directly. It may be kind of repetitive, but hey, it's C. It's always been.
Istari
Posts: 10
Joined: Fri Sep 30, 2005 2:34 am

Post by Istari »

OK. Fixed after I did a

Code: Select all

svn update
in the toolchain directory (It would have helped to notice that particular line in the docs sooner), followed by a rebuild of the toolchain.

Thanks for the help, and thanks for porting my favorite language to the PSP.
fraca7
Posts: 21
Joined: Mon Oct 03, 2005 12:55 am
Location: Paris
Contact:

Post by fraca7 »

No sweat. It's also my favorite language :)

But there's still much to do. I've set up a simple Web page to keep track of evolutions, at the following URL:

http://fraca7.free.fr/pythonpsp/

If the project goes well, this will be enhanced later. Maybe moved to Sourceforge, or rather on the pspdev SVN repository. Who knows.
Post Reply