[comp.sys.mac.programmer] Quick and Dirty writing to screen

dagraham@unix1.tcd.ie (David Graham) (05/06/91)

Hi there,

Can anyone tell me, is there a quick and dirty way of directly addressing
screen memory so I can write a very fast squidgy text drawer?

This isn't for anything 'proper', and I only need it to work on my IIsi.
Since the IIsi video memory is part of main memory (isn't it physical
addresses from 0 upwards?), can I bypass the PMMU and write straight into
'real' location 0, or wherever?

And is the screen memory organised , as described in IM V, in 'chunky'
format? So, in 256 colour mode, each byte will be a pixel?

All I need is the base address of the screen, how to bypass the PMMU trying
to turn my address into something sensible, and that will probably do.

Info on other Macs, and addressing NuBus video cards would also be
acceptable. Or if anyone could just tell me where to look, although I expect
this sort thing isn't documented, since Apple don't like people making
assumptions on changeable things like screen buffers and stuff.

Thanks in anticipation for any replies,

David Graham, JF Comp Sci, Trinity College, Dublin, Ireland
dagraham@unix1.tcd.ie
dagraham@vax1.tcd.ie

davoli@natinst.com (Russell Davoli) (05/07/91)

In article <dagraham.673539752@unix1.tcd.ie>, dagraham@unix1.tcd.ie (David Graham) writes:
> Hi there,
> 
> Can anyone tell me, is there a quick and dirty way of directly addressing
> screen memory so I can write a very fast squidgy text drawer?
> 
> This isn't for anything 'proper', and I only need it to work on my IIsi.
> Since the IIsi video memory is part of main memory (isn't it physical
> addresses from 0 upwards?), can I bypass the PMMU and write straight into
> 'real' location 0, or wherever?
> 
Since the PMMU is built-in to the 68030, it's pretty tough to bypass since
all addresses generated by the processor take a trip through the MMU before
hitting the bus. I'm pretty sure, though, that Apple has published somewhere
what the logical address range of the video memory is (seems like I saw
some IIci development notes that discussed this.)  Given that, you should be
able to write to the logical address and have stuff show up on the screen.

If instead you have a device on the NuBus which is going to write to the
on-board video memory, you better get the right physical address.

> Info on other Macs, and addressing NuBus video cards would also be
> acceptable. Or if anyone could just tell me where to look, although I expect
> this sort thing isn't documented, since Apple don't like people making
> assumptions on changeable things like screen buffers and stuff.
> 
I've seen things where people have written directly to video memory on the
NuBus video cards.  The MMU does nothing to NuBus addresses, so their
logical and physical addresses are the same.  Such techniques are great
for showing raw speed, like a DSP board that calculates something then blasts
the display to the Mac screen, but it's really unfriendly to any windows
or part of the desktop that happens to be where bits have been blasted.
I certainly don't think it's appropriate for anything that ships commercially.

--Russell