コード例 #1
0
        private void StartEmulatorProcess(string baseDir)
        {
            /*
             * var process = new Process();
             * process.StartInfo.WorkingDirectory = Environment.CurrentDirectory + @"\fceux";
             * process.StartInfo.FileName = "fceux.exe";
             * process.StartInfo.Arguments = cartridgeFile;
             * process.EnableRaisingEvents = true;
             * process.Exited += (sender, args) => { _emulatorProcess = null; };
             *
             * process.Start();
             * _emulatorProcess = process;
             */
            var test    = InteropEmu.TestDll();
            var version = InteropEmu.GetMesenVersion();

            InteropEmu.SetDisplayLanguage(Language.English);
            InteropEmu.InitDll();

            _notifListener = new InteropEmu.NotificationListener(InteropEmu.ConsoleId.Master);
            _notifListener.OnNotification += HandleNotification;

            ApplyConfig();
            InteropEmu.ScreenSize size = InteropEmu.GetScreenSize(false);
            _renderControl.Size = new Size(size.Width, size.Height);
            InteropEmu.InitializeEmu(baseDir, _mainWindow.Handle, _renderControl.Handle, false, false, false);



            InteropEmu.AddKnownGameFolder(@"C:\Users\dkmrs\Documents\NesDev\sc");
            ApplyInputConfig();
            ApplyAudioConfig();
            ApplyPreferenceConfig();
            ApplyEmulationConfig();

            InteropEmu.SetNesModel(NesModel.Auto);
            InteropEmu.DebugSetDebuggerConsole(InteropEmu.ConsoleId.Master);
        }