Exemplo n.º 1
0
        private void StateHistoryIntegrityCheckMenuItem_Click(object sender, EventArgs e)
        {
            if (!Emulator.DeterministicEmulation)
            {
                if (MessageBox.Show("The emulator is not deterministic. It might fail even if the difference isn't enough to cause a desync.\nContinue with check?", "Not Deterministic", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            GoToFrame(0);
            int lastState = 0;
            int goToFrame = CurrentTasMovie.TasStateManager.LastEmulatedFrame;

            do
            {
                Mainform.FrameAdvance();

                if (CurrentTasMovie.TasStateManager.HasState(Emulator.Frame))
                {
                    byte[] state     = (byte[])StatableEmulator.SaveStateBinary().Clone();                 // Why is this cloning it?
                    byte[] greenzone = CurrentTasMovie.TasStateManager[Emulator.Frame].Value;

                    if (!state.SequenceEqual(greenzone))
                    {
                        MessageBox.Show("Bad data between frames " + lastState + " and " + Emulator.Frame);
                        return;
                    }

                    lastState = Emulator.Frame;
                }
            }while (Emulator.Frame < goToFrame);

            MessageBox.Show("Integrity Check passed");
        }
Exemplo n.º 2
0
        private void StartNewProjectFromNowMenuItem_Click(object sender, EventArgs e)
        {
            if (AskSaveChanges())
            {
                int index = Emulator.Frame;

                TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
                    index, (byte[])StatableEmulator.SaveStateBinary().Clone());

                GlobalWin.MainForm.PauseEmulator();
                LoadFile(new FileInfo(newProject.Filename), true);
            }
        }
Exemplo n.º 3
0
        private void StartNewProjectFromNowMenuItem_Click(object sender, EventArgs e)
        {
            if (TasView.SelectedRows.Count() == 1 &&
                !CurrentTasMovie.StartsFromSavestate)
            {
                if (AskSaveChanges())
                {
                    int index = TasView.SelectedRows.First();
                    GoToFrame(index);

                    TasMovie newProject = CurrentTasMovie.ConvertToSavestateAnchoredMovie(
                        index, (byte[])StatableEmulator.SaveStateBinary().Clone());

                    GlobalWin.MainForm.PauseEmulator();
                    LoadFile(new FileInfo(newProject.Filename));
                }
            }
        }