There are still some failures on the SBCD, but the logic is identical to other emulator's calculations, but the test case doesn't seem to be the way it should behave, so I'll leave it for now