From: avalon@coombs.anu.edu.au (Darren Reed)
Newsgroups: comp.sys.m6809
Subject: Info on COCO3 (Setup of MMU from BASIC)
Date: 22 Aug 92 21:26:48 GMT
Organization: Computer Services Centre, Australian National University

d3g347@beach.pnl.gov (PD Grengs) writes:


>Howdy folks.

>I have an animation program that fills 384K (12 32K pages)
>of my 512K CoCo III with interpolated ray-traced images.
>At this point, I would like to know how I can rapidly flip
>all 12 pages through the HSCREEN 2 display mode.

>Any ideas...?

Yeah, you need to setup a loop which POKEs stuff.

blah....There have been a few requests for COCO3 info recently so here
is some stuff I found a few years back:


[$E002]		-> $E019

Setup test screen depending on whats in $E7.

	0 - Width 32
	1 - Width 40
	2 - Width 80

[$E004]		-> $E04D

Setup a HSCREEN according to what is in $E6.

	0 - No SCREEN Setup
	1 - HSCREEN 1
	2 -    "    2
	3 -    "    3
	4 -    "    4

[$E006]		-> $E097

Setup MMU data.  Copies locations $E0E1 - $E0F0 to $FFA0 - $FFAF.

[$E008]		-> $E0B5

Changes MMU data for use with 40/80 colomns.

[$E00A]		-> $E0A1

Alters $FFA0.

[$E00C]		-> $E0FF

Sets the TR bit of $FF91 to 0.  Sets the MMU to use the block map
in locations $FFA0 - $FFA7.

[$E00E]		-> $E119

Sets the TR bit of $FF91 to 1.  Sets the MMU to use the block map
in locations $FFA8 - $FFAF.

			---------

Be careful when changing the MMU blocks about since block 0 contans
all the critical 0 page BASIC stuff and block 3 ($6000-$7fff) is the
area used by the coco for stack space (and further down too!).

Other routines:

$E0F1

   Copies data from a 16 byte area which X points to.
A, B, X and Y are not preserved on this call and are all used.

$E0CB

   Identical to the routine at $E0B5 except it is used for setup of the
MMU for the HBUFF command.

			----------

Data.

MMU Copy Area:		$E0E1 - $E0F1
HSCREEN MMU  :		$E0EA - $E0ED

	To change the area of memory you see using HSCREEN, loading a
new set of data into this block of 4 bytes is required.  To load this
into the right places, a call to $E097 afterwards is needed.

Video setup:

Width 32    :		$E032 - $E03A
Width 40    :		$E03B - $E043
Width 80    :		$E044 - $E04C

HSCREEN 1/2 :		$E070 - $E078
HSCREEN 3/4 :		$E079 - $E081

		Byte 0   -> $FF90
		Byte 1-8 -> $FF98 - $FF9F

		$E076 and $E07F should be set based on the starting block;
		of the video meory to use for the HSCREEN (as set by the
		HSCREEN MMU).  As a general rule, 4 * [$E0EA] should work.

For HSCREEN 1-4, $E06C-$E06F is copied to $FF99 (depending on which
HSCREEN).  This byte is copied to the data area at $E070/$E079.

			----------

Demo program:

4 ' High speed poke
5 POKE 65497,0
8 '******************
9 'Disable HCLS when HSCREEN is executed.
10 POKE &HE6C6,18:POKE &HE6C7,18
20 A=0
30 FOR J=0 TO 11 '12 HSCREENS
38 '*****************
39 'Set vertical offset
40 POKE &HE076,A*4
48 '*****************
49 'Put block No.s into $E0EA - $E0ED
50 FOR I=A TO A+3:POKE &HE0EA + (I-A),I:NEXT
58 '*****************
59 'Transfer into MMU
60 EXEC &HE097
70 HSCREEN 2
80 HCLS J: HCOLOR J+1
90 FOR T=1 TO 99:HLINE(RND(320)-1,RND(192)-1)-(RND(320)-1,RND(192)-1),PSET
91 NEXT
100 A=A+4
110 NEXT J
120 GOTO 120

After running this once, insert/change these lines:

75 GOTO 100
120 RUN


			---------

And I'm still using my COCO3 now (2nd keyboard :)

Darren.