POV-Ray : Newsgroups : povray.off-topic : Need for speed : Re: Need for speed Server Time
8 Sep 2024 13:19:45 EDT (-0400)
  Re: Need for speed  
From: John VanSickle
Date: 14 Jul 2008 14:13:39
Message: <487b9753@news.povray.org>
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.

> Also... Apple made a 6502-based product??

Yes, it was called the Apple ][.

> The equations for simple 2D acceleration and reflection are fairly easy, 
> and probably implementable in fixed-point arithmetic.

I suspect that they actually used angles, probably 256ths of a circle, 
which on a screen with 320 x 200 pixels was all the precision anyone 
needed.  When a ball moving at angle X hits a wall set at angle Y, the 
ricochet angle is calculated with addition and subtraction, and no 
multiplication is needed at all.  To move the ball, the angle was used 
to index a lookup table of sine and cosine values, and they probably 
used one table for both (add 0x40 to the 8-bit index to get cosine values).

> The *hard* part about physical simulations is that they usually involve
 > a huge number of items; *one* marble isn't too big a deal.

Yeah; gravity sims are an O(n^2) problem.

Regards,
John


Post a reply to this message

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