home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / csmpdigest / csmp-digest-v3-010 < prev    next >
Text File  |  2010-09-21  |  54KB  |  1,432 lines

  1. Received-Date: Thu, 7 Apr 1994 12:50:15 +0200
  2. From: pottier@clipper.ens.fr (Francois Pottier)
  3. Subject: csmp-digest-v3-010
  4. To: csmp-digest@ens.fr
  5. Date: Thu, 7 Apr 94 12:50:06 MET DST
  6. X-Mailer: ELM [version 2.3 PL11]
  7. Errors-To: listman@ens.fr
  8. Reply-To: pottier@clipper.ens.fr
  9. X-Sequence: 12
  10.  
  11. C.S.M.P. Digest             Thu, 07 Apr 94       Volume 3 : Issue 10
  12.  
  13. Today's Topics:
  14.  
  15.         *Simple* CopyMask question
  16.         C-C++ public domain compiler
  17.         Code Fragment Loader and VM
  18.         Code to rebuild desktop?
  19.         CodeWarrior features?
  20.         Graphic Elements release announcement
  21.         How to get Finder icon?
  22.         Porting Think C to CodeWarrior
  23.         Quickdraw GX Beta 3 fun
  24.         Spoofing a serial port
  25.         Using Think Pascal Library in SC++
  26.         rowBytes for the screen too big?
  27.  
  28.  
  29.  
  30. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  31. (pottier@clipper.ens.fr).
  32.  
  33. The digest is a collection of article threads from the internet newsgroup
  34. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  35. regularly and want an archive of the discussions.  If you don't know what a
  36. newsgroup is, you probably don't have access to it.  Ask your systems
  37. administrator(s) for details.  If you don't have access to news, you may
  38. still be able to post messages to the group by using a mail server like
  39. anon.penet.fi (mail help@anon.penet.fi for more information).
  40.  
  41. Each issue of the digest contains one or more sets of articles (called
  42. threads), with each set corresponding to a 'discussion' of a particular
  43. subject.  The articles are not edited; all articles included in this digest
  44. are in their original posted form (as received by our news server at
  45. nef.ens.fr).  Article threads are not added to the digest until the last
  46. article added to the thread is at least two weeks old (this is to ensure that
  47. the thread is dead before adding it to the digest).  Article threads that
  48. consist of only one message are generally not included in the digest.
  49.  
  50. The digest is officially distributed by two means, by email and ftp.
  51.  
  52. If you want to receive the digest by mail, send email to listserv@ens.fr
  53. with no subject and one of the following commands as body:
  54.     help                        Sends you a summary of commands
  55.     subscribe csmp-digest Your Name    Adds you to the mailing list
  56.     signoff csmp-digest            Removes you from the list
  57. Once you have subscribed, you will automatically receive each new
  58. issue as it is created.
  59.  
  60. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  61. Questions related to the ftp site should be directed to
  62. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  63. digest are available there.
  64.  
  65. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  66.  
  67.  
  68. -------------------------------------------------------
  69.  
  70. >From gk1@acpub.duke.edu (Gavin  Kistner)
  71. Subject: *Simple* CopyMask question
  72. Date: 21 Mar 1994 21:07:59 GMT
  73. Organization: Duke University; Durham, NC; USA
  74.  
  75.  
  76. I'm new to programming the mac (making my first) and want to use CopyMask
  77. to put a picture over a background with a non-square clip.
  78. The picture is stored as a 'PICT' resource, but CopyMask needs a BitMap
  79. (or pixMap for source or dest) record.  The placement is a one-shot
  80. deal...I've been trying to understand some serious SPRITE toolkits, but
  81. they're way too overkill and (I think) complex.
  82.  
  83. Can someone give me the simplest, even ineffecient, way to use CopyMask
  84. with 'PICT' resources.  I'm programming in C, if you want to show in
  85. source code :D
  86. Oh, and there are actually many pieces and masks to use...I can either
  87. keep them in one conglomerate picture or put each in its own
  88. resource...you tell me.
  89.  
  90. One other question - I've used Photoshop to create beautifully dithered
  91. 8-bit versions from the 24-bit originals, but when I tell PS to save the
  92. colormap it created, it makes some file that's all data fork...I want a
  93. 'clut' to set the palette up correctly, right?  Anyone know of an easy way
  94. to do this?  Or even a hard one?
  95.  
  96. Many thanks, and may God bless the Mac and especially its programmers!
  97.  
  98. - Gavin
  99.  
  100. PS My apologies if this appeared before...I tried to post it last night, but
  101. never was able to find my article.  Perhaps my newsreader is messed -
  102. perhaps it would be best if you could mail replies to me directly.
  103. gk1@acpub.duke.edu
  104. -- 
  105. This message brought to you by Gavin Kistner, aka The Rabid Yak, aka RabYak
  106. gk1@acpub.duke.edu   My experimental ftp server: alspaugh-2181.dorm.duke.edu
  107.  
  108. +++++++++++++++++++++++++++
  109.  
  110. >From Arsenault_C@msm.cdx.mot.com (Chris Arsenault)
  111. Date: Thu, 24 Mar 1994 12:26:29 -0500
  112. Organization: Motorola Codex
  113.  
  114. In article <2ml2bf$76l@news.duke.edu>, gk1@acpub.duke.edu (Gavin  Kistner)
  115. wrote:
  116.  
  117. > Can someone give me the simplest, even ineffecient, way to use CopyMask
  118. > with 'PICT' resources?
  119.  
  120. I'm assuming here that your 'PICT's are primarily pixel or paint images vs
  121. drawn (pict opcode) images. 
  122.  
  123. Grab a copy of Tony Myle's excellent SpriteWorld sprite library on
  124. sumex-aim or some of the other ftp archives.  There are a number of image
  125. functions provided in the utilities file that allow you to load pictures
  126. into GWorlds etc. This is a good starting point for what I describe below.
  127.  
  128. Draw your pict image in a paint program. Duplicate the file and convert it
  129. to a 1 bit (B&W) image. This is your mask bitmap.  Copy this into your
  130. resource file. Load the mask bitmap into a grafport (there is a function in
  131. the SpriteWorld utils that does this), then use this for your CopyMask
  132. operation, or alternately convert the bitmap mask into a region
  133. (BitmapToRegion) and use CopyBits with the maskRgn. 
  134.  
  135. There are a number of other ways to mask off images, but this should get
  136. you started.
  137.  
  138. > One other question - I've used Photoshop to create beautifully dithered
  139. > 8-bit versions from the 24-bit originals, but when I tell PS to save the
  140. > colormap it created, it makes some file that's all data fork...I want a
  141. > 'clut' to set the palette up correctly, right?  Anyone know of an easy way
  142. > to do this?  Or even a hard one?
  143.  
  144. There is a problem with how color information is exchanged when working
  145. with various paint programs. (Images that are copied into a ResEdit PICT do
  146. not retain the correct palette that the paint program uses, but use the
  147. system palette instead)  I'll assume that you are using PS to save the
  148. image as a PICT resource so you should be okay. Do a GetPicture to obtain
  149. the PicHandle, then use the Picture Utilities call GetPictInfo().  This
  150. will return all the information you could need about the picture, including
  151. a CTabHandle (the color table for the picture). The GetPictInfo also
  152. returns a palette. If you assign this palette to the window you're going to
  153. display your picture in, you'll get the correct picture colors in the
  154. window instead of the approximations the Palette Manager provides.
  155.  
  156. Have fun!
  157.  Chris
  158. -- 
  159. #include <UsualLegalDisclaimers.h>
  160.  
  161. ---------------------------
  162.  
  163. >From giac@ada.dei.unipd.it (Giovanni Iachello 366675/IF)
  164. Subject: C-C++ public domain compiler
  165. Date: Mon, 14 Mar 1994 11:55:05 GMT
  166. Organization: B.B.B - Universita' di Padova, Italia
  167.  
  168. does anybody know where to find a public domain C/C++ compiler for the
  169. MAc? Maybe the GNU compiler?
  170.  
  171. Thank you!
  172. giac@maya.dei.unipd.it
  173.  
  174.  
  175. +++++++++++++++++++++++++++
  176.  
  177. >From arentz@batcave.knoware.nl (Stefan Arentz)
  178. Date: Sun, 20 Mar 1994 13:04:42 GMT
  179. Organization: Knoware
  180.  
  181. In article <CMnL3v.95q@dei.unipd.it>, giac@ada.dei.unipd.it (Giovanni
  182. Iachello 366675/IF) wrote:
  183.  
  184. > does anybody know where to find a public domain C/C++ compiler for the
  185. > MAc? Maybe the GNU compiler?
  186. > Thank you!
  187. > giac@maya.dei.unipd.it
  188.  
  189. On the MacHack '93 CD, there is a GNU 2.3.3 C and C++ compiler. You need
  190. MPW to use it though...
  191.  
  192. -- Stefan
  193.  
  194. - -----------------------------------------------------------------------
  195. Stefan Arentz          -- Software Constructor --       arentz@knoware.nl
  196.  
  197. +++++++++++++++++++++++++++
  198.  
  199. >From holiday@bnr.ca (Matthew Holiday)
  200. Date: 21 Mar 1994 15:20:47 GMT
  201. Organization: Bell-Northern Research, Richardson, TX
  202.  
  203. In article <arentz-200394150442@batcave.knoware.nl>, arentz@batcave.knoware.nl (Stefan Arentz) writes:
  204. -> In article <CMnL3v.95q@dei.unipd.it>, giac@ada.dei.unipd.it (Giovanni
  205. -> Iachello 366675/IF) wrote:
  206. -> 
  207. -> > does anybody know where to find a public domain C/C++ compiler for the
  208. -> > MAc? Maybe the GNU compiler?
  209. -> > 
  210. -> > Thank you!
  211. -> > giac@maya.dei.unipd.it
  212. -> 
  213. -> On the MacHack '93 CD, there is a GNU 2.3.3 C and C++ compiler. You need
  214. -> MPW to use it though...
  215.  
  216. Where can one obtain this CD?  And how much does it cost?
  217.  
  218. -- 
  219. Matt Holiday                                  #include <std/disclaimer>
  220. holiday@bnr.ca
  221. BNR Richardson, TX            "Proud owner of an unregistered computer"
  222.  
  223. +++++++++++++++++++++++++++
  224.  
  225. >From shebs@cygnus.com (Stan Shebs)
  226. Date: Mon, 21 Mar 1994 18:26:24 GMT
  227. Organization: /cygint/s1/users/shebs/.organization
  228.  
  229.  
  230. In article <2mke0f$cqr@crchh327.bnr.ca> holiday@bnr.ca (Matthew Holiday) writes:
  231.  
  232.    -> On the MacHack '93 CD, there is a GNU 2.3.3 C and C++ compiler. You need
  233.    -> MPW to use it though...
  234.  
  235.    Where can one obtain this CD?  And how much does it cost?
  236.  
  237. There is also a slightly more up-to-date version of 2.3.3 on
  238. ftp.atg.apple.com.  Neither version is totally usable however,
  239. since they have some bugs in code generation for Pascal-declared
  240. functions.  With care, you might be able to use it, but don't cry
  241. too loudly if the object code crashes and takes your machine with it.
  242.  
  243. At this point, I've abandoned the 2.3.3 port and am starting over with
  244. a different strategy for 2.5.x, involving very few MPW-Assembler-specific
  245. hacks and a *real* cross-compilation setup (i.e. sit on a Sun and produce
  246. a Mac executable, resources, fat binary, etc as desired).
  247.  
  248.                             Stan Shebs
  249.                             Cygnus Support
  250.                             shebs@cygnus.com
  251.  
  252. +++++++++++++++++++++++++++
  253.  
  254. >From holiday@bnr.ca (Matthew Holiday)
  255. Date: 22 Mar 1994 14:47:05 GMT
  256. Organization: Bell-Northern Research, Richardson, TX
  257.  
  258. In article <SHEBS.94Mar21102624@andros.cygnus.com>, shebs@cygnus.com (Stan Shebs) writes:
  259. -> 
  260. -> In article <2mke0f$cqr@crchh327.bnr.ca> holiday@bnr.ca (Matthew Holiday) writes:
  261. -> 
  262. ->    -> On the MacHack '93 CD, there is a GNU 2.3.3 C and C++ compiler. You need
  263. ->    -> MPW to use it though...
  264. -> 
  265. ->    Where can one obtain this CD?  And how much does it cost?
  266. -> 
  267. -> There is also a slightly more up-to-date version of 2.3.3 on
  268. -> ftp.atg.apple.com.  Neither version is totally usable however,
  269. -> since they have some bugs in code generation for Pascal-declared
  270. -> functions.  With care, you might be able to use it, but don't cry
  271. -> too loudly if the object code crashes and takes your machine with it.
  272. -> 
  273. -> At this point, I've abandoned the 2.3.3 port and am starting over with
  274. -> a different strategy for 2.5.x, involving very few MPW-Assembler-specific
  275. -> hacks and a *real* cross-compilation setup (i.e. sit on a Sun and produce
  276. -> a Mac executable, resources, fat binary, etc as desired).
  277.  
  278. That's neat, but all I want to do is compile MPW tools under MPW, using C++
  279. instead of C.
  280.  
  281. Thanks for 2.3.3 -- I'm going to try building that tonight.  Does the C++
  282. front end part of 2.3.3 work, or am I stuck with Apple's port of CFront 2.1?
  283.  
  284. -- 
  285. Matt Holiday                                  #include <std/disclaimer>
  286. holiday@bnr.ca
  287. BNR Richardson, TX            "Proud owner of an unregistered computer"
  288.  
  289. +++++++++++++++++++++++++++
  290.  
  291. >From shebs@cygnus.com (Stan Shebs)
  292. Date: Tue, 22 Mar 1994 21:57:02 GMT
  293. Organization: /cygint/s1/users/shebs/.organization
  294.  
  295. In article <2mn0d9$8k3@crchh327.bnr.ca> holiday@bnr.ca (Matthew Holiday) writes:
  296.  
  297.    That's neat, but all I want to do is compile MPW tools under MPW, using C++
  298.    instead of C.
  299.  
  300.    Thanks for 2.3.3 -- I'm going to try building that tonight.  Does the C++
  301.    front end part of 2.3.3 work, or am I stuck with Apple's port of CFront 2.1?
  302.  
  303. Although I haven't tried it lately, "cc1plus" has been observed to build
  304. and run under MPW.  However, it won't generate code that will link with any
  305. MPW C++ libraries (different name mangling).  You would have to recompile
  306. any and all libraries from source code, then work out a way to run static
  307. constructors and destructors, and do many other weird and obscure bits of
  308. work.  Might take a couple weeks of dinking around.  Note also that the
  309. dialect of C++ is different than what you would get with CFront 2.1, or
  310. even the latest (2.5.8) version of GCC.
  311.  
  312.                             Stan Shebs
  313.                             Cygnus Support
  314.                             shebs@cygnus.com
  315.  
  316.  
  317. +++++++++++++++++++++++++++
  318.  
  319. >From holiday@bnr.ca (Matthew Holiday)
  320. Date: 23 Mar 1994 20:48:57 GMT
  321. Organization: Bell-Northern Research, Richardson, TX
  322.  
  323. In article <SHEBS.94Mar22135702@andros.cygnus.com>, shebs@cygnus.com (Stan Shebs) writes:
  324. -> In article <2mn0d9$8k3@crchh327.bnr.ca> holiday@bnr.ca (Matthew Holiday) writes:
  325. -> 
  326. ->    That's neat, but all I want to do is compile MPW tools under MPW, using C++
  327. ->    instead of C.
  328. -> 
  329. ->    Thanks for 2.3.3 -- I'm going to try building that tonight.  Does the C++
  330. ->    front end part of 2.3.3 work, or am I stuck with Apple's port of CFront 2.1?
  331. -> 
  332. -> Although I haven't tried it lately, "cc1plus" has been observed to build
  333. -> and run under MPW.  However, it won't generate code that will link with any
  334. -> MPW C++ libraries (different name mangling).  You would have to recompile
  335. -> any and all libraries from source code, then work out a way to run static
  336. -> constructors and destructors, and do many other weird and obscure bits of
  337. -> work.  Might take a couple weeks of dinking around.  Note also that the
  338. -> dialect of C++ is different than what you would get with CFront 2.1, or
  339. -> even the latest (2.5.8) version of GCC.
  340.  
  341. Good points.  I really hadn't thought about name mangling conventions.  It's
  342. probably more effort than I've got to put into it to make it work with MPW.
  343.  
  344. I haven't heard anything from Apple/APDA about planned improvements to MPW
  345. C++ (i.e., supporting a later version of the C++ language), so I guess I'll
  346. just keep doing tools in C.  Or switch to a Unix machine....
  347.  
  348. -- 
  349. Matt Holiday                                  #include <std/disclaimer>
  350. holiday@bnr.ca
  351. BNR Richardson, TX            "Proud owner of an unregistered computer"
  352.  
  353. ---------------------------
  354.  
  355. >From Willie Rauchwerger <willie-rauchwerger@uokhsc.edu>
  356. Subject: Code Fragment Loader and VM
  357. Date: 17 Mar 1994 19:53:35 GMT
  358. Organization: OU Health Sciences Center
  359.  
  360. Here is a dumb question...
  361.  
  362. Why does your application memory requirement decrease on native PPC
  363. apps when virtual memory is turned on?
  364.  
  365. - -----------------------------------------------------------------
  366. Willie Rauchwerger         AppleLink: Willie
  367. Telemedicine Software Guy  Internet:  willie-rauchwerger@uokhsc.edu
  368. OU Health Sciences Center
  369.  
  370. +++++++++++++++++++++++++++
  371.  
  372. >From rang@winternet.mpls.mn.us (Anton Rang)
  373. Date: 19 Mar 1994 02:01:14 GMT
  374. Organization: Minnesota Angsters
  375.  
  376. In article <2macfv$7iv@romulus.ucs.uoknor.edu> Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  377. >Here is a dumb question...
  378.  
  379.   Actually, it's not a dumb question.  :-)
  380.  
  381. >Why does your application memory requirement decrease on native PPC
  382. >apps when virtual memory is turned on?
  383.  
  384.   When virtual memory is turned on, an application's code (as well as
  385. that of any shared libraries it uses) is mapped into high memory,
  386. rather than being loaded into the application heap.  Because this
  387. high-memory area doesn't correspond to real RAM, the program doesn't
  388. need any memory to be allocated for its code.
  389. --
  390. Anton Rang (rang@winternet.mpls.mn.us)
  391.  
  392. +++++++++++++++++++++++++++
  393.  
  394. >From peirce@outpost.SF-Bay.org (Michael Peirce)
  395. Date: Wed, 23 Mar 94 21:09:25 PST
  396. Organization: Peirce Software, Inc.
  397.  
  398.  
  399. In article <2macfv$7iv@romulus.ucs.uoknor.edu> (comp.sys.mac.programmer), Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  400. > Here is a dumb question...
  401. > Why does your application memory requirement decrease on native PPC
  402. > apps when virtual memory is turned on?
  403.  
  404. No CODE resources get loaded into your heap.  With VM turned on, your
  405. code (from the data fork) is paged into its own memory area as needed
  406. (and it never gets paged back to disk since it's read only, it can
  407. always be read back from the data fork).
  408.  
  409.  
  410. -- Michael Peirce        -- peirce@outpost.sf-bay.org
  411. -- Peirce Software, Inc. -- 719 Hibiscus Place, Suite 301
  412. --                       -- San Jose, California USA 95117
  413. -- Makers of: Smoothie & -- voice: +1.408.244.6554 fax: +1.408.244.6882
  414. --    Peirce Print Tools -- AppleLink: peirce & America Online: AFC Peirce
  415.  
  416. ---------------------------
  417.  
  418. >From martinher@urvax.urich.edu
  419. Subject: Code to rebuild desktop?
  420. Date: Tue, 22 Mar 1994 18:46:44 GMT
  421. Organization: University of Richmond
  422.  
  423. Does anyone have a pointer to source code (C/C++ preferred) to rebuild
  424. the desktop?
  425.  
  426. Herb Martin 
  427. martinher@urvax.urich.edu
  428.  
  429. +++++++++++++++++++++++++++
  430.  
  431. >From leonardr@netcom.com (Leonard Rosenthol)
  432. Date: Thu, 24 Mar 1994 18:53:07 GMT
  433. Organization: Aladdin Systems, Inc.
  434.  
  435. In article <1994Mar22.184329.22097@gossip.urich.edu>,
  436. martinher@urvax.urich.edu wrote:
  437.  
  438. > Does anyone have a pointer to source code (C/C++ preferred) to rebuild
  439. > the desktop?
  440. >  
  441.    It is IMPOSSIBLE for an application to do the rebuild itself since most
  442. of the contents of the Desktop File are undocumented. 
  443.  
  444.    What you can do is to ask the Finder to quit (via Apple events), delete
  445. the DTDB files yourself, and the relaunch the Finder.  At that point the
  446. Finder will rebuild the DTDB for you.
  447.  
  448. Leonard
  449. - ------------------------------------------------------------------------
  450. Leonard Rosenthol                      Internet:       leonardr@netcom.com
  451. Director of Advanced Technology        AppleLink:      MACgician
  452. Aladdin Systems, Inc.                  GEnie:          MACgician
  453.  
  454. ---------------------------
  455.  
  456. >From mdiamond@gradient.cis.upenn.edu (Matthew T Diamond)
  457. Subject: CodeWarrior features?
  458. Date: 23 Mar 1994 19:56:35 GMT
  459. Organization: University of Pennsylvania
  460.  
  461.  
  462. I know; every coupla days someone wants to know if
  463. CodeWarrior supports feature X.
  464.  
  465. But I AM very curious about it.  Is there any online
  466. information available that summarizes the whole thing?
  467. I would like to learn more about the editing environment,
  468. as well as what tools it comes with, how good is the code,
  469. what debugging is like, etc.  (Yes, I know it's still alpha or beta)
  470.  
  471. Presumably some kind of promotional text was written up
  472. somewhere?  It might answer my own and other folks' questions.
  473.  
  474. Matt
  475. mdiamond@gradient.cis.upenn.edu
  476.  
  477. ps. On a related note, I noticed that Symantec 7.0 press releases
  478. didn't mention improvements to the editor.  Did I miss something??
  479.  
  480. +++++++++++++++++++++++++++
  481.  
  482. >From mwron@aol.com (MW Ron)
  483. Date: 23 Mar 1994 17:15:03 -0500
  484. Organization: America Online, Inc. (1-800-827-6364)
  485.  
  486. In article <2mq6tj$abe@netnews.upenn.edu>, mdiamond@gradient.cis.upenn.edu
  487. (Matthew T Diamond) writes:
  488. >Is there any online information available that summarizes the whole thing?
  489.  
  490.  
  491. a bit of background on Metrowerks:
  492.  
  493. Metrowerks has been developing and selling  academic computer language
  494. products since 1988 and has registered users in 26 countries.
  495.  
  496. On January 5th, 1994, Metrowerks introduced Metrowerks CodeWarrior, a
  497. completely new, very powerful development environment for C/C++ and Pascal on
  498. either 68K Macintosh or the new PowerMacintosh.
  499.  
  500. Metrowerks CodeWarrior contains very fast, state-of-the-art compiler
  501. technology that builds your products faster than any other development
  502. environment on Macintosh. CodeWarrior also is compatible with MPW C/C++
  503. source code and both MacApp 3.1 and the TCL have been successfully compiled
  504. with CodeWarrior since introduction. It is currently in use in most of the
  505. major software companies worldwide to port their products to the new
  506. PowerMacintosh.
  507.  
  508. Also included on the CodeWarrior CD is PowerPlant, our new application
  509. framework, written by Greg Dow, the orginal architect of the Think Class
  510. Library.
  511.  
  512.  
  513. Metrowerks business hours are (EST):
  514.  
  515. Monday to Friday, 9 AM to 5 PM.
  516.  
  517. Address:
  518.  
  519. In the USA
  520. Metrowerks, Inc
  521. The Trimex Building
  522. Route 11, Mooers NY
  523. 12958
  524.  
  525. Canada and International
  526. Metrowerks, Inc
  527. 1500 Du College, Suite 300
  528. St-Laurent, QC
  529. H4L 5G6
  530.  
  531. Other electronic addresses:
  532.  
  533. support@metrowerks.ca
  534. sales@metrowerks.ca
  535. MWRON@AOL.COM
  536.  
  537. Tel:  (514) 747-5999
  538. Fax:  (514) 747-2822
  539.  
  540.  
  541.  
  542.  
  543. +++++++++++++++++++++++++++
  544.  
  545. >From jwbaxter@olympus.net (John W. Baxter)
  546. Date: Thu, 24 Mar 1994 15:10:58 -0800
  547. Organization: Internet for the Olympic Peninsula
  548.  
  549. In article <2mq6tj$abe@netnews.upenn.edu>, mdiamond@gradient.cis.upenn.edu
  550. (Matthew T Diamond) wrote:
  551.  
  552. > I know; every coupla days someone wants to know if
  553. > CodeWarrior supports feature X.
  554. > But I AM very curious about it.  Is there any online
  555. > information available that summarizes the whole thing?
  556. > I would like to learn more about the editing environment,
  557. > as well as what tools it comes with, how good is the code,
  558. > what debugging is like, etc.  (Yes, I know it's still alpha or beta)
  559.  
  560. MacTech magazine has had several articles recently about CodeWarrior. 
  561. *Should* be available at your library, but with budgets the way they are
  562. these days, who knows.  [MacTech is also a convenient place to buy
  563. CodeWarrior.  That does not seem (to this outsider) to have affected the
  564. articles.]
  565.  
  566. Frameworks magazine has, I think, had one or two, also.  Harder to find.
  567.  
  568. Both "MacTech" and "develop" are essential parts of one's Macintosh
  569. developer closet, IMHO.
  570. -- 
  571. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  572.    jwbaxter@pt.olympus.net
  573.  
  574. ---------------------------
  575.  
  576. >From al@crucible.powertools.com (Al Evans)
  577. Subject: Graphic Elements release announcement
  578. Date: 23 Mar 94 15:41:54 GMT
  579. Organization: PowerTools, Austin, Texas
  580.  
  581.  
  582. I am pleased to announce the net release of Graphic Elements. 
  583. Graphic Elements is a new paradigm for implementing high-performance
  584. interactive computer graphics in a framework-independent (and, 
  585. potentially, platform-independent) manner. The Graphic Elements 
  586. system is modular and extensible, and individual Graphic Elements
  587. can be re-used in new applications by simple inclusion.
  588.  
  589. This release is available from mac.archive.umich.edu and its mirrors 
  590. in the file:
  591.  
  592.     /mac/misc/demo/graphicelementsdemo.sit.hqx
  593.  
  594. I do not know why they put it in the demo area, since it is a 
  595. completely functional version including linkable library and
  596. examples with source code (Think C 6.0). Note: I do ask a
  597. fee for the "registered shareware version", which includes
  598. an additional code module to speed up the graphics, a linkable
  599. MPW library, source for a TCL pane, and source for a MacApp view.
  600.  
  601. Here are some excerpts from the Graphic Elements README file:
  602.  
  603. [begin excerpts]
  604.  
  605. Graphic Elements is a very general, high-performance, framework-
  606. independent graphics presentation system. It offers graphic performance 
  607. comparable to that of a "sprite animation" system. At the same time, it 
  608. affords a very flexible mechanism for defining what a graphic is and does. 
  609. Anything that can be drawn on the screen can be a Graphic Element.
  610.  
  611. ...the Graphic Elements system is completely "legal". Any normal 
  612. Macintosh window can contain a Graphic Elements "world".
  613.  
  614. >From the viewpoint of the application programmer, a Graphic Element is
  615. an independent software object which knows how to image itself on
  616. demand into an offscreen workspace. Each Graphic Element may optionally
  617. have ways of reacting to 1) the passage of time, 2) contact with
  618. another Graphic Element, and 3) the user's actions. These methods will
  619. be called automatically by the Graphic Elements system, as required. In
  620. addition, the application program can act on Graphic Elements explicitly
  621. at any time.
  622.  
  623. After initialization, the application (or the view or pane object, if 
  624. a class library is being used) needs only two calls to the Graphic 
  625. Elements system to run a window full of animated graphics.
  626.  
  627. ...the Graphic Elements system allows any graphic to be defined as a 
  628. Graphic Element.
  629.  
  630. ...scenes can easily be moved from one program to another by simply 
  631. including them in the new program and calling their initialization 
  632. routines.
  633.  
  634. The same Graphic Elements "scene" source can [...] be compiled under 
  635. MPW C or C++, Think C 6.0, and Symantec C++. The compiled code can be 
  636. utilized from a normal application or from one based on the MacApp 
  637. or TCL class libraries.
  638.  
  639. [end excerpts]
  640.  
  641. If you're still with me, thank you for your attention.
  642.  
  643.                     --Al Evans--
  644. -- 
  645.  
  646. Al Evans                         Tu causes, tu causes
  647. al@crucible.powertools.com               C'est tout ce que tu sais faire
  648. cs.utexas.edu!crucible!al                     -- LaVerdure
  649.  
  650. ---------------------------
  651.  
  652. >From Steve Barrera <barrera@vt.edu>
  653. Subject: How to get Finder icon?
  654. Date: 23 Mar 1994 16:37:33 GMT
  655. Organization: Computing Center
  656.  
  657.  
  658. I want to make a call to the standard get file dialog, then extract 
  659. the Finder icon associated with the selected file and put it in a window.
  660. I can't find a hint anywhere in Inside Mac:Files as to how to do this.
  661. Anyone have a clue?
  662.  
  663. Steve Barrera
  664. barrera@vt.edu
  665.  
  666. +++++++++++++++++++++++++++
  667.  
  668. >From E.J. Draper <utmdacc@odin.mda.uth.tmc.edu>
  669. Date: 23 Mar 1994 17:06:04 GMT
  670. Organization: U.T.M.D. Anderson Cancer Center
  671.  
  672. In article <2mpr8d$9nr@solaris.cc.vt.edu> Steve Barrera, barrera@vt.edu
  673. writes:
  674. >I can't find a hint anywhere in Inside Mac:Files as to how to do this.
  675. >Anyone have a clue?
  676.  
  677.  
  678. Here!s a little snippet.  The main call you!re looking for is
  679. PBDTGetIcon().  
  680.  
  681. PBDTGetIcon() is only available on volumes that use the System 7 desktop
  682. manager scheme.
  683.  
  684.  
  685.  
  686.  
  687.     clearbytes(&DTDBparamBlock,longsizeof(DTDBparamBlock));
  688.  
  689.     DTDBparamBlock.ioVRefNum = volrefnum;
  690.  
  691.     DTDBparamBlock.ioNamePtr = nil;
  692.  
  693.     if (PBDTGetPath(&DTDBparamBlock) == noErr)
  694.     {
  695.         if (DTDBparamBlock.ioDTRefNum == 0)
  696.         {
  697.             return nil;
  698.         }
  699.         
  700.         icondata = NewPtrClear(kLarge8BitIconSize);
  701.         
  702.         if (icondata == nil)
  703.             {
  704.                 return nil;
  705.             }
  706.             
  707.         DTDBparamBlock.ioDTReqCount = kLarge8BitIconSize;
  708.         
  709.         DTDBparamBlock.ioDTBuffer = icondata;
  710.         
  711.         DTDBparamBlock.ioIconType = kLarge8BitIcon;
  712.         
  713.         DTDBparamBlock.ioFileCreator = Creator;
  714.         
  715.         DTDBparamBlock.ioFileType = Type;
  716.         
  717.         Err = PBDTGetIcon(&DTDBparamBlock,false);
  718.         
  719.         if (Err == afpItemNotFound)
  720.             {
  721.                 DisposePtr(icondata);
  722.                 
  723.                 icondata = nil;
  724.  
  725.                 thePic = dogenericdocicon();
  726.                 
  727.                 if (thePic != nil)
  728.                 {
  729.                     return thePic;
  730.                 }
  731.                 
  732.                 return nil;
  733.             }
  734.  
  735.  
  736.       |E|J-  ED DRAPER
  737.  rEpar|D|<-  Radiologic/Pathologic Institute
  738.              The University of Texas M.D. Anderson Cancer Center
  739.              draper@utmdacc.mda.uth.tmc.edu
  740.  
  741. ---------------------------
  742.  
  743. >From tchan@irus.rri.uwo.ca (Thomas KC Chan)
  744. Subject: Porting Think C to CodeWarrior
  745. Date: 22 Mar 1994 21:57:21 GMT
  746. Organization: Imaging Labs, Robarts Research Institute, London
  747.  
  748.  
  749. I am porting my programs from Think C to CodeWarrior.  Right now I
  750. am just testing the 68K port.  The programs works...but...
  751.  
  752.    1. when I time my program speed using clock(), the program gives
  753.       me a big ellapse time.  It turns out that the constant CLOCKS_PER_SEC
  754.       is declared as (_CPS which is) 1.  I check with Think C and find 
  755.       that it has CLOCKS_PER_SEC declared as 60.  ???
  756.  
  757.    2. My program generates output for a line counter using ANSI printf.
  758.       Everything I use "\r" to overwrite the previous value. It works
  759.       in Think C.  But in CodeWarrior, the output would go to SIOUX. And
  760.       seemingly the "\r" character is treated as a new-line char.  ???
  761.  
  762.  
  763. Any one knows any fix to my problems?  Are patches needed for my
  764. CodeWarrior (Gold) compiler?  
  765.  
  766. I find the on-line ref. manual does not provide enough details 
  767. (like PowerPC's PEF [what is it anyways???]) Is there any doc 
  768. available on s/w porting to PowerPC?
  769.  
  770.  
  771.  
  772. Thomas Chan                   email: tchan@irus.rri.uwo.ca
  773.  
  774. +++++++++++++++++++++++++++
  775.  
  776. >From mlevy@csr.uvic.ca (Michael Levy)
  777. Date: Wed, 23 Mar 94 13:38:46 GMT
  778. Organization: University of Victoria
  779.  
  780. In Article <2mnpk1$8ol@falcon.ccs.uwo.ca>, tchan@irus.rri.uwo.ca (Thomas KC
  781. Chan) wrote:
  782. >
  783. >I am porting my programs from Think C to CodeWarrior.  Right now I
  784. >am just testing the 68K port.  The programs works...but...
  785. >
  786. >   1. when I time my program speed using clock(), the program gives
  787. >      me a big ellapse time.  It turns out that the constant CLOCKS_PER_SEC
  788. >      is declared as (_CPS which is) 1.  I check with Think C and find 
  789. >      that it has CLOCKS_PER_SEC declared as 60.  ???
  790.  
  791. Yes, I found this too. Change #define _CPS 1 to #define _CPS 60
  792. in <yval.h>. (See item 2 in the bug-report below).
  793.  
  794. There were a couple of other bugs that I have reported to Metrowerks.
  795. There was no response from them, but I assume they
  796. will fix most of them in the next release. The most serious bug 
  797. (not included in the report) was with malloc - its supposed to take
  798. an unsigned long as its argument. Instead, it is treating its argument
  799. as a signed int. If you try to allocated more than 32,767 bytes, malloc
  800. will return NULL. (Actually, its a bit worse than this. It is taking the
  801. least significant 16 bits of its argument, and treating that as a signed
  802. int. If you pass a long that is larger than 32,767, but which happens to
  803. have a zero in bit 16, malloc will succeed, giving you much less storage
  804. than you think you received). I did phone tech-support about this bug,
  805. and they said that it would be fixed in their next releasw
  806. (apparantly being cut into CD as we spoke - about 2 or 3 weeks ago).
  807.  
  808. I do not know about your second problem, but here for your benefit,
  809. and for the benefit of anyone else trying a THINK C->Metroworks C port,
  810. is a copy of the message I sent them. Because of these problems
  811. (and, most notably, with the debuggers inability to evaluate
  812. expressions,) SYMANTEC still gets my vote as the ANSI C compiler
  813. of choice for the Mac. I haven't done any C++ programming on the
  814. Mac, so I am not entering the other debate.
  815.  
  816. Here is the bug report:
  817.  
  818. 1. In the <yval.h> file, you have
  819. #define _ILONG 1
  820. Shouldn't this be conditional, depending on the value
  821. of __FOURBYTEINTS__?
  822.  
  823. 2. In the same file,
  824. #define _CPS 1
  825. is wrong - shouldn't it be 60 on the Mac? I think its
  826. ticks-per-second to divide into the value returned
  827. by the ANSI function clock().
  828.  
  829. 3. SystemSevenOrLater seems to be defined as 0 instead of 1
  830. even though I am using system 7.1. I can't figure out how to change
  831. it, or find out where it is defined.
  832.  
  833. 4. I got the version 1.a -> 1.b updater. It changed Macheaders
  834. but not Macheaders.c What gives?
  835.  
  836. 5. The predefined names in the C manual (such as __mwerks__)
  837. are in lower-case. They should be in upper case.
  838.  
  839.  
  840. I also noticed some bugs in the debugger, most notably,
  841. in a case like this:
  842.  
  843. int t1,t2;
  844. ....
  845. t1 = 1000;
  846. t2 = 2000;
  847. ...
  848. the debugger showed the same values for t1 and t2, and
  849. changed them simultaneously!
  850.  
  851. While I am on the debugger, I would like to add an item
  852. to your wishlist. I like the overall structure of your debugger
  853. when compared with THINK C. However, for me it is crucial
  854. to be able to evaluate expressions in the debugger. For example,
  855. I have a horrible macro called TAG(X) defined like this:
  856. #define TAG(X) \
  857. ((!(heap[X]&1))?(heap[X]&3):((!(heap[X]&2))?(heap[X]&15):(heap[X]&63)))
  858.  
  859. THINK C's debugger lets me place the expression TAG(X) in the "data"
  860. window and see a value (like 1 or 63). I find this soooo useful.
  861. Please consider adding something similar. In fact, if I could
  862. coerce the result to an enum type and get the symbol instead of
  863. a number in the debugger, I would be ecstatic.
  864.  
  865. Good luck with your product.
  866.  
  867. +============================================+
  868. | Michael Levy                               |
  869. | Department of Computer Science             |
  870. | University of Victoria                     |
  871. | PO Box 3055 Victoria B.C.                  |
  872. | Canada V8W 3P6                             |
  873. | email: mlevy@csr.uvic.ca                   |
  874. | phone: (604) 721-7303                      |
  875. | fax: (604) 721-7292                        |  
  876. +============================================+
  877.  
  878. +++++++++++++++++++++++++++
  879.  
  880. >From johnmce@world.std.com (John McEnerney)
  881. Date: Thu, 24 Mar 1994 02:18:33 GMT
  882. Organization: The World Public Access UNIX, Brookline, MA
  883.  
  884. >int t1,t2;
  885. >....
  886. >t1 = 1000;
  887. >t2 = 2000;
  888. >...
  889. >the debugger showed the same values for t1 and t2, and
  890. >changed them simultaneously!
  891.  
  892. This is probably -not- a bug in the debugger. If the compiler can 
  893. determine that t1 and t2 will never be live simultaneously, it is free to 
  894. place them in the same register or memory location. In fact, it is free 
  895. to delete the assignments altogether if t1 and t2 are never used. (Unless 
  896. they are declared 'volatile')
  897.  
  898. >I have a horrible macro called TAG(X) defined like this:
  899. >#define TAG(X) \
  900. >((!(heap[X]&1))?(heap[X]&3):((!(heap[X]&2))?(heap[X]&15):(heap[X]&63)))
  901. >
  902. >THINK C's debugger lets me place the expression TAG(X) in the "data"
  903. >window and see a value (like 1 or 63). I find this soooo useful.
  904. >Please consider adding something similar. 
  905.  
  906. This will not be possible with our current debugger/compiler 
  907. architecture. THINK C is one of the only environments I've ever seen 
  908. which does this; it is a side-effect of the way the debugger works, which 
  909. is to call the compiler to evaluate the expression.
  910.  
  911. We will probably support some form of expression evaluation in the 
  912. debugger eventually (post-DR3) but it will probably not include macro 
  913. expansion.
  914.  
  915. -- John McEnerney, Metrowerks PowerPC Product Architect
  916.  
  917.  
  918. +++++++++++++++++++++++++++
  919.  
  920. >From tchan@irus.rri.uwo.ca (Thomas KC Chan)
  921. Date: 24 Mar 1994 16:46:07 GMT
  922. Organization: Imaging Labs, Robarts Research Institute, London
  923.  
  924.  
  925. Michael Levy, thanks you for sharing your list with us.
  926.  
  927.  
  928. In article <Cn5D2z.94F@world.std.com> johnmce@world.std.com (John McEnerney) writes:
  929. >>int t1,t2;
  930. >>....
  931. >>t1 = 1000;
  932. >>t2 = 2000;
  933. >>...
  934. >>the debugger showed the same values for t1 and t2, and
  935. >>changed them simultaneously!
  936. >
  937. >This is probably -not- a bug in the debugger. If the compiler can 
  938. >determine that t1 and t2 will never be live simultaneously, it is free to 
  939. >place them in the same register or memory location. In fact, it is free 
  940. >to delete the assignments altogether if t1 and t2 are never used. (Unless 
  941. >they are declared 'volatile')
  942.  
  943. As a high-level language programmer, I don't think I have to worry 
  944. about which register is assigned to which variable.
  945.  
  946. If this happens only when certain optimization option is on, then it is not
  947. a bug; otherwise it definitely is a bug!  Can Michael verify this?
  948.  
  949.  
  950. >>I have a horrible macro called TAG(X) defined like this:
  951. >>#define TAG(X) \
  952. >>((!(heap[X]&1))?(heap[X]&3):((!(heap[X]&2))?(heap[X]&15):(heap[X]&63)))
  953. >>
  954. >>THINK C's debugger lets me place the expression TAG(X) in the "data"
  955. >>window and see a value (like 1 or 63). I find this soooo useful.
  956. >>Please consider adding something similar. 
  957. >
  958. >This will not be possible with our current debugger/compiler 
  959. >architecture. THINK C is one of the only environments I've ever seen 
  960. >which does this; it is a side-effect of the way the debugger works, which 
  961. >is to call the compiler to evaluate the expression.
  962.  
  963. How about unix's dbx & debuggers on VMS ... ?  This feature is definitely
  964. needed.  As a matter of facts, CW debugger is the only one I used so far
  965. that lack of this feature.
  966.  
  967. I also want the capability of hidding some of the variables
  968. (local & global) that I am not interested in.  Currently I have to
  969. scroll the window ups & downs just to see the variables I have
  970. doubts on...  (Have I overlooked that such feature is already
  971. implemented in CW debugger?!!)
  972.  
  973.  
  974. As for my second question, I only want to overwrite the same line on
  975. the screen by using a "<cr>" character instead of a "<nl>" in the
  976. ANSI "printf" function.  Any special character I could use to 
  977. send to CW's SIOUX to simulate this behavior?!
  978.  
  979. (Any way to re-position a SIOUX window besides manually draging it?
  980. Any DOC on SIOUX besides the on-line User Manuals that comes with 
  981. the CD-ROM?)
  982.  
  983.  
  984. I always want to ask this: Is "support@metrowerks.ca" the
  985. e-mail address for "support" from Metrowerks.  (It was printed on
  986. the little booklet that comes with the CW CD-ROM.)  I have sent my 
  987. queries there for a couple/several weeks but never got any
  988. replies ??!!
  989.  
  990.  
  991.  
  992. ---------------------------
  993.  
  994. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  995. Subject: Quickdraw GX Beta 3 fun
  996. Date: 23 Mar 94 12:00:23 +1300
  997. Organization: University of Waikato, Hamilton, New Zealand
  998.  
  999. Just for fun, I tried duplicating the example on page 207 of the PostScript
  1000. Red Book, 2nd Ed.
  1001.  
  1002. For those without the book, the design is a large letter A against a rectangular
  1003. background. Both the letter and the rectangle are filled with a pattern of
  1004. stars, alternately black and grey.
  1005.  
  1006. The first snag I hit is that QuickDraw GX doesn't allow multicoloured fill
  1007. patterns--not unless you use a bitmap for the pattern shape, I guess. So all
  1008. my stars are one colour for now.
  1009.  
  1010. The second problem I hit was that the fill for the letter would not draw
  1011. properly: stars would appear well outside the character outline. This bug
  1012. is still present in beta 3, but I can get around it by changing the shape
  1013. type from text to a path. The same thing would happen for the rectangle
  1014. before, but this works properly in beta 3.
  1015.  
  1016. The next problem was that the fills for the rectangle and the letter would
  1017. not match up--the positions of the stars were different. This is also fixed
  1018. in beta 3.
  1019.  
  1020. All in all, the betas are getting better and better. I hope release isn't
  1021. too far off now...
  1022.  
  1023. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1024. Info & Tech Services Division              fax: +64-7-838-4066
  1025. University of Waikato            electric mail: ldo@waikato.ac.nz
  1026. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+12:00
  1027.  
  1028. +++++++++++++++++++++++++++
  1029.  
  1030. >From dowdy@apple.com (Tom Dowdy)
  1031. Date: Wed, 23 Mar 1994 00:46:58 GMT
  1032. Organization: Apple Computer, Inc.
  1033.  
  1034. In article <1994Mar23.120024.26760@waikato.ac.nz>, ldo@waikato.ac.nz
  1035. (Lawrence D'Oliveiro, Waikato University) wrote:
  1036.  
  1037. > Just for fun, I tried duplicating the example on page 207 of the PostScript
  1038. > Red Book, 2nd Ed.
  1039. > For those without the book, the design is a large letter A against a rectangular
  1040. > background. Both the letter and the rectangle are filled with a pattern of
  1041. > stars, alternately black and grey.
  1042. > The first snag I hit is that QuickDraw GX doesn't allow multicoloured fill
  1043. > patterns--not unless you use a bitmap for the pattern shape, I guess. So all
  1044. > my stars are one colour for now.
  1045.  
  1046. Ah!
  1047.  
  1048. You can make *two* shapes, each filled with a different pattern/color.
  1049. I haven't seen the picture in a while, but I assume that it's just
  1050. one phase is gray and another black.  Since only the pattern
  1051. areas of the filled shape are blitted, you can place them on
  1052. top of one another to get the alternating behavior you mention.
  1053.  
  1054. -- 
  1055.  Tom Dowdy                  Internet: dowdy@apple.COM
  1056.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  1057.  1 Infinite Loop            AppleLink: DOWDY1
  1058.  Cupertino, CA 95014       
  1059.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  1060.  
  1061. ---------------------------
  1062.  
  1063. >From jarezina@magnus.acs.ohio-state.edu (Jasna M. Arezina-Wilson)
  1064. Subject: Spoofing a serial port
  1065. Date: 22 Mar 1994 20:54:55 GMT
  1066. Organization: Ohio State University
  1067.  
  1068. I have a need to write an app/extension/cdev that will allow me to either
  1069. intercept a port speed call and/or modify said call (the reason is that I
  1070. have an older software package that drives the port at 19200, but my lab's
  1071. scanner interface is limited to 9600, and the software doesn't let me
  1072. change the port speed). Before I start on this nasty little project, does
  1073. anyone have any tips/clues/warnings?
  1074.  
  1075. - -------------------------------------------------------
  1076. #include <standard.disclaimer.h>
  1077. /* "My words are my own, and nobody paid me to say them." */
  1078. void void(void);   /* void where voided */
  1079.  
  1080. +++++++++++++++++++++++++++
  1081.  
  1082. >From Frank Price <wprice@jarthur.claremont.edu>
  1083. Date: 22 Mar 1994 22:40:47 GMT
  1084. Organization: Pomona College
  1085.  
  1086. In article <jarezina-220394155129@slip1-36.acs.ohio-state.edu> Jasna M.
  1087. Arezina-Wilson, jarezina@magnus.acs.ohio-state.edu writes:
  1088. >I have a need to write an app/extension/cdev that will allow me to either
  1089. >intercept a port speed call and/or modify said call (the reason is that I
  1090. >have an older software package that drives the port at 19200, but my lab's
  1091. >scanner interface is limited to 9600, and the software doesn't let me
  1092. >change the port speed). Before I start on this nasty little project, does
  1093. >anyone have any tips/clues/warnings?
  1094.  
  1095. A MUCH better idea would be to modify the subject program's code directly. 
  1096. Making a patch on PBControl would be unreliable depending on how they
  1097. decided to set the baud rate.  There are two ways to set the baud rate. 
  1098. One is a PBControl with csCode of 13 (this is from memory so don't quote
  1099. me).  The other is the standard SerReset call which the Apple glue should
  1100. translate into a different PBControl call (see Serial Driver chapter of
  1101. IM).  Basically, use Macsbug (TMON would be a lot easier here) to trap on
  1102. all PBControl calls in the app.  Look at the csCode.  When you find the
  1103. place in the code that the appropriate call is occurring, use the ResEdit
  1104. CODE disassembler or similar device to edit the hex instructions directly
  1105. to modify the baud rate requested into what you really want.  This solution
  1106. will solve your problem permanently and reliably, and will not introduce a
  1107. whole slew of potential problems caused by trap patches.
  1108.  
  1109. -Frank
  1110. _______________________________________________________________________
  1111. | Frank Price   |  wprice@jarthur.claremont.edu                        |
  1112. |_______________|______________________________________________________|
  1113.  
  1114. +++++++++++++++++++++++++++
  1115.  
  1116. >From jarezina@magnus.acs.ohio-state.edu (Jasna M. Arezina-Wilson)
  1117. Date: 23 Mar 1994 15:44:41 GMT
  1118. Organization: Ohio State University
  1119.  
  1120. In article <2mns5f$jje@jaws.cs.hmc.edu>, Frank Price
  1121. <wprice@jarthur.claremont.edu> wrote:
  1122.  
  1123. > [Idea on using MacsBug to hack serial speed]
  1124.  
  1125. This is pretty much what I did. The problem I had in not doing this in the
  1126. first place is that I had no way to get MacsBug to run (no int button on
  1127. the SE here), so I had to track down the F-Key to get into MacsBug. Plus,
  1128. adding to the fact that I have never used MacsBug before (other than
  1129. finding where my program crashed), it was real fun. I still wasn't able to
  1130. change the baud-rate directly - I had to patch the code and check the
  1131. control call, but at least it works!
  1132.  
  1133. (PS: I still think writing a program to spoof the baud rate would be
  1134. interesting)
  1135.  
  1136.  
  1137.  
  1138. - -------------------------------------------------------
  1139. #include <standard.disclaimer.h>
  1140. /* "My words are my own, and nobody paid me to say them." */
  1141. void void(void);   /* void where voided */
  1142.  
  1143. ---------------------------
  1144.  
  1145. >From Dan Crevier <crevier@husc.harvard.edu>
  1146. Subject: Using Think Pascal Library in SC++
  1147. Date: 22 Mar 94 05:18:13 GMT
  1148. Organization: Harvard University
  1149.  
  1150.  
  1151.     Hi, I'm trying to use the WASTE TextEdit engine with SC++.  WASTE 
  1152. comes with WASTE.lib, a Think Pascal library.  I used oConv from Think C 
  1153. 5.0 (I couldn't add it to my project to use the .o converter...).  That 
  1154. gave me a .pi file I could add to the project, and when I tried to link, 
  1155. I got a message that WESetInfo, _LMUL, and _LDIV weren't defined.  I 
  1156. assume that the are some long multiplication and division routines.  Can 
  1157. I write short routines to implement these?  I have MWC, and MPW, but not 
  1158. Think Pascal.  
  1159.     As for WESetInfo, I used DumpObj from MPW (I'd never used it 
  1160. before, I'm not a MPW person), and it showed a list of routines at the 
  1161. top with EP= in front of them, and the routine name in all caps 
  1162. (including WESETINFO).  What does this mean?
  1163.  
  1164.     Any help would be appreciated.
  1165.  
  1166. Thanks.
  1167.  
  1168. dan
  1169.  
  1170.  
  1171. +++++++++++++++++++++++++++
  1172.  
  1173. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  1174. Date: Thu, 24 Mar 1994 10:49:25 GMT
  1175. Organization: (none)
  1176.  
  1177. Dan Crevier <crevier@husc.harvard.edu> writes:
  1178.  
  1179. >    Hi, I'm trying to use the WASTE TextEdit engine with SC++.  WASTE 
  1180. >comes with WASTE.lib, a Think Pascal library.  I used oConv from Think C 
  1181. >5.0 (I couldn't add it to my project to use the .o converter...).  That 
  1182. >gave me a .pi file I could add to the project, and when I tried to link, 
  1183. >I got a message that WESetInfo, _LMUL, and _LDIV weren't defined.  I 
  1184. >assume that the are some long multiplication and division routines.  Can 
  1185. >I write short routines to implement these?  I have MWC, and MPW, but not 
  1186. >Think Pascal.  
  1187.  
  1188. This is exactly the problem I wrote about in my recent post (about how to
  1189. make SAT work under Think C v6).
  1190.  
  1191. 1) You must include uRuntime.lib. Convert it to a C library and include it.
  1192. Using Think C 5, this was all you had to do. (You may have to fiddle with
  1193. the .v file a bit too.)
  1194.  
  1195. 2) Under Think C 6 (or C++), there's a bug in the linker (?) that makes it
  1196. really confused with uRuntime.lib. You must open it with Think C 5 and REMOVE
  1197. the segment named TOOLBOX. Ugly, isn't it?
  1198.  
  1199.  
  1200.  
  1201. --
  1202. - -
  1203. Ingemar Ragnemalm, PhD
  1204. Image processing, Mac shareware games
  1205. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  1206.  
  1207. ---------------------------
  1208.  
  1209. >From alex@metcalf.demon.co.uk (Alex Metcalf)
  1210. Subject: rowBytes for the screen too big?
  1211. Date: Sat, 19 Mar 1994 00:52:44 GMT
  1212. Organization: Demon Internet
  1213.  
  1214.  
  1215.    Hey there!
  1216.  
  1217.    After hacking around with my custom CopyBits routine (which works
  1218. nicely, BTW), I checked what the rowBytes was for the screen's PixMap. My
  1219. screen's only 640 pixels wide (in 8-bit, so one pixel per byte), but the
  1220. rowBytes is 1024. What gives? Is this something to do with making the
  1221. transfer faster in/out of video RAM?
  1222.  
  1223.       Hmm...
  1224.  
  1225.  
  1226.    Alex
  1227.    alex@metcalf.demon.co.uk
  1228.  
  1229. +++++++++++++++++++++++++++
  1230.  
  1231. >From mssmith@afterlife.ncsc.mil (M. Scott Smith)
  1232. Date: Sat, 19 Mar 1994 04:35:11 GMT
  1233. Organization: The Great Beyond
  1234.  
  1235. In article <alex-190394005149@metcalf.demon.co.uk> alex@metcalf.demon.co.uk (Alex Metcalf) writes:
  1236. >
  1237. >   Hey there!
  1238. >
  1239. >   After hacking around with my custom CopyBits routine (which works
  1240. >nicely, BTW), I checked what the rowBytes was for the screen's PixMap. My
  1241. >screen's only 640 pixels wide (in 8-bit, so one pixel per byte), but the
  1242. >rowBytes is 1024. What gives? Is this something to do with making the
  1243. >transfer faster in/out of video RAM?
  1244. >
  1245. >      Hmm...
  1246. >   Alex
  1247.  
  1248. Alex,
  1249.  
  1250.    If your rowBytes is sincerely 1024, then take your Mac to an Apple
  1251. service center immediately.  It must be quarantined before you begin to
  1252. cause others' Macs to have obscure video symptoms.
  1253.  
  1254.    But seriously..  You've discovered a truth about how video works on
  1255. Macs, and some pretty quantitative evidence why it's not safe to assume
  1256. that jumping ahead 640 bytes puts you on the next line (particularly if
  1257. you're fooling around with direct-screen addressing, as I do).
  1258.  
  1259.    Part of the reasoning behind this (and this is true of all video cards,
  1260. Mac and non-Mac) is that you can't buy a, say, 3.7 byte RAM chip.  RAM
  1261. chips only come in certain sizes, so it's not really possible to have
  1262. _exactly_ the right amount of RAM for the screen dimensions and depth.
  1263. Since it probably wouldn't be a good idea to have _less_, most video cards
  1264. have _more_ -- and "jump up" to the most convenient (cheap, etc.) amount.
  1265.  
  1266.    Keep in mind that most video cards can drive monitors of varying
  1267. resolutions, and depths.  If you switch your monitor to black and white
  1268. mode, you don't even need 640 bytes per scanline.  (More like 80.)  Jump
  1269. it up to 24-bit mode, and you need quite a bit more.  There's _always_
  1270. going to be wasted space, even if you're at the best monitor configuration
  1271. your video hardware can support.  (Step beyond that, and your video
  1272. hardware won't support it -- which is a good reason why you can often
  1273. get 24-bit color on 13" monitors with some cards, but not on 21"
  1274. monitors.)
  1275.  
  1276.    Now, you're talking about the screen's PixMap.  In my own PixMap's I
  1277. "align" the data to fit nice boundaries, and there's handy formulas for
  1278. doing this.  In that case it does benefit things like CopyBits.  The
  1279. strategy is that you have a width and height of "usable" space in a PixMap
  1280. (what you intend to actually be there), and rowBytes (and colBytes)
  1281. might not necessarily jive with width and height.  So you subtract
  1282. rowBytes from width to know how to get to the next line in a PixMap.  But
  1283. there's other reasons, as I listed, for the screen's PixMap to be super-
  1284. aligned.
  1285.  
  1286.    Now, just think!  You've found a lot of extra RAM that you can use if
  1287. you need!  Let's see, 1024-640 = 384 * 480 = 180k of free RAM!  (Pardon
  1288. any math errors, it's late.)  And imagine what's in store with video
  1289. cards that are perfectly happy driving 21" monitors in 24-bit color but
  1290. are only hooked up to 12" black and white monitors..
  1291.  
  1292.    Of course I'm sort of kidding.  But that extra RAM has been put to
  1293. good use in the past; as I recall, someone wrote a program called
  1294. MaxAppleSomethingOrOther that "enlarged" the dimensions of the 13" monitor
  1295. when used with the 8/8-24 video card.  (It essentially got rid of the black
  1296. borders around the 13" screen.)  It didn't work with my 8-24GC, darn it,
  1297. so I never got to try it, but I saw it and it was neat.
  1298.  
  1299.    In any case, it can be baffling to see inflated rowBytes but that's how
  1300. it is; just be sure to make no relations between width of screen and number
  1301. of bytes dedicated to each line by the video card..
  1302.  
  1303.    Hope that made sense!
  1304.  
  1305. Have fun,
  1306.  
  1307. Scott
  1308.  
  1309. - -
  1310. M. Scott Smith   (mssmith@afterlife.ncsc.mil || umsmith@mcs.drexel.edu)
  1311.  
  1312.   Mac developer. Student. Ski bum.  Not responsible for the national debt.
  1313.  
  1314.  
  1315. +++++++++++++++++++++++++++
  1316.  
  1317. >From phixus@netcom.com (Chris DeSalvo)
  1318. Date: Mon, 21 Mar 1994 04:48:51 GMT
  1319. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1320.  
  1321. Alex Metcalf (alex@metcalf.demon.co.uk) wrote:
  1322.  
  1323. :    Hey there!
  1324.  
  1325. :    After hacking around with my custom CopyBits routine (which works
  1326. : nicely, BTW), I checked what the rowBytes was for the screen's PixMap. My
  1327. : screen's only 640 pixels wide (in 8-bit, so one pixel per byte), but the
  1328. : rowBytes is 1024. What gives? Is this something to do with making the
  1329. : transfer faster in/out of video RAM?
  1330.  
  1331.  
  1332. Always do a & 0x07FF on a rowBytes field before using it.
  1333.  
  1334. L8R
  1335. Chris
  1336. -- 
  1337. +-----------------------------------------------------------------+
  1338. | phixus@netcom.com           |   Macintosh:  Changing the world, |
  1339. | Chris De Salvo              |        one person at a time!      |
  1340. | Professional Mac Geek       |    -----------------------------  |
  1341. | MacPlay, Irvine, CA         |      (I wish they'd hurry up!)    |
  1342. +-----------------------------------------------------------------+
  1343.  
  1344. Any opinions expressed, or implied, are my own!  They should not be
  1345. considered representative of the opinions or policies of my employer,
  1346. MacPlay, a division of Interplay Productions, Inc.
  1347.  
  1348. +++++++++++++++++++++++++++
  1349.  
  1350. >From phixus@netcom.com (Chris DeSalvo)
  1351. Date: Tue, 22 Mar 1994 07:45:08 GMT
  1352. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1353.  
  1354. Chris DeSalvo (phixus@netcom.com) wrote:
  1355. : Alex Metcalf (alex@metcalf.demon.co.uk) wrote:
  1356. : :    Hey there!
  1357. : :    After hacking around with my custom CopyBits routine (which works
  1358. : : nicely, BTW), I checked what the rowBytes was for the screen's PixMap. My
  1359. : : screen's only 640 pixels wide (in 8-bit, so one pixel per byte), but the
  1360. : : rowBytes is 1024. What gives? Is this something to do with making the
  1361. : : transfer faster in/out of video RAM?
  1362.  
  1363.  
  1364. : Always do a & 0x07FF on a rowBytes field before using it.
  1365.  
  1366. Mistake already realised.  Please, no flames.  I was thinking GWorlds,
  1367. not monitors.
  1368.  
  1369. Yes, a monitor's rowBytes might very well be 1024 because 1K block
  1370. transfers probably go a heck of a lot faster than 640K transfers.
  1371.  
  1372.  
  1373. Chris
  1374.  
  1375. -- 
  1376. +-----------------------------------------------------------------+
  1377. | phixus@netcom.com           |   Macintosh:  Changing the world, |
  1378. | Chris De Salvo              |        one person at a time!      |
  1379. | Professional Mac Geek       |    -----------------------------  |
  1380. | MacPlay, Irvine, CA         |      (I wish they'd hurry up!)    |
  1381. +-----------------------------------------------------------------+
  1382.  
  1383. Any opinions expressed, or implied, are my own!  They should not be
  1384. considered representative of the opinions or policies of my employer,
  1385. MacPlay, a division of Interplay Productions, Inc.
  1386.  
  1387. +++++++++++++++++++++++++++
  1388.  
  1389. >From paul@taniwha.com (Paul Campbell)
  1390. Date: 24 Mar 1994 06:37:09 GMT
  1391. Organization: Taniwha Systems Design
  1392.  
  1393. In article <phixusCn001F.n4u@netcom.com>
  1394. phixus@netcom.com (Chris DeSalvo) writes:
  1395. > Alex Metcalf (alex@metcalf.demon.co.uk) wrote:
  1396. > :    After hacking around with my custom CopyBits routine (which works
  1397. > : nicely, BTW), I checked what the rowBytes was for the screen's PixMap. My
  1398. > : screen's only 640 pixels wide (in 8-bit, so one pixel per byte), but the
  1399. > : rowBytes is 1024. What gives? Is this something to do with making the
  1400. > : transfer faster in/out of video RAM?
  1401.  
  1402. nah ... it's just easier for the hardware guys - esp. if the same 
  1403. hardware has to do 1024x768 - chances are you weren't going to use 
  1404. that extra memory anyway
  1405.  
  1406. > Always do a & 0x07FF on a rowBytes field before using it.
  1407.  
  1408. NO!! ... always do a & 0x7FFF before using it [and DON'T do as older
  1409. IMs
  1410. suggest do an & 0x3FFF - there are now cards out there with genuine 
  1411. rowbytes equal to 0x4000 (or greater) - if you bypass quickdraw 
  1412. and write directly to the screen BEWARE!)
  1413.  
  1414.     Paul
  1415.  
  1416. ______________________________________________________________________
  1417. Paul Campbell                                         paul@taniwha.com
  1418. "Xenon? It's a rare gas ...."
  1419.  
  1420. ---------------------------
  1421.  
  1422. End of C.S.M.P. Digest
  1423. **********************
  1424.  
  1425.  
  1426.