[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sprite card?
mjmahon@aol.com (Michael J. Mahon) wrote in message news:<20031213204948.15885.00000502@mb-m21.aol.com>...
<snip>
> >Graphics-2: Like Graphics-1, but 768 characters definable. Each
> >character is given a foreground/background color for each pixel line
> >of the character. This is the "bitmap" or high-res mode.
> >Various other undocumented modes.
> >
<snip>
>
> I have never seen a 9918 card for the Apple that supported external
> video. The problem is, as you noted earlier, that the external video
> source must be synchronized to the card (or vice versa), and there
> is no provision for doing so. All the sprite cards I have seen have a
> separate crystal oscillator.
>
> This is one of the reasons that the sprite cards were so uninteresting
> to the market--they require you to use two displays with your Apple,
> or to sacrifice one while viewing the other. A second problem, entirely
> within the 9918, is that _everything_ on the display is generated from
> "character cells", which means that drawing an arbitrary straight line
> on the display requires "synthesizing" a lot of "characters" which are
> used up just to create the line display. There are not enough "character"
> blocks to permit an arbitrary bit-mapped display!
>
> Terrapin Logo had a version that used a sprite card for its "turtles" and
> when the character map was exhausted it gave the error "Out of Paint"!
>
> If you wish to conserve this scarce resource, you must pre-synthesize
> the required character block (including any other lines that this one
> crosses) and then search all available character blocks to see if this
> one already exists before allocating a new one.
>
> Since each character has a limited color choice, lines of arbitrary
> colors may not cross (a similar problem to the hi-res color set problem
> of the Apple II, but with more sets of fewer colors).
>
> If you thought that generating addresses for Apple hi-res was wierd,
> the 9918, with its character maps and indirections, will drive you up
> the wall. ;-)
>
> On a hardware note, the Apple cannot directly access the video memory
> (which holds the character maps, pointers, etc.), but must make every
> access indirectly through a register in the 9918.
>
> The 9918 is a great example of what happens when digital designers
> create a video chip: lots of modes and features, but you can't even draw
> a line without dynamically creating new characters (and risking running
> out before the line can be completed)--programmers beware!
>
> (Note that many early video games were designed in just this way: cost
> of the chip is fundamental, so the chip is designed first, with as many
> wierd bells and whistles as the designers can hack in, then the game
> programmers get to look at it and see what they can learn to do, warts
> and all.)
>
You speak of the 9918, and you are right. But the 9918A has a bitmap
mode, allowing 768 unique character definitions, one for each screen
position. Placing these characters, 0-255, three times on the screen
from top left to bottom right, then simply manipulating the pattern
table gives you bit-map graphics (so your Logo won't run "Out of
Paint").
The color artifacting is a problem, one that many early computers
share and there were some sacrifices. The 9918A bitmap mode allows a
foreground and background color for each horizontal row of a
character. A character cell is 8 pixels high, 8 pixels wide. Each 8
pixel wide strip (8x1) can have a foreground (pixel on) and background
(pixel off) color, from the 16 colors.
But the actual addressing to define character definitions and colors
is quite easy. Simple line drawing routines are easy to code. And once
you find the offset in the pattern table, the same offset is good for
the color table.
Here is a Basic program to calculate the byte number.
It returns the byte (offset from start of both tables) to modify, and
the bit to set (for the pattern table).
100 INPUT PIXELROW
110 INPUT PIXELCOL
120 FULLPIXELROW = INT (PIXELROW / 8) * 8
130 FULLPIXELCOL = INT (PIXELCOL / 8) * 8
140 REMAINDERROW = PIXELROW - FULLPIXELROW
140 BYTE = FULLPIXELROW * 32 + FULLPIXELCOL + REMAINDERROW
150 BIT = PIXELCOL - FULLPIXELCOL - 1
160 PRINT BYTE; BIT
Besides, I'm pretty sure the one I remember did allow both Apple and
TI graphics. This may not be true of the one in the auction. I
remember seeing the photo of the screen in the magazine showing a
sprite moving across an Apple graphics display... I believe
AmperSprite was the name!
Ben