Add + document option to remove mapperfile used by a clean configuration.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3553
This commit is contained in:
parent
91f093b9ce
commit
e19e93e5c2
3 changed files with 25 additions and 3 deletions
6
README
6
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue