Skip to content

Instantly share code, notes, and snippets.

@Epicpkmn11
Created October 7, 2022 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Epicpkmn11/c7fe962bc04ad385a9761d6cc945939c to your computer and use it in GitHub Desktop.
Save Epicpkmn11/c7fe962bc04ad385a9761d6cc945939c to your computer and use it in GitHub Desktop.
//---------------------------------------------------------------------------------
#include <nds.h>
#include <stdio.h>
//Include the font header generated by grit
#include "font.h"
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
const int tile_base = 0;
const int map_base = 20;
videoSetModeSub(MODE_0_2D);
vramSetBankC(VRAM_C_SUB_BG);
PrintConsole *console = consoleInit(0,0, BgType_Text4bpp, BgSize_T_256x256, map_base, tile_base, false, false);
ConsoleFont font;
font.gfx = (u16*)fontTiles;
font.pal = (u16*)fontPal;
font.numChars = 256;
font.numColors = fontPalLen / 2;
font.bpp = 4;
font.asciiOffset = 0;
font.convertSingleColor = false;
consoleSetFont(console, &font);
iprintf("Custom Font Demo\n");
iprintf(" by Poffy\n");
iprintf("modified by WinterMute\n");
iprintf("for libnds examples\n");
iprintf("\xBA\xDA\xCA \xC3\xBD\xC4 \xC3\xDE\xBD\xA1\n"); // コレハ テスト デス。 in JIS X 0201
while(1) {
swiWaitForVBlank();
scanKeys();
int keys = keysDown();
if(keys & KEY_START) break;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment