From aaf30c2f28e21c934685154a70993a957cea0d20 Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 25 Oct 2009 22:34:40 +0000 Subject: [PATCH] First pass at showing runtime info in the About window. This is useful for determining whether we're running in 32 or 64-bit mode on a particular system (especially in OSX, where the same app could contain up to 4 actual builds). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1889 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- src/emucore/OSystem.cxx | 41 +++++++++++++-------- src/emucore/OSystem.hxx | 8 ++++ src/gui/AboutDialog.cxx | 5 ++- src/gui/AboutDialog.hxx | 2 +- src/macosx/stella.xcodeproj/project.pbxproj | 2 +- 5 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 51a3eebed..aeb144f12 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -89,24 +89,35 @@ OSystem::OSystem() myRomFile(""), myRomMD5(""), myFeatures(""), + myBuildInfo(""), myFont(NULL), myConsoleFont(NULL) { -#ifdef DISPLAY_OPENGL - myFeatures += "OpenGL "; -#endif -#ifdef SOUND_SUPPORT - myFeatures += "Sound "; -#endif -#ifdef JOYSTICK_SUPPORT - myFeatures += "Joystick "; -#endif -#ifdef DEBUGGER_SUPPORT - myFeatures += "Debugger "; -#endif -#ifdef CHEATCODE_SUPPORT - myFeatures += "Cheats"; -#endif + // Get built-in features + #ifdef DISPLAY_OPENGL + myFeatures += "OpenGL "; + #endif + #ifdef SOUND_SUPPORT + myFeatures += "Sound "; + #endif + #ifdef JOYSTICK_SUPPORT + myFeatures += "Joystick "; + #endif + #ifdef DEBUGGER_SUPPORT + myFeatures += "Debugger "; + #endif + #ifdef CHEATCODE_SUPPORT + myFeatures += "Cheats"; + #endif + + // Get build info + ostringstream info; + const SDL_version* ver = SDL_Linked_Version(); + + info << "Build " << "TODO" << ", using "; + info << "SDL " << (int)ver->major << "." << (int)ver->minor << "." << (int)ver->patch << " "; + info << "[" << " " << "]"; + myBuildInfo = info.str(); #if 0 // Debugging info for the GUI widgets diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index 6faddd7b9..0629a3390 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -346,6 +346,13 @@ class OSystem */ const string& features() const { return myFeatures; } + /** + The build information for Stella (SDL version, architecture, etc). + + @return The build info + */ + const string& buildInfo() const { return myBuildInfo; } + /** Calculate the MD5sum of the given file. @@ -505,6 +512,7 @@ class OSystem string myRomMD5; string myFeatures; + string myBuildInfo; // The font object to use when space is very limited GUI::Font* mySmallFont; diff --git a/src/gui/AboutDialog.cxx b/src/gui/AboutDialog.cxx index 31fd3e822..a81fae4cc 100644 --- a/src/gui/AboutDialog.cxx +++ b/src/gui/AboutDialog.cxx @@ -43,7 +43,7 @@ AboutDialog::AboutDialog(OSystem* osystem, DialogContainer* parent, // Set real dimensions _w = 52 * fontWidth + 8; - _h = 10 * lineHeight + 20; + _h = 11 * lineHeight + 20; // Add Previous, Next and Close buttons xpos = 10; ypos = _h - buttonHeight - 10; @@ -109,8 +109,9 @@ void AboutDialog::updateStrings(int page, int lines, string& title) title = string("Stella ") + STELLA_VERSION; ADD_ATEXT("\\CA multi-platform Atari 2600 VCS emulator"); ADD_ATEXT(string("\\C\\c2") + instance().features()); + ADD_ATEXT(string("\\C\\c2") + instance().buildInfo()); ADD_ALINE; - ADD_ATEXT("\\CCopyright (C) 1995-2009 The Stella team"); + ADD_ATEXT("\\CCopyright (C) 1995-2009 The Stella Team"); ADD_ATEXT("\\Chttp://stella.sourceforge.net"); ADD_ALINE; ADD_ATEXT("Stella is free software released under the GNU GPL"); diff --git a/src/gui/AboutDialog.hxx b/src/gui/AboutDialog.hxx index 11548e8d7..059dd70f4 100644 --- a/src/gui/AboutDialog.hxx +++ b/src/gui/AboutDialog.hxx @@ -37,7 +37,7 @@ class AboutDialog : public Dialog ~AboutDialog(); protected: - enum { kLINES_PER_PAGE = 8 }; + enum { kLINES_PER_PAGE = 9 }; ButtonWidget* myNextButton; ButtonWidget* myPrevButton; diff --git a/src/macosx/stella.xcodeproj/project.pbxproj b/src/macosx/stella.xcodeproj/project.pbxproj index f42461991..8b86811e5 100644 --- a/src/macosx/stella.xcodeproj/project.pbxproj +++ b/src/macosx/stella.xcodeproj/project.pbxproj @@ -1822,7 +1822,7 @@ 2D91752309BA903B0026E9FF /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; FRAMEWORK_SEARCH_PATHS = ( ., "$(HOME)/Library/Frameworks",