Beispiel #1
0
			public async Task ModifyMemory(Command cmd, string name, Memory data = null) {
				var list = CSDK.Game.Converter.ConvertMemory(memory);
				await Task.Delay (1);
				for (int i = 0; i < list.Count; ++i) {
					if (cmd != Command.Retrieve && data == null)
						break;
					if (list [i].Value.Key != name)
						continue;
					Guid guid = list [i].Key;
					switch (cmd) {
					case Command.Add:
						memory.Add (Guid.NewGuid(), new KeyValuePair<string, Memory> (name, data));
						break;
					case Command.Remove:
						memory.Remove(guid);
						break;
					case Command.Replace:
						memory[guid] = new KeyValuePair<string, Memory> (name, data);
						break;
					case Command.Retrieve:
						data = memory [guid].Value;
						break;
					default:
						break;
					}
				}
			}
Beispiel #2
0
 public SuiteRunner(Memory memory, ProgressReporter theReporter, Func<Memory, CellProcessor> newService)
 {
     TestCounts = new TestCounts();
     myReporter = theReporter;
     this.memory = memory;
     this.newService = newService;
 }
 public TelegramService(string token, string applicationDirectory)
 {
     Telegram_token = token;
     SetUp("https://api.telegram.org/bot" + Telegram_token);
     mem = new Memory(applicationDirectory);
     ReadStoredUsernames();
 }
Beispiel #4
0
 public override void DecodeArguments(Memory.MemoryBin bin, ref InstructionDecodeContext context, ref int offset, ref InstructionReference instructionReference)
 {
     if (decodeArgumentsFunction != null)
     {
         decodeArgumentsFunction(this, bin, ref context, ref offset, ref instructionReference.param1, ref instructionReference.param2);
     }
 }
Beispiel #5
0
 public GPU(string _Name, string _Valmistaja, int _CC, int _MC, int _Memory)
 {
     Name = _Name;
     Valmistaja = _Valmistaja;
     CC = _CC;
     Mem = new Memory(_MC, _Memory);
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MemorySecret"/> class with
 /// the specified values.
 /// </summary>
 /// <param name="game">The game.</param>
 /// <param name="gameId">The game id.</param>
 /// <param name="memory">The memory.</param>
 /// <param name="isReturnSecret">if set to <c>true</c> is return secret.</param>
 public MemorySecret(Game game, short gameId, Memory memory, bool isReturnSecret)
 {
     GameID = gameId;
     TargetGame = game;
     Memory = memory;
     IsReturnSecret = isReturnSecret;
 }
Beispiel #7
0
        [SetUp] public void SetUp() {
            memory = new TypeDictionary();
            memory.GetItem<Settings>().InputFolder = "in";
            memory.GetItem<Settings>().OutputFolder = "out";

            folders = new FolderTestModel();
        }
Beispiel #8
0
        /// <summary>
        /// Parses the script into statements and expressions.
        /// </summary>
        /// <param name="script">Script text</param>
        /// <param name="memory">Memory scope object</param>
        public List<Expr> Parse(string script, Memory memory = null)
        {
            Init(script, memory);

            while (true)
            {
                if (_tokenIt.NextToken.Token == Tokens.EndToken)
                    break;

                if (_tokenIt.NextToken.Token != Tokens.NewLine)
                {
                    // Get next statement.
                    var stmt = ParseStatement();
                    
                    if (stmt != null)
                    {
                        // Limit case:
                        _context.Limits.CheckParserStatement(stmt);

                        // Add to list of statements.
                        _statements.Add(stmt);
                    }
                }
                else
                    _tokenIt.Advance();
            }
            return _statements;
        }
Beispiel #9
0
        public override void DecodeArguments(Memory.MemoryBin bin, ref InstructionDecodeContext context, ref int offset, ref InstructionReference instructionReference)
        {
            switch (AddrMode)
            {
                case AddressingModes.ImpliedAccumulator:
                    {
                        break;
                    }
                case AddressingModes.Absolute:
                case AddressingModes.AbsoluteIndexedX:
                    {
                        instructionReference.param1 = DecodeInt2Argument(bin, ref offset);
                        break;
                    }

                case AddressingModes.Direct:
                case AddressingModes.DirectIndexedX:
                    {
                        instructionReference.param1 = DecodeInt1Argument(bin, ref offset);
                        break;
                    }

                default:
                    {
                        throw new InvalidOperationException("Addressing mode unknown for instruction ASL");
                    }
            }
        }
Beispiel #10
0
 public StoryTestFolder(Memory memory, string theInputPath, string theOutputPath, string theSelection, FolderModel theFolderModel, StoryTestFolder theParentFolder) {
     this.memory = memory;
     Name = theInputPath;
     OutputPath = theOutputPath;
     myFolderModel = theFolderModel;
     myParent = theParentFolder;
     mySelection = theSelection;
 }
Beispiel #11
0
 public QAcidState(QAcidRunner<Unit> runner)
 {
     Runner = runner;
     Runs = new List<int>();
     Memory = new Memory(this);
     TempMemory = new TempMemory();
     Shrunk = new Memory(this);
 }
Beispiel #12
0
 int Run(Memory memory, IList<string> arguments)
 {
     ParseArguments(memory, arguments);
     myRunner = new SuiteRunner(memory, myProgressReporter);
     myRunner.Run(
         CreateStoryTestFolder(memory),
         selectedFile);
     return myRunner.TestCounts.FailCount;
 }
 internal MemoryHandler(GameBoy gameboy)
 {
     this.gameboy = gameboy;
       this.memory = (Memory)gameboy.Memory;
       this.cartridge = (Cartridge.Cartridge)gameboy.Cartridge;
       this.cpu = (CPU)gameboy.CPU;
       this.display = (Display)gameboy.Display;
       this.apu = (APU)gameboy.APU;
 }
Beispiel #14
0
        static void Main(string[] args)
        {
            var procs = Process.GetProcessesByName("SC2");

            Memory mem = new Memory(procs[0]);
            mem.DesiredAccess = Memory.VmRead;

            Playertest.TestIt(mem);
        }
Beispiel #15
0
        StoryTestFolder CreateStoryTestFolder(Memory memory, FolderModel folderModel) {
            var storyTestFolder = new StoryTestFolder(memory, folderModel);

            string tagList = memory.GetItem<Settings>().TagList;
            if (!string.IsNullOrEmpty(tagList))
                storyTestFolder.AddPageFilter(new TagFilter(tagList));

            return storyTestFolder;
        }
Beispiel #16
0
 public int Run(IList<string> commandLineArguments, Memory memory, ProgressReporter reporter) {
     var now = DateTime.Now;
     myProgressReporter = reporter;
     var result = Run(memory, commandLineArguments);
     //todo: to suiterunner?
     if (!memory.GetItem<Settings>().DryRun)
         reporter.Write(string.Format("\n{0}, time: {1}\n", Results, DateTime.Now - now));
     return result;
 }
Beispiel #17
0
        StoryTestFolder CreateStoryTestFolder(Memory memory)
        {
            var storyTestFolder = new StoryTestFolder(memory, new FileSystemModel(memory.GetItem<Settings>().CodePageNumber));

            string tagList = memory.GetItem<Settings>().TagList;
            if (!string.IsNullOrEmpty(tagList))
                storyTestFolder.AddPageFilter(new TagFilter(tagList));

            return storyTestFolder;
        }
        public void Execute(ExecutionNodes nodes, ref Memory memory)
        {
            ExecutionNode en;
            if (nodes.TryGetValue(Label, out en) == false)
            {
                throw new ArgumentException("Jump: Label " + Label + " does not exist.");
            }

            en.Execute(nodes, ref memory);
        }
Beispiel #19
0
        public Device(IModeling modeling)
        {
            this.memories = new List<Memory>();
            this.currentMemory = new Memory();

            this.Modeling = modeling;
            this.Queue = new Queue(modeling);
            this.Reset();
            this.OnRelease += Device_OnRelease;
        }
Beispiel #20
0
    public Debugger(AsyncTaskRunner asyncTaskRunner) {
      Dispatch.AsyncTaskRunner = asyncTaskRunner;

      this.BreakpointList = new BreakpointList(this);
      this.Memory = new Memory(this);
      this.ModuleList = new ModuleList(this);
      this.ThreadList = new ThreadList(this);

      this.CurrentContext = new Context(this);
    }
Beispiel #21
0
        /// <summary>
        /// Initializes the parser with the script and setups various components.
        /// </summary>
        /// <param name="script"></param>
        /// <param name="memory"></param>
        public override void Init(string script, Memory memory)
        {
            // 1. Initalize data members
            base.Init(script, memory);

            // 3. Convert script to sequence of tokens.
            Tokenize();

            // 4. Move to first token
            _tokenIt.Advance();
        }
Beispiel #22
0
 public int Run(IList<string> arguments, Memory memory, ProgressReporter reporter)
 {
     LastArguments = arguments;
     ApartmentState = Thread.CurrentThread.GetApartmentState();
     try {
         return int.Parse(ConfigurationManager.AppSettings.Get("returnCode"));
     }
     catch (Exception) {
         return Result;
     }
 }
Beispiel #23
0
        public static VAL functions(string func, VAL parameters, Memory DS)
        {
            if (func != "devalize" && parameters.Size != 2)
                return null;

            var L0 = parameters[0];
            var L1 = parameters[1];

            Valizer.Devalize(L0, L1.Value);
            return L1;
        }
Beispiel #24
0
 int Run(Memory memory, IList<string> arguments) {
     ParseArguments(memory, arguments);
     var fileSystem = new FileSystemModel(memory.GetItem<Settings>().CodePageNumber);
     memory.GetItem<Context>().PageSource = fileSystem;
     memory.GetItem<Context>().SuitePath = new DirectoryPath(memory.GetItem<Settings>().InputFolder);
     myRunner = new SuiteRunner(memory, myProgressReporter);
     myRunner.Run(
         CreateStoryTestFolder(memory, fileSystem),
         selectedFile);
     return myRunner.TestCounts.FailCount;
 }
Beispiel #25
0
        public void TestDisassembler()
        {
            var Memory = new Memory();
            Memory.WriteBytes(0, new byte[] { 0xAF, 0x21, 0xFF, 0xDF, 0x0E, 0x10, 0x06, 0x00, 0x32, 0x05, 0x20, 0xFC, 0x0D, 0x20, 0xF9, 0x3E });
            var Z80Disassembler = new Z80Disassembler(Memory);
            Z80Disassembler.Address = 0;

            for (int n = 0; n < 7; n++)
            {
                Console.WriteLine("{0:X4}: {1}", Z80Disassembler.Address, Z80Disassembler.DecodeNext());
            }
        }
Beispiel #26
0
        protected void InsertActionIntoDMAQueueAndStopExecution(Process.IProcess myProcess, Memory.DMARequest.MemoryAction action)
        {
            var request = new Memory.DMARequest()
            {
                MyProcess = myProcess,
                MemoryWork = action
            };

            myProcess.ContinueCalculating = false;
            myProcess.PCB.ProcessRegisters.ProgramCounter += 1;

            Sys.System.DMA.InsertRequestInQueue(request);
        }
        public OptimalSimulator(string path, int memSize)
        {
            Memory = new Memory(memSize);
            _framesList = new List<int>();
            var frames = File.ReadAllLines(path);
            foreach (var frame in frames) {
                var frameToConvert = frame.Split(null)[0].Substring(0,5);
                var frameAsInt = Convert.ToInt32(frameToConvert, 16);

                _framesList.Add(frameAsInt);
            }
            PageFaults = PageHits = 0;
        }
Beispiel #28
0
		public _Blob(Server.Script.Api api, Memory memory)
		{
			Api = api;
			World = api.World;
			Memory = memory;

			Timer = new System.Timers.Timer()
			{
				AutoReset = true,
				Enabled = false,
				Interval = 1000,
				//Todo: Timer.SynchronizingObject
			};
		}
Beispiel #29
0
        /// <summary>
        /// Initialize
        /// </summary>
        public Interpreter()
        {
            _settings = new LangSettings();

            // Initialzie the context.
            _context = new Context();
            _context.Settings = _settings;
            _context.Limits.Init();

            _memory = _context.Memory;
            _parser = new Parser(_context);
            _parser.Settings = _settings;
            InitSystemFunctions();
        }
Beispiel #30
0
        /// <summary>
        /// Initializes the parser with the script and setups various components.
        /// </summary>
        /// <param name="script"></param>
        /// <param name="memory"></param>
        public override void Init(string script, Memory memory)
        {
            // 1. Initalize data members
            base.Init(script, memory);

            // 2. Convert script to sequence of tokens.
            Tokenize();
            SetupTokenIteratorReferences(this._tokenIt);

            // 3. Move to first token
            _tokenIt.Advance();

            // 4. Setup expr builder
            Exprs.Setup(_tokenIt, _context, _scriptPath);
        }