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

CPU fails to stop after a KIL unofficial opcode #379

Open
SBDWolf opened this issue Jun 3, 2024 · 0 comments
Open

CPU fails to stop after a KIL unofficial opcode #379

SBDWolf opened this issue Jun 3, 2024 · 0 comments

Comments

@SBDWolf
Copy link

SBDWolf commented Jun 3, 2024

KIL/STP/JAM/HLT is a series of unofficial opcodes that are supposed to stop the CPU after their execution: https://www.masswerk.at/6502/6502_instruction_set.html#JAM

However, it would seem that on the MiSTer, the CPU will continue running after the execution of one of these opcodes. This can be tested with these test ROMs: https://github.com/threecreepio/nes-hlt-test/releases

I think this is standard 6502 behavior and not specific to the 2A03 (though I'm not 100% sure).

These are unofficial opcodes and I'm not aware of any officially licensed titles intentionally making use of these (understandably so, stopping the CPU is not very useful). However, one area where this is quite relevant is in Speedruns making use of an ACE exploit, like Super Mario Bros. 3 Any% or Castlevania Any% w/ ACE. These runs involve setups that make use of game bugs that shift the Program Counter within RAM, where a payload can be placed to warp directly to the end credits, for example. In certain cases, depending on luck or player execution, a STP opcode may be encountered. If a platform is not emulating the behavior of this opcode correctly, it may cause the ACE to work in situations where it wouldn't on original hardware.

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

No branches or pull requests

1 participant