Homebrew Development

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

  1. B_E_P_I_S_M_A_N

    B_E_P_I_S_M_A_N I have graced this thread with my presence.

    Member
    749
    2,758
    Jun 7, 2016
    United States
    Sixth Circle of Hell
    Quick question; I'm trying to compile Jansson (found here in the PortLibs: https://github.com/devkitPro/3ds_portlibs/). I followed the instructions, updated my Makefile, and double-checked that everything was installed to $DEVKITPRO/portlibs/armv6k, but whenever I try to compile my program, I end up with this:

    Code:
    In file included from /home/fluffy/Documents/Projects/3DS-VN-Engine/source/main.cpp:7:0:
    /home/fluffy/Documents/Projects/test/source/test.hpp:6:21: fatal error: jansson.h: No such file or directory
    compilation terminated.
    
    Are there any paths I need to set before it compiles, or is there something wrong with my installation? Any help would be appreciated.

    EDIT: Nevermind, it was in issue with the Makefile. Just set LIBDIRS to

    Code:
    LIBDIRS = $(PORTLIBS) $(CTRULIB)
    
    I believe I asked this question before. Heh.
     
    Last edited by B_E_P_I_S_M_A_N, Aug 1, 2017


  2. Pikachuk

    Pikachuk GBAtemp Advanced Fan

    Member
    649
    149
    Mar 19, 2016
    France
    Bordeaux
    i'd like to use stereoscopic 3d with sdl by adding a z axis to the sdl structures
    but i'd like to know how to manage the 3d to allow the 3ds to make the specified pixels 3d depending on the axis
     
  3. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    806
    296
    Jul 28, 2008
    United States
    The 3d effect requires creating a left and right image with objects at different offsets and sizes based on distance. This can be done with the 3d hardware by rendering a 3d scene twice using two different viewpoints. Or it can be accomplished by updating the framebuffer directly with different layers or objects adjusted for each viewpoint.
     
  4. Pikachuk

    Pikachuk GBAtemp Advanced Fan

    Member
    649
    149
    Mar 19, 2016
    France
    Bordeaux
    since i'm using sdl for 3ds, i guess i'll have to modify directly the sdl source, it uses libcitro3d
    does libcitro3d has options to manage the stereoscopic 3d ?
     
  5. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    806
    296
    Jul 28, 2008
    United States
    Yes, though I suspect you will need to adjust the viewpoint (position, projection, etc. ) for each frame manually.
     
  6. nop90

    nop90 GBAtemp Maniac

    Member
    1,421
    2,128
    Jan 11, 2014
    Italy
    Rome
    You could do it but It would be better to handle the x offset for the 2 screens with custom code, so the only change to the SDL lib would be to have two main surfaces to draw on. Or like I did for top screen and bottom screen, you could have a big surface with half rendered on the left screen, and the other half on the bottom screen.

    SDL uses citro3d only for a fast draw from the buffer to the phisical screen. And SDL is a 2d lib so you can't modify it to draw 3d objects, but only to have different deep effects for 2d objects.

    If you want 3d drawing you should use open GL. There is an unfinished open GL wrapper for citro3d, but never tested it.
     
  7. Pikachuk

    Pikachuk GBAtemp Advanced Fan

    Member
    649
    149
    Mar 19, 2016
    France
    Bordeaux
    actually i'm already working like this, the rendering works with one main surface of 411x480 the top screen uses a surface of 411x240 blitted on the top and the bottom screen a surface of 320x240 blitted on the bottom and centered on the x axis

    actually i don't want 3d rendering, just a deep effect

    for the 3d effect i was expecting to have to render two images for the top screen and ajust the x values the z would be a managed value per game object the manager would use this value to set the correct x value on each screen

    actually i just don't know how i should render the two surfaces to the stereoscopic screen (not blitting them on each other but rendering one on the left side and the other on the right side for the 3d)
     
  8. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

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

    Our Patreon
    796
    218
    Oct 6, 2015
    Antarctica
    Ylisse
    How would I make a random number generator?
     
  9. JustANoob;)

    JustANoob;) Member

    Newcomer
    14
    4
    Feb 12, 2016
    United States
    Computer
    You mean actually making or just using a generator?
    If you mean using, rand() is simple enough and Wikipedia is a good place to check if you want to make one.
     
  10. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

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

    Our Patreon
    796
    218
    Oct 6, 2015
    Antarctica
    Ylisse
    It seems whenever I press start with my home-brew I'm developing, it returns to the home menu rather than the home-brew menu. How would I fix this?
     
  11. nop90

    nop90 GBAtemp Maniac

    Member
    1,421
    2,128
    Jan 11, 2014
    Italy
    Rome
    Probably your code misses to close some processes (e.g. romfs) befor exiting and the system crashes. This is The only reason I'm aware of a 3dsx returning to 3ds menu (with a rebout) instead to HBL menu.

    Show an example of homebrew of yours to have more hints.
     
  12. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

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

    Our Patreon
    796
    218
    Oct 6, 2015
    Antarctica
    Ylisse
    Here's a simplified version of my code.
    Code:
    #include <string>
    
    #include <3ds.h>
    #include <sf2d.h>
    #include <sfil.h>
    
    #include "topscr_png.h"
    
    using namespace std;
    
    int main() {
        aptInit();
        sf2d_init();
        sf2d_texture* topScreen       = sfil_load_PNG_buffer(topscr_png,        SF2D_PLACE_RAM);
        // Main loop
        while (aptMainLoop()) {
            hidScanInput();
            u32 kDown = hidKeysDown();
            u32 kHeld = hidKeysHeld();
            u32 kUp = hidKeysUp();
            if (kDown & KEY_START) {
                break;
            }
            // draw instructions
            sf2d_start_frame(GFX_TOP, GFX_LEFT);
            sf2d_draw_texture(topScreen, 0, 0);
            sf2d_end_frame();
            sf2d_swapbuffers();
        }
        sf2d_free_texture(topScreen);
        sf2d_fini();
        aptExit();
        return 0;
    }
    
     
  13. nop90

    nop90 GBAtemp Maniac

    Member
    1,421
    2,128
    Jan 11, 2014
    Italy
    Rome
    Your example works fine for me.

    Attached you can find the whole project, with a compiled 3dsx. Test it on your 3ds, and if has the same problem, than the reason is in your CFW/entryoint.

    If the compiled 3dsx works on your 3ds, compile again my sources and check if it has the same behaviour. If not the problem in in your toolchain.
     

    Attached Files:

  14. B_E_P_I_S_M_A_N

    B_E_P_I_S_M_A_N I have graced this thread with my presence.

    Member
    749
    2,758
    Jun 7, 2016
    United States
    Sixth Circle of Hell
    Just a question out of curiosity; are there any good debugging tools for the 3DS? I know there's Luma's Exception Handler, but it seems fairly low level, and more often than not, I find myself just disabling it and putting a bunch of print messages in my code.
     
  15. nop90

    nop90 GBAtemp Maniac

    Member
    1,421
    2,128
    Jan 11, 2014
    Italy
    Rome
    I do rhe same. Lot of printf and move a breakpoint (while(1)) in the code flow to check that everything works or to find a crash point.
     
  16. B_E_P_I_S_M_A_N

    B_E_P_I_S_M_A_N I have graced this thread with my presence.

    Member
    749
    2,758
    Jun 7, 2016
    United States
    Sixth Circle of Hell
    Hm. I may try that breakpoint method sometime. Thanks.
     
  17. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

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

    Our Patreon
    796
    218
    Oct 6, 2015
    Antarctica
    Ylisse
    It still crashes to the home menu. What's your entry point? I'm using b9s 1.2 with luma 8.1 and using the new hb menu injected into download play via rosalina.
     
  18. Jokshoks

    Jokshoks Newbie

    Newcomer
    1
    0
    Aug 7, 2017
    Netherlands
    Hey guys, i have an old 3ds on 11.4... i was wondering, is it possible to downgrade it to 11.3? Or is there allready a hombrew hack for 11.5? Consinder me a newby with this
     
  19. trainboy2019

    trainboy2019 GBAtemp Advanced Fan

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

    Our Patreon
    796
    218
    Oct 6, 2015
    Antarctica
    Ylisse
    Do you have CFW? If not, I'm pretty sure you're SOL at the moment.
    For the O3ds, there are no payloads, so the home-brew launcher won't work.
    The only way to get CFW on 11.4 right now is to get a hardmod.
     
  20. B_E_P_I_S_M_A_N

    B_E_P_I_S_M_A_N I have graced this thread with my presence.

    Member
    749
    2,758
    Jun 7, 2016
    United States
    Sixth Circle of Hell
    Alright, so, in order to get a better understanding of the 3DS's sound systems (and sound systems in general) while also trying to contribute to the community, I've been working on a sound library for use in games. Much of the code in said sound library is based off the sound systems in ctrulua (namely, this: https://github.com/ctruLua/ctruLua/blob/master/source/audio.c).

    Here's the link to what I've made thus far: https://github.com/BEPISMAN2/sound-thing

    While simply loading sounds into memory and playing them works beautifully, I've found trouble trying to get streaming to work. While streaming from the file technically works, the audio quality is horribly choppy. I've tried comparing my code to the code found in ctrulua several times, and for the life of me, I can't seem to understand what's causing the problem.

    Here's a snippet from the streaming code:
    here's the code

    Any help would be appreciated.