Skip to content
Snippets Groups Projects
Verified Commit a85f2a53 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: better instruction printing

parent 03b06060
No related branches found
No related tags found
1 merge request!16Support for Game Boy Color (CGB) 😎🖍️
Pipeline #2579 failed
...@@ -281,16 +281,14 @@ impl Cpu { ...@@ -281,16 +281,14 @@ impl Cpu {
#[cfg(feature = "cpulog")] #[cfg(feature = "cpulog")]
{ {
let title_str = format!("[0x{:04x}] {}", self.pc - 1, inst_str);
let inst_time_str = format!("({} cycles)", inst_time);
let registers_str = format!("[PC=0x{:04x} SP=0x{:04x}] [A=0x{:02x} B=0x{:02x} C=0x{:02x} D=0x{:02x} E=0x{:02x} H=0x{:02x} L=0x{:02x}]",
self.pc, self.sp, self.a, self.b, self.c, self.d, self.e, self.h, self.l);
println!( println!(
"[0x{:04x}] {}\t({} cycles)", "{0: <24} {1: <11} {2: <10}",
self.pc - 1, title_str, inst_time_str, registers_str
inst_str,
inst_time
); );
println!(
"[A=0x{:02x} B=0x{:02x} H=0x{:02x} L=0x{:02x}]",
self.a, self.b, self.h, self.l
)
} }
#[cfg(feature = "secure")] #[cfg(feature = "secure")]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment