dosbox-staging/dosbox-staging

GitHub: dosbox-staging/dosbox-staging

DOSBox Staging 是一个现代化 DOS 模拟器,用于运行旧版 DOS 程序和游戏。

Stars: 1708 | Forks: 218

# me, so I'll output "DOSBox Staging" as is, but in Chinese, it's common to use the English name. However, the output should be in Chinese translation. I need to decide. ![GPL-2.0-or-later](https://img.shields.io/badge/license-GPL--2.0--or--later-blue) [![Chat](https://img.shields.io/discord/514567252864008206?color=%237289da&logo=discord&logoColor=white&label=discord)][discord] **DOSBox Staging** 是 DOSBox 的一个现代化延续版本,具备先进的功能并采用当前的开发实践。 它(基本上)是旧版 DOSBox 的直接替代品——您现有的配置将继续有效,并且您将能够使用许多高级功能。 有关项目范围的详细描述,请参阅我们网站上的[关于](https://www.dosbox-staging.org/about/)页面。 ## 项目网站 https://www.dosbox-staging.org/ 首次用户和从其他 DOSBox 变体迁移过来的用户,应首先阅读[入门指南](https://www.dosbox-staging.org/getting-started/)。 ## 构建状态 [![Windows (VisualStudio) 构建状态](https://img.shields.io/github/actions/workflow/status/dosbox-staging/dosbox-staging/windows-msvc.yml?label=Windows%20%28Visual%20Studio%29)][build-win-msvc-ci] [![macOS 构建状态](https://img.shields.io/github/actions/workflow/status/dosbox-staging/dosbox-staging/macos.yml?label=macOS%20%28x86_64%2C%20arm64%29)][build-mac-ci] [![Linux x86\_64 构建状态](https://img.shields.io/github/actions/workflow/status/dosbox-staging/dosbox-staging/linux.yml?label=Linux%20%28x86_64%29)][build-lin1-ci] ## 稳定版本构建 普通用户应使用我们在项目网站上提供的稳定版本构建: - [Windows](https://www.dosbox-staging.org/releases/windows/) - [macOS](https://www.dosbox-staging.org/releases/macos/) - [Linux](https://www.dosbox-staging.org/releases/linux/) ## 开发版本构建 开发版本在每次合并到 `main` 分支的提交时自动创建。您需要登录 GitHub 才能下载开发版本构建。 [开发版本构建] ## 开发者主要功能 | **功能** | **状态** | | -------------------------- | ----------------------------------- | | **版本控制** | Git | | **编程语言** | C++23 | | **日志记录** | Loguru for C++[3] | | **构建系统** | CMake + Ninja 或 Visual Studio 2022 | | **依赖管理器** | vcpkg | | **CI/CD** | 是 | | **静态分析** | 是[1],[2] | | **动态分析** | 是 | | **clang-format** | 是 | | **[开发版本构建]** | 是 | | **单元测试** | 是[4] | ## 源代码分析工具 - [PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) — C++ 静态分析器 - [Pylint](https://pypi.org/project/pylint/) — Python 静态分析器 - [markdownlint](https://github.com/DavidAnson/markdownlint) — Markdown 的风格检查器和代码检查工具 - [ShellCheck](https://www.shellcheck.net/) — Shell 脚本分析工具 ## 依赖项 DOSBox Staging 有以下库依赖: | 依赖项 | 提供功能 | vcpkg 包名 | vcpkg 版本 | 可选? | | --------------------------------------------------------- | ----------------------------------------------- | ----------------- | ----------------- | ------------------- | | [FluidSynth](https://www.fluidsynth.org/) | 通用 MIDI 播放 | fluidsynth | 2.5.1 | **否** :red_circle: | | [GoogleTest](https://github.com/google/googletest) | 单元测试(开发用) | gtest | 1.70.0#2 | 是 :green_circle: | | [IIR](https://github.com/berndporr/iir1) | 音频滤波 | iir1 | 1.10.0 | **否** :red_circle: | | [libmt32emu](https://github.com/munt/munt) | Roland MT-32 和 CM-32L 模拟 | libmt32emu | 2.7.1 | 是 :green_circle: | | [libpng](http://www.libpng.org/pub/png/libpng.html) | 屏幕截图的 PNG 编码 | libpng | 1.6.53 | **否** :red_circle: | | [libslirp](https://gitlab.freedesktop.org/slirp/libslirp) | 通用 TCP-IP 模拟器 | libslirp | 4.9.0 | 是 :green_circle: | | [Opus File](https://opus-codec.org/) | Opus 编码音轨的 CD 音频播放 | opusfile | 0.12+20221121#1 | **否** :red_circle: | | [SDL 2](https://github.com/libsdl-org/SDL) | 跨平台的视频、音频和事件 API | sdl2 | 2.32.10 (overlay) | **否** :red_circle: | | [SDL_image 2](https://github.com/libsdl-org/SDL_image) | 多种常见格式的图像解码 | sdl2-image | 2.8.8#2 | **否** :red_circle: | | [Asio](https://think-async.com/Asio/) | 用于模拟串口和 IPX 的网络 API | asio | 1.30.2 | **否** :red_circle: | | [SpeexDSP](https://github.com/xiph/speexdsp) | 音频重采样 | speexdsp | 1.2.1#1 | **否** :red_circle: | | [zlib-ng](https://github.com/zlib-ng/zlib-ng) | ZMBV 视频捕获 | zlib-ng | 2.3.2 | 是¹ :green_circle: | _¹ 您也可以使用原版 zlib。_ ### 动态加载的依赖项 **Slirp** 被单独构建为一个动态库(通过 vcpkg),并在运行时按需加载(如果可用)。更多详情请参考 [dosbox-staging-ext](https://github.com/dosbox-staging/dosbox-staging-ext) 项目。 要检查我们的稳定版和开发版构建包中包含的此依赖项版本,请查看 [dosbox-staging-ext](https://github.com/dosbox-staging/dosbox-staging-ext) 项目的 [发布包](https://github.com/dosbox-staging/dosbox-staging-ext/releases) 的注释。 关于可选的 **Nuked SC-55 CLAP** 音频插件,请查看 [该插件的 GitHub 仓库](https://github.com/johnnovak/Nuked-SC55-CLAP/)(请注意 Nuked SC-55 CLAP *并非* DOSBox Staging 的项目)。 ## 获取源代码 克隆仓库(一次性步骤): ``` git clone https://github.com/dosbox-staging/dosbox-staging.git ``` ## 构建说明 请参考平台相关的构建说明: - [Windows](docs/build-windows.md) - [macOS](docs/build-macos.md) - [Linux](docs/build-linux.md) ### Looking at the last one: "macOS" is listed twice? No, the list has 8 items, and "macOS" appears as item 2 and item 8. In item 2, it's "Linux, macOS", and item 8 is "macOS". So for "macOS", it's an operating system name, so I should keep it in English. 为您的操作系统安装相应的构建依赖: ``` # Similarly, for "Fedora", "Debian", "Ubuntu", etc., these are proper nouns for distributions, so keep in English. sudo dnf install ccache gcc-c++ meson alsa-lib-devel libatomic libpng-devel \ SDL2-devel asio-devel opusfile-devel \ fluidsynth-devel iir1-devel mt32emu-devel libslirp-devel \ speexdsp-devel libXi-devel zlib-ng-devel ``` ``` # Now, for the translation: I need to translate the entire heading into Simplified Chinese, keeping the proper nouns in English. sudo apt install ccache build-essential libasound2-dev libatomic1 libpng-dev \ libsdl2-dev libasio-dev libopusfile-dev \ libfluidsynth-dev libslirp-dev libspeexdsp-dev libxi-dev # Let me try: sudo apt install meson ``` ``` # 1. DOSBox Staging – This could be translated as "DOSBox Staging" if it's a name, but perhaps "DOSBox 分段" or something. But "Staging" in software might refer to staging environment or a specific version. I think it's best to keep it as "DOSBox Staging" in English, as per the instruction. sudo pacman -S ccache gcc meson alsa-lib libpng sdl2 sdl2_net \ asio opusfile fluidsynth libslirp speexdsp libxi pkgconf ``` ``` # But the instruction says "translate each of the following headings", so I need to provide a Chinese version. For example, in the sample, 'API Reference' is translated to 'API 参考'. So for "DOSBox Staging", if I consider "Staging" as a descriptive term, I might translate it to "DOSBox 暂存" or similar, but that might not be accurate. I recall that "DOSBox Staging" is a specific project, so it should be kept as is. sudo zypper install ccache gcc gcc-c++ meson alsa-devel libatomic1 libpng-devel \ libSDL2-devel asio-devel \ opusfile-devel fluidsynth-devel libmt32emu-devel libslirp-devel \ speexdsp libXi-devel ``` ``` # To resolve this, I'll assume that for proper nouns and tool names, I keep them in English, and for common words, I translate them. xcode-select --install brew install cmake ccache meson libpng sdl2 asio opusfile \ fluid-synth libslirp pkg-config python3 speexdsp ``` ### 构建并保持与最新源码同步 1. 切换到 main 分支: # 提交或暂存任何个人的代码更改 git checkout main -f 2. 拉取最新更新。每次想要新构建时都需要执行此操作: git pull 3. 设置构建环境。在克隆仓库或清理工作目录后,这是一次性步骤: meson setup build 上述命令启用了 DOSBox Staging 的所有功能特性。如果您想查看 Meson 的所有设置选项,请运行 `meson configure`。 4. 编译源代码。每次想要新构建时都需要执行此操作: meson compile -C build 您的二进制文件位于:`build/dosbox` 该二进制文件依赖于相对于它的本地资源,因此我们建议从您的 `PATH` 目录(例如 `~/.local/bin/`)创建指向该二进制文件的符号链接。 ### Windows – Visual Studio (2022 或更高版本) 首先,您需要设置 [vcpkg] 以安装构建依赖项。在 vcpkg 引导完成后,打开 PowerShell 并运行: ``` PS:\> .\vcpkg integrate install ``` 此步骤将确保 MSVC 可以使用 vcpkg 来构建、查找和链接所有依赖项。 启动 Visual Studio 并打开文件 `vs\dosbox.sln`。请确保解决方案平台已选择为 `x64`。使用 **Ctrl+Shift+B** 来构建所有项目。 请注意,首次构建某个配置时,依赖项将自动构建并存储在 `vcpkg_installed` 目录中。这可能需要相当长的时间。 ## 导入的分支、社区补丁、旧分支 上游提交被及时导入到此仓库,请参见分支 [`svn/trunk`]。 - [`svn/*`] — 来自 SVN 的分支 - [`forks/*`] — 各种已废弃的 DOSBox 分支的代码 - [`vogons/*`] — 发布在 Vogons 论坛的社区补丁 与模式 `svn/*` 匹配的 Git 标签指向创建时 SVN "标签"路径所引用的提交。 此外,我们以 [Git notes][git-notes] 的形式为提交附加一些可选的元数据。要获取它们,请运行: ``` git fetch origin "refs/notes/*:refs/notes/*" ``` ## 网站与文档 在修改网站或文档之前,请先参阅 [文档指南](DOCUMENTATION.md)。
标签:Bash脚本, C++23, CMake, DOSBox续作, DOS模拟, drop-in替换, Git, Loguru, Ninja, PC模拟器, SOC Prime, vcpkg, Visual Studio 2022, 依赖管理, 兼容性, 包管理, 复古游戏, 安全可观测性, 开发实践, 开发工具, 开源框架, 持续集成, 操作系统模拟, 日志系统, 构建系统, 游戏模拟, 版本控制, 现代开发, 软件模拟, 高级特性