From 394e5f18b6fb034b04fae0f35575dc24a4a1d620 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 16 Mar 2022 04:13:18 +1100 Subject: Fixed some debugger memory view annoyances and cleaned up Lua bindings. Made the debugger memory view not depend on isprint which is affected by the global locale. Assume the OSD will display as ISO-8869-1 and replace problematic printable characters. Started changing Lua function bindings to use set_function to avoid potential issues related to ThePhD/sol2#608, and worked out what was causing problems with symbol table read_memory/write_memory. (They aren't really essential - you can do the same thing with the address space object itself, but they're easier to parameterise.) --- src/frontend/mame/luaengine_render.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/frontend/mame/luaengine_render.cpp') diff --git a/src/frontend/mame/luaengine_render.cpp b/src/frontend/mame/luaengine_render.cpp index 21a68dc65cb..893412a4b30 100644 --- a/src/frontend/mame/luaengine_render.cpp +++ b/src/frontend/mame/luaengine_render.cpp @@ -418,7 +418,7 @@ void lua_engine::initialize_render(sol::table &emu) ctnr.add_line(x1, y1, x2, y2, UI_LINE_WIDTH, rgb_t(*color), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); }; render_container_type["draw_text"] = - [this] (render_container &ctnr, sol::object xobj, float y, char const *msg, std::optional fgcolor, std::optional bgcolor) + [] (render_container &ctnr, sol::this_state s, sol::object xobj, float y, char const *msg, std::optional fgcolor, std::optional bgcolor) { auto justify = ui::text_layout::text_justify::LEFT; float x = 0; @@ -438,7 +438,7 @@ void lua_engine::initialize_render(sol::table &emu) } else { - luaL_error(m_lua_state, "Error in param 1 to draw_text"); + luaL_error(s, "Error in param 1 to draw_text"); return; } y = std::clamp(y, 0.0f, 1.0f); -- cgit v1.2.3