summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2017-07-24 16:17:43 -0500
committer cracyc <cracyc@users.noreply.github.com>2017-07-24 16:17:43 -0500
commitf4c54655f2081346705e1724506be29e01cb3616 (patch)
treefb70acdf9356b1f4b444cb6b25fcbd257f70014c /plugins
parentb02ed9448883defdccd7d0adb52bfe8eb767b5e7 (diff)
plugins/cheat: make sure bp function is run only one per hit (nw)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheat/init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index 6901986b92b..dd4186cf1be 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -81,6 +81,7 @@ function cheat.startplugin()
local stop = true
local cheatname = ""
local consolelog = nil
+ local consolelast = 0
local watches = {}
local breaks = {}
@@ -255,7 +256,7 @@ function cheat.startplugin()
local function periodiccb()
local msg = consolelog[#consolelog]
- if msg:find("Stopped at", 1, true) then
+ if #consolelog > consolelast and msg:find("Stopped at", 1, true) then
local point = msg:match("Stopped at breakpoint ([0-9]+)")
if not point then
point = msg:match("Stopped at watchpoint ([0-9]+")
@@ -277,6 +278,7 @@ function cheat.startplugin()
manager:machine():debugger().execution_state = "run"
end
end
+ consolelast = #consolelog
end
local function bpset(cheat, dev, addr, func)
@@ -693,6 +695,7 @@ function cheat.startplugin()
load_hotkeys()
if manager:machine():debugger() then
consolelog = manager:machine():debugger().consolelog
+ consolelast = 0
end
end)