some doc comments

This commit is contained in:
Sam M W 2023-10-30 19:47:44 +00:00
parent 09b78bed30
commit 26ea6e0c76
2 changed files with 8 additions and 0 deletions

View File

@ -156,6 +156,7 @@ impl AddressingMode {
pub type DecodedInstr = (Instruction, OpInput);
/// The NMOS 6502 variant. This one is present in the Commodore 64, early Apple IIs, etc.
pub struct Nmos6502;
impl crate::Variant for Nmos6502 {
@ -421,6 +422,8 @@ impl crate::Variant for Nmos6502 {
}
}
/// The Ricoh variant which has no decimal mode. This is what to use if you want to emulate the
/// NES.
pub struct Ricoh2a03;
impl crate::Variant for Ricoh2a03 {
@ -446,6 +449,9 @@ impl crate::Variant for Ricoh2a03 {
}
}
}
/// Emulates some very early 6502s which have no ROR instruction. This one is used in very early
/// KIM-1s.
pub struct RevisionA;
impl crate::Variant for RevisionA {

View File

@ -41,6 +41,8 @@ pub mod instruction;
pub mod memory;
pub mod registers;
/// Trait for 6502 variant. This is the mechanism allowing the different 6502-like CPUs to be
/// emulated. It allows a struct to decode an opcode into its instruction and addressing mode.
pub trait Variant {
fn decode(
opcode: u8,