Saturday, July 26, 2014

Android port.

I planned from the start that this project will be multi-platform. At least three platforms are planned to support: Windows, Linux and Android. I already posted screen shots and videos from Windows and Linux. Now I want to show you my current progress on Android.

When I set myself the goal to port my work on Android I knew nothing about OpenGL ES 2.0, which is currently used on most of mobile devices. Somebody told me that porting should be easy. Liar. My current work is based on sources of Orkin’s glN64 plugin, written 10 years ago, before OpenGL 2.0 became standard. Now OpenGL standard has version 4+, and it is changed drastically. Nevertheless, it is backward compatible with old functions and allows programmers to mix new features with old good ones. But only on desktop. Mobile devices don’t want to support old shit, so everything “superfluous” was thrown away. With OGL ES shaders are must, data arrays are must, “fixed” functionality is reduced to minimum. When I estimated amount of work needed for port, I felt sad. Most of inherited OpenGL code had to be completely rewritten.

I downloaded sources of Mupen64Plus Android Edition (AE), which is unofficial port of Mupen64Plus to Android. I hoped to find some clues in it how to make the port. I was lucky: Mupen64Plus AE already has working Android port of glN64! I took it as reference and started to rewrite my version. Some part of code was absolutely useless for me, but I must confess that large part of code was adopted with minimal changes. Nevertheless, when I finished the rewriting, I spend weeks before I got first picture. On desktop version! Then I spent few months fighting with regressions. On desktop version! Of course, I did not work on it days and nights – I don’t have so much time. But a lot of my spare time was spent just to get the result I had with my old OpenGL code. When my plugin started to work with Mupen64Plus for Linux I finally approached to Android itself. Again, I spent many time just to make the code compile on Android. And I spent much much more time before I got something rendered on screen of my device. May be next time I’ll describe the technical problems I solved. I’m just in the beginning of that long road. Today I’ll just show you a few screenshots:

GUI. Video  plugin selection.

My plugin settings. Not everything is working yet.

The Legend of Zelda - Majora's Mask.
Motin blur.

Mario Golf. Frame buffer emulation.

Mario Tennis. Far from perfect yet due to ES restrictions on Frame Buffer Objects.


  1. Have you looked into GL ES 3.1? Maybe that has less restrictions, although you are forced to buy new Android hardware.

  2. No, I haven't check GL ES 3.1 yet. Most of current devices, including the all devices I have, use 2.0. If the Crowd-funding Campaign (http://gliden64.blogspot.ru/2014/08/gliden64-fundraising-campaign-launched.html) will be successful and I will have enough funds for serious Android development, I'll definitely look into it. I'd like to buy Samsung Galaxy Note 3 or Nexus tablet :)

  3. That's interresting.

    As the maintenair of the OpenPandora port of Muppen64, I'll follow this with interest (and I know many pandora member have backed up your project).