示例#1
0
        public void btnBlastToggle_Click(object sender, EventArgs e)
        {
            if (Global.Emulator is NullEmulator)
            {
                return;
            }

            if (RTC_Core.currentStashkey == null || RTC_Core.currentStashkey.blastlayer.Layer.Count == 0)
            {
                IsCorruptionApplied = false;
                return;
            }

            if (!IsCorruptionApplied)
            {
                IsCorruptionApplied = true;
                RTC_Core.currentStashkey.blastlayer.Apply();
            }
            else
            {
                IsCorruptionApplied = false;

                RTC_HellgenieEngine.ClearCheats();

                if (RTC_Core.lastBlastLayerBackup != null)
                {
                    RTC_Core.lastBlastLayerBackup.Apply();
                }
            }


            RTC_Restore.SaveRestore();
        }
示例#2
0
        static void STEP_REWIND()
        {
            if (RTC_Core.ClearCheatsOnRewind)
            {
                RTC_HellgenieEngine.ClearCheats();
            }

            RTC_TimeFlow.RewindStep();
        }
示例#3
0
        public static void LOAD_GAME_BEGIN()
        {
            if (DisableRTC)
            {
                return;
            }

            isNormalAdvance = false;

            RTC_NetCore.HugeOperationStart();

            RTC_HellgenieEngine.ClearCheats(true);
            RTC_PipeEngine.ClearPipes(true);
        }
示例#4
0
        static void STEP_REWIND()
        {
            if (DisableRTC)
            {
                return;
            }

            if (RTC_Core.ClearCheatsOnRewind)
            {
                RTC_HellgenieEngine.ClearCheats();
            }

            if (RTC_Core.ClearPipesOnRewind)
            {
                RTC_PipeEngine.ClearPipes();
            }
        }
示例#5
0
        public static void LOAD_GAME_DONE()
        {
            if (!RTC_Core.isLoaded)
            {
                return;
            }

            if (RTC_Core.currentGameName == lastGameName)
            {
                RTC_MemoryZones.RefreshAndKeepDomains();
            }

            RTC_HellgenieEngine.ClearCheats();


            //Load Game vars into RTC_Core
            PathEntry pathEntry = Global.Config.PathEntries[Global.Game.System, "Savestates"] ??
                                  Global.Config.PathEntries[Global.Game.System, "Base"];

            RTC_Core.currentGameSystem = RTC_Core.EmuFolderCheck(pathEntry.SystemDisplayName);
            RTC_Core.currentGameName   = PathManager.FilesystemSafeName(Global.Game);
            RTC_Core.lastOpenRom       = GlobalWin.MainForm.CurrentlyOpenRom;
            RTC_RPC.RefreshPlugin();

            if (RTC_Core.currentGameName != lastGameName)
            {
                RTC_TimeStack.Reset();
                RTC_MemoryZones.AutoSelectDomains();
            }

            if (RTC_MemoryZones.pendingSelectedDomains != null)
            {
                RTC_MemoryZones.setSelectedDomains(RTC_MemoryZones.pendingSelectedDomains);
                RTC_MemoryZones.pendingSelectedDomains = null;
            }
            lastGameName = RTC_Core.currentGameName;

            //RTC_Restore.SaveRestore();

            RTC_RPC.SendToKillSwitch("UNFREEZE");
        }
示例#6
0
        private void cbSelectedEngine_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbNightmareEngine.Visible           = false;
            gbHellgenieEngine.Visible           = false;
            gbDistortionEngine.Visible          = false;
            gbFreezeEngine.Visible              = false;
            gbExternalRomPlugin.Visible         = false;
            gbMemoryZonesManagement.Visible     = true;
            gbFreezeEngineActive.Visible        = false;
            RTC_Core.ghForm.pnIntensity.Visible = true;

            btnAutoCorrupt.ForeColor = Color.OrangeRed;

            switch (cbSelectedEngine.SelectedItem.ToString())
            {
            case "Nightmare Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.NIGHTMARE;
                gbNightmareEngine.Visible = true;
                break;

            case "Hellgenie Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.HELLGENIE;
                gbHellgenieEngine.Visible = true;
                break;

            case "Distortion Engine":
                RTC_Core.SelectedEngine    = CorruptionEngine.DISTORTION;
                gbDistortionEngine.Visible = true;
                break;

            case "Freeze Engine":
                RTC_Core.SelectedEngine = CorruptionEngine.FREEZE;
                gbFreezeEngine.Visible  = true;
                break;

            case "External ROM Plugin":
                RTC_Core.SelectedEngine     = CorruptionEngine.EXTERNALROM;
                gbExternalRomPlugin.Visible = true;

                RTC_Core.AutoCorrupt     = false;
                btnAutoCorrupt.ForeColor = Color.Silver;

                RTC_Core.ghForm.pnIntensity.Visible = false;
                break;

            default:
                break;
            }


            if (cbSelectedEngine.SelectedItem.ToString() == "External ROM Plugin")
            {
                labelBlastRadius.Visible        = false;
                labelIntensity.Visible          = false;
                labelIntensityTimes.Visible     = false;
                labelErrorDelay.Visible         = false;
                labelErrorDelaySteps.Visible    = false;
                nmIteratorSteps.Visible         = false;
                nmIntensity.Visible             = false;
                track_ErrorDelay.Visible        = false;
                track_Intensity.Visible         = false;
                cbBlastRadius.Visible           = false;
                gbMemoryZonesManagement.Visible = false;
            }
            else if (cbSelectedEngine.SelectedItem.ToString() == "Freeze Engine")
            {
                labelBlastRadius.Visible        = true;
                labelIntensity.Visible          = true;
                labelIntensityTimes.Visible     = true;
                labelErrorDelay.Visible         = true;
                labelErrorDelaySteps.Visible    = true;
                nmIteratorSteps.Visible         = true;
                nmIntensity.Visible             = true;
                track_ErrorDelay.Visible        = true;
                track_Intensity.Visible         = true;
                cbBlastRadius.Visible           = true;
                gbMemoryZonesManagement.Visible = false;
                gbFreezeEngineActive.Visible    = true;
            }
            else
            {
                labelBlastRadius.Visible     = true;
                labelIntensity.Visible       = true;
                labelIntensityTimes.Visible  = true;
                labelErrorDelay.Visible      = true;
                labelErrorDelaySteps.Visible = true;
                nmIteratorSteps.Visible      = true;
                nmIntensity.Visible          = true;
                track_ErrorDelay.Visible     = true;
                track_Intensity.Visible      = true;
                cbBlastRadius.Visible        = true;
            }

            RTC_HellgenieEngine.ClearCheats();
            if (RTC_Core.tfForm != null && RTC_Core.tfForm.Visible)
            {
                RTC_Core.tfForm.RecalculateCorruptFactor();
            }

            RTC_Restore.SaveRestore();
        }
示例#7
0
        private void btnClearCheats_Click(object sender, EventArgs e)
        {
            RTC_HellgenieEngine.ClearCheats();

            //RTC_Restore.SaveRestore();
        }
        private void cbSelectedEngine_SelectedIndexChanged(object sender, EventArgs e)
        {
            gbNightmareEngine.Visible   = false;
            gbHellgenieEngine.Visible   = false;
            gbDistortionEngine.Visible  = false;
            gbFreezeEngine.Visible      = false;
            gbPipeEngine.Visible        = false;
            gbVectorEngine.Visible      = false;
            gbExternalRomPlugin.Visible = false;

            pnCustomPrecision.Visible = false;

            RTC_Core.coreForm.btnAutoCorrupt.Visible    = true;
            RTC_Core.ghForm.pnIntensity.Visible         = true;
            RTC_Core.ecForm.pnGeneralParameters.Visible = true;

            switch (cbSelectedEngine.SelectedItem.ToString())
            {
            case "Nightmare Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.NIGHTMARE;
                gbNightmareEngine.Visible = true;
                pnCustomPrecision.Visible = true;
                break;

            case "Hellgenie Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.HELLGENIE;
                gbHellgenieEngine.Visible = true;
                pnCustomPrecision.Visible = true;
                break;

            case "Distortion Engine":
                RTC_Core.SelectedEngine    = CorruptionEngine.DISTORTION;
                gbDistortionEngine.Visible = true;
                pnCustomPrecision.Visible  = true;
                break;

            case "Freeze Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.FREEZE;
                gbFreezeEngine.Visible    = true;
                pnCustomPrecision.Visible = true;
                break;

            case "Pipe Engine":
                RTC_Core.SelectedEngine   = CorruptionEngine.PIPE;
                gbPipeEngine.Visible      = true;
                pnCustomPrecision.Visible = true;
                break;

            case "Vector Engine":
                RTC_Core.SelectedEngine = CorruptionEngine.VECTOR;
                gbVectorEngine.Visible  = true;
                break;

            case "External ROM Plugin":

                RTC_Core.SelectedEngine     = CorruptionEngine.EXTERNALROM;
                gbExternalRomPlugin.Visible = true;

                RTC_Core.coreForm.AutoCorrupt               = false;
                RTC_Core.coreForm.btnAutoCorrupt.Visible    = false;
                RTC_Core.ecForm.pnGeneralParameters.Visible = false;

                RTC_Core.ghForm.pnIntensity.Visible = false;
                break;

            default:
                break;
            }

            RTC_Core.SendCommandToBizhawk(new RTC_Command(CommandType.REMOTE_SET_ENGINE)
            {
                objectValue = RTC_Core.SelectedEngine
            });

            if (cbSelectedEngine.SelectedItem.ToString() == "External ROM Plugin")
            {
                labelBlastRadius.Visible     = false;
                labelIntensity.Visible       = false;
                labelIntensityTimes.Visible  = false;
                labelErrorDelay.Visible      = false;
                labelErrorDelaySteps.Visible = false;
                nmErrorDelay.Visible         = false;
                nmIntensity.Visible          = false;
                track_ErrorDelay.Visible     = false;
                track_Intensity.Visible      = false;
                cbBlastRadius.Visible        = false;
            }
            else if (cbSelectedEngine.SelectedItem.ToString() == "Freeze Engine")
            {
                labelBlastRadius.Visible     = true;
                labelIntensity.Visible       = true;
                labelIntensityTimes.Visible  = true;
                labelErrorDelay.Visible      = true;
                labelErrorDelaySteps.Visible = true;
                nmErrorDelay.Visible         = true;
                nmIntensity.Visible          = true;
                track_ErrorDelay.Visible     = true;
                track_Intensity.Visible      = true;
                cbBlastRadius.Visible        = true;
            }
            else
            {
                labelBlastRadius.Visible     = true;
                labelIntensity.Visible       = true;
                labelIntensityTimes.Visible  = true;
                labelErrorDelay.Visible      = true;
                labelErrorDelaySteps.Visible = true;
                nmErrorDelay.Visible         = true;
                nmIntensity.Visible          = true;
                track_ErrorDelay.Visible     = true;
                track_Intensity.Visible      = true;
                cbBlastRadius.Visible        = true;
            }

            cbSelectedEngine.BringToFront();

            RTC_HellgenieEngine.ClearCheats();
            RTC_PipeEngine.ClearPipes();
        }
示例#9
0
        public void btnCorrupt_Click(object sender, EventArgs e)
        {
            if (RTC_Core.coreForm.cbClearCheatsOnRewind.Checked == true)
            {
                RTC_HellgenieEngine.ClearCheats();
            }

            if (cbAutoLoadState.Checked && btnCorrupt.Text.ToUpper() != "MERGE")
            {
                if (btnParentKeys[Convert.ToInt32(currentSelectedState)] != null)
                {
                    if (!LoadState())
                    {
                        return;
                    }
                }
                else
                {
                    GlobalWin.Sound.StopSound();
                    MessageBox.Show("There is no SaveState in the selected box,\nPress 'Switch: Save/Load State' then Press 'SAVE'");
                    GlobalWin.Sound.StartSound();
                    return;
                }
            }


            if (rbCorrupt.Checked)
            {
                BlastLayer bl = RTC_Core.Blast();

                if (bl != null)
                {
                    IsCorruptionApplied = true;
                }

                if (cbStashCorrupted.Checked)
                {
                    if (bl == null)
                    {
                        return;
                    }

                    RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), btnParentKeys[Convert.ToInt32(currentSelectedState)], bl);

                    DontLoadSelectedStash = true;
                    lbStashHistory.Items.Add(RTC_Core.currentStashkey);
                    lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                    lbStockpile.ClearSelected();
                }

                if (cbRenderAtCorrupt.Checked)
                {
                    StartRender();
                }
            }
            else if (rbInject.Checked)
            {
                if (lbStashHistory.SelectedIndex == -1 && lbStockpile.SelectedIndex == -1)
                {
                    return;
                }

                if (cbAutoLoadState.Checked)
                {
                    if (btnParentKeys[Convert.ToInt32(currentSelectedState)] != null)
                    {
                        LoadState();
                    }
                    else
                    {
                        GlobalWin.Sound.StopSound();
                        MessageBox.Show("There is no SaveState in the selected box,\nPress 'Switch: Save/Load State' then Press 'SAVE'");
                        GlobalWin.Sound.StartSound();
                        return;
                    }
                }

                if (lbStashHistory.SelectedIndex != -1)
                {
                    RTC_Core.currentStashkey = (lbStashHistory.SelectedItem as StashKey);
                    RTC_Core.currentStashkey.Inject();
                    IsCorruptionApplied = true;
                }

                if (lbStockpile.SelectedIndex != -1)
                {
                    RTC_Core.currentStashkey = (lbStockpile.SelectedItem as StashKey);
                    RTC_Core.currentStashkey.Inject();
                    IsCorruptionApplied = true;
                }

                if (cbStashInjected.Checked)
                {
                    if (lbStashHistory.SelectedIndex != -1)
                    {
                        RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), btnParentKeys[Convert.ToInt32(currentSelectedState)], (lbStashHistory.SelectedItem as StashKey).blastlayer);
                    }

                    if (lbStockpile.SelectedIndex != -1)
                    {
                        RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), btnParentKeys[Convert.ToInt32(currentSelectedState)], (lbStockpile.SelectedItem as StashKey).blastlayer);
                    }

                    DontLoadSelectedStash = true;
                    lbStashHistory.Items.Add(RTC_Core.currentStashkey);
                    lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                    lbStockpile.ClearSelected();
                }

                if (cbRenderAtCorrupt.Checked)
                {
                    StartRender();
                }
            }
            else if (rbOriginal.Checked)
            {
                if (lbStashHistory.SelectedIndex == -1 && lbStockpile.SelectedIndex == -1)
                {
                    return;
                }

                if (lbStashHistory.SelectedIndex != -1)
                {
                    RTC_Core.currentStashkey = (lbStashHistory.SelectedItem as StashKey);
                    RTC_Core.currentStashkey.RunOriginal();
                    IsCorruptionApplied = false;
                }

                if (lbStockpile.SelectedIndex != -1)
                {
                    RTC_Core.currentStashkey = (lbStockpile.SelectedItem as StashKey);
                    IsCorruptionApplied      = false;
                }
            }
            else
            {
                if (lbStockpile.SelectedItems.Count > 1)
                {
                    BlastLayer bl = new BlastLayer();

                    foreach (StashKey item in lbStockpile.SelectedItems)
                    {
                        bl.Layer.AddRange(item.blastlayer.Layer);
                    }

                    //bl.Apply();
                    isStockpileSelectMultiple = false;

                    if (cbStashCorrupted.Checked)
                    {
                        if (bl == null)
                        {
                            return;
                        }

                        RTC_Core.currentStashkey = new StashKey(RTC_Core.GetRandomKey(), (lbStockpile.SelectedItem as StashKey).ParentKey, bl);

                        ApplyCurrentStashkey();

                        DontLoadSelectedStash = true;
                        lbStashHistory.Items.Add(RTC_Core.currentStashkey);
                        lbStashHistory.SelectedIndex = lbStashHistory.Items.Count - 1;
                        lbStockpile.ClearSelected();
                        IsCorruptionApplied = true;
                    }

                    if (cbRenderAtCorrupt.Checked)
                    {
                        StartRender();
                    }
                }
                else
                {
                    MessageBox.Show("Select 2 or more items from the Current Stockpile to merge.");
                }
            }

            RTC_Restore.SaveRestore();
        }
示例#10
0
 private static void PreApplyStashkey()
 {
     RTC_HellgenieEngine.ClearCheats(true);
     RTC_PipeEngine.ClearPipes(true);
 }