-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
friendlier window title #61
Comments
The title is just what DOSBox does normally. You can see it as the window title when running DOSBox as a normal application. Here it is done via the JavaScript I don't even know what would be a friendlier title, and think overriding the standard title setting and choosing a custom title should be up to whoever edits the web page containing the emulator. |
alternatively you can excise the title-setting from the DOSBox source code - it ain't glamorous but it works: diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp
index aaf7c07e..e1ba77f0 100644
--- a/src/gui/sdlmain.cpp
+++ b/src/gui/sdlmain.cpp
@@ -347,11 +347,11 @@ void GFX_SetTitle(Bit32s cycles,int frameskip,bool paused){
}
if (paused) strcat(title," PAUSED");
-#if SDL_VERSION_ATLEAST(2,0,0)
- SDL_SetWindowTitle(sdl.window,title); // VERSION is gone...
-#else
- SDL_WM_SetCaption(title,VERSION);
-#endif
+// #if SDL_VERSION_ATLEAST(2,0,0)
+// SDL_SetWindowTitle(sdl.window,title); // VERSION is gone...
+// #else
+// SDL_WM_SetCaption(title,VERSION);
+// #endif
}
static unsigned char logo[32*32*4]= {
@@ -2170,11 +2170,11 @@ static void GUI_StartUp(Section * sec) {
LOG_MSG("SDL: You are running in 24 bpp mode, this will slow down things!");
}
GFX_Stop();
-#if SDL_VERSION_ATLEAST(2,0,0)
- SDL_SetWindowTitle(sdl.window,"DOSBox"); // VERSION is gone...
-#else
- SDL_WM_SetCaption("DOSBox",VERSION);
-#endif
+// #if SDL_VERSION_ATLEAST(2,0,0)
+// SDL_SetWindowTitle(sdl.window,"DOSBox"); // VERSION is gone...
+// #else
+// SDL_WM_SetCaption("DOSBox",VERSION);
+// #endif
/* The endian part is intentionally disabled as somehow it produces correct results without according to rhoenie*/
//#if SDL_BYTEORDER == SDL_BIG_ENDIAN
However then something in emscripten will simply reset the title to empty; this can be mitigated with some JS: Module.postRun ||= [];
Module.postRun.push(() => {
window.document.title = "My title";
} |
I came across this playing the excellent MS-DOS Game collection at the Internet Archive, great work! I was confused by the games there putting, e.g. "DOSBox SVN, CPU speed: 3000 cycles, Frameskip 0, Program: STUNT" in the window title (thus browser tab and browser history). Tabs and dropdowns cut off the end of this so you don't see what program you're running and it's quite confusing.
Em-DOSBox's
GFX_SetTitle()
in src/gui/sdlmain.cpp sets the title to the nerdy"DOSBox %s, CPU speed: %8d cycles, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram)
a friendlier layout with the key information first would be
"STUNT running in Em-DOSBox v. SVN (CPU speed: 3000 cycles, Frameskip 0)
(the misleading version "number" SVN comes from src/platform/visualc/config.h).
The text was updated successfully, but these errors were encountered: