Page 1 of 1

LOVE2PSP - Convert love scripts to psp

Posted: Tue Sep 04, 2012 4:27 am
by azin
Hello Love community i created a program that does what the topic title says. I called it LOVE2PSP it currently converts simple love api to psp lua api so that your love games can be ran on the psp without having to recode your scripts for psp.I recently began coding for psp again because i just repaired my broken psp lol, and thought to myself how great would it be if i was able to run my love scripts on my psp so i created this program. This program can also be used to create games for love. I plan on adding the option of converting psp scripts to love, but that would be later on. As of right now i am able to convert my old love projects to psp and have no problems. The program loads main.lua and reads it, it will organize your code on the right by category variables, images, audio etc. You can quickly search for the variable by clicking once or edit it quickly by double click or via right-clicking for the full option menu. When finish just save it. If you selected psp build it will convert the main.lua to be ran on psp it would no longer run on love so make sure you back up the file first. If you just want to edit main.lua for love and use LOVE2PSP functions then just select the love icon. Currently build errors are bugged so you will always receive 4 errors on functions missing so ignore it i will fix that later on. If your main.lua for psp build does not use any mouse functions then add an empty function like:

Code: Select all

function analogMove()
end
or you will have errors running it on lua player windows and the psp.

Functions: (currently working)

Code: Select all

- love.audio.load (currently only MP3 files OGG, WAV etc will be added later)
- love.audio.play (also works as love.audio.resume)
- love.audio.stop
- love.graphics.newImage
- love.graphics.draw
- love.graphics.print
- love.graphics.newFont
- love.graphics.setBackgroundColor() (have to set it under love.draw() because its treated as a image drawable)
- love.filesystem.load (not tested but should work)
- love.filesystem.newFile (not tested but should work)
- AnAL animations (newAnimation, Animation:Draw(x, y), Animation:update())
- love.keyboard.isDown() (currently only converts the keys up, down, left, and right to psp d-pad buttons up, down, left, and right)
- love.mouse.isDown("l") (This is limited since the psp does not use a mouse you can map the mouse movement keys onto the d-pad or analog, and the mouse left-click button will be set to the psp's "x" button you can change this through the options >> settings menu)
To do list:

Code: Select all

- Love Lua socket api to psp
- Graphical Mode layout (rather than scripting and viewing code this mode allows the user to just add images etc and move them on screen without coding and run them in love/psp i can't explain so look below for the graphical mode layout preview screenshot)
How to get started:
1) Run LOVE2PSP.exe select file >> open, and select the file you want to convert
2) Once the file is selected you will get a pop-up menu select the PSP icon.
3) Save the file make a new folder drag or copy the files that your love script loads (images, audio, etc) into the new folder
4) In the PSP >> Required folder copy all the files and paste them into your new folder
5) Move the new folder onto your PSP >> Games folder and run it!
Requires that your PSP be hacked to run the scripts

Download includes:
PSP lua player windows: Run psp scripts on windows (Test the scripts)
PSP required files
LOVE2PSP.exe
VB6 Libraries (Might need to install them if you get errors running LOVE2PSP)
Love demos and PSP converted version

If you have audio being played on the script you can not use PSP lua player windows to run it since lua player windows does not support MP3 to run it on lua player windows you must edit main.lua and remove the codes love.audio.load, play, stop by commenting them out with "--" and in script.lua comment out load, play, and stop with "--"

Preview of LOVE2PSP: (Download below)
Image

Preview of Graphical Mode layout:
Image
Me setting up where i want the image to draw

Image
Running the game to test it the position is the same.

Download:
http://www.mediafire.com/?o25aaaze9ti647x

If you would like for me to add an api to convert to psp that is not listed above then give me a reply here with an example of how to use it and i will add it to the next update. If you get any bugs/errors then give me a reply and i will fix it.

Re: LOVE2PSP - Convert love scripts to psp

Posted: Tue Sep 04, 2012 8:02 am
by Roland_Yonaba
Convert love scripts to PSP ? That's a an ambitious idea.
Well, I remember the old days when I was scripting for my old PSP.
As I have a little experience in this, I'm not saying this is impossible, but shouldn't be easy at all.

For instance, love works with callbacks. This is a missing feature on most of Lua player's api...
How are you dealing with that ?

The best way to port a Love games to PSP should be doing it all by yourself. IMHO.

Re: LOVE2PSP - Convert love scripts to psp

Posted: Tue Sep 04, 2012 8:53 am
by azin
Yeah im sure i will come up with something. i have not really thought that far yet lol. But currently it can convert a simple love game and run it on psp it can play audio, draw images, and animate images. As for the other functions like networking the psp lua supports it so i can add in the love luasocket api to convert.

currently love.load() is being constantly called, but it works i would have to figure out a way to make it execute once. love.update(), and love.draw() is also being called constantly. for love.update(dt) delta time i think im going to have to set the variable to 1 since the psp adds variables slow.

Re: LOVE2PSP - Convert love scripts to psp

Posted: Thu Sep 06, 2012 8:17 pm
by qaisjp
I prefer to have a homebrew app (similar to lua player for PSP) in which the app would read the lua files and execute it (like how the normal love works), I'd say something nasty like "omg rubbish design" and "omg you dont indent" but whatever.

love-homebrew-psp :)?

what the ... what theme are you running lol


fix your workarounds or it aint worthy :p (no empty function requirement should be needed)

Re: LOVE2PSP - Convert love scripts to psp

Posted: Sat Sep 08, 2012 4:42 am
by azin
i think my windows theme is classic? lol i did some tweaking on my pc to make it run faster.