Homebrew Development

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

  1. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    but i changed it to get all the sounds from romfs

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

    wait crap your right, i read that wrong. one second
     
  2. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    pushed a new commit @nop90 which should use all the proper filenames n stuff, can you try it?
     
  3. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    Not now, sorry.
     
  4. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    dang. it doesnt work for me, im getting sorta frustrated lol.
     
  5. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    Tested the 3dsx file compiled from your updated code on my new3ds and the sound works, but the sounds file seem bad encoded.

    In the wwekend I can test the difference loading the files from the SD, if any.
     
    Last edited by nop90, Feb 8, 2018
  6. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    but it worked! Im going to have to test CIA, but thats super hype for me lol
     
  7. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    I had time to check the code again, and the problem for the weird sound is the one I reported previously, you pass to CSND a wrong sound size.

    Change the code as below

    Code:
    void loadSound(Sound * snd, char * filename){
        FILE *file = fopen(filename, "rb");
        if(file != NULL){
            fseek(file, 0, SEEK_END);
            snd->size = ftell(file)/2;
           fseek(file, 0, SEEK_SET);
            snd->buffer = linearAlloc(snd->size*sizeof(u16));
           fread(snd->buffer, 1, snd->size, file);
        }
        fclose(file);
    }
    
    For me this fix the 3dsx build.
     
  8. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    alright ill try that. thanks! Btw, do you know how i can ensure that the music pauses when you press the home button? on the CIA build and such if you go to the home menu without properly pressing "exit" sound will keep playing until you launch something else.
     
  9. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    Can't remember at the moment, I'll check my SDL port code.

    The answer should be somewher in this thread anyway, if you can't wait try searching all my old posts.
     
  10. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    will do, thanks
     
  11. ElijahZAwesome

    ElijahZAwesome Hey. I exist. Woo

    Member
    5
    Jul 12, 2016
    United States
    Narnia
    Still can't find anything, and google never seems to help with this, or maybe i just don't know what to google. Can nop90 or anyone really refer me to a place where I can learn to fix this problem, or really any homebrew problem in general? Docs would be great.
     
  12. trainboy2019

    trainboy2019 GBAtemp Maniac

    Member
    4
    GBAtemp Patron
    trainboy2019 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Oct 6, 2015
    United States
    GA
    Could someone help? I keep getting this error when I run make.
    Warning: Spoilers inside!
     
  13. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    You can't sue exceptions with 3ds toolchain configuration.

    You can try to change the code using old style error handling.
     
  14. trainboy2019

    trainboy2019 GBAtemp Maniac

    Member
    4
    GBAtemp Patron
    trainboy2019 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Oct 6, 2015
    United States
    GA
    I was asking what does this error mean, what caused it, and how can I fix it? Also, what's old style error handling? Try/catch blocks?
     
  15. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    this means that in the code you can'y use exceptions (i.e try/catch)

    the -fno-exceptions in your makefile

    you can't (at least if ctrulib isn't deeply changed in the last six months). If you don't beleve me, remove the -fno-exceptions flag.

    old style is to use some integer return values (usually negative ones) to signal an error inside a function. An other ugly method could be to use global variables, but do this only as last option.
     
  16. trainboy2019

    trainboy2019 GBAtemp Maniac

    Member
    4
    GBAtemp Patron
    trainboy2019 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Oct 6, 2015
    United States
    GA
    I just pushed the source to github, if you could tell me where I went wrong, that would be very helpful. https://github.com/trainboy2019/Platformer
     
  17. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    I don't like to be rude, and usually I try to give all the support I can, but this is the third time you ask the same thing.

    You are wrong exactly in the point reported by the compiler:
    Code:
    /Users/user/Desktop/3DSBREWMAKER/Platformer/source/jsoncpp.cpp:2618:25: error: exception handling disabled, use -fexceptions to enable
    
    throw RuntimeError(msg);
    
    I hope you can read it. It reports:
    - file jsoncpp.cpp
    - row 2618
    - col 25

    the problem is using throwRuntimeError(...), and it's used in several points (only the first one is reported).

    As I already said, you can't use exceptions, and throwRuntimeError(...) throws an exception :O.

    For learning what's an exceprion, use google

    PS: sorry to be have been rude, today is a bad day and I need someone to (virtually) punch :rofl2:. If you need ask more.

    PPS: for a quick and dirty hack, try to comment all the throwRuntimeError(...). This way error handling will be disabled (with the risk of the app crashing), but you could be lucky.
     
  18. ghjfdtg

    ghjfdtg Advanced Member

    Newcomer
    2
    Jul 13, 2014
  19. nop90

    nop90 GBAtemp Advanced Maniac

    Member
    11
    Jan 11, 2014
    Italy
    Rome
    just googled for "site:gbatemp.net nop90 home menu homebrew developement"

    what you need is here https://gbatemp.net/threads/homebrew-development.360646/page-264#post-6968395

    you have to pause music after
    Code:
    case APTHOOK_ONSUSPEND:
    
    if you set a global variable to true there, in the mainloop you can check if the music is paused (just in case the game is restored after pressing home) and make it start again, clearing the global variable obviously.
    It's a code example. there is no advanced tutorial for coding on 3ds. Sorry.
     
    Last edited by nop90, Feb 10, 2018
    ElijahZAwesome likes this.
  20. MaiconErick

    MaiconErick GBAtemp Regular

    Member
    2
    Jan 4, 2016
    Brazil
    Is there a wait or pause command?
    I couldn't find more info about this.