mirror of
https://github.com/jborza/emu6502.git
synced 2024-11-24 12:30:48 +00:00
fixed status register handling in PLP (bit 4 now not read)
This commit is contained in:
parent
9f0a6bc40b
commit
adb70b62c3
2
cpu.c
2
cpu.c
@ -342,6 +342,8 @@ void PLA_(State6502* state) {
|
|||||||
|
|
||||||
void PLP_(State6502* state) {
|
void PLP_(State6502* state) {
|
||||||
byte value = pop_byte_from_stack(state);
|
byte value = pop_byte_from_stack(state);
|
||||||
|
//we don't read the BRK flag
|
||||||
|
value ^= 1 << 4;
|
||||||
memset(&state->flags, value, sizeof(Flags));
|
memset(&state->flags, value, sizeof(Flags));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1957,7 +1957,7 @@ void test_PLP() {
|
|||||||
assert_sp(&state, 0xFF);
|
assert_sp(&state, 0xFF);
|
||||||
assert_flag_c(&state, 1);
|
assert_flag_c(&state, 1);
|
||||||
assert_flag_d(&state, 1);
|
assert_flag_d(&state, 1);
|
||||||
assert_flag_b(&state, 1);
|
assert_flag_b(&state, 0);
|
||||||
assert_flag_z(&state, 1);
|
assert_flag_z(&state, 1);
|
||||||
assert_flag_v(&state, 1);
|
assert_flag_v(&state, 1);
|
||||||
assert_flag_n(&state, 1);
|
assert_flag_n(&state, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user