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

Tech Freek

Member
Newcomer
Joined
Jan 7, 2016
Messages
13
Trophies
0
XP
42
Country
United States
Im getting a scary error when i try to build from source.
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/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/username/Desktop/lpp-3ds-master/lpp-3ds-master.elf] Error 1
make: *** [build] Error 2

:/
 

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
Im getting a scary error when i try to build from source.
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/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/username/Desktop/lpp-3ds-master/lpp-3ds-master.elf] Error 1
make: *** [build] Error 2

:/

Go in devkitPro\devkitARM\arm-none-eabi\lib and do a "make CRT=3dsx"
 

Tech Freek

Member
Newcomer
Joined
Jan 7, 2016
Messages
13
Trophies
0
XP
42
Country
United States
Have i got the right idea in thinking that i need to have brahma.init() at the top of my code, to have everything related to payloads working. and then when i want to load arm9 stuff i need to have

arm9.start()
--arm9 stuff goes here
arm9.end()

and also somewhere i need to load.arm9.payload.offset (char *code.bin, u32 0x12000, u32 0)
and use launchPayload to load the rxtools code.bin right?

also does anybody have an app they have made which uses brahma i can look at to get the right idea here?

thank you :)
 
Last edited by Tech Freek,

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
Have i got the right idea in thinking that i need to have brahma.init() at the top of my code, to have everything related to payloads working. and then when i want to load arm9 stuff i need to have

arm9.start()
--arm9 stuff goes here
arm9.end()

and also somewhere i need to load.arm9.payload.offset (char *code.bin, u32 0x12000, u32 0)
and use launchPayload to load the rxtools code.bin right?

also does anybody have an app they have made which uses brahma i can look at to get the right idea here?

thank you :)

??

That is the C function, not the LUA ones.
This is the lua function: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaSystem.cpp#L1740
And these the arguments type: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaSystem.cpp#L1344-L1345
 

Tech Freek

Member
Newcomer
Joined
Jan 7, 2016
Messages
13
Trophies
0
XP
42
Country
United States
Whenever i load a .3dsx with System.launch3DSX()
I get two black screens.. Am i doing something wrong? @Rinnegatamante

I have a similar problem, i can load and boot minipasta.3dsx just fine, but loading cakes.3dsx and rxtools.3dsx gives black screens and wont boot, (using both arm9 payloads and 3dsx loader gives black screen as well).
i think its something to do with how they boot on the system and there is a timing issue here, if you can add a delay like you can with ctr boot manager maybe it can be fixed?
 

Tech Freek

Member
Newcomer
Joined
Jan 7, 2016
Messages
13
Trophies
0
XP
42
Country
United States
I tried it with A test homebrew i made, and @TheCruel 's "Draw Attack". Neither of which worked.
yea it does depend, as i just tried booting back to homebrew launcher by pressing A with my app and it worked just fine

here is my code if anyone wants to see

-- Initialize some colors
red = Color.new(255,0,0)
blue = Color.new(0,0,255)
green = Color.new(0,255,0)
--load image
image = Screen.loadImage(System.currentDirectory().."/background.png")
--load.arm9.payload.offset (char *\rxTools\sys\code.bin, u32 0x12000, u32 0)

Graphics.init()

-- Main Loop
while true do

-- Clear top screen
Screen.waitVblankStart()
Screen.refresh()
Screen.clear(TOP_SCREEN)

-- Read controls input
pad = Controls.read()

--image top screen
Screen.drawImage(0,0,image,TOP_SCREEN)



-- Check for controls input


if (Controls.check(pad,KEY_A)) then
Screen.freeImage(image)
System.reboot()
end



if (Controls.check(pad,KEY_R)) then
System.launchPayload("/rxTools/sys/code.bin",0)
end

if (Controls.check(pad,KEY_B)) then
System.launchPayload("/cakes/code.bin",0)
end


if (Controls.check(pad,KEY_Y)) then
System.launch3DSX("/3ds/miniPasta/miniPasta.3dsx")
end

if (Controls.check(pad,KEY_START)) then
System.launch3DSX("/3ds/rxTools/rxTools.3dsx")
end

if (Controls.check(pad,KEY_SELECT)) then
System.launch3DSX("/3ds/cakes/cakes.3dsx")
end

--end controls input


-- Write something on bottom screen
Screen.debugPrint(0,15,"Press A To Reboot",red,BOTTOM_SCREEN)
Screen.debugPrint(0,60,"Press R To Launch rxTools bin",red,BOTTOM_SCREEN)
Screen.debugPrint(0,30,"Press X To Launch Homebrew",red,BOTTOM_SCREEN)
Screen.debugPrint(0,45,"Press Y To Launch MiniPasta",red,BOTTOM_SCREEN)
Screen.debugPrint(0,75,"Press B To Launch Cakes bin",red,BOTTOM_SCREEN)
Screen.debugPrint(0,90,"Press START To Launch rxTools ",red,BOTTOM_SCREEN)
Screen.debugPrint(0,105,"Press SELECT To Launch cakes ",red,BOTTOM_SCREEN)


-- Flipping screens
Screen.flip()

oldpad = pad

end
 

PabloMK7

Red Yoshi! ^ω^
Developer
Joined
Feb 21, 2014
Messages
2,616
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,172
Country
Spain
Post your code. Also are you using csnd or dsp?
Code:
bgm = Sound.openOgg(System.currentDirectory().."resources/bgm.ogg", true)
Sound.init ()
Sound.play (bgm,LOOP)
while true do
--Some other things
end
I'm using Sound.play, so I don't know which service I'm using.
Ask me if you want the full script.
 

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
Code:
bgm = Sound.openOgg(System.currentDirectory().."resources/bgm.ogg", true)
Sound.init ()
Sound.play (bgm,LOOP)
while true do
--Some other things
end
I'm using Sound.play, so I don't know which service I'm using.
Ask me if you want the full script.

If you don't have an XML with CSND, you're using experimental DSP which is unperfect.
Anyway you're not calling Sound.updateStream in your main loop so it obviously loop only initial part.
 
  • Like
Reactions: PabloMK7

PabloMK7

Red Yoshi! ^ω^
Developer
Joined
Feb 21, 2014
Messages
2,616
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,172
Country
Spain
Here it is:
Code:
System.currentDirectory("/CTGP-7/")
Graphics.init()
function getcontrol()
    GC_key = Controls.read()
    GC_x,GC_y = Controls.readCirclePad()
    GC_outkey = ""
    if (Controls.check(GC_key,KEY_A)) and not(Controls.check(GC_oldkey,KEY_A)) then
        GC_outkey = "A"
    elseif (Controls.check(GC_key,KEY_B)) and not(Controls.check(GC_oldkey,KEY_B)) then
        GC_outkey = "B"
    end
    if (Timer.getTime(ctrl_timer) >= 500) then
        Timer.reset(ctrl_timer)
        GC_oldkey = KEY_X
        GC_oldx = 0
        GC_oldy = 0
    end
    if (((Controls.check(GC_key,KEY_DLEFT)) and not(Controls.check(GC_oldkey,KEY_DLEFT))) or ((GC_x < -128) and not (GC_oldx < -128))) then
        GC_outkey = "Left"
        Timer.reset(ctrl_timer)
    elseif (((Controls.check(GC_key,KEY_DRIGHT)) and not(Controls.check(GC_oldkey,KEY_DRIGHT))) or ((GC_x > 128) and not (GC_oldx > 128))) then
        GC_outkey = "Right"
        Timer.reset(ctrl_timer)
    elseif (((Controls.check(GC_key,KEY_DUP)) and not(Controls.check(GC_oldkey,KEY_DUP))) or ((GC_y > 128) and not (GC_oldy > 128))) then
        GC_outkey = "Up"
        Timer.reset(ctrl_timer)
    elseif (((Controls.check(GC_key,KEY_DDOWN)) and not(Controls.check(GC_oldkey,KEY_DDOWN))) or ((GC_y < -128) and not (GC_oldy < -128))) then
        GC_outkey = "Down"
        Timer.reset(ctrl_timer)
    end
    GC_oldkey = GC_key
    GC_oldx = GC_x
    GC_oldy = GC_y
    return GC_outkey
end
function listDirectory(dir)
    dir = System.listDirectory(dir)
    files_table = {}
    for i,file in pairs(dir) do
        if not file.directory then
            table.insert(files_table,file)
        end
    end
    table.sort(files_table, function (a, b) return (a.name:lower() < b.name:lower() ) end)
    return files_table
end
function getconfig()
    filenames = {}
    filenames = listDirectory(System.currentDirectory().."gamefs/Course/")
    trackn = #filenames
    tracke = {}
    local i
    local z = ""
    tracks = {}
    for i = 1, trackn, 1 do
        z = filenames[i].name
        z = string.sub(z,1,-5)
        if (string.sub(z,1,1) == "_") then
            tracke[i] = false
            tracks[i] = string.sub(z,2,-1)
        else
            tracke[i] = true
            tracks[i] = z
        end
    end
    dofile(System.currentDirectory().."config/names.lua")
    if not (#cts == trackn) then
        System.exit()
    end
    return true
end
function applyconfig()
    local z
    for z = 1, trackn, 1 do
        if (System.doesFileExist(System.currentDirectory().."gamefs/Course/"..tracks[z]..".szs")) then
            if not (tracke[z]) then
                System.renameFile(System.currentDirectory().."gamefs/Course/"..tracks[z]..".szs", System.currentDirectory().."gamefs/Course/_"..tracks[z]..".szs")
            end
        elseif (System.doesFileExist(System.currentDirectory().."gamefs/Course/_"..tracks[z]..".szs")) then
            if (tracke[z]) then
                System.renameFile(System.currentDirectory().."gamefs/Course/_"..tracks[z]..".szs", System.currentDirectory().."gamefs/Course/"..tracks[z]..".szs")
            end
        end
    end
    return true
end
function checkntr()
    local cias = System.listCIA()
    local v
    local installed
    local count = 0
    for _ in pairs(cias) do count = count + 1 end
    for v = 1, count, 1 do
        if (cias[v].unique_id == 0x00b00000) then
            installed = true
            break
        else
            installed = false
        end
    end
    return installed
end
-- Load files
topimgl = Screen.loadImage(System.currentDirectory().."resources/top_l.bmp")
submen0 = Graphics.loadImage(System.currentDirectory().."resources/submen0.png")
submen1 = Screen.loadImage(System.currentDirectory().."resources/submen1.bmp")
submen2 = Screen.loadImage(System.currentDirectory().."resources/submen2.bmp")
submen3 = Screen.loadImage(System.currentDirectory().."resources/submen3.bmp")
btn_u = Graphics.loadImage(System.currentDirectory().."resources/btn_u.png")
btn_s = Graphics.loadImage(System.currentDirectory().."resources/btn_s.png")
btn_en = Graphics.loadImage(System.currentDirectory().."resources/btn_en.png")
btn_dis = Graphics.loadImage(System.currentDirectory().."resources/btn_dis.png")
btn_sl = Graphics.loadImage(System.currentDirectory().."resources/btn_sl.png")
bgm = Sound.openOgg(System.currentDirectory().."resources/bgm.ogg", true)
beep = Sound.openOgg(System.currentDirectory().."resources/beep.ogg", false)
beep1 = Sound.openOgg(System.currentDirectory().."resources/beep1.ogg", false)
font = Font.load(System.currentDirectory().."resources/font.ttf")
-- End load files
mus0 = false
installntr = false
men = 0
men1 = 0
men3 = 1
disp1 = men3 + 1
disp2 = men3 - 1
submen = 0
oldpad = Controls.read
topscreen = topimgl
bottomscreen = submen3
ntrinstalled = checkntr()
getconfig()
ctrl_timer = Timer.new()
Sound.init()
Sound.play(bgm,LOOP)
while true do
Sound.updateStream()
    checkbutton = true
    pad = getcontrol()
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.clear(BOTTOM_SCREEN)

    Screen.drawImage(0,0,topscreen,TOP_SCREEN)
    if (installntr) then
        System.installCIA(System.currentDirectory().."ntr/ntr.cia")
        submen = 0
        men = 0
        men1 = 0
        installntr = false
        checkbutton = false
        ntrinstalled = checkntr()
    end
    if not (ntrinstalled) then
        submen = 255
        Screen.debugPrint(0, 0, "NTR must be installed,", Color.new(255,255,255), BOTTOM_SCREEN)
        Screen.debugPrint(0, 10, "do you want to install it?", Color.new(255,255,255), BOTTOM_SCREEN)
        Screen.debugPrint(0, 30, "A = Just do it!!", Color.new(255,255,255), BOTTOM_SCREEN)
        Screen.debugPrint(0, 40, "B = NO!!", Color.new(255,255,255), BOTTOM_SCREEN)
        if (pad == "A") then
            Screen.debugPrint(0, 60, "Installing...", Color.new(255,255,255), BOTTOM_SCREEN)
            installntr = true
            checkbutton = false
        elseif (pad == "B") then
            Sound.pause(bgm)
            Sound.close(bgm)
            Sound.pause(beep)
            Sound.close(beep)
            Sound.pause(beep1)
            Sound.close(beep1)
            Sound.term()
            System.exit()
        end
    end
    if (launchntr) then
        System.launchCIA(0x00b00000,SDMC)
        System.exit()
    end
    if (submen == 0) then -- main menu
        Font.setPixelSizes(font, 32)
        if (pad == "Down") then
            men = men + 1
            Sound.play(beep, NO_LOOP)
        elseif (pad == "Up") then
            men = men - 1
            Sound.play(beep, NO_LOOP)
        end
        if (men > 2) then
            men = 0
        elseif (men < 0) then
            men = 2
        end
        if (men == 0) then
            Graphics.initBlend(BOTTOM_SCREEN)
            Graphics.drawImage(0, 0, submen0)
            Graphics.drawImage(5, 15, btn_s)
            Graphics.drawImage(5, 90, btn_u)
            Graphics.drawImage(5, 165, btn_u)
            Graphics.termBlend()
            Font.print(font, 25, 30, "Launch CTGP-7", Color.new(0,0,255), BOTTOM_SCREEN)
            Font.print(font, 25, 105, "Course Manager", Color.new(255,255,255), BOTTOM_SCREEN)
            Font.print(font, 25, 180, "Exit", Color.new(255,255,255), BOTTOM_SCREEN)
            if (pad == "A") and (checkbutton) then
                launchntr = true
            end
        elseif (men == 1) then
            Graphics.initBlend(BOTTOM_SCREEN)
            Graphics.drawImage(0, 0, submen0)
            Graphics.drawImage(5, 15, btn_u)
            Graphics.drawImage(5, 90, btn_s)
            Graphics.drawImage(5, 165, btn_u)
            Graphics.termBlend()
            Font.print(font, 25, 30, "Launch CTGP-7", Color.new(255,255,255), BOTTOM_SCREEN)
            Font.print(font, 25, 105, "Course Manager", Color.new(0,0,255), BOTTOM_SCREEN)
            Font.print(font, 25, 180, "Exit", Color.new(255,255,255), BOTTOM_SCREEN)
            if (pad == "A") and (checkbutton) then
                Sound.play(beep, NO_LOOP)
                submen = 1
                men = 0
                men1 = 0
                checkbutton = false
            end
        elseif (men == 2) then
            Graphics.initBlend(BOTTOM_SCREEN)
            Graphics.drawImage(0, 0, submen0)
            Graphics.drawImage(5, 15, btn_u)
            Graphics.drawImage(5, 90, btn_u)
            Graphics.drawImage(5, 165, btn_s)
            Graphics.termBlend()
            Font.print(font, 25, 30, "Launch CTGP-7", Color.new(255,255,255), BOTTOM_SCREEN)
            Font.print(font, 25, 105, "Course Manager", Color.new(255,255,255), BOTTOM_SCREEN)
            Font.print(font, 25, 180, "Exit", Color.new(0,0,255), BOTTOM_SCREEN)
            if (pad == "A") and (checkbutton) then
                Sound.pause(bgm)
                Sound.close(bgm)
                Sound.pause(beep)
                Sound.close(beep)
                Sound.pause(beep1)
                Sound.close(beep1)
                Sound.term()
                System.exit()
            end
        end
    end
    if (submen == 1) then -- Course manager

        Font.setPixelSizes(font, 25)
        if (pad == "Down") then
            men3 = men3 - 1
            Sound.play(beep1, NO_LOOP)
        elseif (pad == "Up") then
            men3 = men3 + 1
            Sound.play(beep1, NO_LOOP)
        end
        if (men3 >= trackn + 1) then
            men3 = 1
        elseif (men3 <= 0) then
            men3 = trackn
        end
        disp1 = men3 + 1
        disp2 = men3 - 1
        if (disp1 >= trackn + 1) then
            disp1 = 1
        elseif (disp1 <= 0) then
            disp1 = trackn
        end
        if (disp2 >= trackn + 1) then
            disp2 = 1
        elseif (disp2 <= 0) then
            disp2 = trackn
        end
        if ((pad == "Right") or (pad == "Left") or (pad == "A")) and (checkbutton) then
            tracke[men3] = not tracke[men3]
            Sound.play(beep, NO_LOOP)
        end
        if (pad == "B") and (checkbutton) then
            Sound.play(beep1, NO_LOOP)
            submen = 0
            men = 1
            checkbutton = false
            applyconfig()
        end
        color_ed = {}
        if (tracke[men3]) then
            btn_enadisa = btn_en
            color_ed[3] = Color.new(0,255,0)
        else
            btn_enadisa = btn_dis
            color_ed[3] = Color.new(255,0,0)
        end
        Graphics.initBlend(BOTTOM_SCREEN)
        Graphics.drawImage(0, 0, submen0)
        Graphics.drawImage(4, 73, btn_sl)
        Graphics.drawImage(8, 151, btn_enadisa)
        Graphics.termBlend()
        if (tracke[disp1]) then
            color_ed[1] = Color.new(0,153,0)
        else
            color_ed[1] = Color.new(153,0,0)
        end
        if (tracke[disp2]) then
            color_ed[2] = Color.new(0,153,0)
        else
            color_ed[2] = Color.new(153,0,0)
        end
        Font.print(font, 8, 0,men3.." / "..trackn, Color.new(255,255,255), BOTTOM_SCREEN)
        Font.print(font, 8, 203,"Press B to exit", Color.new(255,255,255), BOTTOM_SCREEN)
        Font.print(font, 8, 50,cts[disp1], color_ed[1], BOTTOM_SCREEN)
        Font.print(font, 12, 75,cts[men3], color_ed[3], BOTTOM_SCREEN)
        Font.print(font, 8, 100,cts[disp2], color_ed[2], BOTTOM_SCREEN)
    end
    oldpad = pad
    Screen.flip()
end
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BakerMan @ BakerMan:
    imagine not having hands, cringe
    +1
  • AncientBoi @ AncientBoi:
    ESPECIALLY for things I do to myself :sad:.. :tpi::rofl2: Or others :shy::blush::evil:
    +1
  • The Real Jdbye @ The Real Jdbye:
    @SylverReZ if you could find a v5 DS ML you would have the best of both worlds since the v5 units had the same backlight brightness levels as the DS Lite unlockable with flashme
  • The Real Jdbye @ The Real Jdbye:
    but that's a long shot
  • The Real Jdbye @ The Real Jdbye:
    i think only the red mario kart edition phat was v5
  • BigOnYa @ BigOnYa:
    A woman with no arms and no legs was sitting on a beach. A man comes along and the woman says, "I've never been hugged before." So the man feels bad and hugs her. She says "Well i've also never been kissed before." So he gives her a kiss on the cheek. She says "Well I've also never been fucked before." So the man picks her up, and throws her in the ocean and says "Now you're fucked."
    +2
  • BakerMan @ BakerMan:
    lmao
  • BakerMan @ BakerMan:
    anyways, we need to re-normalize physical media

    if i didn't want my games to be permanent, then i'd rent them
    +1
  • BigOnYa @ BigOnYa:
    Agreed, that why I try to buy all my games on disc, Xbox anyways. Switch games (which I pirate tbh) don't matter much, I stay offline 24/7 anyways.
    +1
  • AncientBoi @ AncientBoi:
    I don't pirate them, I Use Them :mellow:. Like I do @BigOnYa 's couch :tpi::evil::rofl2:
    +1
  • cearp @ cearp:
    @BakerMan - you can still "own" digital media, arguably easier and better than physical since you can make copies and backups, as much as you like.

    The issue is DRM
    +1
  • cearp @ cearp:
    You can buy drm free games / music / ebooks, and if you keep backups of your data (like documents and family photos etc), then you shouldn't lose the game. but with a disk, your toddler could put it in the toaster and there goes your $60

    :rofl2:
  • cearp @ cearp:
    still, I agree physical media is nice to have. just pointing out the issue is drm
    +1
  • rqkaiju2 @ rqkaiju2:
    i like physical media because it actually feels like you own it. thats why i plan on burning music to cds
  • cearp @ cearp:
    It's nice to not have to have a lot of physical things though, saves space
    +1
  • AncientBoi @ AncientBoi:
    Nor clothes 🤮 . Saves on time, soap, water and money having to wash them. :D
  • SylverReZ @ SylverReZ:
    @rqkaiju2, Physical media is a great source for archiving your data, none of that cloud storage shiz.
    +1
  • AncientBoi @ AncientBoi:
    [squeezes @SylverReZ onto a physical media, then archives you in my old stuff box] :tpi::rofl2::tpi:
    +1
  • BakerMan @ BakerMan:
    guys, should i change my pfp to one of these or keep it the same?
    iu

    iu

    (i guess i could change it to one of my other pfps too, but i just want to see what you guys think first)
  • SylverReZ @ SylverReZ:
    @BakerMan, Up to you.
  • BakerMan @ BakerMan:
    smug sonic time lmao
    +1
    BakerMan @ BakerMan: smug sonic time lmao +1