Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!apple!radius!lemke From: lemke@radius.com (Steve Lemke) Newsgroups: comp.sys.mac.programmer Subject: Re: Switching Monitor Depth Keywords: monitor, depth, color Message-ID: <1347@radius.com> Date: 16 Oct 90 00:45:29 GMT References: <1990Oct5.052135.1635@ux1.cso.uiuc.edu> <39821@shemp.CS.UCLA.EDU> Lines: 53 tj@kona.cs.ucla.edu (Tom Johnson) writes: }In article <1990Oct5.052135.1635@ux1.cso.uiuc.edu> jason@ux1.cso.uiuc.edu (Jason Watts) writes: }> }> I am writing a program which needs to change the depth of the main }>monitor. This does not seem to be documented in IM V, "Graphics Devices." }>Does anyone know the procedure for doing this? } }The only somewhat supported way to do this is documented in Tech Note 276: }"Gimmie Depth Or Gimmie Death (So You Want to be a Monitors Impersonator?)" }which details a new call (SetDepth()) availiable in System 6.0.5. This }tech note is probably up on Apple.com via anonymous ftp. Yep, that's the way to do it. I just re-wrote the pop-up bit-depth changer that is in RadiusWare (the init/cdev that ships with Radius display boards for the Mac II and SE/30). There's also a nifty call that you can do to check and see if a certain video mode is available or not - it's called "HasDepth()". HOWEVER, BE AWARE THAT HASDEPTH HAS A BUG!! I ran into this, and had to write around it. If you use HasDepth() on a IIci or IIfx (or any of the new machines with 32-bit QuickDraw in ROM), HasDepth does NOT return the Video Mode as TN276 claims it does. It DOES still return 0 if the mode is not available, but instead of returning 128, 129, 130, 131, etc. for the mode, it just returns 256 (which, as I understand, is a Boolean "TRUE"). This bug has been acknowledged by DTS, though they weren't sure when it would be fixed. Anyway, don't count on the result being a proper video mode number. 256 is not a valid mode, and bad things will happen if you try to send 256 to SetDepth as a mode value. (SetDepth will accept either a video mode number or the bit level i.e. you can send "1" or "128" to switch to one-bit mode.) }Of course this call will only work with 6.0.5 (or later). Has anyone }else come up with some code which will work on earlier versions? It is possible to change the bitdepth without using the new calls, but since any machine on which you would need to change the bitdepth is bound to be running some flavor of System 6.0.x, why put yourself through that hell? I can't think of a reason anyone with a Mac II shouldn't be running at least 6.0.5, so use the call. Of course, you'll want to use SysEnvirons to make SURE that you're running under at least 6.0.5 before you use the call (or else the mouse will lock - trust me!). However, I replaced a few pages of assembly language (our old code) with a fraction of that, using HasDepth and SetDepth. Anyway, if you have any problems understanding TN276 or making it work, feel free to write me and I'll see if I can't help. As others have mentioned, do pay attention to the user interface implications of changing the bit depth. --Steve -- ----- Steve Lemke, Engineering Quality Assurance, Radius Inc., San Jose ----- ----- Reply to: lemke@radius.com (Note: NEW domain-style address!!) -----