Monday 30 July 2012

Squirrel's Guide to Macintosh Emulation


(last updated: 30/07/2012)

Following my troubles emulating Dark Castle for black and white Macintoshes, I felt it was worth writing a guide. Put simply, Macintosh emulation is dreadful from a user perspective, so any help to solve that issue is time worth spent.

This is intended primarily for Windows users, though no doubt there'll be some tips for other platforms too. I'm not an amazing source for knowledge when it comes to Macs, but I solved a problem and want to share results.

So, you've embarked on a questionable life choice - remember that black and white Macintosh game you played in the late 80s? You want to play it now! Except... finding an 80s Apple Macintosh in working order is a hard task, and should you succeed, there's no guarantee the software will work. Running these things on the original hardware is satisfying, but impractical. We need an alternative solution.

You could go browsing the The Gryphel Project, which may be able to point you in a rough direction. There are other guides too, but I found that most of them were pretty poor at getting their points across. The work you actually have to do far exceeds what most of them hint at, and the fact you need to use a guide at all deters people from spending time emulating the classic Macintosh family, which is sad.

So here's a better attempt at steering people onto the right track. There are many types of Macintosh (venture to Wikipedia for greater detail on the operating system's history), but today I am simply planning to look at a typical black-and-white Macintosh game from the mid-to-late 80s. It was an interesting set of machines - high resolution graphics, graphical user interface-driven and an entirely unique set of games and software in its library. So successful was the Macintosh, that it still exists to this day, albeit in a very different form.

So different is the situation that we're forced to emulate older systems in order to play older games. And unfortunately, nobody in the classic Macintosh community thought to engineer a nice solution to the problems we're going to encounter today. Classic Macintosh emulation is a mess - ironically, the easy and intuitive interfaces and technologies which define a Mac, are almost non-existent in Mac emulators. It's a joke, but we have to take it seriously. I apologise in advance.

What you should need


To play a classic Macintosh game on a modern PC the following is needed as a minimum:

- Mini vMac (a.k.a. an emulator)
- a BIOS ROM so Mini vMac will work
- a compatible operating system
- a disk containing a game

But the classic Macintosh community, which I will continue to criticise as long as this guide is still relevant, have employed various methods to make your life more difficult. Nobody will tell you this, but in reality... you may need a great deal more than what I've just listed. To put it lightly, Macintosh emulation is a challenge. There is plenty of room for improvement, but in order to improve, awareness of the problems has to be raised.


But in order to fully understand what we're dealing with, let us observe what sort of Macintosh we are emulating. Spoilers: it's not a real one.


Why that's a lot of floppy disk drives! Macintosh emulation is all about disks. There's nothing "concrete" like you'd have with a modern hard drive - everything is done through through removable and interchangeable disks. Everything. And as a result, you'll read the word "disk" quite often.

Every operating system is distributed on its own disk - a "startup disk". These are disks you need to give the emulator upon startup - they essentially just load an interface. They also give the illusion of a hard drive on the desktop called "System Tools" or "Starter Disk", but ignore those - we're not using a real Mac and there are no real hard drives (observe my reluctance to call it a "hard disk drive").

Instead we're better off creating a "fake" hard drive. The emulated Macintoshes will recognise it as a floppy disk, but they don't need to conform to the rules of floppy disks. My floppy disk will be able to cope with hundreds of megabytes, and won't have any significant loading times at all. You can download blank disks of varying sizes here - these things compress exceptionally well, but when taken out of their ZIPs, a 244MB disk is seen as a 244MB size file. Emulators don't care how big a disk is, so getting one which is capable of housing tons of data means we'll never need another one. That keeps things simple.

You're going to be using this fake hard drive often, possibly across multiple emulators, so get used to it. When we encounter other software and load it into emulators, they will be treated as separate, smaller disks - the best idea is to copy this stuff onto your fake hard drive so we don't have to juggle floppies at a later date. It's also worth noting that software can be booted off anything.

Operating systems and game disks will vary, more on that later.

What you will actually need


Two Emulators

Yes, you'll need two. No, in a perfect world you shouldn't need two.


Mini vMac


This is the best Macintosh emulator in terms of design. Dragging and dropping files onto the vMac window simulates the process of inserting a floppy disk into a real Macintosh. As you will note from my doctored image above, there is an infinite amount of floppy disk drives - you can drag as many as you like onto the screen and they can be any size at all.

Mini vMac is, however, limited. It only emulates black and white Macintoshes, which means it will only cover System 1, 2, 3, 4, 5, 6 and a limited version of 7. vMac boasts user-friendliness and better sound, and in Dark Castle's case, will be the emulator of choice.


Basilisk II


Basilisk II is the backup emulator. If an awkward file confuses vMac, we have to bring in Basilisk II to sort things out. Basilisk II has a wide variety of problems - it emulates more systems (System 1 to OS 9) though often struggles in the audio department and most importantly, isn't half as user-friendly.

Most notably, those behind the later iterations of Basilisk II are sadly quite clueless, forcing it to rely on outdated versions of GTK in a failed attempt at being an open source freebie Richard Stallman unshaven G-thing. Basilisk II's real creators dropped off the face of the earth a while ago, so all updates between 2008 and the present have been bugfixes for issues you are unlikely to encounter. Take a risk, use an older version.

Basilisk II also doubles up as the "supreme" emulator. If you let it, it'll link up to real floppy disk drives and real printers and real internet connections, turning your system into an actual classic Macintosh should you desire one. But that's a different story and not games-related.


(you don't need to care for the third big Mac emulator, SheepShaver - this is geared towards PowerPC Macintoshes (Mac OS 7, 8 and 9) and though might be a decent alternative to Basilisk, I've not tested it personally since I didn't need to use it)


vMac Extensions

These are features which should be built into vMac but aren't. God knows why.


ImportFL


vMac will only recognise disks in DSK and IMG format (and potentially others of that nature). So though you can drag and drop as many files as you like, if they're not one of these types the OS will want to reformat (a.k.a. destroy) the contents of the file.

ImportFL is a program that when running, will let you drag and drop anything onto the emulated Mac system. This is extremely useful - downloaded files are rarely in DSK or IMG format.


ExportFL


ExportFL is the opposite of ImportFL - this will let you move files from the emulated machine onto the host one. ExportFL is only necessary in certain situations (if you have a DSK or IMG file on the emulated machine for example) but it's a wise idea to have a copy anyway.


Operating Systems

Apple are kind enough to offer older versions of Mac OS for free. This is good. Unfortunately you will need to use several versions of Mac OS - the operating system was changed more frequently than Windows, and compatibility can break with each new iteration (you see this with Windows too - Windows 7 can't run a lot of Windows 95 programs without help).

Theoretically you don't need a copy of System 1, 2, 3, 4 or 5. You'll need a copy of System 6 (Dark Castle doesn't run on anything later), and crucially, a copy of System 7.5.5. If you want to dive into colour games at a later date, you might want OS 8 or 9, but you won't be using vMac at all in those circumstances.

System 7.5.5 is extremely useful, because it behaves differently depending on the emulator. This particular brand of OS is compatible with older both black and white Macintoshes and the colour ones, and will adapt to the computer it is running on. It will run under vMac, allowing you to take advantage of ImportFL and ExportFL, but also Basilisk II, in which many other useful features will become accessible.

What's important to note is that your fake hard drive will work with all operating systems. So you're only changing the OS and emulator.


...Decompression Tools

Right. This is where things get complicated.

Put simply, there isn't a huge demand to emulate the Mac computers of old - those who wanted it were usually long-time Mac supporters, trained in the ways of Apple. It is still very much geared towards Mac OS X users today, which is tedious if you're a fan of Windows (or Linux).

Starting with System 7 and amplified with Mac OS 8 and 9, Mac users were given access to the internet. During this period, files were uploaded online, except the process pre-dates global standards. Things were done "the Mac way", not in a way useful to the rest of us. It is understandable for those living in the 1990s, but because nobody has bothered to convert to global standards, there are vast collections of classic Mac software that are almost unusable in the 2010s by anyone not running a classic Mac. This is a problem.

We are going to have a lot of problems with file types. Let me stress this - all of these issues would be avoidable if the classic Macitosh community got its act together. Every format we will encounter will be depreciated and painful to work with, but there is no alternative at present.

Without going into much detail - we want DSK or IMG files, as these are what the emulators will understand. Anyone reasonably fluent in the ways of the internet will note that sometimes downloads are compressed in ZIPs, RARs or 7Zs to save space, and all are widely supported formats and easy to deal with. In the Mac community, we get other formats that aren't as widely supported, because it took the Mac longer to adopt the above as "standards".

Macintosh DSK files are often compressed in SIT files. And for SIT files, we need the wonders of StuffIt Expander. StuffIt is used to tackle the practically pointless BinHex (.hqx) format, and its bizarre range of proprietary formats (.sit, .sitx and .sea) Sometimes you get combinations of both (.sea.hqx is fairly common) but StuffIt can handle it... sort of.

Trust me when I say StuffIt Expander is the single most confusing and horrible part of classic Macintosh emulation. On the plus side, StuffIt Expander is still frequently updated and is available for free. On the down side, you need two versions of the thing and neither can be "current".

You see, the team behind StuffIt Expander like to change things. Most notably, all of their proprietary formats completely changed in version 5.0 - extension names are identical, contents are not, and there is no easy way of knowing which version of StuffIt was used to compress the .sit file in question. Also, even though StuffIt is still maintained today, newer expanders will not recognise the formats of the 90s. The regressive nature of StuffIt means that most of the world has moved away from it, but again, not the classic Mac fans.

We'll get into this later, but essentially you need two versions of StuffIt Expander (a.k.a. Aladdin Expander) - 4.0.1, and 5.5. The former will tackle "old" archives, the latter "new" ones.


Finalised List

- Mini vMac
- vMac BIOS
- Basilisk II (2008 version)
- Basilisk II BIOS
- SDL.dll... possibly
- System 6.0.x
- System 7.5.5
- A big floppy disk to serve as a fake hard drive
- StuffIt Expander 4.0.1
- StuffIt Expander 5.5
- ImportFL
- ExportFL
- A Game

...console emulation is easier.

What you might need


HFVExplorer for Windows, though it very much depends on what you'd be using this for. HFVExplorer will help you with MacBinaries (.bin files which claim to work with Macs), but is really the tool for turning things into DSK format. Chances are, you won't need to use this. It's certainly not "required" like many claim.

Setting up this garbage


Right lets set up these emulators.

vMac is easy. You just hook it up to a BIOS and boom:


Drag your OS of choice onto the window and it should load.


System 7.5.5, everybody. I won't patronise you with the Mac GUI - it's extremely simple to use and inspired everything you use today. You close windows on the left.

Drag a disk onto the window and it'll show up on the desktop and open. Ctrl key combinations perform special functions. Easy.


Basilisk II is similar, the major difference being that Basilisk II doesn't have the drag-and-drop interface, which means you have to load things in advance. This is not a great emulator - it's outdated and awkward to use, but it gets the job done.

Basilisk II needs SDL.dll, which should have been included in the download but often isn't for unknown reasons. SDL.dll is easy to find because loads of people use the SDL libraries when producing multi-platform software.

Remember not to use a super-new version of this emulator otherwise you'll have to provide it with GTK. This is pointless and unnecessary.


BasiliskIIGUI sets up everything. Two features of this menu will likely have to change:


Basilisk II assumes you're using ten year old graphics cards. These sorts of settings are better for modern machines. The low resolution is for the purposes of this article - Macs traditionally love their big resolutions, and you can impress your friends with a 1991-spec machine running at 1600x1280.


Unlike vMac, you have to set up all your disks in advance, including the OS. Top line on the left should be the OS, second line your fake hard drive, and any other disks come after that. Then hit run and hopefully, boom:


Also System 7.5.5. But now... in colour! I should also point out the "General" tab lets you switch between different Macintosh models. Some models won't run some operating systems. You need to experiment - I'm using a Quadra 900 here which was the default. You'll also have to set up your BIOS ROM in the memory tab.

This is tedious, but not difficult. The difficulty is turning downloaded files into something useful.

Turning downloaded files into something useful



Here's something I downloaded, time to turn it into something useful. It's Centipede for Mac, stored as a SIT file. In Windows, I can do nothing with this - it has to be decompressed on a classic Mac.


I have to use ImportFL on vMac to get this file on my fake hard drive. I still can't do anything with it, but it's in a much better spot. Now, as you can see, I have my two StuffIt expanders ready - I don't know what sort of SIT file this is, so time to experiment. Let's see if StuffIt 4.0.1 can cope.


It can't - the SIT file doesn't show up. In reality, StuffIt 4.0.1. can rarely cope with downloaded SIT files - it's only in very rare circumstances where it can (which is why you need it). StuffIt 5.5 will not boot in vMac, so to continue this experiment - it's off to Basilisk II.


Right, here we are again in Basilisk. StuffIt 5.5 time.


Hurray, we can expand. Now of course, I don't know what the results of this expansion will be. There might not be anything in this archive at all.


The results. This is interesting - a Mac executable. This could have been anything - it could have been a folder, or a DSK file, or a picture of John Lennon, we couldn't possibly know. These sorts of executables mean nothing to Windows, which is probably why it was stored in a Mac-only format. That's no excuse for the SIT file though - this game should have been stored in DSK or IMG format, but wasn't.

Boot it under Basilisk in its current setting and we get nothing. Let's go back to vMac and see if we get something different.


I've been running System 7.5.5 for both vMac and Basilisk so far. You wouldn't think two emulators using the same operating system would vary so much, but subtle differences can have a big impact.


We're not having much luck here. In both vMac and Basilisk, this is as far as Centipede will go in System 7.5.5. My first reaction was that it was an issue with visuals - Centipede is a black and white game, and perhaps the colour was breaking things, but that's not the case. However, vMac is producing sound where Basilisk is not - there's life, but we can't see it.


In these situations, it's best to downgrade. Now I've hooked up vMac with System 6. Again, the disk I'm using for the fake hard drive is compatible with all classic Mac OSes - only the OS startup disk need change.


And under System 6, the game boots up fine. With Basilisk it won't produce sound, in vMac, it will. This is why you need multiple operating systems and emulators. Also this is a fine unofficial version of Centipede, but not as good as the arcade original.

But let's just think about this for a second. A game that requires System 6 or lower to run... requires System 7.5.5 or higher to expand. You needed two emulators to get this game working (with sound). What stupidity.


Here's something else to note. This is the Mac version of Frogger. The SIT file was the one I downloaded - 195kB. The DSK file is what was lying inside - 400kB (so it's been compressed by about 51%). That ZIP is something I made in Windows and is 192kB, roughly 3kB smaller than the SIT version. It's not much, but it's enough to devalue the SIT format entirely. ZIP is already a comparatively weak compression method - SIT must be useless.


If you wanted to be totally hardcore about compression, go with RAR or 7Z, also frequently used on the internet. Look at the savings!

DSK | 400kB | "0%"
SIT | 195kB | "51.25%"
ZIP | 192kB | "52%"
RAR | 177kB | "55.74%"
7Z  | 161kB | "59.75%"

But you know, file compression is a topic in itself. I'm not here to compare TARs with CABs - it's just to highlight the stupidity of using a niche compression format.

Look at all those pointless steps I had to go through just to beat the compression. It's ridiculous. Now fair enough, there may be Basilisk alternatives to ImportFL and ExportFL to make this job a bit simpler, but with a lack of good audio emulation, a good chunk of your game will be missing without using vMac.

Can we do this without a classic Mac?


Not easily. There may be outdated solutions to deal with the decompression, but the results can be inconclusive and can risk damaging the contents of the archive as Windows will ignore some Mac-only stuff. Most importantly, the majority of converters are twenty year old command line programs for DOS - you'd have to get DOSBox involved, and the process ends up being slower and error prone. That Centipede executable would have likely died.

There is a version of StuffIt for DOS (UNSTUFF) which decompresses the old-style SIT format, but the new style is trickier to solve under Windows. You also have hurdles with HQX - you might have to get BinHex for DOS involved, and the workload is generally higher than on a classic Mac... as hard as it is to believe.

Oh and yes, there are brand spanking new versions of StuffIt Expander you can download today. Don't do that. For one, they're not compatible with SIT files at all (it's SITX these days!), and most importantly for me, you have to install them. It's bloated, useless tat, and if you're not careful, the uninstall process can kill your .zip file compatibility completely. You might have more success with the Windows StuffIts of the past, but you already have to use two Windows programs, which in my mind is more than enough. These people don't deserve your traffic.


Downloads


Here's one I made earlier.

A copy of vMac, configured working copy of Basilisk II (with SDL), Systems 6 and 7 and a 32MB disk (you might want to transfer to a bigger one post-download) with expanders and importers/exporters, all yours for free. You can find these things separately, but unlike the classic Macintosh community, I like keeping things simple.

IT DOES NOT CONTAIN BIOS ROMS. You'll have to find vMAC.ROM for vMac, and Macintosh ROMs such as PERFOMA.ROM for Basilisk II. So you'll have to track those down.

It is worth noting that you'll be forced to play with Basilisk if you want it to run more high-end Macintosh games. So might have to reconfigure this thing anyway.


I don't proclaim to be some amazing Mac god. In fact, up until a month ago, I had never even touched Macintosh emulation. There will be more efficient ways of getting things to work properly, but nobody seems keen to discuss them. Ideally I don't want this guide to serve any purpose at all - the fact I felt the need to write one suggests that the situation is rather dire, and it is.

The issue here is not so much the juggling of emulators and compatibility woes. It's the deeper problems - the classic Mac community's reliance on SIT, SEA and HQX formats, even in the modern age. The entire game library needs sifting through and sorting out, standardising and made accessible to the modern user. Many sites distribute games in DSK format and to those people, thank you - you are helping the world. But most do not, and it's a horrible state of affairs for the end user. Certainly, Steve Jobs would never have approved!

I hope this helps someone. It certainly would have helped me a couple of days ago.

2 comments:

  1. Thanks Dude. You saved me tons of time. Great job. Thanks again!

    ReplyDelete
  2. I feel like I should mention the reason for StuffIt. It's because classic Mac files have "resource forks" with every single file. These are not part of the file's actual data but are copied along with it, and contain things like the icon and the type and creator codes that tell the Mac what program to open things with. If you used some PC archiver to expand these files (like StuffIt for Windows 98) you would lose that resource information.

    This is also why Mac OS X programs tended to be distributed as disk image files up until the Mac App Store.

    ReplyDelete