GED graphic format

From: Michael Current (aa700@cleveland.Freenet.Edu)
Date: 08/17/93-11:18:53 AM Z


From: aa700@cleveland.Freenet.Edu (Michael Current)
Subject: GED graphic format
Date: Tue Aug 17 11:18:53 1993




 From: jharris@cup.portal.com (John D Harris)


The GED graphic format is really in two parts -- player/missles (PMG),
and playfield.  For the playfield, there is a 10K DLI that
continuously stuffs colors into the color registers.  The background
color isn't changed, but the other 3 color registers can be stuffed
multiple times with different values.  This creates 9 playfield colors
per scan line.  A color register value only exists for a portion of
the scan line, and it creates what I call a color 'cell'.  It divides
the screen up into columns, as shown below, and I'll follow it with
the DLI code.  The scan line will begin with starting colors for all
three registers.  Next, the DLI pre-loads the first three color
changes into A,X,Y.  That takes us to pixel #27 on the horizontal scan
line.  From there, follow the chart below.

                       -- DLI instruction --
                                            LDA #       LDA #
       STA $D016      STX $D017  STY $D018  STA $D016   STA $D017

                      --  X pixel coordinates --
           31             63         83         107         131
1st set of ! New color 1  ! New cols ! New cols ! 3rd value ! 3rd val
colors 0-3 ! and original ! 1-2, and ! 1-3      ! for col 1 ! for 1-2
exist here ! 2-3          ! org 3    !          ! 2nd 2-3   ! 2nd 3

This is the timing of the DLI, but visually, It's more important to
see where the color cells are, since that's what you draw with.

1st value of  ! 2nd value of color 0              ! 3rd value of
color 0       !                                   ! color 0

1st value of color 1       ! 2nd value of color 1          ! 3rd val
                           !                               ! of col 1

1st value of color 2                   ! 2nd value of color 2

There is no 3rd value for color 2.  I hope you can visualize what this
does.  It means that depending upon where the cursor is on the line,
changing the color register value using the Shift-Arrows only changes
the local color 'cell'.  It will only change the color on part of the
line.  Playfield colors are stuffed automatically every line, and so
changing a color cell effects only the scan line it is being changed
on.  The previous values will get stuffed back into the color register
on subsequent lines, until those color cells are changed as well,
(which can be done with the 'C' and 'W' commands).

The pixel positions in the chart are for the default setting.  GED now
allows you to skew the entire routine left or right, one cycle at a time.
This will move all of the pixel coordinates.

--------------
| PMG Format |
--------------

GED has full control over all of the Atari graphic registers, but in a
more limited fashion than it does with the playfield colors.  There is
only time in the DLI for one more register change.  So for maximum
flexibility, GED can set which register to change, as well as what
value should be stored into it.  This makes PMG changes behave
differently than playfield color changes.  Since PMG changes are not
automatically stuffed every line, changing a PMG graphic register will
effect every line from the cursor position down to the bottom of the
screen, or to any other place where that register was changed further
down the screen.

All PMG attributes have a starting value at the top of the screen.  If
the cursor is at the top when you give a GED command to adjust PMGs,
the change will occur in this starting table, and you may change all
of the attribute values in this way.  (The Shift-Ctl-Up command is
useful for getting to the top).

If the cursor is part way down the screen, any PMG commands will have
to use the DLI routine which can only change one attribute at a time.
If you enter another command on the same line, GED will look for the
closest unused scan line above the position you requested.  (By
unused, I mean a scan line that does not contain a PMG register change
-- it can contain playfield or PMG data.) The cursor will be
repostioned to that line to let you know where the command was placed.
If GED ran into the top of the screen, or a conflicting command before
finding an unused line, the screen will flash briefly, to let you know
the command could not be stored.  The cursor will be positioned at the
conflicting position.

The problem you might run into, if you have any dense sections of
register changes, is that by the time GED finds an unused line, it may
be far enough above your cursor position that it effects other uses
for a PMG object higher up.  For example, lets say you have two small
objects on the screen that you are trying to color with PMGs.  These
objects have one scan line of space between them.  With the cursor at
the top left of the lower object, you press 'Shift-1' to move the
player to the new location.  Then you use the Shift-Arrows to change
it to a new color.  Since this scan line was already used to store the
position change, GED will use the blank line between the two objects.
Now you decide that the second object needs to be larger, and you need
to make the player wider to cover it.  When you press '>' at this
point, the closest line is at the bottom of the first object, and
changing the player there may change the first object's appearance.
When something like this happens, you may want to first press
'Shift-0' to erase this last register change.  Then you need to
examine the screen to see if there are any other ways to accomplish
what you want.  It may turn out that you don't need the extra width
until a bit later in the object, and you can enter the width change
partway down the object.  There may also be no way to do what you
need, and the only alternative is to switch to using a different
object, or swap with one already in use.

There are other things you can do in tight spots, including editing or
moving objects slightly to allow for a register change, or to cross to
the other side of a playfield color cell boundary.  One other option,
is that if a new color change is relatively close to the previous
value, and you can't perform the change exactly at the first pixel
where you need the color, it may be completely unnoticable to just let
the change occur where it can.  People may not even see a few pixels
of a different color.  The MARTIAN picture had to do this once.  Can
you find the spot?

I hope that some of you will find GED a fascinating new approach to
color graphics -- instead of a mess of confusion.  I'm always
available to answer questions.

John Harris
45346 Graceway Dr.
Ahwahnee, CA 93601

jharris@cup.portal.com
GEnie:JHARRIS32
-- 
Michael Current, Cleveland Free-Net 8-bit Atari SIGOp / Mt. Pleasant, MI, USA 
        Internet: mcurrent@carleton.edu / Cleveland Free-Net: aa700


-----------------------------------------
Return to message index