Kronos 2.1.2 progress report (Sega Saturn emulator)

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.

RetroArch Disc Project – Alpha testing has begun! Details inside

Ever since the announcement earlier on June 30th, we have been working hard on the RetroArch Disc Project, and we are now getting to the stage where we want users to start alpha testing the latest code.

We invite you to come over to our Discord channel (also linked to on the RetroArch website – click on the tab ‘Discord’)- and join the channel #discordproject.

How to apply for alpha testing

For the purpose of this alpha test, we need you to meet the following requirements:

  • You are using the latest nightly versions of RetroArch (available here).
  • You are using RetroArch on PC, and are running either Linux or Windows with the CDROM support included.
  • Make sure the cores you are going to be testing are the latest up-to-date versions. Update them daily from the Core Updater if unsure – the cores should have physical CDROM support, otherwise the testing won’t work.
  • You have an optical disc drive (either USB or internal, any CD-ROM/DVD-ROM/BD-ROM drive should do).

Report issues you’re having with physical CDROM playback. Be as detailed as possible in your feedback – we are especially interested in which optical disc drive you’re using.

Be prepared that you might be asked by a moderator to run ‘retroarch_debug.exe’ and return a log message back to us in order to learn more about the issues you’re having. ‘retroarch_debug.exe’ is a debug executable that should be shipped with every RetroArch nightly version for Windows. For Linux users, we assume that they can build from source and compile with CDROM_DEBUG=1 manually in order to run these more detailed debug tests.

Compatible cores

Listed below are some of the cores that we added physical CD-ROM support to, and the ones that we would like you to test –

  • Beetle PSX (HW and non-HW)
  • Beetle Saturn
  • Genesis Plus GX
  • 4DO
  • Redbook Audio Player (Audio CD core)

We have also added support to more cores, but for now we want to go with these cores as they have been most extensively tested.

A couple of known edge cases:

  • Beetle PSX HW: The ‘vulkan’ renderer can exhibit issues where either the CD will not work, or some other corruption issue will manifest itself. We recommend you use ‘opengl’ or ‘software’ for now while you test CDROM.
  • Beetle PSX HW: Make sure the core option ‘CD Access Method’ is not set to ‘precache’. If you do, real discs won’t work.

How to load discs

1.You need to first start up the core itself (there is no automatic system detection yet when you insert a disc).
Go to Load Core, and select the core you want to use.

2. Once the core is loaded, select ‘Load Disc’.
3. It will now list all optical drives. Make sure the disc you want to use has been inserted into the optical drive tray and make sure the tray is closed. Then select the drive. The core will now start with your CDROM as input.

How to dump discs

RetroArch can dump discs to internal storage in bin/cue format. The video above will show you how.

  1. Select ‘Dump Disc’.
  2. It will now list all optical drives. Make sure the disc you want to use has been inserted into the optical drive tray and make sure the tray is closed. Then select the drive.

The disc will now be dumped to the ‘Downloads’ directory. It will continue showing the progress bar until the operation has finished. In the meantime, you can play any core/game (as long as it doesn’t involve real CD playback) until the dumping has finished.

Redbook Audio Player – Libretro core for music CD playback!

As a testbed for the Disc Project, we made a redbook audio CD player Libretro core!

You can grab this core for Windows and/or Linux by going to Online Updater, and downloading it from the list (Redbook Audio Player).

Known potential issues

  • Right now, CDROM works better on Linux vs. Windows.
  • FMV playback with Beetle PSX HW has the potential to be slow on some optical disc drives on Windows. Cause yet unconfirmed.
  • There is a known issue with redbook audio – the redbook audio track begins a few seconds later from its starting period.
  • Libcrypt copy-protected PlayStation1 games will not work right now, but any other copy-protected PlayStation1 disc should.
    Here is a listing of some Libcrypt-protected games from Europe: https://hastebin.com/ruyacahuba.http . You can generally assume these won’t work.