Z80 Assembly 45: Software Sprite Scaling and Rotation
The Challenge of Geometric Transformations The Z80 has no native support for the complex trigonometric math needed for rotation, nor does it have floating-point math for precise scaling. All geometric transformations must be calculated using fixed-point math and look-up tables (LUTs). Sprite Scaling (Zooming) Scaling a sprite involves sampling the source image at mathematically calculated intervals and writing the result to the screen. The Principle: To double the size of a sprite (Scale Factor = 2), you read every $1^{st}$ pixel from the source and draw it twice on the screen, both horizontally and vertically. ...