Advertising (This ad goes away for registered users. You can Login or Register)

[Tutorial] Python PSP Programming

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
bkuri
Posts: 4
Joined: Tue Aug 28, 2012 3:24 pm

Re: [Tutorial] Python PSP Programming

Post by bkuri » Tue Aug 28, 2012 3:42 pm

@Acid_Snake: Thanks for the tutorials. I was able to get pygame working under Linux and run all the samples. Unfortunately, every time I transfer my files to the PSP, the EBOOT file shows up as "corrupted data" under XMB. Could it be because of my firmware? (I am running 6.60ME 1.8). Any advice would be appreciated.

Secondly, is there a way to emulate the pad buttons and/or joystick when the apps are run outside of the PSP?

Thanks again, and keep up the good work!
Advertising

User avatar
Acid_Snake
Retired Mod
Posts: 3099
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: [Tutorial] Python PSP Programming

Post by Acid_Snake » Wed Aug 29, 2012 11:10 am

I'm using the exact same firmware as you and python works, the only thing I can recommend is to re-download the file.
As for the buttons, they are already emulated:
Cross --> Z
Circle --> S
Square --> A
Triangle --> W
Left trigger --> Q
Right trigger --> E
Start --> V
Select --> C
Up, Down, Left, Right --> Arrow keys
Advertising

4ich
Posts: 37
Joined: Fri May 25, 2012 11:43 am

Re: [Tutorial] Python PSP Programming

Post by 4ich » Thu Aug 30, 2012 3:37 am

bkuri wrote:@Acid_Snake: Thanks for the tutorials. I was able to get pygame working under Linux and run all the samples. Unfortunately, every time I transfer my files to the PSP, the EBOOT file shows up as "corrupted data" under XMB. Could it be because of my firmware? (I am running 6.60ME 1.8). Any advice would be appreciated.

Secondly, is there a way to emulate the pad buttons and/or joystick when the apps are run outside of the PSP?

Thanks again, and keep up the good work!

did u "save disconnected" your psp ?
i had the same issue first time
Check out www.Consoleheaven.de... we build it up =)

bkuri
Posts: 4
Joined: Tue Aug 28, 2012 3:24 pm

Re: [Tutorial] Python PSP Programming

Post by bkuri » Thu Aug 30, 2012 10:50 am

Actually I tried multiple ways to send it... I tend to transfer files using PSP-FTPD, but that didn't work at first, so I tried everything from USB mode to even upgrading my CFW to 6.60 PRO-C, but nothing worked.

After quite a few tries I decided to ftp just the EBOOT file (not the entire folder) and it finally copied it correctly. No idea as to why this happened, but at least it's working now. :)

bkuri
Posts: 4
Joined: Tue Aug 28, 2012 3:24 pm

Re: [Tutorial] Python PSP Programming

Post by bkuri » Thu Aug 30, 2012 11:06 am

I made a few bitmap fonts based on the great EnvyCodeR in case someone wants them:

Size 14:
Image

Size 16:
Image

The size 14 looks ok but it's a bit small. The size 16 works great on my desktop but looks garbled on the PSP. Any idea as to why this could be?

bkuri
Posts: 4
Joined: Tue Aug 28, 2012 3:24 pm

Re: [Tutorial] Python PSP Programming

Post by bkuri » Thu Aug 30, 2012 11:37 am

Just made a size-18 version and I still get the same problem:
Image

So I guess the limit is 14 for some random reason... Considering that the font.png provided in @Acid_Snake's sample is much bigger it makes things even more confusing. :x

BTW, these fonts obviously work better with dark backgrounds. If someone needs an inverted one I can get them done pretty quickly.
Last edited by bkuri on Thu Aug 30, 2012 3:36 pm, edited 1 time in total.

User avatar
Acid_Snake
Retired Mod
Posts: 3099
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: [Tutorial] Python PSP Programming

Post by Acid_Snake » Thu Aug 30, 2012 11:55 am

I have a very good font file, I got it from spider solitaire.
Attachments
font.png
font.png (8.57 KiB) Viewed 3327 times

svenn
Posts: 66
Joined: Fri Dec 24, 2010 5:17 pm
Location: Belgium
Contact:

Re: [Tutorial] Python PSP Programming

Post by svenn » Mon Sep 17, 2012 2:57 pm

I'm newb to python, but have some knowledge on other languages. So I attempted this tut, its nice. but these are some tips that might come in handy for windows users. (mostly obv stuff)


1) install python http://www.python.org/download/ (Python 2.7.3 Windows Installer, works fine)
2) add envirment variabele "C:\Python27" to PATH (http://www.windows7hacker.com/index.php ... -windows-7 )
3) install pygame http://www.pygame.org/download.shtml (pygame-1.9.1.win32-py2.7.msi works fine)
4) open cmd, try python, close python "exit()", follow tutorial, run script as : python location/script.py

I felt it needed to be written like a baby-version :D

working my way through your tutorials Acid_Snake, thx !

blacky94
Posts: 7
Joined: Fri Jun 29, 2012 11:22 pm

Re: [Tutorial] Python PSP Programming

Post by blacky94 » Mon Sep 24, 2012 3:52 am

hi,

i have a problem with the blit function, i try to draw a half-transparent image on a normal image, but when i try to run the script on my psp the half-transparent image isn't transparent, but it works fine when i run it on my pc.
here is the script:
image1 is not transparent (the bg) and image2 is a half-transparent box

Code: Select all

import psp2d

screen = psp2d.Screen()
CLEAR_COLOR = psp2d.Color(0,0,0)
image1 = psp2d.Image("image1.png")
image2 = psp2d.Image("image2.png")

while True:
    screen.clear(CLEAR_COLOR)
    screen.blit(image2)
    screen.blit(image1)
    screen.swap()
hope you can solve the prob

User avatar
qwikrazor87
Guru
Posts: 2860
Joined: Sat Apr 21, 2012 1:23 pm
Location: The North Pole

Re: [Tutorial] Python PSP Programming

Post by qwikrazor87 » Mon Sep 24, 2012 4:05 am

You said that image1 is not transparent. Looking at your code I can see that image1 (not transparent) is covering image2 (transparent). So switch those two around and it should work.

Code: Select all

while True:
    screen.clear(CLEAR_COLOR)
    screen.blit(image1)
    screen.blit(image2)
    screen.swap()
That way the transparent image is on top of the non-transparent image.
PSP 2001 - TA-085 - 6.60 PRO-C2
PS Vita 3G - PCH-1101 - 3.60 HENkaku Ensō
Maxwest Nitro 4 phone - Android 5.1
Laptop - Toshiba Satellite L305D-S5974 - Ubuntu 12.04 LTS

Post Reply

Return to “Programming and Security”