Refactor CPU instructions (#2)

This commit is contained in:
2023-12-30 21:34:08 +00:00
committed by GitHub
parent 2e4dd7b15c
commit 98c2c90c08
108 changed files with 7564 additions and 3540 deletions
+12
View File
@@ -1,3 +1,5 @@
use std::fmt::Display;
use crate::cpu::bus::Bus;
/// OPCODE #const
@@ -114,6 +116,16 @@ pub enum IndexRegister {
X, Y,
}
impl Display for IndexRegister {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let name = match self {
IndexRegister::X => "X",
IndexRegister::Y => "Y",
};
write!(f, "{}", name)
}
}
#[derive(Copy, Clone)]
pub enum AddressingMode {
Accumulator,