Homebrew [Release] Lua Player Plus 3DS (lpp-3ds) - LUA interpreter for 3DS

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 187,231
  • Replies Replies 1,199
  • Likes Likes 35
So I'm intrested in learning Lua. If I know the basics of it, and I know how to create simple 2D/3D games, and I want to create one for 3DS do I use this?
 
So I'm intrested in learning Lua. If I know the basics of it, and I know how to create simple 2D/3D games, and I want to create one for 3DS do I use this?
Yes, just put index.lua with the .3dsx file. For lpp-3ds specific functions, look at "Documentation.html" included with the download or this page.
 
Finally Revision 3 of lpp-3ds is ready to download!

Changelog:

New functions:

- Socket.init() - Init socketing system.
- Socket.term() - Term socketing system.
- Socket.createServerSocket() - Create a server socket.
- Socket.connect() - Create a client socket and connect it to the host.
- Socket.send() - Send a message.
- Socket.receive() - Receive a message.
- Socket.accept() - Search for connections (Server sockets).
- Socket.close() - Close a socket.
- Network.getWifiLevel() - Returns power level of your WiFi connection (1 to 3).
- Graphics.getImageWidth() - Returns width of a loaded GPU texture.
- Graphics.getImageHeight() - Returns height of a loaded GPU texture.
- Graphics.drawRotateImage() - Blit a rotated GPU texture.
- Graphics.drawScaleImage() - Blit a scaled GPU texture.
- Graphics.drawImageExtended() - Blit a GPU texture with custom settings.
- Graphics.convertFrom() - Convert a CPU image to a GPU texture.
- Graphics.drawCircle() - Blit a circle using GPU.
- System.addNotification() - Add a news to official Nintendo News applet.
- System.getUsername() - Returns console user username.
- System.getBirthday() - Returns console user birthday.

New features:


- Added texture blinding for images. Now you can blit your image with a color blinding effect.
- Now interpreter will execute a full collect garbage cycle when exiting or launching apps.
- Improved GPU coords accuracy: now all drawing functions take floats coords instead of integer ones.

Deprecated functions:

- Network.initFTP() deprecated ( Use Socket.init() )
- Network.termFTP() deprecated ( Use Socket.term() )
- System.extractRAR deprecated (Unstable and not RAM-safe function)

Syntax changes:

- Now Graphics.drawImage() takes an optional 4th argument (u32 color) for texture blinding.
- Now Graphics.drawPartialImage() takes an optional 8th argument (u32 color) for texture blinding.
- Now all Graphics drawing function will take floats instead of integers as coords.

Bugfixes:

- Graphics.loadImage() now loads JPG and BMP files correctly.
- Screen.flipImage() now flip 32bpp images correctly.
- Sound.openOgg() now correctly loads OGG files without a COMM sector in header.
- Sound.updateStream() now correctly works with OGG files with loop system enabled.
- Socket.term() correctly free RAM used for Socketing (Old Network.termFTP doesn't).

Samples:


- Updated BMPV.lua sample to last interpreter build.
- Added sample for Console module.
- Added sample for Socket module.
- Added sample for Graphics module.

Download: http://rinnegatamante.it
 
Last edited by Rinnegatamante,
This is supposed to add to "Notifications"? It doesn't seem to work, or I'm probably using it wrong. Tested through themehax, ironhax, and oot3dhax. New 3DS 10.1.0-27U

Don't know if new haxs have access to news:U service. Tested it with CIA/3DS builds and on NH1.1b when i added it and it worked perfectly.
 
Don't know if new haxs have access to news:U service. Tested it with CIA/3DS builds and on NH1.1b when i added it and it worked perfectly.
3dbrew just says "news:u" is accessible without specifying Ninjhax 1 or 2. Probably an issue with newer haxes then.

Also just tested on Old 3DS 10.1.0-27U with themehax/oot3dhax (doesn't have ironfall).
 
Last edited by ihaveahax,
Hey there,
I'm coming across a problem while trying to run the BMPV sample code (with minor tweaks). The video playback keeps flickering while kind of rolling and playing the frames back rather slowly, not to mention it's also turned to black and white (not priority right now but equally as curious about that). I've spent a while trying to fix it but have nothing. I've given double buffering a try (at least I think I did) by using draw; flip; refresh; draw; in that order, as well as playing around with other things.

Here's my current code, any help would really be appreciated. I'm sure it's something really obvious that I'm overlooking. Video file is 15fps bmpv, stereo audio (haven't got that working yet either).
Code:
-- The original video used can be viewed here: https://www.youtube.com/watch?v=Kh0Y2hVe_bw

test = BMPV.load("/output.bmpv")
Sound.init()
BMPV.start(test,LOOP,0x08,0x09)
white = Color.new(255,255,255)
while true do
    Screen.refresh()
    Screen.waitVblankStart()
    Screen.clear(TOP_SCREEN)
    cur = BMPV.getFrame(test)
    Screen.debugPrint(0,0,cur,white,TOP_SCREEN)
    BMPV.draw(1,0,test,BOTTOM_SCREEN)
    Screen.flip()
    Sound.updateStream()
end

Here's a gif of it running in Citra:

DentalMeatyAfricanaugurbuzzard.gif
 
Last edited by Plath,
Hey there,
I'm coming across a problem while trying to run the BMPV sample code (with minor tweaks). The video playback keeps flickering while kind of rolling and playing the frames back rather slowly, not to mention it's also turned to black and white (not priority right now but equally as curious about that). I've spent a while trying to fix it but have nothing. I've given double buffering a try (at least I think I did) by using draw; flip; refresh; draw; in that order, as well as playing around with other things.

Here's my current code, any help would really be appreciated. I'm sure it's something really obvious that I'm overlooking. Video file is 15fps bmpv, stereo audio (haven't got that working yet either).
Code:
-- The original video used can be viewed here: https://www.youtube.com/watch?v=Kh0Y2hVe_bw

test = BMPV.load("/output.bmpv")
Sound.init()
BMPV.start(test,LOOP,0x08,0x09)
white = Color.new(255,255,255)
while true do
    Screen.refresh()
    Screen.waitVblankStart()
    Screen.clear(TOP_SCREEN)
    cur = BMPV.getFrame(test)
    Screen.debugPrint(0,0,cur,white,TOP_SCREEN)
    BMPV.draw(1,0,test,BOTTOM_SCREEN)
    Screen.flip()
    Sound.updateStream()
end

Here's a gif of it running in Citra:

DentalMeatyAfricanaugurbuzzard.gif


I highy suggest you to use JPGV videos (Syntax is the same for JPGV sub-module).
Anyway, try to execute the code on real hw and see if results are same.
 
  • Like
Reactions: Plath
I highy suggest you to use JPGV videos (Syntax is the same for JPGV sub-module).
Anyway, try to execute the code on real hw and see if results are same.

Thanks for your suggestions. Tried it with JPGV, exact same code just replacing BMPV struct calls with JPGV. I got the same results on n3DS hardware running tubehax, except now it's going through the frames super slow.
Could someone maybe send me a working .JPGV to test out for the bottom screen? I just want to make sure it's not the files or converter I'm using.

Pictured below is what the JPGV script looks like:
Untitled.png
 
Last edited by Plath,
Thanks for your suggestions. Tried it with JPGV, exact same code just replacing BMPV struct calls with JPGV. I got the same results on n3DS hardware running tubehax, except now it's going through the frames super slow.
Could someone maybe send me a working .JPGV to test out for the bottom screen? I just want to make sure it's not the files or converter I'm using.

Pictured below is what the JPGV script looks like:
View attachment 26088

Take in mind that Citra is very slow if compared to real hardware. Anyway, to vid2jpgv remember to give HEIGHTxWIDTH (not WIDTHxHEIGHT).
Aldo the getFrame call is useless, you just have to use the draw function (It updates video and aubio buffers by itself).

--------------------- MERGED ---------------------------

Here you are a sample JPGV encoded with this settings:
Video is 24:29 mins (124 MBs)

Framerate: 23
Audiochannels: 2
Resolution: 240x320
Samplerate: 24000
Audiocodec: Vorbis
Video Quality: LQ
3D Video: No

http://rinnegatamante.it/output.jpgv
 
Last edited by Rinnegatamante,
  • Like
Reactions: Plath
Take in mind that Citra is very slow if compared to real hardware. Anyway, to vid2jpgv remember to give HEIGHTxWIDTH (not WIDTHxHEIGHT).

Thank so much again, your file let me know it was just my conversion I was screwing up. Not sure if I was doing the wrong resolutions earlier, but changing the samplerate to 24000 has everything working 100%.
All the work you've done here is incredible by the way!
 

Site & Scene News

Popular threads in this forum