   byte xlat[] = { 0, 0, 0, 1, 5, 2, 3, 4, 0, 6, 0, 7, 11,8, 9,10 };
 
   for (int i = 0; i < MOVETIME; i++) {
-    GD.cmd_gradient(0, 0, 0x101010, 480, 272, 0x202060);
+    GD.cmd_gradient(0, 0, 0x101010, GD.w, GD.h, 0x202060);
     GD.cmd_bgcolor(0x101020);
 
     GD.Begin(BITMAPS);
     GD.SaveContext();
     GD.ColorRGB(0xfff0c0);
     GD.ColorA(0xc0);
-    GD.cmd_scale(F16(32), F16(32));
+    GD.cmd_scale(F16(sf * 32), F16(sf * 32));
     GD.cmd_setmatrix();
     GD.Vertex2ii(32, 8, 1, 0);
     GD.RestoreContext();


static void p2(int &x, int &y, const char *c)
{
  x = 16 * (32 + 32 * (c[0] - 'a'));
  y = 16 * ( 8 + 32 * ('8' - c[1]));
}

#define MOVETIME    10
#define OVERSAMPLE  8

int clocks[2];

    if (c[0])
      moving = 16 * ('8' - c[3]) + (c[2] - 'a');

    GD.SaveContext();
    GD.ColorRGB(0xe0e0e0);
    GD.cmd_loadidentity();
    GD.cmd_scale(F16(sf), F16(sf));
    GD.cmd_setmatrix();
    for (int y = 0; y < 8; y++)
      for (int x = 0; x < 8; x++) {
        int pos = 16 * y + x;
        byte piece = b[pos] & 15;
        if (pos != moving && piece != 0)
          GD.Vertex2ii(32 + sf * 32 * x, 8 + sf * 32 * y, 0, xlat[piece]);
      }

    if (c[0]) {
