home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!apple!mumbo.apple.com!gallant.apple.com!seuss.apple.com!user
- From: absurd@apple.apple.com (Tim Dierks, software saboteur)
- Subject: Re: Is this a BaseAddress problem with the Quadra .?.?.?.
- Sender: news@gallant.apple.com
- Message-ID: <absurd-191192162053@seuss.apple.com>
- Date: Fri, 20 Nov 1992 00:38:14 GMT
- References: <1992Nov18.232653.13027@news.vanderbilt.edu>
- Organization: MacDTS Marauders
- Followup-To: comp.sys.mac.programmer
- Lines: 62
-
- In article <1992Nov18.232653.13027@news.vanderbilt.edu>,
- BLOOMDA@ctrvax.vanderbilt.edu (_creative_output_) wrote:
- > 8-bit mode. That's when I learned about incorporating the slot
- > number of the video card into the base address:
- > ( ( baseAddr >> 24 ) | something ) << 20 | baseAddr, or somesuch
- >
- > - Dave =(^;|= Dave Bloom, JSPS
- > bn: bloomda@vuctrvax
- > in: bloomda@ctrvax.vanderbilt.edu
- > "Mekka Lekka Hai, Lekka Heinie Ho"
-
- Here's the right way to get the slot number of a monitor, given its
- GDevice: (as a bonus, this also gets the name of the card in
- question; to just get the slot, chop off all the lines after the
- *slot = ... line.
-
- OSErr
- GetSlotAndName(GDHandle gDev,short *slot,char *name)
- { OSErr err;
- short refNum;
- SpBlock spb;
-
- refNum = (**gDev).gdRefNum; // video driver refNum for this GDevice
- *slot = (**(AuxDCEHandle)GetDCtlEntry(refNum)).dCtlSlot;
- // slot in which this video card sits
-
- spb.spSlot = *slot; // In the slot we're interested in
- spb.spID = 0;
- spb.spExtDev = 0;
- spb.spCategory = 1; // Get the board sResource
- spb.spCType = 0;
- spb.spDrvrSW = 0;
- spb.spDrvrHW = 0;
- spb.spTBMask = 0;
-
- err = SNextTypeSRsrc(&spb);
- if (err)
- return err;
-
-
- spb.spID = 2; // Getting the description string
- // spSPointer was set up by
- SNextTypesResource
- err = SGetCString(&spb);
- if (err)
- return err;
-
- strcpy(name,(char *)spb.spResult); // Get the returned string
- DisposPtr((Ptr)spb.spResult); // Undocumented; we have to dispose of
- it
-
- c2pstr(name);
-
- return noErr;
- }
-
- You should also be very careful to use SwapMMUMode() to switch into
- 32-bit mode any time you write to the framebuffer, regardless of what
- bitdepth it is at.
-
- Tim Dierks
- MacDTS, but what?
-