amaiorano / vectrexy

A Vectrex emulator written in modern C++
MIT License
50 stars 9 forks source link

ASL overflow flag #1

Closed binji closed 6 years ago

binji commented 6 years ago

Hi, just found this video series and am enjoying it so far! I was watching episode one and noticed that the overflow flag calculation for OpASL is wrong:

        CC.Overflow = (origValue >> 7) ^ (origValue >> 6);

origValue >> 6 needs to be masked or you'll set the overflow flag when it shouldn't be. For example if origValue is 0b11000000, then you'll get 1 ^ 3 == 2 instead of 1 ^ 1 == 0.

amaiorano commented 6 years ago

Thank you very much! I fixed the issue and gave you credit in the commit message: https://github.com/amaiorano/vectrexy/commit/b95ba15c3f5c29d5762d1e1ce16030dcaf6a2b86

Glad you're enjoying the series :)