pub struct Registers {
Show 33 fields skip_bios: bool, registers: Box<[u32]>, r8: u32, r8_fiq: u32, r9: u32, r9_fiq: u32, r10: u32, r10_fiq: u32, r11: u32, r11_fiq: u32, r12: u32, r12_fiq: u32, r13: u32, r13_fiq: u32, r13_svc: u32, r13_abt: u32, r13_irq: u32, r13_und: u32, r14: u32, r14_fiq: u32, r14_svc: u32, r14_abt: u32, r14_irq: u32, r14_und: u32, r15: u32, cpsr: Cpsr, spsr: u32, spsr_fiq: u32, spsr_svc: u32, spsr_abt: u32, spsr_irq: u32, spsr_und: u32, null_spsr: u32,
}

Fields§

§skip_bios: bool§registers: Box<[u32]>§r8: u32§r8_fiq: u32§r9: u32§r9_fiq: u32§r10: u32§r10_fiq: u32§r11: u32§r11_fiq: u32§r12: u32§r12_fiq: u32§r13: u32§r13_fiq: u32§r13_svc: u32§r13_abt: u32§r13_irq: u32§r13_und: u32§r14: u32§r14_fiq: u32§r14_svc: u32§r14_abt: u32§r14_irq: u32§r14_und: u32§r15: u32§cpsr: Cpsr§spsr: u32§spsr_fiq: u32§spsr_svc: u32§spsr_abt: u32§spsr_irq: u32§spsr_und: u32§null_spsr: u32

Implementations§

source§

impl Registers

source

pub fn new(skip_bios: bool) -> Self

source

pub fn read_register(&self, reg_idx: usize) -> u32

source

pub fn write_register(&mut self, reg_idx: usize, val: u32)

source

pub fn spsr(&self) -> u32

source

pub fn set_spsr(&mut self, spsr: u32)

source

fn does_spsr_exist(&self) -> bool

Returns if an spsr exists in the current OperatingMode.

source

pub fn switch_operating_mode(&mut self, new_mode: OperatingMode)

source

pub fn get_sign_flag(&self) -> bool

source

pub fn set_sign_flag(&mut self, sign_flag_val: bool)

source

pub fn get_zero_flag(&self) -> bool

source

pub fn set_zero_flag(&mut self, zero_flag_val: bool)

source

pub fn get_carry_flag(&self) -> bool

source

pub fn set_carry_flag(&mut self, carry_flag_val: bool)

source

pub fn get_overflow_flag(&self) -> bool

source

pub fn set_overflow_flag(&mut self, overflow_flag_val: bool)

source

pub fn get_irq_disabled_flag(&self) -> bool

source

pub fn set_irq_disabled(&mut self, irq_disabled_val: bool)

source

pub fn get_fiq_disabled(&self) -> bool

source

pub fn set_fiq_disabled(&mut self, fiq_disabled_val: bool)

source

pub fn get_thumb_state(&self) -> bool

source

pub fn set_thumb_state(&mut self, thumb_state_val: bool)

source

pub fn get_opearting_mode(&self) -> OperatingMode

source

pub fn cpsr(&self) -> u32

source

pub fn set_cpsr(&mut self, cpsr: u32)

Trait Implementations§

source§

impl Reset for Registers

source§

fn reset(&mut self)

Reset to a default state.
source§

impl Snapshot<RegistersSnapshot> for Registers

source§

fn capture(self) -> Result<RegistersSnapshot, ()>

Capture the current state.
source§

fn restore(&mut self, snapshot: RegistersSnapshot) -> Result<(), Box<dyn Error>>

Restore a state.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.