Emulating PoP1 Mac under GNU/Linux

Discuss other PoP1 related things here.
Post Reply
mYse|f
Efendi
Efendi
Posts: 6
Joined: April 10th, 2016, 5:40 pm

Emulating PoP1 Mac under GNU/Linux

Post by mYse|f »

I'm trying to make the Macintosh version of Prince of Persia 1 work under GNU/Linux with Basilisk II (Version 1.0). I've downloaded the PoP Macintosh Total Pack from popuw.com and tried to run it under Wine (1.8.2), but the emulator's window is not redrawing itself (I have to constantly move the cursor above it to see what's happening). Newer versions doesn't have this issue, but then I get the following message when I try to run the game: (screenshot)
Prince of Persia only runs in Black and White, 4 color mode, 16 color mode or 256 color mode.
Since newer versions of Basilisk II are lacking the option to change the color depth, I can only try to change it inside Mac OS, which gives another error: (screenshot)
This computer does not support Monitors & Sound. Use the Monitors control panel and the Sound control panel on this computer.
I've tried different versions/builds of Basilisk II (both natively and with Wine), and also SheepShaver, but this is as close as I'm able to get to fix this. Since the most recent build seems to be provided by Fedora (Basilisk II 1.0 20160322), I would like to use that to make the game work.

Any idea how to solve this?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

Start a new, 8-bit display server:
$ vncserver :1 -depth 8
Then connect to it:
$ vncviewer :1
mYse|f
Efendi
Efendi
Posts: 6
Joined: April 10th, 2016, 5:40 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by mYse|f »

After figuring out which packages to install on my distribution (vnc4server & xvnc4viewer), I received the following message when running the second command:

Code: Select all

 main:        unable to connect to host: Connection refused (111)
Do I have to execute vncviewer with root privileges or reboot my computer?
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

mYse|f wrote:Connection refused
I've never seen that.
You should just be able to run it as a regular user (non-root); all it should ask for is your (regular system) password.

You know what is weird...
I actually started writing a manual for this...
Spoiler: show
Running Prince of Persia 1 for Mac on GNU/Linux
May 6, 2016

Contents

...

Preamble

This document explains how to run the Mac version of Prince of Persia 1 on GNU/Linux. In the rest of this document, the words "Mac" and "Macintosh" will not be used, because Macintosh is a series of PCs. We will use "System 7", Mac OS 7, which is an operating system used on some of these PCs. To run Prince of Persia 1, we will emulate System 7.

License

Copyright © 2016 Prince of Persia modding community

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front­Cover Texts, and no Back­Cover Texts.

What We Will Not Do

We will not use Wine, because we don't need to. We will not work with compressed files, because using StuffIt or BinHex is too much of a hassle. We will not install System 7, because it takes too much time, disk space, and several installation disks or a CD. We will not change the first (main) display to 8-bit (set the Depth in /etc/X11/xorg.conf to 8, then restart X). We will not use startx to create a second display (sudo startx -- :1 -depth 8) and we will not use Xnest to create a nested server (sudo Xnest -depth 8 :1), nor will we start the emulator from the first display (BasiliskII --display :1). We will not manually download a prebuilt binary of the emulator, because it may be too old and cause audio problems (even with pulseaudio-esound-compat or padsp). We will not compile the source code, because this takes too much time.

Prerequisites

First, download and install the following packages and files.

- Basilisk II, the emulator.
Simply run: $ sudo apt-get install basilisk2
https://packages.debian.org/search?keyw ... ection=all
http://packages.ubuntu.com/search?keywo ... ection=all

- A System 7 boot disk.
Use a search engine to search for: "System 7 boot disk"
Sample download locations:
http://www.emaculation.com/System70_boot.zip
https://web.archive.org/web/20000304021 ... 0_boot.zip

- A ROM file.
Use a search engine to search for: PERFORMA.ROM
Sample download locations:
http://www.redundantrobot.com/macemulator/1mbMacrom.zip
https://github.com/macmade/Macintosh-RO ... M?raw=true

- A VNC client and server.
Simply run: $ sudo apt-get install xvnc4viewer vnc4server
This will give you the programs "vncviewer" and "vncserver".

- HFS (Hierarchical File System) files.
Prince of Persia 1: http://www.popot.org/get_the_games.php?game=1_Mac
Optional:
PoPMap: http://www.popot.org/level_editors.php?editor=PoPMap
The Persia Cheater: http://www.popot.org/other_useful_tools.php?tool=TPC
Prince of Persia Editor: http://www.popot.org/other_useful_tools ... ol=sav_hof

Putting Everything Together

Prince of Persia 1 only runs in black and white, 4 color mode, 16 color mode and 256 color mode. We'll use 256 color mode, which means we need an 8-bit display. However, since the 8-bit display makes it more difficult to tinker with the emulator, we will first set up Basilisk II.

Run: $ BasiliskII
If you ever want to stop it, use the menu option: Special -> Shut Down

On the Volumes tab, use the "Add..." button to add:
- System70_boot.dsk
- pop1_12.hfs
- pop1_22.hfs
Optional:
- PoPE_10.hfs
- PoPMap_10b5.hfs
- TPC_10.hfs

On the Memory/Misc tab, use the "Browse..." button to add:
- PERFORMA.ROM

Next, we use VNC to get an 8-bit display.
Run: $ vncserver :1 -depth 8
If you ever want to stop it, use: $ vncserver -kill :1
Connect to the display.
Run: $ vncviewer :1

Inside the viewer, run BasiliskII, then click the "Start" button.
..and I swear that this worked just fine.
But now suddenly the in-game colors are wrong.
I have no idea what changed.

I've been trying to get it to work again, with things like this:
$ vncserver :1 -pixelformat bgr233
$ vncviewer -LowColourLevel 2 :1
But all I get now are Basilisk II crashes, or more/different incorrect colors.
mYse|f
Efendi
Efendi
Posts: 6
Joined: April 10th, 2016, 5:40 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by mYse|f »

Looking at the log file revealed the following error

Code: Select all

Fatal server error:
could not open default font 'fixed'
so I searched for a fix, and installing xfonts-base solved the problem. Now I'm getting a similar issue like you (ugly colors and weird fonts). One step at a time…
Norbert wrote:You know what is weird...
I actually started writing a manual for this...
That's not weird at all. The need to run an emulator through VNC, that's weird.
mYse|f
Efendi
Efendi
Posts: 6
Joined: April 10th, 2016, 5:40 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by mYse|f »

Anyway, once I get the emulator running, the game runs with correct colors, even with the sound working properly. The frame rate is not optimal though (actually worse than what I get when running the old Basilisk II build 142 through Wine), and the game plays a bit slow (similar to the one in this video). I guess I have to try some other methods to make the game run smoothly. I'm wondering why there's no option in Basilisk II V1.0 to make the emulated system think it's running in 256 color mode. It worked before (well, sort of) so why this isn't still implemented?

Also, I think you should mention in your documentation how to terminate the running VNC session:

Code: Select all

vncserver -kill :1
[/s] Edit: I overlooked that you've already done so.
Attachments
pop1mac-vnc2.png
pop1mac-vnc1.png
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

This may be interesting:
https://github.com/cebix/macemu/pull/92

[Edit: I've just tested it. It works like a charm!]
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

I put together a document with detailed instructions:
2016-09-23_PoP_for_Mac_on_Linux.pdf
(ODT source)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

Norbert wrote: September 23rd, 2016, 8:18 pm I put together a document with detailed instructions:
2016-09-23_PoP_for_Mac_on_Linux.pdf
(ODT source)
My document says "If audio is not working, try: [...]", after instructing the reader to obtain System70_boot.dsk, which doesn't even support audio (source). I'm in the process of improving the document...
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: Emulating PoP1 Mac under GNU/Linux

Post by Norbert »

Norbert wrote: December 9th, 2022, 4:01 pm
Norbert wrote: September 23rd, 2016, 8:18 pm I put together a document with detailed instructions:
2016-09-23_PoP_for_Mac_on_Linux.pdf
(ODT source)
My document says "If audio is not working, try: [...]", after instructing the reader to obtain System70_boot.dsk, which doesn't even support audio (source). I'm in the process of improving the document...
Here is the new version:
2022-12-10_PoP_for_Mac_on_Linux.pdf
(ODT source)
Post Reply