mirror of
https://github.com/FranLMSP/snes.git
synced 2026-10-03 16:05:18 -04:00
Refactor CPU instructions (#2)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user