Beetle PSX HW PSA for Windows/AMD GPU users – update your drivers!

Written by rz5

From at least February to mid August there was a bug on beetle-psx’s GL renderer that only affected users with AMD GPUs.

This bug was exposed when user ‘orbea’ corrected a mistake in glsm (an OpenGL state manager, made by libretro, used in beetle-psx), where it would it would hint that beetle-psx wanted a version 3.1 core profile OpenGL rendering context but, by specification, the ‘core profile’ is only from version 3.2 onward.

It is still unknown why, but after orbea’s patch, AMD GPUs would render black frames on every situation except for FMVs.
Intel and Nvidia GPUs were unaffected.
Trying to find out what was wrong was very frustrating. CodeXL and RenderDoc were briefly used in the expectation that they would point out obvious API mistakes or perform API call order analysis and give a warning e.g. “are you sure you want to change this complex colored frame for a single-colored frame and present it?”

It is unfortunate that sometimes bugs like this pop up and due to the blackbox nature of closed-source proprietary drivers, using a debugger like gdb becomes unfruitful for hobby developers when you arive at the point where your opensource the code starts calling into driver code.
Then one begins to wonder: was it one of my commits in the past? Is our code going against the OpenGL spec in some way that triggers this behavior on the typically strict spec-following AMD drivers? Is it our fault at all?

And while this bug was active, users affected by it surely grew frustrated at the lack of progress and some even got dissuaded from using beetle-psx altogether.

Eventually, in mid August, update 18.8.1 came out for AMD’s Radeon Software graphics software and that seemingly fixed the bug. Which seems to indicate towards the problem being on the AMD driver side, not in beetle-psx.

Introducing BeetleDC OIT libretro core + updated BeetleDC regular core

The BeetleDC libretro core has seen several big improvements as of late, and we thought it would be remiss of us if we did not take this opportunity to talk about it.

There are two cores now

There are now two BeetleDC cores:

  • BeetleDC regular
  • BeetleDC OIT

BeetleDC regular: Contains an OpenGL renderer that requires OpenGL 2.x on the desktop and GLES 2.x on mobile.

BeetleDC OIT: Contains an OpenGL renderer that requires OpenGL 4.3, and as a result is only available for Windows and Linux. BeetleDC OIT might have significantly increased system requirements, but in return you get much more accurate graphics which tend to fix nearly all the issues that plague Dreamcast graphics with the regular version.

How to get it

In RetroArch, go to Online Updater -> Update Cores. From there, BeetleDC and BeetleDC OIT should be available for the following platforms:

  • Linux
  • Windows
  • Mac (Reicast OIT is not available for Mac due to no GL 4.3 support)

What is new/improved in both Reicast versions?

BeetleDC regular

BeetleDC regular’s OpenGL renderer has received many improvements that greatly increases the graphics accuracy and squashes many graphics bugs that plagued games in the past.

Here are some of the Dreamcast’s GPU features that are now implemented:

  • Tile clipping support.
  • Fogging support.
  • Volume modifier shadow support.
  • Multipass rendering.
  • Render to texture buffer.
  • Log 2 depth buffer.

Some additional enhancements include a log 2 depth buffer, fixing much of the polygon glitching that could happen in the distant background in many games.

All of these additions to the existing GL2 renderer in BeetleDC regular come courtesy of flyinghead.

BeetleDC OIT

BeetleDC OIT uses an entirely new graphics renderer written by flyinghead targeting OpenGL 4.3. In addition to boasting all the features that BeetleDC regular also enjoys as of this date, it also has the additional advantage of incorporating Order Independent Transparency, so that we don’t have to do hacky and error prone alpha sorting hacks, which is our main resort in BeetleDC regular.

  • Tile clipping support.
  • Fogging support.
  • Volume modifier shadow support.
  • Multipass rendering.
  • Render to texture buffer.
  • Log 2 depth buffer.
  • Order independent transparency.
  • Two-volume mode support.

NOTE: This requires a compatibility context for OpenGL 4.3. You might encounter issues with Intel/AMD GPUs right now on Linux using Mesa drivers since they require core context. Core context cannot currently be used because there are still graphic bugs to be solved when using this.

Showcase of new emulated features

Flyinghead has a terrific fork of Reicast that dramatically increased the rendering accuracy of BeetleDC’s OpenGL renderer. We backported these features with the gracious help of flyinghead. All kudos goes to him.

Tile clipping support


The Dreamcast’s PVR2 had a tile clipping GPU feature that was used to obscure portions of the screen. It was cheaper to keep rendering portions of the screen that were not meant to be seen by the user and just clip them away instead of deciding not to render them at all. This was previously unimplemented, which led to all sorts of graphics glitches. This has now been finally implemented in both cores.

Fogging support


The Dreamcast had a 128-bit fogging table that games could take advantage of. Plenty did, such as Cannon Spike, Blue Stinger, Resident Evil: Code Veronica, Virtua Fighter 3tb, and more games. This is now finally implemented for both cores.

Volume modifier shadow support


The Dreamcast made use of volume modifiers in order to simulate shadows in many games. This was previously either completely unimplemented or very buggily rendered. Volume modifiers are now correctly implemented in both cores (BeetleDC and BeetleDC OIT). Performance costs should be minimal and you definitely notice the shadows being cast now by characters and other objects.

Multipass rendering


The game V-Rally 2 relies on multipass rendering for rendering the UI elements on top of the game screen. This has finally been emulated on both cores (BeetleDC and BeetleDC OIT).

Render to texture buffer


Not only has render to texture being reimplemented (leading to much faster performance), but certain games such as Tony Hawk’s Pro Skater 1/2 would render to VRAM for rendering shadows. The upshot of this is that the shadow looks much more convincing vs. merely using volume modifiers in order to simulate shadows. This feature has been finally implemented in both cores.

Log 2 depth buffer


Thanks to the logarithmic depth buffer, many rendering bugs have been fixed. Some games have been completely fixed as a result, such as Cannon Spike, while others such as Soul Calibur no longer have the scenery in the background glitch out.

Note that this relies on gl_FragDepth being available. This might become an issue when we bring the BeetleDC libretro core to mobile, since it’s not a part of the GLES2 spec and might require either extensions or GLES3 support.

Order Independent Transparency

NOTE: This feature is exclusive to BeetleDC OIT, and is not available in the regular BeetleDC core.


Other improvements

Date/time saving is finally fixed


Finally you don’t have to keep inputting date/time again whenever starting a game with the BeetleDC cores.

Be sure to set a correct date/time, as entering a wrong date might lead to it not being able to save.

Analog triggers

The core finally supports analog triggers. The Dreamcast had analog L/R triggers, previously we only had digital trigger simulation, where the L1/R1 would simulate 50% press of the trigger and L2/R2 would be a 100% press of the trigger. While this mode is still available if you enable the option ‘Digital Triggers’, you can also now just take advantage of the new digital trigger capabilities.

In addition to this ,deadzone issues should be fixed now, so there should hopefully be no more analog input disparities between Xbox pads and PS4 pads.

Videos