Problem building SheepShaver on OSX 10.6.4

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

Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

Ronald P. Regensburg wrote:Note that we do not use the SDL 1.2.14 release version for building OSX 10.6/10.7 SheepShaver that is compatible with fullscreen mode in 10.7.
See this topic: http://www.emaculation.com/forum/viewto ... =20&t=7202
Sounds like the Lion issue is fixed in the SDL 1.2 hg repository. So this should mean that SDL 1.2.15, when it's released should be the one to use. Until that's released, I suggest making builds using SDL from the SDL 1.2 hg repository, which is what SDL 1.2.15 will be.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

If I want to try to build SheepShaver using SDL from the SDL 1.2 hg repository, how should I edit video_sdl.cpp if I want a working hardware cursor?


Edit:
Or is the developer version identified as 1.2.15 and can I simply change

Code: Select all

<= SDL_VERSIONNUM(1, 2, 10)
into

Code: Select all

== SDL_VERSIONNUM(1, 2, 15)
Last edited by Ronald P. Regensburg on Sun Jan 01, 2012 12:29 pm, edited 1 time in total.
Reason:  
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

Hi,

I found a problem trying to build in Lion (10.7.2) from the command line with Xcode 4.1 and SDL 1.5 (31-12-2011).
I posted a small report in the SheepShaver and Lion status post here:
http://www.emaculation.com/forum/viewto ... 618#p41618

Best,
Cat_7
Last edited by Cat_7 on Sun Jan 01, 2012 8:08 am, edited 2 times in total.
Reason:  
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

Ronald P. Regensburg wrote:If I want to try to build SheepShaver using SDL from the SDL 1.2 hg repository, how should I edit video_sdl.cpp if I want a working hardware cursor?
You shouldn't need to make any changes, since I've committed the change that enables it under SDL >= 1.2.15.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

I built SheepShaver with current BII and SS source and current SDL from the SDL 1.2 hg repository.

I followed the same procedure I used successfully many times and again here last August, again on the same machine and again with MacOSX 10.6.8 with XCode 3.2.6: http://www.emaculation.com/forum/viewto ... 085#p40085

The resulting application seems to run mostly OK and the NSAutoReleasePool problem appears to be solved.

However: The SheepShaver screen opens white and stays white.

In Console I see this error repeated continuously:

Code: Select all

02-01-12 22:01:28	[0x0-0x77c77c].SheepShaver[42707]	Mon Jan  2 22:01:28 MacKanjer4.local SheepShaver[42707] <Error>: CGContextDrawImage: invalid context 0x0
02-01-12 22:01:28	[0x0-0x77c77c].SheepShaver[42707]	Mon Jan  2 22:01:28 MacKanjer4.local SheepShaver[42707] <Error>: CGContextFlush: invalid context 0x0
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

Looks like it's a bug introduced in the SDL 1.2 hg repository. Change QZ_UpdateRects() in SDL's SDL_QuartzVideo.m to:

Code: Select all

static void QZ_UpdateRects (_THIS, int numRects, SDL_Rect *rects)
{
    if (SDL_VideoSurface->flags & SDL_OPENGLBLIT) {
        QZ_GL_SwapBuffers (this);
    }
    else if ( [ qz_window isMiniaturized ] ) {
    
        /* Do nothing if miniaturized */
    }
    
    else {
        CGContextRef cgc = (CGContextRef)
           // [[NSGraphicsContext currentContext] graphicsPort];
						            [[NSGraphicsContext graphicsContextWithWindow: qz_window]
                graphicsPort];
        QZ_DrawResizeIcon (this);
        CGContextFlush (cg_context);
        CGImageRef image = CGBitmapContextCreateImage (cg_context);
        CGRect rectangle = CGRectMake (0,0,[window_view frame].size.width,[window_view frame].size.height);
        
        CGContextDrawImage (cgc, rectangle, image);
        CGImageRelease(image);
        CGContextFlush (cgc);
    }
}
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Does indeed solve the white screen issue.

It is my first build with SDL 1.2.11 or later that again enables the hardware cursor with switching to the software cursor when needed. Nice, I prefer the hardware cursor, but...

It works correctly in window mode, but it appears to work also in fullscreen mode causing problems with clicking in some areas (specifically in the menu bar). Clicking in the menu bar does nothing, the software version of the cursor appears and gets stuck while SheepShaver freezes and the hardware version of the cursor still moves.

As before, in older builds with SDL 1.2.10, only the software cursor should be used in full screen mode.


Other unresolved issues that are specific of 64bit Intel versions built with SDL 1.2.14 or later:
- Copying text between MacOS in emulator and host OSX does not work both ways. (Possibly an issue in BII/SS source in relation to how the clipboard works on Intel Macs.)
- Crashing of SheepShaver when certain applications are launched. (Happens consistently when iCab is launched, never happens in older SheepShaver builds.)
- Color changing in the SheepShaver window when the SheepShaver window is minimized and again maximized. (Probably somehow related to the use of Quartz instead of previously the depreciated QuickDraw.) When the problem occurs, it can be solved by forcing MacOS in the emulated machine to redraw the screen by setting a different color depth in the Monitors control panel.
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

This build (64 bit only), created in Snow Leopard using the SDL 1.2.15 fix proposed above runs fine in windowed and full screen modes in Lion.
It does display the problem Ronald mentioned when running in Snow Leopard.
http://www.open.ou.nl/hsp/downloads/She ... 1_2012.zip

Best,
Cat_7
Last edited by Cat_7 on Tue Jan 03, 2012 1:43 pm, edited 4 times in total.
Reason:  
PeterHolbrook
Apple Corer
Posts: 273
Joined: Fri Oct 26, 2007 7:56 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by PeterHolbrook »

It looks as if the new build can't be run in 32-bit mode. Can this be fixed?
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

Not yet. The version I just posted is 64 bit only, but runs both windowed and full screen in Lion.
Please refer to the older builds if you need 32 bit.

Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Cat_7 wrote:This build (64 bit only), created in Snow Leopard using the SDL 1.2.15 fix proposed above runs fine in windowed and full screen modes in Lion.
It does display the problem Ronald mentioned when running in Snow Leopard.
http://www.open.ou.nl/hsp/downloads/She ... 1_2012.zip
I suppose it behaves exactly the same in Lion as my build earlier today that I referred to above: http://www.xs4all.nl/~ronaldpr/sheepsha ... _test3.zip

Edit: Your build behaves indeed the same in Snow Leopard as my build.
Last edited by Ronald P. Regensburg on Tue Jan 03, 2012 2:29 pm, edited 1 time in total.
Reason:  
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

Our member Myrd has completed his configuration of SheepShaver to build with Xcode.
I followed his instructions:

1. A side-by-side checkout of SheepShaver and BasiliskII CVS
repositories (this is normal).
2. Having run 'make links' from SheepShaver/ root.
3. SDL installed as a framework in /Library/Frameworks/SDL.framework.
4. You do not need to run autogen.sh / configure to use the Xcode
project. If you've done so already, you should remove or temporary
move/rename src/Unix/config.h, as the presence of that file currently
conflicts with the Xcode build and will cause errors in Xcode.

However, this leads to errors during building:
1x The file “Info.plist” couldn’t be opened because there is no such file.
(ProcessInfoPlistFile build/Release/SheepShaver.app/Contents/Info.plist Info.plist)

43x something like: ld: warning: in /Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks//SDL.framework/SDL, missing required architecture ppc in file
"_SDL_SetPalette", referenced from:
driver_base::update_palette() in video_sdl.o

Best,
Cat_7
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Same here.

- MacOSX 10.6.8, XCode 3.2.6, 10.4u, 10.5, and 10.6 SDKs installed.
- New checkout of BasiliskII and SheepShaver CVS side-by-side and 'make links' done from SheepShaver root as usual.
- SDL.framework built from the SDL.xcodeproj in current source from the SDL 1.2 hg repository and copied to /Library/Frameworks.

Build (release configuration) failed with 44 errors (as described above by Cat_7) and 142 warnings.
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Problem building SheepShaver on OSX 10.6.4

Post by vasi »

It sounds like your SDL.framework isn't build Universal.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Yes, obviously. I suppose that I have to choose the appropriate architecture and/or SDKs, but I am not sure what to do exactly. When I open the SDL 1.2 project and choose the project info, I see (from top to bottom):

- Additional SDKs: (empty)
- Architectures: menu with
  • 32-bit Intel
    64-bit Intel
    Standard (32/64-bit Intel) (This one is selected)
    Native Architecture of Build Machine
    Other...
    (When I choose Other, I could add additional architectures to the existing $(ARCHS_STANDARD_32_64_BIT)
- Base SDK: Gives a menu with all installed SDKs, for Mac OS X 10.4 through 10.6, now set to "Latest Mac OS X (Mac OS X 10.6)".
- Build Active Architecture only: Not enabled
- Valid Architectures: i386 ppc ppc64 ppc7400 ppc970 x86_64

As the SheepShaver project is made to build a UB version that runs on 10.4 PPC through 10.6 Intel, I suppose I should make a SDL.framework for 10.4 PPC through 10.6 Intel. Now what should I set where to make that UB SDL.framework?
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Problem building SheepShaver on OSX 10.6.4

Post by vasi »

Hmm, I thought SDL had a Universal build style, but I guess not. I can't really investigate much right now, but I'll take a look later.

For now, try building SDL.framework for the 10.4 SDK and architectures (ppc, i386, x86_64), that way it will match the SheepShaver build you're attempting.
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

The Info.plist error was a problem with the Xcode project file, I've committed a fix.

To check whether SDL.framework is a Universal Binary or not, you can run:

Code: Select all

file /Library/Frameworks/SDL.framework/SDL
For me, the output is:

Code: Select all

/Library/Frameworks/SDL.framework/SDL: Mach-O universal binary with 3 architectures
/Library/Frameworks/SDL.framework/SDL (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/Library/Frameworks/SDL.framework/SDL (for architecture i386):	Mach-O dynamically linked shared library i386
/Library/Frameworks/SDL.framework/SDL (for architecture ppc):	Mach-O dynamically linked shared library ppc
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

Hi,

I could build a SheepShaver version from the current source and latest SDL from Mercurial. For SheepShaver, I changed nothing from the original project settings available in the latest code from CVS.

However, I had to compile SDL with setting to 10.5 and remove all targets except ppc, i386 and x86_64. Trying to compile from 10.4 results in errors stating gcc 4.2 doesn't support the ppc architecture.

The resulting SheepShaver can run in 32 and 64 bit in Snow Leopard.
-It has the same flaw reported earlier: when running full screen, the mouse sticks in the menu bar of Mac OS and the menu's don't show. EDIT: the mouse does open the menus but only after extensive fiddling with clicking and dragging.
I also see a mouse trail when moving the mouse too quick.
-Even when running in 32 bit, the clipboard exchange between OSX and Mac OS doesn't work.

This build won't run in Lion (not in 32 nor in 64 bit.):
Dyld Error Message:
Library not loaded: @rpath/SDL.framework/Versions/A/SDL
Referenced from: /Users/USER/*/SheepShaver.app/Contents/MacOS/SheepShaver
Reason: Incompatible library version: SheepShaver requires version 12.0.0 or later, but SDL provides version 1.0.0

Best,
Cat_7
Last edited by Cat_7 on Fri Jan 06, 2012 9:14 am, edited 4 times in total.
Reason:  
vasi
Tinkerer
Posts: 54
Joined: Mon Feb 23, 2009 11:46 pm

Re: Problem building SheepShaver on OSX 10.6.4

Post by vasi »

Cat_7 wrote:Hi,
However, I had to compile SDL with setting to 10.5 and remove all targets except ppc, i386 and x86_64. Trying to compile from 10.4 results in errors stating gcc 4.2 doesn't support the ppc architecture.
If you want to compile against the 10.4 SDK, you should be able to change the build settings so that GCC 4.0 is used.
-It has the same flaw reported earlier: when running full screen, the mouse sticks in the menu bar of Mac OS and the menu's don't show. EDIT: the mouse does open the menus but only after extensive fiddling with clicking and dragging.
I also see a mouse trail when moving the mouse too quick.
No idea what this is, and I can't even test 'til I'm back on a Mac.
-Even when running in 32 bit, the clipboard exchange between OSX and Mac OS doesn't work.


You could try turning on DEBUG in clip_macosx.cpp, and seeing what sort of error messages are printed.
This build won't run in Lion (not in 32 nor in 64 bit.):
Dyld Error Message:
Library not loaded: @rpath/SDL.framework/Versions/A/SDL
Referenced from: /Users/USER/*/SheepShaver.app/Contents/MacOS/SheepShaver
Reason: Incompatible library version: SheepShaver requires version 12.0.0 or later, but SDL provides version 1.0.0
Ewww, rpath!? It sounds like an external SDL.framework (maybe in /Library/Frameworks?) is overriding the one from SheepShaver. I really don't understand why we're using rpath instead of executable_path.
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Cat_7 »

I fixed that by recompiling the SDL framework in Lion with 10.5 and placing it in /Library/Frameworks.
I'll see what I can do in Snow Leopard build with the path to the framework.
EDIT: I'm unable to fix the path to the included framework

Best,
Cat_7
Last edited by Cat_7 on Fri Jan 06, 2012 2:42 pm, edited 1 time in total.
Reason:  
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

I've updated the SheepShaver Xcode project to set the SDL load path to use the SDL framework from SS's bundle.
Myrd
Granny Smith
Posts: 107
Joined: Mon Dec 25, 2006 4:09 am

Re: Problem building SheepShaver on OSX 10.6.4

Post by Myrd »

To build SDL with the same settings as SheepShaver, do the following:

Set Base SDK to 10.4. Add a "Build Setting Condition" on Base SDK to set it to 10.5 on Intel 64-bit.
Change C/C++ Compiler to GCC 4.0.
Set Mac OS X Deployment Target to 10.4. Add a "Build Setting Condition" on Mac OS X Deployment Target to 10.5 on Intel 64-bit.

To add a "Build Setting Condition", have the property selected and use the gear menu on the bottom left corner of the window in Xcode.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Followed the above instructions carefully, built a SDL.framework, and copied it to /Library/Frameworks/

Tried to build SheepShaver following the instructions given in basilisk-devel mailing list (and repeated in this topic by Cat_7).

Again building fails with 142 warnings and 44 errors, just like before. All errors are SDL-related:

Code: Select all

 "_SDL_SetPalette", referenced from:
 driver_base::update_palette()       in video_sdl.o

"_SDL_LockSurface", referenced from:
 update_display_static_bbox(driver_base*)      in video_sdl.o
 video_refresh_window_static()     in video_sdl.o

"_SDL_SemPost", referenced from:
 AudioInterrupt()     in audio_sdl.o
And so on.

Todays hg SDL 1.2, BII, and SS source.

Snow Leopard 10.6.8 on Intel Core 2 Duo.
XCode 3.2.6
MacOSX10.4u/10.5/10.6 SDKs installed
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

And when I check SDL, it appears to not have PPC architecture:

Code: Select all

$ file /Library/Frameworks/SDL.framework/SDL
/Library/Frameworks/SDL.framework/SDL: Mach-O universal binary with 2 architectures
/Library/Frameworks/SDL.framework/SDL (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/Library/Frameworks/SDL.framework/SDL (for architecture i386):	Mach-O dynamically linked shared library i386
Is another additional setting needed for building SDL.framework that Myrd did not specify above?

Edit 1: For "Architectures" the only choices are for Intel (32-bit, 46-bit, 23/64-bit, or native architecture). There is also "Other..." but that requires to enter a string and I have absolutely no idea what to enter for PPC. The same for a added Build Setting Condition.

Edit 2: Well, I was intimidated by the default string "$(ARCHS_STANDARD_32_64_BIT)", but replacing it by simply "ppc i386 x86_64" apparently did the trick. The built SDL.framework now has 3 architectures. I will proceed trying to build SheepShaver.
Last edited by Ronald P. Regensburg on Thu Jan 12, 2012 9:05 pm, edited 2 times in total.
Reason:  
User avatar
Ronald P. Regensburg
Expert User
Posts: 7834
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Problem building SheepShaver on OSX 10.6.4

Post by Ronald P. Regensburg »

Worked this time. I now have a SheepShaver that is identified as having 3 architectures.

In Snow Leopard it runs fine in 64-bit in window mode, but it has the earlier described cursor problems in full-screen mode. But when set it to run as 32-bit, it runs fine in both window mode and full-screen mode. Uses the hardware cursor in all modes.

I can test it in 10.4 PPC on my PowerBook G4. After that I will post this 12 January 2012 UB version in a new topic, asking forum users to test it on different host systems. It may be suitable for use as the single UB for 10.4 through 10.7.

Edit: Test build posted here: http://www.emaculation.com/forum/viewto ... =20&t=7438
Last edited by Ronald P. Regensburg on Thu Jan 12, 2012 10:42 pm, edited 1 time in total.
Reason:  
Post Reply