improve code for ppu scanline rendering.