GERLA.CC

tutorial · commodore 64 · mac

How to make a Commodore 64 game on a Mac

The tools you need, from the bare minimum to what it takes to measure, all free. Writing a C64 game today doesn't mean working on a C64: you write on the Mac, you test in an emulator, and the real C64, if you have one, is the final check. This is the chain Ruote Fumanti was built with.

The editor is just the place where the code gets written. To get to a file the C64 will load you need a few other pieces, and most of them install with Homebrew, the macOS package manager, in a single command:

brew install acme exomizer vice python git ffmpeg
01 · the bare minimum

Write, build, test

With these four you write, build with one command and test the game.

whatwhat it's for, and with what
Editorwriting the assembly: Visual Studio Code with the VS64 extension (source), which understands ACME, KickAssembler and cc65 and hooks into VICE for debugging
Assemblerturning the .asm source into a .prg file: ACME, the one used for Ruote Fumanti. Alternatively KickAssembler (needs Java) or ca65, inside cc65
Emulatortesting the game, pausing it, reading memory with the monitor: VICE, x64sc in particular, the most accurate. VICE also brings c1541, which builds .d64 disk images
Crunchergetting a single small file that unpacks itself: Exomizer

The work cycle is always the same: write in VS Code, build with ACME, crunch with Exomizer, open the .prg in VICE.

VS Code open on the Ruote Fumanti source

VS Code on the game folder: sources in src/ on the left, native.asm on the right, open at the routine that scrolls the road, the one told in how the road scrolls.

The build: ACME and Exomizer

make rebuilds everything: ACME assembles, Exomizer crunches. At the bottom the memory map: 61 KB of game become a 24 KB file that unpacks itself.

Ruote Fumanti in VICE

the PRG in VICE (x64sc), on track 3. Bottom left, the thing that matters: 50.1 frames a second.

02 · a complete game

What you need beyond the code

whatwhat it's for, and with what
Scriptinggenerating data and tables, converting graphics, checking the build: Python, with Pillow to read and write images
Automationrebuilding everything with one command: make, which comes with Apple's command line tools (xcode-select --install), or VS Code tasks
Versionsgoing back, comparing, losing nothing: Git
Spritedrawing sprites within the C64's limits: Spritemate, which runs in the browser (source)
Charactersthe character set, tiles and levels: VChar64, also for Mac
Imagesscreens and pictures in the C64's colours and resolutions: Multipaint
Musiccomposing for the SID: GoatTracker 2 (there's a Mac version), or SID-Wizard, which runs inside the C64 or the emulator
The jump sprites in Spritemate

Spritemate with Ruote Fumanti's fifteen jump sprites: the car in seven sizes, each with two wheel phases, plus the shadow. If sprites are new to you, they're explained from scratch in C64 sprites.

Music doesn't have to go through a tracker: in Ruote Fumanti the tune is written as text, one line per voice, and a Python script turns it into SID data.

03 · measuring

To measure instead of eyeballing

This is the part that separates "it seems to work" from "it works, and it can be shown".

whatwhat it's for, and with what
CPU in Pythontesting pieces of code without opening the emulator: load the program, call a routine, check the registers: py65
Scripted emulatorletting a program drive the game, reading memory every frame, counting dropped frames, taking screenshots: the remote monitor of VICE (-remotemonitor option), driven from Python
Videoclips for the game page, with audio recorded by the emulator: FFmpeg
Second emulatormaking sure the game doesn't only work in VICE: VirtualC64, native on Mac
Real C64the final test, with a flash cartridge such as Kung Fu Flash, or an Ultimate 64
Tests on a 6502 CPU with py65

py65 tests the M and F keys and the engines without opening the emulator: the keyboard is fake, the code is the game's real code. Every line is a check, and at the bottom FALLITE 0, zero failures.

The VICE monitor on the running game

VICE's monitor, driven by a script, halts the game mid-race: the CPU registers, the scrolling code disassembled, and the variables' memory. The instructions from $14f5 down are the .fine routine seen from inside the machine.

Measuring with VICE driven by Python

the 1.0.2 measurements: dropped frames out of 3000, how long the police car stays on you, and what happens at the end of the track.

The four terminal screenshots are rebuilt as images from the commands' real output; the others are direct captures of the programs.

04 · publishing

Getting it to the people who play it

whatwith what
Page and downloaditch.io
Uploading filesbutler, itch.io's official command line tool
The C64 sceneCSDb, the scene database
in short

Three levels

  • to start VS Code, ACME, VICE, Exomizer
  • for a real game plus Python, make, Git, and editors for sprites, characters and music
  • to know it works py65, scripted VICE, a second emulator, and a real C64 when you can

← All tutorials Ruote Fumanti →