Changeset 445 in vbox for trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
- Timestamp:
- Jan 30, 2007 10:04:05 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r435 r445 556 556 " -[no]csam Enable or disable CSAM\n" 557 557 " -[no]hwvirtex Permit or deny the usage of VMX/SVN\n" 558 " -warpdrive <1..20000> The virtual time rate as percent, with 100 as the normal rate.\n" 558 559 #endif 559 560 "\n"); … … 705 706 unsigned fCSAM = ~0U; 706 707 TriStateBool_T fHWVirt = TriStateBool_Default; 708 uint32_t u32WarpDrive = 0; 707 709 #endif 708 710 #ifdef VBOX_WIN32_UI … … 1133 1135 else if (strcmp(argv[curArg], "-nohwvirtex") == 0) 1134 1136 fHWVirt = TriStateBool_False; 1137 else if (strcmp(argv[curArg], "-warpdrive") == 0) 1138 { 1139 if (++curArg >= argc) 1140 { 1141 RTPrintf("Error: missing the rate value for the -warpdrive option!\n"); 1142 rc = E_FAIL; 1143 break; 1144 } 1145 u32WarpDrive = RTStrToUInt32(argv[curArg]); 1146 if (u32WarpDrive < 2 || u32WarpDrive > 20000) 1147 { 1148 RTPrintf("Error: the warp drive rate is restricted to [2..20000]. (%d)\n", u32WarpDrive); 1149 rc = E_FAIL; 1150 break; 1151 } 1152 } 1135 1153 #endif /* VBOXSDL_ADVANCED_OPTIONS */ 1136 1154 #ifdef VBOX_WIN32_UI … … 1767 1785 { 1768 1786 gMachine->COMSETTER(HWVirtExEnabled)(fHWVirt); 1787 } 1788 if (u32WarpDrive != 0) 1789 { 1790 if (!gMachineDebugger) 1791 { 1792 RTPrintf("Error: No debugger object; -warpdrive %d cannot be executed!\n", u32WarpDrive); 1793 goto leave; 1794 } 1795 gMachineDebugger->COMSETTER(VirtualTimeRate)(u32WarpDrive); 1769 1796 } 1770 1797 #endif /* VBOXSDL_ADVANCED_OPTIONS */ … … 3090 3117 static void UpdateTitlebar(TitlebarMode mode, uint32_t u32User) 3091 3118 { 3092 static char pszTitle[1024] = {0};3119 static char szTitle[1024] = {0}; 3093 3120 3094 3121 /* back up current title */ 3095 char pszPrevTitle[1024];3096 strcpy( pszPrevTitle, pszTitle);3097 3098 3099 strcpy( pszTitle, "InnoTek VirtualBox - ");3122 char szPrevTitle[1024]; 3123 strcpy(szPrevTitle, szTitle); 3124 3125 3126 strcpy(szTitle, "InnoTek VirtualBox - "); 3100 3127 3101 3128 Bstr name; 3102 3129 gMachine->COMGETTER(Name)(name.asOutParam()); 3103 3130 if (name) 3104 strcat( pszTitle, Utf8Str(name).raw());3131 strcat(szTitle, Utf8Str(name).raw()); 3105 3132 else 3106 strcat( pszTitle, "<noname>");3133 strcat(szTitle, "<noname>"); 3107 3134 3108 3135 … … 3115 3142 gMachine->COMGETTER(State)(&machineState); 3116 3143 if (machineState == MachineState_Paused) 3117 strcat( pszTitle, " - [Paused]");3144 strcat(szTitle, " - [Paused]"); 3118 3145 3119 3146 if (gfGrabbed) 3120 strcat( pszTitle, " - [Input captured]");3147 strcat(szTitle, " - [Input captured]"); 3121 3148 3122 3149 // do we have a debugger interface … … 3132 3159 BOOL logEnabled = FALSE; 3133 3160 BOOL hwVirtEnabled = FALSE; 3161 ULONG virtualTimeRate = 100; 3134 3162 gMachineDebugger->COMGETTER(RecompileSupervisor)(&recompileSupervisor); 3135 3163 gMachineDebugger->COMGETTER(RecompileUser)(&recompileUser); … … 3139 3167 gMachineDebugger->COMGETTER(Singlestep)(&singlestepEnabled); 3140 3168 gMachineDebugger->COMGETTER(HWVirtExEnabled)(&hwVirtEnabled); 3141 RTStrPrintf(pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle), 3142 " [STEP=%d CS=%d PAT=%d RR0=%d RR3=%d LOG=%d HWVirt=%d]", 3169 gMachineDebugger->COMGETTER(VirtualTimeRate)(&virtualTimeRate); 3170 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3171 " [STEP=%d CS=%d PAT=%d RR0=%d RR3=%d LOG=%d HWVirt=%d", 3143 3172 singlestepEnabled == TRUE, csamEnabled == TRUE, patmEnabled == TRUE, 3144 3173 recompileSupervisor == FALSE, recompileUser == FALSE, 3145 3174 logEnabled == TRUE, hwVirtEnabled == TRUE); 3175 char *psz = strchr(szTitle, '\0'); 3176 if (virtualTimeRate != 100) 3177 RTStrPrintf(psz, &szTitle[sizeof(szTitle)] - psz, " WD=%d%%]", virtualTimeRate); 3178 else 3179 RTStrPrintf(psz, &szTitle[sizeof(szTitle)] - psz, "]"); 3146 3180 #else 3147 3181 BOOL hwVirtEnabled = FALSE; 3148 3182 gMachineDebugger->COMGETTER(HWVirtExEnabled)(&hwVirtEnabled); 3149 RTStrPrintf( pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle),3183 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3150 3184 "%s", hwVirtEnabled ? " (HWVirtEx)" : ""); 3151 3185 #endif /* DEBUG */ … … 3162 3196 gMachine->COMGETTER(State)(&machineState); 3163 3197 if (machineState == MachineState_Starting) 3164 strcat( pszTitle, " - Starting...");3198 strcat(szTitle, " - Starting..."); 3165 3199 else if (machineState == MachineState_Restoring) 3166 3200 { … … 3168 3202 HRESULT rc = gProgress->COMGETTER(Percent)(&cPercentNow); 3169 3203 if (SUCCEEDED(rc)) 3170 RTStrPrintf( pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle),3204 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3171 3205 " - Restoring %d%%...", (int)cPercentNow); 3172 3206 else 3173 RTStrPrintf( pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle),3207 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3174 3208 " - Restoring..."); 3175 3209 } … … 3181 3215 { 3182 3216 AssertMsg(u32User >= 0 && u32User <= 100, ("%d\n", u32User)); 3183 RTStrPrintf( pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle),3217 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3184 3218 " - Saving %d%%...", u32User); 3185 3219 break; … … 3189 3223 { 3190 3224 AssertMsg(u32User >= 0 && u32User <= 100, ("%d\n", u32User)); 3191 RTStrPrintf( pszTitle + strlen(pszTitle), sizeof(pszTitle) - strlen(pszTitle),3225 RTStrPrintf(szTitle + strlen(szTitle), sizeof(szTitle) - strlen(szTitle), 3192 3226 " - Taking snapshot %d%%...", u32User); 3193 3227 break; … … 3202 3236 * Don't update if it didn't change. 3203 3237 */ 3204 if (strcmp( pszTitle, pszPrevTitle) == 0)3238 if (strcmp(szTitle, szPrevTitle) == 0) 3205 3239 return; 3206 3240 … … 3209 3243 */ 3210 3244 #ifdef VBOX_WIN32_UI 3211 setUITitle( pszTitle);3245 setUITitle(szTitle); 3212 3246 #else 3213 SDL_WM_SetCaption( pszTitle, "InnoTek VirtualBox");3247 SDL_WM_SetCaption(szTitle, "InnoTek VirtualBox"); 3214 3248 #endif 3215 3249 }
Note:
See TracChangeset
for help on using the changeset viewer.