Game Boy Color >> C/C++

Font


參考資訊:
1. bgb
2. doc
3. gbdk_playground

Font Functions

extern UINT8 font_ibm[];
extern UINT8 font_min[];
extern UINT8 font_spect[];
extern UINT8 font_italic[];

void font_init(void) NONBANKED;
font_t font_load(void *font) NONBANKED;
font_t font_set(font_t font_handle) NONBANKED;

main.c

#include <stdio.h> 
#include <gb/gb.h>
#include <gb/cgb.h>
#include <gb/font.h>
 
unsigned short palette[] = {RGB_WHITE, RGB_RED, RGB_GREEN, RGB_BLUE};

void main(void)
{
    font_init();
    font_set(font_load(font_spect));
    set_bkg_palette(0, 1, palette);
    printf("New font!");
}

完成


返回上一頁