use crate::*; pub struct BedrockCore { pub mem: ProgramMemory, pub wst: Stack, pub rst: Stack, pub cycle: usize, } impl BedrockCore { pub fn new() -> Self { Self { mem: ProgramMemory::new(), wst: Stack::new(), rst: Stack::new(), cycle: 0, } } pub fn with_device_bus(self, dev: DB) -> BedrockEmulator { BedrockEmulator { core: self, dev } } pub fn reset(&mut self) { self.cycle = 0; self.mem.pc = 0; self.wst.sp = 0; self.rst.sp = 0; } }