Your #1 source for Atari Lynx news and information!
Atari GamerAtari GamerAtari Gamer

We are moving all Atari Lynx related content over to Atari Lynx Vault and all our shop content over to K-Retro Gaming. Please update your bookmarks!

As a result of this change, the following will no longer be available: Online Lynx Emulator, Collection Tracker, Game Ratings, News. If you are interested in contributing content to Atari Lynx Vault, we are seeking editors and maintainers.

Why is this happening? First - the Atari Gamer branding is changing to K-Retro Gaming to allow us to expand to providing games, replacement parts, and mod services to other game consoles. And second - The content management system running Atari Gamer is out of date and Google AppEngine (where the website runs) will no longer allow it to run after the 30th January 2024, so in order to preserve all content we switched to a new and modern content management system and chose a website domain that better suits the subject matter. Since we are operating this website in our spare time, on top of full time family and job committments, some features had to be dropped.

  1. Home >
  2. Articles >
  3. Setting up development tools for Atari Lynx programming on macOS

Getting started with writing code for the Atari Lynx is easy. There is a number of very good resources that explain how to get going - they step through examples and get you on the way to writing simple games. Alex Thissen's programming tutorial series is probably the most easy to follow. Then for more in-depth information the Atari Lynx Programming subforum on AtariAge is a very good resource. However something that isn't covered in detail is how to set up and compile Atari Lynx code on a Mac. That's where this tutorial comes in.


This tutorial will tutorial assumes that you are already familiar with Lynx programming and simply want to start building your code on a Mac. The tutorial is a part of a series that will cover aspects of Lynx programming that haven't been covered in other places.

The Compiler

Since the Atari Lynx is 6502 based system. The choice of compiler is obvious - CC65. Note the website address, the current version is hosted on Github, the old version is still on its own domain over at cc65.org. This tutorial covers the current version.

Since there is no release version of CC65 available for the Mac, you have to build your own. This requires that Xcode with development tools is set up first, this blog post covers that aspect.

Building CC65 is simple. This tutorial will assume that all of the development tools involved are going to reside in the /Applications/devtools directory. So the first step is to make sure the directory exists and clone the CC65 repository using git. This is all done via the Terminal application.

mkdir -p /Applications/devtools
cd /Applications/devtools
git clone https://github.com/cc65/cc65.git

Once all the code is downloaded it's time to build CC65 using make.

cd cc65
make all

If everything went well there should be no errors and CC65 and all its tools should have been compiled. At this point Lynx code can be compiled, but first there are a few extra items to take care of to make life easier.

Additional Tools

Just the compiler is all well and good but in most cases you will need some additional tooling, especially if you are trying to build code that's out there already. One of the most frequently used tools is sprpck by Bastian Schick. There is no binary release version of it, in fact the original v1.97 source code won't build on a Mac, but there is a way to do it.

There is a "forked" version 1.98 of the tool over at GitHub that has been updated specifically to build on a Mac. It can be found here - https://github.com/kateflower/sprpck. There is no functional difference between the 1.97 and 1.98 versions apart from Mac compatibility. So lets clone, then build it...

cd /Applications/devtools
git clone https://github.com/kateflower/sprpck.git
cd sprpck
make

Again if no errors are displayed, sprpck is built and ready to use. Note that CC65 comes with its own sp65 image tool which will be covered in more detail in the future.

A Few Conveniences

With the tooling set up you can get started, but before you do that it's a good idea to set up the command line environment to make it easier to build Lynx code. It's a good idea to set up environment variables pointing to the CC65 and sprpck install locations as well as adding both to the run search path.

This is done by adding some code to end of the ~/.profile file. The easiest way to do this is via the command line...

open -a /Applications/TextEdit.app ~/.profile

Add the following lines to the end of the file...

export SPRPCK_HOME=/Applications/devtools/sprpck
export CC65_HOME=/Applications/devtools/cc65
export CC65_TGT=$CC65_HOME/target
export PATH=$CC65_HOME/bin:$SPRPCK_HOME:$PATH

For these changes to take effect you need to close and re-open the Terminal app (or just the current tab).

Go Forth and Code

Now you should have everything you need to get started with simple game coding on the Lynx. It pays to get familiar with CC65 documentation and especially its Atari Lynx specific information section. Be sure to go through all of Alex's tutorials and have a look at the demo part of the Atari Gamer GitHub repository for some Lynx code examples.

This tutorial series will keep getting expanded so check back for more content soon.

-AG
Did we get something wrong or you have something to contribute? Please tell us about it!
You can find Atari Gamer on...
Be sure to follow for the latest Atari Lynx news, updates, stories and photos!
[ Don't show again ][ Dismiss ]
Loading...
10
We have an online shop that has lots of Atari Lynx related goodies - including LCD mod kits, flash carts, display stands and other fun things for your Lynx! Check it out here.

If your download doesn't start automatically after 10 seconds, please click here.
Cookie Consent
By continuing to browse or by clicking ‘Accept’, you agree to storing of cookies on your device to enhance your site experience and for analytical purposes. To learn more about how we use cookies, please see our privacy policy.
Accept and Close