Lua player core development
Moderators: Shine, Insert_witty_name
Lua player core development
Ok, this is the thread for the C-side of the Lua Player and for ideas for the API. I think the next thing to implement is the PhysicsFS, which allows you to pack all your game resources in one zip file. Laurens wants to do this. Together with Nevyn's Lowser, it simplifies the deployment and makes the player more safe, because it can't write and read everywhere any more, which is a good idea, if it will be ported to other platforms, like PC and Mac.
Last edited by Shine on Mon Dec 05, 2005 3:14 am, edited 2 times in total.
I've been working at this. Unfortunately, it's not a question of just recompiling it for the psp. So, I need to port it. I've been hard at work at it, and I think I'm about 1/3rd done.
I'm about to head off to a 1-week holiday, so I'll be back in the land of the Internet at the 22nd of August. So, more news after that!
I'm about to head off to a 1-week holiday, so I'll be back in the land of the Internet at the 22nd of August. So, more news after that!
If a beautiful girl tells you she's done some modeling work in the past, and you ask her what 3D software she used, you might be a gamedeveloper.
I meant the Lua Player itself, which is written in C, there will be no C script support, which is executed by the Lua Player. But if you know C, you can help with the base, too.XRS wrote:Cool, i´ll wait to try that "C-Side" cause i know something about C
It is not very high on my priority list, I'm wating until the network support is more complete in the PSPSDK, then it will be easier, but feel free to implement it yourself and I'll integrate it in Lua Player. PhysicsFS is more important and I would like to have affine transformation for image blitting and vector graphics.liquid8d wrote:I had mentioned previously but don't know how high a priority it might be.. I'd like to see some network implementation in there..
Dude, it's coming. Patience. John_K is working on a standard BSD sockets interface. When he's done, networking should be just a few hours' hacking away. (Networking is /my/ top priority ;) )liquid8d wrote:I had mentioned previously but don't know how high a priority it might be.. I'd like to see some network implementation in there..
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
I think there's something wrong with the colors when you do a screen:clear.
Check this:
http://haggar.pocketheaven.com/fade.lua.txt
Left and Right = Change Red value
Square and Circle = Change Blue value
L and R-Trigger = Change Green value
Analogue Left and Right = Change Alpha
Select = Change between FillRect and ScreenClear
If you press Select and then change a color value, like Red, then it gets weird. And how does the alpha work?
Check this:
http://haggar.pocketheaven.com/fade.lua.txt
Left and Right = Change Red value
Square and Circle = Change Blue value
L and R-Trigger = Change Green value
Analogue Left and Right = Change Alpha
Select = Change between FillRect and ScreenClear
If you press Select and then change a color value, like Red, then it gets weird. And how does the alpha work?
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
Yes, this is a good idea. I've tested wave generation in this thread and the slow part is the wave write function, but the sample generation is very fast. I think a new function Sound.new(table) for mono sounds and Sound.new(table, table) for stereo sounds would be nice.MikeHaggar wrote:How about adding system:beep(int,int)?
Plays the sound of a beep of a specified frequency and duration through the "console speaker".
Some kind of sound that simulates PC-like beep.
Then one can get some kind of sound without adding wave files and stuff ;)
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
-
- Posts: 116
- Joined: Mon Jul 18, 2005 2:20 am
Hi guys, I'm sorta back from my holiday. I do have some work to pick up & a deadline to make, (and to read 2 weeks worth of svn commits ;)), so it will be 1st of september before I can continue on PSP development, but I'm very eager to continue with the porting of physfs! Talk to you soon!
If a beautiful girl tells you she's done some modeling work in the past, and you ask her what 3D software she used, you might be a gamedeveloper.
Yes, I'm working on this. Currently the first triangle is spinning:KaL wrote:LuaGL ?
Below is the code. I've used luaglut for it, which allows to programs with OpenGL calls which looks nearly the same as in C, but there are still problems integrating the 2D Lua Player functions with pspgl, which I'm using as the backend, because some OpenGL functions are missing, but the pspgl team is working on it.
Really nice is the fast turnaround time: When I enable USB, I can change the OpenGL source, save it and one hit on "start" reloads it. This is faster than in normal C/C++ IDEs, where you have to recompile it and helps me a lot for testing and learning OpenGL :-)
Code: Select all
white = Color.new(255, 255, 255)
glViewport(0, 0, 480, 272)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(75, 16/9, 0.5, 1000)
glShadeModel(GL_SMOOTH)
glMatrixMode(GL_MODELVIEW)
angle = 0
while true do
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
gluLookAt(0, 0, 2.5, 0, 0, 0, 0, 1, 0)
glRotatef(angle, 0, 0, 1)
glBegin(GL_TRIANGLES)
glColor3f(1, 0, 0)
glVertex3f(-2, -2, 0)
glColor3f(0, 1, 0)
glVertex3f(2, -2, 0)
glColor3f(0, 0, 1)
glVertex3f(0, 2, 0)
glEnd()
glFlush()
angle = angle + 0.5
screen:print(0, 0, "current angle: " .. angle, white)
if angle == 100 then screen:save("opengl.png") end
screen.waitVblankStart()
screen.flip()
if Controls.read():start() then break end
end
As Nevyn already wrote:LuMo wrote:what about a image:scale() ?
may enable some nice zoom-out/in effects
greets
PS: or is there already a workaround?
libArt can be found at http://www.levien.com/libart/ . I don't know the details of the library, but looks like the way to go. Perhaps there is already a Lua wrapper for it somewhere? I didn't checked all Google results for "libart lua", perhaps it must be written from scratch. Then we have to design a nice Lua interface to libart first and someone with some time has to implement it :-)There was talk about adding libArt, which would bring all primitives as vector graphics.
This is the wrong thread for general PSP SDK talk. Ask in the PSPSDK forum instead. (Oh, and actually supplying the error you get/the specific problem you have would help, too)LuMo wrote:i would help, but i can't get the psptoolchain set up properly
tried and failed multiple (even with following the steps in tutorials exactly)
maybe i get me a linux guru to help ;)
greets
Firstly very nice work on LuaPlayer. I've been using it to experiment a bit, and it is a quite nice and rapid way to develop or prototype on PSP.
Wanted to offer some 2 cents on the sound (mikmod) implementation. I worked with a variation of mikmod ages ago on Nintendo64 (produced music for some commercial N64 games, got the engine working on there with the help of its original author - Jean Paul Mikkers).
It would be nice to have some more control over XM playback via mikmod, especially:
- The ability to set the volume for, or mute/unmute individual channels in a playing multitrack module (mod/xm/s3m/etc.). This is nice for doing dynamic music mixing... having music that mixes voices in and out to match gameplay or screen events.
- Use of reverse/bidirectional loops is fairly handy and in some cases critical for XM playback support. It saves a lot of memory/rom to be able to engineer samples with bidirectional looping enabled.
- The ability to set callback(s) from within the (playing) music file(s). For example, setting a callback on the start of each pattern, or the start of each pattern step, or on specific effects bytes values being passed in the pattern channels is handy for synchronizing visual events to music or doing things like making music-oriented games. It would also make it very easy to synch a 'sound effects' based realtime/dynamic sequencer with a 'music' based background sequencer.
- The ability to trigger a specific pattern in a music file to play (instead of play from start). This is handy for using patterns to define sound effects or short musical pieces all stored in a single tracker music file... handy way to leverage a small bank of sample data into a lot of different sounds or cues.
I also look forward to anything you manage to get working with openGL in Luaplayer. On the graphics side it would certainly be handy to have rotation, blending, blend modes (additive, subtractive, overlay, etc.), and so on.
Again -- great work!
Wanted to offer some 2 cents on the sound (mikmod) implementation. I worked with a variation of mikmod ages ago on Nintendo64 (produced music for some commercial N64 games, got the engine working on there with the help of its original author - Jean Paul Mikkers).
It would be nice to have some more control over XM playback via mikmod, especially:
- The ability to set the volume for, or mute/unmute individual channels in a playing multitrack module (mod/xm/s3m/etc.). This is nice for doing dynamic music mixing... having music that mixes voices in and out to match gameplay or screen events.
- Use of reverse/bidirectional loops is fairly handy and in some cases critical for XM playback support. It saves a lot of memory/rom to be able to engineer samples with bidirectional looping enabled.
- The ability to set callback(s) from within the (playing) music file(s). For example, setting a callback on the start of each pattern, or the start of each pattern step, or on specific effects bytes values being passed in the pattern channels is handy for synchronizing visual events to music or doing things like making music-oriented games. It would also make it very easy to synch a 'sound effects' based realtime/dynamic sequencer with a 'music' based background sequencer.
- The ability to trigger a specific pattern in a music file to play (instead of play from start). This is handy for using patterns to define sound effects or short musical pieces all stored in a single tracker music file... handy way to leverage a small bank of sample data into a lot of different sounds or cues.
I also look forward to anything you manage to get working with openGL in Luaplayer. On the graphics side it would certainly be handy to have rotation, blending, blend modes (additive, subtractive, overlay, etc.), and so on.
Again -- great work!
is it possible that the svn-path changed from
svn://svn.ps2dev.org/pspware/LuaPlayer/
to
svn://svn.ps2dev.org/pspware/trunk/LuaPlayer
? (hope this is the right one)
further two more questions...
- A recent version of opoo's PSP toolchain `
^^^^ also possble with windows sdk? anyone tested?
- zlib, libpng, liblua, liblualib, mikmodlib
where can i svn those? (i am browsing the ps2dev-svn server for quite a time, without luck)
svn://svn.ps2dev.org/pspware/LuaPlayer/
to
svn://svn.ps2dev.org/pspware/trunk/LuaPlayer
? (hope this is the right one)
further two more questions...
- A recent version of opoo's PSP toolchain `
^^^^ also possble with windows sdk? anyone tested?
- zlib, libpng, liblua, liblualib, mikmodlib
where can i svn those? (i am browsing the ps2dev-svn server for quite a time, without luck)
/pspware/trunk/LuaPlayer is the right one, was never at /pspware/LuaPlayer.LuMo wrote:is it possible that the svn-path changed from
svn://svn.ps2dev.org/pspware/LuaPlayer/
to
svn://svn.ps2dev.org/pspware/trunk/LuaPlayer
? (hope this is the right one)
What's "windows sdk"? I'm using Cygwin and update it all the time from svn, when something important changes (I'm subscribed to the SVN mailinglist).LuMo wrote: further two more questions...
- A recent version of opoo's PSP toolchain `
^^^^ also possble with windows sdk? anyone tested?
Try psp/Trunk from http://svn.pspdev.org/ .LuMo wrote: - zlib, libpng, liblua, liblualib, mikmodlib
where can i svn those? (i am browsing the ps2dev-svn server for quite a time, without luck)
hmm then there is a mistake in: Readme (LuaPlayer Core developers).txt [luaplayer-source v.10]
will try cygwin again
thanks for your help
will check cygwin now, and check back afterwards
with windows sdk i mean PSPide C++ (by milhouse)Acquisition and build
============================
% svn checkout svn://svn.ps2dev.org/pspware/LuaPlayer/
will try cygwin again
thanks for your help
will check cygwin now, and check back afterwards
Ref: Shine's OpenGL script to spin a triangle found in this thread.
Attempted to run the script on either Win or PSP but I got error msg:
"error: index.lua:2: attempt to call global `glViewport' (a nil value)"
Is openGL really implemented to LP? If so, which version?
Thanks.
Attempted to run the script on either Win or PSP but I got error msg:
"error: index.lua:2: attempt to call global `glViewport' (a nil value)"
Is openGL really implemented to LP? If so, which version?
Thanks.
Geo Massar
Retired Engineer
Retired Engineer
IT IS DONE (after 9hours!!!)
for now all went fine...
sucessfully compiled the following packages with make and make install:
gave me the following error message:
had to force it:
TIA
Lumo
for now all went fine...
sucessfully compiled the following packages with make and make install:
- libpng
lua
mikmod
mikmodlib
zlib
gave me the following error message:
[UPDATE] Lua did not compile ok| sp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luaplayer.o src/luaplayer.c
src/luaplayer.c:9:17: error: lua.h: No such file or directory
src/luaplayer.c:10:20: error: lualib.h: No such file or directory
src/luaplayer.c:11:21: error: lauxlib.h: No such file or directory
In file included from src/luaplayer.c:13:
src/luaplayer.h:53: error: syntax error before '*' token
src/luaplayer.h:57: error: syntax error before '*' token
src/luaplayer.h:58: error: syntax error before '*' token
src/luaplayer.h:59: error: syntax error before '*' token
src/luaplayer.h:60: error: syntax error before '*' token
src/luaplayer.h:61: error: syntax error before '*' token
src/luaplayer.h:63: error: syntax error before '*' token
src/luaplayer.c:16: error: syntax error before '*' token
src/luaplayer.c:16: warning: type defaults to 'int' in declaration of 'L'
src/luaplayer.c:16: warning: data definition has no type or storage class
src/luaplayer.c: In function 'runScript':
src/luaplayer.c:20: warning: implicit declaration of function 'lua_open'
src/luaplayer.c:20: warning: assignment makes pointer from integer without a cas
t
src/luaplayer.c:23: warning: implicit declaration of function 'luaopen_io'
src/luaplayer.c:24: warning: implicit declaration of function 'luaopen_base'
src/luaplayer.c:25: warning: implicit declaration of function 'luaopen_table'
src/luaplayer.c:26: warning: implicit declaration of function 'luaopen_string'
src/luaplayer.c:27: warning: implicit declaration of function 'luaopen_math'
src/luaplayer.c:28: warning: implicit declaration of function 'luaopen_loadlib'
src/luaplayer.c:38: warning: implicit declaration of function 'luaL_loadfile'
src/luaplayer.c:40: warning: implicit declaration of function 'luaL_loadbuffer'
src/luaplayer.c:43: warning: implicit declaration of function 'lua_pcall'
src/luaplayer.c:43: error: 'LUA_MULTRET' undeclared (first use in this function)
src/luaplayer.c:43: error: (Each undeclared identifier is reported only once
src/luaplayer.c:43: error: for each function it appears in.)
src/luaplayer.c:46: warning: implicit declaration of function 'printf'
src/luaplayer.c:46: warning: incompatible implicit declaration of built-in funct
ion 'printf'
src/luaplayer.c:46: warning: implicit declaration of function 'lua_tostring'
src/luaplayer.c:46: warning: format '%s' expects type 'char *', but argument 2 h
as type 'int'
src/luaplayer.c:47: warning: implicit declaration of function 'lua_pop'
src/luaplayer.c:49: warning: implicit declaration of function 'lua_close'
make: *** [src/luaplayer.o] Error 1
had to force it:
now i am getting new errors :/make -f Makefile.psp
make install -f Makefile.psp
any ideas?psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luaplayer.o src/luaplayer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luacontrols.o src/luacontrols.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luagraphics.o src/luagraphics.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luasound.o src/luasound.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/luasystem.o src/luasystem.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/utility.o src/utility.c
bin2c src/auxiliary/boot.lua boot.c bootString
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/main.o src/main.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -c -o src/framebuffer.o src/framebuffer.c
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -O2 -fno-strict-aliasi
ng -L. -L/usr/local/pspdev/psp/sdk/lib src/graphics.o src/sound.o src/luaplay
er.o src/luacontrols.o src/luagraphics.o src/luasound.o src/luasystem.o src/util
ity.o src/main.o src/framebuffer.o -llua -llualib -lpng -lz -lpspgu -lm -lmikmod
-lmmio -lpspaudiolib -lpspaudio -lpspusb -lpspusbstor -lpsppower -lpspdebug -lp
spdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspuser -lpspkernel -o luaplayer.elf
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/liblua.a: could not read
symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
make: *** [luaplayer.elf] Error 1
TIA
Lumo
Last edited by LuMo on Sun Oct 02, 2005 7:41 pm, edited 1 time in total.