[comp.sys.mac.programmer] How to access frame buffer on Mac II?

jenlan@eos.arc.nasa.gov (Jennifer S Lanham) (02/09/91)

Hi,
  I understand it is a no-no to write to the main screen frame buffer on
  a Mac II ( x, fx, etc.).  In fact, the base address of the graphics
  device's  pixMap is 0x0000.  Does some one know how to get around this?

  Thanx,

  Jennifer Lanham
  jenlan@eos.arc.nasa.gov
  

bskendig@bow.Princeton.EDU (Brian Kendig) (02/09/91)

In article <7876@eos.arc.nasa.gov> jenlan@eos.arc.nasa.gov (Jennifer S Lanham) writes:
>  I understand it is a no-no to write to the main screen frame buffer on
>  a Mac II ( x, fx, etc.).  In fact, the base address of the graphics
>  device's  pixMap is 0x0000.  Does some one know how to get around this?

Um, use QuickDraw routines?

I don't see your problem.  You don't need to know what the base
address is; you don't need to flip bits by hand -- just call the
appropriate QuickDraw procedures, and you should be okay.

Could you clarify your difficulty?

     << Brian >>

| Brian S. Kendig      \ Macintosh |   Engineering,   | bskendig             |
| Computer Engineering |\ Thought  |  USS Enterprise  | @phoenix.Princeton.EDU
| Princeton University |_\ Police  | -= NCC-1701-D =- | @PUCC.BITNET         |
"It's not that I don't have the work to *do* -- I don't do the work I *have*."

jenlan@eos.arc.nasa.gov (Jennifer S Lanham) (02/09/91)

>In article <7876@eos.arc.nasa.gov> I write:
>>  I understand it is a no-no to write to the main screen frame buffer on
>>  a Mac II ( x, fx, etc.).  In fact, the base address of the graphics
>>  device's  pixMap is 0x0000.  Does some one know how to get around this?
In article <6091@idunno.Princeton.EDU> Brian Kendig replies:
>Um, use QuickDraw routines?
>I don't see your problem.... -- just call the
>appropriate QuickDraw procedures, and you should be okay.
>Could you clarify your difficulty?

Sorry, I should have stated that  QuickDraw is too slow for what I am trying
to do.  I WANT to get around its slowness by drawing directly to the frame
buffer.  I can do it on a plus.  Does anyone know how to draw directly to
the frame buffer on a Mac II? Any suggestions welcome and appreciated.

E-mail is fine if the general audience is not interested.

Thank you,
J Lanham
jenlan@eos.arc.nasa.gov

Lawson.English@p88.f15.n300.z1.fidonet.org (Lawson English) (02/10/91)

Jennifer S Lanham writes in a message to All

JSL> Sorry, I should have stated that QuickDraw is too slow for what 
JSL> I am trying to do. I WANT to get around its slowness by drawing 
JSL> directly to the frame buffer. I can do it on a plus. Does anyone 
JSL> know how to draw directly to the frame buffer on a Mac II? Any 
JSL> suggestions welcome and appreciated. 

Sorry, I have problems with E_Mail, but I'd like to point out that QD can be
speeded up through various means:\

1) bypass the trap dispatcher; if you are doing lots of pixel manipulation,
the 100+ cycles-per-trap-call overhead can kill you. Use NGetTrapAddress to
jump directly to where you need to go.
2) offscreen bit/pixel maps can speep things up amazingly as you don't need
to worry about clipRgns, etc whilest drawing.
3) I seem to recall that FillRect can actually be faster than LineTo for drawing
lines...


Just some suggestions for keeping withing Apple guidelines. 


Lawson
 

--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!300!15.88!Lawson.English
Internet: Lawson.English@p88.f15.n300.z1.fidonet.org

egw.weakm@p3.lanl.gov (Eric Wasserman) (02/11/91)

In the previous posting I neglected to mention that the
code assumes that the video card is in 8-bit mode.

If you can live with a slightly slower method you might try
making an offscreen pixMap, hacking its pixels directly,
and then using CopyBits to put it into a window.  I think
that would be a lot less likely to break and should get rid
of those nasty null pointer problems (since QuickDraw
handles the access to the video ram for you).

Eric
egw.weakm@p3.lanl.gov