Fixed the bug in my fast filled and textured triangle drawing routine for the ZX Spectrum. I've released the code on GitHub in lib/vector_filled.z80, with an example file in Demo/demo_3D. This will form part of a simple 3D engine I'm tinkering with.
https://github.com/breakintoprogram/lib-spectrum
As ever, the code is written for clarity (well, at least as clear as Z80 assembler gets) rather than raw performance, but it should be quick enough for most purposes.
Next job will be to scan convert a circle, and add some assembler directives so that it can be assembled to either render in Spectrum screen coordinates, or in an organised off-screen buffer (where each line is 32 bytes below the one above).
Yep, that seems pretty fast. Sure I can squeeze some more performance out of it still in the horizontal line routine.
You can follow @BreakIntoProg.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: