private void UpdateBuilderOptions()
{
Options.EnableSSA = cbEnableSSA.Checked;
Options.EnableIROptimizations = cbEnableIROptimizations.Checked;
Options.EnableSparseConditionalConstantPropagation = cbEnableSparseConditionalConstantPropagation.Checked;
Options.GenerateNASMFile = cbGenerateNASMFile.Checked;
Options.GenerateASMFile = cbGenerateASMFile.Checked;
Options.GenerateMapFile = cbGenerateMapFile.Checked;
Options.ExitOnLaunch = cbExitOnLaunch.Checked;
Options.EnableQemuGDB = cbEnableQemuGDB.Checked;
Options.LaunchGDB = cbLaunchGDB.Checked;
Options.UseMultipleThreadCompiler = cbCompilerUsesMultipleThreads.Checked;
Options.MemoryInMB = (uint)nmMemory.Value;
Options.EnableInlinedMethods = cbInlinedMethods.Checked;
Options.VBEVideo = cbVBEVideo.Checked;
Options.BaseAddress = tbBaseAddress.Text.ParseHexOrDecimal();
Options.EmitSymbols = cbEmitSymbolTable.Checked;
Options.EmitRelocations = cbRelocationTable.Checked;
Options.Emitx86IRQMethods = cbEmitx86IRQMethods.Checked;
if (Options.VBEVideo)
{
string[] Mode = tbMode.Text.Split('x');
if (Mode.Length == 3)
{
try
{
int ModeWidth = int.Parse(Mode[0]); //Get Mode Width
int ModeHeight = int.Parse(Mode[1]); //Get Mode Height
int ModeDepth = int.Parse(Mode[2]); //Get Mode Depth
Options.Width = ModeWidth;
Options.Height = ModeHeight;
Options.Depth = ModeDepth;
}
catch (Exception e)
{
throw new Exception("An error occured while parsing VBE Mode: " + e.Message);
}
}
else
{
throw new Exception("An error occured while parsing VBE Mode: " + "There wasn't 3 arguments");
}
}
switch (cbImageFormat.SelectedIndex)
{
case 0: Options.ImageFormat = ImageFormat.IMG; break;
case 1: Options.ImageFormat = ImageFormat.ISO; break;
case 2: Options.ImageFormat = ImageFormat.VHD; break;
case 3: Options.ImageFormat = ImageFormat.VDI; break;
case 4: Options.ImageFormat = ImageFormat.VMDK; break;
default: break;
}
switch (cbEmulator.SelectedIndex)
{
case 0: Options.Emulator = EmulatorType.Qemu; break;
case 1: Options.Emulator = EmulatorType.Bochs; break;
case 2: Options.Emulator = EmulatorType.VMware; break;
default: break;
}
switch (cbDebugConnectionOption.SelectedIndex)
{
case 0: Options.DebugConnectionOption = DebugConnectionOption.None; break;
case 1: Options.DebugConnectionOption = DebugConnectionOption.Pipe; break;
case 2: Options.DebugConnectionOption = DebugConnectionOption.TCPServer; break;
case 3: Options.DebugConnectionOption = DebugConnectionOption.TCPClient; break;
default: break;
}
lbSource.Text = Path.GetFileName(Options.SourceFile);
lbSourceDirectory.Text = Path.GetDirectoryName(Options.SourceFile);
switch (cbBootFormat.SelectedIndex)
{
case 0: Options.BootFormat = BootFormat.Multiboot_0_7; break;
case 1: Options.BootFormat = BootFormat.Multiboot_0_7_video; break;
default: Options.BootFormat = BootFormat.NotSpecified; break;
}
switch (cbBootFileSystem.SelectedIndex)
{
case 0: Options.FileSystem = FileSystem.FAT12; break;
case 1: Options.FileSystem = FileSystem.FAT16; break;
default: break;
}
switch (cbPlatform.SelectedIndex)
{
case 0: Options.PlatformType = PlatformType.X86; break;
default: Options.PlatformType = PlatformType.NotSpecified; break;
}
switch (cbBootLoader.SelectedIndex)
{
case 0: Options.BootLoader = BootLoader.Syslinux_3_72; break;
case 1: Options.BootLoader = BootLoader.Syslinux_6_03; break;
case 2: Options.BootLoader = BootLoader.Grub_0_97; break;
case 3: Options.BootLoader = BootLoader.Grub_2_00; break;
default: break;
}
}