Inheritance: PspEmulatorComponent, IResetable
コード例 #1
0
ファイル: LlePspCpu.cs プロジェクト: soywiz/cspspemu
 public LlePspCpu(string Name, InjectContext InjectContext, CpuProcessor CpuProcessor, uint EntryPoint = 0x1fc00000)
 {
     this.Name = Name;
     //this.CachedGetMethodCache = PspEmulatorContext.GetInstance<CachedGetMethodCache>();
     this.CpuThreadState = new CpuThreadState(CpuProcessor);
     this.EntryPoint = EntryPoint;
 }
コード例 #2
0
		public void SetUp()
		{
			PspConfig = new PspConfig();
			PspEmulatorContext = new PspEmulatorContext(PspConfig);
			PspEmulatorContext.SetInstanceType<PspMemory, LazyPspMemory>();

			Processor = PspEmulatorContext.GetInstance<CpuProcessor>();
			MipsAssembler = new MipsAssembler(new PspMemoryStream(PspEmulatorContext.GetInstance<PspMemory>()));
		}
コード例 #3
0
        static public Action <CpuThreadState> CreateAndCacheDelegateForPC(this CpuProcessor CpuProcessor, Stream MemoryStream, uint EntryPC)
        {
            var Delegate = CpuProcessor.MethodCache.TryGetMethodAt(EntryPC);

            if (Delegate == null)
            {
                Delegate = CpuProcessor.CreateDelegateForPC(MemoryStream, EntryPC);
                CpuProcessor.MethodCache.SetMethodAt(EntryPC, Delegate);
            }
            return(Delegate);
        }
コード例 #4
0
ファイル: HlePspThreadTest.cs プロジェクト: shin527/cspspemu
		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));
		}
コード例 #5
0
ファイル: CpuThreadState.cs プロジェクト: mrcmunir/cspspemu
        public CpuThreadState(CpuProcessor Processor)
        {
            this.CpuProcessor = Processor;

            GPR = new GprList() { Processor = this };
            FPR = new FprList() { Processor = this };
            FPR_I = new FprListInteger() { Processor = this };

            for (int n = 0; n < 32; n++)
            {
                GPR[n] = 0;
                FPR[n] = 0.0f;
            }
        }
コード例 #6
0
        static public Action <CpuThreadState> CreateDelegateForString(this CpuProcessor CpuProcessor, String Assembly, bool BreakPoint = false)
        {
            var MemoryStream = new MemoryStream();

            MemoryStream.PreservePositionAndLock(() =>
            {
                var MipsAssembler = new MipsAssembler(MemoryStream);

                MipsAssembler.Assemble(Assembly);
            });
            var Delegate = CpuProcessor.CreateDelegateForPC(MemoryStream, 0);

            return((_CpuThreadState) =>
            {
                _CpuThreadState.StepInstructionCount = 1000000;
                Delegate(_CpuThreadState);
            });
        }
コード例 #7
0
ファイル: CpuThreadState.cs プロジェクト: mrcmunir/cspspemu
        public CpuThreadState(CpuProcessor Processor)
        {
            this.CpuProcessor = Processor;

            GPR = new GprList()
            {
                Processor = this
            };
            FPR = new FprList()
            {
                Processor = this
            };
            FPR_I = new FprListInteger()
            {
                Processor = this
            };

            for (int n = 0; n < 32; n++)
            {
                GPR[n] = 0;
                FPR[n] = 0.0f;
            }
        }
コード例 #8
0
ファイル: CpuThreadState.cs プロジェクト: shin527/cspspemu
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Processor"></param>
		public CpuThreadState(CpuProcessor Processor)
		{
			this.CpuProcessor = Processor;
			this.MethodCache = Processor.MethodCache;
			//this.Memory = Processor.Memory;

			GPR = new GprList() { CpuThreadState = this };
			FPR = new FprList() { CpuThreadState = this };
			C0R = new C0rList() { CpuThreadState = this };
			FPR_I = new FprListInteger() { CpuThreadState = this };
			Vfpr = new VfprList() { CpuThreadState = this };

			for (int n = 0; n < 32; n++)
			{
				GPR[n] = 0;
				FPR[n] = 0.0f;
			}
		}
コード例 #9
0
 public override void InitializeComponent()
 {
     this.Callbacks = new HleUidPool<HleCallback>();
     this.ScheduledCallbacks = new Queue<HleCallback>();
     this.CpuProcessor = PspEmulatorContext.GetInstance<CpuProcessor>();
     this.HleInterop = PspEmulatorContext.GetInstance<HleInterop>();
 }
コード例 #10
0
		public FunctionViewerForm(CpuProcessor CpuProcessor)
		{
			this.CpuProcessor = CpuProcessor;
			InitializeComponent();
		}
コード例 #11
0
ファイル: CpuEmiterTest.cs プロジェクト: mrcmunir/cspspemu
 public void SetUp()
 {
     Processor = PspEmulatorContext.GetInstance<CpuProcessor>();
     CpuThreadState = new CpuThreadState(Processor);
 }
コード例 #12
0
ファイル: HleThreadManager.cs プロジェクト: mrcmunir/cspspemu
 public override void InitializeComponent()
 {
     this.Processor = PspEmulatorContext.GetInstance<CpuProcessor>();
     this.HleCallbackManager = PspEmulatorContext.GetInstance<HleCallbackManager>();
     this.HleInterruptManager = PspEmulatorContext.GetInstance<HleInterruptManager>();
 }
コード例 #13
0
ファイル: CpuThreadState.cs プロジェクト: soywiz/cspspemu
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Processor"></param>
        public CpuThreadState(CpuProcessor Processor)
        {
            this.CpuProcessor = Processor;
            this.MethodCache = Processor.MethodCache;
            //this.Memory = Processor.Memory;

            GPR = new GprList() { CpuThreadState = this };
            FPR = new FprList() { CpuThreadState = this };
            C0R = new C0rList() { CpuThreadState = this };
            FPR_I = new FprListInteger() { CpuThreadState = this };
            Vfpr = new VfprList() { CpuThreadState = this };

            for (int n = 0; n < 32; n++)
            {
                GPR[n] = 0;
                FPR[n] = 0.0f;
            }

            VFR_CC_7 = VFR_CC_6 = VFR_CC_5 = VFR_CC_4 = VFR_CC_3 = VFR_CC_2 = VFR_CC_1 = VFR_CC_0 = true;

            for (int n = 0; n < 128; n++)
            {
                Vfpr[n] = 0.0f;
            }
        }
コード例 #14
0
 static public Action <CpuThreadState> CreateDelegateForPC(this CpuProcessor CpuProcessor, Stream MemoryStream, uint EntryPC)
 {
     return(FunctionGenerator.CreateDelegateForPC(CpuProcessor, MemoryStream, EntryPC));
 }
コード例 #15
0
 public override void InitializeComponent()
 {
     this.HleCallbackManager = PspEmulatorContext.GetInstance<HleCallbackManager>();
     this.CpuProcessor = PspEmulatorContext.GetInstance<CpuProcessor>();
     this.HleInterop = PspEmulatorContext.GetInstance<HleInterop>();
     //uint MaxHandlers = Enum.GetValues(typeof(PspInterrupts)).OfType<uint>().Max() + 1;
     InterruptHandlers = new HleInterruptHandler[(int)PspInterrupts._MAX];
     for (int n = 0; n < InterruptHandlers.Length; n++)
     {
         InterruptHandlers[n] = new HleInterruptHandler(
             this,
             (PspInterrupts)n,
             HleCallbackManager
         );
     }
 }