[Patch] Full macOS / Mac OS X support

Post new patches here!
Post Reply
kyr0
Posts: 2
Joined: Sat 11 May, 2019 12:49 am

[Patch] Full macOS / Mac OS X support

Post by kyr0 » Sun 12 May, 2019 11:10 pm

Hi :)

first of all thank you for this project and the immense amount of work you invested in PCem. It is a pleasure for me to use it and play my childhood games again. The emulation is awesome and proofs to be far ahead of DosBox in accuracy and performance for my use cases.

However, I found it a bit inconvenient to manually patch the sources, compile and mess with config paths when I use PCem on my Macbook. Also, creating and loading CD ROM images proofed to be far more complicated than I thought on Mac. Finally I was wondering why OpenGL 3 rendering wasn't enabled because Mac OS X would support it for window contexts in general.

Well, I accepted that as a challenge and invested this weekend to fix all these issues with the motivation to give a little bit back:
- Implemented an automated build process for Mac OS app bundles and DMG installers
- Changed the PCem path location as by Apple standard for Macs (to use ~/Library/Application Support/PCem). Path gets auto-created if the folder doesn't exist
- Implemented a OS/Finder extension to create MS DOS compatible (ISO 9660 joliet) images from directories with 1 click: https://github.com/kyr0/MacOS-Finder-Co ... o-CD-Image
- Implemented experimental OpenGL 3.0 support and upgraded the shader versions (branch: opengl3)

I did also release the .dmg installer file as a beta to test for Mac users. Known issues are noted on GitHub and as GitHub issues but so far everything I tested works (nothing critical): https://github.com/kyr0/PCemV14MacOSX/releases

I marked everywhere that this is unofficial. It's based on the v14 linux release sources.

Code & docs:
https://github.com/kyr0/PCemV14MacOSX

@SarahWalker I wrote a detailed description of my changes for you in case you'd like to apply my changes. I'd also offer to volunteer for a PCem 15 mac release if official support is desired.

Issues: https://github.com/kyr0/PCemV14MacOSX/issues

Those issues are all very much "minor" and are no deal-breaker at all. If you could give me a hint where to fix them in the code I would like to try to fix them all.

Again, thank you for the great work on PCem. As a programmer I do really see the great achievements made. I'm impressed by your long-term motivation and overall commitment and code quality. Thank you for the clean code. I was able to learn something new from your code and it was a pleasure to work with the code base.

The diff: OpenGL 3 on Mac: https://github.com/kyr0/PCemV14MacOSX/compare/opengl3
The diff: Mac support in general: https://github.com/kyr0/PCemV14MacOSX/c ... db0bc5c8d8

Greetings from Munich,
Aron

vga256
Posts: 1
Joined: Wed 22 May, 2019 12:58 am

Re: [Patch] Full macOS / Mac OS X support

Post by vga256 » Wed 22 May, 2019 6:44 pm

Really appreciate your hard work Aron. I tried to run the packaged DMG, unfortunately it produces a lot of missing library errors.

Code: Select all

dyld: Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib
  Referenced from: /Applications/PCem.app/Contents/MacOS/./libwx_osx_cocoau_xrc-3.0.dylib
  Reason: image not found

Code: Select all

dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.9.dylib
  Referenced from: /Applications/PCem.app/Contents/MacOS/./libwx_osx_cocoau_xrc-3.0.dylib
  Reason: Incompatible library version: libwx_osx_cocoau_xrc-3.0.dylib requires version 13.0.0 or later, but libjpeg.9.dylib provides version 12.0.0
And there are likely more missing deps, but I haven't bothered to install more libraries via brew yet. Rather than installing via brew, is there a way of including the dependencies in the .app package?

kyr0
Posts: 2
Joined: Sat 11 May, 2019 12:49 am

Re: [Patch] Full macOS / Mac OS X support

Post by kyr0 » Fri 26 Jul, 2019 7:08 pm

Hi vga256,

first of all, sorry for the huge delay in responding. I'm typically not online here and for some magical reason I didn't receive any email notification (or didn't see it :)
I activated notifications for now.

Well, I'm sorry that the .dmg didn't work for you. I was aware of this issue in general and checked the binary and dmg for all external libraries linked but it seems that I left out libpng. If you like, you can open an issue on my github repo. If you'd like to help me further, you could checkout:

https://github.com/kyr0/PCemV14MacOSX/b ... dle-sh#L28

As you can see, these are the steps to copy the dependent libs into the app image and replace the links. Then you can check if the libs of the app image are used by checking the binary with "ld".

The error "Incompatible library version:" is interesting, what OS X / MacOS version are you using?

Thank you for testing and best,
Aron

Post Reply