add -2x and -3x to uxn11
This commit is contained in:
parent
768b99d1db
commit
c92249da5b
|
@ -4,6 +4,7 @@
|
|||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysymdef.h>
|
||||
#include <string.h>
|
||||
#include <sys/timerfd.h>
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
|
@ -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++]))
|
||||
|
|
Loading…
Reference in New Issue