From 557ef1224b888cce5756ead7f6efa702db900e56 Mon Sep 17 00:00:00 2001 From: SergioMartin86 Date: Sat, 24 Feb 2024 06:49:33 +0000 Subject: [PATCH] Removing flag for alignment -- fixed at 1024 now --- meson_options.txt | 8 -------- source/quickerNES/core/cpu.cpp | 6 ++++-- source/quickerNES/meson.build | 5 +---- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 7226cf1..fe802da 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -26,11 +26,3 @@ option('onlyOpenSource', yield: true ) -option('CPUFunctionAlignment', - type : 'integer', - min : 1, - value : 1024, - description : '''Indicates the alignment for the main emulator CPU function. - This is a large function that may cross page boundaries, which impacts performance. - This requires the GNU compiler to work.''' -) \ No newline at end of file diff --git a/source/quickerNES/core/cpu.cpp b/source/quickerNES/core/cpu.cpp index 8ff7e37..318bd1c 100644 --- a/source/quickerNES/core/cpu.cpp +++ b/source/quickerNES/core/cpu.cpp @@ -222,8 +222,10 @@ uint8_t clock_table [256] = { 3,5,2,8,4,4,6,6,2,4,2,7,4,4,7,7 // F }; - -__attribute__((optimize("align-functions=" _QUICKERNES_CPU_FUNCTION_ALIGNMENT))) +// This optimization is only possible on linux systems -- MSVC does not allow function alignment +#ifdef __linux__ +__attribute__((optimize("align-functions=1024"))) +#endif Cpu::result_t Cpu::run ( nes_time_t end ) { set_end_time_( end ); diff --git a/source/quickerNES/meson.build b/source/quickerNES/meson.build index dc896f2..34e6a08 100644 --- a/source/quickerNES/meson.build +++ b/source/quickerNES/meson.build @@ -28,13 +28,10 @@ quickerNESSrc = quickerNESAPUSrc + quickerNESPPUSrc + [ 'core/cpu.cpp' ] -# Getting page alignment option -CPUFunctionAlignment = get_option('CPUFunctionAlignment') - # quickerNES Core Configuration quickerNESDependency = declare_dependency( - compile_args : [ '-D_QUICKERNES_CPU_FUNCTION_ALIGNMENT="' + CPUFunctionAlignment.to_string() + '"'], + compile_args : [ ], include_directories : include_directories(['.']), sources : [ quickerNESSrc ] ) \ No newline at end of file