If a picture is worth a thousand words, then a video is worth a million...
This is a video driver that instead of tiles and sprites draws vector shapes in real-time as the screen is scanned. Therefore, no big frame buffer is needed, just a relatively small double-buffered display list.
I'm posting this here in a kindof unfinished state, because I want to avoid sitting on it for months like I usually do.
- Open either demo.spin (simple demo/test) or cobra.spin (the 3D Elite ship rendering thing)
- Change arguments to kb.start and gfx.start to suit your board (the latter takes a TV.spin style pingroup as first arg and NTSC/PAL60 flag as second (PAL60 not tested))
- Load to RAM
cobra.spin has some keyboard controls:
- Arrow keys/Home/End to rotate the model
- A to re-enable automatic rotation
- R to reset rotation
- C to toggle debug color mode
- B/N to switch models
Known issues (driver itself):
- Everything is kinda quickly hacked together and lacks polish and comments
- Output module is the same as JET Engine's. I might make a higher resolution and less bloated one later
- Shapes that are clipped by the top edge of the screen disappear - will have to precalculate during VBLANK
Known issues (Spin geometry processing):
- Only triangle rendering is implemented. In theory arbitrary convex polygons are already supported by the rendering cogs, but the geometry processing for those is going to bit more complicated than for triangles. (cobra.spin currently uses triangulation to draw convex polygons). I might also implement lines and text.
- Those nasty gaps between triangles
Known issues (example programs):
- cobra.spin doesn't work in fastspin for some reason - demo.spin does.
- slow Spin code (see above)
- In cobra.spin, the thargoid's model is imported, but doesn't work (The Elite ship models are taken from the included B7051600.TXT, more could be imported)
- The normals on the ship models are a bit whack (different lengths and sometimes plain wrong) - maybe recalculate from scratch?