forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

lua on PSP (not lua player !)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 10:14 am    Post subject: lua on PSP (not lua player !) Reply with quote

hi,

i have to read my own lua script without using the excellent (but too complete in my case) luaplayer
any ideas ?
i had a look inside the lua player samples but the lua lib files (header and lib) are not present...

thanks in advance !
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sat Apr 15, 2006 8:13 pm    Post subject: Reply with quote

Check out http://www.lua.org and download the source, and the docs.

Hope this helps,
Pete
Back to top
View user's profile Send private message Visit poster's website
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 8:45 pm    Post subject: Reply with quote

yes i can indeed compile all by myself but just wanted to know if anybody had already compiled and created the lua libraries for the psp toolchain ?
it's just to not waste my time if it available somewhere ..

thanks !
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sat Apr 15, 2006 8:56 pm    Post subject: Reply with quote

Sorry, I didn't realise that.

I think it's available on the PS2Dev Subversion server:
http://svn.ps2dev.org/listing.php?repname=psp&path=%2Ftrunk%2Flua%2F&rev=0&sc=0

Pete
Back to top
View user's profile Send private message Visit poster's website
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 10:29 pm    Post subject: Reply with quote

great !! thanks a lot !
Back to top
View user's profile Send private message Send e-mail
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sat Apr 15, 2006 10:38 pm    Post subject: Reply with quote

it looks to contain what i'm looking for but i don't see any download button !??
i must be missing something ! :)
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sat Apr 15, 2006 10:56 pm    Post subject: Reply with quote

Open up a cygwin window and type:
svn co svn://svn.ps2dev.org/psp/trunk/lua
Back to top
View user's profile Send private message Visit poster's website
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sun Apr 16, 2006 4:04 am    Post subject: Reply with quote

great it seems to work except i don't have the permission !? :-(
i've the following error :

svn: Can't connect to host 'syn.ps2dev.org': Connection refused


any ideas ?
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sun Apr 16, 2006 4:29 am    Post subject: Reply with quote

You've typed "syn.ps2dev.org" there - is that a typo?

The line I gave should work - it worked for me, I tested it before posting.

Pete
Back to top
View user's profile Send private message Visit poster's website
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sun Apr 16, 2006 8:04 am    Post subject: Reply with quote

yep you right, just a little error in what i've typed
now it's ok
thanks a lot !!
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sun Apr 16, 2006 8:21 am    Post subject: Reply with quote

You're welcome.

Pete
Back to top
View user's profile Send private message Visit poster's website
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sun Apr 16, 2006 10:59 am    Post subject: Reply with quote

ok now i can compile and test the lua sample
i've modified it and everything works perfectly
so i've tried to put some lua stuff in my own code

but when i try to link with lua libs : -llualib -llua (like in the lua sample !)
i've the following errors :

Code:

Performing Makefile project actions
Makefile (30) : warning: overriding commands for target `kxploit'
c:/cygwin/usr/local/pspdev/psp/sdk/lib/build.mak (137) : warning: ignoring old commands for target `kxploit'
rm -f nXviewer.elf  nXviewer.o _libs/callbacks.o _libs/vram.o PARAM.SFO EBOOT.PBP EBOOT.PBP
C:/cygwin/usr/local/pspdev/bin/vs-psp-gcc -I. -Ic:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o nXviewer.o nXviewer.c
C:/cygwin/usr/local/pspdev/bin/vs-psp-gcc -I. -Ic:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o _libs/callbacks.o _libs/callbacks.c
C:/cygwin/usr/local/pspdev/bin/vs-psp-gcc -I. -Ic:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o _libs/vram.o _libs/vram.c
C:/cygwin/usr/local/pspdev/bin/vs-psp-gcc -I. -Ic:/cygwin/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -Lc:/cygwin/usr/local/pspdev/psp/sdk/lib   nXviewer.o _libs/callbacks.o _libs/vram.o -lpspgum -lpspgu -lm -lpspusb -lpspusbstor -llualib -llua -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o nXviewer.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_tan':
lmathlib.c:(.text+0xd0): undefined reference to `tanf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_asin':
lmathlib.c:(.text+0x110): undefined reference to `asinf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_acos':
lmathlib.c:(.text+0x150): undefined reference to `acosf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_atan':
lmathlib.c:(.text+0x190): undefined reference to `atanf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_atan2':
lmathlib.c:(.text+0x1e8): undefined reference to `atan2f'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_ceil':
lmathlib.c:(.text+0x22c): undefined reference to `ceilf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_mod':
lmathlib.c:(.text+0x2c4): undefined reference to `fmodf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_sqrt':
lmathlib.c:(.text+0x31c): undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_pow':
lmathlib.c:(.text+0x378): undefined reference to `powf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_log':
lmathlib.c:(.text+0x3bc): undefined reference to `logf'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_log10':
lmathlib.c:(.text+0x3fc): undefined reference to `log10f'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/liblualib.a(lmathlib.o): In function `math_exp':
lmathlib.c:(.text+0x43c): undefined reference to `expf'
collect2: ld returned 1 exit status
psp-fixup-imports nXviewer.elf
Error, could not find file nXviewer.elf
mksfo 'nXviewer' PARAM.SFO
psp-strip nXviewer.elf -o nXviewer_strip.elf
psp-strip: 'nXviewer.elf': No such file
pack-pbp EBOOT.PBP PARAM.SFO NULL  \ NULL NULL NULL  \ NULL  nXviewer_strip.elf NULL
ERROR: Could not open the file. (nXviewer_strip.elf)
make: *** [EBOOT.PBP] Error 255


i've searched for the maths functions asked but nothing (except this from lua package) contains these !!!

i really don't understand how the lua sample can link !
there's somthing strange here !!

any ideas welcome !

here is the makefile i use :

Code:

TARGET = nXviewer
OBJS = nXviewer.o _libs/callbacks.o _libs/vram.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS= -lpspgum -lpspgu -lm -lpspusb -lpspusbstor -llualib -llua

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = nXviewer

PSPSDK=c:/cygwin/usr/local/pspdev/psp/sdk#$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

ifneq ($VS_PATH),)
CC       = C:/cygwin/usr/local/pspdev/bin/vs-psp-gcc
CXX      = C:/cygwin/usr/local/pspdev/bin/vs-psp-g++
endif


XTARGET = $(shell echo $(TARGET)000000 | cut -b1-6)
KXDIR = $(TARGET)
KXDUMMY = $(TARGET)%
 
kxploit: $(TARGET).elf $(PSP_EBOOT_SFO)
   mkdir -p "$(KXDIR)"
   $(STRIP) $(TARGET).elf -o $(KXDIR)/$(PSP_EBOOT)
   mkdir -p "$(KXDUMMY)"
   $(PACK_PBP) "$(KXDUMMY)/$(PSP_EBOOT)" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON)  \
   $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1)  \
   $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR)
   cp -r $(KXDIR) $(PSP_MOUNT)/PSP/GAME/
   cp -r $(KXDUMMY) $(PSP_MOUNT)/PSP/GAME/
               


if someone could tell be wich library contains theses maths functions i could check my sdk and update if needed
but that doesn"t explain how the lua sample can link !! ???
Back to top
View user's profile Send private message Send e-mail
zoret



Joined: 19 Mar 2006
Posts: 22

PostPosted: Sun Apr 16, 2006 11:15 am    Post subject: Reply with quote

ok i've just found it !
the lua libs need the lm lib so i have to put this lib at the end of the libs list

i've simply modified my makefile :

LIBS= -lpspgum -lpspgu -lpspusb -lpspusbstor -llualib -llua -lm

the linker is rather dumb...

nevermind, now it works !!
Back to top
View user's profile Send private message Send e-mail
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Mon Apr 17, 2006 2:50 am    Post subject: Reply with quote

Glad it works now - yes, the fact that order is important in linking really is a pain sometimes.

I wonder if this feature actually has any practical use...
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group