Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 7 - Parameter RAM Utilities


Using the Parameter RAM Utilities

The Parameter RAM Utilities provide two functions--GetSysPPtr and WriteParam--that allow you to directly manipulate parameter RAM. The GetSysPPtr function lets you access the low-memory copy of the parameter RAM, and the WriteParam function lets you write the modified low-memory copy back to parameter RAM. A third function, InitUtil, is used by the system software only. At system startup, this function reads the values from parameter RAM into low memory.

You may find it necessary to read the values in parameter RAM or even change them. You read from and write to parameter RAM using the GetSysPPtr and WriteParam functions.

Many of the values held in parameter RAM are also copied at system startup into other low-memory locations. Therefore, to change a value in parameter RAM, you must change all low-memory copies representing the value before you call WriteParam to write the values back to the clock chip. For example, the global variable SPVolCtl points to the location within the system parameters record that stores the speaker volume, and the global variable SdVolume references a copy of this information stored elsewhere in low memory. You could change one without changing the other, although ordinarily you change both simultaneously.

WARNING
It is not recommended that you directly manipulate parameter RAM. Your application should, if at all possible, use the routines provided by the Toolbox to read the information stored in parameter RAM.
The global variable SysParam points to the beginning of the system parameters record stored in low memory. You can access the system parameters record directly by using this global variable, or you can use the GetSysPPtr routine to return a pointer to the system parameters record. Thus, you can access the low-memory system parameters record like this:

WITH GetSysPPtr^ DO
BEGIN
   ...   {access the system parameters record directly here}
END;
IMPORTANT
Though system software automatically copies parameter RAM into low memory at startup, it does not automatically do the reverse. Therefore, after you make a change to the information in the low-memory system parameters record, you must use the WriteParam function to copy values from that record back to the clock chip to make the change permanent.
At startup, system software calls the InitUtil function (which you should never need to call yourself) to copy the values stored in parameter RAM into low memory. (It then copies those values into other appropriate global variables.) When you make changes to the low-memory copy of parameter RAM, you must call the WriteParam function to record your changes in the clock chip.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice