virtualc64
virtualc64 copied to clipboard
Replace all calls to rand() by calls to a custom randomizer
VirtualC64 calls rand()
at multiple places. Although the returned sequences are deterministic, this causes issues in run-ahead mode, since both instances would query different numbers and diverge.
TODO: Implement a new Randomizer class that returns a deterministic pseudo-random sequence and instantiate this class in both the main instance and the run-ahead instance.
Fun fact: Bugs related to run-ahead mode result in funny behavior due to diverging emulator instances. In Barry McGuigan World Championship Boxing, I've thought to have knocked out my opponent.
However, this only happened in the run-ahead instance. After the next resync, I've been lying on the ground and lost the fight.