- [NEW] Afegit comando "debug(...)" per a escriure logs en consola
This commit is contained in:
@@ -86,6 +86,7 @@ void table_to_str(lua_State *L, int indx) {
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
static int cpp_cls(lua_State *L) {
|
||||
uint8_t color = luaL_optinteger(L, 1, 32);
|
||||
cls(color);
|
||||
@@ -420,7 +421,26 @@ bool lua_is_playing() {
|
||||
return lua_state == STATE_PLAYING;
|
||||
}
|
||||
|
||||
const char boot[] = "function init()mode(1)cls()play('o5l0v5cegv4cegv3cegv2cegv1ceg')memcpy(360,4608,240)memcpy(1560,4848,240)ink(1)print('G A M E',8,16)ink(4)print('S Y S T E M',20,16)ink(7)print('mini',9,8)ink(8)print('v0.7.3',34,29)w=0 end function update()w=w+1 if w>90 then cls()load()end end";
|
||||
const char boot[] =
|
||||
"function init()"
|
||||
"mode(1)"
|
||||
"cls()"
|
||||
"play('o5l0v5cegv4cegv3cegv2cegv1ceg')"
|
||||
"memcpy(360,4608,240)"
|
||||
"memcpy(1560,4848,240)"
|
||||
"ink(1) print('G A M E',8,16)"
|
||||
"ink(4) print('S Y S T E M',20,16)"
|
||||
"ink(7) print('mini',9,8)"
|
||||
"ink(8) print('v0.7.4',34,29)"
|
||||
"w=0 "
|
||||
"end "
|
||||
"function update()"
|
||||
"w=w+1 "
|
||||
"if w>90 then "
|
||||
"cls()"
|
||||
"load()"
|
||||
"end"
|
||||
"end";
|
||||
|
||||
void lua_init(const char* filename, const bool start_playing) {
|
||||
if (lua_state != STATE_STOPPED) lua_quit();
|
||||
@@ -429,6 +449,9 @@ void lua_init(const char* filename, const bool start_playing) {
|
||||
//init_exists = update_exists = false;
|
||||
bool file_loaded = true;
|
||||
|
||||
lua_getglobal(L, "print");
|
||||
lua_setglobal(L, "debug");
|
||||
|
||||
if (filename == NULL) {
|
||||
if (luaL_loadstring(L, boot)) {
|
||||
debug("BOOT ERROR:", false);
|
||||
|
||||
Reference in New Issue
Block a user