pub fn rotate_left_r8(cpu: &mut CPU, r8: &Reg8, through_carry: bool, reset_zero: bool) -> u8 {
    let value = cpu.registers.read8(r8);

    let (rotated_value, flags) = alu_rotate_left(value, cpu.registers.f, through_carry);
    cpu.registers.write8(r8, rotated_value);
    cpu.registers.f = flags;

    if reset_zero {
        cpu.registers.f.remove(Flags::ZERO);
        4
    } else {
        8
    }
}
/// Rotate an 8-bit register to the left.
///
/// If through_carry is true then the high bit will go into the RegisterFlags::CARRY flag and the old value of the
/// RegisterFlags::CARRY flag will become the new low bit.
/// If it is not true the high bit will become the low bit as well as going into the RegisterFlags::CARRY flag.
///
/// If reset_zero is true the RegisterFlags::ZERO flag will always be reset.
/// If it is not true the RegisterFlags::ZERO flag will be set only if the rotated value equals zero.
///
/// Takes 4 cycles if always using A, otherwise 8 cycles
///
/// # Examples
///
/// ```asm
/// ; 4 cycle
/// RLCA  ; Rotate A left (resets Flag::RegisterFlags::ZERO)
/// RLA   ; Rotate A left through the carry flag (resets Flag::RegisterFlags::ZERO)
///
/// ; 8 cycle
/// RLC B ; Rotate B left (sets Flag::RegisterFlags::ZERO if rotated result == 0)
/// RL B  ; Rotate B left through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
///
/// ```
Rotate an 8-bit register to the left.
If through_carry is true then the high bit will go into the RegisterFlags::CARRY flag and the old value of the
RegisterFlags::CARRY flag will become the new low bit.
If it is not true the high bit will become the low bit as well as going into the RegisterFlags::CARRY flag.

If reset_zero is true the RegisterFlags::ZERO flag will always be reset.
If it is not true the RegisterFlags::ZERO flag will be set only if the rotated value equals zero.

Takes 4 cycles if always using A, otherwise 8 cycles
Rotate an 8 - bit register to the left . If through_carry is true then the high bit will go into the RegisterFlags :: CARRY flag and the old value of the RegisterFlags :: CARRY flag will become the new low bit . If it is not true the high bit will become the low bit as well as going into the RegisterFlags :: CARRY flag . If reset_zero is true the RegisterFlags :: ZERO flag will always be reset . If it is not true the RegisterFlags :: ZERO flag will be set only if the rotated value equals zero . Takes 4 cycles if always using A otherwise 8 cycles
pub fn rotate_left_r8(cpu: &mut CPU, r8: &Reg8, through_carry: bool, reset_zero: bool) -> u8 {
    let value = cpu.registers.read8(r8);
    let (rotated_value, flags) = alu_rotate_left(value, cpu.registers.f, through_carry);
    cpu.registers.write8(r8, rotated_value);
    cpu.registers.f = flags;
    if reset_zero {
        cpu.registers.f.remove(Flags::ZERO);
        4
    } else {
        8
    }
}
pub fn rotate_left_r8 ( cpu : & mut CPU , r8 : & Reg8 , through_carry : bool , reset_zero : bool ) -> u8 { let value = cpu . registers . read8 ( r8 ) ; let ( rotated_value , flags ) = alu_rotate_left ( value , cpu . registers . f , through_carry ) ; cpu . registers . write8 ( r8 , rotated_value ) ; cpu . registers . f = flags ; if reset_zero { cpu . registers . f . remove ( Flags :: ZERO ) ; 4 } else { 8 } }
Rotate an 8-bit register to the left.
Rotate an 8 - bit register to the left .
cpu
&mut CPU
r8
&Reg8
through_carry
bool
reset_zero
bool
cpu
&mut CPU
r8
&Reg8
through_carry
bool
reset_zero
bool
examples
```asm
; 4 cycle
RLCA  ; Rotate A left (resets Flag::RegisterFlags::ZERO)
RLA   ; Rotate A left through the carry flag (resets Flag::RegisterFlags::ZERO)

; 8 cycle
RLC B ; Rotate B left (sets Flag::RegisterFlags::ZERO if rotated result == 0)
RL B  ; Rotate B left through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)


` ` ` asm ; 4 cycle RLCA ; Rotate A left ( resets Flag :: RegisterFlags :: ZERO ) RLA ; Rotate A left through the carry flag ( resets Flag :: RegisterFlags :: ZERO ) ; 8 cycle RLC B ; Rotate B left ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 ) RL B ; Rotate B left through the carry flag ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 )