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

Fix implementation of BCD mode quirks on 6502 and 65c02 #55

Closed
wants to merge 20 commits into from

Conversation

KrisKennaway
Copy link

Fixes the remaining issues with BCD compatibility discussed in #33 (but not the additional opcodes). This leans heavily on the following resources:

I have added a few things here that were useful in development:

  • added the ability to trace execution with a flag to mpu.step(). This was critical when trying to debug the behaviour of 6502 functional test code. At this point it is not necessary for the patch though, so I could remove or reimplement it.

  • helpers for executing test cases that are implemented as 6502 binary code

  • wired up Bruce Clark's BCD test suite, which now passes

  • added a test harness for executing Klaus Dormann's test suite, if the binary object files are separately provided (they are skipped if not present). These tests also now pass, with the exception of:

    1. BBR/BBS opcodes available on the Rockwell/WDC 65c02 implementations, which are not supported yet
    2. tests for NOP behaviour of certain unimplemented opcodes (in some 65c02 variants)

KrisKennaway and others added 20 commits May 10, 2017 23:16
https://github.com/Klaus2m5/6502_65C02_functional_tests for source
and binary images (GPL'ed so not committing here)

The 65C02 one currently is not passing.
trace the execution of the currently failing decimal-mode ADC test,
see mnaberez#33
This fixes various bugs with ADC/SBC in decimal mode found by Klaus
Dormann's test suite.
65C02 including invalid BCD arguments.

These are

; Written by Bruce Clark.  This code is public domain.
; see http://www.6502.org/tutorials/decimal_mode.html

and obtained via Klaus Dormann's
https://github.com/Klaus2m5/6502_65C02_functional_tests
6502-specific.  The handling of invalid BCD arguments differs between
6502 and 65C02 and these are testing 6502-specific behaviour.
amb5l (Klaus2m5/6502_65C02_functional_tests#8)

Minor modification to BRK when test completes instead of using 65C02
STP.
completion PC

Streamline test harness a bit
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

Successfully merging this pull request may close these issues.

1 participant