Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Error in THUMB mode SBC carry flag setting #1818
I wrote a test ROM generator (fuzzer) for the GBA, and generated some ROMs with it. Running them on mGBA shows that the way you determine your carry flag in THUMB SBC instructions does not always work. Below is the error my generated test ROM gives:
The test shifts
By the way, the ROM was tested on hardware, and it passed, just to be clear. I hope this helps!
By the way, if you want to check this for yourself, the ROM that showed this particular issue is still in the repo, but really any ROM you generate with it with enough test cases will show this issue.
Also, the way you set it for ARM ADC/SBC/RSC instructions seems to be correct, so it should be an easy fix!