Adding counters and control for vsync and hsync signals.