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 Previous  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
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

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

LuMo wrote:

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


Sounds to me like lualib isn't in your path. Confirm that the above three files really are in your /usr/local/pspdev/psp/include/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

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

seems that i updated just when you posted :)
yes, those files are located in the dir, NOW

following files are included:
    alloca.h
    ar.h
    argz.h
    assert.h
    ctype.h
    dirent.h
    envz.h
    errno.h
    fastmath.h
    fcntl.h
    files
    getopt.h
    grp.h
    iconv.h
    ieeefp.h
    langinfo.h
    lauxlib.h
    limits.h
    locale.h
    lua.h
    lualib.h
    machine
    malloc.h
    math.h
    mikmod.h
    mmio.h
    newlib.h
    paths.h
    png.h
    pngconf.h
    process.h
    ptform.h
    pthread.h
    pwd.h
    reent.h
    regdef.h
    search.h
    setjmp.h
    signal.h
    stdio.h
    stdlib.h
    string.h
    sys
    tdefs.h
    termios.h
    time.h
    timer.h
    unctrl.h
    unistd.h
    utime.h
    utmp.h
    wchar.h
    wctype.h
    zconf.h
    zlib.h
    _ansi.h
    _syslist.h

_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
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 Oct 02, 2005 7:48 pm    Post subject: Reply with quote

Yes, you're not getting a preprocessor error now, that thing there is a linker error.

Confirm that you have the file
/usr/local/pspdev/psp/lib/liblua.a

(see that "/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/lib/liblua.a: could not read" there? MIGHT give you a clue to what's wrong. . .)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

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

LuMo wrote:
[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 :/


If you have compiled Lua before without Makefile.psp, there are old files compiled for your host system. Call a "make clean" and "make -f Makefile.psp clean" and then again a "make -f Makefile.psp" and "make -f Makefile.psp install".
Back to top
View user's profile Send private message
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

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

thats evil :)
it works now
thanks to the chiefs ;)

greets
Lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 11:15 am    Post subject: Reply with quote

I'm not sure but is there a socket like interface for lua <-> psp's wifi connection?
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Mon Oct 03, 2005 6:02 pm    Post subject: Reply with quote

not yet
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 9:05 pm    Post subject: Reply with quote

LuMo wrote:
not yet


Ah, there should be, Like a Net class or something.

e.g. Net.startWifi() would start the wifi connection

You could have something to poll available connections like
Code:

Net.connections Array

Net.connections[0][0] == "Home"  // SSID  {
Net.connections[0][1] == "10.0.0.3" // IP    {    Read-only as defined on PSP vmenu
Net.connections[0][1] == "10.0.0.1" // Gateway    {

Net.pickConnection(0)

time = 0
notconnect = 0
data = ""

while Net.connected = false do
  time = time + 1
  if time > 200 then
    notconnect = 1
    break
  end
end

if notconnect = 0 then
  while Net.connected = true do
    if Net.error = true do
      screen:print(1,1,Net.LastError(),Color.new(255,255,255))
      break
    end
    sock = Net.Socket.New("10.0.0.1", 80) // This halts the script while it connects, adds any error to sock.Errors array
    while sock.connected = true
      if sock.error = true do
        screen:print(1,1,sock.LastError(),Color.new(255,255,255))
        break       
      end
      sock.get(data)
      // Decide what to do with the socket data
      sock.send("String")
    end
  end
end


Something like that.. would be idea...

I don't even know if you can define Classes in Lua lol
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Mon Oct 03, 2005 9:08 pm    Post subject: Reply with quote

the problem is not the lua end
its mainly cause the backend (c-side) is not stable yet (guessing!!)

greets
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Oct 03, 2005 9:09 pm    Post subject: Reply with quote

I promise, the reason that we don't have sockets in LuaPlayer isn't because we can't come up with an API...

When sockets in the toolchain is stable, luaplayer will get it.


Last edited by nevyn on Mon Oct 03, 2005 9:11 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 9:09 pm    Post subject: Reply with quote

LuMo wrote:
the problem is not the lua end
its mainly cause the backend (c-side) is not stable yet (guessing!!)

greets


Well PSPRadio and PSPWifiJukebox seems to work fine...
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Oct 03, 2005 9:11 pm    Post subject: Reply with quote

Zenurb wrote:
LuMo wrote:
the problem is not the lua end
its mainly cause the backend (c-side) is not stable yet (guessing!!)

greets


Well PSPRadio and PSPWifiJukebox seems to work fine...


They aren't what you'd call "stable" when it comes to the networking end. Also, they aren't using BSD sockets, but rather interface directly with the sce* functions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 9:20 pm    Post subject: Reply with quote

nevyn wrote:
Zenurb wrote:
LuMo wrote:
the problem is not the lua end
its mainly cause the backend (c-side) is not stable yet (guessing!!)

greets


Well PSPRadio and PSPWifiJukebox seems to work fine...


They aren't what you'd call "stable" when it comes to the networking end. Also, they aren't using BSD sockets, but rather interface directly with the sce* functions.


Why does LuaPlayer have to use BSD sockets?

LuaPlayer should map the sce socket functions, that way, people can get an understanding of them, and when they move onto C/C++ they will find it easier =)
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Mon Oct 03, 2005 9:29 pm    Post subject: Reply with quote

Because BSD sockets is the de facto standard for networking. And because there's already a great network library written, and I hate to reinvent the wheel. And because "mapping the sce functions" makes the API damn ugly and non-user-friendly.

"..and when they move onto C/C++...": LuaPlayer isn't a first step of programming, so that newbies can start somewhere instead of C (although it can certainly be used that way). Rather, it's a rapid application development environment, perfectly suitable for "real programmers". Thus the language shouldn't be designed to help you progress onto C, but to make every part of the language/interface fast and simple to use.

Using BSD sockets allows it to be portable, as well, needing no extra code to port it to Win, Mac and Linux (or even, say, nintendo DS, when their bsd sockets stabilize)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 10:03 pm    Post subject: Reply with quote

nevyn wrote:
Because BSD sockets is the de facto standard for networking. And because there's already a great network library written, and I hate to reinvent the wheel. And because "mapping the sce functions" makes the API damn ugly and non-user-friendly.

"..and when they move onto C/C++...": LuaPlayer isn't a first step of programming, so that newbies can start somewhere instead of C (although it can certainly be used that way). Rather, it's a rapid application development environment, perfectly suitable for "real programmers". Thus the language shouldn't be designed to help you progress onto C, but to make every part of the language/interface fast and simple to use.

Using BSD sockets allows it to be portable, as well, needing no extra code to port it to Win, Mac and Linux (or even, say, nintendo DS, when their bsd sockets stabilize)


Good point. I just am impatient waiting for socket support in LuaPlayer.

Is there a way to bundle your Lua scripts directly into the LuaPlayer Eboot and have bundled applications? *Is a noob*
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Mon Oct 03, 2005 10:12 pm    Post subject: Reply with quote

you could add your code to the boot.lua, which will be included into the eboot (shine said something like that)
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 10:19 pm    Post subject: Reply with quote

LuMo wrote:
you could add your code to the boot.lua, which will be included into the eboot (shine said something like that)


I mean like, with python, you can embed the script directly into the interpeter and have one file which runs the interpreter which loads the code from a resource in itself, can you do that with LuaPlayer?
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Mon Oct 03, 2005 10:23 pm    Post subject: Reply with quote

lots of questions hehe, you can compile luaplayer and include the script to the binary, but a.f.a.i.k. you are not able to include the resources
zip support (loading scripts and res. from a zip file) is planned to be done

greets
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Zenurb



Joined: 30 Sep 2005
Posts: 106
Location: United Kingdom

PostPosted: Mon Oct 03, 2005 10:24 pm    Post subject: Reply with quote

LuMo wrote:
lots of questions hehe, you can compile luaplayer and include the script to the binary, but a.f.a.i.k. you are not able to include the resources
zip support (loading scripts and res. from a zip file) is planned to be done

greets


Cool =] My last question for now. I'm in college, and I'll tinker more when I get home.
_________________
Proud Dvorak User
US 1.5 PSP (Original)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
LuMo



Joined: 21 Aug 2005
Posts: 410
Location: Austria

PostPosted: Fri Oct 07, 2005 7:38 pm    Post subject: C-Side of LuaPlayer(windows) Reply with quote

well i tried to add a >>little<< function just to test if it works.
i copied the blit-function (to seperate files)
and compiled it, which worked without any errors!
i tested created an lua file to test the original code (so i did not **** something up)

Code:
--load images
picture=Image.load('landscape.png')
backbuffer = Image.createEmpty(480, 272)


while not Controls.read():start() do
   backbuffer:blit(0,0,picture,0,0,240,272,false)
   backbuffer:blit(240,0,picture,240,0,240,272,false)
   screen:blit(0,0,backbuffer,0,0,backbuffer:width(),backbuffer:height(),false)
   screen.waitVblankStart()
   screen.flip()
end

test successful

after that i changed the line
Code:
   backbuffer:blit(0,0,picture,0,0,240,272,false)
   backbuffer:myblit(240,0,picture,240,0,240,272,false)

this should give me exactly the same result as the one above (due just copying the function)
but luaplayer returns me the following error:

Code:
loop in gettable

in the line where myblit is used!
i do not know what this means...
any ideas?

[EDIT] i just get the same error when i put the function in the same file (graphics.c and luagraphics.c)

thanks in advance
lumo
_________________
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Back to top
View user's profile Send private message Visit poster's website
Arwin



Joined: 12 Jul 2005
Posts: 426

PostPosted: Fri Oct 07, 2005 10:14 pm    Post subject: Reply with quote

nevyn wrote:
Zenurb wrote:
LuMo wrote:
the problem is not the lua end
its mainly cause the backend (c-side) is not stable yet (guessing!!)

greets


Well PSPRadio and PSPWifiJukebox seems to work fine...


They aren't what you'd call "stable" when it comes to the networking end. Also, they aren't using BSD sockets, but rather interface directly with the sce* functions.


What do you mean here exactly? I've been using PSP Radio last weekend for a fair bit, and I had no problems ... But I assume that you'll likely know something about the internals that I don't. ;)
Back to top
View user's profile Send private message
haust



Joined: 01 Oct 2005
Posts: 25
Location: France

PostPosted: Mon Oct 17, 2005 7:36 am    Post subject: Reply with quote

Would it be possible to obtain all the call stack when an error occurs ??
I have lots of functions called from many points and I have hard time to find exactly where the error occured :(
I don't known if it's possible or difficlut but it would be useful :)
Back to top
View user's profile Send private message
haust



Joined: 01 Oct 2005
Posts: 25
Location: France

PostPosted: Thu Oct 27, 2005 7:54 pm    Post subject: Reply with quote

Another request : would it be possible to add LuaExpat for xml support. I think it would be useful for data storing, config file and things like that....

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



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Thu Oct 27, 2005 8:11 pm    Post subject: Reply with quote

haust wrote:
Another request : would it be possible to add LuaExpat for xml support. I think it would be useful for data storing, config file and things like that....


Why do you want XML for config files? You can do it in Lua, if you need hierarchicly configs:
Code:

config = { a={1,2,b={3}}, c="Hallo"}


and the just a dofile to read the config. But if you really want to use XML, there is a very short pure Lua solution: http://lua-users.org/wiki/LuaXml
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Fri Oct 28, 2005 12:33 am    Post subject: Reply with quote

Arwin wrote:
What do you mean here exactly? I've been using PSP Radio last weekend for a fair bit, and I had no problems ... But I assume that you'll likely know something about the internals that I don't. ;)


Tried connecting using DHCP? Seen what happens when a socket timeout? Those problems were fixed in the latest release, but that was like today, so I haven't had time to look at it.

And it's still not socket.h. There's a guy, David Beyer, who's working on that, though.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
haust



Joined: 01 Oct 2005
Posts: 25
Location: France

PostPosted: Fri Oct 28, 2005 7:27 am    Post subject: Reply with quote

Shine wrote:
Why do you want XML for config files? You can do it in Lua, if you need hierarchicly configs:
Code:

config = { a={1,2,b={3}}, c="Hallo"}


and the just a dofile to read the config. But if you really want to use XML, there is a very short pure Lua solution: http://lua-users.org/wiki/LuaXml

Well, I should had say (sorry if my english is not correct) that I know Lua tables can be used for all kind of needs including config data. However I like separation between code and data. When I need to modify the core logic I change the source code, when I need to modify the visuals, audio, config, etc. I change the data files, but it's just me....
Anyway it was just a request, I can live without it :)

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



Joined: 02 Oct 2005
Posts: 65
Location: Austria

PostPosted: Fri Oct 28, 2005 9:17 am    Post subject: Reply with quote

You sound like a Java or C++ programmer :P
But I guess that's to be expected from someone who prepends all his member variables with m_ *shudder*

But seriously, why would you need a seperate config file format in a Lua app? I mean, the lua table constructor syntax is actually far more suited to the task than XML, and it will be faster to parse as well ;)

And why shouldn't you be able to seperate code and data just because the data is in Lua tables?
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Fri Oct 28, 2005 5:49 pm    Post subject: Reply with quote

haust wrote:
However I like separation between code and data. When I need to modify the core logic I change the source code, when I need to modify the visuals, audio, config, etc. I change the data files


Separation of code and data is a good idea for bigger programs, but I don't see why you don't want to use tables for it. You have your main program, index.lua (or script.lua)

Code:

dofile("level1.lua")
...
doSomethingWith(level.name, level.timeLimit)


and then in a separate file your config, e.g. for a level, as a file named "level1.lua" :

Code:

level = {
  name = "The big one",
  timeLimit = 12345
}


(of course, instead of hardcoding dofile("level1.lua") a list of levels could be in some other config files). The nice thing is, that you can save numbers and strings without the need to convert it. With XML you have only strings.
Back to top
View user's profile Send private message
haust



Joined: 01 Oct 2005
Posts: 25
Location: France

PostPosted: Fri Oct 28, 2005 6:53 pm    Post subject: Reply with quote

haust wrote:
Anyway it was just a request, I can live without it :)

I already use tables for data handling (since, I guess, tables were designed for this)....
Back to top
View user's profile Send private message
th0mas



Joined: 24 Apr 2005
Posts: 43
Location: Canada

PostPosted: Mon Nov 14, 2005 7:12 am    Post subject: Reply with quote

I apologize in advance if this would be better suited in a different thread.

I've ported the windows emulator to SDL. It should be possible to get it to run on a wide array of devices and other consoles. I did not port sound, nor (obviously) 3d.

I just took the src/emulator/windows/windows.c and ported the glut code to SDL, and took sound.c and made a set of stub functions.

[nevermind this part, bug fixed, see footnote]
AFAIK, there is only one bug that is not fixed at the moment. It seems that certain blitting functions do not work, and I am unsure why this is. For example:

- helloworld works
- clock, calculator, minesweeper works
- stars works

- fractal doesn't work
- snake - the background is there, but the snake itself does not show up.

I just did this in the past hour or two, so probably the fix will appear soon.. but if anyone knows what is going on offhand please let me know.

I'll pass the code onto whoever wants it once the bug is fixed.

Cheers,
Tom

Update: Bug fixed. i updated to the SVN source (I was using the 0.11 release) and it fixed it. Games appear to be completely playable (sans sound & 3d).
_________________
http://th0mas.xbox-scene.com
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 Previous  1, 2, 3  Next
Page 2 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