First functioning version of VIDEO_TIMING_GEN (not fully tested)