当前位置: 首页>>代码示例>>C#>>正文


C# CpuThreadState.CopyRegistersFrom方法代码示例

本文整理汇总了C#中CSPspEmu.Core.Cpu.CpuThreadState.CopyRegistersFrom方法的典型用法代码示例。如果您正苦于以下问题:C# CpuThreadState.CopyRegistersFrom方法的具体用法?C# CpuThreadState.CopyRegistersFrom怎么用?C# CpuThreadState.CopyRegistersFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSPspEmu.Core.Cpu.CpuThreadState的用法示例。


在下文中一共展示了CpuThreadState.CopyRegistersFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExecuteQueued

        public int ExecuteQueued(CpuThreadState CpuThreadState, bool MustReschedule)
        {
            int ExecutedCount = 0;

            if (HasScheduledCallbacks)
            {
                //Console.Error.WriteLine("STARTED CALLBACKS");
                while (HasScheduledCallbacks)
                {
                    var HleCallback = DequeueScheduledCallback();

                    var FakeCpuThreadState = new CpuThreadState(CpuProcessor);
                    FakeCpuThreadState.CopyRegistersFrom(CpuThreadState);
                    HleCallback.SetArgumentsToCpuThreadState(FakeCpuThreadState);

                    try
                    {
                        HleInterop.Execute(FakeCpuThreadState);
                    }
                    finally
                    {
                        ExecutedCount++;
                    }

                    //Console.Error.WriteLine("  CALLBACK ENDED : " + HleCallback);
                    if (MustReschedule)
                    {
                        //Console.Error.WriteLine("    RESCHEDULE");
                        break;
                    }
                }
                //Console.Error.WriteLine("ENDED CALLBACKS");
            }

            return ExecutedCount;
        }
开发者ID:mrcmunir,项目名称:cspspemu,代码行数:36,代码来源:HleCallbackManager.cs

示例2: sceKernelStartModule

        public int sceKernelStartModule(CpuThreadState CpuThreadState, int ModuleId, int ArgumentsSize, uint ArgumentsPointer, int* Status, SceKernelSMOption* SceKernelSMOption)
        {
            var Module = Modules.Get(ModuleId);

            if (Module.Loaded)
            {
                var NewCpuThreadState = new CpuThreadState(CpuThreadState.CpuProcessor);
                NewCpuThreadState.CopyRegistersFrom(CpuThreadState);
                NewCpuThreadState.GP = Module.InitInfo.GP;
                NewCpuThreadState.CallerModule = Module;

                var ThreadId = (int)ThreadManForUser.sceKernelCreateThread(NewCpuThreadState, "ModuleThread", Module.InitInfo.PC, 10, 1024, PspThreadAttributes.ClearStack, null);
                ThreadManForUser.sceKernelStartThread(NewCpuThreadState, ThreadId, ArgumentsSize, ArgumentsPointer);
            }

            //throw(new NotImplementedException());
            if (Status != null)
            {
                *Status = 0;
            }
            return 0;
        }
开发者ID:SsJVasto,项目名称:cspspemu,代码行数:22,代码来源:ModuleMgrForUser.cs

示例3: ExecuteQueued

        public void ExecuteQueued(CpuThreadState BaseCpuThreadState)
        {
            if (Enabled)
            {
                HleCallback[] HleCallbackListCopy;
                lock (HleCallbackList)
                {
                    HleCallbackListCopy = HleCallbackList.ToArray();
                    HleCallbackList.Clear();
                }

                foreach (var HleCallback in HleCallbackListCopy)
                {
                    var FakeCpuThreadState = new CpuThreadState(CpuProcessor);
                    FakeCpuThreadState.CopyRegistersFrom(BaseCpuThreadState);
                    HleCallback.SetArgumentsToCpuThreadState(FakeCpuThreadState);

                    HleInterop.Execute(FakeCpuThreadState);
                    //Console.Error.WriteLine("Execute queued");

                    // Execute just one!
                    break;
                }
            }
        }
开发者ID:e-COS,项目名称:cspspemu,代码行数:25,代码来源:HleInterruptManager.cs


注:本文中的CSPspEmu.Core.Cpu.CpuThreadState.CopyRegistersFrom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。