Sprite Expansion Library 2.0


nathanielbabiak 2021-01-06 04:49 (Edited)

Sprite Expansion Library

This library will display filled polygons much faster than my other three full-screen display systems. It's blazing fast compared to the Pxl Library! And, if your game doesn't ultimately use all eleven of the allocated sprites, the raster interrupt subprogram can be trimmed down to gain even more speed!

The technique works per row (raster scanline). It uses sprites N=0 to N=10 to display horizontal lines on the screen. (You can adjust the LowRes NX sprite numbers in SUB S_RASTER.) Each sprite can be from 1 to 32 pixels wide, so to cover a whole row (of 160 pixels) it would use five sprites (5*32=160). A single scanline can be modified individually (it doesn't need to modify the surrounding rows above and below).

S_CLS clears the whole screen of all lines, and S_PXL draws a single pixel of a specific palette and color.

S_HORZ draws a single horizontal line. It uses 1 to 5 sprites starting with sprite N. It uses as many sprites as required to draw the whole line. The other drawing commands call S_HORZ.

A few notes:

SX Library 1.0.nx | Open in app
2021-01-09 03:05
SX Library 0.4.nx | Open in app
2021-01-07 06:09
SX Library 0.1.nx | Open in app
2021-01-06 04:49

GAMELEGEND 2021-01-06 04:59

this is legendary

nathanielbabiak 2021-01-06 04:59

Thanks! It's already faster than Pxl Library and it's not even optimized yet!

CubicleHead 2021-01-06 14:46

I really like the wavy titles you did in the code :)

nathanielbabiak 2021-01-07 06:59

Thanks! I did the same thing for my Pxl Library upload too. On iPad it's really tough to focus on just a few lines, so I figured I'd try it.

Timo 2021-01-09 11:00

Using sprites is a really clever idea!

Log in to reply.