NightFox’s Lib
|
Functions related to error handling and other general settings. More...
Functions | |
__attribute__ ((noreturn)) void NF_Error(u32 code | |
Stops program execution and shows the error on the screen. More... | |
void | NF_SetRootFolder (const char *folder) |
Defines the root folder of your project (FAT or NitroFS). More... | |
void | NF_DmaMemCopy (void *destination, const void *source, u32 size) |
Function copy blocks of memory from RAM to VRAM fast. More... | |
Variables | |
char | NF_ROOTFOLDER [64] |
Root folder used by NFLib. | |
Functions related to error handling and other general settings.
__attribute__ | ( | (noreturn) | ) |
Stops program execution and shows the error on the screen.
This command is used internally by the lib to generate debug messages and it will rarely be used in you code.
101: File not found. 102: Not enough memory. 103: Not enough free slots. 104: Background not found. 105: Background not created. 106: Value outside of bounds. 107: Not enough contiguous blocks in VRAM (tiles). 108: Not enough contiguous blocks in VRAM (maps). 109: ID already used. 110: ID not loaded in RAM. 111: ID not loaded in VRAM. 112: Sprite not created. 113: Not enough VRAM. 114: Text layer doesn't exist. 115: Background dimensions are invalid (not multiple of 256). 116: File too big. 117: Affine background dimensions are invalid. 118: Affine creation layer is invalid.
code | Error code. |
text | Description. |
value | Additional info. |
void NF_DmaMemCopy | ( | void * | destination, |
const void * | source, | ||
u32 | size | ||
) |
Function copy blocks of memory from RAM to VRAM fast.
DMA copies from RAM to VRAM are the most efficient. The function checks if the data is aligned for the DMA copy. If not, it uses memcpy() insead.
Example:
destination | Destination pointer. |
source | Source pointer. |
size | Number of bytes to copy. |
void NF_SetRootFolder | ( | const char * | folder | ) |
Defines the root folder of your project (FAT or NitroFS).
This makes it easy to change the name of folder that contains all files of your project after it’s compiled. It’s imperative the use of this function before loading any file from FAT.
If you want to use NitroFS, use "NITROFS" as root folder name. You must configure your Makefile correctly to include the NitroFS files in your ROM. When using a flashcard, it must support argv. Use Homebrew Menu to launch the ROM if your flashcard doesn't support it.
Example:
folder |