pub fn alu_inc_8bit(d8: u8, flags: Flags) -> (u8, Flags) {
    let mut new_flags = flags;
    new_flags.remove(Flags::SUBTRACT);
    new_flags.set(Flags::HALF_CARRY, d8 & 0x0F == 0x0F);

    let incremented = d8.wrapping_add(1);

    new_flags.set(Flags::ZERO, incremented == 0);

    (incremented, new_flags)
}
/// Increment 8-bit value
///
/// Update flags:
///
/// ## Flags::ZERO
///
/// Set if the result equals zero.
///
/// ## Flags::SUBTRACT
///
/// Always unset
///
/// ## Flags::HALF_CARRY
///
/// Set if the lower nibble of the value overflowed
///
/// ## Flags::CARRY
///
/// Unchanged
///
Increment 8-bit value
Update flags.
Increment 8 - bit value Update flags .
pub fn alu_inc_8bit(d8: u8, flags: Flags) -> (u8, Flags) {
    let mut new_flags = flags;
    new_flags.remove(Flags::SUBTRACT);
    new_flags.set(Flags::HALF_CARRY, d8 & 0x0F == 0x0F);
    let incremented = d8.wrapping_add(1);
    new_flags.set(Flags::ZERO, incremented == 0);
    (incremented, new_flags)
}
pub fn alu_inc_8bit ( d8 : u8 , flags : Flags ) -> ( u8 , Flags ) { let mut new_flags = flags ; new_flags . remove ( Flags :: SUBTRACT ) ; new_flags . set ( Flags :: HALF_CARRY , d8 & 0x0F == 0x0F ) ; let incremented = d8 . wrapping_add ( 1 ) ; new_flags . set ( Flags :: ZERO , incremented == 0 ) ; ( incremented , new_flags ) }
Increment 8-bit value
Update flags:
Increment 8 - bit value Update flags :
d8
u8
flags
Flags
d8
u8
flags
Flags
flags::zero
Set if the result equals zero.
Set if the result equals zero .
flags::subtract
None
flags::half_carry
Set if the lower nibble of the value overflowed
Set if the lower nibble of the value overflowed
flags::carry
None