Homebrew Homebrew Development

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy

Not latest release but i think this is the latest officially published (and i won't spend any time trying to compile it so...), thank you.

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

Looks like it still crashes :/ what can be the problem? (I already stripped the ELF).
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
It works with unstripped elfs now like 3dsxtool does. Though it really shouldn't crash if they're stripped, I'd consider that a bug.

I tried both with unstripped or stripped files and it crashes everytime. File is not huge (3dsx file is 561 kb, stripped elf 627 kb, i definitely compiled bigger homebrews in CIA format like CHMM2) :/
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
  • Like
Reactions: daxtsu

Lectem

Active Member
Newcomer
Joined
Nov 21, 2014
Messages
43
Trophies
0
Age
30
XP
135
Country
France
Aaah, that makes sense, especially with fsUseSession() being initialized to false (so that the SD access still goes to the original handle). I wish somewhere anything would have mentioned that every archive needs its own handle. The great refactor made me think that wasn't needed anymore.

The current approach of overriding the current session feels cludgy. I would have much rather preferred manually providing handles, and allowing that parameter be NULL so that a default is used. That's just my personal taste, though. Thanks for the insight.
Well, it was made that way because ctrulib now has ref counting for services handles.
 

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
Well, it was made that way because ctrulib now has ref counting for services handles.
This makes sense if in general there only needs to be a single handle per service, but this doesn't seem to be the case for the Filesystem service. Again, for oot3dhax_installer, I had to use fsUseSession() and its counterpart to be able to get a second handle that could then open an Archive to manage access to OOT's save data.

If you don't mind indulging another question, while porting svdt to ctrulib-1.0 I encountered more Filesystem issues. In particular, svdt reads the title of carts, and I was unable to get any fs:USER handle that wasn't the main one (the reference counted one, returned by fsGetSessionHandle()) to open a file to read from the game cart directly. If I tried to use any other handle, I'd get error 0xD9004676 (3dsbrew says this is essentially a permission denied error). I was forced to use fsEndUseSession() to have the main handle be the one visible to FSUSER_* functions when I wanted to access the game cart, then I had to restore the handle associated with the save file Archive (another call to fsUseSession()) so that future reads and writes to that archive worked.

What exactly is going on with all of these handles? Why are there only some things that the one returned by fsGetSessionHandle() can do? Is there any good documentation about what all of this is? 3dsbrew tries to explain it, but doesn't say what Archives actually are or represent.
 

Gelex

Member
Newcomer
Joined
Jan 17, 2016
Messages
14
Trophies
0
XP
78
Country
United States
I got my answer in the 3dsdev development IRC channel. The answer has to do with permissions. The handle that the homebrew apps use by default originally comes from the Homemenu, and brings with it the permissions of the Homemenu. This is why things HBL can see, like the game cart title information, are accessible to that handle, but the save data for the game is only available once the process is launched, which is why the homemenu handle can't see it. Just thought I'd document my findings (and what I was told in the IRC) in case it helps someone else.
 
D

Deleted User

Guest
Has anyone managed to get NEWS_AddNotification working yet? (for custom notifications). I noticed in news.h of ctrulib that there was a function to add a notification like this, but I'm not sure how to exactly use it:
Code:
Result NEWS_AddNotification(const u16* title, u32 titleLength, const u16* message, u32 messageLength, const void* imageData, u32 imageSize, bool jpeg);
Any ideas?
 

Slashcash

Well-Known Member
Member
Joined
Oct 15, 2015
Messages
338
Trophies
0
XP
611
Country
Italy
Has anyone managed to get NEWS_AddNotification working yet? (for custom notifications). I noticed in news.h of ctrulib that there was a function to add a notification like this, but I'm not sure how to exactly use it:
Code:
Result NEWS_AddNotification(const u16* title, u32 titleLength, const u16* message, u32 messageLength, const void* imageData, u32 imageSize, bool jpeg);
Any ideas?

Didn't check the documentation myself but that signature looks self-explanatory. It takes a 16bit string as a title, an int with the titlelenght, same thing with the actual message. Than a raw pointer to the image data, i suppose you should pass true or false as last parameter depending on if you are pointing to a jpeg image or not. What's the difficulty?
 
D

Deleted User

Guest
Didn't check the documentation myself but that signature looks self-explanatory. It takes a 16bit string as a title, an int with the titlelenght, same thing with the actual message. Than a raw pointer to the image data, i suppose you should pass true or false as last parameter depending on if you are pointing to a jpeg image or not. What's the difficulty?
I've not been doing much coding recently, so things have been a bit confusing for me as I've got back into the coding spirit. Basically, I'm stuck at the usage of the 16-bit strings, and the 32-bit message length thing. I'm not sure exactly what a 16/32-bit string is, but I'm gonna google it now.
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
In C code you could probably use it like this (assuming no picture):

Code:
NEWS_AddNotification(L"Hello, Title!", 13, L"Hello, body of message!", 23, NULL, 0, false);

Of course, use proper string length functions and not magic numbers like that, but passing NULL for the image data, zero for the size, and false for the jpeg boolean should suffice. Note that I've not tested this myself, but it should be alright.
 
  • Like
Reactions: Deleted User
D

Deleted User

Guest
In C code you could probably use it like this (assuming no picture):

Code:
NEWS_AddNotification(L"Hello, Title!", 13, L"Hello, body of message!", 23, NULL, 0, false);

Of course, use proper string length functions and not magic numbers like that, but passing NULL for the image data, zero for the size, and false for the jpeg boolean should suffice. Note that I've not tested this myself, but it should be alright.
Thanks, daxtsu. I'll give this a try. Hope it works! (I know I have to initialize the news service first by doing newsInit() first, don't I?)

Edit: Also, don't I have to close it off by putting NewsExit() at the end, as well?
 

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
Thanks, daxtsu. I'll give this a try. Hope it works! (I know I have to initialize the news service first by doing newsInit() first, don't I?)

Edit: Also, don't I have to close it off by putting NewsExit() at the end, as well?

You do, but note that ctrulib will try to get news:u first instead, and only if that fails, will it try news:s. Assuming you're using a CIA for this, you can change the RSF to have access to news:s instead of news:u and it should work straight away. If you're using a 3dsx file, I'm not entirely sure if you get access to that service or not (someone tell me if you do/don't).
 
D

Deleted User

Guest
You do, but note that ctrulib will try to get news:u first instead, and only if that fails, will it try news:s. Assuming you're using a CIA for this, you can change the RSF to have access to news:s instead of news:u and it should work straight away. If you're using a 3dsx file, I'm not entirely sure if you get access to that service or not (someone tell me if you do/don't).
I think *hax 2.5 can get access to the news:u service. (maybe news:s, I'm not sure)
Also, I've been trying to get CIA compilation working over the past few weeks, but steveice10's makerom just isn't working for some reason...
 

Rinnegatamante

Well-Known Member
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
  • Like
Reactions: Deleted User

daxtsu

Well-Known Member
Member
Joined
Jun 9, 2007
Messages
5,627
Trophies
2
XP
5,194
Country
Antarctica
  • Like
Reactions: Deleted User

suhaib10

Active Member
Newcomer
Joined
Jan 15, 2016
Messages
32
Trophies
0
XP
60
Country
Canada
Hey can someone please help me out, I am trying to compile ninjhax2.x but i keep getting this error.
Code:
Makefile:6: *** "Please set CTRULIB in your environment. export DEVKITARM=<path to>ctrulib/libctru".  Stop.
Currently I am running Linux Mint17.1(ubuntu 14.04) i have devpro setup and its working(compiled reinand fine). I tried placing the ctrulib in the devpro directory and setting the path but it still wont work.
Anyone know how to fix this ?

EDIT: Fixed it. Manually cleaned bashrC (removing duplicates), re added ctrulib and need a REBOOT.
 
Last edited by suhaib10,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: Apply snorgle to pinfor.