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

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 187,212
  • Replies Replies 1,199
  • Likes Likes 35
That doesn't help me. These are obviously paths, but where do they lead to? I'm sorry that I may seem stupid, but please keep in mind that I first tried to do anything with 3DS homebrew 3 days ago.
it's the folder that opens when you put your sd card in. it's the 'root'.
 
Can somebody tell me where the /sdmc/ folders is?

/sdmc/ refers to the root of the 3DS SD card.
in regards to the Citra 3DS emulator, if you want to test out this homebrew on PC, /sdmc/ refers to FolderWithCitraEmulatorInIt\user\sdmc\ which is the folder the emulator treats as a 3DS SD card.
 
Citra is surprisingly accurate. When it crashes on Citra, it almost always crashes or hangs on my 3DS as well.
 
/sdmc/ refers to the root of the 3DS SD card.
in regards to the Citra 3DS emulator, if you want to test out this homebrew on PC, /sdmc/ refers to FolderWithCitraEmulatorInIt\user\sdmc\ which is the folder the emulator treats as a 3DS SD card.

But I'm using a Mac right now and can't seem to find the folder anywhere. Do you, where I can find it, because it would be much more simple debugging programs on a computer.
 
But I'm using a Mac right now and can't seem to find the folder anywhere. Do you, where I can find it, because it would be much more simple debugging programs on a computer.

Weird here's an attached screenshot of my citra folder and its directories. So yeah, I just put "lpp-3ds.3dsx" in that /sdmc/ folder, copied one of the sample lua files into /sdmc/ as well and renamed the sample lua file "index.lua"
 

Attachments

  • tree.jpg
    tree.jpg
    27.5 KB · Views: 321
If I do that, I just have to copy all the files on my SD card in the folder?

I guess you could but really you only need to copy file relevant to what you want to run.
Like for example I can run the lpp-3ds.3dsx (the lua interpreter) from any directory on my computer but the thing is that that 3dsx file will look for a "index.lua" on the root of the SD card and that's why you would need the index.lua inside of /sdmc/. If you don't have the index.lua file in /sdmc/ you can still load the lua interpreter... But it'll show an error.
 
I guess you could but really you only need to copy file relevant to what you want to run.
Like for example I can run the lpp-3ds.3dsx (the lua interpreter) from any directory on my computer but the thing is that that 3dsx file will look for a "index.lua" on the root of the SD card and that's why you would need the index.lua inside of /sdmc/. If you don't have the index.lua file in /sdmc/ you can still load the lua interpreter... But it'll show an error.

So I tried to create to folder myself and it actually worked and loads the sample programs fine, but a simple sample program I wrote (just printing a few system variables to the screen) doesn't work on it, although it runs on actual hardware. Do you know what's up with that?
 
So I tried to create to folder myself and it actually worked and loads the sample programs fine, but a simple sample program I wrote (just printing a few system variables to the screen) doesn't work on it, although it runs on actual hardware. Do you know what's up with that?

No idea, I gave up on this. Can't stand lua. I'm sure there's plenty of problems with the not yet finished Citra emulator that cause that error.
 
The project I'm working on uses a lot of strings and the string functions I've been introduced to in Lua don't seem to be as robust as what I'm used to in C++. I've seen demonstrations of what I need to do in Lua and it's pretty inelegant.
sf2dl uses C++ so I'm trying to get that running..

I'm sure it's possible but I'm gonna avoid relearning something I already know how to do if I can.
 
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.

Just an update: I was able to fix my environment and compile the source. I did have to make some changes to the makefile. For anyone else who can't compile, here are the steps that I took, assuming you have only have devkitPro r44 installed in c:\devkitPro and the lpp-3ds source.

Install python (and add it to your PATH).
Create a new folder at c:\devkitPro\aemstro and add these files: https://github.com/smealum/aemstro
Create a new folder at c:\devkitPro\portlibs\3ds and extract zlib to it: http://sourceforge.net/projects/devkitpro/files/portlibs/arm/
Copy C:\devkitPro\devkitARM\arm-none-eabi\lib\armv6k\fpu\3dsx_crt0.o two folders back to c:\devkitPro\devkitARM\arm-none-eabi\lib\3dsx_crt0.o
Edit the makefile to add $(PORTLIBS) to the LIBDIRS line. (this fixes the "cannot find -lz" error)
Edit the makefile to change the reference to C:\Python31 to just "python.exe" (if you have python installed elsewhere)

With these changes, the application compiles without any problems and builds all the 3dsx/3ds/cia files as expected.
 
  • Like
Reactions: ihaveahax
@Rinnegatamante, is there any way to get this working in Citra? It works fine on actual hardware but I get "unmapped read" error in the emulator.

I found out you need to put the index.lua and 3dsx file in the citra/user/sdmc folder.
 
Last edited by 0x0wl,
This is totally working in Citra for me. Are your files/folders set up correctly? Do you have a main loop?
A sample I was testing worked fine on a 3DS but failed in Citra because I hadn't implemented a loop yet.

Also, is there something wrong with reading and writing files? When I read a file's contents and output its text, the output had weird trailing characters and would show as hex in Sublime Text. I wrote this:
Code:
-- HI SCORE IS BROKEN
-- idk why

hiscorefile = io.open("/gfx/hiscore",FCREATE)
text = io.read(hiscorefile,0,10)
hiscore = tonumber(text)
if (score > hiscore) then
    hiscore = score
    io.write(hiscorefile,0,hiscore, 21)
end
 

Site & Scene News

Popular threads in this forum