[comp.sys.mac.programmer] SwapMMUMode? or GetPixBaseAddr?

mkt059@ipl.jpl.nasa.gov (Mike Tschudi (Cartographic Applic.)) (11/26/90)

Has anyone had experience with SwapMMUMode or 32-bit QuickDraw's
GetPixBaseAddr?

I'd like to alter the values of pixels in an offscreen GWorld, but
GetPixBaseAddr says that it returns a 32-bit pointer that is the
only way to get to the offscreen GWorld's PixMap, and SwapMMUMode
crashes my Mac (IIcx using Think C 4).


Michael Tschudi
Cartographic Applications Group
Jet Propulsion Lab, Pasadena, CA

russotto@eng.umd.edu (Matthew T. Russotto) (11/28/90)

In article <77758@ipl.jpl.nasa.gov> mkt059@ipl.jpl.nasa.gov (Mike Tschudi (Cartographic Applic.)) writes:
>Has anyone had experience with SwapMMUMode or 32-bit QuickDraw's
>GetPixBaseAddr?
>
>I'd like to alter the values of pixels in an offscreen GWorld, but
>GetPixBaseAddr says that it returns a 32-bit pointer that is the
>only way to get to the offscreen GWorld's PixMap, and SwapMMUMode
>crashes my Mac (IIcx using Think C 4).

There is a tech note on this-- what happens is the PC looks like this:
XXYYYYYY, so when you swapMMUMode, those XXs cause the machine to go
off into lala land and crash.  You need a bit of inline assembly to
fix the PC so it looks like 00YYYYYY before you call SwapMMUMode.


--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
     .sig under construction, like the rest of this campus.

ph@cci632.UUCP (Pete Hoch) (11/29/90)

In article <77758@ipl.jpl.nasa.gov>, mkt059@ipl.jpl.nasa.gov (Mike Tschudi (Cartographic Applic.)) writes:
> Has anyone had experience with SwapMMUMode or 32-bit QuickDraw's
> GetPixBaseAddr?
 
> I'd like to alter the values of pixels in an offscreen GWorld, but
> GetPixBaseAddr says that it returns a 32-bit pointer that is the
> only way to get to the offscreen GWorld's PixMap, and SwapMMUMode
> crashes my Mac (IIcx using Think C 4).
 
I think you will find that the documentation for GetPixBaseAddr said
that you may get a 32 bit address back.  There is another call to
find out if it really is a 32 bit address.  Now ask yourself, "Where
would a 32 bit address come from, since my Mac runs in 24 bit mode?"
The answer my friend is ridding on the NuBus.  If you want to support
the 8/24 GC graphics card from Apple then you may get a 32 bit address.
If you don't care about this card, then do not worry.

If you want to do the right thing and supprot it, then I suggest you
get a real development system where you can call SwapMMUMode. ;=]

Pete Hoch