Пример #1
0
        public Cpu(IEmulationInstance emulator, ComponentParameters parameters)
        {
            Debug.Assert(emulator != null);
            Debug.Assert(parameters != null);

            _caps     = new CpuCapabilities();
            _stats    = new RuntimeStatistics();
            _emulator = emulator;
            _params   = parameters;

            _lastSyscall = -1;
            _syscalls    = new BiosFunction[1024];

#if STATS
            _timer = new PerformanceTimer();
            _timeSinceLastIpsPrint = 0.0;
#endif

            _clock  = new Clock();
            _memory = new Memory();

            // Order matters as the lookup is linear and stupid... should be changed somehow
            //_memory->DefineSegment( MemoryType::PhysicalMemory, "Main Memory", 0x08000000, 0x01FFFFFF );
            //_memory->DefineSegment( MemoryType::PhysicalMemory, "Hardware Vectors", 0x1FC00000, 0x000FFFFF );
            //_memory->DefineSegment( MemoryType::PhysicalMemory, "Scratchpad", 0x00010000, 0x00003FFF );
            //_memory->DefineSegment( MemoryType::PhysicalMemory, "Frame Buffer", 0x04000000, 0x001FFFFF );
            //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 1", 0x1C000000, 0x03BFFFFF );
            //_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 2", 0x1FD00000, 0x002FFFFF );

            _core0 = new Core(this, 0, "Allegrex", CoreAttributes.HasCp2);
            _core1 = new Core(this, 1, "Media Engine", CoreAttributes.Default);

            _codeCache      = new CodeCache();
            _context        = new GenerationContext();
            _context.Cpu    = this;
            _context.Core0  = _core0;
            _context.Memory = _memory;

            _executionMode = ExecutionMode.Run;
            _firstExecute  = true;
        }
Пример #2
0
		public Cpu( IEmulationInstance emulator, ComponentParameters parameters )
		{
			Debug.Assert( emulator != null );
			Debug.Assert( parameters != null );

			_caps = new CpuCapabilities();
			_stats = new RuntimeStatistics();
			_emulator = emulator;
			_params = parameters;

			_lastSyscall = -1;
			_syscalls = new BiosFunction[ 1024 ];

#if STATS
			_timer = new PerformanceTimer();
			_timeSinceLastIpsPrint = 0.0;
#endif

			_clock = new Clock();
			_memory = new Memory();
			
			// Order matters as the lookup is linear and stupid... should be changed somehow
			//_memory->DefineSegment( MemoryType::PhysicalMemory, "Main Memory", 0x08000000, 0x01FFFFFF );
			//_memory->DefineSegment( MemoryType::PhysicalMemory, "Hardware Vectors", 0x1FC00000, 0x000FFFFF );
			//_memory->DefineSegment( MemoryType::PhysicalMemory, "Scratchpad", 0x00010000, 0x00003FFF );
			//_memory->DefineSegment( MemoryType::PhysicalMemory, "Frame Buffer", 0x04000000, 0x001FFFFF );
			//_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 1", 0x1C000000, 0x03BFFFFF );
			//_memory->DefineSegment( MemoryType::HardwareMapped, "Hardware IO 2", 0x1FD00000, 0x002FFFFF );

			_core0 = new Core( this, 0, "Allegrex", CoreAttributes.HasCp2 );
			_core1 = new Core( this, 1, "Media Engine", CoreAttributes.Default );

			_codeCache = new CodeCache();
			_context = new GenerationContext();
			_context.Cpu = this;
			_context.Core0 = _core0;
			_context.Memory = _memory;

			_executionMode = ExecutionMode.Run;
			_firstExecute = true;
		}