Egghead.page Logo

How Did the Commodore 64 Blink the Text Cursor?

This article explores the technical mechanism behind the Commodore 64’s blinking text cursor, detailing the role of the Kernal ROM, screen memory manipulation, and system timers involved in creating the iconic visual effect. By examining the interaction between the CPU and the video memory, we can understand how software routines managed to produce a steady blink without dedicated hardware support for cursor animation.

The Commodore 64 did not rely on the VIC-II video chip to handle cursor blinking automatically. Instead, the process was managed entirely by software through the system’s Kernal ROM. The cursor itself was not a hardware sprite but a specific character code stored in the screen memory, which ranged from memory addresses $0400 to $07FF. Typically, the cursor was represented as a reverse-video space character. To make this block appear and disappear, the Kernal routine had to periodically modify the byte value stored at the current cursor position in the screen RAM.

To regulate the speed of the blink, the Kernal utilized a memory-based counter located at address $0286. This counter was decremented during the main input loop or via interrupt-driven processes. When the counter reached zero, the Kernal triggered the blink routine. This routine would read the current value at the cursor’s screen memory location and toggle the most significant bit (bit 7). Toggling this bit switched the character between its reverse-video state and its normal state, effectively making the cursor vanish and reappear against the background.

Once the toggle was complete, the counter at $0286 was reset to a predefined value, determining the duration until the next blink cycle. This software-driven approach allowed for flexibility, as programmers could modify the memory values to change the blink rate or disable the blink entirely for specific applications. Although this method relied on the CPU rather than dedicated video hardware, it was efficient enough to maintain a consistent visual rhythm without noticeably impacting the system’s overall performance during standard text input operations.