Graphics/Printing/custom_font/source/main.c

//---------------------------------------------------------------------------------
#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 = 95;
        font.numColors =  fontPalLen / 2;
        font.bpp = 4;
        font.asciiOffset = 32;
        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");

        while(1) {
                swiWaitForVBlank();
        }

        return 0;
}
 全て クラス ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義
libndsに対してMon Apr 26 23:39:49 2010に生成されました。  doxygen 1.6.3