Proposed Patches, Test build

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
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

If you guys want to try a version built with the latest cvs sources and a few of my patches - actually stuck awaiting for a moderator in the basilisk-devel@lists.sourceforge.net because they are bigger than 40 kbytes - I can post a link to an universal binary on my site, linked with an embedded patched SDL-1.2.14 to avoid memory leaks, just let me know and I'll upload it.
I tested it on two PowerBook G4 with Tiger and Leopard, a G5 2x2GHz with both systems and a MacBook Pro with either Leopard, where it runs in 32-bit or Snow Leopard where it runs in 64-bit.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I think that everyone would be very happy to try out your patched version.

If you need it to be hosted somewhere, feel free to e-mail me the file: mgoodine@gmail.com and I can put it up here.
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

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

Post by Ronald P. Regensburg »

Tried it on my Intel Core 2 Duo iMac with 10.5.8.

- The application is twice the size of my builds (4.4MB vs 2.2MB), mainly because of the embedded SDL framework.
- It crashes with a SIGSEGV. It runs when "Ignore Illegal Memory Accesses" is enabled.
(Edit: Crash related to the precise timer patch that I excluded from my 25-10-2009 build because of similar crashes with my 18-10-2009 build?)
- It feels and looks extremely slow, slower even than the May 2006 snapshot, mainly because of slow display performance.
- Sound is again impaired (possibly because of the problematic sdl audio patch that I excluded from my builds).
- CPU usage is very low compared with my builds (6.5% vs 18%)
- It uses the software cursor. The preferred hardware cursor (with better performance) can only work with SDL 1.2.10.


@ClockWise
Is it possible to move these messages to a new topic about chombier's 64-bit patch?
Last edited by Ronald P. Regensburg on Wed Nov 04, 2009 7:40 am, edited 1 time in total.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

To be able to compare a build with your patch and my 25-10-2009 build, could you try to create a build in the same way?

- With exclusion of the 19-02-2009 sdl audio patch that causes (or makes apparent) serious audio problems.
- With exclusion of the 18-08-2009 precise timer patch that causes (or makes apparent) a problem that causes freeze or crash at startup on many host machines/systems.
- Using sdl 1.2.10 to enable the hardware cursor for smoother cursor movements and better overall performance.

This is how I created the 25-10-2009 build:

Code: Select all

mkdir SheepShaverBuild
cd SheepShaverBuild


(get source files from cvs)

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix login

(password: "anoncvs")

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout BasiliskII

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout SheepShaver


(fetch older file to reverse the 19-02-2009 sdl audio patch)

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout -D 2009-02-18 BasiliskII/src/SDL/audio_sdl.cpp


(fetch older files to reverse the 18-08-2009 precise timer patch)

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout -D 2009-08-16 BasiliskII/src/Unix/sysdeps.h

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout -D 2009-08-16 BasiliskII/src/Unix/timer_unix.cpp

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout -D 2009-08-16 SheepShaver/src/timer.cpp

cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout -D 2009-08-16 SheepShaver/src/Unix/sysdeps.h


(get sdl release 1.2.10)

mkdir SDL
cd SDL

svn checkout http://svn.libsdl.org/tags/SDL/release-1.2.10

(So far the needed files)


(building in Leopard against 10.4 SDK)

export MACOSX_DEPLOYMENT_TARGET=10.4
export CPPFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk"
export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"


cd release-1.2.10
./autogen.sh
./configure --disable-shared --prefix=`pwd`
make
make install

PATH=`pwd`/bin:$PATH
export PATH

cd ../../SheepShaver
make links

cd src/Unix
./autogen.sh --disable-vosf --enable-sdl-static --enable-sdl-audio --enable-sdl-video

make
make SheepShaver_app
I built on PPC and Intel separately and merged the two executables using the lipo command:

Code: Select all

lipo -create SheepShaver-intel SheepShaver-ppc -output SheepShaver

(check the merged file)

file SheepShaver
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

Ronald P. Regensburg wrote:To be able to compare a build with your patch and my 25-10-2009 build, could you try to create a build in the same way?

- With exclusion of the 19-02-2009 sdl audio patch that causes (or makes apparent) serious audio problems.
- With exclusion of the 18-08-2009 precise timer patch that causes (or makes apparent) a problem that causes freeze or crash at startup on many host machines/systems.
I've built a new version with these previous sources, available at the same location.
Ronald P. Regensburg wrote:- Using sdl 1.2.10 to enable the hardware cursor for smoother cursor movements and better overall performance.
Well, I'd rather use the most recent SDL 1.2.14, since it's the only one available for x86_64, but I don't link with the static one, so if you want to use a previous version of SDL, simply replace the folder SDL.Framework in SheepShaver.app/Contents/Frameworks with the one you want to use.
Ronald P. Regensburg wrote:I built on PPC and Intel separately and merged the two executables using the lipo command:

Code: Select all

lipo -create SheepShaver-intel SheepShaver-ppc -output SheepShaver

(check the merged file)

file SheepShaver
No need to build on different computers: I build the 3 architectures on my MacBook Pro. :wink:

Here's how I built this version:

Code: Select all

cd src/Unix

# SDL ppc 10.4
make distclean
NO_CONFIGURE=1 ./autogen.sh
FLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
CC=gcc-4.0 CXX=g++-4.0 CFLAGS="$FLAGS" CPPFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
./configure --enable-sdl-framework --enable-sdl-video --enable-sdl-audio --disable-vosf --without-gtk --without-mon
make SheepShaver_app
cp SheepShaver.app/Contents/MacOS/SheepShaver SheepShaver_ppc

# SDL i386 10.4
make clean
FLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
CC=gcc-4.0 CXX=g++-4.0 CFLAGS="$FLAGS" CPPFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
./configure --enable-sdl-framework --enable-sdl-video --enable-sdl-audio --disable-vosf --without-gtk --without-mon
make SheepShaver_app
cp SheepShaver.app/Contents/MacOS/SheepShaver SheepShaver_i386

# SDL x86_64
make clean
FLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
CFLAGS="$FLAGS" CPPFLAGS="$FLAGS" LDFLAGS="$FLAGS" \
./configure --enable-sdl-framework --enable-sdl-video --enable-sdl-audio --disable-vosf --without-gtk --without-mon --with-dgcc=g++-4.0
make SheepShaver_app
cp SheepShaver.app/Contents/MacOS/SheepShaver SheepShaver_x86_64

lipo SheepShaver_ppc SheepShaver_i386 SheepShaver_x86_64 -create -o SheepShaver.app/Contents/MacOS/SheepShaver
cp ../MacOSX/FatInfo.plist SheepShaver.app/Contents/Info.plist
mkdir -p SheepShaver.app/Contents/Frameworks
cp -R /Library/Frameworks/SDL.Framework SheepShaver.app/Contents/Frameworks/SDL.Framework
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:
Ronald P. Regensburg wrote:To be able to compare a build with your patch and my 25-10-2009 build, could you try to create a build in the same way?

- With exclusion of the 19-02-2009 sdl audio patch that causes (or makes apparent) serious audio problems.
- With exclusion of the 18-08-2009 precise timer patch that causes (or makes apparent) a problem that causes freeze or crash at startup on many host machines/systems.
I've built a new version with these previous sources, available at the same location.
The result is exactly the the same. In short: Unusable for practical purposes on my Core 2 Duo iMac with Leopard 10.5.8.

BTW: Who added the "Virtual Machine" menu with "Power off" item? Must have been done recently, it is not in the 25-10-2009 build. It apparently does what Control-Escape does also.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:a few of my patches - actually stuck awaiting for a moderator in the basilisk-devel@lists.sourceforge.net because they are bigger than 40 kbytes
Your messages have been sent to the list, also the first one with the 47.2KB attachment. I received both messages on October 27.
They are also in the list archive: http://sourceforge.net/mailarchive/foru ... lisk-devel
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

Ronald P. Regensburg wrote:
chombier wrote:a few of my patches - actually stuck awaiting for a moderator in the basilisk-devel@lists.sourceforge.net because they are bigger than 40 kbytes
Your messages have been sent to the list, also the first one with the 47.2KB attachment. I received both messages on October 27.
They are also in the list archive: http://sourceforge.net/mailarchive/foru ... lisk-devel
Not sure why I didn't receive them.

Anyway, I've built SDL 1.2.10 to check the 'hardware cursor' difference.
First problem: it won't build on Snow Leopard. It looks like the /Developer/SDKs/MacOSX10.5.sdk folder content is different from Leopard's Developer Tools…
So I had to build this version on a PowerPC Mac running Leopard.
Then I replaced the link command for the PPC version to use this static library instead of the SDL framework.
First launch on a PPC Mac: Freeze after the welcome screen, as many ppc users with your latest version.

Let's think about the differences: there's only one: the application is linked against SDL 1.2.10 instead of 1.2.14.

So I tried something else: activate the 'hardware cursor' with SDL 1.2.14, and guess what: it seems to behave correctly.
A new build is available at the same location.
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

Ronald P. Regensburg wrote:BTW: Who added the "Virtual Machine" menu with "Power off" item? Must have been done recently, it is not in the 25-10-2009 build. It apparently does what Control-Escape does also.
I added it, it might be helpful when the VM is stuck to leave it properly instead of force-quitting it, because the application allocates shared memory that is never released when you force quit it.
[edit]
I also modified the way the clipboard is exhanged between the host and the mac, as the old functions are no not available for the x86_64 architectures.
I couldn't really test it because I don't have a Localized MacOS other than US or French, but maybe the copy/paste of text between hosts now works for Japanese or such systems. It's only available in Snow Leopard in 64 bit for now.
[/edit]
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

chombier wrote:So I tried something else: activate the 'hardware cursor' with SDL 1.2.14, and guess what: it seems to behave correctly.
A new build is available at the same location.
Did you test this thoroughly? With SDL 1.2.11, 1.2.12 and 1.2.13 the hardware cursor approach does not work properly, but the problems would not be immediately obvious in casual testing. (Unfortunately, at this point I do not recall how to reproduce them.)

BTW, it is my understanding that SheepShaver doesn't work at all with an unpatched SDL 1.2.14. Are your SDL source patches available somewhere?
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

kelvin31415 wrote:Did you test this thoroughly?
I must confess I didn't. But no crash so far.
kelvin31415 wrote:BTW, it is my understanding that SheepShaver doesn't work at all with an unpatched SDL 1.2.14. Are your SDL source patches available somewhere?
The only change I made to SDL is explained here, and only fixes a memory leak:
http://bugzilla.libsdl.org/show_bug.cgi?id=870

To make SheepShaver work with this version of SDL, I added one more Screen_blit_func_info to the Screen_blitters table in video_blit.cpp to deal with the new BGRA pixel format used:

Code: Select all

    { 32, 0xff00, 0xff0000, 0xff000000, Blit_Copy_Raw   , Blit_Copy_Raw     }	// OK
kelvin31415
Tinkerer
Posts: 83
Joined: Sat Apr 12, 2008 8:22 pm

Post by kelvin31415 »

chombier wrote:
kelvin31415 wrote:Did you test this thoroughly?
I must confess I didn't. But no crash so far.
The problems I observed were not crashes; just that the cursor was not always changing when it should. (I seem to vaguely recall that this had something to do with movement around the bottom of the SheepShaver window, but don't hold me to that.)

Thanks for your SDL patches. Have you looked at SDL 1.3 at all?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:First launch on a PPC Mac: Freeze after the welcome screen, as many ppc users with your latest version.
That was with the 18-10-2009 build, not anymore with the 25-10-2009 build.
So I tried something else: activate the 'hardware cursor' with SDL 1.2.14, and guess what: it seems to behave correctly.
A new build is available at the same location.
That build does indeed use the hardware cursor correctly. But otherwise this build behaves just as badly on my Intel Mac with 10.5.8 as your previous builds: Crash at launch unless "Ignore Illegal Memory Accesses" is checked, display terribly slow to such an extend that it is unusable, and hardly recognizable crackling sounds.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:
Ronald P. Regensburg wrote:BTW: Who added the "Virtual Machine" menu with "Power off" item? Must have been done recently, it is not in the 25-10-2009 build. It apparently does what Control-Escape does also.
I added it, it might be helpful when the VM is stuck to leave it properly instead of force-quitting it, because the application allocates shared memory that is never released when you force quit it.
I am not sure it is a good idea. Users may use it when they shouldn't, risking file system problems on their MacOS volumes. Until now, the way to quit when SheepShaver got stuck (for instance when no startup disk can be found), was not to force-quit, but to press Control-Escape.
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

Ronald P. Regensburg wrote:That build does indeed use the hardware cursor correctly. But otherwise this build behaves just as badly on my Intel Mac with 10.5.8 as your previous builds: Crash at launch unless "Ignore Illegal Memory Accesses" is checked, display terribly slow to such an extend that it is unusable, and hardly recognizable crackling sounds.
The slowness is caused by the SDL switch from QuickDraw to Quartz, and it's the only way to go for 64 bit...
I have no crash here on 10.4/10.5 ppc and 10.5/10.6 intel using my last build with "ignore illegal memory access" unchecked. What does the console says about the crash ?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:The slowness is caused by the SDL switch from QuickDraw to Quartz, and it's the only way to go for 64 bit...
Can the patch be applied such that QuickDraw is still used in 32bit mode? I noticed that you created a new build this morning that does suffer from this slowness. What did you change?

I do not use Snow Leopard yet, so I cannot check this, but SheepShaver without your patch seems to run fine in 10.6. What are the advantages for SheepShaver to run in 64bit mode?
I have no crash here on 10.4/10.5 ppc and 10.5/10.6 intel using my last build with "ignore illegal memory access" unchecked. What does the console says about the crash ?
The crash does not happen on my PowerBook G5 Leopard, it does happen with both yesterday's and today's build on my Core 2 Duo iMac Leopard:

Code: Select all

05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] SIGSEGV 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]   pc 0x376e7653 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]   ea 0x65193d59 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  r0 00000000   r1 2dae69c2   r2 00000000   r3 15d0c4de 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  r4 ffffd5cb   r5 ffffea00   r6 3f9114b7   r7 00000000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  r8 4f487963   r9 4082000c  r10 35d0d000  r11 00000108 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] r12 35b90530  r13 00000000  r14 2dae6a1e  r15 00000001 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] r16 4f487963  r17 35d16ec0  r18 65193d59  r19 15d0c3f6 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] r20 2dae6a9e  r21 15c056f6  r22 2daf1400  r23 00000000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] r24 15d0c4e2  r25 00000000  r26 00000004  r27 00006d18 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] r28 15c41804  r29 35e90090  r30 35f60000  r31 68fff000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  f0 0.00000   f1 0.00000   f2 0.00000   f3 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  f4 0.00000   f5 0.00000   f6 0.00000   f7 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  f8 0.00000   f9 0.00000  f10 0.00000  f11 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] f12 0.00000  f13 0.00000  f14 0.00000  f15 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] f16 0.00000  f17 0.00000  f18 0.00000  f19 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] f20 0.00000  f21 0.00000  f22 0.00000  f23 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] f24 0.00000  f25 0.00000  f26 0.00000  f27 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] f28 0.00000  f29 0.00000  f30 0.00000  f31 0.00000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  lr 35e90090  ctr 00000000   cr 40001c08  xer 00000004 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329]  pc 35e90090 fpscr 00000000 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] abort, pc: 0x35eb68c0, lr: 0x35eb68c0 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] SheepShaver V2.3 by Christian Bauer and Mar"c" Hellwig 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] Reading ROM file... 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] Using SDL/coreaudio audio output 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] Detected CPU features: MMX SSE SSE2 SSE3 SSSE3 
05-11-09 15:54:16 [0x0-0x43043].SheepShaver[329] PowerPC CPU emulator by Gwenole Beauchesne 
chombier
Space Cadet
Posts: 9
Joined: Sun Oct 25, 2009 9:04 am

Post by chombier »

Ronald P. Regensburg wrote: Can the patch be applied such that QuickDraw is still used in 32bit mode?
Yes, as long as SDL 1.2.10 that uses QuickDraw still runs in MacOSX, you can statically link the 32-bit version against it instead of 1.2.14.
Ronald P. Regensburg wrote: I noticed that you created a new build this morning that does suffer from this slowness. What did you change?
I forgot to disable the vosf option in the previous builds.
But this one crashes immediately on ppc. I still don't understand why, since the crash reports an illegal access to an address in ROM that should be allowed (ROMBase + 0x10000 exactly), and unfortunately, gdb doesn't like SheepShaver's way to play with the stack and the POSIX signals...
I do not use Snow Leopard yet, so I cannot check this, but SheepShaver without your patch seems to run fine in 10.6. What are the advantages for SheepShaver to run in 64bit mode?
Actually, close to none. The jit translated code might be a little faster.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

chombier wrote:
Ronald P. Regensburg wrote: I noticed that you created a new build this morning that does suffer from this slowness. What did you change?
I forgot to disable the vosf option in the previous builds.
Oops! :oops:
I meant to write: "I noticed that you created a new build this morning that does not suffer from this slowness."
But this one crashes immediately on ppc.
And here it does not crash on PPC-Leopard but it does crash on Intel-Leopard.

There may be a different issue that is not related to your patch. Also my 25-10-2009 build appears to crash on some machines and checking "Ignore Illegal Memory Accesses" solves that.
Gary
Student Driver
Posts: 11
Joined: Tue Oct 27, 2009 2:19 am
Location: Kansas

Post by Gary »

Testing at home, the application noted above crashes immediately on the emac (1.25GHz G4 PPC, running 10.5.8), which only helps verify that it doesn't run on PPC as stated in the thread.

Hmm, yeah, "space cadet". Posted in wrong place but it's still relevant I guess. More important was that it networks on my intel iMac at work. Any more progress on this?
Post Reply