Raspberry Pi4, BasiliskII performance - must use X!

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
ujimaflip
Space Cadet
Posts: 7
Joined: Wed Apr 28, 2021 11:44 pm

Raspberry Pi4, BasiliskII performance - must use X!

Post by ujimaflip »

Hi All,
I'm new to the forum, but been using the emulators for years. I'm sure there are a few out there with similar setups to me: A series of Raspberry Pis, all running various iterations of retro games, including our favourites from the that time when the mac was a serious gaming machine (Maybe it will happen again with the M1s - I guess we will see).
Back to the reason for the post: I was very disappointed with the performance of BasiliskII on the pi4 (compared to the pi3). It took me some time to work it out, but essentially the graphics drivers are only optimised to function when running X. After a lot of playing with various settings, I have managed to achieve a satisfactory setup by creating custom .xinitrc for each env (BasiliskII, SheepShaver).
I typical xinit script looks something like this - save the file in something like startbasilisk in your home dir

Code: Select all

#!/bin/sh
xrandr --output HDMI-1 --mode 800x600 --panning 800x600 --transform 1.33333333,0,-125,0,1,0,0,0,1
exec sudo -E /home/pi/macemu/BasiliskII/src/Unix/BasiliskII
Probably not the best idea to run from the build directory - but I was also trying out lots of build config settings, so was useful for me to configure this way.
The first line sets the X resolution to 800x600, and transforms the image adding borders left and right to stop the image being stretched across the screen (maybe you prefer stretched - it which case you can omit this, or simply set the resolution - something like xrandr -s 800x600. sudo is only required for sheep_net. We could change the ownership of the sheep_net.. but that still requires sudo in the script, so I'm not sure how much we save.
My script to launch:

Code: Select all

sudo modprobe sheep_net
startx /home/pi/startbasilisk
This script can simply be dropped into RetroPie roms/ports if you use RetroPie.
User avatar
adespoton
Forum All-Star
Posts: 3350
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Raspberry Pi4, BasiliskII performance - must use X!

Post by adespoton »

Thanks for the details!

When you weren't using X, what were you using? SDL1.2, SDL2, or direct framebuffer? These will likely all have different results.

Here's the specs for RPi3 and RPi4:

RPi3:
SoC: Broadcom BCM2837
CPU: 4× ARM Cortex-A53, 1.2GHz
GPU: Broadcom VideoCore IV

RPi4:
SoC: Broadcom BCM2711B0
CPU: quad-core A72 (ARMv8-A) 64-bit @ 1.5GHz
GPU: Broadcom VideoCore VI

They both have 64-bit quad core ARM chips that adhere to ARMv8-A. So the big difference is likely the GPU. Possibly SDL 1.2 doesn't handle the instruction set for VideoCore VI, so is stepping back to generic instructions that run slower?

I'd be interested to see if you could get the SDL2 version running, as that should have VideoCore VI support.
ujimaflip
Space Cadet
Posts: 7
Joined: Wed Apr 28, 2021 11:44 pm

Re: Raspberry Pi4, BasiliskII performance - must use X!

Post by ujimaflip »

Hi both the pi3 and pi4 are built with sdl2. There is quite some debate online regarding the OpenGL drivers for the pi4. More energy has gone into X support. Running without X on the pi4 results in poor stuttering performance. If launched via X the performance is a lot better.

As an update to the above, I’ve changed monitors. This new one automatically swaps to 4:3 so I no longer have to pass and xrandr transforms (just the resolution).
Post Reply