Core Progress – Snes9x 2002 – Input lag reduced by 1-2 frames

Written by Brunis:

There’s probably a good number of people still using RetroArch’s snes9x2002 core for SNES emulation on low-performance devices (primarily Raspberry Pi 1 and Zero). There’s probably also going to be a resurgence now that the Retroflag GPI Case is coming. Because of this, I had a look at snes9x2002, testing both the performance (frame rate) and input lag. Turns out snes9x2002 had two issues with input lag:

In the LibRetro layer: The emulator would first run to generate a frame, then the input would be sampled, instead of the other way around. This means that the input fed to the emulator was always that which was sampled after rendering the previous frame. This added between 0 and 1 frame of input lag, depending on frame rendering time.

In the emulator itself: Each time the emulator was kicked off to render the next frame, it would start at the first scanline and run to the last. Due to how most SNES games work (polling input at the beginning of VBLANK, running game logic during VBLANK and scanning out the resulting lines from scanline 0 to 226/240), the optimal thing to do is to start the emulator at VBLANK, just before polling input, and then run it for a complete frame until the start of the next VBLANK. That means you capture input polling, game logic and resulting image within one and the same emulator loop. This issue added exactly 1 frame of input lag.

I fixed these issues (with Tatsuya79 on GitHub helping out with committing the LibRetro layer fix) and the result is a reduction of input lag by 1-2 frames (16.7 to 33.3 ms), without any increased computational demands. The updated core is available now, by updating from source or using the Online Updater in RetroArch.

It’s important to mention that these fixes bring snes9x2002 up to par with the other RetroArch snes9x cores in terms of input lag. Unless you have a really low-performance device, you’re still better off using snes9x2005 and upwards for the superior emulation.

RetroArch 1.7.7 – Released!

UPDATE May 11, 2019: RetroArch 1.7.7 has been updated again. This latest hotfix release should fix several crashing issues that could happen at startup on the 3DS and WiiU. It should also be a generally more stable release than the previous version. If you already downloaded RetroArch before May 11, be sure to download it again and upgrade your existing version!

RetroArch 1.7.7 has just been released! Grab it here.

If you’d like to show your support, consider donating to us. Check here in order to learn more.

Buildbot/release woes – and a new Patreon goal

On a special note, this release took several days due to our buildbot no longer being up to the task of being able to process all of these builds within a timely manner. We have set out a new Patreon goal that would allow us to significantly upgrade our rented servers so that release cycles don’t have to take 10+ hours anymore. Please consider pledging to our Patreon.

New tiers and perks

We have created new tiers, there is now a $1 tier that gives you a special Discord badge and access to a Patron-only Discord channel. The $5 tier gives you all the perks of the $1 tier including a special subflair on our RetroArch subreddit page. There is now also a $10+ tier, if you become a member of this, you can choose to have your name/nickname inserted into RetroArch’s Credits screen in future versions of the program.

So, we reiterate, the release could have happened this past weekend, but unfortunately, we were met with the stark reality of a buildbot that has long since outgrown its shoes, and we now need to throw better hardware at it in order to make it perform much faster. So we ask for your help in that endeavor.

Highlights

Experimental alpha version of UWP/Xbox One version!


NOTE: This is a pre-alpha version of RetroArch for UWP/Xbox One! Please be aware that the current product is far from polished, and that whatever you see here might not be reflective of the finished product later on. Our sole purpose for releasing this is that Dominater01 had already made a release and we felt it would be remiss not to share this with our users, regardless of its current level of polish.

To learn more about this, read this article here.

Desktop UI – Settings

Ever since its inception, RetroArch users on the desktop have been clamoring for a Desktop UI that would allow them to manipulate all of the settings available in RetroArch. The most often heard complaint was that it was cumbersome to change these settings with a gamepad. Of course, our intention is to have a unified UI that mostly works the same across desktop, game consoles and mobile phones, but a reasonable argument could be made that it was counterintuitive to force a desktop user to go through a gamepad-centric UI.

So, to address these criticisms, a few versions back we debuted a companion Desktop UI that can be invoked by pressing F5. This was step 1. We have made this process a bit easier now too for Windows users. You can now go to the menubar, go to ‘Window’ and then select ‘Toggle Desktop Menu’ in order to go to the Desktop UI.

Step 2 was adding an actual settings screen. This has now been done as of version 1.7.7. Thanks to the great efforts of CozmoP and also due to some refactoring on our end, starting as of version 1.7.7, RetroArch will finally allow you to change settings inside the nice and easy Desktop UI (that can be triggered at any time by pressing F5 on your keyboard).

NOTE: The Desktop UI is only available for Mac, Windows and Linux. The desktop UI is powered by Qt 5.

Menu widgets

In this video, you will see some of the widgets in action when:
* Taking a screenshot
* Downloading a core

But there are many more widget elements available, such as:
* Fastforwarding
* Rewinding
* Showing the framerate onscreen
* Achievement notifications

Etc.

This is all courtesy of natinusala. More widgets will be added in the future.

Generic message widget, shader previous/next hotkey

Achievement notification widgets

New OpenGL Core driver supports Slang universal shader spec!


A new OpenGL driver has been made that targets OpenGL 3.2 and up. And unlike the older GL driver, this one supports only slang shaders. This means that this OpenGL driver can now finally use the same shaders as Vulkan, Direct3D 10/11/12, and Metal. This marks an important milestone for us since we are well on our way to having a true universal shader spec now that can cross around graphics API barriers.

To learn more about this, read this article here.

Legacy OpenGL 1.1 driver for GPUs with no vendor-supplied drivers!

Up until now, RetroArch required at least OpenGL 2.x support on the desktop. If your GPU did not have a driver supporting at least OpenGL 2.x, RetroArch would simply not run with the OpenGL driver.

There are plenty of integrated Intel video cards that have no real OpenGL support on Windows 10, so they have to rely on a fallback driver provided by Microsoft called ‘GDI Generic’. This limits these cards to OpenGL 1.1.

Now, those inconvenienced users can still use the OpenGL 1.1 fallback driver. Do note that it will be impossible for shaders to ever work with this video driver – OpenGL 1.1 dates back to 1997. It would take until 2003/2004 before pixel and vertex shaders would become a standard feature of any video card worth its salt.

To learn more about this, read this article here.

RGUI – Particle effect animation system and numerous improvements

RGUI is a low-fi CRT-friendly raster-based menu UI that in the past has been kept purposefully minimalist.

jdgleaver has really taken the bull by the horns and significantly improved upon RGUI, to the point where it now has:

  1. Thumbnail support (with scaling support)
  2. Theme support
  3. Fancy particle animation effects
  4. Drop shadow icons for text
  5. Extended ASCII character support (for accented characters)
  6. Much-needed performance improvements

To learn more about this, read these articles here and here.

Menu framerate is now framerate independent

Previously, the menu would be capped at 60fps. Users acclimatized to higher refresh rates would find the 60fps update to be lacking when they are inside one of the fancy raster menus inside RetroArch (XMB/MaterialUI/Ozone).

The menu framerate in RetroArch is now framerate independent. So, for instance, if you’re using a 120Hz resolution, XMB will animate at 120fps, and you will see smooth animation with menu shader effects like the ribbon effect, snow, or bokeh.

When you’re running a game that is capped at 60fps, it will cap the menu along with it. But once the game with the lower refresh rate cap is loaded out of memory again, the menu should return again to that native framerate.

Menu Font text issues fixed on Android and macOS

Severe font text issues have been fixed on both Android and macOS. Languages like Japanese should now display properly on Android without any of the graphical bugs that appeared on earlier versions.

We are also now using STB_font unicode as our font driver for macOS and iOS, so for the first time languages like Japanese and other non-Western languages should finally be rendered properly.

Press Quit Twice To Exit

RetroArch traditionally exits the program immediately when you press the ‘Escape’ key on your keyboard. This has been one of the most commonly heard complaints usability-wise, so while this is an acquired taste, it’s understandable that some wouldn’t want the program to function like this.

So now there is a new option for those who dislike it – ‘Press Quit Twice To Quit’. Go to Settings – Input, and enable it. You will notice that when you hit the Escape key now to exit, it will remind you through a popup message first that you need to hit the key another time for it to truly exit.

Android phones: Vibrate on touch

You can enable this by going to Settings -> Input, and turning on ‘Vibrate on key touch’.

Your Android phone will vibrate every time you touch an UI element inside the menu or overlay. This could be useful in order to get a sense of tactile feedback from your button interactions while playing a game.

Automatically set the user language based on your system language

This is a new feature at first-time startup. Right now, it should work on Android, Linux and Windows.

When starting up RetroArch for the first time, it will check what your system language is set to, and then make RetroArch use that same language. This way, you don’t have to manually change your language after starting up RetroArch for the first time.

If you find that for whatever reason you want to use either another language or revert to English, you can go to Settings -> User and set Language back to English.

Changes for macOS

The macOS version ‘Apple macOS High Sierra (and later) with Metal2’ now requires Metal, the new graphics API. If your system does not have Metal support, it will not run. There is no backwards compatibility support for OpenGL, as Apple is fast-tracking the deprecation of this API and it might not be there for much longer. This version requires macOS High Sierra and/or later (10.13).

Please be aware that cores which rely on Libretro GL will not work with this version of RetroArch.

Conversely, there is also a separate build where OpenGL support is still a thing, but there is no Metal driver. This version requires macOS/OSX Tiger or higher (10.7).

And so much more…

We could write an entire book about all the new features we added to RetroArch 1.7.7. The list is so exhaustive, in fact, that we had to split this release blog post up into several mini articles in order to properly do justice to all of the major features and platform releases that have happened as a result of this release. We might go into some more of the standout features later on in a future blog post, but for now, below is the massive CHANGELOG of this release.

General changelog

– 3DS: Add unique IDs to prevent cores overwriting each other.
– 3DS: Fix screen tearing when running 50Hz content.
– ANDROID: We now target API level 26 (minimum is still API level 9).
– ANDROID: Add option to vibrate on touch (works in menu or overlay).
– ANDROID: Add device vibration option for cores that support rumble.
– ANDROID: Add gamepad vibration support for cores that support rumble.
– ANDROID: Allow stylus/pen to move mouse without pressing down.
– AUDIO: Avoid deadlocks in certain audio drivers when toggling menu sounds on.
– BLISS-BOX: Support PSX Jogcon (requires firmware 3.0).
– CHEEVOS: Fix crash when reading memory that is out of range.
– CHEEVOS: New Cheevos implementation enabled by default.
– CHEEVOS: Pop-up badges when an achievement is triggered.
– CRT: Dynamic super resolution support.
– DISCORD: Fix potential crash when username is empty and discord is disabled.
– DISCORD: Ask to join support for Linux.
– INPUT/ANDROID: Add “Input Block Timeout” option.
– COMMON: For platforms without HAVE_THREADS, don’t automatically resume content when saving/loading states
– COMMON: Make playlist sorting optional and consistent.
– COMMON: Fix sorting of playlists with blank labels.
– COMMON: Fix content scanner creating false positive playlist entries that also have wrong label and crc32.
– COMMON: Add some MMX-optimized pixel conversion routines.
– COMMON: Fix typo preventing some SSE2-optimized pixel conversions from being used.
– COMMON: Add option to track how long content has been running over time.
– COMMON: Fix buffer overflows in system information.
– COMMON: Add option to change screen orientation via the windowing system (Android, Windows, X11).
– COMMON: Show CPU model name in log.
– COMMON: Add “Help -> Send Debug Info” option (and F10 hotkey) to send diagnostic info to the RetroArch team for help with problems.
– COMMON: Show GPU device name/version in log.
– COMMON: Add menu option to write log info to a file.
– COMMON: Add subsystem support for playlists. Subsystem info is automatically saved to the history playlist for easy relaunching.
– GL: Add new “gl1” OpenGL 1.1 compliant video driver for legacy GPUs and software renderers
– GL: Add a new “glcore” driver with slang support (requires GL 3.2+ or GLES3).
– GL: Draw OSD on top of overlay.
– GONG: Add savestate support.
– GONG: Add video refresh rate core options.
– GONG: Two player support via core option.
– GUI: Fix text alignment when using stb_unicode.
– GUI: Fix text display issues when using Japanese (and other unicode-dependent language) text with stb_unicode.
– GUI: Set language on first startup to the user’s preferred OS language (Windows, *nix and Android).
– INPUT: Add (scaled radial) analog deadzone and sensitivity options.
– LIBRETRO: Add Turkish language support.
– LIBRETRO: Allow non-accelerated video to rotate the display.
– LOCALIZATION: Update Chinese (Simplified) translation.
– LOCALIZATION: Update Chinese (Traditional) translation.
– LOCALIZATION: Update Dutch translation.
– LOCALIZATION: Update French translation.
– LOCALIZATION: Update German translation.
– LOCALIZATION: Update Japanese translation.
– LOCALIZATION: Update Polish translation.
– LOCALIZATION: Update Russian translation.
– LOCALIZATION: Update Spanish translation.
– LOCALIZATION: Add new Turkish translation.
– MIDI: Fix startup crash in midi driver.
– MENU: Bugfix – you can no longer get stuck in Online Updater -> Update Core screen when toggling between ingame and menu.
– MENU: Selectively hide ‘Take Screenshot’ for video drivers that don’t support taking screenshots.
– MENU: Framerate independent menu rendering. MaterialUI/Ozone/XMB/RGUI can now run at higher framerates.
– MENU: Thumbnails work in history list.
– MENU: Menu widgets.
– MENU: Add memory statistics support to more context drivers.
– MENU: Enable ozone driver for UWP builds.
– MENU: Add optional “looping” menu text ticker with configurable speed.
– MENU: Fix core video rendering when using ozone with GL cores that implement the scissor test.
– MENU: Add optional playlist sublabels (associated core + play time, where available).
– MENU: Dropdown list settings now apply immediately.
– MENU: Add setting to require pressing the “Exit RetroArch” hotkey twice to confirm.
– MENU: Now able to run at higher refresh rates than 60Hz.
– MENU: Enable “Add to Favorites” without loading a core.
– MENU: Allow core name to be hidden on history/favorites playlists.
– MENU: Populate crc32 and db_name fields when adding history/favourites playlist entries.
– MENU: Fix TTF files not showing in OSD/menu font selection screen.
– MENU: Fix audio/video filters not showing in file browser.
– MENU/MaterialUI: Add subsystem support.
– MENU/MaterialUI: Add currently selected entry in dropdown menus.
– MENU/OZONE: Add mouse support on entries (no sidebar yet).
– MENU/OZONE: Allow collapsing the sidebar.
– MENU/OZONE: Add thumbnail support.
– MENU/OZONE: Battery notifications.
– MENU/OZONE: Add wifi icon for network entries.
– MENU/QT/WIMP: Add git version and build date to Help->About window.
– MENU/QT/WIMP: Fix content loading via the file browser.
– MENU/QT/WIMP: Add new settings window to control all RetroArch settings.
– MENU/RGUI: Improve playlist titles.
– MENU/RGUI: Add option to hide associated cores in playlists.
– MENU/RGUI: Add internal upscaling option.
– MENU/RGUI: Add subsystem support.
– MENU/RGUI: Add menu sublabel support.
– MENU/RGUI: Re-enable “Load Core” option when content is loaded.
– MENU/RGUI: Add optional “Collections” entry to main menu.
– MENU/RGUI: Add “Lock Menu Aspect Ratio” option.
– MENU/RGUI: Add “full width” layout option.
– MENU/RGUI: Ensure menu color theme is applied immediately.
– MENU/RGUI: Fix “Lock Menu Aspect Ratio” option when using custom viewports.
– MENU/RGUI: Add widescreen support.
– MENU/RGUI: Allow text to be centred when selecting widescreen layouts.
– MENU/RGUI: Add inline playlist thumbnail support.
– MENU/RGUI: Add optional shadow effects.
– MENU/RGUI: Performance optimizations.
– MENU/RGUI: Add optional extended ASCII support.
– MENU/RGUI: Add optional delay when loading thumbnails.
– MENU/RGUI: Add on-screen keyboard.
– MENU/RGUI: Battery notifications.
– MENU/XMB: Prevent crashes when resizing to a tiny window.
– MENU/XMB: XMB honors the ‘show menu sublabels’ setting now – was previously RGUI only
– NETPLAY: Fix stall-out causing total disconnection with >2 players.
– NETPLAY: Different (more intuitive?) default netplay share policy.
– NETPLAY: Add hotkey option to toggle hosting on/off.
– NETWORKING: Encode URLs to allow for spaces in directory names.
– OSX: Prevent crash on exit.
– OSX: Metal is now the default video driver for the RetroArch Metal build.
– OSX: Enable CoreAudio v3 driver for Metal.
– OSX/MACOS/IOS: Now uses the STB Unicode font driver.
– PS2: CDFS support.
– PS2: Implemented analog support for ps2 controllers.
– PS2: Fix audio freeze after restarting core.
– PS2: Fix issues with load state and the font driver.
– PS2: File I/O now works for USB and network host.
– PS2: Support cores with extra padding in their frame buffers.
– SCANNER: New option ‘Scan without core match’. When this is enabled,
supported extensions by all installed cores are not checked, and instead
it will add all content it finds to a playlist. This way, you can install the core you need later on after scanning. Not enabled by default.
– SHADERS: Don’t alphabetize shader presets.
– SWITCH: Add rumble support.
– SWITCH: Add USB keyboard support.
– VITA: Add bluetooth mouse and keyboard support.
– VULKAN: Fix color issues with RGBA8888 swapchains in readback (screenshots).
– WII: Don’t init overlay when RAM is beyond 72MB.
– WII: Skip CRC calculation on content load, can improve load times of larger games by several seconds.
– WINDOWS: Fall back to gl1 driver if accelerated GPU driver is unavailable.
– WINDOWS: Allow winraw and xinput to work without dinput (needed for WinRT).
– WINDOWS: Add MSVC2017 ARM desktop support.
– UWP: Fix rewind by opting for slower codepath.
– UWP: Fix relative path name issues when loading shaders.
– UWP: Optimizations for VFS system.