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
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:
Every unit to be overlaid must have such a directive, whether it is used directly from the Attract's USES list, or indirectly, by one of the USE'd units. Regrettably, this form of the {$O } directive can only be used in the main program, not in units.
NOTE: poor choices for overlaying:
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.