Skip to content

Instantly share code, notes, and snippets.

@sean3z
Last active May 15, 2018 03:25
Show Gist options
  • Save sean3z/f52480f64f391904a32a23037615743e to your computer and use it in GitHub Desktop.
Save sean3z/f52480f64f391904a32a23037615743e to your computer and use it in GitHub Desktop.
Example System
use cpu::Cpu;
use display::Display;
use keypad::Keypad;
pub struct System {
cpu: Cpu,
memory: [u8; 4096],
keypad: Keypad,
display: Display
}
impl System {
pub fn new() -> System {
System {
cpu: Cpu::new(),
memory: [0; 4096],
keypad: Keypad::new(),
display: Display::new()
}
}
pub fn cycle(&mut self) {
// do stuff regularly
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment