int main() { Bdisp_AllClr_VRAM(); Bdisp_EnableColor(1); // Initialize console 1. nio_console c1; // The screen can hold up to 64 columns and 27 rows // 64 columns, 14 rows. 0px offset for x/y. Background color 15 (white), foreground color 0 (black) nio_InitConsole(&c1,64,14,0,0, NIO_COLOR_BLACK, NIO_COLOR_WHITE); nio_DrawConsole(&c1); nio_console c2; nio_InitConsole(&c2,64,13,0,14*8, NIO_COLOR_BLACK, NIO_COLOR_WHITE); nio_DrawConsole(&c2); // Just showing printf nio_printf(&c1,"%s build at %s, %s\n",__FILE__,__DATE__,__TIME__); nio_printf(&c2,"256 text colors available! "); int i; for(i = 1; i<16; i++) { nio_SetColor(&c2, 0, i); nio_printf(&c2, "%d ", i); } nio_printf(&c2,"\n"); // Press EXE to exit while(1) { char text[100]; // If no text was entered, exit if(!nio_GetStr(&c1,text)) break; // Write the text into 2nd console nio_printf(&c2,"%s\n",text); //Bdisp_PutDisp_DD(); } nio_CleanUp(&c1); nio_CleanUp(&c2); return 0; }
int main() { char filename[50] = {'\0'}; //fileBrowser(filename, (unsigned char*)"*.lua", (unsigned char*)"*.lc", (unsigned char*)"*.txt", "Title"); //*.lua, *.lc, *.txt: filetypes to filter; "Title": small text to show in blue on the top left corner Exec_info exec_info = {0,0,0}; int key = 0, debug = 0, handle_program, i=0; char pc_s[10]; Bdisp_AllClr_VRAM(); srand(time_getTicks()); init_gui(); init_machine(); while(1) { handle_program = gui(exec_info); if(handle_program > 0) { init_machine(); load_game(handle_program); exec_info = play_game(); } else { while(i < 10) { nio_DrawConsole(&c1); GetKey(&key); i++; } i=0; } } nio_CleanUp(&c1); while(1) { GetKey(&key); } return 1; }
void dConsoleCleanUp() { nio_CleanUp(&csl); }