From: pottier@clipper.ens.fr (Francois Pottier) Subject: csmp-digest-v3-012 Date: Mon, 11 Apr 94 12:52:57 MET DST C.S.M.P. Digest Mon, 11 Apr 94 Volume 3 : Issue 12 Today's Topics: Antialiasing code-algo somewhere? Finding full path names Global cursor change: how to? Graphic Elements: an element that isn't there How do I read digital samples from an audio CD? I crashed a Power Mac! Multiple HD Reads, can it be done? PBDTGetAPPL on a network volume? PEF, XCOFF Info Wanted QuickDraw Question Quickdraw Blend Function Inaccurate? Read-Save Styled Text Code Try 3: Movie Credit Scrolling - How? making fat binaries question The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier (pottier@clipper.ens.fr). The digest is a collection of article threads from the internet newsgroup comp.sys.mac.programmer. It is designed for people who read c.s.m.p. semi- regularly and want an archive of the discussions. If you don't know what a newsgroup is, you probably don't have access to it. Ask your systems administrator(s) for details. If you don't have access to news, you may still be able to post messages to the group by using a mail server like anon.penet.fi (mail help@anon.penet.fi for more information). Each issue of the digest contains one or more sets of articles (called threads), with each set corresponding to a 'discussion' of a particular subject. The articles are not edited; all articles included in this digest are in their original posted form (as received by our news server at nef.ens.fr). Article threads are not added to the digest until the last article added to the thread is at least two weeks old (this is to ensure that the thread is dead before adding it to the digest). Article threads that consist of only one message are generally not included in the digest. The digest is officially distributed by two means, by email and ftp. If you want to receive the digest by mail, send email to listserv@ens.fr with no subject and one of the following commands as body: help Sends you a summary of commands subscribe csmp-digest Your Name Adds you to the mailing list signoff csmp-digest Removes you from the list Once you have subscribed, you will automatically receive each new issue as it is created. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest. Questions related to the ftp site should be directed to scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP digest are available there. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src. ------------------------------------------------------- >From mcmath@csb1.nlm.nih.gov (Charles F. McMath) Subject: Antialiasing code-algo somewhere? Date: Fri, 25 Mar 94 15:44:51 GMT Organization: National Library of Medicine (Tried to post this last night, looks like it didn't work. That will explain any duplicates floating around...) I have a TIFF image I'm displaying in a window; however, it needs to be antialiased. I've seen some antialiasing code that works on text, but it's written in Think C with inline assembly. I need to do something in MPW, and would prefer straight C code. Anybody have any pointers as to where I can look? If such code exists, that'd be great, but I'll take leads to books, articles, etc, on antialiasing. Note this is dealing with generalized graphics, not text (which I read last night, 32-bit QD can antialias - see develop issue 1, I think). Thanks to all! chuck +--------------------------------------------------------------------------+ | Chuck McMath * On Line Computer Systems, Inc. * chuck@ocs.com | | Hey batter, hey batter, hey batter, swing!" - Anon. | | Best Album of 1994: "Barney & Friends" Best Song: Barney's "I Love You" | +--------------------------------------------------------------------------+ +++++++++++++++++++++++++++ >From lowry@shiva.eche.ualberta.ca (Brian Lowry) Date: 25 Mar 1994 20:58:58 GMT Organization: Chem Eng - Univ of Alberta In article <1994Mar25.154451.1487@nlm.nih.gov>, mcmath@csb1.nlm.nih.gov (Charles F. McMath) wrote: > I have a TIFF image I'm displaying in a window; however, it needs > to be antialiased. I've seen some antialiasing code that works on > text, but it's written in Think C with inline assembly. I need to > do something in MPW, and would prefer straight C code. Draw the TIFF in an offscreen 24 bit GWorld and then Update the GWorld to the desired size - you should get an anti-aliased version of your image (inasmuch as simple averaging is anti-aliasing -- some might argue it isn't). All included gratis, thanks to 32 bit Quickdraw... -- Brian Lowry +++++++++++++++++++++++++++ >From markhanrek@aol.com (MarkHanrek) Date: 27 Mar 1994 01:16:02 -0500 Organization: America Online, Inc. (1-800-827-6364) In article <1994Mar25.154451.1487@nlm.nih.gov>, mcmath@csb1.nlm.nih.gov (Charles F. McMath) writes: You might look in the "Graphic Gems" source code collection, and also in "NIH Image". Sorry, I'm unable to specify where you can find these. Mark Hanrek --------------------------- >From mike Subject: Finding full path names Date: 21 Mar 1994 21:35:56 GMT Organization: Comp Sci Dept. VUW I have been attempting to use the std file package to get full pathnames for files. What I want to do is use SFGetFile to select a file and then return the full pathname for that file. Is there any way of getting the full pathname of the default directory? Mac Revealed says the vRefNum is the reference number of the default directory but as far as I can tell it is the reverence number of the volume (irrespective of the directory within that vol). I suppose I want a way of doing the equialent of the UNIX command pwd. Any ideas suggestions.. mike ps I know you are not supposed to refer to files by pathnames but this is for a first course in programming and vRefNums and FileRefNums is a bit heavy at this stage. ============================================================== mike@comp.vuw.ac.nz mike.doyle@vuw.ac.nz Mathematics and Computer Science Departments 3rd Floor Cotton Building Victoria University P O Box 600 Phone: + 64 4 472 1000 x8874 Wellington, New Zealand. Fax: + 64 4 471 2070 ============================================================== +++++++++++++++++++++++++++ >From walkerm@acf2.nyu.edu (Michael A. Walker) Date: Thu, 24 Mar 1994 18:52:15 -0500 Organization: New York University In article <2ml3vs$ccc@st-james.comp.vuw.ac.nz>, mike wrote: > I have been attempting to use the std file package to get > full pathnames for files. What I want to do is use SFGetFile > to select a file and then return the full pathname for that > file. > The code to do this isn't really that hard. SFGetFile, and its cousins, return the volume name and directory of the file selected in its dialog. You can use this with the following: void PathNameFromDirID(long dirID, short vRefNum, StringPtr fullPathName) { CInfoPBRec block; Str255 directoryName; OSErr err; fullPathName[0] = '\0'; block.dirInfo.ioDrParID = dirID; block.dirInfo.ioNamePtr = directoryName; do { block.dirInfo.ioVRefNum = vRefNum; block.dirInfo.ioFDirIndex = -1; block.dirInfo.ioDrDirID = block.dirInfo.ioDrParID; err = PBGetCatInfo(&block, FALSE); pstrcat(directoryName, (StringPtr)"\p:"); pstrinsert(fullPathName, directoryName); } while (block.dirInfo.ioDrDirID != 2); } where fullPathName is a pointer to a string (pascal string, if I remember correctly) you give the function to store the full path name. The functions 'pstrcat' and 'pstrinsert' are defined as: void pstrcat(StringPtr dst, StringPtr src) { BlockMove(src + 1, dst + *dst + 1, *src); *dst += *src; } void pstrinsert(StringPtr dst, StringPtr src) { BlockMove(dst + 1, dst + *src + 1, *dst); BlockMove(src + 1, dst + 1, *src); *dst += *src; } Hope this helps. -- Michael A. Walker New York University walkerm@acf2.nyu.edu ==============================================------------------------8-; main() {int x,y,k;char *b=" .:,;!/>)|&IH%*#@";double cr,ci,zr,zi,temp,cx,cy; for(y=30;puts(""),cy=y*0.1-1.5,y-->=0;){for(x=0;cx=x*0.04-2,zr=0,zi=0,x++<75;) {for(cr=cx,ci=cy,k=0;temp=zr*zr-zi*zi+cr,zi=2*zr*zi+ci,zr=temp,k<112;k++) if(zr*zr+zi*zi>10)break;printf("%c",b[k%16]);}}} /* try this on for size!! */ +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wätte) Date: 25 Mar 1994 08:35:26 GMT Organization: The Royal Institute of Technology In walkerm@acf2.nyu.edu (Michael A. Walker) writes: > do { > block.dirInfo.ioVRefNum = vRefNum; > block.dirInfo.ioFDirIndex = -1; > block.dirInfo.ioDrDirID = block.dirInfo.ioDrParID; > err = PBGetCatInfo(&block, FALSE); > pstrcat(directoryName, (StringPtr)"\p:"); > pstrinsert(fullPathName, directoryName); > } while (block.dirInfo.ioDrDirID != 2); So if you get an error, you wil just keep looping without ever leaving the loop? Cheers, / h+ -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- CORRECTLY in this case meaning to the language spec, not to the naive expectations of the programmer. +++++++++++++++++++++++++++ >From Carl R. Osterwald Date: Fri, 25 Mar 94 16:06:09 GMT Organization: National Renewable Energy Laboratory In article Michael A. Walker, walkerm@acf2.nyu.edu writes: > fullPathName[0] = '\0'; . . . >where fullPathName is a pointer to a string (pascal string, if I >remember correctly) you give the function to store the full >path name. Using a Pascal string for the result will fail if the resultant full path name exceeds 255 characters, which is entirely possible. This is one reason why the OS never really uses full path names, and why the StandardFile routines use FSSpecs instead. +++++++++++++++++++++++++++ >From robert@fpksu65.bv.tu-berlin.de (Robert Uebbing) Date: 27 Mar 1994 09:56:25 GMT Organization: TU Berlin In article , Carl R. Osterwald wrote: > > In article Michael A. > Walker, walkerm@acf2.nyu.edu writes: > > fullPathName[0] = '\0'; > . > . > . > >where fullPathName is a pointer to a string (pascal string, if I > >remember correctly) you give the function to store the full > >path name. > > Using a Pascal string for the result will fail if the resultant full path > name exceeds 255 characters, which is entirely possible. This is one > reason why the OS never really uses full path names, and why the > StandardFile routines use FSSpecs instead. well, the main reason why the MacOS uses FSSpecs to identify files is that the full file path name is *not* definite. you can give different volumes with the same name and therefore have the identical full path name for different files (opposed to the unix and dos file system). robbi *********************************************************************** * Robert Uebbing * * - Institut fuer Photogrammetrie und Kartographie an der TU Berlin - * * - Institute for Photogrammetry and Cartography TU Berlin, Germany - * *********************************************************************** --------------------------- >From AIKEN Subject: Global cursor change: how to? Date: Sun, 27 Mar 1994 05:19:26 GMT Organization: McGill University I'm writing a background app that kicks in every once in a while, and I would like to communicate the fact that I'm working to the user. I figured a cute way of doing this would be an Auto-Doubler-like cusor switch (For the unfamiliar, AD changes the cursor to "AD" when it's working on your drive). However, cursor changes seem to be local to an app, i.e. the cursor only actually gets changed on a SetCursor() call if your app is in the foreground. So, of course, calling setCursor() from a background app seems to have no effect at all. Is there a way of accomplishing what I wish to do? Any advice appreciated. Cheers, Mark Aiken inra@musicb.mcgill.ca +++++++++++++++++++++++++++ >From markhanrek@aol.com (MarkHanrek) Date: 27 Mar 1994 01:28:06 -0500 Organization: America Online, Inc. (1-800-827-6364) AutoDoubler and Public Utilities and other things which change the cursor when they are active have one thing in common -- they are all extensions. When extensions patch a trap, such as SetCursor, they patch it before any applications are active, and affect the behavior of all that follows. But if an application patches SetCursor, it only impacts itself when it is active. To be able to affect the cursor "globally" no matter what, an extension of some sort will be required ( a helper extension or full blown doohickie ). Have fun! :) Mark Hanrek +++++++++++++++++++++++++++ >From Robin J. Lunge Date: 28 Mar 1994 02:40:25 GMT Organization: Cornell University To set the cursor from the background, you can fiddle with the low-memory globals TheCrsr and CrsrNew. The former contains the current (1-bit) cursor. The latter has to be tickled to get the system to actually show the change. +++++++++++++++++++++++++++ >From pottier@trimaran.ens.fr (Francois Pottier) Date: 28 Mar 1994 14:10:42 GMT Organization: Ecole Normale Superieure, PARIS, France In article <2n5g2pINN450@newsstand.cit.cornell.edu>, Robin J. Lunge wrote: >To set the cursor from the background, you can fiddle with the low-memory >globals TheCrsr and CrsrNew. The former contains the current (1-bit) >cursor. The latter has to be tickled to get the system to actually show >the change. Another, cleaner way (IMHO) is to record the address of _SetCursor at INIT time, and then call it directly. Thus you're able to bypass Multifinder's patch and change the cursor even when you're in the background. The only drawback is that you need an INIT. In my case it didn't matter because I already had one. -- Francois Pottier pottier@dmi.ens.fr +++++++++++++++++++++++++++ >From wdh@netcom.com (Bill Hofmann) Date: Mon, 28 Mar 1994 17:51:23 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) >In article <2n5g2pINN450@newsstand.cit.cornell.edu>, >Robin J. Lunge wrote: >>To set the cursor from the background, you can fiddle with the low-memory >>globals TheCrsr and CrsrNew. The former contains the current (1-bit) >>cursor. The latter has to be tickled to get the system to actually show >Another, cleaner way (IMHO) is to record the address of _SetCursor at >INIT time, and then call it directly. Thus you're able to bypass Multifinder's > >The only drawback is that you need an INIT. In my case it didn't matter Eeek. But if you get the address of SetCursor and call it directly, you also lose any *other* patches installed, that the USER has installed, like ClikChange or other abominations. To do it right, you should *patch* SetCursor, and normally have your patch be a no-op. A modern Mac way to communicate easily would be to set up a: 1. SetCursor patch which looks at a variable to determine whehter to fool with the cursor 2. a Gestalt selector which either provides the address of said variable or a pointer to a function to call which would set the variable and do other things Since the original poster seems to want to (probably) animate the cursor or some such thing, one useful way to do this would be to use the Gestalt proc to return the address of a function which either a. fired off a VBL task which animates the cursor (being sure to check CrsrBusy before calling SetCursor) b. turns off the VBL task. Ugh. Getting complex... -- -Bill Hofmann wdh@netcom.COM Fresh Software and Instructional Design +1 510 524 0852 --------------------------- >From al@crucible.powertools.com (Al Evans) Subject: Graphic Elements: an element that isn't there Date: 28 Mar 94 17:54:34 GMT Organization: PowerTools, Austin, Texas This is an answer to a question about Graphic Elements which several people have asked me in email. If you don't have Graphic Elements, skip this article -- or better yet, go ftp it from mac.archive.umich.edu (or its mirror sites): /mac/misc/demo/graphicelementsdemo.sit.hqx. Don't be put off by the name: the file includes a Think C 6.0 linkable library and example programs with source code. The following simple Graphic Element has two basic uses: 1) It can act as an invisible "detector", to report or take action whenever another Graphic Element enters a certain rectangle within its world; 2) It can be slaved to another Graphic Element in order to give that element a collision rectangle different in size or position from its animationRect. In either case, an appropriate collision procedure should be assigned to the "null" element. - ---Source code for null Graphic Element----- pascal void RenderNullElement(GrafElPtr element, GWorldPtr destGWorld) { #pragma unused(destGWorld, element) //For debugging, could do //FrameRect(&element->animationRect); } GrafElPtr NewNullElement(GEWorldPtr world, OSType id, short plane, Rect *animRect) { GrafElPtr element; element = NewGrafElement(world, id, plane, sizeof(GrafElement), NoLoader, 0, 0); if (element) { element->animationRect = *animRect; element->copyMode = 0; element->flags = geShown; element->renderIt = RenderNullElement; element->drawIt = nil; element->drawData = nil; element->changeIntrvl = 0; } return element; } - ---end source code----- --Al Evans-- -- Al Evans | Graphic Elements: A new standard for | high-performance interactive Macintosh graphics. al@crucible.powertools.com | Available from mac.archive.umich.edu | /mac/misc/demo/graphicelementsdemo.sit.hqx --------------------------- >From bfitz@ACM.ORG Subject: How do I read digital samples from an audio CD? Date: 23 Mar 1994 19:39:09 GMT Organization: ACM Network Services How can I read the digital audio data from an audio CD in a usable >From bfitz@ACM.ORG Subject: How do I read digital samples from an audio CD? Date: 23 Mar 1994 19:47:35 GMT Organization: ACM Network Services How can I read the digital audio data from an audio CD in a usable (mungeable) format? Ideally, I want to get 44Khz 16-bit stereo data which I can then process myself (using custom soudn processing routines). I did the trick about running MoviePlayer (on a PowerMacintosh 7100/66 with a CD 300i), and using Open to convert a track from an audio CD into a QuickTime movie. Now what? I found a utility called Movie2Snd that looks like it's supposed to make an 'snd ' resource out of the soundtrack of a QuickTime movie, but it fails on these (5 to 8 MB) movies. It "looks" like all I need to do is OpenMovieFile() NewMovieFromFile() CloseMovieFile() PutMovieIntoTypedHandle() but the QuickTime documentaion is very vague about sample rates, sample size, etc. Also, given that MoviePlayer turned a 4 minute sample into a mere 5.3 MB file indicates that it is probably saving this as a mono 8-bit 22.254 Khz sample. I really want the original 44Khz 16-bit data. So, where do I go to find out how to get the audio data samples? Any documents I can read? Anyone's brain I can pick? Favors to exchange? -- Brian Fitzgerald -- +++++++++++++++++++++++++++ >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Date: 25 Mar 94 15:41:47 +1300 Organization: University of Waikato, Hamilton, New Zealand In article <2mq6cn$jr5@hopper.acm.org>, bfitz@ACM.ORG writes: > > ... the QuickTime documentaion is very vague about sample rates, sample > size, etc. This is all explained in "Inside Macintosh: QuickTime". Information about samples is stored in sample descriptions; the descriptions for sound samples are defined in Movies.h/p/def. > Also, given that MoviePlayer turned a 4 minute sample into a > mere 5.3 MB file indicates that it is probably saving this as a mono 8-bit > 22.254 Khz sample. I really want the original 44Khz 16-bit data. There is an "Options..." button in the movie open dialog. This is where you choose sample size and rate, and the portion of the track you want to capture. Lawrence D'Oliveiro fone: +64-7-856-2889 Info & Tech Services Division fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00 +++++++++++++++++++++++++++ >From rrwood@ionews.io.org (Roy Wood) Date: 26 Mar 1994 11:22:16 -0500 Organization: Internex Online (io.org) Data: 416-363-4151 Voice: 416-363-8676 I know that QuickTime makes it possible to read audio CD files from Apple CD ROM drives (well, some Apple CD ROM drives), but I'm not sure that it works with drives manufactured by other manufacturers (NEC, etc.). Does anyone know if it is possible to use QuickTime to read audio files using a non-Apple CD ROM drive? And as far as using QuickTime goes, it works, but it's kind of indirect. Has anyone played around with writing a device driver that allows the audio tracks to be read directly? I know there would be all kinds of nuisance problems with it, but it should be possible. Anybody listening on this one? I'd be willing to give it a try if I could get some info about the SCSI commands that allow reading of data from the audio part of the disk.... -Roy +++++++++++++++++++++++++++ >From paulcho@ionews.io.org (paulcho) Date: 26 Mar 1994 11:38:31 -0500 Organization: Internex Online (io.org) Data: 416-363-4151 Voice: 416-363-8676 Article: 23239 of comp.sys.mac.programmer wrote: > How can I read the digital audio data from an audio CD in a usable > (mungeable) format? Ideally, I want to get 44Khz 16-bit stereo data which > I can then process myself (using custom soudn processing routines). > > I did the trick about running MoviePlayer (on a PowerMacintosh 7100/66 with > a CD 300i), and using Open to convert a track from an audio CD into a > QuickTime movie. Now what? I found a utility called Movie2Snd that looks > like it's supposed to make an 'snd ' resource out of the soundtrack of a > QuickTime movie, but it fails on these (5 to 8 MB) movies. > > It "looks" like all I need to do is > > OpenMovieFile() > NewMovieFromFile() > CloseMovieFile() > > PutMovieIntoTypedHandle() > PutMovieIntoTypedHandle work in RAM, you just ran out of memory. > but the QuickTime documentaion is very vague about sample rates, sample > size, etc. Also, given that MoviePlayer turned a 4 minute sample into a > mere 5.3 MB file indicates that it is probably saving this as a mono 8-bit > 22.254 Khz sample. I really want the original 44Khz 16-bit data. Look for the "options..." button in the StandPutFile after you press "Convert..." in the StandGetFile. You can chose 44Khz, 22Khz, 11 Khz, 8/16bit, mono/Stereo,selection start time and end time etc. in the Audio CD Import Options dialog. > So, where do I go to find out how to get the audio data samples? Any > documents I can read? Anyone's brain I can pick? Favors to exchange? > > -- Brian Fitzgerald -- Anyway, try my DeskTopMovie program (part of MovieTrilogy available from sumex). You can import the movie and convert it to AIFF format. I tried on a 4:52 audio track and resulted in a 47MB file. ________________________________________________________________ Paul C.H. Ho paulcho@io.org Pink Elephant Technologies Paul_C.H._Ho@magic-bbs.corp.apple.com 74020.772@compuserve.com +++++++++++++++++++++++++++ >From jwang@soda.berkeley.edu (James Wang) Date: 26 Mar 1994 21:53:15 GMT Organization: Computer Science Undergrad Assoc., UCBerkeley In article <2n1nfo$m4n@ionews.io.org>, Roy Wood wrote: >does anyone know if it is possible to use QuickTime to read audio files using >a non-Apple CD ROM drive? it's not possible to digitize audio tracks from anything but an apple CD300, CD300i, or CD300+ using QuickTime 1.6.1. >And as far as using QuickTime goes, it works, but it's kind of indirect. >Has anyone played around with writing a device driver that allows the audio >tracks to be read directly? I know there would be all kinds of nuisance i read in MacUser that Disk-to-Disk is one commerical package that does this with good third-party drive support. +++++++++++++++++++++++++++ >From dspman@aol.com (DSPman) Date: 26 Mar 1994 23:09:02 -0500 Organization: America Online, Inc. (1-800-827-6364) I've read CD audio from a CD-300i into QuickTime movies but it's screwed up. The left and right channels intermittently switch. I had heard that there was a bug in the ROMs or something. Can anyone confirm this? Will Apple fix this? I expected to do this with my 840av but something is wrong. George Warner warnergt@aloft.att.com +++++++++++++++++++++++++++ >From Manuel Veloso Date: Sun, 27 Mar 1994 23:18:16 GMT Organization: Ibex Productions In article <2mq6cn$jr5@hopper.acm.org> , bfitz@ACM.ORG writes: >How can I read the digital audio data from an audio CD in a usable >(mungeable) format? Ideally, I want to get 44Khz 16-bit stereo data which >I can then process myself (using custom soudn processing routines). There was a code snippet posted to alt.sources.mac that let you suck audio straight from the CD into a file. I'm not sure where the archives are, but it's up there. +++++++++++++++++++++++++++ >From mxmora@unix.sri.com (Matt Mora) Date: 28 Mar 1994 13:41:37 -0800 Organization: SRI International, Menlo Park, CA In article <2n1nfo$m4n@ionews.io.org> rrwood@ionews.io.org (Roy Wood) writes: >Has anyone played around with writing a device driver that allows the audio >tracks to be read directly? I know there would be all kinds of nuisance >problems with it, but it should be possible. Anybody listening on this >one? I'd be willing to give it a try if I could get some info about the >SCSI commands that allow reading of data from the audio part of the disk.... I believe Apple has already written one. It documented in a tech note. You make calls to the driver to control the cd rom drive. I'm using it in my cd application. The code to start you off is on the developer CD. Xavier -- ___________________________________________________________ Matthew Xavier Mora Matt_Mora@sri.com SRI International mxmora@unix.sri.com 333 Ravenswood Ave Menlo Park, CA. 94025 --------------------------- >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Subject: I crashed a Power Mac! Date: 23 Mar 94 16:43:47 +1300 Organization: University of Waikato, Hamilton, New Zealand People, I have managed, without really trying, to write and distribute a PowerMac-incompatible program. Get your FTP self over to Sumex and pick up the file info-mac/disk/fix-icons.hqx (or something like that). That program completely goes off into the weeds on a 6100/60. I just tried sending an update, and it was (quite rightly) rejected by one of the moderators, as it appears they are now testing submissions on a Power Mac. But of course the existing version already in the archive has the same problem. And you know what the problem is? I'm calling InitFonts before InitGraf. I don't know *where* I got the idea that this was the right thing to do--I just checked Inside Mac Vol I, and I am WRONG. Yet I've been doing this for goodness knows how long, and I *never* got a crash on any other Mac before. Never. Gee, I feel so embarrassed about such an elementary stuffup... Lawrence D'Oliveiro fone: +64-7-856-2889 Info & Tech Services Division fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00 +++++++++++++++++++++++++++ >From wangd@CS.ColoState.EDU ( danny wang) Date: 23 Mar 94 05:42:55 GMT Organization: Colorado State University -- Computer Science Department I have crashed a friend's PowerMac(gee I wish I had one) with ResEdit. Does that count as a real crash? I will be trying to do some more REAL software trials on that box pretty soon...ha, ha, ha. (evil grin) -- Intel is not even half of intelligence.... ******************************************************************************* There's no such thing as chance; wangd@CS.ColoState.EDU And what to us seems merest accident wang@lamar.ColoState.EDU Springs from the deepest source of destiny. cs152bs1@lamar.ColoState.EDU --Johann Christoph Friedrich von Schiller Just livin' in my SANITARIUM. 1759-1805 ******************************************************************************* Speak 68040 and carry a PowerPC 620.... +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wätte) Date: 23 Mar 1994 08:35:50 GMT Organization: Royal Institute of Technology, Stockholm, Sweden In <1994Mar23.164347.26777@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >And you know what the problem is? I'm calling InitFonts before InitGraf. That's a result of the new ROMs (which you will see in 68k Macs as well) not of the PowerPC as such. -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- "It was, in fact, cool as all get-out. Fortunately it was a little too late (historically speaking) to be groovy." -- Dennis Pelton +++++++++++++++++++++++++++ >From jwbaxter@olympus.net (John W. Baxter) Date: Wed, 23 Mar 1994 10:30:08 -0800 Organization: Internet for the Olympic Peninsula In article <1994Mar23.054255.19492@yuma>, wangd@CS.ColoState.EDU ( danny wang) wrote: > I have crashed a friend's PowerMac(gee I wish I had one) with ResEdit. Does > that count as a real crash? I will be trying to do some more REAL software > trials on that box pretty soon...ha, ha, ha. (evil grin) You probably only appeared to crash the Power Mac with ResEdit. For a long time, the Memory Manager has been quietly helping developers by fixing some of their dumb errors (because there were far too many broken applications not to). Some future Memory Manager will stop helping (and speed up as a result). With the Power Mac, we see a step along the way: if a debugger is installed, the Memory Manager does a user break, saying something like "Access Fault". If you say to continue (G command in MacsBug), processing continues, with the old fix-up code executed. This is supposed to encourage developers (who really should have a debugger ) to fix their code. As it happens, one of the broken applications is ResEdit 2.1.1 [If you only have half of the debugging installed (the "nub" but no low-level debugger) you get a 30-second freeze while the nub looks madly for a debugger, then the nub presses on.] -- John Baxter Port Ludlow, WA, USA [West shore, Puget Sound] jwbaxter@pt.olympus.net +++++++++++++++++++++++++++ >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Date: 24 Mar 94 10:47:51 +1300 Organization: University of Waikato, Hamilton, New Zealand How about this for the smallest program that will crash a PowerMac, but run OK on a 68K Mac: #include void main(void) { InitFonts(); } (OK, so it doesn't actually do anything, so what did you expect.) Here's the compiled version, if you want to try it: (This file must be converted with BinHex 4.0) :$9"[Gf9b6@&M3h*KFfJ!39"36$q3"#!!N!F%FVi6!*!%!3#3!`2B!!!#f!#3!jU E!(dG!!#!rrm!!"LT!(dG3!#!rrm!!"LY!(dG0!!#r`e3EhGPFNeKBd0bBA0S!J# 3!d&38%`rN!3K!*!%J!!!39"36$q3"#%!N!5!!*!5UEFFD3#3"J4b!*!-"Y-P!*! $&"J09(PbB@jZEh0KGA*eF`#3&!E9*3#3!a3`!*!L"YBP!*!$&$8!N#N)!&!!!DM q6R8!!!*#!*!$#J#3!h)!N!4#H!T+RFj1ZJ!d6VS!*%*R5(N!!2rr5'm!"%KA5(J !!5)krpC1Y4!!)'d!E%k3!+Rd)MVrbQF%6V83!%je@Bm[2&T&8Np#CkQJ*&GCMbm m4%&838*RUD!J9b"3)RJ*##45B!ibf'B+-KTJ!N)C8FRrr,[*CZkTSkQM@Bm[2%4 548a#CkQJ)&HJ*5"3iN!N$@!'-KM9Y4!!8FMrq+QM6R8JAc)B0"L`@&I*rrT+3QI q6[!Jr#"I-KJd',#B9mRrqNT#Crj1m#$k)&mb'$3BX%*Z#T!!3@d'd%""m!!#-"" RrNl`!!!J,`!%,d%!"#)[!!J[A`!%51Fm!#3!*J&)3X6$+!!U!8K&b-A84%K#N!2 !`G##60m!2#)I6R8J,`!%,d%!"#)[!!J[A`!%51Fa!%kk!*a-h`#-)Kp1G5![!!3 [33!%)Lm!##pI!!4)jc%!6VS!I#!"60m!M#)I6R8J,`!%,d%!"#)[!!J[A`!%51F a!%kk!#a-h`#-)Kp1G5![!!3[33!%)Lm!##pI!!4)jc%!6VS!$#!"60m!M#)I6R9 +J'SF5S&U$%5!4)&1ZJ!J4)&1G85!6VS!&N5!4)&1G8U"DJT%J8kk!!C%J%je,M` !!2rrXS"M"L)!F!"1GE#(BJb!`8K!-J"#3%K!6R@bKf)D,J"#3%K!J-&)3%K(2J" )4il"-!G)4c)(6R8N!#B"iSMLLE+(B[L!`F#(-J2#`#i$5%I1`%K(dSGP#*+#BJ4 %J8je8d"Jj%je!*!$D!#3!hJ!N!GB!*!$)!!)2c`!!DR`!+Br2!!"UI!!ZMmm!!' Tm!$12c`!!DR`!1Sr2!!"UI!")$mm!!'Tm!&!2c`!!DR`!@)r2!!"UI!"JMmm!!' Tm!)m2c`!!DR`!!!r2!!#UI!!N!-+!*!$"J#3!`B!N!3"!*!$!pJ!!!,B!*!$QJ" p('`@aJ#3!a`!QJ!%4%&833#3!bTD49*2!*!$0N4548`!N!0#3dp%43!#!%j659T &!*!$FJ!!rrmS!*!*rrm)!!!%!*!'rrmS!!!)!*!&![rr1!!!$!#3"3(rra`!!"J !N!ErrbJ!!Pi!N!6rN!3!!!,+!*!%Y$F: Let me know how it works for you! Lawrence D'Oliveiro fone: +64-7-856-2889 Info & Tech Services Division fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00 +++++++++++++++++++++++++++ >From nagle@netcom.com (John Nagle) Date: Thu, 24 Mar 1994 00:11:10 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) wangd@CS.ColoState.EDU ( danny wang) writes: >I have crashed a friend's PowerMac(gee I wish I had one) with ResEdit. Does >that count as a real crash? I will be trying to do some more REAL software >trials on that box pretty soon...ha, ha, ha. (evil grin) It's not a protected mode system. It's a Macintosh. Crashes just like a Macintosh. That's Apple's idea of a feature. John Nagle +++++++++++++++++++++++++++ >From d88-jwa@mumrik.nada.kth.se (Jon Wätte) Date: 24 Mar 1994 09:12:19 GMT Organization: The Royal Institute of Technology In <1994Mar24.104751.26808@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >How about this for the smallest program that will crash a PowerMac, but >run OK on a 68K Mac: > #include > void main(void) > { > InitFonts(); > } It is, of course, incorrect according to IM. It won't run on an ordinary Mac running Discipline. -- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe -- Not speaking for IBM. +++++++++++++++++++++++++++ >From pottier@fregate.ens.fr (Francois Pottier) Date: 24 Mar 1994 12:39:37 GMT Organization: Ecole Normale Superieure, PARIS, France In article , John W. Baxter wrote: >result). With the Power Mac, we see a step along the way: if a debugger >is installed, the Memory Manager does a user break, saying something like >"Access Fault". If you say to continue (G command in MacsBug), processing >continues, with the old fix-up code executed. Could you be more precise ? Exactly when does an "Access Fault" happen, and in what way should current code be fixed ? -- Francois Pottier ___ ___ _ _ / ___ ___ ___ pottier@dmi.ens.fr /_ /__/ /_| /| / / / / / / /__ / / \ / | / |/ /___ /__/ / ___/ _ / +++++++++++++++++++++++++++ >From Manuel Veloso Date: Sat, 26 Mar 1994 05:51:51 GMT Organization: Ibex Productions In article <2ms1m9$5ao@nef.ens.fr> Francois Pottier, pottier@fregate.ens.fr writes: >Could you be more precise ? Exactly when does an "Access Fault" happen, and >in what way should current code be fixed ? It was something about one of the exception vectors doing a stripaddress/retry on a non-24-bit clean address (ie: if an illegal address exception was caused, the vector would strip and retry). It's in one of the new tech notes somewhere. +++++++++++++++++++++++++++ >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) Date: 28 Mar 94 10:09:16 +1300 Organization: University of Waikato, Hamilton, New Zealand In article <2mrlhj$8j4@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wätte) writes: > In <1994Mar24.104751.26808@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: > >>How about this for the smallest program that will crash a PowerMac, but >>run OK on a 68K Mac: >> #include >> void main(void) >> { >> InitFonts(); >> } > > It is, of course, incorrect according to IM. It won't run > on an ordinary Mac running Discipline. Yeah, but lots of release software (including some from Apple!) won't run under Discipline, am I right? So I'm not sure if that really counts... :-) (By the way, Jon, can you stop e-mailing me copies of your postings? One copy of your wisdom is enough. Thanks!) Lawrence D'Oliveiro fone: +64-7-856-2889 Info & Tech Services Division fax: +64-7-838-4066 University of Waikato electric mail: ldo@waikato.ac.nz Hamilton, New Zealand 37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00 +++++++++++++++++++++++++++ >From ez006626@othello.ucdavis.edu (David Xavier Clancy) Date: Mon, 28 Mar 1994 07:19:12 GMT Organization: University of California, Davis danny wang (wangd@CS.ColoState.EDU) wrote: : I have crashed a friend's PowerMac(gee I wish I had one) with ResEdit. Does : that count as a real crash? I will be trying to do some more REAL software : trials on that box pretty soon...ha, ha, ha. (evil grin) ResEdit Crashes rather nicetly on a 68k mac too. In fact, it's good if it crashes in the same places/conditions. --xav +++++++++++++++++++++++++++ >From "Donpaul C. Stephens" Date: Mon, 28 Mar 1994 08:01:31 -0500 Organization: Senior, Electrical and Computer Engineering, Carnegie Mellon, Pittsburgh, PA According to the article in BYTE magazine, the Virtual Memory in the Power Macintosh line is implemented w/ Read only and Read/Write blocks. The read only blocks cannot be altered. The R/W blocks can be altered by any stray program until Apple expands the services of the nano-kernel the nano-kernel is the Hardware Abstraction Layer [HAL] on which the system runs. It is the only code that runs in supervisor mode in PowerMac the rest, incl the OS runs in User mode [it probably makes it easier to emulate the 680x0 in the system if it is a user process like the rest The article then explains why the 680x0 macs are as crash prone as windows: everything runs in Supervisor Mode No, its not a feat to crash a Power Mac . But I wouldn't expect the OS to kill stray processes for any memory violations until 1Q 95, when system 8 is rumored to be released --------------------------- >From bdiamand@netcom.com (Ben Diamand) Subject: Multiple HD Reads, can it be done? Date: Thu, 17 Mar 1994 18:48:52 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) I'm pretty sure that the answer to this is 'no' for most Macs, but here goes anyway: Can the pre-quadra Mac II's(IIci, SE/30) perform simultaneous(sp?) reads from different scsi devices on the same scsi chain. As a further question, if I do ASYNC reads, will future Macs that can do this(assuming current ones cannot) work as expected? Thanks! Ben Diamand bdiamand@netcom.com ALINK:bdiamand +++++++++++++++++++++++++++ >From rang@winternet.mpls.mn.us (Anton Rang) Date: 27 Mar 1994 21:56:57 GMT Organization: Minnesota Angsters In article <764568523.AA03331@psybbs.durham.nc.us> Ben.Diamand%f1.n3641.z1@psybbs.durham.nc.us (Ben Diamand) writes: >I'm pretty sure that the answer to this is 'no' for most Macs, but here >goes anyway: Can the pre-quadra Mac II's(IIci, SE/30) perform >simultaneous(sp?) reads from different scsi devices on the same scsi >chain. The old SCSI manager does not support interleaved access to multiple devices on one SCSI chain. (So the answer is, "No.") >As a further question, if I do ASYNC reads, will future Macs that >can do this(assuming current ones cannot) work as expected? Well, the new SCSI manager (4.3) does support interleaved access, so you can get to more than one device at a time. But your comment on async reads leads me to believe that you're really talking about disk drivers. (Are you using Read(), or SCSIRead()?) Disk drivers follow basically the same laws; if you try to do an asynchronous read, and you're on a pre-4.3 machine or have a pre-4.3 driver, it will complete synchronously. However, if you have a 4.3 machine and a 4.3 driver, *or* an accelerator which supports asynchronous i/o, then an asynchronous read will work as you expect, as long as you're doing direct i/o to the driver. Yet another caveat. If you're going through the current file system, you can only have one I/O pending at a time, so you can only access one disk at a time, even if all the other conditions are OK for doing things asynchronously. (As far as I know, anyway...anyone know differently?) -- Anton Rang (rang@winternet.mpls.mn.us) --------------------------- >From long@mcntsh.enet.dec.com (Rich Long) Subject: PBDTGetAPPL on a network volume? Date: 20 MAR 94 15:16:46 Organization: Digital Equipment Corporation I have some code that is using PBDTGetAPPL against all mounted volumes in order to see if the owner of a given creator code is present. This works fine except for a disk that is mounted from a System 7 server. PBDTGetAPPL for this volume returns a -43 error instead of the afpItemNotFound I might expect. The documentation is not very helpful -- any ideas? ( I am checking the hasDesktopMgr bit and PBDTGetPath returns no errors ). Thanks, Rich +++++++++++++++++++++++++++ >From Tim S. Date: Mon, 28 Mar 1994 19:41:26 GMT Organization: System Updates In article <2mib3e$ph9@nntpd.lkg.dec.com> Rich Long, long@mcntsh.enet.dec.com writes: >I have some code that is using PBDTGetAPPL against all mounted volumes in >order to see if the owner of a given creator code is present. This works fine >except for a disk that is mounted from a System 7 server. PBDTGetAPPL for this >volume returns a -43 error instead of the afpItemNotFound I might expect. The >documentation is not very helpful -- any ideas? ( I am checking the >hasDesktopMgr bit and PBDTGetPath returns no errors ). > >Thanks, >Rich I had a similar problem when writing BNDL Banger - you have to special case servers and use AppleTalk calls instead. I special cased them and ignored them (since servers typically don't let users have enough privs to munge in their desktop databases and that's BNDL Banger's sole reason for existing). You'll need to wade through the AppleTalk headers/docs... Hope that helps, Tim S. My opinions are my own. They're my feet and I'll put them in my mouth if I want to. Do not expose to open flame. Some Assembly required. Remove before flight. Under penalty of law, do not remove this tag. Caution, contains silica gel, do not eat. Do not read while operating a motor vehicle or heavy equipment. In case of eye contact, flush with water. This supersedes all previous notices. --------------------------- >From quinn@cs.uwa.edu.au (Quinn "The Eskimo!") Subject: PEF, XCOFF Info Wanted Date: Mon, 28 Mar 1994 09:45:16 +0800 Organization: Department of Computer Science, The University of Western Australia In article <2mv3b4$oa2@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wätte) wrote: >You should remove the cfrg resource if you remove the data fork PEF. Talking about PEF... (: Where can I find a good description of the internals of the PEF and XCOFF file formats? -- Quinn "The Eskimo!" "Support HAVOC!" Department of Computer Science, The University of Western Australia +++++++++++++++++++++++++++ >From platypus@cirrus.som.cwru.edu (Gary Kacmarcik) Date: 28 Mar 1994 03:15:46 GMT Organization: Case Western Reserve University, Cleveland, Ohio (USA) In article quinn@cs.uwa.edu.au (Quinn "The Eskimo!") writes: > > Talking about PEF... (: Where can I find a good description of the > internals of the PEF and XCOFF file formats? if you want a Q&D description, you can probably get a good idea from the DumpPEF and DumpXCOFF MPW tools. if you want a "complete" description of PEF, you need to license it from Apple. if you want more info about XCOFF, you can get the O'Reilly book "Understanding and Using COFF" (Gintaras R. Gircys), and try to get some of the headers from an RS/6000. XCOFF is based on COFF, so the book'll get you most of the way there. IBM also has a book that describes the XCOFF format, but i don't have the reference handy. -gary j kacmarcik platypus@curie.ces.cwru.edu --------------------------- >From mdtaylor@apple.com (Mark Taylor) Subject: QuickDraw Question Date: Tue, 22 Mar 1994 18:18:03 GMT Organization: Apple Computer, Inc. Greetings, I have a very irritating QuickDraw problem which I'm hoping someone can advise me about. It could be it's hopeless... In my app, I put up a marquee as a target "zone" for dragging and dropping. The marquee is circular, so I xor a FrameOval to create it. Unfortunately, whenever my custom cursor is within the oval, the image of the cursor is alternately hidden and shown. To the user this looks like a vibrating cursor. I've tried using a region to draw the marquee with the same result. I've also done the marquee as a rectangle (as a test) and the problem goes away - however, I really need a circular target - not a rectangle. I'm guessing that QuickDraw obscures the cursor during drawing if the cursor is within an oval or region. Does this sound right? Is this true? If so, is there anyway to defeat this? Hope someone can help! Mark +++++++++++++++++++++++++++ >From KLUEV@jonathan.srcc.msu.su Date: Sat, 26 Mar 1994 16:15:14 +0300 Organization: (none) In article mdtaylor@apple.com (Mark Taylor) writes: > >In my app, I put up a marquee as a target "zone" for dragging and dropping. >The marquee is circular, so I xor a FrameOval to create it. Unfortunately, >whenever my custom cursor is within the oval, the image of the cursor is >alternately hidden and shown. To the user this looks like a vibrating >cursor. > >I've tried using a region to draw the marquee with the same result. I've >also >done the marquee as a rectangle (as a test) and the problem goes away - >however, I really need a circular target - not a rectangle. > >I'm guessing that QuickDraw obscures the cursor during drawing if the >cursor is >within an oval or region. Does this sound right? Is this true? If so, is >there anyway to defeat this? QuickDraw always Shield/Show cursor when it is drawing onscreen or copying from screen. The actual hiding of cursor occurred only if drawing can disturb cursor (i.e. drawing's and cursor's rects overlap). This vibrating cursor doesn't go away in case of rects, but QD draws rects much more faster than ovals or regions. A little could be done about this flickering. One way to minimize this flickering is to minimize your drawing. 1.Don't 'move' marquees, stop them. 2.Draw only when user moves mouse. 3.When you need to draw, do a minimal number of QD calls. (Finder does this.). So, if you are doing something like that: "PenMode (xor) FrameRgn (Old) - To show first Rgn Whenever user moves mouse: FrameRgn (Old) - To erase old FrameRgn (New) - To draw new" (2 QD operations). try to change your code to something like this: "PenMode (xor) CopyRgn (Old, Temp); InsetRgn (Temp, 1, 1); XorRgn (Old, Temp, Old); - To create one pixel "outline" region. PaintRgn (Old); - To show first Whenever user moves mouse: /* Create New Rgn using the same tehnique as Old. */ XorRgn (Old, New, Temp); - Some preparation PaintRgn (Temp); - Makes all drawing" (1 QD operation). If you want to do this with ovals, just convert them to regions. This should reduce cursor flickering. Michael Kluev. +++++++++++++++++++++++++++ >From kenlong@netcom.com (Ken Long) Date: Sun, 27 Mar 1994 00:05:06 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) Quickdraw probably obscures the cursor in such areas unless you tell it otherwise. In Color It 2.3, if you make a selection, and move the cursor within the bounds of the region, it changes to a mirror image of the standard arrow cursor to facilitate dragging the selection. Therefore, in order to track down source for such goings on, my approach would be to get some which does, or may do, this. First choice would be C source - Pascal if no C could be found. Logical downloadable targets: DTS-Draw (Apple ftp). Get the source and do a SerchFiles 1.3 search for the string "cursor." It may be prudent to run the project and see if the cursor (a) is visible within a selection, (b) changes if so. Alternative choice: Image 1.49 or better. Get the built app and test as before. If it does what you want, get the current source and do the string search to track down the routines. A knowledgeable programmer could probably just give you a fragment or snippet. But if you had no one to ask for a fast answer, string searches of running C source are so fast they are almost instantaneous. -Ken- --------------------------- >From deway@css.itd.umich.edu (Doug Way) Subject: Quickdraw Blend Function Inaccurate? Date: 23 Mar 1994 22:41:03 GMT Organization: University of Michigan ITD/User Services Does anyone out there know if there are any innaccuracies with Quickdraw's blend function? That is, the process of blending two colors together by using PenMode(blend) and drawing one color on top of another? (I seem to vaguely remember someone talking about this here long ago, so if this is true, please post!) I'm trying to write a game which displays objects being reflected on a colored surface. The simplest way to do this seemed to be to draw with PenMode(blend) so that the object colors and surface colors are blended together to simulate a reflection. I know that Quickdraw uses the function: weight * sourceColor + (65535 - weight) * destColor blendedColor = --------------------------------------------------- 65535 This function determines the blend for each of the red, green and blue components, where weight is a number between 0 and 65535. When it determines the RGB values of the blended color, Quickdraw then (presumably) looks up the closest color in the palette which matches, and draws that color. This is where I seem to be having a problem. I even went through the trouble of setting up my own palette which would contain the exact colors which would need to be blended. But Quickdraw sometimes seems to pick the wrong color as the blended color. The color is not usually off by more than 5 or 10%, but that's still pretty bad in my book. Here's a more concrete example. If I have: sourceColor.red = 35000 and destColor.red = 45000 sourceColor.green = 7000 destColor.green = 12000 sourceColor.blue = 12000 destColor.blue = 17000 and the blend weight = 8000 then the blended color should be: blendedColor.red = 43800 blendedColor.green = 11400 blendedColor.blue = 16400 So, early on in my program I add these three colors to the palette (along with a bunch of others). I then draw the destination color (destColor) on the screen. The PenMode is then set to blend (w/ weight = 8000), and the source color is drawn on top of the destColor. For some reason, the resulting color is still the destColor, not the blendedColor it should be. I know the blended color is available in the color table, because I can use RGBForeColor (or PMForeColor) to set it and draw it somewhere else on the screen. (Hmmm, I just remembered that I'm doing this on an offscreen pixmap, but this shouldn't be a problem since both offscreen and onscreen pixmaps have the same .pmTable color table.) Well, any ideas? I realize there may be some quirk in my code which is causing this, but I wanted to see if anyone knew about any known problems before I went on an all-out effort to isolate the problem. I'll gladly give credit in my game to anyone who can help out. Thanks! /---------------DISCLAIMER:----My opinions are, remarkably, exactly the----\ | same as those of my employer. In fact, | | Doug Way (Bebound!) I am merely a mouthpiece through which | \---deway@css.itd.umich.edu----their collective thoughts pass unaltered.---/ +++++++++++++++++++++++++++ >From lowry@shiva.eche.ualberta.ca (Brian Lowry) Date: 24 Mar 1994 16:19:38 GMT Organization: Chem Eng - Univ of Alberta In article <2mqghv$s97@lastactionhero.rs.itd.umich.edu>, deway@css.itd.umich.edu (Doug Way) wrote: > Does anyone out there know if there are any innaccuracies with Quickdraw's > blend function? That is, the process of blending two colors together by > using PenMode(blend) and drawing one color on top of another? [details omitted] > (Hmmm, I just remembered that I'm doing this on an offscreen pixmap, but > this shouldn't be a problem since both offscreen and onscreen pixmaps > have the same .pmTable color table.) How can a blend be accurate on a CLUT device? The inverse colour table is only five bits, so you're always going to have errors... A better solution might be to use 24 bit GWorlds offscreen and then dither them to the CLUT device, since this would have the added benefit of not making 16 and 24 bit users' screens look like 8 bit messes. -- Brian Lowry +++++++++++++++++++++++++++ >From lari@cs.unc.edu (Humayun Lari) Date: 24 Mar 1994 16:01:28 -0500 Organization: The University of North Carolina at Chapel Hill In article , Brian Lowry wrote: >In article <2mqghv$s97@lastactionhero.rs.itd.umich.edu>, >deway@css.itd.umich.edu (Doug Way) wrote: > >> Does anyone out there know if there are any innaccuracies with Quickdraw's >> blend function? That is, the process of blending two colors together by >> using PenMode(blend) and drawing one color on top of another? [snip] > How can a blend be accurate on a CLUT device? The inverse colour table >is only five bits, so you're always going to have errors... A better >solution might be to use 24 bit GWorlds offscreen and then dither them to >the CLUT device, since this would have the added benefit of not making 16 >and 24 bit users' screens look like 8 bit messes. Doug, since the default inverse color table is 4-bit, you may want to try a MakeITable(NULL, NULL, 5) to generate a 5-bit inverse table for the current device. Check IM 5 for details -- I think the 5-bit inverse table requires 32K, and MakeITable requires something like 79K just to work, so you need to be slightly concerned about memory. 'Course, this still won't be perfect, but it'll be better than the default. Note that the problem with using 24-bit worlds is that dithering is slow and can make 8-bit users' screens look messy. Experiment... Humayun Lari (lari@cs.unc.edu) +++++++++++++++++++++++++++ >From deway@css.itd.umich.edu (Doug Way) Date: 28 Mar 1994 06:25:10 GMT Organization: University of Michigan ITD/User Services Humayun Lari (lari@cs.unc.edu) wrote: : Brian Lowry wrote: : [snip] : > How can a blend be accurate on a CLUT device? The inverse colour table : >is only five bits, so you're always going to have errors... A better : >solution might be to use 24 bit GWorlds offscreen and then dither them to : >the CLUT device, since this would have the added benefit of not making 16 : >and 24 bit users' screens look like 8 bit messes. : Doug, since the default inverse color table is 4-bit, you may want to try a : MakeITable(NULL, NULL, 5) to generate a 5-bit inverse table for the current : device. Check IM 5 for details -- I think the 5-bit inverse table requires : 32K, and MakeITable requires something like 79K just to work, so you need : to be slightly concerned about memory. Thanks for the info. After reading Brian's response, I went back & read the Color Manager chapter of IM 5, and figured out that the 4-bit inverse table was the problem. (I'd been wasting my time looking in the Palette Manager & Quickdraw chapters before.) 24-bit screens are not an option here, since this is a high-speed game. (Believe it or not, I'm getting 30 frames per second on a IIsi drawing two (fairly small) objects with blended reflections.) In fact, 8 bits is plenty, because there is a small, fixed number of colors in each object & in the reflecting wall, and I specifically add the possible blending combinations to the palette ahead of time. For example, if there are 10 colors in the objects, and 8 colors in the wall, then there will be 10*8=80 possible blended colors which I precalculate and add to the palette. No need for 24 bits. Although I do understand what you mean about the color lookup being inaccurate anyway. I'll try the 5-bit table. That should descrease the inaccuracy by half, so that may be good enough. I noticed that IM 5 mentioned that it's possible to create your own custom lookup table for even greater accuracy. Is this at all practical? /---------------DISCLAIMER:----My opinions are, remarkably, exactly the----\ | same as those of my employer. In fact, | | Doug Way (Bebound!) I am merely a mouthpiece through which | \---deway@css.itd.umich.edu----their collective thoughts pass unaltered.---/ --------------------------- >From danprice@delphi.com Subject: Read-Save Styled Text Code Date: Sun, 27 Mar 94 17:17:20 -0500 Organization: Delphi (info@delphi.com email, 800-695-4005 voice) I'm trying to get some read/save styled text code of mine to work but have had NO success. I was in a bookstore the other day and noticed that IM:TEXT has such code, but I am only a poor student who doesn't have 40$ to shell. Anybody have this code that tehy could mail me? I'm using think Pascal. -dp +++++++++++++++++++++++++++ >From mxmora@unix.sri.com (Matt Mora) Date: 28 Mar 1994 13:49:33 -0800 Organization: SRI International, Menlo Park, CA In article danprice@delphi.com writes: > >I'm trying to get some read/save styled text code of mine to work but have >had NO success. I was in a bookstore the other day and noticed that IM:TEXT >has such code, but I am only a poor student who doesn't have 40$ to shell. > >Anybody have this code that tehy could mail me? I'm using think Pascal. This should get you going. GetFNum('times', familyID); TextFont(familyID); Textsize(12); myTE := TEStylNew(r, r); {important! I was using the old call duh:)} TextHandle := GetResource('TEXT', 128); StylHandle := stScrpHandle(GetResource('styl', 128)); { TEInsert(TextHandle^, GetHandleSize(TextHandle), myTE);} { TESetSelect(0, $8000, myTE);} { SetStylHandle(StylHandle, myTE);} TEStylInsert(TextHandle^, GetHandleSize(TextHandle), StylHandle, myTE); {TESetSelect(0, 0, myTE);} myTe^^.just := 1; TECalText(myTE); TEUpdate(r, myTE); Xavier -- ___________________________________________________________ Matthew Xavier Mora Matt_Mora@sri.com SRI International mxmora@unix.sri.com 333 Ravenswood Ave Menlo Park, CA. 94025 --------------------------- >From cconstan@epdiv1.env.gov.bc.ca (Carl B. Constantine) Subject: Try 3: Movie Credit Scrolling - How? Date: Thu, 17 Mar 1994 10:04:43 -0800 Organization: Ministry of Environment, Lands & Parks Sorry for the multiple posts (if your server recieved multiple posts) but our NNTP server is having problems. I would like to know how to do movie credit style scrolling like I have seen in many people's about box's. Can someone give me a code snippet or anything like that? Thanks in advance. -- ========================================================================= Carl B. Constantine B.C. Environment, Lands & Parks End-User Support Analyst CCONSTAN@epdiv1.env.gov.bc.ca +++++++++++++++++++++++++++ >From kenlong@netcom.com (Ken Long) Date: Fri, 18 Mar 1994 03:10:36 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) Carl: There's some source for a program called "Words Alive" which has a "curtains" type thing in its about box. It starts with a picture and then a pixel-at-a-time "curtain" raises (the picture goes up) revealing some more credits. There are sideways auto-scrolling texts' which should not be hard to make vertical, like the "Marquee" stuff I recently posted (did I send you the file?). I've got some source that scrolls up or down just by GetMouse-while-StillDown offset. I was actually going to toss what I have on your server, but rework the project into a more diversified demo and then post it on a.s.m. The basic trick is offsetting or scrolling (same difference) the rect. or rgn according to what you specify. It can be via a key, the mouse or automatic. I've got one Pascal project, where the about in a blank pDB, and a little line shows up, on center. It gets bigger and you see that it's text. It gets to 14pt and nicely fits into the box, hangs about 60, then keeps on zoomin' up closer (""). Then the box closes. That particular effect, in reverse, with a vertical (-) offset would be similar to the opening sequence in StarWars. Also, the MSG demo, doing all it's wipes and other effects, may indicate an action to take. But regarding text? I don't know. The one I have offsets text kinda like the "Grabber" tool. Making it auto should be a snap. -Ken- +++++++++++++++++++++++++++ >From Kevin Marks Date: Sat, 19 Mar 1994 17:46:06 GMT Organization: Me In article Carl B. Constantine, cconstan@epdiv1.env.gov.bc.ca writes: >I would like to know how to do movie credit style scrolling like I have >seen in many people's about box's. Can someone give me a code snippet or >anything like that? QuickTime's Text Tracks will do this automatically if you set a few flags, but the docs are a bit flaky. >From Carl.B..Constantine%f1.n3641.z1@psybbs.durham.nc.us (Carl B. Constantine) Subject: Try 3: Movie Credit Scrolling - How? Date: 17 Mar 94 23:04:43 GMT Organization: (none) Organization: Ministry of Environment, Lands & Parks Sorry for the multiple posts (if your server recieved multiple posts) but our NNTP server is having problems. I would like to know how to do movie credit style scrolling like I have seen in many people's about box's. Can someone give me a code snippet or anything like that? Thanks in advance. -- ========================================================================= Carl B. Constantine B.C. Environment, Lands & Parks End-User Support Analyst CCONSTAN@epdiv1.env.gov.bc.ca +++++++++++++++++++++++++++ >From paulcho@ionews.io.org (paulcho) Date: 26 Mar 1994 11:28:54 -0500 Organization: Internex Online (io.org) Data: 416-363-4151 Voice: 416-363-8676 Kevin Marks wrote: >QuickTime's Text Tracks will do this automatically if you set a few >flags, but the docs are a bit flaky. You can use my TextMovie program(part of MovieTrilogy availiable on sumex) to create the QuickTime Text track movie. Then all you have to do is load and play the movie. ________________________________________________________________ Paul C.H. Ho paulcho@io.org Pink Elephant Technologies Paul_C.H._Ho@magic-bbs.corp.apple.com 74020.772@compuserve.com +++++++++++++++++++++++++++ >From zobkiw@datawatch.com (joe zobkiw) Date: Mon, 28 Mar 1994 13:08:31 GMT Organization: Datawatch Corporation In article <2n1ns6$n0f@ionews.io.org>, paulcho@ionews.io.org (paulcho) wrote: > > > Kevin Marks wrote: > >QuickTime's Text Tracks will do this automatically if you set a few > >flags, but the docs are a bit flaky. > > You can use my TextMovie program(part of MovieTrilogy availiable > on sumex) to create the QuickTime Text track movie. Then all you > have to do is load and play the movie. > If al lyou want is scrolling credits just create a TEHandle in your window, fill it with styled text from a resource, and TEScroll it...when it reaches the end, reset your scroll position to the top. That's it! If you want pictures, you can ScrollRect a PICT resource. ___________________________________________________________ _/_/_/_/ Joe Zobkiw ,,, _/ Senior Software Engineer - - _/ Datawatch Corporation L _/_/_/_/ zobkiw@datawatch.com - --------------------------- >From rhn@netcom.com (Ron Nicholson) Subject: making fat binaries question Date: Wed, 23 Mar 1994 08:36:51 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) I'm using the Metrowerks Codewarrior Gold DR1 compilers. I've got both the 68k and PPC versions of my applications working. How do I take the 2 applications and make a fat binary? Do I need any special resources not found in either of the 2 processor specific apps? Or do I just paste all the resources and the data fork of the PPC app together into one big glob? Is there a utility to do this? Thanks, Ron Nicholson rhn@netcom.com #include (hey, I'm just a hardware guy, doing software for fun.) +++++++++++++++++++++++++++ >From jwbaxter@olympus.net (John W. Baxter) Date: Wed, 23 Mar 1994 10:46:21 -0800 Organization: Internet for the Olympic Peninsula In article , rhn@netcom.com (Ron Nicholson) wrote: > I'm using the Metrowerks Codewarrior Gold DR1 compilers. I've got both > the 68k and PPC versions of my applications working. How do I take the > 2 applications and make a fat binary? Do I need any special resources > not found in either of the 2 processor specific apps? Or do I just > paste all the resources and the data fork of the PPC app together into > one big glob? Is there a utility to do this? One method: Build the 68K version. Use the result (or a suitably named copy) as the resource file when you build the ppc version. [Note that the presence of the 'cfrg' resource in that 68K version is likely to annoy the system if you run the 68K version on a Power Mac.] -- John Baxter Port Ludlow, WA, USA [West shore, Puget Sound] jwbaxter@pt.olympus.net +++++++++++++++++++++++++++ >From rhn@netcom.com (Ron Nicholson) Date: Sun, 27 Mar 1994 19:45:40 GMT Organization: NETCOM On-line Communication Services (408 241-9760 guest) In article , John W. Baxter wrote: > >One method: >Build the 68K version. Use the result (or a suitably named copy) as the >resource file when you build the ppc version. [Note that the presence of >the 'cfrg' resource in that 68K version is likely to annoy the system if >you run the 68K version on a Power Mac.] > OK, I used this method to build a fat binary. The resulting file seems to run just fine on both an SE/30 and a Power Mac (except for the fact it runs 29 times faster on the 7100!) But doesn't the 'cfrg' resource need to be modified to indicate that the app is a fat binary and not just a pcc only app? Is there a way for a fat application to toggle or have the user select whether to run in native or emulated mode on a Power Mac? I have Codewarrior Gold, Develop 17 and the newest Macsbug. What other critical items might I need off of the Mac on Risc SDK in order to build Power Mac apps correctly? Thanks, Ron Nicholson rhn@netcom.com #include --------------------------- End of C.S.M.P. Digest **********************