[comp.sys.mac.programmer] My 256K ROMs aren't smart enough, or Are Apple ROM programmers sloughing off?

mystone@sol.engin.umich.edu (Dean Yu) (11/07/88)

   OK, will somebody at Apple please tell me that the people who programmed
the Mac II ROMs were really doing their jobs instead of playing NetTrek?  Two
of us have been working on a color version of ShowINIT that will display a
color icon if the machine it is running on has Color QuickDraw, and plot the old
black and white icon if CQD isn't available.
   No, big deal, right?  Well, we call GetCIcon, assuming that it will set
the pointers to all the PixMaps and BitMaps correctly as is stated in IM V.
We rant and rave for a few hours thinking that our knowledge of 68000 was a
little lax, and we had the wrong addressing modes, etc.  Then we wisened up
and decided to use the debugger, and take a look at what's going up.  Guess
what we found?  The baseAddr fields in all the maps were NIL!  Specifically,
 CIcon.iconPMap.baseAddr, CIcon.iconMask.baseAddr, and CIcon.iconBMap.baseAddr
were all set to nil.  Now I quote from IM V, on GetCIcon:

  "The GetCIcon function allocates a CIcon data structure and initializes it
using the information in the resource of type 'cicn' with the specified ID."

  So.  What's the story?  If it sounds like I'm ticked, I am.  I'm getting
tired of trying to write neat programs, and finding out that there are
problems with the ROMs.  How are we supposed to expect to write decent
programs if the tools which make the Mac the Mac don't work like they're
supposed to?
  True, we can figure out where all the maps are stored by hand (we think),
but why should this be done when Apple should have done it for us?

______________________________________________________________________________
Dean Yu                            |  E-mail:    mystone@caen.engin.umich.edu
University of Michigan             |  Real-mail: Dean Yu
Computer Aided Engineering Network |             2413 Kelsey House
===================================|             600 E Madison
"These are MY opinions." (My       |             Ann Arbor, MI 48109
 employer doesn't want them.       |==========================================
 Actually, they don't really care  |
 what I think.  But President      |   This space intentionally left blank.
 Duderstadt does...)               |
------------------------------------------------------------------------------

spector@vx2.NYU.EDU (David HM Spector) (11/07/88)

Paul Mercer, the author of ShowInit, has just released a new version
(in source) on AppleLink that does exactly what you want, it will show
a cicn if its available and the grafDevice is >= 4 bits or show a
plain ICN# otherwise.  I will drop him a note on AppleLink and ask if
it may be posted.

_DHMS
-------------------------------------------------------------------------------
David HM Spector				   New York University
Senior Systems Programmer			   Stern School of Business
ARPAnet: SPECTOR@GBA.NYU.EDU			   Academic Computing Center
USEnet:...!{allegra,rocky,harvard}!cmcl2!spector   90 Trinity Place, Rm C-4
HamRadio: N2BCA      MCIMail: DSpector             New York, New York 10006
AppleLink: D1161     CompuServe: 71260,1410        (212) 285-6080
"Capital punishment is our society's recognition of the sanctity of human life"
			- Senator Orrin Hatch

earleh@eleazar.dartmouth.edu (Earle R. Horton) (11/07/88)

In article <3f84800b.59b7@sauron.engin.umich.edu> mystone@sol.engin.umich.edu 
	(Dean Yu) writes:
...
>  So.  What's the story?  If it sounds like I'm ticked, I am.  I'm getting
>tired of trying to write neat programs, and finding out that there are
>problems with the ROMs.  How are we supposed to expect to write decent
>programs if the tools which make the Mac the Mac don't work like they're
>supposed to?

     Repeat after me:

Write a line of code.
Look at what really happens with a debugger.
Write another line of code.
Look at what really happens with a debugger.
Write another line of code.
Look at what really happens with a debugger.
Repeat...

     I've been through this a million times.  All sorts of Toolbox
functions fail to function in the documented manner, or in what I
THINK is the documented manner.  Half the time, it's me.  Half the
time, it's the documentation being ambiguous.  The other half, it's
the ROM.

     The only way to make steady progress when entering the realms of
functions which you have not used before is to look at the return
value[s] the first few times you use them.  Sure, it seems to take a
little longer this way, but you KNOW how the call works after you do
this a few times, and don't get bitten later.

     Another thing.  This is not a problem which is unique to the
Macintosh.

Earle R. Horton. 23 Fletcher Circle, Hanover, NH 03755
(603) 643-4109
Sorry, no fancy stuff, since this program limits my .signature to three

brecher@well.UUCP (Steve Brecher) (11/08/88)

The current version of Paul Mercer's ShowINIT displays cicns, if present,
using GetCIcon and PlotCIcon.  Works fine for Pyro! 3.x.  So I don't think
there's a system software problem.

ShowINIT is available on AppleLink.  Source code may be available from Mercer.