modify vsync/hsync code to use counter values passed down from host.