diff --git a/src/debugger/mod.rs b/src/debugger/mod.rs index 807b75e..0cf1dbf 100644 --- a/src/debugger/mod.rs +++ b/src/debugger/mod.rs @@ -332,14 +332,18 @@ impl Debugger { } pub fn print_registers(f: &mut impl io::Write, state: &RunState) { - writeln!(f, "┌────────────────────────────────────┐").unwrap(); - writeln!(f, "│ HEX INT UINT CHAR │").unwrap(); + writeln!(f, "\x1b[2m┌────────────────────────────────────┐\x1b[0m").unwrap(); + writeln!( + f, + "\x1b[2m│ \x1b[3mhex int uint char\x1b[0m\x1b[2m │\x1b[0m" + ) + .unwrap(); for i in 0..8 { - write!(f, "│ R{} ", i).unwrap(); + write!(f, "\x1b[2m│\x1b[0m R{} ", i).unwrap(); print_integer(f, state.reg(i)); - writeln!(f, " │").unwrap(); + writeln!(f, " \x1b[2m│\x1b[0m").unwrap(); } - writeln!(f, "└────────────────────────────────────┘").unwrap(); + writeln!(f, "\x1b[2m└────────────────────────────────────┘\x1b[0m").unwrap(); } fn print_integer(f: &mut impl io::Write, value: u16) { diff --git a/src/debugger/print.rs b/src/debugger/print.rs index 9c5ff5e..8ee87ee 100644 --- a/src/debugger/print.rs +++ b/src/debugger/print.rs @@ -6,6 +6,7 @@ use crate::runtime::terminal_line_start; pub struct Writer; +// TODO(feat): impl `fmt::Writer` instead impl io::Write for Writer { fn write(&mut self, buf: &[u8]) -> io::Result { // TODO: Make this good