OneLoneCoder / olcNES

NES Emulator, and Tutorial Video Code
1.35k stars 225 forks source link

Fix display bug for jumping back negative amounts #26

Closed hamhub7 closed 4 years ago

hamhub7 commented 4 years ago

The bug here is that javidx9 assumes that the value is unsigned, but in relative addressing mode it is signed. Instead of adding always, we subtract in the cases where the value is negative using 2's complement. This seems to work great.

hamhub7 commented 4 years ago

This was corrected in the next video, linked here: https://youtu.be/xdzOvpYPmGE?t=2340