Upload UI
[lsnes.git] / src / lua / sysrc.cpp
blobbb485d827db2739e8d97ce558b8dcffe752be1ff
1 const char* lua_sysrc_script =
2 "loopwrapper = function(fn, ...)\n"
3 " local routine = coroutine.create(fn);\n"
4 " local resume = function(...)\n"
5 " if coroutine.status(routine) ~= \"dead\" then\n"
6 " local x, y;\n"
7 " x, y = coroutine.resume(routine, ...);\n"
8 " if not x then\n"
9 " error(y);\n"
10 " end\n"
11 " end\n"
12 " end\n"
13 " local yield = function()\n"
14 " return coroutine.yield(routine);\n"
15 " end\n"
16 " resume(yield, ...);\n"
17 " return resume;\n"
18 "end;\n"
19 "print=print2;\n"
20 "loadfile=loadfile2;\n"
21 "dofile=dofile2;\n"
22 "memory2=memory2();\n"
23 "callback=callback();\n";