Monday, June 18, 2007

About 3 weeks ago, I got a Sony PSP, since only playing games isnt enought for me, I started fiddling around for so called "Homebrew" software for it.

The homebrew community for PSP is quite big and mostly around C coding but surprisingly I found that a guy named Jerome made Python-psp, awesome port of Python 2.4.3 and PSP graphic, sound and network API to Python modules.

Based on that and my bare knowledge of C, I decided to start working on a Stackless Python port for it.

I recently saw the great work from Richard Tew in porting Stackless to Nintendo DS and decided to give a try. Checked out the 2.4.3 PSP port from python-psp repository and merged the Stackless 2.4.4 tag into it.

The first thing to be done, was fixing up some conflicts mostly related to IO and threads. Next Richard pointed me out that the Stackless needs to save and restore stack pointers and this is done in assembly.

Based on trial and error, it took me a day to figure out and have a compiled interpreter.

To finish it all, I ran the stackless unittests and some Stackless applications from the Stackless Examples Project and found that its all working.

I hope other people could try it out and maybe find some bugs, probably I will make the source available and the diff patches too.

The next thing in my roadmap is porting Python and Stackless Python 2.5.1 to PSP, hope it wont be much trouble.

The download is temporarily stored on Stackless Examples project. As soon as I decide to host it or anyone else do, it will be here:

http://stacklessexamples.googlecode.com/files/PSP-Stackless-2.4.4.zip

To install just create a folder in your /PSP/GAME150 folder and place the EBOOT.PBP there.
The python folder is the libraries and must be placed on your memory stick root.

For more information check the Python-psp page.

Thanks a lot for Jerome for the amazing work on the Python port and Richard Tew for the Stackless porting!

Any questions contact me directly.

14 comments:

Carlos Eduardo said...

The download is temporarily stored on Stackless Examples project. As soon as I decide to host it or anyone else do, it will be here:

http://stacklessexamples.googlecode.com/files/PSP-Stackless-2.4.4.zip

To install just create a folder in your /PSP/GAME150 folder and place the EBOOT.PBP there.
The python folder is the libraries and must be placed on your memory stick root.

For more information check the Python-psp page.

stacey said...

Sounds interesting. I use the existing python psp to make a few games.

Do you know if this links to the OldSchool library graphics engine or the psp2d engine?

Thanks

Stacey

Carlos Eduardo said...

It kept all compatibility to the existing Python port.

Its your option to use psp2d or OS Lib... just like the original PSP-Python.

johannsen said...

Nice to see someone picking up on the Python-for-PSP front. I've been putting off learning Python since there didn't seem to be much homebrew action lately.

If you don't mind a rather newbie question: Will the Livewires module work with PSP Python, or will I have to hope that someone creates a PSP version someday?

Anonymous said...

do you think the psp gps will be available in psp python soon?

greg said...

where do we contact you directly? 'script.py' seems to be missing from PSP-Stackless-2.4.4.zip.

$ cat pytrace.txt
Python-PSP started Thu Jan 1 19:00:50 1970

Free memory: 736512
Search path: lib/python21.zip;ms0:/python/site-packages;ms0:/python

Error - could not open script.py

Carlos Eduardo said...

Answering some questions above, here I go..

johannsen - based on what I read about, the Livewires module depends on Pygame. Since Pygame hasnt been ported to PSP, this module wont work. you can check the Python-psp page for some examples.

anonymous - I dont know about the GPS but if the APIs to access it are available in C, a module can be made for python.

greg - Take a look on the pages in my post... the Python-PSP for Python examples and the Stackless Examples page for its examples... I think that with this you will start coding in Python in no time.

Probably I will make a post with examples and first steps using Stackless on PSP in a few days.

johannsen said...

Thanks for the answer, Carlos. Keep up the good work, and don't let the trolls on PSP Updates put you down!

Anonymous said...

nice to hear but how can i run a sample, i installed your psp-package... and the next steps?

Xavier said...

Is it possible to add video playback support?

Anonymous said...

Stackless Python Tutorials and Resources
http://islab.org/stackless/

Anonymous said...

Thank you Carlos! I have just one request, that you compile against one of the newer firmware's, such as the 4.01 m33 kernels, since I can't run 1.50 kernels on my PSP slim... :(

Thanks!

Carlos Eduardo said...

The latest version of PSP Stackless Python can be found on http://code.google.com/p/pspstacklesspython/

It has been converted to User mode and runs on any PSP.

Nebelum said...

Hello Carlos, first of all thanks for the Python port!

Just a quick question that I'm wondering is if there will be IR port access integrated into Stackless Python-PSP. I know in the now-defunct (i.e. no longer maintained) Python-PSP port originally by fraca7, there is IR port access.

Will you be adding it to Stackless Python-PSP anytime in the future?

Post a Comment