Please, add "cartidge reset" api call #473

This commit is contained in:
BADIM-PC\Vadim
2017-12-20 15:07:35 +03:00
parent 0e997f5d33
commit 2eacc2bf34
6 changed files with 24 additions and 11 deletions

View File

@@ -774,6 +774,15 @@ static s32 lua_sync(lua_State* lua)
return 0;
}
static s32 lua_reset(lua_State* lua)
{
tic_machine* machine = getLuaMachine(lua);
machine->state.initialized = false;
return 0;
}
static s32 lua_memcpy(lua_State* lua)
{
s32 top = lua_gettop(lua);
@@ -1075,7 +1084,7 @@ static const lua_CFunction ApiFunc[] =
lua_rectb, lua_spr, lua_btn, lua_btnp, lua_sfx, lua_map, lua_mget,
lua_mset, lua_peek, lua_poke, lua_peek4, lua_poke4, lua_memcpy,
lua_memset, lua_trace, lua_pmem, lua_time, lua_exit, lua_font, lua_mouse,
lua_circ, lua_circb, lua_tri, lua_textri, lua_clip, lua_music, lua_sync
lua_circ, lua_circb, lua_tri, lua_textri, lua_clip, lua_music, lua_sync, lua_reset
};
STATIC_ASSERT(api_func, COUNT_OF(ApiKeywords) == COUNT_OF(ApiFunc));