Question:
Skin2code.txt shows, to me, the routine for drawing the entire screen. I don't understand how skin2code works if there is only one cell in the viewport that is of skin2, and the rest are of skin0.

Answer:
Here is a long story of how the skin business is implemented.
When the viewport is about to be drawn, the following things happen:
Note that in this example, the function for pits at relative cell 7 gets executed.  But there is nothing that prevents that code from drawing whatever it pleases.  If it wants to black out the screen and draw a picture of a Bald Eagle filling the entire viewport, there is nothing to stop it.  So you could, in principle, provide a SINGLE function that gets called for all cell types and all relative cell numbers and sort it all out yourself as to what should be drawn in the entire viewport.  But using the built-in 'CASE-LIKE' capability makes things easier to manage, IMHO.