[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

To unexpand a sprite in the horizontal direction, the corresponding bit in the VIC-II control register at location 53277 ($D01D in HEX) must be turned OFF (set to a 0). The following POKE "unexpands" a sprite in the X direction:

   POKE 53277,PEEK(53277)AND (255-2^SN)
where SN is the sprite number from 0 to 7.

To expand a sprite in the vertical direction, the corresponding bit in the VIC-II control register at location 53271 ($D017 in HEX) must be turned ON (set to a 1). The following POKE expands a sprite in the Y direction:

   POKE 53271,PEEK(53271)OR(2^SN)
where SN is the sprite number from 0 to 7.

To unexpand a sprite in the vertical direction, the corresponding bit in the VIC-II control register at location 53271 ($D017 in HEX) must be turned OFF (set to a 0). The following POKE "unexpands" a sprite in the Y direction:

   POKE 53271,PEEK(53271)AND (255-2^SN)
where SN is the sprite number from 0 to 7.

SPRITE POSITIONING

Once you've made a sprite you want to be able to move it around the screen. To do this, your Commodore 64 uses three positioning registers:

  1. SPRITE X POSITION REGISTER
  2. SPRITE Y POSITION REGISTER
  3. MOST SIGNIFICANT BIT X POSITION REGISTER

Each sprite has an X position register, a Y position register, and a bit in the X most significant bit register. This lets you position your sprites very accurately. You can place your sprite in 512 possible X positions and 256 possible Y positions.

The X and Y position registers work together, in pairs, as a team. The locations of the X and Y registers appear in the memory map as follows: First is the X register for sprite 0, then the Y register for sprite 0.


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated May 12, 2002.