From 7685bc8b00238224e2af7aa1346f289464c2d9f3 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 20 Jan 2016 22:01:16 -0800 Subject: [PATCH] LR35902: Popping AF should clear unused F bits --- src/lr35902/isa-lr35902.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lr35902/isa-lr35902.c b/src/lr35902/isa-lr35902.c index f768734cf..b91e796a2 100644 --- a/src/lr35902/isa-lr35902.c +++ b/src/lr35902/isa-lr35902.c @@ -592,6 +592,7 @@ DEFINE_INSTRUCTION_LR35902(CPL_, #define DEFINE_POPPUSH_INSTRUCTION_LR35902(REG, HH, H, L) \ DEFINE_INSTRUCTION_LR35902(POP ## REG ## Delay, \ cpu-> L = cpu->bus; \ + cpu->f.packed &= 0xF0; \ cpu->index = cpu->sp; \ ++cpu->sp; \ cpu->instruction = _LR35902InstructionLD ## HH ## _Bus; \