Running 3DSX from Homebrew App

Discussion in '3DS - Homebrew Development and Emulators' started by JackMacWindows, Nov 23, 2016.

  1. JackMacWindows
    OP

    JackMacWindows Member

    Newcomer
    41
    20
    Jan 16, 2016
    United States
    Hello,
    I want to make a simple launcher for my CFW 3DS. I want to have the launcher load with menuhax, replacing CtrBootManager. When I hold the Y key it will boot to the homebrew menu, otherwise it will boot to Luma3DS. I currently have this code:
    Code:
    
    #include <stdio.h>
    #include <3ds.h>
    #include <unistd.h>
    
    PrintConsole screen, debug;
    template <class T>
    void sleep(T time) {usleep(time * 1000000);}
    
    int main() {
        gfxInitDefault();
        consoleInit(GFX_TOP, &debug);
        consoleInit(GFX_BOTTOM, &screen);
        consoleSelect(&screen);
        printf("Checking keys...\n");
        sleep(.25);
        hidScanInput();
        if ((hidKeysDown() & KEY_Y) || (hidKeysHeld() & KEY_Y)) {
            printf("Loading Homebrew Menu...");
            sleep(2);
            //run("boot.3dsx");
        } else {
            printf("Loading Luma3DS...");
            sleep(2);
            //run("luma.3dsx");
        }
        return 0;
    }
    
    I have been looking for source code to show how to load, and all I found was the boot.c from the homebrew launcher, but I get many build errors when I include it; and I have tried the CtrBootManager loader.c, which does not do anything. How can I boot the .3dsx files?
     
    Last edited by JackMacWindows, Nov 28, 2016