diff --git a/Makefile.common b/Makefile.common index 98e9683fc0..9a55a67774 100644 --- a/Makefile.common +++ b/Makefile.common @@ -204,7 +204,7 @@ OBJ += frontend/frontend.o \ movie.o \ record/record_driver.o \ record/drivers/record_null.o \ - libretro-common/features/cpu_features.o \ + performance.o \ performance_counters.o \ verbosity.o diff --git a/audio/audio_dsp_filter.c b/audio/audio_dsp_filter.c index 1d206e2a5f..e781683918 100644 --- a/audio/audio_dsp_filter.c +++ b/audio/audio_dsp_filter.c @@ -23,13 +23,13 @@ #include <file/file_path.h> #include <lists/dir_list.h> -#include <features/cpu_features.h> #include "audio_dsp_filter.h" #include "audio_filters/dspfilter.h" #include "../config_file_userdata.h" #include "../frontend/frontend_driver.h" +#include "../performance.h" #include "../performance_counters.h" #include "../dynamic.h" diff --git a/audio/audio_resampler_driver.c b/audio/audio_resampler_driver.c index 9487afed5b..a50d70fece 100644 --- a/audio/audio_resampler_driver.c +++ b/audio/audio_resampler_driver.c @@ -17,11 +17,11 @@ #include <string.h> #include <string/stdstring.h> -#include <features/cpu_features.h> #include "audio_resampler_driver.h" #include "../config_file_userdata.h" #ifdef RARCH_INTERNAL +#include "../performance.h" #include "../performance_counters.h" #endif #ifndef DONT_HAVE_STRING_LIST diff --git a/audio/audio_utils.c b/audio/audio_utils.c index 64b7df19ec..51b5f9b9a1 100644 --- a/audio/audio_utils.c +++ b/audio/audio_utils.c @@ -23,9 +23,8 @@ #include <altivec.h> #endif -#include <features/cpu_features.h> - #ifdef RARCH_INTERNAL +#include "../performance.h" #include "../performance_counters.h" #endif diff --git a/dynamic.c b/dynamic.c index e8cf340371..e89bdfa18d 100644 --- a/dynamic.c +++ b/dynamic.c @@ -23,7 +23,6 @@ #include <compat/posix_string.h> #include <dynamic/dylib.h> #include <string/stdstring.h> -#include <features/cpu_features.h> #include <retro_assert.h> #ifdef HAVE_CONFIG_H @@ -39,6 +38,7 @@ #include "record/record_driver.h" #include "core.h" #include "performance_counters.h" +#include "performance.h" #include "system.h" #include "gfx/video_context_driver.h" diff --git a/gfx/video_driver.c b/gfx/video_driver.c index dc66557d6b..8b380a7dc4 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -25,7 +25,6 @@ #endif #include <file/config_file.h> -#include <features/cpu_features.h> #include "video_thread_wrapper.h" #include "../frontend/frontend_driver.h" @@ -34,6 +33,7 @@ #include "../config.def.h" #include "../retroarch.h" #include "../runloop.h" +#include "../performance.h" #include "../performance_counters.h" #include "../list_special.h" #include "../core.h" diff --git a/gfx/video_filter.c b/gfx/video_filter.c index 6cc8a2be7a..fe46697bce 100644 --- a/gfx/video_filter.c +++ b/gfx/video_filter.c @@ -19,12 +19,12 @@ #include <file/file_path.h> #include <lists/dir_list.h> #include <dynamic/dylib.h> -#include <features/cpu_features.h> #include "../frontend/frontend_driver.h" #include "../config_file_userdata.h" #include "../dynamic.h" #include "../general.h" +#include "../performance.h" #include "../performance_counters.h" #include "../verbosity.h" #include "video_filter.h" diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index bbfc87d8fd..b4b8ca1155 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -19,11 +19,11 @@ #include <limits.h> #include <rthreads/rthreads.h> -#include <features/cpu_features.h> #include "video_thread_wrapper.h" #include "font_driver.h" #include "video_shader_driver.h" +#include "../performance.h" #include "../performance_counters.h" #include "../runloop.h" #include "../verbosity.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index 735ea2f1fe..e483a0c10c 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -62,7 +62,7 @@ ENCODINGS /*============================================================ PERFORMANCE ============================================================ */ -#include "../libretro-common/features/cpu_features.c" +#include "../performance.c" #include "../performance_counters.c" /*============================================================ diff --git a/libretro-common/formats/jpeg/rjpeg.c b/libretro-common/formats/jpeg/rjpeg.c index e8e6f2701d..4d43a66c76 100644 --- a/libretro-common/formats/jpeg/rjpeg.c +++ b/libretro-common/formats/jpeg/rjpeg.c @@ -1,25 +1,3 @@ -/* Copyright (C) 2010-2016 The RetroArch team - * - * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (rjpeg.c). - * --------------------------------------------------------------------------------------- - * - * Permission is hereby granted, free of charge, - * to any person obtaining a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - /* Modified version of stb_image's JPEG sources. */ diff --git a/libretro-common/include/formats/image.h b/libretro-common/include/formats/image.h index 00457cf2a5..1f96b81efd 100644 --- a/libretro-common/include/formats/image.h +++ b/libretro-common/include/formats/image.h @@ -1,23 +1,17 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2015 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. * - * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (image.h). - * --------------------------------------------------------------------------------------- + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. * - * Permission is hereby granted, free of charge, - * to any person obtaining a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see <http://www.gnu.org/licenses/>. */ #ifndef __RARCH_IMAGE_CONTEXT_H diff --git a/libretro-common/include/formats/jsonsax.h b/libretro-common/include/formats/jsonsax.h index 86d6d6b207..76860fe5f5 100644 --- a/libretro-common/include/formats/jsonsax.h +++ b/libretro-common/include/formats/jsonsax.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (jsonsax.h). diff --git a/libretro-common/include/formats/rjpeg.h b/libretro-common/include/formats/rjpeg.h index 81f61b92af..539fd058df 100644 --- a/libretro-common/include/formats/rjpeg.h +++ b/libretro-common/include/formats/rjpeg.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rjpeg.h). diff --git a/libretro-common/include/formats/rpng.h b/libretro-common/include/formats/rpng.h index fa3f5d5bca..94db62932f 100644 --- a/libretro-common/include/formats/rpng.h +++ b/libretro-common/include/formats/rpng.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rpng.h). diff --git a/libretro-common/include/formats/rxml.h b/libretro-common/include/formats/rxml.h index c3f3335c19..3ee1109601 100644 --- a/libretro-common/include/formats/rxml.h +++ b/libretro-common/include/formats/rxml.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* Copyright (C) 2010-2015 The RetroArch team * * --------------------------------------------------------------------------------------- * The following license statement only applies to this file (rxml.h). diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 989d3b5727..c1bd67114d 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -18,8 +18,6 @@ #include <compat/strl.h> #include <string/stdstring.h> -#include <features/cpu_features.h> - #include "menu_generic.h" #include "../menu_driver.h" @@ -30,6 +28,7 @@ #include "../menu_entries.h" #include "../../configuration.h" +#include "../../performance.h" #include "../../performance_counters.h" #include "../../input/input_autodetect.h" #include "../../input/input_config.h" diff --git a/menu/menu_animation.c b/menu/menu_animation.c index a4c1efb0ce..db267ec8fb 100644 --- a/menu/menu_animation.c +++ b/menu/menu_animation.c @@ -16,14 +16,13 @@ #include <math.h> #include <string.h> - #include <compat/strl.h> #include <encodings/utf.h> #include <retro_miscellaneous.h> -#include <features/cpu_features.h> #include "menu_animation.h" #include "../configuration.h" +#include "../performance.h" #include "../performance_counters.h" #define IDEAL_DELTA_TIME (1.0 / 60.0 * 1000000.0) diff --git a/menu/menu_input.c b/menu/menu_input.c index f1a5b66415..0025dd668d 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -27,8 +27,6 @@ #include <stdlib.h> #include <string.h> -#include <features/cpu_features.h> - #include "menu_driver.h" #include "menu_input.h" #include "menu_animation.h" @@ -41,6 +39,7 @@ #include "../general.h" #include "../managers/cheat_manager.h" +#include "../performance.h" #include "../performance_counters.h" #include "../core.h" #include "../input/input_joypad_driver.h" diff --git a/network/net_http_special.c b/network/net_http_special.c index 10ad9c15fe..2c488c614c 100644 --- a/network/net_http_special.c +++ b/network/net_http_special.c @@ -17,8 +17,8 @@ #include <stdlib.h> #include <net/net_http.h> -#include <features/cpu_features.h> +#include "../performance.h" #include "../performance_counters.h" #include "net_http_special.h" diff --git a/libretro-common/features/cpu_features.c b/performance.c similarity index 91% rename from libretro-common/features/cpu_features.c rename to performance.c index 94f5b73e79..b165192103 100644 --- a/libretro-common/features/cpu_features.c +++ b/performance.c @@ -1,29 +1,31 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2016 - Daniel De Matteis * - * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (cpu_features.c). - * --------------------------------------------------------------------------------------- + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. * - * Permission is hereby granted, free of charge, - * to any person obtaining a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see <http://www.gnu.org/licenses/>. */ #include <stdio.h> +#include "libretro.h" +#include "performance.h" +#include "general.h" +#include "compat/strl.h" +#include "verbosity.h" -#include <compat/strl.h> -#include <features/cpu_features.h> +#ifdef _WIN32 +#define PERF_LOG_FMT "[PERF]: Avg (%s): %I64u ticks, %I64u runs.\n" +#else +#define PERF_LOG_FMT "[PERF]: Avg (%s): %llu ticks, %llu runs.\n" +#endif #if defined(_WIN32) #include <direct.h> diff --git a/libretro-common/include/features/cpu_features.h b/performance.h similarity index 56% rename from libretro-common/include/features/cpu_features.h rename to performance.h index dc8d091188..dac242511d 100644 --- a/libretro-common/include/features/cpu_features.h +++ b/performance.h @@ -1,23 +1,17 @@ -/* Copyright (C) 2010-2016 The RetroArch team +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. * - * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (cpu_features.h). - * --------------------------------------------------------------------------------------- + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. * - * Permission is hereby granted, free of charge, - * to any person obtaining a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, - * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see <http://www.gnu.org/licenses/>. */ #ifndef _LIBRETRO_SDK_CPU_INFO_H diff --git a/performance_counters.c b/performance_counters.c index 2ac7ee2a72..209e6fb824 100644 --- a/performance_counters.c +++ b/performance_counters.c @@ -17,8 +17,7 @@ #include <stdio.h> #include <string.h> -#include <features/cpu_features.h> - +#include "performance.h" #include "performance_counters.h" #include "general.h" diff --git a/retroarch.c b/retroarch.c index 70032242ec..e0f1cff51f 100644 --- a/retroarch.c +++ b/retroarch.c @@ -42,7 +42,6 @@ #include <file/file_path.h> #include <retro_stat.h> #include <retro_assert.h> -#include <features/cpu_features.h> #include "content.h" #include "core_type.h" @@ -59,6 +58,7 @@ #include "configuration.h" #include "general.h" #include "runloop.h" +#include "performance.h" #include "managers/cheat_manager.h" #include "system.h" diff --git a/runloop.c b/runloop.c index 03780d734b..63e4e2d889 100644 --- a/runloop.c +++ b/runloop.c @@ -23,7 +23,6 @@ #include <file/file_path.h> #include <retro_inline.h> #include <retro_assert.h> -#include <features/cpu_features.h> #include <queues/message_queue.h> #ifdef HAVE_THREADS #include <rthreads/rthreads.h> @@ -39,6 +38,7 @@ #include "autosave.h" #include "core_info.h" #include "configuration.h" +#include "performance.h" #include "movie.h" #include "retroarch.h" #include "runloop.h"