mfc-badge/source/main.cpp

56 lines
1.2 KiB
C++

/*------------------------------------------------------------------------------
MFC NDS Conbadge
Kitsch 2024
------------------------------------------------------------------------------*/
#include <stdio.h>
#include <nds.h>
#include <filesystem.h>
#include <nf_lib.h>
int main(int argc, char **argv) {
//prepare a NitroFS initialization screen
NF_Set2D(0, 0);
NF_Set2D(1, 0);
consoleDemoInit();
printf("\n NitroFS init. Please Wait.\n\n");
swiWaitForVBlank();
//initialize NitroFS and set it as the root folder of the filesystem
nitroFSInit(NULL);
NF_SetRootFolder("NITROFS");
//initialize 2D engine in both screens and use mode 5
NF_Set2D(0, 5);
NF_Set2D(1, 5);
//initialize bitmap backgrounds system
NF_InitBitmapBgSys(0, 1);
NF_InitBitmapBgSys(1, 1);
//initialize storage buffers
NF_Init16bitsBgBuffers();
//load bitmap background files from NitroFS
NF_Load16bitsBg("bmp/badge_01", 0);
//transfer image to VRAM of both screens
NF_Copy16bitsBuffer(0, 0, 0);
NF_Copy16bitsBuffer(1, 0, 0);
//it'se not needed anymore so remove it from RAM
NF_Unload16bitsBg(0);
while (1) {
swiWaitForVBlank();
}
return 0;
}