Working on boot logo
This commit is contained in:
28
lua.cpp
28
lua.cpp
@@ -152,7 +152,7 @@ extern "C" {
|
||||
return 0;
|
||||
}
|
||||
static int cpp_tostr(lua_State *L) {
|
||||
int val = luaL_checknumber(L, 1);
|
||||
float val = luaL_checknumber(L, 1);
|
||||
lua_pushstring(L, tostr(val));
|
||||
return 1;
|
||||
}
|
||||
@@ -223,6 +223,28 @@ extern "C" {
|
||||
load(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_log(lua_State *L) {
|
||||
const char* str = luaL_checkstring(L, 1);
|
||||
debug(str);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_fileout(lua_State *L) {
|
||||
const char* str = luaL_checkstring(L, 1);
|
||||
const uint16_t addr = luaL_checknumber(L, 2);
|
||||
const uint16_t size = luaL_checknumber(L, 3);
|
||||
fileout(str, addr, size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cpp_filein(lua_State *L) {
|
||||
const char* str = luaL_checkstring(L, 1);
|
||||
const uint16_t addr = luaL_checknumber(L, 2);
|
||||
const uint16_t size = luaL_checknumber(L, 3);
|
||||
filein(str, addr, size);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define STATE_STOPPED 0
|
||||
@@ -294,6 +316,10 @@ void lua_init(const char* filename, const bool start_playing) {
|
||||
lua_pushcfunction(L,cpp_nosound); lua_setglobal(L, "nosound");
|
||||
lua_pushcfunction(L,cpp_setmode); lua_setglobal(L, "setmode");
|
||||
lua_pushcfunction(L,cpp_load); lua_setglobal(L, "load");
|
||||
lua_pushcfunction(L,cpp_log); lua_setglobal(L, "log");
|
||||
|
||||
lua_pushcfunction(L,cpp_fileout); lua_setglobal(L, "fileout");
|
||||
lua_pushcfunction(L,cpp_filein); lua_setglobal(L, "filein");
|
||||
|
||||
lua_pushinteger(L, 0); lua_setglobal(L, "KEY_UNKNOWN");
|
||||
lua_pushinteger(L, 4); lua_setglobal(L, "KEY_A");
|
||||
|
||||
Reference in New Issue
Block a user