About a year ago, I wrote about box86, an i386 emulator for ARM developed by @ptitSeb, who is also responsible for the awesome gl4es wrapper for OpenGL → OpenGL ES. While the original look at it a year ago was already impressive, I want to look at it again, and point out what has changed since then and what you can do with it now.
I’m currently still testing this on my old Debian Jessie based ODROID GameStation Turbo image, with box86-odroid, libgl-odroid and monolibs-odroid installed. Each of these are used in a different way to improve the overall experience and provide drivers needed to run the games in this game. All of the above will be installed together if you install box86-odroid.
Some people may be familiar with a software called ExaGear. It was a commercial x86 (i386) emulator for ARMand ARM64 devices, that allowed you to run i386 software. While the overall performance was quite good, it lacked 3D support, if your platform did not provide x86 GPU drivers, which is normally not the case, except for the RPi which can use MESA drivers, and for this is able to run OpenGL on i386 in a limited way. Also, most x86 games require OpenGL, which most ARM SoCs do not support. Therefore, the overall support for x86 games was limited to 2D games and applications which did not require any hardware acceleration, or command line tools.
With box86, @ptitSeb took a different approach. He did not only write a CPU emulation for x86, but also implemented the possibility of redirecting calls from the x86 environment to the ARM host environment, using native ARM libraries rather than emulated x86 libraries. He first implemented this for OpenGL support, which in combination with gl4es allowed us to run applications and games that require hardware acceleration. It also allows to forward many system calls from applications directly to the host system rather than trying to emulate these calls under an emulated x86 environment, which is much faster than pure emulation.
@ptitSeb is constantly working on box86 to improve compatibility and performance, but he also is working hard on gl4es (libgl-odroid) to support this project. The combination of these two has greatly improved over the last months allowing us to run more applications and games that are only available on x86 to be run on ARMplatforms. One of the biggest changes is the work @ptitSeb is doing on an x86 → ARM dynamic recompiler. This means that some of the x86 calls are converted directly into ARMcode “on the fly” without emulation, at the time they are requested. The same technique is done in many other emulators to speed up overall performance.
For example, in the past when you run PSX emulator on an ARM64 board, that was compiled for ARM64 it was unable to use dynamic recompiler (for example the C2 or N2), and even if the board was more powerful than other boards, the games were very slow and far from being full speed, while much slower ARMboards (for example the ODROID C1 or U3) were perfectly capable of running these games at full speed with an ARMdynamic recompiler. Some applications run 2-10 times faster with dynamic recompiler, than with pure emulation. The same applies for box86, games that were previously way too slow to play are now running much faster, opening up so many more games that are able to run on ODROIDs. The dynamic recompiler increased loading times a lot, games load so much faster than they did before, where on some games you had to wait 5-15mins to load the game data, they are now loaded in mere seconds.
Recap of some old games
While the game already ran impressively well the last time I checked it, the latest improvement makes the game a very smooth experience. Overall performance increased quite a bit, and you can now set the graphics quality to maximum. The game runs nearly like a native game with only tiny stutter here and there, which you would expect on an older PC as well. I can highly recommend this game on the ODROID-XU4.
God Will Be Watching
There is not much to say: the game was running well, although not at full speed, so what changed? Now it does run at full speed perfectly well.
When I first looked at the game, the game took a very long time to load (somewhere between 5-10 minutes). Now it takes about 30 seconds to start, that is over 10 times faster than it was before. In game, the game was also suffering from some minor speed problems. They were nothing that rendered the game unplayable but it wasn’t full speed, which was a bit of a shame for a game that relies on speed similar to Sonic. This is now fixed as well and the game runs perfectly at full speed.
Faster Than Light
This is another well known commercial game that was already running under box86, but with a very long loading time of over 5 minutes. This is also reduced to less than a minute, and the sound problem is also gone. The game is now fast enough to play music and sound effects and doesn’t cause stutter.
World of Goo
The game now runs at full speed, but might need LIBGL_FB=3 as a flag to run, due to some issues with GLX initialization.
So overall the games from last time work better, that’s good, but what is new since then? What can we run that we couldn’t run before?
Day of the Tentacle Remastered
Let’s start with something big and shiny.
I love the original game Day of the Tentacle, and still play it today on ScummVM on my ODROIDs. Now, with box86, I can also play the remastered version with improved graphics and interface. It looks amazing and plays very well. There is one minor downside at the moment. The loading time between screens can be 10 seconds, which is quite long if you consider this game is about walking and exploring and trying out things from one place to another place. Still, the game works fine, and if you don’t mind the loading, there’s no difference between this and a regular PC.
This rather simple looking game is actually quite heavy on the GPU, probably due to their use of CRT and other shaders.
The game is a puzzle platformer where you need to time your jumps right, infest humans to reach your target, or kill other enemies. It’s a fun little game, which a little while ago only ran slow, but now is quite playable if not yet full speed.
Pier Solar and the Great Architects
This RPG game is a tribute to the old Mega Drive / Genesis styled RPG games and has a 16bit mode that pretty much looks like it could be from a Mega Drive / Genesis. It also has a HD and HD+ mode which look a lot better and polished.
For my taste, the game takes too long to get started, but it’s ok, and I wonder what it’s like in later sections of the game. It’s fully playable on the ODROID- XU4 though, so give it a try if you want.
Many have probably heard of the game, not so many might have played it. In some countries it’s still forbidden due to its controversial nature. This action shooter allows you to follow a peaceful path to accomplish your goals, but it’s also the more boring path. The game runs overall ok, but not perfect. I had issues with sound and it’s hard to change resolution. The game is slightly too slow, not unplayable, but definitely not full speed.
The Bard’s Tales
The Bard’s Tales is an impressive series of RPG games that look very good and run fine on the ODROID-XU4 and other ODROIDs. The graphics are really something, and although the game was already working when I last tried it a couple of months back, it now has much better performance, making this game feel like a native game.
I can only highly recommend the game, it’s very funny and has the famous “Beer Song” (https://www.youtube.com/watch?v=eTUJNeuFIFA), and a game that has beer in it can’t be bad.
This game strangely only runs with OpenGL 1.x support, but it doesn’t show. The game looks gorgeous and plays really nicely. You need to rescue all the eggs in the game by collecting them. This puzzle game is quite challenging and makes you think before you make your move. It also looks very cute and has a nice little tune that fits the game perfectly. Overall, this game runs great even if it may not be the same speed as on a regular PC the game is quite playable and doesn’t feel laggy. The game controller support for the game is superb and even supports rumble if you have a controller that supports it. This is a highly addicting game and I recommend it.
I played my first “Worms” game back on the Amiga 500. It was actually just called “Worms”, and it was a huge success and so much fun to play. The series continues even today, and has a couple of remakes of older versions of the game and 3D versions.
The game runs surprisingly fast. The only time it stutters is when the PC is calculating its move, but the actual move and attacks are perfectly fine.
This impressive dungeon crawler also runs full speed on the ODROID-XU4. The only problem with this one is that it requires a relatively huge amount of RAM (for ARM boards, that is). You need at least 1500MB free memory to run it, so depending on the operating system, you may not be able to run it on an XU4, and the game is better suited for an N1 with ARMHF drivers and 4GB of memory. Overall this game is impressive and I highly recommend it.
There are tons of more games I can’t go into, as there are so many of them that work now, but I want to share some of them with you to give you an idea what is working.
There are so many different types of games working now. A couple of months back, some of them were so slow that it was more like playing a slideshow, but these games now run full speed (for example, Hyper Light Drifter). It’s really impressive how far the emulator has evolved in just one year.
There are, however, a few games I want to single out as they are my personal favorites, and some of which you may know as well. Two are very close and even share a similar name. I already played them a while back on ExaGear where they run in software 3D rendering. It was impressive that this game actually worked, but now I can run these games with box86 and 3D hardware acceleration. These games bring back so many memories for me, as I played them as a child and at it’s time they were in everyone’s gaming collection if they were a gamer, especially on the PC. I’m talking, of course, about Unreal and Unreal Tournament (the original 1999 edition).
Both Unreal and Unreal Tournament were ported to Linux many years back. It’s somewhat difficult to get these running nowadays, as they use very old drivers, especially when it comes to sound. But otherwise, these games are still amazing, and run as well as I remember playing them in 1999 on my AMD K6-2 450 MHz processor with Riva TNT graphics card. The game ran fine back then, but now on the ODROID, I can even play them in 720p or 1080p which I could not back in the old days. This is really amazing, and to be honest, I’m looking forward to taking some time off and replaying Unreal to see if it’s still how I remember it.
Unreal is working the best at the moment. I start the game with the following options:
$ LIBGL_SRGB=1 LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libaoss.so.0 box86 UnrealLinux.binLIBGL_SRGB=1 uses a special mode in gl4es that increases overall brightness, as the game can be extremely dark otherwise. LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libaoss.so.0 is required since the game uses /dev/dsp for sound output which is no longer used and with this we can redirect the sound to an alsa emulation.
The game takes a little while to start, as it loads quite a lot of data right at the start and then directly goes into the flyby. Performance wise, this is awesome, I mean it really feels like this game is running natively on the ODROID. I haven’t experienced any lag while playing the game. In fact, the menu seems to be slower than the game itself, and I run it on high details in 32bit color depth at 720p. It just feels amazing playing this game.
Unreal Tournament was the perfection of multiplayer first person combat. I played this countless times with friends at LAN parties while on vacation. The Assault game mode was always my favorite, and until today, there are very few games that have even come close to implementing such an exciting game mode. I totally miss playing this with my friends. I always hated “capture the flag”, which every other game was based around. Unreal Tournament did everything right and I dare to say I liked it better than Quake 3. However, I couldn’t get sound to work in this version. It relies on a very old driver called OSS, and while I’m able to load kernel modules for this, I’m unable to use it for sound. Other methods like aoss and padsp don’t work either, so I’m stuck without sound for this one.
In just one year Box86 really took off in terms of compatibility. Last time I wrote about it, it was a nice project with lots of promises, but rather little support. Now it’s gone through the roof, and the support for the games is amazing!
I’m looking forward to what will work in the months to come. I’m hoping for Unity and WINE support, as this opens up even more games. I especially look forward to WINE, which would be really impressive because WINE, in combination with OpenGL, could mean we may be able to play Windows games with hardware acceleration on ODROIDs as well. The project promises to be very exciting.
There are others that also follow the development and test games on Raspberry Pi and other platforms. You can check out the Youtube Channel “Pi Lab” (https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g/videos), where you can find even more games running under box86. Thanks @ptitSeb for all of his hard work on this project!