2026-04-19 C64 retro machine TL;DR: In this phlog post I explain how I set up a functioning development enviroment for 6502 assembler on a dedicated C64 replica machine. I describe the problems I encountered and how I got around them. Lastly I muse on how this different approach to computing changed my programming expierence. Introduction ============ I love retro computing as much as I love retro gaming. My absolute favorite micro-computer is the Commodore 64 from 1982. I'm not sure where this strange affection stems from since I'm a bit too young to have experienced it first-hand. Nonetheless, I like the C64 for its simplicity but also for its jankiness. I very much enjoy the sound of the SID chip and often find myself in awe looking at what the demoscene is capable of getting out of this 1Mhz machine. Last but not least I'm kind of obsessed with the MOS 6502, a really simple, cost-effective 8-bit micro-processor which was ubiquitous in the 1980s. I knew that I'm too much of a smooth brain to become a serious demoscener myself but still I felt the urge to write some fun little programs in BASIC and 6502 assembler for recreational purposes. So naturally, I started using the VICE[1] emulator to find my way around things. This was viable but also felt not like the real deal. I'm not talking about hardware vs emualtion but rather about my interaction with the medium. I wrote all my code in Emacs, compiled it with a cross-assembler and had my Makefile auto-start the program in VICE. I had created a modern workflow for a retro-machine but what I really wanted was a genuine retro-feeling. In my opinion this entails writing code directly on the C64 and without all the distractions of a modern PC. So, what were my options? I'm not a hardware guy so I didn't want to fool around with failing, 40 year old technology. The new Commodore Ultimate64[1] was too expensive for my taste and running VICE on my beefy desktop PC just felt wrong. That's when I stumbled upon a cool project called bmc64. Quoting directly from the project page[3]: BMC64 is a bare metal fork of VICE's C64 emulator optimized for the Raspberry Pi 3. (It will also work on RPi 2 and Zero models with reduced performance for some features.) It has 50hz/60hz smooth scrolling, low video/audio latency and a number of other features that make it perfect for building your own C64 replica machine. For more details visit the github link below. I happened to have an old RPi 3B+ in my drawer collection dust. So I set out to set it up as a C64-development-machine. Here is how I have done it: Machine setup ============= 1. bmc64 I followed the instructions on the project page and got the emulator up and running in no time. I boots in only a few seconds and when you're done with it you just turn it off (I really appreciate this immediacy). Pressing F12 will open an overlay menu with options for attaching disk drives and cartridges, configuring joysticks, savestate management, etc. 2. PAL assembler I stumbled upon a very small channel on YouTube where some boomer-furry from Canada shows off his C64 programming projects[4]. He does all his development on a real C64 using the PAL assembler. I never heard of this program before but it was easy enough to acquire[5]. The cool thing about the PAL assembler is that you can use the default screen editor to write your programs. Here is a very bare-bones example: 10 SYS700 20 .OPT P,OO 30 INC $D020 40 RTS `RUN` will assemble the program at the default memory location $C000. You can then call it with `SYS49152`. A simple loop using inline labels looks like this: 30 LDX #$FF 40 LOOP DEX 50 BNE LOOP If you also want to go down this path I really recommend reading the manual[6]. 3. EPYX FastLoad The disk drive on C64 is extremely slow so a fast loader is mandatory. One of the most popular ones is the fast loader from EPYX[7]. It also comes with memory monitor program which is essential for debugging. Loading two programs at the same time on a C64 is kind of tricky. The user is responsible for making sure that multiple loaded programs will not interfere with each other. I configured bmc64 to load the fast loader cartridge on boot. Simply entering `!` will start the monitor. But there is a problem: if I use the monitor and then call back to PAL by entering `RUN` the monitor unexpectedly starts again! Let's have a look the first instruction of the assembler program 10 SYS700 This will call machine code at memory location 700 ($02BC in hexadecimal). If I use the monitor to look a this address I get this 4C 32 8F (disassembled: JMP $8F32 = 36658). So `SYS700` is just executing this jump instruction which loads the address where PAL is located. Depending on the memory configuration of the machine this load-address can vary but on a stock C64 its safe to assume that PAL lives at $8F32. To circumvent this problem I just replaced `SYS700` with `SYS36658` at the start of my assembler program. Now I can use both the assembler and the monitor alternately. The actual usage of the fast loader is described in the manual[8]. But be cautious: there is also circulating a text-only manual which is wrong in some places. The loader includes a menu for file operations which can be opened by pressing the £-key but in the text-only manual `£` shows up as `#`. You also need the £-key to show the registers when using the monitor. And here comes the next problem: I could not produce the £-symbol on my keyboard (us-layout, symbolic mapping). But I found a solution. On the SD-card in the C64 folder there is a keyboard configuration file called `rpi_sym.vkm`. Here I added this line where the keybindings are defined: backslash 6 0 0 /* \ -> £ */ This maps backslash to the british pound symbol. I can't guarantee that this will not overwrite another key but so far I encountered no problems. The programming experience ========================== With the machine set up I can now write programs like it was done in the olden days. Using the C64 screen editor, fumbling around with line numbers and using a real physical book as programming reference. Now the big questions is why did I do this to myself? Basically I made my life as hard as possible by introducing extra friction around every corner. But, as it is so often, these limitations lead to new insights. Since it is just such a pain to use this setup I now have to THINK before I write. For exmaple I never EVER in my life drew flow charts for my programs! But guess what, now I do because have to. I can only see at best 25 screen lines of my program at once and need a way keep its overall structure in my mind at all times. Furthermore I now use pen and paper to jolt down the first draft of my code. While in a text editor you are constrained by the linear nature of the text flow on paper anything goes: writing code snippets left and right, adding small charts, truth tables, annotations... This really is amazing and for this early stage you don't even need a computer to program. Finally free XD Conclusion ========== There you have it. A fully functional development environment for 6502 assembler on a dedicated C64 replica machine. No distractions, no internet, no multi-tasking. Just you and the machine ready for your creative endeavors. Footnotes ========= [1] https://vice-emu.sourceforge.io/ [2] https://www.commodore.net/ [3] https://accentual.com/bmc64/ [4] Lupe Darksnout (https://www.youtube.com/channel/UClI80Kz0pMoEk9SU9KF4wAw) [5] https://csdb.dk/release/?id=18294 [6] https://ist.uwaterloo.ca/~schepers/PAL.TXT [7] https://commodore.software/downloads/download/178-utility-cartridges-roms/13785-epyx-fastload-cartridge-v2-roms [8] https://support.retrorewind.ca/_media/commodore/c64/epyx_fastload_manual.pdf