--- previous/src/shortcut.c 2018/04/24 19:29:52 1.1.1.3 +++ previous/src/shortcut.c 2018/04/24 19:33:13 1.1.1.5 @@ -14,11 +14,9 @@ const char ShortCut_fileid[] = "Hatari s #include "dialog.h" #include "file.h" #include "m68000.h" -#include "dimension.h" -#include "memorySnapShot.h" +#include "dimension.hpp" #include "reset.h" #include "screen.h" -#include "screenSnapShot.h" #include "configuration.h" #include "shortcut.h" #include "debugui.h" @@ -26,7 +24,6 @@ const char ShortCut_fileid[] = "Hatari s #include "video.h" #include "snd.h" #include "statusbar.h" -#include "clocks_timings.h" static SHORTCUTKEYIDX ShortCutKey = SHORTCUT_NONE; /* current shortcut key */ @@ -54,6 +51,7 @@ static void ShortCut_FullScreen(void) */ static void ShortCut_MouseGrab(void) { + bGrabMouse = !bGrabMouse; /* Toggle flag */ /* If we are in windowed mode, toggle the mouse cursor mode now: */ @@ -77,24 +75,6 @@ static void ShortCut_MouseGrab(void) /*-----------------------------------------------------------------------*/ /** - * Shortcut to toggle YM/WAV sound recording - */ -static void ShortCut_RecordSound(void) -{ -} - - -/*-----------------------------------------------------------------------*/ -/** - * Shortcut to toggle screen animation recording - */ -static void ShortCut_RecordAnimation(void) -{ -} - - -/*-----------------------------------------------------------------------*/ -/** * Shortcut to sound on/off */ static void ShortCut_SoundOnOff(void) @@ -104,55 +84,49 @@ static void ShortCut_SoundOnOff(void) Sound_Reset(); } - /*-----------------------------------------------------------------------*/ /** - * Shortcut to fast forward + * Shorcut to M68K debug interface */ -static void ShortCut_FastForward(void) -{ - /* Set maximum speed */ - ConfigureParams.System.bFastForward = true; -} - - -/*-----------------------------------------------------------------------*/ -/** - * 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"); -} - - -/*-----------------------------------------------------------------------*/ -/** - * Shorcut to debug interface - */ -static void ShortCut_Debug(void) +void ShortCut_Debug_M68K(void) { int running; - /* Call the debugger */ running = Main_PauseEmulation(true); + /* Call the debugger */ DebugUI(); if (running) Main_UnPauseEmulation(); } +/*-----------------------------------------------------------------------*/ +/** + * Shorcut to I860 debug interface + */ +void ShortCut_Debug_I860(void) { + int running; + + if (bInFullScreen) + Screen_ReturnFromFullScreen(); + + running = Main_PauseEmulation(true); + + /* 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("I860 Console Debugger", 100); + Statusbar_Update(sdlscrn); + + /* disable normal GUI alerts while on console */ + int alertLevel = Log_SetAlertLevel(LOG_FATAL); + + /* Call the debugger */ + nd_start_debugger(); + Log_SetAlertLevel(alertLevel); + + if (running) + Main_UnPauseEmulation(); +} /*-----------------------------------------------------------------------*/ /** @@ -165,21 +139,33 @@ static void ShortCut_Pause(void) } /** - * Shorcut to load a disk image + * Shorcut to switch monochrome and dimension screen */ static void ShortCut_Dimension(void) { -#if ENABLE_DIMENSION - if(ConfigureParams.Screen.nMonitorType != MONITOR_TYPE_DUAL) { - if (ConfigureParams.Screen.nMonitorType==MONITOR_TYPE_DIMENSION) { - ConfigureParams.Screen.nMonitorType=MONITOR_TYPE_CPU; + if (ConfigureParams.System.nMachineType==NEXT_STATION || + ConfigureParams.Screen.nMonitorType==MONITOR_TYPE_DUAL) { + return; + } + + while (ConfigureParams.Screen.nMonitorNum < ND_MAX_BOARDS) { + if (ConfigureParams.Screen.nMonitorType==MONITOR_TYPE_CPU) { + ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_DIMENSION; + ConfigureParams.Screen.nMonitorNum = 0; } else { - ConfigureParams.Screen.nMonitorType=MONITOR_TYPE_DIMENSION; + ConfigureParams.Screen.nMonitorNum++; + } + if (ConfigureParams.Screen.nMonitorNum==ND_MAX_BOARDS) { + ConfigureParams.Screen.nMonitorType = MONITOR_TYPE_CPU; + ConfigureParams.Screen.nMonitorNum = 0; + break; + } + if (ConfigureParams.Dimension.board[ConfigureParams.Screen.nMonitorNum].bEnabled) { + break; } } + Statusbar_UpdateInfo(); - Screen_SetFullUpdate(); -#endif } @@ -207,57 +193,21 @@ void ShortCut_ActKey(void) Main_UnPauseEmulation(); Reset_Cold(); /* Reset emulator with 'cold' (clear all) */ break; -#if 0 - case SHORTCUT_WARMRESET: - Main_UnPauseEmulation(); - Reset_Warm(); /* Emulator 'warm' reset */ - break; - case SHORTCUT_SCREENSHOT: - ScreenSnapShot_SaveScreen(); /* Grab screenshot */ - break; - case SHORTCUT_BOSSKEY: - ShortCut_BossKey(); /* Boss key */ - break; - case SHORTCUT_CURSOREMU: /* Toggle joystick emu on/off */ - Joy_ToggleCursorEmulation(); - break; - case SHORTCUT_FASTFORWARD: - ShortCut_FastForward(); /* Toggle Min/Max speed */ - break; - case SHORTCUT_RECANIM: - ShortCut_RecordAnimation(); /* Record animation */ - break; - case SHORTCUT_RECSOUND: - ShortCut_RecordSound(); /* Toggle sound recording */ - break; -#endif case SHORTCUT_SOUND: ShortCut_SoundOnOff(); /* Enable/disable sound */ break; -#if 0 - case SHORTCUT_DEBUG: - ShortCut_Debug(); /* Invoke the Debug UI */ - break; -#endif -#if ENABLE_DIMENSION - case SHORTCUT_DEBUG: - nd_start_debugger(); /* Invoke the Debug UI */ + case SHORTCUT_DEBUG_M68K: + ShortCut_Debug_M68K(); /* Invoke the Debug UI */ + break; + case SHORTCUT_DEBUG_I860: + ShortCut_Debug_I860(); /* Invoke the M68K UI */ break; -#endif case SHORTCUT_PAUSE: ShortCut_Pause(); /* Invoke Pause */ break; case SHORTCUT_QUIT: Main_RequestQuit(); break; -#if 0 - case SHORTCUT_LOADMEM: - MemorySnapShot_Restore(ConfigureParams.Memory.szMemoryCaptureFileName, true); - break; - case SHORTCUT_SAVEMEM: - MemorySnapShot_Capture(ConfigureParams.Memory.szMemoryCaptureFileName, true); - break; -#endif case SHORTCUT_DIMENSION: ShortCut_Dimension(); break; @@ -286,11 +236,6 @@ bool Shortcut_Invoke(const char *shortcu { SHORTCUT_MOUSEGRAB, "mousegrab" }, { SHORTCUT_COLDRESET, "coldreset" }, { SHORTCUT_WARMRESET, "warmreset" }, - { SHORTCUT_SCREENSHOT, "screenshot" }, - { SHORTCUT_BOSSKEY, "bosskey" }, - { SHORTCUT_RECANIM, "recanim" }, - { SHORTCUT_RECSOUND, "recsound" }, - { SHORTCUT_SAVEMEM, "savemem" }, { SHORTCUT_QUIT, "quit" }, { SHORTCUT_NONE, NULL } };