github StrikerX3/Ymir v0.1.7

latest release: latest-nightly
25 days ago

Ymir v0.1.7

Discord | Patreon | Compatibility list

This version brings the customary set of bug fixes along with a bunch of new features, including support for the Arcade Racer and Mission Stick peripherals (in both three- and six-axis modes), the ability to take raw screenshots, new video options to improve frame pacing in windowed mode and make better use of high refresh rates when synchronizing video, a global exception handler to catch unexpected emulator crashes, and even the debugger got some attention this time - the SH-2 debugger is finally actually useful and has been an invaluable asset to help investigate and troubleshoot many bugs!

This version also brings overall performance improvements by using OS-specific features for manual reset events (used to synchronize the GUI, emulator and VDP renderer threads) as well as improving SH-2 SLEEP instruction handling. The performance uplift varies a lot between games and systems, with some seeing as much as 10% more performance.

Thanks to @Wunkolo, macOS builds are now universal, supporting both Apple Silicon and Intel-based systems in one binary. @bsdcode has been adding support for FreeBSD builds as well (#385, #389, #421), which is now available in the FreeBSD Ports Collection here.

Nightly builds are now available here. Keep in mind these are not as thoroughly tested and may contain bugs, but they're very useful for testers who wish to contribute to the evolution of Ymir or users who want to stay on the bleeding edge.

Important

Save state files created by any stable release are guaranteed to be forwards-compatible with any future version of Ymir, both stable and nightly. Save state files created by nightlies have no such guarantee. Save state files are not backwards-compatible.

Compatibility improvements

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

showcase

(click any image to zoom)

Thanks to the issue reports from many testers and users, Ymir has received numerous improvements and bug fixes. New testers have joined the community, with special mention to @thelastangryman1907 who has reported dozens of bugs for many obscure Japanese games. Of course, I should also mention long-time testers who have been helping ensure Ymir doesn't have any regressions: @Zet-sensei, @celeriyacon, @AydanWatkins, @GoodWall533, @Silanda, @waspennator, @Immersion95, @markkrauth, and many others. Sorry if I forgot someone, the list just keeps growing!

The compatibility list now has more than 10% of total games reported with nearly 80% compatibility. Filing compatibility reports is a great way to help the community too, so don't hesitate to test games and write your reports here!

Moving on to specific fixes, let's start with the brains of the Saturn: the SH-2s. The improvements in cache emulation accuracy in 0.1.6 have been deemed stable enough to be considered safe to use when needed. As such, Ymir's internal game database has been updated to force-enable this feature for Astal, Dark Savior, and Soviet Strike, as these games are known to have compatibility issues without cache emulation.

astal-forced-sh2-cache

Some fixes to SH-2 interrupt handling (particularly DMAC and FRT) have finally solved a long-standing stability issue in Daytona USA (#209) and allowed Shellshock to boot up (#344) (although Shellshock requires boosted CD Block read speeds to avoid a crash on the intro FMV). The SLEEP instruction has also been fixed and sleep/standby modes are now implemented, allowing the emulator to efficiently skip processing the CPU if it's in one of those modes as well as wake them up when an interrupt is signaled. This allows Culdcept to boot (#346) and improves performance of games that make use of the instruction.

Speaking of non-booting games, a good number of these problems were caused by CD Block or image loading issues. Last Bronx is a good example -- it uses two data tracks: a Mode 1 track containing the game's code and data, and a Mode 2 track with compressed data in a proprietary format. The way these tracks are laid out is unusual - the second data track has a pregap that wasn't being handled correctly by Ymir. Now, most Last Bronx dumps work correctly (#238), but some CHD dumps are still causing problems.

The newly-implemented support for CD-ROM Mode 2 tracks has also fixed the missing intro FMV in NiGHTS into Dreams, a really old bug reported by yours truly before releasing 0.1.0 (#46). Additional improvements to BIN+CUE and CHD loading have allowed other games to boot or fix their audio desync issues, such as the voice lines in Minnesota Fats - Pool Legend (#363).

Many other small tweaks and fixes to CD Block functionality have also helped improve compatibility with many games, including Ultraman Zukan (#329), Digital Dance Mix Vol. 1 - Namie Amuro, Sega Rally Championship Plus, Astal, Mizuki Shigeru no Youkai Zukan Soushuuhen (#391), and WipEout 2097/XL (#202).

nights-fmv astal-in-game wipeout-xl-in-game

The SCU has also received attention in this version. This time the focus was on various nuances of DMA transfers and timers, which led to stability improvements in Fighting Vipers, Sonic Jam, Tennis Arena, and probably many others.

As usual, there have been numerous graphics fixes to count here, most of them focused on small accuracy errors reported by testers. One fix that deserves to be highlighted is delaying the handling of VDP1 framebuffer swaps to slightly later in the same scanline which was meant to fix Marvel Super Heroes sprite glitches but has also fixed dozens of issues along with it:

  • Flickering graphics in DragonHeart - Fire & Steel (#334), King of Fighters '96 / '97 (#272), Jantei Battle Cos-Player (#368), PhantasM (#336), Soviet Strike (#303), Virtua Cop 2, and Yellow Brick Road (#335)
  • Corrupted sprites in Center Ring Boxing (#377), and Marvel Super Heroes (Shuma Gorath's Chaos Dimension move) (#72)
  • Partially missing sprites in Fuusui Sensei - Feng-Shui Master (#405)
  • Freezes/crashes in Mahou no Janshi - Poe Poe Poemy (#378), and Shockwave Assault (#406)

Another fix to highlight which wasn't as impactful, but is something that no other software-based Saturn emulator does right, is the VDP2 VRAM access cycle handling fix done to improve Doukyuusei - if's title screen while maintaining proper behavior for Capcom Generation - Dai-5-shuu Kakutouka-tachi's art gallery. The new behavior has been documented here to the best of my knowledge.

Finally, the last component to receive some fixes was the SMPC. Specifically, a couple of fixes to the way inputs are reported in SH-2 direct mode have fixed lack of input response in World Heroes Perfect (#297), Touge King the Spirits (#322), Chaos Control Remix (#348), and Father Christmas (#374). This leads us nicely into the next section.

Input system enhancements

Ymir now supports the Arcade Racer and Mission Stick peripherals in addition to the Control Pad and 3D Control Pad. The steering wheel sensitivity curve can be adjusted in the peripheral configuration window. The Mission Stick can be switched between three-axis and six-axis modes, the latter of which works great in Panzer Dragoon II Zwei as long as you have an extra pair of hands.

arcade-racer-config mission-stick-config

Almost the entire alphabet is mapped to this controller. Good luck using it with only two hands.

At a lower level, the input system is now capable of distinguishing various characteristics of input axes:

  • Monopolar/bipolar: whether the axis value ranges from 0 to 1 or -1 to +1 respectively
  • Absolute/relative: whether the axis reads a fixed value when held at a particular position or responds to continuous movement
  • 1D/2D: the number of components of the axis

Here are some examples of each combination of characteristics:

1D Monopolar Bipolar
Absolute Gamepad trigger Steering wheel
Relative - Mouse wheel
2D Monopolar Bipolar
Absolute Drawing pen, touchscreen Gamepad stick
Relative - Mouse movement

With this, the emulator will now stop you from binding mismatching axes to input binds, such as trying to map a gamepad trigger to the Arcade Racer's steering wheel.

UI features

Several new options have been added to manage frame pacing. You are now able to toggle improved frame pacing ("video synchronization", not to be confused with VSync) on and off in windowed mode, which greatly improves frame pacing in the same way it does for full screen mode. If you're running a high refresh rate display, Ymir will now make better use of the display frames to further reduce input lag by repeating emulator frames and processing input while maintaining the GUI speed under your display's refresh rate. If the target speed is higher than your display's refresh rate, VSync is automatically disabled and you can choose to present the earliest or the latest frame for slightly improved performance or lower perceived input lag.

video-sync-settings

The application will now catch fatal errors and display a message box to the user. These are extremely helpful to diagnose serious crashes, so whenever you encounter them, make sure to take a screenshot and include them in issues. You can also enable the message box for unhandled exceptions with the newly added -E command line option, though this isn't recommended for general usage since it may also trigger false positives depending on your system.

fatal-error exception

Fatal errors are fatal, exceptions are not.

A new hotkey has been added to take raw screenshots of the emulator, bound to F12 by default. The screenshots can be scaled from 1x to 4x and will not be distorted by the aspect ratio setting, and are saved to PNG files capturing the raw framebuffer without data loss.

The "Speed" indicator in the title bar and frame rate OSD will now display the actual and the target emulation speeds separately. If the actual speed is lower than the target speed, the emulator is demanding too much CPU power from your system and isn't capable of reaching the desired speed. Also, the VDP1 frame rate counter will now accurately track how many VDP1 frames have actually been rendered instead of the number of draw calls issued during that frame - the latter is now tracked in a separate counter.

speed-osd speed-titlebar

Doom really abuses the VDP1 to run at abysmal frame rates. And this is using the improvement patch by fafling!

A few quality-of-life features have been added:

  • You can now have Ymir automatically load most recently loaded game disc image on startup
  • The program will automatically detect the profile path and allow using the user profile path from the OS's user home directory (a contribution from @bsdcode)
  • There are new hotkeys to rotate the screen clockwise and counterclockwise (for TATE mode)

Debugger

At long last, the SH-2 debugger is actually somewhat useful! Breakpoints and single-stepping have been implemented, and there is a branch in the works to add support for memory watchpoints which didn't make it in time for this release.

The breakpoints are saved per game and per CPU, and require debug tracing to be enabled (F11 by default) to avoid a big performance impact when not using debugging features. To support them, a new "debug break signal" feature has been added to the emulator core that can be observed and signaled by any component, allowing the emulator to suspend execution at any point -- with some supporting code, of course. This will pave the way for more advanced breakpoints in the future that can be triggered by any component, not just the SH-2 CPUs.

The SH-2 debugger has also received a new window to list all registered exception vectors pointing at the CPU's VBR or any custom address.

image

Image

The [WIP] marker is gone for good. But there's always more work to do...

The CD Block has a new debug feature: the Filters view. This window lists the settings for all 24 filters, which helped fix some lockup and no-boot issues in Last Bronx, Sega Rally Championship Plus, and Digital Dance Mix Vol. 1 - Namie Amuro, as well as fix graphics in Ultraman Zukan and the intro FMV in NiGHTS into Dreams...

The non-trivial usage of filters in NiGHTS has been documented here.

cdblock-filters

Special thanks

I have added a nice little mention in the About window to all the people who have helped me improve Ymir. Thank you all!

image

If you want to be a part of this list, consider joining the official Discord server or becoming a Patreon supporter.

Changes

New features and improvements

  • App: Added a button to copy the version string from the About window.
  • App: Added hotkey to take screenshots (bound to F12 by default) with adjustable scaling from 1x to 4x. (#350)
  • App: Added option to automatically load most recently loaded game disc image on startup.
  • App: Auto-center About window whenever it is opened.
  • App: Automatically detect profile path and allow using the user profile path from the OS's user home directory. (#411, #17; @bsdcode)
  • App: Display error dialog on unhandled exceptions.
  • App: Show actual emulation speed in title bar and frame rate OSD.
  • App: Show actual VDP1 frame rate separated from VDP1 draw calls.
  • Build: macOS builds are now universal -- one binary supports both Intel and Apple Silicon Macs. (#351; @Wunkolo)
  • Build: Nightly builds are now available here.
  • Core: Improve manual reset event performance by using OS-specific implementations based on cppcoro.
  • Debugger: Added CD Block filters view.
  • Debugger: Added rudimentary SH-2 breakpoint management and per-game debugger state persistence. (#22)
  • Debugger: Added SH-2 exception vector list view.
  • Debugger: Allow suspending SH-2 CPUs in debug mode. (#22)
  • Debugger: Implemented SH-2 breakpoints. (#22)
  • Debugger: Introduced debug break signal that can be raised from just about anywhere. (#21)
  • GameDB: Force SH-2 cache emulation for Astal, Dark Savior and Soviet Strike.
  • GameDB: Implemented flag to force SH-2 cache emulation to specific games.
  • Input: Categorized gamepad triggers and sticks as absolute axes. Absolute axes output fixed values at specific positions.
  • Input: Categorized gamepad triggers as monopolar axes (having values ranging from 0.0 to 1.0) and gamepad sticks as bipolar axes (-1.0 to +1.0).
  • Input: Implemented Arcade Racer peripheral. (#29)
  • Input: Implemented Mission Stick peripheral with toggleable three-axis and six-axis modes. (#30)
  • Video: Added hotkeys to rotate screen clockwise and counterclockwise. (#318)
  • Video: Added option to reduce input lag by adjusting GUI frame rate to the largest multiple of the emulator's target frame rate that's not greater than the display's refresh rate.
  • Video: Added option to reduce video latency by displaying the latest frame instead of the oldest when the emulator is running faster than the display's refresh rate.
  • Video: Added option to synchronize video frames in windowed mode.
  • Video: Avoid frame skipping on slow refresh rate monitors by disabling VSync if the target frame rate exceeds the display's refresh rate.
  • Video: Simplify frame rate control in full screen mode.

Fixes

  • CD Block: Disconnect filter inputs for the fail target, not the filter itself. Fixes broken graphics in Ultraman Zukan's title screen. (#329)
  • CD Block: Don't disconnect CD device from when setting the fail output of filter. Fixes Digital Dance Mix Vol. 1 - Namie Amuro playback.
  • CD Block: Fix directory indexing for ReadDirectory and ChangeDirectory commands. Fixes Sega Rally Championship Plus (Japan) not booting.
  • CD Block: Fix handling of "no change" playback end parameter. Fixes Astal taking a long time to load the first stage.
  • CD Block: Properly read path table and directory records that cross the boundary between two CD sectors. Fixes Mizuki Shigeru no Youkai Zukan Soushuuhen booting back to BIOS. (#391)
  • CD Block: Read subheader data from CD-ROM Mode 2 tracks only and fix their addressing. Fixes missing intro FMV in NiGHTS into Dreams... (#46)
  • CD Block: Start new playbacks from starting FAD when paused. Fixes WipEout 2097 and XL boot issues. (#202)
  • Media: Add support for CD-ROM Mode 2 tracks. Fixes Last Bronx not booting. (#238)
  • Media: Compensate for INDEX 00 pregap in multi-indexed tracks in CUE sheets. Fixes partially skipped Minnesota Fats - Pool Legend voice lines. (#363)
  • Media: Fix handling of pregap in data tracks in single BIN+CUE dumps. Fixes some Last Bronx dumps not booting.
  • Media: Realign data offset to hunks between tracks in CHDs. Fixes some Last Bronx CHD dumps not booting.
  • Save states: Added CD Block file system state to save state data.
  • Scheduler: Ensure events are executed in chronological order.
  • SCU: Fix A-Bus external interrupt handling.
  • SCU: Fix DMA source address updates when source address increment is zero. Fixes background priority issue regression in Street Fighter - Real Battle on Film. (#168)
  • SCU: Fix Timer 1 not triggering when the reload counter is larger than 0x1AA or 0x1C6 depending on horizontal resolution.
  • SCU: Ignore/skip illegal DMA transfers in indirect transfer lists. Partially fixes corrupted or missing sprites in Fighting Vipers.
  • SCU: Illegal DMA interrupts should not trigger VDP1 Sprite Draw End DMA transfers.
  • SCU: Notify bus of DMA transfers.
  • SCU: Prevent indirect DMA transfers from starting if the first entry is illegal. Stops Tennis Arena from destroying all memory.
  • SCU: Use the source address increment for indirect DMA transfer data.
  • Settings: Disable "Include VDP1 rendering in VDP2 renderer thread" by default and don't enable it in presets.
  • Settings: Persist custom Screenshots profile path. (#398)
  • Settings: Properly restore controller binds for controllers other than the Saturn Control Pad. (#397)
  • SH2: Fix CPU getting stuck handling DMAC interrupts forever. Fixes Shellshock not booting. (#344)
  • SH2: Handle sleep/standby mode and wake up on interrupts. Fixes Culdcept getting stuck on intro FMV and boosts overall performance on games that make use of the SLEEP instruction. (#346)
  • SH2: Only clear zeroed out bits from write clear bitmask on FRT FTCSR writes. Fixes random lockups in Daytona USA. (#209) (thanks to @celeriyacon)
  • SMPC: Fixed TH control mode reports on SH-2 direct mode. Fixes input response in World Heroes Perfect, Touge King the Spirits, Chaos Control Remix, and Father Christmas. (#297, #322, #348, #374)
  • SMPC: Fixed TL reporting on SH-2 direct mode.
  • VDP1: Disable "antialiasing" for lines and polylines.
  • VDP1: Fix bad transparency caused by "illegal" RGB 5:5:5 color data (0x0001..0x7FFE). Fixes transparency in Sonic X-treme.
  • VDP1: Process framebuffer swap slightly later in the VBlank OUT line. Fixes numerous issues:
    • Flickering graphics in DragonHeart - Fire & Steel, King of Fighters '96 / '97, Jantei Battle Cos-Player, PhantasM, Soviet Strike, Virtua Cop 2, and Yellow Brick Road (#272, #303, #334, #335, #336, #368)
    • Corrupted sprites in Center Ring Boxing, and Marvel Super Heroes (Shuma Gorath's Chaos Dimension move) (#72, #377)
    • Partially missing sprites in Fuusui Sensei - Feng-Shui Master (#405)
    • Freezes/crashes in Mahou no Janshi - Poe Poe Poemy, and Shockwave Assault (#378, #406)
  • VDP1: Reorder LOPR, COPR, CEF and BEF updates. Fixes missing graphics in Virtual On - Cyber Troopers and Sega Touring CARS. (#112, #246)
  • VDP1: Use SCU DMA bus notification to adjust VDP1 VRAM write timing penalty. Fixes hanging intro FMV in Sonic Jam without breaking Mega Man X3's sprites. (#83)
  • VDP2: Always initialize and update background counters even for disabled layers. Fixes rolling screen in F-1 Challenge. (#300)
  • VDP2: Block bitmap reads from VRAM banks without appropriate CP access. Fixes dirty graphics in NFL Quarterback Club 97's title screen. (#332)
  • VDP2: Compute bitmap data access offsets when multiple chunks are read for an NBG. Fixes background offset in Doukyuusei - if while maintaining the slicing fix for Capcom Generation - Dai-5-shuu Kakutouka-tachi. (#384)
  • VDP2: Don't apply sprite shadow if sprite priority is lower than the top layer. Fixes shadows drawing on top of objects in Blue Seed - Kushinada Hirokuden. (#349)
  • VDP2: Don't blend line screen with layer 1 if line screen color calculations are disabled. Fixes fog in battle backgrounds in Zanma Chou Ougi - Valhollian. (#352)
  • VDP2: Don't increment vertical scroll BG coordinate on complementary field lines when rendering deinterlaced RBG lines. Fixes jittery/interlaced Grandia FMVs when deinterlace is enabled.
  • VDP2: Fix layer enable flags calculation when only RBG1 is enabled. Fixes missing background in MechWarrior 2's menus. (#413)
  • VDP2: Fix line color insertion logic. Fixes erroneously blended ground in Athlete Kings. (#299)
  • VDP2: Fix priority calculations for bitmap BGs. Fixes character sprites being drawn behind the background layer in Mr. Bones. (#247)
  • VDP2: Fix race conditions with threaded deinterlacing causing some artifacts on RBGs in single-density interlaced mode.
  • VDP2: Fix window indexing for RBGs in high resolution modes. Fixes stretched shadows in Last Bronx. (#395)
  • VDP2: Handle RBG window pixels in high resolution modes. Fixes extra column of garbage in Athlete Kings. (#299)
  • VDP2: Invert TVSTAT.ODD reads. Fixes garbled graphics on the top half of the screen in True Pinball. (#320)
  • VDP2: RBG1 uses Rotation Parameter B, not A.
  • VDP2: Reset NBG2/3 base vertical scroll counters when writing to SCYN2/3. Fixes garbled graphics in Marvel Super Heroes vs. Street Fighter during Shuma Gorath's Chaos Dimension move. (#72)
  • VDP2: Rework rotation table calculations. Fixes warped ground on player two's screen in Sonic R multiplayer mode. (#401)
  • VDP2: Skip calculation of VRAM PN/CP accesses for NBGs when RBG1 is enabled. Fixes missing car graphics in Gale Racer. (#359)
  • VDP2: Swap even/odd field when entering VBlank.

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 universal, working on both Apple Silicon (ARM) systems (AArch64) and Intel systems (x86_64). Ymir requires macOS 13 (Ventura) or later.

FreeBSD users can install Ymir from the Ports Collection:

pkg install Ymir         (uses zenity with GTK3 widgets for SDL3's file dialogs)
pkg install Ymir-gtk4    (uses zenity with GTK4 widgets)

Don't miss a new Ymir release

NewReleases is sending notifications on new releases.