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

0x0wl

Member
Newcomer
Joined
Aug 18, 2015
Messages
17
Trophies
0
Age
33
XP
66
Country
United States
I was able to use the provided .3dsx fine, but I wanted to try compiling lpp-3ds myself. I'm using devkitpro r44 which required me to change a line in the makefile (noted in this thread) and do a clean build. I also had to update some print() statements in one of the Python files since I'm using Python 3.4.

Anyway, when I try to build lpp-3ds with the new -mfloat-abi=hard option, it compiles up until it starts using zlib to merge the binaries into lpp-3ds-master.elf. e.g.:
...
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(inftrees.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(zutil.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(zutil.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(adler32.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(adler32.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(inffast.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(inffast.o)
...

(compiling with -mfloat-abi=softfp gives the "cannot find 3dsx_crt0.o: No such file or directory" error listed in the thread)
According to a comment I found (in this bug report) zlib would need to be recompiled to work with this mfloat option.

What version of devkitpro are you using?
 

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 was able to use the provided .3dsx fine, but I wanted to try compiling lpp-3ds myself. I'm using devkitpro r44 which required me to change a line in the makefile (noted in this thread) and do a clean build. I also had to update some print() statements in one of the Python files since I'm using Python 3.4.

Anyway, when I try to build lpp-3ds with the new -mfloat-abi=hard option, it compiles up until it starts using zlib to merge the binaries into lpp-3ds-master.elf. e.g.:
...
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(inftrees.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(zutil.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(zutil.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(adler32.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(adler32.o)
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: error: d:/3DS/lpp-3ds-master/lpp-3ds-master.elf uses VFP register arguments, c:/devkitPro/portlibs/3ds/lib\libz.a(inffast.o) does not
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file c:/devkitPro/portlibs/3ds/lib\libz.a(inffast.o)
...

(compiling with -mfloat-abi=softfp gives the "cannot find 3dsx_crt0.o: No such file or directory" error listed in the thread)
According to a comment I found (in this bug report) zlib would need to be recompiled to work with this mfloat option.

What version of devkitpro are you using?

I'm using the latest version of devkitpro but with my proper settings (and with an old version of libctru properly edited by me to match up with the latest bugfixes and adds.
 

0x0wl

Member
Newcomer
Joined
Aug 18, 2015
Messages
17
Trophies
0
Age
33
XP
66
Country
United States
Alright, so it's not the version of devkitpro. That's mostly what I was wondering. I think I know where the problem is, then.

Thanks again for the help.
 

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
Alright, so it's not the version of devkitpro. That's mostly what I was wondering. I think I know where the problem is, then.

Thanks again for the help.

Just don't use mfloat-abi = hard but use softfp as default.
You don't have to edit anything from the repository to correctly compile it.
 

The_Marcster

Well-Known Member
Newcomer
Joined
Aug 18, 2015
Messages
98
Trophies
0
Age
24
XP
86
Country
Gambia, The
I have another question: Whenever I try to use a method to connect to the internet (Network.requestString or Network.downloadFile), my program and even the samples for Network.requestString and Network.downloadFile fail and tell me, they couldn't open the url. Also, when I return to the homebrew channel I'm not connected to the internet anymore. Do you know why this happens?

But apart from that problem, amazing work with the lua interpreter, I already created a few simple programs and everything worked great. So again, good work :)
 

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 have another question: Whenever I try to use a method to connect to the internet (Network.requestString or Network.downloadFile), my program and even the samples for Network.requestString and Network.downloadFile fail and tell me, they couldn't open the url. Also, when I return to the homebrew channel I'm not connected to the internet anymore. Do you know why this happens?

But apart from that problem, amazing work with the lua interpreter, I already created a few simple programs and everything worked great. So again, good work :)

It's a common issue for newest hacks. All networking homebrews have this kinds of problem.
 

Anthe

Active Member
Newcomer
Joined
Aug 17, 2013
Messages
33
Trophies
0
Age
24
XP
181
Country
Belgium
Is there an example somewhere for 3D? I'd like to draw certain sprites in my game "closer" to the player than others, or make the starting logo pop out. The asteroids game is a bit confusing. As you know, I'm using the GPU renderer ;).
 

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 there an example somewhere for 3D? I'd like to draw certain sprites in my game "closer" to the player than others, or make the starting logo pop out. The asteroids game is a bit confusing. As you know, I'm using the GPU renderer ;).

Asteroids 3D is the only 3D source produced with lpp-3ds (It's not real 3D cause it doesn't use GPU functions like shader, vertex, matrix and so on). Anyway, i can explain you better parts of code you not understand about Asteroids 3D.
 

Anthe

Active Member
Newcomer
Joined
Aug 17, 2013
Messages
33
Trophies
0
Age
24
XP
181
Country
Belgium
Well.. in this example you only draw to the right eye. Shouldn't there be two eyes you draw to? Can you just draw one sprite twice to both eyes to create a 3D effect, or do you have to adjust the coordinates?
Code:
if Screen.get3DLevel() > 0 then
            Graphics.initBlend(TOP_SCREEN,RIGHT_EYE)
            Graphics.drawImage(100,10,logo_gpu)
            Graphics.termBlend()
end
 

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
Well.. in this example you only draw to the right eye. Shouldn't there be two eyes you draw to? Can you just draw one sprite twice to both eyes to create a 3D effect, or do you have to adjust the coordinates?
Code:
if Screen.get3DLevel() > 0 then
            Graphics.initBlend(TOP_SCREEN,RIGHT_EYE)
            Graphics.drawImage(100,10,logo_gpu)
            Graphics.termBlend()
end

You posted only a part of the code.
Code:
Graphics.initBlend(TOP_SCREEN)
     Graphics.drawImage(100,10,logo_gpu)
     Graphics.termBlend()
     if Screen.get3DLevel() > 0 then
       Graphics.initBlend(TOP_SCREEN,RIGHT_EYE)
       Graphics.drawImage(100,10,logo_gpu)
       Graphics.termBlend()
     end

having a check on current 3D level prevent you to blit double image for an eye you don't use when 3d is disabled (RIGHT_EYE).
Remember that initBlend take as 2nd argument LEFT_EYE by default if not used.
 

Anthe

Active Member
Newcomer
Joined
Aug 17, 2013
Messages
33
Trophies
0
Age
24
XP
181
Country
Belgium
That makes sense! Thank you!

EDIT: Moorrreee questions! I have loaded a 44100Hz, 32-bit float OGG file, but it just keeps looping the beginning or doing weird things. I have looked around and changed values but I just can't make it work.

Sound.play(bgmusic, LOOP, 0x08, 0x09)
What's these u32 channel, [u32 channel2] values anyway? I can't find anything about it on the internet :s
 
Last edited by Anthe,

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
You posted only a part of the code.
Code:
Graphics.initBlend(TOP_SCREEN)
     Graphics.drawImage(100,10,logo_gpu)
     Graphics.termBlend()
     if Screen.get3DLevel() > 0 then
       Graphics.initBlend(TOP_SCREEN,RIGHT_EYE)
       Graphics.drawImage(100,10,logo_gpu)
       Graphics.termBlend()
     end

having a check on current 3D level prevent you to blit double image for an eye you don't use when 3d is disabled (RIGHT_EYE).
Remember that initBlend take as 2nd argument LEFT_EYE by default if not used.


Are you using streaming feature? If yes, you have to call Sound.updateStream() on your main loop.
 

Anthe

Active Member
Newcomer
Joined
Aug 17, 2013
Messages
33
Trophies
0
Age
24
XP
181
Country
Belgium
Yop, I'm using streaming! Thanks again, my game is now pretty much ready for release!
EDIT: When using the streaming method, the sound does the same first few seconds thing after it starts over. I don't think it's due to my code.
 
Last edited by Anthe,

dfsa3fdvc1

Well-Known Member
Member
Joined
Jan 3, 2015
Messages
226
Trophies
0
XP
214
Country
Albania
Looks cool. I'm having problems running this with Citra though. Included a screencap of my setup.
I know you said that an index.lua needs be in /sdmc/ but I couldn't find a index.lua in the release folder. Do you know where I can find an index.lua file?
Thank you.

I also tried renaming the "math.lua" to "index.lua" but that didn't work either.
 

Attachments

  • Lua Citra.jpg
    Lua Citra.jpg
    57.3 KB · Views: 255

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
Yop, I'm using streaming! Thanks again, my game is now pretty much ready for release!
EDIT: When using the streaming method, the sound does the same first few seconds thing after it starts over. I don't think it's due to my code.

Mmmmhhhh i noticed this issue also few days ago when trying new things for TriaAl.
I have to check where the problem came from.
Anyway, for the moment, streaming feature is fully working for AIFF and WAV files (i know they are very big if compared to OGG files but for now you can use them).
Or if you don't have RAM problems, you can disable streaming feature.

Looks cool. I'm having problems running this with Citra though. Included a screencap of my setup.
I know you said that an index.lua needs be in /sdmc/ but I couldn't find a index.lua in the release folder. Do you know where I can find an index.lua file?
Thank you.

I also tried renaming the "math.lua" to "index.lua" but that didn't work either.

For Citra, don't know where the index.lua file goes. Anyway index.lua file must be wrote from you (you can also use a sample provided with R2 release.
 

dfsa3fdvc1

Well-Known Member
Member
Joined
Jan 3, 2015
Messages
226
Trophies
0
XP
214
Country
Albania
For Citra, don't know where the index.lua file goes. Anyway index.lua file must be wrote from you (you can also use a sample provided with R2 release.

Awesome, what directroy is the sample index.lua in? I extracted both the source and release of R2 and couldn't find it.

EDIT: I'm dumb. Just reanming the samples as "index.lua gets them working, lol. I must have done something wrong when I tried that earlier, lol.
So yeah, just putting the .3dsx and index.lua into /sdmc/ works great.
 
Last edited by dfsa3fdvc1,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: I have a number of geriatric relatives.