Homebrew Homebrew app using NitroFS doesn't load correctly from stock DS/DSi Menu, loads fine from nds hbmenu and TwilightMenu++

Dionicio3

goat
OP
Member
Joined
Feb 26, 2017
Messages
4,046
Trophies
2
Age
20
Location
Hollister, CA
Website
dionicio3.com
XP
7,178
Country
United States
I'm trying to start developing some basic homebrew using NitroFS and NFLib, but I'm having issues getting a basic Hello World-type program running the way I want. Whenever I launch it with melonDS, either directly or by going through the DS Menu, I just get a black screen. Same thing happens when I boot it from the DSi Menu on a real DSi installed via NTM. However, if I boot into nds hbmenu on melonDS, or into TwilightMenu++ and launch it from there, it works fine. How do other homebrew programs that use NitroFS get around this issue?

This is what the program is supposed to do
1700869787042.png


C++:
#include <stdio.h>
#include <nds.h>
#include <filesystem.h>
#include <nf_lib.h>

volatile int frame = 0;

void Vblank() {
    frame++;
}

int main(int argc, char **argv) {
    consoleDemoInit();
    // turn on MODE 0 on the top screen
    NF_Set2D(0, 0);
    swiWaitForVBlank();

    // init nitroFS and set as root folder
    nitroFSInit(NULL);
    NF_SetRootFolder("NITROFS");

    // init tiled bg system on the top screen
    NF_InitTiledBgBuffers();
    NF_InitTiledBgSys(0);

    // init tiled sprites system on the top screen
    NF_InitSpriteBuffers();
    NF_InitSpriteSys(0);

    // Load our Tiled Sprite
    NF_LoadSpriteGfx("skiddo", 0, 16, 16);
    NF_LoadSpritePal("skiddo", 0);

    // transfer sprite to VRAM
    NF_VramSpriteGfx(0, 0, 0, false);
    NF_VramSpritePal(0, 0, 0);

    // create sprite
    NF_CreateSprite(0, 0, 0, 0, 0, 0);
    // print shit

    iprintf("Testing :)\n");
    while(true) {
        NF_SpriteOamSet(0);
        swiWaitForVBlank();
        oamUpdate(&oamMain);
        swiWaitForVBlank();
        /*scanKeys();
        int keys = keysDown();
        if (keys & KEY_A) {
            iprintf("A\n");
        }
        if (keys & KEY_B) {
            iprintf("B\n");
        }*/
    }
    return 0;
}
 

Dionicio3

goat
OP
Member
Joined
Feb 26, 2017
Messages
4,046
Trophies
2
Age
20
Location
Hollister, CA
Website
dionicio3.com
XP
7,178
Country
United States

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: Lol rappers still promoting crypto