Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <pspdisplay.h>
- #include "lua_lib.h"
- #include "lua.h"
- #include "lualib.h"
- #include "lauxlib.h"
- #define printf pspDebugScreenPrintf
- extern int lua_print(lua_State *L)
- {
- int arg_len = lua_gettop(L);
- int n;
- for (n=1; n <= arg_len; n++) {
- printf("%s%s", lua_tostring(L, n), "\t");
- }
- printf("\n");
- return 0;
- }
- lua_State* lua_lib_newstate()
- {
- lua_State* L;
- L = luaL_newstate();
- luaL_openlibs(L);
- lua_register(L, "print", lua_print);
- lua_register(L, "isRunning", lua_isRunning);
- lua_register(L, "setDebugScreen", lua_setDebugScreen);
- lua_register(L, "vblank", lua_vblank);
- lua_register(L, "getPad", lua_getPad);
- lua_register(L, "isKeyDown", lua_isKeyDown);
- return L;
- }
Add Comment
Please, Sign In to add comment