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

chore: made clock freq a separate func

parent 7df3ce77
No related branches found
No related tags found
1 merge request!16Support for Game Boy Color (CGB) 😎🖍️
Pipeline #2602 failed
...@@ -580,6 +580,10 @@ impl GameBoy { ...@@ -580,6 +580,10 @@ impl GameBoy {
self.apu().set_clock_freq(value); 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) { pub fn attach_null_serial(&mut self) {
self.attach_serial(Box::<NullDevice>::default()); self.attach_serial(Box::<NullDevice>::default());
} }
...@@ -610,13 +614,13 @@ impl GameBoy { ...@@ -610,13 +614,13 @@ impl GameBoy {
pub fn description(&self, column_length: usize) -> String { pub fn description(&self, column_length: usize) -> String {
format!( format!(
"{} {}\n{} {}\n{} {:.02} Mhz\n{} {}\n{} {}\n{} {}", "{} {}\n{} {}\n{} {}\n{} {}\n{} {}\n{} {}",
format!("{:width$}", "Version", width = column_length), format!("{:width$}", "Version", width = column_length),
VERSION, VERSION,
format!("{:width$}", "Mode", width = column_length), format!("{:width$}", "Mode", width = column_length),
self.mode(), self.mode(),
format!("{:width$}", "Clock", width = column_length), 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), format!("{:width$}", "RAM Size", width = column_length),
self.ram_size(), self.ram_size(),
format!("{:width$}", "VRAM Size", width = column_length), format!("{:width$}", "VRAM Size", width = column_length),
......
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