//! Testing rendering speeds. void test_speeds() { irq_init(NULL); irq_add(II_VBLANK, NULL); gFont= vwf_default; int ii; const char *str= glados[0]; int len= strlen(str); for(ii=0; ii<countof(gProfs); ii++) { gProfs[ii].proc(&gProfs[ii], str); key_wait_till_hit(KEY_ANY); } RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE0 | DCNT_BG2; tte_init_se_default(2, BG_CBB(0) | BG_SBB(24)); tte_init_con(); pal_bg_bank[14][1]= CLR_ORANGE; iprintf("%d\n", len); for(ii=0; ii<countof(gProfs); ii++) { tte_set_special(SE_PALBANK(14+(ii&1))); iprintf("%-17s %6d %d\n", gProfs[ii].str, gProfs[ii].time, gProfs[ii].time/len); } key_wait_till_hit(KEY_START); }
void prof_null_drawg(TProfiler *prof, const char *str) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE3 | DCNT_BG2; tte_init_bmp(3, &gFont, null_drawg); prof_draws(prof, str); }
void prof_bmp16_base(TProfiler *prof, const char *str, fnDrawg proc) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE3 | DCNT_BG2; tte_init_bmp(3, &gFont, proc); prof_draws(prof, str); }
void prof_obj_drawg(TProfiler *prof, const char *str) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE0 | DCNT_OBJ | DCNT_OBJ_1D; tte_init_obj(&oam_mem[127], ATTR0_TALL, ATTR1_SIZE_8, 0, CLR_YELLOW, 0, &gFont, obj_drawg); prof_draws(prof, str); }
void prof_bmp8_base(TProfiler *prof, const char *str, fnDrawg proc) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE4 | DCNT_BG2; vid_page= vid_mem; tte_init_bmp(4, &gFont, proc); prof_draws(prof, str); }
void prof_chr4c_base(TProfiler *prof, const char *str, fnDrawg proc) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE0 | DCNT_BG2; tte_init_chr4c(2, BG_CBB(0)|BG_SBB(24), 0xF000, 0x0201, CLR_YELLOW, &gFont, proc); prof_draws(prof, str); }
void prof_ase_drawg(TProfiler *prof, const char *str) { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE1 | DCNT_BG2; int charH= gFont.charH; gFont.charH= 16; const u8 *widths= gFont.widths; gFont.widths= NULL; tte_init_ase(2, BG_CBB(0)|BG_SBB(24) | BG_AFF_32x32, 0, CLR_YELLOW, 0, &gFont, ase_drawg); prof_draws(prof, str); gFont.charH= charH; gFont.widths= widths; }
//--------------------------------------------------------------------------------- // Program entry point //--------------------------------------------------------------------------------- int main(void) { //--------------------------------------------------------------------------------- RegisterRamReset(RESET_PALETTE | RESET_VRAM | RESET_OAM); // the vblank interrupt must be enabled for VBlankIntrWait() to work // since the default dispatcher handles the bios flags no vblank handler // is required irqInit(); irqEnable(IRQ_VBLANK); irqEnable(IRQ_HBLANK); irqSet(IRQ_HBLANK, hblankHandler); videoInitMode0(); while (1) { VBlankIntrWait(); } }
void CreditDevkitArmandtonc() { RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE0 | DCNT_BG0; tte_init_chr4c(0, // BG 0 BG_CBB(0)|BG_SBB(31), // Charblock 0; screenblock 31 0xF000, // Screen-entry offset bytes2word(1,2,0,0), // Color attributes. CLR_WHITE, // White text &verdana9Font, // Verdana 9 font NULL ); vid_vsync(); tte_write("#{P:35,60}Credit to Wintermute for devkitARM!\n"); tte_write("#{P:35,70}Credit to Cern for Tonc!"); waitsecs(7); }
void MainMenu() { //This function brings up the main menu and has it do stuff. RegisterRamReset(RESET_GFX); REG_DISPCNT= DCNT_MODE0 | DCNT_BG0; tte_init_chr4c(0, // BG 0 BG_CBB(0)|BG_SBB(31), // Charblock 0; screenblock 31 0xF000, // Screen-entry offset bytes2word(1,2,0,0), // Color attributes. CLR_WHITE, // White text &verdana9Font, // Verdana 9 font NULL ); vid_vsync(); draw_main_menu(); while(1){ vid_vsync(); mmFrame(); key_poll(); //This code is still being worked on but it will handle what is selected on the menu. if (key_hit(KEY_DOWN)){ mainmenuselected++; if (mainmenuselected > 3){ mainmenuselected = 3; } draw_main_menu(); }else if (key_hit(KEY_UP)){ mainmenuselected = mainmenuselected - 1; if (mainmenuselected < 0){ mainmenuselected = 0; } draw_main_menu(); }else if (key_hit(KEY_B)){ }else if (key_hit(KEY_A)){ if (mainmenuselected == 0){ biosdump(); vid_vsync(); draw_main_menu(); }else if (mainmenuselected == 1){ buttontest(); vid_vsync(); draw_main_menu(); }else if (mainmenuselected == 2){ RTC_Main(); vid_vsync(); draw_main_menu(); }else if (mainmenuselected == 3){ soundtest(); vid_vsync(); draw_main_menu(); } } } }