improve code for ppu scanline 0 handling.