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 {
|
pub struct Core {
|
||||||
x_regs: [RegValue; 32],
|
pub(crate) x_regs: [RegValue; 32],
|
||||||
pc: Addr,
|
pub(crate) pc: Addr,
|
||||||
mem: MemConfig,
|
pub(crate) mem: MemConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Core {
|
impl Core {
|
||||||
@@ -73,11 +73,11 @@ impl Core {
|
|||||||
self.pc = pc;
|
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]
|
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 {
|
if id == 0 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user