Lutris' blog

Day 1: Cosmic Conflict on Odyssey 2 (1978)

by on Feb.24, 2010, under lutris

Ah …1978. The year I was born. This was also the year when the Odyssey² was released by Magnavox (Which was later bought by Phillips). The Odyssey² was one of the first gaming consoles with a microprocessor (The other ones where the Atari 2600 and the Fairchild VES).

Well, this looks like fun !

Just look how great the specs of this machine are :

  • Intel 8048 8-bit microcontroller running at 1.79 MHz
  • CPU-internal RAM: 64 bytes
  • Audio/video RAM: 128 bytes
  • BIOS ROM: 1024 bytes
  • 160×200 resolution (NTSC)
  • 16-color fixed palette; sprites may only use 8 of these colors

Impressive, right ? Well at least, we shouldn’t have any problems to emulate this one. 

O2em : The Odyssey² emulator

Turns out that there is one (and only one) pure Odyssey² emulator which is o2em. Mess also emulates the Odyssey² because it emulates pretty much everything on earth, but I will not do anything Mess-related during these 33 days, it deserves better and one day is not enough for a huge project like this one.

The good thing is that o2em can run on Linux. It has an Open Source License (Artistic License), but sadly it’s not included in Ubuntu …  Damnit ! For the first day, it’s not a very good start. Let me explain why.

Lutris uses what I call runners, runners are whatever program that can run games. It can be an emulator like o2em, it can be Wine (because Wine Is Not an Emulator), it can be Linux (because Linux runs native games). Runners should be easy to install. When you launch Lutris, the first menu item you get is “Manage runners”. Selecting it opens a window with a list of runners and some buttons on the right which says “Install” if you don’t have the runner yet or “Configure” if you have it on your harddrive. Installing runners should be done with one mouse click, and for this I use the binary packages available on every Linux distro. This means that if a runner is not packaged for some distro, then you’re out of luck… and o2em is not packaged. As this is the first day, let me explain things more in detail.

Lutris is not just  yet another frontend for emulators

Sure, the goal of Lutris is to provide a nice frontend to launch games easily, but that’s not the main point of focus. I want to make sure that games are able to run forever. Each single video game is a part of our culture and the gaming culture seems in bad shape right now … You might think it’s illegal to download Cosmic Conflict and the Odyssey² BIOS, but isn’t it more important to preserve our video game legacy ?And if you bought a used cartridge on ebay, would Magnavox make any money on it ? Not at all … But legal issues are not the worst part. The really annoying part is that almost nobody cares. Neither Magnavox, nor Linux packagers and we will see similar cases in a few days. Me, and by extension the Lutris project does care that you are able to play an Odyssey² game in 10 years so you can show your kids what video games looked like when you were a kid. This means that as long as the Lutris project is alive i’ll strive to keep the “runners” available and well maintained. First step in order to achieve this is to become a Ubuntu MOTU and even a Debian maintainer. You can follow my progress on becoming a MOTU on my other blog.

For now, I’ll just add a Need Packaging: o2em in my TODO list, I’ll know it will take some time to get into Debian and Ubuntu but the packages will be available as soon as possible on my PPA.

Getting o2em to run

Right now the goal is to be able to run the emulator  regardless of its availability in Ubuntu. I gave the link for the o2em homepage above, and I notice something … The Linux binary is for v1.16 but the latest source is v1.18, guess we’ll have to compile some stuff (That’s the way to go anyway if I want to make a Debian package). I had to change a few things to get o2em to compile, the following script should do it right :

#!/bin/bash
gksu apt-get install liballegro4.2-dev
wget http://kent.dl.sourceforge.net/project/o2em/o2em/1.18/o2em118src.zip
unzip o2em118src.zip
cd o2em118src/SRC
for f in *.C; do mv $f `echo $f | tr '[:upper:]' '[:lower:]'`; done
for f in *.H; do mv $f `echo $f | tr '[:upper:]' '[:lower:]'`; done
sed -i '
/#include <time.h>/ i\
#include <errno.h>
' score.c
LIBALLEG=$(allegro-config --libs)
sed -i -e 's~LIBALLEG = \/usr\/lib\/liballeg.so.4.2 -lalleg_unsharable~LIBALLEG='"$LIBALLEG"'~' Makefile.linux
make -f Makefile.linux
gksu cp o2em dis48 /usr/bin
mkdir $HOME/.o2em
mkdir $HOME/.o2em/bios

Next step is to add the bios file and finding the game, I won’t give you direct links but try typing on Google “The Old Computer” should give you some good hints.

You should now have a running Odyssey² emulator on your machine.If you try it a bit, you’ll notice something … Yes, there’s no sound ! This is a confirmed and yet unfixed bug in Allegro, it’s on Launchpad and on the PulseAudio bugtracker. The worse thing is that this has been fixed for a while, the problem is that Debian and Ubuntu still have Allegro 4.2.2, the current version is 4.9, there’s also a 4.4 branch and the 4.2.3 maintenance release has the fix to this bug. Looks like it’s another task for a MOTU, and when you’re dealing with a library that was once maintainted by the mighty Sam Hocevar himself, you’d better not mess things up ! That’s ok, I’ve finished reading the Debian Policy and I’m about to begin the Debian Maintainer’s guide. And if I fail, there will be some experienced MOTU or Debian Maintainer that manages to package a newer version of Allegro.

O2em in Lutris

Once I had o2em running (without sound), it was not a big deal to add the functionality in Lutris. Writing a runner module is really not that hard, it’s just a matter of translating a manpage or documentation into the right Python dictionaries.  You can see how a runner is written by looking at the runners/o2em.py file in the source folder. Once the runner has the relevant data, Lutris can build the settings dialog and make up the command line to run the game by itself.

Yay, let’s play some Cosmic Conflict ! Ok … the game is not that great, you have to shoot pixelated Tie Fighters and weird looking spaceships,  that’s all there is to it.

Cosmic Conflict in all it's glory

Playing Odyssey² games might have more historical interest than it brings lots of fun, but bringing this emulator in Lutris will be a very good practice in terms of learning Debian Packaging. As we will see in next days, o2em is far from being the only poorly maintained emulator in the Linux world.

See you tomorrow for more badass ancient games, meanwhile you can listen to Queen, AC DC and Kiss or watch Superman and Jaws 2.


1 Comment for this entry

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives

All entries, chronologically...