Skip to content

Commit

Permalink
lua: add sj.get_module_namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lordheavy committed Dec 12, 2024
1 parent e4c18fe commit 59354d9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sjasm/lua_sjasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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] = " ";
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 59354d9

Please sign in to comment.