Developers of the Atari ST Emulator NoSTalgia


nost02.jpg

Atari ST

What led you to create an Atari ST emulator for the Macintosh?

I have always missed some great games from my Atari: Elite, Bubble Bobble, Defender of the Crown, and some others. One day I saw PaCifiST, a great and maybe the first real ST emulator for MS-DOS. I wanted such software on my Mac, so I started to study the UAE (an Amiga emulator) source code because it also uses a 68000 CPU. Five days later, I started to write NoSTalgia, and one week later it was far enough along to display the GEM1 desktop. At some point, I demoed the emulator to a friend and he convinced me to compile a public version. A few days later, NoSTalgia 0.1 was released.

Can you describe the tools used to develop your emulators?

I have used Metrowerks’ CodeWarrior to write all versions of NoSTalgia and PowerST. CodeWarrior was fast and easy to use, albeit a tad expensive. I recently switched to Apple’s free developer tools for Mac OS X, ProjectBuilder. There is a lot of documentation about the ST hardware on the Internet, including the source code of some ST emulators. The developer of PaCifiST, F. Gidouin, greatly helped me, in addition to the ample documentation on the MFP ACIA (Circuits of the ST), and helped me to find some bugs.

nost03.gif

Atari GEM OS

What is most challenging in creating an emulator?

Writing the MFP (interrupts controller) code was not easy. This is because most programs and games running on the Atari ST intensively use the hardware. That’s why you have great programs but poor compatibility between all the Atari hardware.

NoSTalgia appears to be compatible with most Atari ST software. A few, however, don’t work or lack sound. What are the causes?

The sound part of NoSTalgia-MIDI and normal audio-was written by Francois Menu, and with his latest code, the sound is now working correctly. However, some software is incompatible with NoSTalgia because emulation on any level is very difficult. In addition, programs that used some type of “tricks” are very difficult to emulate. Of course, sometimes it’s just a bug, but more often than not it comes down to a limitation of the emulator. I should mention that some things are not emulated to keep performance at an acceptable level. Hopefully with the help of the users, I can debug and fix programs which have problems running correctly.

Can you describe your experiences in Carbonizing the emulator and challenges of working with Mac OS X?

It was really easy to port the NoSTalgia emulator to Mac OS X, taking only two days. That said, Mac OS X is a true multitasking OS and some portions of the emulator needed some adaptations (i.e. graphic interface, and speed control of the emulated CPU).

Do your emulators take advantage of technologies such as OpenAL or OpenGL?

No, I’m focusing on the compatibility with the Atari ST software first.

Many die-hard Atari and Amiga users refuse to let go of their platforms, and we even hear occasional attempts to introduce new machines. Do you think there is any market for new models?

Not really. I can’t see any application, software or hardware-wise, that a Macintosh or PC wouldn’t be able to handle. The Atari ST was a great machine, especially for having a built-in MIDI port, but its time has passed.

Is there any hardware which hasn’t been emulated that you would like to see available for the Mac?

Not really, as I am only interested in one platform, the Atari ST, and NoSTalgia handles all my cravings for classic computing. I do however sometimes use VirtualPC to run Steem and PaCifiST (both are Atari ST emulators) or a C64 emulator to play M.U.L.E..

On the Macintosh platform, the current king of emulation seems to be Richard Bannister. Have you tried his emulators or spoken with him?

Yes, Richard Bannister helped me a lot with the first version of NoSTalgia. In fact, some parts of the source code are from him. Remember, NoSTalgia was my first “public” application. He was a tremendous help with the design and performance.

nost04.gif

ProjectBuilder

Emulation has come a long way, and today’s emulator fan can even emulate computers and consoles that were recently placed into the marketplace, such as Nintendo and Sega consoles. Do you think the interest in emulation for older classic hardware is fading?

Not really. I have a lot of feedback from NoSTalgia users. They like the old games better than the new ones, even if they do have much better graphics and sound. I think these games are appealing to users because their concepts were easier to grasp and get right into. The game Elite is a great example.

What language are you using to develop your emulators?

NoSTalgia is written in C, with Assembly code for the monochrome screen drawing code. PowerST uses an Assembly CPU core; it’s three times faster but less compatible and not compatible with Mac OS X.

With the speed of today’s processors, it seems many programmers have ignored Assembly. What are your thoughts on this?

In the case of my Atari ST emulators, the screen rendering code uses most of the CPU time. The emulator’s performance is very dependent on the CPU, the system bus and video. For example, in NoSTalgia, I modified the screen drawing code to use only 32 bits access. The performance of the emulator almost doubled! I think that Assembly code is not easy to write for a CPU like a G3 or a G4. In addition, most modern compilers produce very good code.

Your emulators are distributed as shareware. As a somewhat “niche” product, how are sales going?

NoSTalgia is free, while PowerST is shareware. I’m not trying to get rich with these emulators. To be frank, it’s not really fun to see serial numbers of PowerST on the Internet after so much work. And so that is why work on PowerST was suspended.

What are some of your favorite games from the Atari ST era?

Elite!!, Bubble Bobble, Defender of the Crown, Captive, Colonial Conquest, and Dungeon Master.

Is there any feature from the Atari ST’s Operating System (TOS) that you would like to see implemented on Mac OS X?

Not really, but I like the fact that the TOS is only 192kB of ROM. Mac OS X consumes 1GB on my hard disk. Also, my Mac boots in a little over a minute while my Atari ST could boot in five seconds. But I suppose that is progress for you.

The Amiga and Atari ST featured great 2D graphic games, along with very nice sound, while being based on a 16-bit CPU. Looking at some 2D games for the Mac available today, they often seem to lack the speed, graphic wizardry and sound. What is your view on today’s 2D games compared to what was available for the Amiga and Atari ST?

I think most of today’s games are not optimized, and of course stay away from Assembly code for portability. Overall, I think most developers don’t do enough to really try to optimize their software (RAM and CPU usage).

There is a new Atari ST emulator from Germany called “MagiCMac.” Do you keep a close watch on your competitors?

Yes, of course. MagicMac is great but it’s for “serious apps.” What I mean by this is that MagicMac is not an emulator per say, it’s “Magic” (an Atari ST line OS) for the Macintosh. NoStalgia is a real plain Atari ST emulator—for games, MIDI, and other software.

The Atari ST, like the Commodore Amiga, was based on Motorola’s 680X0 processors. The Mac version of the Amiga emulator “UAE (Ubiquitous Amiga Emulator)” seems to be in limbo—have you ever considered working on an Amiga emulator?

Not really, although I do have the source code of UAE and I also helped to debug some CPU bugs in it. I’m not really qualified to work on an Amiga emulator since I don’t even know how operate a real Amiga!

Most emulator developers are careful in stating that they do not provide ROMs, and that users should only use ROMs that they legally2 own. However, it is pretty clear that the vast majority of emulation fans do not own the games and software they are using with their emulators. What is your view on this subject?

I don’t distribute ROMs or software since it’s illegal.

nost05.gif

Xenon 2”

Creating an emulator seems to be a complex undertaking. Why not develop shareware games for the Macintosh instead?

Because it’s a challenge for me, and I have written NoSTalgia to play my favorite games. As I said earlier, I’m not really trying to generate income, I’m more interested in re-living the games I so much enjoyed from the past that I owned.

At their height, the Amiga and Atari ST boasted much better hardware and software than IBM and Apple’s offerings. However, the world moved towards these platforms. Can you briefly give your view on what you believe went wrong?

Piracy played a big hand—who wants to write software that will be pirated the next day? Just look on the Internet today, you can find almost every Atari ST or Amiga program ever released. In addition, while initial Amigas and STs were groundbreaking, they didn’t move far beyond their initial designs, while in four short years the Mac moved from the 68000, to 68020/30 CPU. Same over in the PC camp.

The Amiga vs. Atari ST debate still carries on to this day. As an Atari ST user, can you state in one sentence why you feel the Atari ST was a better machine?

I don’t know if the Atari ST was a better machine. Both the Atari ST and the Amiga were two really great computers with a lot of nice software. I think I’ll side-step your question as I don’t want to enter into the “Atari ST vs. Amiga” war.

If someone wants to dive into emulation programming, where should they start?

Since I don’t have a long track record as an emulation developer, as well as concentrating on one platform, I can only comment on the path I took: I downloaded the UAE source code, since the Atari and the Amiga use the same CPU, and tried to first understand how it worked. Then I modified the code to run the TOS software. Later, I moved towards adding lower-level support for Atari ST hardware, such as screen, shifter, MFP, and so on.

nost06.gif

Pang”

Interview with Francois

Hi Francois, could you please introduce yourself and your history with Atari and Mac? Do you currently own any Macs?

My very first computer was a Commodore CBM 4016, an “all-in-one” computer which had a 40 column character green monochrome display, a 1MHz 8-bit 6502 processor and 16kB of RAM! Although the machine lacked graphic possibilities, it featured a nice built-in BASIC, as many machines in the eighties did. This computer led me into programming. Around 1985 it was time for a new computer and I really wanted a Macintosh, but they were by far too expensive. I would move up to an Atari ST in 1985, and a few years later I joined the Macintosh community with a PowerMac 8600. At that time I was using Macs in my job, developing multimedia CD-ROMs with Apple Media Tool. Using a Mac for professional work every day is the best way to be converted to the simplicity and power of Mac OS! In 2000, I needed a new Mac to run Mac OS X, so I purchased the best computer Apple ever produced-the G4 Cube. It’s a great machine, especially in its lack of “noise,” and I’m glad I purchased one before Apple discontinued the line-which is a shame in my opinion.

Philippe mentioned that you’ve developed the sampled sound portion in the upcoming emulator NoSTalgia 1.4. How did you join up with him?

Philippe posted a message a while back in the newsgroup fr.comp.sys.mac saying he was about to develop an Atari ST emulator, and asked for technical documentation about the Atari ST. I thought, “Woo, that’s cool!” So I offered to send Philippe a fair amount of documentation that was gathering dust on my shelf—fortunately, I didn’t have to send it overseas, only “Outre-Quie’vrain.” My only requirement was to be one of the first beta testers so that I could start replaying all of my old games.

My first programming efforts for NoSTalgia were working on the MIDI routines. In my job, I was developing software using QuickTime, so one day I thought, “Why not use the QuickTime software synthesizer to play what’s coming from the MIDI ports of the Atari ST?!” I told Philippe about my idea, and he was kind enough to accept it and let me work with him on his emulator.

nost07.gif

Cubase Lite

As the QuickTime Player is able to play MIDI files, I was thinking the code would be fairly simple, and just a matter of “virtual wiring” between the Atari ST’s MIDI ports and the QuickTime synthesizer. However, it wasn’t that easy because QuickTime knows how to import a MIDI file, but doesn’t know about MIDI codes sent in real time. I had to write a complete MIDI interpreter to pilot the QT synthesizer from the Atari ST! The MIDI protocol is well documented, and not very complex, so the code came along nicely. Interestingly enough, that same code from the Mac OS 8 era is still in the Mac OS X version of NoSTalgia. The next obvious step was being able to control a real MIDI synthesizer from the emulated Atari ST running on the Mac. At that time, OMS (Open Music System) was the “standard” library for writing MIDI software, so that’s what you have on the Mac OS 8/9 version of NoSTalgia. I’m planning to update these routines with CoreMIDI on Mac OS X. OMS, and soon CoreMIDI, allows NoSTalgia to control a synthesizer, but it handles “MIDI in” as well, so you can record yourself playing on the synthesizer completely by keyboard (using the very first version of Cubase running in the emulated Atari ST, for example).

The first version of the sound emulation in NoSTalgia had been written by Philippe, but it didn’t have sampled sound support, so after writing the MIDI code, it was a new challenge for me. That was tough! My version improved the quality of the sound (thanks to a better accuracy of the emulation), but still no sampled sounds were playing. Instead, there were some cracking noises, because I had completely overlooked the need for precise timing—my code was only accurate to 1/50 of a second. You couldn’t tell the inaccuracy when playing notes on the sound chip, but for sampled sound you have to be precise to 1/44100 of a second (in the case of CD quality)! Now that NoSTalgia is Mac OS X only, I updated the sound routines from Sound Manager to CoreAudio, which is a dream to use.

What was your previous experience with sound on the Atari ST ?

You may not believe it, but I didn’t have that much experience with sound on the ST! I did know roughly how the sound chip worked, but how sampled sound was played through that chip puzzled me at the time, as I wasn’t able to find any documentation on that particular subject. Now that I have worked on emulating the chip, it’s all fallen into place.

The Atari ST featured a Yamaha YM2149. Could you give us some historical and technical background on Atari’s soundchip/system?

This chip is a clone of the General Instruments AY-3-8910, or perhaps the other way around. Either chip has been used in a lot of microcomputers such as the Sinclair ZX Spectrum, Amstrad CPC, Oric Atmos, and arcade consoles. It’s an interesting musical device; it has three independent channels that output a square wave. You access the chip registers to control it, setting the frequency, amplitude for each channel and the period and shape of a global envelope. It’s like playing notes on a keyboard. There’s a noise channel too, for the explosion effects in games. It’s fairly easy to use, and you can produce great tunes without any sort of load on the processor. Except for sampled sound, which uses an undocumented trick to turn the chip into a digital-analog audio converter, but the processor has to send the samples in perfect synchronization to the chip—you need an 8MHz 68000 to do that!

What was the most challenging part in writing the sound code for NoSTalgia?

Sound is real-time! You have to be sure that everything stays in sync, as well as understand how the system wants to take your sound to play it on the hardware. On Mac OS X, understanding CoreAudio is the key. There’s some good examples code in the SDK.

What other projects, if any, have you done on the Mac?

Professionally, I’ve worked on several multimedia CD-ROMs, back in the golden age of multimedia.

Do you have any complaints about the Macintosh APIs or Apple’s documentation?

For programmers, there’s never enough documentation. Seriously though, sometimes the existing documentation is outdated. However developing on Mac OS X is great, heaven compared to “Classic” Mac OS. You can have never-ending loops, memory leaks, crashing bugs in your application, yet the system stays solid as a rock. As Mac OS X’s sound is real-time, it’s not really handy using a step-by-step debugger on your code. But putting a lot of trace in it helps a lot, and those traces show up in the console immediately. You know what’s happening, when it’s happening.

Bio

Philippe is living in Belgium (not far from Brussels) and is 35 years old. His first computer was a Canon X-07—a portable computer with a small LCD screen.

1 GEM is a GUI desktop environment produced by Digital Research about the time that Microsoft did the first version of Windows. The Atari ST line used a modified version of GEM.

2 Infringement of intellectual property rights is a serious issue, and there are many views on emulation. To read a counter view on the subject, please visit Nintendo’s policy page.

developers,atari,st,emulator,nostalgia

Recent Forum Threads

About iDevGames

Since 1998, iDevGames has been educating, supporting and enhancing the community of game developers that produce video games for the Apple Mac and iPhone platforms. Get the latest game development news by subscribing to our news feed.