               };
 
               // Push pixel to framebuffer
-              let fbo: int64 = (int64(gpu_line) * 160) + int64(sprite_x + x);
+              let fbo: int64 = (int64(gpu_line) * 160) + int64(sx + x);
               if testb(sprite_flags, 7) {
                 let bgcolor = *(gpu_framebuffer + fbo);
                 if bgcolor == 0 {


        let x: int16 = 0;
        while x < 8 {
          if (sprite_x + x >= 0) and (sprite_x + x < 160) {
            // Make a bitmask for the pixel being rendered
            let pixel_mask = 0x80 >> (if testb(sprite_flags, 5) { 7 - x; } else { x; });



      i += 1;
    }

    // Free temp OAM
    // free(oam_c);
  } else {
    // Sprites not enabled
    // FIXME: Should we do anything special here?
