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

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 187,240
  • Replies Replies 1,199
  • Likes Likes 35
Looks nice. Don't know if it'll replace Sublime Text for me yet, but we'll see how well it develops ;).
 
Regarding the IDE:

I use ZeroBrane Studio with some custom scripts for auto complete and launching Citra.

k9iXVMZ.png



Interpreter: http://pastebin.com/ApcGk4tE
API: http://pastebin.com/gALW2PEK

Instructions: Download the raw citra.lua and lpp.lua files above. You will have to edit citra.lua to reflect your lpp-3ds.3dsx and citra paths.
Go to your ZeroBrane install and place citra.lua in ZeroBraneStudio\interpreters and lpp.lua under ZeroBraneStudio\api\lua.

Then in the IDE, go to Project > Lua Interpreter and select "LPP/Citra". Auto complete should work and hitting Execute (F6) should launch Citra.

Edit: Make sure when you are coding your project, your index.lua is in citra\user\sdmc and NOT next to your 3dsx. When you transfer to your 3ds they need to be in the same folder together.

When lpp-3ds is running, it is looking in the current directory of your SD for index.lua. If you run the app on your 3DS, homebrew launcher sets the current directory to your application folder where the 3dsx is launched.
Citra doesn't do that so it sets the current directory to the root of the emulated SD card. That's why there is a difference.
I strongly recommend using a symbolic link for your index.lua file so it is a little easier to keep everything organized.

Edit 2: This autocomplete API is only for R2 and does not include any new functions from R3+. Not too much has changed but there are some differences.
 
Last edited by 0x0wl,
The Sound.close()/term() functions aren't working, sound just keeps playing. And if I exit the homebrew then go back again the audio resumes from where it left off (though if you stay in the Homebrew Launcher for a while everything kind of "resets" and when you open the homebrew again it won't resume).
 
Big fan of these latest commits to LPP on the Github.
One last final thing I've got a question about is, is it possible to do a OneShotPrint with GPU rendering?
In my previous posts I figured out the double-buffer thing with CPU rendering but I've been playing around with GPU rendering and haven't figured it out.

Here's what I've got so far

index.lua said:
red = Color.new(255,0,0)
green = Color.new(0,255,0)

Graphics.init()

function onshotdraw(x1,x2,y1,y2,color)
Graphics.fillRect(x1,x2,y1,y2,color)
Screen.flip()
Screen.refresh()
Graphics.fillRect(x1,x2,y1,y2,color)​
end

while true do
Graphics.initBlend(TOP_SCREEN)

if Controls.check(Controls.read(), KEY_A) then
onshotdraw(20,50,30,40,red)​
elseif Controls.check(Controls.read(), KEY_B) then
onshotdraw(40,60,40,50,green)​
end

Graphics.termBlend()
Screen.waitVblankStart()​
end

So what this does right now is that it gets a box based on input to stick on screen which is good but once I try to apply the other box the first box get erased. It's like Screen.Refresh() always clears everything
 
Big fan of these latest commits to LPP on the Github.
One last final thing I've got a question about is, is it possible to do a OneShotPrint with GPU rendering?
In my previous posts I figured out the double-buffer thing with CPU rendering but I've been playing around with GPU rendering and haven't figured it out.

Here's what I've got so far



So what this does right now is that it gets a box based on input to stick on screen which is good but once I try to apply the other box the first box get erased. It's like Screen.Refresh() always clears everything

OneshotPrint with GPU rendering should be something like this:

Code:
function GPUOneShotPrint(func, screen)
   Graphics.initBlend(screen)
   func()
   Graphics.termBlend()
   Screen.flip()
   Screen.refresh()
   Graphics.initBlend(screen)
   func()
   Graphics.termBlend()
end

The Sound.close()/term() functions aren't working, sound just keeps playing. And if I exit the homebrew then go back again the audio resumes from where it left off (though if you stay in the Homebrew Launcher for a while everything kind of "resets" and when you open the homebrew again it won't resume).

You should first stop your sound with Sound.pause(), then close it to free RAM with Sound.close() and then stop sound module with Sound.term() (Sound.term should be called only when exiting your homebrew).

An example is Music module for Sunshell: https://github.com/Rinnegatamante/Sunshell/blob/master/LUA/modules/music.lua#L121-L127
 
You should first stop your sound with Sound.pause(), then close it to free RAM with Sound.close() and then stop sound module with Sound.term() (Sound.term should be called only when exiting your homebrew).
Oh, I see. I wasn't pausing it. Thanks!
 
Is there a way to turn off the screens? Doesn't appear on the docs but just asking.
 
Is JPGV the same as M-JPEG? The description on wikipedia sure seems to match, and when I search for jpgv on google your github is the second result.
If you're interested in including a more common format, yellows8's github has something to accept VP8 which I think is webm? (Some webm might be VP9 now though). I couldn't make the dependencies work but maybe someone who knows what they're doing can figure it out.

M-JPEG should be easy enough to work with though so it's nothing urgent.

EDIT: Ah ok, I should have actually read your github. So it's basically a container for MPEG? Sounds like it should be doable.
 
Last edited by ~Poke~,
Is JPGV the same as M-JPEG? The description on wikipedia sure seems to match, and when I search for jpgv on google your github is the second result.
If you're interested in including a more common format, yellows8's github has something to accept VP8 which I think is webm? (Some webm might be VP9 now though). I couldn't make the dependencies work but maybe someone who knows what they're doing can figure it out.

M-JPEG should be easy enough to work with though so it's nothing urgent.

EDIT: Ah ok, I should have actually read your github. So it's basically a container for MPEG? Sounds like it should be doable.

JPGV is an experimental container format that, by now, supports MJPEG codec as Videocodec and Vorbis and PCM16 codec as Audiocodec.
In the future (Not near future), i'll try to add theora files support (Theora uses Vorbis codec both for audio and video and is, by now, one of the best containers in the world).
 
  • Like
Reactions: ~Poke~
Regarding the IDE:

I use ZeroBrane Studio with some custom scripts for auto complete and launching Citra.

k9iXVMZ.png



Interpreter: http://pastebin.com/ApcGk4tE
API: http://pastebin.com/gALW2PEK

Instructions: Download the raw citra.lua and lpp.lua files above. You will have to edit citra.lua to reflect your lpp-3ds.3dsx and citra paths.
Go to your ZeroBrane install and place citra.lua in ZeroBraneStudio\interpreters and lpp.lua under ZeroBraneStudio\api\lua.

Then in the IDE, go to Project > Lua Interpreter and select "LPP/Citra". Auto complete should work and hitting Execute (F6) should launch Citra.
So I have set up your method partially correct but here is what happens when I try to test


http://bronzeflames.deviantart.com/art/Capture-561037885?ga_submit_new=10%3A1442603585

it doesn't even show a black screen. just sits there waiting


edit: I have tried this with the code that comes with llp still no luck. However, when I load the 3dsx it self into citra I get a error message
 
Last edited by BurningDesire,

Site & Scene News

Popular threads in this forum