github StrikerX3/Ymir v0.1.6

latest releases: latest-nightly, v0.1.7, latest-rolling...
one month ago

Ymir v0.1.6

Discord | Patreon

This update, just like previous 0.1.x releases, brings a ton of compatibility fixes, more performance improvements, and a handful of new features to play with, including vertical display (TATE) mode, a basic notification/messages system, improved frame pacing stability in full screen mode, and emulation speed control. This is the biggest release yet, with over 80 changelog entries and the most bug fixes of every release so far.

Before we get to the meat of the release notes, I'd like to announce that Ymir now has an official compatibility list which still needs some love. Help fill it out by testing games and filling out reports in the Requests sheets. As of this writing, over 60% of reported titles are fully playable and another 20% at least goes in-game. Not bad for an emulator that's less than a year old! But this is only a small picture of the overall compatibility, as only 6% of the entire library has been tested so far.

ymir-compat

Compatibility improvements

Here's a small showcase of games that now work on 0.1.6 or had major bugs fixed:

ymir-games-showcase (click any image to zoom)

As usual, @celeriyacon has provided me with an ever-growing set of test ROMs to help improve emulation accuracy, while @Zet-sensei has pointed me in the right direction with various tricky games to test and fix, and the folks in the Discord community have been diligently testing dev builds and reporting issues left and right. This time, the SCU and the VDP2 have received special attention -- tons of fixes eliminated various bugs in previously working games and made a few more games boot past the SEGA logo or the typical black screens. WipEout is now playable and Rayman's graphics glitches have been eradicated for the most part. Even the famed Rayman final boss glitch is no match for Ymir.

ymir-wipeout.mp4
ymir.-.rayman.mp4

The SCU DSP in particular now has an even nastier set of tests, some of which Ymir is deliberately failing in order to maintain compatibility with some games. The SCU DMA has received an overhaul and is much more accurate, matching Mednafen's behavior 1:1. There are a few cases where both Ymir and Mednafen don't match the real hardware, although these are probably never seen on commercial titles. SCU interrupts have been revised along with master/slave SH-2 external interrupt handling behavior and should be much less problematic. The synchronization between SCU and the two SH-2 CPUs has been tightened, which helped fix WipEout's black screen on boot.

SH-2 cache emulation had a small bug in the LRU lookup table that caused weird glitches in many FMVs; this is now fixed and SH-2 cache emulation is now enabled by default for the added compatibility it provides for some games (e.g. Dark Savior).

There are too many VDP1 and VDP2 fixes to discuss here -- see the Changes section below for details. In short, many graphics glitches reported by users have been fixed, including some that no other emulator (except the MiSTer Saturn core, to my knowledge) has accurately emulated so far. A notable example is an issue with Capcom Generation - Dai-5-shuu Kakutouka-tachi (#254) in which the bottom portion of the pictures in the art gallery were sliced and shifted to the right, a behavior seen on Ymir 0.1.5, Mednafen 1.32.1, Yaba Sanshiro 1.16.6 and Nova 0.7.0:

ymir-capcom-gallery-image-bad

This was caused by lack of emulation of an improper VRAM access cycles configuration made by the game for the bitmap graphics displayed on these screens. With recent improvements to VRAM access cycles handling, Ymir 0.1.6 is now capable of displaying the images correctly:

ymir-capcom-gallery-image-good

The newly improved VDP2 VRAM access delay debug window can display information on delayed background data accesses and has been upgraded to display information on bitmap backgrounds too:

ymir-vram-access-delay

If you're technically-minded and interested in how this works, check out my brief writeup on games that use illegal VRAM access cycles.

To conclude this round-up, there have been a few fixes to the CUE parser that should fix some CD audio track misalignments and allow Ymir to load games dumped with ImgBurn or other non-Redump-approved tools, as long as the audio tracks are still in raw/binary format. The CD Block, SCSP and SMPC received one small bugfix each:

  • CD audio tracks in X-Men: Children of the Atom will now resume properly after pausing in-game.
  • A SCSP bug that caused sound effects in many games to be truncated has been squashed. Enjoy Sonic R's pause jingle in its entirety, Alucard's hoohs and haahs while speedrunning Akumajou Dracula X, and Daytona USA CCE's over-the-top announcer lines uninterrupted!
  • SMPC command processing was slowed down ever so slightly to allow finicky games such as F1 Challenge and the European release of Quake to boot.

TATE mode and new view options

A number of games (especially shoot-em-ups) support TATE mode, which requires the screen to be rotated 90°. Ymir now supports rotating the display in any direction to support those games, or just for added challenge. You can even rotate the display 180°, because why not?

display-rotation-options tate-mode-games

Along with this, new aspect ratio options have been added along with options to quickly resize the window to specific scales. Note that the scales are relative to high resolution modes, so the 2x option will result in 4x4 pixels in low resolution modes and 2x2 pixels in high resolution modes, both of which fit nicely on a 1080p display. Also, there's a new option to remember window geometry (position and size) so you don't have to adjust the window every time the emulator is relaunched.

view-menu

Smoother frame pacing

This version significantly improves frame pacing stability in full screen modes. The algorithm will now smooth out frame rate adjustments based on audio buffer state over the course of multiple frames and will spin-wait for up to 1 ms to ensure the frame is presented as close to the target time as possible. See the graphs below for a comparison.

Before:
ymir-frame-pacing-0 1 5

After:
ymir-frame-pacing-0 1 6

0.1.5 had slight fluctuations on every frame. 0.1.6 is far more consistent, as depicted by the nearly straight line and the more accurate 16.6ms frame time.

Performance improvements

Some components went through a round of performance optimizations:

  • SH-2 cache emulation now avoids byte-swapping, making it slightly less impactful when enabled.
  • SH-2 interrupt checks have been optimized down to a single flag check, noticeably improving performance as this is done millions of times per second.
  • SCSP went through various micro optimization rounds that also contributed to a small overall performance gain.
  • The memory bus can now map simple arrays directly, greatly speeding up accesses to ROM and RAM which comprises the majority of memory accesses.

Combined, these optimizations contributed to an overall emulation performance improvement of 5% to 10% on average and in some cases as high as 25%.

The biggest performance boost of this version comes from a new option in Settings > Video that introduces a separate thread for deinterlacing which significantly lessens the performance impact of that enhancement. In some games, the deinterlace option used to cut performance almost in half, but with the new thread the impact is usually less than 10%. This option requires a quad-core CPU or better for best results.

See the pictures below for a performance comparison in Virtua Fighter 2:

image

In this example, the performance cost of the deinterlace option was about 37%. With the dedicated thread, it drops to less than 8%. Some games benefit much more from this option than others. In Fighters Megamix, performance is lowered by 43% with the deinterlace enhancement, but when adding the dedicated thread, it reduces performance by less than 8% again.

Speed control

Before 0.1.6, the only speed options you had were 100% or uncapped (and paused, if you count that as a "speed option"). Now you have two adjustable speeds at your disposal which you can swap with the push of a button and adjust on the fly from 10% to 500% with new shortcuts. The uncapped turbo mode is still present and disables the speed limit just like before. In full screen mode, the GUI will always be updated at 48 fps or higher when running at lower speeds. If the target speed is higher than your display's refresh rate, the emulator will skip frames to maintain the GUI frame rate within range. Note that this frame-skipping does not boost performance -- the emulator is still fully rendering all frames but choosing not to display some of them.

ymir-speed-settings

ymir-alt-speed-slomo ymir-high-speed ymir-normal-speed

Several new hotkeys were introduced to let you control the speed in real time without going through menus and settings windows. These are the default key bindings:

ymir-speed-control-keybinds

Input system enhancements

The input system now lets you bind Ctrl, Alt or Shift as controller buttons, and will now react to standalone keypresses regardless of modifier combos. On 0.1.6, assuming the default input bindings, pressing Ctrl+J will now correctly trigger the A button on the Port 1 Control Pad (which is bound to J by default), whereas before these changes the key combo would mask the standalone J keypress, blocking it from actuating the A button on the emulated controller.

Important

Keys mapped to controller buttons will always be triggered regardless of modifier keys (Ctrl, Alt, Shift). This means shortcuts that use keys mapped to controller buttons will also cause these buttons to be actuated. Some default keybindings where changed or removed to accomodate for the new behavior. Make sure to reset the hotkeys or reconfigure them to avoid conflicts. The following default binds were changed:

  • Pause/resume emulation: Ctrl+P replaced with Spacebar.
  • Start button on Port 1 Control Pad and 3D Control Pad: Return removed due to conflict with Alt+Enter used for toggling full screen.

A new "Clear all" button was added to controller input settings to let you quickly clear and remap all buttons.

UI features

A simple notification/messaging system has been added to provide feedback for some actions. You can turn it on or off in the newly added Settings > GUI tab.

ymir-messages ymir-gui-settings

Let's talk about the new GUI settings while at it. The "Remember window geometry" option was explained above. "Show messages" toggles the notification messages shown above on and off. "Show frame rate" displays a nifty little frame rate counter with the same information displayed on the window title bar, useful for full screen modes, and you can place it in any of the four window corners. Finally, "Show speed indicators for modified speeds" will display the slow-motion or fast-forward indicator if the current emulation speed is not set to 100%.

ymir-fps-osd

ymir-ffwd-indicator ymir-ffwd-turbo-indicator ymir-slomo-indicator ymir-fast-rewind-indicator ymir-slow-rewind-indicator

You can bind keys to toggle the frame rate OSD on and off and to cycle between the four positions.

The Backup Memory Manager also received some attention. You can now sort files, the entries will be sorted by filename by default, and it now displays the number of logical blocks (matching the numbers displayed in the Saturn's backup manager screens) and header blocks separately. Also, the manager will now export BUP files in the standard format used by various save management tools, allowing you to export saves from Ymir and use them with any other emulator or even a real Saturn.

Image

In the pictures below, you can see that the exported BUP file now has the Vmem magic and contains a valid BUP header which can be successfully read by external backup management tools.

ymir-bup-data ymir-bup-data-imported

Also on the topic of backup memory, when inserting a Backup RAM cartridge, the Image path field will now provide a default value, letting you insert the cartridge without having to specify a path first.

ymir-default-bup-cart-path

The File menu now contains a submenu for save states. You can directly load or save states from there or select an empty slot.

ymir-save-states-menu

Changes

New features and improvements

  • App: Added display rotation options for TATE mode games. (#256)
  • App: Added frame rate OSD and hotkeys to toggle it and change positions.
  • App: Added menu actions to resize window to specific scales.
  • App: Added new 3:2 and 16:10 forced aspect ratio options.
  • App: Added option to remember window position and size. (#4)
  • App: Added save states to File menu.
  • App: Added simple message overlay system to display some basic notifications. (#288)
  • App: Display emulation speed in title bar and under speed indicator, and add a new indicator for slow motion. (#16)
  • App: Improve full screen frame pacing even further by spin-waiting for up to 1 ms before the frame presentation target.
  • App: Include timestamp on save states.
  • App: Notify about loading/saving save states or switching save state slots.
  • App: Smooth out frame interval adjustments in full screen mode.
  • Backup Manager: Export "Vmem"-type BUP files by default.
  • Backup Manager: Make all columns sortable.
  • Backup Manager: Show logical block usage (matching BIOS numbers) + header blocks. (#294)
  • Debugger: Added basic VDP1 registers inspector window.
  • Input: Added new keybinds for frame rate limit control: increase/decrease speed, switch between primary/alternate speed, reset speed. (#16)
  • Input: Changed default keybinds for Pause/Resume action from "Pause, Ctrl+P" to "Pause, Spacebar".
  • Input: Removed Return from default binds to Port 1 Start button to avoid conflict with full screen hotkey (Alt+Enter).
  • SCSP: Various micro optimizations.
  • Settings: Added "Clear all" button to controller configuration window to clear all binds. (#288)
  • Settings: Automatically create/suggest a backup RAM file if no path is specified when inserting the cartridge.
  • SH2: Improve cache emulation performance by avoiding byte-swapping cache lines.
  • SH2: Improve overall emulation performance by simplifying interrupt checks.
  • System: Map 030'0000-03F'FFFF memory area.
  • System: Map simple arrays directly as pointers into the Bus struct to improve overall performance.
  • VDP2: Add dedicated thread for deinterlaced rendering if VDP2 threading is enabled. Significantly lessens performance impact of the deinterlace enhancement on quad-core CPUs or better.
  • Video: Implemented frame rate limiter. (#16)

Fixes

  • App: Disable emulator-GUI thread syncing when not in full screen mode. Fixes emulator slowing down when running at 100% speed on displays with refresh rate lower than 60 Hz.
  • App: Fix frame pacing and speed limiter on 50 and 60 Hz displays.
  • CD Block: Fix handling of "no change" PlayDisc parameters. Fixes X-Men: Children of the Atom CDDA tracks not resuming after pausing. (#274)
  • Debugger: Indirect SCU DMA transfers were being traced with the updated indirect table address.
  • Input: Fix inability to bind keyboard combos.
  • Input: Modifier keys can now be used correctly as controller input binds and will no longer interfere with other controller inputs. (#282)
  • Media: Allow loading CUE files with PREGAP and INDEX 00 on the same TRACK.
  • Media: Don't bother detecting silence in pregap area; trust the CUE files.
  • Media: Skip blank lines in CUE files.
  • Save states: Read/write missing SCSP field to save state object. Fixes occasional application crashes when using the rewind buffer in conjunction with save states.
  • SCSP: Use EG level instead of total level in MSLC reads. Fixes missing/truncated SFX on various games, including Sonic R, Akumajou Dracula X and Daytona USA CCE.
  • SCU: Allow SCU DSP program and data RAM reads or writes while the program is paused (thanks to @celeriyacon).
  • SCU: DSP data RAM reads should return 0xFFFFFFFF while program is running (thanks to @celeriyacon).
  • SCU: HBlank IN DMA transfers should not be gated by timers. Fixes non-scrolling Shinobi-X cityscape background. (#193)
  • SCU: Improve HBlank IN, VBlank IN and VBlank OUT interrupt signal handling.
  • SCU: Increment DMA source address by 4 after performing DMA transfers with no increment. Fixes background priority issues in Street Fighter - Real Battle on Film. (#168)
  • SCU: Interleave SCU DSP DMA transfers with program execution when not writing to Program RAM or accessing the CT used by DMA (thanks to @celeriyacon).
  • SCU: Rework SCU DMA transfers. Fixes displaced tile data in Steam-Heart's. (#278)
  • SCU: Run all pending DMA transfers instead of just the highest priority.
  • SCU: Split up MSH2/SSH2 interrupt handling.
  • SCU: Various fixes to SCU DSP DMA transfers to DSP Program RAM (thanks to @celeriyacon).
  • Settings: Reverse IPL column sorting order.
  • SH2: Fix cache LRU AND update mask. Fixes FMV glitches on Capcom games, WipEout and Mr. Bones when SH-2 cache emulation is enabled. (#202, #247, #270)
  • SH2: TAS.B read should bypass cache.
  • SH2: The nIVECF pin of the SSH2 is disconnected, disallowing it from doing external interrupt vector fetches.
  • SMPC: Delay all commands for slightly longer to allow Quake (EU) to boot with normal CD read speed (2x).
  • SMPC: Fix automatic switch to PAL or NTSC to match area code more consistently.
  • System: Only hard reset if SMPC area code actually changed.
  • System: Tighten synchronization between SCU and SH-2 CPUs. Improves stability on WipEout (USA). (#202)
  • VDP1: Double horizontal erase area when drawing low-resolution sprites with 8-bit data. Fixes right half of sprite graphics not cleaning up in Resident Evil's options menu. (#180)
  • VDP1: Extend line clipping to the left and top edges by one pixel to compensate for some inaccuracies.
  • VDP1: Fix end codes for 64 and 128 color sprites. Fixes white sprite outlines in Scud - The Disposable Assassin and broken sprites in Primal Rage. (#268, #280)
  • VDP1: Hack in VDP1 command processing delay on VRAM writes. Fixes glitched sprites on Mega Man X3. (#244)
  • VDP1: Include source color MSB when rendering polygons in half-luminance mode. Fixes intro FMV background on Crows - The Battle Action. (#107)
  • VDP1: Mask CMDCOLR bits 0..3 in 4bpp banked sprite mode. Fixes palette issues in Steam-Heart's and Dragon Ball Z - Shinbutouden. (#69, #278)
  • VDP1: Properly handle DIE/DIL in single-density interlaced mode. Fixes text drawn twice as tall in Resident Evil options menu. (#180)
  • VDP2: Adjust character data offset for 2x2 characters in RGB 8:8:8 color format. Fixes garbled FMV in Crusader - No Remorse. (#108)
  • VDP2: Apply character pattern delay based on first pattern name access, not all of them. Fixes shifted UI elements in Battle Arena Toshinden Remix. (#306)
  • VDP2: Apply per-dot special color calculations to bitmap BGs. Fixes translucent UI in The Story of Thor. (#152)
  • VDP2: Don't update line/back screen color, line screen scroll or rotation parameters when the display is disabled. Fixes blank screen during Sega Rally Championship boot up.
  • VDP2: Fix per-dot special priority function. Fixes BG priority issues in Waku Waku Puyo Puyo Dungeon.
  • VDP2: Fix single-density interlaced mode not actually interlacing the image.
  • VDP2: Fix sprite layer display when rotation mode is enabled. Fixes sliding 3D graphics on Hang-On GP and Highway 2000. (#167, #208, #277)
  • VDP2: Fix transparent VDP1 color data handling. Fixes missing graphics in Rayman's level select screens and Bubble Bobble's sky in the title screen. (#262)
  • VDP2: Fix window short-circuiting logic. Fixes missing ground in Final Fight Revenge and incorrect UI elements in Sakura Taisen. (#104, #253)
  • VDP2: Halve sprite layer width when drawing 8-bit sprite layer in low-resolution VDP2 modes. Fixes text drawn twice as wide in Resident Evil options menu. (#180)
  • VDP2: Handle bad window parameters set by Snatcher on the "Act 1" title screen (and probably many other places). (#259)
  • VDP2: Honor TVMD.BDCLMD when the display is disabled. Fixes screen transitions in Sega Rally Championship.
  • VDP2: Ignore vertical cell scroll read cycles for NBGs that have the effect disabled. Fixes wavy background effect on stage 2 of Magical Night Dreams - Cotton 2. (#255)
  • VDP2: Implemented rules for bitmap VRAM access delay. Fixes sliced images in Capcom Generation - Dai-5-shuu Kakutouka-tachi art gallery. (#254)
  • VDP2: Latch BG scroll registers earlier (at VBlank OUT) and latch vertical scroll registers (SCY[ID]Nn). Fixes bad vertical offset in Shinobi-X's NBG2 layer. (#193)
  • VDP2: Read first vertical cell scroll entry on bitmap backgrounds. Fixes misplaced lines in Street Fighter - Real Battle on Film FMVs. (#291)
  • VDP2: The first vertical cell scroll entry read does not update the address. Fixes background offset on the first Rayman boss stage.
  • VDP2: Update line screen scroll address at Y=0. Fixes line glitches in Rayman's backgrounds and Sonic Jam's Sonic 2 special stage graphics.
  • VDP2: Update line screen scroll offsets only at the specified boundaries. Very slightly improves performance and fixes text slicing issues in Sega Rally Championship's Records and Options screens.
  • VDP2: Update vertical cell scroll every 8 cell dots correctly when the background is zoomed in.
  • VDP2: Update vertical scroll registers (SCY[ID]Nn) when written. Fixes background distortion effect of Shuma Gorath's Chaos Dimension super move in Marvel Super Heroes vs. Street Fighter. (#72)
  • VDP: Fix handling of VDP1 threading flag when VDP2 threading is disabled.
  • ymdasm: Fix reversed SCU DSP DMA immediate/data RAM operand decoding.
  • ymdasm: Mask and translate several SCU DSP immediates.

Which version should I download?

Grab the file matching your operating system and processor architecture:

  • windows, linux and macos indicate the operating system
  • x86_64 is for Intel or AMD CPUs and AArch64 (also known as ARM64) is for ARM CPUs
  • All builds are for 64-bit systems

For x86_64 builds, the AVX2 version offers slightly better performance but requires a CPU that supports the instruction set -- pretty much any Intel Core or AMD CPU since 2011 and Intel Pentium/Celeron CPUs from 2020 onwards has support for it. If you don't know if AVX2 is supported or you have no idea what any of this means, it's probably safe to grab the AVX2 version if you don't have an ancient or cheap computer. If it doesn't start up or randomly crashes for no reason, try the SSE2 version.

Every ARM build also includes support for the NEON instruction set.

For Windows releases, you might also need to install the latest Microsoft Visual C++ Redistributable package (x86_64 installer, AArch64/ARM64 installer). Ymir requires Windows 10 or later.

The macOS releases are available for Apple Silicon (ARM) systems (AArch64) and Intel systems (x86_64). Ymir requires macOS 13 (Ventura) or later.

Don't miss a new Ymir release

NewReleases is sending notifications on new releases.