Views: 1,375,847 Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 02-25-24 02:22 PM

Main - Posts by Eclipse2212

Posted on 08-10-16 08:47 PM, in How does romfs work? Link | #1061

I'm working on an homebrew that require to load a crapload of files, essentially sprites and sound.

I've searched a lot over the Internet, but, I don't understand how to link the files to the code
(I'm using sf2d with sftd and sfil, if it can help.)

I tried several times but the only thing that render is a black screen and my console who hangs (I use a 2Ds xD)

I worked when I was using the data folder, so, I really don't understand why it doesn't work.

I will accept any kind of help, beceause this make me crazy.

Oh, if you want the source code, i can link a compressed file.

Have a nice trap!


Posted on 08-10-16 08:58 PM, in How does romfs work? Link | #1063
Thanks, already found this example,
Actually, I'm using this to try to make my code work.

It leads me to a "silly" question: when i load the files with sfil, do I have to open the file by myself, or the lib do it by itself?

Posted on 08-10-16 09:46 PM, in How does romfs work? (rev. 4 of 08-10-16 10:14 PM) Link | #1065
Okay, gonna search in the lib project



Found on png.c in the sfil project:
sf2d_texture *sfil_load_PNG_file(const char *filename, sf2d_place place)
png_byte pngsig[PNG_SIGSIZE];
FILE *fp;

if ((fp = fopen(filename, "rb")) == NULL) {
goto exit_error;

if (fread(pngsig, 1, PNG_SIGSIZE, fp) != PNG_SIGSIZE) {
goto exit_close;

if (png_sig_cmp(pngsig, 0, PNG_SIGSIZE) != 0) {
goto exit_close;

sf2d_texture *texture = _sfil_load_PNG_generic((void *)fp, _sfil_read_png_file_fn, place);
return texture;

return NULL;

So, the Lib open the file as "read binary", so the erroro come from the path of the files?

I declared the load like this:
sf2d_texture *Act0 = sfil_load_PNG_file("romfs:/tex/spr_actbt_center_0.png", SF2D_PLACE_RAM);

Is this Ok?

(Sorry to bother you so much)


Oh, the files weren't at the good place

Main - Posts by Eclipse2212

Page rendered in 0.015 seconds. (2048KB of memory used)
MySQL - queries: 22, rows: 65/65, time: 0.007 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.