2 * \file examples_oneThread.c
3 * \brief How to launch a thread with VP_SDK
6 ///////////////////////////////////////////////
13 volatile int frame = 0;
16 //---------------------------------------------------------------------------------
19 //---------------------------------------------------------------------------------
24 //---------------------------------------------------------------------------------
27 //---------------------------------------------------------------------------------
29 irqSet(IRQ_VBLANK, Vblank);
30 irqEnable(IRQ_VBLANK);
31 videoSetMode(0); //not using the main screen
32 videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text
33 vramSetBankC(VRAM_C_SUB_BG);
35 SUB_BG0_CR = BG_MAP_BASE(31);
37 BG_PALETTE_SUB[255] = RGB15(31,31,31); //by default font will be rendered with color 255
39 //consoleInit() is a lot more flexible but this gets you up and running quick
40 consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);
44 //---------------------------------------------------------------------------------
45 int main(int argc, char **argv)
47 //---------------------------------------------------------------------------------
48 touchPosition touchXY;
52 iprintf(" Hello DS dev'rs\n");
53 iprintf(" www.devkitpro.org\n");
54 iprintf(" www.drunkencoders.com");
59 touchXY=touchReadXY();
61 // print at using ansi escape sequence \x1b[line;columnH
62 iprintf("\x1b[10;0HFrame = %d",frame);
63 iprintf("\x1b[16;0HTouch x = %04X, %04X\n", touchXY.x, touchXY.px);
64 iprintf("Touch y = %04X, %04X\n", touchXY.y, touchXY.py);