From 6b4f3355fd73458776d51980a3ff5d20685965f2 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Thu, 16 Mar 2023 14:48:17 +1000 Subject: [PATCH] Correct mem callbacks docs (resolves #3522) --- .../lua/LuaHelperLibs/EventsLuaLibrary.cs | 12 ++++++------ .../Interfaces/IMemoryCallbackSystem.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs b/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs index e8fdd6fe9e7..c3e18f1c41e 100644 --- a/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs +++ b/src/BizHawk.Client.Common/lua/LuaHelperLibs/EventsLuaLibrary.cs @@ -98,7 +98,7 @@ public string OnLoadState(LuaFunction luaf, string name = null) .Guid.ToString(); [LuaDeprecatedMethod] - [LuaMethod("onmemoryexecute", "Fires after the given address is executed by the core")] + [LuaMethod("onmemoryexecute", "Fires immediately before the given address is executed by the core")] public string OnMemoryExecute( LuaFunction luaf, uint address, @@ -109,8 +109,8 @@ public string OnMemoryExecute( return OnBusExec(luaf, address, name: name, scope: scope); } - [LuaMethodExample("local exec_cb_id = event.on_bus_exec(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after the given address is executed by the core\" );\r\n\tend\r\n\t, 0x200, \"Frame name\", \"System Bus\" );")] - [LuaMethod("on_bus_exec", "Fires after the given address is executed by the core")] + [LuaMethodExample("local exec_cb_id = event.on_bus_exec(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires immediately before the given address is executed by the core\" );\r\n\tend\r\n\t, 0x200, \"Frame name\", \"System Bus\" );")] + [LuaMethod("on_bus_exec", "Fires immediately before the given address is executed by the core")] public string OnBusExec( LuaFunction luaf, uint address, @@ -145,7 +145,7 @@ public string OnBusExec( } [LuaDeprecatedMethod] - [LuaMethod("onmemoryexecuteany", "Fires after any address is executed by the core (CPU-intensive)")] + [LuaMethod("onmemoryexecuteany", "Fires immediately before any address is executed by the core (CPU-intensive)")] public string OnMemoryExecuteAny( LuaFunction luaf, string name = null, @@ -155,8 +155,8 @@ public string OnMemoryExecuteAny( return OnBusExecAny(luaf, name: name, scope: scope); } - [LuaMethodExample("local exec_cb_id = event.on_bus_exec_any(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires after any address is executed by the core (CPU-intensive)\" );\r\n\tend\r\n\t, \"Frame name\", \"System Bus\" );")] - [LuaMethod("on_bus_exec_any", "Fires after any address is executed by the core (CPU-intensive)")] + [LuaMethodExample("local exec_cb_id = event.on_bus_exec_any(\r\n\tfunction()\r\n\t\tconsole.log( \"Fires immediately before every instruction executed (in the specified scope) by the core (CPU-intensive)\" );\r\n\tend\r\n\t, \"Frame name\", \"System Bus\" );")] + [LuaMethod("on_bus_exec_any", "Fires immediately before every instruction executed (in the specified scope) by the core (CPU-intensive)")] public string OnBusExecAny( LuaFunction luaf, string name = null, diff --git a/src/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs b/src/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs index 36a71690168..8b4e562f1e8 100644 --- a/src/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs +++ b/src/BizHawk.Emulation.Common/Interfaces/IMemoryCallbackSystem.cs @@ -68,7 +68,7 @@ public interface IMemoryCallbackSystem : IEnumerable /// Executes all matching callbacks for the given address and domain /// /// The address to check for callbacks - /// The value contained (or written to) addr + /// For reads/execs, the value read/executed; for writes, the value to be written. Cores may pass the default 0 if write/exec is partially implemented. /// The callback flags relevant to this access /// The scope that the address pertains to. Must be a value in void CallMemoryCallbacks(uint addr, uint value, uint flags, string scope);