Making Windows a first-class libretro citizen

This will be a continously updated blog post detailing my progress on getting our Windows/Winbloze game up.

I’ve dusted off an old Core 2 Duo laptop, put Windows 7 and 8 on it, and intend on getting the Windows ports up to snuff as well as starting work on the Windows Phone/Surface ports (I can only do the Surface ports for now since I still don’t have Windows Phones to develop on, though).

A few things I will be looking at:

  • Windows Surface/Phone RetroArch port – ie. making RetroArch suitable as a Windows 8 app
  • Getting RetroArch on the Windows App Store
  • Native MSVC 2010 solutions for most libretro ports out there (should also work on MSVC 2012 and later)
  • A frontend GUI/menubar of some kind for the Windows versions.
  • Two RetroArch Win versions – one for Windows 8 Modern UI, the other Desktop one with a more conventional UI

Right now, most libretro ports depend on a Mingw build environment. I’ll try augmenting this with native MSVC solutions so that we are no longer dependent strictly on Mingw for development. Also, like the last bullet point already suggests, an effort will be made to start implementing a rational, conventional, thin ‘GUI/menubar’ around the Windows ports. While RetroArch/RGUI is still meant  to be controlled by a gamepad and this is fine, I don’t think it’s too much to ask that we are able to at least select ROMs with a native file dialog screen – and other niceties like that which a menubar would provide. The RetroArch OSX port also benefited from similar additions and I don’t think the ‘raw’ way the current Windows version is put out really does it justice.

For people who won’t like this menubar/GUI, it will be possible to disable it so that RetroArch Win32 will look and act the same as it does now.

Also, of course with the port to Surface/Windows Phone will come an additional Windows 8-centric Modern UI GUI as well. The way I see it, there will be several versions of RetroArch in the future – one that will be available on the Windows Store with a modern UI look (where we basically release several statically linked cores + RetroArch on the App Store), and there will be a RetroArch with a desktop UI look (probably looking mostly similar to SNES9x) which you will be able to download from our Libretro website.

The RetroArch for PC with the modern UI look would have severe disadvantages (dynarec code can’t work for Windows 8 Store apps, Win8 apps don’t allow dynamic libraries so we will have to release standalone emus, and lots of other shenanigans) but at least we will have a presence for enduser people that only look at the Windows Store for possible apps to download – that, and it will converge neatly with the Surface/Windows Phone port.

I hate Windows 8.x as much as the next guy and am rooting for it to fail. The only reason I am really doing this is because of the RetroArch project and my desire for it to be omnipresent. If it weren’t for this, I wouldn’t be bothering to do this right now.

I’ll update this post when more progress is made (or make a new post in case this one is taking too long).

RetroArch/Libretro Technical brochure

Here is a PDF slideshow giving a nice overview of Libretro, RetroArch and the road ahead for the project –

http://www.libretro.com/wp-content/uploads/2014/03/RetroArch-Libretro-Technical-Brochure.pdf

Tomorrow updated versions of RetroArch for iOS, Android and Wii will follow- some hotfixes here and there (FBA core missing in Android, graphics glitches with Glide64 in Mupen64 iOS, resolution setting not saving in RetroArch GX, etc).

RetroArch 1.0.0.2 Changelog

In this post I’ll try to summarize all the changes made to RetroArch since the last version (1.0.0.1). It’s by no means complete but it gives a general overview of what has changed.

Note that the iOS version is still upcoming.

Cores

Mupen64 – W coordinate for vertices now properly set according to per-game depth bias. Should fix most of the texture wobbling issues in games.

Mupen64 – Fixed ‘No Controller connected’ issue in Banjo-Tooie.

Mupen64 – Uses refactored audio RSP plugin, includes numerous fixes such as improved MusyX support, etc.

Mupen64 – Glide64 refactoring  – Optimized dither noise code – is now done on the GPU entirely.

Mupen64 – Glide64 refactoring – codebase has been cleaned up significantly, code duplication cut down on.

Mupen64 – (Non-mobile versions) – Three-point filtering option instead of just bilinear filtering. The N64 used an inferior form of bilinear filtering called 3-sample (or 3-point) filtering. Textures were made with this in mind so many look a lot better with point filtering vs. bilinear.

Screenshot comparison here: http://imgur.com/a/M9nRP

Genesis Plus GX – Aspect ratio changes are now applied correctly.

Genesis Plus GX – Other changes.

Mednafen VB – Added Core Options for Virtual Boy – Anaglyph/Palette.

Mednafen (All) – Should correctly save SRAM to save directory now.

SNES9x – Memory leak fixes and some other improvements.

Nestopia – Core updates.

3DEngine – New core. A combination of all other 3D tech demos so far along with advanced libretro features like camera support, GPS/location services, etc. Can also be used to display still pictures (JPEG/PNG). JPEG support is buggy right now.

VBA-M – Adds Code Breaker/Game Shark support (by using cheat files).

FBA core – No more hardcoded 1024×1024 frame buffer – is now set dynamically. Should in most cases free up around 3MB of system RAM.

RetroArch GX – Gamecube/Wii

– More screen resolutions.

– Overlay support.

– Faster blitting – inlined lots of GX functions.

RetroArch OSX 

– Joypads should work now.

– Analog mapping to D-pad works now for all cores.

– All the changes made to RGUI since the last release (Core Information, reorganized Settings, possible to map frontend actions to gamepad buttons/analog axes, etc)

RetroArch Android

– Should fix App Not Responding issue that happened with overlays and threaded video.

– All the changes made to RGUI since the last release (Core Information, reorganized Settings, possible to map frontend actions to gamepad buttons/analog axes, etc)

RetroArch going all PSP – PSP Version for Next Next release?

RetroArch PSP

This one generated more interest than I had expected. The PSP code in the RetroArch codebase has been dormant for quite some time now, but I never felt like hooking it up until some weeks ago.

Aliaspider did most of the final touches on video/audio after the initial port was up and running. Implemented right now is video, audio, input, RGUI, and most of the features you’d expect from RetroArch. I’ve already been asked about whether or not RetroArch PSP will include shaders or filters, and the answer is ‘no’. PSP’s GPU is fixed function and it has no shader capabilities whatsoever. CPU filters on the other hand would be far too CPU intensive for what is already a pretty weak CPU.

So how is performance with cores? Right now, Gambatte, NXEngine, Doom and some others are running at fullspeed. Aliaspider wrote a custom resampler for Gambatte since even Themaister’s blipper turned out to be too slow for PSP. Nestopia turned out to be surprisingly slow on PSP (about half the framerate of the Raspberry Pi – around 30fps or so) and FBA is also ‘not there’ yet for performance (currently maxing out at 50fps or so for CPS2 games). The latest version of Picodrive seems to be around 50 to 55fps with Sonic 1 – so definitely still a bit slower than the last Picodrive PSP version that was released by notaz back in 2007. It deserves mentioning that most of these cores right now are pretty unoptimized – it is all just generic C code.

Anyway, given that we’re dealing with a very weak CPU here, the need for custom cores arises. My plan is to make libretro versions of NJEMU, gPSP and others so that we can have full-speed CPS1/CPS2/GBA emulation at least on PSP. Aliaspider and me are also looking at ways to improve the current core’s performance. Some of these ideas involve implementing the RETRO_RENDER_HW feature so that we can draw directly to the PSP’s framebuffer and use the raw GPU command buffer through the use of some inlined macros.

So when can you expect a first public release of RetroArch PSP? Not now at least – maybe somewhere in time for 1.0.0.3.  We still believe that with a bit more work, we can release something special on PSP – which is why there will be no release right now. There will be little to no usage of the MediaEngine in cores, so if all goes well you can expect to run RetroArch PSP just fine on your Vita as well.

Remote Joy

Remember this? It was a PRX plugin for homebrew PSPs that allowed you to stream the PSP’s video/audio feed over WiFi to your computer. Well, about a year ago or so we made a very quick-and-dirty initial port to libretro.  The main advantages of this libretro core is that you will be able to use all the advanced functionality of RetroArch, that it is cross-platform and that it embeds libusb into the main core library (the original RemoteJoy was Win32-only).

Right now this core is not yet releasable and there is still some way to go before it can compete with the standalone RemoteJoy Win32 client. Maybe it will be more finished in time for 1.0.0.3.

PPSSPP Libretro core

In case none of the aforementioned two things excited you, maybe this will. We will be looking at making a libretro port of PPSSPP soon. This will be the second non-tech demo libretro GL core after Mupen64. At first it will target Android, iOS, and PC. Xbox 360 support may be considered in the future if I can get my XDK box back – since developing and debugging on a Slim alone is quite painful.

PPSSPP’s GUI will probably be left in (similar to the MAME libretro cores), though it will also be possible to run games headless.

RetroArch v1.0.0.1 release information

This will be our CHANGELOGs from now on.

Core changes

Mupen64

  • Fix audio float overflow bugs – fixes Star Wars: Shadows of the Empire, Star Wars: Episode 1 Racer, Tsumi to Batsu/Sin and Punishment (on PC)
  • (iOS) Added hack to assem_arm.c’s “verify_dirty” return function to make GoldenEye work
  • Alternate controls work differently now – you start with Original controls – press ‘Select’ to toggle ‘Alternate Controls’
  • (Core) Added MusyX ucode for RSP HLE – fixes sound in these games – affects games like Hydro Thunder, Gauntlet Legends, Biohazard 2/Resident Evil 2, etc. Graphics in Resident Evil 2 still messed up though with RSP HLE – change to CXD4 RSP for now to render the graphics accurately.
  • (Core) Other incidental changes.
  • (Core) Some preliminary work on getting graphics to show up in Conker’s Bad Fur Day for glN64

FCEUmm

  • Memory leaks and other bugfixes courtesy of Alcaro

Platform changes

Android

  • Custom input binds should work now again
  • Re-added old overlays – some people complained that the new normalized overlays had an impact on performance
  • Uploaded x86 version too to the Play Store

OSX

  • Now should find cores directory out of the box
  • Some under-the-hood changes with regards to keyboard input that end-users won’t notice much of for now

iOS

  • Reimplemented BTStack controls – it is still very bug-prone though.
  • New icon
  • Re-added old overlays

Gamecube/Wii

  • Input changes courtesy of Jacobeian – MIGHT finally fix long-standing input bugs
  • FBA Full should work again
  • New Input Settings option – Analog to D-pad mapping