コード例 #1
0
ファイル: Server.cs プロジェクト: TishoAngelov/TelerikAcademy
 public Server(ICpu cpu, IRamMemory ram, IEnumerable<IHardDrive> hardDrives)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = this.defaultVideoCard;
 }
コード例 #2
0
 public IPc GetPc(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Pc(cpu, hardDrives, motherboard);
 }
コード例 #3
0
 public Server(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
     : base(cpu, hardDrives, motherboard)
 {
 }
コード例 #4
0
 public IServer GetServer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Server(cpu, hardDrives, motherboard);
 }
コード例 #5
0
ファイル: Computer.cs プロジェクト: jesusico83/Telerik
 public Computer(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
 }
コード例 #6
0
ファイル: Computer.cs プロジェクト: didimitrov/Algo
 public Computer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage)
 {
     Storage = storage;
     Gpu = gpu;
     Ram = ram;
     Cpu = cpu;
 }
コード例 #7
0
ファイル: CpuUtility.cs プロジェクト: CalebJ2/KOS
        /// <summary>
        /// Take the topmost arguments down to the ARG_MARKER_STRING, pop them off, and then
        /// put them back again in reversed order so a function can read them in normal order.
        /// Note that if this is an indirect call, it will also consume the thing just under
        /// the ARG_MARKER, since that's expected to be the delegate or KOSDelegate that we already
        /// read and pulled the needed information from.
        /// <param name="cpu">the cpu we are running on, fur stack manipulation purposes</param>
        /// <param name="direct">need to know if this was a direct or indirect call.  If indirect,
        /// then that means it also needs to consume the indirect reference off the stack just under
        /// the args</param>
        /// </summary>
        public static void ReverseStackArgs(ICpu cpu, bool direct)
        {
            List<object> args = new List<object>();
            object arg = cpu.PopValue();
            while (cpu.GetStackSize() > 0 && arg.GetType() != ArgMarkerType)
            {
                args.Add(arg);

                // It's important to dereference with PopValue, not using PopStack, because the function
                // being called might not even be able to see the variable in scope anyway.
                // In other words, if calling a function like so:
                //     declare foo to 3.
                //     myfunc(foo).
                // The code inside myfunc needs to see that as being identical to just saying:
                //     myfunc(3).
                // It has to be unaware of the fact that the name of the argument was 'foo'.  It just needs to
                // see the contents that were inside foo.
                arg = cpu.PopValue();
            }
            if (! direct)
                cpu.PopStack(); // throw away the delegate or KOSDelegate info - we already snarfed it by now.
            // Push the arg marker back on again.
            cpu.PushStack(new KOSArgMarkerType());
            // Push the arguments back on again, which will invert their order:
            foreach (object item in args)
                cpu.PushStack(item);
        }
コード例 #8
0
 public Computer(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives)
 {
     this.cpu = cpu;
     this.ram = ram;
     this.videoCard = videoCard;
     this.hardDrives = hardDrives;
 }
コード例 #9
0
 public MotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard)
 {
     this.ram = ram;
     this.cpu = cpu;
     this.hardDrive = hardDrive;
     this.videoCard = videoCard;
 }
コード例 #10
0
 public ILaptop GetLaptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
 {
     return new Laptop(cpu, hardDrives, motherboard, battery);
 }
コード例 #11
0
ファイル: Computer.cs プロジェクト: damy90/Telerik-all
 public Computer(ComputerType type, ICpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
     this.Type = type;
 }
コード例 #12
0
 public Computer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     this.Cpu = cpu;
     this.HardDrives = hardDrives;
     this.Motherboard = motherboard;
 }
コード例 #13
0
 public Laptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
     : base(cpu, hardDrives, motherboard)
 {
     this.Battery = battery;
 }
コード例 #14
0
ファイル: UserDelegate.cs プロジェクト: Whitecaribou/KOS
 /// <summary>
 /// Make a new UserDelegate given the current state of the CPU and its stack, and
 /// the entry point location of the function to call.
 /// </summary>
 /// <param name="cpu">the CPU on which this program is running.</param>
 /// <param name="context">The IProgramContext in which the entryPoint is stored.  Entry point 27 in the interpreter is not the same as entrypoint 27 in program context.</param>
 /// <param name="entryPoint">instruction address where OpcodeCall should jump to to call the function.</param>
 /// <param name="useClosure">If true, then a snapshot of the current scoping stack, and thus a persistent ref to its variables,
 ///   will be kept in the delegate so it can be called later as a callback with closure.  Set to false if the
 ///   function is only getting called instantly using whatever the scope is at the time of the call.</param>
 public UserDelegate(ICpu cpu, IProgramContext context, int entryPoint, bool useClosure)
 {
     this.cpu = cpu;
     ProgContext = context;
     EntryPoint = entryPoint;
     if (useClosure)
         CaptureClosure();
     else
         Closure = new List<VariableScope>(); // make sure it exists as an empty list so we don't have to have 'if null' checks everwywhere.
 }
コード例 #15
0
ファイル: Console.cs プロジェクト: justinricheson/GameBoyEm
 public Console(ICpu cpu, IMmu mmu, IGpu gpu, ITimer timer, IController controller)
 {
     Cpu = cpu;
     Mmu = mmu;
     Gpu = gpu;
     Timer = timer;
     Controller = controller;
     _emitFrames = true;
     _breakpoints = new HashSet<uint>();
 }
コード例 #16
0
 public override Server ManufactureServer()
 {
     this.ram = new RamMemory(32);
     this.cpu = new Cpu(4, 32, this.ram);
     this.hardDrives = new List<HardDriver>
     {
         new HardDriver(0, true, 2, new List<HardDriver> { new HardDriver(1000, false, 0), new HardDriver(1000, false, 0) })
     };
     return new Server(this.cpu, this.ram, this.hardDrives);
 }
コード例 #17
0
        public Motherboard(ICpu cpu, IRam ram, IVideoCard videoCard)
        {
            cpu.Motherboard = this;
            this.Cpu = cpu;

            ram.Motherboard = this;
            this.Ram = ram;

            videoCard.Motherboard = this;
            this.VideoCard = videoCard;
        }
コード例 #18
0
        // The hardcoded values are used on only one place so i think that there is no need of constants.
        public override PersonalComputer ManufacturePC()
        {
            this.ram = new RamMemory(4);
            this.videoCard = new MonochromeVideoCard();
            this.cpu = new Cpu(2, 64, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(2000, false, 0)
            };

            return new PersonalComputer(this.cpu, this.ram, this.videoCard, this.hardDrives);
        }
コード例 #19
0
        // The hardcoded values are used on only one place so i think that there is no need of constants.
        public override PersonalComputer ManufacturePC()
        {
            this.ram = new RamMemory(8);
            this.videoCard = new ColorfulVideoCard();
            this.cpu = new Cpu(4, 64, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(1000, false, 0)
            };

            return new PersonalComputer(this.cpu, this.ram, this.videoCard, this.hardDrives);
        }
コード例 #20
0
 protected Computer(
     ICpu cpu,
     IRam ram,
     IEnumerable<IHardDrive> hardDrives,
     IVideoCard videoCard)
 {
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
     this.Motherboard = new Motherboard(this.Cpu, this.Ram, this.VideoCard);
 }
コード例 #21
0
        public override Laptop ManufactureLaptop()
        {
            this.ram = new RamMemory(8);
            this.videoCard = new ColorfulVideoCard();
            this.cpu = new Cpu(4, 32, this.ram, this.videoCard);
            this.hardDrives = new[]
            {
                new HardDriver(1000, false, 0)
            };
            IBattery battery = BatteryFactory.GetBattery(BatteryType.LaptopBattery);

            return new Laptop(this.cpu, this.ram, this.videoCard, this.hardDrives, battery);
        }
コード例 #22
0
ファイル: DebugControl.cs プロジェクト: BradFuller/pspplayer
        public DebugControl( Debugger debugger )
        {
            Debug.Assert( debugger != null );
            if( debugger == null )
                throw new ArgumentNullException( "debugger" );
            _debugger = debugger;

            _breakpoints = new List<Breakpoint>();
            _breakpointLookup = new Dictionary<int, Breakpoint>();

            _cpu = _debugger.Host.CurrentInstance.Cpu;
            Debug.Assert( _cpu != null );
        }
コード例 #23
0
 public CpuStateViewModel(ICpu cpu)
 {
     A = $"{cpu.A:X2}";
     B = $"{cpu.B:X2}";
     C = $"{cpu.C:X2}";
     D = $"{cpu.D:X2}";
     E = $"{cpu.E:X2}";
     FC = $"{cpu.FC}";
     FH = $"{cpu.FH}";
     FN = $"{cpu.FN}";
     FZ = $"{cpu.FZ}";
     H = $"{cpu.H:X2}";
     L = $"{cpu.L:X2}";
     SP = $"{cpu.SP:X4}";
     PC = $"{cpu.PC:X4}";
     IME = $"{cpu.IME}";
 }
コード例 #24
0
ファイル: CpuPane.cs プロジェクト: BradFuller/pspplayer
        public CpuPane( Studio studio )
            : this()
        {
            Debug.Assert( studio != null );
            if( studio == null )
                throw new ArgumentNullException( "studio" );
            _studio = studio;

            this.Icon = IconUtilities.ConvertToIcon( Properties.Resources.RegistersIcon );

            _cpu = _studio.Debugger.Host.CurrentInstance.Cpu;
            _core0 = _cpu.Cores[ 0 ];

            _studio.GlobalRefreshRequested += new EventHandler( StudioGlobalRefreshRequested );

            this.generalRegistersLabel_SizeChanged( this, EventArgs.Empty );

            _useFriendlyLabels = true;
            this.friendlyCheckbox.Checked = _useFriendlyLabels;

            this.UpdateValues();
        }
コード例 #25
0
 protected override void ExecuteInternal(ICpu _, IMemory __, Operand src, Operand dst, Operand ___)
 {
     dst.Value = src.Value;
 }
コード例 #26
0
 public GamingDesktop(ICpu cpu, IMotherBoard motherBoard, IVideoCard videoCard) : base(cpu, motherBoard, videoCard)
 {
 }
コード例 #27
0
 public void Execute(ICpu cpu)
 {
     cpu.Memory[Value] = (byte)((cpu.Registers[Register] >> 8) & 0xFF);
 }
コード例 #28
0
 public NOP(ICpu cpu) : base(cpu)
 {
 }
コード例 #29
0
ファイル: 0xCBD1.cs プロジェクト: josh-perry/gbboi-emu
 public void Execute(Instruction instruction, ICpu cpu, IMmu mmu)
 {
     throw new NotImplementedException(Mnemonic);
 }
コード例 #30
0
 public BranchIfCarry(ICpu cpu, IAddressMode addressMode) : base(cpu, addressMode)
 {
 }
コード例 #31
0
ファイル: RTS.cs プロジェクト: Opelkuh/6502sharp
 public RTS(ICpu cpu) : base(cpu)
 {
 }
コード例 #32
0
 public Ldy(ICpu cpu) : base(cpu)
 {
 }
コード例 #33
0
 public Host(ICpu processor)
 {
     Cpu = processor;
 }
コード例 #34
0
 public AbsoluteModeXOffset(ICpu cpu) : base(cpu)
 {
 }
コード例 #35
0
ファイル: ROR.cs プロジェクト: Opelkuh/6502sharp
 public ROR(ICpu cpu) : base(cpu)
 {
 }
コード例 #36
0
 public void Execute(Instruction instruction, ICpu cpu, IMmu mmu)
 {
     cpu.Registers.C.Value = cpu.ReadImmediateN();
 }
コード例 #37
0
ファイル: Emulator.cs プロジェクト: pedromsantos/DCPU16.Net
 public Emulator(ICpu cpu)
 {
     this.cpu = cpu;
     this.memory = new Memory();
     this.cpu.Memory = this.memory;
 }
コード例 #38
0
 public void Execute(Instruction instruction, ICpu cpu, IMmu mmu)
 {
     mmu.WriteByte((ushort)(0xFF00 + cpu.Registers.C.Value), cpu.Registers.A.Value);
 }
コード例 #39
0
 public override int Resolve(ICpu cpu, ref byte[] raw)
 {
     return(raw[0]);
 }
コード例 #40
0
 public void Execute(ICpu cpu)
 {
     cpu.Registers.ProgramCounter = Value;
 }
コード例 #41
0
 public PersonalComputer(IRam ram, ICpu cpu, IEnumerable <IHardDrive> drives, IVideoCard videoCard)
     : base(ram, cpu, drives, videoCard)
 {
 }
コード例 #42
0
 public void Execute(ICpu cpu) => cpu.Registers.ProgramCounter = Pop(cpu);
コード例 #43
0
 public IndirectYMode(ICpu cpu) : base(cpu)
 {
 }
コード例 #44
0
ファイル: Sleep.cs プロジェクト: avdosev/vm
 protected override void ExecuteInternal(ICpu cpu, IMemory memory, Operand timeToSleep, Operand op1, Operand op2)
 {
     Thread.Sleep(timeToSleep.Value.ToInt());
 }
コード例 #45
0
ファイル: 0xF0.cs プロジェクト: josh-perry/gbboi-emu
        public void Execute(Instruction instruction, ICpu cpu, IMmu mmu)
        {
            var n = cpu.ReadImmediateN();

            cpu.Registers.A.Value = mmu.ReadByte((ushort)(0xFF00 + n));
        }
コード例 #46
0
ファイル: IncCommand.cs プロジェクト: ramunsk/SimpleVM
 public IncCommand(ICpu cpu)
     : base(cpu)
 {
 }
コード例 #47
0
ファイル: FakeSupervisor.cs プロジェクト: Sapfir0/kontur
 public Decision OnInstructionExecuteError(ICpu cpu, IMemory memory, string message)
 {
     return(Decision.Terminate);
 }
コード例 #48
0
ファイル: Emulator.cs プロジェクト: Dervall/LeetNES
 public Emulator(ICpu cpu, IPpu ppu, IMemory memory)
 {
     this.cpu = cpu;
     this.ppu = ppu;
     this.memory = memory;
 }
コード例 #49
0
 protected Desktop(ICpu cpu, IMotherBoard motherBoard, IVideoCard videoCard)
 {
     _cpu         = cpu;
     _motherBoard = motherBoard;
     _videoCard   = videoCard;
 }
コード例 #50
0
ファイル: PersonalComputer.cs プロジェクト: didimitrov/Algo
 protected PersonalComputer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage)
     : base(cpu, ram, gpu, storage)
 {
 }
コード例 #51
0
 public BranchIfPositive(ICpu cpu, IAddressMode addressMode) : base(cpu, addressMode)
 {
 }
コード例 #52
0
ファイル: FakeSupervisor.cs プロジェクト: Sapfir0/kontur
 public Decision OnStep(ICpu cpu, IMemory memory)
 {
     return(Decision.Continue);
 }
コード例 #53
0
ファイル: Pc.cs プロジェクト: jesusico83/Telerik
 public Pc(ICpu cpu, IRam ram, IEnumerable<HardDrive> hardDrives, VideoCardBase videoCard)
     : base(cpu, ram, hardDrives, videoCard)
 {
 }
コード例 #54
0
 public BranchIfNotEqual(ICpu cpu, IAddressMode addressMode) : base(cpu, addressMode)
 {
 }
コード例 #55
0
ファイル: Laptop.cs プロジェクト: cwetanow/Telerik
 public Laptop(IRam ram, ICpu cpu, IEnumerable<IHardDrive> drives, IVideoCard videoCard, IBattery battery)
     : base(ram, cpu, drives, videoCard)
 {
     this.Battery = battery;
 }
コード例 #56
0
 public void Initialization()
 {
     cpu32 = new Cpu32Bit(4);
 }
コード例 #57
0
ファイル: Debugger.cs プロジェクト: Sapfir0/kontur
 Decision ISupervisor.OnInstructionExecuteError(ICpu cpu, IMemory memory, string message)
 {
     return(OnPause(new PauseContext(memory, cpu, StopReason.InstructionExecutionError, null, message)));
 }
コード例 #58
0
 public JMP(ICpu cpu) : base(cpu)
 {
 }
コード例 #59
0
ファイル: BPL.cs プロジェクト: Opelkuh/6502sharp
 public BPL(ICpu cpu) : base(cpu)
 {
 }
コード例 #60
0
 public RelativeMode(ICpu cpu) : base(cpu)
 {
 }