Previous: New Compilation Flags
Up: PtInit updates for Monoprogram form
Previous Page: New Compilation Flags
Next Page: Extensions to Extra Services Control

Setting up Full Re-Initialization

Handling the internal lists of created ports:

To permit the monoprogram to cause Ports to simulate internally the conditions of first execution, Ports now exports the routine:

PROCEDURE ptDiscardPorts( FullRefresh:BOOLEAN);
     "ptDispose"s of every port on the in use list.
      If FullRefresh is TRUE, disposes of all port, including txpSysMsg,
        and sets ptInUseHead to NIL; assumes next call to ptInit will assume
        from this that full initialisation is needed;
      If FullRefresh is FALSE, txpSysMsg is left on the in use list,
        but all other ports are discarded.
      Note actual manner of disposal (to free list, back to system, other)
        is decided by ptDispose.

By calling ptDiscardPorts( TRUE); the Attract program can cause the next call to ptInit to perform a full initialisation.

ptDiscardPorts should clearly not be called by the ordinary dialogue module.

``Passing'' Ports' internal variable settings:

Ports has 2 compilation flags for recalling non-volatile variables, for saving them either to disc or to memory. The monoprogram format takes advantage of the one in memory.

When compiled for monoprogram format, ptInit reads from DlgGlbls's exported variable dgParamSaveBuffer a series of parameters in the form <tag-char>. The tag characters correspond to the Ports variables to be set; if any is missing from the list of parameters, its corresponding variable is not changed. The integer values may have a negative sign (but not a positive one).

tag      Ports variable         Default value if tag is missing
       d          DeadTime                 DefDeadTime
       r          DefaultRead              DefReadTime
       s          DefaultStroke            DefStrokeTime
       t          TchrDefWriteSpeed        DefTicToc
       u          UserDefWriteSpeed        0
       c          CharSetFlag              1 (=TRUE)

TxpTicToc is taken from UserDefWriteSpeed if it is not zero, from TchrDefWriteSpeed otherwise.

UseETCCharSet is equivalent to CharSetFlag > 0.

This set of variables and the logic applied to them is a union of the sets that were previously being handled respectively in saving on disc and saving to memory.



Previous: New Compilation Flags
Up: PtInit updates for Monoprogram form
Previous Page: New Compilation Flags
Next Page: Extensions to Extra Services Control

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