I have the arm64 recompiler working on macOS, but I ran into a different issue:
Code: Select all
Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
terminating with uncaught exception of type NSException
Just fyi, to get things working thus far:
1) I had to add an __APPLE__ case to the allocator to add MAP_JIT to the flags.
2) I had to add pthread_jit_write_protect_np(0/1) calls around blocks that wrote to the MAP_JIT memory, this function toggle is per thread, and the blocks default to execute but read-only.
3) I needed to regen the build files with autoreconf -i, and needed to doctor them.
4) The configure.ac needed to detect host_cpu of "arm" and set CPU=arm64. This should probably be specific to host darwin.
5) The build needed the off64_t overrides, since that doesn't exist here. Offsets seem to be 64 bit, though.
6) DEFAULT_INCLUDES needed to be changed to include /opt/homebrew/include, since somehow Homebrew doesn't override that for my environment.
7) codegen_allocator_clean_blocks needed a separate cache wipe function for macOS ARM: sys_cache_control(kCacheFunctionPrepareForExecution, &mem_block_
The only issue seems to be that wxMac thing.
Incidentally, MAP_JIT is needed when building for 10.14 SDK and 10.14+ on Intel, too, but the pthread_jit function calls are not needed.
EDIT: I managed to make it run long enough to get into Windows 98 SE, by forcing it into fullscreen mode using ./pcem --fullscreen to run it. It seems to work, but it fails to run Final Reality with 3Dfx mode.