mirror of
https://github.com/holub/mame
synced 2025-06-07 13:23:50 +03:00
plugins/cheat: make sure bp function is run only one per hit (nw)
This commit is contained in:
parent
b02ed94488
commit
f4c54655f2
@ -81,6 +81,7 @@ function cheat.startplugin()
|
|||||||
local stop = true
|
local stop = true
|
||||||
local cheatname = ""
|
local cheatname = ""
|
||||||
local consolelog = nil
|
local consolelog = nil
|
||||||
|
local consolelast = 0
|
||||||
local watches = {}
|
local watches = {}
|
||||||
local breaks = {}
|
local breaks = {}
|
||||||
|
|
||||||
@ -255,7 +256,7 @@ function cheat.startplugin()
|
|||||||
|
|
||||||
local function periodiccb()
|
local function periodiccb()
|
||||||
local msg = consolelog[#consolelog]
|
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]+)")
|
local point = msg:match("Stopped at breakpoint ([0-9]+)")
|
||||||
if not point then
|
if not point then
|
||||||
point = msg:match("Stopped at watchpoint ([0-9]+")
|
point = msg:match("Stopped at watchpoint ([0-9]+")
|
||||||
@ -277,6 +278,7 @@ function cheat.startplugin()
|
|||||||
manager:machine():debugger().execution_state = "run"
|
manager:machine():debugger().execution_state = "run"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
consolelast = #consolelog
|
||||||
end
|
end
|
||||||
|
|
||||||
local function bpset(cheat, dev, addr, func)
|
local function bpset(cheat, dev, addr, func)
|
||||||
@ -693,6 +695,7 @@ function cheat.startplugin()
|
|||||||
load_hotkeys()
|
load_hotkeys()
|
||||||
if manager:machine():debugger() then
|
if manager:machine():debugger() then
|
||||||
consolelog = manager:machine():debugger().consolelog
|
consolelog = manager:machine():debugger().consolelog
|
||||||
|
consolelast = 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user