If sprite pointer #0, at location 2040, contains the number 14, for example, this means that sprite 0 will be displayed using the 64 bytes beginning at location 14*64 = 896 which is in the cassette buffer. The following formula makes this clear:
LOCATION = (BANK * 16384) + (SPRITE POINTER VALUE * 64)Where BANK is the 16K segment of memory that the VIC-II chip is looking at and is from 0 to 3.
The above formula gives the start of the 64 bytes of the sprite definition block.
When the VIC-II chip is looking at BANK 0 or BANK 2, there is a ROM IMAGE of the character set present in certain locations, as mentioned before. Sprite definitions can NOT be placed there. If for some reason you need more than 128 different sprite definitions, you should use one of the banks without the ROM IMAGE, 1 or 3.
The VIC-II control register at location 53269 ($D015 in HEX) is known as the SPRITE ENABLE register. Each of the sprites has a bit in this register which controls whether that sprite is ON or OFF. The register looks like this:
$D015 7 6 5 4 3 2 1 0To turn on sprite 1, for example, it is necessary to turn that bit to a 1. The following POKE does this:
POKE 53269.PEEK(53269)OR 2A more general statement would be the following:
POKE 53269,PEEK(53269)OR (2^SN)where SN is the sprite number, from 0 to 7.
|NOTE:A sprite must be turned ON before it can be seen.|
|This page has been created by Sami Rautiainen.|
|Read the small print.||Last updated May 12, 2002.|