public void SetUp() { PspConfig = new PspConfig(); PspConfig.HleModulesDll = Assembly.GetExecutingAssembly(); PspEmulatorContext = new PspEmulatorContext(PspConfig); PspEmulatorContext.SetInstanceType<PspMemory, LazyPspMemory>(); PspEmulatorContext.SetInstanceType<GpuImpl, GpuImplNull>(); PspEmulatorContext.SetInstanceType<PspAudioImpl, AudioImplNull>(); Memory = PspEmulatorContext.GetInstance<PspMemory>(); ThreadManager = PspEmulatorContext.GetInstance<HleThreadManager>(); Processor = PspEmulatorContext.GetInstance<CpuProcessor>(); MipsAssembler = new MipsAssembler(new PspMemoryStream(Memory)); }
public void Init(HleThreadManager ThreadManager, PspMemory PspMemory, HleMemoryManager MemoryManager) { var BlockType = Attributes.HasFlag(MsgPipeAttributes.UseHighAddress) ? MemoryPartition.Anchor.High : MemoryPartition.Anchor.Low ; this.ThreadManager = ThreadManager; this.PspMemory = PspMemory; this.PoolPartition = MemoryManager.GetPartition(PartitionId).Allocate( Size, BlockType, Alignment: 16, Name: "<MsgPipe> : " + Name ); }
public HleThread(PspEmulatorContext PspEmulatorContext, CpuThreadState CpuThreadState) { this.HleInterruptManager = PspEmulatorContext.GetInstance<HleInterruptManager>(); this.HleThreadManager = PspEmulatorContext.GetInstance<HleThreadManager>(); this.MethodCache = CpuThreadState.CpuProcessor.MethodCache; this.PspConfig = CpuThreadState.CpuProcessor.PspConfig; if (this.PspConfig.UseCoRoutines) { this.Coroutine = HleThreadManager.Processor.CoroutinePool.CreateCoroutine(this.Name, MainLoop); } else { this.GreenThread = new GreenThread(); GreenThread.InitAndStartStopped(MainLoop); } this.CpuThreadState = CpuThreadState; }
public int sceKernelResumeDispatchThread(HleThreadManager.SCE_KERNEL_DISPATCHTHREAD_STATE State) { ThreadManager.DispatchingThreads = State; return 0; }