Homebrew Homebrew Development

MasterFeizz

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
1,098
Trophies
1
Age
29
XP
3,710
Country
United States
How can I read and display images from a romfs then?
You can write directly to the framebuffer (slow), or use the GPU. If you want to use the GPU you can either write your own library or use an existing one like sf2d (easier) or citro3d.
Citro3d example: https://github.com/devkitPro/3ds-examples/tree/master/graphics/gpu/textured_cube (Harder)
sfillib (sf2dlib) example: https://github.com/xerpi/sfillib/tree/master/sample (Easier)
They both pack the images directly into the executable, but changing it to load from romfs is easy. With sfilib you only need to use sfil_load_JPEG_file with the romfs path. Check the RomFS example on how to setup the romfs.
 
  • Like
Reactions: Deleted User
D

Deleted User

Guest
You can write directly to the framebuffer (slow), or use the GPU. If you want to use the GPU you can either write your own library or use an existing one like sf2d (easier) or citro3d.
Citro3d example: https://github.com/devkitPro/3ds-examples/tree/master/graphics/gpu/textured_cube (Harder)
sfillib (sf2dlib) example: https://github.com/xerpi/sfillib/tree/master/sample (Easier)
They both pack the images directly into the executable, but changing it to load from romfs is easy. With sfilib you only need to use sfil_load_JPEG_file with the romfs path. Check the RomFS example on how to setup the romfs.
Thank you for this. I'll experiment with it later. :)
 
D

Deleted User

Guest
Do you have any javascript knowledge? I'm soon going to need testers for an API friendliness test, and since you want to experiment with some 3ds homebrew maybe you can help.
Unfortunately, Java isn't my strong-point, so I can't really help on that one; sorry. :(
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
While compiling the romfs example i get an error 199
Code:
linking romfs.elf
built ... romfs.smdh
make[1]: *** [/opt/devkitpro/examples/3ds/romfs/romfs.3dsx] Error 199
make: *** [build] Error 2

Any idea what this could be?

(I'm pretty experienced in javascript)
 

MasterFeizz

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
1,098
Trophies
1
Age
29
XP
3,710
Country
United States
While compiling the romfs example i get an error 199
Code:
linking romfs.elf
built ... romfs.smdh
make[1]: *** [/opt/devkitpro/examples/3ds/romfs/romfs.3dsx] Error 199
make: *** [build] Error 2

Any idea what this could be?

(I'm pretty experienced in javascript)
I just tried compiling it and it worked, do you have the latest devkitarm? I'm on windows so I don't know how the versions are compared between linux and windows.

(I'll contact you when everything is ready to be tested ;))
 

Zarxrax

Well-Known Member
Member
Joined
Oct 5, 2005
Messages
369
Trophies
1
Website
Visit site
XP
1,577
Country
United States
Can anyone tell me if there currently exists the possibility of writing a homebrew replacement for the application which allows a 3ds to be used as a controller for Smash 4 Wii U? Do we know how the 3ds talks to the Wii U and how to reproduce that?
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
I just tried compiling it and it worked, do you have the latest devkitarm? I'm on windows so I don't know how the versions are compared between linux and windows.

(I'll contact you when everything is ready to be tested ;))
i've reinstalled the environment 2-3 weeks ago, i'll try again tomorrow
 

erman1337

Well-Known Member
Member
Joined
Sep 27, 2015
Messages
1,211
Trophies
0
Location
Brussels
XP
983
Country
Belgium
Unless you want to make a compatible lua player for pc, citra is the best option. Also, I'm pretty sure that citra supports the DPad.
Controls.check(Controls.read(), KEY_DRIGHT) keeps returning false when I'm holding on the right button

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

Just found the right key, it's H


????????
 

erman1337

Well-Known Member
Member
Joined
Sep 27, 2015
Messages
1,211
Trophies
0
Location
Brussels
XP
983
Country
Belgium
I'm working on an application using lpp-3ds, and I want to draw a long text, but it would overflow out of the screen, so I did a character limiter thingy:
r5bA1Xw.png


Code:
descLines = {}
desc = themes[currBadge]['desc']
desc:gsub(".", function(c) if #descLines == 0 or #descLines[#descLines] == 31 then table.insert(descLines, c) else descLines[#descLines] = descLines[#descLines] .. c end end)

for i,v in pairs(descLines) do
    h = (i * 22) + 4
    Font.print(font, 5, h, v:gsub("^%s", ""), white, BOTTOM_SCREEN)
end

Although it kinda cuts off letters as you can see in the screenshot above. Is there a better way of doing this?
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
Although it kinda cuts off letters as you can see in the screenshot above. Is there a better way of doing this?

I don't know lua, but one thing that you could do:
- split the sentence on spaces into an array of strings
- iterate through the array, and check how many space is left, if there is enough space, then print the word
- if there is not enough space, go to a new line
 

Tjessx

Well-Known Member
Member
Joined
Dec 3, 2014
Messages
1,160
Trophies
0
Age
27
XP
952
Country
Belgium
I've been trying to create a library using the library template given with the examples of ctrulib.
When it compiles i get the necessary .a file, but i have trouble using that .a file.

I tried including it in the settings of Netbeans, but after losing hours i gave up and placed it inside the devkitPro/libctru folder.
i placed the .a file in lib, and the header files in include.

I can include the header files now in my code, but whenever i try to use something of the library, i get this error:
undefined reference to `Namespace::class:function()'

Could someone tell me how to import a static library in Netbeans, and why i get this error?
Thanks,
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,858
Country
Italy
I'm working on an application using lpp-3ds, and I want to draw a long text, but it would overflow out of the screen, so I did a character limiter thingy:
r5bA1Xw.png


Code:
descLines = {}
desc = themes[currBadge]['desc']
desc:gsub(".", function(c) if #descLines == 0 or #descLines[#descLines] == 31 then table.insert(descLines, c) else descLines[#descLines] = descLines[#descLines] .. c end end)

for i,v in pairs(descLines) do
    h = (i * 22) + 4
    Font.print(font, 5, h, v:gsub("^%s", ""), white, BOTTOM_SCREEN)
end

Although it kinda cuts off letters as you can see in the screenshot above. Is there a better way of doing this?

https://github.com/Rinnegatamante/Sunshell/blob/master/LUA/scripts/funcs.lua#L156-L181

This is how Sunshell prints Warning/Errors messages with formatted text according to spaces.
 

Coto

-
Member
Joined
Jun 4, 2010
Messages
2,979
Trophies
2
XP
2,565
Country
Chile
I've been trying to create a library using the library template given with the examples of ctrulib.
When it compiles i get the necessary .a file, but i have trouble using that .a file.

I tried including it in the settings of Netbeans, but after losing hours i gave up and placed it inside the devkitPro/libctru folder.
i placed the .a file in lib, and the header files in include.

I can include the header files now in my code, but whenever i try to use something of the library, i get this error:
undefined reference to `Namespace::class:function()'

Could someone tell me how to import a static library in Netbeans, and why i get this error?
Thanks,

have you tried devkitPro/libctru/lib/ for *.a -- compiled object library (library of symbols)
and devkitPro/libctru/include/ for *.h -- symbol declaration folder (header)


say you have a library(.a) called hi

so it will have to be called
libhi.a

also in Makefile you must add:

Code:
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS   := -lhi


edit:

also in whatever .c / .cpp template you use:

you must add the header file, say its called libhi.h:

Code:
//main.cpp
#include <libhi.h>

void do_salute(){
hi(); //declaration must be linked 
}
 
Last edited by Coto,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    T @ Texasauras: SOLILOQUY