Merge branch 'master' of pterpstra.com:m68k-backplane-computer/emu

This commit is contained in:
pjht 2023-11-02 18:34:22 -05:00
commit a31f0eb1ab
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
2 changed files with 9 additions and 14 deletions

View File

@ -149,7 +149,6 @@ pub trait Mmu: Debug {
) -> NullableResult<u32, BusError>;
}
#[allow(dead_code)]
pub const fn u64_set_be_byte(val: u64, idx: u8, byte: u8) -> u64 {
let mut bytes = val.to_be_bytes();

View File

@ -164,32 +164,28 @@ impl Card for MmuCard {
impl Display for MmuCard {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let q1 = if self.map_frames_enabled[0] {
Some(self.map_frames[0])
format!("{:#x}", self.map_frames[0])
} else {
None
"disabled".to_string()
};
let q2 = if self.map_frames_enabled[1] {
Some(self.map_frames[1])
format!("{:#x}", self.map_frames[1])
} else {
None
"disabled".to_string()
};
let q3 = if self.map_frames_enabled[2] {
Some(self.map_frames[2])
format!("{:#x}", self.map_frames[2])
} else {
None
"disabled".to_string()
};
let q4 = if self.map_frames_enabled[3] {
Some(self.map_frames[3])
format!("{:#x}", self.map_frames[3])
} else {
None
"disabled".to_string()
};
f.write_fmt(format_args!(
"MMU card, {} (Q1: {:?}, Q2: {:?}, Q3: {:?}, Q4: {:?})",
"MMU card, {} (Q1: {q1}, Q2: {q2}, Q3: {q3}, Q4: {q4})",
if self.enabled { "enabled" } else { "disabled" },
q1,
q2,
q3,
q4
))
}
}