HDTenEightyP/NetNews huggingface dataset:
From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
Subject: Re: using the A5 register (help wanted)
Organization: University of Illinois at Urbana
Date: Mon, 4 Jan 1993 02:02:44 GMT
Keywords: Help wanted

In <1993Jan3.180416.2891@mnemosyne.cs.du.edu> rduta@nyx.cs.du.edu (Radu) 
writes:

>I was wandering if someone could explain to me how the A5 register works.
>And as logn as we are on the subject, what is the purpose for SetUpA5 & 
>RestoreA5, and when are they used.  

A5 is used as a base to reference all of an application's global variables. If
you are programming in a high-level language, you usually never need to be 
concerned with this fact, as long as you are writing an application with no 
interrupt-driven code. THAT sort of code (like VBL routines that run every time
the hardware draws the screen and some other types of code that might be 
running wt a time when the system has moved another application's value into 
A5) needs to get access to application globals and can do so by using the 
SetUpA5 and RestoreA5 routines. The details on these is to be found in IM VI or
in the tech notes.

>If someone could direct me to a FTP site that caries info files, I'd apreciate
>that also.

ftp.apple.com. Apple's ftp site. for tech notes, check dts/mac/tn
From: aleskine@cs.hut.fi (Arto Leskinen)
Newsgroups: comp.sys.mac.programmer
Subject: StyledLineBreak
Date: 25 Dec 92 22:27:58 GMT
Distribution: comp.sys.mac.programmer
Organization: Helsinki University of Technology, Finland

I have tried to use SryledLineBreak function in my program. I know how to do
this with NFindWord, but I thought that StyledLineBreak would be faster.
But I can not make it to work. Here is my function:

long lineLength(mTextSHand mTRecH, long chars, long line,
		mLineStyleRec *lineStyles, short styleCount)
{
	unsigned char *cPtr, **cHand;
	unsigned short i, width = 0, offset = 1;
	long start;
	FormatOrder order[kMaxLineStyles];
	StyledLineBreakCode sLBCode = smBreakOverflow;
	
	for ( i=0; order[i][0] = i++; );
	start = (*(*mTRecH)->lineStarts)[line];
	cHand = capCpyStr((**mTRecH).currText, start, chars);
	width = (**mTRecH).destRect.right - (**mTRecH).destRect.left;
	if ( cHand && **cHand)
	{
		cPtr = *cHand;
		styleCount = setLineStyles(mTRecH, line, lineStyles);
		GetFormatOrder(order, 0, styleCount, (Boolean)GetSysJust(),
					mTRLDirProc, (Ptr) lineStyles);
		for (i = 0; lineStyles[order[i][0]].tStyleH && 
		(sLBCode == smBreakOverflow); i++)
		{
			setTextStyle(lineStyles[order[i][0]].tStyleH);
			sLBCode = StyledLineBreak(cPtr, chars,
				lineStyles[order[i][0]].start,
				lineStyles[order[i][0]+1].start-1, 0L, &width,
				&offset);
		}
		return (offset ? offset : chars);
	}
}
the offset will be always 0, I have thought that it will be set to byte count
for line break position. Linestyles in an array of structs where there is 
handle to stylerec and start(long). When line wrap happends, return value
is right, but offset is 0. Any Ideas?

I would like to loop through styles and return number of chars that will go
into line.

Arto Leskinen
aleskine@cs.hut.fi
From: parej@JSP.UMontreal.CA (Pare Jerome)
Newsgroups: comp.sys.mac.programmer
Subject: Licensing and the rights of programming environments...
Date: 2 Jan 93 18:11:36 GMT
Distribution: na
Organization: Universite de Montreal

Hi to all of you and a happy new year!

I have a question regarding the rights you have when programming in an
environment (Think C and Pascal, MPW, and the others...):
Can you commercially program "right out the box" and sell your programs
commercially or do you need to get extra licensing to distribute your
products (from Think, Apple, and other makers...)?

Thanks for the replies!
Jerome.

-- 
Ciao!
Jerome Pare	parej@jsp.umontreal.ca
Newsgroups: comp.sys.mac.programmer
From: sold@kit.uni-kl.de (Christoph Sold)
Subject: Re: Extracting the color table from PICT
Organization: Universitaet Kaiserslautern
Date: Fri, 1 Jan 1993 15:22:02 GMT

In article <Bzn0t9.2uu@rahul.net> mike@rahul.net (Mike Smithwick) writes:
>From: mike@rahul.net (Mike Smithwick)
>Subject: Extracting the color table from PICT
>Date: Tue, 22 Dec 1992 01:43:57 GMT
>[]
>
>Where is the colortable information in a PICT color image file. IM 5 isn't
>quite as clear as I would like it to be in its PICT description. Is 
>there any source code available??
>
>mike
>
Mike,

have a look at the Picture Utilities Package, described in IM Vol. VI. 
Everything you need is there.

-Christoph
---------------------------------------------------------------------------
Christoph P. Sold                   CATS Software GmbH
                                    Mussbacher Landstr.2
sold@kit.uni-kl.de                  W-6730 Neustadt (Weinstrasse)
ger.xse0035@applelink.apple.com     Germany

"If an apple is fun, what the heck is an appletree?"
Newsgroups: comp.sys.mac.programmer
From: rmah@panix.com (Robert Mah)
Subject: Re: Problem with patch to HFSDispatch
Date: Mon, 28 Dec 1992 02:25:59 GMT
Organization: PANIX Public Access Unix, NYC

In <absurd-221292190600@seuss.apple.com> absurd@apple.apple.com (Tim Dierks, software saboteur) writes:

>Your problem is that you're destroying A1; it's used as a parameter by
>some HFSDispatch selectors.

>While you could do this by trashing a different register, which isn't
>used, you could always use the slightly more complex but somewhat more
>clever method.

>       clr.l    -(sp)                     ; save room for forwarding address
>>      movem.l  a4, -(sp)                 ; save registers
>>      lea      main, a4                  ; setup globals
>>      cmp.w    #5, d0                    ; if not CatMove
>>      bne.s    @1 
>>      move.w   #1, gNeedsUpdate          ; set the gNeedsUpdate flag
>> @1   move.l   realHFSDispatchTrap,4(a7) ; store forwarding address on stack
>>      movem.l  (sp)+, a4                 ; restore registers
>       rts                                ; jump to real HFSDispatch

>Note that this preserves all the registers by using the trick of using
>an RTS to pop the jump address off of the stack, allowing you to restore
>all your registers first.

Thanks I'll try it and see how it works.  But won't changing the return 
address mess up some toolbox things.  I seem to recall that that was why
"tail patches" were not allowed -- of course, I could be totally confused
here :->

Thanks again,
Rob
-- 
[--------------------------------------------------]
[  Robert S. Mah   |  "Every day an adventure,     ]
[  rmah@panix.com  |   every moment a challenge."  ]
[--------------------------------------------------]
Newsgroups: comp.sys.mac.programmer
Subject: Window Zooming
From: matsrc@vaxa.hofstra.edu
Date: 1 Jan 93 12:28:30 EST

Happy New Year everyone, and to start it off some questions about
window zooming. I've read the Tech Notes, the various discussions in
Inside Macintosh, and now Dean Yu's code for window zooming, but there
are two things that are still not clear to me in my quest for
absolutely p.c. (_not_ PC :) ) zooming.

(1) FindWindow (actually, the standard WDEF) returns inZoomIn or
inZoomOut on the basis of a comparison of the window's portRect with
its stdState. This means to me that the stdState must be calculated
_before_ the user clicks in the zoom box in order for the correct
decision to be made. The time to do this seems to be after any drag or
resize. However, the code given in the Tech Notes and that given by
Dean Yu calculate the stdState _after_ the click in the zoom box. Which
is correct?

If you ask what difference does it make, consider the following
scenario: A window is put in its standard state, which is smaller than
the screen  (like a Finder window). It is then moved elsewhere on the
screen, but to another valid position for its standard state. When the
user clicks on the zoom box, you would like FindWindow to return
inZoomIn because the window is in its standard state, but how will
FindWindow know that?

(2) Which takes precedence when switching to the standard state:  The
desire to leave the top left corner fixed, or the desire to leave space
on the right of the main screen for Finder icons? Dean Yu's code would
leave the top left corner fixed and allow the standard state to cover
the icons, if this fits on the screen. Only if it does not fit is the
window moved and resized to uncover the icons. The Finder, naturally
enough, gives precedence to uncovering its own icons (try it). Which
ought it to be?

Questions to ponder for 1993.
--Steve Costenoble
--matsrc@vaxc.hofstra.edu
Newsgroups: comp.sys.mac.programmer
From: rmah@panix.com (Robert Mah)
Subject: Re: Why the Piracy? Here's why...
Date: Mon, 28 Dec 1992 02:33:48 GMT
Organization: PANIX Public Access Unix, NYC

In <bobert.725146974@godzilla> bobert@informix.com (Robert Murphy) writes:

>In the U.S., a software company typically gets only 30-40% (or less) of the
>suggested retail price; the rest goes to the distributors and dealers who
>get the product to the customer.

Actually, the margins for a software publisher is around 50% -- even for 
very small companies.  You can sometimes even get 60% margins.  It all
depends on how powerful you firm is, how many units you're going to move,
how expensive each unit is and what kind of co-marketing deals you have
going with the distributors and/or retailers.

I used to work for a small software firm (less than $5 mil in sales), and
we were able to get 55% margin at times for a product with a retail price
of $295.  I'm not sure, but I don't think our sales staff was imbued with
an excess of genius.

Cheers,
Rob
-- 
[--------------------------------------------------]
[  Robert S. Mah   |  "Every day an adventure,     ]
[  rmah@panix.com  |   every moment a challenge."  ]
[--------------------------------------------------]
From: bpb9204@tamsun.tamu.edu (Brent Burton)
Newsgroups: comp.sys.mac.programmer
Subject: Re: abs(-32768) = -32768 in Th C
Date: 21 Dec 1992 20:12:56 -0600
Organization: Texas A&M Univ., Inc.
NNTP-Posting-Host: tamsun.tamu.edu
Keywords: Think C

ficara@remus.rutgers.edu (ken ficara) writes:
|
|Corllary: when I say "printf("%d\n",INT_MIN);" I get "-32768." But
|when I open up <limits.h> and look at it, it says "#define INT_MIN
|(~32767)". Huh?
|
|Ken Ficara                                        ficara@remus.rutgers.edu

This is correct.  For example, if we have 4-bit signed integers, then the
range will be from -8 to +7.  The 4th bit (MSb) is the sign bit:
  0111 = 7
  0110 = 6
   ...
  0000 = 0
  1111 = -1
  1110 = -2
   ...
  1000 = -8

To convert a negative 2's complement bitset to it's value, you first
write the complement of the bits, and then add 1 to that (now treated
as unsigned value).  The resulting unsigned value is the magnitude of
the negative number, so -8 (1000) is treated as:
  1000 = -8                         |     1110 = -2
  0111 = 7  (complement of above)   |     0001 =  1 (~)
 +0001      (add one)               |    +0001      (+1)
 =1000 = 8  (unsigned value here).  |    =0010 =  2 

If I defined INTMIN for the above 4 bit system, I'd define it as
  #define INTMIN (~7)
which evaluates to (~0111) = 1000 = -8
Now just add the proper number of 0's and 1's to the above example and
you get the proper values for -32768.

-Brent
For a number represented in 2's complement by n bits, the max will 
be  (2**n)-1 and the minimum will be -(2**n).

-- 
+-------------------------+
| Brent Burton    N5VMG   |    
| bpb9204@tamsun.tamu.edu |  
+-------------------------+
From: chuck@gte.com (Chuck Hoffman)
Newsgroups: comp.sys.mac.programmer
Subject: Re: New to macintosh programming...
Date: 29 Dec 92 13:07:11 GMT
Followup-To: comp.sys.mac.programmer
Organization: GTE Laboratories

In article <1992Dec28.230134.14720@medmail.stanford.edu>,
brucet@leland.Stanford.EDU (Bruce Templeton) wrote:
> 
> In article <chuckb.725567825@milton> chuckb@milton.u.washington.edu (Chuck Bass) writes:
> >I am an experienced C programmer beginning work on a 
> >Mac (coming from workstation/PC programming).  I am wondering if
> >there is a specific book or other reference to help my
> >transition to the mac.  I would like learn specifics about
> >portability issues such as memory allocation and file IO.
> >
> >If anyone has any info, anecdotes, references on making this
> >transition I would apprecitate it.
> >
> >chuckb
> >
> >(I'm using Think C)
> 
> The best introduction for C on the Macintosh is called (I think) _Macintosh
> C Primer vol. 2_.  I'm not sure about the name because I don't have it in
> front of me now.

Mark, Dave, and Cartwright Reed, "Macintosh C Programming Primer,
     Volume I," second edition, Addison-Wesley Publishing Co., 1992,
     ISBN 0-201-60838-3, $26.95 (USA).

Mark, Dave, "Macintosh C Programming Primer, Volume II," Addison-
     Wesley Publishing Co., 1990, $24.95 (USA).


> Also, anyone programming on the Macintosh needs the _Inside Macintosh_ series.

Available through Apple Programmers and Developers Association (APDA). 
Their toll-free telephone order number for the U.S. is:  800-282-2732.

> -bruce templeton


Chuck Hoffman
chuck@gte.com
GTE Laboratories, Waltham, Massachusetts, USA
(617) 466-2131
=====================================
I'm not sure why we're here, but I am sure that while we're here we're
supposed to help each other.
=====================================
Newsgroups: comp.sys.mac.programmer
From: jimlynch@netcom.com (Jim Lynch)
Subject: Re: Licensing and the rights of programming environments...
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
Distribution: na
Date: Sun, 3 Jan 1993 11:45:29 GMT

In article <1993Jan2.181136.18003@cc.umontreal.ca> parej@JSP.UMontreal.CA (Pare Jerome) writes:
>Can you commercially program "right out the box" and sell your programs
>commercially or do you need to get extra licensing to distribute your
>products (from Think, Apple, and other makers...)?

You can with Think.
From: russotto@eng.umd.edu (Matthew T. Russotto)
Newsgroups: comp.sys.mac.programmer
Subject: Re: How might one patch the OS to automagically  reboot during hw/sw except
Keywords: exception reboot macsbug kiosk how
Date: 3 Jan 93 03:40:35 GMT
Distribution: comp.sys.mac.programmer
Organization: Project GLUE, University of Maryland, College Park

In article <drutman.725933707@sol.UVic.CA> drutman@sol.UVic.CA (D. Rutman) writes:
>I  have a MMind director presentation using a dvi card that sometimes fails. I would like to ensure that the mac will reboot automatically in the event of any
>software or hardware exception. The mac is in an unattended kiosk so if it crashes, no one will fix it. So until  I pin down whether the cause, I'd like to cylce the cpu and satrat from scratch. Any suggestions?

Patch 'SysError' to always do a restart.  Though I'm not sure that
will get all of them-- you may have to mess with the 68000 exception
vectors as well.
-- 
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
Some news readers expect "Disclaimer:" here.
Just say NO to police searches and seizures.  Make them use force.
(not responsible for bodily harm resulting from following above advice)
Newsgroups: comp.sys.mac.programmer
From: cole@alexia.lis.uiuc.edu (Sandra Stewart-Cole)
Subject: Re: One binary for all Macs (even 128K)
Organization: University of Illinois at Urbana
Date: Sun, 3 Jan 1993 19:30:01 GMT

The 128 and 512k are not worth supporting. As someone who actually wrote 
programs for them I am saddened in saying that, but the simple fact is that the
total number of pre-plus Macs sold was small, and since there were Apple 
upgrades available to Plus status, 3rd-party upgrades to Plus status, and some
really hazardously shoddy power supplies, ther are not too many of them left 
out there. 
 
I have seen twice in my 8-year history using the Mac a citation of exponential
sales growth. The first was with the Plus, then with the price cut of '90. Both
time the Mac press ended up drooling about Apple having sold as many units in a
year as in all previous years. (I'm being vague because I can't remember the 
exact citations, but remember reading such stories)  Given that a used Plus is
a $300 investment, the pre-Plus market is by nature a cheapskate market. That 
makes it real tough to actually sell anything to them, and if you try to make 
software that can work on ANY Mac you will have to count on selling to people 
with modern macs and maybe having some 2nd-hand sales to people with old Macs.
On the other hand, if you restrict yourself to using only that information in 
Inside Mac vI-vIII, and add harmless things like vers and SIZE resources for 
later Macs to use, it is a SIMPLE project. The only trouble is that you will 
have some pretty austere programs. 
Newsgroups: comp.sys.mac.programmer
From: urban@yoda.fsl.noaa.gov (Art Urban)
Subject: TCL: Did I Cheat, or What?
Organization: Forecast Systems Lab, NOAA, Boulder CO, USA
Date: Wed, 30 Dec 1992 17:19:52 GMT

Last night I thought it would be great if I could write a CMouseTask
subclass which drags visual entities around in a window. Fine. I created a
subclass of CPane and in it invoked my CDragOutlineTask in a TrackMouse()
call. Much to my surprize this "nearly" worked. The problem I had was that
the click in CMyPane was invoking the Prepare() method which sets up a
clipRgn equal to CMyPane's aperture. Ergo, my DragGrayRgn() call was
getting clipped to CMyPane's bounding rectangle...not exactly what I was
hoping for.

So, I began to look for a method (inherited or otherwise) which would allow
me to redefine the clipRgn. I found none, so I passed a Prepare() message
to CMyPane's enclosure which conveniantly was theMainPane. This did the
trick. My gray region now is visible and clipped within the window. The
question is however, did I cheat? Was there a better way to achieve my
desired result?

-- 
Art Urban 					        urban@yoda.fsl.noaa.gov
===============================================================================
 "Look, he's being attacked by creamy nugget centers."		 	 -Joel
===============================================================================
From: steelem@rintintin.Colorado.EDU (STEELE MARK A)
Newsgroups: comp.sys.mac.programmer
Subject: THINK C bug??
Date: 22 Dec 92 00:12:48 GMT
Distribution: na
Organization: University of Colorado, Boulder

A few days ago a thread appeared questioning a bug in Think C on a Quadra.
I replied to the author that I hadn't yet experienced this problem. I have
yet to see any more posts about this, however this past weekend I turned
on the profiler and have stdout redirected to a file so I could review it.
Here is what I encountered: The file that was open before running the program
to be profiled would become corrupt. A #define at the beginning of the file
suddenly became #ddddd folloed by some garbage characters. the last line
of the file became duplicated, since it contains the closing bracket, this
was an error. I clean this file up and reran the program, the debugger would
hang at this point. I then rebuilt the project by removing all objects and
discovered that some headers would be too big for the current segment.
These headers are supplied by symantec so I would think that they are ok 
and the project has just been corrupted.
Has anybody else with a Quadra and Think C 5.0.4 ran into this problem?
Remember that I have only had this problem when the profiler has been turned
on and I run with the debugger. The problem occurs after running the app a
few times. I have run a memcheck program that checks out, I have also run
Norton Disk Doctor on the HD to look for problems, none found.

-Mark
steelem@rintintin.colorado.edu
Newsgroups: comp.sys.mac.programmer
From: d88-jwa@hemul.nada.kth.se (Jon Wtte)
Subject: Re: What does TRY/CATCH/ENDTRY do?
Organization: Royal Institute of Technology, Stockholm, Sweden
Date: Wed, 23 Dec 1992 11:21:22 GMT

In <1h8402INN6io@iskut.ucs.ubc.ca> guxu@physics.ubc.ca (Guang Xu) writes:

>The following code is found in Think C class Library:
>TRY{
>CATCH{
>END TRY

No space there...

>What do they mean?


An excellent description for this exception handling mechanism
(which is good and should be used) is found in the TCL Reference
manual that came with the compiler. You could also look the
mechanism up in the source, which is recommended for deeper
understanding.

Never ever do a return from withing a TRY/CATCH/ENDTRY, by
the way.

Cheers,

							/ h+

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  "It was, in fact, cool as all get-out.  Fortunately it was a little
   too late (historically speaking) to be groovy."
                     -- Dennis Pelton
From: evans@ece.arizona.edu
Newsgroups: comp.sys.mac.programmer
Subject: Transfering files between Mac and Sun
Date: 23 Dec 92 02:28:44 GMT
Reply-To: evans@ece.arizona.edu
Distribution: world,local
Organization: University of Arizona Dept. of Electrical and Computer Engineering


How do you transfer files between the Mac and
Sun operating on Unix?  The Max is on the phone
line but not the network.  HELP!!
Newsgroups: comp.sys.mac.programmer
From: niko@iastate.edu (Nikolaus E Schuessler)
Subject: * Disks, tracks, and rpm
Organization: Iowa State University, Ames, IA
Date: Fri, 1 Jan 1993 17:09:15 GMT

Inside Mac II-211 gives the following layout for an 800k disk:

Tracks Sectors/Trk  
0-15       12
16-31      11
32-47      10
48-63       9
64-79       8

1) Does anyone know the equivalent table for a 1440k disk?
2) I assume the mac doesn't use an interleaving scheme... right?
3) Any ideas on the rpm of the drive for each sector/Trk combination?

Also, if there is a unix guru reading this as well, how
might one best set up a 'disktab' entry for this --
kinda tricky with variable rpm and sectors/trk...

-- 
Niko Schuessler               
Project Vincent Systems Manager              email: niko@iastate.edu
Iowa State University Computation Center     voice: (515) 294-1672
Ames IA 50011                                snail: 272 Durham 
Newsgroups: comp.sys.mac.programmer
From: bwilliam@iat.holonet.net (Bill Williams)
Subject: Re: talking to 2nd SCSI bus?
Organization: HoloNet National Internet Access BBS: 510-704-1058/modem
Date: Wed, 23 Dec 1992 06:44:50 GMT

You may not use the SCSI manager to communicate directly with SCSI
accelerators such as ATTO's Silicon Express series, 68000 Inc.c SCSI Bolt,
or the amazing FWB JackHammer card.

The new SCSI manager (SCSI Manager 4.3) shipping soon with the "Cyclone"
for certain (in ROM) WILL support multiple busses and you can read all
about the partially amazing new SCSI manager on AppleLink.

As to how the cards are communicated with : all are proprietary. some are
very similar to CAM models, some allow multiple cards of the same make in
the machine others (like 68000 Inc.s) have software limitations
permanently limiting the number of boards to one per machine. Yes they all
do avoid the normal 7 fixed locations in the unit table, but all three
have a bunch of high level calls that are intended for proper communication.

As the card vendors for the developers interfaces.

Bill Williams (only directly familiar with the three products I mentioned)
From: freek@phil.ruu.nl (Freek Wiedijk)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Uniquely identifying a Mac? How?
Date: 25 Dec 92 17:04:41 GMT
Organization: Department of Philosophy, University of Utrecht, The Netherlands

peter@cujo.curtin.edu.au (Peter N Lewis) writes:
>If Apple put a serial number on the 
>machine, and people successfully copy protect their programs, the immediate
>consequence of this is that the value of the machine drops a great deal.
>All those users can't pirate the programs they want, so they stop buying
>the machines, and buy other machines where they can get the programs 
>they want for free.

Yes!

That's why one of my friends (hi Jos!) bought a 486 machine and
advocated me to do the same (never!).  "Pirating software for it is
much easier because there are far more people to copy software from."

Yet another reason why Intel machines are more popular that Macs.
Not only is the hardware cheaper, the software is also cheaper...

Freek
--
Third theory of Phenomenal Dynamics:  The difference between
a symbol and an object is quantitative, not qualitative.