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

cere_ender

Active Member
Newcomer
Joined
Jul 7, 2015
Messages
44
Trophies
0
Age
31
XP
97
Country
I resolved my problem. The error was in fillRect: I was assigning wrong values as parameters and the code was not running properly. Now it does. Thank you for your support.
 

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
I am new to both Lua and the whole 3DS homebrewing scene.
Trying to get various samples to run, to no avail. I've tried both renaming the samples to index.lua, or putting dofile(samplefilename.lua) into the index.lua.
All I get when it launches is a blank, greylined screen.
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,831
Country
United States
I am new to both Lua and the whole 3DS homebrewing scene.
Trying to get various samples to run, to no avail. I've tried both renaming the samples to index.lua, or putting dofile(samplefilename.lua) into the index.lua.
All I get when it launches is a blank, greylined screen.
You're putting index.lua with the .3dsx, right?
 

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
You're putting index.lua with the .3dsx, right?
Yep, and the 3dsx file is named after the folder it's in.
Am I missing some sort of declaration or something in my index file? The sample files should work right off the bat if I rename them to index.lua right?

My only programming knowledge from before this is some extensive fiddling with GML so working with a non-object orientated language is a step outside my comfort zone.

EDIT: Oh crud! I just remembered I'm using themehax 1.0. Let me just update and get back to you.

EDIT2: Yep, that fixed it.
 
Last edited by HexZyle,

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
I can't seem to get any lua based homebrew programs (or even the LPP samples) to work at all on my 9.0.0-20U N3DS. I'm using Themehax 1.3 (but I also tried browserhax/stagefright, with no luck), and I put lpp-3ds.3dsx in /3ds/lpp-3ds on my sd card, along with the helloworld.lua sample (renamed to index.lua), but all I get is a black screen, and I have to hard reboot the 3DS. Other non-lua homebrew applications work fine. No emuNANDs are being used here. Is LPP not compatible with themehax (homemenuhax) or browserhax?
 
Last edited by daxtsu,

730

Professional Shitposter
Member
Joined
Apr 2, 2015
Messages
485
Trophies
0
XP
628
Country
Argentina
I can't seem to get any lua based homebrew programs (or even the LPP samples) to work at all on my N3DS. I'm using Themehax 1.3 (but I also tried browserhax/stagefright, with no luck), and I put lpp-3ds.3dsx in /3ds/lpp-3ds on my sd card, along with the helloworld.lua sample (renamed to index.lua), but all I get is a black screen, and I have to hard reboot the 3DS. Other non-lua homebrew applications work fine. No emuNANDs are being used here. Is LPP not compatible with themehax (homemenuhax) or browserhax?
I've used lpp with browserhax and it works fine.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
I'm not sure what the issue is, then. I have nothing wrongly named, or in the wrong place, as far as I can tell. The instructions say to put the index.lua file with the 3dsx file, which it is.
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
I'm not sure what the issue is, then. I have nothing wrongly named, or in the wrong place, as far as I can tell. The instructions say to put the index.lua file with the 3dsx file, which it is.
I thunk the index.lua should be placed in the scripts folder. Not sure though, i might be dreaming
 

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
I'm not sure what the issue is, then. I have nothing wrongly named, or in the wrong place, as far as I can tell. The instructions say to put the index.lua file with the 3dsx file, which it is.

I think some of the examples are broken, or at least do not work on themehax and firmware 10.1
I have gotten graphics_and_controls to work, wav fails to play the sound but at least displays some error text, but image and gpu result in the same black screen you describe with rebooting as the only way to quit.

Yet if I just put
Code:
dofile("graphics_and_controls.lua")
in index.lua, it doesn't work, resulting in the same black screen. I'm getting really confused.
 
Last edited by HexZyle,
  • Like
Reactions: daxtsu

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
I managed to get both graphics_and_controls to work in addition to gpu. Since I can't get the dofile function to work without crashing, I mashed them together using function:
Code:
function gpu()
    Graphics.initBlend(TOP_SCREEN)
    Graphics.drawLine(0, 100, 0, 100, Color.new(255,255,255))
    Graphics.fillRect(20,50,30,40, Color.new(255,0,0))
    Graphics.termBlend()
    Screen.flip()
    Screen.waitVblankStart()
end

Graphics.init() -- Init GPU

red = Color.new(255,0,0)
blue = Color.new(0,0,255)
green = Color.new(0,255,0)
while true do
    Screen.waitVblankStart()
    pad = Controls.read()
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    Screen.fillRect(5,150,5,20,green,TOP_SCREEN)
    if (Controls.check(pad,KEY_A)) then
        Screen.debugPrint(6,6,"Button A pressed",blue,TOP_SCREEN)
    else
        Screen.debugPrint(6,6,"Button A not pressed",blue,TOP_SCREEN)
    end
    if (Controls.check(pad,KEY_B)) then
        gpu()
    end
    if (Controls.check(pad,KEY_Y)) then
        Graphics.term()  -- Term GPU before exiting
        System.exit()
    end  
    Screen.debugPrint(0,0,"LPP 3DS Test Script",red,BOTTOM_SCREEN)
    Screen.debugPrint(0,15,"Screen & Color Modules - OK",red,BOTTOM_SCREEN)
    Screen.debugPrint(0,30,"Controls Module - OK",red,BOTTOM_SCREEN)
    Screen.flip()
end

Probably pretty lame for all you lua-savvy coders, but it's a big achievement for me :3
 
Last edited by HexZyle,

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,831
Country
United States
Yet if I just put
Code:
dofile("graphics_and_controls.lua")
in index.lua, it doesn't work, resulting in the same black screen. I'm getting really confused.
I know you've already removed the code, but you could try 'dofile(System.currentDirectory().."/graphics_and_controls.lua")'.
 
  • Like
Reactions: HexZyle

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
I know you've already removed the code, but you could try 'dofile(System.currentDirectory().."/graphics_and_controls.lua")'.

This could explain why I couldn't get the image code to work, because I wasn't using the absolute path to the image file. Thanks, I'll give it a shot.
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,069
Trophies
2
XP
7,831
Country
United States
This could explain why I couldn't get the image code to work, because I wasn't using the absolute path to the image file. Thanks, I'll give it a shot.
I noticed that sometimes just giving a file name didn't work with file-based operations. So that might be why.
 

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
That... worked? The graphic being displayed on the screen is a squashed mess of monochromatic pixels, when the original bitmap was pale green, (the only way it resembles the original bitmap is in its width) but it's doing something that isn't crashing, so that's good. (To be honest though, I did just use the default values and sub in a large image, so that's probably why it's being squashed. Let me just review the parameters)

Also, the image sample has a piece of code in it
Code:
Screen.saveBitmap(bitmap2,"/bitmap",false)

Which isn't even documented.
What's the deal?
 
Last edited by HexZyle,

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
That... worked? The graphic being displayed on the screen is a squashed mess of monochromatic pixels, when the original bitmap was pale green, (the only way it resembles the original bitmap is in its width) but it's doing something that isn't crashing, so that's good. (To be honest though, I did just use the default values and sub in a large image, so that's probably why it's being squashed. Let me just review the parameters)

Also, the image sample has a piece of code in it
Code:
Screen.saveBitmap(bitmap2,"/bitmap",false)

Which isn't even documented.
What's the deal?

My fault, this function simply save an image into a BMP file.
 

HexZyle

Pretty Petty Pedant
Member
Joined
Sep 12, 2015
Messages
300
Trophies
0
XP
452
Country
Australia
Okay, I give up. I've been trying for ages with a bunch of different functions to get a simple image loaded in to draw on either of the screens, and I'm failing miserably. The only success I've met with is getting a single pixel to render on the top screen at 100,127, and sometimes when mucking around with the code-created image, I can get a bunch of assorted pixels from the loaded in image littered haphazardly in a blob on the bottom screen. My bitmap image is 20x20.

My current code is a mashup of the gui, graphics_and_controls, and image scripts.

EDIT: Nevermind, figured it out. For some reason the BMP files I am using (8-bit, 0 dithering, saved by paint.NET) do not correctly load in, but I tested a JPG file which works fine, and a PNG image in 32-bit, which also displays correctly.
 
Last edited by HexZyle,

PabloMK7

Red Yoshi! ^ω^
Developer
Joined
Feb 21, 2014
Messages
2,604
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,028
Country
Spain
Is it possible to loop a sound to a certain sample? I mean, if the file has 1000 samples and I want to loop to sample 100 when it reaches sample 1000, is it possible?
 
  • Like
Reactions: 730

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Mondooooo @ Mondooooo: anyone