-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No handling of NMI or IRQ #64
Comments
We could add it there, yes. pub trait InterruptHandler {
fn set_nmi(&mut self, value: bool);
fn set_irq(&mut self, value: bool);
} Let's keep it simple. trait Bus {
fn set_byte(&mut self, address: u16, value: u8);
fn get_byte(&self, address: u16) -> u8;
fn trigger_irq(&mut self);
} |
I think it depends on how we expect client code to actually call the mos6502 library. To emulate something like the Atari 2600, or any of the other well-known platforms, you'll need to run your own code with every machine cycle. So for example libz80, and Mike Chambers fake6502, and others have a callback to do this and our case is similar (the Therefore, a trait Bus {
fn set_byte(&mut self, address: u16, value: u8);
fn get_byte(&self, address: u16) -> u8;
fn irq_pending(&mut self) -> bool;
fn nmi_pending(&self) -> bool;
fn reset_pending(&mut self) -> bool;
} I'm imagining that a Commodore 64 emulator will set a flag in the How does that idea seem to you? |
Yeah, that sounds quite reasonable.
I'd also be fine with the current proposal, though. |
I don't see a way to send an interrupt or reset or anything to the CPU.
I would guess this belongs in the
Bus
trait if #63 gets mergedThe text was updated successfully, but these errors were encountered: