Esempio n. 1
0
        public static void Main(string[] args)
        {
            ParseCommandLineArgs(args, out romPath);
            if (string.IsNullOrWhiteSpace(romPath))
            {
                Environment.Exit(-1);
            }
            Configure();

            StreamWriter logWriter      = null;
            bool         loggingEnabled = !string.IsNullOrWhiteSpace(logPath);

            if (loggingEnabled)
            {
                logWriter = new StreamWriter(logPath);
                if (loggingEnabled)
                {
                    Console.SetOut(logWriter);
                }
            }

            try
            {
                var emulator = Boot();
                using var game = new MonoGameBoy(emulator, romPath, useBootRom, loggingEnabled, config);
                game.Run();
            }
            finally
            {
                if (logWriter != null)
                {
                    logWriter.Dispose();
                }
            }
        }
Esempio n. 2
0
 private static void RunGame(string sceneName)
 {
     Console.WriteLine();
     Console.WriteLine($"Loading scene {sceneName}...");
     Console.WriteLine("Keys:");
     Console.WriteLine(" [T] Display tileset");
     Console.WriteLine(" [B] Display background map");
     Console.WriteLine(" [W] Display window layer");
     Console.WriteLine(" [S] Display sprite layer");
     Console.WriteLine(" [Space] Display screen");
     Console.WriteLine(" [Esc] Exit");
     using (var game = new MonoGameBoy(sceneName))
         game.Run();
 }