31 lua_getglobal(L,
"native_callback_loop");
32 int native_callback_loop = luaL_ref(L, LUA_REGISTRYINDEX);
34 lua_getglobal(L,
"native_callback_draw");
35 int native_callback_draw = luaL_ref(L, LUA_REGISTRYINDEX);
37 lua_getglobal(L,
"native_callback_keyboard");
38 int native_callback_keyboard = luaL_ref(L, LUA_REGISTRYINDEX);
40 static uint8_t page = 0;
41 static uint8_t frameskip = 0;
45 while(*(
volatile uint16_t*) 0x04000006 >= 160);
50 while(*(
volatile uint16_t*) 0x04000006 < 160);
58 while(*(
volatile uint16_t*) 0x04000006 >= 160);
59 while(*(
volatile uint16_t*) 0x04000006 < 160);
62 while(*(
volatile uint16_t*) 0x04000006 >= 160);
63 while(*(
volatile uint16_t*) 0x04000006 < 160);
64 if (++frameskip & 1) {
76 while(*(
volatile uint16_t*) 0x04000006 >= 160);
77 while(*(
volatile uint16_t*) 0x04000006 < 160);
82 while(*(
volatile uint16_t*) 0x04000006 >= 160);
83 while(*(
volatile uint16_t*) 0x04000006 < 160);
91 while(*(
volatile uint16_t*) 0x04000006 >= 160);
92 while(*(
volatile uint16_t*) 0x04000006 < 160);
95 while(*(
volatile uint16_t*) 0x04000006 >= 160);
96 while(*(
volatile uint16_t*) 0x04000006 < 160);
99 while(*(
volatile uint16_t*) 0x04000006 >= 160);
100 while(*(
volatile uint16_t*) 0x04000006 < 160);
108 while(*(
volatile uint16_t*) 0x04000006 >= 160);
109 while(*(
volatile uint16_t*) 0x04000006 < 160);
112 while(*(
volatile uint16_t*) 0x04000006 >= 160);
113 while(*(
volatile uint16_t*) 0x04000006 < 160);
114 if (++frameskip & 1) {
124 while(*(
volatile uint16_t*) 0x04000006 >= 160);
125 while(*(
volatile uint16_t*) 0x04000006 < 160);
128#error invalid FPS_MODE