     //    Bit3   Tile VRAM-Bank  **CGB Mode Only**     (0=Bank 0, 1=Bank 1)
     //    Bit2-0 Palette number  **CGB Mode Only**     (OBP0-7)
 
+    let sprite_size = if gpu_sprite_size { 16; } else { 8; };
+
+    // // Sort the sprite table by priority
+    // let oam_c = malloc(40 * 4);
+    // memcpy(oam_c, oam, 40 * 4);
+    // qsort(oam_c, 40, 4, gpu_sprite_compare);
+    let total = 0;
+
     let i = 0;
-    let total = 0;
     while i < 40 {
       let offset = (i * 4);
 
-      let sprite_y = int16(*(oam + offset + 0)) - 16;
-      let sprite_x = int16(*(oam + offset + 1)) - 8;
+      let sy = int16(*(oam + offset + 0)) - 16;
+      let sx = int16(*(oam + offset + 1)) - 8;
       let sprite_tile = int16(*(oam + offset + 2));
       let sprite_flags = *(oam + offset + 3);
 
       // Remember, we are rendering on a line-by-line basis
       // Does this sprite intersect our current scanline?
 
-      if sprite_y <= int16(gpu_line) and (sprite_y + 8) > int16(gpu_line) {
+      if sy <= int16(gpu_line) and (sy + sprite_size) > int16(gpu_line) {
 
         total += 1;
         if total > 10 {
-          // No more sprites
           break;
         }
 
-        let tile_y: int16 = int16(gpu_line) - sprite_y;
+        let tile_y: int16 = int16(gpu_line) - sy;
         if testb(sprite_flags, 6) {
-          tile_y = 7 - tile_y;
+          tile_y = sprite_size - 1 - tile_y;
+        }
+
+        // IFF sprite_size is 16 ..
+        if sprite_size == 16 {
+          // Top or bottom tile?
+          if tile_y < 8 {
+            // Top
+            sprite_tile &= 0xFE;
+          } else {
+            // Bottom
+            tile_y -= 8;
+            sprite_tile |= 0x01;
+          }
         }
 
         let td_address: int16 = sprite_tile * 16 + int16(tile_y) * 2;

              };

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

  gpu_line = 0;
}

def gpu_sprite_compare(a: *uint8, b: *uint8): c_int {
  let a_x = *(a + 1);
  let b_x = *(b + 1);

  if a_x < b_x {
    return -1;
  }

  if b_x > a_x {
    return 1;
  }

  if a_x == b_x {
    let aptr = a as uint64;
    let bptr = b as uint64;

    if aptr < bptr {
      return -1;
    }

    if bptr > aptr {
      return 1;
    }
  }

  return 0;
}

def gpu_render_scanline() {
  // TODO: Combine Window & Background rendering .. code is super duplicated

  // Set whole line to 0x0 (clear)
  let i = 0;
  while i < 160 {
    *(gpu_framebuffer + (int64(gpu_line) * 160) + i) = 0;

    i += 1;
  }

  // Background
  if gpu_bg_enable {
