Core Native GBA 0.0.17
create your own game-engine with just lua for nitendo game boy advance console.
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1#include "engine/bytecode.h"
2#include "game/bytecode.h"
3
4#include "zeebo.h"
5
6/**
7 * @todo remove
8 */
9#include <nds.h>
10
11int main()
12{
13 powerOn(POWER_ALL);
14 videoSetMode(MODE_FB0);
15 vramSetBankA(VRAM_A_LCD);
16
17 draw_logo();
18
19 lua_State *L;
20 L = luaL_newstate();
21 luaL_openlibs(L);
24
25 luaL_loadbuffer(L, engine_bytecode_lua, engine_bytecode_lua_len, "E");
26 lua_pcall(L, 0, 0, 0);
27
28 lua_getglobal(L, "native_callback_init");
29 lua_pushnumber(L, 256);
30 lua_pushnumber(L, 192);
31
32 luaL_loadbuffer(L, game_bytecode_lua, game_bytecode_lua_len, "G");
33 lua_pcall(L, 0, 1, 0);
34 lua_pcall(L, 3, 0, 0);
35
36 runtime(L);
37 return 0;
38}
void draw_library_install(lua_State *L)
Definition draw.c:104
void draw_logo()
Definition draw_logo.c:12
int main()
Definition main.c:11
void runtime(lua_State *L)
Definition runtime.c:10
void text_library_install(lua_State *L)
Definition text.c:62