How to have 9 sprites in rasterline

1.2k views Asked by At

Is it possible to have more than 8 sprites in a rasterline on a real Commodore 64 (not on an emulator)? the sprites don't need to be different.

3

There are 3 answers

0
Peter Kofler On BEST ANSWER

Yes it is possible using assembly in interrupts. The interrupt would be aligned to the raster of the video chip. After the first sprite has been rendered by the video chip (using NOP to wait for the necessary time), its position and shape are changed further to the right. Then the interrupt waits again until the sprite has been rendered to reset it to its original place because the nest raster needs to "see" it there.

Using this technique you can have more than 8 sprites in one raster line. The technique is similar to showing sprites in the border for the case of For sprites in the left/right borders. Instead of changing the register to make the screen less width, you need to change the x-position of the sprite.

0
wurst On

Short answer: yes. Long answer: yes, but there are some caveats:

VICII (the video chip) reads in 3 bytes of sprite data per rasterfor each of the maximum 8 hardware sprite, and the buffered data is meant to be displayed on the next raster.

If you display a hardware sprite a second time on a given raster that buffer will be empty the next raster, so on the following raster you'll end up with a transparent stripe in the sprite.

Also the sprite data fetches happen at around the end of the current raster/start of the next one, so you are pretty much limited to duplicate sprite #0 (because its data is fetched first), and even then the CRT-beam is so far on the right of the screen that you'd have to remove the sideborder to able to see the duplicate sprite visible.

0
anoniem On

There is a nice demo that does this: https://csdb.dk/release/?id=48577

In the comments below the demo there is a brief explanation:

"Since sprite 0 fetch happens in the beginning of the right border, you can move this very sprite to immediately after that fetch, and it will be displayed again, even if it has been displayed already earlier in the same line. But it cannot be displayed in the following line again before the right border, as the shift register doesn't get filled with new pattern data until the beginning of the right border on that next line. This is why this trick only works on every other line."