Previous: Converting Attract Mode into Main Program
Up: Converting Attract Mode into Main Program
Next: The Module-Calling Cycle
Previous Page: Converting Attract Mode into Main Program
Next Page: The Module-Calling Cycle

Making and Using the Overlays

Even if the entire code of the dialogue could fit in memory at once, it would take a long time to load all its code from disc. All monoprogram dialogues so far have therefore used Turbo Pascal's overlay manager, the unit Overlay, to make each module a separately loadable unit. These units are contained not in the .EXE file of the program itself, but in a file ending in .OVR which the Overlay manager administers.

To import all the modules and make them into overlays:

EXAMPLE:

USES AttrXtra, Overlay, MarkJump, Ports, PDisplay, 
         MenuDisplay, BasketWv1, BasketWv2, BasketWv3, BasketWv4;
    {$O MenuDisplay}
    {$O BasketWv1}
    {$O BasketWv2} {$O BW2Utils} {$O BW2Graph}
    {$O BasketWv3}
    {$O BasketWv4}

This is from the Attract program for the imaginary dialogue ``Basket Weaving''. All four modules are overlaid. Also, Basket Weaving 2 has two support units of its own which are to be overlaid.



Previous: Converting Attract Mode into Main Program
Up: Converting Attract Mode into Main Program
Next: The Module-Calling Cycle
Previous Page: Converting Attract Mode into Main Program
Next Page: The Module-Calling Cycle

Educational Technology Center
Dept. of Info. and Comp.Sci.
Univ. of California, Irvine
92717, CA, USA