7
print("HELLO WORLD",9,9);
8
while(1){} //loop forever
13
void print(char* text,u16 x,u16 y){
15
u16* ScreenBase = (u16*)0x6004000;
16
ScreenBase = ScreenBase + x + y*32;
17
while ( *text != '\0' ){
19
*ScreenBase++ = (u16)*text-'A'+1;
26
REG_DISPCNT = (MODE0 | BG2_ENABLE); //this sets the screen mode to mode 0 and enables background 2
28
// 256 colors and charscreenbase 0, screenbase 8
29
// default size is 256x256 pixel
30
REG_BG2CNT = (1 << 7 | 0 << 2 | 8 << 8);
33
u16* palDest=(u16*)BGPaletteMem; //0x5000000
34
u16* palSource = (u16*)Master_Palette;
35
// copy the palette info (256 colors a 15/16 Bit) into the desired address
38
*palDest++ = *palSource++;
41
// copy the tiles to charbase 0, (0x6000000 start of the videobuffer)
42
u16* fontDest = (u16*)VideoBuffer; //this is the start of video memory
43
u16* fontSource = (u16*)font_Tiles;
46
*fontDest++ = *fontSource++;