POV-Ray : Newsgroups : povray.off-topic : Need for speed : Re: Need for speed Server Time
8 Sep 2024 01:13:24 EDT (-0400)
  Re: Need for speed  
From: John VanSickle
Date: 16 Jul 2008 20:45:35
Message: <487e962f$1@news.povray.org>
John VanSickle wrote:
> Orchid XP v8 wrote:
>> John VanSickle wrote:
>>
>>> There were games on the Apple (6502-based) which had seven versions 
>>> of any given sprite graphic so that they wouldn't have to be shifted 
>>> in order to display them on the screen.  8-bit game programmers 
>>> learned much about squeezing every last drop of performance out of 
>>> limited speed and memory.
>>
>> Wouldn't having 7 copies of the same data eat more memory?
> 
> This is what programmers call a trade-off; the only way to get 
> acceptable speed was to use up seven times as much memory (not eight, 
> because only the lower seven bits of each video byte represented screen 
> pixels; the MSB selected the colors).
> 
>> Did it actually store 7 copies, or just precompute them?
> 
> The computer did not precompute them; the programmer did.

Now that I think about it more, there was a bit more involved than 
shifting the bits.  On the Apple ][, if a raster bit was set, but its 
neighbors were not, it was one of four colors, depending on the MSB of 
the byte and whether the bit fell in an even or odd column on the screen.

The upshot of this is that if the programmer simply shifted the bits 
over, then the colors of three of the sprites would be radically 
different from the other four, and if the sprite began in an 
odd-numbered byte (horizontally) rather than an even-numbered one, the 
colors would again be swapped.  Programmers wound up making fourteen 
versions of every sprite, and aside from preserving the MSB, each group 
of seven were shifted versions of the same graphic, shifted across two 
bytes, and not one.

Regards,
John


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.