--- previous/src/shortcut.c 2018/04/24 19:29:52 1.1.1.3 +++ previous/src/shortcut.c 2018/04/24 19:31:16 1.1.1.4 @@ -15,10 +15,8 @@ const char ShortCut_fileid[] = "Hatari s #include "file.h" #include "m68000.h" #include "dimension.h" -#include "memorySnapShot.h" #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 */ @@ -77,24 +74,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 +83,49 @@ static void ShortCut_SoundOnOff(void) Sound_Reset(); } - -/*-----------------------------------------------------------------------*/ -/** - * Shortcut to fast forward - */ -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 + * Shorcut to M68K 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,12 +138,15 @@ 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.System.nMachineType==NEXT_STATION || !ConfigureParams.Dimension.bEnabled) { + return; + } + + if (ConfigureParams.Screen.nMonitorType != MONITOR_TYPE_DUAL) { if (ConfigureParams.Screen.nMonitorType==MONITOR_TYPE_DIMENSION) { ConfigureParams.Screen.nMonitorType=MONITOR_TYPE_CPU; } else { @@ -178,8 +154,6 @@ static void ShortCut_Dimension(void) } } Statusbar_UpdateInfo(); - Screen_SetFullUpdate(); -#endif } @@ -207,57 +181,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 +224,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 } };