My fork of Basilisk II
Moderators: Cat_7, Ronald P. Regensburg
My fork of Basilisk II
https://github.com/uyjulian/macemu
Check out the "core_cleanup" branch.
I personally want to do the following:
1. remove all support code for other platforms for BasiliskII except macOS/SDL (already done)
2. convert BasiliskII build system to CMake, like Hatari and Previous are doing (already done)
3. Backport CPU from old BasiliskII (this will reduce the amount of differences when porting a new CPU core) (already done)
4. Port JIT from ARAnyM (partially done; currently hangs.)
5. Modularize the Toolbox traps, so that it's easy for anybody to accelerate Toolbox functions with just a trap number and a function definition.
I'll clean up and send #4 and #5 in a PR after those are finished. #1, #2, and #3 are just to get familiar with the source code.
Also, check out my Basilisk II FLTK GUI. viewtopic.php?f=6&t=9467
These are "far off" ideas:
Port Dolphin JIT to SheepShaver
AOT compiler with LLVM
UAE emulation when 68k code is executed in Sheepshaver
Boot from folder in shared directory instead of disk image
Toolbox windows managed by WindowServer/Wayland/X compositor
Check out the "core_cleanup" branch.
I personally want to do the following:
1. remove all support code for other platforms for BasiliskII except macOS/SDL (already done)
2. convert BasiliskII build system to CMake, like Hatari and Previous are doing (already done)
3. Backport CPU from old BasiliskII (this will reduce the amount of differences when porting a new CPU core) (already done)
4. Port JIT from ARAnyM (partially done; currently hangs.)
5. Modularize the Toolbox traps, so that it's easy for anybody to accelerate Toolbox functions with just a trap number and a function definition.
I'll clean up and send #4 and #5 in a PR after those are finished. #1, #2, and #3 are just to get familiar with the source code.
Also, check out my Basilisk II FLTK GUI. viewtopic.php?f=6&t=9467
These are "far off" ideas:
Port Dolphin JIT to SheepShaver
AOT compiler with LLVM
UAE emulation when 68k code is executed in Sheepshaver
Boot from folder in shared directory instead of disk image
Toolbox windows managed by WindowServer/Wayland/X compositor
- adespoton
- Forum All-Star
- Posts: 4274
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: My fork of Basilisk II
Thanks, Julia! That's a lot of progress already!
Re: My fork of Basilisk II
Okay, I decided to put latest BasiliskII uae_core back in, but I used the ARAnyM JIT compiler.
ARM JIT still needs some work to be done.
Oh, and as a bonus, JIT compiler works again on the latest macOS and compilers! pagezero_size was changed to 0x2000; JIT compilers don't work on 64-bit macOS if pagezero_size isn't set properly. Also, the CPUID function was replaced with the one from ARAnyM, which allows the CPUID check to work again.
Also, if you are attempting to compile it yourself, you can just use CMake. Be sure you set CMAKE_BUILD_TYPE to Release to optimize the executable. Also, LTO will just result in an abort trap for some reason.
Also, the "sleep when idle"/"idlewait" functions will result in the Toolbox hanging since no events are processed randomly. Be sure to turn it off/uncheck the option.
Also, if it hangs while you are trying to launch, just do and try again. It takes a few tries.
Here's a benchmark from the 1 March 2014 build for reference:
Initial try with 8192 Translation Cache Size:
Now, processor speed is slow... but look at the disk scores!
Second try with 16384 Translation Cache Size:
The processor speed comes back... but disk scores are lower than even the 1 March 2014 build...
I'm going to mess with it more next week.
ARM JIT still needs some work to be done.
Oh, and as a bonus, JIT compiler works again on the latest macOS and compilers! pagezero_size was changed to 0x2000; JIT compilers don't work on 64-bit macOS if pagezero_size isn't set properly. Also, the CPUID function was replaced with the one from ARAnyM, which allows the CPUID check to work again.
Also, if you are attempting to compile it yourself, you can just use CMake. Be sure you set CMAKE_BUILD_TYPE to Release to optimize the executable. Also, LTO will just result in an abort trap for some reason.
Also, the "sleep when idle"/"idlewait" functions will result in the Toolbox hanging since no events are processed randomly. Be sure to turn it off/uncheck the option.
Also, if it hangs while you are trying to launch, just do
Code: Select all
killall -KILL BasiliskII
Here's a benchmark from the 1 March 2014 build for reference:
Initial try with 8192 Translation Cache Size:
Now, processor speed is slow... but look at the disk scores!
Second try with 16384 Translation Cache Size:
The processor speed comes back... but disk scores are lower than even the 1 March 2014 build...
I'm going to mess with it more next week.
Re: My fork of Basilisk II
Temporary test build 2018-06-06, including fltkbasiliskgui: https://transfer.sh/jg3ZQ/BasiliskII-test1.zip
Source code repository has also been updated. Disable "idlewait" or "Don't use CPU when idle" or events, such as mouse click/keyboard type will stop working randomly.
If my build hangs immediately while you are trying to run it, kill it with then try running it again. It takes a few tries.
Now for some benchmarks:
Source code repository has also been updated. Disable "idlewait" or "Don't use CPU when idle" or events, such as mouse click/keyboard type will stop working randomly.
If my build hangs immediately while you are trying to run it, kill it with
Code: Select all
killall -KILL BasiliskII
Now for some benchmarks:
- rickyzhang
- Apple Corer
- Posts: 205
- Joined: Mon Sep 15, 2014 7:59 pm
Re: My fork of Basilisk II
Boy, I missed you thread completely! Great work!
So far there are some compatible issues that is hard to figure it out why in emulator. That's why I improved the run time debugger last year. Because it crashed in some application. It is a real show stopper to me.
Glad that you make some serious coding work. Please keep us posted!
Why? You want to pissed off Power PC Mac and Linux folks?1. remove all support code for other platforms for BasiliskII except macOS/SDL (already done)
2. convert BasiliskII build system to CMake, like Hatari and Previous are doing (already done)
Why are you doing this? Can you give me more technical background on this?3. Backport CPU from old BasiliskII (this will reduce the amount of differences when porting a new CPU core) (already done)
Very interesting project. What is your motivation? Can you point to me more details so that I can take a quick look?4. Port JIT from ARAnyM (partially done; currently hangs.)
Nice work. But what toolbox function is a deal breaker in emulated OS that need acceleration? TBH, in my dated Intel i7 2600k box I have zero performance problem at all in all apps I'm running. Even I can't use JIT.5. Modularize the Toolbox traps, so that it's easy for anybody to accelerate Toolbox functions with just a trap number and a function definition.
So far there are some compatible issues that is hard to figure it out why in emulator. That's why I improved the run time debugger last year. Because it crashed in some application. It is a real show stopper to me.
Glad that you make some serious coding work. Please keep us posted!
There is an App for that!
https://github.com/rickyzhang82
https://github.com/rickyzhang82
Re: My fork of Basilisk II
I'm planning on also looking at support for E-UAE PowerPC JIT compiler.rickyzhang wrote:Boy, I missed you thread completely! Great work!
Why? You want to pissed off Power PC Mac and Linux folks?1. remove all support code for other platforms for BasiliskII except macOS/SDL (already done)
2. convert BasiliskII build system to CMake, like Hatari and Previous are doing (already done)
Most of the work on this point has been undone. It didn't work very well.rickyzhang wrote:Why are you doing this? Can you give me more technical background on this?3. Backport CPU from old BasiliskII (this will reduce the amount of differences when porting a new CPU core) (already done)
Make JIT work on 64-bit x86, ARM, and on newer compilers. Look here for source code -> https://github.com/uyjulian/macemu on core_cleanup branchrickyzhang wrote:Very interesting project. What is your motivation? Can you point to me more details so that I can take a quick look?4. Port JIT from ARAnyM (partially done; currently hangs.)
QuickDraw mainly. It would be nice to GPU-accelerate it. I also want to get rid of or work around nested EmulOp calls and JIT, since it causes problems with the "idlewait" function of BasiliskII.rickyzhang wrote:Nice work. But what toolbox function is a deal breaker in emulated OS that need acceleration? TBH, in my dated Intel i7 2600k box I have zero performance problem at all in all apps I'm running. Even I can't use JIT.5. Modularize the Toolbox traps, so that it's easy for anybody to accelerate Toolbox functions with just a trap number and a function definition.
rickyzhang wrote: So far there are some compatible issues that is hard to figure it out why in emulator. That's why I improved the run time debugger last year. Because it crashed in some application. It is a real show stopper to me.
Glad that you make some serious coding work. Please keep us posted!
- rickyzhang
- Apple Corer
- Posts: 205
- Joined: Mon Sep 15, 2014 7:59 pm
Re: My fork of Basilisk II
To accelerate quick draw, I think SDL 2 is an answer not the alternative emulator nor improve JIT.
The pixel from guest OS is written to frame buffer in host OS directly. It is host OS (thus SDL) determine how to plot in host OS screen. It doesn't seem to relate to JIT.
The pixel from guest OS is written to frame buffer in host OS directly. It is host OS (thus SDL) determine how to plot in host OS screen. It doesn't seem to relate to JIT.
There is an App for that!
https://github.com/rickyzhang82
https://github.com/rickyzhang82
Re: My fork of Basilisk II
Synchronized with latest ARAnyM compiler sources.
I'm still having the issue where the program may sometimes hang before showing the window, and a SIGKILL is needed to kill the program. It appears that ARAnyM is using fixed addressing with JIT instead of direct addressing, so maybe I'll try that.
I'm still having the issue where the program may sometimes hang before showing the window, and a SIGKILL is needed to kill the program. It appears that ARAnyM is using fixed addressing with JIT instead of direct addressing, so maybe I'll try that.
- adespoton
- Forum All-Star
- Posts: 4274
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: My fork of Basilisk II
This is looking really promising! Thanks for sharing
Maybe eventually we can merge your fork back into mainline BII....
Maybe eventually we can merge your fork back into mainline BII....
Re: My fork of Basilisk II
The rest of uae_cpu from ARAnyM was merged.
There's still the issue of the program sometimes hanging on startup, and I'm not sure where to start on debugging that issue.
There's still the issue of the program sometimes hanging on startup, and I'm not sure where to start on debugging that issue.
Re: My fork of Basilisk II
I synchronized changes with ARAnyM again.
There's still the following issues:
1. Program randomly hanging on startup
2. Program not working properly with idlewait option (no events except mouse movement events are delivered)
There's still the following issues:
1. Program randomly hanging on startup
2. Program not working properly with idlewait option (no events except mouse movement events are delivered)
Re: My fork of Basilisk II
Okay, it seems like the random hang on startup is caused by the SDL2 code. See https://github.com/cebix/macemu/issues/203
- rickyzhang
- Apple Corer
- Posts: 205
- Joined: Mon Sep 15, 2014 7:59 pm
Re: My fork of Basilisk II
If you compile with addressing mode in memory banks in configure, it should workaround the hangs.
I'm working on the permanent fix now.
Code: Select all
--enable-addressing=banks
There is an App for that!
https://github.com/rickyzhang82
https://github.com/rickyzhang82
- rickyzhang
- Apple Corer
- Posts: 205
- Joined: Mon Sep 15, 2014 7:59 pm
Re: My fork of Basilisk II
I proposed several solutions in the issue. I will go for the solution that use memory banks addressing.uyjulian wrote:Okay, it seems like the random hang on startup is caused by the SDL2 code. See https://github.com/cebix/macemu/issues/203
But I dont know the performance hit, compared to direct addressing. I downloaded MacBench 4.0 from macintoshrepository.com. But the app crashed in BII from System7.5.
where do you get your MacBench 4.0?
There is an App for that!
https://github.com/rickyzhang82
https://github.com/rickyzhang82
Re: My fork of Basilisk II
Macintosh Gardenrickyzhang wrote:I proposed several solutions in the issue. I will go for the solution that use memory banks addressing.uyjulian wrote:Okay, it seems like the random hang on startup is caused by the SDL2 code. See https://github.com/cebix/macemu/issues/203
But I dont know the performance hit, compared to direct addressing. I downloaded MacBench 4.0 from macintoshrepository.com. But the app crashed in BII from System7.5.
where do you get your MacBench 4.0?
- rickyzhang
- Apple Corer
- Posts: 205
- Joined: Mon Sep 15, 2014 7:59 pm
Re: My fork of Basilisk II
I benchmark two addressing: direct and memory banks. As I expected, the memory banks is a little bit slower than direct. But in general, there are no noticeable issues at all to run any Apps in BII under direct or memory banks.
But what makes the huge performance differences is the GCC compiler optimization flag:
- No optimization at all:
Code: Select all
-O0
- Optimization at level 3 and native code:
Code: Select all
-O3 -march=native
There is an App for that!
https://github.com/rickyzhang82
https://github.com/rickyzhang82
-
- Apple Corer
- Posts: 239
- Joined: Thu Nov 09, 2017 12:06 pm
Re: My fork of Basilisk II
The issue will be fixed with the following commit:uyjulian wrote:Okay, it seems like the random hang on startup is caused by the SDL2 code. See https://github.com/cebix/macemu/issues/203
https://github.com/kanjitalk755/macemu/ ... c82f828bac
Re: My fork of Basilisk II
Cool. I'll check it outkanjitalk755 wrote:The issue will be fixed with the following commit:uyjulian wrote:Okay, it seems like the random hang on startup is caused by the SDL2 code. See https://github.com/cebix/macemu/issues/203
https://github.com/kanjitalk755/macemu/ ... c82f828bac
- adespoton
- Forum All-Star
- Posts: 4274
- Joined: Fri Nov 27, 2009 5:11 am
- Location: Emaculation.com
- Contact:
Re: My fork of Basilisk II
While we're integrating, any chance of integrating Vasi's date offset patch from a few years back into BII/SS?
Re: My fork of Basilisk II
Updated with latest ARAnyM changes.
I still need to figure out why "idlewait" hangs randomly…
I still need to figure out why "idlewait" hangs randomly…
Re: My fork of Basilisk II
It seems like Hatari UAE core is more updated then ARAnyM's core. I'll see if I can integrate the changes...