Beispiel #1
0
        public void Add(IMemoryCallback callback)
        {
            switch (callback.Type)
            {
            case MemoryCallbackType.Execute:
                Execs.Add(callback);
                _hasExecutes = true;
                break;

            case MemoryCallbackType.Read:
                Reads.Add(callback);
                _hasReads = true;
                break;

            case MemoryCallbackType.Write:
                Writes.Add(callback);
                _hasWrites = true;
                break;
            }

            if (_empty)
            {
                Changes();
            }

            _empty = false;
        }
Beispiel #2
0
        public void Add(IMemoryCallback callback)
        {
            if (!AvailableScopes.Contains(callback.Scope))
            {
                throw new InvalidOperationException($"{callback.Scope} is not currently supported for callbacks");
            }

            if (!callback.Address.HasValue)
            {
                throw new NotImplementedException("Wildcard callbacks (no address specified) not currently implemented.");
            }

            var container = new CallbackContainer(callback);

            if (container.Callback.Type == MemoryCallbackType.Execute)
            {
                _executeCallback = RunExecCallback;
                _execPcs[callback.Address.Value] = callback;
                MGBAHawk.ZZHacky.BizSetExecCallback(_mgba.Core, _executeCallback);
            }
            else
            {
                MGBAHawk.ZZHacky.BizSetMemCallback(_mgba.Core, container.CallDelegate);
                container.ID = MGBAHawk.ZZHacky.BizSetWatchpoint(_mgba.Core, callback.Address.Value, container.WatchPointType);
            }

            _callbacks.Add(container);
        }
        public void Add(IMemoryCallback callback)
        {
            if (!AvailableScopes.Contains(callback.Scope))
            {
                throw new InvalidOperationException($"{callback.Scope} is not currently supported for callbacks");
            }

            switch (callback.Type)
            {
            case MemoryCallbackType.Execute:
                _execs.Add(callback);
                _hasExecutes = true;
                break;

            case MemoryCallbackType.Read:
                _reads.Add(callback);
                _hasReads = true;
                break;

            case MemoryCallbackType.Write:
                _writes.Add(callback);
                _hasWrites = true;
                break;
            }

            if (_empty)
            {
                Changes();
            }

            _empty = false;
        }
Beispiel #4
0
        /// <exception cref="InvalidOperationException">scope of <paramref name="callback"/> isn't available</exception>
        public void Add(IMemoryCallback callback)
        {
            if (!AvailableScopes.Contains(callback.Scope))
            {
                throw new InvalidOperationException($"{callback.Scope} is not currently supported for callbacks");
            }

            switch (callback.Type)
            {
            case MemoryCallbackType.Execute:
                _execs.Add(callback);
                break;

            case MemoryCallbackType.Read:
                _reads.Add(callback);
                break;

            case MemoryCallbackType.Write:
                _writes.Add(callback);
                break;
            }

            if (UpdateHasVariables())
            {
                Changes();
            }
        }
Beispiel #5
0
        // Adds an existing callback
        public Breakpoint(IDebuggable core, IMemoryCallback callback)
        {
            _core    = core;
            _active  = true;
            Callback = callback.Callback;
            Address  = callback.Address;
            Type     = callback.Type;
            Name     = callback.Name;

            // We don't know where this callback came from so don't let the user mess with it
            // Most likely it came from lua and doing so could cause some bad things to happen
            ReadOnly = true;
        }
Beispiel #6
0
        private void RemoveBreakpoint(IMemoryCallback callback)
        {
            switch (callback.Type)
            {
            case MemoryCallbackType.Read:
                api.RemoveBreakpoint(mupen64plusApi.BreakType.Read, callback.Address);
                break;

            case MemoryCallbackType.Write:
                api.RemoveBreakpoint(mupen64plusApi.BreakType.Write, callback.Address);
                break;

            case MemoryCallbackType.Execute:
                api.RemoveBreakpoint(mupen64plusApi.BreakType.Execute, callback.Address);
                break;
            }
        }
		public void Add(IMemoryCallback callback)
		{
			switch (callback.Type)
			{
				case MemoryCallbackType.Execute:
					Execs.Add(callback);
					_hasExecutes = true;
					break;
				case MemoryCallbackType.Read:
					Reads.Add(callback);
					_hasReads = true;
					break;
				case MemoryCallbackType.Write:
					Writes.Add(callback);
					_hasWrites = true;
					break;
			}
			if (empty)
				Changes();
			empty = false;
		}
Beispiel #8
0
 public CallbackContainer(IMemoryCallback callBack)
 {
     Callback     = callBack;
     CallDelegate = Call;
 }
Beispiel #9
0
 public CallbackContainer(IMemoryCallback callBack)
 {
     Callback = callBack;
 }