nnarain / nescore

NES emulator library written in Rust
7 stars 1 forks source link

Refactoring and optimization #40

Open nnarain opened 4 years ago

nnarain commented 4 years ago

Refactor and optimize code. For example the Rc<RefCell<T>>s need to go...

Also Rc and RefCell cannot be sent across threads and in some cases it might be nice to run the core on its own thread:

let mut nes = Nes::default().with_cart(cart);

thread::spawn(move || loop {
  let data = nes.emulate_frame();
  // send data
})
nnarain commented 4 years ago

https://byuu.net/design/cooperative-threading

Generators with resume arguments: https://play.rust-lang.org/?version=nightly&gist=b6b4919931ffec20b9477bd599f57fcd

nnarain commented 4 years ago