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.

Libretro Cores Progress Report – April 2, 2020

Our last core progress report was on February 29, 2020. Below we detail the most significant changes to all the Libretro cores we and/or upstream partners maintain. We are listing changes that have happened since then.

How to update your cores in RetroArch

There are two ways to update your cores:

a – If you have already installed the core before, you can go to Online Updater and select ‘Update Installed Cores’.

b – If you haven’t installed the core yet, go to Online Updater, ‘Core Updater’, and select the core from the list that you want to install.

Final Burn Neo

Description: Multi-system arcade emulator

  • Latest updates from upstream

blueMSX

Description: Home computer MSX emulator

  • Fix not smooth scroll in PAL 50Hz
  • Buildfix for libnx (Switch)
  • Buildfix for 3DS

Beetle PSX

Description: Sony PlayStation emulator

  • Added “fast PAL” hack to allow PAL games to play at NTSC framerates
  • Added Force NTSC aspect ratio
  • Vulkan: Disable adaptive smoothing by default

    This should be disabled by default like the other Vulkan-exclusive
    enhancements so as to better match stock settings

  • Hide scanline core options based on content region
  • Refactor memory card core options logic

    Get rid of confusing check_variables() memcard startup logic and
    corresponding redundant variables, and update core option
    labels/sublabels to match actual core functionality.

  • Implement aspect ratio core option (psx.correct_aspect equivalent)

    Beetle PSX implementation of “psx.correct_aspect” introduced in Mednafen
    1.24.0-UNSTABLE (no relevant code backported from upstream).
    Additionally fixes aspect ratio scaling issues when cropping overscan or
    adjusting visible scanlines. “Force 4:3” is left as a legacy option for
    users preferring the old inaccurate behavior.

  • Add option for setting core-reported FPS timing
  • WIP: increase RAM to 8MB instead of the default 2
  • Improve internal FPS detection

Vitaquake 2

Description: Quake 2 game engine core

Vitaquake 2 is now available for the first time on Emscripten.

Hatari

Description: Atari ST/STE/TT/Falcon emulator

  • Port: Ported Hatari to PS Vita

Atari 800

Description:

  • Port: Ported Atari 800 to 3DS

Dosbox core

Description: MS-DOS home computer emulator

  • Latest updates from Github

Dosbox SVN

Description: MS-DOS home computer emulator

  • Latest updates from Github
  • Make 16MB RAM default, change default cycle mode to “fixed” and “10000”

    Max and auto modes are broken on some systems.

LRMAME

Description: Multi-system arcade emulator

  • Updated to version 0.219

ECWolf

Description: Wolfenstein 3D game engine core

  • Latest updates (TODO/FIXME)

Flycast

Description: Sega Dreamcast emulator

  • fix alignment issues reported by ubsan on x64
  • Fix chd lzma and zlib buffers alignment
  • Fix rec/x64 block check alignment
  • Fix ChannelEx struct alignment
  • nvmem: generate console ID at startup. rec-x64: Call stack alignment

    Generate console ID in dc_nvmem.bin if blank. Used by chuchu rocket
    login.
    Align stack to 16-byte when calling function from x64 rec

  • (NAOMI) add sfz3ugd button labels
  • (NAOMI) Alien Front Naomi needs DIV matching disabled
  • (NAOMI) VMU support (vonot, sf3zu). Fix otrigger inputs.
  • input: only use R2/L2 for trigger input even with digital triggers
  • renderer: generate mipmaps for custom textures
  • custom texture: stop loader thread before loading state
  • renderer: decrease MipmapD bias – fixes street lights in Sonic Adventure 1
  • gdrom: don’t resume CDDA if not playing. stop if cur > end – implement ATA_IDENTIFY
  • Protect RAM and VRAM when VMEM is disabled
  • (Switch) Initial Port
  • ta: defer index building and strip merging, filter out infinite vertices
  • pvr: reserve more opaque polys. Don’t crash on TA overrun
  • vmem: unprotect vram when releasing memory if NO_VMEM
  • (Switch) Iterate each Page for Permission set
  • Use -O2 for YUV_Block8x8 due to UB
  • pvr: don’t reset tile clipping value on each frame – Fixes Irides – master of blocks
  • support multi-session cue/bin. mipmap D-adjust only to increase LoD
  • limit maple schedule time
  • allow VRAM 8-bit reads
  • gl: use common ReadFramebuffer() func
  • sort triangles even with 1 polygon – fixes missing Naomi boot logo and vtennis2 black frame during replay
  • fix crash when TR poly count is 0

ChaiLove

  • Port: Ported ChaiLove core to 3DS
  • Port: Ported ChaiLove core to Android

HBMAME

Description: Emulator of homebrew and hacked games for arcade hardware

  • New core

VICE

Description: Commodore 64 home computer emulator

  • Split “Paddles” joyport type to first two RetroPads:
    Player1 vertical axis = Player2 horizontal axis
    Player1 2nd button = Player2 1st button
    Add speed modifier hotkeys (slower+faster) for paddles/mouse

    Because “Paddles” is in fact 2 controllers in one joyport, and currently it is read like a mouse with 2 axis and 2 buttons, this is not convenient for 2 player games, like Panic Analogue, which use paddles as 2 separate entities with one axis and one button.

  • Fixes for JiffyDOS, Disk Control & Statusbar –

    To evade JiffyDOS incompatibilities with CRTs, PRGs & TAPs, the allowance method is changed from whitelist to blacklist.
    Also M3U playlists of D64 images will allow, and playlists of TAP images will not
    Fixed not being able to insert disks at all when starting without content
    Drive type defaults to 1541, as in inserting D81s will not work for now, because drive type autodetection happens only on autostart
    Finetuned statusbar

  • Turbofire & JiffyDOS fix –
    Minor fixes:

    Turbofire pulse was off (value 2 was actually 4)
    No reason to allow JiffyDOS core option with anything other than D64 & D81, or is there..?

  • Remove Nuklear GUI, Add VKBD touch control –
    Replaced bloaty Nuklear with the lightweight VKBD from PUAE

    No drawbacks, only benefits: Touch control, better performance, simpler maintenance

  • Port: Fixed VICE core Android build
  • Port: Ported VICE core to 3DS
  • Port: Ported VICE core to Emscripten
  • Add support for disk control interface v1 (disk display labels)
  • x64: Exclude vicii-clock-stretch.c – vicii-clock-stretch.c is not really used on x64, it’s only for x128
  • Disable cpmcart on x128 –
    Both x128 and cpmcart have z80 cpu and both have z80_regs symbols.
    On platforms other than emscripten those symbols end up being aliased
    due to “-fcommon” behaviour. This would lead to very weird results if they
    would ever be used together.

    On real hw cpmcart is unnecessarry due to integrated CP/M mode

    In the emulator cpmcart is runtime-enable only on x64 and x64sc but
    the relevant code is still compiled-in.

    So just remove cpmcart.c and #ifndef to avoid references

  • Core option for disabling autostart joined with autostart warp
  • Statusbar improvements, VKBD transparency core option

GME

Description: Game Music Emulator core

  • Port: Ported GME core to PSL1GHT (PS3)
  • Port: Ported GME core to 3DS

prBoom

Description: Doom 1/2 game engine core

  • retro_run: Don’t attempt to run domm lop after exit – This fixes crash on exit on 3DS
  • Port: Added PSL1GHT port (PS3)

MelonDS

Description: Nintendo DS emulator

  • (Switch) Latest updates

P-UAE

Description: Commodore Amiga emulator

  • VKBD updates, CD turbo speed backport
  • WHDLoad changes (button overrides)
  • VKBD touch control –
    Only tested with Windows and mouse, since RETRO_DEVICE_POINTER also reacts with it. Hence also disabled real mouse control while VKBD is visible.
  • Port: Ported P-UAE to PSVita
  • Minor save state improvements
  • Extended ZIP support

ScummVM

  • Update to ScummVM 2.1.1
  • Allow launching games directly from game files

Mr. Boom

Description:

  • Port: Ported Mr. Boom to 3DS
  • Port: Ported Mr. Boom to Emscripten
  • Port: Ported Mr. Boom to PSP
  • Port: Ported Mr. Boom to PS Vita
  • Port: Ported Mr. Boom to Apple tvOS
  • Fix unaligned casts

FCEUmm

Description: NES emulator core

  • Fix unable to load some unif carts
  • M274 update
  • Add 42-in-80000 multicart (m380)
  • Add mapper 389 (Caltron 9-in-1)
  • BMCFK23C – update
  • Fix default palette
  • Add Mortal Kombat Trilogy – 8 People (M1274) (Ch) [!].nes to ines-cor…
  • Merge unif board BMC-Super24in1SC03 to BMC-FK23C
  • M176: Minor tweak to chr mixed ram/rom logic check and others
  • Simplify dipswitch options for Nintendo World Championships 1990 cart
  • MMC3: Make sure to free any allocated memory when using MMC3 as an external module
  • Misc mapper updates
  • m269: Move chr unscrambling to mapper init
  • Unif: Show raw values for prg/chr rom size in logs
  • Remove unneeded code in BMC-Super24in1SC03
  • Remove duplicate code in bmc-fk23c
  • Rewrite BMC-FK23C/A (m176) based on updated notes and testing
  • Fix incompatible pointer type warning
  • Add 168-in-1 New Contra Function 16 to ines-correct.h
  • unif.c: Align board map struct
  • ines.c: Cleanup mapper struct and iNESLoad()
  • Fix unterminated savestate struct
  • Update mapper 79
  • vrc2and4: Fix mapper 22 games not working (regression) and refactoring
  • Update ines-correct.h

The Powder Toy

Description: Game engine core

  • Port: Ported The Powder Toy to 3DS

PocketCDG

Description: MP3 Karaoke audio player

  • Eliminate too verbose output – On 3DS stderr is printed on lower screen and is slow. This messes up the
    performance completely.

Picodrive

Description: Sega Megadrive/Genesis/32X/CD emulator

  • Add option to change sound quality – Even with the fast renderer (#116), the framerate on the PSP slows down at some points in some games. Reducing the sound rate can help increase the framerate in these cases.

    It’s not ideal but it’s better than frame skipping. [bmaupin]

VBA-M

Description: Game Boy Advance emulator

  • Fix Save Failed error for Super Monkey Ball Jr.

gpSP

Description: Game Boy Advance emulator

  • [3DS] Fix dynarec prefetch aborts
  • Add automatic frame skipping

Frodo

Description: Commodore 64 emulator

  • Support running without ROM

PX68K

Description: Sharp X68000 Emulator

  • Prevent simultaneous up+down / left+right button presses

Lutro

Lutro now runs on the 3DS.

Snake runs at 60 fps
Platformer runs at 20 fps

  • (3DS) Fix build
  • (Switch) Fix build