public Processor(IMemoryBank memory = null, IMemoryMap map = null, ushort?topOfStackAddress = null, float frequencyInMHz = 4, bool enableFlagPrecalculation = true) { // You can supply your own memory implementations, for example if you need to do RAM paging for >64K implementations. // Since there are several different methods for doing this and no 'official' method, there is no paged RAM implementation in the core code. FrequencyInMHz = frequencyInMHz; _windowsTicksPerZ80Tick = (int)Math.Ceiling(10 / frequencyInMHz); Registers = new Registers(this); Ports = new Ports(this); Memory = memory ?? new MemoryBank(); Memory.Initialise(this, map ?? new MemoryMap(MAX_MEMORY_SIZE_IN_BYTES, true)); IO = new ProcessorIO(this); TimingMode = TimingMode.FastAndFurious; InterruptMode = InterruptMode.IM0; _topOfStack = topOfStackAddress ?? 0; Registers.SP = _topOfStack; // If precalculation is enabled, all flag combinations for all input values for 8-bit ALU / bitwise operations are pre-built now // (but not the 16-bit ALU operations, the number space is far too big). // This is *slightly* faster than calculating them in real-time, but if you need to debug flag calculation you should // disable this and attach a debugger to the flag calculation methods in FlagLookup.cs. FlagLookup.EnablePrecalculation = enableFlagPrecalculation; FlagLookup.BuildFlagLookupTables(); // The Z80 instruction set needs to be built (all Instruction objects are created, bound to the microcode instances, and indexed into a hashtable - undocumented 'overloads' are built here too) InstructionSet.Build(); _debugging = Debugger.IsAttached; }
public DeviceViewModel(PortViewModel owner, IMemoryMap memoryMap) { Owner = owner; type = NodeTypes.device; Name = "Device"; Icon = "/Images/device.png"; this.memoryMap = memoryMap; this.memoryMap.HoldingRegisterChanged += MemoryMap_HoldingRegisterChanged; }
public SpriteHandler( IPPUMemoryMap ppuMemoryMap, PPURegisters registers, PaletteHandler paletteHandler) { this.registers = registers; this.ppuMemoryMap = ppuMemoryMap; this.paletteHandler = paletteHandler; }
public Mmu(IMemoryMap memoryMap, IRegisters registers) { this.MemoryMap = memoryMap; this.Registers = registers; // TODO: Initialize IO memory this.Stack = new Stack(this.MemoryMap, this.Registers.Sp); this.Reset(); }
public void CreateSlaves(CancellationToken token) { PortViewModel portModel; foreach (var port in Children) { portModel = (PortViewModel)port; foreach (var device in portModel.Children) { IMemoryMap map = ((DeviceViewModel)device).GetMemory(); ushort address = ((DeviceViewModel)device).Address; new Slave(address, portModel.GetPort(), map, token); } } }
public Processor( IMemoryMap memoryMap, Registers registers, FlagProcessor flagProcessor, OpcodeCycles opcodeCycles, InterruptController interruptController) { this.memoryMap = memoryMap; this.registers = registers; this.flagProcessor = flagProcessor; this.opcodeCycles = opcodeCycles; this.interruptController = interruptController; flags = registers.Flags; interruptsEnabled = true; }
public MirroredMemory(int lowerIndex, int upperIndex, int mirroredLowerIndex, int mirroredUpperIndex, IMemoryMap memoryMapper, string name) : base(new Range(lowerIndex, upperIndex), name) { this.mirroredRange = new Range(mirroredLowerIndex, mirroredUpperIndex); this.moduloValue = this.mirroredRange.Max - this.mirroredRange.Min; this.memoryMapper = memoryMapper; foreach (var memorySegment in this.memoryMapper) { if (this.mirroredRange.IsOverlapped(memorySegment.Range) || this.mirroredRange.Equals(memorySegment.Range)) { this.realMemorySegments.Add(memorySegment); } } if (!this.realMemorySegments.Any()) { throw new InvalidOperationException($"Mirrored memory ({this.Name}) setup, but it can't find another memory segment to link to."); } }
public FunctionsImplementation(IMemoryMap memory) { memoryMap = memory; }
public MOS6502(IMemoryMap memoryMap) => this.MemoryMap = memoryMap;
public RamRegister(IMemoryMap ram, IDoubleRegister doubleRegister) { this.ram_ = ram; this.doubleRegister_ = doubleRegister; }
public Ricoh2A03(IMemoryMap memoryMap) : base(memoryMap) { }
public void Initialise(Processor cpu, IMemoryMap map) { _cpu = cpu; _map = map; _initialised = true; }
public GameBoyCpu(IMemoryMap memoryMap, Registers registers, Processor opcodeProcessor) { this.memoryMap = memoryMap; this.registers = registers; this.processor = opcodeProcessor; }
public ExternalFacade(IMemoryMap memoryMap, Range range, string name) { this.memoryMap = memoryMap; this.range = range; this.Name = name; }
public Stack(IMemoryMap memoryMap, IDoubleRegister sp) { this.memoryMap_ = memoryMap; this.sp_ = sp; }
public Device(IMemoryMap memoryMap) { this.memoryMap = memoryMap; observers = new List <IObserver>(); }