Atari Lynx programming tutorial series:
So, you want to develop a game or program for the Atari Lynx, right? Well, join me on my journey to learn how to program for this game console. This tutorial series will be expanded and updated as my knowledge of the platform grows, when feedback from the community is given. Some things in this tutorial might be wrong. Let me know and help grow this tutorial, so people can benefit from it.
I will write this so others can also start developing games. At this point in time I think I will use a set of helloworld-ish samples to explain concepts, but also build a real game to explore the various aspects of Lynx game development. This means that I am not sure how the tutorials will be structured. I anticipate that they will be like living documents that grow and get better content over time.
The ingredients for a game
These are the things you will need to build, test and run your game for the Atari Lynx:
- The actual hardware of an Atari Lynx device
- A programmable cartridge onto which you can transfer the game and test it in the real Lynx
- An emulator to make dry runs without needing the hardware and the time to transfer and test a cartridge
- A development environment that can produce the correct 65SC02 code that the Lynx console can run
- The idea for a game
- Basic understanding of programming
- Dedication, patience and perseverance
Let’s briefly look at each one of these.
Actual Atari Lynx device
You probably have one already. Why else would you want to write a game for this device? If not, there are plenty of Lynx console to be bought in your neighborhood or on the Internet. Ebay is probably a good place to start if no one around you has one for you.
There is no particular preference for the Atari Lynx Mark I (Classic) or II model. The games should run on both. The most noticeable difference in the hardware is the support for stereo in the Lynx II, where the Lynx I only has mono sound. The form factors are different as well. Here, there is a slight bias towards the Lynx II, because it has an open cartridge slot that allows for easy insertion of odd-shaped cartridges. This will help with the flashable cartridges as well (see later).
A programmable cartridge
There are a couple of ways to get a game binary image onto a cartridge. One of them is an EEPROM-burner. I have seen these out there. Or you can use the Flashcart by Karri Kaksonen. My personal favorite is the FlashCard by Lynxman. I own one and have used it extensively to try my games on a real Lynx device. Works like a charm and it is highly recommended. It’s affordable. Check with Lynxman for availability and pricing. Make sure you have a Lynx II or are willing to remove the cartridge bay door of your Lynx I.
Emulator to quickly test a game
There are two main emulators out there:
- Handy (with incarnations for about every platform and device)
- Mednafen (Multi-system emulator based of Handy source code with improvements)
I have always used Handy, but recently found that Mednafen has flawless sound support. It is a bit trickier to use (command-line based), but is well worth checking out.
When you choose Handy, do pick the Developer version, as it includes debugging support and has more features. Pick up the source code for the emulator as well, which is for the developer version. I have written a blog article on how to compile the source for Handy on Visual Studio 2010.
Development environment for building 65SC02 code
In my book a development environment encompasses everything that you need to build games. This ranges from your operating system, to tooling and documentation.
You have got the operating system taken care of already. How else would you be browsing this page? I cannot judge whether this will be the OS for game development of your choice. I know that it is possible to get a working and productive environment for Windows and Linux and not so sure for MacOS. Everything else will have slimmer chances. If you use one of the first two then your in luck. Otherwise you might need to switch. My operating system is Windows, and have nothing against the others. However, I do focus on Windows and Microsoft technology. I will not compare this with other operating systems and manufacturers thereof. You be the judge of what is better.
My list of things for the Atari Lynx development environment:
- Compiler, assembler and linker for 65SC02 source code
- Text editor and/or GUI for source code and resource files
- Framework specifically for creating Atari Lynx games
We’ll get into each of the tooling later on.
The idea for a game
Surely, to develop a game you will need to have an idea of what the game is like. That is not what this tutorial is about. It is meant to give you the knowledge on how to use the platform, hardware, tooling and programming environment to accomplish writing a game. As far as the game is concerned: that is your idea mixed with the things in this tutorial.
Basic understanding of programming
There are so many books, internet sites, people, training companies and schools out there that can teach you how to program, it’s not even funny anymore. If you are not comfortable writing code and haven’t got your head around it yet, this tutorial might not be for you. I do assume you have programming experience and skills. Then again, reading this might help you learn more about programming. You’ll notice if it can help you develop your skills. For me, it has been very educational to program in a low level way, instead of the high level languages and frameworks that I use every day.
Dedication, patience and perseverance
Being a developer of software can be a very rewarding task. Whether it is monetary gain, or personal satisfaction of solving a problem or completing a game, for everyone there is something to be had from developing. If there isn’t you should really reconsider starting development or being a developer.
But, the other side of the medal is that there will almost certainly be moments where things get tough. You might not get the results you want, or not as quickly as you’d like. There will be bugs in your code that you need to hunt down and fix. There is not as much documentation as you will need and the developer community is small to say the least. You have been warned and should be prepared to deal with this. On the upside, take a look at the fun games that the homebrew community of the Atari Lynx has developed the past couple of years. And I must say after having spent a couple of evenings experimenting: it is really fun to program for the Lynx. Amazing what this little console can do. Little code, big results. I am enthusiastic. I hope you are too.
From this point on
This first part has not a whole lot to do with programming yet. But we’ll take it step by step. The next part will cover the various tools that you will need and could use. We’ll discuss the compilers, editors and frameworks. So, stay tuned for more on the Atari Lynx programming tutorial.