Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,390
  • Replies Replies 6,048
  • Likes Likes 54
and on a higher level what is your end goal in all of this just for more context?

I would like to get xerpi's sfillib working, which, as explained in an earlier post, requires the portlib library. Please let me know if you know of any alternatives.
 
I would like to get xerpi's sfillib working, which, as explained in an earlier post, requires the portlib library. Please let me know if you know of any alternatives.

A search in this very thread reveals a makefile by xerpi to build all of these for you. I'm running it right now seems to work.
https://github.com/xerpi/3ds_portlibs


and to answer your second question there are alternate methods

These options will just convert the image into a C array which you can just include in your project, rather than load the image at runtime
GIMP has a nice export to C file feature which you can include in your project
ImageMagick can also do the above (not sure now but it was used in one of devkitpro's samples, the bitmap one)

Advantages: no library dependency on sfillib, no runtime penalty, easy to get up and running quickly
Disadvantages: compile time increased slightly, making changes to images will require exporting again, code/binary size increased
 
A search in this very thread reveals a makefile by xerpi to build all of these for you. I'm running it right now seems to work.
https://github.com/xerpi/3ds_portlibs


and to answer your second question there are alternate methods

These options will just convert the image into a C array which you can just include in your project, rather than load the image at runtime
GIMP has a nice export to C file feature which you can include in your project
ImageMagick can also do the above (not sure now but it was used in one of devkitpro's samples, the bitmap one)

Advantages: no library dependency on sfillib, no runtime penalty, easy to get up and running quickly
Disadvantages: compile time increased slightly, making changes to images will require exporting again, code/binary size increased

Oh, I knew about sf2dlib, it's just that I wanted to load .png images and the like off the SD card for a program I have in mind.

Anyways, thanks for all the help. I'm going to try xerpi's makefile right now.
 
Yep, welcome!

After running xerpi's makefile just go back to sfillib and run make there, then make install. You should be set up then.

Lastly make sure that in your app's makefile you list -lsfil and -lsf2d (in this order) for the LIBS macro before -lctru

LIBS := -lctru -lm

will become

LIBS := -lsfil -lsf2d -lctru -lm
 
  • Like
Reactions: Deleted User
Yes, you will need to use ctrulib to get the actual physical output, and the library does need to be open source since I don't really think you will be able to find a closed source library that will be compatible with the architecture and compiler.
Would it have to be an ARM library, x86, x86-x64? Or would I have to change it somehow.
 
the threading on the 3ds OS is cooperative, so whats the point of using threads in applications, when actually never something runs really parallel?
 
the threading on the 3ds OS is cooperative, so whats the point of using threads in applications, when actually never something runs really parallel?
The threads are cooperative which mean only one thread at a time per CPU core, the O3DS is dual core and the N3DS is quad core. You can use some of the CPU time of the system core and on the N3DS you can create threads on the other cores. Also the concept of coroutines is widely used in computing and they don't run in parallel.
 
Last edited by MasterFeizz,
is there any effective advantage which comes from the fact that 2 or 4 cores are available if only one is active at the time?
All cores are active. You're having a hard time differentiating concurrency with parallelism. The 3DS does have threads running in parallel, but even if a system is a single core/thread there are still benefits of running concurrent processes.

Edit: Just open up your task manager and look at how many threads you are currently running, the difference is that the kernel schedules the threads and on the 3ds you have to do it yourself.
 
Last edited by MasterFeizz,
I'm pretty new to this multi threading thing, I programmed for years all kind of programs in a single thread.

My problem in thinking is that if you have pass the torch further manually, I don't see any advantage from the technical standpoint compared to the good old just spread the slower operations to do over multiple frames(/cycles) while doing lighter operations(which need to be done more often, e.g. rendering) every cycle.
 
I'm pretty new to this multi threading thing, I programmed for years all kind of programs in a single thread.

My problem in thinking is that if you have pass the torch further manually, I don't see any advantage from the technical standpoint compared to the good old just spread the slower operations to do over multiple frames(/cycles) while doing lighter operations(which need to be done more often, e.g. rendering) every cycle.
You gave the best example youself. Let's say you write a single threaded software for linux, that software is not going to have a reserved core just for itself but the kernel will schedule it's execution time. The biggest difference is that the kernel is doing everything for you so it appears to be "seamless", while on the 3DS you will have to yeld the thread yourself.
 
I think I understood the difference between, parallelism and concurrency.

So there isn't an advantage, in terms of performance, when using threads, within an application, on 3ds, right(except for things like running something while waiting for VBlank)?
 

Site & Scene News

Popular threads in this forum