It has been some time since the last report, let’s try to go a bit more in-depth this time.
The OpenGL CS video renderer
The Saturn is a beast. It features 8 processors, among them are 2 custom graphics processors called VDP1 and VDP2. The VDP2 handled backgrounds, while the VDP1 handled sprites, textures and polygons.
The VDP1 was rendering “quads” line per line, the general idea was to interpolate endpoints along the horizontal edges, then to draw textured lines between those endpoints. It had to draw the lines with an extra pixel where the slope changed, so all of the pixels had a neighbor to the left, right, top, or bottom. They did this to prevent gaps between the lines.
A modern graphics APIs like OpenGL doesn’t know how to do that, because its rendering pipeline is based on triangle geometry, so basically it can’t reproduce VDP1 behavior. There are tricks like tesselation, but ultimately they are just workarounds for specific issues and not all-in-one solutions for this. Here is some good news though : with OpenGL 4.3, a new feature called compute shaders was introduced, you might have heard about it through Flycast’s order independent transparency, or N64’s parallel, this new component gives lots of flexibility to OpenGL, and allows the implementation of routines to render quads line per line. It is what this renderer is about : reproducing VDP1 behavior accurately.
Let’s do some comparison, from first to last, those images were shot from console, Mednafen/beetle, Kronos (OpenGL CS renderer), Kronos (the old OpenGL renderer, based on YabaSanshiro’s). There are 2 things noticeable related to this VDP1 behavior in those :
- border of the road : on console, Mednafen and Kronos’s new renderer, if you zoom in, you’ll notice it’s not a smooth line, there are dots, this is the accurate behavior; the last screen, while the smooth line might look better, is actually inaccurate.
- holes everywhere : if you zoom in on the last screenshot, you’ll notice some holes here and there, on the top of the hills, on the road in the back, those holes don’t exist on the other screenshots.
It’s possible to workaround those holes with the OpenGL renderer, but at the end of the day you end up creating other issues in the process. Until recently we used such workaround but, in the case of Sega Rally, it was magnifying the dots on the border of the road.
The only known downside of this new renderer is that it will require a fairly good GPU!
ST-V support was improved
While still a bit preliminary, some major rework was done recently on ST-V support :
- You can now set your favorite bios region (NB : it will be ignored if the game doesn’t support that region though)
- The EEPROM is now properly saved and loaded
- ROM loading mechanism was fixed, there should be no more messages of the ST-V bios telling you there is something wrong with the game you are trying to launch
- Lots of input issues, going from the lack of kick harness (used for 5th & 6th buttons on some games) to the inputs not responding at all, were fixed
Improvements on the Libretro port
There were some long-term issues with the Libretro implementation, but a lot of improvements were done about them :
- Resolution switching, which is something that happens every few seconds on saturn, was somehow wrong, one of the worst side effect was artifacts especially visible in “mesh” (if you don’t use the “improved mesh” core option), it was fixed
- Toggling between fullscreen and windowed was causing issues from glitches to crashes, it has been mostly fixed
- While the saturn framerate should be 50 or 60 fps depending on the region, sometimes it’s not rendering anything because the Saturn is actually shutting down its video output, kronos is trying to have an accurate behavior for this too, which is a bit of a headache for the libretro ecosystem which is expecting a more linear framerate. A better way of handling this was implemented.
Also, here is a summary of this core’s options :
- Force HLE BIOS : it will ignore your bios file and use the old HLE bios from yabause instead, this function is unmaintained and is mainly there for debugging purpose (there is at least one known case where it’s unlocking the game though : Astal, for some reason the real bios is shutting down the video output), don’t report issues if you enabled this option.
- Video format : will force format to PAL or NTSC, default is auto
- Frameskip : will skip rendering at a fixed rate, it can improve playability dramatically on lower end devices
- SH-2 cpu core : default is “kronos”, our cross-platform cached interpreter, the other one is the unmaintained yabause SH-2 interpreter, we got the same policy than the HLE bios about it.
- OpenGL version : this option was introduced as a workaround for setups giving false positive when asking if a specific OpenGL version was supported (it happened…), set this to the highest version your gpu support.
- Video renderer : to enable the new renderer, default is the old one for compatibility reasons
- Share saves with beetle : will share save paths with beetle-saturn, allowing you to use the same savefiles.
- Addon cartridge : to change cartridge, default is auto, it is recommended to let the default except if you intend to play heart of darkness, a prototype requiring the 16M extended RAM.
- 6Player Adaptor on Port 1 : self explanatory
- 6Player Adaptor on Port 2 : same, one word of warning though, enabling the second multitap is known for causing a weird autofire behavior.
- Internal Resolution : self explanatory
- Polygon Mode : works with the default OpenGL renderer, used to fix wobbling textures issues, OpenGL CS doesn’t need this, default is cpu tesselation but gpu tesselation is recommended if your gpu supports it (OpenGL 4.2), perspective correction is more cpu friendly but heavily glitched.
- Improved mesh : will replace fake transparency (mesh) by real transparency, default is disabled
- RBG Compute shaders : will use compute shaders to rotate background, it is recommended if your gpu supports it, default is disabled
- Wireframe mode : self-explanatory ? It works only with OpenGL CS, mostly for debugging but can be a fun feature, give it a try for curiosity !
- ST-V Service/Test Buttons : enable buttons to access service menu in ST-V game, default is disabled to avoid misspress
- ST-V Favorite Region : select your region for ST-V, default is EU for censorship and language reasons.
On a sidenote, lots of other things were fixed/improved since my last report, but nothing seemed major so we decided to skip them. If you want to know more about this emulator, you can check the youtube channel, or join us on discord.