jeffythedragonslayer wrote: ↑Thu Jul 21, 2022 11:14 pm
Cool. I'd like to see the five-pointed star and ellipse.
A non-rotated ellipse is easy, for a pre-calculated HDMA table. Multiply the left-right offset of the circle by an x-scale. If you look at my source code you'll see the formula I used for a circle, which includes an
x_scale variable (which I used to aspect-correct the circle).
A five pointed star is going to require two windows. I'm not going to draw one the moment, but I will include a star when I start working on the two window demos.
iNCEPTIONAL wrote: ↑Fri Jul 22, 2022 12:48 am
I don't know what a programmatic shape is, but how about a sihouette of a pawn chess piece, ala.
In this context, a programmatic shape is a shape that can be created using a simple formula or algorithm. Generating the window table takes CPU time and the simpler you can make the code, the faster it will run.
The last time I experimented with windows I used ~10-30% of a frame's CPU time to draw a circle (which is perfectly fine for a fadeout or a sparse level) and ~40-65% CPU to draw a large triangle (which is way too much for game-play, but perfectly fine for a title-screen or cutscene).
For more complicated shapes, like the pawn chess piece, it is better to use a pre-calculated table. It will take up more ROM space, especially if you want to scale or animate the window. Translating (moving) the pre-calculated tables will cost CPU time, I'm guessing < 20% CPU time for a single 200 scanline window. Won't know for sure until I code one.
Another advantage of pre-calculated tables is that they can be built from image files. A programmer can write a simple program that takes an image file, computes the left/right position of each scanline and outputs table data for a game.
After I've written the wiki page, I'll work on a translated window demo (using chess pieces as my window source). I'm curious to see how much CPU time it would consume.