Encounter: Quantum bug

Channel:
Subscribers:
675
Published on ● Video Link: https://www.youtube.com/watch?v=Et6X_1gquFM



Duration: 0:00
236 views
8


In the process of implementing the complete joystick/controller driven interactions, I ended up running out of memory on the machine.

One way to solve that was to convert some of the heaviest functions from C to assembler, and one candidate was the display of the objets in the scene which needs to handle comma separators, and view scrolling when it does not fit.

Except after converting to assembler the scrolling ended up displaying the objects incorrectly... and as you can see on the video, just adding a print of the variables involved solve the issue.

sprintf((char*)0xbb80+40*27,"MaxOffset:%d Offset:%d ",gInventoryMaxOffset,gInventoryOffset);

This is often called "Quantum bug" or "Eisenbug", the type of bug that disappear when you try to debug it (ie: when it's observed).

And yes, it's probably some side effect of something somewhere introduce sometimes by someone.

Just need to find it.