Building RPCEmu on Mac OS X

ask about 32-bit emulators like ArcEm, Red Squirrel, Arculator or RPCEmu here
User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Building RPCEmu on Mac OS X

Postby pollito » Sat Mar 18, 2017 9:13 pm

Hi there,

Are there any up to date instructions for building the latest RPCEmu on Mac OS X?

I checked out the Mercurial source and ran a ./configure but it fails with the following:

Code: Select all

checking for Allegro - version >= 4.2.2... no
*** The allegro-config script installed by Allegro could not be found
*** If Allegro was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the ALLEGRO_CONFIG environment variable to the
*** full path to allegro-config.
configure: error: building RPCEmu requires Allegro to be installed


I have tried installing Allegro from both MacPorts and Homebrew to no avail. MacPorts's Allegro 4 (allegro) won't build on Mac OS X 10.11.6 stating:

Code: Select all

Error: allegro uses deprecated API which has been removed as of Mac OS X 10.7.
Error: Failed to fetch allegro: incompatible Mac OS X version


Allegro 5 (allegro5) builds fine but I still get the original error message. There is no allegro-config on my system and I'm not sure why the configure script thinks it isn't installed at all. Exactly the same thing happens if I use Homebrew's allegro package (which is also Allegro 5).

Thanks in advance,
pollito

User avatar
danielj
Posts: 4527
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester

Re: Building RPCEmu on Mac OS X

Postby danielj » Sun Mar 19, 2017 7:10 am

Basically, until it's moved away from allegro 4, you can't :(
4 & 5 aren't compatible and 4 won't compile on recent OS X.


d.

User avatar
hoglet
Posts: 5877
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Building RPCEmu on Mac OS X

Postby hoglet » Sun Mar 19, 2017 7:35 am

danielj wrote:Basically, until it's moved away from allegro 4, you can't :(
4 & 5 aren't compatible and 4 won't compile on recent OS X.

FYI, it's probably this issue:
https://www.allegro.cc/forums/thread/609104

Dave

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Sun Mar 19, 2017 11:52 am

"allegro-config" doesn't exist in Allegro 5. They now use pkg-config, like the rest of the world. You can compile and install that on OS X with no trouble at all.

It is possible to patch RPCEmu to work with Allegro 5 on OS X, but it's a lot of work. I have a modified version of 0.8.14 that's compiled against Allegro 5.2.1 that works reasonably well on recent versions of OS X, and a half-finished port of 0.8.15. The sound is a bit weird but everything else seems fine. I don't know how performance compares against an Allegro 4 version, as I have no way of comparing unless I want to build a Linux VM or faff around getting it to work in Windows.

As with many projects, it's one that I started and meant to finish, but other things intervened. I did a bit of work getting RPCEmu to work with OS X in the past, and meant to do more, but certain individuals rather put me off doing anything else.

I can finish off my 0.8.15 and make some unofficial patches and instructions available here if there is interest.

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Sun Mar 19, 2017 5:48 pm

I've had a quick look at my efforts for 0.8.15 and it appears I did finish getting it to compile after all:

Image

Code: Select all

Mac-Pro:rpcemu-0.8.15 $ otool -L rpcemu
rpcemu:
   liballegro.5.2.dylib (compatibility version 5.2.0, current version 5.2.1)
   liballegro_main.5.2.dylib (compatibility version 5.2.0, current version 5.2.1)
   liballegro_audio.5.2.dylib (compatibility version 5.2.0, current version 5.2.1)
   liballegro_dialog.5.2.dylib (compatibility version 5.2.0, current version 5.2.1)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)

User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: Building RPCEmu on Mac OS X

Postby pollito » Sun Mar 19, 2017 9:24 pm

=D> Ooooooh! Nice! :D :D :D

I just installed Lion in a VM, and finally managed to get Allegro 4 to build using the instructions for hacking Xcode to include the Snow Leopard stuff in this file. The trick would not work on El Capitan as it appears more stuff has been depreciated since. Anyway I managed to get the compiled code over from Lion to El Capitan and then installed it.

I was just congratulating myself on a Sunday well wasted when I thought I would check back here! :lol:

Yes, using a modern version of Allegro is a great idea. Although I'm not a developer, I have always wondered why RPCEmu and Arculator used such an old version. I assumed it was more complicated than just changing a few references so that must be the reason.

Is there any chance you could make your binary available? It would be muchly appreciated!

My problem is this: I dual boot Mac OS X and Windows 10 on my main machine and on both, when using RPCEmu with a version of RISC OS 4 or higher, I get a strange issue whereby the screen doesn't update unless I move the mouse pointer upwards. It then updates horizontally, one line at a time, as I move the mouse. I posted about this in this thread and was hoping to try the latest version of RPCEmu under OS X to see if it made any difference.

Many thanks :)
pollito

SarahWalker
Posts: 1003
Joined: Fri Jan 14, 2005 3:56 pm
Contact:

Re: Building RPCEmu on Mac OS X

Postby SarahWalker » Sun Mar 19, 2017 9:28 pm

pollito wrote:Yes, using a modern version of Allegro is a great idea. Although I'm not a developer, I have always wondered why RPCEmu and Arculator used such an old version. I assumed it was more complicated than just changing a few references so that must be the reason.

Allegro 5 wasn't available during the original development of either emulator. Potentially both emulators could have been ported to it once it became available, however this would have been quite a lot of work (it's basically a completely different library) and there was no suggestion that Allegro 4.x was about to disappear.

User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: Building RPCEmu on Mac OS X

Postby pollito » Mon Mar 20, 2017 8:43 pm

Hi Sarah,

Thank you for the explanation - I assumed that Allegro 5 wasn't just a 'drop in' replacement for Allegro 4 or it would have been 'dropped in' a long time ago. :)

You guys have done a fantastic job with the emulators and I don't want you to think I was denigrating you in any way. I wish I knew enough about programming to be able to modify Arculator or RPCEmu to work with Allegro 5.

Kind regards,
pollito

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Mon Mar 20, 2017 8:55 pm

pollito wrote:Is there any chance you could make your binary available? It would be muchly appreciated!


I'd rather distribute a patch, as it's less likely to go wrong if your system is different to mine. It also makes it easier for people to see exactly what I've done and how it can be improved.

You can download the patch from here.

Before compiling RPCEmu, you need a few packages to be installed. You can either install them from a package manager or compile yourself. I always compile myself, so the instructions below are for this:

automake

Download from: http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz.

To build from source:

Code: Select all

tar fx automake-1.15.tar.gz
cd automake-1.15
./configure
make
sudo make install


You will be prompted for your password by the final command. You can speed the build along by appending " -jX" to the "make" command, where "X" is a number. My Mac Pro has 12(!) cores, so I use "make -j12".

autoconf

Download from: http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz

To build from source:

Code: Select all

tar fx autoconf-2.69.tar.gz
cd autoconf-2.69
./configure
make
sudo make install


pkg-config

Download from: https://pkg-config.freedesktop.org/rele ... 9.2.tar.gz

To build from source:

Code: Select all

tar fx pkg-config-0.29.2.tar.gz
cd pkg-config-0.29.2
./configure --with-internal-glib
make
sudo make install


cmake

This is needed if you compile Allegro from source. Download from https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz.

To build from source:

Code: Select all

tar fx cmake-3.7.2.tar.gz
cd cmake-3.7.2
./configure
make
sudo make install


The "./configure" stage may give show a message about Java and a JDK. You can ignore it - just press "OK".

Allegro

Download from http://download.gna.org/allegro/allegro ... 2.2.tar.gz.

To build from source:

Code: Select all

tar fx allegro-5.2.2.tar.gz
cd allegro-5.2.2.0
cmake .
make
sudo make install


Ignore any warnings that occur during the "cmake ." part.

RPCEmu

Download from http://marutan.net/rpcemu/cgi/download. ... .15.tar.gz.

Before you do anything else, copy the "patches.tar.bz2" file into the same folder as the "rpcemu-0.8.15.tar.gz".

To build from source:

Code: Select all

tar fx rpcemu-0.8.15.tar.gz
cd rpcemu-0.8.15/src
tar fx ../../patches.tar.bz2
patch < patches/combined.patch
autoreconf -fvi
./configure
make


At the end of this process, you should have an "rpcemu" file in the parent of the "src" folder. You can copy a ROM into the "roms" folder and start the emulator in the normal way.

Please note that this patch hasn't been tested at all - I don't use RPCEmu for anything other than playing about. It does not include networking support.

The patch includes an Xcode project inside the "src/macosx" folder, so you can compile the code from Xcode instead of using the command-line once everything is up and running. It puts a "proper" icon in the Dock and loads the ROM, CMOS and other files from ~/Library/Application Support/RPCEmu instead of the "rpcemu-0.8.15" folder. XCode will compile a proper OS X application for you.

User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: Building RPCEmu on Mac OS X

Postby pollito » Tue Mar 21, 2017 9:15 pm

Hi VincentVega,

That's amazing! Thank you so much! :D :D :D

Just one thing I - you need to build autoconf before automake or it won't ./configure. Apart from that your instructions are spot on.

It didn't resolve the graphical issue I have but it was worth trying just for the experience. I can run it with Risc OS 3 though so thanks again. :)

Quick question - is there any way to bring the menu up? The documentation for the Linux version suggests pressing [CTRL] + [END] but this doesn't seem to work.
pollito

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Wed Mar 22, 2017 9:33 am

Allegro 5 doesn't have the GUI elements, so the menus won't work.

User avatar
hoglet
Posts: 5877
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Building RPCEmu on Mac OS X

Postby hoglet » Wed Mar 22, 2017 12:06 pm

VincentVega wrote:Allegro 5 doesn't have the GUI elements, so the menus won't work.

I think Menus got added back into the Native Dialog Add-On in Allegro 5.1:
http://liballeg.org/a5docs/trunk/native_dialog.html

Dave

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Thu Mar 23, 2017 6:51 pm

Thanks for that. I may have a look and see if I can re-introduce the menu elements, at least. There are a couple of dialogue boxes as well, but Allegro 5 doesn't support those currently. Unfortunately, programming a proper, native UI in Objective X/Cocoa is far beyond my abilities.

User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: Building RPCEmu on Mac OS X

Postby pollito » Sun Mar 26, 2017 9:19 am

VincentVega wrote:Unfortunately, programming a proper, native UI in Objective X/Cocoa is far beyond my abilities.


Personally I think using Cocoa for emulators like RPCEmu is a waste of time and sort of defeats the point of the code being portable.

I think Allegro 5 menus would be great. :)

Are you looking at implementing the menus on the 0.8.15 version or the latest code in the repository?

Regards,
pollito

VincentVega
Posts: 182
Joined: Thu Sep 11, 2008 9:19 pm

Re: Building RPCEmu on Mac OS X

Postby VincentVega » Sun Mar 26, 2017 10:39 am

More than likely the 0.8.15 one, as I'd have to work around any differences between 0.8.15 and the latest repository version when applying the main patch. That's unless there is a good reason to use the latest repository version.

Thinking about your display issues, do you get the same problem with things not displaying if you try out the demo programs that are compiled as part of Allegro? There are a number of them inside the "examples" folder within the main allegro-5.2.2.0 folder that you compiled from. This would identity whether it's an Allegro issue or an RPCEmu issue.

User avatar
pollito
Posts: 24
Joined: Fri Nov 18, 2016 3:57 pm
Location: Cluj-Napoca, Romania

Re: Building RPCEmu on Mac OS X

Postby pollito » Wed Mar 29, 2017 7:09 pm

Apologies for the delay. I haven't been in front of my main machine for a few days.

So far I've run all of the Allegro 5 demos alphabetically up to ex_gldepth and only ex_haptic and ex_haptic2 fail with al_install_haptic failed and Could not init haptics (respectively). All the other demos run fine.

The thing is, the problem happens on the same machine regardless of whether RPCEmu is run under Windows or Mac OS X (and regardless of whether Allegro 4 or Allegro 5 is being used, it would seem), and it also happens on my work machine which only runs Windows. My home machine has an nVidia GeForce GTX 280 card in it and the work machine has an Intel 4000 series. Also, it only happens when RPCEmu is emulating RISC OS 4 or RISC OS 6. Risc OS 3.xx is absolutely fine. I have also compiled the latest version for Windows from the repository and it makes no difference.
pollito


Return to “emulators”

Who is online

Users browsing this forum: No registered users and 1 guest