From: owner-csmp@ugrad.ece.mcgill.ca Subject: csmp digest Vol 4 No 053 C.S.M.P. Digest Wed, 13 May 98 Volume 4 : Issue 53 Today's Topics: AEResumeTheCurrentEvent disposes event and reply? Background App Blanking the screen...for good BlockMove vs BlockMoveData C++ & Rhapsody? DEADBEEF in Supervisor data space Detecting how much memory is available Drawing Tiles Fast Drawing pictures with non-rect. shapes Launching a Browser with a URL MacsBug an OS8.1 Macsbug for G3? PPC instruction set overview needed The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken (marka@ee.mcgill.ca). The digest is a collection of article threads from the internet newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and csmp.games. It is designed for people who read news 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 ee.mcgill.ca). 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 digests can be obtained by email, ftp or through the World Wide Web. If you want to receive the digest by mail, send email to majordomo@ee.mcgill.ca with no subject and one of the following commands as body: help Sends you a summary of commands subscribe csmp Adds you to the mailing list unsubscribe csmp Removes you from the list Once you have subscribed, you will automatically receive each new issue as it is created. Back issues are available by ftp from Info-Mac mirror sites in the per/csmp subdirectory, e.g. ftp://sumex-aim.stanford.edu/info-mac/per/csmp/ The contents of all back issues can be searched by accessing the following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au): http://marvin.stattech.com.au/search.html They can also be searched through the following URLs, thanks to Tim Tuck (Tim.Tuck@sensei.com.au): http://wais.sensei.com.au/searchform.html wais://wais.sensei.com.au:210/csmp? ------------------------------------------------------- >From Brian.Dupuis@nc.drsolomon.com (Brian Dupuis) Subject: AEResumeTheCurrentEvent disposes event and reply? Date: Tue, 07 Apr 1998 19:01:41 -0400 Organization: Dr. Solomon's Software I'm trying to use the OSA library to run attached scripts from a simple program. That works fine, as far as I can tell. However, my application uses AESuspendTheCurrentEvent before processing the event, does it's processing, then resumes it with the "...ResumeThe..." call. However, even when the AE is a direct event (checks it right before the resume call), the AEResumeTheCurrentEvent function disposes of my event and reply. This only happens on events originating from the OSAExecute function, on scripts that happen to call the app. If the event is one that I send myself in a regular manner, this all works fine. Just that pesky OSAExecute causes this. Since IM says that direct events require the app to dispose of the event and reply itself, I quickly bomb since the event and reply were already disposed. Any ideas? Thanks, Brian -- ==================================================================== | Brian J. Dupuis |

(919)833-1877 (919)833-7475 | | Software Analyst - Virex | Brian.Dupuis@nc.drsolomon.com | | Dr Solomon's Software | | ==================================================================== | Virex | | The Fastest, Most Accurate Virus Protection for Macintosh | | --- http://www.drsolomon.com --- | ==================================================================== +++++++++++++++++++++++++++ >From hellman@ais.net (Olof Hellman) Date: Wed, 08 Apr 1998 11:28:42 -0600 Organization: Northwestern University, Evanston, IL, US Be sure to copy the 8-byte AEDesc struct and not just stash the pointer. Secondly, where are you disposing of the event? OSAExecute will dispose of any events that it creates, so if you suspend / resume an event sent from OSAAExecute, you shouldn't be disposing of anything. Third, you do know that suspending an event sent from your own application causes an immediate event timeout, right? In article , Brian.Dupuis@nc.drsolomon.com wrote: > I'm trying to use the OSA library to run attached scripts from a simple > program. That works fine, as far as I can tell. However, my application > uses AESuspendTheCurrentEvent before processing the event, does it's > processing, then resumes it with the "...ResumeThe..." call. However, > even when the AE is a direct event (checks it right before the resume > call), the AEResumeTheCurrentEvent function disposes of my event and > reply. This only happens on events originating from the OSAExecute > function, on scripts that happen to call the app. If the event is one > that I send myself in a regular manner, this all works fine. Just that > pesky OSAExecute causes this. Since IM says that direct events require the > app to dispose of the event and reply itself, I quickly bomb since the > event and reply were already disposed. Any ideas? > +++++++++++++++++++++++++++ >From Brian.Dupuis@nc.drsolomon.com (Brian Dupuis) Date: Wed, 08 Apr 1998 15:14:07 -0400 Organization: Dr. Solomon's Software In article , hellman@ais.net (Olof Hellman) wrote: > Be sure to copy the 8-byte AEDesc struct and not just stash the pointer. Yup. Doing that already, or I'm fairly certain the whole thing would not work at any time. > Secondly, where are you disposing of the event? OSAExecute will dispose > of any events > that it creates, so if you suspend / resume an event sent from > OSAAExecute, you shouldn't > be disposing of anything. Disposing of the event when I get done processing it, immediately after resuming the event, as long as it's a direct event. If OSAExecute disposes of any event it creates, how am I supposed to tell that the event is created by OSAExecute so I don't dispose of it? In IM, it says to check the event source, and if it's direct (which it says it is), I dispose of it. Is there some special handling to determine if it came from OSA? > Third, you do know that suspending an event sent from your own application > causes an > immediate event timeout, right? Yup. Not a problem (I think). Thanks for your input, Brian -- ==================================================================== | Brian J. Dupuis |

(919)833-1877 (919)833-7475 | | Software Analyst - Virex | Brian.Dupuis@nc.drsolomon.com | | Dr Solomon's Software | | ==================================================================== | Virex | | The Fastest, Most Accurate Virus Protection for Macintosh | | --- http://www.drsolomon.com --- | ==================================================================== +++++++++++++++++++++++++++ >From hellman@ais.net (Olof Hellman) Date: Wed, 08 Apr 1998 15:58:25 -0600 Organization: Northwestern University, Evanston, IL, US In article , Brian.Dupuis@nc.drsolomon.com (Brian Dupuis) wrote: > > > Secondly, where are you disposing of the event? OSAExecute will dispose > > of any events that it creates, so if you suspend / resume an event sent from > > OSAAExecute, you shouldn't be disposing of anything. > > Disposing of the event when I get done processing it, immediately after > resuming the event, as long as it's a direct event. If OSAExecute > disposes of any event it creates, how am I supposed to tell that the event > is created by OSAExecute so I don't dispose of it? In IM, it says to > check the event source, and if it's direct (which it says it is), I > dispose of it. Is there some special handling to determine if it came from > OSA? > > > Third, you do know that suspending an event sent from your own application > > causes an > > immediate event timeout, right? > > Yup. Not a problem (I think). > > Thanks for your input, > Brian > Is there a reason why you need to resume the event? If you need to resume to send a reply, then you've already hosed yourself because of the timeout. In this case you've got to avoid doing a suspend/resume. If you don't care about a reply, just dispose the event without resuming. +++++++++++++++++++++++++++ >From caveman-removethis@ricochet.net (Andy Bachorski) Date: Sun, 12 Apr 1998 15:48:27 -0700 Organization: All USENET -- http://www.Supernews.com In article , Brian.Dupuis@nc.drsolomon.com (Brian Dupuis) wrote: > Resuming the event is part of the standard processing that I do when I >get done processing the event, so that I can indeed tell the originator >what happened. I would love to be able to either a) not send a reply or b) >not dispose of the event and reply if it originates from OSAExecute, but >the crux of it is, there's no way that I've found to tell that the event >originated from OSAExecute. It appears as a standard direct event, which, >according to IM, makes my application responsible for disposing the event >and reply. The simplest way to tell were an event has come from would be to add your own private parameter to each self-send event, say a keySentToSelf parameter. I really doesn't even need to have a value since the application is the onlyone who knows about it (don't put it in the app's terminology). Now, when you get an event you can test for the presence of this parameter to determine what to do. An alternative might be to set the event descs to null desc after disposing them. theEvent.descriptorType = typeNull; theEvent.dataHandle = nil; This usually works because it's always safe to dispose a null descriptor, but only if the event is not being used by the sender before being disposed again. A bit riskier, so probably not a good first choice. Just curious -- you say you are ckecking the event to see if it's direct dispatched. How are you determining this, by looking for a PSN targer with a value of kCurrentProcess? Andy B +++++++++++++++++++++++++++ >From hellman@ksan.ms.nwu.edu (Olof Hellman) Date: Mon, 13 Apr 1998 12:06:12 -0600 Organization: Northwestern University Andy Bachorski wrote: > The simplest way to tell were an event has come from would be to add your > own private parameter to each self-send event, say a keySentToSelf > parameter. Andy, is there a reason why this is simpler than looking at the source attribute of the event? and if it there is, is there really a way to convince OSAExecute to generate events with a private parameter in them? Somehow, I think you really didn't mean to say that. - Olof +++++++++++++++++++++++++++ >From caveman-removethis@ricochet.net (Andy Bachorski) Date: Mon, 13 Apr 1998 20:34:55 -0700 Organization: All USENET -- http://www.Supernews.com In article , hellman@ksan.ms.nwu.edu (Olof Hellman) wrote: >Andy Bachorski wrote: > >> The simplest way to tell were an event has come from would be to add your >> own private parameter to each self-send event, say a keySentToSelf >> parameter. > >Andy, is there a reason why this is simpler than looking at the source >attribute of the >event? and if it there is, is there really a way to convince OSAExecute to >generate events with >a private parameter in them? Somehow, I think you really didn't mean to >say that. Nope, Olof, I said exactly what I meant to say. ;) The original question, if I remember right, was how to tell if an event came from the applicatin itself from a script running inside the application. Since the app could add the extra parameter and the script couldn't (unless you wrote the script that way, and knew what the secret param key was) it would allow the app to tell where the event came from. It may not be the optimal solution, but given what I knew about the problem, it is workable. Or did I miss something here? Andy B --------------------------- >From moonlight@isd.net (Ben Hales) Subject: Background App Date: Thu, 16 Apr 1998 23:53:33 -0400 Organization: (none) I have a control panel extension and a background app, type 'appe', that work together. I have the background app in the extensions folder and it launches automatically at system starup. The problem comes when I quit the background app. The Finder comes up with an alert the says "The application so-and-so quit possibly because the server that contained it has been disconnected". The background app quits but it also makes another app quit for some reason. Why? Thanks, Ben Hales -- \\---The-Best-Line-Ever-------------------\\ SOME LADY(to Winston):You're drunk. WINSTON CHURCHILL: Yeah, well you're ugly. And when I wake up tomorrow I'll be sober, but you'll still be ugly. - ------------------- Buy MacOS 8 Now!!!!!! http://www.macos.apple.com/macos8/ +++++++++++++++++++++++++++ >From dtp@pluto.njcc.com (David T. Pierson) Date: Fri, 17 Apr 1998 11:57:42 -0400 Organization: New Jersey Computer Connection, Lawrenceville, NJ moonlight@isd.net (Ben Hales) wrote: >I have a control panel extension and a background app, type 'appe', that >work together. I have the background app in the extensions folder and it >launches automatically at system starup. The problem comes when I quit >the background app. The Finder comes up with an alert the says "The >application so-and-so quit possibly because the server that contained it >has been disconnected". The background app quits but it also makes >another app quit for some reason. Why? How are you quitting the background app? Is the other app that quits always the same one? Is it loaded from a networked machine? Is the connection closing when you quit? How reproducible is this on other types of machines/system versions? Is the other app launched by your background app? David +++++++++++++++++++++++++++ >From jasonp@blue.seas.upenn.edu (Jason S Pareti) Date: 17 Apr 1998 17:54:26 GMT Organization: University of Pennsylvania Ben Hales (moonlight@isd.net) wrote: : The Finder comes up with an alert the says "The : application so-and-so quit possibly because the server that contained it : has been disconnected". We had a similar problem with an APPL & appe combo we used for a screensaver. Under 8.0 and 8.1, if the APPL launches the appe, then whenever you quit the APPL the backgroud appe will automatically be quit by the Finder and the message above given. I'm pretty sure it's a confirmed bug with the Process Manager in 8.0 and higher. We weren't able to find a work-around, unfortunately. Cheers, Jason +++++++++++++++++++++++++++ >From hiking1@magicpubs.com (Michael) Date: Fri, 17 Apr 1998 11:08:24 -0700 Organization: Magic Publications Ben Hales wrote: > I have a control panel extension and a background app, type 'appe', that > work together. I have the background app in the extensions folder and it > launches automatically at system starup. The problem comes when I quit > the background app. The Finder comes up with an alert the says "The > application so-and-so quit possibly because the server that contained it > has been disconnected". The background app quits but it also makes > another app quit for some reason. Why? Are you quitting by sending a quit app Apple Event? Why don't you just make the background app a regular background only app and put it in the Startup Items folder instead? If you use this approach, i don't think you'll have these problems (unless, of course, you've not chosen a unique creator type for your app). -- In all matters of opinion, our adversaries are insane. -- Mark Twain +++++++++++++++++++++++++++ >From moonlight@isd.net (Ben Hales) Date: Fri, 17 Apr 1998 19:25:03 -0400 Organization: (none) In article , dtp@pluto.njcc.com (David T. Pierson) wrote: > moonlight@isd.net (Ben Hales) wrote: > > >I have a control panel extension and a background app, type 'appe', that > >work together. I have the background app in the extensions folder and it > >launches automatically at system starup. The problem comes when I quit > >the background app. The Finder comes up with an alert the says "The > >application so-and-so quit possibly because the server that contained it > >has been disconnected". The background app quits but it also makes > >another app quit for some reason. Why? > > How are you quitting the background app? Is the other app that quits > always the same one? Is it loaded from a networked machine? Is the > connection closing when you quit? How reproducible is this on other types > of machines/system versions? Is the other app launched by your background > app? > > David When I quit the app I send a highlevel event to it. The other app it different. It seems to be the first one I launch in the Finder like CodeWarrior or something. It isn't loaded from a networded machine. I use the computer at my house. I'm not sure how it acts on other machines. The other app is not launched by my background app. Thanks, Ben Hales -- \\---The-Best-Line-Ever-------------------\\ SOME LADY(to Winston):You're drunk. WINSTON CHURCHILL: Yeah, well you're ugly. And when I wake up tomorrow I'll be sober, but you'll still be ugly. - ------------------- Buy MacOS 8 Now!!!!!! http://www.macos.apple.com/macos8/ +++++++++++++++++++++++++++ >From slur@world.std.com (Scott Lahteine) Date: Mon, 20 Apr 1998 01:02:19 GMT Organization: Pylon Transit Authority In article <6h850i$pu9$1@netnews.upenn.edu>, jasonp@blue.seas.upenn.edu (Jason S Pareti) wrote: >Ben Hales (moonlight@isd.net) wrote: >: The Finder comes up with an alert the says "The >: application so-and-so quit possibly because the server that contained it >: has been disconnected". > >We had a similar problem with an APPL & appe combo we used for a >screensaver. Under 8.0 and 8.1, if the APPL launches the appe, then >whenever you quit the APPL the backgroud appe will automatically be quit >by the Finder and the message above given. > >I'm pretty sure it's a confirmed bug with the Process Manager in 8.0 and >higher. > >We weren't able to find a work-around, unfortunately. Well, he said the 'appe' loaded at startup - not by the application - so it's a question of whether there's a parent/child issue here or just the fact that they share the same Creator Code. Maybe it would work if they had different creators...? -- Scott Lahteine "No Universe is perfect which leaves no room for improvement." --------------------------- >From lottsim@aol.com (LOTTSIM) Subject: Blanking the screen...for good Date: 16 Apr 1998 20:50:49 GMT Organization: AOL http://www.aol.com For a control panel which I'm working on, I'd like to completely blank out the screen for a couple of seconds. This isn't too hard to do---simply hide the menubar and fill the screen black. However, problems arise when any application starts doing any graphics work; the previously black screen is written over. Is there any way to get around this, and stop other applications from writing to the screen? Thanks, Alex Rampell +++++++++++++++++++++++++++ >From andrew@AmbrosiaSW.com (Andrew Welch) Date: Thu, 16 Apr 1998 23:23:12 GMT Organization: Ambrosia Software, Inc. In article <1998041620504900.QAA22173@ladder03.news.aol.com>, lottsim@aol.com (LOTTSIM) wrote: > For a control panel which I'm working on, I'd like to completely blank out the > screen for a couple of seconds. This isn't too hard to do---simply hide the > menubar and fill the screen black. > > However, problems arise when any application starts doing any graphics work; > the previously black screen is written over. Is there any way to get around > this, and stop other applications from writing to the screen? Sure... one way would be to gamma fade the monitor (or all attached monitors, as the case may be) to black... > Thanks, > > Alex Rampell +--------------------------+-----------------------------------+ | Andrew Welch | Ambrosia Software, Inc. | | Thaumaturgist | http://www.AmbrosiaSW.com/ | +--------------------------+-----------------------------------+ +++++++++++++++++++++++++++ >From kluev@stalker.gamma.-deIete-.ru (Michael Kluev) Date: Fri, 17 Apr 1998 15:42:23 +0400 Organization: _ In article <1998041620504900.QAA22173@ladder03.news.aol.com>, lottsim@aol.com (LOTTSIM) wrote: > For a control panel which I'm working on, I'd like to completely blank out the > screen for a couple of seconds. This isn't too hard to do---simply hide the > menubar and fill the screen black. > > However, problems arise when any application starts doing any graphics work; > the previously black screen is written over. Is there any way to get around > this, and stop other applications from writing to the screen? Open the big full screen window. -- Michael Kluev. PS. Remove "-delete-." part from my address to reply. +++++++++++++++++++++++++++ >From Jens Bauer Date: Fri, 17 Apr 1998 22:49:53 +0200 Organization: Faster Software LOTTSIM wrote: > > For a control panel which I'm working on, I'd like to completely blank out the > screen for a couple of seconds. This isn't too hard to do---simply hide the > menubar and fill the screen black. > > However, problems arise when any application starts doing any graphics work; > the previously black screen is written over. Is there any way to get around > this, and stop other applications from writing to the screen? Hi Alex! Do it the Atari-way. It's compatible to all languages I guess, so don't worry. It's also legal. Just turn down the Gamma-table, so all colors go black. Graphics should still work. If this does not work, please tell us what happens, and we'll try another approach by moving the screen-pointer and clearing the viewed screen. +++++++++++++++++++++++++++ >From Jens Bauer Date: Sat, 18 Apr 1998 17:42:53 +0200 Organization: Faster Software Michael Kluev wrote: > Open the big full screen window. Ofcuz, VERY good solution! -But before this, you might want to fade the colors. Then you can open the window, and fade/set back the colors, then you're pretty sure that the graphics will be correct. +++++++++++++++++++++++++++ >From sperspect@mindspring.com Date: Sun, 19 Apr 1998 19:39:24 -0400 Organization: Software Perspectives In article <1998041620504900.QAA22173@ladder03.news.aol.com>, lottsim@aol.com (LOTTSIM) wrote: > Is there any way to get around > this, and stop other applications from writing to the screen? Gamma fading is a great idea unless you want something to appear on the screen for any reason....so... You could try using a Text Services window instead of a standard window. This kind of window will be placed over ANY other windows and prevent things from being drawn there. The NewServiceWindow function opens a floating utility window in the floating window service layer, in front of the current application. The text service component may use the window for interaction with the user or other purposes. FUNCTION NewServiceWindow (wStorage: Ptr; boundsRect: Rect; title: Str255; visible: Boolean; theProc: Integer; behind: WindowPtr; goAwayFlag: Boolean; ts: ComponentInstance; VAR window: WindowPtr): OSErr; You'd want to do something like the following: NewServiceWindow ( nil, &qd.screenBits.bounds,"\p",false,plainDBox, ( WindowPtr ) -1,false,nil, &myServiceWindow ); Kevin -- Software Perspectives Web Site: www.mindspring.com/~sperspect --------------------------- >From drysdallSPAMFREE@waikato.ac.nz (Richard Drysdall) Subject: BlockMove vs BlockMoveData Date: Wed, 15 Apr 1998 16:44:47 +1200 Organization: University of Waikato Hi. I've seen several people mention in past postings that we should use BlockMoveData instead of BlockMove. Since I don't have IM: Memory (or whatever it's documented in), and since I view the prospect of downloading and reading the pdf version in the same way a vegetarian views a T-bone steak, can someone give me a quick rundown on BlockMoveData? Specifically: 1. What does BlockMoveData do that makes it better than BlockMove? 2. Does it have the same parameters? 3. What systems/roms is it available on? 4. Gotchas? Thanks very much for any info. -- Richard Drysdall, University of Waikato, New Zealand * Please remove the upper case letters from my email address to reply. * Information gathering organisations are hereby denied permission to use any personal information pertaining to myself (including my email address) in any form of commercial transaction. Unsolicited email will be forwarded to the appropriate postmasters. +++++++++++++++++++++++++++ >From trumbull@cs.yale.edu (Ben Trumbull) Date: Wed, 15 Apr 1998 01:21:07 -0400 Organization: Yale University In article , drysdallSPAMFREE@waikato.ac.nz wrote: > Hi. > > I've seen several people mention in past postings that we should use > BlockMoveData instead of BlockMove. Since I don't have IM: Memory (or > whatever it's documented in), and since I view the prospect of downloading > and reading the pdf version in the same way a vegetarian views a T-bone > steak, can someone give me a quick rundown on BlockMoveData? Specifically: > > 1. What does BlockMoveData do that makes it better than BlockMove? > 2. Does it have the same parameters? > 3. What systems/roms is it available on? > 4. Gotchas? You can check the API in the header files (sorry, not handy). However, the reason it's better than BlockMove is because BlockMove flushes the cache for any move over x bytes (x = 16?). On a PPC system, flushing the L2 cache with each move is VERY expensive. It bites that moving 20 bytes nukes a 1MB cache. Hence, use BlockMoveData. terminally curious, Ben ___________________________________________________________________ Benjamin Trumbull trumbull@cs.yale.edu Yale University You can't be in hell; you can still read your e-mail +++++++++++++++++++++++++++ >From jwwalker@kagi.takethisout.com (James W. Walker) Date: Tue, 14 Apr 1998 23:41:06 -0800 Organization: A+Net In article , drysdallSPAMFREE@waikato.ac.nz wrote: >1. What does BlockMoveData do that makes it better than BlockMove? It's what it doesn't do, namely, flush the cache. BlockMove always flushes the processor caches, on the theory that the data you're moving MIGHT be executable code. If you know you're not moving code, use BlockMoveData, and don't take that speed hit. >2. Does it have the same parameters? Yes. >3. What systems/roms is it available on? Other than saying that all PowerPC machines have it, I'm not sure. But the beauty of it is that you don't need to know. The 68K trap word for it is the same trap number as BlockMove, with an extra flag bit set. Machines that have never heard of BlockMoveData will just ignore the extra bit. >4. Gotchas? I don't think so. -- Jim Walker To reply, take out the spam-blocker from my address. +++++++++++++++++++++++++++ >From Jim Murphy Date: 15 Apr 1998 09:15:39 GMT Organization: Apple Computer, Inc. In article Ben Trumbull, trumbull@cs.yale.edu writes: >BlockMove flushes the cache for any move over x bytes (x = 16?). On >a PPC system, flushing the L2 cache with each move is VERY expensive. >It bites that moving 20 bytes nukes a 1MB cache. Hence, use >BlockMoveData. BlockMove only needs to flush the 68K processor caches for compatibility, not the PowerPC caches. Thus, it only removes 68K code that's been recompiled by a DR emulator, and not native PowerPC code. It's also smart enough to do a range flush, and thus generally won't need to dump the entire DR cache. This doesn't mean you shouldn't use BlockMoveData, you should. It's just that BlockMove isn't as painful as you describe. Jim Murphy Mac OS Release Engineering/MacsBug murph@apple Apple Computer, Inc. --------------------------- >From Ian Russell Ollmann Subject: C++ & Rhapsody? Date: Fri, 10 Apr 1998 17:43:43 -0700 Organization: The Scripps Research Institute, La Jolla, CA How well is C++ going to work with the Rhapsody yellowbox. Will we be pretty much stuck with Obj-C or java or can we use C++? I'm asking because we (i.e. not Be) are looking at options for porting chunks of the Be object framework to either MacOS or Rhapsody and the framework is written in C++. Preemptive multitasking on MacOS is looking very painful, so I thought I'd ask about Rhapsody. Will it be possible to intermix mix C++ and Obj-C in the same code? The same application? Ian +++++++++++++++++++++++++++ >From andrew_abernathy@omnigroup.com Date: 11 Apr 1998 09:30:50 GMT Organization: Omni Development, Inc. Ian Russell Ollmann wrote: > > How well is C++ going to work with the Rhapsody yellowbox. Will we > be pretty much stuck with Obj-C or java or can we use C++? [...] > Will it be possible to intermix mix > C++ and Obj-C in the same code? The same application? Obj-C++ looks something like this: ... someCPPObject = [someObjCObject gimmeSomeCPPObject]; int value = someCPPObject.gimmeSomeValue(); ... IE within an Obj-C class you can message C++ objects, and vice versa. Obj-C objects can have ivars that hold C++ objects, etc. However, where you _might_ run into problems is if Apple's version of the Obj-C++ compiler isn't quite up-to-date with what you expect from a current C++ compiler. In the past, it's lagged some; it's unclear if that will change now. (As an ex-C++ user who has Seen The Light, I can't resist urging everyone to give Obj-C a fair shake. Its syntax, while initially strange due to its difference from most syntaxes, is in reality much more expressive than the C++ syntax, and it's _far_ more flexible while still being pretty fast. Features like categories are _extremely_ useful.) - - andrew_abernathy@omnigroup.com - NeXTmail & MIME ok +++++++++++++++++++++++++++ >From lars.farm@ite.mh.se (Lars Farm) Date: Sat, 11 Apr 1998 14:50:23 +0200 Organization: pv Ian Russell Ollmann wrote: > How well is C++ going to work with the Rhapsody yellowbox. Will we > be pretty much stuck with Obj-C or java or can we use C++? I'm asking > because we (i.e. not Be) are looking at options for porting chunks of the > Be object framework to either MacOS or Rhapsody and the framework is > written in C++. Preemptive multitasking on MacOS is looking very painful, > so I thought I'd ask about Rhapsody. Will it be possible to intermix mix > C++ and Obj-C in the same code? The same application? > > Ian Until a modern version of g++ of egcs is available or until Metrowerks delivers you're out of luck. The current version of g++ is 2.7.something and is useless for c++. -- Lars Farm; lars.farm@ite.mh.se - Limt/Channelmatic: lars.farm@limt.se +++++++++++++++++++++++++++ >From sw@nan.co.uk (Sak Wathanasin) Date: Sun, 12 Apr 1998 15:18:55 GMT Organization: Network Analysis Ltd In article <1d7bslx.14yqtw619wndmhN@dialup116-1-32.swipnet.se>, lars.farm@ite.mh.se (Lars Farm) wrote: > Until a modern version of g++ of egcs is available or until Metrowerks > delivers you're out of luck. The current version of g++ is 2.7.something > and is useless for c++. Er, gcc 2.8.1 can actually compile appls that use STL. Unfortunately, no one has updated the iostreams lib (and friends). Been using it for the last month or so on Linux and Solaris (sorry, folks, got a family to feed...). -- Sak Wathanasin Network Analysis Limited 178 Wainbody Ave South, Coventry CV3 6BX, UK Internet: sw@nan.co.uk Phone: (+44) 1203 419996 Fax: (+44) 1203 690690 +++++++++++++++++++++++++++ >From dent@highway1.com.au (Andy Dent) Date: Wed, 15 Apr 1998 04:26:54 +0800 Organization: A.D. Software In article <1d7bslx.14yqtw619wndmhN@dialup116-1-32.swipnet.se>, lars.farm@ite.mh.se (Lars Farm) wrote: >The current version of g++ is 2.7.something >and is useless for c++. This sweeping statement is too broad to be meaningful. We have a number of OOFILE customers using g++ versions from 2.6.x onward successfully on a range of Unix platforms worldwide. OOFILE doesn't use templates or STL which may be the areas that Lars refers to. FWIW one of our UK customers has OOFILE running under a Rhapsody DR release, as well as MkLinux. One of our largest Unix customers (in terms of size of their databases) has been using OOFILE with g++ for over 2 years under Solaris and SunOS. I believe they started with g++ v2.6.3. OOFILE has been used with at least 15 different compilers and versions of compilers worldwide. Consistently, we have had the most problems with bugs in Visual C++ of various versions, and we've relied on g++ as the authorative source of compiler error messages when it came to debugging subtle problems. -- Andy Dent, Software Designer, A.D. Software, Western Australia OOFILE - Database, Reports, Graphs, GUI for c++ on Mac, Unix & Windows PP2MFC - PowerPlant->MFC portability http://www.highway1.com.au/adsoftware/crossplatform.html +++++++++++++++++++++++++++ >From lars.farm@ite.mh.se (Lars Farm) Date: Wed, 15 Apr 1998 19:45:11 +0200 Organization: pv Andy Dent wrote: > In article <1d7bslx.14yqtw619wndmhN@dialup116-1-32.swipnet.se>, > lars.farm@ite.mh.se (Lars Farm) wrote: > > >The current version of g++ is 2.7.something > >and is useless for c++. > > This sweeping statement is too broad to be meaningful. > [...] templates or STL which may be the areas that Lars refers to. Yes, it was a sweeping statement. By c++ I mean standard c++ (ISO/IEC14882). By current I mean the g++ found on RDR1. g++ 2.7.x implements a subset of old ARM-C++. ARM-Subset because of for instance: to use exceptions you must turn off all optimizations! Use (pre ISO) templates and expect to manage instantiations manually, etc... The differences between C++ and ARM-C++ are significant. Lots of important differences in templates. operator new requires exceptions. namespaces. casts. the standard library. etc, etc. g++ 2.7.x falls flat on its face in all these areas. So, if you want to use C++ then 2.7.x really is useless. If you are satisfied with a subset of 1989 ARM-C++, willing to search the net for more or less functional fragments of the standard library and compile them yourself, then you can use 2.7.x, but that language is not C++. - Lars -- Lars Farm; lars.farm@ite.mh.se - Limt/Channelmatic: lars.farm@limt.se +++++++++++++++++++++++++++ >From Andy Finnell Date: Thu, 16 Apr 1998 11:36:38 -0400 Organization: AT&T WorldNet Services On Sat, 11 Apr 1998, andrew_abernathy@omnigroup.com wrote: >(As an ex-C++ user who has Seen The Light, I can't resist urging >everyone to give Obj-C a fair shake. Its syntax, while initially >strange due to its difference from most syntaxes, is in reality much >more expressive than the C++ syntax, and it's _far_ more flexible while >still being pretty fast. Features like categories are _extremely_ >useful.) > Amen to that! I have picked up obj-c recently (under Mklinux) and have been amazed at its power. :-) True dynamic binding (no more writing virtual in front of functions!) and catagories are just plain cool! Unfortunately I'm still in college so I have to use c++ to write my programs. :-( But I'm porting a lot of my data structures over to obj-c and now do all my personal projects in obj-c. -andy +++++++++++++++++++++++++++ >From James McIninch Date: Thu, 16 Apr 1998 14:33:18 -0400 Organization: GenePro, Inc. Andy Dent wrote: > > In article <1d7bslx.14yqtw619wndmhN@dialup116-1-32.swipnet.se>, > lars.farm@ite.mh.se (Lars Farm) wrote: > > >The current version of g++ is 2.7.something > >and is useless for c++. > Incidentally, the current version of g++ is 2.8.1. It correctly handles templates and namespaces where the 2.7.x ones did not. I can't comment on the completeness of the exception support since I haven't fiddled with it. -- Dr. James D. McIninch Projects Director GenePro, Inc. 451 Bishop St., NW Suite B Atlanta, GA 30318 USA Phone: (404) 875-4131 Fax: (404) 875-9698 --------------------------- >From "Marc Page" Subject: DEADBEEF in Supervisor data space Date: 13 Apr 98 12:58:59 -0500 Organization: National Instruments, Austin, TX I got the following in MacsBug while debugging a program: Bus Error at 03349DEE while reading byte from DEADBEEF in Supervisor data space DEADBEEF?!?!? Is this an easter egg? What does it mean? - ------------------------------------------------- - Marc Page http://www.ridgenet.net/~mackays/pages.cgi - ------------------------------------------------- ....error reading Win OS. (A)bort, (R)etry, (T)hink Different? - ------------------------------------------------- This message was created and sent using the Cyberdog Mail System - ------------------------------------------------- +++++++++++++++++++++++++++ >From Jens Bauer Date: Mon, 13 Apr 1998 22:12:00 +0200 Organization: Faster Software Marc Page wrote: > I got the following in MacsBug while debugging a program: > > Bus Error at 03349DEE > while reading byte from DEADBEEF in Supervisor data space > > DEADBEEF?!?!? > > Is this an easter egg? What does it mean? When writing code in assembler, people usually initializes some variables for storing addresses in. -Say you have an Interrupt routine, and you want to install this routine somewhere. you place the old value of the Interrupt vector in your variable. You install your interrupt in the vector, and when your interrupt is done, it jumps to the saved address. If, for some reason, this address has not been written to the variable, the variable still contains the old value. Often, people initialize this value to $DEADBEEF, $FADEFACE, $FADEBEEF, $BEEFFACE, $ABBABABE, etc, etc. It all started years ago. When people wrote code without these variables, they instead patched the code directly, so a JMP in 68xxx assembler was initialized to.. to_old_rout: JMP $FEEDFACE This made sure that the assembler wouldn't optimise it to a short-word jump, but keep room for a full address. Hope this answers your (and many other's) questions. -WoF- +++++++++++++++++++++++++++ >From forsytgd@aol.com (Forsytgd) Date: 14 Apr 1998 18:35:50 GMT Organization: AOL http://www.aol.com Marc Page wrote: > I got the following in MacsBug while debugging a program: > > Bus Error at 03349DEE > while reading byte from DEADBEEF in Supervisor data space > > DEADBEEF?!?!? > > Is this an easter egg? What does it mean? This is a perfectly good 32-bit address. Most likely, it just happens to fit an English word meaning as well when displayed in hex format. Some addresses can be downright interesting as words but are still addresses. George "If at first you don't succeed, blame it on the software" +++++++++++++++++++++++++++ >From "Marc Page" Date: 14 Apr 98 15:48:54 -0500 Organization: National Instruments, Austin, TX Actually, its not a perfectly good 32-Bit Mac Address, its odd. On Tue, Apr 14, 1998 1:35 PM, Forsytgd wrote: >Marc Page wrote: >> I got the following in MacsBug while debugging a program: >> >> Bus Error at 03349DEE >> while reading byte from DEADBEEF in Supervisor data space >> >> DEADBEEF?!?!? >> >> Is this an easter egg? What does it mean? > >This is a perfectly good 32-bit address. Most likely, it just happens to fit >an English word meaning as well when displayed in hex format. Some >addresses >can be downright interesting as words but are still addresses. > >George >"If at first you don't succeed, blame it on the software" > - ------------------------------------------------- - Marc Page http://www.ridgenet.net/~mackays/pages.cgi - ------------------------------------------------- ....error reading Win OS. (A)bort, (R)etry, (T)hink Different? - ------------------------------------------------- This message was created and sent using the Cyberdog Mail System - ------------------------------------------------- +++++++++++++++++++++++++++ >From steve@discoverysoft.com (Steven Fisher) Date: Tue, 14 Apr 1998 14:22:57 -0700 Organization: Discovery Software Ltd. I wrote: >Basically, DEADBEEF is a default value. Oops! I forgot to mention that this default value comes from the PowerPC chip itself, which is based on an IBM architecture. -- Steven Fisher; Discovery Software Ltd.; steve@discoverysoft.com "Anyone who has never made a mistake has never tried anything new." -- Albert Einstein +++++++++++++++++++++++++++ >From steve@discoverysoft.com (Steven Fisher) Date: Tue, 14 Apr 1998 14:21:04 -0700 Organization: Discovery Software Ltd. In article , "Marc Page" wrote: >I got the following in MacsBug while debugging a program: > >Bus Error at 03349DEE >while reading byte from DEADBEEF in Supervisor data space > >DEADBEEF?!?!? > >Is this an easter egg? What does it mean? Basically, DEADBEEF is a default value. Kind of handy for debugging, since trying to do anything with DEADBEEF will cause a crash and DEADBEEF is recognizable enough that you know something went wrong. See -- Steven Fisher; Discovery Software Ltd.; steve@discoverysoft.com "Anyone who has never made a mistake has never tried anything new." -- Albert Einstein +++++++++++++++++++++++++++ >From Jens Bauer Date: Wed, 15 Apr 1998 05:42:29 +0200 Organization: Faster Software Marc Page wrote: > > Actually, its not a perfectly good 32-Bit Mac Address, its odd. It's a perfectly good address for debugging purposes. It offers anything that can crash your program a 'polite' way: Bus-errors Address-errors Too bad it's not an illegal instruction though. -WoF- +++++++++++++++++++++++++++ >From Jens Bauer Date: Wed, 15 Apr 1998 05:20:01 +0200 Organization: Faster Software Steven Fisher wrote: > >Basically, DEADBEEF is a default value. > > Oops! I forgot to mention that this default value comes from the PowerPC > chip itself, which is based on an IBM architecture. AHEM! My Atari did not have a PowerPC back in '87! However, Charles F. Johnson, a shareware coder actually used this address in lots of software. -How do you mean it comes from the PowerPC chip itself. -Do you mean it, eh, creates this, eh, error, by itself, or ? -I don't understand. +++++++++++++++++++++++++++ >From entity@interlog.com (Entity) Date: 16 Apr 1998 17:29:33 -0400 Organization: Hybrid Designs In article <35342763.FDEA235E@adr.dk>, Jens Bauer wrote: >Steven Fisher wrote: > >> >Basically, DEADBEEF is a default value. >> >> Oops! I forgot to mention that this default value comes from the PowerPC >> chip itself, which is based on an IBM architecture. > >AHEM! > >My Atari did not have a PowerPC back in '87! >However, Charles F. Johnson, a shareware coder actually used this address in >lots of software. > >-How do you mean it comes from the PowerPC chip itself. -Do you mean it, eh, >creates this, eh, error, by itself, or ? -I don't understand. Yep, on the Amiga as well, it would put DEADBEEF for memory that had been deallocated. This was a great way of checking to see if you were referencing data or pointers from a deleted structure/linked list item etc. I can't remember if the OS did this on default when memory was deallocated or whether there was some debugging program that did that... (I think it might have been MungWall or something that did it..) -- _____________________________________________________________________________ Hybrid Designs entity@interlog.com +++++++++++++++++++++++++++ >From Jens Bauer Date: Fri, 17 Apr 1998 22:22:01 +0200 Organization: Faster Software Entity wrote: > >-How do you mean it comes from the PowerPC chip itself. -Do you mean it, eh, > >creates this, eh, error, by itself, or ? -I don't understand. > > Yep, on the Amiga as well, it would put DEADBEEF for memory that had been > deallocated. This was a great way of checking to see if you were > referencing data or pointers from a deleted structure/linked list item > etc. I can't remember if the OS did this on default when memory was > deallocated or whether there was some debugging program that did that... > (I think it might have been MungWall or something that did it..) Yeh, but I think that saying the CPU (PowerPC) writes this value by default, is some kinda distorted illusion. The CPU does not know what a dead beef is. -WoF- --------------------------- >From jhs@atomic.cs.princeton.edu (James Shaw) Subject: Detecting how much memory is available Date: 7 Apr 1998 03:58:49 GMT Organization: Computer Science Department, Princeton University Hello, We're getting near a beta of our latest game and I'm struggling a bit with a philosophical question: how to handle memory requirements. If I go wild and never load from disk during the game, it is zippy fast and responsive but will take ~12MB of RAM. If I cache some stuff, it occasionally hits disk at certain key spots but I can reduce its footprint to 9M. If I cache a lot, performance suffers but I can get it down even further (e.g. 5-6M). Note: there aren't any "levels" or obvious places in the game where I can load/unload a set of graphics/sounds. My first question is: should I bother? My target machine is a 68040 or PPC, with possible 68030 use. Memory's cheap now but I don't like the idea of unnecessarily excluding some people (especially people who have registered other games and supported us in the past). Is it technically possible to reliably act one way if 9Meg are available and another way if 12Meg are? (Is a big malloc and free reliable?) If so, could you post a snippet. I'd appreciate it and so would the people who play our games! Thanks, James James Shaw Quarter Note Software - Games for the Macintosh james@kagi.com http://www.cs.princeton.edu/~jhs/shareware +++++++++++++++++++++++++++ >From macgnome@aol.com (MacGnome) Date: 7 Apr 1998 20:36:34 GMT Organization: AOL http://www.aol.com hummm... that sounds like a job for.... The Gestalt Manager! check gestalt.h (or GestaltEqu.h for older universal headers) for the symbol thingee (excuse my terminology) for free memory, I know it's in there somewhere. -MacGnome@aol.com +++++++++++++++++++++++++++ >From hiking1@magicpubs.com (Michael) Date: Tue, 7 Apr 1998 17:51:20 -0700 Organization: Magic Publications > We're getting near a beta of our latest game and I'm struggling > a bit with a philosophical question: how to handle memory requirements. > > If I go wild and never load from disk during the game, it is zippy > fast and responsive but will take ~12MB of RAM. If I cache some > stuff, it occasionally hits disk at certain key spots but I can > reduce its footprint to 9M. If I cache a lot, performance suffers > but I can get it down even further (e.g. 5-6M). Note: there > aren't any "levels" or obvious places in the game where I can > load/unload a set of graphics/sounds. Why don't you let the user control this? Set your minimum size to 5-6Mb, and your preferred size to 12-14Mb. When starting up, you can find out how much memory is at your disposal and act accordingly. Also consider using System 7 temporary memory. > My first question is: should I bother? My target machine is a > 68040 or PPC, with possible 68030 use. Memory's cheap now but > I don't like the idea of unnecessarily excluding some people > (especially people who have registered other games and supported > us in the past). Memory may be cheap now, but many 68K machines, especially 68030 vintage top out at 10-12Mb (i.e. the hardware will not support larger configurations). > Is it technically possible to reliably act one way if 9Meg are > available and another way if 12Meg are? Yes. >(Is a big malloc and free reliable?) I don't know of any problems with large memory requests. Generally speaking, if it returns a handle other than NULL, you got the memory you requested; if you get NULL, you didn't (in which you either request a smaller amount, squawk at the user, try requesting System 7 temporary memory, or whatever). -- In all matters of opinion, our adversaries are insane. -- Mark Twain +++++++++++++++++++++++++++ >From jhs@atomic.cs.princeton.edu (James Shaw) Date: 9 Apr 1998 19:53:14 GMT Organization: Computer Science Department, Princeton University Hi again, I've gotten a lot of helpful comments both here and in email. The malloc/free solution is obviously not the best, much preferred is calling MaxBlock() or FreeMem(). For my uses, FreeMem() is more appropriate as I don't need one big block but just lots of total memory during init. Relatedly, several people asked if I could tone down the memory requirements or load on demand more often. Fair enough, I can but performance suffers and I'd like to give top performance to those who have the memory. One person mentioned virtual memory slowing things down. Agreed. VM is evil, and anyone playing any game should turn it off. Some people mentioned quitting other apps or the finder (gasp!). As it is a take over the screen game, voluntarily quitting other apps is assumed if you aren't decked out with RAM. More important to me is awareness of the existance of some older 68030's with low max memory. ("Hah! 12 Megs max, we'll NEVER need all of that!") What I'll plan on doing is checking FreeMem() during Init. I'll have 2 or 3 hand-picked thresholds to determine what memory usage level the person is at. Then I'll do the loading accordingly. Hmmm...this could end up being pretty slick. Does anyone else know of a game where this sort of "smart" memory requirements is done? I'd be interested in seeing how it works for them. Thanks again for all of the help, James +++++++++++++++++++++++++++ >From ammon@_remove_cs.byu.edu (Ammon Skidmore) Date: Fri, 10 Apr 1998 17:49:41 -0700 Organization: Skidperfect Software In article <6gj8va$qts$1@cnn.Princeton.EDU>, jhs@atomic.cs.princeton.edu (James Shaw) wrote: >... >What I'll plan on doing is checking FreeMem() during >Init. I'll have 2 or 3 hand-picked thresholds to determine >what memory usage level the person is at. Then I'll >do the loading accordingly. Hmmm...this could end up being >pretty slick. Does anyone else know of a game where this >sort of "smart" memory requirements is done? I'd be >interested in seeing how it works for them. When your app launches, it gets at least the minimum amount of memory set in the finder info box, so you'll have to tell the user the recommended minimum memory requirement, or modify the SIZE resource and have them reload the game. As an example, I remember that the PegLeg demo has you quit&relead when you de/increased the size of the playing area. hope this helps, -Ammon -- Ammon Skidmore Skidperfect Software, Inc. The spiraling shape will make you go insane But everyone wants to see that groovy thing -- TMBG +++++++++++++++++++++++++++ >From hiking1@magicpubs.com (Michael) Date: Sun, 12 Apr 1998 17:17:43 -0700 Organization: Magic Publications > When your app launches, it gets at least the minimum amount of memory set > in the finder info box, so you'll have to tell the user the recommended > minimum memory requirement, or modify the SIZE resource and have them > reload the game. As an example, I remember that the PegLeg demo has you > quit&relead when you de/increased the size of the playing area. Just set the "Preferred size" to the max you could possibly want, the "Minimum size" to the least you can get by on, and leave the SIZE resource alone after that. If a user has at least the minimum, but not as much as the maximum available, the app is given as much as it can be given. A dialog could be brought up in lower memory conditions, but those can get annoying. -- In all matters of opinion, our adversaries are insane. -- Mark Twain --------------------------- >From 4gbds@qlink.queensu.ca (Shoemaker Garth B D) Subject: Drawing Tiles Fast Date: 12 Apr 1998 19:04:46 GMT Organization: Queen's University, Kingston Hello All, I am having a problem with performance (code performance, that is). I have to draw a matrix of 64x64 pixel images. There will either be 6x6, 12x12, or 24x24 of them. I do this by drawing them to a backbuffer and copying it over. I originally tried drawing a bunch of PICT resources to the backbuffer. This proved to be very slow, even with only 6x6 of them. I thought this was very strange, seeing as all I do is fillrect the region I am going to draw in, set up a bunch of rects, draw PICTs in the rects, and copy it to the main grafport. So, I tried doing it with CICNs, I thought it might be faster. nope, no faster. For reference, it takes roughly half a second to do the whole draw/copy thing on my 040 25MHz. This seems ludicrously slow. Any tips? Thanks, Garth +++++++++++++++++++++++++++ >From Clark Cox Date: Sun, 12 Apr 1998 21:15:37 GMT Organization: Coxware Software Shoemaker Garth B D wrote: > > Hello All, > I am having a problem with performance (code performance, that > is). I have to draw a matrix of 64x64 pixel images. There will either be > 6x6, 12x12, or 24x24 of them. I do this by drawing them to a backbuffer > and copying it over. I originally tried drawing a bunch of PICT resources > to the backbuffer. This proved to be very slow, even with only 6x6 of > them. I thought this was very strange, seeing as all I do is fillrect the > region I am going to draw in, set up a bunch of rects, draw PICTs in the > rects, and copy it to the main grafport. So, I tried doing it with CICNs, > I thought it might be faster. nope, no faster. > For reference, it takes roughly half a second to do the whole > draw/copy thing on my 040 25MHz. This seems ludicrously slow. Any tips? > > Thanks, > Garth Put each PICT or cicn in it's own small GWorld when your program first starts up. Then copy them from those GWorlds instead of using DrawPicture or PlotCIcon. For an additional speedup, try to limit the depth of all GWorlds involved to 8-bit (lower if you can stand it), the lower the bit depth, the less data there is to transfer, which leads to faster copying times. -- Clark S. Cox, III | ClarkCox3@hotmail.com Coxware Software | Coxware@hotmail.com "The only stupid question is the one not asked" --Unknown e-mail harvester traps: Chairman Reed Hundt: rhundt@fcc.gov Commissioner James Quello: jquello@fcc.gov Commissioner Susan Ness: sness@fcc.gov Commissioner Rachelle Chong: rchong@fcc.gov president@whitehouse.gov mwa234@hotmail.com bestrealtor@marketingmaster.com bstar@sssnet.com info@herbchew.com yyyr4t7@biblioteca.com clickthru@timefreedom.com nantragod@earthlink.net invite@onlinenow.net hdn94-018.hil.compuserve.com zippydj@nevwest.com haniophile@ntr.net Offer@shire.com inetmktg@usa.net empower@empowerlabs.com info@dproducts.be dynamarket@vaprnet.com promotions@the-bookstore.com root@mail.icongrp.com healthy181@aol.com cashrewards@hotmail.com Success@paper.com tei@websecure.net bb77@wyoma.com removeadultinf +++++++++++++++++++++++++++ >From REPLACEME@loop.com (Vern Jensen) Date: Sun, 12 Apr 1998 17:13:03 -0800 Organization: Replace REPLACEME with Jensen to reply In article <6gr38e$62j@knot.queensu.ca>, 4gbds@qlink.queensu.ca (Shoemaker Garth B D) wrote: > Hello All, > I am having a problem with performance (code performance, that > is). I have to draw a matrix of 64x64 pixel images. There will either be > 6x6, 12x12, or 24x24 of them. I do this by drawing them to a backbuffer > and copying it over. I originally tried drawing a bunch of PICT resources > to the backbuffer. This proved to be very slow, even with only 6x6 of > them. I thought this was very strange, seeing as all I do is fillrect the > region I am going to draw in, set up a bunch of rects, draw PICTs in the > rects, and copy it to the main grafport. So, I tried doing it with CICNs, > I thought it might be faster. nope, no faster. > For reference, it takes roughly half a second to do the whole > draw/copy thing on my 040 25MHz. This seems ludicrously slow. Any tips? First of all, don't draw from a PICT or CICN. As you've discovered, this is very slow. Instead, you need to draw the PICT or CICN into a GWorld before starting the game, and then using CopyBits or CopyMask to do the drawing during the game. This will be much faster than CICNs or PICTs, but will still be slow. So the next step is to write a custom blitter. In other words, something that does the copying directly, using your own code, instead of QuickDraw. ("Quick" Draw ???) I'd suggest getting Tricks of the Mac Game Programming Gurus. It's a great book that covers all of this, plus a whole lot more. You should also check out some of the freely available animation libraries, like SpriteWorld and SAT (Sprite Animation Toolkit). SpriteWorld has the fastest scrolling engine around, and SAT 2.5 will have a very fast scrolling engine too. Oh - you can also check out MoofWars, downloadable from www.devworld.apple.com. (Sorry, you'll have to find it yourself.) It's a scrolling game that uses DrawSprocket, which demonstrates how to blit tiles very quickly, as well as how to draw RLE sprites. But read Tricks of the Mac Game Programming Gurus first! -Vern - ------------------------------------------------------------------- Replace the text REPLACEME in my email address with Jensen to reply. Visit the SpriteWorld 2 Web page at: http://users.aol.com/spritewld2/ - ------------------------------------------------------------------- +++++++++++++++++++++++++++ >From *johnnyc*@or.psychology.dal.ca (John Christie) Date: Tue, 21 Apr 1998 09:35:10 -0300 Organization: ISINet, Nova Scotia > So the next step is to write a custom blitter. In other words, something It depends on the speed after you get the first step done. don't do anything non standard that you don't have to. Come back to the list after drawing your PICTS offscreen in advance and then see if you need more speed. Not all machines will appreciate a custom blitter. For example, 7200s can see 50% speed benefits from CopyBits. Since you probably need to write both codes and switch between them after a brief test at the beginning of your program, start with CopyBits. -- You aren't free if you CAN choose - only if you DO choose. All you are is the decisions you make. Remove "*" and ohnny (i.e. jc@) to reply via email +++++++++++++++++++++++++++ >From Jens Bauer Date: Thu, 23 Apr 1998 00:32:47 +0200 Organization: Faster Software John Christie wrote: > > So the next step is to write a custom blitter. In other words, something > > It depends on the speed after you get the first step done. don't do > anything non standard that you don't have to. Come back to the list after > drawing your PICTS offscreen in advance and then see if you need more > speed. > Not all machines will appreciate a custom blitter. For example, 7200s > can see 50% speed benefits from CopyBits. Since you probably need to > write both codes and switch between them after a brief test at the > beginning of your program, start with CopyBits. Good point, but I'm not completely satisfied. Say, the stuff could be tested on a "slow" computer like the 7200. No need to write own routines for doing screen-optimising. However... Don't forget, there are slower machines out there, the 6200 and 6100 should be brought into mind too, as well as the older PowerBooks. An idea on how to determine which routine should be defaulted: measure the speed of CopyBits with mftbr (PPC instruction, pretty precise) measure the speed of your custom routine. If CopyBits is MUCH slower than your custom routine, select the custom routine as DEFAULT. Allow the user to change this setting, before the routine is used, for instance, in a dialog before the game starts. To see if the custom routine does the job correctly, it could be tested on 2 offscreen worlds, and these 2 buffers could be then be compared. If the results are different, use CopyBits. This is a pretty safe way, and should really be considered, even if you think you know what you're doing.. -WoF- --------------------------- >From leon@daimi.aau.dk (Leon Mortensen) Subject: Drawing pictures with non-rect. shapes Date: 21 Apr 1998 14:17:56 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University I looking for some help on drawing parts of pictures from 'PICT' resources. For example having a picture and an oval mask and just painting the stuff in the oval part of the picture. Is it possible to use CopyBits, CopyMask,... which are using BitMap's. And how? Any freedback is appreciated. Preferrable with some sourcecode. Thanks all, Leon +++++++++++++++++++++++++++ >From sam@NOSPAMa2b.com.au (Sam Vaughan) Date: Wed, 22 Apr 1998 09:40:29 +1000 Organization: A2B Telecommunications In article <6hi9qk$fr3$1@nf.aau.dk>, leon@daimi.aau.dk (Leon Mortensen) wrote: > I looking for some help on drawing parts of pictures from 'PICT' resources. > > For example having a picture and an oval mask and just painting the stuff in the oval part of the picture. > > Is it possible to use CopyBits, CopyMask,... which are using BitMap's. And how? > > Any freedback is appreciated. Preferrable with some sourcecode. > > Thanks all, > > Leon Leon, I don't have any code handy to post with this message, and I don't want to wing it, because there's no way I'd get it right! What I can do is describe the process for you. Copybits will do what you need. Copybits copies an image using a transfer mode you specify. I would suggest that you first copy your PICT into a GWorld using the source copy mode (normal mode). Next, fill another GWorld with white, and draw a solid black oval in the middle to create your mask. You will then need to copy just the white part of the mask into the first GWorld, which will blank out the parts of the PICT you don't want drawn to the screen. I can't tell you off-hand which transfer mode to use for this, but you'll find out pretty quickly with some experimentation and some Inside Macintosh browsing. Finally, copy to the screen using the transparent mode, which will only draw the non-white pixels on the screen. If you are drawing to a non-white area of the screen, things are a little harder, because white parts of your PICT that are inside the oval will need to be drawn. In this case, you'll have to draw a white oval to the screen before drawing your PICT there. I learnt this stuff while creating a scrolling credits About box - the best advice I have is to experiment. It won't take you too long, and it's quite good fun - you get pretty cool looking graphics as reward for your time, which is more than I can say for much of the daily grind! If you get stuck, mail me, and I'll dig out my code. I actually posted it here a while back in a scrolling about box text discussion, so you could probably find it at Deja News too. There's also source code for Metrowerks' CodeWarrior About Box on the CW CD, but it goes into far more detail than you'll probably need first off. Hope it comes together, Sam. Sam Vaughan ("`-''-/").___..--''"`-._ `6_ 6 ) `-. ( ).`-.__.`) samjv@NOSPAMrubix.com.au (_Y_.)' ._ ) `._ `. ``-..-' sam@NOSPAMa2b.com.au _..`--'_..-_/ /--'_.' ,' _________________________(il),-'' (li),' ((!.-' +++++++++++++++++++++++++++ >From freesoft@club.innet.be (Jean-Christophe Godart) Date: Fri, 24 Apr 1998 09:43:58 +0100 Organization: Free Soft S.A. In article <6hi9qk$fr3$1@nf.aau.dk>, leon@daimi.aau.dk (Leon Mortensen) wrote: > I looking for some help on drawing parts of pictures from 'PICT' resources. > > For example having a picture and an oval mask and just painting the stuff in the oval part of the picture. > > Is it possible to use CopyBits, CopyMask,... which are using BitMap's. And how? > > Any freedback is appreciated. Preferrable with some sourcecode. > > Thanks all, > > Leon Leon, Do something like: void DrawClippedPict(const Rect *ovalRect, const Rect *pictRect, PicHandle pict) { RgnHandle theRgn,oldClip,newClip; theRgn = NewRgn(); oldClip = NewRgn(); newClip = NewRgn(); GetClip(oldClip); OpenRgn(); PaintOval(ovalRect); /* it won't draw anything */ CloseRgn(theRgn); SectRgn(theRgn,oldClip,newClip); if(RectInRgn(pictRect, newClip)) { SetClip(newClip); DrawPicture(pict,pictRect); SetClip(oldClip); } DisposeRgn(theRgn); DisposeRgn(oldClip); DisposeRgn(newClip); } Jean-Christophe --------------------------- >From keith@nonspam-address.com (Keith Ledbetter) Subject: Launching a Browser with a URL Date: Thu, 16 Apr 1998 10:48:00 -0400 Organization: MindSpring Enterprises hi, all -- Does anyone out there have any examples of launching a Web browser from a Mac application to go to a specific Web URL? I've got lots of code to launch applications, apps associated with documents, etc...but this one has me perplexed Any help would be appreciated! Keith +++++++++++++++++++++++++++ >From dtp@pluto.njcc.com (David T. Pierson) Date: Thu, 16 Apr 1998 12:11:50 -0400 Organization: New Jersey Computer Connection, Lawrenceville, NJ keith wrote: > Does anyone out there have any examples of launching a Web browser from >a Mac application to go to a specific Web URL? I've got lots of code to >launch applications, apps associated with documents, etc...but this one >has me perplexed Any help would be appreciated! Call LaunchApplication and stuff a GURL event into the launchAppParameters field of the launch parameter block. Technote 1002: http://devworld.apple.com/technotes/tn/tn1002.html shows how to do this with an Open Documents event. It shouldn't be too hard to use a GURL event in the same way. A better way, IMHO, is to use Internet Config's ICLaunchUrl(). HTH, David +++++++++++++++++++++++++++ >From keith@nonspam-address.com (Keith Ledbetter) Date: Thu, 16 Apr 1998 13:08:44 -0400 Organization: MindSpring Enterprises In article , dtp@pluto.njcc.com says... > > Call LaunchApplication and stuff a GURL event into the launchAppParameters > field of the launch parameter block. > > http://devworld.apple.com/technotes/tn/tn1002.html > > shows how to do this with an Open Documents event. It shouldn't be too > hard to use a GURL event in the same way. > > A better way, IMHO, is to use Internet Config's ICLaunchUrl(). Thanks, David! I'll check it out :) Keith +++++++++++++++++++++++++++ >From hellman@ksan.ms.nwu.edu (Olof Hellman) Date: Thu, 16 Apr 1998 13:35:42 -0600 Organization: Northwestern University In article , keith@mindspring.com wrote: > hi, all -- > > Does anyone out there have any examples of launching a Web browser from > a Mac application to go to a specific Web URL? I've got lots of code to > launch applications, apps associated with documents, etc...but this one > has me perplexed Any help would be appreciated! > > Keith tell app "Netscape" GetURL "http://www.metrowerks.com" end tell +++++++++++++++++++++++++++ >From 4gbds@qlink.queensu.ca (Shoemaker Garth B D) Date: 18 Apr 1998 07:14:10 GMT Organization: Queen's University, Kingston Olof Hellman (hellman@ksan.ms.nwu.edu) wrote: : > hi, all -- : > : > Does anyone out there have any examples of launching a Web browser from : > a Mac application to go to a specific Web URL? I've got lots of code to : > launch applications, apps associated with documents, etc...but this one : > has me perplexed Any help would be appreciated! : > : > Keith : I've been wondering about this topic as well. Another question is: How do you tell which browsers the user has installed? Is there some way to find the user's default browser? Thanks, Garth +++++++++++++++++++++++++++ >From meeroh@mit.edu Date: Sat, 18 Apr 1998 04:31:27 -0400 Organization: MIT In article <6h9js2$due@knot.queensu.ca>, 4gbds@qlink.queensu.ca (Shoemaker Garth B D) wrote: >Olof Hellman (hellman@ksan.ms.nwu.edu) wrote: >: > hi, all -- >: > >: > Does anyone out there have any examples of launching a Web browser from >: > a Mac application to go to a specific Web URL? I've got lots of code to >: > launch applications, apps associated with documents, etc...but this one >: > has me perplexed Any help would be appreciated! >: > >: > Keith >: > >I've been wondering about this topic as well. Another question is: How do >you tell which browsers the user has installed? Is there some way to >find the user's default browser? > >Thanks, > Garth Use Internet Config. The documentation is at: Hth, meeroh -- "The last good thing written in C was Franz Schubert's Symphony number 9." Erwin Dieterich --------------------------- >From Kim Foo-Jones Subject: MacsBug an OS8.1 Date: Sat, 25 Apr 1998 18:41:17 +0000 Organization: (none) Since re-installing my system and upgrading to MacOS 8.1 I can't get Macsbug to install at start-up. I'm using version 6.5.3 but I heard someone mention 6.5.4 a while back... Does this exist and is it required for OS 8.1 - I couldn't find it on devworld. TIA, -Kim Foo-Jones +++++++++++++++++++++++++++ >From Tobias Peciva Date: Sat, 25 Apr 1998 20:05:14 +0200 Organization: Chalmers University of Technology, Sweden Kim Foo-Jones wrote: > Since re-installing my system and upgrading to MacOS 8.1 I can't get > Macsbug to install at start-up. I'm using version 6.5.3 but I heard > someone mention 6.5.4 a while back... Does this exist and is it required > for OS 8.1 - I couldn't find it on devworld. A version 6.5.4a3 can be downloaded from Apple's ftp sites. According to the OS 8.0 documentation, no earlier versions of MacsBug will work. - Tobias Peciva +++++++++++++++++++++++++++ >From Peter S Lau Date: 26 Apr 1998 07:43:29 -0400 Organization: Interlog Internet Services Tobias Peciva writes: > Kim Foo-Jones wrote: > > > Since re-installing my system and upgrading to MacOS 8.1 I can't get > > Macsbug to install at start-up. I'm using version 6.5.3 but I heard > > someone mention 6.5.4 a while back... Does this exist and is it required > > for OS 8.1 - I couldn't find it on devworld. > > A version 6.5.4a3 can be downloaded from Apple's ftp sites. According to > the OS 8.0 documentation, no earlier versions of MacsBug will work. The latest version of Macsbug is 6.5.4a4, it's also on CW Pro 3 CD. pete +++++++++++++++++++++++++++ >From Kim Foo-Jones Date: Sun, 26 Apr 1998 17:25:10 +0000 Organization: (none) > > > The latest version of Macsbug is 6.5.4a4, it's also on CW Pro 3 CD. > I don't seem to have received my CW Pro 3... Any word on a UK release? Anyway, thanks to you and Tobias for the hints - I'll check ftp.apple.com -Kim Foo-Jones --------------------------- >From Just van Rossum Subject: Macsbug for G3? Date: Sun, 12 Apr 1998 03:58:03 +0200 Organization: Letterror I don't know whether this is a naive question, but is there a version of Macsbug that works on a G3? If yes, where can I find/buy it? I tried to install version 6.5.3 (the latest I could find), but it does not seem to get loaded: if I hit cmd-powerkey, all I get is the little mini-monitor (or whatever it's called)... Thanks a lot in advance. Just +++++++++++++++++++++++++++ >From techren@techren.com (Edward Floden) Date: Sun, 12 Apr 1998 00:15:56 -0500 Organization: TechRen Enterprises In article <35301FAB.326E@letterror.com>, just@letterror.com wrote: >I don't know whether this is a naive question, but is there a version of >Macsbug that works on a G3? 6.5.4a4 is the current version. I think (don't quote me, though) that you can find it on Apple's sites, in the Unsupported directory. Better yet, go to Version Tracker and search for it there. I remember following the link from that site. Ed. -- Edward Floden TechRen Enterprises C.W. McCall and Other Wild Places +++++++++++++++++++++++++++ >From hiking1@magicpubs.com (Michael) Date: Sun, 12 Apr 1998 17:17:48 -0700 Organization: Magic Publications > >I don't know whether this is a naive question, but is there a version of > >Macsbug that works on a G3? > > 6.5.4a4 is the current version. I think (don't quote me, though) that you > can find it on Apple's sites, in the Unsupported directory. Better yet, go > to Version Tracker and search for it > there. I remember following the link from that site. It should be on Apple's web site and you should be able to locate it with a find. I don't think it's in the Unsupported directory as it is an Apple product. -- In all matters of opinion, our adversaries are insane. -- Mark Twain --------------------------- >From heiko.panther@mni.fh-giessen.de (Heiko Panther) Subject: PPC instruction set overview needed Date: Tue, 21 Apr 1998 15:18:54 +0200 Organization: University of Giessen, Germany Hello. Does anyone here know where I can get docs on the PPC assebler instruction set? Thank you, Heiko +++++++++++++++++++++++++++ >From trumbull@cs.yale.edu (Ben Trumbull) Date: Tue, 21 Apr 1998 15:14:58 -0400 Organization: Yale University In article , nospam.pbaxter@assistivetech.com (me) wrote: > In article , > heiko.panther@mni.fh-giessen.de (Heiko Panther) wrote: > > > Hello. > > > > Does anyone here know where I can get docs on the PPC assebler > instruction set? > > > > Thank you, > > > > Heiko > Hi, > I would recommend the book "PowerPCÅ Microprocessor Developer's Guide" > written by John Bunda, Terence Potter & Robert Shadowen. The publisher is > Sams Publishing. This includes the 601, 603 and 604 microprocessors. "Optimizing PowerPC Code" by Gary Kacmarcik, everyone should own one. terminally curious, Ben ___________________________________________________________________ Benjamin Trumbull trumbull@cs.yale.edu Yale University You can't be in hell; you can still read your e-mail +++++++++++++++++++++++++++ >From heiko.panther@mni.fh-giessen.de (Heiko Panther) Date: Wed, 22 Apr 1998 00:26:03 +0200 Organization: University of Giessen, Germany In article , trumbull@cs.yale.edu (Ben Trumbull) wrote: > > > Does anyone here know where I can get docs on the PPC assebler > > instruction set? > > > > > I would recommend the book "PowerPCÅ Microprocessor Developer's Guide" > > written by John Bunda, Terence Potter & Robert Shadowen. The publisher is > > Sams Publishing. This includes the 601, 603 and 604 microprocessors. > > "Optimizing PowerPC Code" by Gary Kacmarcik, everyone should own one. Is there also some info available online? A short reference would be enough. Heiko +++++++++++++++++++++++++++ >From sam@NOSPAMa2b.com.au (Sam Vaughan) Date: Wed, 22 Apr 1998 09:43:58 +1000 Organization: A2B Telecommunications In article , heiko.panther@mni.fh-giessen.de (Heiko Panther) wrote: > In article , > trumbull@cs.yale.edu (Ben Trumbull) wrote: > > > > > Does anyone here know where I can get docs on the PPC assebler > > > instruction set? > Is there also some info available online? A short reference would be enough. > > Heiko Heiko, Check out the Motorola web site. They're very good with providing pdf documentation for their products. In particular, you'll find hefty user manuals for each PPC CPU there. http://www.mot.com Sam. Sam Vaughan ("`-''-/").___..--''"`-._ `6_ 6 ) `-. ( ).`-.__.`) samjv@NOSPAMrubix.com.au (_Y_.)' ._ ) `._ `. ``-..-' sam@NOSPAMa2b.com.au _..`--'_..-_/ /--'_.' ,' _________________________(il),-'' (li),' ((!.-' +++++++++++++++++++++++++++ >From Anders Ohlsson Date: Tue, 21 Apr 1998 18:54:35 +0200 Organization: substandard > > > > Does anyone here know where I can get docs on the PPC assebler > > > instruction set? http://www.mot.com/SPS/PowerPC/teksupport/teklibrary/ /A +++++++++++++++++++++++++++ >From O'NEEL Bruce Date: 22 Apr 1998 11:06:51 +0200 Organization: University of Geneva sam@NOSPAMa2b.com.au (Sam Vaughan) writes: > Check out the Motorola web site. They're very good with providing pdf > documentation for their products. In particular, you'll find hefty user > manuals for each PPC CPU there. > > http://www.mot.com > And they used to have a way that you could fill out a form and they would mail you the paper books. Quite nice. Note that at the time I was in the US. cheers bruce -- Bruce O'Neel phone: +41 22 950 91 22 (direct) INTEGRAL Science Data Centre +41 22 950 91 00 (switchb.) Chemin d'Ecogia 16 fax: +41 22 950 91 33 CH-1290 VERSOIX e-mail: Bruce.Oneel@obs.unige.ch Switzerland WWW: http://obswww.unige.ch/isdc/ --------------------------- End of C.S.M.P. Digest **********************