コード例 #1
0
        public static void LoadRom_NET(string RomFile)
        {
            // -> EmuHawk Process only
            //Loads a rom inside Bizhawk from a Filename.

            RTC_Core.StopSound();

            var args = new BizHawk.Client.EmuHawk.MainForm.LoadRomArgs();

            if (RomFile == null)
            {
                RomFile = GlobalWin.MainForm.CurrentlyOpenRom;
            }

            var lra = new BizHawk.Client.EmuHawk.MainForm.LoadRomArgs {
                OpenAdvanced = new OpenAdvanced_OpenRom {
                    Path = RomFile
                }
            };

            RTC_Hooks.AllowCaptureRewindState = false;
            GlobalWin.MainForm.LoadRom(RomFile, lra);
            RTC_Hooks.AllowCaptureRewindState = true;

            RTC_Core.StartSound();
        }
コード例 #2
0
        public static void LoadRom(string RomFile)
        {
            List <string> MemoryBanks = null;

            if (isLoaded)
            {
                MemoryBanks = new List <string>(); //Saves current targetted zones
                foreach (object oneItem in RTC_MemoryZones.SelectedDomains)
                {
                    MemoryBanks.Add(oneItem.ToString());
                }
            }

            GlobalWin.Sound.StopSound();
            GlobalWin.DisplayManager.NeedsToPaint = false;

            var args = new BizHawk.Client.EmuHawk.MainForm.LoadRomArgs();

            if (RomFile == null)
            {
                RomFile = GlobalWin.MainForm.CurrentlyOpenRom;
            }

            var lra = new BizHawk.Client.EmuHawk.MainForm.LoadRomArgs {
                OpenAdvanced = new OpenAdvanced_OpenRom {
                    Path = RomFile
                }
            };

            GlobalWin.MainForm.LoadRom(RomFile, lra);

            GlobalWin.DisplayManager.NeedsToPaint = true;
            GlobalWin.Sound.StartSound();

            if (isLoaded)
            {
                RTC_MemoryZones.RefreshDomains(); //refresh and reload zones
                int nbZones = coreForm.lbMemoryZones.Items.Count;

                for (int i = 0; i < nbZones; i++)
                {
                    foreach (string SelectedItem in MemoryBanks)
                    {
                        if (coreForm.lbMemoryZones.Items[i].ToString() == SelectedItem)
                        {
                            coreForm.lbMemoryZones.SetSelected(i, true);
                            break;
                        }
                    }
                }
            }
        }