int main(void) { gfxInitDefault(); if(R_FAILED(ndspInit())) return 0; #ifdef DEBUG LightLock_Init(&debug_lock); consoleInit(GFX_BOTTOM, &bottomScreen); consoleDebugInit(debugDevice_CONSOLE); #endif consoleInit(GFX_TOP, &topScreen); //aptHook(&hookCookie, AptEventHook, NULL); svcCreateEvent(&bufferReadyConsumeRequest, RESET_STICKY); svcCreateEvent(&bufferReadyProduceRequest, RESET_STICKY); getFiles(); bool exit = false; while (!exit) { std::string filename = select_file(); exit = stream_file(filename); } ndspExit(); gfxExit(); return 0; }
static int gfx_console(lua_State *L) { consoleScreen = luaL_optinteger(L, 1, GFX_TOP); bool err = false; if (lua_isboolean(L, 2)) { err = lua_toboolean(L, 2); } consoleInit(consoleScreen, NULL); if (err) consoleDebugInit(debugDevice_CONSOLE); return 0; }
/*! initialize console subsystem */ void console_init(void) { consoleInit(GFX_TOP, &status_console); consoleSetWindow(&status_console, 0, 0, 50, 1); consoleInit(GFX_TOP, &main_console); consoleSetWindow(&main_console, 0, 1, 50, 29); consoleSelect(&main_console); consoleDebugInit(debugDevice_NULL); }
/* DS_SysInit Initializes DS specific system hardware and interrupts. */ LOCALPROC DS_SysInit(void) { defaultExceptionHandler(); powerOn(POWER_ALL_2D); lcdMainOnTop(); irqSet(IRQ_VBLANK, DS_VBlank_IRQ); irqSet(IRQ_HBLANK, DS_HBlank_IRQ); irqSet(IRQ_TIMER1, DS_Timer1_IRQ); irqEnable(IRQ_VBLANK); irqEnable(IRQ_HBLANK); irqEnable(IRQ_TIMER1); /* This sets up 2 timers as a milisecond counter. TIMER0_DATA Will overflow roughly every 1 msec into TIMER1_DATA. When TIMER1_DATA overflows an interrupt will be generated and DS_Timer1_IRQ will be called. */ TIMER0_DATA = 32768; TIMER0_CR = TIMER_DIV_1 | TIMER_ENABLE; TIMER1_DATA = 0; TIMER1_CR = TIMER_ENABLE | TIMER_CASCADE | TIMER_IRQ_REQ; /* Testing. */ consoleDemoInit(); consoleDebugInit(DebugDevice_NOCASH); /* Use the default keyboard until I design a (good) UI... */ DSKeyboard = keyboardDemoInit(); keyboardShow(); /* Drop back to a read only filesystem embedded in the Mini vMac binary if we cannot open a media device. */ if (! fatInitDefault()) { nitroFSInit(); } }
int main(int argc, char* argv[]) { REG_POWERCNT = POWER_ALL & ~(POWER_MATRIX | POWER_3D_CORE); // don't need 3D consoleDebugInit(DebugDevice_CONSOLE); defaultExceptionHandler(); time(&rawTime); lastRawTime = rawTime; timerStart(0, ClockDivider_1024, TIMER_FREQ_1024(1), clockUpdater); /* Reset the EZ3in1 if present */ if (!__dsimode) { sysSetCartOwner(BUS_OWNER_ARM9); GBA_BUS[0x0000] = 0xF0; GBA_BUS[0x1000] = 0xF0; } fifoSetValue32Handler(FIFO_USER_02, fifoValue32Handler, NULL); sharedData = (SharedData*)memUncached(malloc(sizeof(SharedData))); sharedData->scalingOn = false; // It might make more sense to use "fifoSendAddress" here. // However there may have been something wrong with it in dsi mode. fifoSendValue32(FIFO_USER_03, ((u32)sharedData)&0x00ffffff); consoleOn = true; initConsole(); initInput(); readConfigFile(); if (argc >= 2) { char* filename = argv[1]; loadProgram(filename); initializeGameboyFirstTime(); } else { selectRom(); } consoleOn = false; updateScreens(); runEmul(); return 0; }