Lua Player version 0.15

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 Player version 0.15

Post by Shine »

On http://www.luaplayer.org you can get the new version 0.15.

The changelog:

- timer bug fixed (was bug in PSPSDK) [mrbrown]
- wlan socket support (based on PspPet's "WiFi Multi-Test .03") [Shine]
- changed sceGu* and sceGum* functions to Gu.* and Gum.* [Shine]
- System.getFreeMemory added [Shine]
- Freetype added, with 2 default fonts (see http://www.gnome.org/fonts/ for the licence) [Shine]

The new functions are documented at http://wiki.ps2dev.org/psp:lua_player:functions and with the 2 new samples: True Type Font and WLAN. The WLAN example has a webserver integrated: Enter the IP of your PSP in your webbrowser and the PSP delivers a simple test page.

I'm sure there are many bugs, especially the new WLAN support needs to be enhanced, e.g. DNS lookup and some internal TODOs, but at least it works :-)
Last edited by Shine on Sat Jan 07, 2006 6:23 pm, edited 1 time in total.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

great work on the wireless.. can't wait to try it out.
Chaosmachine Studios: High Quality Homebrew.
nevyn
Posts: 136
Joined: Sun Jul 31, 2005 5:05 pm
Location: Sweden
Contact:

Post by nevyn »

Dude, you added wireless :P Not a pure socket.h implementation it seems, but perhaps that's for the good... 'Tho adding the LuaSocket library (http://luaforge.net/projects/luasocket/) would kick serious ass.

I need to get back to the luaplayer scene... *too much school*
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

Hello
I've just noticed that there is maybe some problem when printing
text to a screen with Luaplayer0.15:

FOSK0.20 works smoothly under Luaplayer v0.12, but when running with Luaplayer v0.15,
the lines with null length are printed with the same content as the prev.lines.

source: http://fosk4psp.dynamicweb.hu/
file: kbrdfnct.lua
routine: disptxt()

Code: Select all

for j = 1,k do
            tx = j+starty
			
                if &#40;tx > 0&#41;and &#40;tx<numlines&#41; then
                    screen&#58;print&#40;0, 8*&#40;j-1&#41;, string.format&#40;"%s",string.sub&#40;text&#91;tx&#93;,startx,&#40;string.len&#40;text&#91;tx&#93;&#41;-mode1&#41;&#41;&#41;, colors&#91;2&#93;&#91;1&#93;&#41;
                end
end

EDIT:
the same thing happens with MikeHaggar's Text Browser.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mrn wrote:FOSK0.20 works smoothly under Luaplayer v0.12, but when running with Luaplayer v0.15,
the lines with null length are printed with the same content as the prev.lines.
To fix your problem write this:

Code: Select all

yourStringVariable
instead of

Code: Select all

string.format&#40;"%s", yourStringVariable&#41;
and

Code: Select all

sv1 .. sv2
instead of

Code: Select all

string.format&#40;"%s%s", sv1, sv2&#41;
I don't know the reason for this bug, but looks like string.format uses the last string, when outputing an empty string. In Lua Player 0.12 this throws no assertion:

Code: Select all

assert&#40;string.format&#40;"%s", "1"&#41; == "1"&#41;
assert&#40;string.format&#40;"%s", ""&#41; == ""&#41;
and in Lua Player 0.15 this throws no assertion:

Code: Select all

assert&#40;string.format&#40;"%s", "1"&#41; == "1"&#41;
assert&#40;string.format&#40;"%s", ""&#41; == "1"&#41;
I've added it to the list of bugs: http://wiki.ps2dev.org/psp:lua_player:todos
BTW: this list is not for me only, if someone can fix a bug, I would be happy to include it to Lua Player :-)
dkla
Posts: 21
Joined: Mon Oct 17, 2005 6:55 pm

Re: Lua Player version 0.15

Post by dkla »

[quote=
- Freetype added, with 2 default fonts (see http://www.gnome.org/fonts/ for the licence) [Shine]
[/quote]

Arrrgh, just when I finished writing all those font-blitting routines for my game, you built it into the Player!!! :-)

But seriously, good job on the Freetype stuff (and thanks for adding color support). I'll definitely check it out.
User avatar
dragaron
Posts: 6
Joined: Tue Dec 06, 2005 11:14 am

LUA v.15

Post by dragaron »

Possible bugs:

I noticed that when checking for the time in this version it returns the hour inaccurately at 5 hours later than usual. If system clock says 5:00 pm, the LUA v.15 returns the hour as 10:00 pm.

Also, wav files sound slightly distorted in this version. They have a crackling noise in LUA v.15, when they played perfectly well in LUA v.15.
He has showed you, O man, what is good.
And what does the LORD require of you?
To act justly and to love mercy
and to walk humbly with your God. (Micah 6:8)
User avatar
JoshDB
Posts: 87
Joined: Wed Oct 05, 2005 3:54 am

Post by JoshDB »

The time in Lua Player is GMT -+0
2Xtremes2004
Posts: 53
Joined: Wed Aug 31, 2005 1:43 am

Post by 2Xtremes2004 »

JoshDB wrote:The time in Lua Player is GMT -+0
Is this new with v.15 because before (v.14) it was displaying the time according to the time zone set on my psp, if so is there a way to set the time zone within lua?

My current clock code.

Code: Select all

function Clock&#40;&#41;
	time = os.time&#40;&#41;
	dateString = os.date&#40;"%l&#58;%M%p %m/%d/%Y"&#41;
	dateFields = os.date&#40;"*t", time&#41;

	screen&#58;print&#40;169, 2, dateString, white&#41;
end
I want my money back!?
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

just tried to replace the "screen:print" with "screen:fontPrint" in F.O.S.K
and it become really-really slow: I need to press a button 10-15 times
until the cursor reacts. Removing "string:format" does not speed it up at all
(just try it in the dispText routine.)

So, the question is, why is it so and how can I make it faster?
(the only thing coming to my mind is to copy the actual screen
and re-display it if there is no change like cursor movement...
but still, it does not solve the true-type font speed question.)
thnx, mrn
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

mrn wrote: So, the question is, why is it so and how can I make it faster?
(the only thing coming to my mind is to copy the actual screen
and re-display it if there is no change like cursor movement...
but still, it does not solve the true-type font speed question.)
You can cache the font drawing, but I think the best would be if it is cached from Lua Player, because otherwise it is difficult for Lua scripts when inserting single characters, because all other characters has to be redrawn, so caching could be done only per character. Currently the problem is that the glyphs are rendered every time again. Perhaps the bitmap objects, which are produced by Freetype, should be cached.
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Hey, dude -

When will version 0.15 for Windows platform be available?

I tried 3D Cube/index.lua from the version 0.14 distribution with the version 0.14 for Windows and I got a black screen.

It would be very helpful if I had a version 0.15 for Windows in order to experiment 3D stuff. I know OpenGL but Gu.* and Gum.* are not quite the same with OpenGL or even SDL. I spent a lot of time trying to figure out the differences.

Thanks.
Geo Massar
Retired Engineer
Zenurb
Posts: 106
Joined: Fri Sep 30, 2005 8:33 am
Location: United Kingdom
Contact:

Post by Zenurb »

Unless you can somehow make Gu.* and Gum.* map to OpenGL functions which do the same thing exactly, there wont be any 3d functions in the windows version of luaplayer.
Proud Dvorak User
US 1.5 PSP (Original)
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Oh ...
Geo Massar
Retired Engineer
mrn
Posts: 116
Joined: Wed Nov 02, 2005 2:26 am

Post by mrn »

You can cache the font drawing, but I think the best would be if it is cached from Lua Player, because otherwise it is difficult for Lua scripts when inserting single characters, because all other characters has to be redrawn, so caching could be done only per character. Currently the problem is that the glyphs are rendered every time again. Perhaps the bitmap objects, which are produced by Freetype, should be cached.
Shine, can you pls. implement the caching in one of the next versions of Lua Player?
It would allow to see much more from a text file, not to mention the look,
the zoomIn - zoomOut options, etc.
This would also support offline browser-type applications to be ported to Lua.
(btw, is there any offline browser for reading downloaded htm files?)
willdenniss
Posts: 1
Joined: Sun Oct 09, 2005 11:38 am

Post by willdenniss »

Thanks for the awesome software! I found a considerable speed increase upgrading to 0.15

fontPrint is cool, but extreemly slow. In it's current state, it's primary use that I see is for cached stuff - not to be called every frame. Perhaps the docs should warn about this.

Will.
LiquidIce
Posts: 55
Joined: Mon Apr 04, 2005 1:15 am
Contact:

Post by LiquidIce »

Shine, YOU are the man! Network support is perfect! This is exactly what I have been waiting for. Now I can finish my application. Look for some exciting news when I launch my Lua app on Jan 5th.

Thanks for all of your hard work, it is appreciated.
justatest
Posts: 10
Joined: Mon Dec 19, 2005 5:56 pm

Post by justatest »

cool !! network supported !!! and also waiting for the guy up there say Jan 15th !! keep going all !
ema
Posts: 11
Joined: Wed Dec 07, 2005 3:02 am
Contact:

Post by ema »

LuaPlayer is a great work!
I'm enjoying more than playing any games :)

Now, I have a suggestion for 3D services.
How about dividing vertex prepareing from Gum.drawArray?

I've added a small user data for storing prepared vertices,
drawing 3D objects became extremely faster.
(it could draw over 12000 triangles in 1/60 sec.)

Here is the source code.
http://geocities.com/lua_ema/lua3dgs.zip

I'm glad if you like it.

Thanks.
Post Reply