fmt rom address
This commit is contained in:
parent
e648ea17d2
commit
0ae8697eb8
1 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,7 @@
|
||||||
use std::ops::{Add, Sub};
|
use std::{
|
||||||
|
fmt::UpperHex,
|
||||||
|
ops::{Add, Sub},
|
||||||
|
};
|
||||||
|
|
||||||
pub(crate) use self::types::*;
|
pub(crate) use self::types::*;
|
||||||
|
|
||||||
|
@ -33,6 +36,15 @@ pub(crate) enum RomAddress {
|
||||||
MappedBank(MappedBankAddress),
|
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)]
|
#[derive(Clone, Copy)]
|
||||||
pub(crate) enum IoAddress {
|
pub(crate) enum IoAddress {
|
||||||
Joypad,
|
Joypad,
|
||||||
|
|
Loading…
Add table
Reference in a new issue