commanderx16 / x16-emulator

Emulator for the Commander X16 8-bit computer
383 stars 60 forks source link

Clear sprite buffer when disabling sprites in VERA #465

Closed jestin closed 1 year ago

jestin commented 1 year ago

I noticed that when a raster line interrupt occurs on a line where a sprite is being drawn, and the the sprites are disable during that interrupt, the sprite continues to draw what was in the buffer for that line.

image

To fix this, we can clear the sprite buffers when sprites are disabled by a vera register write. This is the same clearing that happens per-line when rendering sprites, except we don't replace the pixels.

Here's what it now looks like with this fix in place, which is how it looks on box16 as well as on real VERA hardware:

image

indigodarkwolf commented 1 year ago

Yep, that looks like a reasonable fix. Thanks!