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 player core development
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Aug 13, 2005 4:10 pm    Post subject: Lua player core development Reply with quote

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
Back to top
View user's profile Send private message
Laurens



Joined: 28 Jun 2005
Posts: 14

PostPosted: Sun Aug 14, 2005 9:29 pm    Post subject: Reply with quote

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!
_________________
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.
Back to top
View user's profile Send private message MSN Messenger
XRS



Joined: 15 May 2005
Posts: 32

PostPosted: Sun Aug 14, 2005 10:04 pm    Post subject: Reply with quote

Cool, iŽll wait to try that "C-Side" cause i know something about C :P
Keep up the good work!
Back to top
View user's profile Send private message
liquid8d



Joined: 30 Jun 2005
Posts: 66

PostPosted: Mon Aug 15, 2005 8:16 am    Post subject: Reply with quote

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..
Back to top
View user's profile Send private message AIM Address
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Aug 15, 2005 8:55 am    Post subject: Reply with quote

XRS wrote:
Cool, iŽll wait to try that "C-Side" cause i know something about C


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.

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..


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.
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Aug 15, 2005 9:01 am    Post subject: Reply with quote

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 ;) )
Back to top
View user's profile Send private message Send e-mail Visit poster's website
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Mon Aug 22, 2005 9:22 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Mon Aug 22, 2005 9:27 am    Post subject: Reply with quote

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 ;)
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Aug 22, 2005 11:12 am    Post subject: Reply with quote

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 ;)


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.
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Aug 22, 2005 11:13 am    Post subject: Reply with quote

MikeHaggar wrote:
I think there's something wrong with the colors when you do a screen:clear.


Yes, there was a bug. Using black worked, but every other color could cause problems. I've fixed this in version 0.9.
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Mon Aug 22, 2005 11:37 am    Post subject: Reply with quote

Ok :)
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Tue Aug 23, 2005 10:33 pm    Post subject: Reply with quote

The Crateria Scroller doesn't work with the stormtrooper image any more. It used to work in 0.8.


And with Music.playFile you can't give it full path to filename like ms0:/psp/music/1.xm, but you have to do a System.currentDirectory(ms0:/psp/music/) to get it to work.
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Wed Aug 24, 2005 10:11 pm    Post subject: Reply with quote

Hmm... How about adding image:fillEllipse?
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Thu Aug 25, 2005 1:00 am    Post subject: Reply with quote

MikeHaggar wrote:
Hmm... How about adding image:fillEllipse?


There was talk about adding libArt, which would bring all primitives as vector graphics.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Laurens



Joined: 28 Jun 2005
Posts: 14

PostPosted: Sun Aug 28, 2005 3:53 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message MSN Messenger
KaL



Joined: 03 Apr 2005
Posts: 41

PostPosted: Sun Aug 28, 2005 6:21 am    Post subject: Reply with quote

LuaGL ?
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Aug 28, 2005 10:12 am    Post subject: Reply with quote

KaL wrote:
LuaGL ?


Yes, I'm working on this. Currently the first triangle is spinning:



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:

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
Back to top
View user's profile Send private message
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Sun Aug 28, 2005 11:11 am    Post subject: Reply with quote

nice...
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sun Aug 28, 2005 5:01 pm    Post subject: Reply with quote

what about a image:scale() ?
may enable some nice zoom-out/in effects

greets
PS: or is there already a workaround?
Back to top
View user's profile Send private message Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Aug 28, 2005 5:37 pm    Post subject: Reply with quote

LuMo wrote:
what about a image:scale() ?
may enable some nice zoom-out/in effects

greets
PS: or is there already a workaround?


As Nevyn already wrote:

Quote:

There was talk about adding libArt, which would bring all primitives as vector graphics.


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 :-)
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sun Aug 28, 2005 9:12 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Sun Aug 28, 2005 9:16 pm    Post subject: Reply with quote

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


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)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
alinear



Joined: 06 Sep 2005
Posts: 5
Location: Brooklyn, NY, USA

PostPosted: Tue Sep 06, 2005 2:43 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
haust



Joined: 01 Oct 2005
Posts: 25
Location: France

PostPosted: Sat Oct 01, 2005 7:52 am    Post subject: Reply with quote

Shine, Nevyn do you plan to have some kind of features set for a Lua Player v1.0 or will you just add features as they come and use version number just to say "hey new release" ??

vh
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sat Oct 01, 2005 7:59 pm    Post subject: Reply with quote

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)
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Oct 01, 2005 8:15 pm    Post subject: Reply with quote

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)


/pspware/trunk/LuaPlayer is the right one, was never at /pspware/LuaPlayer.

LuMo wrote:

further two more questions...
- A recent version of opoo's PSP toolchain `
^^^^ also possble with windows sdk? anyone tested?


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:

- zlib, libpng, liblua, liblualib, mikmodlib
where can i svn those? (i am browsing the ps2dev-svn server for quite a time, without luck)


Try psp/Trunk from http://svn.pspdev.org/ .
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sat Oct 01, 2005 8:23 pm    Post subject: Reply with quote

hmm then there is a mistake in: Readme (LuaPlayer Core developers).txt [luaplayer-source v.10]
Quote:
Acquisition and build
============================
% svn checkout svn://svn.ps2dev.org/pspware/LuaPlayer/


with windows sdk i mean PSPide C++ (by milhouse)

will try cygwin again

thanks for your help
will check cygwin now, and check back afterwards
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Sun Oct 02, 2005 6:56 am    Post subject: Reply with quote

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.
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sun Oct 02, 2005 7:03 am    Post subject: Reply with quote

not in .10 i guess shine tested this on a nightly build on his comp.
note: its about 7 hours later and toolchain is still running *WOAH*
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Sun Oct 02, 2005 7:22 pm    Post subject: Reply with quote

IT IS DONE (after 9hours!!!)

for now all went fine...
sucessfully compiled the following packages with make and make install:
    libpng
    lua
    mikmod
    mikmodlib
    zlib

after that i tried to compile LuaPlayer... failed!

gave me the following error message:
Quote:
| 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


[UPDATE] Lua did not compile ok
had to force it:
Quote:
make -f Makefile.psp
make install -f Makefile.psp


now i am getting new errors :/

Quote:
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


any ideas?
TIA
Lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com


Last edited by LuMo on Sun Oct 02, 2005 7:41 pm; edited 1 time in total
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 Lua Player Development All times are GMT + 10 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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