i check for bg tiles with bgget(1,x,y,1) and if it returns true then bgput 1,x/16,/16,0. It is slightly off but not too much