int main(int argc, char** argv) { std::list<std::string> args(argv, argv + argc); showIntro(); parseArguments(args); findDataDirectory(); const EGLint configAttrs[] = { EGL_BUFFER_SIZE, options.bitsPerPixel, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE }; const EGLint configAttrs32[] = { EGL_BUFFER_SIZE, 32, EGL_NONE }; const EGLint contextAttrs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; int winWidth = 800; int winHeight = 480; const float w = winWidth, h = winHeight; EGLConfig config32 = 0; EGLint configCount = 0; bool result = nativeCreateDisplay(&ctx.nativeDisplay); ASSERT(result); nativeGetScreenSize(ctx.nativeDisplay, &winWidth, &winHeight); result = initializeEgl(winWidth, winHeight, configAttrs, contextAttrs); ASSERT(result); eglChooseConfig(ctx.dpy, configAttrs32, &config32, 1, &configCount); if (!configCount) { printf("32bpp config not found\n"); } glPixelStorei(GL_UNPACK_ALIGNMENT, 1); ASSERT_GL(); #define ADD_TEST(TEST) runTest(*std::auto_ptr<Test>(new TEST)); #include "tests.inl" #undef ADD_TEST terminateEgl(); }
void initProgram() { //------------------------ // start initializing crap //------------------------ defaultExceptionHandler(); // set up the exception handler powerON(POWER_ALL_2D); // turn on everything #ifndef DEBUG_MODE fb_init(); // initialize top screen video #else debugInit(); #endif bg_init(); // initialize bottom screen video setNewOrientation(ORIENTATION_0); // set up extra vram banks to be scratch memory vramSetBankE(VRAM_E_LCD); vramSetBankF(VRAM_F_LCD); vramSetBankG(VRAM_G_LCD); vramSetBankH(VRAM_H_LCD); vramSetBankI(VRAM_I_LCD); fb_setBGColor(30653); bg_setBGColor(0); drawStartSplash(); lcdMainOnTop(); // set fb to top screen fb_swapBuffers(); bg_swapBuffers(); // out of order for competition irqInit(); // initialize irqs irqSet(IRQ_VBLANK, startvBlank); irqEnable(IRQ_VBLANK); setMode(INITFAT); setSoundInterrupt(); // initialize fifo irq setGenericSound(11025, 127, 64, 1); waitForInit(); // wait until arm7 has loaded and gone to sleep initComplexSound(); // initialize sound variables initWifi(); fixGautami(); setCursorProperties(0, 2, 0, 0); initCapture(); initClipboard(); // set defaults to english in case we can't load the langauge file for // some reason also takes care of partial translations. initLanguage(); initRandomList(); fixAndTags(); resetKeyboard(); setDate(); if(!DRAGON_InitFiles()) { // oops, no cf card! setMode(DISPLAYCOW); setFont(font_arial_11); setColor(0xFFFF); bg_dispSprite(96, 5, errmsg, 0); bg_setClipping(5,25,250,181); bg_dispString(0,0,l_nofat); bg_swapBuffers(); while(1) { // wee, la la la! // More or less, we aren't going to do nothing here } } //-------------------------------------------------------------------- //finished init, now check to make sure the DSOrganize dir is there... //-------------------------------------------------------------------- findDataDirectory(); makeDirectories(); if(DRAGON_FileExists("DSOrganize") != FE_DIR) { setMode(DISPLAYCOW); // oops, not there, we must create! DRAGON_mkdir("DSOrganize"); DRAGON_chdir("DSOrganize"); DRAGON_mkdir("DAY"); DRAGON_mkdir("HELP"); DRAGON_mkdir("LANG"); DRAGON_mkdir("RESOURCES"); DRAGON_mkdir("REMINDER"); DRAGON_mkdir("SCRIBBLE"); DRAGON_mkdir("TODO"); DRAGON_mkdir("VCARD"); DRAGON_mkdir("ICONS"); DRAGON_mkdir("CACHE"); DRAGON_mkdir("COOKIES"); DRAGON_mkdir("HOME"); DRAGON_chdir("/"); makeDefaultSettings(); setFont(font_arial_11); setColor(0xFFFF); bg_dispSprite(96, 5, errmsg, 0); bg_setClipping(5,25,250,181); bg_dispString(0,0, l_createdir); bg_swapBuffers(); while(!keysDown()) { scanKeys(); } } setMode(INITPLUGIN); //------------------------------------------------------------------- //finished creating dirs, now check to make sure if they extracted it //did their extracting program actually get all the dirs? //------------------------------------------------------------------- DRAGON_chdir(d_base); if(DRAGON_FileExists("Day") != FE_DIR) { DRAGON_mkdir("DAY"); } if(DRAGON_FileExists("Help") != FE_DIR) { DRAGON_mkdir("HELP"); } if(DRAGON_FileExists("Lang") != FE_DIR) { DRAGON_mkdir("LANG"); } if(DRAGON_FileExists("Reminder") != FE_DIR) { DRAGON_mkdir("REMINDER"); } if(DRAGON_FileExists("Scribble") != FE_DIR) { DRAGON_mkdir("SCRIBBLE"); } if(DRAGON_FileExists("Todo") != FE_DIR) { DRAGON_mkdir("TODO"); } if(DRAGON_FileExists("VCard") != FE_DIR) { DRAGON_mkdir("VCARD"); } if(DRAGON_FileExists("Icons") != FE_DIR) { DRAGON_mkdir("ICONS"); } if(DRAGON_FileExists("Cache") != FE_DIR) { DRAGON_mkdir("CACHE"); } if(DRAGON_FileExists("Cookies") != FE_DIR) { DRAGON_mkdir("COOKIES"); } if(DRAGON_FileExists("Home") != FE_DIR) { DRAGON_mkdir("HOME"); } DRAGON_chdir("/"); //------------------------------------------- //how about we load the settings for them eh? //------------------------------------------- loadSettings(); DRAGON_chdir(d_base); if(DRAGON_FileExists("startup.wav") == FE_FILE) { char tStr[256]; sprintf(tStr, "%sstartup.wav", d_base); loadWavToMemory(); loadSound(tStr); } DRAGON_chdir("/"); initStartScreen(); irqSet(IRQ_VBLANK, vBlank); fb_setBGColor(genericFillColor); bg_setBGColor(genericFillColor); }