AgonConsole8 / vdp-gl

Fork of vdp-gl
GNU General Public License v3.0
2 stars 2 forks source link

Separate image generation from signal generation #12

Open stevesims opened 4 months ago

stevesims commented 4 months ago

The current structure of vdp-gl mixes together image generation with VGA signal generation

There are a few features that would be nice to add to the agon-vdp that are made more difficult by the intermixing of these two areas of functionality. Two examples of this are the ability to "blit" between the front and back buffers in a double-buffered mode, and to draw to a bitmap. If there was a clean separation between the two then it would be significantly easier to add these features.

Additionally separating out image generation would potentially allow those features in vdp-gl to more easily be used with a different signal generation.

stevesims commented 1 month ago

the reality is that the nature of the code architecture vdp-gl inherits from fab-gl makes it impractical to separate out image generation from signal generation.

it is almost certainly more straightforward and simpler to completely rewrite the image generation, writing to a completely new framebuffer system, and then make use of fab-gl's VGADirectController to generate a signal based on that framebuffer. that form of signal generation essentially parallels how the existing paletted VGA controllers work - the various ISRHandler functions inside each controller variants essentially perform the function of converting the framebuffer a row at a time into a signal buffer that will be sent out the VGA port using DMA.