Skip to content

Commit

Permalink
wdc65816: fix PLB wrapping in emulation mode (#1277)
Browse files Browse the repository at this point in the history
>Regarding PLB, it looks like it reads from $200 and snes9x, mesen,
bsnes, and the official CPU manual all got it wrong.

Reproduced and verified on real hardware via
https://github.com/gilyon/snes-tests
  • Loading branch information
asiekierka authored and Screwtapello committed Oct 31, 2023
1 parent 55925d9 commit dab534b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bsnes/processor/wdc65816/instructions-other.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ E S.h = 0x01;
auto WDC65816::instructionPullB() -> void {
idle();
idle();
L B = pull();
L B = pullN();
ZF = B == 0;
NF = B & 0x80;
E S.h = 0x01;
}

auto WDC65816::instructionPullP() -> void {
Expand Down

0 comments on commit dab534b

Please sign in to comment.