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,604
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,031
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,604
Trophies
2
Age
24
Location
Yoshi's Island
XP
5,031
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.
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    as to you
  • K3Nv2 @ K3Nv2:
    How do you know if the night will be good when you're asleep
  • BakerMan @ BakerMan:
    because i didn't say i was asleep
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
    The Real Jdbye @ The Real Jdbye: never had that i don't think