head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2026.11.08.16.42.08; author ryoon; state Exp; branches; next ; commitid jdIJd7JCw1Xd5G2H; desc @@ 1.1 log @emulators/m88m: import m88m-1.2.4 M88M is a modern, cross-platform port of the classic PC-8801 emulator M88, originally developed by cisc. While the original M88 was tightly coupled with the Win32 API and DirectX, M88M leverages raylib and raygui for its frontend, making it natively compatible with macOS (Intel/Apple Silicon), Linux, FreeBSD, Haiku, and Windows via a single CMake-based build system. @ text @$NetBSD$ * Do not download binaries. Build from source code for all platforms. --- CMakeLists.txt.orig 2026-09-13 02:20:40.000000000 +0000 +++ CMakeLists.txt @@@@ -111,62 +111,9 @@@@ target_link_libraries(m88core PUBLIC ZLIB::ZLIB) target_link_libraries(m88core PUBLIC ZLIB::ZLIB) # --- raylib ------------------------------------------------------------ -include(FetchContent) -# Automatically select binary URL based on platform/arch -if(TARGET raylib) message(STATUS "Using system raylib") -elseif(APPLE) - # raylib 6.0 release uses a universal binary for macOS - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_macos.tar.gz") -elseif(WIN32) - if(CMAKE_GENERATOR_PLATFORM MATCHES "ARM64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_winarm64_msvc16.zip") - elseif(CMAKE_GENERATOR_PLATFORM MATCHES "Win32" OR CMAKE_SIZEOF_VOID_P EQUAL 4) - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_win32_msvc16.zip") - elseif(MSVC) - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_win64_msvc16.zip") - else() - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_win64_mingw-w64.zip") - endif() -elseif(M88M_IS_LINUX AND NOT M88M_RASPIOS) - # The Raspberry Pi builds (M88M_RASPIOS) must not use these prebuilt - # binaries: they are compiled for desktop OpenGL (wrong for the Pi's GPU) - # and against a newer glibc than Raspberry Pi OS ships. Leaving - # RAYLIB_BINARY_URL unset makes the block below build raylib from source - # with GLES 2.0 instead. - if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64") - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_linux_amd64.tar.gz") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64") - set(RAYLIB_BINARY_URL "https://github.com/raysan5/raylib/releases/download/6.0/raylib-6.0_linux_arm64.tar.gz") - endif() -endif() -if(TARGET raylib) - # System raylib was found above. -elseif(RAYLIB_BINARY_URL) - message(STATUS "Downloading raylib binary: ${RAYLIB_BINARY_URL}") - FetchContent_Declare( - raylib_bin - URL ${RAYLIB_BINARY_URL} - DOWNLOAD_EXTRACT_TIMESTAMP TRUE - ) - FetchContent_MakeAvailable(raylib_bin) - - add_library(raylib STATIC IMPORTED GLOBAL) - if(MSVC) - set_target_properties(raylib PROPERTIES - IMPORTED_LOCATION "${raylib_bin_SOURCE_DIR}/lib/raylib.lib" - INTERFACE_INCLUDE_DIRECTORIES "${raylib_bin_SOURCE_DIR}/include" - ) - else() - set_target_properties(raylib PROPERTIES - IMPORTED_LOCATION "${raylib_bin_SOURCE_DIR}/lib/libraylib.a" - INTERFACE_INCLUDE_DIRECTORIES "${raylib_bin_SOURCE_DIR}/include" - ) - endif() -else() - message(STATUS "No pre-compiled binary for this platform. Falling back to source build.") set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(BUILD_GAMES OFF CACHE BOOL "" FORCE) set(SUPPORT_MODULE_RAUDIO ON CACHE BOOL "" FORCE) @@@@ -190,42 +137,15 @@@@ else() set(OPENGL_VERSION "ES 2.0" CACHE STRING "" FORCE) endif() - FetchContent_Declare( - raylib - GIT_REPOSITORY https://github.com/raysan5/raylib.git - GIT_TAG 6.0 - GIT_SHALLOW TRUE - ) - FetchContent_MakeAvailable(raylib) if(M88M_IS_HAIKU) target_compile_options(raylib PRIVATE -include "${CMAKE_CURRENT_SOURCE_DIR}/src/raylib/haiku_raylib_compat.h" ) endif() -endif() -include(FetchContent) -FetchContent_Declare( - raygui - GIT_REPOSITORY https://github.com/raysan5/raygui.git - GIT_TAG 5.0 - GIT_SHALLOW TRUE -) -FetchContent_MakeAvailable(raygui) - # raygui ships a single header; expose its include dir as an interface lib. add_library(raygui INTERFACE) target_include_directories(raygui INTERFACE ${raygui_SOURCE_DIR}/src) - -# --- nativefiledialog-extended ----------------------------------------- -if(NOT M88M_IS_HAIKU) - FetchContent_Declare( - nfd - GIT_REPOSITORY https://github.com/btzy/nativefiledialog-extended.git - GIT_TAG v1.3.0 - ) - FetchContent_MakeAvailable(nfd) -endif() # --- raylib frontend executable ---------------------------------------- file(GLOB RAYLIB_FRONT_SRC src/raylib/*.cpp) @