diff options
author | Couriersud <couriersud@users.noreply.github.com> | 2009-12-19 23:12:07 +0000 |
---|---|---|
committer | Couriersud <couriersud@users.noreply.github.com> | 2009-12-19 23:12:07 +0000 |
commit | 3af4cd9bec355c7f08e709ca1e7ea2570e519d90 (patch) | |
tree | cd36753ba85a5f67b03497aa01460ae3cf7c0b19 /src/osd/windows/winmain.c | |
parent | da19077b98af83dda92422e64802e0228b289161 (diff) |
Added option "numprocessors"
-numprocessors <auto|value>
Specify the number of processors to use for work queues. Specifying
"auto" will use the value reported by the system or environment
variable OSDPROCESSORS. To avoid abuse, this value is internally limited
to 4 times the number of processors reported by the system.
The default is "auto".
Diffstat (limited to 'src/osd/windows/winmain.c')
-rw-r--r-- | src/osd/windows/winmain.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/osd/windows/winmain.c b/src/osd/windows/winmain.c index 735b4ba984a..0b9b25ad47a 100644 --- a/src/osd/windows/winmain.c +++ b/src/osd/windows/winmain.c @@ -165,6 +165,7 @@ const options_entry mame_win_options[] = { NULL, NULL, OPTION_HEADER, "WINDOWS PERFORMANCE OPTIONS" }, { "priority(-15-1)", "0", 0, "thread priority for the main game thread; range from -15 to 1" }, { "multithreading;mt", "0", OPTION_BOOLEAN, "enable multithreading; this enables rendering and blitting on a separate thread" }, + { "numprocessors;np", "auto", 0, "number of processors; this overrides the number the system reports" }, // video options { NULL, NULL, OPTION_HEADER, "WINDOWS VIDEO OPTIONS" }, @@ -309,6 +310,7 @@ static void output_oslog(running_machine *machine, const char *buffer) void osd_init(running_machine *machine) { int watchdog = options_get_int(mame_options(), WINOPTION_WATCHDOG); + const char *stemp; // thread priority if (!options_get_bool(mame_options(), OPTION_DEBUG)) @@ -317,6 +319,21 @@ void osd_init(running_machine *machine) // ensure we get called on the way out add_exit_callback(machine, osd_exit); + // get number of processors + stemp = options_get_string(mame_options(), WINOPTION_NUMPROCESSORS); + + osd_num_processors = 0; + + if (strcmp(stemp, "auto") != 0) + { + osd_num_processors = atoi(stemp); + if (osd_num_processors < 1) + { + mame_printf_warning("Warning: numprocessors < 1 doesn't make much sense. Assuming auto ...\n"); + osd_num_processors = 0; + } + } + // initialize the subsystems winvideo_init(machine); winsound_init(machine); |