[FEAT] memcpy

[CHANGE] New default color 0x0f
This commit is contained in:
2021-12-08 07:34:54 +01:00
parent 963958e596
commit 290d50e32f
3 changed files with 18 additions and 2 deletions

View File

@@ -200,6 +200,14 @@ extern "C" {
return 0;
}
static int cpp_memcpy(lua_State *L) {
int dst = luaL_checkinteger(L, 1);
int src = luaL_checkinteger(L, 2);
int size = luaL_checkinteger(L, 3);
memcpy(dst, src, size);
return 0;
}
static int cpp_sound(lua_State *L) {
float freq = luaL_checknumber(L, 1);
int len = luaL_checkinteger(L, 2);
@@ -312,6 +320,7 @@ void lua_init(const char* filename, const bool start_playing) {
lua_pushcfunction(L,cpp_setchar); lua_setglobal(L, "setchar");
lua_pushcfunction(L,cpp_peek); lua_setglobal(L, "peek");
lua_pushcfunction(L,cpp_poke); lua_setglobal(L, "poke");
lua_pushcfunction(L,cpp_memcpy); lua_setglobal(L, "memcpy");
lua_pushcfunction(L,cpp_sound); lua_setglobal(L, "sound");
lua_pushcfunction(L,cpp_nosound); lua_setglobal(L, "nosound");
lua_pushcfunction(L,cpp_setmode); lua_setglobal(L, "setmode");