Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!iuvax!rutgers!apple!parent From: parent@Apple.COM (Sean Parent) Newsgroups: comp.sys.mac.programmer Subject: Re: Need help with INITs Summary: Learning the Mac Message-ID: <24070@apple.Apple.COM> Date: 16 Jan 89 20:06:31 GMT References: <541@amanpt1.zone1.com> <23872@apple.Apple.COM> <316@s1.sys.uea.ac.uk> Organization: Apple Computer Inc., Cupertino, CA Lines: 37 In article <316@s1.sys.uea.ac.uk>, jrk@s1.sys.uea.ac.uk (Richard Kennaway) writes: > In article <23872@apple.Apple.COM> parent@Apple.COM (Sean Parent) writes: > >In <541@amanpt1.zone1.com>, mrr@amanpt1.zone1.com (Mark Rinfret) writes: > >> > >> I've just recently started exploring INIT's and didn't get very far before > >> I ran into a snag. When the following small init program is run, it gets > >> a System Error (line F emulator trap) on the InitWindows call. As you can > >You need to set up A5 correctly with some code that would look like this. > Boggle!! > > This is totally over my head. I would like to write some INITs and VBQ tasks > and cdevs and so on, but Inside Mac tells me next to nothing about them. > Neither do the MPW or Lightspeed C manuals. What do I need to read? I do > know how to write ordinary applications. (But I'm not interested in anything > that would require learning assembler.) Sorry, Writting INITs and VBL tasks and the like require a good understanding of how the system operates. I know learning assembly can be a pain (68K is better than most) but nothing will aid you more in these areas then a good debugger and a strong understanding of 68K. As recommended reading (asside from the Motorola 68K manual) try reading Scott Knaster's book "How to Write Macintosh Software" (Hayden Press, I think). This book is a good introduction to how the Mac internals work and provides a lot of debugging tips. As to the code from my previouse post. A5 is a 68K register that the Mac uses to reference QD globals. It is set up to point to a pointer to thePort. Bellow the Port are the other QD globals. DeskHook is a variable stored in low memory that the system (specificaly the window manager) uses to draw the DeskTop on non Mac IIs and I believe it has a few other uses as well. If it is set to nil then the Mac will just draw the DeskTop gray otherwise it will call the routine pointed to by DeskHook to draw the DeskTop. The value of DeskHook at Init time is not defined. I hope this gives you a little more information. Learning the Mac is not easy but it can be fun. Sean