-
-
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
Starting on implementing different variants #88
Conversation
b685829
to
d914687
Compare
From what I can see, the failing CI/CD process has to do with linting |
Skeptic checks that the examples in the |
Can you read the output of the
|
67cac0d
to
fb53ae4
Compare
Okay, I've sussed it. Clippy is being run with Which do you prefer? |
I have disabled |
Thanks. We can remove skeptic then. I hope there's a replacement of some sort. |
Do you want to find one? Or shall we remove the example(s) from the README and refer readers to the |
2cfcf60
to
032f80e
Compare
There is a replacement; cargo doctest can do it now. I'll open another pull request to bring the compile times down by removing skeptic and num, which should close #89 as well. |
Perfect. Thanks! |
You ready to merge the |
Oh, sorry, I was referring to your comment about removing skeptic and nom. 😅 |
This reverts commit c87975e.
bd57275
to
09b78be
Compare
That commit has been reverted and the PR has been rebased; so this is ready for merging as far as I am concerned |
pub struct Nmos6502; | ||
|
||
impl crate::Variant for Nmos6502 { | ||
fn decode(opcode: u8) -> Option<(Instruction, AddressingMode)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is so nice.
@@ -40,3 +40,12 @@ pub mod cpu; | |||
pub mod instruction; | |||
pub mod memory; | |||
pub mod registers; | |||
|
|||
pub trait Variant { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc comments would help here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a basic description that there are different variants of the CPU, and that they handle operations differently.
@@ -52,7 +53,7 @@ fn main() { | |||
0x4c, 0x10, 0x00, // Jump to .algo | |||
]; | |||
|
|||
let mut cpu = cpu::CPU::new(Memory::new()); | |||
let mut cpu = cpu::CPU::new(Memory::new(), Nmos6502); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add a Default
impl for that?
// Initializes an Nmos6502 variant
let mut cpu = CPU::default();
If we don't want to add a default, we can alternatively provide
let mut cpu = CPU::nmos();
Just an idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out how to do Default
because of the generics; do you have a concrete idea?
Looks good. Just some minor comments. We can merge if you like as there are no blockers. Up to you. 😄 |
Great, are you happy to merge and do a release on crates.io? |
Sure! |
No description provided.