Skip to content

Commit

Permalink
Merge pull request #4718 from maron2000/refine_log
Browse files Browse the repository at this point in the history
 More refine Version strings display
  • Loading branch information
joncampbell123 authored Dec 31, 2023
2 parents bcf674a + 8f0375e commit 6257bdb
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 7 deletions.
47 changes: 44 additions & 3 deletions include/version_string.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
/*
* Copyright (C) 2011-2023 The DOSBox-X Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#if WIN32 && !defined(HX_DOS)
#ifdef _MSC_VER
#define OS_PLATFORM "Windows"
#if defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86)
#if _MSC_VER <= 1916
#define OS_PLATFORM "VS XP"
#define OS_PLATFORM_LONG "Visual Studio XP"
#else
#define OS_PLATFORM "VS"
#define OS_PLATFORM_LONG "Visual Studio"
#endif
#else
#define OS_PLATFORM "VS ARM"
#define OS_PLATFORM_LONG "Visual Studio ARM"
#endif
#elif defined(__MINGW32__)
#define OS_PLATFORM "MinGW"
#define OS_PLATFORM_LONG "MinGW"
#else
#define OS_PLATFORM "Windows"
#define OS_PLATFORM_LONG "Windows"
#endif
#elif defined(HX_DOS)
#define OS_PLATFORM "DOS"
#define OS_PLATFORM_LONG "DOS"
#elif defined(LINUX)
#define OS_PLATFORM "Linux"
#define OS_PLATFORM_LONG "Linux"
#elif defined(MACOSX)
#define OS_PLATFORM "macOS"
#ifdef __arm__
#define OS_PLATFORM "ARM mac"
#define OS_PLATFORM_LONG "macOS ARM"
#else
#define OS_PLATFORM "x86 mac"
#define OS_PLATFORM_LONG "macOS Intel"
#endif

#else
#define OS_PLATFORM ""
#define OS_PLATFORM_LONG ""
#endif

#if defined(_M_X64) || defined (_M_AMD64) || defined (_M_ARM64) || defined (_M_IA64) || defined(__ia64__) || defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
Expand All @@ -22,4 +63,4 @@
#else
#define OS_BIT "32"
#define OS_BIT_INT 32
#endif
#endif
4 changes: 2 additions & 2 deletions src/gui/sdlmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8557,7 +8557,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
#endif

/* -- Welcome to DOSBox-X! */
LOG_MSG("DOSBox-X version %s (%s %s %d-bit)",VERSION, OS_PLATFORM, SDL_STRING, OS_BIT_INT);
LOG_MSG("DOSBox-X version %s Commit %s (%s %s %d-bit)",VERSION, GIT_COMMIT_HASH, OS_PLATFORM_LONG, SDL_STRING, OS_BIT_INT);
LOG(LOG_MISC,LOG_NORMAL)("Copyright 2011-%s The DOSBox-X Team. Project maintainer: joncampbell123 (The Great Codeholio). DOSBox-X published under GNU GPL.",std::string(COPYRIGHT_END_YEAR).c_str());

#if defined(MACOSX)
Expand Down Expand Up @@ -8719,7 +8719,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT {
#if defined(C_SDL2)
SDL_version sdl_version;
SDL_GetVersion(&sdl_version);
LOG_MSG("SDL: version %d.%d.%d, Video %s, Audio %s)",
LOG_MSG("SDL: version %d.%d.%d, Video %s, Audio %s",
sdl_version.major, sdl_version.minor, sdl_version.patch,
SDL_GetCurrentVideoDriver(), SDL_GetCurrentAudioDriver());
#endif //defined (C_SDL2)
Expand Down
3 changes: 2 additions & 1 deletion src/shell/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <dirent.h>
#endif
#include "build_timestamp.h"
#include "version_string.h"

extern bool shell_keyboard_flush;
extern bool dos_shell_running_program, mountwarning, winautorun;
Expand Down Expand Up @@ -754,7 +755,7 @@ void GetExpandedPath(std::string &path) {
void showWelcome(Program *shell) {
/* Start a normal shell and check for a first command init */
ansiinstalled = is_ANSI_installed(shell);
std::string verstr = "v"+std::string(VERSION)+", "+GetPlatform(false);
std::string verstr = "v"+std::string(VERSION)+", "+OS_PLATFORM_LONG+" "+SDL_STRING+" " + OS_BIT + "-bit";
if (machine == MCH_PC98) {
shell->WriteOut(ParseMsg("\x86\x52\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44"
"\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44\x86\x44"
Expand Down
2 changes: 1 addition & 1 deletion src/shell/shell_cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3707,7 +3707,7 @@ void DOS_Shell::CMD_VER(char *args) {
dos_ver_menu(false);
} else {
WriteOut(MSG_Get("SHELL_CMD_VER_VER"),VERSION,SDL_STRING,dos.version.major,dos.version.minor);
if (optR) WriteOut("DOSBox-X Git commit %s, built on %s\nPlatform: %s %d-bit", GIT_COMMIT_HASH, UPDATED_STR, OS_PLATFORM, OS_BIT_INT);
if (optR) WriteOut("DOSBox-X Git commit %s, built on %s\nPlatform: %s %d-bit", GIT_COMMIT_HASH, UPDATED_STR, OS_PLATFORM_LONG, OS_BIT_INT);
}
}

Expand Down

0 comments on commit 6257bdb

Please sign in to comment.