cebix / macemu

Basilisk II and SheepShaver Macintosh emulators
1.38k stars 288 forks source link

Enable SDL2 for Linux and Mac OS X #202

Closed rickyzhang82 closed 4 years ago

rickyzhang82 commented 4 years ago

I tested it the following configuration:

All build without error and boot up fine with Mac OS 7.5

rickyzhang82 commented 4 years ago

Added CI to test both SDL1 and SDL2 in Linux

I haven't added Mac OS X CI because I'm not familiar with homebrew. I used macport in Mac OS X. Travis CI support homebrew out-of-the-box.

If anyone knows the BII dependencies of hombrew, please let me know. I'd like to add Mac OS X to CI, as well.

rickyzhang82 commented 4 years ago

@asvitkine Any reasons why it is not accepted? I'm working on a PR that make System 6 run again.

asvitkine commented 4 years ago

I haven't had a chance to look at it yet. Will try to get to it tomorrow.

On Sat., Jun. 27, 2020, 11:50 a.m. Ricky Zhang, notifications@github.com wrote:

@asvitkine https://github.com/asvitkine Any reasons why it is not accepted? I'm working on a PR that make System 6 run again.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cebix/macemu/pull/202#issuecomment-650577685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAEJ4E5TWRICXQCXJH6KJDRYYINLANCNFSM4OIWPSRQ .

rickyzhang82 commented 4 years ago

The PR only address the build method from Linux and Mac OS X. It doesn't address XCode build or Windows build.

I compiled in Mac OS X through autoconf like the way I did in Linux.

To compile SDL1, use the configure:

./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler --with-x --with-gtk --with-mon

To compile SDL2, use the configure:

./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler --with-x --with-gtk --with-mon --with-sdl2

The build status is passed from Travis. See this link

rickyzhang82 commented 4 years ago

Since you don't have permission to point Travis CI to this repo -- https://github.com/cebix/macemu/, I have to redirect the Travis build status to my upstream-master branch in my forked repo. I have to keep https://github.com/cebix/macemu/ branch in sync with upstream-master branch in my repo. This is a workaround.

Once you accept the PR, it will show the build status properly from my upstream-master branch.

rickyzhang82 commented 4 years ago

SDL2 autoconf build in Mac OS X uses Apple metal backend, while in Linux SDL2 uses OpengGL.

I don't see any problem in my Linux SDl2. But in my iMac, I have random issue: 8 of 10 times, BII hangs during start up.

I opened an issue in kanijtalk755 repo: https://github.com/kanjitalk755/macemu/issues/43

It seems that there is a bug in SDL2 in video control ROM patch. I'm still looking into it.

But the most important thing is that we should bring back people to the upstream repo rather than scatter the new feature everywhere. Given enough time and eyeballs, we can fix it.

The new SDL2 is parallel to the original SDL1 back end. Therefore, it didn't break any old platform or old configuration.

rickyzhang82 commented 4 years ago

I figured out what caused the hang. But this is a bug from long long time ago. It is not from me. I opened an issue in https://github.com/cebix/macemu/issues/203 to address it.

Using memory banks addressing can workaround it.

rickyzhang82 commented 4 years ago

@asvitkine Any road block from my side to accept the PR?

asvitkine commented 3 years ago

I was looking at the state of the BasiliskII Xcode project and looks it no longer builds due to changes in this PR. For example, a bunch of missing files are referenced.

But also, it's now set to use SDL2 which I believe doesn't work on 10.6. But it's an Xcode 3.2 project (i.e. for 10.6)!

I'm thinking of just reverting the changes to the Xcode project to how it was before (SDL1) to get it back to a working state. Unless you have different suggestions?

rickyzhang82 commented 3 years ago

@asvitkine

I don't recommend revert the support of SDL2. Since macOS Mojave 10.14 discontinue support of OpenGL, I can't run Basilisk II with SDL 1.2 after 10.14. SDL2 is my only way to get hardware acceleration with Metal works in Mac. If you revert SDL2 PR, it would break MacOS X build after 10.14.

For older Mac OS like 10.4 PPC, I stil could build BII with Makefile. So if you could not build with XCode, try Makefile approach. You may have to get build stack from MacPort first.

It is hard to keep XCode build up-to-date with the change of different version of XCode and Mac O.S X. I'd recommend keeping it up with Makefile build approach. Try Makefile approach in 10.6.

BTW, could you enable Travis build and add build status in README. We could have some basic build coverage test for different platform and arch (see https://travis-ci.org/github/rickyzhang82/macemu)