]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/games/eui.c
emulators ui: don't drink and code
[plan9front.git] / sys / src / games / eui.c
index 8bd05e8502c56ddd3d14003c7788fda15200eae1..d2464cca8509808b3297106eb131e0f47e9ad31a 100644 (file)
@@ -12,7 +12,7 @@ u64int keys, keys2;
 int trace, paused;
 int savereq, loadreq;
 QLock pauselock;
-int scale, warp10;
+int scale, fixscale, warp10;
 uchar *pic;
 Rectangle picr;
 Mousectl *mc;
@@ -188,7 +188,11 @@ screeninit(void)
 {
        Point p;
 
-       scale = Dx(screen->r) / vwdx;
+       if(!fixscale){
+               scale = Dx(screen->r) / vwdx;
+               if(Dy(screen->r) / vwdy < scale)
+                       scale = Dy(screen->r) / vwdy;
+       }
        if(scale <= 0)
                scale = 1;
        else if(scale > 16)
@@ -319,5 +323,6 @@ initemu(int dx, int dy, int bpp, ulong chan, int dokey, void(*kproc)(void*))
        if(kproc == nil)
                proccreate(joyproc, nil, mainstacksize);
        bg = allocimage(display, Rect(0, 0, 1, 1), screen->chan, 1, 0xCCCCCCFF);
+       scale = fixscale;
        screeninit();
 }