dirkwhoffmann / virtualc64

VirtualC64 is a cycle-accurate C64 emulator for macOS
https://dirkwhoffmann.github.io/virtualc64
Other
356 stars 33 forks source link

VICE test sprite0move fails in V3.2 alpha 8 #473

Closed dirkwhoffmann closed 5 years ago

dirkwhoffmann commented 5 years ago

VICE:

bildschirmfoto 2018-11-24 um 13 31 44

VirtualC64:

bildschirmfoto 2018-11-24 um 13 30 31

Might be related to #387

dirkwhoffmann commented 5 years ago

Was broken with commit f5b416a85e8f644ea8013b7396a46cfedfc86b8b

dirkwhoffmann commented 5 years ago

Had to roll back one of the VICII speed optimizations. In the optimized version, the zBuffer and the pixelSource were not reset after each cycle, but only after those cycles that access these variables. Unfortunately this leads to less robust, error-prone code. To fix the issue, I replaced

#define END_CYCLE \
 dataBusPhi2 = 0xFF; \
 xCounter += 8; \
 if (unlikely(delay)) { processDelayedActions(); }

by the previous implementation:

#define END_CYCLE \
 dataBusPhi2 = 0xFF; \
 xCounter += 8; \
 for (unsigned i = 0; i < 8; i++) { zBuffer[i] = pixelSource[i] = 0; } \
 if (unlikely(delay)) { processDelayedActions(); }
dirkwhoffmann commented 5 years ago

Bug was not related to #387

dirkwhoffmann commented 5 years ago

There is another bug in this test case: Move sprite to the right until X coord reaches 014E:

bildschirmfoto 2018-11-25 um 12 15 35

Broken with commit e32a43d142873379752ec5cb286f6a95d6248ae1

dirkwhoffmann commented 5 years ago

3.2 alpha 10 seems to fix the issue:

http://www.dirkwhoffmann.de/virtualc64/VirtualC64_3.2alpha10.zip

Alessandro1970 commented 5 years ago

Ok, this works for me too

UgoCaneFifone commented 5 years ago

It's ok for me too