Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADC/SBC buggy? #5

Closed
GrantMeStrength opened this issue Mar 24, 2021 · 3 comments
Closed

ADC/SBC buggy? #5

GrantMeStrength opened this issue Mar 24, 2021 · 3 comments

Comments

@GrantMeStrength
Copy link

Hi -

I am wondering if you have checked your (beautifully neat) 6502 implementation against a respected test such as Klaus2m5?

I ask because I have been testing my own emulation, and I have trouble with the notorious ADC/SBC opcodes. When I tried your implementations it also failed.

I see in your code the line:

if ((0x00FF&bcd_total) > 0x09) { bcd_total=bcd_total+0x010; bcd_total=bcd_total-0x0A; }

which contains a reference bcd_total before it has been assigned a value, thus the condition is never true. Maybe you missed something?

thanks!

-John

@MicroCoreLabs
Copy link
Owner

MicroCoreLabs commented Mar 24, 2021 via email

@GrantMeStrength
Copy link
Author

I am still trying to get ANY BCD code to pass the tests, mine or yours. If yours is good, the issue is elsewhere in my code and I apologize for suggesting otherwise :-)

I know that the first time I ran Klause's test my code passed and I was delighted - and then I remembered BCD testing was off, and turned it on, and was less delighted ;-)

@MicroCoreLabs
Copy link
Owner

MicroCoreLabs commented Mar 25, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants