VDP2 cache progress

The cache is finally working for the VDP2 cell mode (the one used in the bios). I had some transparency problem due to textures not being reloaded when the transparency bit of the screen was changed, but that’s now corrected.
Performances are quite interesting in the current cache state, ie around 50 fps when the “Sega Saturn” text is displayed, and between 30 and 40 fps inside the cd player.

You might say it’s not that fast, but actually as the whole page is displayed (ie 512*512 pixels) instead of just the visible part (ie 320*224 in that case), a lot of extra calculation is done, which slows down the display. Of course I’ll change that in the future, but right now it’s already faster than it was in the previous release, so that’s a good start šŸ™‚

Now that’s the cache is running for cell mode, I’m now in the process of integrating bitmap mode to it … I took the opportunity to redesign the way both modes are setup, and to put it in different functions.
My goal is to have the whole bitmap to be added as a single texture to the texture map. That implies to modify the texture class structure, as until now each VDP2 texture was considered to be 8*8.

Now the bitmap texture will just be considered as a big cell (up to 1024*512), and displayed like the others.

So what are the next steps ?

  • add bitmaps to the VDP2 cache
  • convert the other display modes to use the cache
  • test the cache speed, and improve it

That’s all for now (but that’s a lot, believe me :p)

New coordinate system

After spending some time toying with OpenGL coordinate system (OCS), I was able to get the same one than the Saturn’s. That’s really interesting as up to now I was using the originalĀ OCS (ie with values between -1.0 and 1.0), which implied to do all sort of conversions to get oneĀ dot in the Saturn coordinate system (SCS) converted into the OpenGL one. For instance, theĀ dot [50,50] in theĀ SCS had to be converted into somethingĀ likeĀ [0.215,Ā 0.1483] in the OCS. Now it’s one for one, so no more conversions are needed.

I never dug into that aspectĀ until now, as everything worked fine. ButĀ  with the cache system I want to setup for the VDP2, that could have become a major drawback.

So less calculations automatically lend to more speed, but in the other hand the video card has to support the same viewport size than the Saturn’s, which is 2048*2048. I’ve sent a version to beta testers to check what’s the maximum viewport supported by various graphic cards, and so far none has failed (even an old S3 from 2001 was able to do so …)
SoĀ I have reached the decision to drop support for graphic card not supporting 2048*2048 viewport for the current version. If there’s a demand I’ll try to do something for older cards, but you’ll have to be convincing šŸ˜‰

Yesterday I finished modifying the VDP1 to take into account the new coordinate system and everything went smoothly. I even added the VDP2 planes šŸ™‚ Now the bios is almostĀ back to the way it should look, minus the scrolling (which should be taken care of quickly).

Next step is to add the cache detection, as it’s reloaded every frame right now. When it’ll be done, I’ll have a better view on the performances of the cache …

VDP2 texturing

Back from holidays !
I’m making some progress on the VDP2 : 512*512 textures are now correctly filled with data.
Now I have to add it to the rendering engine (with the VDP1).
After that, depending on how good the perfs are, I’ll extend the code to the whole VDP2 (currently just the code used in the bios is changed)
Stay tuned, there’s more to come