-
Notifications
You must be signed in to change notification settings - Fork 43
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
Feature Request: 6510 Unintended OpCodes #1
Comments
Newer version here: http://csdb.dk/release/download.php?id=178508 |
Did you mean to link to a file on drive C:\ :) ?
|
@mattgodbolt already fixed. |
Does anybody know how many of these opcodes are supported in the NES 6502 (Ricoh 2A03)? |
The NES uses a slightly hacked copy of the NMOS 6502, so, aside from decimal arithmetic, it's identical to that, and therefore identical to the 6510. |
As far as I understand, the core of Ricoh 2A03 is an exact copy of the NMOS 6502, only disabling a transistor to circumvent a patent. Unfortunately, http://www.visual6502.org seems to be unavailable right now. This request is conceptually related to llvm-mos/llvm-mos#54. @llvm-mos looks very promising to me. It does not appear to support any unintentional NMOS 6502 opcodes yet. To my understanding, it should be relatively easy to implement something in the assembler, but making use of those opcodes in the backend is a different matter. Some comments to this blog post could give useful ideas. |
The BCD opcodes are missing in the 2A03 afaik to make room for sound support |
@robindegen, by BCD opcodes, do you mean |
For more on the decimal mode changes, see the (archived) page of the visual6502 wiki: |
See https://web.archive.org/web/20130406065431/https://forums.nesdev.com/viewtopic.php?f=9&t=9813
So indeed as you say, the sillicon is there; but you can not use the functionality. If you need BCD, you must emulate the behavior with other opcodes in software. |
As time permits please add support for 'illegal opcodes.' An excellent reference exists at NMOS 6510 Unintended Opcodes: No More Secrets.
The 6510 on the C64 had these op-codes but other variants of the MOS 65xx family did not. For example, the 8-bit chip 65C02 (common in early C64 accelerators) lacked support for these op-codes. Also, the 16 bit variant WDC 65C816 found in the SuperCPU, the Apple 2GS, etc. redefined these codes to entirely different (now valid) op-codes. So, you'll probably want to use a command line switch to enable/disable this feature if you add it.
It's worth noting that modern C64 accelerators such as the Turbo Chameleon 64 do support these op-codes and even today some demo coders use them to save a few CPU cycles now and again.
The text was updated successfully, but these errors were encountered: