Last active
May 15, 2018 03:25
-
-
Save sean3z/f52480f64f391904a32a23037615743e to your computer and use it in GitHub Desktop.
Example System
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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