示例#1
0
 public static Process StartDOSBox(DOSBoxOptions options)
 {
     return(Process.Start(new ProcessStartInfo
     {
         WorkingDirectory = workingDirectory,
         FileName = exe,
         Arguments = GetDOSBoxArguments(options)
     }));
 }
示例#2
0
 public static Process GetUnstartedProcess(DOSBoxOptions options)
 {
     return(new Process
     {
         StartInfo = new ProcessStartInfo
         {
             WorkingDirectory = workingDirectory,
             FileName = exe,
             Arguments = GetDOSBoxArguments(options)
         }
     });
 }
示例#3
0
        private static string GetDOSBoxArguments(DOSBoxOptions options)
        {
            var args = new StringBuilder();

            // Game config options
            if (options.GameOptions != null)
            {
                foreach (KeyValue option in options.GameOptions)
                {
                    args.Append(" -c \"SET " + option.Key + "=" + option.Value + "\" ");
                }

                foreach (KeyValue option in options.GameOptions)
                {
                    if (option.Key == "fullscreen")
                    {
                        if (option.Value == "true")
                        {
                            args.Append(" -fullscreen");
                        }
                    }
                }
            }


            // Fullscreen
            //for (int i = 0; i < options.GameOptions.Count; i++)
            //{
            //    if (options.GameOptions[i].Key == "fullscreen") {
            //        if (options.GameOptions[i].Value == "true") {
            //            args.Append(" -fullscreen");
            //        }
            //    }
            //}

            // Mount drive and start game
            args.Append(" -c \"C:\"");
            args.Append($"-c \"mount c '{DOSBoxC}\\{options.ExeFolderPath}'\"");
            args.Append(" -c \"C:\"");
            args.Append($"-c \"{options.ExeName} {options.Arguments}\"");

            // auto exit dosbox after exe
            //args.Append(" -c \"exit\"");

            return(args.ToString());
        }