Commodore 64 Manual do Utilizador Página 36

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 83
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 35
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) + (SPRITEPOINTERVALUE* 64)
Where BANK is the 16K segment of memory that the VIC-II chip is look-
ing at and is fr~m 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 BANK0 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.
TURNING SPRITES ON
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 0
To turn on sprite 1, for example, it is necessary to turn that bit to a I.
The following POKE does this:
POKE 53269,PEEK(53269)OR 2
A more general statement would be the following:
POKE 53269,PEEK(53269}OR (2tSN)
where SN is the sprite number, from 0 to 7.
NOTE: A sprite must be turned ON before it con be seen.
134 'PROGRAMMING GRAPHICS
Vista de página 35
1 2 ... 31 32 33 34 35 36 37 38 39 40 41 ... 82 83

Comentários a estes Manuais

Sem comentários