diff --git a/src/uxn11.c b/src/uxn11.c index 91dd136..926fdcd 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,7 @@ static XImage *ximage; static Display *display; static Window window; static char *loaded_rom; +static int init_scale; #define WIDTH (64 * 8) #define HEIGHT (40 * 8) @@ -229,7 +231,7 @@ emu_init(void) display = XOpenDisplay(NULL); if(!display) return system_error("X11", "Could not open display"); - screen_resize(WIDTH, HEIGHT, 1); + screen_resize(WIDTH, HEIGHT, init_scale); init_console(); return 1; } @@ -310,11 +312,14 @@ main(int argc, char **argv) { Uxn u = {0}; int i = 1; + init_scale = 1; if(i == argc) return system_error("usage", "uxn11 [-v] file.rom [args...]"); /* Read flags */ if(argv[i][0] == '-' && argv[i][1] == 'v') return system_version("Uxn11 - Graphical Varvara Emulator", "12 Nov 2023"); + if(strcmp(argv[i], "-2x") == 0 || strcmp(argv[i], "-3x") == 0) + init_scale = argv[i++][1] - '0'; if(!emu_init()) return system_error("Init", "Failed to initialize varvara."); if(!system_init(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++]))