Lua library

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Lua library

Post by Shine »

I've built a nice installation packet for using Lua in own programs: lua-psp-zip. A sample directory, with a minimal PSPSDK project, is included. It is like libpng and zlib: build it with "make" and install it with "make install" and you can use it for your projects from everywhere.

Perhaps it should be imported into the PSP svn (I don't have write access to it). I've tested it with my Snake and looks like it works. The only difference compared to the original Lua is, that I've written my own Makefile to produce only one lib instead of liblua and liblualib (liblualib.a is only some 94 kB, so I don't think this is a problem).
KaL
Posts: 41
Joined: Sun Apr 03, 2005 9:59 pm

Post by KaL »

One thing would be very interesting : to interface sce[...] functions with the your lua interpreter :p
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

KaL wrote:One thing would be very interesting : to interface sce[...] functions with the your lua interpreter :p
Not every application might need this, for example for my upcoming Lua Player I use higher level functions, like loadImage, blitImage with alpha channel etc., so this doesn't belong to a general lua-library, but it should be easy to map all sce-functions with tolua.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

Now it is in subversion at psp/trunk/lua/liblua.
mikeyleo
Posts: 6
Joined: Thu Jul 21, 2005 4:41 am

Post by mikeyleo »

Is there a list of these higher level functions? I've looked in the include files of the PSPSDK and don't see them. Sorry if this is a stupid question.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mikeyleo wrote:Is there a list of these higher level functions? I've looked in the include files of the PSPSDK and don't see them. Sorry if this is a stupid question.
doc/manual.html looks like a good place to start :-)
mikeyleo
Posts: 6
Joined: Thu Jul 21, 2005 4:41 am

Post by mikeyleo »

Shine wrote:
mikeyleo wrote:Is there a list of these higher level functions? I've looked in the include files of the PSPSDK and don't see them. Sorry if this is a stupid question.
doc/manual.html looks like a good place to start :-)
I must be blind too. :) I don't see a doc directory under the PSPDEV directory. Is there something else I need to download?
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mikeyleo wrote:I must be blind too. :) I don't see a doc directory under the PSPDEV directory. Is there something else I need to download?
It doesn't belong to the core PSPSDK, you have to do a checkout, like for all other libraries, which are already ported for the PSP, like zlib, libpng, jpeg and SDL:

svn co svn://svn.pspdev.org/psp/trunk/lua

and then it is in lua/lliblua/doc.
mikeyleo
Posts: 6
Joined: Thu Jul 21, 2005 4:41 am

Post by mikeyleo »

Shine wrote:
mikeyleo wrote:I must be blind too. :) I don't see a doc directory under the PSPDEV directory. Is there something else I need to download?
It doesn't belong to the core PSPSDK, you have to do a checkout, like for all other libraries, which are already ported for the PSP, like zlib, libpng, jpeg and SDL:

svn co svn://svn.pspdev.org/psp/trunk/lua

and then it is in lua/lliblua/doc.
I went to that directory and it had the docs for lua 5.0. I'm looking for a document that lists functions like loadImage and blitImage. Thanks for the help you've been giving me.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mikeyleo wrote:I went to that directory and it had the docs for lua 5.0. I'm looking for a document that lists functions like loadImage and blitImage. Thanks for the help you've been giving me.
lualib is the pure Lua library for using in every PSP program. The function loadImage, blitImage etc. are defined in my upcoming PSP Lua Player and they are not Lua standard, so it doesn't belong to the general Lua library.

I don't have documented the Player at this time, you have to look at the source of the prelease of my player or just wait some days, until I find some time to finish a more complete release.
mikeyleo
Posts: 6
Joined: Thu Jul 21, 2005 4:41 am

Post by mikeyleo »

lualib is the pure Lua library for using in every PSP program. The function loadImage, blitImage etc. are defined in my upcoming PSP Lua Player and they are not Lua standard, so it doesn't belong to the general Lua library.

I don't have documented the Player at this time, you have to look at the source of the prelease of my player or just wait some days, until I find some time to finish a more complete release.[/quote]

I understand that these functions aren't part of Lua. The sample scripts I've looked at (your snake script and the steel script) use those functions. I looked at the source of your player, but didn't see them mentioned. I figure that there's documentation for them somewhere, I just can't figure out where.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mikeyleo wrote:I figure that there's documentation for them somewhere, I just can't figure out where.
Please read my last answer again.
mikeyleo
Posts: 6
Joined: Thu Jul 21, 2005 4:41 am

Post by mikeyleo »

Shine wrote:
mikeyleo wrote:I figure that there's documentation for them somewhere, I just can't figure out where.
Please read my last answer again.
Oh, I know what my problem was, I was looking at an older version of your player's sourcecode. Now I see the functions. Thank you for all your help.
Panajev2001a
Posts: 100
Joined: Sat Aug 20, 2005 3:25 am

Post by Panajev2001a »

Shine, so with this library I can use LUA scripts in any programs done with PSPSDK and this LUA library, but tolua or tolua++ need to be compiled only for a cygwin/x86 target as the only thing they are doing is helping me pre-process header files so that LUA and my C/C++ files can work together (call LUA scripts from C/C++ code and vice-versa) and as such it would make no sense to me to compile it for PSP using psp-gcc... right ?
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

You are right, tolua is executed on your host system, so compiling it with psp-gcc doesn't make sense.
Panajev2001a
Posts: 100
Joined: Sat Aug 20, 2005 3:25 am

Post by Panajev2001a »

Shine wrote:You are right, tolua is executed on your host system, so compiling it with psp-gcc doesn't make sense.
Thank you, I just wanted to make sure all was right in my head hehe ;).

Hopefully around PSP a nice community like PS2 Linux one builds up, so far so good IMHO.
Post Reply