home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15463 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!mumbo.apple.com!gallant.apple.com!wolverine.apple.com!user
  2. From: jpugh@apple.com (Jon Pugh)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: Extended PRam
  5. Message-ID: <jpugh-140992143701@wolverine.apple.com>
  6. Date: 14 Sep 92 21:47:06 GMT
  7. References: <92253.101329JTC4@psuvm.psu.edu>
  8. Sender: news@gallant.apple.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: Apple Computer, Inc.
  11. Lines: 35
  12.  
  13. In article <92253.101329JTC4@psuvm.psu.edu>, JTC4@psuvm.psu.edu wrote:
  14. > Does anyone know the format of PRam beond the 20 bytes documented in IM
  15. > or where it is documented?  Information about how to access it (ReadXPRam
  16. > and WriteXPRam?) would also be appreciated.  I am trying to set the alert
  17. > sound to some default for system 7 and it seems to be kept in XPRam
  18. > somewhere.  I also need to know where system 6.0.7 kept the defalt.
  19.  
  20. It would appear that no one has written down all the secret bytes of XPRAM,
  21. although someone must arbitrate conflicts when we define stuff.  I've just
  22. never needed to know.  I did disassemble the Sound cdev to figure out where
  23. and how the beep resource number was saved for my SwitchBeep cdev
  24. (available on ftp.apple.com in /pub/pugh/switchbeep.sit.hqx).
  25.  
  26. The ReadXParam and WriteXParam traps are apparently discussed in the
  27. hardware manual (a WWDC trivia question was "What are the only traps not
  28. defined anywhere in Inside Macintosh?").  They are register based traps
  29. without glue, so they cannot be called directly from C or Pascal.
  30.  
  31. However, I have created two cheap routines which do exactly what you want. 
  32. Since I am a nice guy, at least at the moment, here they are.  Send money.
  33. ;)
  34.  
  35. FUNCTION GetBeep: Integer; INLINE $204F, $203C, $0002, $007C, $A051;
  36.  
  37. PROCEDURE SetBeep (theBeep: Integer); INLINE $204F, $203C, $0002, $007C,
  38. $A052;
  39.  
  40. These routines use the 'snd ' resource ID number.  This is the same under
  41. system 6 and 7.
  42.  
  43. As usual, these routines are unsafe and unsupported.  I might even be
  44. hosing your stack since I hand assembled them but they seem to work for me.
  45.  
  46. Jon
  47.