Archive

Archive for October 9, 2014

Building an Amiga for $40 with Raspberry PI and UAE4All

October 9, 2014 22 comments

Right. As most readers probably know by now, I absolutely love the idea of re-furnishing old computers to their former glory. I tend to buy second-hand computers and technology and turn them into something useful and modern, or at least something the original designers didn’t consider when they made it. Like my $43 Apple G4 with dual monitors, a kit I turned into a MorphOS powerhouse – that is presently running a custom synapse (FreePascal coded) file-server.

Well, I’ve had a Raspberry PI floating around the place for a whole year now; It was originally something I bought for my 11 year old son in a desperate hope that he would fancy a DIY project with his old man. But sadly I have capitulated to the power of minecraft and the fact that he is more a “soccer kid” than a programmer. I love him either way, but I hope to initiate him into the mysteries of code – which have given my life so much joy. Especially in my childhood, playing games and trying to make them using Blitz basic 🙂

The RPI mini computer, size of a pack of sigarettes

The RPI mini computer, size of a pack of cigarettes

Either way, yesterday I was shopping when came across a special offer on 5V re-chargable batteries, the models meant to re-charge your iPhone. So each battery holds enough juice to fill an empty phone when you’re on the road. I suddenly remembered that the voltage and amp was identical to the Raspberry PI, and since you could chain-connect several batteries together via USB->USB MINI connectors  I figured if I got a couple of them the PI could run on them.

And work it did! I was actually able to get 6 full hours of “mobile” activity from the Raspberry PI with just two batteries (!). Which is en-par with any modern laptop of portable touch device (IPad, Android Pad). I also stopped by an electronic’s store and picked up a USB splitter – turning the meager 2 USB slots on the classical Raspberry PI into a 6 slot connectivity monster.

Tip: A rule of thumb if you want a “portable Amiga” is to add one battery to the chain per USB device you have connected that requires power. Keyboard and mouse doesn’t require much, but count one battery (a total of 2 so far). Add two more batteries if you use a USB disk drive, and a single battery if you use a Wi-FI dongle or a USB stick. So for an RPI with keyboard, mouse, external 512 gig disk and a wi-fi dongle: count 5 chained batteries.

Tip 2: Save your sanity and buy a pack of those cheap wireless keyboard and mouse. It requires very little power on the RPI and you dont have cables all over the place. Especially in your living room where your wife will no doubt comment after a while 🙂

Top 3: If your TV has an USB plug, buy a USB to mini-usb cable, then use the USB on your TV to power your RPI (!) It works brilliantly and once again saves you a power cable. With this in place you only need the HDMI cable and your’re ready to rock.

Linux to the rescue

One of the cool things about Linux these days is that it’s driver database has grown huge over the past 7-8 years. It used to be that getting anything at all to work on linux, let alone “off the shelves” windows hardware, was nearly impossible. I vividly remember having a (then) high-end gaming PC with the latest Mattrox graphics card (the type you could buy 2 or 3 and chain them with fire-wire optical cables for extreme performance) + Soundblaster 16, but when I tried to install RedHat Linux I ended up with a bog-standard VESA driver! That was such a disappointment that I did not touch linux for 8 years.

Well those days are long gone and most modern Linux distro’s are able to recognize whatever you throw at it. Since I picked up Ubuntu and started using it full-time I have yet to find a single piece of hardware that it cant work with. Which is brilliant! Especially the source-based drivers that (in theory) should work on all distros as long as it uses the driver API to talk with the hardware.

Either way — this meant that getting the Raspberry PI to recognize keyboard, mouse, external drive and even my printer (!) was actually easier than on my spankingly new Mac! You plug it in and seconds later it’s ready to go.

Memories of Amiga

I must admit that I miss my Amiga a lot. Im now 41 years old but when I think about my Amiga, which I clung to until the last moment, only selling it in 1995 due to Microsoft Office requirement in college, I get all warm and fuzzy inside. It’s the same emotion you experience when you meet “that special someone from the past, she that got away”. I guess it’s common knowledge that people who grew up with Amiga’s are extremely passionate about it – bordering on fundamentalism. And this is decades after it’s gone out of production (!).

There are crimes in the history of technology; VHS vs. Betamax was one of them – but the absolute worst crime in computing history – en par with the extinction of a the west-indies by a hoard of drunken sailors in the 1600’s, will always be the unjust death of the Amiga. We would inhabit a very different technological world had Commodore survived to this day, that is for sure. It would be faster, easier and far more friendly than anything we have today. Nor would it be driven by megalomaniac psychopaths like Steve Jobs or Bill Gates. Although Petro Tyschtschenko can give you a nasty scare if you meet him holding “the walker” prototype in a dark alley somewhere.

Right – here are few things people may not know about the Amiga:

  • You could buy VR (virtual reality) equipment based on Amiga Tech 20 years ago. VR is not new nor is it innovative, it all started with the Amiga
  • TV series Babylon 5 used Amiga for all it’s graphics
  • LucasArts used Amiga 4000 render-farms
  • Nasa loved the Amiga and had a ton of them, they were also used in a couple of satellites!
  • While Microsoft Windows could barely run calculator and notepad simultaneously, the Amiga had full preemptive multitasking
  • AmigaOS was architected after UNIX and is extremely resource sufficient; running a full multi-window desktop, multitasking with far better performance than Mac’s and PC’s at a meager 1 megabyte of ram and 14Mhz Motorola 68000 CPU. That’s like a 14 year old beating Mike Tyson
  • It was only when PC’s adopted graphics accelerators and 3D hardware that Amiga’s struggled to keep up
  • PPC accelerator cards were made to make up for it, but commodore screwed up the marketing
  • Ultimately the Amiga died due to neglect by Commodore, which filed for bankruptcy
  • After the demise of the Amiga, the MC68000 CPU’s were mainly used in washing-machines (auch!)

Turning a PI into an Amiga

Looking at the specs of the $35 Rasperry PI mini-computer we find that in a raw head-to-head comparison of CPU power (which is really unfair to the Raspberry, because the Amiga’s strength was it’s integrated custom chipset) it is head over heals beyond anything the Amiga had. The Amiga 500 had 512Kb ram, the low-end RPI has 512 megabyte ram (1024 times more!). The CPU is a single-core ARM processor running at 700Mhz, but most people overclock it to 1Ghz. I can only imagine how the PI would run if Amiga OS was ported whole-heartedly over. Amiga OS natively compiled for that hardware would run rings around an average, modern PC.

Ta-Da! <$50 for a portable Amiga? Eat that Amiga inc!

Ta-Da! Less than $50 for a portable Amiga? Take that Amiga INC!

So, how could I turn my now battery powered Raspberry PI into an Amiga? Well, I have to turn to emulation. And in order to get that working I need Linux. So I went over to the Raspberry PI website and downloaded the noobs disk image, plugged in a network cable and installed Debian (I also tried the fedora port, but Debian gave the best speed). I used the apt-get package manager to update the system, plugged in a wireless USB dongle so i could finally ditch the cable — and voila! I had a “mobile” Raspberry with wireless capabilities. Oh and I had a ordinary USB keyboard and mouse in all the time. Just in case you think I did this via telepathy.

Setting up the emulation

Next was the Amiga emulator, which comes in many flavors and forks. Once again i googled the best option and found a custom variation of Amiga4All on the RPI website. I downloaded the package and installed it.

Next, I needed a few things:

  • Original ROM files from the Amiga
  • Disk images of games, Workbench (the Amiga desktop) and harddisk’s

Well, considering the amount of money I have invested in Amiga’s during my teens I felt no shame visiting my local torrent and grabbing a massive 8 gigabyte ISO with everything. And I mean everything, including all the ROM files ever made for the Amiga (and then some! Even the failed Commodore inventions like the CDTV was there).

I took the Flash-Card out of the RPI and plugged it into my Mac, then copied the ROM files to the “roms” folder, and the disk images to the games folder. I also separated the floppy images from the harddisk images so it would be easier to work with.

Adapting Linux

Next, having booted back into Linux on the RPI, I edited the config file and removed the statement “startx” (towards the end of the config file) which is the command that starts the desktop under Linux (I presume this is universal, but I’m really new to Linux so there may be variations). I replaced it with the command-line call to start UAE instead – pointing it to the first game I ever bought as a kid: Rocket Ranger (I later discovered that you could disable the desktop completely when you install, but picking “text mode” instead of desktop-display).

To be perfectly frank I never thought it would work “just like that”, because I have only 3 weeks on hands-on experience with Linux (Ubuntu) so I was prepared to drone over esoteric man-files and asking people online. But to my big surprise, I 6-10 seconds later I was looking at the Cinemaware logo on my spanking new 55″ LED TV. Boy did I jump! I even got sound, although it was slightly jerky.

I went back in and had a look at the UAE config, turned on JIT, set “drop frames” to 1 (it was set to 3). I also set sound to mono, because I’m not that into music anyhow. And that was it — it worked just like my old Amiga (!)

Setting up WB

Next step was to see if any of the Workbench HD images worked, and indeed they did! It’s actually faster to use Workbench under emulation – than to use Arch Linux compiled for Raspberry (oh yes, I tested that distro as well, and it was barely usable at all).

Overclocking

A major speed boost is the over-clocking feature. You simply edit the RPI boot config and set over-clocking to max (see article on doing this here) and the CPU runs at 1Ghz, which is a great improvement from the default 700MHz. I have yet to find a game which runs worse than the original Amiga — and I’m guessing it’s not even hardware accelerated.

As you probably know the RPI comes with a proper GPU, which is how it can play HD video. If UAE was to use this there is no doubt — the RPI would replicate the old Amiga down to the letter, but with more power, more ram and full driver support for modern hardware.

Well, I hope my little adventure interested you!