Switch to full style
About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.
Post a reply

Running Basilisk II on Linux without Xorg

Tue May 07, 2013 4:54 pm

I'm trying to get Basilisk running on a Raspberry Pi, and so far I've been partially successful! It runs just fine from within Xorg, but i'd like to be able to run it directly from the command line, as seen in this video:

Basilisk II on the Raspberry Pi

When I try to run it from the command line without starting X first, I get an error saying:

Code:
(BasiliskII:2430): Gtk-WARNING **: cannot open display:


Anyone have any reccomendations on what I can try to get this working? I know it can work, because the video shows Basilisk II being launched from the command line, but I can't figure it out. Running through X is very slow on the underpowered Raspberry Pi.

Re: Running Basilisk II on Linux without Xorg

Tue May 07, 2013 6:55 pm

Hi,

Did you follow his instructions on how to build your own version of Basilisk on the PI?:

# apt-get install git libsdl1.2-dev
# git clone github.com/cebix/macemu
# cd macemu/BasiliskII/src/Unix
# NO_CONFIGURE=1 ./autogen.sh
# ./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler
# make install

Best,
Cat_7

Re: Running Basilisk II on Linux without Xorg

Tue May 07, 2013 7:03 pm

I did, and they got me as far as being able to launch the app in X11. He actually skipped a step in those instructions, you need to run ./autogen.sh before you can run ./configure. I still can't run from the command line though. On a computer like the RaspberryPi, X11 uses a huge portion of its resources, and makes Basilisk less than useful.

I've emailed the maker of the video and he's gotten back to me with a couple of good suggestions. It looks like it might be unable to use SDL for some reason and is defaulting to X instead. I'll post back here if I figure it out.

Re: Running Basilisk II on Linux without Xorg

Wed Jun 11, 2014 1:44 am

I have been successful in compiling and running Basilisk II on my Raspberry. However, I cannot run it at any other screen resolution than 512x384. If I try to run at any other resolution, the system boots but the display gives me a slow horizontal roll left to right. (remember when TV's had a vertical and horizontal roll adjustment?, just like that...) The bigger the screen the slower the roll. Larger screens also introduce a slow upward vertical roll as well.

Running 30 Hz refresh. Quadra 900, 68040, System 7.5.3

Any ideas? I do have software that won't run at 512x384.

I've been running the pre-compiled Basilisk II and SheepShaver for years on my Intel Mac with no problems. Can set screen resolution at will. Generally use 1024x768.

[added info]

All above using hdmi cable direct to monitor...

Have found that when viewing the Raspberry via Apple's Screen Sharing, even running at 512x384 causes a slow vertical roll. Sounds like it is more than just a compile or preferences issue.

[more info]

I have found that the following MAX refresh rates are working for me without scroll issues using hdmi direct to a monitor.

512 x 384 60Hz
640 x 480 10 Hz
800 x 600 10 Hz
1024 x 768 5 Hz

Re: Running Basilisk II on Linux without Xorg

Sun Jun 15, 2014 8:15 am

Honestly it looked as though he edited the X11 startup files to start up Basilisk II instead of a display manager, when startx is run. That's what I thought when I saw that one second at the start of the video.

*EDIT* Sorry for not actually contributing to the post. And it seems I misread a bit; Xorg IS being used here. I'm not exactly experienced with Linux distros, although I use them, but I'll see if I can help. Give me some time to research too.

Re: Running Basilisk II on Linux without Xorg

Sun Jun 15, 2014 8:17 am

Cat_7 wrote:Hi,

Did you follow his instructions on how to build your own version of Basilisk on the PI?:

# apt-get install git libsdl1.2-dev
# git clone github.com/cebix/macemu
# cd macemu/BasiliskII/src/Unix
# NO_CONFIGURE=1 ./autogen.sh
# ./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler
# make install

Best,
Cat_7


I believe he also mentioned "--without-gtk". Are you sure that's not important?

Re: Running Basilisk II on Linux without Xorg

Sat May 14, 2016 10:15 pm

Sorry for digging up an old topic. But I've succeeded to successfully compile BasiliskII on my Pi 1B and to run the game Prince of Persia 2 - The Shadow and the Falme full screen on it. Not without X, but I think that the "bloat" of X is not that bad...

Here's how I did it. If anyone's interested I could be somewhat more elaborate. Notice that the procedure mentioned earlier in this post and on https://vimeo.com/62033644 leave us w/ a Basilisk version that can not run in 8 bit color (= 256 color) mode. Prince of Persia 2 - The Shadow and the Flame demands 256 colors, no less and no more.

I use a Raspberry Pi 1B. I run a Raspbian version based on Debian 8 "Jessie". Also note that I replaced libgtk2-dev with libgtk2.0-dev and "github.com/cebix/macemu" with "https://github.com/cebix/macemu.git" and that I did NOT use SDL video (I DID use SDL audio!) but a framebuffer option.
Code:
apt-get install git libsdl1.2-dev autoconf libgtk2[b].0[/b]-dev libxxf86dga-dev libxxf86vm-dev libesd0-dev
git clone https://github.com/cebix/macemu.git
cd macemu/BasiliskII/src/Unix
./configure --disable-vosf --disable-jit-compiler --without-gtk --enable-sdl-audio --enable-fbdev-dga
make
sudo make install


My '/home/pi/.basilisk_ii_prefs' file is like below. Notice that I set BesiliskII to use 'ignoresegv true' else Prince2 crashes the emulator. If you wish a higher resolution then alter the line "screen win/512/384" to 640x480 or what you'd like. You also have to set the proper Model ID etc. etc. See the BasiliskII readme from it's website.
Code:
#disk /home/pi/mac/DiskTools_MacOS8.image
#disk /home/pi/mac/150MB_Pi
disk /home/pi/mac/200MB
#disk /home/pi/mac/Stuff-it_(no_install_needed).dsk

#rom /home/pi/mac/Quadra900.rom
rom /home/pi/mac/QUAD650.ROM

screen win/512/384
#screen dga/640/480
#screen dga/512/384
fbdevicefile /usr/local/share/BasiliskII/fbdevices
#screen dga/cgsix

ignoresegv true

extfs /home/pi/mac/

frameskip 0

seriala /dev/ttyS0
serialb /dev/ttyS1
udptunnel false
udpport 6066
bootdrive 0
bootdriver 0
#ramsize 8388608
ramsize 32000000

modelid 14
cpu 4
fpu false
nocdrom true
nosound false
noclipconversion false
nogui false
jit false
jitfpu false
jitdebug false
jitcachesize 0
jitlazyflush false
jitinline false
keyboardtype 5
keycodes false
mousewheelmode 1
mousewheellines 3
dsp /dev/dsp
mixer /dev/mixer
ignoresegv false
idlewait true


If you want to play Prince2 fulll screen (which is 512x384) you'll have to start your Pi in 512x384 pixels faramebuffer (or whatever it's called). Edit your /boot/config.txt like so:
Code:
framebuffer_width=512
framebuffer_height=384


Now startx (actually: LXDE) and run "BasiliskII" from a terminal. Make it full screen with Alt + F11. The hard part is obtaining a Mackintosh hard drive image that works for you. See the l.a.r.g.e Emaculation about that here. Or download the "Total Pack" for Windows from the Prince of Persia fan site. That has the proper ROM and hard disk image to play Prince2 (and some other games).

Then you might have to set your wide screen 16:9 TV to old fashioned 4:3, else the aspect ratio is wrong.

P.S. I did manage to run BasiliskII without X. Compile it with the option "--enable-sdl-video" instead of "--enable-fbdev-dga". Start your Pi in "CEA mode" (which is meant for TV's, the other mode, DMT, is meant for computer monitors) by setting in your /boot/config.txt:
Code:
hdmi_group=1
hdmi_mode=1



Good luck w/ Apple gaming! :)

Re: Running Basilisk II on Linux without Xorg

Fri Aug 12, 2016 3:39 am

I don't get it. How can you resolve the 256 color problem? I have lemmings but it requires 256 color. I tried set screen win/800/600/8. It doesn't work.

Re: Running Basilisk II on Linux without Xorg

Fri Aug 12, 2016 4:23 am

...and has anyone attempted building against Wayland instead of Xorg yet? This would get away from X, although not by using direct framebuffers or ncurses etc. I thought that you still needed SDL 1.2 to build BII on Linux, which means you need an SDL 1 target architecture.

Re: Running Basilisk II on Linux without Xorg

Fri Aug 12, 2016 12:25 pm

rickyzhang wrote:I don't get it. How can you resolve the 256 color problem? I have lemmings but it requires 256 color. I tried set screen win/800/600/8. It doesn't work.

You have to compile BasiliskII from source code. The executable that comes w/ Linux (Debian) has SDL video enabled. I disabled that en enabled Frame Buffer. So the line that configures BII to be compiled fron source code becomes (see my post from 15 May 2016, 00:15):
Code:
./configure --disable-vosf --disable-jit-compiler --without-gtk --enable-sdl-audio --enable-fbdev-dga

If you're not familiar w/ compiling applications from source code then all this might look intimidating. But in my opinion it's worth the trouble alone for Prince2.

Good luck! :)

Re: Running Basilisk II on Linux without Xorg

Fri Aug 12, 2016 10:55 pm

rickyzhang wrote:I don't get it. How can you resolve the 256 color problem? I have lemmings but it requires 256 color. I tried set screen win/800/600/8. It doesn't work.
Just to be clear: even after you get the Basilisk II settings correct, it is frequently necessary to go to the "Monitors & Sound" control panel within Mac OS, after you start Basilisk II, and select 256 colors. Some programs may not otherwise recognize that you are in fact running in 256 colors.

Re: Running Basilisk II on Linux without Xorg

Sat Aug 13, 2016 10:53 am

After much trial and error, for those getting the slow horizontal scroll out of the sdl framebuffer with Basilisk. The issue appears to be somekind of semaphore/mutex issue that affects single core setups.

Inside your .basilisk_ii_prefs file change

frameskip 0

to

frameskip 2

try and see. You may have to go slightly higher than 2 but 2 was the lowest that worked for me to get a solid screen.

on multicore pi this does not seem to be an issue.

Have fun!

Re: Running Basilisk II on Linux without Xorg

Sun Aug 21, 2016 4:09 pm

MeneerJansen wrote:
rickyzhang wrote:I don't get it. How can you resolve the 256 color problem? I have lemmings but it requires 256 color. I tried set screen win/800/600/8. It doesn't work.

You have to compile BasiliskII from source code. The executable that comes w/ Linux (Debian) has SDL video enabled. I disabled that en enabled Frame Buffer. So the line that configures BII to be compiled fron source code becomes (see my post from 15 May 2016, 00:15):
Code:
./configure --disable-vosf --disable-jit-compiler --without-gtk --enable-sdl-audio --enable-fbdev-dga

If you're not familiar w/ compiling applications from source code then all this might look intimidating. But in my opinion it's worth the trouble alone for Prince2.

Good luck! :)


I used sdl video to resolve 8bit color problem. My pull request has been merged to macemu upstream repo (https://github.com/cebix/macemu/commit/ ... 22730ab3af)

In your ~/.basilisk_ii_prefs, manually add
displaycolordepth [bit of color depth]
,eg
Code:
 displaycolordepth 8

2^8 = 256.

I have confirmed that it works for any customized window and full screen 256 color in X86-64 Linux, Intel and PPC Mac

Re: Running Basilisk II on Linux without Xorg

Sun Aug 21, 2016 8:15 pm

rickyzhang wrote:
MeneerJansen wrote:
rickyzhang wrote:I don't get it. How can you resolve the 256 color problem? I have lemmings but it requires 256 color. I tried set screen win/800/600/8. It doesn't work.

You have to compile BasiliskII from source code. The executable that comes w/ Linux (Debian) has SDL video enabled. I disabled that en enabled Frame Buffer. So the line that configures BII to be compiled fron source code becomes (see my post from 15 May 2016, 00:15):
Code:
./configure --disable-vosf --disable-jit-compiler --without-gtk --enable-sdl-audio --enable-fbdev-dga

If you're not familiar w/ compiling applications from source code then all this might look intimidating. But in my opinion it's worth the trouble alone for Prince2.

Good luck! :)


I used sdl video to resolve 8bit color problem. My pull request has been merged to macemu upstream repo (https://github.com/cebix/macemu/commit/ ... 22730ab3af)

In your ~/.basilisk_ii_prefs, manually add
displaycolordepth [bit of color depth]
,eg
Code:
 displaycolordepth 8

2^8 = 256.

I have confirmed that it works for any customized window and full screen 256 color in X86-64 Linux, Intel and PPC Mac

There is this topic about Prince Of Persia 2 and BasiliskII: viewtopic.php?f=6&t=8940&start=25

I don't remember if I recompiled BII to run PoP2 on my "big" Linux computer too. But on my Raspberry Pi BII wouldn't run in 8 bit mode when compiled w/ SDL. Is the 'displaycolordepth' a new option that BII accepts through its config file?

Re: Running Basilisk II on Linux without Xorg

Mon Aug 22, 2016 12:37 am

I just added it last week.

Re: Running Basilisk II on Linux without Xorg

Mon Aug 22, 2016 3:30 am

Is there any reason you do not add it on the screen line, as it used to be and as still works on some older Win compiles IIRC, like:

screen win/1024/768/8

Re: Running Basilisk II on Linux without Xorg

Mon Aug 22, 2016 9:43 am

If you use SDL, no matter what host OS Windows/Mac/Linux, it always enumerate all available color depth and pick the highest one. There is no way to override it. Because it didn't parse the fourth parameter (ie [1]/[2/[3]/[4]) in the source.

I have carefully review the monitor code in SDL part.

Re: Running Basilisk II on Linux without Xorg

Wed Aug 24, 2016 8:39 am

rickyzhang wrote:I just added it last week.

Are you the maintainer of the source code then?

Re: Running Basilisk II on Linux without Xorg

Wed Aug 24, 2016 8:50 am

No. It is my pull request. I believe Christian Bauer have handed over pull request merge to others.

It is pity that someone has fixed 64bit issues for slirp. But he just stopped in the middle. Kids nowadays doesn't have too much passion or patient.

The BII dev mailing list and github repo is QUITE. I want to migrate new QEMU Tiny Code Generator to BII so that it can be free from compiler constraint in JIT. But I don't see/hear anyone's response.

Re: Running Basilisk II on Linux without Xorg

Wed Aug 24, 2016 9:48 am

rickyzhang wrote:No. It is my pull request. I believe Christian Bauer have handed over pull request merge to others.

It is pity that someone has fixed 64bit issues for slirp. But he just stopped in the middle. Kids nowadays doesn't have too much passion or patient.

The BII dev mailing list and github repo is QUITE. I want to migrate new QEMU Tiny Code Generator to BII so that it can be free from compiler constraint in JIT. But I don't see/hear anyone's response.

Unfortunately I am no programmer so I do not completely understand everything you're wrote. But am I correct in thinking that the option to set BII to 8 bit color in the settings file is not (yet) accepted by BII? At least for the SDL version?

Re: Running Basilisk II on Linux without Xorg

Wed Aug 24, 2016 11:27 am

rickyzhang wrote:No. It is my pull request. I believe Christian Bauer have handed over pull request merge to others.

Indeed, there is no main developer for BasiliskII and SheepShaver anymore since 2006. The source code is guarded by "asvitkine", who also handles pull requests.

You pull request regarding customized color depth in SDL was merged 9 days ago.

Re: Running Basilisk II on Linux without Xorg

Mon Jan 27, 2020 6:36 am

Thanks for this, I encountered a few errors installing onto a newly imaged card using Buster lite. Here is what worked, restricted to getting Basilisk ready:

sudo apt install automake git libsdl2-dev
git clone https://github.com/cebix.macemu
NO_CONFIGURE=1 ./autogen.sh
./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler
sudo make install
BasisliskII (I prefer to let it make a prefs file for me to edit)
sudo nano /basilisk_ii_prefs

I've spent many hours trying to get this far, many other sites just didn't work but this did! And for those who aren't reading clearly, I repeat that I do not include the steps to get a fresh OS ready (network, updates, etc), nor do I include a Mac ROM, OS or disk

Re: Running Basilisk II on Linux without Xorg

Mon Jan 27, 2020 12:06 pm

Glad you succeeded.

I suppose that, while composing your post, you forgot the line: cd macemu/BasiliskII/src/Unix

And for creating the prefs file you omitted the dot before the .basilisk_ii_prefs file name.

Re: Running Basilisk II on Linux without Xorg

Tue Jan 28, 2020 12:14 am

Oops! An ADD glitch from trying to do too much at once, sorry. Thanks for pointing it out.

I did go a step further and replicated the install onto a Pi with GUI, proving that it works. In addition, it has three advantages, at least for me:
1. You can actually see the warning (and other) messages,
2. If it goes belly up, you can shut it down with <ALT-F4> rather than unplugging the Pi,
3. You have a GUI for easy copying of files, etc; e.g. I use the same OS file on my PC and laptop.

Now to do things like put it online...
Post a reply