#include "game.h"
+#include "screens.h"
+#include "sprite.h"
int fb_width, fb_height;
long fb_size;
-void *fb_pixels, *vmem;
+uint16_t *fb_pixels;
long time_msec;
-void (*swap_buffers)(void*);
+void (*draw)(void);
+void (*key_event)(int key, int pressed);
+static struct sprites dbgfont;
-int game_init(int argc, char **argv)
+
+int init(int argc, char **argv)
{
+ if(load_sprites(&dbgfont, "data/dbgfont.spr") == -1) {
+ return -1;
+ }
+ if(intro_init() == -1) {
+ return -1;
+ }
+ if(menu_init() == -1) {
+ return -1;
+ }
+
+ intro_start();
return 0;
}
-void game_cleanup(void)
+void cleanup(void)
{
+ intro_cleanup();
+ menu_cleanup();
}
-void game_draw(void)
+void dbg_print(void *fb, int x, int y, const char *str)
{
-}
+ uint16_t *dest = (uint16_t*)fb + y * fb_width + x;
-void game_keyboard(int key, int press)
-{
+ while(*str) {
+ int c = *str++;
+
+ if(c > ' ' && c < 128) {
+ draw_sprite(dest, fb_width * 2, &dbgfont, c - ' ');
+ }
+ dest += 8;
+ }
}
+