Just to beat a dead horse...
The method i use is quite simple, and makes use of the POINT and RECT structs.
for those not familiar with POINT or RECT, POINT has two ints: x,y; and RECT has four ints: left,top,right,bottom.
any position can be represented by a POINT, any rectangular area can be represented by a RECT.
so, your world may be 1600x1600 pixels, and your resolution of choice is 800x600. (for the sake of discussion, i am assuming that the ENTIRE display is used)
your main character (or camera, or whatever) is represented by a POINT structure that describes a location in worldspace (described by the RECT l=0,t=0,r=1600,b=1600) (This is called an anchor point)
and of course, you want the camera to look at the center of the screen(400,300).
so, a RECT describing the extent of the camera is l=-400,t=-300,r=400,b=300
so, adding x to left and right, and y to top and bottom, you have the RECT in worldspace that describes what is seen in screen space.
but, we dont want our RECT to be outside of worldspace, so we clip our anchor to a RECT that ensures that the RECT will not contain any points not in worldspace.
we take the anchor extent RECT (-400,-300,400,300) and subtract it from the coordinates of worldspace (0,0,1600,1600), to get anchorspace (400,300,1200,1300). now, as long as the anchor is within anchorspace, we can plot whatever is in worldspace into screenspace without fear.
how does this relate to scrolling?
well, when scrolling, all you need to do is move the anchor, and clip it to anchorspace.
[This message has been edited by TANSTAAFL (edited December 16, 1999).]