Compiling Sheepshaver in El Capitan (2010 MBP)

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
jetboy
Space Cadet
Posts: 1
Joined: Mon Apr 25, 2016 1:21 pm

Compiling Sheepshaver in El Capitan (2010 MBP)

Post by jetboy »

Hi all... I'm trying to compile Sheepshaver in El Capitan. My reason is that the current 'recommended binary' is unable to read disk images, or CDs (e.g. old games and OS X installer disks) that I throw at it. Unrecognised format? I remember these all used to work with a previous OS X version (waaay in the past) but they no longer appear to be working.

So I configure it using the following:

./configure --disable-jit CFLAGS="-Wl,-no_pie" CXXFLAGS="-Wl,-no_pie" LDFLAGS="-Wl,-no_pie"

(I don't understand the pie bit, but a guy here seems to think it's important to remove pie for some reason... https://github.com/cebix/macemu/issues/16)

The emulator is also saying:

https://i.imgur.com/795vqSQ.png

And in the log...
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 105 (X_ChangePointerControl)
Value in failed request: 0x0
Serial number of failed request: 9
Current serial number in output stream: 10
My EXTREMELY LIMITED brain tells me this is something to do with how the emulator works. Is it some kind of memory addressing? My brain is too small to understand how this all works but maybe there is a clue here:

https://github.com/tycho/sheepshaver/co ... e925462e6b

I think memory... somebody patched the configure.ac file to have a special addressing mode for OS X (maybe Apple prevents us from doing certain things so they are working around this?) Either way, the above 'patch' looks like a dirt hack that goes in and hard codes 0x1000000 if you're on a Mac... no? Either way, there now seems to be a more dynamic solution being distributed with the source (within configure.ac):
dnl Addressing mode
AC_ARG_ENABLE(addressing,
[ --enable-addressing=AM set the addressing mode to use [default=real]],
[case "$enableval" in
real) WANT_ADDRESSING_MODE="real";;
direct) WANT_ADDRESSING_MODE="direct";;
direct,0x*) WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\([[UuLl]]\{1,2\}\)\?\)$/s//\1/p'`;;
esac],
[WANT_ADDRESSING_MODE="real"]
)
QUESTION...

Am I on the right track? 'Real' addressing mode is being used with my binary. I try using 'direct' by using the following configure option:
./configure --disable-jit --enable-addressing=direct CFLAGS="-Wl,-no_pie" CXXFLAGS="-Wl,-no_pie" LDFLAGS="-Wl,-no_pie"
However, no dice. Guessing I can be more specific, but "--enable-addressing=direct,0x1000000" does not work either. When configuring, both say:
checking for addressing mode to use... configure: error: could not determine a sensible NATMEM_OFFSET value
So I'm a little stuck. It appears that:
- JIT is just... broken on OS X?
- There's some kind of a memory (or other) issue that I have just embarrassed myself trying to pretend I understand.
- This is a 64-bit binary... maybe 64-bit has broken a few things and I need to start thinking about compiling a 32-bit binary?

I dunno... but some help/advice/discussion on the matter would be really helpful. Cheers :D
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Compiling Sheepshaver in El Capitan (2010 MBP)

Post by adespoton »

From memory, I think this addresses most of your questions:
1. SheepShaver compiles on 10.6.8 or earlier. It'll compile in a VM running 10.6.8. There are compile instructions on the wiki.
2. SheepShaver starts memory addressing at physical value 0. This is a no-no on modern OSes, so modern compilers won't let you do it. The dynamic addressing is news to me, but sounds interesting, if you can get it to work :)
3. I think the JIT depends on the old addressing method, so it will need a bit of an overhaul if you're using dynamic addressing.
4. 64-bit mode is a bit flaky -- even when compiled against a 64-bit target, the usual recommendation is that it be run in 32-bit mode. I don't think JIT works in 64-bit mode at all.

However, if you try your changes while compiling on 10.6.8, you should get past your current roadblock.

If you succeed in making the source XCode 10.7 friendly, PLEASE share. Fixing dynamic addressing, rewriting JIT for 64-bit CPUs and migrating from SDL 1.2 to SDL 2.0 are the biggest current changes needed to SheepShaver, and all of them are host platform independent. Any changes will help Windows and Linux users too -- not just OS X users.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Compiling Sheepshaver in El Capitan (2010 MBP)

Post by Ronald P. Regensburg »

This information may spare you the effort to try and compile SheepShaver in El Capitan, which is unlikely to succeed:

SheepShaver cannot read physical CD's in Mountain Lion and later. OSX prevents access. However, SheepShaver will read disk images fine, also in El Capitan, if in compatible format and when added to the volumes list in SheepShaver preferences and NOT mounted on the host system. (Compatible image formats are Disk Utility created "read/write" format (.dmg) and "DVD/CD Master" format (.cdr). It will also read .iso files and most .toast files. It is recommended to lock the image file in OSX Finder Info panel for the file.

If software insists on having the original physical CD to be mounted, it can be fooled with a workaround using the Virtual DVD-ROM/CD Utility.

See the Known Issues section in the setup manual.
http://www.emaculation.com/doku.php/she ... own_issues
Post Reply