Commodore 64 Video Revisited
An Update From Jim Butterfield
The programs given in "Commodore 64 Video – A Guided Tour," Parts 6 and 7 (July and August, 1983), work fine on my machine, and will work well on many earlier model Commodore 64 machines. On the newer machines, there's a problem that can be solved by adding the extra line:
90 POKE 53265, 27
Here's the problem: In newer models of the 64, the computer actually does its own raster interrupt at time of power-up. This is done for a peculiar reason: The computer wants to know if it's a European model or not.
As TV technicians will tell you, North American television has 525 scan lines, whereas the European PAL system has well over 600. The computer's internal clock also runs at a slightly different speed. But the ROM is the same in both systems.
Now, the ROM needs to know whether it's working within a European or North American system, since it will want to time certain events (realtime clock, communications speeds, cassette tape) at a constant speed regardless of its internal clock rate. So at time of power-up, it commands: "Tell me when I reach line 622 of the screen." (The actual value it uses is 311, since scan lines are "twinned.")
Some time later, the computer asks, "Has line 622 showed up?" If the answer is yes, the computer knows it must be on a European system. If the answer is no, the computer decides that this must be the North American system, which doesn't have 622 lines on the screen. Now the computer can fix up its timing tables.
In the meantime, it has left the raster register with a high number in place. To make the split programs in Parts 6 and 7 work, we must take this high number out. Address 53266 handles most of the raster register, and it's all we need to do the job specified. But first we must clean out that high bit in address 53265 with a POKE value of 27.
If this seems rather complex, don't worry about it. Just add the line 90 POKE 53265,27 to all programs, and everything should behave correctly.