CSPspEmu.Core.Cpu.Dynarec.DynarecFunctionCompiler.CreateFunction C# (CSharp) Method

CreateFunction() public method

public CreateFunction ( IInstructionReader InstructionReader, uint PC, Action ExploreNewPcCallback = null, bool DoDebug = false, bool DoLog = false ) : DynarecFunction
InstructionReader IInstructionReader
PC uint
ExploreNewPcCallback Action
DoDebug bool
DoLog bool
return DynarecFunction
        public DynarecFunction CreateFunction(IInstructionReader InstructionReader, uint PC, Action<uint> ExploreNewPcCallback = null, bool DoDebug = false, bool DoLog = false)
        {
            switch (PC)
            {
                case SpecialCpu.ReturnFromFunction:
                    return new DynarecFunction()
                    {
                        AstNode = new AstNodeStmEmpty(),
                        EntryPC = PC,
                        Name = "SpecialCpu.ReturnFromFunction",
                        InstructionStats = new Dictionary<string,uint>(),
                        Delegate = (CpuThreadState) =>
                        {
                            if (CpuThreadState == null) return;
                            throw (new SpecialCpu.ReturnFromFunctionException());
                        }
                    };
                default:
                    var MipsMethodEmiter = new MipsMethodEmitter(CpuProcessor, PC, DoDebug, DoLog);
                    var InternalFunctionCompiler = new InternalFunctionCompiler(InjectContext, MipsMethodEmiter, this, InstructionReader, ExploreNewPcCallback, PC, DoLog);
                    return InternalFunctionCompiler.CreateFunction();
            }
        }