Homebrew Development

Discussion in '3DS - Homebrew Development and Emulators' started by aliak11, Jan 16, 2014.

  1. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    14
    Nov 24, 2014
    Italy
    Bologna
    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.

    — Posts automatically merged - Please don't double post! —

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

    TheCruel Developer

    Banned
    12
    Dec 6, 2013
    United States
    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.
     
  3. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    14
    Nov 24, 2014
    Italy
    Bologna
    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) :/
     
  4. daxtsu

    daxtsu GBAtemp Guru

    Member
    14
    Jun 9, 2007
    Antarctica
    Rinnegatamante likes this.
  5. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    14
    Nov 24, 2014
    Italy
    Bologna
    Thanks man, it did the trick (pretty strange anyway cause i'm still on devkitArm r42 :/ )
     
    daxtsu likes this.
  6. Lectem

    Lectem Member

    Newcomer
    1
    Nov 21, 2014
    France
    Well, it was made that way because ctrulib now has ref counting for services handles.
     
  7. Gelex

    Gelex Member

    Newcomer
    1
    Jan 17, 2016
    United States
    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.
     
  8. Gelex

    Gelex Member

    Newcomer
    1
    Jan 17, 2016
    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.
     
  9. Gocario

    Gocario GBAFail'd

    Member
    6
    Sep 5, 2015
    France
    Bourg Palette
    @Gelex I started to work on a simple manager for save backups. May it be useful for you!
    There is still some bugs (can't use title selector twice, red screen sometimes, yellow screen, etc)
     
    Last edited by Gocario, Jan 19, 2016
  10. Voxel

    Voxel Master of moonjumps

    Member
    14
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    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?
     
  11. Slashcash

    Slashcash GBAtemp Fan

    Member
    5
    Oct 15, 2015
    Italy
    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?
     
  12. Voxel

    Voxel Master of moonjumps

    Member
    14
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    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.
     
  13. daxtsu

    daxtsu GBAtemp Guru

    Member
    14
    Jun 9, 2007
    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.
     
    Voxel likes this.
  14. Voxel

    Voxel Master of moonjumps

    Member
    14
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    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?
     
  15. daxtsu

    daxtsu GBAtemp Guru

    Member
    14
    Jun 9, 2007
    Antarctica
    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).
     
  16. Voxel

    Voxel Master of moonjumps

    Member
    14
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    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...
     
  17. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    14
    Nov 24, 2014
    Italy
    Bologna
    lpp-3ds also has support for custom notifications with System.addNotification. If you want to give it a look, here's the source: https://github.com/Rinnegatamante/lpp-3ds/blob/master/source/luaSystem.cpp#L1514-L1541
     
    Voxel likes this.
  18. daxtsu

    daxtsu GBAtemp Guru

    Member
    14
    Jun 9, 2007
    Antarctica
    If you're on devkitARM r45 and ctrulib 1.0.0 or newer, you need to update makerom, as it'll just crash or generate invalid CIAs. Check my homebrew template repo: https://github.com/thedax/3DSHomebrewTemplate/tree/master/tools for a newer version (not updated for Mac or Linux yet).
     
    Voxel likes this.
  19. Voxel

    Voxel Master of moonjumps

    Member
    14
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Jun 27, 2015
    United Kingdom
    Got it working now! Thanks! :yay3ds:
     
    daxtsu likes this.
  20. suhaib10

    suhaib10 Member

    Newcomer
    1
    Jan 15, 2016
    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, Jan 20, 2016
Quick Reply
Draft saved Draft deleted
Loading...