This simple demo should help with the math portion of a 2D pixel-perfect scrolling map (ignore the clunky tiles).
http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=turtle177603142002002034&comments=no
http://www.blitzcoder.com/cgi-bin/showcase/showcase_showentry.pl?id=turtle177603142002002034&comments=no