aboutsummaryrefslogtreecommitdiff
path: root/src/mmio.rs
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-07-22 22:24:53 +0200
committerAstatin <[email protected]>2025-07-22 22:24:53 +0200
commite47f2eb23b624428323bcab0fb6781cc6d107e38 (patch)
tree99ed6c5f9550ac9f6cb9f3383ad0a565926bdb11 /src/mmio.rs
parentd175756707970532f7bb25358e7fca412b596c66 (diff)
Add different verbosity levels
Diffstat (limited to 'src/mmio.rs')
-rw-r--r--src/mmio.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mmio.rs b/src/mmio.rs
index d9f2a5a..8c8739f 100644
--- a/src/mmio.rs
+++ b/src/mmio.rs
@@ -1,10 +1,11 @@
use crate::io::{Audio, Serial};
use crate::state::Memory;
+use crate::logs::{log, LogLevel};
impl<S: Serial, A: Audio> Memory<S, A> {
pub fn r_io(&self, addr: u8) -> u8 {
if addr > 0x50 {
- println!("Reading from 0xff{:02x} not implemented yet", addr);
+ log(LogLevel::Debug, format!("Reading from 0xff{:02x} not implemented yet", addr));
}
match addr {
0x00 => {
@@ -55,7 +56,7 @@ impl<S: Serial, A: Audio> Memory<S, A> {
}
}
_ => {
- println!("Reading from 0xff{:02x} not implemented yet", addr);
+ log(LogLevel::Debug, format!("Reading from 0xff{:02x} not implemented yet", addr));
self.io[addr as usize]
}
}
@@ -295,10 +296,10 @@ impl<S: Serial, A: Audio> Memory<S, A> {
}
_ => {
if addr != 0x25 && addr != 0x24 && addr != 0x26 && addr < 0x30 && addr > 0x3f {
- println!(
+ log(LogLevel::Debug, format!(
"Writing to 0xff{:02x} not implemented yet ({:02x})",
addr, value
- );
+ ));
}
}
}