diff --git a/lib/src/processor/memory/addresses.rs b/lib/src/processor/memory/addresses.rs index a93f1f7..a742c1b 100644 --- a/lib/src/processor/memory/addresses.rs +++ b/lib/src/processor/memory/addresses.rs @@ -1,4 +1,7 @@ -use std::ops::{Add, Sub}; +use std::{ + fmt::UpperHex, + ops::{Add, Sub}, +}; pub(crate) use self::types::*; @@ -33,6 +36,15 @@ pub(crate) enum RomAddress { MappedBank(MappedBankAddress), } +impl UpperHex for RomAddress { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + RomAddress::Bank0(a) => a.fmt(f), + RomAddress::MappedBank(a) => a.fmt(f), + } + } +} + #[derive(Clone, Copy)] pub(crate) enum IoAddress { Joypad,