This is my program for this Contest....
i'll publish a beta next days....
Note: a front end, its a visual panel, for made config changes more easy and fast ...in this case, the application works as a "tool" for DOSBox emulator that allows you customize the dosbox.conf file, with a few mouse clicks...
¿¿What is DOSBox??
DOSBox: is a x86 DOS style console emulator....with it, you can run oldiest DOS abbandonware applications and games, in real mode and protected mode emulating a MS-DOS style console, into modern operating systems (as Windows XP for example).
Note think, that it does, is an emulation of a Operating System INTO another one, mostly, this task NEEDS a poweful machine to made some kind of programs executed run smoothly (i'm using a Pentium 4 - 3.0Ghz machine with 1Gb RAM ...i don't test DOSBox in older machines, and don't know how it works in it...this not means that not work...for example i also test in 1,4 with 512 mb of RAM memory and for some games, runs good....i'm meaning OLDER machines like a P200 or P450 processors)
Features of the FrontEnd:
- Trying made a Built-in Games Database for having like a Game Library (stored in DBase file)
- Intended for lastest version of DOSBox v0.65
- Nice eye-candy interface, winamp Skinned kind stylish
- Once you Pre-Generate config, you can modify manually the resulting dosbox.conf file
- made trying keep low-resources requeriments...
- most controls and parameters have pre-fixed values...then no much posibilities of enter wrong values.
- most variable parameters have bound-checking avoid wrong values
Requeriments: BDE installation for Database engine (DBF) and DOSBox program installed
this is the main bunch of code that generate the config file for console (a Memo component is used for store the lines)
AnsiString Temporal;
int pos; int result;
char HW_SCALE_VAR[30];
char SENSITIVITY_VAR[30];
Memo2->Visible = False;
Memo2->Refresh();
Memo1->Visible = True;
Memo1->Refresh();
////Preparing first section [SDL]///////////////////////////
Memo1->Clear();
Memo1->Lines->Add("[SDL]");
//Fullscreen
if(FULLSCREEN==True)
{ Memo1->Lines->Add("fullscreen=true");}
else {Memo1->Lines->Add("fullscreen=false");}
//Double Buffered
if(DOUBLEBUFFER == True)
{Memo1->Lines->Add("fulldouble=true"); }
else { Memo1->Lines->Add("fulldouble=false");}
//Don't resize when fullscreened
//DOSBox 0.63 version
//if(FULLFIXED == True)
//{Memo1->Lines->Add("fullfixed=true"); }
// else { Memo1->Lines->Add("fullfixed=false");}
//Set the resolution for Fullscreen
Memo1->Lines->Add("fullresolution=original");
//Set the resolution for Window
Memo1->Lines->Add("windowresolution=original");
//Set the rendering output mode
//we use the same variable for 2 or 3 assignments
sprintf(HW_SCALE_VAR, "output=%s", OUTPUT);
Memo1->Lines->Add(HW_SCALE_VAR);
//Reescaling (when applied)
//sprintf(HW_SCALE_VAR, "hwscale=%s", HWSCALE);
//Memo1->Lines->Add(HW_SCALE_VAR);
//Mouse AutoLock
if(AUTOLOCK == True)
{Memo1->Lines->Add("autolock=true"); }
else { Memo1->Lines->Add("autolock=false");}
//Mouse Sensitivity
sprintf(SENSITIVITY_VAR, "sensitivity=%d", SENSITIVITY);
Memo1->Lines->Add(SENSITIVITY_VAR);
//Wait on Error (in DosBox console)
if(WAIT_ON_ERROR == True)
{Memo1->Lines->Add("waitonerror=true"); }
else { Memo1->Lines->Add("waitonerror=false");}
//Level of Priority for Dosbox
sprintf(PRIORITY_VAR, "priority=%s", PRIORITY.c_str());
Memo1->Lines->Add(PRIORITY_VAR);
//Mapperfile
MAPPERFILE = Edit_MAPPERFILE->Text;
sprintf(MAPPERFILE_VAR, "mapperfile=%s", MAPPERFILE.c_str());
Memo1->Lines->Add(MAPPERFILE_VAR);
//Use Scan codes
if(usescancodes == True)
{Memo1->Lines->Add("usescancodes=true"); }
else { Memo1->Lines->Add("usescancodes=false");}
//2nd section [dosbox]////////////////////
///////////////////////////////////////////////////////
Memo1->Lines->Add("[dosbox]");
Memo1->Lines->Add("language=");
sprintf(TEMP_STRING, "machine=%s", machine.c_str());
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "captures=%s", captures.c_str());
Memo1->Lines->Add(TEMP_STRING);
if(Edit_MEMORY_SIZE->Text.ToInt() > 600)
{
memsize = 64;
Edit_MEMORY_SIZE->Text = 64;
}
else { memsize = Edit_MEMORY_SIZE->Text.ToInt();}
sprintf(TEMP_STRING, "memsize=%d", memsize);
Memo1->Lines->Add(TEMP_STRING);
//////////////////////////////////////////////////////
//3rd section [render]///////////////////
//////////////////////////////////////////////////////
Memo1->Lines->Add("[render]");
//Frameskip
sprintf(TEMP_STRING, "frameskip=%d", frameskip);
Memo1->Lines->Add(TEMP_STRING);
//Aspect
if(aspect == True)
{Memo1->Lines->Add("aspect=true"); }
else { Memo1->Lines->Add("aspect=false");}
//Scaler
sprintf(TEMP_STRING, "scaler=%s", scaler);
Memo1->Lines->Add(TEMP_STRING);
///////////////////////////////////////////////////////
//////SECCION [CPU]
Memo1->Lines->Add("[cpu]");
//Core
sprintf(TEMP_STRING, "core=%s", core);
Memo1->Lines->Add(TEMP_STRING);
//Cycles/////////////////////////////////////////////
cycles = Edit_CYCLES->Text.ToInt();
if(cycles > 40000)
{ cycles = 3000; Edit_CYCLES->Text = 3000; }
if(CheckBox_AUTO_CYCLES->Checked == True)
{
sprintf(TEMP_STRING, "cycles=auto");
Memo1->Lines->Add(TEMP_STRING);
}
else { sprintf(TEMP_STRING, "cycles=%d", cycles);
Memo1->Lines->Add(TEMP_STRING);
}
//Cycles UP//////////////////////////////////////////
sprintf(TEMP_STRING, "cycleup=%d", cycleup);
Memo1->Lines->Add(TEMP_STRING);
//Cycles DOWN
sprintf(TEMP_STRING, "cycledown=%d", cycledown);
Memo1->Lines->Add(TEMP_STRING);
//DOS SECTION//////////////////////////////////////////////////
sprintf(TEMP_STRING, "[dos]");
Memo1->Lines->Add(TEMP_STRING);
if(xms_memory == True)
{Memo1->Lines->Add("xms=true"); }
else { Memo1->Lines->Add("xms=false");}
if(ems_memory == True)
{Memo1->Lines->Add("ems=true"); }
else { Memo1->Lines->Add("ems=false");}
sprintf(TEMP_STRING, "umb=%s", ComboBox_UMB->Text);
Memo1->Lines->Add(TEMP_STRING);
//MIXER SECTION////////////////////////////////////////////////
sprintf(TEMP_STRING, "[mixer]");
Memo1->Lines->Add(TEMP_STRING);
if(nosound == True)
{Memo1->Lines->Add("nosound=true"); }
else { Memo1->Lines->Add("nosound=false");}
//RATE
sprintf(TEMP_STRING, "rate=%d", rate);
Memo1->Lines->Add(TEMP_STRING);
//BlockSize
sprintf(TEMP_STRING, "blocksize=%d", blocksize);
Memo1->Lines->Add(TEMP_STRING);
//prebuffer
sprintf(TEMP_STRING, "prebuffer=%d", prebuffer);
Memo1->Lines->Add(TEMP_STRING);
//SB SECTION/////////////////////////////////////////////////
sprintf(TEMP_STRING, "[sblaster]");
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "type=%s", type);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "irq=%d", irq);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "dma=%d", dma);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "hdma=%d", hdma);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "oplmode=%s", oplmode);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "oplrate=%d", oplrate);
Memo1->Lines->Add(TEMP_STRING);
if(mixer == True)
{Memo1->Lines->Add("mixer=true"); }
else { Memo1->Lines->Add("mixer=false");}
//MIDI SECTION////////////////////////////////////////////////
sprintf(TEMP_STRING, "[midi]");
Memo1->Lines->Add(TEMP_STRING);
if(mpu401 == True)
{
sprintf(TEMP_STRING, "mpu401=true");
Memo1->Lines->Add(TEMP_STRING);
}
else {
sprintf(TEMP_STRING, "mpu401=false");
Memo1->Lines->Add(TEMP_STRING);
}
sprintf(TEMP_STRING, "device=%s", device);
Memo1->Lines->Add(TEMP_STRING);
//Gravis UltraSound SECTION/////////////////////////////////////
sprintf(TEMP_STRING, "[gus]");
Memo1->Lines->Add(TEMP_STRING);
if(gus == True)
{
sprintf(TEMP_STRING, "gus=true");
Memo1->Lines->Add(TEMP_STRING);
}
else {
sprintf(TEMP_STRING, "gus=false");
Memo1->Lines->Add(TEMP_STRING);
}
sprintf(TEMP_STRING, "gusrate=%d", gusrate);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "gusbase=%d", gusbase);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "irq1=%d", irq1);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "irq2=%d", irq2);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "dma1=%d", dma1);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "dma2=%d", dma2);
Memo1->Lines->Add(TEMP_STRING);
sprintf(TEMP_STRING, "ultrasnd=%s", Edit_ULTRADIR->Text);
Memo1->Lines->Add(TEMP_STRING);
///////////////////////////////////////////////////////
//here i copy from other temporary buffer, the rest
//of the config, .
//////////////////////////////////////////////////////
AnsiString CADENA_TEMPORAL;
CADENA_TEMPORAL = LMDMemo2->Lines->GetTextStr();
Memo1->Add(CADENA_TEMPORAL);
/////////////////////////////////////////////////////////
//sprintf(TEMP_STRING, "mount %s %s", ComboBox1->Text.c_str(), ruta_juegos);
//Memo1->Add(TEMP_STRING);
/////////////////////////////////////////////////////////
chdir(appPath.c_str());