         video_y = VIDEO_BUFFER_LINES - 2;
     }
 
+    float x_mix;
+    float y_mix;
+
     switch (OPTION_VIDEO_FILTER)
     {
         case VIDEO_FILTER_LINEAR:
-
-            float x_mix = float (mod_x) / float (scale);
-            float y_mix = float (mod_y) / float (scale);
+            x_mix = float (mod_x) / float (scale);
+            y_mix = float (mod_y) / float (scale);
 
             /* Fetch the four pixels to interpolate between */
             vec4 pixel_tl = get_pixel (video_x,     video_y    );

        video_x = VIDEO_BUFFER_WIDTH - 2;
    }

    /* TODO: Increased buffer size to handle higher-resolution games. */

    /* Top border. */
    if (video_y < 1)
    {

uniform ivec3 options; /* x = video_filter, y = show_border, z = blank_left */
uniform int scale;


/*
 * Given a pixel coordinate into the video-out, return the colour value.
 * This  function handles the dimming of the border area.
 */
vec4 get_pixel (int x, int y)
{
    bool active_area;
