[comp.sys.apple2] HIRES question

nagendra@bucsf.bu.edu (nagendra mishr) (02/04/91)

Does anyone remember what the memory location is that tells what page
you're drawing on?

I wanted to do some 2 page animation with the old hires modes. and I
remember that it was something like poke -16xxx,32 to draw on page 1 and
poke -16xxx,64 to draw on page2 without showing those screens.
but I can't seem to remember the location numbers.
Does anyone  remember?

nagendra@bucsf.bu.edu

****************************************************************************
*     Destiny is a birth-right.      |  nagendra@bucsf.bu.edu              *
*     Not wanting it is a decision.  |  Junior at Bonston University       *
*     Not realizing it is failure.   |            computer science         *
****************************************************************************

dlyons@Apple.COM (David A. Lyons) (02/05/91)

In article <NAGENDRA.91Feb4032746@bucsf.bu.edu> nagendra@bucsf.bu.edu (nagendra mishr) writes:
>Does anyone remember what the memory location is that tells what page
>you're drawing on? [...]

I didn't remember offhand, but I remembered that CALL 62454 would fill the
current screen with the last used color.  62454 is $F3F6, so I looked and
found it using $E6 as the high byte of the pointer to the memory to fill.

$E6 is 230, so you want to POKE 230,32 to draw to page 1 and POKE 230,64
to draw to page 2.

-- 
David A. Lyons, Apple Computer, Inc.      |   DAL Systems
Apple II System Software Engineer         |   P.O. Box 875
America Online: Dave Lyons                |   Cupertino, CA 95015-0875
GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons
   
My opinions are my own, not Apple's.

seah@ee.rochester.edu (David Seah) (02/05/91)

In article <NAGENDRA.91Feb4032746@bucsf.bu.edu> nagendra@bucsf.bu.edu (nagendr!
>Does anyone remember what the memory location is that tells what page
>you're drawing on?

Zero page location $E6 (230 decimal) tells you what memory page that
Applesoft will use to draw on.  For Hires Page 1, poke 230,32.  For Hires
Page 2, poke 230,64.

>I wanted to do some 2 page animation with the old hires modes. and I
>remember that it was something like poke -16xxx,32 to draw on page 1 and
>poke -16xxx,64 to draw on page2 without showing those screens.
>but I can't seem to remember the location numbers.

Here's something out of the ancient book, "Apple Graphics and Arcade Game
Design" by Jeffrey Stanton:

5 X1=0:Y1=0
10 rem clear both screens
20 home:hgr:hgr2:hcolor=3
30 rem now looking at page2
40 rem set drawing mode pointer (E6) to screen #1
50 POKE 230,32
51 rem clear screen #1
52 call 62450
60 for i=1 to 35
70 x2=int(rnd(1)*280)
80 y2=int(rnd(1)*192)
90 hplot x1,y1 to x2,y2
100 x1=x2:y1=y2
110 next i
120 rem look at screen #1 full screen
125 poke-16300,0:poke-16302,0
130 rem set drawing mode pointer (e6) to screen #2
135 POKE 230,64
136 rem clear screen#2
137 call 62450
145 for i=1 to 35
150 x2=int(rnd(1)*280)
160 y2=int(rnd(1)*192)
170 hplot x1,y1 to x2,y2
180 x1=x2:y1=y2
190 next i
200 rem look at screen #2
210 poke -16299,0
230 goto 50

All...what memories! :-)

-- 
Dave Seah ^..^  |  Analog Design Automation Research Group - Graphics & GUI  | 
                |  University of Rochester, Dept. of Electrical Engineering  |

////// Internet: seah@ee.rochester.edu ////// America Online: AFC DaveS //////

ART100@psuvm.psu.edu (Andy Tefft) (02/05/91)

In article <48811@apple.Apple.COM>, dlyons@Apple.COM (David A. Lyons) says:
>
>I didn't remember offhand, but I remembered that CALL 62454 would fill the
>current screen with the last used color.  62454 is $F3F6, so I looked and
>found it using $E6 as the high byte of the pointer to the memory to fill.
>
>$E6 is 230, so you want to POKE 230,32 to draw to page 1 and POKE 230,64
>to draw to page 2.

That's one way of finding out :-)

When's the last time you could do something like this on a mac?

Of course, 230 is easier to remember than the number you did!

marekp@pnet91.cts.com (Marek Pawlowski) (02/05/91)

As a follow-up question to that, could someone list all the important memor
locations for graphic page flipping.  Such as the ones to diplay page x, and
draw on page x, etc?

/* Marek Pawlowski, marekp@{generic|pnet91|bkj386|torag|aunix}.uucp  [CONT] */
/* {albert|wookumz|apple-gunkies|pogo|churchy|geech|spiff|mole}.ai.mit.edu  */
/* President, Intelligent Twist Software, 250 Harding Blvd, PO BOX 32017    */
/* Richmond Hill, Ontario, L4C 9M7, CANADA.  An ideal route is as follows:  */
/* { Ph: (416) 884-4501 4-8pm EDT } generic!pnet91!marekp@zoo.toronto.edu   */

ericmcg@pnet91.cts.com (Eric Mcgillicuddy) (02/05/91)

>$E6 is 230, so you want to POKE 230,32 to draw to page 1 and POKE 230,64
>to draw to page 2.
>
>--
>David A. Lyons, Apple Computer, Inc.      |   DAL Systems

POKE 230,96 draws to Page 3 also. I wonder were POKE 230,128 draws? On the
wall maybe?  :)

POKE the colour number into 228 if you do not like the las colour plotted.
Black is 0 or128, White is 127 or 255, Green =42, Violet = 85, Orange = 170
and Blue =213. Note that these numbers equate to the bit patterns required to
generate these colours.

UUCP: bkj386!pnet91!ericmcg
INET: ericmcg@pnet91.cts.com

daveh@ccwf.cc.utexas.edu (David H. Huang) (02/05/91)

In article <452@generic.UUCP> marekp@pnet91.cts.com (Marek Pawlowski) writes:
>As a follow-up question to that, could someone list all the important memor
>locations for graphic page flipping.  Such as the ones to diplay page x, and
>draw on page x, etc?

To select graphics screen      => -16304
To select text screen          => -16303
To select full screen graphics => -16302
To select graphics/text        => -16301
To select page 1               => -16300
To select page 2               => -16299
To select lo-res               => -16298
To select hi-res               => -16297

and as other people have pointed out, POKE 230,32  to draw on page 1,
POKE 230,64 to draw on page 2.

Those softswitches are from memory, but I think I got them all right. You can
do the conversion to hex yourself if you want...

>/* Marek Pawlowski, marekp@{generic|pnet91|bkj386|torag|aunix}.uucp  [CONT] */
>/* {albert|wookumz|apple-gunkies|pogo|churchy|geech|spiff|mole}.ai.mit.edu  */
>/* President, Intelligent Twist Software, 250 Harding Blvd, PO BOX 32017    */
>/* Richmond Hill, Ontario, L4C 9M7, CANADA.  An ideal route is as follows:  */
>/* { Ph: (416) 884-4501 4-8pm EDT } generic!pnet91!marekp@zoo.toronto.edu   */


-- 
David Huang                                 |
Internet: daveh@ccwf.cc.utexas.edu          |     "My ganglion is stuck in
UUCP: ...!ut-emx!ccwf.cc.utexas.edu!daveh   |      a piece of chewing gum!"
America Online: DrWho29                     |