void CScreensLinks::init(HWND hwnd) { // get initial config m_scratchConfig = *m_mainConfig; // fill side list box (in EDirection order) HWND child = getItem(hwnd, IDC_SCREENS_SRC_SIDE); SendMessage(child, CB_ADDSTRING, 0, (LPARAM)TEXT("---")); SendMessage(child, CB_ADDSTRING, 0, (LPARAM)getString(IDS_EDGE_LEFT).c_str()); SendMessage(child, CB_ADDSTRING, 0, (LPARAM)getString(IDS_EDGE_RIGHT).c_str()); SendMessage(child, CB_ADDSTRING, 0, (LPARAM)getString(IDS_EDGE_TOP).c_str()); SendMessage(child, CB_ADDSTRING, 0, (LPARAM)getString(IDS_EDGE_BOTTOM).c_str()); // create error boxes m_srcSideError = createErrorBox(hwnd); m_srcScreenError = createErrorBox(hwnd); m_dstScreenError = createErrorBox(hwnd); resizeErrorBoxes(); m_selectedLink = -1; m_editedLink = CEdgeLink(); m_edgeLinks.clear(); updateScreens(hwnd, ""); updateScreensControls(hwnd); updateLinks(hwnd); updateLinksControls(hwnd); }
void stateLoadFunc(int value) { printMenuMessage("Loading state..."); muteSND(); if (loadState(stateNum) == 0) { closeMenu(); updateScreens(); printMessage[0] = '\0'; } }
void CScreensLinks::addScreen(HWND hwnd) { CAddScreen dialog(hwnd, m_config, ""); if (dialog.doModal()) { updateScreens(hwnd, dialog.getName()); updateScreensControls(hwnd); updateLinks(hwnd); updateLinksControls(hwnd); } }
void displayMenu() { menuOn = true; fastForwardMode = false; if (checkRumble()) enableMenuOption("Rumble Pak"); else disableMenuOption("Rumble Pak"); // Enable backlight if necessary, and delay as necessary if the console // needs to be initialized. updateScreens(!consoleInitialized); redrawMenu(); }
void CScreensLinks::removeScreen(HWND hwnd) { // remove screen from config (this also removes aliases) m_config->removeScreen(getSelectedScreen(hwnd)); // update dialog updateScreens(hwnd, ""); updateScreensControls(hwnd); updateLinks(hwnd); updateLinksControls(hwnd); }
void setScaleModeFunc(int value) { scaleMode = value; if (!isMenuOn()) { updateScreens(); } if (value == 0) { doAtVBlank(checkBorder); enableMenuOption("Console Output"); } else { disableMenuOption("Console Output"); } }
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; }
void initializeGameboy() { sgbMode = false; switch(gbcModeOption) { case 0: // GB initGBMode(); break; case 1: // GBC if needed if (rom[0][0x143] == 0xC0) initGBCMode(); else initGBMode(); break; case 2: // GBC if (rom[0][0x143] == 0x80 || rom[0][0x143] == 0xC0) initGBCMode(); else initGBMode(); break; } bool sgbEnhanced = rom[0][0x14b] == 0x33 && rom[0][0x146] == 0x03; if (sgbEnhanced && resultantGBMode != 2 && probingForBorder) { resultantGBMode = 2; nukeBorder = false; } else { probingForBorder = false; } initMMU(); initCPU(); initLCD(); initGFX(); initSND(); if (!probingForBorder && suspendStateExists) { loadState(-1); // enter the console on resume advanceFrame = true; } updateScreens(); }
void CScreensLinks::editScreen(HWND hwnd) { CString oldName = getSelectedScreen(hwnd); CAddScreen dialog(hwnd, m_config, oldName); if (dialog.doModal()) { CString newName = dialog.getName(); // rename screens in the edge list if (newName != oldName) { for (size_t i = 0; i < m_edgeLinks.size(); ++i) { m_edgeLinks[i].rename(oldName, newName); } m_editedLink.rename(oldName, newName); } updateScreens(hwnd, newName); updateScreensControls(hwnd); updateLinks(hwnd); updateLinksControls(hwnd); } }
void ScreenSetup::dataToFrontend() { updateScreens(); }
// Called each vblank while the menu is on void updateMenu() { if (subMenuUpdateFunc != 0) { subMenuUpdateFunc(); return; } bool redraw = false; // Get input if (keyPressedAutoRepeat(KEY_UP)) { option--; if (option < -1) option = menuList[menu].numOptions-1; redraw = true; } else if (keyPressedAutoRepeat(KEY_DOWN)) { option++; if (option >= menuList[menu].numOptions) option = -1; redraw = true; } else if (keyPressedAutoRepeat(KEY_LEFT)) { if (option == -1) { menu--; if (menu < 0) menu = numMenus-1; } else if (menuList[menu].options[option].numValues != 0 && menuList[menu].options[option].enabled) { int selection = menuList[menu].options[option].selection-1; if (selection < 0) selection = menuList[menu].options[option].numValues-1; menuList[menu].options[option].selection = selection; menuList[menu].options[option].function(selection); } redraw = true; } else if (keyPressedAutoRepeat(KEY_RIGHT)) { if (option == -1) { menu++; if (menu >= numMenus) menu = 0; } else if (menuList[menu].options[option].numValues != 0 && menuList[menu].options[option].enabled) { int selection = menuList[menu].options[option].selection+1; if (selection >= menuList[menu].options[option].numValues) selection = 0; menuList[menu].options[option].selection = selection; menuList[menu].options[option].function(selection); } redraw = true; } else if (keyJustPressed(KEY_A)) { forceReleaseKey(KEY_A); if (option >= 0 && menuList[menu].options[option].numValues == 0 && menuList[menu].options[option].enabled) { menuList[menu].options[option].function(menuList[menu].options[option].selection); } redraw = true; } else if (keyJustPressed(KEY_B)) { forceReleaseKey(KEY_B); closeMenu(); updateScreens(); } else if (keyJustPressed(KEY_L)) { menu--; if (menu < 0) menu = numMenus-1; if (option >= menuList[menu].numOptions) option = menuList[menu].numOptions-1; redraw = true; } else if (keyJustPressed(KEY_R)) { menu++; if (menu >= numMenus) menu = 0; if (option >= menuList[menu].numOptions) option = menuList[menu].numOptions-1; redraw = true; } if (redraw && subMenuUpdateFunc == 0 && isMenuOn()) // The menu may have been closed by an option doAtVBlank(redrawMenu); }
void advanceFrameFunc(int value) { advanceFrame = true; closeMenu(); updateScreens(); }
void setScreenFunc(int value) { consoleScreen = !value; updateScreens(); }
void returnFunc(int value) { closeMenu(); updateScreens(); }
void resetFunc(int value) { nukeBorder = false; closeMenu(); updateScreens(); initializeGameboy(); }
void cGame::gameLoop(){ inputHandler(); updateScreens(); drawScreens(); }