Happy birthday, Hatari!
According to Hatari's doc/release-notes.txt file, the very first
version of Hatari, version 0.01, has been released 20 years ago, on the
21st of May 2001. To celebrate the birthday, I'd like to reminisce a
little bit about the beginning...
I don't remember clearly, but I think the basic idea of the need of a
cycle-accurate emulator for Linux already started in the year 2000. I
was just 21 years old and just started my studies at the University of
Ulm. I already had Linux on my hard disk and I really liked it. But for
some things, you still needed to boot Windows 98 from your second
partition. Cycle accurate Atari ST emulation was one of these things.
On Linux, there was basically just STonX (see the website
http://www.complang.tuwien.ac.at/nino/stonx.html for the original
version), which did not see a new release since 1997. While STonX was
quite fine for running GEM applications with a decent speed, it
completely lacked cycle accuracy for the CPU emulation, so most old
games and demos either ran too fast or not at all, not to mention
things like color raster or border effects or even Spectrum 512
screens. There were two more Atari ST emulators around for Linux, one
called FAST (which later got renamed to CaSTaway, for details see
http://castaway.sourceforge.net/), but that was also completely
unmaintained and rather incomplete at that point in time, and one
called Osis, which had a completely different goal, though (it was an
emulator for GEM applications only, without the need for a TOS ROM -
see https://web.archive.org/web/20010210005756/http://osis.nocrew.org/
for details), so the situation on Linux felt rather frustrating after
having seen emulators like PaCifiST, WinSTon and STew on Windows (IIRC
STeem was also already available on Windows, but not yet on Linux).
Then at one point in time, I noticed that the author of WinSTon had
released the source code of his emulator (which still can be found on
https://sourceforge.net/projects/winston/). And the source code was
written in well-documented C. Well, it was wrapped in C++ files since
it had been written with Microsoft's Visual-C++ Suite, but apart from
some small C++ specialties, the code was mostly normal C. Apart from
the CPU emulation itself - that was written in x86 assembly, using the
syntax of the Microsoft compiler, of course. Since I hardly knew any
x86 assembly at that point in time and that assembly syntax was quite
different to the GNU one, this was completely useless for me on Linux.
So I was thinking about replacing the CPU core with a different one.
Initially I was thinking of the Starscream CPU core since that was
quite popular in other emulators at that point in time. But that was
also completely written in assembly, so it would have been harder to
debug and not portable to other CPU architectures. Fortunately, I
notice that the Amiga emulator UAE featured a good, cycle-accurate CPU
core that was written in portable C code, so I decided to use that.
During the break between the first and second semester of my studies,
in early 2001, I did not have much exams yet, so I had some spare time
which I used to make the WinSTon code compilable on Linux. Bit by bit,
I disabled all Windows-specific code in the sources, and rewrote some
functions that looked important to use POSIX file handling instead. On
the 21st of March 2021, I reached a point where all files that looked
necessary were finally compiling on Linux, too (i.e. I ditched the
files that only were used for the Windows GUI and thus very far from
being portable anyway), and I also copied the UAE CPU core sources into
the tree, without really wiring it up yet. I was so happy to get to
this point where the sources at least compiled that I even dared to
label it as version 0.01 already, though nothing was working yet, it
was really just a "compile test". But apperently I was on the right
track, indeed, since one week of intense hacking later, I was already
able to boot TOS 1.00 up to the desktop in the emulator. That was
version 0.02, still no keyboard and mouse yet, but seeing the desktop
was certainly a huge motivation to continue.
I also wanted to share my work very early already, so I've put the
early versions on my private website already. I wasn't able to find
version 0.01 or 0.02 in any of my backups anymore, but I've found a
backup of version 0.03, so if you're interested, this is how the
website looked at that point in time:
http://hatari.tuxfamily.org/archive/hatari-0.03/hatari_e.html
... and if you're brave, you can even download the source code and try
to make it compile and run on new systems again (beware, it won't run
out-of-the box! You have to add -lm to the linker and -fcommon to the
CMPLRFLAGS, and increase INTERCEPT_WORKSPACE_SIZE quite a bit).
In the following weeks and month, the project slowly took off. There
were some contributions by others who got curious, and in late May
2001, Hatari even got a proper CVS repository on SourceForge (see
https://sourceforge.net/projects/hatari/ - the CVS repo has been shut
down nowadays, but you can still download the early tarballs starting
with v0.05 there).
In the course of time, I then rewrote bit by bit the disabled
Windows-specific parts in the sources, finally also getting sound
support and stuff like the Spectrum 512 screen rendering support
working on Linux, too, and increased bit by bit the integration of the
UAE CPU core with the rest of the WinSTon-ased sources, but it took
until version 0.30 in 2003 until one nasty bug in the interrupt / SR
handling was finally fixed (it was the bug that got fixed in commit
https://git.tuxfamily.org/hatari/hatari.git/commit/?id=a2313ce7c755fea9
if I remember clearly, a bug that caused random crashes while moving
the mouse, for example), so that my original dream of having a usable
cycle-accurate Atari ST emulator for Linux finally came true at that
point in time, I think.
So that were my memories of the very early days... Of course a lot of
additional stuff has happened in the course of time, but for this mail
here it's enough of sentimentality, I think (but I can continue maybe
next weekend if you liked this kind of memory dumps, or maybe Nicolas,
Eero, Laurent or anybody else could share some memories about the Hatari
history, too).
Enjoy,
Thomas