Jump to content
IGNORED

Sprites on C64.


CrazyBoss

Recommended Posts

Hello.

 

I stated to dig a bit into how C64 graphics works. As I understand there are 8 sprites. And they are 24x21 pixels. Right ?

 

I have programmed on the TMS99X8 VDP (Memotech, ColecoVision, MSX) and a bit on Intellivision. I think its a bit confusing why its 24x21 pixels ?

 

So I can display 8 sprites at the time each is 24x21 pixels ? - I wonder why its not 24x24 pixels. By anyway, look forword to learn more about the C64 and its graphics :)

 

Link to comment
Share on other sites

24 x 21 bits is 3 bytes x 21 = 63 bytes.

24 x 24 would be 3 x 24 = 72

 

The first fits nicely into memory along binary boundaries (2,4,8,16,32,64).

The second, not so much.

 

Thus, the first allows the VIC-II to make a rule: sprite data must be aligned on a 64 byte boundary

Then, the pointer for the sprite data doesn't need to store the lower 6 bits of the address, since it will always be 0.

 

 

  • Like 3
Link to comment
Share on other sites

Also in comparison, the VDP only does 16x16 pixel sprites so you get 97% more pixels per sprite on the C64. Note that just like the VDP, you can in principle multiplex the 8 hardware sprites on multiple lines across the screen, but it requires raster synchronized timing and may introduce flickering. Also remember that each sprite optionally can be drawn in multicolour mode which halves the horizontal resolution to 12x21 but lets you use three foreground colours (one per sprite, two common for all sprites) per sprite without putting multiple on top of eachother like you would do on VDP, STIC etc. And yes, you can expand sprites to double height and/or width, though each pixel then is twice as big.

Link to comment
Share on other sites

  • 3 weeks later...
On 2/24/2021 at 5:24 PM, brain said:

Thus, the first allows the VIC-II to make a rule: sprite data must be aligned on a 64 byte boundary

Then, the pointer for the sprite data doesn't need to store the lower 6 bits of the address, since it will always be 0.

Also, sprite addresses are relative to the current VIC-II bank (16 KB in size), meaning that the top 2 bits of a full 16-bit address aren't needed either.  The total savings of 6+2 bits means that each sprite pointer fits in exactly one byte, which is neat and efficient.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...