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 * @li @b REG_DISPCNT @c 0x4000000
8 * @li @b REG_VCOUNT @c 0x4000006
9 * @li @b MODE_3 @c 0x3
10 * @li @b BG2_ENABLE @c 0x400
11 */
12int main()
13{
14 (*(volatile uint32_t*)0x4000000) = 0x3 | 0x400;
15
16 draw_logo();
17
18 lua_State *L;
19 L = luaL_newstate();
20 luaL_openlibs(L);
23
24 luaL_loadbuffer(L, engine_bytecode_lua, engine_bytecode_lua_len, "E");
25 lua_pcall(L, 0, 0, 0);
26
27 lua_getglobal(L, "native_callback_init");
28 lua_pushnumber(L, 240);
29 lua_pushnumber(L, 160);
30
31 luaL_loadbuffer(L, game_bytecode_lua, game_bytecode_lua_len, "G");
32 lua_pcall(L, 0, 1, 0);
33 lua_pcall(L, 3, 0, 0);
34
35 runtime(L);
36 return 0;
37}
void draw_library_install(lua_State *L)
Definition draw.c:104
void draw_logo()
Definition draw_logo.c:12
int main()
Definition main.c:12
void runtime(lua_State *L)
Definition runtime.c:29
void text_library_install(lua_State *L)
Definition text.c:62