Пример #1
0
        public override void UpdateData()
        {
            string mem0 = Tokenizer.GetMemoryName(Arg0);
            string mem1 = Tokenizer.GetMemoryName(Arg1);

            switch (Operation)
            {
            case RegCalcOperation.Set: Data = mem0 + " = " + mem1; break;

            case RegCalcOperation.Inc: Data = mem0 + " += " + mem1; break;

            case RegCalcOperation.Dec: Data = mem0 + " -= " + mem1; break;

            case RegCalcOperation.Mul: Data = mem0 + " *= " + mem1; break;

            case RegCalcOperation.Div: Data = mem0 + " /= " + mem1; break;

            case RegCalcOperation.Mod: Data = mem0 + " %= " + mem1; break;

            case RegCalcOperation.And: Data = mem0 + " &= " + mem1; break;

            case RegCalcOperation.SetMemToByte: Data = mem0 + " = BYTE[script offset " + mem1 + "]"; break;

            case RegCalcOperation.SetMemToWord: Data = mem0 + " = WORD[script offset " + mem1 + "]"; break;

            case RegCalcOperation.SetByteToMem: Data = "BYTE[script offset " + mem0 + "] = " + mem1; break;

            case RegCalcOperation.SetWordToMem: Data = "WORD[script offset " + mem0 + "] = " + mem1; break;

            case RegCalcOperation.SetMemToLiteral: Data = mem0 + " = LITERAL[" + Arg0.ToString() + "]"; break;

            case RegCalcOperation.SetScriptPointer: Data = "Jump to " + mem0; break;                               //Set next instruction to [script offset mem0]. Equivalent to "Jump to mem0"

            case RegCalcOperation.SetScriptPointer2: Data = "Jump to script offset 2*" + mem1 + "+" + mem0; break; //Set next instruction to [script offset 2*mem1+mem0]. Equivalent to "Jump"

            case RegCalcOperation.RandomMod: Data = mem0 + " = randInt() % " + mem1; break;

            case RegCalcOperation.ClippedInc: Data = mem0 + " += " + mem1 + "(Clipped at 255)"; break;

            case RegCalcOperation.ClippedDec: Data = mem0 + " -= " + mem1 + "(Clipped at 0)"; break;

            case RegCalcOperation.IncBy1: Data = mem0 + " ++"; break;

            case RegCalcOperation.UnlockAlbum: Data = "Unlock album entry"; Data2 = Tokenizer.GetEvTitle(Arg0); break;     //Ensure Arg1 = 1

            case RegCalcOperation.SetSceneTitle: Data = "Set title"; Data2 = Tokenizer.GetSceneTitle(Arg0); break;

            case RegCalcOperation.UnlockMusic: Data = "Unlock music"; Data2 = Tokenizer.GetBgmTitle((Arg0 >> 1) & 0x7FF); break; //Ensure Arg1 = 1

            case RegCalcOperation.UnlockMovie: Data = "Unlock movie"; Data2 = "[UNDOCUMENTED] " + Arg0.ToString(); break;        //Ensure Arg1 = 1

            case RegCalcOperation.HasReadAllMessages: Data = mem0 + " = Has read all 34774 messages?"; break;
            }
        }
Пример #2
0
 private void ReportDuration(System.Diagnostics.Stopwatch stopwatch, string suffix, string port)
 {
     System.Diagnostics.Debug.WriteLine(string.Format(port + ": COMMAND+{0} DURATION: {6} {1}(0x{2}, 0x{3}, 0x{4}, 0x{5})", suffix, Command, Arg0.ToString("X8"), Arg1.ToString("X8"), Arg2.ToString("X8"), Arg3.ToString("X8"), stopwatch.Elapsed));
 }