Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!pasteur!ames!nrl-cmf!cmcl2!brl-adm!umd5!uvaarpa!mcnc!thorin!unc!steele From: steele@unc.cs.unc.edu (Oliver Steele) Newsgroups: comp.sys.mac Subject: Re: (LSC) Deep Dark Secrets Wanted! Message-ID: <817@thorin.cs.unc.edu> Date: 22 Jan 88 02:44:33 GMT References: <870111@hpcilzb.HP.COM> Sender: news@thorin.cs.unc.edu Reply-To: steele@unc.UUCP (Oliver Steele) Organization: University Of North Carolina, Chapel Hill Lines: 73 tedj@hpcilzb.HP.COM (Ted Johnson) writes: > >Would someone please share the DEEP DARK programming secrets on how to: > > (1)black out the ENTIRE screen (including JCLOCK)? I have seen several > screen savers that do this... What is the magical ROM routine > that I have to call? There are experts on this on the net, but (deep breath) here goes: GrafPort myPort; OpenPort(&myPort); /*does a SetPort too*/ EraseRect(&myPort.portRect); This is OK for a stand-alone, MultiFinder-animous application. If you want something that will trigger update events when it goes away, try Rect bounds; bounds = WMgrPort->portRect; myWindow = NewWindow(0,&bounds,"\pI may appear on the top screen", false,0,-1,false,0); ShowWindow(myWindow); SetPort(myWindow); RectRgn(myWindow.port.visRgn, &bounds); EraseRect(&bounds); ... RectRgn(((WindowPeek)myWindow).strucRgn, &bounds); DisposeWindow(myWindow); DrawMenuBar(); /* or something like this. I'm not at home, so I can't try this out */ Remember that if you do some drawing after you black out the screen, you need to erase the four corners yourself. Neither of these keeps JCLOCK from doing its thing. JCLOCK is run off of the VBL interrupt, and doesn't write into a window, so you need to o Disable VBL interrupts. Nasty. o Change ScreenBits to a buffer area. Nasty. o Flip to the alternate screen buffer. Only works on a Plus and earlier. o Change all the colors to black. Only works on a II (or later? :-) > (2)make a DA live forever (i.e., remain active across launching > different applications from the non-multi Finder), unless > you explicitly close it by clicking on it's close box. > I assume this means patching one or more of the ROM routines.... Set the DA up to launch a VBL task. I think da-insect at sumex has C source for this. > (3)Write an INIT? main(){SysBeep(7);} Set the code type to 'INIT', any number. Build a file called Beeper. User ResEdit or FileMaster or some such to change the type of Beeper to 'INIT'. Put Beeper in your System Folder. Set your sound level to something besides 0. Reboot. You get the idea. "The interrupt system, memory manager, and ROM-based I/O drivers have already been initialized by the ROM boot code. The boot code initializes the Event Manager, the Font Manager, the Resource Manager, and the file system. (Althought the toolbox is initialized at this point, MacsBug does not use the Toolbox.)" This is from the docs for MacsBug, and tells the state of the world when MacsBug is loaded. Since INITs are loaded at about the same time, you're probably safe assuming you have use of the above managers from an INIT. Just remember not to use any A5-relative locations, such as thePort (in InitGraf(&thePort)), but I think the LSC documentation talks about this. ------------------------------------------------------------------------------ Oliver Steele ...!{decvax,ihnp4}!mcnc!unc!steele steele@cs.unc.edu "What is L-marked? Theta-marked. I mean, the mind boggles at the idea of a VP being theta-marked!" -- Gary Hendrick