diff options
author | 2018-06-29 10:58:19 +0200 | |
---|---|---|
committer | 2018-06-29 20:04:28 +0200 | |
commit | a704ed7b1b121c3bcff52d49bff8372360fe907c (patch) | |
tree | 53dd19f2dbe2bd0bf0f747dcccd989beabfafbf7 /src/frontend/mame/luaengine.cpp | |
parent | f16d1298a44e71c18c337fc321faebe4fe691e06 (diff) |
emumem: Backend modernization [O. Galibert]
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index c4e7bbbbfdd..edc56ee13b9 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1287,42 +1287,40 @@ void lua_engine::initialize() return table; }, "wpset", [](device_debug &dev, addr_space &sp, const std::string &type, offs_t addr, offs_t len, const char *cond, const char *act) { - int wptype = WATCHPOINT_READ; + read_or_write wptype = read_or_write::READ; if(type == "w") - wptype = WATCHPOINT_WRITE; + wptype = read_or_write::WRITE; else if((type == "rw") || (type == "wr")) - wptype = WATCHPOINT_READ | WATCHPOINT_WRITE; + wptype = read_or_write::READWRITE; return dev.watchpoint_set(sp.space, wptype, addr, len, cond, act); }, "wpclr", &device_debug::watchpoint_clear, "wplist", [this](device_debug &dev, addr_space &sp) { sol::table table = sol().create_table(); - device_debug::watchpoint *list = dev.watchpoint_first(sp.space.spacenum()); - while(list) + for(auto &wpp : dev.watchpoint_vector(sp.space.spacenum())) { sol::table wp = sol().create_table(); - wp["enabled"] = list->enabled(); - wp["address"] = list->address(); - wp["length"] = list->length(); - switch(list->type()) + wp["enabled"] = wpp->enabled(); + wp["address"] = wpp->address(); + wp["length"] = wpp->length(); + switch(wpp->type()) { - case WATCHPOINT_READ: + case read_or_write::READ: wp["type"] = "r"; break; - case WATCHPOINT_WRITE: + case read_or_write::WRITE: wp["type"] = "w"; break; - case WATCHPOINT_READ | WATCHPOINT_WRITE: + case read_or_write::READWRITE: wp["type"] = "rw"; break; default: // huh? wp["type"] = ""; break; } - wp["condition"] = list->condition(); - wp["action"] = list->action(); - table[list->index()] = wp; - list = list->next(); + wp["condition"] = wpp->condition(); + wp["action"] = wpp->action(); + table[wpp->index()] = wp; } return table; }); |