[comp.sys.apple2] Apple II+ 80-column access

scottp@uxrd17.UUCP (Scott Popp ()) (06/07/90)

Here's a technical question that I've been unable to get answered.  Maybe
somebody out there knows:
     On an Apple 2+, with an Applied Engineering Viewmaster 80 column card,
how do you access the memory pages in which the text screen is stored.  I
am interested in directly accessing the text screen from assembly language,
in conjunction with ProDOS, but I would even be happy knowing how to do
this from DOS.  I've consulted many technical manuals, but they either have
nothing on 80-column card access, or only mention Apple 2e specific
information.  I seem to recall a general-purpose method of accessing 80-column
memory in ProDOS, but the article didn't go into depths of how to do it.
Any help would be greatly appreciated.

						-Scott Popp
						-attmail!scottpopp
						-201-457-5168

toddpw@tybalt.caltech.edu (Todd P. Whitesel) (06/09/90)

scottp@uxrd17.UUCP (Scott Popp ()) writes:

>     On an Apple 2+, with an Applied Engineering Viewmaster 80 column card,
>how do you access the memory pages in which the text screen is stored.

Heh, you came to the right place. One weekend quite a few years ago I sat down
and disassembled the firmware for the thing, and this is what I found:

Screen memory is 2K (eight pages) bank switched four times into $CC00-CDff of
the expansion ROM space. (I.E. reference $CFFF to clear the expansion area and
then access any location in $C3xx to enable the Viewmaster's firmware and RAM;
this is done by the firmware every time it prints a character.)

Accesses to $C0Bx do the following things (x is four bits, abcd):
	if d=0, the address register of the 6845 is accessed via the data bus
	if d=1, the specified register of the 6845 is accessed via the data bus
	if c=0, Viewmaster-generated video is selected
	if c=1, ][+ generated video is selected
(Note that both video systems operate independently and the bit controls an
analog switch which passes one of the two video signals to the monitor.)
	ab taken as a two bit number selects the two page bank to be accessed
at $CC00-CDff.

The address register and register definitions of the 6845 may be found in many
data books, most commonly Motorola's 8 Bit Microprocessors and Perhiperals.

Warning: the firmware hardware-scrolls the screen through the buffer, wrapping
around as necessary. There are routines used internally by the firmware that
you can probably call (assuming you have the same version I have) which will
calculate the correct address for you. Of course, if you are doing everything
yourself then you don't have to use hardware scrolling if you don't want to.

I'd need time to dig up the exact locations, so mail me if you want to pursue
this.

Todd Whitesel
toddpw @ tybalt.caltech.edu