fn rra(gb: &mut GameBoy) {
    let a = gb.cpu.get_8(Register8::A);
    let carry = gb.cpu.get_flag(Flag::C) as u8;
    let first = a << 7;
    let rotated = a >> 1 | carry;

    gb.cpu.set_8(Register8::A, rotated);
    gb.cpu.set_flag(Flag::C, first == 0b1);
    gb.cpu.set_flag(Flag::N, false);
    gb.cpu.set_flag(Flag::H, false);
}
/// The register is shifted right by one, the 0 bit goes to the carry
/// flag, and  the carry flag goes to bit 7. Flags apart from the
/// carry flag are as for RLCA.
The register is shifted right by one, the 0 bit goes to the carry
flag, and  the carry flag goes to bit 7. Flags apart from the
carry flag are as for RLCA.
The register is shifted right by one the 0 bit goes to the carry flag and the carry flag goes to bit 7 . Flags apart from the carry flag are as for RLCA .
fn rra(gb: &mut GameBoy) {
    let a = gb.cpu.get_8(Register8::A);
    let carry = gb.cpu.get_flag(Flag::C) as u8;
    let first = a << 7;
    let rotated = a >> 1 | carry;
    gb.cpu.set_8(Register8::A, rotated);
    gb.cpu.set_flag(Flag::C, first == 0b1);
    gb.cpu.set_flag(Flag::N, false);
    gb.cpu.set_flag(Flag::H, false);
}
fn rra ( gb : & mut GameBoy ) { let a = gb . cpu . get_8 ( Register8 :: A ) ; let carry = gb . cpu . get_flag ( Flag :: C ) as u8 ; let first = a << 7 ; let rotated = a >> 1 | carry ; gb . cpu . set_8 ( Register8 :: A , rotated ) ; gb . cpu . set_flag ( Flag :: C , first == 0b1 ) ; gb . cpu . set_flag ( Flag :: N , false ) ; gb . cpu . set_flag ( Flag :: H , false ) ; }
The register is shifted right by one, the 0 bit goes to the carry
flag, and  the carry flag goes to bit 7.
The register is shifted right by one the 0 bit goes to the carry flag and the carry flag goes to bit 7 .
gb
&mut GameBoy