[Patch] Full macOS / Mac OS X support

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

[Patch] Full macOS / Mac OS X support

Post by kyr0 »

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 »

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: 3
Joined: Sat 11 May, 2019 12:49 am

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

Post by kyr0 »

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
Cheez
Posts: 86
Joined: Tue 19 Dec, 2017 4:08 am

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

Post by Cheez »

elsen wrote: Fri 23 Apr, 2021 4:48 pm kyro,
Does not work, please go fuck yourself, thank you.
wow?? how about you go fuck YOUR self? you created an account just to be a shithead to someone who wasn't even talking to you, over something that nobody has to do for you or anyone else. You didn't even provide any sort of information about anything, so nobody can help your stupid ass.
kyr0
Posts: 3
Joined: Sat 11 May, 2019 12:49 am

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

Post by kyr0 »

Thank you Cheez! Well, if I would take it personally, the guy doesn't deserve any response, but I see that he/she must have had a very bad time and/or lives a pretty poor and sad life/situation atm... so I'm better sorry for the person.

btw there has been more and more positive community support with the initial project to bring PCem to the Mac platform and we've built a small community now. There is even growing support to port the code to support the new ARM based Apple CPUs (M1).

V15, V16 and recently V17 has been ported.

Here is the GitHub org and community: https://github.com/PCemOnMac
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

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

Post by SarahWalker »

Apologies for slack moderating, offending post has been removed and idiot has been banned.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

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

Post by SarahWalker »

kyr0 wrote: Sat 24 Apr, 2021 8:38 am V15, V16 and recently V17 has been ported.

Here is the GitHub org and community: https://github.com/PCemOnMac
Glad to see this is still going, but any plans to merge back to mainline?
User avatar
Madd the Sane
Posts: 2
Joined: Tue 18 May, 2021 9:23 pm
Location: Idaho

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

Post by Madd the Sane »

Looks like you can get the gist of the changes by comparing commits: https://github.com/PCemOnMac/PCemV17mac ... 690...main
Get out of my mind, idea: I already have an idea in there!
User avatar
Madd the Sane
Posts: 2
Joined: Tue 18 May, 2021 9:23 pm
Location: Idaho

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

Post by Madd the Sane »

I have created a pull request based off of these patches here: https://github.com/sarah-walker-pcem/pcem/pull/14
If there's any question on the changes, ask me: I'll try to answer.
Get out of my mind, idea: I already have an idea in there!
Post Reply