#include #include #include #include #include #include "keyb.h" #include "vga.h" #include "text.h" #include "map.h" #include "data.h" /* disable paging because our int handlers are written in C */ int _crt0_startup_flags = _CRT0_FLAG_LOCK_MEMORY; int main(int argc, char *argv[]) { keyb_init(); atexit(keyb_free); /* set VGA 320x200, 256 col */ if (!set_mode(0x13)) { fprintf(stderr, "ERROR: failed to init the VGA card\n"); return 1; } set_palette(binary_palette_start); if (!open_framebuffer()) { set_mode(3); fprintf(stderr, "ERROR: failed to open the framebuffer\n"); return 1; } blit_erase(0); wait_vsync(); map_init(binary_stage_start); map_render(); blit_update(); while (!keys[KEY_ESC]) wait_vsync(); set_mode(3); close_framebuffer(); return 0; }