All Projects → jeff-1amstudios → c64-smooth-scrolling

jeff-1amstudios / c64-smooth-scrolling

Licence: other
An implementation of smoothly scrolling a character-based screen on a Commodore 64

Programming Languages

assembly
5116 projects

Smooth scrolling screen on Commodore 64

Here is some sample code to implement horizontal smooth scrolling on a C64.

The algorithm in pseudo-code is:

when_graphics_chip_is_at_line_3() {
  if (xscroll == 0) {
    shift_upper_half_of_color_ram();
  }
}

when_graphics_chip_is_at_vblank() {
   xscroll--;
   if (xscroll == 4) {
      shift_upper_half_of_screen_ram_to_back_buffer();
   }
   else if (xscroll == 2) {
      shift_lower_half_of_screen_ram_to_back_buffer();
   }
   else if (xscroll < 0) {
      swap_screen_buffer();
      shift_lower_half_of_color_ram();
      draw_next_column_to_screen_and_color_ram()
   }
}

See http://1amstudios.com/2014-12-07-c64-smooth-scrolling for more details

DustLayer is a fanstastic site devoted to C64 internals with great descriptions and tutorials. Highly recommended!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].