+ // Find name table:
+ nametab = PicoMem.vram;
+ nametab += (pv->reg[2] & 0x0e) << (10-1);
+ nametab += (line>>3) << (6-1);
+
+ dx = pv->reg[8]; // hscroll
+ if (scanline < 16 && (pv->reg[0] & 0x40))
+ dx = 0; // hscroll disabled for top 2 rows
+
+ tilex = ((-dx >> 3) + cellskip) & 0x1f;
+ ty = (line & 7) << 1; // Y-Offset into tile
+ cells = maxcells - cellskip;
+
+ dx = ((dx - 1) & 7) + 1;
+ if (dx != 8)
+ cells++; // have hscroll, need to draw 1 cell more
+ dx += cellskip << 3;
+
+ // low priority tiles
+ if (!(pv->debug_p & PVD_KILL_B))
+ draw_strip(nametab, dx, cells, tilex | 0x0000 | (ty << 16));
+
+ // sprites
+ if (!(pv->debug_p & PVD_KILL_S_LO))
+ draw_sprites(scanline);
+
+ // high priority tiles (use virtual layer switch just for fun)
+ if (!(pv->debug_p & PVD_KILL_A))
+ draw_strip(nametab, dx, cells, tilex | 0x1000 | (ty << 16));
+
+ if (pv->reg[0] & 0x20)
+ // first column masked
+ ((int *)Pico.est.HighCol)[2] = ((int *)Pico.est.HighCol)[3] = 0xe0e0e0e0;