Commodore 64 Fast Bitmap Scrolling Techniques: HSP/DMA Delay and Line Crunching Explained with Debugging

Martin Piper

Summary:

This video details advanced bitmap scrolling techniques on the Commodore 64, breaking down how complex demo effects are achieved without solely relying on CPU memory manipulation. It explores techniques like Horizontal Screen Positioning (HSP) or DMA delay, which involves precisely timed updates to the VIC chip's screen control register (D011) to trigger a "bad line" state mid-raster line, forcing the VIC chip to fetch character data earlier and shift the display horizontally. It also covers "line crunching" for vertical scrolling, where the VIC chip is tricked into prematurely fetching new character rows, effectively "crunching" 8 pixel lines into one. These methods are often combined, as demonstrated by a dynamic, free-form bitmap scrolling effect, with debugging insights showing real-time register changes and CPU pauses.

Commodore 64 fast bitmap scrolling combining horizontal and vertical techniques
Commodore 64 fast bitmap scrolling combining horizontal and vertical techniques [ 00:29:25 ]

Introduction to Commodore 64 Bitmap Scrolling [00:00:00]

The video explores techniques for fast bitmap scrolling on the Commodore 64 (C64), which is challenging due to the large memory footprint (10,000 bytes per screen) that would overburden the CPU if scrolled conventionally.

Horizontal Bitmap Scrolling: HSP/DMA Delay Technique [00:02:43]

This technique, also known as Horizontal Screen Positioning (HSP) or DMA delay, is demonstrated with a "fist" graphic scrolling horizontally.

Vertical Bitmap Scrolling: Line Crunching Technique [00:13:57]

This technique, often called "line crunching," enables very fast vertical scrolling of bitmap screens.

Combined Horizontal and Vertical Scrolling (Any Given Screen Position - AGSP / Variable Screen Position - VSP) [00:28:46]

This section showcases a demo (the "Bones" logo) that combines both the HSP/DMA delay and line crunching techniques to achieve dynamic, multi-directional bitmap scrolling.

Example Code and Resources [00:42:00]

The video concludes by providing a practical example of the combined techniques in C64 assembly code.