Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

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

Resources

Stars

48 stars

Watchers

6 watching

Forks

Releases

Packages

Contributors

Languages