From 59354d9d0fbc4f655efc195c467a39063b2f41d2 Mon Sep 17 00:00:00 2001 From: Laurent Carlier Date: Thu, 12 Dec 2024 18:07:35 +0100 Subject: [PATCH] lua: add sj.get_module_namespace --- sjasm/lua_sjasm.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sjasm/lua_sjasm.cpp b/sjasm/lua_sjasm.cpp index 0df512e5..cff19495 100644 --- a/sjasm/lua_sjasm.cpp +++ b/sjasm/lua_sjasm.cpp @@ -338,6 +338,10 @@ static unsigned int lua_sj_get_word(unsigned int address) { return result; } +static const char* lua_sj_get_module(void) { + return ModuleName; +} + static bool lua_zx_trdimage_create(const char* trdname, const char* label = nullptr) { // setup label to truncated 8 char array padded with spaces char l8[9] = " "; @@ -406,6 +410,7 @@ static void lua_impl_init() { .addFunction("get_byte", lua_sj_get_byte) .addFunction("get_word", lua_sj_get_word) .addFunction("get_device", GetDeviceName) // no error/warning, can be called directly + .addFunction("get_module_namespace", lua_sj_get_module) .addFunction("set_page", lua_sj_set_page) .addFunction("set_slot", lua_sj_set_slot) // MMU API will be not added, it is too dynamic, and _pc("MMU ...") works