diff --git a/README b/README index 65b2312e..5a5849d6 100644 --- a/README +++ b/README @@ -313,8 +313,9 @@ dosbox -editconf program dosbox -opencaptures program dosbox -printconf dosbox -eraseconf +dosbox -erasemapper - name + name If "name" is a directory it will mount that as the C: drive. If "name" is an executable it will mount the directory of "name" as the C: drive and execute "name". @@ -391,6 +392,9 @@ dosbox -eraseconf -eraseconf removes the default configuration file. + -erasemapper + removes the mapperfile used by the default clean configuration file. + Note: If a name/command/configfile/languagefile contains a space, put the whole name/command/configfile/languagefile between quotes ("command or file name"). If you need to use quotes within quotes diff --git a/docs/dosbox.1 b/docs/dosbox.1 index edef4bce..1a759440 100644 --- a/docs/dosbox.1 +++ b/docs/dosbox.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH DOSBOX 1 "May 27, 2009" +.TH DOSBOX 1 "Feb 26, 2010" .\" Please adjust this date whenever revising the manpage. .SH NAME dosbox \- an x86/DOS emulator with sound/graphics @@ -27,6 +27,8 @@ dosbox \- an x86/DOS emulator with sound/graphics .B dosbox \-printconf .LP .B dosbox \-eraseconf +.LP +.B dosbox \-erasemapper .SH DESCRIPTION This manual page briefly documents .BR "dosbox" ", an x86/DOS emulator." @@ -107,6 +109,9 @@ prints the location of the default configuration file. .TP .B \-eraseconf removes the default configuration file. +.TP +.B \-erasemapper +removes the mapperfile configured in the clean default configuration file. .SH "INTERNAL COMMANDS" .B dosbox supports most of the DOS commands found in command.com. In addition, the diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 3faddb95..217caf13 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -51,6 +51,7 @@ #include "cross.h" #include "control.h" +#define MAPPERFILE "mapper-" VERSION ".conf" //#define DISABLE_JOYSTICK #if C_OPENGL @@ -1513,7 +1514,7 @@ void Config_Add_SDL() { Pstring = Pmulti->GetSection()->Add_string("inactive",Property::Changeable::Always,"normal"); Pstring->Set_values(inactt); - Pstring = sdl_sec->Add_path("mapperfile",Property::Changeable::Always,"mapper-" VERSION ".conf"); + Pstring = sdl_sec->Add_path("mapperfile",Property::Changeable::Always,MAPPERFILE); Pstring->Set_help("File used to load/save the key/event mappings from."); Pbool = sdl_sec->Add_bool("usescancodes",Property::Changeable::Always,true); @@ -1644,6 +1645,17 @@ static void eraseconfigfile() { exit(0); } +static void erasemapperfile() { + std::string path,file=MAPPERFILE; + Cross::GetPlatformConfigDir(path); + path += file; + FILE* f = fopen(path.c_str(),"r"); + if(!f) exit(0); + fclose(f); + unlink(path.c_str()); + exit(0); +} + //extern void UI_Init(void); @@ -1660,6 +1672,7 @@ int main(int argc, char* argv[]) { if(control->cmdline->FindString("-editconf",editor,false)) launcheditor(); if(control->cmdline->FindString("-opencaptures",editor,true)) launchcaptures(editor); if(control->cmdline->FindExist("-eraseconf")) eraseconfigfile(); + if(control->cmdline->FindExist("-erasemapper")) erasemapperfile(); /* Can't disable the console with debugger enabled */ #if defined(WIN32) && !(C_DEBUG)