Sunday 29 May 2016

PCEngine emulation: Hu-Go!

This one has been suggested by a reader of this blog (actually, the only one I got feedback from, and very interesting discussions :-)). It's been a little tricky to get to work, and at this time I am still struggling with sound, but I believe this article can be of interest to anyone trying to compile it on ARM.

Hu-Go is quite an old emulator from Zeograd (https://www.zeograd.com/hugo_download.php), which has been forked into Huexpress. But as Huexpress seems to require OpenGL, I preferred to put my hopes into Hu-Go!

Compilation of Hu-Go has been a pain: actual C issues, no out-of-the-box way to add include paths, and wrong detection of the platform leading to code not being compiled and resulting in link errors... I suggest you get the modified version I have put on my github account: https://github.com/alban-rochel/pixbox-hugo. This one:

  • Fixes compilation issues, if you follow the instructions carefully
  • Is already set up for a 1280x720 display. Otherwise, edit osd_sdl_gfx.c, lines 250 and 251, and put in whatever you want!
To be able to compile Hu-Go! on a Pixbox-like platform, where the custom SDL library is not in a standard place, you have to trick it to add the SDL include path to its search paths (by adding it to CFLAGS). Which may not be immediate for non gcc-savvy geeks. And more, you have to get into the guts of the configure script to understand why it cannot tell you are compiling on a Linux platform. Actually, it looks for an x86 Linux platform, but has nothing x86 specific! So we'll tell it to compile on an x86 platform!

So I ended up with the following compilation line:
 CFLAGS="$CFLAGS -I/media/BBB/include/SDL" ./configure --prefix=/media/BBB --disable-gui --disable-netplay --with-sdl --with-sdl-mixer --with-sdl-prefix=/media/BBB/lib/ --with-sdl-exec-prefix=/media/BBB --build=i386-linux --target=i386-linux  
 make install  

And that's it!

Actually, this is still Work In Progress. I still have to map the controls to the Pixbox keys (nothing frightening), and, most of all, understand why the sound is so bad! I'll update this page when I have made progress on these subjects.

To start a game:
 /media/BBB/bin/hugo /media/BBB/roms/pce/Bonk\ III\ -\ Bonk\'s\ Big\ Adventure\ \(USA\).pce -s -w 2  
The -w argument is important as it triggers the "windowed" mode (even though this makes no sense in framebuffer display), which actually takes the resolution you have passed in osd_sdl_gfx.c!