dgrfactory / spcplay

SNES SPC700 Player + Improved SNESAPU.DLL
https://dgrfactory.jp/spcplay/
GNU General Public License v2.0
142 stars 7 forks source link

Incorrect handling of BRK ($0F) opcode #20

Closed exodustx0 closed 4 years ago

exodustx0 commented 4 years ago

When the BRK instruction is encountered, the PC should be pushed, the PSW should be pushed, and the Break flag should be set. However, spcplay will set the Break flag before the PSW is pushed, meaning that the PSW pushed to stack (and the PSW restored when RETI is called) has the Break flag set also, resulting in it never being cleared until power is turned off. I'm aware that this is somewhat of a non-issue, seeing as the Break flag isn't used whatsoever, but it's still erroneous, so I figured it worthwhile to point out.

dgrfactory commented 4 years ago

Hi, @Exodustx0 . Thank you for reporting the issue. The reported issue has been fixed with revision https://github.com/dgrfactory/spcplay/commit/66c065a14a11ce6634ea59d11b32dd4266827d62 . Please wait while the package is uploaded to the release page.

The fixed SNESAPP.DLL can be downloaded from the link below. https://github.com/dgrfactory/spcplay/files/5408185/snesapu-2.18.2.6862-b1.zip

exodustx0 commented 4 years ago

Excellent! BRK now executes as expected. Thanks for your work!