[comp.sys.mac.programmer] System Error 389?

ralphm@portia.Stanford.EDU (Ralph Melton) (02/19/91)

I'm using Programmer's Key 1.1b4 with thirty-something other inits on a
Mac SE/30.

Recently, having wandered into great weirdness with a deranged piece of
assembly code, I decided that I had munged memory enough to justify a
reboot.  When I used Programmer's Key's Command-Shift-Power to reboot,
however, it dropped me into Macsbug with a "System Error 389." A cursory
glance of the preceding code revealed nothing unusual.

Since I was trying to reboot anyway, I just gave an "rb" to MacsBug.  But
I have not been able to find out what System Error 389 is, either from
the SysErrTable 3.0 DA, or Inside Mac.

Can anyone tell me what System Error 389 means?


A completely unrelated question:  I'm trying to program a module for After
Dark that demonstrates various sorting algorithms graphically.  I'm
representing the numbers being sorted as colored dots against a black
background.

I would like to color the dots such that the color of a dot
indicates the low few bits of the value that the dot represents.
That is, in 1 bit mode, every dot would be white, in two bits, the color
of a dot would indicate whether the value of the dot was even or odd,
and in 4 bits of color, the color of the dot would indicate
[the value of the dot] mod 8.

The simplest way I see to do this is to choose a set of eight RGB colors,
which I'll refer to as RGB [0..7], such that:

In one bit, all the colors map to white.
In two bits of color, all the colors RGB[i] map to one non-black color for
	i odd, and to a different color for i even.
In four bits, all RGB[i] map to different non-black colors.

How can I do this?
Is it even possible to assume that I can find a set of colors that will have
these properties on all color Macs?
If so, should I just generate a new set of colors at initialization time?
Am I being too limiting by not giving the user a way to choose his or her
own colors?


One last question:  Is it inappropriate for me to call Random from within
an After Dark module?  I realize that, since I don't have globals, if I 
call Random, I am stepping on the RandSeed global of someone else's
A5 world.  But RandSeed is supposed to contain a pseudorandom number.
If I replace it with a different pseudorandom number, will I give any
program problems?

Thanks in advance,

Ralph Melton

-- 
Ralph Melton	The White Rabbit	ralphm@portia.stanford.edu

"An algorithmic tour de force.  Best of all, it seems to work."