#include #include "../../../vm/vm.h" #undef true #undef false #include #include #include VM vm = {0}; void mainloop() { if (!step_vm(&vm)) { emscripten_cancel_main_loop(); return; } } int main() { if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("SDL initialization failed: %s\n", SDL_GetError()); return 1; } SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); emscripten_set_canvas_element_size("#canvas", 640, 480); printf("VM loaded successfully\n"); emscripten_set_main_loop(mainloop, 0, 1); return 0; }