Last year, I wrote a fairly complete Genesis (MegaDrive) emulator in C++, for education purposes, that contains a full VDP emulation. The VDP in Megadrive is the father of the VDPs on Saturn, so you can have a look to see how it works:
<a href="https:&#x2F;&#x2F;github.com&#x2F;rasky&#x2F;genemu" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rasky&#x2F;genemu</a><p>The code should be quite easy to read, as I wrote it to be close to what the hardware does, without any additional complexity for optimizations.