A very important component of any demo is having a kick arse SID chip track backing it. That means, we need to be able to play a track while performing some mastery of the raster bar. It was something I was dreading looking at, but turned out to be a very straight forward thing and only ended up taking about 10 minutes to get working.
Having done some work with interrupts now, I’ve realised just how powerful they can be for demo coding and how time sensitive some effects / routines are. I’ve looked at a few different ways to set them up and thought I’d recap.
Interrupts occur every 60th of a second. On the C64, memory locations $0314 and $0315 (788 & 789 in decimal) contain a vector to the execution address of the normal interrupt service routine. The default values here are $31 (49) and $ea (234), which form $ea31.
Time to start getting familiar with using the zero page and use an interrupt for some simple effects. I decided to create a basic colour cycle effect that updates the colour map, shifting the character colours in a direction. Back in the day, I couldn’t get my head around how to actually achieve this via assembly language, but I’ve had a lot of experience in programming since then, so have a much better idea of how to achieve the effect.