Homebrew [W.i.P] Lua Player Plus - First Lua Interpreter for 3DS

clienthax

Well-Known Member
Member
Joined
Oct 21, 2009
Messages
100
Trophies
0
XP
276
Country
I just didn't want to have to worry about setting up the compilation tools if I didn't have to. I'll try compiling it, and if it works, I'll post the binary somewhere.

EDIT: Compiled version attached.
didn't mean to come off hostile in that comment btw, i would of thrown a build up if you couldn't ;)
 

minexew

ayy lmao
Member
Joined
Mar 16, 2013
Messages
228
Trophies
0
XP
284
Country
Are you using some kind of a framework to make library bindings easier?
I might consider making a binding for ctrGL if people are interested.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Very interesting your openGL porting.
It's quite easy to port libraries on our interpreter. For Graphics Module we use luaGraphics.cpp ( https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaGraphics.cpp ) for the C implementation of the functions and we register these C functions onto the LUA stack through luaScreen.cpp ( https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaScreen.cpp ).

Currently, UserData creation and registration is not possible with our interpreter (UserData are similar to C++ classes) and LUA doens't have some kind similar to C pointers so you can find a bit hard to port some function to our interpreter.
We are working to re-implement UserDataStubs and UserDataRegister functions to solve this problem.


Some news: Added Timer module, Screen.fillEmptyRect function, System.getFirmware and System.getKernel.
Also added a new sample for Timer module.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
I think not. It's quite simple to port basic game homebrew written for PSP LPP but every single PSP LPP hb it's too complex for the actual stage of the interpreter (i have to add at least a new I/O module cause the basic C I/O library it's not working properly (for example, if you try to call the io.lines function, you get a "Function is not implemented" error.).
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
As i said few days ago, LPP need a revision for I/O module so, now in System module can be found some functions to use 3DS-like I/O functions (cause i had problem with standard C functions).
In specific, i added openFile,writeFile,readFile,getFileSize and closeFile.
 

minexew

ayy lmao
Member
Joined
Mar 16, 2013
Messages
228
Trophies
0
XP
284
Country
As i said few days ago, LPP need a revision for I/O module so, now in System module can be found some functions to use 3DS-like I/O functions (cause i had problem with standard C functions).
In specific, i added openFile,writeFile,readFile,getFileSize and closeFile.

Did you call sdmcInit before trying to use fopen et al.?
Having separate functions for file I/O on the 3DS doesn't seem like the right solution.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Removed the original I/O module and added some patches on fly at the interpreter startup to sets up new I/O module so they will now use the same syntax then original LUA library (so io.open, io.write, etc...). I also updated the io sample with new syntax.
At the same time, added a patch on fly to fix dofile function: now it also uses fs utility provided by ctrulib.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Added an Image system with possibility to load and save bitmap and manipulate them like you're manipulating screen (allowing to create different graphic levels to manage independently).

For example, from this sample: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/samples/image.lua

You can get a thing like this:
screen.bmp
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
I want to add New 3DS hardware support, but, actually, there are a lot of basic functions in order to be developped (like file/dir managing (delete,rename,copy,move), gyroscope and accelerometer support, etc...) and i also don't have a N3DS to test the code.
Also, i want to improve BMPV and WAV loading cause they're very high-RAM using (for a WAV of about 14 MB stereo, you have to have 28 MB of free RAM in order to load it in LUA stack, i want to make them working as a stream but i need to understand why CSND_LOOP_ENABLE seems not to work in order to do this...).
 
  • Like
Reactions: Woodbin

Woodbin

Well-Known Member
Newcomer
Joined
Sep 16, 2012
Messages
80
Trophies
1
Age
31
Location
Raccoon den
XP
191
Country
I am of course asking in long term, naturally there's a lot of more important and basic stuff to implement and perfect.

My N3DS is on the way, so once I look into Lua more, Gateway releases 9.2 update and you implement some N3DS features , I'd gladly help with testing.

Edit: And of course once I begin tinkering with LPP i can give some reports and so as well. Too little free time at the moment, university, thesis, job...
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
Some news:
- Added functions to manage directories and files (Example coming soon)
- Added possibility to stream WAV files (few RAM usage) (Example coming soon)
- Added support to Bitmap in 32Bit format (before, only 24Bit was supported)
- Speedup for some functions (BMPV module, Sound module, Screen module)
 
  • Like
Reactions: ztoben

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
I want to specify a thing:

Looking to GBAtemp wiki ( http://wiki.gbatemp.net/wiki/List_of_3DS_homebrew ) i seen that my lpp gamehb test was described as an homebrew which need LPP in order to run.
Every LPP hb is completely Stand-Alone, because main script is loaded from hb folder. You only need to rename 3dsx executable and create with SMDHTool or SMDHBuilder your proper smdh file.
PixelRoad, for example, doesn't need LPP to be executed.

Some little news:
- Added function to check if a file exists (System.doesFileExist)
- Added function to get color of a Screen/Image pixel at the selected coordinates (Screen.getPixel(x, y, screen/image))

Very soon will be added streaming feature to BMPV module to reduce RAM usage for video reproduction.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
I want to specify a thing:

Looking to GBAtemp wiki ( http://wiki.gbatemp.net/wiki/List_of_3DS_homebrew ) i seen that my lpp gamehb test was described as an homebrew which need LPP in order to run.
Every LPP hb is completely Stand-Alone
I didn't know (I didn't test all homebrew yet)
Thanks for the info :)

If developers could create/maintain their own wiki page that would be great (I'm alone to maintain all homebrew pages, so it looks bad and empty for the moment).
Even a little page with only the infobox (name/dev/link) is enough.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
I didn't know (I didn't test all homebrew yet)
Thanks for the info :)

If developers could create/maintain their own wiki page that would be great (I'm alone to maintain all homebrew pages, so it looks bad and empty for the moment).
Even a little page with only the infobox (name/dev/link) is enough.

No problem, you're doing an excellent work with the wiki ;) . It's very helpfull.

Smart update: Big speedup for drawing functions (Screen and Video modules).

Coming soon:
- PNG, JPG and TGA support.
- TTF fonts support.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @Psionic Roshambo, Thats pretty cool.