home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-106.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  41.2 KB  |  1,052 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Mon, 08 Jun 92       Volume 1 : Issue 106
  2.  
  3. Today's Topics:
  4.  
  5.     Writing a DRIVER (for inter-app comm)
  6.     Console Emulation
  7.     Phase2 zone setting
  8.     Macsbug - Novice questions
  9.     Marksman/AppMaker comments?
  10.     Sampled sound buffers & Sound Muncher
  11.     Good language and debugger for Mac
  12.     Finding out if the debugger is installed
  13.  
  14.  
  15. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  16.  
  17. These digests are available (by using FTP, account anonymous, your email
  18. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  19. edu.  This is also the home of the comp.sys.mac.programmer Frequently Asked
  20. Questions list.  The last several issues of the digest are available from
  21. sumex-aim.stanford.edu as well.
  22.  
  23. These digests are also available via email.  Just send a note saying that you
  24. want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will
  25. automatically receive each new digest as it is created.
  26.  
  27. The digest is a collection of articles from the internet newsgroup comp.sys.
  28. mac.programmer.  It is designed for people who read c.s.m.p. semi-regularly
  29. and want an archive of the discussions.  If you don't know what a newsgroup
  30. is, you probably don't have access to it.  Ask your systems administrator(s)
  31. for details.  (This means you can't post questions to the digest.)
  32.  
  33. The articles in these digests are taken directly from comp.sys.mac.programmer.
  34. They are not edited; all articles included in this digest are in their original
  35. posted form.  The only articles that are -not- included in these digests are
  36. those which didn't receive any replies (except those that give information
  37. rather than ask a question).  All replies to each article are concatenated
  38. onto the original article in the order in which they were received.  Article
  39. threads are not added to the digests until the last article added to the
  40. thread is at least one month old (this is to ensure that the thread is dead
  41. before adding it to the digests).
  42.  
  43. Send administrative mail to mkelly@cs.uoregon.edu.
  44.  
  45. -------------------------------------------------------
  46.  
  47. From: jimc@isc-br.ISC-BR.COM (Jim Cathey)
  48. Subject: Writing a DRIVER (for inter-app comm)
  49. Date: 23 Apr 92 16:59:18 GMT
  50. Organization: ISC-Bunker Ramo, Spokane, WA
  51.  
  52. Perhaps some guru can help me.  I'm trying to do 'clean' inter-
  53. application communications for a pair of my programs.  For System 7,
  54. I will look into (and probably use) whatever is there for this.  For
  55. System 3.2-6.X, I am trying to use a dummy driver for this purpose.
  56. The idea is to avoid burning time spent polling by having the server
  57. application post an asynchronous read to the driver.  (Just one more
  58. async read up of the many it's already set up to handle.)  Then,
  59. whenever the client wishes to trigger the server it just does an
  60. immediate write to the driver (it has to be immediate otherwise the
  61. write will just be queued behind the read that is already there.)
  62.  
  63. The problem is that the Device Manger documentation is almost opaque
  64. when it comes to _actually_ writing a driver!  I can't figure out how
  65. to have the Prime routine complete more than one request at a time
  66. (both the current, immediate one and the queued asynchronous one).  It
  67. implies that you can do either one or the other, but not both.  I've
  68. tried JSR-ing to JIODone (instead of jumping to it) to complete the
  69. queued routine, and then returning to the DM to complete the immediate
  70. write, but this doesn't seem to work.  Disassembly (via MacsBug) of
  71. the IODone routine didn't really help, it's what led me to try the
  72. double-return trick.
  73.  
  74. I really don't want to have to try to play games with dNeedTime, nor
  75. do I want to put in a VBL task to poll the driver.  We're back to
  76. burning machine time again this way, and it would probably be simpler
  77. (and a lot less clean) to search the heap zones for the server and
  78. poke around in a memory mailbox.  I _don't_ want to do this, any more
  79. than I want to patch traps (or vote for Duke :-).
  80.  
  81. This should be a simple event-driven driver.  The only thing that
  82. changes the driver's state is the various incoming requests, so these
  83. requests should be able to trigger all required action right then and
  84. there, without leaving messages for various timers and pollers to find
  85. later (which besides being ugly and complex slows down the whole
  86. process).
  87.  
  88. I suppose I could de-queue the PB's myself and call their completion
  89. routines, and figure out how to make the DM like this (using that
  90. MacsBug disassembly), but this is also ugly, and shouldn't be necessary.
  91.  
  92. What am I missing?
  93.  
  94. +----------------+
  95. ! II      CCCCCC !  Jim Cathey
  96. ! II  SSSSCC     !  ISC-Bunker Ramo
  97. ! II      CC     !  TAF-C8;  Spokane, WA  99220
  98. ! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
  99. ! II      CCCCCC !  (509) 927-5757
  100. +----------------+
  101.             "PC's --- the junk bonds of the computer industry"
  102.  
  103. +++++++++++++++++++++++++++
  104.  
  105. From: aw0g+@andrew.cmu.edu (Aaron Wohl)
  106. Date: 23 Apr 92 19:17:48 GMT
  107. Organization: Special Projects, Carnegie Mellon, Pittsburgh, PA
  108.  
  109. For an exmaple device driver see host akutaktak.andrew.cmu.edu
  110. [128.2.35.1] path /aw0g/mailcheck.sit.hqx.  It is a driver I wrote that
  111. checks your unix mail.  It is dynamicly installed into a free unit table
  112. slot.
  113.  
  114. For a discussionof the JIODone business see the think c user reference
  115. manual.  IO request can only compleat in order.  The drivers like MacTCP
  116. that allow multiple async request do this by removing the request from
  117. the queue and simulating the done routine themselfs.  The JIODone
  118. business works by putting the right stuff in register and jumping to
  119. JIODone which compleats the front item in that drivers queue.  There
  120. isn't a way to directly compleat more than one request or a request
  121. other than front one.   If you are doing this kind of stuff I highly
  122. recommend Nosy/THE debugger from Jasik designs.  With them you can
  123. browse through other drivers and the ROM and see what is going on.
  124.  
  125. Aaron
  126.  
  127. +++++++++++++++++++++++++++
  128.  
  129. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  130. Date: 23 Apr 92 20:50:24 GMT
  131. Organization: University of Illinois at Urbana
  132.  
  133. jimc@isc-br.ISC-BR.COM (Jim Cathey) writes:
  134.  
  135. >The problem is that the Device Manger documentation is almost opaque
  136. >when it comes to _actually_ writing a driver!  I can't figure out how
  137. >to have the Prime routine complete more than one request at a time
  138. >(both the current, immediate one and the queued asynchronous one).  It
  139. >implies that you can do either one or the other, but not both.  I've
  140. >tried JSR-ing to JIODone (instead of jumping to it) to complete the
  141. >queued routine, and then returning to the DM to complete the immediate
  142. >write, but this doesn't seem to work.  Disassembly (via MacsBug) of
  143. >the IODone routine didn't really help, it's what led me to try the
  144. >double-return trick.
  145.  
  146. I think JSR-ing to IODone should do it. This should remove the request
  147. from the queue, call the completion routine, set ioResult, and move
  148. the next thing to the head of the queue and wait for the next
  149. SystemTask. Then it should return to where you JSR-ed from, at which
  150. point you can RTS directly to the immediate call. Re-entrancy *might*
  151. be a problem, but I don't really see how.
  152.  
  153. One other possibility if this doesn't work is to have two device
  154. drivers, one for the read and one for the write. The one you write to
  155. can JMP to IODone for the one you read from. This seems pretty silly
  156. and I think your original solution should probably work.
  157.  
  158. PS: The other person who followed up to this mentioned seeing the
  159. THINK C manual for info about IODone. Don't bother. THINK C does not
  160. in the least take care of calling IODone after you have returned
  161. inProgress from the driver; it is all up to you after that.
  162.  
  163. If you need more help, feel free to e-mail.
  164.  
  165. pr
  166. - --
  167. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  168. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  169. System manager - Cognitive Science Group, Beckman Institute, UIUC
  170. Internet: resnick@cogsci.uiuc.edu
  171.  
  172. +++++++++++++++++++++++++++
  173.  
  174. From: andyp@treehouse.UUCP (Andy Peterman)
  175. Date: 25 Apr 92 18:33:00 GMT
  176. Organization: The Treehouse
  177.  
  178. In article <1992Apr23.205024.22292@news.cso.uiuc.edu-> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  179. - ->jimc@isc-br.ISC-BR.COM (Jim Cathey) writes:
  180. - ->
  181. - ->->The problem is that the Device Manger documentation is almost opaque
  182. - ->->.....
  183. - ->
  184. - ->I think JSR-ing to IODone should do it. This should remove the request
  185. - ->from the queue, call the completion routine, set ioResult, and move
  186. - ->the next thing to the head of the queue and wait for the next
  187. - ->SystemTask. Then it should return to where you JSR-ed from, at which
  188. - ->point you can RTS directly to the immediate call. Re-entrancy *might*
  189. - ->be a problem, but I don't really see how.
  190. - ->
  191. - ->One other possibility if this doesn't work is to have two device
  192. - ->drivers, one for the read and one for the write. The one you write to
  193. - ->can JMP to IODone for the one you read from. This seems pretty silly
  194. - ->and I think your original solution should probably work.
  195. - ->
  196.  
  197. I ran across a similar problem writing a driver and ended up with two
  198. drivers, one for write and one for read.  I believe this is the only way
  199. to have asynchronous reads and writes.  One problem with this is that
  200. they have to share common memory - I ended up using the same storage for
  201. dCtlStorage.  Also, it would be tricky communicating between them.
  202.  
  203. An easier solution might be to use a Control call instead of a Write.  A 
  204. Control call should make it through to a driver with a pending Read or Write.
  205.  
  206. - -- 
  207. Andy Peterman                       
  208. treehouse!andyp@gvgpsa.gvg.tek.com  
  209. (916) 273-4569                      
  210.  
  211. +++++++++++++++++++++++++++
  212.  
  213. From: resnick@cogsci.uiuc.edu (Pete Resnick)
  214. Organization: University of Illinois at Urbana
  215. Date: Sat, 25 Apr 1992 20:32:56 GMT
  216.  
  217. andyp@treehouse.UUCP (Andy Peterman) writes:
  218.  
  219. [Regarding device driver calls]
  220.  
  221. >An easier solution might be to use a Control call instead of a Write.  A 
  222. >Control call should make it through to a driver with a pending Read or Write.
  223.  
  224. That won't work. There is only one queue. Only immediate calls will
  225. get through. Remember that's *immediate*, not just synchronous. The
  226. Device Manager headers (at least in MPW C and THINK C) do not have
  227. prototypes for immediate calls, only asynchronous and synchrounous.
  228. Those will be queued.
  229.  
  230. pr
  231. - --
  232. Pete Resnick             (...so what is a mojo, and why would one be rising?)
  233. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  234. System manager - Cognitive Science Group, Beckman Institute, UIUC
  235. Internet: resnick@cogsci.uiuc.edu
  236.  
  237. +++++++++++++++++++++++++++
  238.  
  239. From: scott@mcl.mcl.ucsb.edu (Scott Bronson)
  240. Date: 26 Apr 92 02:42:18 GMT
  241.  
  242. In <1992Apr23.205024.22292@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  243.  
  244. >PS: The other person who followed up to this mentioned seeing the
  245. >THINK C manual for info about IODone. Don't bother. THINK C does not
  246. >in the least take care of calling IODone after you have returned
  247. >inProgress from the driver; it is all up to you after that.
  248.  
  249.  
  250. In the section in the THINK C manual (version 4 or 5 -- they both have
  251. it) describing the THINK DA glue (to allow the writing of a DA without
  252. using even one line of assembly), it gives a moderately detailed
  253. description of how the glue resolves the RTS/IODone question.  This is
  254. the best discussion I've seen on this problem.
  255.  
  256. Note that this is described in the section on DAs, not DRVRs.  Sorry,
  257. I can't supply page numbers as my manual is at home.
  258.  
  259.     - Scott
  260.  
  261. +++++++++++++++++++++++++++
  262.  
  263. From: lsr@taligent.com (Larry Rosenstein)
  264. Date: 24 Apr 92 21:32:55 GMT
  265. Organization: Taligent, Inc.
  266.  
  267. In article <3640@isc-br.ISC-BR.COM>, jimc@isc-br.ISC-BR.COM (Jim Cathey) wrote:
  268. > I will look into (and probably use) whatever is there for this.  For
  269. > System 3.2-6.X, I am trying to use a dummy driver for this purpose.
  270.  
  271. Issue 3 of develop has an article about writing a driver in C++ that implements
  272. exactly this.
  273. - -----
  274. Larry Rosenstein
  275. Taligent, Inc.
  276. lsr@taligent.com
  277.  
  278. +++++++++++++++++++++++++++
  279.  
  280. From: lsr@taligent.com (Larry Rosenstein)
  281. Date: 24 Apr 92 21:36:15 GMT
  282. Organization: Taligent, Inc.
  283.  
  284. In article <66051@apple.Apple.COM>, lsr@taligent.com (Larry Rosenstein) wrote:
  285. > Issue 3 of develop
  286.  
  287. I made a mistake.  It's issue 4.
  288.  
  289. +++++++++++++++++++++++++++
  290.  
  291. From: jimc@isc-br.ISC-BR.COM (Jim Cathey)
  292. Date: 27 Apr 92 22:45:05 GMT
  293. Organization: ISC-Bunker Ramo, An Olivetti Company
  294.  
  295. In article <1992Apr23.205024.22292@news.cso.uiuc.edu> resnick@cogsci.uiuc.edu (Pete Resnick) writes:
  296. >>The problem is that the Device Manger documentation is almost opaque
  297. >>when it comes to _actually_ writing a driver!  I can't figure out how
  298. >>to have the Prime routine complete more than one request at a time
  299. >>(both the current, immediate one and the queued asynchronous one).  It
  300. >>implies that you can do either one or the other, but not both.  I've
  301. >>tried JSR-ing to JIODone (instead of jumping to it) to complete the
  302. >>queued routine, and then returning to the DM to complete the immediate
  303. >>write, but this doesn't seem to work.  Disassembly (via MacsBug) of
  304. >>the IODone routine didn't really help, it's what led me to try the
  305. >>double-return trick.
  306. >
  307. >I think JSR-ing to IODone should do it. This should remove the request
  308. >from the queue, call the completion routine, set ioResult, and move
  309. >the next thing to the head of the queue and wait for the next
  310. >SystemTask. Then it should return to where you JSR-ed from, at which
  311. >point you can RTS directly to the immediate call. Re-entrancy *might*
  312. >be a problem, but I don't really see how.
  313.  
  314. Well, I got things to work finally.  I had to simplify what I was
  315. trying to do (and fix some bugs too), but I think I will be able
  316. to make everything work that I need to.  I end up posting a single
  317. ASYNC read from my server.  The client program then can do an
  318. IMMEDIATE write, which will kick things loose.  I only have one
  319. pending read up, so JSR'ing to IODone and then returning from the
  320. Prime routine seems to be adequate.  All other requests are done
  321. as IMMEDIATE PBControl calls so they don't get queued.  They're
  322. ugly, in that they use ioBuffer (and other I/O fields that aren't
  323. formally defined in the control versions of the structures) in
  324. order to do READs and WRITEs that don't disturb the asynchronous
  325. I/O queue.  Ick.
  326.  
  327. >One other possibility if this doesn't work is to have two device
  328. >drivers, one for the read and one for the write. The one you write to
  329. >can JMP to IODone for the one you read from. This seems pretty silly
  330. >and I think your original solution should probably work.
  331.  
  332. Now _that's_ ugly!  One of these bletcherous beasts is bad enough!
  333.  
  334. I had to put the driver in the system heap, even though I didn't
  335. want to, because it seems to disappear from the unit table on a
  336. major switch (sometimes, anyhow) and can't be found by my client
  337. application if the driver's in the server's heap.
  338.  
  339. I've got another problem:  After all that work to split off the
  340. connection initiation action into another application (so there
  341. can be 'documents' to open), the damned connections end up opening
  342. in the non-frontmost layer!  The trigger application comes and goes,
  343. and the _Finder_ is what ends up in front when the server is finally
  344. able to establish the connection.  Some months it doesn't pay to
  345. get out of bed...
  346.  
  347. +----------------+
  348. ! II      CCCCCC !  Jim Cathey
  349. ! II  SSSSCC     !  ISC-Bunker Ramo
  350. ! II      CC     !  TAF-C8;  Spokane, WA  99220
  351. ! IISSSS  CC     !  UUCP: uunet!isc-br!jimc (jimc@isc-br.isc-br.com)
  352. ! II      CCCCCC !  (509) 927-5757
  353. +----------------+
  354.             "PC's --- the junk bonds of the computer industry"
  355.  
  356. +++++++++++++++++++++++++++
  357.  
  358. From: ksand@apple.com (Kent Sandvik)
  359. Date: 4 May 92 21:58:04 GMT
  360. Organization: MacDTS Mongols
  361.  
  362. In article <66051@apple.Apple.COM>, lsr@taligent.com (Larry Rosenstein) writes:
  363. > In article <3640@isc-br.ISC-BR.COM>, jimc@isc-br.ISC-BR.COM (Jim Cathey)
  364. wrote:
  365. > > 
  366. > > I will look into (and probably use) whatever is there for this.  For
  367. > > System 3.2-6.X, I am trying to use a dummy driver for this purpose.
  368. > Issue 3 of develop has an article about writing a driver in C++ that
  369. implements
  370. > exactly this.
  371.  
  372. Unfortunately the example is broken under MPW 3.2. What we do
  373. inside DTS is to send a PD package - found at CompuServe for instance -
  374. that shows how to create a fake app, and then a special tool (part
  375. of this distribution) moves the jump table entries and any other
  376. global data back to the one and only segment. As for an Apple solution,
  377. don't ask me when we will get this one. I do know that we have 
  378. reinvented the same tools inside engineering a couple of times, but
  379. it takes a lot of energy to get those tools supported and released.
  380.  
  381. Cheers,
  382. Kent Sandvik/DTS
  383. ..but not speaking for DTS... 
  384. Born Again Dynamic Language Programmer
  385.  
  386. ---------------------------
  387.  
  388. From: mozart@coos.dartmouth.edu (Sting)
  389. Subject: Console Emulation
  390. Date: 27 Apr 92 13:26:30 GMT
  391. Organization: Dartmouth College, Hanover, NH
  392.  
  393. Greetings!
  394.  
  395. I'm trying to figure out how to emulate a glass terminal using THINK C and
  396. the Macintosh ROM toolbox.  I know the THINK package contains a console and
  397. an ANSI package that emulate that sort of thing, but according to the specifi-
  398. cations, these packages can't be used for input, and that's not good.
  399.  
  400. My thoughts are that I could use the toolbox TextEdit stuff to maintain the
  401. text window itself, and get command lines by reading the last line in the
  402. buffer whenever the user hits return or enter.  Actually parsing the command
  403. line is easy, as long as I can get the line into its own data structure.
  404.  
  405. Finding the number of the last line is easy enough (it would be the value of
  406. the hte.teNLines field), and I can get the linestart from the teLines array,
  407. but does anyone have any idea as to how I could then copy that line into a
  408. C-string somewhere?
  409.  
  410. Also, does anyone know a good way to add lines from a separate buffer to the
  411. end of a TextEdit record without having to make copies of the entire text
  412. block?
  413.  
  414. Thanks!
  415. - -Mike
  416.  
  417. P.S.-  Please email any responses you post in addition to posting them.
  418.        Thank you!
  419.  
  420.  
  421.  
  422.  
  423. - --
  424. Michael J. Fromberger            | With every prison blown to dust
  425. Composer, Guitarist            | My enemies walk free
  426. Sting@Dartmouth.EDU                     | I'm mad about you,
  427. Kiewit Computation Ctr. Student Asst.    | I'm mad about you ... (Sting)
  428.  
  429. +++++++++++++++++++++++++++
  430.  
  431. From: bpb9204@tamsun.tamu.edu (Brent)
  432. Organization: Texas A&M Univ., Inc.
  433. Date: Wed, 6 May 1992 16:24:31 GMT
  434.  
  435. mozart@coos.dartmouth.edu (Sting) writes:
  436. | [tty emulation...], but according to the specifi-
  437. |cations, these packages can't be used for input, and that's not good.
  438.  
  439. What kind of input are you talking about?  Sure you can.  You can get
  440. lines read by using the familiar scanf().
  441.  
  442. But anyway, read on; I'm doing something similar...
  443.  
  444. |My thoughts are that I could use the toolbox TextEdit stuff to maintain the
  445. |text window itself, and get command lines by reading the last line in the
  446. |buffer whenever the user hits return or enter.  
  447.  
  448. That's what I did.  I created a normal window with a scroll bar and a text
  449. area.  Initially, a prompt is printed (length of prompt string is known).
  450. I have checks in there so that when the user presses backspace, and if the
  451. current insertion position is not within the [0 - (prompt_length-1)] range,
  452. then I delete the character (this makes the prompt unchangeable).  The user
  453. may enter characters/text as usual, copy/paste, etc and then when the user
  454. presses <enter>, that's when I read what was written.  After I would process
  455. their entered stuff, a new prompt is printed and the cycle continues.
  456.  
  457. |Finding the number of the last line is easy enough (it would be the value of
  458. |the hte.teNLines field), and I can get the linestart from the teLines array,
  459. |but does anyone have any idea as to how I could then copy that line into a
  460. |C-string somewhere?
  461.  
  462. Whenever you want to get text out of a textEdit record without munging with
  463. the record yourself, you have to do some text editing from within your app.
  464. Ex:    Text = "The cow jumped over the moon"
  465.                0123456789012345678901234567  (character positions)
  466.  
  467. If you wanted the string "jumped over", you would call:
  468.   TESetSelect( te_handle, 8,18);      /* check the parameter order here */
  469.   s = TEGetText( te_handle);          /* this copies the selected text; again,
  470.                                          lookup the params on this.         */
  471.   TESetSelect( te_handle, 32767, 32767);  /* moves cursor back to end of TE */
  472.  
  473. |Also, does anyone know a good way to add lines from a separate buffer to the
  474. |end of a TextEdit record without having to make copies of the entire text
  475. |block?
  476.  
  477. Yep.  
  478.   char buf[]="This is added to the end.";
  479.   TESetSelect( te_handle, 32767,32767);  /* move to end; changes insert. pt. */
  480.   TEInsert( te_handle, buf, strlen(buf)); /* add text at insertion point */
  481.  
  482.  
  483. Please don't flame me if my TE function names/parameters are not exactly 
  484. right - it's hard coding macs by memory (ever try Xlib? ;-).  Look up the
  485. similarly-named calls in Inside Mac for the real details.
  486.  
  487. The code I have written that implements this "console" will be freely
  488. available.  It's done and is working, and it is stable.  Unfortunately, 
  489. today is the last day of classes and finals start Friday.  I'll try to get
  490. this out asap, however.
  491.  
  492. - -Brent
  493. - -- 
  494. - ------------------------------------------------------------------------------
  495. Brent P. Burton, N5VMG                                    Computer Sci/Physics
  496. bpb9204@tamsun.tamu.edu                                   Texas A&M University
  497. - ------------------------------------------------------------------------------
  498.  
  499. ---------------------------
  500.  
  501. From: d39818@simpsons.pnl.gov (David R. McGee)
  502. Subject: Phase2 zone setting
  503. Date: 1 May 92 02:16:20 GMT
  504. Organization: Pacific Northwest Laboratory
  505.  
  506. What we need one of you excellent network mangement software developers or
  507. freeware developers to do is write some code that will remotely set an
  508. ethernet connected Macintosh in a certain phase2 zone.
  509.  
  510. David R. McGee
  511. Network Manager
  512. Pacific Northwest Laboratory
  513. Battelle Boulevard, M/S K1-88
  514. Richland, WA 99352
  515. (509)375-6994
  516. ALINK drmcgee
  517. internet dr_mcgee@pnl.gov
  518.  
  519. +++++++++++++++++++++++++++
  520.  
  521. From: throop@wilder.com (Throop Wilder)
  522. Date: 5 May 92 17:40:08 GMT
  523. Organization: Wilder Systems/Trik Product Group
  524.  
  525. In article <1992May1.021620.11378@oracle.pnl.gov> d39818@simpsons.pnl.gov (David R. McGee) writes:
  526. >What we need one of you excellent network mangement software developers or
  527. >freeware developers to do is write some code that will remotely set an
  528. >ethernet connected Macintosh in a certain phase2 zone.
  529. >
  530. >David R. McGee
  531. >internet dr_mcgee@pnl.gov
  532.  
  533. Our NetDistributor 2.0 product (still in beta) can do this right
  534. now. If you're interested in this kind of functionality, drop
  535. me a line.
  536.  
  537. Throop
  538.  
  539. PS. NetDistributor lets you install/update software remotely on
  540. local/ether/tokentalk nets. 
  541.  
  542. ---------------------------
  543.  
  544. From: green@eniac.seas.upenn.edu (Bradley Green )
  545. Subject: Macsbug - Novice questions
  546. Date: 6 May 92 00:08:32 GMT
  547. Organization: University of Pennsylvania
  548.  
  549. I just ftp'ed Macsbug from the apple site, and found no information
  550. included on how use use/run it.  Furthermore, when I uncompressed the
  551. files, I found nothing resembling an executible application or a
  552. system extension.  So how does one go about using this thing?  Is there
  553. a free manual avaliable, and I just missed it.
  554.  
  555. Thanks for your response.
  556.  
  557. - --
  558. *----------------------------------------------------------------------------*
  559. * Bradley S. Green                University of Pennsylvania   *
  560. * green@eniac.seas.upenn.edu            Dept. Of Systems Engineering *
  561. *----------------------------------------------------------------------------*
  562.  
  563. +++++++++++++++++++++++++++
  564.  
  565. From: mhall@occs.cs.oberlin.edu (Matthew Hall)
  566. Date: 6 May 92 20:51:58 GMT
  567. Organization: Oberlin College Computer Science
  568.  
  569. In article <76852@netnews.upenn.edu> green@eniac.seas.upenn.edu (Bradley Green ) writes:
  570.  
  571.  
  572. >   I just ftp'ed Macsbug from the apple site, and found no information
  573. >   included on how use use/run it.  Furthermore, when I uncompressed the
  574. >   files, I found nothing resembling an executible application or a
  575. >   system extension.  So how does one go about using this thing?  Is there
  576. >   a free manual avaliable, and I just missed it.
  577. >
  578. >   Thanks for your response.
  579.  
  580. Well, there is no free manual.  Sorry.  You can buy it at your local
  581. software etc. for around $16.
  582.  
  583. Macsbug is not an extension, it's a debugger.  To install it, drag it
  584. into your system folder (for all systems) and reboot.  The message
  585. "Macsbug installed" or "Debugger installed" should then appear under
  586. the "Welcome to Macintosh" message in the opening alert.
  587.     To enter it, hit the programmers switch (little plastic tab on
  588. some macs, or
  589. control-command-funny-key-that-looks-like-a-backward-triangle-aka-power-key
  590. if you don't have the programmers switch.  Type ? for a little help.
  591.  
  592. - -matt hall
  593. - --
  594.  
  595.  
  596. - -------------------------------------------------------------------------------
  597. Matt Hall.    mhall@occs.cs.edu  OR  SMH9666@OBERLIN.BITNET
  598.               (216)-775-5805 (That's a Cleveland Area code. Lucky Me)
  599.  
  600. "If a man comes up to you and says:
  601.     'A dog just carried away your ear.'
  602. Do you run after the dog, or search first for your ear?" - Moon over Morocco
  603.   
  604.  
  605. ---------------------------
  606.  
  607. From: macman@newton.WPI.EDU (Chris Silverberg)
  608. Subject: Marksman/AppMaker comments?
  609. Date: 6 May 92 03:49:07 GMT
  610. Organization: Worcester Polytechnic Institute
  611.  
  612. Greetings.
  613.  
  614. I am looking for some feedback on either Marksman or AppMaker from the
  615. people who are using them... I currently program with THINK C 5.0, and 
  616. although I'm just using regular C, I may start working with the TCL later
  617. on.  I'm also looking for comments from people who use both... like, if
  618. I were trapped on a desert island, and I could only have one... which one
  619. should I choose? ;-)
  620.  
  621. Thanks... please email.
  622. - - Chris 
  623.  =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  624.    Chris Silverberg                     INTERNET: macman@wpi.wpi.edu
  625.    Worcester Polytechnic Institute      WMUG BBS  508-832-5844 (TeleFinder)
  626.    America Online: TfChris              FIDONET:  1:322/115.1
  627.  
  628. +++++++++++++++++++++++++++
  629.  
  630. From: dnebing@bgsu.edu (Mr. Neb)
  631. Date: 6 May 92 16:38:17 GMT
  632. Organization: Bowling Green State University B.G., Oh.
  633.  
  634. macman@newton.WPI.EDU (Chris Silverberg) writes:
  635. > I am looking for some feedback on either Marksman or AppMaker from the
  636. > people who are using them... I currently program with THINK C 5.0, and 
  637. > although I'm just using regular C, I may start working with the TCL later
  638. > on.  I'm also looking for comments from people who use both... like, if
  639. > I were trapped on a desert island, and I could only have one... which one
  640. > should I choose? ;-)
  641.  
  642.     I have used Marksman, as well as it's predecessor called 
  643. Prototyper.  It's a very nice package, overall.  You set up your program
  644. visually, creating menus and windows etc.  You can even run the "program"
  645. to see how things will work together.  You can test the way that things
  646. link together to get a basic idea of how your finished program will run.
  647.  
  648.     The only thing that I don't care for about either of these programs
  649. is the large amount of repetitive code that these programs can generate.  In
  650. most cases this is hard to run into, but if you have a large window stuffed
  651. with textedit items, both Prototyper and Marksman generate a lot of
  652. repetitive code instead of using a single procedure that could be called
  653. over and over.
  654.  
  655.     Generating code with the comments is just horrid.  I comment a good
  656. bit of the time to let myself know what's going on, but these programs
  657. comment every line.  And if you turn the commenting off, sometimes it is
  658. hard to understand just where the code is going.  I am not trying to say that
  659. it is not good code, but it is like trying to read someone elses code and
  660. understand just what they were thinking when they wrote it.
  661.  
  662.     Enough of the Marksman and Prototyper bashing though.  They are two
  663. very good programs that can take a lot of time out of the development cycle.
  664. The code that is generated is (most of the time) very good and
  665. understandable.  I would recommend them to anyone.
  666.  
  667.     Just my $0.02,
  668.  
  669.     Dave Nebinger
  670.     dnebing@andy.bgsu.edu
  671.  
  672. ---------------------------
  673.  
  674. From: kelly@clio (Kelly Fitz)
  675. Subject: Sampled sound buffers & Sound Muncher
  676. Date: 6 May 92 19:03:16 GMT
  677. Organization: University of Illinois at Urbana
  678.  
  679.  
  680. How can I make the Mac Sound Manager play sample buffers? I'm reading up 
  681. sixteen bit sample files, converting them to eight bit samples, putting them
  682. in a buffer, and trying to play them through the Mac speaker.
  683. I have tried creating SoundHeaders and passing them with the SoundCmd
  684. bufferCmd, but I get no sound. When I check the Sound Channel Status, I
  685. find that the channel is busy, but the StartTime, EndTime, and CurrentTime
  686. are all zero. I allocated the Sound Channel ahead of time with no errors.
  687. Moreover, when I procede to dispose of the Sound Channel, the Mac loses
  688. its lunch.
  689.  
  690. Has anyone gotten this stuff to work? The documentation and error reporting 
  691. are so complete that I can't figure out why it's not making any noise.
  692. (My sarcasm bit is set)
  693.  
  694. The most useful thing for me would be a working code fragment which plays
  695. buffers on the sampledSoundSynth.
  696.  
  697. - -Kelly Fitz
  698. CERL Sound Group
  699. University of Illinois, Urbana
  700. k-fitz@uiuc.edu
  701.  
  702. +++++++++++++++++++++++++++
  703.  
  704. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  705. Organization: Kalamazoo College
  706. Date: Wed, 6 May 1992 20:30:23 GMT
  707.  
  708. kelly@clio (Kelly Fitz) writes:
  709. >
  710. >How can I make the Mac Sound Manager play sample buffers?
  711. >I have tried creating SoundHeaders and passing them with the SoundCmd
  712. >bufferCmd, but I get no sound. When I check the Sound Channel Status, I
  713. >find that the channel is busy, but the StartTime, EndTime, and CurrentTime
  714. >are all zero. I allocated the Sound Channel ahead of time with no errors.
  715. >Moreover, when I procede to dispose of the Sound Channel, the Mac loses
  716. >its lunch.
  717.  
  718. It's very hard to figure out what's going on here, without a snippet of
  719. the actual code.  My guesses would be, roughly in order of probability:
  720.  
  721. Your qLength is zero.
  722. Your header is bad.  Check the sampleRate and baseFrequency fields
  723. especially.
  724. Your callback routine is crashing silently.
  725. Your SndChannel is relocatable.  Like GrafPorts, SndChannels can't move
  726. around, or the system loses track of them.
  727. Cosmic rays.
  728.  
  729. >Has anyone gotten this stuff to work?
  730.  
  731. Three or four people.  Two are presently in institutions, one has
  732. renounced computers and taken a vow of silence, and one vanished under
  733. mysterious circumstances in November of 1989.
  734.  
  735. >The most useful thing for me would be a working code fragment which plays
  736. >buffers on the sampledSoundSynth.
  737.  
  738. I'm planning on really, truly finishing up a Think C 5 class that
  739. handles sound well, sometime in the next week or so.  I'll keep you
  740. posted.
  741.  
  742. In the meantime...hmmm...well, OK, let's try this.  (None of the
  743. following code was tested.  If it doesn't work, email me and I'll try to
  744. figure out what's going on.)
  745.  
  746. void playSound(short sndRsrcID)
  747. {
  748.     SndChannelPtr mySndChannelPtr;
  749.     SndCommand mySndCommand;
  750.     Handle mySndRsrc;
  751.     long theOffset;
  752.     OSErr myOSErr;
  753.     
  754.     mySndChannelPtr = NewPtrClear( sizeof(SndChannel) );
  755.     FailNIL(mySndChannelPtr);
  756.     mySndChannelPtr->qLength = 128;
  757.     FailOSErr(SndNewChannel(&mySndChannel, sampledSynth,
  758.         initMono, NULL);
  759.     
  760.         /* Try a 'snd ' from the System file first, to make sure
  761.          * it isn't bad data.  I like "Quack."
  762.          */
  763.     mySndRsrc = GetResource('snd ', sndRsrcID);
  764.     FailNIL(mySndRsrc);
  765.     HLock(mySndRsrc);
  766.     
  767.         /* This function defined later... */
  768.     theOffset = offsetToSoundHeader(mySndRsrc);
  769.  
  770.     mySndCommand.cmd = bufferCmd;
  771.     mySndCommand.param1 = 0;
  772.     mySndCommand.param2 = *mySndRsrc + theOffset;
  773.     
  774.         /* Passing TRUE for "noWait" is somewhat trickier. */
  775.     FailOSErr(SndDoCommand(mySndChannelPtr, &mySndCommand, FALSE));
  776.  
  777.     FailOSErr(SndDisposeChannel(mySndChannelPtr, TRUE));
  778.  
  779.     DisposPtr(mySndChannelPtr);
  780. }
  781.  
  782.     /* Here's an abridged version of my "offsetToSoundHeader"
  783.      * function.  It's not too bright, so don't give it strange
  784.      * sounds, especially non-sampledSynth sounds.  Only format
  785.      * 1 'snd 's are supported.
  786.      */
  787. long offsetToSoundHeader(Handle sndRsrcHndl)
  788. {
  789.     SndListPtr theSndListPtr;
  790.     long theOffset;
  791.     short nSndCommands;
  792.  
  793.     theSndListPtr = (SndListPtr) *sndRsrcHndl;
  794.        /* Start the offset off pointing just past the "format" word. */
  795.     theOffset = 2;
  796.     if (theSndListPtr->format == firstSoundFormat) {
  797.           /* Skip past the "number of synths/modifiers" word. */
  798.        theOffset += 2;
  799.           /* Skip past all the synths and modifiers. */
  800.        theOffset += sizeof(ModRef) * theSndListPtr->numModifiers;
  801.     } else {
  802.           /* Skip past the reference count. */
  803.        theOffset += 2;
  804.     }
  805.        /* Get the number of sound commands. */
  806.     nSndCommands = *((short *) (*sndRsrcHndl + theOffset));
  807.        /* Skip past the "number of sound commands" word. */
  808.     theOffset += 2;
  809.        /* Skip past all the sound commands. */
  810.     theOffset += sizeof(SndCommand) * nSndCommands;
  811.     return theOffset;
  812. }
  813. - -- 
  814.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  815.  "A common way to answer a question about C is to 'see what the compiler
  816.   does.'  Clearly C has suffered from being partly defined, then
  817.   implemented." - High C language reference manual, 1987
  818.  
  819. ---------------------------
  820.  
  821. From: seitz@netcom.com (Matthew Seitz)
  822. Subject: Good language and debugger for Mac
  823. Date: 7 May 92 05:12:00 GMT
  824. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  825.  
  826. Hello all.  My company is getting into Mac software development.  As one of
  827. programmers, I'm looking for a good development language.  Currently I have
  828. a lot of experience with DOS and Windows programming, especially with
  829. assembly language and C.  The debugger I'm most familiar with in the DOS
  830. world is Soft-ICE.  Since I will be starting to do work on the Mac, I was
  831. wondering if some suggestions could be dropped my way as to the best language
  832. and debugger for use on the Mac.  The applications I will be working on
  833. will be primarily low-level stuff (we do local area networks), something
  834. that will allow me good access to the internals of the Mac and allow me
  835. to view these same internals from the debugger.  I would really prefer a
  836. good assembler to C, but I don't know of any assemblers for the Mac at all.
  837. The only good C compiler I've seen referenced so far is Think C.
  838.  
  839.     Any suggestions?
  840.  
  841.     Thank you,
  842.  
  843. - -- 
  844.                     Matthew Seitz
  845.                     seitz@netcom.com
  846.  
  847. +++++++++++++++++++++++++++
  848.  
  849. From: eric@homebase.vistachrome.com (Eric Brunson)
  850. Date: 7 May 92 13:39:06 GMT
  851. Organization: Vista-Chrome, Incorporated
  852.  
  853. In article <pnfkjg_.seitz@netcom.com> seitz@netcom.com (Matthew Seitz) writes:
  854. >Hello all.  My company is getting into Mac software development.  As one of
  855. >programmers, I'm looking for a good development language.  Currently I have
  856. >a lot of experience with DOS and Windows programming, especially with
  857. >assembly language and C.  The debugger I'm most familiar with in the DOS
  858. >world is Soft-ICE.  Since I will be starting to do work on the Mac, I was
  859. >wondering if some suggestions could be dropped my way as to the best language
  860. >and debugger for use on the Mac.  The applications I will be working on
  861. >will be primarily low-level stuff (we do local area networks), something
  862. >that will allow me good access to the internals of the Mac and allow me
  863. >to view these same internals from the debugger.  I would really prefer a
  864. >good assembler to C, but I don't know of any assemblers for the Mac at all.
  865. >The only good C compiler I've seen referenced so far is Think C.
  866. >
  867. >    Any suggestions?
  868. >
  869. >    Thank you,
  870. >
  871. >-- 
  872. >                    Matthew Seitz
  873. >                    seitz@netcom.com
  874.  
  875. Symantec 'Think C' for straight C.  Undecided for Object Oriented, probably 
  876. MacApp if they ever stop changing their class libs.
  877.  
  878. - ---
  879. Eric Brunson               These opinions are mine alone,
  880. eric%rde@uunet.uu.net        but they could be yours for a low monthly fee!
  881. - -- 
  882. Eric Brunson               These opinions are mine alone,
  883. eric%rde@uunet.uu.net        but they could be yours for a low monthly fee!
  884.  
  885. ---------------------------
  886.  
  887. From: piovanel@ghost.dsi.unimi.it (marco piovanelli)
  888. Subject: Finding out if the debugger is installed
  889. Organization: Computer Science Dep. - Milan University
  890. Date: Thu, 30 Apr 1992 14:14:35 GMT
  891.  
  892. I have MacsBug 6.2.1 and I want to write an FKEY to drop me into MacsBug
  893. with one simple keystroke.  At first, I thought the obvious solution
  894. was to simply stuff these 4 bytes
  895.  0xA9FF  _Debugger
  896.  0x4E75  rts
  897. into the FKEY resource and stash the FKEY into the system resource fork.
  898. In fact, it works pretty fine, but listen: now comes the pain.
  899. I sometimes have to boot with extensions disabled, so MacsBug doesn't get
  900. loaded, but after a while I forget it and I hit the command+shift
  901. combination, thus crashing the machine with an Unimplemented Trap DS error.
  902.   Well, I though, just check for the existence of the _Debugger trap by
  903. checking its address against that of the _Unimplemented trap.
  904. But that doesn't work, because the two addresses always coincide.
  905. The _Debugger trap is *ALWAYS* unimplemented, so to say.  I guess
  906. MacsBug patches directly the trap dispatcher, so it doesn't need to
  907. set a new trap address.
  908.   Now, has anyone any idea as to determining whether MacsBug is installed?
  909. I would love a CLEAN method, like using _Gestalt or checking some
  910. low-memory global.
  911.   Thanks in advance for any suggestions.
  912.  
  913. Marco Piovanelli - Computer Science Department - Milano University
  914.  
  915. +++++++++++++++++++++++++++
  916.  
  917. From: quinn@cs.uwa.edu.au (Quinn "The Eskimo!")
  918. Date: 1 May 92 00:47:12 GMT
  919. Organization: The University of Western Australia
  920.  
  921. In article <1992Apr30.141435.3140@ghost.dsi.unimi.it>, piovanel@ghost.dsi.unimi.it (marco piovanelli) writes:
  922. >   Well, I though, just check for the existence of the _Debugger trap by
  923. > checking its address against that of the _Unimplemented trap.
  924.  
  925. Much too obvious.  The Mac is laughing at you (-:
  926.  
  927. > But that doesn't work, because the two addresses always coincide.
  928. > The _Debugger trap is *ALWAYS* unimplemented, so to say.  I guess
  929. > MacsBug patches directly the trap dispatcher, so it doesn't need to
  930. > set a new trap address.
  931.  
  932. That's right.
  933.  
  934. >   Now, has anyone any idea as to determining whether MacsBug is installed?
  935. > I would love a CLEAN method, like using _Gestalt or checking some
  936. > low-memory global.
  937.  
  938. MacsBug 6.1 manual, Appendix C "MacsBug Internals", page 105...
  939.  
  940. {$push}
  941. {$setc quoting=true}
  942.  
  943. Beginning with the 128k ROM, support for debuggers is provided.  When a
  944. system error or 68000 exception occurs, the ROM code examines the global
  945. variable MacJmp to see if a debugger is installed.  The high-order byte
  946. of MacJmp is used to contain the following information.
  947.  
  948. Bit Meaning
  949. 7   Set if debugger is running
  950. 6   Set if debugger can handle system errors
  951. 5   Set if debugger is installed
  952. 4   Set if debugger can support the Extended Discipline utility
  953.  
  954. {$pop}
  955.  
  956. >   Thanks in advance for any suggestions.
  957.  
  958. Share and Enjoy.
  959.  
  960. Quinn "The Eskimo!"   <quinn@cs.uwa.edu.au>  "Real Coke, Diet .sig"
  961. Department of Computer Science, The University of Western Australia
  962.   -- Who's very thankful for his copy of ETO.
  963.  
  964. +++++++++++++++++++++++++++
  965.  
  966. From: keith@taligent.com (Keith Rollin)
  967. Date: 1 May 92 19:17:46 GMT
  968. Organization: Taligent
  969.  
  970. In article <1992May1.004712.28557@bilby.cs.uwa.edu.au>, quinn@cs.uwa.edu.au
  971. (Quinn "The Eskimo!") writes:
  972. > In article <1992Apr30.141435.3140@ghost.dsi.unimi.it>,
  973. piovanel@ghost.dsi.unimi.it (marco piovanelli) writes:
  974. > > 
  975. > >   Now, has anyone any idea as to determining whether MacsBug is installed?
  976. > > I would love a CLEAN method, like using _Gestalt or checking some
  977. > > low-memory global.
  978. > MacsBug 6.1 manual, Appendix C "MacsBug Internals", page 105...
  979. > {$push}
  980. > {$setc quoting=true}
  981. > Beginning with the 128k ROM, support for debuggers is provided.  When a
  982. > system error or 68000 exception occurs, the ROM code examines the global
  983. > variable MacJmp to see if a debugger is installed.  The high-order byte
  984. > of MacJmp is used to contain the following information.
  985. > Bit Meaning
  986. > 7   Set if debugger is running
  987. > 6   Set if debugger can handle system errors
  988. > 5   Set if debugger is installed
  989. > 4   Set if debugger can support the Extended Discipline utility
  990. > {$pop}
  991.  
  992. This is only true on 24-bit machines. If you have 32-bit clean ROMs, the bits
  993. quoted above are moved to BFF. This is because on 24-bit ROMs, those bits are in
  994. the upper byte of the pointer to the Macsbug entry point. In 32-bit mode, those
  995. bits have to be moved elsewhere in order to keep the pointer 32-bit clean.
  996.  
  997. if (On32BitMachine())
  998.     debuggerBits = *(char*) MacJmp;
  999. else
  1000.     debuggerBits = *(char*) 0x0BFF;
  1001.  
  1002. Boolean debuggerRunning = (debuggerBits & 0x20 != 0);
  1003.  
  1004. I think that the Macsbug 6.2 manual can help you write the On32BitMachine()
  1005. function.
  1006.  
  1007. - --
  1008. Keith Rollin
  1009. Phantom Programmer
  1010. Taligent, Inc.
  1011.  
  1012.  
  1013. +++++++++++++++++++++++++++
  1014.  
  1015. From: piovanel@ghost.dsi.unimi.it (marco piovanelli)
  1016. Organization: Computer Science Dep. - Milan University
  1017. Date: Thu, 7 May 1992 14:33:27 GMT
  1018.  
  1019. Well, I posted this some time ago, but I couldn't get an answer.
  1020. The question is: how do you find out if a debugger (I'm using
  1021. MacsBug 6.2.1) is currently installed?  Is there a Gestalt selector
  1022. for this piece of information?  Some low-mem global to check?
  1023. The obvious way, that is: checking the address of the _Debugger trap
  1024. (0xA9FF) against that of _Unimplemented doesn't seem to work, because
  1025. the two addresses ALWAYS match, even if MacsBug IS installed.
  1026. Maybe MacsBug doesn't need to implement the _Debugger trap because it
  1027. traps the trap dispatcher directly (?)
  1028.  
  1029. The reason why I am interested in this is that an FKEY I wrote to drop
  1030. me into MacsBug with one keystroke {0xA9FF, 0x4E75} crashes my Mac if
  1031. I happen to boot it with Extensions Disasbled (debugger doesn't load)
  1032. and I simply don't want this to happen.
  1033.  
  1034. Thanks in advance for any hints.
  1035. Please e-mail me, because I am seldom able to access this newsgroup.
  1036.  
  1037. ---------------------------
  1038.  
  1039. End of C.S.M.P. Digest
  1040. **********************
  1041.