Make fields and register access functions of Core accessible to the rest of the emulator
This commit is contained in:
10
src/core.rs
10
src/core.rs
@@ -15,9 +15,9 @@ pub(crate) enum InstructionResult {
|
||||
}
|
||||
|
||||
pub struct Core {
|
||||
x_regs: [RegValue; 32],
|
||||
pc: Addr,
|
||||
mem: MemConfig,
|
||||
pub(crate) x_regs: [RegValue; 32],
|
||||
pub(crate) pc: Addr,
|
||||
pub(crate) mem: MemConfig,
|
||||
}
|
||||
|
||||
impl Core {
|
||||
@@ -73,11 +73,11 @@ impl Core {
|
||||
self.pc = pc;
|
||||
}
|
||||
|
||||
fn reg_read(&self, id: RegId) -> RegValue {
|
||||
pub(crate) fn reg_read(&self, id: RegId) -> RegValue {
|
||||
self.x_regs[id as usize]
|
||||
}
|
||||
|
||||
fn reg_write(&mut self, id: RegId, value: RegValue) {
|
||||
pub(crate) fn reg_write(&mut self, id: RegId, value: RegValue) {
|
||||
if id == 0 {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user