1
0
Fork 0

Partial rewrite of the configsystem part 2. Should be usuable. Missing parts are cosmetic. (based on Moe his stuff). I hope everything works in visual C.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3098
This commit is contained in:
Peter Veenstra 2008-02-10 11:14:03 +00:00
parent 0a8945c885
commit 45074288cf
10 changed files with 811 additions and 536 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: dosbox.cpp,v 1.127 2008-02-03 20:43:13 c2woody Exp $ */
/* $Id: dosbox.cpp,v 1.128 2008-02-10 11:14:03 qbix79 Exp $ */
#include <stdlib.h>
#include <stdarg.h>
@ -270,57 +270,66 @@ static void DOSBOX_RealInit(Section * sec) {
"# They are used to (briefly) document the effect of each option.\n");
MAPPER_AddHandler(DOSBOX_UnlockSpeed, MK_f12, MMOD2,"speedlock","Speedlock");
svgaCard=SVGA_None;
machine=MCH_VGA;
int10.vesa_nolfb=false;
std::string cmd_machine;
const char * mtype;
if (control->cmdline->FindString("-machine",cmd_machine,true)) mtype=cmd_machine.c_str();
else mtype=section->Get_string("machine");
if (strcasecmp(mtype,"cga")==0) machine=MCH_CGA;
else if (strcasecmp(mtype,"tandy")==0) machine=MCH_TANDY;
else if (strcasecmp(mtype,"pcjr")==0) machine=MCH_PCJR;
else if (strcasecmp(mtype,"hercules")==0) machine=MCH_HERC;
else if (strcasecmp(mtype,"ega")==0) machine=MCH_EGA;
else if ((strcasecmp(mtype,"vga")==0) || (strcasecmp(mtype,"vga_s3")==0) ||
(strcasecmp(mtype,"svga")==0) || (strcasecmp(mtype,"svga_s3")==0)) {
machine=MCH_VGA;
svgaCard=SVGA_S3Trio;
} else if (strcasecmp(mtype,"vesa_nolfb")==0) {
machine=MCH_VGA;
svgaCard=SVGA_S3Trio;
int10.vesa_nolfb=true;
} else if ((strcasecmp(mtype,"vga_et4000")==0) || (strcasecmp(mtype,"svga_et4000")==0)) {
machine=MCH_VGA;
svgaCard=SVGA_TsengET4K;
} else if ((strcasecmp(mtype,"vga_et3000")==0) || (strcasecmp(mtype,"svga_et3000")==0)) {
machine=MCH_VGA;
svgaCard=SVGA_TsengET3K;
} else if ((strcasecmp(mtype,"vga_pvga1a")==0) || (strcasecmp(mtype,"svga_pvga1a")==0) ||
(strcasecmp(mtype,"svga_paradise")==0)) {
machine=MCH_VGA;
svgaCard=SVGA_ParadisePVGA1A;
} else if (strcasecmp(mtype,"vgaonly")==0) {
machine=MCH_VGA;
svgaCard=SVGA_None;
} else {
LOG_MSG("DOSBOX:Unknown machine type %s",mtype);
if (control->cmdline->FindString("-machine",cmd_machine,true)){
//update value in config (else no matching against suggested values
section->HandleInputline(std::string("machine=") + cmd_machine);
}
std::string mtype(section->Get_string("machine"));
svgaCard = SVGA_S3Trio;
machine = MCH_VGA;
int10.vesa_nolfb = false;
if (mtype == "cga") { machine = MCH_CGA; }
else if (mtype == "tandy") { machine = MCH_TANDY; }
else if (mtype == "pcjr") { machine = MCH_PCJR; }
else if (mtype == "hercules") { machine = MCH_HERC; }
else if (mtype == "ega") { machine = MCH_EGA; }
else if (mtype == "vga") { svgaCard = SVGA_S3Trio; }
else if (mtype == "vga_s3") { svgaCard = SVGA_S3Trio; }
else if (mtype == "vesa_nolfb") { svgaCard = SVGA_S3Trio; int10.vesa_nolfb = true;}
else if (mtype == "vga_et4000") { svgaCard = SVGA_TsengET4K; }
else if (mtype == "vga_et3000") { svgaCard = SVGA_TsengET3K; }
else if (mtype == "vga_pvga1a") { svgaCard = SVGA_ParadisePVGA1A; }
else if (mtype == "vga_paradise") { svgaCard = SVGA_ParadisePVGA1A; }
else if (mtype == "vgaonly") { svgaCard = SVGA_None; }
else E_Exit("DOSBOX:Unknown machine type %s",mtype.c_str());
}
void DOSBOX_Init(void) {
Section_prop * secprop;
Section_line * secline;
Prop_int* Pint;
Prop_hex* Phex;
Prop_string* Pstring;
Prop_bool* Pbool;
Prop_multival* Pmulti;
SDLNetInited = false;
// Some frequently used option sets
const char *rates[] = { "22050", "44100", "48000", "32000", "16000", "11025", "8000", 0 };
const char *ios[] = { "220", "240", "260", "280", "2a0", "2c0", "2e0", "300", 0 };
const char *irqs[] = { "3", "5", "7", "9", "10", "11", "12", 0 };
const char *dmas[] = { "0", "1", "3", "5", "6", "7", 0 };
/* Setup all the different modules making up DOSBox */
const char* machines[] = {
"hercules", "cga"," tandy", "pcjr", "ega", "vga",
"vgaonly", "vga_s3", "vga_et3000", "vga_et4000",
"vga_pvga1a", "vga_paradise", "vesa_nolfb", 0 };
secprop=control->AddSection_prop("dosbox",&DOSBOX_RealInit);
secprop->Add_string("language","");
secprop->Add_string("machine","vga");
secprop->Add_string("captures","capture");
Pstring = secprop->Add_string("language",Property::Changeable::Always,"");
Pstring->Set_help("Select another language file.");
Pstring = secprop->Add_string("machine",Property::Changeable::OnlyAtStart,"vga");
Pstring->Set_values(machines);
Pstring->Set_help("The type of machine tries to emulate.");
Pstring = secprop->Add_string("captures",Property::Changeable::Always,"capture");
Pstring->Set_help("Directory where things like wave, midi, screenshot get captured.");
#if C_DEBUG
LOG_StartUp();
@ -330,58 +339,75 @@ void DOSBOX_Init(void) {
secprop->AddInitFunction(&PAGING_Init);//done
secprop->AddInitFunction(&MEM_Init);//done
secprop->AddInitFunction(&HARDWARE_Init);//done
secprop->Add_int("memsize",16);
Pint = secprop->Add_int("memsize", Property::Changeable::WhenIdle,16);
Pint->SetMinMax(1,63);
Pint->Set_help("Amount of memory DOSBox has in megabytes.");
secprop->AddInitFunction(&CALLBACK_Init);
secprop->AddInitFunction(&PIC_Init);//done
secprop->AddInitFunction(&PROGRAMS_Init);
secprop->AddInitFunction(&TIMER_Init);//done
secprop->AddInitFunction(&CMOS_Init);//done
MSG_Add("DOSBOX_CONFIGFILE_HELP",
"language -- Select another language file.\n"
"memsize -- Amount of memory DOSBox has in megabytes.\n"
"machine -- The type of machine tries to emulate:hercules,cga,tandy,pcjr,vga.\n"
"captures -- Directory where things like wave,midi,screenshot get captured.\n"
);
secprop=control->AddSection_prop("render",&RENDER_Init,true);
secprop->Add_int("frameskip",0);
secprop->Add_bool("aspect",false);
secprop->Add_string("scaler","normal2x");
MSG_Add("RENDER_CONFIGFILE_HELP",
"frameskip -- How many frames DOSBox skips before drawing one.\n"
"aspect -- Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n"
"scaler -- Scaler used to enlarge/enhance low resolution modes.\n"
" Supported are none,normal2x,normal3x,advmame2x,advmame3x,hq2x,hq3x,\n"
" 2xsai,super2xsai,supereagle,advinterp2x,advinterp3x,\n"
" tv2x,tv3x,rgb2x,rgb3x,scan2x,scan3x.\n"
" If forced is appended (like scaler=hq2x forced), the scaler will be used\n"
" even if the result might not be desired.\n"
);
Pint = secprop->Add_int("frameskip",Property::Changeable::Always,0);
Pint->SetMinMax(0,10);
Pint->Set_help("How many frames DOSBox skips before drawing one.");
Pbool = secprop->Add_bool("aspect",Property::Changeable::Always,false);
Pbool->Set_help("Do aspect correction, if your output method doesn't support scaling this can slow things down!.");
Pmulti = secprop->Add_multi("scaler",Property::Changeable::Always," ");
Pmulti->Set_help("Scaler used to enlarge/enhance low resolution modes. If 'forced' is appended,the scaler will be used even if the result might not be desired.");
Pstring = Pmulti->GetSection()->Add_string("type",Property::Changeable::Always,"normal2x");
const char *scalers[] = {
"none", "normal2x", "normal3x",
#if RENDER_USE_ADVANCED_SCALERS>2
"advmame2x", "advmame3x", "advinterp2x", "advinterp3x", "hq2x", "hq3x", "2xsai", "super2xsai", "supereagle",
#endif
#if RENDER_USE_ADVANCED_SCALERS>0
"tv2x", "tv3x", "rgb2x", "rgb3x", "scan2x", "scan3x",
#endif
0 };
Pstring->Set_values(scalers);
const char* force[] = { "", "forced", 0 };
Pstring = Pmulti->GetSection()->Add_string("force",Property::Changeable::Always,"");
Pstring->Set_values(force);
secprop=control->AddSection_prop("cpu",&CPU_Init,true);//done
const char* cores[] = { "auto",
#if (C_DYNAMIC_X86) || (C_DYNREC)
secprop->Add_string("core","auto");
#else
secprop->Add_string("core","normal");
"dynamic",
#endif
secprop->Add_string("cycles","auto");
secprop->Add_int("cycleup",500);
secprop->Add_int("cycledown",20);
MSG_Add("CPU_CONFIGFILE_HELP",
"core -- CPU Core used in emulation: normal,simple"
#if (C_DYNAMIC_X86) || (C_DYNREC)
",dynamic,auto.\n"
" auto switches from normal to dynamic if appropriate"
#endif
".\n"
"cycles -- Amount of instructions DOSBox tries to emulate each millisecond.\n"
" Setting this value too high results in sound dropouts and lags.\n"
" You can also let DOSBox guess the correct value by setting it to max.\n"
" The default setting (auto) switches to max if appropriate.\n"
"cycleup -- Amount of cycles to increase/decrease with keycombo.\n"
"cycledown Setting it lower than 100 will be a percentage.\n"
);
"normal", "simple",0 };
Pstring = secprop->Add_string("core",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(cores);
Pstring->Set_help("CPU Core used in emulation. auto will switch to dynamic if available and appropriate.");
Pmulti = secprop->Add_multi("cycles",Property::Changeable::Always," ");
Pmulti->Set_help(
"Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags. Cycles can be set in 3 ways:"
" 'auto' tries to guess what a game needs.\n"
" It usually works, but can fail for certain games.\n"
" 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails.\n"
" (Example: fixed 4000)\n"
" 'max' will allocate as much cycles as your computer is able to handle\n");
const char* cyclest[] = { "auto","fixed","max" };
Pstring = Pmulti->GetSection()->Add_string("type",Property::Changeable::Always,"auto");
Pstring->Set_values(cyclest);
Pstring = Pmulti->GetSection()->Add_string("parameters",Property::Changeable::Always,"");
Pint = secprop->Add_int("cycleup",Property::Changeable::Always,500);
Pint->SetMinMax(1,1000000);
Pint->Set_help("Amount of cycles to increase/decrease with keycombo.");
Pint = secprop->Add_int("cycledown",Property::Changeable::Always,20);
Pint->SetMinMax(1,1000000);
Pint->Set_help("Setting it lower than 100 will be a percentage.");
#if C_FPU
secprop->AddInitFunction(&FPU_Init);
#endif
@ -390,168 +416,229 @@ void DOSBOX_Init(void) {
secprop->AddInitFunction(&KEYBOARD_Init);
secprop=control->AddSection_prop("mixer",&MIXER_Init);
secprop->Add_bool("nosound",false);
secprop->Add_int("rate",22050);
secprop->Add_int("blocksize",2048);
secprop->Add_int("prebuffer",10);
Pbool = secprop->Add_bool("nosound",Property::Changeable::OnlyAtStart,false);
Pbool->Set_help("Enable silent mode, sound is still emulated though.");
MSG_Add("MIXER_CONFIGFILE_HELP",
"nosound -- Enable silent mode, sound is still emulated though.\n"
"rate -- Mixer sample rate, setting any devices higher than this will\n"
" probably lower their sound quality.\n"
"blocksize -- Mixer block size, larger blocks might help sound stuttering\n"
" but sound will also be more lagged.\n"
"prebuffer -- How many milliseconds of data to keep on top of the blocksize.\n"
);
Pint = secprop->Add_int("rate",Property::Changeable::OnlyAtStart,22050);
Pint->Set_values(rates);
Pint->Set_help("Mixer sample rate, setting any devices higher than this will probably lower their sound quality.");
const char *blocksizes[] = {
"2048", "4096", "8192", "1024", "512", "256", 0};
Pint = secprop->Add_int("blocksize",Property::Changeable::OnlyAtStart,2048);
Pint->Set_values(blocksizes);
Pint->Set_help("Mixer block size, larger blocks might help sound stuttering but sound will also be more lagged.");
Pint = secprop->Add_int("prebuffer",Property::Changeable::OnlyAtStart,10);
Pint->SetMinMax(0,100);
Pint->Set_help("How many milliseconds of data to keep on top of the blocksize.");
secprop=control->AddSection_prop("midi",&MIDI_Init,true);//done
secprop->AddInitFunction(&MPU401_Init,true);//done
secprop->Add_string("mpu401","intelligent");
secprop->Add_string("device","default");
secprop->Add_string("config","");
MSG_Add("MIDI_CONFIGFILE_HELP",
"mpu401 -- Type of MPU-401 to emulate: none, uart or intelligent.\n"
"device -- Device that will receive the MIDI data from MPU-401.\n"
" This can be default,alsa,oss,win32,coreaudio,coremidi,none.\n"
"config -- Special configuration options for the device. In Windows put\n"
" the id of the device you want to use. See README for details.\n"
);
const char* mputypes[] = { "intelligent", "uart", "none",0};
// FIXME: add some way to offer the actually available choices.
const char *devices[] = { "default", "win32", "alsa", "oss", "coreaudio", "coremidi","none", 0};
Pstring = secprop->Add_string("mpu401",Property::Changeable::WhenIdle,"intelligent");
Pstring->Set_values(mputypes);
Pstring->Set_help("Type of MPU-401 to emulate.");
Pstring = secprop->Add_string("device",Property::Changeable::WhenIdle,"default");
Pstring->Set_values(devices);
Pstring->Set_help("Device that will receive the MIDI data from MPU-401.");
Pstring = secprop->Add_string("config",Property::Changeable::WhenIdle,"");
Pstring->Set_help("Special configuration options for the device driver. This is usually the id of the device you want to use. See README for details.");
#if C_DEBUG
secprop=control->AddSection_prop("debug",&DEBUG_Init);
#endif
secprop=control->AddSection_prop("sblaster",&SBLASTER_Init,true);//done
secprop->Add_string("sbtype","sb16");
secprop->Add_hex("sbbase",0x220);
secprop->Add_int("irq",7);
secprop->Add_int("dma",1);
secprop->Add_int("hdma",5);
secprop->Add_bool("mixer",true);
secprop->Add_string("oplmode","auto");
secprop->Add_int("oplrate",22050);
const char* sbtypes[] = { "sb1", "sb2", "sbpro1", "sbpro2", "sb16", "none", 0 };
Pstring = secprop->Add_string("sbtype",Property::Changeable::WhenIdle,"sb16");
Pstring->Set_values(sbtypes);
Pstring->Set_help("Type of sblaster to emulate.");
Phex = secprop->Add_hex("sbbase",Property::Changeable::WhenIdle,0x220);
Phex->Set_values(ios);
Phex->Set_help("The IO address of the soundblaster.");
Pint = secprop->Add_int("irq",Property::Changeable::WhenIdle,7);
Pint->Set_values(irqs);
Pint->Set_help("The IRQ number of the soundblaster.");
Pint = secprop->Add_int("dma",Property::Changeable::WhenIdle,1);
Pint->Set_values(dmas);
Pint->Set_help("The DMA number of the soundblaster.");
Pint = secprop->Add_int("hdma",Property::Changeable::WhenIdle,5);
Pint->Set_values(dmas);
Pint->Set_help("The High DMA number of the soundblaster.");
Pbool = secprop->Add_bool("mixer",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Allow the soundblaster mixer to modify the DOSBox mixer.");
const char* opltypes[]={ "auto", "cms", "opl2", "dualopl2", "opl3", "none", 0};
Pstring = secprop->Add_string("oplmode",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(opltypes);
Pstring->Set_help("Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.");
Pint = secprop->Add_int("oplrate",Property::Changeable::WhenIdle,22050);
Pint->Set_values(rates);
Pint->Set_help("Sample rate of OPL music emulation.");
MSG_Add("SBLASTER_CONFIGFILE_HELP",
"sbtype -- Type of sblaster to emulate:none,sb1,sb2,sbpro1,sbpro2,sb16.\n"
"sbbase,irq,dma,hdma -- The IO/IRQ/DMA/High DMA address of the soundblaster.\n"
"mixer -- Allow the soundblaster mixer to modify the DOSBox mixer.\n"
"oplmode -- Type of OPL emulation: auto,cms,opl2,dualopl2,opl3.\n"
" On auto the mode is determined by sblaster type.\n"
" All OPL modes are 'Adlib', except for CMS.\n"
"oplrate -- Sample rate of OPL music emulation.\n"
);
secprop=control->AddSection_prop("gus",&GUS_Init,true); //done
secprop->Add_bool("gus",true);
secprop->Add_int("gusrate",22050);
secprop->Add_hex("gusbase",0x240);
secprop->Add_int("irq1",5);
secprop->Add_int("irq2",5);
secprop->Add_int("dma1",3);
secprop->Add_int("dma2",3);
secprop->Add_string("ultradir","C:\\ULTRASND");
Pbool = secprop->Add_bool("gus",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable the Gravis Ultrasound emulation.");
MSG_Add("GUS_CONFIGFILE_HELP",
"gus -- Enable the Gravis Ultrasound emulation.\n"
"gusbase,irq1,irq2,dma1,dma2 -- The IO/IRQ/DMA addresses of the \n"
" Gravis Ultrasound. (Same IRQ's and DMA's are OK.)\n"
"gusrate -- Sample rate of Ultrasound emulation.\n"
"ultradir -- Path to Ultrasound directory. In this directory\n"
" there should be a MIDI directory that contains\n"
" the patch files for GUS playback. Patch sets used\n"
" with Timidity should work fine.\n"
);
Pint = secprop->Add_int("gusrate",Property::Changeable::WhenIdle,22050);
Pint->Set_values(rates);
Pint->Set_help("Sample rate of Ultrasound emulation.");
Phex = secprop->Add_hex("gusbase",Property::Changeable::WhenIdle,0x240);
Phex->Set_values(ios);
Phex->Set_help("The IO addresses of the Gravis Ultrasound.");
Pint = secprop->Add_int("irq1",Property::Changeable::WhenIdle,5);
Pint->Set_values(irqs);
Pint->Set_help("The first IRQ number of the Gravis Ultrasound. (Same IRQs are OK.)");
Pint = secprop->Add_int("irq2",Property::Changeable::WhenIdle,5);
Pint->Set_values(irqs);
Pint->Set_help("The second IRQ number of the Gravis Ultrasound. (Same IRQs are OK.)");
Pint = secprop->Add_int("dma1",Property::Changeable::WhenIdle,3);
Pint->Set_values(dmas);
Pint->Set_help("The first DMA addresses of the Gravis Ultrasound. (Same DMAs are OK.)");
Pint = secprop->Add_int("dma2",Property::Changeable::WhenIdle,3);
Pint->Set_values(dmas);
Pint->Set_help("The second DMA addresses of the Gravis Ultrasound. (Same DMAs are OK.)");
Pstring = secprop->Add_string("ultradir",Property::Changeable::WhenIdle,"C:\\ULTRASND");
Pstring->Set_help(
"Path to Ultrasound directory. In this directory\n"
"there should be a MIDI directory that contains\n"
"the patch files for GUS playback. Patch sets used\n"
"with Timidity should work fine.");
secprop = control->AddSection_prop("speaker",&PCSPEAKER_Init,true);//done
Pbool = secprop->Add_bool("pcspeaker",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable PC-Speaker emulation.");
Pint = secprop->Add_int("pcrate",Property::Changeable::WhenIdle,22050);
Pint->Set_values(rates);
Pint->Set_help("Sample rate of the PC-Speaker sound generation.");
secprop=control->AddSection_prop("speaker",&PCSPEAKER_Init,true);//done
secprop->Add_bool("pcspeaker",true);
secprop->Add_int("pcrate",22050);
secprop->AddInitFunction(&TANDYSOUND_Init,true);//done
secprop->Add_string("tandy","auto");
secprop->Add_int("tandyrate",22050);
secprop->AddInitFunction(&DISNEY_Init,true);//done
secprop->Add_bool("disney",true);
const char* tandys[] = { "auto", "on", "off", 0};
Pstring = secprop->Add_string("tandy",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(tandys);
Pstring->Set_help("Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.");
Pint = secprop->Add_int("tandyrate",Property::Changeable::WhenIdle,22050);
Pint->Set_values(rates);
Pint->Set_help("Sample rate of the Tandy 3-Voice generation.");
MSG_Add("SPEAKER_CONFIGFILE_HELP",
"pcspeaker -- Enable PC-Speaker emulation.\n"
"pcrate -- Sample rate of the PC-Speaker sound generation.\n"
"tandy -- Enable Tandy Sound System emulation (off,on,auto).\n"
" For auto Tandysound emulation is present only if machine is set to tandy.\n"
"tandyrate -- Sample rate of the Tandy 3-Voice generation.\n"
"disney -- Enable Disney Sound Source emulation. Covox Voice Master and Speech Thing compatible.\n"
);
secprop->AddInitFunction(&DISNEY_Init,true);//done
Pbool = secprop->Add_bool("disney",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).");
secprop=control->AddSection_prop("joystick",&BIOS_Init,false);//done
MSG_Add("JOYSTICK_CONFIGFILE_HELP",
"joysticktype -- Type of joystick to emulate: auto (default), none,\n"
" 2axis (supports two joysticks,\n"
" 4axis (supports one joystick, first joystick used),\n"
" 4axis_2 (supports one joystick, second joystick used),\n"
" fcs (Thrustmaster), ch (CH Flightstick).\n"
" none disables joystick emulation.\n"
" auto chooses emulation depending on real joystick(s).\n"
"timed -- enable timed intervals for axis. (false is old style behaviour).\n"
"autofire -- continuously fires as long as you keep the button pressed.\n"
"swap34 -- swap the 3rd and the 4th axis. can be useful for certain joysticks.\n"
"buttonwrap -- enable button wrapping at the number of emulated buttons.\n"
);
secprop->AddInitFunction(&INT10_Init);
secprop->AddInitFunction(&MOUSE_Init); //Must be after int10 as it uses CurMode
secprop->AddInitFunction(&JOYSTICK_Init);
secprop->Add_string("joysticktype","auto");
secprop->Add_bool("timed",true);
secprop->Add_bool("autofire",false);
secprop->Add_bool("swap34",false);
secprop->Add_bool("buttonwrap",true);
const char* joytypes[] = { "auto", "2axis", "4axis", "4axis_2", "fcs", "ch", "none",0};
Pstring = secprop->Add_string("joysticktype",Property::Changeable::WhenIdle,"auto");
Pstring->Set_values(joytypes);
Pstring->Set_help(
"Type of joystick to emulate: auto (default), none,\n"
"2axis (supports two joysticks),\n"
"4axis (supports one joystick, first joystick used),\n"
"4axis_2 (supports one joystick, second joystick used),\n"
"fcs (Thrustmaster), ch (CH Flightstick).\n"
"none disables joystick emulation.\n"
"auto chooses emulation depending on real joystick(s).");
Pbool = secprop->Add_bool("timed",Property::Changeable::WhenIdle,true);
Pbool->Set_help("enable timed intervals for axis. (false is old style behaviour).");
Pbool = secprop->Add_bool("autofire",Property::Changeable::WhenIdle,false);
Pbool->Set_help("continuously fires as long as you keep the button pressed.");
Pbool = secprop->Add_bool("swap34",Property::Changeable::WhenIdle,false);
Pbool->Set_help("swap the 3rd and the 4th axis. can be useful for certain joysticks.");
Pbool = secprop->Add_bool("buttonwrap",Property::Changeable::WhenIdle,true);
Pbool->Set_help("enable button wrapping at the number of emulated buttons.");
// had to rename these to serial due to conflicts in config
secprop=control->AddSection_prop("serial",&SERIAL_Init,true);
secprop->Add_string("serial1","dummy");
secprop->Add_string("serial2","dummy");
secprop->Add_string("serial3","disabled");
secprop->Add_string("serial4","disabled");
MSG_Add("SERIAL_CONFIGFILE_HELP",
"serial1-4 -- set type of device connected to com port.\n"
" Can be disabled, dummy, modem, nullmodem, directserial.\n"
" Additional parameters must be in the same line in the form of\n"
" parameter:value. Parameter for all types is irq.\n"
" for directserial: realport (required), rxdelay (optional).\n"
" for modem: listenport (optional).\n"
" for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n"
" transparent, port, inhsocket (all optional).\n"
" Example: serial1=modem listenport:5000\n"
);
const char* serials[] = { "dummy", "disabled", "modem", "nullmodem",
#if defined(WIN32) || defined(OS2)
"directserial realport:COM1", "directserial realport:COM2",
#else
"directserial realport:ttyS0", "directserial realport:ttyS1",
#endif
0};
Pstring = secprop->Add_string("serial1",Property::Changeable::WhenIdle,"dummy");
Pstring->Set_values(serials);
Pstring->Set_help(
"set type of device connected to com port.\n"
"Can be disabled, dummy, modem, nullmodem, directserial.\n"
"Additional parameters must be in the same line in the form of\n"
"parameter:value. Parameter for all types is irq.\n"
"for directserial: realport (required), rxdelay (optional).\n"
"for modem: listenport (optional).\n"
"for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n"
" transparent, port, inhsocket (all optional).\n"
"Example: serial1=modem listenport:5000");
Pstring = secprop->Add_string("serial2",Property::Changeable::WhenIdle,"dummy");
Pstring->Set_values(serials);
Pstring->Set_help("see serial1");
Pstring = secprop->Add_string("serial3",Property::Changeable::WhenIdle,"disabled");
Pstring->Set_values(serials);
Pstring->Set_help("see serial1");
Pstring = secprop->Add_string("serial4",Property::Changeable::WhenIdle,"disabled");
Pstring->Set_values(serials);
Pstring->Set_help("see serial1");
/* All the DOS Related stuff, which will eventually start up in the shell */
//TODO Maybe combine most of the dos stuff in one section like ems,xms
secprop=control->AddSection_prop("dos",&DOS_Init,false);//done
secprop->AddInitFunction(&XMS_Init,true);//done
secprop->Add_bool("xms",true);
Pbool = secprop->Add_bool("xms",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable XMS support.");
secprop->AddInitFunction(&EMS_Init,true);//done
secprop->Add_bool("ems",true);
secprop->Add_bool("umb",true);
Pbool = secprop->Add_bool("ems",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable EMS support.");
Pbool = secprop->Add_bool("umb",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable UMB support.");
secprop->AddInitFunction(&DOS_KeyboardLayout_Init,true);
secprop->Add_string("keyboardlayout", "none");
MSG_Add("DOS_CONFIGFILE_HELP",
"xms -- Enable XMS support.\n"
"ems -- Enable EMS support.\n"
"umb -- Enable UMB support.\n"
"keyboardlayout -- Language code of the keyboard layout (or none).\n"
);
Pstring = secprop->Add_string("keyboardlayout",Property::Changeable::WhenIdle, "none");
Pstring->Set_help("Language code of the keyboard layout (or none).");
// Mscdex
secprop->AddInitFunction(&MSCDEX_Init);
secprop->AddInitFunction(&DRIVES_Init);
secprop->AddInitFunction(&CDROM_Image_Init);
#if C_IPX
secprop=control->AddSection_prop("ipx",&IPX_Init,true);
secprop->Add_bool("ipx", false);
MSG_Add("IPX_CONFIGFILE_HELP",
"ipx -- Enable ipx over UDP/IP emulation.\n"
);
Pbool = secprop->Add_bool("ipx",Property::Changeable::WhenIdle, false);
Pbool->Set_help("Enable ipx over UDP/IP emulation.");
#endif
// secprop->AddInitFunction(&CREDITS_Init);
//TODO ?
secline=control->AddSection_line("autoexec",&AUTOEXEC_Init);
MSG_Add("AUTOEXEC_CONFIGFILE_HELP",
"Lines in this section will be run at startup.\n"