Coder Social home page Coder Social logo

pcemonmac / pcemv17macos Goto Github PK

View Code? Open in Web Editor NEW
68.0 3.0 14.0 2.18 MB

Port of the PCem PC emulator for macOS. Comes with OpenGL 3.0 support built-in

License: GNU General Public License v3.0

Makefile 6.67% Shell 0.18% M4 0.04% C 83.46% C++ 9.64%

pcemv17macos's Introduction

PCemV17macOS

MacOS port of PCem low-level PC hardware emulator PCem V17. Experimental OpenGL 3 port.

Under macOS 10.14 (Mojave) and 10.15 (Catalina):

Step 1: Install Xcode command-line tools

You need Xcode command-line tools from Apple in order to install Home Brew. You can install Xcode from the App Store or, when you run the Home Brew install script (step 2), it will install the command-line tools for you.

Step 2: Install Home Brew

Home Brew is the package manager for macOS that makes it easy to install the required packages needed for PCem to compile successfully. You can get it from https://brew.sh or run the following command from a Terminal shell:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Step 3: Install the required packages needed by PCem

In order to compile PCem on macOS you'll need sdl2, wxmac and openal-soft packages (Note: Later versions of macOS already have openal-soft so you may not need to install it using Home Brew). You can install theses with the following commands:

brew install sdl2

brew install wxmac

brew install openal-soft

Step 4: Download the Source Code

Download the source code from this repository and change directory to the PCem install folder.

Example: cd /PCemV17macOS-master

Step 5: Build PCem

Run the configuration script:

./configure --enable-release-build

If you want networking support:

./configure --enable-networking --enable-release-build

Assuming the command completes successfully run:

make -j4 -Wl,headerpad_max_install_names

This uses 4 threads in parallel and makes space for dylibs to be renamed later (in bundles).

This will take a while. You may see some warning messages during the make process but they do not seem to cause any issues with the compile. Once it completes you'll have the pcem executable file in the install folder. To start the program just run ./pcem from the terminal. You will need to obtain the required ROM files for the machine you want to emulate and need at least one valid ROM for pcem to start. These go in the roms folder located in the folder where PCem is installed.

Under macOS 11 (Big Sur):

  1. Follow the same steps 1-4 as described above for Mojave & Catalina, but ommitting the command to install wxmac via Homebrew.

If wxmac is already installed, in Terminal run:

brew uninstall wxmac

Alternatively, you can go to usr/local/Cellar and move the wxmac folder elsewhere, unless/until you want the unmodified Homebrew version installed again.

  1. Download wxmac from source:

https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.5.1/wxWidgets-3.0.5.1.tar.bz2

cd to the wxWidgets-3.0.5.1 folder and run:

./configure --prefix=/usr/local/Cellar/wxmac/3.0.5.1_1 --enable-clipboard --enable-controls --enable-dataviewctrl --enable-display --enable-dnd --enable-graphics_ctx --enable-std_string --enable-svg --enable-unicode --with-expat --with-libjpeg --with-libpng --with-libtiff --with-opengl --with-osx_cocoa --with-zlib --disable-precomp-headers --disable-monolithic --with-macosx-version-min=10.15 --disable-webview

Then run:

make install

This creates the wxmac libraries and the path to the config file is:

/usr/local/Cellar/wxmac/3.0.5.1_1/bin/wx-config

Download the PCemV17 source as above, cd into the folder and run the following configure command:

./configure --enable-networking --enable-release-build --with-wxdir=/usr/local/Cellar/wxmac/3.0.5.1_1/bin/

Then run:

make

This should result in the successfull compilation of the 'pcem' executable. Running it should produce the standard initial error message that no ROMs are present.

pcemv17macos's People

Contributors

almeath avatar kode54 avatar kyr0 avatar maddthesane avatar mills5 avatar shambler2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pcemv17macos's Issues

No ROMs detected on Mac Mini M1

I managed to compile and PCem successfully after changing the path from /usr/local/Cellar to /opt/homebrew/Cellar, however when I run the executable, I get the "PCem fatal error: No ROMs present popup", even though I have sis496-1.awa ROM sitting in the roms/sis496 folder. Additionally in the terminal window I see the following messages - I'm not sure if they are relevant:
Menu item not found: 1403
Menu item not found: 1404
What am I doing wrong?

LLDB results for PCem v17 (ARM64 Apple Silicon)

Presumably this is also accurate for the x86_64 version, but I did a LLDB to try to figure out the errors involving menu item 1403 and 1404 as well as the crash when closing.

(lldb) target create "/Applications/PCem v17 copy/pcem"
Current executable set to '/Applications/PCem v17 copy/pcem' (arm64).
(lldb) run
Process 7060 launched: '/Applications/PCem v17 copy/pcem' (arm64)
Set fullspeed - 0 0 0
2021-04-22 18:47:35.223807-0500 pcem[7060:445148] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x102f4f450> F8BB1C28-BAE8-11D6-9C31-00039315CD46
Menu item not found: 1403
Menu item not found: 1404
Menu item not found: 1403
Menu item not found: 1404
Process 7060 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10)
    frame #0: 0x0000000100396f44 pcemsdl_renderer_update + 172 pcemsdl_renderer_update:
    -> 0x100396f44 <+172>: ldr x9, [x9, #0x10]
    0x100396f48 <+176>: adrp x10, 3516
    0x100396f4c <+180>: nop
    0x100396f50 <+184>: ldr x3, [x10, #0x7f0]
    Target 0: (pcem) stopped.
    (lldb)

It won't run on Mojave

It won't run from Mojave, I got the following error: (EDIT: tried your binary dmg)

$ ./pcem
dyld: Library not loaded: /usr/lib/system/libsystem_featureflags.dylib
Referenced from: /Applications/PCem.app/Contents/MacOS/./libSystem.B.dylib
Reason: image not found

However I can compile the official pcem code (Sarah Walker's) normally, though since v17 it lacks DynaRec support on mac, that's why I wanted to try your code.

Incompatible library version: libtiff.5.dylib

Dyld Error Message:
Library not loaded: /usr/local/opt/libtiff/lib/libtiff.5.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 12.0.0 or later, but libtiff.5.dylib provides version 11.0.0

My Info:
Mac OS 11.1
M1 Mac
PCem 17.0.0-beta.1

Test results

Catalina:

  • compilation works flawlessy
  • resulting binary executes MS DOS 6.22
  • loads CD driver
  • I can play Jazzjack rabbit

-> Performance is better than in V16 -- no more micro lags in sound/video playback
-> But OpenGL 3 rendering backend NOT available
-> Software rendering and OpenGL 2 works

SDL2 path incorrect

Hi All,

Very minor issue that I ran into while compiling the latest main on an M1 Mac.

System: Macbook Pro M1
Pre-requisites installed through ARM native version of homebrew (sdl2)
wxmac compiled as per instructions

Compile fails due to SDL.h (and a few other related header files) not being in the correct path.

Worked around it by swapping out all angle bracketed header includes that contain <SDL2/*> for double quoted includes e.g. <SDL2/sdl.h> to "SDL.h". There was roughly 10 edits I had to make then it compiled fine, all were in files that interacted with wx-mac.

Not sure if anyone else came across this or its something down to the way I have my system set up.

Please update the default_roms_path to follow macOS Standards

Hi,

The default ROMS behavior should be changed. On the application startup, a folder ~/Library/Application Support/PCem should be created and the default roms,configs,nvr, etc. should be copied from $executable_path/../Resources/SKEL to that folder, so that the user can customize them without actually modifying the /Applications/PCem.app binary. If that initial provisioning is done, PCem shouldn't complain about ROMS at startup anymore. The expected path of ~/PCem or /usr/share/pcem is not documented in the error dialog box nor in stderr, nor is it created automatically.

Thanks,
R.

Please include all the linked libraries in the build in the Frameworks directory

Hi,

I've written a small shell script that will correct the linked libraries in order for them to be included in PCem.app/Content/Frameworks and the application to run completely independently of homebrew dependencies. You also need to include libtiff.dylib, libjpeg.dylib, libpng.dylib, as they are referenced by WX. I've also excluded the private copies of libSystem and libc++.

If you build PCem with an older macOS SDK, it should work with older releases as well. Should time permit it, I'll do my best to make a direct XCode build of it that solves everything, but I am having some doubts.

The script can be found below.

Thanks,
R.

mkdir ../Frameworks
mv libwx_baseu-3.0.dylib ../Frameworks/libwx_baseu.dylib
mv libwx_baseu_net-3.0.dylib ../Frameworks/libwx_baseu_net.dylib
mv libwx_baseu_xml-3.0.dylib ../Frameworks/libwx_baseu_xml.dylib
mv libwx_osx_cocoau_html-3.0.dylib ../Frameworks/libwx_osx_cocoau_html
mv libwx_osx_cocoau_qa-3.0.dylib ../Frameworks/libwx_osx_cocoau_qa.dylib
mv libwx_osx_cocoau_xrc-3.0.dylib ../Frameworks/libwx_osx_cocoau_xrc.dylib
mv libwx_osx_cocoau_adv-3.0.dylib ../Frameworks/libwx_osx_cocoau_adv.dylib
mv libwx_osx_cocoau_core-3.0.dylib ../Frameworks/libwx_osx_cocoau_core.dylib
mv libSDL2-2.0.0.dylib ../Frameworks/libSDL2.dylib
mv /usr/local/opt/jpeg/lib/libjpeg.9.dylib ../Frameworks/libjpeg.dylib
mv /usr/local/opt/libpng/lib/libpng16.16.dylib ../Frameworks/libpng.dylib
mv /usr/local/opt/libtiff/lib/libtiff.5.dylib ../Frameworks/libtiff.dylib

install_name_tool -change "@executable_path/libSystem.b.dylib" "/usr/lib/libSystem.B.dylib" pcem
install_name_tool -change "@executable_path/libc++.1.dylib" "/usr/lib/libc++.1.dylib" pcem
install_name_tool -change "@executable_path/libwx_osx_cocoau_xrc-3.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_xrc.dylib" pcem
install_name_tool -change "@executable_path/libwx_osx_cocoau_qa-3.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_qa.dylib" pcem
install_name_tool -change "@executable_path/libwx_osx_cocoau_adv-3.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_adv.dylib" pcem
install_name_tool -change "@executable_path/libwx_osx_cocoau_core-3.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_core.dylib" pcem
install_name_tool -change "@executable_path/libwx_osx_cocoau_html-3.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_html.dylib" pcem
install_name_tool -change "@executable_path/libwx_baseu_xml-3.0.dylib" "@loader_path/../Frameworks/libwx_baseu_xml.dylib" pcem
install_name_tool -change "@executable_path/libwx_baseu_net-3.0.dylib" "@loader_path/../Frameworks/libwx_baseu_net.dylib" pcem
install_name_tool -change "@executable_path/libwx_baseu-3.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" pcem
install_name_tool -change "@executable_path/libSDL2-2.0.0.dylib" "@loader_path/../Frameworks/libSDL2.dylib" pcem

cd ../Frameworks
install_name_tool -id libwx_osx_cocoau_html.dylib libwx_osx_cocoau_html.dylib
install_name_tool -id "libwx_osx_cocoau_html.dylib" libwx_osx_cocoau_html.dylib
install_name_tool -change "/usr/local/opt/libpng/lib/libpng16.16.dylib" "@loader_path/../Frameworks/libpng.dylib" libwx_osx_cocoau_html.dylib
install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib" "@loader_path/../Frameworks/libjpeg.dylib" libwx_osx_cocoau_html.dylib
install_name_tool -change "/usr/local/opt/libtiff/lib/libtiff.5.dylib" "@loader_path/../Frameworks/libtiff.dylib" libwx_osx_cocoau_html.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_core.dylib" libwx_osx_cocoau_html.dylib
install_name_tool -change  "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_osx_cocoau_html.dylib

install_name_tool -id libwx_osx_cocoau_xrc.dylib libwx_osx_cocoau_xrc.dylib
install_name_tool -change "/usr/local/opt/libpng/lib/libpng16.16.dylib" "@loader_path/../Frameworks/libpng.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib" "@loader_path/../Frameworks/libjpeg.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "/usr/local/opt/libtiff/lib/libtiff.5.dylib" "@loader_path/../Frameworks/libtiff.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "@loader_path/../libwx_osx_cocoau_html.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_html.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "@loader_path/../libwx_osx_cocoau_adv.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_adv.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "@loader_path/../libwx_osx_cocoau_core.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_core.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "@loader_path/../libwx_baseu_xml.dylib" "@loader_path/../Frameworks/libwx_baseu_xml.dylib" libwx_osx_cocoau_xrc.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib"  "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_osx_cocoau_xrc.dylib

install_name_tool -id libwx_osx_cocoau_qa.dylib libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/opt/wxmac/lib/libwx_osx_cocoau_qa-3.0.dylib"  "@loader_path/../Frameworks/libwx_osx_cocoau_qa.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/opt/libpng/lib/libpng16.16.dylib"  "@loader_path/../Frameworks/libpng.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib"  "@loader_path/../Frameworks/libjpeg.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/opt/libtiff/lib/libtiff.5.dylib"  "@loader_path/../Frameworks/libtiff.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib"  "@loader_path/../Frameworks/libwx_osx_cocoau_core.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib"  "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_osx_cocoau_qa.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu_xml-3.0.0.5.0.dylib"  "@loader_path/../Frameworks/libwx_baseu_xml.dylib" libwx_osx_cocoau_qa.dylib

install_name_tool -id libwx_osx_cocoau_core.dylib libwx_osx_cocoau_core.dylib
install_name_tool -change "/usr/local/opt/libpng/lib/libpng16.16.dylib" "@loader_path/../Frameworks/libpng.dylib" libwx_osx_cocoau_core.dylib
install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib" "@loader_path/../Frameworks/libjpeg.dylib" libwx_osx_cocoau_core.dylib
install_name_tool -change "/usr/local/opt/libtiff/lib/libtiff.5.dylib" "@loader_path/../Frameworks/libtiff.dylib" libwx_osx_cocoau_core.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_osx_cocoau_core.dylib

install_name_tool -id libwx_osx_cocoau_adv.dylib libwx_osx_cocoau_adv.dylib
install_name_tool -change "/usr/local/opt/libpng/lib/libpng16.16.dylib" "@loader_path/../Frameworks/libpng.dylib" libwx_osx_cocoau_adv.dylib
install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib" "@loader_path/../Frameworks/libjpeg.dylib" libwx_osx_cocoau_adv.dylib
install_name_tool -change "/usr/local/opt/libtiff/lib/libtiff.5.dylib" "@loader_path/../Frameworks/libtiff.dylib" libwx_osx_cocoau_adv.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_osx_cocoau_core-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_osx_cocoau_core.dylib" libwx_osx_cocoau_adv.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_osx_cocoau_adv.dylib

install_name_tool -id libwx_baseu.dylib libwx_baseu.dylib

install_name_tool -id libwx_baseu_net.dylib libwx_baseu_net.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_baseu_net.dylib

install_name_tool -id libwx_baseu_xml.dylib libwx_baseu_xml.dylib
install_name_tool -change "/usr/local/Cellar/wxmac/3.0.5.1_1/lib/libwx_baseu-3.0.0.5.0.dylib" "@loader_path/../Frameworks/libwx_baseu.dylib" libwx_baseu_xml.dylib

install_name_tool -change "/usr/local/opt/jpeg/lib/libjpeg.9.dylib" "@loader_path/../Frameworks/libjpeg.dylib" libtiff.dylib
install_name_tool -id libSDL2.dylib libSDL2.dylib
install_name_tool -id libtiff.dylib libtiff.dylib
install_name_tool -id libpng.dylib libpng.dylib
install_name_tool -id libjpeg.dylib libjpeg.dylib

Can't configure (pre-compile) on Apple Silicon BigSur

Hi,

Quite possibly doing something wrong here - first time attempting to compile something on this machine.

Followed the BigSur instructions, used the ARM release of homebrew to install dependencies, including the package provided by vashpan in the discussions (cdalvaro/tap/wxmac)

Currently running BigSur 11.2.3

Ran the configure command and got the following output:

user@MacBook-Pro PCemV17macOS-main % ./configure --enable-release-build
checking build system type... arm-apple-darwin20.3.0
checking host system type... arm-apple-darwin20.3.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether to build for release... yes
checking whether to enable debugging... no
checking whether to enable networking... no
checking whether to use ALSA for MIDI output... no
checking for cpu... configure: error: Unsupported CPU. arm
user@MacBook-Pro PCemV17macOS-main % make
make: *** No targets specified and no makefile found.  Stop.

Seems like it's not matching the CPU to one of the ones defined in the configure script and just failing from there?
Not familiar enough with configure scripts to troubleshoot myself yet though will keep fiddling

Segmentation Fault 11 on macOS Big Sur (Intel)

I downloaded the last release from here and unfortunately the app does not open, I have placed the roms in the right place, however, the app refuses to open, no warning, no alert, no mention of the reason why. The icon comes on dock and leaves.

macOS Big Sur 11.4, retina Macbook Pro 13" 2013.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.