pub fn rotate_right_indirect_hl(cpu: &mut CPU, through_carry: bool, reset_zero: bool) -> u8 {
    let a16_addr = cpu.registers.read16(&Reg16::HL);
    let value = cpu.mmu.read8(a16_addr);

    let (rotated_value, flags) = alu_rotate_right(value, cpu.registers.f, through_carry);
    cpu.mmu.write8(a16_addr, rotated_value);
    cpu.registers.f = flags;
    if reset_zero {
        cpu.registers.f.remove(Flags::ZERO)
    }

    16
}
/// Rotate an indirect value, taken from memory using a 16-bit register as an address to the right.
///
/// If through_carry is true then the low bit will go into the RegisterFlags::CARRY flag and the old value of the
/// RegisterFlags::CARRY flag will become the new high bit.
/// If it is not true the low bit will become the high 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 16 cycles.
///
/// # Examples
///
/// ```asm
/// RRC (HL) ; Rotate memory[hl] right (sets Flag::RegisterFlags::ZERO if rotated result == 0)
/// RR (HL)  ; Rotate memory[hl] right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
///
/// ```
Rotate an indirect value, taken from memory using a 16-bit register as an address to the right.
If through_carry is true then the low bit will go into the RegisterFlags::CARRY flag and the old value of the
RegisterFlags::CARRY flag will become the new high bit.
If it is not true the low bit will become the high 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 16 cycles.
Rotate an indirect value taken from memory using a 16 - bit register as an address to the right . If through_carry is true then the low bit will go into the RegisterFlags :: CARRY flag and the old value of the RegisterFlags :: CARRY flag will become the new high bit . If it is not true the low bit will become the high 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 16 cycles .
pub fn rotate_right_indirect_hl(cpu: &mut CPU, through_carry: bool, reset_zero: bool) -> u8 {
    let a16_addr = cpu.registers.read16(&Reg16::HL);
    let value = cpu.mmu.read8(a16_addr);
    let (rotated_value, flags) = alu_rotate_right(value, cpu.registers.f, through_carry);
    cpu.mmu.write8(a16_addr, rotated_value);
    cpu.registers.f = flags;
    if reset_zero {
        cpu.registers.f.remove(Flags::ZERO)
    }
    16
}
pub fn rotate_right_indirect_hl ( cpu : & mut CPU , through_carry : bool , reset_zero : bool ) -> u8 { let a16_addr = cpu . registers . read16 ( & Reg16 :: HL ) ; let value = cpu . mmu . read8 ( a16_addr ) ; let ( rotated_value , flags ) = alu_rotate_right ( value , cpu . registers . f , through_carry ) ; cpu . mmu . write8 ( a16_addr , rotated_value ) ; cpu . registers . f = flags ; if reset_zero { cpu . registers . f . remove ( Flags :: ZERO ) } 16 }
Rotate an indirect value, taken from memory using a 16-bit register as an address to the right.
Rotate an indirect value taken from memory using a 16 - bit register as an address to the right .
cpu
&mut CPU
through_carry
bool
reset_zero
bool
cpu
&mut CPU
through_carry
bool
reset_zero
bool
examples
```asm
RRC (HL) ; Rotate memory[hl] right (sets Flag::RegisterFlags::ZERO if rotated result == 0)
RR (HL)  ; Rotate memory[hl] right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)


` ` ` asm RRC ( HL ) ; Rotate memory [ hl ] right ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 ) RR ( HL ) ; Rotate memory [ hl ] right through the carry flag ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 )