Building a C64 from Scratch: Text and BASIC

154

Booting BASIC with Custom Hardware

In the third episode of his series, Building a C64, DrMattRegan hits a major milestone. He successfully boots Commodore BASIC using hand-wired logic and EPROMs. The machine runs without a single original Commodore 64 chip. For retro computing fans, this episode delivers both technical depth and visible progress.

Raster Timing and Memory Explained

Regan begins with a deep dive into raster timing. He shows how the VIC-II chip tracks scanlines based on clock cycles. Using this approach, he simulates beam position through what he calls “dead reckoning.” This allows the video generator to stay in sync with the CPU.

He then contrasts static RAM and dynamic RAM. The VIC-20 used static RAM, but the C64 moved to DRAM. Regan explains this change using transistor counts and refresh cycles. DRAM offered more memory with fewer transistors, a necessity for building a C64 with 64KB.

Managing CPU and Video Timing

The 6510 CPU and the VIC-II chip share memory. This creates a challenge. The VIC-II must steal cycles without crashing the CPU. Regan solves this by implementing shadow RAM. Using latches and flip-flops, he queues writes when the CPU and video hardware compete for memory access.

This strategy ensures stable video output. Even better, it lets the CPU keep running at full speed.

Handling Memory Mapping and I/O Ports

The 6510 CPU includes a 6-bit I/O port. This port controls which ROM or RAM blocks are visible in the memory map. Without it, the system cannot boot.

Since Regan’s system uses a soft CPU core, he injects an I/O write at the start of boot. This sets the correct memory map. It ensures the KERNAL and BASIC ROMs are available before the reset vector runs.

The Blue Screen Arrives

After burning ROMs and hardwiring the video path, Regan flips the switch. At first, nothing works. But after a few tweaks, the familiar Commodore 64 blue screen appears. BASIC is running on custom hardware.

Although the keyboard and interrupts are not yet active, this moment proves the build works. The C64 is alive — recreated from logic gates, EPROMs, and a Turing-complete CPU.

What’s Next in the Build?

This episode wraps up the first “epoch” of the project. Regan teases sprite logic for the next stage. A prototype board already supports two sprites with shadow RAM. He plans to integrate this soon.

Conclusion

Building a C64 is more than a technical experiment. It’s a love letter to an iconic machine. Regan’s clear explanations make the complex circuitry understandable. For hardware hackers and retro fans, this video is a must-watch.

Click Here to watch the previous episode of this series.

Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments