Homebrew maximum code/data size for homebrew loader

elhobbs

Well-Known Member
OP
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Does anyone know if there is a maximum code or data size for for loading homebrew. I am working on a project with a fair amount of code and data and it is hanging at the red screen when loading. this occurs on both hax 1.1b and 2.5
Code:
$ arm-none-eabi-size.exe
   text    data     bss     dec 
2061296   42008 8955572 11058876

I am using std::map as well - I thought I saw a thread that mentioned issues with this but I cant seem to find it. if someone knows the issue then a link would be appreciated. thank you.
 

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,131
Country
United States
There are limits, and the limits can be overcome by specifying a target process in xml descriptor which uses a comparable amount of code.

I checked a sizable 3ds elf of mine:

Code:
   text      data       bss       dec       hex
2379656     25712     83088    2488456    25f888

Your bss is huge lol

Btw, I use std::map as well as vector, queue, and such STL containers. I'm not aware of any problem with these.
 
Last edited by TheCruel,

pdapanda

Well-Known Member
Member
Joined
Nov 19, 2014
Messages
730
Trophies
0
Age
32
XP
1,167
Country
Switzerland
there is indeed a limitation on the amount of code you can use for the menu, because it's meant to be able to run under any title and the smallest title we have by default is dlplay which only has about 588KB of RX memory available. you can have basically as much data as you want. unfortunately this limitation (which, again, only applies to the menu) is not about to go away in order to maximize compatibility with host titles, so it will be necessary for you to work with it. one easy thing you can do is compile non-performance-essential pieces of code as -Os.
for reference, portal3DS's code takes up less than 340KB without any kind of code size optimization, so it's entirely possible to fit complex programs within these limits.

Why not ask smea?
 

elhobbs

Well-Known Member
OP
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
There are limits, and the limits can be overcome by specifying a target process in xml descriptor which uses a comparable amount of code.

I checked a sizable 3ds elf of mine:

Code:
   text      data       bss       dec       hex
2379656     25712     83088    2488456    25f888

Your bss is huge lol

Btw, I use std::map as well as vector, queue, and such STL containers. I'm not aware of any problem with these.
good to know. Do you have any any info on the xml descriptor format or an example I could use as a reference?

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

Why not ask smea?
what is the best way to do that?
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
good to know. Do you have any any info on the xml descriptor format or an example I could use as a reference?

If you want to pick a title to launch under, you can do this:

Code:
<targets selectable="false">
<title mediatype="1">000400000015D800</title>
<title mediatype="1">000400000015B100</title>
</targets>

Mediatypes (correct me if I'm wrong, going off the top of my head):
0 = NAND
1 = SD
2 = Gamecard

Set selectable to true if you want the user to be able to pick, ala Save Manager/SVDT.

If you want to ask hax 2.x for specific services:

Code:
<services autodetect="false">
<request priority="1">soc:U</request>
</services>
 
Last edited by daxtsu,

elhobbs

Well-Known Member
OP
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
If you want to pick a title to launch under, you can do this:

Code:
<targets selectable="false">
<title mediatype="1">000400000015D800</title>
<title mediatype="1">000400000015B100</title>
</targets>

Mediatypes (correct me if I'm wrong, going off the top of my head):
0 = NAND
1 = SD
2 = Gamecard

Set selectable to true if you want the user to be able to pick, ala Save Manager/SVDT.

If you want to ask hax 2.x for specific services:

Code:
<services autodetect="false">
<request priority="1">soc:U</title>
</services>
ok, I feel like this creating more questions. sorry if I am being dense - but, how do I go about choosing a title id and why would I need to specify more than one?
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
ok, I feel like this creating more questions. sorry if I am being dense - but, how do I go about choosing a title id and why would I need to specify more than one?

If you specify titleids in the XML, the hax payload will automatically pick whichever one is applicable (so if you have the European ironfall on your system, in this example's case, it'll pick that one). Specifying more than one lets you cover multiple regions of the same game/app. For example, in my wifi toggle app, I used an XML file for a while that had every region's MSET's titleids in it so that it would automatically pick the correct one to launch as.
 

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,131
Country
United States
Code:
<services autodetect="false">
<request priority="1">soc:U</title>
</services>
Btw, The </title> should be </request>. I think this used to work, but has since changed and this flawed xml no longer works, it caused me pain before smea mentioned it.
 
  • Like
Reactions: daxtsu

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Btw, The </title> should be </request>. I think this used to work, but has since changed and this flawed xml no longer works, it caused me pain before smea mentioned it.

Thanks for the correction, I yanked it off Github from Rinnegatamante's one issue.
 

elhobbs

Well-Known Member
OP
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
ok - sadly, I think I need someone to spoon feed the answer to me. how do I go about picking a title to run under that will satisfy my code/data memory requirements?
 

GBAFail

Smell my finger.
Member
Joined
Oct 26, 2015
Messages
491
Trophies
0
Location
Uranus
XP
321
Country
United States
ok - sadly, I think I need someone to spoon feed the answer to me. how do I go about picking a title to run under that will satisfy my code/data memory requirements?
The monster hunter 4U special demo has the most executable memory available. Please note it can only be used to run homebrew on n3DS because it uses the extended memory mode. :D
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Laid at the party is fun unless you're in prison lol