From 731077c991f07646c0a32535f70f26b9f54c53ce Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sun, 25 Oct 2009 05:04:51 +0000 Subject: [PATCH] From: Dirk Best Date: Sat, Oct 10, 2009 at 20:09 Subject: patch for ui.c To: submit@mamedev.org Hello, attached is a small patch that changes the way cpu clocks are displayed on the initial information page. It now displays the real values, which takes internal mulitpliers/dividers into account. Dirk --- src/emu/ui.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emu/ui.c b/src/emu/ui.c index 8bd2762cdb7..0b402f76ab3 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -979,6 +979,9 @@ astring *game_info_astring(running_machine *machine, astring *string) /* loop over all CPUs */ for (device = machine->firstcpu; device != NULL; device = scandevice) { + /* get cpu specific clock that takes internal multiplier/dividers into account */ + int clock = cpu_get_clock(device); + /* count how many identical CPUs we have */ count = 1; for (scandevice = device->typenext; scandevice != NULL; scandevice = scandevice->typenext) @@ -994,10 +997,10 @@ astring *game_info_astring(running_machine *machine, astring *string) astring_catc(string, cpu_get_name(device)); /* display clock in kHz or MHz */ - if (device->clock >= 1000000) - astring_catprintf(string, " %d.%06d" UTF8_NBSP "MHz\n", device->clock / 1000000, device->clock % 1000000); + if (clock >= 1000000) + astring_catprintf(string, " %d.%06d" UTF8_NBSP "MHz\n", clock / 1000000, clock % 1000000); else - astring_catprintf(string, " %d.%03d" UTF8_NBSP "kHz\n", device->clock / 1000, device->clock % 1000); + astring_catprintf(string, " %d.%03d" UTF8_NBSP "kHz\n", clock / 1000, clock % 1000); } /* loop over all sound chips */