Well, more specifially I would think you define each viewport at say 0,0 with a width/height of 200,200 (example)
hide all cameras, show one, render, copyrect to a image buffer, hide, show next, render, copyrect, etc, etc
At the end just draw all four images to the screen where you want the viewports visible.
hide all cameras, show one, render, copyrect to a image buffer, hide, show next, render, copyrect, etc, etc
At the end just draw all four images to the screen where you want the viewports visible.