PDA

View Full Version : sdlBasic for PSP version 0.5



deniska
May 22nd, 2008, 02:47
sdlBasic is a small, efficient multiplatform basic interpreter originally created by Roberto Viola in 2002.
http://deniska.dcemu.co.uk/images/sdlbasic3.PNG
Its core is based on wxBasic and syntax, inspired by AMOS, is easy to learn by beginners
http://www.sdlbasic.altervista.org contains the reference guides language overview, comand syntax, examples and
additional tools and resources, required for development.

Installation
The interpreter only works on custom PSP 3.XX firmwares.
Copy sdlBasic folder to ms:/PSP/GAME (or ms:/PSP/GAME3XX where XX is your custom firmware's subversion.
http://deniska.dcemu.co.uk/images/sdlbasic1.png

Using the interpreter
sdlBasic program(s) should be saved in [program_name].sdlbas file and placed in sdlBasic folder, together with EBOOT.PBP file and
fonts directory. Of course, sdlBasic folder can be renamed, and EBOOT icon/background can be replaced with a number of tools.
If only one .sdlbas file is detected in the folder, the interpreter immediately runs it. Over wise the program selection screen is displayed.
http://deniska.dcemu.co.uk/images/sdlbasic2.png

PSP-spesific features & limitations
- setdisplay() dimensions are limited to 640x480, 320x240, 480x272 (and some derivatives)
- only some keyboard keys are mapped (arrows, enter, space, escape) and available through key() / inkey commands.
- all psp buttons can be queried with getButtonJoystick() call with button indexes from 0 to 13
- mouse calls are partially implemented via the analog pad and buttons mapped to [x],[o],[triangle],[square]
- isPSP=1 and os=PSP variables are added for platform detection.
- network, mpeg and cd-control calls as well as shell() are not implemented yet.
- mp3 playbeack is not supported. Ogg, wav and tracker formats should be used instead.

version update: 0.6 has a bug fix for a memory leak during loading images.

Download and leave feedback via comments

Download Here (http://deniska.dcemu.co.uk/bin/sdlBasic_psp_v05.rar)

osgeld
May 22nd, 2008, 08:21
this is very interesting

is there a project website?

and how does speed compare to luaplayer 0.20?

and 1 suggestion 240x136 fullscreen

justicejoe
May 22nd, 2008, 08:31
i tried out your app its great alot of potential, i dont understand how to use it as a translator but would like too. i have an src file with mp3 lite so if i was to run both apps how would one do that? i know it may seem simple to you but its not very noob friendly yet. im trying to tun my psp into a functional guide like the one seen in hitch hikers guide to the galaxy, i figure its only a matter of time before the fictional tool comes to life. it would be great if i could download an encyclopedia that i could edit and update and play home brew games through and i see the start of the making of that in this. i know its still early in history for such a thing to exist, but as an adult traveler i would love to have all the info i can on locations and animals and first aid, i can stuff in there with a user friendly gui. the psp has sooo much potential. good job keep it up dude.

trucidare
May 22nd, 2008, 09:34
Hey, good to see the good old SDLBasic on Psp.

Long Time ago i created the German tutorial, but now i´m using more c++. Thanks alot for porting this very good basic :)

deniska
May 22nd, 2008, 15:24
this is very interesting

is there a project website?

and how does speed compare to luaplayer 0.20?

and 1 suggestion 240x136 fullscreen

The link to the website in in the root post..
240x136 is supported...
I have not done any performance comparisons yet..

osgeld
May 22nd, 2008, 18:38
i knew that the basic's website is there, didnt know if you had one just for the psp port

i tried it out last night, and the shadow of the beast demo was really impressive

luaplayer could do that, maby not as smooth and you would have to use some magic tricks

anyway i think im going to start playing with this tonight and i cant wait to see where it goes

(noticable bug, likes to crash on exit to xmb)

deniska
May 23rd, 2008, 06:26
(noticable bug, likes to crash on exit to xmb)

how do you replicate it?

acer5050
May 23rd, 2008, 23:06
Hi love your app.

Seems like a great language to help me get into coding and mess around with some homebrew.....

One question though. I'm working on an application that will work as a magazine viewer (magazines in .jpg) all goes well on the pc and on the psp until I get to page 9 then it freezes! My code below whats wrong? btw is there a way to make it so that i can have a button to go back and not just forward? Thanks :)


'
' sdlBasic PSP 0.5
'
' Name: PSPMag
' Purpose: To view psp magazines without using the image viewer
' Author: PSPHeaven/Acer5050 http://pspheaven.net [email protected]
' Licence: LGPL
'
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------
prints("PSPHeaven's Magazine Viewer")
prints("Created In SDLBasic")
prints("Alpha 0.1")
prints("PSPHeaven.Net")
prints("Will Automaticaly Exit At End")
prints("Just as a test this has XMag #1 Included")
prints("Press [X] To start and to goto the next page")
waitkey(k_return)
cls
image=loadimage("media/001.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/002.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/003.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/004.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/005.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/006.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/007.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/008.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/009.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/010.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/012.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/013.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/014.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/015.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/016.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/017.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/018.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/019.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/020.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/021.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/022.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/023.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/024.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/025.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/026.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/027.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/028.jpg")
pastebob(0,0,image)
waitkey
cls
image=loadimage("media/029.jpg")
pastebob(0,0,image)
waitkey

osgeld
May 23rd, 2008, 23:43
how do you replicate it?

in almost every demo push the home button and choose yes, goes to off mode instead of xmb :)

psp phat 3.80m33 - 5

acer5050
May 24th, 2008, 01:44
psp slim 3.90M33-3 no problem

btw, why is memory card in constant use?

osgeld
May 24th, 2008, 05:04
i did not experience this

(cough) this is why a psp version website would be good

[purely optional] i have a host account with 500gb of space and a tb a month bandwidth on mutiple oc4's, ... and i dont really use it .. but im still prepaid for another 175 days, so i offer free hosting to projects im interested in

setup included

if you wanna

and yea im going to renew it when it comes up

acer5050
May 24th, 2008, 05:18
Do you have a domain?

Maybe I could help out..... I run pspheaven.net

You could setup for example pspsdl.pspheaven.net or something like that! I'd me much more than happy to do so. I'd let you use the forums too if you'd like I'll make ya a mod, etc. I'd love to have you on the site. Let me know.

osgeld
May 24th, 2008, 06:26
cheesefactory.us

alot tho buy their own "el cheapo" domain (mine cost a 1.99$) and point it to my host

its not like a "scene" site, its just space for project websites of all nature

nothing is intertwined ect, just your little space on the web for your project (just an offer to the op, doesnt matter to me either way ;) )

acer5050
May 25th, 2008, 02:52
sounds like a space for a cheese site lol..... but you can always get a domain for 3-9$ and put that on it

deniska
May 27th, 2008, 18:08
Hi love your app.

Seems like a great language to help me get into coding and mess around with some homebrew.....

One question though. I'm working on an application that will work as a magazine viewer (magazines in .jpg) all goes well on the pc and on the psp until I get to page 9 then it freezes! My code below whats wrong? btw is there a way to make it so that i can have a button to go back and not just forward? Thanks :)

You running out of memory since you ask for a new slot for each image... try doing following:

waitkey(k_return)
i=1
while 1
cls
if (i<10) then
image=loadimage("media/00" & i &".jpg",0)
else
image=loadimage("media/0" & i &".jpg",0)
end if
pastebob(0,0,image)
prints(i)
waitkey
if key(K_up) then
i=i+1
end if
if key(K_down) then
i=i-1
end if
end while


( up & down should should take you to next/prev image; you still need to put a couple more conditions to make sure you don't run outside of your image list)

deniska
May 27th, 2008, 18:10
psp slim 3.90M33-3 no problem

btw, why is memory card in constant use?

starting your program with setdisplay() call should take care of those debugging writes to memory stick

acer5050
May 27th, 2008, 21:19
thank you for your help

EDIT

I've been looking all over and cannot figure it out...
Once it gets to the end there are no images and I get an image not found error.
how can it just exit instead?

deniska
May 28th, 2008, 15:36
thank you for your help

EDIT

I've been looking all over and cannot figure it out...
Once it gets to the end there are no images and I get an image not found error.
how can it just exit instead?
change

while 1

to

while i<20


This is assuming that 20 is your last image...

deniska
May 28th, 2008, 16:16
FYI,
I found a small bug that would drain the memory on image loads.. version 0.6 has a fix for it...

acer5050
May 28th, 2008, 22:42
ok thanks :) and nice to see updates coming out so fast :)

acer5050
May 28th, 2008, 22:51
0.6 has no eboot and corrupt images :/
EDIT

srry ur fine, my computer messed up is all

togi
May 28th, 2008, 22:54
Hello Deniska,
thanks a lot for the update to improve this great app !!!! :thumbup::thumbup:
BR
ToGi

acer5050
May 28th, 2008, 22:56
:/ Doing what you said causes the app to load only one image :/ is it just me?

EDIT

I got it :)

Making it

while i<003

when my last image is 002 works

:)

happy_mak
May 31st, 2008, 16:48
Dear Deniska,

This is absolutely mind blowing.. BASIC on PSP wow wow ... tried it with an old Hello world type program. Worked cool.

Ref URL
http://blog.livedoor.jp/gai_jin/archives/51388713.html

The only report which i wanted to make was after the waitkey, the program returns to XMB, any reason why this happens and how to make it go back to the program selection menu?

Appreciate your help in advance

deniska
May 31st, 2008, 18:49
Dear Deniska,

The only report which i wanted to make was after the waitkey, the program returns to XMB, any reason why this happens and how to make it go back to the program selection menu?

Appreciate your help in advance

The reason I made it this way is that since there is no automatic garbage collection, there is no guarantee that all the memory and other resources get freed up by user's code. exit to xmb is the cleanest and simplest way of doing this. Besides, most of the coders would probably want to package their creations as separate packages so the menu would not even show up..

happy_mak
June 2nd, 2008, 15:21
Understood. Makes a lot of sense from the application packaging perspective... Thankyou for your reply Deniska. I look forward to further updates to this homebrew package from you.

Manish

Art
June 19th, 2008, 03:37
Thanks Deniska :)



Besides, most of the coders would probably want to package their creations as separate packages so the menu would not even show up..
How do you make it so thew menu doesn't show up?
(ie. LUAplayer style).

JLF65
June 19th, 2008, 05:46
Thanks Deniska :)


How do you make it so thew menu doesn't show up?
(ie. LUAplayer style).

Just have ONE Basic file in the folder.

By the way, I updated sdlBasic to use my SDL with TV support. Now using 640x480 makes some sense! ;)

Check out arkanoid on the TV... looks nice. :cool:

http://www.mediafire.com/download.php?ujtmaiz3oje

acer5050
June 21st, 2008, 04:24
Sweet :)

nincompoop
August 25th, 2008, 09:52
This is a quick BASIC teaching tools for my daughters. PSPs are no longer just the game machine for them.

Francesco_PSP
October 14th, 2008, 12:29
Hello all!

Is this still alive?

A psp SDL Basic interpreter is exactly what I wanted to start writing hb, so many thanks to Deniska!

My first psp programming attempt is a slideshow with music and nice transitions; first version is running, still without music and transition but first problems is with loadimage that can't properly load images larger than 800x600. Since my pics are 800x600 slideshow is perfect (of course pics are zoomed to 480x272). Same problem is with the demo program ImageViewr, if I try to make it open a 1600x1200 jpg it crashes and psp power off so I think this is a loadimage problem.

Another small problem is that hidemouse seems not working after a setdisplay but for that a workaround can be found.

I'm using 0.6 version at the moment because of sdterr file that 0.7 doesnt produce.

Anyway I like this basic!

Sorry for bad english,
Bye!

arnebcab
March 24th, 2009, 16:46
*solved the problem*