If you want to see a simple video system that renders partial scanlines via timers see the sam coupe driver (just to give you some pointers).