some cleanup
use flag PG_GLOBAL to map the video memory