/** * Shortcut to toggle full-screen */ static void ShortCut_FullScreen(void) { if (!bInFullScreen) { Screen_EnterFullScreen(); } else { Screen_ReturnFromFullScreen(); } }
/** * Lock full-screen for drawing */ static bool Screen_Lock(void) { if (SDL_MUSTLOCK(sdlscrn)) { if (SDL_LockSurface(sdlscrn)) { Screen_ReturnFromFullScreen(); /* All OK? If not need to jump back to a window */ return false; } } return true; }
/** * Un-Initialise emulation */ static void Main_UnInit(void) { Screen_ReturnFromFullScreen(); IoMem_UnInit(); SDLGui_UnInit(); Screen_UnInit(); Exit680x0(); /* SDL uninit: */ SDL_Quit(); /* Close debug log file */ Log_UnInit(); }
/** * Shortcut to 'Boss' key, ie minmize Window and switch to another application */ static void ShortCut_BossKey(void) { /* If we are in full-screen, then return to a window */ Screen_ReturnFromFullScreen(); if (bGrabMouse) { SDL_SetRelativeMouseMode(SDL_FALSE); SDL_SetWindowGrab(sdlWindow, SDL_FALSE); bGrabMouse = false; } Main_PauseEmulation(true); /* Minimize Window and give up processing to next one! */ fprintf(stderr,"FIXME: minimize window!\n"); }
/** * Shortcut to 'Boss' key, ie minmize Window and switch to another application */ static void ShortCut_BossKey(void) { /* If we are in full-screen, then return to a window */ Screen_ReturnFromFullScreen(); if (bGrabMouse) { SDL_WM_GrabInput(SDL_GRAB_OFF); bGrabMouse = false; } Main_PauseEmulation(true); /* Minimize Window and give up processing to next one! */ #if WITH_SDL2 SDL_MinimizeWindow(sdlWindow); #else SDL_WM_IconifyWindow(); #endif }
/** * Copy details back to configuration and perform reset. */ bool Change_CopyChangedParamsToConfiguration(CNF_PARAMS *current, CNF_PARAMS *changed, bool bForceReset) { bool NeedReset; bool bReInitSCSIEmu = false; bool bReInitEnetEmu = false; bool bReInitSoundEmu = false; bool bReInitIoMem = false; bool bScreenModeChange = false; int i; Dprintf("Changes for:\n"); /* Do we need to warn user that changes will only take effect after reset? */ if (bForceReset) NeedReset = bForceReset; else NeedReset = Change_DoNeedReset(current, changed); /* Do we need to change SCSI disks? */ for (i = 0; i < ESP_MAX_DEVS; i++) { if (!NeedReset && (current->SCSI.target[i].bDiskInserted != changed->SCSI.target[i].bDiskInserted || current->SCSI.target[i].bWriteProtected != changed->SCSI.target[i].bWriteProtected || strcmp(current->SCSI.target[i].szImageName, changed->SCSI.target[i].szImageName))) { bReInitSCSIEmu = true; break; } } /* Note: MO and floppy disk insert/eject called from GUI */ /* Do we need to change Ethernet connection? */ if (!NeedReset && current->Ethernet.bEthernetConnected != changed->Ethernet.bEthernetConnected) { bReInitEnetEmu = true; } /* Do we need to change Sound configuration? */ if (!NeedReset && (current->Sound.bEnableSound != changed->Sound.bEnableSound || current->Sound.bEnableMicrophone != changed->Sound.bEnableMicrophone)) { bReInitSoundEmu = true; } /* Copy details to configuration, * so it can be saved out or set on reset */ if (changed != &ConfigureParams) { ConfigureParams = *changed; } /* Copy details to global, if we reset copy them all */ Configuration_Apply(NeedReset); /* Check if all necessary files exist */ Dialog_CheckFiles(); if (bQuitProgram) { SDL_Quit(); exit(-2); } /* Re-init IO memory map? */ if (bReInitIoMem) { Dprintf("- IO mem<\n"); IoMem_Init(); } /* Re-init SCSI disks? */ if (bReInitSCSIEmu) { Dprintf("- SCSI disks<\n"); SCSI_Reset(); } /* Re-init Ethernet? */ if (bReInitEnetEmu) { Dprintf("- Ethernet<\n"); Ethernet_Reset(false); } /* Re-init Sound? */ if (bReInitSoundEmu) { Dprintf("- Sound<\n"); Sound_Reset(); } /* Force things associated with screen change */ if (bScreenModeChange) { Dprintf("- screenmode<\n"); Screen_ModeChanged(); } /* Do we need to perform reset? */ if (NeedReset) { const char *err_msg; Dprintf("- reset\n"); err_msg=Reset_Cold(); // if (err_msg!=NULL) { // DlgAlert_Notice(err_msg); // return false; // } } /* Go into/return from full screen if flagged */ if (!bInFullScreen && ConfigureParams.Screen.bFullScreen) Screen_EnterFullScreen(); else if (bInFullScreen && !ConfigureParams.Screen.bFullScreen) Screen_ReturnFromFullScreen(); /* update statusbar info (CPU, MHz, mem etc) */ Statusbar_UpdateInfo(); Dprintf("done.\n"); return true; }
/** * Debugger user interface main function. */ void DebugUI(debug_reason_t reason) { int cmdret, alertLevel; char *expCmd, *psCmd = NULL; static const char *welcome = "\n----------------------------------------------------------------------" "\nYou have entered debug mode. Type c to continue emulation, h for help.\n"; History_Mark(reason); if (bInFullScreen) Screen_ReturnFromFullScreen(); /* Make sure mouse isn't grabbed regardless of where * this is invoked from. E.g. returning from fullscreen * enables grab if that was enabled on windowed mode. */ SDL_WM_GrabInput(SDL_GRAB_OFF); DebugUI_Init(); if (welcome) { fputs(welcome, stderr); welcome = NULL; } DebugCpu_InitSession(); DebugDsp_InitSession(); Symbols_LoadCurrentProgram(); DebugInfo_ShowSessionInfo(); /* override paused message so that user knows to look into console * on how to continue in case he invoked the debugger by accident. */ Statusbar_AddMessage("Console Debugger", 100); Statusbar_Update(sdlscrn, true); /* disable normal GUI alerts while on console */ alertLevel = Log_SetAlertLevel(LOG_FATAL); cmdret = DEBUGGER_CMDDONE; do { /* Read command from the keyboard and give previous * command for freeing / adding to history */ psCmd = DebugUI_GetCommand(psCmd); if (!psCmd) break; /* returns new expression expanded string */ if (!(expCmd = DebugUI_EvaluateExpressions(psCmd))) continue; /* Parse and execute the command string */ cmdret = DebugUI_ParseCommand(expCmd); free(expCmd); } while (cmdret != DEBUGGER_END); /* free exit command */ DebugUI_FreeCommand(psCmd); Log_SetAlertLevel(alertLevel); DebugUI_SetLogDefault(); DebugCpu_SetDebugging(); DebugDsp_SetDebugging(); }