Documented Source Code For Elite On The C64, BBC Micro And Others

If you ever wanted to dive into the source code for the 1980s space game Elite, but didn’t want to invest many hours reverse-engineering the 6502 assembly code, then [Mark Moxon]’s annotated code has you covered. The systems referenced range from the BBC Micro and Commodore 64 to the NES and Apple II, with some of these versions based on the officially released source code. For other systems the available source code was used together with decompiled game binaries to determine the changes and to produce functional, fully commented source code.

The cutting-edge gameplay of Elite on the 8502.
The cutting-edge gameplay of Elite on the 8502.

This particular game is fascinating for being one of the first to use wire-frame 3D graphics with hidden-line removal and a sprawling universe in which to trade and deal with less than friendly parties using a variety of weapons. After this initial entry it would go on to spawn many sequels and inspired countless games that’d follow a similar formula.

On the respective GitHub project page for each version, you can find instructions on how to build the code for yourself, such as for the Commodore 64. Of note here is the license, which precludes anyone from doing more than forking and reading the code. If this is no concern, then building the game is as simple as using the assembler (BeebAsm) and the c1541 disk image utility from the VICE project.

All You Need For Artificial Intelligence Is A Commodore 64

Artificial intelligence has always been around us, with [Timothy J. O’Malley]’s 1985 book on AI projects for the Commodore 64 being one example of this. With AI defined as being the theory and development of systems that can perform tasks that normally requiring human intelligence (e.g. visual perception, speech recognition, decision-making), this book is a good introduction to the many ways that computer systems for decades now have been able to learn, make decisions and in general become more human-like. Even if there’s no electronic personality behind the actions.

In the book’s first chapter, [Timothy] isn’t afraid to toss in some opinions about the true nature of intelligence and thinking. Starting with the concept that intelligence is based around storing information and being able to derive meaning from connections between stored pieces of information, the idea of a basic AI as one would use in a game for the computer opponent arises. A number of ways of implementing such an AI is explored in the first and subsequent chapters, using Towers of Hanoi, chess, Nim and other games.

After this we look at natural language processing – referencing ELIZA as an example – followed by heuristics, pattern recognition and AI for robotics. Although much of this may seem outdated in this modern age of LLMs and neural networks, it’s important to realize that much of what we consider ‘bleeding edge’ today has its roots in AI research performed in the 1950s and 1960s. As [Timothy] rightfully states in the final chapter, there is no real limit to how far you can push this type of AI as long as you have more hardware and storage to throw at the problem. This is where we now got datacenters full of GPU-equipped systems churning through vector space calculations for the sake of today’s LLM & diffusion model take on ‘AI’.

Using a Commodore 64 to demonstrate the (lack of) validity of claims is not a new one, with recently a group of researchers using one of these breadbin marvels to run an Ising model with a tensor network and outperforming IBM’s quantum processor. As they say, just because it’s new and shiny doesn’t necessarily mean that it is actually better.

Linus Live-Codes Music On The Commodore 64

In this tremendously educational video, [Linus Åkesson] takes us through how he develops a synthesizer and a sequencer and editor for it on the Commodore 64, all in BASIC. While this sounds easy, [Linus] is doing this in hard mode: all of the audio is generated by POKE, and it gets crazier from there. If you’re one of those people out there who think that BASIC is a limited language, you need to watch this video.

[Linus] can do anything with POKE. On a simple computer like the C64, the sound chip, the screen chips, and even the interrupts that control program flow are all accessible simply by writing to the right part of memory. So the main loop here simply runs through a lot of data, POKEing it into memory and turning the sound chip on and off. There’s also a counter running inside the C64 that he uses to point into a pitch lookup table in the code.

But the inception part comes when he designs the sequencer and editor. Because C64 BASIC already has an interactive code editor, he hijacks this for his music editor. The final sequencer interface exists inside the program itself, and he writes music in the code, in real time, using things like LIST and editing. (Code is data, and data is code.) Add in a noise drum hack, and you’ve got some classic chiptuney sounds by the end.

We love [Linus]’s minimal C64 exercises, and this one gets maximal effect out of a running C64 BASIC environment. But that’s so much code in comparison to his 256-byte “A Mind is Born” demo. But to get that done, he had to use assembly.

Thanks [zogzog] for the great tip!

Continue reading “Linus Live-Codes Music On The Commodore 64”

C64 Gets A Graphics Upgrade Courtesy Of Your Favorite Piano Manufacturer

The Commodore 64 was quite a machine in its time, though a modern assessment would say that it’s severely lacking in the graphical department. [Vossi] has whipped up a bit of an upgrade for the C64 and C128, in the form of a graphics expansion card running Yamaha hardware.

As you might expect, the expansion is designed to fit neatly into a C64 cartridge slot. The card runs the Yamaha V9958—the video display processor known for its appearance in the MSX2+ computers. In this case, it’s paired with a healthy 128 kB of video RAM so it can really do its thing. The V9958 has an analog RGB output that can be set for PAL or NTSC operation, and can perform at resolutions up to 512×212 or even 512×424 interlaced. Naturally, it needs to be hooked directly up to a compatible screen, like a 1084, or one with SCART input. [Vossi] took the time to create some demos of the chip’s capabilities, drawing various graphics in a way that the C64 couldn’t readily achieve on its own.

It’s a build that almost feels like its from an alternate universe, where Yamaha decided to whip up a third-party graphics upgrade for the C64. That didn’t happen, but stranger team ups have occurred over the years.

[Thanks to Stephen Walters for the tip!]

New Release Of Vision Basic: Hot New Features!

As the Commodore 64 ages, it seems to be taking on a second life. Case in point: Vision BASIC is a customized, special version of the BASIC programming language with a ton of features to enable Commodore 64 programs to be written more easily and with all sorts of optimizations. We’ve tested out both the original 1.0 version of Vision BASIC, and now with version 1.1 being released there are a whole host of tweaks and updates to make the experience even better!

One of the only limitation of Vision BASIC is the requirement for expanded RAM. It will not run on an unexpanded C64 — but the compiled programs will, so you can easily distribute software made using Vision on any C64. A feature introduced in version 1.1 is support for GeoRAM, a different RAM expansion cartridge, and modern versions of GeoRAM like the NeoRAM which has battery-backed RAM. This allows almost instantaneous booting into the Vision BASIC development environment.

Some of the standout features include a doubling of compilation speed, which is huge for large programs that take up many REU segments in source form. There are new commands, including ALLMOBS for setting up all sprites with a single command; POLL to set up which joystick port is in use; CATCH to wait for a particular scanline; and plenty more! Many existing commands have been improved as well. As in the original version of Vision BASIC, you can freely mix 6510 assembly and BASIC wherever you want. You can use the built-in commands for bitmaps, including panning, collision detection, etc., or you can handle it in assembly if you want! And of course, it comes with a full manual — yes, a real, printed book!

One of the nice features of Vision BASIC is the customization of the development environment. On the first run, after agreeing to the software terms, you enter your name and it gets saved to the Vision BASIC disk. Then, every time you start the software up, it greets you by name! You can also set up a custom colour scheme, which also gets saved. It’s a very pleasant environment to work in. Depending on how much additional RAM you have, you can hold multiple program segments in different RAM banks. For example, you could have all your source code in one bank, all your bitmaps and sprites in another, and your SID tunes in yet another. The compiler handles all this for you when you go to compile the program to disk, so it’s easy to keep large programs organized and easy to follow.

If you’ve always wanted to write a game or application for the C64 but just didn’t know how to get started, or you felt daunted at having to learn assembly to do sprites and music, Vision BASIC is a great option. You will be blown away at the number of commands available, and as you become more experienced you can start to sprinkle in assembly to optimize certain parts of your code if desired.

The Commodordion Gets A Big Usability Upgrade

The chiptune scene is dominated by Game Boys and other Nintendo hardware, but one should never forget the gorgeous, beautiful tones that come from the hallowed Commodore 64. [Linus Åkesson] knows this well, and it’s at the heart of his work on the Commodordion. Now, he’s built an even better version.

The original idea he had was to build an accordion-like control surface for the SID chip in a Commodore 64. The device is capable of creating beautiful accordion-like music with a simple 8-bit flair. He has since dubbed the original Commodordion the “bass Commodordion,” while the new version is classified as a tenor instrument.

The prime upgrades are ergonomic. The previous instrument was too heavy, with the left hand having to carry an entire Commodore 64 on its own. It was also hard to reach the keys. The new version is much lighter, with one of the two C64s of the original having been removed. The supporting electronics have been redesigned to more neatly fit into a space behind the bellows.

The result is a machine that’s far easier to play, and one that won’t injure the user in extended play sessions. “It’s now a pleasure, not a pain,” says [Linus]. The payoff in usability is obvious, and the tunes themselves are hauntingly beautiful.

We first covered the Commordordion back in 2022, but it wasn’t the first time we saw one of [Linus]’s impressive creations.

Continue reading “The Commodordion Gets A Big Usability Upgrade”

You Can Program AVRs From The Commodore 64

These days, most of our microcontroller boards come with bootloaders so you can squirt hex into them straight over USB. However, you don’t need to do things this way. If you’re more old school, you can program your AVRs right from a Commodore 64. [Linus Akesson] shows us how.

Programming an AVR isn’t that hard. By holding the chip in reset, it’s possible to flash code via a serial protocol using just three wires. However, that’s pretty impractical to do with modern PCs — they don’t come with addressable IO pins anymore. Normally, you’d use a dedicated programmer to do the job, but [Linus] found his had died on a Friday night. So he set about turning his C64 into one instead.

He decided to use the pins of the C64’s Joystick Port 2, with pins 1, 2, 3, and 4 hooked up to SCK, MOSI, Reset, and MISO on the AVR, respectively. 5 V and Ground were also provided courtesy of the C64’s port. He then whipped up a simple bit of assembly code to read a bit of AVR hex and spit it out over the Joystick port following the in-circuit programming protocol. With a 1541 Ultimate to load files on to the C64 in hand, it was easy to pull his compiled AVR program off his modern PC, chuck it on the C64, and then get the old Commodore to program the AVR in turn.

It’s not the first time [Linus] has wowed us with a C64 in hand. If you’ve got your own fresh projects for the best-selling computer of all time, don’t hesitate to let us know!