Flycast world’s first Dreamcast emulator to receive Vulkan renderer – available later today on RetroArch with nightly core!

The first Dreamcast emulator ever to get a Vulkan renderer. Completely open-source, written from scratch, and available later today on RetroArch. Update your core later today to get the latest version with the Vulkan renderer! Available for Android, Windows, and Linux.

For more information, read down below…

Wait … a new what?

The renderer is the emulator component that emulates the Dreamcast/Naomi GPU chip, namely the PowerVR Series2. It was one of the first generations of 3D chips, with only a fixed pipeline. The PowerVR2 supported DirectX 6.0, which was the graphics API used by Windows CE games on the Dreamcast. Successors of the PowerVR2 would later be found in the original iPhone and iPod Touch (PowerVR4), iPhone 4 and iPad (PowerVR5) and many many other mobile devices. Now the Dreamcast GPU is more than 20 years old. You might think it should be easy to emulate such an ancient chip on modern hardware, right? Well … yes for the most part. But there’s one thing that the PVR2 does really well, and it’s order-independent transparency. And even today this is still not trivial to implement even on modern hardware. You won’t find this feature in Open GL or DirectX, and you need a pretty recent version of these APIs to be able to emulate it, which means manually sorting individual pixels from back to front and blending them together, and doing this for each visible pixel on the screen!

OK, but what about Vulkan?

For those of you who are not familiar with Vulkan, it is a relatively new 3D graphics API, basically a follow-on to Open GL. Open GL is quite permissive and has little declarative constraints. You just throw stuff at the driver when you need to and the driver’s job is to figure it out. The downside of this is that the Open GL driver often needs to guess what you’ll do next and he might not guess right. And when it doesn’t, performance suffers. Vulkan is radically different in that everything must be declared in advance, in great details, and there’s very little room for improvisation on the part of the driver. Vulkan works much closer to the hardware than Open GL does. So you can expect less overhead, more reliability and better performance in many cases.

The downside of Vulkan is the sheer amount of code you have to write to display just a single triangle on the screen, let alone a full-featured Dreamcast renderer. Last time I checked, the Vulkan renderer had 47 source files and around 7800 lines of code. (The Open GL renderer only has around 6000 lines of code.)

So what do we get?

As with Open GL, there are actually two Vulkan renderers: The first one uses a traditional single render pass with per-triangle or per-mesh sorting done by the CPU. The second one is capable of order-independent transparency with per-pixel sorting performed by the GPU. It uses multiple subpasses to compose the final image: the first subpass draws the opaque geometry depth map and the shadows casted on them. The second subpass renders all opaque geometry to a temporary color framebuffer, and transparent geometry into a huge pixel linked list. The last subpass then renders shadow volumes for translucent geometry. And finally all pixels are sorted and blended together using the opaque framebuffer of the previous subpass as background.

The next Flycast nightly build will have support for Vulkan on all major platforms: Windows, Linux and Android. In terms of features, the new renderer should be on par with the Open GL renderer, with the notable exception of lightgun crosshair and VMU screens display, which will be added soon. However, expect to find bugs and crashes here and there as is expected with any new piece of software. Also it may be slower than Open GL depending on many factors such as GPU, driver version, game being played, etc. We’ll do our best to fix any issue encountered and overcome performance issues. When reporting problems, make sure to indicate what GPU you’re using and the Vulkan driver version. It is highly recommended to upgrade your drivers to the latest version available, especially on mobile.

Here is a showcase of the differences between the basic and OIT renderers. By the way, this also applies to Open GL.

Here the hair of these ladies show glitching triangles in basic mode.

In Speed Devils 2, the shadow volumes (called “Modifier Volumes” in Dreamcast literature) are used in a special way to project headlights. This is only possible by using deferred rendering.

In this example, look at Ryo’s cast shadow on his left. There is a fog effect applied to this scene, but the basic single pass renderer cannot apply a fog effect to the cast shadow. In the OIT renderer, the shadow is perfectly fogged.

In Jet Set Radio, the character is composed of translucent polygons, and these polygons can be shadowed as well. Only the OIT renderer can properly render shadows cast on translucent polygons.

To finish, here is another seldom used GPU features: secondary accumulation buffer. It can be used to do tri-linear filtering and other effects. This is Evil Dead – Hail to the King and it is clear that the basic renderer is having a hard time here.

Final thoughts

Yes, the per-pixel alpha transparency option which to this date was only available on Windows and Linux now also works on Android with the Vulkan renderer. However, keep in mind that per-pixel alpha sorting is heavily memory bandwidth-limited. It has been tested on a Mali G76 (Samsung Galaxy S10+) – and it runs acceptably at 640×480 or 800×600 resolution. Your mileage may vary depending on the GPU power inside your Android phone. We recommend you to find that sweet spot which works best for you, and if results are too bad with per-pixel alpha enabled, turn back to per-triangle.

Some clear advantages of the Vulkan renderer is that frame pacing is much better than the OpenGL renderer, and performance is far higher when it comes to texture uploads and/or framebuffer manipulation. For example – when you KO an opponent in Dead Or Alive 2 against an explosive wall – the framerate would often tumble a bit on GL, but no such issues with Vulkan. Similar improvements can be noticed in Virtua Tennis 2 – when certain framebuffer effects happen after a replay, performance is much more steady with Vulkan thanks to the high degree of parallelism.

With Vulkan, we have heard reports that virtually all sound crackles and stutters are gone. That’s because with vulkan you choose the sync points where you wait. In GL the driver has to guess and sometimes it fails. These effects are using render to texture, and with OpenGL this creates sync issues.

BeetleDC Libretro Progress Report – December 2018

It’s been a pretty busy end of the year for the BeetleDC core. Most of the work consisted in finalizing and improving support for Naomi and Atomiswave arcade ROMs.

Naomi / Atomiswave

Naomi GD-ROMs are now supported and this adds more than 120 Naomi games to the list of supported arcade games.
ROMs archived with 7zip as well as parent/split ROMs are now supported as well.
Another new feature is the use of per-game input descriptors: so instead of binding “Button 1” or “Axis 1”, you’ll have descriptive names such as “JUMP” or “STEERING WHEEL”. Not all games have input descriptors but more will be added in the future (and pull requests are welcome.)


In addition, many bugs have been fixed allowing many arcade games to now be fully playable: 18 Wheeler, Airline Pilot, Cosmic Smash, House of the Dead 2, Jambo Safari, Ninja Assault, Shooting Love, Virtual Athlete, Virtual On Oratorio Tangram and probably more.

Dreamcast

On the Dreamcast front, a recent but notable improvement is the automatic setting of the BIOS date and time at boot. So you should never see the date/time setting screen again. In the same area, a new core option allows to choose the BIOS language, so you don’t have to boot the BIOS to change it.
Using the Libretro disk control interface, disk swapping has been implemented. When asked by the game, you can now virtually eject the current disk and select a new one without restarting. Some multi-disk games require this feature such as D2 or Pop’n Music 3 and 4 append disks.

Another new feature for both console and arcade is the Synchronous Rendering core option. This option is only active with Threaded Rendering. When activated, it will pause the emulation thread instead of dropping a frame, which results in less dropped frames and thus a better and smoother frame rate.
Finally, Restart has been implemented so one can reset a game without having to restart the front-end.

 

Happy and Peaceful Holidays!

BeetleDC Libretro NAOMI and MAME ROM support!

Flyinghead is adding MAME ROM support to the arcade side of BeetleDC Libretro.

Here is what has currently been implemented:

  • NAOMI M1 cartridge support
  • NAOMI M2 cartridge support
  • NAOMI M4 cartridge support

Things you need to know

  • Right now, only non-merged romsets work. A merged rom is a ROM without parent, it contains all the files needed.
  • NAOMI M4 cartridges require a special BIOS file to be put inside your System directory. The M4 bios should be in a “naomi.zip” file in the BIOS folder (/dc ). The file in specific which hsould be inside that zip file is called ‘epr-21576h.ic27’.

Other important additions/changes

  • in the past, NAOMI games would only work with BeetleDC Libretro if you loaded .lst files. .lst files are no longer necessary now. You should be able to run an arcade game with BeetleDC Libretro using the plain .bin/.dat file instead now. So theoretically it should now be capable of just loading Demul-compatible ROMs instead.
  • Ring Out 4×4 now allows for up to 4 player support due to adding dual I/O board support for this game.

What are the list of MAME ROMs that are compatible?

You can check the entries inside this file here –

https://github.com/libretro/beetle-dc/blob/master/core/hw/naomi/naomi_roms.h

Out of these games, nearly all should work except for Samba De Amigo right now.

What’s planned/next?

  • Sammy Atomiswave MAME ROM support
  • Sega NAOMI GD-ROM MAME ROM support

BeetleDC Libretro Progress Report

Display VMU screens ingame!

NOTE: This feature currently works properly in BeetleDC Libretro non-OIT. BeetleDC Libretro OIT will require some more work before this feature will start rendering properly.

Thanks to RetroSven, here is another major new feature!

It is now possible to display the VMU screen ingame! You can also specify the exact positioning of each VMU, whether it should be positioned at the top left, top right, bottom left, or bottom right corner of the screen. You can also specify the opacity of each screen and the exact size of the screen. You can display all 4 attached VMU screens at the same time onscreen!

For those that don’t know, the VMU was the Dreamcast’s memory card which also could be used as a standalone device. It was powered by a ring battery, had a D-pad and some face buttons, and it was even possible to play some minigames on the VMU.Games could download VMU minigames onto the system and you could then play these minigames when used as a standalone device.

Samurai Shodown VI (NAOMI) renders properly now with Extra Depth Scaling option!

Reicast Libretro now has a new feature – Extra Depth Scaling. By enabling this, the graphics in Samurai Shodown VI (Naomi arcade game) will render properly.

Note that even with this enabled, BeetleDC OIT Libretro will currently have some display bugs that the non-OIT core won’t have. Hopefully the two can become just as good later on.

BeetleDC libretro now supports NAOMI + other additions!

BeetleDC libretro now supports Sega Naomi arcade games! Both BeetleDC and BeetleDC OIT have been updated.

Limited to Sega Naomi 1 for now. Atomiswave to GD-ROM conversion games can also work, some of them might have some issues though.

Sega Naomi

Naomi was an arcade videogame system based on the Sega Dreamcast hardware. While being nearly identical in terms of architecture, it did have double the RAM and fillrate of the home console version.

Naomi became one of the longest lasting arcade systems to be used second only to the Neo Geo AES. Various licensees (such as Capcom, Arc Sys, and even Nintendo) licensed the hardware during its lifespan to produce arcade games with.

How to use it

You will need a NAOMI BIOS file inside your system directory. The BIOS with the best compatibility so far is epr-21576g.ic27. This is a file that is contained inside the MAME NAOMI bios zip. Rename this file to naomi_boot.bin and move it to your ‘system directory/dc directory.

What content to use

You will need roms that worked on nullDC Naomi. These will typically be .dat/.lst or .bin/.lst pairs.

The last value of the .lst file specifies the size of the .dat/.bin file in hexademical value.

Here is an example of the .lst file used for Toy Fighter –

Toy Fighter
“Toy Fighter.dat”, 0x0000000, 0x05800000

You can find the existing .lst files here.

NOTE: MAME ROMS won’t work (yet). Proper Atomiswave roms won’t work, however, most Atomiswave to Naomi GD-ROM conversions should at least work or boot.

Currently existing issues

There are some issues that remain with Naomi support:

  • By default, two arcade sticks are hooked up.
  • There are some video and syncing glitches right now. One of the most immediately apparent is the flickering Naomi boot screen.
  • There is no analog and/or shoulder button support yet for Naomi games.

Videos

Toy Fighter

Dolphin Blue

King of Fighters XI

Dead or Alive 2 Millennium

Street Fighter Zero 3 Upper

Other enhancements

Fast GD-ROM Loading

A new core option called ‘GD-ROM Fast Loading Mode’ has been added. It can severely cut down on loading times, sometimes even removing them almost entirely as can be seen in the game ‘Daytona USA 2001’ here.

Various sound fadeout bugfixes

Through some judiciously applied hacks, the following games no longer suffer from sound fadeout issues:

  • Border Down
  • Bomberman Online
  • Chaos Field
  • Death Crimson OX
  • Fatal Fury/Garou: Mark Of The Wolves
  • Jet Set Radio/Jet Grind Radio
  • Napple Tale
  • Phantasy Star Online
  • Phantasy Star Online Ver. 1
  • Radirgy
  • Segagaga
  • Sonic Shuffle
  • Trigger Heat Exelica
  • WWF Royal Rumble

Graphics fixes

Thanks to the awesome efforts of flyinghead, several graphics glitches have been fixed –

Workaround for Virtua Tennis ball color problem.

Fix – Psyvariar 2, Explosions don’t render correctly

Other changes

Reicast OIT

  • Added an accumulation Pixel Buffer Size core option. You can set this to 512MB, 1GB or 2GB, depending on how much VRAM your video card has. For higher resolutions to output correctly, you might need to increase this to the highest value possible.
  • House Of The Dead 2 failed a verify assert – should boot and be playable now.
  • Rebase ADPCM decoding.
  • Reicast (non-OIT)

  • Multipass rendering is now enabled by default. Plenty of games need this for accurate rendering and the performance tradeoff should be minimal.
  • House Of The Dead 2 failed a verify assert – should boot and be playable now.
  • Rebase ADPCM decoding.
  • What’s next?

    We intend to have the next version of RetroArch available soon. On top of that, despite numerous delays, Supermodel will finally be coming soon! We felt it was right to get Sega Naomi up and running first before we unveil that!