Exemplo n.º 1
0
 public byte[] MakeIGTState(GscIntroSequence intro, byte[] initialState, int igt)
 {
     LoadState(initialState);
     CpuWrite("wGameTimeSeconds", (byte)(igt / 60));
     CpuWrite("wGameTimeFrames", (byte)(igt % 60));
     intro.ExecuteAfterIGT(this);
     return(SaveState());
 }
Exemplo n.º 2
0
    public static IGTResults IGTCheckParallel <Gb>(Gb[] gbs, int timesec, GscIntroSequence intro, int numIgts, Func <GameBoy, bool> fn = null, int ss = 0, int ssOverwrite = -1) where Gb : Gsc
    {
        gbs[0].SetTimeSec(timesec);
        intro.ExecuteUntilIGT(gbs[0]);
        byte[]   igtState = gbs[0].SaveState();
        byte[][] states   = new byte[numIgts][];
        MultiThread.For(numIgts, gbs, (gb, i) => {
            states[i] = gb.MakeIGTState(intro, igtState, i);
        });

        return(IGTCheckParallel(gbs, states, fn, ss, ssOverwrite));
    }
Exemplo n.º 3
0
    public IGTResults IGTCheck(int timesec, GscIntroSequence intro, int numIgts, Func <GameBoy, bool> fn = null, int ss = 0, int ssOverwrite = -1)
    {
        SetTimeSec(timesec);
        intro.ExecuteUntilIGT(this);
        byte[]   igtState = SaveState();
        byte[][] states   = new byte[numIgts][];
        for (int i = 0; i < numIgts; i++)
        {
            states[i] = MakeIGTState(intro, igtState, i);
        }

        return(IGTCheck(states, fn, ss, ssOverwrite));
    }
Exemplo n.º 4
0
    public static IGTResults IGTCheckParallel <Gb>(Gb[] gbs, int timesec, GscIntroSequence intro, int numIgts, Func <Gb, bool> fn = null, int ss = 0, int igtOffset = 0) where Gb : Gsc
    {
        gbs[0].SetTimeSec(timesec);
        intro.ExecuteUntilIGT(gbs[0]);
        byte[]     igtState    = gbs[0].SaveState();
        IGTResults introStates = new IGTResults(numIgts);

        MultiThread.For(numIgts, gbs, (gb, i) => {
            introStates[i] = gb.MakeIGTState(intro, igtState, i + igtOffset);
        });

        return(IGTCheckParallel(gbs, introStates, x => fn == null || fn((Gb)x), ss));
    }
Exemplo n.º 5
0
    public IGTResults IGTCheck(int timesec, GscIntroSequence intro, int numIgts, Func <bool> fn = null, int ss = 0, int igtOffset = 0)
    {
        SetTimeSec(timesec);
        intro.ExecuteUntilIGT(this);
        byte[]     igtState    = SaveState();
        IGTResults introStates = new IGTResults(numIgts);

        for (int i = 0; i < numIgts; i++)
        {
            introStates[i] = MakeIGTState(intro, igtState, i + igtOffset);
        }

        return(IGTCheck(introStates, fn, ss));
    }
Exemplo n.º 6
0
    public static void Test(byte x, byte y, byte hour, byte minute, byte momStep, byte audio, byte frameType, byte menuAccount, byte igt, GscIntroSequence intro, string path, string recordName = "")
    {
        MakeSave(x, y, hour, minute, momStep, audio, frameType, menuAccount, igt);
        Gold gb = new Gold();

        if (recordName != "")
        {
            gb.Record(recordName);
        }
        gb.SetTimeSec(120);
        intro.ExecuteUntilIGT(gb);
        gb.CpuWrite("wGameTimeFrames", igt);
        gb.Execute(path);
        ushort dvs = Textboxes(gb).DVs;

        Console.WriteLine("0x{0:x4}", dvs);
        gb.Dispose();
    }
Exemplo n.º 7
0
 public static IGTResults IGTCheckParallel <Gb>(int numThreads, int timesec, GscIntroSequence intro, int numIgts, Func <GameBoy, bool> fn = null, int ss = 0, int ssOverwrite = -1) where Gb : Gsc
 {
     return(IGTCheckParallel(MultiThread.MakeThreads <Gb>(numThreads), timesec, intro, numIgts, fn, ss, ssOverwrite));
 }