Inheritance: PspEmulatorComponent, IResetable
Exemplo n.º 1
0
 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;
 }
Exemplo n.º 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>()));
		}
Exemplo n.º 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);
        }
Exemplo n.º 4
0
		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));
		}
Exemplo n.º 5
0
        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;
            }
        }
Exemplo n.º 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);
            });
        }
Exemplo n.º 7
0
        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;
            }
        }
Exemplo n.º 8
0
		/// <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;
			}
		}
Exemplo n.º 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>();
 }
Exemplo n.º 10
0
		public FunctionViewerForm(CpuProcessor CpuProcessor)
		{
			this.CpuProcessor = CpuProcessor;
			InitializeComponent();
		}
Exemplo n.º 11
0
 public void SetUp()
 {
     Processor = PspEmulatorContext.GetInstance<CpuProcessor>();
     CpuThreadState = new CpuThreadState(Processor);
 }
Exemplo n.º 12
0
 public override void InitializeComponent()
 {
     this.Processor = PspEmulatorContext.GetInstance<CpuProcessor>();
     this.HleCallbackManager = PspEmulatorContext.GetInstance<HleCallbackManager>();
     this.HleInterruptManager = PspEmulatorContext.GetInstance<HleInterruptManager>();
 }
Exemplo n.º 13
0
        /// <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;
            }
        }
Exemplo n.º 14
0
 static public Action <CpuThreadState> CreateDelegateForPC(this CpuProcessor CpuProcessor, Stream MemoryStream, uint EntryPC)
 {
     return(FunctionGenerator.CreateDelegateForPC(CpuProcessor, MemoryStream, EntryPC));
 }
Exemplo n.º 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
         );
     }
 }