video controller logic