public string OnExit(LuaFunction luaf, string name = null)
        {
            var nlf = new NamedLuaFunction(luaf, "OnExit", LogOutputCallback, CurrentThread, name);

            _luaFunctions.Add(nlf);
            return(nlf.Guid.ToString());
        }
Beispiel #2
0
        public string OnMemoryWrite(LuaFunction luaf, uint?address = null, string name = null)
        {
            try
            {
                if (DebuggableCore != null && DebuggableCore.MemoryCallbacksAvailable())
                {
                    if (N64CoreTypeDynarec())
                    {
                        return(Guid.Empty.ToString());
                    }

                    var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentThread, name);
                    _luaFunctions.Add(nlf);

                    DebuggableCore.MemoryCallbacks.Add(
                        new MemoryCallback(MemoryCallbackType.Write, "Lua Hook", nlf.Callback, address, null));
                    return(nlf.Guid.ToString());
                }
            }
            catch (NotImplementedException)
            {
                LogMemoryCallbacksNotImplemented();
                return(Guid.Empty.ToString());
            }

            LogMemoryCallbacksNotImplemented();
            return(Guid.Empty.ToString());
        }
        public string OnInputPoll(LuaFunction luaf, string name = null)
        {
            var nlf = new NamedLuaFunction(luaf, "OnInputPoll", LogOutputCallback, CurrentThread, name);

            _luaFunctions.Add(nlf);

            if (InputPollableCore != null)
            {
                try
                {
                    InputPollableCore.InputCallbacks.Add(nlf.Callback);
                    return(nlf.Guid.ToString());
                }
                catch (NotImplementedException)
                {
                    LogNotImplemented();
                    return(Guid.Empty.ToString());
                }
            }
            else
            {
                LogNotImplemented();
                return(Guid.Empty.ToString());
            }
        }
Beispiel #4
0
        public string OnMemoryWrite(LuaFunction luaf, uint?address = null, string name = null, string scope = null)
        {
            try
            {
                if (DebuggableCore?.MemoryCallbacksAvailable() == true)
                {
                    if (!HasScope(scope))
                    {
                        LogScopeNotAvailable(scope);
                        return(Guid.Empty.ToString());
                    }

                    var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentFile, name);
                    RegisteredFunctions.Add(nlf);
                    DebuggableCore.MemoryCallbacks.Add(
                        new MemoryCallback(ProcessScope(scope), MemoryCallbackType.Write, "Lua Hook", nlf.MemCallback, address, null));
                    return(nlf.Guid.ToString());
                }
            }
            catch (NotImplementedException)
            {
                LogMemoryCallbacksNotImplemented();
                return(Guid.Empty.ToString());
            }

            LogMemoryCallbacksNotImplemented();
            return(Guid.Empty.ToString());
        }
Beispiel #5
0
        public string OnSaveState(LuaFunction luaf, string name = null)
        {
            var nlf = new NamedLuaFunction(luaf, "OnSavestateSave", LogOutputCallback, CurrentFile, name);

            RegisteredFunctions.Add(nlf);
            return(nlf.Guid.ToString());
        }
Beispiel #6
0
        public string OnMemoryWrite(LuaFunction luaf, uint?address = null, string name = null, string domain = null)
        {
            try
            {
                if (DebuggableCore != null && DebuggableCore.MemoryCallbacksAvailable())
                {
                    var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentFile, name);
                    RegisteredFunctions.Add(nlf);

                    if (string.IsNullOrWhiteSpace(domain))
                    {
                        if (Domains != null && Domains.HasSystemBus)
                        {
                            domain = Domains.SystemBus.Name;
                        }
                    }

                    DebuggableCore.MemoryCallbacks.Add(
                        new MemoryCallback(domain, MemoryCallbackType.Write, "Lua Hook", nlf.MemCallback, address, null));
                    return(nlf.Guid.ToString());
                }
            }
            catch (NotImplementedException)
            {
                LogMemoryCallbacksNotImplemented();
                return(Guid.Empty.ToString());
            }

            LogMemoryCallbacksNotImplemented();
            return(Guid.Empty.ToString());
        }
Beispiel #7
0
        public void OnInputPoll(LuaFunction luaf, string name = null)
        {
            var nlf = new NamedLuaFunction(luaf, "OnInputPoll", LogOutputCallback, CurrentThread, name);

            _luaFunctions.Add(nlf);
            Global.Emulator.CoreComm.InputCallback.Add(nlf.Callback);
        }
Beispiel #8
0
        public string OnMemoryWrite(LuaFunction luaf, uint?address = null, string name = null)
        {
            var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentThread, name);

            _luaFunctions.Add(nlf);
            Global.CoreComm.MemoryCallbackSystem.AddWrite(nlf.Callback, address);
            return(nlf.Guid.ToString());
        }
Beispiel #9
0
        public string OnMemoryExecute(LuaFunction luaf, uint address, string name = null, string domain = null)
        {
            try
            {
                if (DebuggableCore != null && DebuggableCore.MemoryCallbacksAvailable() &&
                    DebuggableCore.MemoryCallbacks.ExecuteCallbacksAvailable)
                {
                    if (N64CoreTypeDynarec())
                    {
                        return(Guid.Empty.ToString());
                    }

                    var nlf = new NamedLuaFunction(luaf, "OnMemoryExecute", LogOutputCallback, CurrentThread, name);
                    _luaFunctions.Add(nlf);

                    if (string.IsNullOrWhiteSpace(domain))
                    {
                        if (Domains != null && Domains.HasSystemBus)
                        {
                            domain = Domains.SystemBus.Name;
                        }
                    }

                    DebuggableCore.MemoryCallbacks.Add(
                        new MemoryCallback(domain, MemoryCallbackType.Execute, "Lua Hook", nlf.Callback, address, null));
                    return(nlf.Guid.ToString());
                }
            }
            catch (NotImplementedException)
            {
                LogMemoryExecuteCallbacksNotImplemented();
                return(Guid.Empty.ToString());
            }

            LogMemoryExecuteCallbacksNotImplemented();
            return(Guid.Empty.ToString());
        }
		public string OnExit(LuaFunction luaf, string name = null)
		{
			var nlf = new NamedLuaFunction(luaf, "OnExit", LogOutputCallback, CurrentThread, name);
			_luaFunctions.Add(nlf);
			return nlf.Guid.ToString();
		}
		public string OnMemoryWrite(LuaFunction luaf, uint? address = null, string name = null)
		{
			var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentThread, name);
			_luaFunctions.Add(nlf);
			Global.CoreComm.MemoryCallbackSystem.AddWrite(nlf.Callback, address);
			return nlf.Guid.ToString();
		}
		public void OnInputPoll(LuaFunction luaf, string name = null)
		{
			var nlf = new NamedLuaFunction(luaf, "OnInputPoll", LogOutputCallback, CurrentThread, name);
			_luaFunctions.Add(nlf);
			Global.Emulator.CoreComm.InputCallback.Add(nlf.Callback);
		}
Beispiel #13
0
		public string OnMemoryWrite(LuaFunction luaf, uint? address = null, string name = null)
		{
			try
			{
				if (DebuggableCore != null && DebuggableCore.MemoryCallbacksAvailable())
				{
					var nlf = new NamedLuaFunction(luaf, "OnMemoryWrite", LogOutputCallback, CurrentThread, name);
					_luaFunctions.Add(nlf);

					DebuggableCore.MemoryCallbacks.Add(
						new MemoryCallback(MemoryCallbackType.Write, "Lua Hook", nlf.Callback, address));
					return nlf.Guid.ToString();
				}
			}
			catch (NotImplementedException)
			{
				LogMemoryCallbacksNotImplemented();
				return Guid.Empty.ToString();
			}

			LogMemoryCallbacksNotImplemented();
			return Guid.Empty.ToString();
		}
Beispiel #14
0
		public string OnInputPoll(LuaFunction luaf, string name = null)
		{
			var nlf = new NamedLuaFunction(luaf, "OnInputPoll", LogOutputCallback, CurrentThread, name);
			_luaFunctions.Add(nlf);

			if (InputPollableCore != null)
			{
				try
				{
					InputPollableCore.InputCallbacks.Add(nlf.Callback);
					return nlf.Guid.ToString();
				}
				catch (NotImplementedException)
				{
					LogNotImplemented();
					return Guid.Empty.ToString();
				}
			}
			else
			{
				LogNotImplemented();
				return Guid.Empty.ToString();
			}
		}