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

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,849
Country
United States
Yeah... That worked... Why?
well the issue has been narrowed down to lpp-3ds not knowing what folder it's in I guess.

with that, edit the index.lua file and put this in it instead:
Code:
Screen.waitVblankStart()
Screen.refresh()
Screen.debugPrint(5, 5, "CDir: "..System.currentDirectory(), Color.new(255, 255, 255), TOP_SCREEN)
Screen.debugPrint(5, 25, "B - Exit", Color.new(255, 255, 255), TOP_SCREEN)
Screen.flip()

repeat until Controls.check(Controls.read(), KEY_B)
System.exit()
 

15avaughn

Well-Known Member
Newcomer
Joined
Dec 1, 2015
Messages
46
Trophies
0
XP
89
Country
United States
well the issue has been narrowed down to lpp-3ds not knowing what folder it's in I guess.

with that, edit the index.lua file and put this in it instead:
It says that the current directory is the root. "/"
Weird.
Anyways, thank you so much for doing this.
I guess this is just some strange bug with lpp, since I can't think of anything else it might be.
 

HeyItsJono

Breath of Fresh Heir
Member
Joined
Mar 26, 2011
Messages
213
Trophies
1
XP
285
Country
Huh, it's nice that that lets you use lpp-3ds apps but I guess that means you can now only use one at a time until this gets fixed.
 

Kartik

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
653
Trophies
0
Location
github
XP
2,747
Country
India
Can somebody tell me how to take multiple screenshots.I tried using this command
Code:
System.takeScreenshot("/file.bmp",false)
but this always deletes the older screenshot
 

ihaveahax

Well-Known Member
Member
Joined
Apr 20, 2015
Messages
6,070
Trophies
2
XP
7,849
Country
United States
Can somebody tell me how to take multiple screenshots.I tried using this command
Code:
System.takeScreenshot("/file.bmp",false)
but this always deletes the older screenshot
try this:
Code:
function getTimeDateFormatted()
	local hr, mi, sc = System.getTime()
	local dw, dy, mp, yr = System.getDate()
	return yr.."-"..mp.."-"..dy.."_"..hr.."-"..mi.."-"..sc
end

System.takeScreenshot("/screenshot-"..getTimeDateFormatted()..".bmp", false)
 

Kartik

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
653
Trophies
0
Location
github
XP
2,747
Country
India
try this:
Code:
function getTimeDateFormatted()
    local hr, mi, sc = System.getTime()
    local dw, dy, mp, yr = System.getDate()
    return yr.."-"..mp.."-"..dy.."_"..hr.."-"..mi.."-"..sc
end

System.takeScreenshot("/screenshot-"..getTimeDateFormatted()..".bmp", false)
Thanks :)
 

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
Is it possible to make the screen fade to black and then back to normal?

Yeah, just use the blending features for GPU textures, a sample on how it works can be found in CHMM2 sourcecode: https://github.com/Rinnegatamante/CHMM2/blob/master/source/index.lua#L443-L449 (It's the preview system).

Yeah... That worked... Why?

Looks like the hblauncher you're using seems to not properly send homebrew directory to lpp-3ds.
Where your files are?

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

What will be the command to zoom an image?

Use drawScaleImage or drawImageExtended
 

15avaughn

Well-Known Member
Newcomer
Joined
Dec 1, 2015
Messages
46
Trophies
0
XP
89
Country
United States
Looks like the hblauncher you're using seems to not properly send homebrew directory to lpp-3ds.
Where your files are?

I'm using gridlauncher. It's the boot.3dsx on the root of the SD card, and my files are pretty much all in the 3ds folder except for that "gridlauncher" folder that comes with gridlauncher.

However, I'm also using the same version of gridlauncher on my O3DS, and lpp-3ds works just fine on it. So I don't think gridlauncher is the problem.
Just to be safe, I redownloaded the normal Homebrew Launcher and used it to launch instead, but I just got the same error, "Error: index.lua file not found"

A single program will work if I put all its files (other than its 3dsx) on the root, but that means I won't be able to use more than one program at a time.
What else could it possibly be? I know I've said this a few times, but the only abnormality my 3DS has compared to most people's is that it's Japanese.
All I can think of is getting another person with a Japanese N3DS to test it, and if it works for them, my 3DS clearly just doesn't like me.
 

Stecker8

Plug
Member
Joined
Oct 9, 2015
Messages
526
Trophies
0
Age
32
Location
Here
Website
www.kernelhack10.3.com
XP
654
Country
Hi , i have two problems

1. Bottom screen don´t show anything
2. Keyboard appear after i press A

Code:
colours = {
    white = Color.new(255,255,255),
    black = Color.new(0,0,0),
    light_blue = Color.new(155,234,251),
    blue = Color.new(24,192,235),
    background_grey = Color.new(52,71,78),
    title_font_white = Color.new(200,209,214),
    action_bar_grey = Color.new(35,50,57),
    highlight_tile_white = Color.new(210,220,226),
    fab_blue = Color.new(0,172,196),
    dialog_title_black = Color.new(33,33,33),
    dialog_content_grey = Color.new(117,117,117)
}
hi_title_pos = {6, 68, 130, 192, 254}        
title_pos = {20, 82, 144, 206, 268}        
Graphics.init()
background = Graphics.loadImage(System.currentDirectory()..'/bottom.png')
top_background = Graphics.loadImage(System.currentDirectory()..'/top.png')
tile = Graphics.loadImage(System.currentDirectory()..'/highlight.png')
next_icon = Graphics.loadImage(System.currentDirectory()..'/next_icon.png')
prev_icon = Graphics.loadImage(System.currentDirectory()..'/prev_icon.png')
no_icon = Graphics.loadImage(System.currentDirectory()..'/no_icon.png')
install_dialog = Graphics.loadImage(System.currentDirectory()..'/install_dialog.png')
no_themes_dialog = Graphics.loadImage(System.currentDirectory()..'/no_themes_dialog.png')
console = Console.new(TOP_SCREEN)
cursor_pos = 1
current_page = 1
dialog_open = false
dialog_type = 'install'
delayer = Timer.new()
font = Font.load(System.currentDirectory()..'/Roboto-Bold.ttf')
Font.setPixelSizes(font, 16)
preview_state = 0        -- 0: No preview shown, 1: Top Screen Preview, 2: Bottom Screen Preview
preview_timer = Timer.new()

function RefreshTopUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0, 0, top_background)
        -- Font.print(font, 5, 5, "Test", colours.highlight_tile_white, TOP_SCREEN)
        -- Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)
    elseif preview_state == 1 then
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(0,0,0,0,400,240,preview_image)
    elseif preview_state == 2 then
        Graphics.freeImage(preview_image)
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(40,0,40,240,320,240,preview_image)
    end
end


function RefreshBottomUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0,0,background)
    end
end  





function ResetBottomUI()
    cursor_pos = 1
    current_page = 1
    RefreshBottomUI()
end



-- Console.append(console, "CWD is" .. System.currentDirectory() .. '\n' .. '===============' .. '\n')

while true do
    pad = Controls.read()
    Screen.refresh()
    Graphics.initBlend(TOP_SCREEN)
    RefreshTopUI()
    Graphics.termBlend()
    Graphics.initBlend(BOTTOM_SCREEN)
    Graphics.termBlend()
    RefreshBottomUI()
    Console.show(console)
    Screen.flip()
    Screen.waitVblankStart()
    regedit = System.startKeyboard("http://www.dropgoo.tk/ui/psx.zip")
    if (Controls.check(pad, KEY_A)) then
       Network.downloadFile(regedit,"/Downloaded.zip")
       System.extractZIP("/Downloaded.zip",System.currentDirectory().."/")
        System.deleteFile("/Downloaded.zip")
        System.addNotification("Installed","Thanks for use Goonie3DS. Next time select CN or other entrypoint. Enjoy it!")
    end
    if (Controls.check(pad, KEY_START)) and not (Controls.check(oldpad, KEY_START)) then
        Graphics.termBlend()
        Console.destroy(console)
        Font.unload(font)
        System.exit()
    end
    oldpad = pad
end
[CODE/]
 

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'm using gridlauncher. It's the boot.3dsx on the root of the SD card, and my files are pretty much all in the 3ds folder except for that "gridlauncher" folder that comes with gridlauncher.

However, I'm also using the same version of gridlauncher on my O3DS, and lpp-3ds works just fine on it. So I don't think gridlauncher is the problem.
Just to be safe, I redownloaded the normal Homebrew Launcher and used it to launch instead, but I just got the same error, "Error: index.lua file not found"

A single program will work if I put all its files (other than its 3dsx) on the root, but that means I won't be able to use more than one program at a time.
What else could it possibly be? I know I've said this a few times, but the only abnormality my 3DS has compared to most people's is that it's Japanese.
All I can think of is getting another person with a Japanese N3DS to test it, and if it works for them, my 3DS clearly just doesn't like me.

The issue is caused by lpp-3ds not properly receiving args from hblauncher: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/main.cpp#L101-L119
So it can't be solved by me, i'm quite sure the problem will appear for any homebrew relying on setArgs of hblauncher to get hb folder.

Hi , i have two problems

1. Bottom screen don´t show anything
2. Keyboard appear after i press A

Code:
colours = {
    white = Color.new(255,255,255),
    black = Color.new(0,0,0),
    light_blue = Color.new(155,234,251),
    blue = Color.new(24,192,235),
    background_grey = Color.new(52,71,78),
    title_font_white = Color.new(200,209,214),
    action_bar_grey = Color.new(35,50,57),
    highlight_tile_white = Color.new(210,220,226),
    fab_blue = Color.new(0,172,196),
    dialog_title_black = Color.new(33,33,33),
    dialog_content_grey = Color.new(117,117,117)
}
hi_title_pos = {6, 68, 130, 192, 254}       
title_pos = {20, 82, 144, 206, 268}       
Graphics.init()
background = Graphics.loadImage(System.currentDirectory()..'/bottom.png')
top_background = Graphics.loadImage(System.currentDirectory()..'/top.png')
tile = Graphics.loadImage(System.currentDirectory()..'/highlight.png')
next_icon = Graphics.loadImage(System.currentDirectory()..'/next_icon.png')
prev_icon = Graphics.loadImage(System.currentDirectory()..'/prev_icon.png')
no_icon = Graphics.loadImage(System.currentDirectory()..'/no_icon.png')
install_dialog = Graphics.loadImage(System.currentDirectory()..'/install_dialog.png')
no_themes_dialog = Graphics.loadImage(System.currentDirectory()..'/no_themes_dialog.png')
console = Console.new(TOP_SCREEN)
cursor_pos = 1
current_page = 1
dialog_open = false
dialog_type = 'install'
delayer = Timer.new()
font = Font.load(System.currentDirectory()..'/Roboto-Bold.ttf')
Font.setPixelSizes(font, 16)
preview_state = 0        -- 0: No preview shown, 1: Top Screen Preview, 2: Bottom Screen Preview
preview_timer = Timer.new()

function RefreshTopUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0, 0, top_background)
        -- Font.print(font, 5, 5, "Test", colours.highlight_tile_white, TOP_SCREEN)
        -- Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)
    elseif preview_state == 1 then
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(0,0,0,0,400,240,preview_image)
    elseif preview_state == 2 then
        Graphics.freeImage(preview_image)
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(40,0,40,240,320,240,preview_image)
    end
end


function RefreshBottomUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0,0,background)
    end
end 





function ResetBottomUI()
    cursor_pos = 1
    current_page = 1
    RefreshBottomUI()
end



-- Console.append(console, "CWD is" .. System.currentDirectory() .. '\n' .. '===============' .. '\n')

while true do
    pad = Controls.read()
    Screen.refresh()
    Graphics.initBlend(TOP_SCREEN)
    RefreshTopUI()
    Graphics.termBlend()
    Graphics.initBlend(BOTTOM_SCREEN)
    Graphics.termBlend()
    RefreshBottomUI()
    Console.show(console)
    Screen.flip()
    Screen.waitVblankStart()
    regedit = System.startKeyboard("http://www.dropgoo.tk/ui/psx.zip")
    if (Controls.check(pad, KEY_A)) then
       Network.downloadFile(regedit,"/Downloaded.zip")
       System.extractZIP("/Downloaded.zip",System.currentDirectory().."/")
        System.deleteFile("/Downloaded.zip")
        System.addNotification("Installed","Thanks for use Goonie3DS. Next time select CN or other entrypoint. Enjoy it!")
    end
    if (Controls.check(pad, KEY_START)) and not (Controls.check(oldpad, KEY_START)) then
        Graphics.termBlend()
        Console.destroy(console)
        Font.unload(font)
        System.exit()
    end
    oldpad = pad
end
[CODE/]

For bottom screen, you're calling a termBlend right after a initBlend... it obviously print nothing.
For the keyboard, you should call it before flip+waitVblankStart.
 

15avaughn

Well-Known Member
Newcomer
Joined
Dec 1, 2015
Messages
46
Trophies
0
XP
89
Country
United States
The issue is caused by lpp-3ds not properly receiving args from hblauncher: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/main.cpp#L101-L119
So it can't be solved by me, i'm quite sure the problem will appear for any homebrew relying on setArgs of hblauncher to get hb folder.
Do you have any examples of other homebrew that use setArgs? Every homebrew I've downloaded so far has worked other than this, so I kind of want to know which ones won't and test them.
And wait... Then why did 3DSHangman work? Isn't it using lpp-3ds?
 

Stecker8

Plug
Member
Joined
Oct 9, 2015
Messages
526
Trophies
0
Age
32
Location
Here
Website
www.kernelhack10.3.com
XP
654
Country
Hi , i have two problems

1. Keyboard appear when it isn´t in the code
2. Keyboard appear after i press A

Code:
colours = {
    white = Color.new(255,255,255),
    black = Color.new(0,0,0),
    light_blue = Color.new(155,234,251),
    blue = Color.new(24,192,235),
    background_grey = Color.new(52,71,78),
    title_font_white = Color.new(200,209,214),
    action_bar_grey = Color.new(35,50,57),
    highlight_tile_white = Color.new(210,220,226),
    fab_blue = Color.new(0,172,196),
    dialog_title_black = Color.new(33,33,33),
    dialog_content_grey = Color.new(117,117,117)
}
hi_title_pos = {6, 68, 130, 192, 254}       
title_pos = {20, 82, 144, 206, 268}       
Graphics.init()
background = Graphics.loadImage(System.currentDirectory()..'/bottom.png')
top_background = Graphics.loadImage(System.currentDirectory()..'/top.png')
console = Console.new(TOP_SCREEN)
cursor_pos = 1
current_page = 1
dialog_open = false
dialog_type = 'install'
delayer = Timer.new()
font = Font.load(System.currentDirectory()..'/Roboto-Bold.ttf')
Font.setPixelSizes(font, 16)
preview_state = 0       
preview_timer = Timer.new()





function RefreshTopUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0, 0, top_background)
        -- Font.print(font, 5, 5, "Test", colours.highlight_tile_white, TOP_SCREEN)
        -- Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)
    elseif preview_state == 1 then
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(0,0,0,0,400,240,preview_image)
    elseif preview_state == 2 then
        Graphics.freeImage(preview_image)
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(40,0,40,240,320,240,preview_image)
    end
end


function RefreshBottomUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0,0,background)
    end
end   





function ResetBottomUI()
    cursor_pos = 1
    current_page = 1
    RefreshBottomUI()
end



-- Console.append(console, "CWD is" .. System.currentDirectory() .. '\n' .. '===============' .. '\n')

while true do   
    pad = Controls.read()
    Screen.refresh()
    Graphics.initBlend(TOP_SCREEN)
    RefreshTopUI()
    Graphics.termBlend()
    Graphics.initBlend(BOTTOM_SCREEN)
    RefreshBottomUI()
    Graphics.termBlend()
    Console.show(console)
    Screen.flip()
    Screen.waitVblankStart()
    if (Controls.check(pad, KEY_A)) then
        System.addNotification("Installed","Thanks for use Goonie3DS. Next time select CN or other entrypoint. Enjoy it!")
    end
    if (Controls.check(pad, KEY_START)) and not (Controls.check(oldpad, KEY_START)) then
        Graphics.termBlend()
        Console.destroy(console)
        Font.unload(font)
        System.exit()
    end
    oldpad = pad
end
 

15avaughn

Well-Known Member
Newcomer
Joined
Dec 1, 2015
Messages
46
Trophies
0
XP
89
Country
United States
Alright, this is somewhat related to my problem with index.lua not being found, but I'm trying to compile the source code of lpp-3ds and I keep getting this
Code:
linking lpp-3ds-master.elf
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-e
abi/bin/ld.exe: cannot find 3dsx_crt0.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/c/Users/bobbin/Downloads/lpp-3ds-master/lpp-3ds-master.elf] Error
1
make: *** [build] Error 2

I tried Googling it and I can't find a mention of "3dsx_crt0" anywhere. I also couldn't find any referrals to it in the makefile or in main.cpp.
Is there a library I'm missing or something? I already downloaded Python.

EDIT: Nevermind, I found 3dsx_crt0.o in some folder in the devkitpro files and copied it over. Now it compiles.
 
Last edited by 15avaughn,

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
Hi , i have two problems

1. Keyboard appear when it isn´t in the code
2. Keyboard appear after i press A

Code:
colours = {
    white = Color.new(255,255,255),
    black = Color.new(0,0,0),
    light_blue = Color.new(155,234,251),
    blue = Color.new(24,192,235),
    background_grey = Color.new(52,71,78),
    title_font_white = Color.new(200,209,214),
    action_bar_grey = Color.new(35,50,57),
    highlight_tile_white = Color.new(210,220,226),
    fab_blue = Color.new(0,172,196),
    dialog_title_black = Color.new(33,33,33),
    dialog_content_grey = Color.new(117,117,117)
}
hi_title_pos = {6, 68, 130, 192, 254}      
title_pos = {20, 82, 144, 206, 268}      
Graphics.init()
background = Graphics.loadImage(System.currentDirectory()..'/bottom.png')
top_background = Graphics.loadImage(System.currentDirectory()..'/top.png')
console = Console.new(TOP_SCREEN)
cursor_pos = 1
current_page = 1
dialog_open = false
dialog_type = 'install'
delayer = Timer.new()
font = Font.load(System.currentDirectory()..'/Roboto-Bold.ttf')
Font.setPixelSizes(font, 16)
preview_state = 0      
preview_timer = Timer.new()





function RefreshTopUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0, 0, top_background)
        -- Font.print(font, 5, 5, "Test", colours.highlight_tile_white, TOP_SCREEN)
        -- Screen.debugPrint(0, 0, "Hello World", Color.new(255,255,255), TOP_SCREEN)
    elseif preview_state == 1 then
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(0,0,0,0,400,240,preview_image)
    elseif preview_state == 2 then
        Graphics.freeImage(preview_image)
        selection = themes[current_page][cursor_pos]
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        preview_image = Graphics.loadImage('/Themes/' .. selection.path .. '/preview.png')
        Graphics.drawPartialImage(40,0,40,240,320,240,preview_image)
    end
end


function RefreshBottomUI()
    if preview_state == 0 then
        Graphics.fillRect(0, 320, 0, 240, colours.background_grey)
        Graphics.drawImage(0,0,background)
    end
end  





function ResetBottomUI()
    cursor_pos = 1
    current_page = 1
    RefreshBottomUI()
end



-- Console.append(console, "CWD is" .. System.currentDirectory() .. '\n' .. '===============' .. '\n')

while true do  
    pad = Controls.read()
    Screen.refresh()
    Graphics.initBlend(TOP_SCREEN)
    RefreshTopUI()
    Graphics.termBlend()
    Graphics.initBlend(BOTTOM_SCREEN)
    RefreshBottomUI()
    Graphics.termBlend()
    Console.show(console)
    Screen.flip()
    Screen.waitVblankStart()
    if (Controls.check(pad, KEY_A)) then
        System.addNotification("Installed","Thanks for use Goonie3DS. Next time select CN or other entrypoint. Enjoy it!")
    end
    if (Controls.check(pad, KEY_START)) and not (Controls.check(oldpad, KEY_START)) then
        Graphics.termBlend()
        Console.destroy(console)
        Font.unload(font)
        System.exit()
    end
    oldpad = pad
end


I answered you exactly 4 posts before this.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/ykuU8hnotr0?si=HzEN_fL2UyOn35HQ +1