From ed76cb83a085a38b54e983044167344ac74af804 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sat, 5 Jun 2004 11:17:23 +0000 Subject: [PATCH] Added -version to dosbox. Updated Readme(added -version. removed auto from machinetype) Updated Manpage(added freesize, version and machinetype) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1808 --- ChangeLog | 3 ++- README | 6 +++++- docs/dosbox.1 | 20 +++++++++++++++++--- src/gui/sdlmain.cpp | 13 +++++++++---- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6807255e..710c1bff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,11 +10,12 @@ - Changed sensitivity settings of the mouse. - Fixed a bug with an unterminated string in the drivelabel. - Changed file search routines a bit to be more compatible. - - Added support for attribute-searching with fcb's + - Added support for attribute-searching with fcb's. - Changed OpenGL so that it is initialized only when used. - Added basic SDA. - Changed psp and dta functions to use dta. - Added some more PIC commands. (c2woody) + - Added the -version switch, which makes dosbox report its version. 0.61 - Added a beta dynamic cpu for x86 hosts (very unstable) diff --git a/README b/README index 46484459..e7adaa3b 100644 --- a/README +++ b/README @@ -20,6 +20,8 @@ Usage: dosbox [name] [-exit] [-c command] [-fullscreen] [-conf congfigfile] [-lang languagefile] [-machine machinetype] [-noconsole] + +dosbox -version name If "name" is a directory it'll mount that as the C: drive. @@ -48,8 +50,10 @@ dosbox [name] [-exit] [-c command] [-fullscreen] [-conf congfigfile] -machine machinetype Setup dosbox to emulate a specific type of machine. Valid choices are: - auto,hercules,cga,tandy,vga. + hercules, cga, tandy, vga (default). + -version + output version information and exit. Useful for frontends. Note: If a name/command/configfile/languagefile contains a space in it, put the whole name/command/configfile/languagefile between quotes("example"). diff --git a/docs/dosbox.1 b/docs/dosbox.1 index a140290c..b19b7993 100644 --- a/docs/dosbox.1 +++ b/docs/dosbox.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH DOSBOX 1 "October 5, 2003" +.TH DOSBOX 1 "June 5, 2004" .\" Please adjust this date whenever revising the manpage. .SH NAME dosbox \- an x86/DOS emulator with sound/graphics @@ -11,6 +11,9 @@ dosbox \- an x86/DOS emulator with sound/graphics .B [file] .BI "[\-c " command ] .B [\-exit] +.BI "[\-machine " machinetype ] +.LP +.B dosbox -version .SH DESCRIPTION This manual page briefly documents .BR "dosbox" ", an x86/DOS emulator." @@ -38,6 +41,13 @@ A summary of options is included below. .TP .B \-exit .BR dosbox " will exit after running the program specified by " file . +.TP +.BI \-machine " machinetype +.RB "Setup " dosbox " to emulate a specific type of machine." +.RI "Valid choices are: " "hercules, cga, tandy, vga(default)". +.TP +.B \-version +Output version information and exit. Useful for frontends. .SH "INTERNAL COMMANDS" .B dosbox supports most of the DOS commands found in command.com. In addition, the @@ -46,7 +56,7 @@ following extra commands are available: .BI "MOUNT [\-t " type "] [\-size " size ] .I driveletter sourcedirectory .B [\-aspi] [\-ioctl] -.BI "[\-usecd " number "] [\-label " drivelabel ] +.BI "[\-usecd " number "] [\-label " drivelabel "] [\-freesize " freesize ] .LP .B MOUNT \-cd .LP @@ -63,7 +73,11 @@ The local directory you want to have inside dosbox. Type of the mounted directory. Supported are: dir (standard), floppy, cdrom. .TP .BI \-size " drivesize" -Sets the size of the drive. +Sets the size of the drive. See the examples in the README for details. +.TP +.BI \-freesize " freesize" +Sets the amount of free space available on a drive in MB's. This is a more +.RB "simple version of " \-size . .TP .BI \-label " drivelabel" .RI "Sets the name of the drive to " drivelabel ". Needed on some" diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index d4784940..95c04792 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: sdlmain.cpp,v 1.64 2004-03-10 22:50:51 harekiet Exp $ */ +/* $Id: sdlmain.cpp,v 1.65 2004-06-05 11:17:23 qbix79 Exp $ */ #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -904,6 +904,12 @@ int main(int argc, char* argv[]) { CommandLine com_line(argc,argv); Config myconf(&com_line); control=&myconf; + if (control->cmdline->FindExist("-version") || + control->cmdline->FindExist("--version") ) { + printf(VERSION "\n"); + return 0; + } + /* Can't disable the console with debugger enabled */ #if defined(WIN32) && !(C_DEBUG) @@ -930,7 +936,7 @@ int main(int argc, char* argv[]) { DEBUG_SetupConsole(); #endif - if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM + if ( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM #ifndef DISABLE_JOYSTICK |SDL_INIT_JOYSTICK @@ -1011,7 +1017,7 @@ int main(int argc, char* argv[]) { if(sdl.wait_on_error) { //TODO Maybe look for some way to show message in linux? #if (C_DEBUG) - LOG_MSG("Press enter to continue",error); + LOG_MSG("Press enter to continue"); fgetc(stdin); #elif defined(WIN32) Sleep(5000); @@ -1025,6 +1031,5 @@ int main(int argc, char* argv[]) { catch(...){ throw;//dunno what happened. rethrow for sdl to catch } - return 0; };