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 

[ANN] Python for PSP

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



Joined: 03 Oct 2005
Posts: 21
Location: Paris

PostPosted: Mon Nov 14, 2005 1:17 am    Post subject: [ANN] Python for PSP Reply with quote

is ready, and the PSP modules are somewhat usable. Downloads and documentation here:

http://fraca7.free.fr/pythonpsp/
Back to top
View user's profile Send private message Visit poster's website
flaxum



Joined: 13 Oct 2005
Posts: 4

PostPosted: Mon Nov 14, 2005 4:16 am    Post subject: Reply with quote

Thanks a lot!
This is absolutely amazing!
(No more mindless compiling to write a simple program!)
Back to top
View user's profile Send private message
Radleb



Joined: 14 Nov 2005
Posts: 1

PostPosted: Mon Nov 14, 2005 10:03 am    Post subject: Reply with quote

If u had ported Python Languaje to PSP could you do the same with PHP?
Since both are scripting languaje, and sometimes even share some sintaxis.
Could be posible to port PHP now?
Cya!

Radleb
Back to top
View user's profile Send private message
sherpya



Joined: 03 Oct 2005
Posts: 61

PostPosted: Mon Nov 14, 2005 9:28 pm    Post subject: Reply with quote

php is not as good as python as standalone language, it's mainly used for web applications, an intresting stuff can be porting spidermonkey js engine, I've yet made a js shell with addons command for win32/unix, I may look for a psp port, I can re-use python psp module and convert it for use with js
Back to top
View user's profile Send private message
stinkymeat



Joined: 18 Oct 2005
Posts: 10

PostPosted: Tue Nov 15, 2005 8:59 am    Post subject: Reply with quote

Woo! Yay! Good work!
Back to top
View user's profile Send private message
benob



Joined: 16 Nov 2005
Posts: 1

PostPosted: Wed Nov 16, 2005 6:36 am    Post subject: psp python idea Reply with quote

why not porting pygame to python/psp. this lib is a frontend to sdl and is growing in popularity : there are more and more games created with it. (http://www.pygame.org)
Back to top
View user's profile Send private message
fraca7



Joined: 03 Oct 2005
Posts: 21
Location: Paris

PostPosted: Fri Nov 18, 2005 1:57 am    Post subject: Reply with quote

I've thought about porting pygame, but I wonder if it's not a bit heavy, compared to an ad hoc API... Maybe I'll give it a try anyway.
Back to top
View user's profile Send private message Visit poster's website
stinkymeat



Joined: 18 Oct 2005
Posts: 10

PostPosted: Sun Nov 20, 2005 2:28 am    Post subject: Reply with quote

According to psp2d module transform can be applied to images and pretty much anything (the way i understand it) what about screen. Is it like opengl where you move the scene, or do you move the screen or all the elements - docs say taht image transform is slow and screen uses hardware accl...
Back to top
View user's profile Send private message
fraca7



Joined: 03 Oct 2005
Posts: 21
Location: Paris

PostPosted: Sun Nov 20, 2005 6:45 am    Post subject: Reply with quote

Transformations are a half-assed attempt to generalize pixel-based effects on an image, or the screen. Since they operate pixel by pixel and each pixel may be affected arbitrarily through a user-defined callback, there is no way it can be hardware accelerated. It's only intended to pre-calculate some sophisticated visual effects.

As a matter of fact, I don't even know if this class will make it in the final release, I'm not sure it's actually of any use in practice :)

I'll update the wiki tomorrow with detailed information and examples of the stuff that is not covered int the tutorial, including tranformations.
Back to top
View user's profile Send private message Visit poster's website
stinkymeat



Joined: 18 Oct 2005
Posts: 10

PostPosted: Sun Nov 20, 2005 10:07 am    Post subject: Reply with quote

Good stuff, nice to see that you are committed to a project :D
Back to top
View user's profile Send private message
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Sat Jan 14, 2006 3:46 pm    Post subject: Reply with quote

Any hints on how to build Python? I put together this command line but I just get errors:

Quote:
CXX=psp-g++ LDFLAGS="-L`psp-config --pspsdk-path`/lib -lstdc++ -lpsplibc -lpspkernel -lpspuser" ./configure --host=psp --prefix=`psp-config --psp-prefix`
...
psp-gcc -c -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Modules/python.o Modules/python.c
psp-gcc: unrecognized option '-no-cpp-precomp'
cc1: error: unrecognized command line option "-Wno-long-double"
make: *** [Modules/python.o] Error 1
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Jan 14, 2006 4:10 pm    Post subject: Reply with quote

See http://fraca7.free.fr/pspwiki/doku.php?id=installation, "Building Python for PSP"
Back to top
View user's profile Send private message
mstrhelix



Joined: 10 Feb 2006
Posts: 7

PostPosted: Fri Feb 10, 2006 11:34 am    Post subject: Reply with quote

Ok i just recently d-loaded the python interpreter for PSP and i want to contribute to the scene but I cannot seem to find anywhere a PSP2D module that is for PSP. I cannot compile one but would like to develope in Python. can anyone please post a link or tell me where to get it. I went to the PSP Python wiki and looked all over with no luck for d-load anything but source code.
Back to top
View user's profile Send private message Send e-mail
Elric



Joined: 16 Feb 2007
Posts: 2

PostPosted: Fri Feb 16, 2007 5:25 am    Post subject: Reply with quote

I know that the psp-python site is down temporarily for construction, but has anyone mirrored the old site or made files available for doing development in the interim while the "official" site is down?

I'd like to try some PSP development and python would be my preferred language. Based on googling and searching here, it seems like the port was pretty stable/usable before the site went down.

Thanks for any info/ideas!! :)
Back to top
View user's profile Send private message
Jai_Guru



Joined: 13 Aug 2006
Posts: 12

PostPosted: Fri Feb 16, 2007 10:25 am    Post subject: Reply with quote

Can VPython be used with this?
http://www.vpython.org/
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Feb 16, 2007 10:37 am    Post subject: Reply with quote

Elric wrote:
I know that the psp-python site is down temporarily for construction, but has anyone mirrored the old site or made files available for doing development in the interim while the "official" site is down?

I'd like to try some PSP development and python would be my preferred language. Based on googling and searching here, it seems like the port was pretty stable/usable before the site went down.

Thanks for any info/ideas!! :)


Well, I'm glad I got the stuff when I did (Jan 11, 2007). Hopefully it isn't down long.

I play the solitaire game that was on that site quite often. It's definately stable.
Back to top
View user's profile Send private message AIM Address
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Fri Feb 16, 2007 11:39 pm    Post subject: Reply with quote

Hi!
J.F. wrote:
I play the solitaire game that was on that site quite often. It's definately stable.

The last release fixed a memory leak in fonts, but broke drawing fonts over images....but it's stable. :)

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
Elric



Joined: 16 Feb 2007
Posts: 2

PostPosted: Sat Feb 17, 2007 2:38 am    Post subject: Reply with quote

sakya wrote:
Hi!
J.F. wrote:
I play the solitaire game that was on that site quite often. It's definately stable.

The last release fixed a memory leak in fonts, but broke drawing fonts over images....but it's stable. :)

Ciaooo
Sakya


Anyone have a pointer to a spot where the last stable build can be downloaded while the main site is down? Thanks!
Back to top
View user's profile Send private message
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Sat Feb 17, 2007 2:46 am    Post subject: Reply with quote

Hi!
Elric wrote:
Anyone have a pointer to a spot where the last stable build can be downloaded while the main site is down? Thanks!

You can download from here the latest eboot with a test script that shows the font bug. :)
It's not the "original" release...I've only converted it for FW 1.50 and added the icon.

http://www.MegaShare.com/112221

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
fraca7



Joined: 03 Oct 2005
Posts: 21
Location: Paris

PostPosted: Sat Feb 17, 2007 9:16 pm    Post subject: Reply with quote

I just fixed the font drawing bug. Binary release at the usual place:

http://fraca7.free.fr/EBOOT.PBP
Back to top
View user's profile Send private message Visit poster's website
fraca7



Joined: 03 Oct 2005
Posts: 21
Location: Paris

PostPosted: Sat Feb 17, 2007 10:28 pm    Post subject: Reply with quote

I just fixed the font drawing bug. Binary release at the usual place:

http://fraca7.free.fr/EBOOT.PBP
Back to top
View user's profile Send private message Visit poster's website
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Sun Feb 18, 2007 12:04 am    Post subject: Reply with quote

Hi! :)
fraca7 wrote:
I just fixed the font drawing bug. Binary release at the usual place:

Wow, many thanks! :)

Downloading now.

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
sakya



Joined: 28 Apr 2006
Posts: 190

PostPosted: Sun Feb 18, 2007 8:17 pm    Post subject: Reply with quote

Hi!

I think I found some bugs in this release.
Check this script:
Code:
import thread
import psp2d
import pspnet
from time import time, sleep
from pspos import freemem, getclock, setclock, getbus, setbus, battery

msg = ""
clock = getclock()

def newThread(pNumber):
  global msg
  msg = "Started thread " + str(pNumber)
  sleep(2)
  msg = "Finished thread " + str(pNumber)


def connectionCB(state):
  global msg
  msg = "STATE: " + str(state)


#Main:
screen = psp2d.Screen()
font = psp2d.Font('font.png')
background_image = psp2d.Image(480,272)
background_image.clear(psp2d.Color(0,0,0))
oldPad = None
number = 0
padTime = None

while True:
  screen.blit(background_image, 0, 0, background_image.width, background_image.height, 0, 0)
  font.drawText(screen, 20, 120, "CLOCK SET TO: " + str(clock))
  font.drawText(screen, 20, 140, "TIME: " + str(time()))
  font.drawText(screen, 20, 160, "MESSAGE: " + msg)
  newText = "MEM: " + str(freemem() / 1024) + "kb  CPU:" + str(getclock()) + "Mhz  BUS:" + str(getbus()) + "Mhz  BATT:" + str(battery()[3]) + "%"
  font.drawText(screen, 0, 0, newText)
  screen.swap()

  pad = psp2d.Controller()
  if pad != oldPad \
  and not padTime or time() - padTime >= 0.2:
    padTime = time()
    if pad.cross:
      number += 1
      thread.start_new_thread(newThread, (number,))
    elif pad.circle:
      msg = "Connecting"
      pspnet.connectToAPCTL(2, connectionCB)
    elif pad.r and clock < 333:
      clock += 1
      setclock(clock)
    elif pad.l and clock > 0:
      clock -= 1
      setclock(clock)
    oldPad = pad


1.When you start a new thread (press X) the main thread hangs waiting for the child thread to finish.
2.Sometimes when the script starts the video is corrupted. Launching the application with the wifi switch on seems to fix this problem. Avoiding to import pspnet seems to fix this problem. I think it's the function to check the wlan switch. I had the same problem trying to add this function on my own.

Many thanks for your work.

Ciaooo
Sakya
Back to top
View user's profile Send private message Visit poster's website
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