fix(instructions): correct the flags being set in ADD HL, r16
This commit is contained in:
parent
a6d5553035
commit
15781b3d5a
|
@ -1504,12 +1504,10 @@ impl Instruction {
|
||||||
fn add_u16s(left: u16, right: u16, flags: &mut Flags) -> u16 {
|
fn add_u16s(left: u16, right: u16, flags: &mut Flags) -> u16 {
|
||||||
let (sum, did_overflow) = left.overflowing_add(right);
|
let (sum, did_overflow) = left.overflowing_add(right);
|
||||||
|
|
||||||
flags.update(
|
flags.set_n(false);
|
||||||
false,
|
flags.set_h(Self::add_u16_half_carry(left, right));
|
||||||
Self::add_u16_half_carry(left, right),
|
flags.set_c(did_overflow);
|
||||||
flags.h(),
|
|
||||||
did_overflow,
|
|
||||||
);
|
|
||||||
sum
|
sum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue