00cc9309cb
de6e324bdseparate emu thread10d3daf86Roms List improvements95d202f37Let's make the rom list process on a separate thread so the emulator doesnt take ages to load.fc306967fWow the ROM Header was just completely busted. Game list view works nowbad1691eefuck this shit2b59e5f46game list in progressd26417b83remappable inputs in progressac4af8106inpute72abc240update readme430139dc9Qt6 frontend3080d4d45Fix this small bug too08cd13b85Cop0 unused functions do not actually pose a threat (as per manual). They don't do anything, so shall we.61bb4fb44make idle loop detection a little more specific with where the load goesb037de4c3SAZDFsdff12e81e73eneed to figure out why n64-systemtest loops indefinitely at some address that appears to be valid (i think it's me not invalidating the cache properly)204f0e13bidle skipping seems to work!cb8bb634asdkfjlasdf58e5c89c1Fix compilation issue on my machine (no idea)24fb2898eattempting more serious idle skipping214719577Place rsp.Step inside cached interpreter. Gains about 3 more fpsbb97dcc23mmmmm920b77d38wjkhasdfjhkasdf430ccdab4it's a start...4f42a673aCached interpreter plays Mario 64. Start looking into RSP as wellc9a030787idle skipping works!5fbda03cenew idea366637abaIdle skipping... maybe?609fa2fb0Cache instructions implemented but broken lmao. Commented out for nowe140a6d12- Stop using inheritance for CPU, instead use composition. - Introduce KAIZEN_JIT_ENABLED optional define instead of relying on __aarch64__ and the like. - More cache work68e613057prep cache impl811b4d809fix clang formatfda755f7didkd5024ebbfsmall MI refactor in preparation of (eventually) implementing the RDRAM interface properly694b45341Merge commit '206dcdedf195fb320913584180edb12c7731e396' as 'external/SDL'206dcdedfSquashed 'external/SDL/' content from commit 4d17b99d0a4d16e1cb4need to update sdl848b19920Fix compilation errordb61b5299Merge commit 'e94a94559f28e49678fbcf72199a5258137b0fe9' as 'external/imgui'e94a94559Squashed 'external/imgui/' content from commit 02e9b8cac52edb3757need to update imguic1a705e86Emulate weird JALR behaviour4b4c32f4bFix exception for "unusable COP1" in 4 instructions i missed accidentally (again)df5828142Bug putting 0s in the log everywheref8b580048Make isviewer a sink to file8241e9735Fix exception for "unusable COP1" in 4 instructions i missed accidentallyb29715f20small changesd9a620bc1make use of my new small utility library0d1aa938eAdd 'external/ircolib/' from commit 'ce3cd726c8df8388d554abf8bb55d55020eb4450'e64eb40b3Fuck git git-subtree-dir: external/ircolib git-subtree-split:de6e324bde
248 lines
8.5 KiB
CMake
248 lines
8.5 KiB
CMake
macro(SDL_DetectCompiler)
|
|
set(USE_CLANG FALSE)
|
|
set(USE_GCC FALSE)
|
|
set(USE_INTELCC FALSE)
|
|
set(USE_QCC FALSE)
|
|
set(USE_TCC FALSE)
|
|
if(CMAKE_C_COMPILER_ID MATCHES "Clang|IntelLLVM")
|
|
set(USE_CLANG TRUE)
|
|
# Visual Studio 2019 v16.2 added support for Clang/LLVM.
|
|
# Check if a Visual Studio project is being generated with the Clang toolset.
|
|
if(MSVC)
|
|
set(MSVC_CLANG TRUE)
|
|
endif()
|
|
elseif(CMAKE_COMPILER_IS_GNUCC)
|
|
set(USE_GCC TRUE)
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
|
|
set(USE_INTELCC TRUE)
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "QCC")
|
|
set(USE_QCC TRUE)
|
|
elseif(CMAKE_C_COMPILER_ID MATCHES "TinyCC")
|
|
set(USE_TCC TRUE)
|
|
endif()
|
|
endmacro()
|
|
|
|
function(sdl_target_compile_option_all_languages TARGET OPTION)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:${OPTION}>")
|
|
if(CMAKE_OBJC_COMPILER)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:OBJC>:${OPTION}>")
|
|
endif()
|
|
endfunction()
|
|
|
|
macro(cached_check_c_compiler_flag _arg _var)
|
|
if(NOT DEFINED "${_var}")
|
|
check_c_compiler_flag("${_arg}" "${_var}" ${ARGN})
|
|
endif()
|
|
endmacro()
|
|
|
|
function(SDL_AddCommonCompilerFlags TARGET)
|
|
option(SDL_WERROR "Enable -Werror" OFF)
|
|
|
|
get_property(TARGET_TYPE TARGET "${TARGET}" PROPERTY TYPE)
|
|
if(MSVC)
|
|
cmake_push_check_state()
|
|
cached_check_c_compiler_flag("/W3" COMPILER_SUPPORTS_W3)
|
|
if(COMPILER_SUPPORTS_W3)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/W3>")
|
|
endif()
|
|
cmake_pop_check_state()
|
|
endif()
|
|
|
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC OR USE_TCC)
|
|
if(MINGW)
|
|
# See if GCC's -gdwarf-4 is supported
|
|
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101377 for why this is needed on Windows
|
|
cmake_push_check_state()
|
|
cached_check_c_compiler_flag("-gdwarf-4" HAVE_GDWARF_4)
|
|
if(HAVE_GDWARF_4)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:-gdwarf-4>")
|
|
endif()
|
|
cmake_pop_check_state()
|
|
endif()
|
|
|
|
# Check for -Wall first, so later things can override pieces of it.
|
|
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
|
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
|
cached_check_c_compiler_flag(-Wall HAVE_GCC_WALL)
|
|
if(MSVC_CLANG)
|
|
target_compile_options(${TARGET} PRIVATE "/W3")
|
|
elseif(HAVE_GCC_WALL)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wall")
|
|
if(HAIKU)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wno-multichar")
|
|
endif()
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wundef HAVE_GCC_WUNDEF)
|
|
if(HAVE_GCC_WUNDEF)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wundef")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wfloat-conversion HAVE_GCC_WFLOAT_CONVERSION)
|
|
if(HAVE_GCC_WFLOAT_CONVERSION)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wfloat-conversion")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-fno-strict-aliasing HAVE_GCC_NO_STRICT_ALIASING)
|
|
if(HAVE_GCC_NO_STRICT_ALIASING)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-fno-strict-aliasing")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wdocumentation HAVE_GCC_WDOCUMENTATION)
|
|
if(HAVE_GCC_WDOCUMENTATION)
|
|
if(SDL_WERROR)
|
|
cached_check_c_compiler_flag(-Werror=documentation HAVE_GCC_WERROR_DOCUMENTATION)
|
|
if(HAVE_GCC_WERROR_DOCUMENTATION)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Werror=documentation")
|
|
endif()
|
|
endif()
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wdocumentation")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wdocumentation-unknown-command HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
|
|
if(HAVE_GCC_WDOCUMENTATION_UNKNOWN_COMMAND)
|
|
if(SDL_WERROR)
|
|
cached_check_c_compiler_flag(-Werror=documentation-unknown-command HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
|
|
if(HAVE_GCC_WERROR_DOCUMENTATION_UNKNOWN_COMMAND)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Werror=documentation-unknown-command")
|
|
endif()
|
|
endif()
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wdocumentation-unknown-command")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-fcomment-block-commands=threadsafety HAVE_GCC_COMMENT_BLOCK_COMMANDS)
|
|
if(HAVE_GCC_COMMENT_BLOCK_COMMANDS)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-fcomment-block-commands=threadsafety")
|
|
else()
|
|
cached_check_c_compiler_flag(/clang:-fcomment-block-commands=threadsafety HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
|
|
if(HAVE_CLANG_COMMENT_BLOCK_COMMANDS)
|
|
sdl_target_compile_option_all_languages(${TARGET} "/clang:-fcomment-block-commands=threadsafety")
|
|
endif()
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wshadow HAVE_GCC_WSHADOW)
|
|
if(HAVE_GCC_WSHADOW)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wshadow")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wunused-local-typedefs HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
|
if(HAVE_GCC_WUNUSED_LOCAL_TYPEDEFS)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wno-unused-local-typedefs")
|
|
endif()
|
|
|
|
cached_check_c_compiler_flag(-Wimplicit-fallthrough HAVE_GCC_WIMPLICIT_FALLTHROUGH)
|
|
if(HAVE_GCC_WIMPLICIT_FALLTHROUGH)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Wimplicit-fallthrough")
|
|
endif()
|
|
endif()
|
|
|
|
if(SDL_WERROR)
|
|
if(MSVC)
|
|
cached_check_c_compiler_flag(/WX HAVE_WX)
|
|
if(HAVE_WX)
|
|
target_compile_options(${TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:/WX>")
|
|
endif()
|
|
elseif(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QNX)
|
|
cached_check_c_compiler_flag(-Werror HAVE_WERROR)
|
|
if(HAVE_WERROR)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-Werror")
|
|
endif()
|
|
|
|
if(TARGET_TYPE STREQUAL "SHARED_LIBRARY")
|
|
check_linker_flag(C "-Wl,--no-undefined-version" LINKER_SUPPORTS_NO_UNDEFINED_VERSION)
|
|
if(LINKER_SUPPORTS_NO_UNDEFINED_VERSION)
|
|
target_link_options(${TARGET} PRIVATE "-Wl,--no-undefined-version")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
if(NOT (APPLE OR MSVC))
|
|
if(SDL_WERROR)
|
|
get_property(target_type TARGET ${TARGET} PROPERTY TYPE)
|
|
if(target_type MATCHES "SHARED_LIBRARY|MODULE_LIBRARY")
|
|
check_linker_flag(C "-Wl,-fatal-warnings" LINKER_SUPPORTS_WL_FATAL_WARNINGS)
|
|
if(LINKER_SUPPORTS_WL_FATAL_WARNINGS)
|
|
target_link_options(${TARGET} PRIVATE "-Wl,-fatal-warnings")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
if(USE_CLANG)
|
|
cached_check_c_compiler_flag("-fcolor-diagnostics" COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS)
|
|
if(COMPILER_SUPPORTS_FCOLOR_DIAGNOSTICS)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-fcolor-diagnostics")
|
|
endif()
|
|
else()
|
|
cached_check_c_compiler_flag("-fdiagnostics-color=always" COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS)
|
|
if(COMPILER_SUPPORTS_FDIAGNOSTICS_COLOR_ALWAYS)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-fdiagnostics-color=always")
|
|
endif()
|
|
endif()
|
|
|
|
if(USE_TCC)
|
|
sdl_target_compile_option_all_languages(${TARGET} "-DSTBI_NO_SIMD")
|
|
endif()
|
|
endfunction()
|
|
|
|
function(check_x86_source_compiles BODY VAR)
|
|
if(ARGN)
|
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
|
endif()
|
|
if(APPLE_MULTIARCH AND (SDL_CPU_X86 OR SDL_CPU_X64))
|
|
set(test_conditional 1)
|
|
else()
|
|
set(test_conditional 0)
|
|
endif()
|
|
check_c_source_compiles("
|
|
#if ${test_conditional}
|
|
# if defined(__i386__) || defined(__x86_64__)
|
|
# define test_enabled 1
|
|
# else
|
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
|
# endif
|
|
#else /* test normally */
|
|
# define test_enabled 1
|
|
#endif
|
|
#if test_enabled
|
|
${BODY}
|
|
#else
|
|
int main(int argc, char *argv[]) {
|
|
(void)argc;
|
|
(void)argv;
|
|
return 0;
|
|
}
|
|
#endif" ${VAR})
|
|
endfunction()
|
|
|
|
function(check_arm_source_compiles BODY VAR)
|
|
if(ARGN)
|
|
message(FATAL_ERROR "Unknown arguments: ${ARGN}")
|
|
endif()
|
|
if(APPLE_MULTIARCH AND (SDL_CPU_ARM32 OR SDL_CPU_ARM64))
|
|
set(test_conditional 1)
|
|
else()
|
|
set(test_conditional 0)
|
|
endif()
|
|
check_c_source_compiles("
|
|
#if ${test_conditional}
|
|
# if defined(__arm__) || defined(__aarch64__)
|
|
# define test_enabled 1
|
|
# else
|
|
# define test_enabled 0 /* feign success in Apple multi-arch configs */
|
|
# endif
|
|
#else /* test normally */
|
|
# define test_enabled 1
|
|
#endif
|
|
#if test_enabled
|
|
${BODY}
|
|
#else
|
|
int main(int argc, char *argv[]) {
|
|
(void)argc;
|
|
(void)argv;
|
|
return 0;
|
|
}
|
|
#endif" ${VAR})
|
|
endfunction()
|