Newbie - cygwin Lua emulator question.

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

Moderators: Shine, Insert_witty_name

Post Reply
wasted
Posts: 6
Joined: Sun Feb 19, 2006 9:08 am

Newbie - cygwin Lua emulator question.

Post by wasted »

Hi all - I've been searching through and am just stuck on how to invoke the Lua emulator in cygwin.
I've installed the toolchain etc... and can get a lua hello world test script to run, but one that uses psp functions fails with:
$ lua script.lua
lua: script.lua:2: attempt to index global `Color' (a nil value)
stack traceback:
script.lua:2: in main chunk
[C]: ?

where the script contains :
$ cat script.lua
-- create a new Color object
green = Color.new(0, 255, 0)

-- show some text on offscreen
screen:print(200, 100, "Hello World!", green)

-- flip visible and offscreen
screen.flip()

-- wait forevever
while true do
screen.waitVblankStart()
end

I guess I need to include the PSP library that contains the Color function, but do not know how to do this.

Any help much appreciated !
wasted
Posts: 6
Joined: Sun Feb 19, 2006 9:08 am

Post by wasted »

Am I asking for something that cannot be done ?
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

you can't do it that way.
what you try is calling luaplayer-specific functions on normal lua release

you need to get luaplayer for windows
put it in a folder eg ~/luaplayerwindows
then enter this directory and put your script.lua in.
start the script by typing
./luaplayer.exe script.lua

thats it

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
wasted
Posts: 6
Joined: Sun Feb 19, 2006 9:08 am

Post by wasted »

Thanks - that makes sense.

I've followed the instructions at http://wiki.ps2dev.org/psp:lua_player:compiling and got LuaPlayer source. When I try to compile I get the error for missing header file - tdefs.h (see below).

Can anyone help with another location for the source ?

wasted@Sun ~/source/LuaPlayer
$ make -f Makefile.windows
g++ -I. -I/include -I/sdk/include -I/include -Isrc -c -o src/luacontrols.o sr
c/luacontrols.cpp
In file included from src/luacontrols.cpp:2:
src/luaplayer.h:5:19: tdefs.h: No such file or directory
src/luacontrols.cpp:4:21: pspctrl.h: No such file or directory
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

do you have pspsdk path set?
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
wasted
Posts: 6
Joined: Sun Feb 19, 2006 9:08 am

Post by wasted »

No I don't. I have :
PSPDEV=/usr/local/pspdev

Looking at http://wiki.ps2dev.org/psp:lua_player:compiling the only reference to pspsdk is in the block for making freetype:

cd freetype
sh autogen.sh
LDFLAGS="-L`psp-config --pspsdk-path`/lib -lc -lpspuser" \
./configure --host psp --prefix=`psp-config --psp-prefix`
make
make install

Do I need to start from this point ?

Thanks.
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

if you want to compile the whole thingy i got a script for you (which SHOULD do all the stuff)
if you want it, let me know and i mail it to you, please give me feedback as if its working fine... i can release it!

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
wasted
Posts: 6
Joined: Sun Feb 19, 2006 9:08 am

Post by wasted »

Yes please ! Do I need to add my email add to my profile ?
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

you can PM me your email too ;)

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Post Reply