Previous: New units for DOS
Up: New units for DOS
Next: UCSDPrimitives
Previous Page: New units for DOS
Next Page: UCSDPrimitives

AttrXtra

The purpose of AttrXtra (Attract-mode Extras) is to provide services needed typically only by Attract modes. The most important one here is the initialization of the unit Overlay in its correct order.

Before any overlaid units can be used by the program, the Overlay manager has to be initialized; however, since some of them may have to contain initialization code which runs before the first statement of the main program does, the Overlay manager has to be initialized before that initialization code is run. Obviously no statement in the program itself can do that; so AttrXtra's initialization code does it. The attract program assures that this initialization runs first simply by listing AttrXtra in the USES list ahead of any overlaid unit.

CAUTION: The initialization of Overlay includes at least giving it the name of the file containing the overlays (Turbo Pascal generates this file as it compiles the monoprogram). However, AttrXtra can't know beforehand under what particular name the .OVR file will be created; and since, as shown above, it must use its own initialization code for this job, it cannot take any parameters from the program. It handles this by searching the current directory for the first file in it ending in .OVR and initializing Overlay with that. It is therefore very important that the first .OVR it finds be the right one for this program. Clearly the safest way is to have only one .OVR in the directory at a time.

Overlay allows other parameters to be adjusted as well, such as possible use of expanded memory according to the L.I.M. expanded memory model, or adjustment of the size of the overlay buffer. This version of AttrXtra, however, makes no adjustment to these parameters.

AttrXtra's exported declarations are:

UNIT AttrXtra;

INTERFACE

FUNCTION ProgNamed( NameParam, ProgNameList: STRING): INTEGER;

IMPLEMENTATION



Previous: New units for DOS
Up: New units for DOS
Next: UCSDPrimitives
Previous Page: New units for DOS
Next Page: UCSDPrimitives

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