MacTrove  — Classic Macintosh Archive
 
 Home Software Hardware Docs Magazines Forums Search
Search:   Software, forums, magazines & more

Pram Save Restore C

File pram-save-restore-c.hqx
Size 151.4 KB
Category Development
Mac OS System 7
↓ Download pram-save-restore-c.hqx

Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute corrections, and join the community chat.

About

What: save the PRAM and extended PRAM and restore it on start-up Contents: PRAM boss - System extension (but can run as application if the file type changed from INIT to APPL) PRAM boss.pi - Project for the application part of PRAM boss PRAM save.cc - Source code for the application part of PRAM boss PRAM reset.pi - Project for the INIT resource that restores PRAM PRAM reset.c - source code for the INIT resource PRAM guard.* - application and the source code to set/restore just the regular PRAM at any time The source code contains enough (I hope) comments to show what a particular piece of code does, as well as some tricks involved Language: Symantec C/C++ 6.0 and built-in Assembler System: System 7.x, but probably 6.x is OK, too. Tested on IIsi, IIci, Quadras and Centres. Note: the source code uses a "standard" environment, see myenv-notify.cpt Comments to: oleg@ponder.csci.unt.edu, oleg@unt.edu References: DiskParam (/info-mac/util/), SetXParam (from redback.cs.uwa.edu.au (130.95.80.61) as "/ComSci/LabUtilities/SetXParam.sit") Special note: for a map of the extended PRAM, read on. Explanation: PRAM boss is a better version of DiskParam. The PRAM boss is a bundle of an application and an INIT resource. The application (when double-clicked) just dumps the contents of the 20-byte regular PRAM plus the contents of the entire Extended PRAM into a 'HEXA' resource. The INIT resets the regular PRAM and (a part of) the extended PRAM to the values saved into the 'HEXA' resource. The date/time is not spoiled! So, you can run the application on your computer and create a HEXA resource with some 'standard' settings. Then you can change the creator to INIT and drop the (now a 'System Extension') into the Extensions folder. From that moment on, whenever you restart your Mac, the PRAM and extended PRAM are reset to their "standard" values. You can even delete the code resource with the Resource editor: that way there is no way you can change the "standard" values. It's perfect for computers in the Lab. The INIT that resets the PRAMs does NOT patch the system, nor it takes any memory in the system heap, etc. After it resets the PRAM, it quietly quits without leaving any traces in the system. The distribution contains the compiled PRAM boss in the guise of the System extension. To run it as an application, change the file type to APPL. PRAM guard is my early experiment, it works only with the regular PRAM, but it's got a nice (I hope) user interface written in C++! Map of the extended PRAM (for references) from the article posted in comp.sys.mac.{programmer,system, hardware} with comments from ez015670@othello.ucdavis.edu, quinn@cs.uwa.edu.au, wolfson@ll.mit.edu, and small corrections Extended PRAM Map Loc Length Related to (hex) (dec) 1 1 Used by a system program _InternalWait 8 4 Looks like the last 4 bytes of the regular PRAM (See IM, Vol II, OS Util)

MacTrove — Classic Macintosh Archive — Full site | Software | Search
Classic version — compatible with older browsers.