Refactor and fix core vblank support