diff --git a/src/gb.rs b/src/gb.rs index 3c98084af00424166467c587f846c2193280b313..ae412854d5bc61eb0d19457400ec291360bea629 100644 --- a/src/gb.rs +++ b/src/gb.rs @@ -580,6 +580,10 @@ impl GameBoy { self.apu().set_clock_freq(value); } + pub fn clock_freq_s(&self) -> String { + format!("{:.02} Mhz", self.clock_freq() as f32 / 1000.0 / 1000.0) + } + pub fn attach_null_serial(&mut self) { self.attach_serial(Box::<NullDevice>::default()); } @@ -610,13 +614,13 @@ impl GameBoy { pub fn description(&self, column_length: usize) -> String { format!( - "{} {}\n{} {}\n{} {:.02} Mhz\n{} {}\n{} {}\n{} {}", + "{} {}\n{} {}\n{} {}\n{} {}\n{} {}\n{} {}", format!("{:width$}", "Version", width = column_length), VERSION, format!("{:width$}", "Mode", width = column_length), self.mode(), format!("{:width$}", "Clock", width = column_length), - self.clock_freq() as f32 / 1000.0 / 1000.0, + self.clock_freq_s(), format!("{:width$}", "RAM Size", width = column_length), self.ram_size(), format!("{:width$}", "VRAM Size", width = column_length),