Homebrew Homebrew Development

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,791
Country
Spain
Load the code somewhere (e.g. github) and I'll look into it.

It seems the problem is using "Romfs" path in .cia. E.g: #define IMG_MONKEY_SPRITE "romfs:/resources/Art/Monkey.png". You can check the code on my github: https://github.com/Manurocker95/Evolution_Sav3D_Me

I know that's the problem, cz modifying the paths to sdmc:/ and putting the files there, works.
 
Last edited by Manurocker95,

RocketRobz

Stylish TWiLight Hero
Developer
Joined
Oct 1, 2010
Messages
16,593
Trophies
3
Age
24
XP
20,971
Country
United States
I'm trying to use .JPG images in TWLoader, but I'm getting this:
Code:
c:/devkitPro/libctru/lib\libsfil.a(sfil_jpeg.o): In function `_sfil_load_JPEG_generic':
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:9: undefined reference to `jpeg_start_decompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:36: undefined reference to `jpeg_read_scanlines'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:46: undefined reference to `jpeg_finish_decompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:55: undefined reference to `jpeg_abort_decompress'
c:/devkitPro/libctru/lib\libsfil.a(sfil_jpeg.o): In function `sfil_load_JPEG_file':
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:70: undefined reference to `jpeg_std_error'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:71: undefined reference to `jpeg_CreateDecompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:72: undefined reference to `jpeg_stdio_src'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:73: undefined reference to `jpeg_read_header'
 

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,791
Country
Spain
I'm trying to use .JPG images in TWLoader, but I'm getting this:
Code:
c:/devkitPro/libctru/lib\libsfil.a(sfil_jpeg.o): In function `_sfil_load_JPEG_generic':
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:9: undefined reference to `jpeg_start_decompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:36: undefined reference to `jpeg_read_scanlines'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:46: undefined reference to `jpeg_finish_decompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:55: undefined reference to `jpeg_abort_decompress'
c:/devkitPro/libctru/lib\libsfil.a(sfil_jpeg.o): In function `sfil_load_JPEG_file':
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:70: undefined reference to `jpeg_std_error'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:71: undefined reference to `jpeg_CreateDecompress'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:72: undefined reference to `jpeg_stdio_src'
c:/disassemblies/3ds/sfillib-master/libsfil/source/sfil_jpeg.c:73: undefined reference to `jpeg_read_header'

Did you put -ljpg in the makefile?
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
It seems the problem is using "Romfs" path in .cia. E.g: #define IMG_MONKEY_SPRITE "romfs:/resources/Art/Monkey.png". You can check the code on my github: https://github.com/Manurocker95/Evolution_Sav3D_Me

I know that's the problem, cz modifying the paths to sdmc:/ and putting the files there, works.

The resources seems to be correctly packed in romfs inside the CIA file, and the code seems to be ok. If I have time kater I'll try to find the problem.

PS: compiling the code gives me an error
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
@Manurocker95

I fixed the compiling problem and 3dsx version works fine. To test the cia version I have to be at home tonight, but it should work (at least the romfs part)

If it doesn't work, one reason could be your makerom version: you're using an exe in your project folder instead of putting it in your devkitarm bin folder. Are you trying an updated version? because this way is not very clean.

Tonight I'll test the cia built with my makerom and with yours too.

Last thing, your CIA (when it will be working) will have problem handling home menu events. Look here: https://gbatemp.net/threads/homebrew-development.360646/page-264#post-6968395
 

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
Hi there everybody. I've a C question that I don't know the answer.
I've read a lot of times that most people use
Code:
#include "picture_jpeg.h"
and use
Code:
sfil_load_JPEG_buffer(picture_jpeg, picture_jpeg_size, SF2D_PLACE_RAM);
instead of
Code:
sfil_load_JPEG_file("romfs:/picture.jpeg", SF2D_PLACE_RAM);
Is there any advantage of using first method? What method is "better"?
Thanks :)
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Hi there everybody. I've a C question that I don't know the answer.
I've read a lot of times that most people use
Code:
#include "picture_jpeg.h"
and use
Code:
sfil_load_JPEG_buffer(picture_jpeg, picture_jpeg_size, SF2D_PLACE_RAM);
instead of
Code:
sfil_load_JPEG_file("romfs:/picture.jpeg", SF2D_PLACE_RAM);
Is there any advantage of using first method? What method is "better"?
Thanks :)

The main difference is that with the header file, the resource data are statically inserted in the executable, making it bigger (with slightly bigger boot time, usually not noticeable), while with the romfs the data are accessed only at run time and can be placed in the heap (at runtime too).

In my coding experience with the 3ds I often found problems accessing large static arrays from some parts of the code, so when I have to load a lot of resources I prefer to use the romfs.
 
Last edited by nop90,
  • Like
Reactions: umbjolt

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
The main difference is that with the header file, the resource data are statically inserted in the executable, making it bigger (with slightly bigger boot time, usually not noticeable), while with the romfs the data are accessed only at run time and can be placed in the heap (at runtime too).

Im my coding experience with the 3ds I often found problems accessing large static arrays from some parts of the code, so when I have to load a lot of resources I prefer to use the romfs.

Now I understand!
Thanks @nop90 ;)
 

Hayleia

Well-Known Member
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
The main difference is that with the header file, the resource data are statically inserted in the executable, making it bigger (with slightly bigger boot time, usually not noticeable), while with the romfs the data are accessed only at run time and can be placed in the heap (at runtime too).

Im my coding experience with the 3ds I often found problems accessing large static arrays from some parts of the code, so when I have to load a lot of resources I prefer to use the romfs.
I already knew of the advantages of romfs, but I didn't answer because I didn't know if static arrays had an advantage over romfs. Do they really have none?
 

Kartik

Well-Known Member
Member
Joined
Jun 6, 2015
Messages
653
Trophies
0
Location
github
XP
2,747
Country
India
If it interests anyone,I have successfully made a imgur uploader for the 3ds.It currently can upload images which are less than 5mb and I planning to release it soon!!:yay3ds::D
 
Last edited by Kartik,

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,791
Country
Spain
@Manurocker95

I fixed the compiling problem and 3dsx version works fine. To test the cia version I have to be at home tonight, but it should work (at least the romfs part)

If it doesn't work, one reason could be your makerom version: you're using an exe in your project folder instead of putting it in your devkitarm bin folder. Are you trying an updated version? because this way is not very clean.

Tonight I'll test the cia built with my makerom and with yours too.

Last thing, your CIA (when it will be working) will have problem handling home menu events. Look here: https://gbatemp.net/threads/homebrew-development.360646/page-264#post-6968395

Yeah, the .3dsx works on citra and console, but the .cia seems not to work. I'm using a template, so I don't really know if I'm using the latest one :\

Whenever I get it working I'll take a look, thx! :)
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,791
Country
Spain

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
Testing on non-cfw o3ds, the romfs path is not working (3dsx nor cia). And I'm getting a command not found in makerom. Dunno why.

I think that the problem is that you are loading too many resources finishing the linear memory.

For the romfs folder, there are a lot of files not used from the game, you shoul put them elsewhere , leaving the romfs folder clead, so to have a final game file smaller.
 

Manurocker95

Game Developer & Pokémon Master
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
29
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,791
Country
Spain
I think that the problem is that you are loading too many resources finishing the linear memory.

For the romfs folder, there are a lot of files not used from the game, you shoul put them elsewhere , leaving the romfs folder clead, so to have a final game file smaller.

That makes no sense cz you can load the same resources from SD without issue :(
 

nop90

Well-Known Member
Member
Joined
Jan 11, 2014
Messages
1,556
Trophies
0
Location
Rome
XP
3,136
Country
Italy
That makes no sense cz you can load the same resources from SD without issue :(
It's not so strange, the romfs service could use some nemory to handle reading calls amd some cache maybe.

The main point is that the game works with the emulator and with the 3dsx, so the romfs is called correctly.

With the Cia version there are two big differences: the program that packs the Cia file (makerom) and the enviroment where the exec runs (the 3ds normal enviroment instead of the homebrew launcher)

For the makerom I used my version that I know works fine.

For the enviroment I had a game running with no problem with the 3dsx and finishing the linear memory with the Cia version.

I don't have time to fully debug your code, I'm only giving you a hint.

You could try to change all the wav files with dummy file of only 1 sec of music (to save memory) and see if this changes something.

When I port games to 3ds I often have to lower the quality.of the sound files to make them load.
Good luck, debugging on the 3ds is always a pain.
 
Last edited by nop90,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Xdqwerty @ Xdqwerty: @BakerMan, I have a piano keyboard but I never use it