Back to Made with Claude Code

Commodore 64 Terminal: Authentic Display & Colors

Building a pixel-perfect C64 terminal emulator required research into the VIC-II chip's specifications and accurate color reproduction.

The Challenge

The Commodore 64, released in 1982, was one of the most popular home computers of all time. To create an authentic terminal emulator, we needed to match two critical specifications: the exact screen dimensions and the scientifically accurate color palette.

40 Columns × 25 Rows

The C64's VIC-II video chip displayed text in a fixed grid of 40 columns by 25 rows, with each character occupying an 8×8 pixel block. This gave a total screen resolution of 320×200 pixels.

Screen Width
40 columns
Screen Height
25 rows
Character Size
8×8 pixels
Total Resolution
320×200 px

Implementation: We use CSS calc() to dynamically scale the font size based on viewport width, ensuring exactly 40 characters fit across the screen:

/* Calculate font size for 40-column display */
font-size: calc((100vw - padding) / (40 * 0.6));

/* 0.6 = monospace character width-to-height ratio */

The Pepto Palette

The C64's color palette has been a subject of debate for decades. The VIC-II chip output colors in YUV color space for PAL/NTSC television systems, and converting this to RGB for modern displays is not straightforward.

The most scientifically accurate palette is the Pepto palette, created by Philip "Pepto" Timmermann through detailed analysis of the VIC-II chip's color generation, including proper gamma correction for modern displays.

Complete 16-Color Palette

Black
#000000
White
#FFFFFF
Red
#68372B
Cyan
#70A4B2
Purple
#6F3D86
Green
#588D43
Blue
#352879
Yellow
#B8C76F
Orange
#6F4F25
Brown
#433900
Light Red
#9A6759
Dark Grey
#444444
Grey
#6C6C6C
Light Green
#9AD284
Light Blue
#6C5EB5
Light Grey
#959595

Implementation Details

Our C64 terminal uses the classic blue background (#352879) with light blue text (#6C5EB5), matching the default C64 boot screen that millions of users remember.

Additional visual authenticity comes from proper line spacing, matching the original boot sequence text, and implementing the characteristic C64 cursor as a solid block.

References

Pepto's C64 Color Analysis
Comprehensive article on calculating the VIC-II color palette with gamma correction.

C64-Wiki: Color
Documentation of the Commodore 64's 16-color palette.

C64-Wiki: Standard Character Mode
Technical details on the 40×25 character display mode.