Skip to content

Commit

Permalink
Merge pull request #5 from omarandlorraine/immref2regs
Browse files Browse the repository at this point in the history
implement `immutable_registers` method
  • Loading branch information
ivanizag committed Jun 27, 2023
2 parents 359cb66 + d9e73cd commit 6d6baca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ impl Cpu {
&mut self.state.reg
}

/// Returns an immutable references to Registers struct to read the Z80 registers
pub fn immutable_registers(&self) -> &Registers {
&self.state.reg
}

/// Returns if the Cpu has executed a HALT
pub fn is_halted(&self) -> bool {
self.state.halted && !self.state.nmi_pending && !self.state.reset_pending
Expand Down

0 comments on commit 6d6baca

Please sign in to comment.