diff --git a/README.md b/README.md index 246bffa..43d4678 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ Changes + Forced alignment at the start of a page to prevent crossing cache line boundaries + Simplifying instruction decode - Minimize compiled code size to reduce pressure on L1i cache -- Sound is no longer emulated during skip frames Credits ========= diff --git a/meson.build b/meson.build index b3772bc..3a5893e 100644 --- a/meson.build +++ b/meson.build @@ -5,8 +5,7 @@ project('quickerNES','c','cpp', ) # Getting page alignment -getConfCommand = run_command('getconf', 'PAGESIZE', check: true) -pageSize = getConfCommand.stdout().strip() +pageSize = get_option('CPUFunctionAlignment') # quickerNES Core sources @@ -45,7 +44,7 @@ quickerNESCoreSrc = [ # quickerNES Core Configuration quickerNESCoreDependency = declare_dependency( - compile_args : [ '-Wfatal-errors', '-Wall', '-Werror', '-Wno-multichar', '-D_PAGE_SIZE="' + pageSize + '"'], + compile_args : [ '-Wfatal-errors', '-Wall', '-Werror', '-Wno-multichar', '-D_PAGE_SIZE="' + pageSize.to_string() + '"'], include_directories : include_directories(['source', 'source/core', 'extern']), sources : [ quickerNESCoreSrc, 'extern/metrohash128/metrohash128.cpp' ] ) diff --git a/meson_options.txt b/meson_options.txt index b2dff03..86af9d9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,4 +3,14 @@ option('buildTests', value : false, description : 'Build test suite', yield: true +) + +option('CPUFunctionAlignment', + type : 'integer', + min : 1, + value : 4096, + description : '''Indicates the alignment for the main emulator CPU function. + This is a large function that may cross page boundaries, which impacts performance. + We recommend setting this value for the architecture own page size. + This requires the GNU compiler to work.''' ) \ No newline at end of file